@inspectr/mcplab 1.31.0 → 1.32.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-CBxKXA35.js +267 -0
- package/dist/app/index.html +1 -1
- package/dist/app-server/evaluation-result-projection.d.ts.map +1 -1
- package/dist/app-server/evaluation-result-projection.js +5 -0
- package/dist/app-server/evaluation-result-projection.js.map +1 -1
- package/dist/app-server/inspectr-routes.d.ts +14 -0
- package/dist/app-server/inspectr-routes.d.ts.map +1 -0
- package/dist/app-server/inspectr-routes.js +35 -0
- package/dist/app-server/inspectr-routes.js.map +1 -0
- package/dist/app-server/inspectr-session-manager.d.ts +33 -34
- package/dist/app-server/inspectr-session-manager.d.ts.map +1 -1
- package/dist/app-server/inspectr-session-manager.js +70 -23
- package/dist/app-server/inspectr-session-manager.js.map +1 -1
- package/dist/app-server/router.d.ts.map +1 -1
- package/dist/app-server/router.js +32 -0
- package/dist/app-server/router.js.map +1 -1
- package/dist/app-server/run-queue-domain.d.ts +2 -0
- package/dist/app-server/run-queue-domain.d.ts.map +1 -1
- package/dist/app-server/run-queue-domain.js +2 -1
- package/dist/app-server/run-queue-domain.js.map +1 -1
- package/dist/app-server/run-queue-executor.d.ts +2 -0
- package/dist/app-server/run-queue-executor.d.ts.map +1 -1
- package/dist/app-server/run-queue-executor.js +67 -0
- package/dist/app-server/run-queue-executor.js.map +1 -1
- package/dist/app-server/runs-routes.d.ts +1 -0
- package/dist/app-server/runs-routes.d.ts.map +1 -1
- package/dist/app-server/runs-routes.js +1 -1
- package/dist/app-server/runs-routes.js.map +1 -1
- package/dist/cli.js +5 -0
- package/dist/cli.js.map +1 -1
- package/package.json +7 -4
- package/dist/app/assets/index-Cwogc_kk.js +0 -267
|
@@ -1,267 +0,0 @@
|
|
|
1
|
-
var e=Object.create,t=Object.defineProperty,n=Object.getOwnPropertyDescriptor,r=Object.getOwnPropertyNames,i=Object.getPrototypeOf,a=Object.prototype.hasOwnProperty,o=(e,t)=>()=>(t||(e((t={exports:{}}).exports,t),e=null),t.exports),s=(e,n)=>{let r={};for(var i in e)t(r,i,{get:e[i],enumerable:!0});return n||t(r,Symbol.toStringTag,{value:`Module`}),r},c=(e,i,o,s)=>{if(i&&typeof i==`object`||typeof i==`function`)for(var c=r(i),l=0,u=c.length,d;l<u;l++)d=c[l],!a.call(e,d)&&d!==o&&t(e,d,{get:(e=>i[e]).bind(null,d),enumerable:!(s=n(i,d))||s.enumerable});return e},l=(n,r,o)=>(o=n==null?{}:e(i(n)),c(r||!n||!n.__esModule||!a.call(n,`default`)?t(o,`default`,{value:n,enumerable:!0}):o,n));(function(){let e=document.createElement(`link`).relList;if(e&&e.supports&&e.supports(`modulepreload`))return;for(let e of document.querySelectorAll(`link[rel="modulepreload"]`))n(e);new MutationObserver(e=>{for(let t of e)if(t.type===`childList`)for(let e of t.addedNodes)e.tagName===`LINK`&&e.rel===`modulepreload`&&n(e)}).observe(document,{childList:!0,subtree:!0});function t(e){let t={};return e.integrity&&(t.integrity=e.integrity),e.referrerPolicy&&(t.referrerPolicy=e.referrerPolicy),t.credentials=e.crossOrigin===`use-credentials`?`include`:e.crossOrigin===`anonymous`?`omit`:`same-origin`,t}function n(e){if(e.ep)return;e.ep=!0;let n=t(e);fetch(e.href,n)}})();var u=o((e=>{var t=Symbol.for(`react.element`),n=Symbol.for(`react.portal`),r=Symbol.for(`react.fragment`),i=Symbol.for(`react.strict_mode`),a=Symbol.for(`react.profiler`),o=Symbol.for(`react.provider`),s=Symbol.for(`react.context`),c=Symbol.for(`react.forward_ref`),l=Symbol.for(`react.suspense`),u=Symbol.for(`react.memo`),d=Symbol.for(`react.lazy`),f=Symbol.iterator;function p(e){return typeof e!=`object`||!e?null:(e=f&&e[f]||e[`@@iterator`],typeof e==`function`?e:null)}var m={isMounted:function(){return!1},enqueueForceUpdate:function(){},enqueueReplaceState:function(){},enqueueSetState:function(){}},h=Object.assign,g={};function _(e,t,n){this.props=e,this.context=t,this.refs=g,this.updater=n||m}_.prototype.isReactComponent={},_.prototype.setState=function(e,t){if(typeof e!=`object`&&typeof e!=`function`&&e!=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,e,t,`setState`)},_.prototype.forceUpdate=function(e){this.updater.enqueueForceUpdate(this,e,`forceUpdate`)};function v(){}v.prototype=_.prototype;function y(e,t,n){this.props=e,this.context=t,this.refs=g,this.updater=n||m}var b=y.prototype=new v;b.constructor=y,h(b,_.prototype),b.isPureReactComponent=!0;var x=Array.isArray,S=Object.prototype.hasOwnProperty,C={current:null},w={key:!0,ref:!0,__self:!0,__source:!0};function T(e,n,r){var i,a={},o=null,s=null;if(n!=null)for(i in n.ref!==void 0&&(s=n.ref),n.key!==void 0&&(o=``+n.key),n)S.call(n,i)&&!w.hasOwnProperty(i)&&(a[i]=n[i]);var c=arguments.length-2;if(c===1)a.children=r;else if(1<c){for(var l=Array(c),u=0;u<c;u++)l[u]=arguments[u+2];a.children=l}if(e&&e.defaultProps)for(i in c=e.defaultProps,c)a[i]===void 0&&(a[i]=c[i]);return{$$typeof:t,type:e,key:o,ref:s,props:a,_owner:C.current}}function E(e,n){return{$$typeof:t,type:e.type,key:n,ref:e.ref,props:e.props,_owner:e._owner}}function D(e){return typeof e==`object`&&!!e&&e.$$typeof===t}function O(e){var t={"=":`=0`,":":`=2`};return`$`+e.replace(/[=:]/g,function(e){return t[e]})}var k=/\/+/g;function A(e,t){return typeof e==`object`&&e&&e.key!=null?O(``+e.key):t.toString(36)}function j(e,r,i,a,o){var s=typeof e;(s===`undefined`||s===`boolean`)&&(e=null);var c=!1;if(e===null)c=!0;else switch(s){case`string`:case`number`:c=!0;break;case`object`:switch(e.$$typeof){case t:case n:c=!0}}if(c)return c=e,o=o(c),e=a===``?`.`+A(c,0):a,x(o)?(i=``,e!=null&&(i=e.replace(k,`$&/`)+`/`),j(o,r,i,``,function(e){return e})):o!=null&&(D(o)&&(o=E(o,i+(!o.key||c&&c.key===o.key?``:(``+o.key).replace(k,`$&/`)+`/`)+e)),r.push(o)),1;if(c=0,a=a===``?`.`:a+`:`,x(e))for(var l=0;l<e.length;l++){s=e[l];var u=a+A(s,l);c+=j(s,r,i,u,o)}else if(u=p(e),typeof u==`function`)for(e=u.call(e),l=0;!(s=e.next()).done;)s=s.value,u=a+A(s,l++),c+=j(s,r,i,u,o);else if(s===`object`)throw r=String(e),Error(`Objects are not valid as a React child (found: `+(r===`[object Object]`?`object with keys {`+Object.keys(e).join(`, `)+`}`:r)+`). If you meant to render a collection of children, use an array instead.`);return c}function M(e,t,n){if(e==null)return e;var r=[],i=0;return j(e,r,``,``,function(e){return t.call(n,e,i++)}),r}function N(e){if(e._status===-1){var t=e._result;t=t(),t.then(function(t){(e._status===0||e._status===-1)&&(e._status=1,e._result=t)},function(t){(e._status===0||e._status===-1)&&(e._status=2,e._result=t)}),e._status===-1&&(e._status=0,e._result=t)}if(e._status===1)return e._result.default;throw e._result}var P={current:null},F={transition:null},I={ReactCurrentDispatcher:P,ReactCurrentBatchConfig:F,ReactCurrentOwner:C};function L(){throw Error(`act(...) is not supported in production builds of React.`)}e.Children={map:M,forEach:function(e,t,n){M(e,function(){t.apply(this,arguments)},n)},count:function(e){var t=0;return M(e,function(){t++}),t},toArray:function(e){return M(e,function(e){return e})||[]},only:function(e){if(!D(e))throw Error(`React.Children.only expected to receive a single React element child.`);return e}},e.Component=_,e.Fragment=r,e.Profiler=a,e.PureComponent=y,e.StrictMode=i,e.Suspense=l,e.__SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED=I,e.act=L,e.cloneElement=function(e,n,r){if(e==null)throw Error(`React.cloneElement(...): The argument must be a React element, but you passed `+e+`.`);var i=h({},e.props),a=e.key,o=e.ref,s=e._owner;if(n!=null){if(n.ref!==void 0&&(o=n.ref,s=C.current),n.key!==void 0&&(a=``+n.key),e.type&&e.type.defaultProps)var c=e.type.defaultProps;for(l in n)S.call(n,l)&&!w.hasOwnProperty(l)&&(i[l]=n[l]===void 0&&c!==void 0?c[l]:n[l])}var l=arguments.length-2;if(l===1)i.children=r;else if(1<l){c=Array(l);for(var u=0;u<l;u++)c[u]=arguments[u+2];i.children=c}return{$$typeof:t,type:e.type,key:a,ref:o,props:i,_owner:s}},e.createContext=function(e){return e={$$typeof:s,_currentValue:e,_currentValue2:e,_threadCount:0,Provider:null,Consumer:null,_defaultValue:null,_globalName:null},e.Provider={$$typeof:o,_context:e},e.Consumer=e},e.createElement=T,e.createFactory=function(e){var t=T.bind(null,e);return t.type=e,t},e.createRef=function(){return{current:null}},e.forwardRef=function(e){return{$$typeof:c,render:e}},e.isValidElement=D,e.lazy=function(e){return{$$typeof:d,_payload:{_status:-1,_result:e},_init:N}},e.memo=function(e,t){return{$$typeof:u,type:e,compare:t===void 0?null:t}},e.startTransition=function(e){var t=F.transition;F.transition={};try{e()}finally{F.transition=t}},e.unstable_act=L,e.useCallback=function(e,t){return P.current.useCallback(e,t)},e.useContext=function(e){return P.current.useContext(e)},e.useDebugValue=function(){},e.useDeferredValue=function(e){return P.current.useDeferredValue(e)},e.useEffect=function(e,t){return P.current.useEffect(e,t)},e.useId=function(){return P.current.useId()},e.useImperativeHandle=function(e,t,n){return P.current.useImperativeHandle(e,t,n)},e.useInsertionEffect=function(e,t){return P.current.useInsertionEffect(e,t)},e.useLayoutEffect=function(e,t){return P.current.useLayoutEffect(e,t)},e.useMemo=function(e,t){return P.current.useMemo(e,t)},e.useReducer=function(e,t,n){return P.current.useReducer(e,t,n)},e.useRef=function(e){return P.current.useRef(e)},e.useState=function(e){return P.current.useState(e)},e.useSyncExternalStore=function(e,t,n){return P.current.useSyncExternalStore(e,t,n)},e.useTransition=function(){return P.current.useTransition()},e.version=`18.3.1`})),d=o(((e,t)=>{t.exports=u()})),f=o((e=>{function t(e,t){var n=e.length;e.push(t);a:for(;0<n;){var r=n-1>>>1,a=e[r];if(0<i(a,t))e[r]=t,e[n]=a,n=r;else break a}}function n(e){return e.length===0?null:e[0]}function r(e){if(e.length===0)return null;var t=e[0],n=e.pop();if(n!==t){e[0]=n;a:for(var r=0,a=e.length,o=a>>>1;r<o;){var s=2*(r+1)-1,c=e[s],l=s+1,u=e[l];if(0>i(c,n))l<a&&0>i(u,c)?(e[r]=u,e[l]=n,r=l):(e[r]=c,e[s]=n,r=s);else if(l<a&&0>i(u,n))e[r]=u,e[l]=n,r=l;else break a}}return t}function i(e,t){var n=e.sortIndex-t.sortIndex;return n===0?e.id-t.id:n}if(typeof performance==`object`&&typeof performance.now==`function`){var a=performance;e.unstable_now=function(){return a.now()}}else{var o=Date,s=o.now();e.unstable_now=function(){return o.now()-s}}var c=[],l=[],u=1,d=null,f=3,p=!1,m=!1,h=!1,g=typeof setTimeout==`function`?setTimeout:null,_=typeof clearTimeout==`function`?clearTimeout:null,v=typeof setImmediate<`u`?setImmediate:null;typeof navigator<`u`&&navigator.scheduling!==void 0&&navigator.scheduling.isInputPending!==void 0&&navigator.scheduling.isInputPending.bind(navigator.scheduling);function y(e){for(var i=n(l);i!==null;){if(i.callback===null)r(l);else if(i.startTime<=e)r(l),i.sortIndex=i.expirationTime,t(c,i);else break;i=n(l)}}function b(e){if(h=!1,y(e),!m){if(n(c)!==null)m=!0,M(x);else{var t=n(l);t!==null&&N(b,t.startTime-e)}}}function x(t,i){m=!1,h&&(h=!1,_(w),w=-1),p=!0;var a=f;try{for(y(i),d=n(c);d!==null&&(!(d.expirationTime>i)||t&&!D());){var o=d.callback;if(typeof o==`function`){d.callback=null,f=d.priorityLevel;var s=o(d.expirationTime<=i);i=e.unstable_now(),typeof s==`function`?d.callback=s:d===n(c)&&r(c),y(i)}else r(c);d=n(c)}if(d!==null)var u=!0;else{var g=n(l);g!==null&&N(b,g.startTime-i),u=!1}return u}finally{d=null,f=a,p=!1}}var S=!1,C=null,w=-1,T=5,E=-1;function D(){return!(e.unstable_now()-E<T)}function O(){if(C!==null){var t=e.unstable_now();E=t;var n=!0;try{n=C(!0,t)}finally{n?k():(S=!1,C=null)}}else S=!1}var k;if(typeof v==`function`)k=function(){v(O)};else if(typeof MessageChannel<`u`){var A=new MessageChannel,j=A.port2;A.port1.onmessage=O,k=function(){j.postMessage(null)}}else k=function(){g(O,0)};function M(e){C=e,S||(S=!0,k())}function N(t,n){w=g(function(){t(e.unstable_now())},n)}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(e){e.callback=null},e.unstable_continueExecution=function(){m||p||(m=!0,M(x))},e.unstable_forceFrameRate=function(e){0>e||125<e?console.error(`forceFrameRate takes a positive int between 0 and 125, forcing frame rates higher than 125 fps is not supported`):T=0<e?Math.floor(1e3/e):5},e.unstable_getCurrentPriorityLevel=function(){return f},e.unstable_getFirstCallbackNode=function(){return n(c)},e.unstable_next=function(e){switch(f){case 1:case 2:case 3:var t=3;break;default:t=f}var n=f;f=t;try{return e()}finally{f=n}},e.unstable_pauseExecution=function(){},e.unstable_requestPaint=function(){},e.unstable_runWithPriority=function(e,t){switch(e){case 1:case 2:case 3:case 4:case 5:break;default:e=3}var n=f;f=e;try{return t()}finally{f=n}},e.unstable_scheduleCallback=function(r,i,a){var o=e.unstable_now();switch(typeof a==`object`&&a?(a=a.delay,a=typeof a==`number`&&0<a?o+a:o):a=o,r){case 1:var s=-1;break;case 2:s=250;break;case 5:s=1073741823;break;case 4:s=1e4;break;default:s=5e3}return s=a+s,r={id:u++,callback:i,priorityLevel:r,startTime:a,expirationTime:s,sortIndex:-1},a>o?(r.sortIndex=a,t(l,r),n(c)===null&&r===n(l)&&(h?(_(w),w=-1):h=!0,N(b,a-o))):(r.sortIndex=s,t(c,r),m||p||(m=!0,M(x))),r},e.unstable_shouldYield=D,e.unstable_wrapCallback=function(e){var t=f;return function(){var n=f;f=t;try{return e.apply(this,arguments)}finally{f=n}}}})),p=o(((e,t)=>{t.exports=f()})),m=o((e=>{var t=d(),n=p();function r(e){for(var t=`https://reactjs.org/docs/error-decoder.html?invariant=`+e,n=1;n<arguments.length;n++)t+=`&args[]=`+encodeURIComponent(arguments[n]);return`Minified React error #`+e+`; visit `+t+` for the full message or use the non-minified dev environment for full errors and additional helpful warnings.`}var i=new Set,a={};function o(e,t){s(e,t),s(e+`Capture`,t)}function s(e,t){for(a[e]=t,e=0;e<t.length;e++)i.add(t[e])}var c=typeof window<`u`&&window.document!==void 0&&window.document.createElement!==void 0,l=Object.prototype.hasOwnProperty,u=/^[: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]*$/,f={},m={};function h(e){return l.call(m,e)?!0:l.call(f,e)?!1:u.test(e)?m[e]=!0:(f[e]=!0,!1)}function g(e,t,n,r){if(n!==null&&n.type===0)return!1;switch(typeof t){case`function`:case`symbol`:return!0;case`boolean`:return r?!1:n===null?(e=e.toLowerCase().slice(0,5),e!==`data-`&&e!==`aria-`):!n.acceptsBooleans;default:return!1}}function _(e,t,n,r){if(t==null||g(e,t,n,r))return!0;if(r)return!1;if(n!==null)switch(n.type){case 3:return!t;case 4:return!1===t;case 5:return isNaN(t);case 6:return isNaN(t)||1>t}return!1}function v(e,t,n,r,i,a,o){this.acceptsBooleans=t===2||t===3||t===4,this.attributeName=r,this.attributeNamespace=i,this.mustUseProperty=n,this.propertyName=e,this.type=t,this.sanitizeURL=a,this.removeEmptyString=o}var y={};`children dangerouslySetInnerHTML defaultValue defaultChecked innerHTML suppressContentEditableWarning suppressHydrationWarning style`.split(` `).forEach(function(e){y[e]=new v(e,0,!1,e,null,!1,!1)}),[[`acceptCharset`,`accept-charset`],[`className`,`class`],[`htmlFor`,`for`],[`httpEquiv`,`http-equiv`]].forEach(function(e){var t=e[0];y[t]=new v(t,1,!1,e[1],null,!1,!1)}),[`contentEditable`,`draggable`,`spellCheck`,`value`].forEach(function(e){y[e]=new v(e,2,!1,e.toLowerCase(),null,!1,!1)}),[`autoReverse`,`externalResourcesRequired`,`focusable`,`preserveAlpha`].forEach(function(e){y[e]=new v(e,2,!1,e,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(e){y[e]=new v(e,3,!1,e.toLowerCase(),null,!1,!1)}),[`checked`,`multiple`,`muted`,`selected`].forEach(function(e){y[e]=new v(e,3,!0,e,null,!1,!1)}),[`capture`,`download`].forEach(function(e){y[e]=new v(e,4,!1,e,null,!1,!1)}),[`cols`,`rows`,`size`,`span`].forEach(function(e){y[e]=new v(e,6,!1,e,null,!1,!1)}),[`rowSpan`,`start`].forEach(function(e){y[e]=new v(e,5,!1,e.toLowerCase(),null,!1,!1)});var b=/[\-:]([a-z])/g;function x(e){return e[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(e){var t=e.replace(b,x);y[t]=new v(t,1,!1,e,null,!1,!1)}),`xlink:actuate xlink:arcrole xlink:role xlink:show xlink:title xlink:type`.split(` `).forEach(function(e){var t=e.replace(b,x);y[t]=new v(t,1,!1,e,`http://www.w3.org/1999/xlink`,!1,!1)}),[`xml:base`,`xml:lang`,`xml:space`].forEach(function(e){var t=e.replace(b,x);y[t]=new v(t,1,!1,e,`http://www.w3.org/XML/1998/namespace`,!1,!1)}),[`tabIndex`,`crossOrigin`].forEach(function(e){y[e]=new v(e,1,!1,e.toLowerCase(),null,!1,!1)}),y.xlinkHref=new v(`xlinkHref`,1,!1,`xlink:href`,`http://www.w3.org/1999/xlink`,!0,!1),[`src`,`href`,`action`,`formAction`].forEach(function(e){y[e]=new v(e,1,!1,e.toLowerCase(),null,!0,!0)});function S(e,t,n,r){var i=y.hasOwnProperty(t)?y[t]:null;(i===null?r||!(2<t.length)||t[0]!==`o`&&t[0]!==`O`||t[1]!==`n`&&t[1]!==`N`:i.type!==0)&&(_(t,n,i,r)&&(n=null),r||i===null?h(t)&&(n===null?e.removeAttribute(t):e.setAttribute(t,``+n)):i.mustUseProperty?e[i.propertyName]=n===null?i.type!==3&&``:n:(t=i.attributeName,r=i.attributeNamespace,n===null?e.removeAttribute(t):(i=i.type,n=i===3||i===4&&!0===n?``:``+n,r?e.setAttributeNS(r,t,n):e.setAttribute(t,n))))}var C=t.__SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED,w=Symbol.for(`react.element`),T=Symbol.for(`react.portal`),E=Symbol.for(`react.fragment`),D=Symbol.for(`react.strict_mode`),O=Symbol.for(`react.profiler`),k=Symbol.for(`react.provider`),A=Symbol.for(`react.context`),j=Symbol.for(`react.forward_ref`),M=Symbol.for(`react.suspense`),N=Symbol.for(`react.suspense_list`),P=Symbol.for(`react.memo`),F=Symbol.for(`react.lazy`),I=Symbol.for(`react.offscreen`),L=Symbol.iterator;function R(e){return typeof e!=`object`||!e?null:(e=L&&e[L]||e[`@@iterator`],typeof e==`function`?e:null)}var z=Object.assign,ee;function te(e){if(ee===void 0)try{throw Error()}catch(e){var t=e.stack.trim().match(/\n( *(at )?)/);ee=t&&t[1]||``}return`
|
|
2
|
-
`+ee+e}var ne=!1;function re(e,t){if(!e||ne)return``;ne=!0;var n=Error.prepareStackTrace;Error.prepareStackTrace=void 0;try{if(t){if(t=function(){throw Error()},Object.defineProperty(t.prototype,"props",{set:function(){throw Error()}}),typeof Reflect==`object`&&Reflect.construct){try{Reflect.construct(t,[])}catch(e){var r=e}Reflect.construct(e,[],t)}else{try{t.call()}catch(e){r=e}e.call(t.prototype)}}else{try{throw Error()}catch(e){r=e}e()}}catch(t){if(t&&r&&typeof t.stack==`string`){for(var i=t.stack.split(`
|
|
3
|
-
`),a=r.stack.split(`
|
|
4
|
-
`),o=i.length-1,s=a.length-1;1<=o&&0<=s&&i[o]!==a[s];)s--;for(;1<=o&&0<=s;o--,s--)if(i[o]!==a[s]){if(o!==1||s!==1)do if(o--,s--,0>s||i[o]!==a[s]){var c=`
|
|
5
|
-
`+i[o].replace(` at new `,` at `);return e.displayName&&c.includes(`<anonymous>`)&&(c=c.replace(`<anonymous>`,e.displayName)),c}while(1<=o&&0<=s);break}}}finally{ne=!1,Error.prepareStackTrace=n}return(e=e?e.displayName||e.name:``)?te(e):``}function ie(e){switch(e.tag){case 5:return te(e.type);case 16:return te(`Lazy`);case 13:return te(`Suspense`);case 19:return te(`SuspenseList`);case 0:case 2:case 15:return e=re(e.type,!1),e;case 11:return e=re(e.type.render,!1),e;case 1:return e=re(e.type,!0),e;default:return``}}function ae(e){if(e==null)return null;if(typeof e==`function`)return e.displayName||e.name||null;if(typeof e==`string`)return e;switch(e){case E:return`Fragment`;case T:return`Portal`;case O:return`Profiler`;case D:return`StrictMode`;case M:return`Suspense`;case N:return`SuspenseList`}if(typeof e==`object`)switch(e.$$typeof){case A:return(e.displayName||`Context`)+`.Consumer`;case k:return(e._context.displayName||`Context`)+`.Provider`;case j:var t=e.render;return e=e.displayName,e||=(e=t.displayName||t.name||``,e===``?`ForwardRef`:`ForwardRef(`+e+`)`),e;case P:return t=e.displayName||null,t===null?ae(e.type)||`Memo`:t;case F:t=e._payload,e=e._init;try{return ae(e(t))}catch{}}return null}function oe(e){var t=e.type;switch(e.tag){case 24:return`Cache`;case 9:return(t.displayName||`Context`)+`.Consumer`;case 10:return(t._context.displayName||`Context`)+`.Provider`;case 18:return`DehydratedFragment`;case 11:return e=t.render,e=e.displayName||e.name||``,t.displayName||(e===``?`ForwardRef`:`ForwardRef(`+e+`)`);case 7:return`Fragment`;case 5:return t;case 4:return`Portal`;case 3:return`Root`;case 6:return`Text`;case 16:return ae(t);case 8:return t===D?`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 t==`function`)return t.displayName||t.name||null;if(typeof t==`string`)return t}return null}function se(e){switch(typeof e){case`boolean`:case`number`:case`string`:case`undefined`:return e;case`object`:return e;default:return``}}function ce(e){var t=e.type;return(e=e.nodeName)&&e.toLowerCase()===`input`&&(t===`checkbox`||t===`radio`)}function B(e){var t=ce(e)?`checked`:`value`,n=Object.getOwnPropertyDescriptor(e.constructor.prototype,t),r=``+e[t];if(!e.hasOwnProperty(t)&&n!==void 0&&typeof n.get==`function`&&typeof n.set==`function`){var i=n.get,a=n.set;return Object.defineProperty(e,t,{configurable:!0,get:function(){return i.call(this)},set:function(e){r=``+e,a.call(this,e)}}),Object.defineProperty(e,t,{enumerable:n.enumerable}),{getValue:function(){return r},setValue:function(e){r=``+e},stopTracking:function(){e._valueTracker=null,delete e[t]}}}}function le(e){e._valueTracker||=B(e)}function ue(e){if(!e)return!1;var t=e._valueTracker;if(!t)return!0;var n=t.getValue(),r=``;return e&&(r=ce(e)?e.checked?`true`:`false`:e.value),e=r,e!==n&&(t.setValue(e),!0)}function de(e){if(e||=typeof document<`u`?document:void 0,e===void 0)return null;try{return e.activeElement||e.body}catch{return e.body}}function V(e,t){var n=t.checked;return z({},t,{defaultChecked:void 0,defaultValue:void 0,value:void 0,checked:n??e._wrapperState.initialChecked})}function fe(e,t){var n=t.defaultValue==null?``:t.defaultValue,r=t.checked==null?t.defaultChecked:t.checked;n=se(t.value==null?n:t.value),e._wrapperState={initialChecked:r,initialValue:n,controlled:t.type===`checkbox`||t.type===`radio`?t.checked!=null:t.value!=null}}function pe(e,t){t=t.checked,t!=null&&S(e,`checked`,t,!1)}function me(e,t){pe(e,t);var n=se(t.value),r=t.type;if(n!=null)r===`number`?(n===0&&e.value===``||e.value!=n)&&(e.value=``+n):e.value!==``+n&&(e.value=``+n);else if(r===`submit`||r===`reset`){e.removeAttribute(`value`);return}t.hasOwnProperty(`value`)?ge(e,t.type,n):t.hasOwnProperty(`defaultValue`)&&ge(e,t.type,se(t.defaultValue)),t.checked==null&&t.defaultChecked!=null&&(e.defaultChecked=!!t.defaultChecked)}function he(e,t,n){if(t.hasOwnProperty(`value`)||t.hasOwnProperty(`defaultValue`)){var r=t.type;if(!(r!==`submit`&&r!==`reset`||t.value!==void 0&&t.value!==null))return;t=``+e._wrapperState.initialValue,n||t===e.value||(e.value=t),e.defaultValue=t}n=e.name,n!==``&&(e.name=``),e.defaultChecked=!!e._wrapperState.initialChecked,n!==``&&(e.name=n)}function ge(e,t,n){(t!==`number`||de(e.ownerDocument)!==e)&&(n==null?e.defaultValue=``+e._wrapperState.initialValue:e.defaultValue!==``+n&&(e.defaultValue=``+n))}var _e=Array.isArray;function ve(e,t,n,r){if(e=e.options,t){t={};for(var i=0;i<n.length;i++)t[`$`+n[i]]=!0;for(n=0;n<e.length;n++)i=t.hasOwnProperty(`$`+e[n].value),e[n].selected!==i&&(e[n].selected=i),i&&r&&(e[n].defaultSelected=!0)}else{for(n=``+se(n),t=null,i=0;i<e.length;i++){if(e[i].value===n){e[i].selected=!0,r&&(e[i].defaultSelected=!0);return}t!==null||e[i].disabled||(t=e[i])}t!==null&&(t.selected=!0)}}function ye(e,t){if(t.dangerouslySetInnerHTML!=null)throw Error(r(91));return z({},t,{value:void 0,defaultValue:void 0,children:``+e._wrapperState.initialValue})}function be(e,t){var n=t.value;if(n==null){if(n=t.children,t=t.defaultValue,n!=null){if(t!=null)throw Error(r(92));if(_e(n)){if(1<n.length)throw Error(r(93));n=n[0]}t=n}t??=``,n=t}e._wrapperState={initialValue:se(n)}}function xe(e,t){var n=se(t.value),r=se(t.defaultValue);n!=null&&(n=``+n,n!==e.value&&(e.value=n),t.defaultValue==null&&e.defaultValue!==n&&(e.defaultValue=n)),r!=null&&(e.defaultValue=``+r)}function Se(e){var t=e.textContent;t===e._wrapperState.initialValue&&t!==``&&t!==null&&(e.value=t)}function Ce(e){switch(e){case`svg`:return`http://www.w3.org/2000/svg`;case`math`:return`http://www.w3.org/1998/Math/MathML`;default:return`http://www.w3.org/1999/xhtml`}}function we(e,t){return e==null||e===`http://www.w3.org/1999/xhtml`?Ce(t):e===`http://www.w3.org/2000/svg`&&t===`foreignObject`?`http://www.w3.org/1999/xhtml`:e}var Te,Ee=function(e){return typeof MSApp<`u`&&MSApp.execUnsafeLocalFunction?function(t,n,r,i){MSApp.execUnsafeLocalFunction(function(){return e(t,n,r,i)})}:e}(function(e,t){if(e.namespaceURI!==`http://www.w3.org/2000/svg`||`innerHTML`in e)e.innerHTML=t;else{for(Te||=document.createElement(`div`),Te.innerHTML=`<svg>`+t.valueOf().toString()+`</svg>`,t=Te.firstChild;e.firstChild;)e.removeChild(e.firstChild);for(;t.firstChild;)e.appendChild(t.firstChild)}});function De(e,t){if(t){var n=e.firstChild;if(n&&n===e.lastChild&&n.nodeType===3){n.nodeValue=t;return}}e.textContent=t}var Oe={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},ke=[`Webkit`,`ms`,`Moz`,`O`];Object.keys(Oe).forEach(function(e){ke.forEach(function(t){t=t+e.charAt(0).toUpperCase()+e.substring(1),Oe[t]=Oe[e]})});function Ae(e,t,n){return t==null||typeof t==`boolean`||t===``?``:n||typeof t!=`number`||t===0||Oe.hasOwnProperty(e)&&Oe[e]?(``+t).trim():t+`px`}function je(e,t){for(var n in e=e.style,t)if(t.hasOwnProperty(n)){var r=n.indexOf(`--`)===0,i=Ae(n,t[n],r);n===`float`&&(n=`cssFloat`),r?e.setProperty(n,i):e[n]=i}}var Me=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 Ne(e,t){if(t){if(Me[e]&&(t.children!=null||t.dangerouslySetInnerHTML!=null))throw Error(r(137,e));if(t.dangerouslySetInnerHTML!=null){if(t.children!=null)throw Error(r(60));if(typeof t.dangerouslySetInnerHTML!=`object`||!(`__html`in t.dangerouslySetInnerHTML))throw Error(r(61))}if(t.style!=null&&typeof t.style!=`object`)throw Error(r(62))}}function Pe(e,t){if(e.indexOf(`-`)===-1)return typeof t.is==`string`;switch(e){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 Fe=null;function Ie(e){return e=e.target||e.srcElement||window,e.correspondingUseElement&&(e=e.correspondingUseElement),e.nodeType===3?e.parentNode:e}var Le=null,Re=null,ze=null;function Be(e){if(e=Bi(e)){if(typeof Le!=`function`)throw Error(r(280));var t=e.stateNode;t&&(t=Hi(t),Le(e.stateNode,e.type,t))}}function Ve(e){Re?ze?ze.push(e):ze=[e]:Re=e}function He(){if(Re){var e=Re,t=ze;if(ze=Re=null,Be(e),t)for(e=0;e<t.length;e++)Be(t[e])}}function Ue(e,t){return e(t)}function We(){}var Ge=!1;function Ke(e,t,n){if(Ge)return e(t,n);Ge=!0;try{return Ue(e,t,n)}finally{Ge=!1,(Re!==null||ze!==null)&&(We(),He())}}function qe(e,t){var n=e.stateNode;if(n===null)return null;var i=Hi(n);if(i===null)return null;n=i[t];a:switch(t){case`onClick`:case`onClickCapture`:case`onDoubleClick`:case`onDoubleClickCapture`:case`onMouseDown`:case`onMouseDownCapture`:case`onMouseMove`:case`onMouseMoveCapture`:case`onMouseUp`:case`onMouseUpCapture`:case`onMouseEnter`:(i=!i.disabled)||(e=e.type,i=e!==`button`&&e!==`input`&&e!==`select`&&e!==`textarea`),e=!i;break a;default:e=!1}if(e)return null;if(n&&typeof n!=`function`)throw Error(r(231,t,typeof n));return n}var Je=!1;if(c)try{var Ye={};Object.defineProperty(Ye,"passive",{get:function(){Je=!0}}),window.addEventListener(`test`,Ye,Ye),window.removeEventListener(`test`,Ye,Ye)}catch{Je=!1}function Xe(e,t,n,r,i,a,o,s,c){var l=Array.prototype.slice.call(arguments,3);try{t.apply(n,l)}catch(e){this.onError(e)}}var Ze=!1,Qe=null,$e=!1,et=null,tt={onError:function(e){Ze=!0,Qe=e}};function nt(e,t,n,r,i,a,o,s,c){Ze=!1,Qe=null,Xe.apply(tt,arguments)}function rt(e,t,n,i,a,o,s,c,l){if(nt.apply(this,arguments),Ze){if(Ze){var u=Qe;Ze=!1,Qe=null}else throw Error(r(198));$e||($e=!0,et=u)}}function it(e){var t=e,n=e;if(e.alternate)for(;t.return;)t=t.return;else{e=t;do t=e,t.flags&4098&&(n=t.return),e=t.return;while(e)}return t.tag===3?n:null}function at(e){if(e.tag===13){var t=e.memoizedState;if(t===null&&(e=e.alternate,e!==null&&(t=e.memoizedState)),t!==null)return t.dehydrated}return null}function ot(e){if(it(e)!==e)throw Error(r(188))}function st(e){var t=e.alternate;if(!t){if(t=it(e),t===null)throw Error(r(188));return t===e?e:null}for(var n=e,i=t;;){var a=n.return;if(a===null)break;var o=a.alternate;if(o===null){if(i=a.return,i!==null){n=i;continue}break}if(a.child===o.child){for(o=a.child;o;){if(o===n)return ot(a),e;if(o===i)return ot(a),t;o=o.sibling}throw Error(r(188))}if(n.return!==i.return)n=a,i=o;else{for(var s=!1,c=a.child;c;){if(c===n){s=!0,n=a,i=o;break}if(c===i){s=!0,i=a,n=o;break}c=c.sibling}if(!s){for(c=o.child;c;){if(c===n){s=!0,n=o,i=a;break}if(c===i){s=!0,i=o,n=a;break}c=c.sibling}if(!s)throw Error(r(189))}}if(n.alternate!==i)throw Error(r(190))}if(n.tag!==3)throw Error(r(188));return n.stateNode.current===n?e:t}function ct(e){return e=st(e),e===null?null:lt(e)}function lt(e){if(e.tag===5||e.tag===6)return e;for(e=e.child;e!==null;){var t=lt(e);if(t!==null)return t;e=e.sibling}return null}var ut=n.unstable_scheduleCallback,dt=n.unstable_cancelCallback,ft=n.unstable_shouldYield,pt=n.unstable_requestPaint,mt=n.unstable_now,ht=n.unstable_getCurrentPriorityLevel,gt=n.unstable_ImmediatePriority,_t=n.unstable_UserBlockingPriority,vt=n.unstable_NormalPriority,yt=n.unstable_LowPriority,bt=n.unstable_IdlePriority,xt=null,St=null;function Ct(e){if(St&&typeof St.onCommitFiberRoot==`function`)try{St.onCommitFiberRoot(xt,e,void 0,(e.current.flags&128)==128)}catch{}}var wt=Math.clz32?Math.clz32:Dt,Tt=Math.log,Et=Math.LN2;function Dt(e){return e>>>=0,e===0?32:31-(Tt(e)/Et|0)|0}var Ot=64,kt=4194304;function At(e){switch(e&-e){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 e&4194240;case 4194304:case 8388608:case 16777216:case 33554432:case 67108864:return e&130023424;case 134217728:return 134217728;case 268435456:return 268435456;case 536870912:return 536870912;case 1073741824:return 1073741824;default:return e}}function jt(e,t){var n=e.pendingLanes;if(n===0)return 0;var r=0,i=e.suspendedLanes,a=e.pingedLanes,o=n&268435455;if(o!==0){var s=o&~i;s===0?(a&=o,a!==0&&(r=At(a))):r=At(s)}else o=n&~i,o===0?a!==0&&(r=At(a)):r=At(o);if(r===0)return 0;if(t!==0&&t!==r&&(t&i)===0&&(i=r&-r,a=t&-t,i>=a||i===16&&a&4194240))return t;if(r&4&&(r|=n&16),t=e.entangledLanes,t!==0)for(e=e.entanglements,t&=r;0<t;)n=31-wt(t),i=1<<n,r|=e[n],t&=~i;return r}function Mt(e,t){switch(e){case 1:case 2:case 4:return t+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 t+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 Nt(e,t){for(var n=e.suspendedLanes,r=e.pingedLanes,i=e.expirationTimes,a=e.pendingLanes;0<a;){var o=31-wt(a),s=1<<o,c=i[o];c===-1?((s&n)===0||(s&r)!==0)&&(i[o]=Mt(s,t)):c<=t&&(e.expiredLanes|=s),a&=~s}}function Pt(e){return e=e.pendingLanes&-1073741825,e===0?e&1073741824?1073741824:0:e}function Ft(){var e=Ot;return Ot<<=1,!(Ot&4194240)&&(Ot=64),e}function It(e){for(var t=[],n=0;31>n;n++)t.push(e);return t}function Lt(e,t,n){e.pendingLanes|=t,t!==536870912&&(e.suspendedLanes=0,e.pingedLanes=0),e=e.eventTimes,t=31-wt(t),e[t]=n}function Rt(e,t){var n=e.pendingLanes&~t;e.pendingLanes=t,e.suspendedLanes=0,e.pingedLanes=0,e.expiredLanes&=t,e.mutableReadLanes&=t,e.entangledLanes&=t,t=e.entanglements;var r=e.eventTimes;for(e=e.expirationTimes;0<n;){var i=31-wt(n),a=1<<i;t[i]=0,r[i]=-1,e[i]=-1,n&=~a}}function zt(e,t){var n=e.entangledLanes|=t;for(e=e.entanglements;n;){var r=31-wt(n),i=1<<r;i&t|e[r]&t&&(e[r]|=t),n&=~i}}var Bt=0;function Vt(e){return e&=-e,1<e?4<e?e&268435455?16:536870912:4:1}var Ht,Ut,Wt,Gt,Kt,qt=!1,Jt=[],Yt=null,H=null,Xt=null,Zt=new Map,Qt=new Map,$t=[],en=`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 tn(e,t){switch(e){case`focusin`:case`focusout`:Yt=null;break;case`dragenter`:case`dragleave`:H=null;break;case`mouseover`:case`mouseout`:Xt=null;break;case`pointerover`:case`pointerout`:Zt.delete(t.pointerId);break;case`gotpointercapture`:case`lostpointercapture`:Qt.delete(t.pointerId)}}function nn(e,t,n,r,i,a){return e===null||e.nativeEvent!==a?(e={blockedOn:t,domEventName:n,eventSystemFlags:r,nativeEvent:a,targetContainers:[i]},t!==null&&(t=Bi(t),t!==null&&Ut(t)),e):(e.eventSystemFlags|=r,t=e.targetContainers,i!==null&&t.indexOf(i)===-1&&t.push(i),e)}function rn(e,t,n,r,i){switch(t){case`focusin`:return Yt=nn(Yt,e,t,n,r,i),!0;case`dragenter`:return H=nn(H,e,t,n,r,i),!0;case`mouseover`:return Xt=nn(Xt,e,t,n,r,i),!0;case`pointerover`:var a=i.pointerId;return Zt.set(a,nn(Zt.get(a)||null,e,t,n,r,i)),!0;case`gotpointercapture`:return a=i.pointerId,Qt.set(a,nn(Qt.get(a)||null,e,t,n,r,i)),!0}return!1}function an(e){var t=zi(e.target);if(t!==null){var n=it(t);if(n!==null){if(t=n.tag,t===13){if(t=at(n),t!==null){e.blockedOn=t,Kt(e.priority,function(){Wt(n)});return}}else if(t===3&&n.stateNode.current.memoizedState.isDehydrated){e.blockedOn=n.tag===3?n.stateNode.containerInfo:null;return}}}e.blockedOn=null}function on(e){if(e.blockedOn!==null)return!1;for(var t=e.targetContainers;0<t.length;){var n=_n(e.domEventName,e.eventSystemFlags,t[0],e.nativeEvent);if(n===null){n=e.nativeEvent;var r=new n.constructor(n.type,n);Fe=r,n.target.dispatchEvent(r),Fe=null}else return t=Bi(n),t!==null&&Ut(t),e.blockedOn=n,!1;t.shift()}return!0}function sn(e,t,n){on(e)&&n.delete(t)}function cn(){qt=!1,Yt!==null&&on(Yt)&&(Yt=null),H!==null&&on(H)&&(H=null),Xt!==null&&on(Xt)&&(Xt=null),Zt.forEach(sn),Qt.forEach(sn)}function ln(e,t){e.blockedOn===t&&(e.blockedOn=null,qt||(qt=!0,n.unstable_scheduleCallback(n.unstable_NormalPriority,cn)))}function un(e){function t(t){return ln(t,e)}if(0<Jt.length){ln(Jt[0],e);for(var n=1;n<Jt.length;n++){var r=Jt[n];r.blockedOn===e&&(r.blockedOn=null)}}for(Yt!==null&&ln(Yt,e),H!==null&&ln(H,e),Xt!==null&&ln(Xt,e),Zt.forEach(t),Qt.forEach(t),n=0;n<$t.length;n++)r=$t[n],r.blockedOn===e&&(r.blockedOn=null);for(;0<$t.length&&(n=$t[0],n.blockedOn===null);)an(n),n.blockedOn===null&&$t.shift()}var dn=C.ReactCurrentBatchConfig,fn=!0;function pn(e,t,n,r){var i=Bt,a=dn.transition;dn.transition=null;try{Bt=1,hn(e,t,n,r)}finally{Bt=i,dn.transition=a}}function mn(e,t,n,r){var i=Bt,a=dn.transition;dn.transition=null;try{Bt=4,hn(e,t,n,r)}finally{Bt=i,dn.transition=a}}function hn(e,t,n,r){if(fn){var i=_n(e,t,n,r);if(i===null)di(e,t,r,gn,n),tn(e,r);else if(rn(i,e,t,n,r))r.stopPropagation();else if(tn(e,r),t&4&&-1<en.indexOf(e)){for(;i!==null;){var a=Bi(i);if(a!==null&&Ht(a),a=_n(e,t,n,r),a===null&&di(e,t,r,gn,n),a===i)break;i=a}i!==null&&r.stopPropagation()}else di(e,t,r,null,n)}}var gn=null;function _n(e,t,n,r){if(gn=null,e=Ie(r),e=zi(e),e!==null){if(t=it(e),t===null)e=null;else if(n=t.tag,n===13){if(e=at(t),e!==null)return e;e=null}else if(n===3){if(t.stateNode.current.memoizedState.isDehydrated)return t.tag===3?t.stateNode.containerInfo:null;e=null}else t!==e&&(e=null)}return gn=e,null}function vn(e){switch(e){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(ht()){case gt:return 1;case _t:return 4;case vt:case yt:return 16;case bt:return 536870912;default:return 16}default:return 16}}var yn=null,bn=null,xn=null;function Sn(){if(xn)return xn;var e,t=bn,n=t.length,r,i=`value`in yn?yn.value:yn.textContent,a=i.length;for(e=0;e<n&&t[e]===i[e];e++);var o=n-e;for(r=1;r<=o&&t[n-r]===i[a-r];r++);return xn=i.slice(e,1<r?1-r:void 0)}function Cn(e){var t=e.keyCode;return`charCode`in e?(e=e.charCode,e===0&&t===13&&(e=13)):e=t,e===10&&(e=13),32<=e||e===13?e:0}function wn(){return!0}function Tn(){return!1}function En(e){function t(t,n,r,i,a){for(var o in this._reactName=t,this._targetInst=r,this.type=n,this.nativeEvent=i,this.target=a,this.currentTarget=null,e)e.hasOwnProperty(o)&&(t=e[o],this[o]=t?t(i):i[o]);return this.isDefaultPrevented=(i.defaultPrevented==null?!1===i.returnValue:i.defaultPrevented)?wn:Tn,this.isPropagationStopped=Tn,this}return z(t.prototype,{preventDefault:function(){this.defaultPrevented=!0;var e=this.nativeEvent;e&&(e.preventDefault?e.preventDefault():typeof e.returnValue!=`unknown`&&(e.returnValue=!1),this.isDefaultPrevented=wn)},stopPropagation:function(){var e=this.nativeEvent;e&&(e.stopPropagation?e.stopPropagation():typeof e.cancelBubble!=`unknown`&&(e.cancelBubble=!0),this.isPropagationStopped=wn)},persist:function(){},isPersistent:wn}),t}var Dn={eventPhase:0,bubbles:0,cancelable:0,timeStamp:function(e){return e.timeStamp||Date.now()},defaultPrevented:0,isTrusted:0},On=En(Dn),kn=z({},Dn,{view:0,detail:0}),An=En(kn),jn,Mn,Nn,Pn=z({},kn,{screenX:0,screenY:0,clientX:0,clientY:0,pageX:0,pageY:0,ctrlKey:0,shiftKey:0,altKey:0,metaKey:0,getModifierState:Gn,button:0,buttons:0,relatedTarget:function(e){return e.relatedTarget===void 0?e.fromElement===e.srcElement?e.toElement:e.fromElement:e.relatedTarget},movementX:function(e){return`movementX`in e?e.movementX:(e!==Nn&&(Nn&&e.type===`mousemove`?(jn=e.screenX-Nn.screenX,Mn=e.screenY-Nn.screenY):Mn=jn=0,Nn=e),jn)},movementY:function(e){return`movementY`in e?e.movementY:Mn}}),Fn=En(Pn),In=En(z({},Pn,{dataTransfer:0})),Ln=En(z({},kn,{relatedTarget:0})),Rn=En(z({},Dn,{animationName:0,elapsedTime:0,pseudoElement:0})),zn=En(z({},Dn,{clipboardData:function(e){return`clipboardData`in e?e.clipboardData:window.clipboardData}})),Bn=En(z({},Dn,{data:0})),Vn={Esc:`Escape`,Spacebar:` `,Left:`ArrowLeft`,Up:`ArrowUp`,Right:`ArrowRight`,Down:`ArrowDown`,Del:`Delete`,Win:`OS`,Menu:`ContextMenu`,Apps:`ContextMenu`,Scroll:`ScrollLock`,MozPrintableKey:`Unidentified`},Hn={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`},Un={Alt:`altKey`,Control:`ctrlKey`,Meta:`metaKey`,Shift:`shiftKey`};function Wn(e){var t=this.nativeEvent;return t.getModifierState?t.getModifierState(e):(e=Un[e])?!!t[e]:!1}function Gn(){return Wn}var Kn=En(z({},kn,{key:function(e){if(e.key){var t=Vn[e.key]||e.key;if(t!==`Unidentified`)return t}return e.type===`keypress`?(e=Cn(e),e===13?`Enter`:String.fromCharCode(e)):e.type===`keydown`||e.type===`keyup`?Hn[e.keyCode]||`Unidentified`:``},code:0,location:0,ctrlKey:0,shiftKey:0,altKey:0,metaKey:0,repeat:0,locale:0,getModifierState:Gn,charCode:function(e){return e.type===`keypress`?Cn(e):0},keyCode:function(e){return e.type===`keydown`||e.type===`keyup`?e.keyCode:0},which:function(e){return e.type===`keypress`?Cn(e):e.type===`keydown`||e.type===`keyup`?e.keyCode:0}})),qn=En(z({},Pn,{pointerId:0,width:0,height:0,pressure:0,tangentialPressure:0,tiltX:0,tiltY:0,twist:0,pointerType:0,isPrimary:0})),Jn=En(z({},kn,{touches:0,targetTouches:0,changedTouches:0,altKey:0,metaKey:0,ctrlKey:0,shiftKey:0,getModifierState:Gn})),Yn=En(z({},Dn,{propertyName:0,elapsedTime:0,pseudoElement:0})),Xn=En(z({},Pn,{deltaX:function(e){return`deltaX`in e?e.deltaX:`wheelDeltaX`in e?-e.wheelDeltaX:0},deltaY:function(e){return`deltaY`in e?e.deltaY:`wheelDeltaY`in e?-e.wheelDeltaY:`wheelDelta`in e?-e.wheelDelta:0},deltaZ:0,deltaMode:0})),Zn=[9,13,27,32],Qn=c&&`CompositionEvent`in window,$n=null;c&&`documentMode`in document&&($n=document.documentMode);var er=c&&`TextEvent`in window&&!$n,tr=c&&(!Qn||$n&&8<$n&&11>=$n),nr=` `,rr=!1;function ir(e,t){switch(e){case`keyup`:return Zn.indexOf(t.keyCode)!==-1;case`keydown`:return t.keyCode!==229;case`keypress`:case`mousedown`:case`focusout`:return!0;default:return!1}}function ar(e){return e=e.detail,typeof e==`object`&&`data`in e?e.data:null}var or=!1;function sr(e,t){switch(e){case`compositionend`:return ar(t);case`keypress`:return t.which===32?(rr=!0,nr):null;case`textInput`:return e=t.data,e===nr&&rr?null:e;default:return null}}function cr(e,t){if(or)return e===`compositionend`||!Qn&&ir(e,t)?(e=Sn(),xn=bn=yn=null,or=!1,e):null;switch(e){case`paste`:return null;case`keypress`:if(!(t.ctrlKey||t.altKey||t.metaKey)||t.ctrlKey&&t.altKey){if(t.char&&1<t.char.length)return t.char;if(t.which)return String.fromCharCode(t.which)}return null;case`compositionend`:return tr&&t.locale!==`ko`?null:t.data;default:return null}}var lr={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 ur(e){var t=e&&e.nodeName&&e.nodeName.toLowerCase();return t===`input`?!!lr[e.type]:t===`textarea`}function dr(e,t,n,r){Ve(r),t=pi(t,`onChange`),0<t.length&&(n=new On(`onChange`,`change`,null,n,r),e.push({event:n,listeners:t}))}var fr=null,pr=null;function mr(e){ai(e,0)}function hr(e){if(ue(Vi(e)))return e}function gr(e,t){if(e===`change`)return t}var _r=!1;if(c){var vr;if(c){var yr=`oninput`in document;if(!yr){var br=document.createElement(`div`);br.setAttribute(`oninput`,`return;`),yr=typeof br.oninput==`function`}vr=yr}else vr=!1;_r=vr&&(!document.documentMode||9<document.documentMode)}function xr(){fr&&(fr.detachEvent(`onpropertychange`,Sr),pr=fr=null)}function Sr(e){if(e.propertyName===`value`&&hr(pr)){var t=[];dr(t,pr,e,Ie(e)),Ke(mr,t)}}function Cr(e,t,n){e===`focusin`?(xr(),fr=t,pr=n,fr.attachEvent(`onpropertychange`,Sr)):e===`focusout`&&xr()}function wr(e){if(e===`selectionchange`||e===`keyup`||e===`keydown`)return hr(pr)}function Tr(e,t){if(e===`click`)return hr(t)}function Er(e,t){if(e===`input`||e===`change`)return hr(t)}function Dr(e,t){return e===t&&(e!==0||1/e==1/t)||e!==e&&t!==t}var Or=typeof Object.is==`function`?Object.is:Dr;function kr(e,t){if(Or(e,t))return!0;if(typeof e!=`object`||!e||typeof t!=`object`||!t)return!1;var n=Object.keys(e),r=Object.keys(t);if(n.length!==r.length)return!1;for(r=0;r<n.length;r++){var i=n[r];if(!l.call(t,i)||!Or(e[i],t[i]))return!1}return!0}function Ar(e){for(;e&&e.firstChild;)e=e.firstChild;return e}function jr(e,t){var n=Ar(e);e=0;for(var r;n;){if(n.nodeType===3){if(r=e+n.textContent.length,e<=t&&r>=t)return{node:n,offset:t-e};e=r}a:{for(;n;){if(n.nextSibling){n=n.nextSibling;break a}n=n.parentNode}n=void 0}n=Ar(n)}}function Mr(e,t){return e&&t?e===t?!0:e&&e.nodeType===3?!1:t&&t.nodeType===3?Mr(e,t.parentNode):`contains`in e?e.contains(t):e.compareDocumentPosition?!!(e.compareDocumentPosition(t)&16):!1:!1}function Nr(){for(var e=window,t=de();t instanceof e.HTMLIFrameElement;){try{var n=typeof t.contentWindow.location.href==`string`}catch{n=!1}if(n)e=t.contentWindow;else break;t=de(e.document)}return t}function Pr(e){var t=e&&e.nodeName&&e.nodeName.toLowerCase();return t&&(t===`input`&&(e.type===`text`||e.type===`search`||e.type===`tel`||e.type===`url`||e.type===`password`)||t===`textarea`||e.contentEditable===`true`)}function Fr(e){var t=Nr(),n=e.focusedElem,r=e.selectionRange;if(t!==n&&n&&n.ownerDocument&&Mr(n.ownerDocument.documentElement,n)){if(r!==null&&Pr(n)){if(t=r.start,e=r.end,e===void 0&&(e=t),`selectionStart`in n)n.selectionStart=t,n.selectionEnd=Math.min(e,n.value.length);else if(e=(t=n.ownerDocument||document)&&t.defaultView||window,e.getSelection){e=e.getSelection();var i=n.textContent.length,a=Math.min(r.start,i);r=r.end===void 0?a:Math.min(r.end,i),!e.extend&&a>r&&(i=r,r=a,a=i),i=jr(n,a);var o=jr(n,r);i&&o&&(e.rangeCount!==1||e.anchorNode!==i.node||e.anchorOffset!==i.offset||e.focusNode!==o.node||e.focusOffset!==o.offset)&&(t=t.createRange(),t.setStart(i.node,i.offset),e.removeAllRanges(),a>r?(e.addRange(t),e.extend(o.node,o.offset)):(t.setEnd(o.node,o.offset),e.addRange(t)))}}for(t=[],e=n;e=e.parentNode;)e.nodeType===1&&t.push({element:e,left:e.scrollLeft,top:e.scrollTop});for(typeof n.focus==`function`&&n.focus(),n=0;n<t.length;n++)e=t[n],e.element.scrollLeft=e.left,e.element.scrollTop=e.top}}var Ir=c&&`documentMode`in document&&11>=document.documentMode,Lr=null,Rr=null,zr=null,Br=!1;function Vr(e,t,n){var r=n.window===n?n.document:n.nodeType===9?n:n.ownerDocument;Br||Lr==null||Lr!==de(r)||(r=Lr,`selectionStart`in r&&Pr(r)?r={start:r.selectionStart,end:r.selectionEnd}:(r=(r.ownerDocument&&r.ownerDocument.defaultView||window).getSelection(),r={anchorNode:r.anchorNode,anchorOffset:r.anchorOffset,focusNode:r.focusNode,focusOffset:r.focusOffset}),zr&&kr(zr,r)||(zr=r,r=pi(Rr,`onSelect`),0<r.length&&(t=new On(`onSelect`,`select`,null,t,n),e.push({event:t,listeners:r}),t.target=Lr)))}function Hr(e,t){var n={};return n[e.toLowerCase()]=t.toLowerCase(),n[`Webkit`+e]=`webkit`+t,n[`Moz`+e]=`moz`+t,n}var Ur={animationend:Hr(`Animation`,`AnimationEnd`),animationiteration:Hr(`Animation`,`AnimationIteration`),animationstart:Hr(`Animation`,`AnimationStart`),transitionend:Hr(`Transition`,`TransitionEnd`)},Wr={},Gr={};c&&(Gr=document.createElement(`div`).style,`AnimationEvent`in window||(delete Ur.animationend.animation,delete Ur.animationiteration.animation,delete Ur.animationstart.animation),`TransitionEvent`in window||delete Ur.transitionend.transition);function Kr(e){if(Wr[e])return Wr[e];if(!Ur[e])return e;var t=Ur[e],n;for(n in t)if(t.hasOwnProperty(n)&&n in Gr)return Wr[e]=t[n];return e}var qr=Kr(`animationend`),Jr=Kr(`animationiteration`),Yr=Kr(`animationstart`),Xr=Kr(`transitionend`),Zr=new Map,Qr=`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 $r(e,t){Zr.set(e,t),o(t,[e])}for(var ei=0;ei<Qr.length;ei++){var ti=Qr[ei];$r(ti.toLowerCase(),`on`+(ti[0].toUpperCase()+ti.slice(1)))}$r(qr,`onAnimationEnd`),$r(Jr,`onAnimationIteration`),$r(Yr,`onAnimationStart`),$r(`dblclick`,`onDoubleClick`),$r(`focusin`,`onFocus`),$r(`focusout`,`onBlur`),$r(Xr,`onTransitionEnd`),s(`onMouseEnter`,[`mouseout`,`mouseover`]),s(`onMouseLeave`,[`mouseout`,`mouseover`]),s(`onPointerEnter`,[`pointerout`,`pointerover`]),s(`onPointerLeave`,[`pointerout`,`pointerover`]),o(`onChange`,`change click focusin focusout input keydown keyup selectionchange`.split(` `)),o(`onSelect`,`focusout contextmenu dragend focusin keydown keyup mousedown mouseup selectionchange`.split(` `)),o(`onBeforeInput`,[`compositionend`,`keypress`,`textInput`,`paste`]),o(`onCompositionEnd`,`compositionend focusout keydown keypress keyup mousedown`.split(` `)),o(`onCompositionStart`,`compositionstart focusout keydown keypress keyup mousedown`.split(` `)),o(`onCompositionUpdate`,`compositionupdate focusout keydown keypress keyup mousedown`.split(` `));var ni=`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(` `),ri=new Set(`cancel close invalid load scroll toggle`.split(` `).concat(ni));function ii(e,t,n){var r=e.type||`unknown-event`;e.currentTarget=n,rt(r,t,void 0,e),e.currentTarget=null}function ai(e,t){t=!!(t&4);for(var n=0;n<e.length;n++){var r=e[n],i=r.event;r=r.listeners;a:{var a=void 0;if(t)for(var o=r.length-1;0<=o;o--){var s=r[o],c=s.instance,l=s.currentTarget;if(s=s.listener,c!==a&&i.isPropagationStopped())break a;ii(i,s,l),a=c}else for(o=0;o<r.length;o++){if(s=r[o],c=s.instance,l=s.currentTarget,s=s.listener,c!==a&&i.isPropagationStopped())break a;ii(i,s,l),a=c}}}if($e)throw e=et,$e=!1,et=null,e}function oi(e,t){var n=t[Ii];n===void 0&&(n=t[Ii]=new Set);var r=e+`__bubble`;n.has(r)||(ui(t,e,2,!1),n.add(r))}function si(e,t,n){var r=0;t&&(r|=4),ui(n,e,r,t)}var ci=`_reactListening`+Math.random().toString(36).slice(2);function li(e){if(!e[ci]){e[ci]=!0,i.forEach(function(t){t!==`selectionchange`&&(ri.has(t)||si(t,!1,e),si(t,!0,e))});var t=e.nodeType===9?e:e.ownerDocument;t===null||t[ci]||(t[ci]=!0,si(`selectionchange`,!1,t))}}function ui(e,t,n,r){switch(vn(t)){case 1:var i=pn;break;case 4:i=mn;break;default:i=hn}n=i.bind(null,t,n,e),i=void 0,!Je||t!==`touchstart`&&t!==`touchmove`&&t!==`wheel`||(i=!0),r?i===void 0?e.addEventListener(t,n,!0):e.addEventListener(t,n,{capture:!0,passive:i}):i===void 0?e.addEventListener(t,n,!1):e.addEventListener(t,n,{passive:i})}function di(e,t,n,r,i){var a=r;if(!(t&1)&&!(t&2)&&r!==null)a:for(;;){if(r===null)return;var o=r.tag;if(o===3||o===4){var s=r.stateNode.containerInfo;if(s===i||s.nodeType===8&&s.parentNode===i)break;if(o===4)for(o=r.return;o!==null;){var c=o.tag;if((c===3||c===4)&&(c=o.stateNode.containerInfo,c===i||c.nodeType===8&&c.parentNode===i))return;o=o.return}for(;s!==null;){if(o=zi(s),o===null)return;if(c=o.tag,c===5||c===6){r=a=o;continue a}s=s.parentNode}}r=r.return}Ke(function(){var r=a,i=Ie(n),o=[];a:{var s=Zr.get(e);if(s!==void 0){var c=On,l=e;switch(e){case`keypress`:if(Cn(n)===0)break a;case`keydown`:case`keyup`:c=Kn;break;case`focusin`:l=`focus`,c=Ln;break;case`focusout`:l=`blur`,c=Ln;break;case`beforeblur`:case`afterblur`:c=Ln;break;case`click`:if(n.button===2)break a;case`auxclick`:case`dblclick`:case`mousedown`:case`mousemove`:case`mouseup`:case`mouseout`:case`mouseover`:case`contextmenu`:c=Fn;break;case`drag`:case`dragend`:case`dragenter`:case`dragexit`:case`dragleave`:case`dragover`:case`dragstart`:case`drop`:c=In;break;case`touchcancel`:case`touchend`:case`touchmove`:case`touchstart`:c=Jn;break;case qr:case Jr:case Yr:c=Rn;break;case Xr:c=Yn;break;case`scroll`:c=An;break;case`wheel`:c=Xn;break;case`copy`:case`cut`:case`paste`:c=zn;break;case`gotpointercapture`:case`lostpointercapture`:case`pointercancel`:case`pointerdown`:case`pointermove`:case`pointerout`:case`pointerover`:case`pointerup`:c=qn}var u=!!(t&4),d=!u&&e===`scroll`,f=u?s===null?null:s+`Capture`:s;u=[];for(var p=r,m;p!==null;){m=p;var h=m.stateNode;if(m.tag===5&&h!==null&&(m=h,f!==null&&(h=qe(p,f),h!=null&&u.push(fi(p,h,m)))),d)break;p=p.return}0<u.length&&(s=new c(s,l,null,n,i),o.push({event:s,listeners:u}))}}if(!(t&7)){a:{if(s=e===`mouseover`||e===`pointerover`,c=e===`mouseout`||e===`pointerout`,s&&n!==Fe&&(l=n.relatedTarget||n.fromElement)&&(zi(l)||l[Fi]))break a;if((c||s)&&(s=i.window===i?i:(s=i.ownerDocument)?s.defaultView||s.parentWindow:window,c?(l=n.relatedTarget||n.toElement,c=r,l=l?zi(l):null,l!==null&&(d=it(l),l!==d||l.tag!==5&&l.tag!==6)&&(l=null)):(c=null,l=r),c!==l)){if(u=Fn,h=`onMouseLeave`,f=`onMouseEnter`,p=`mouse`,(e===`pointerout`||e===`pointerover`)&&(u=qn,h=`onPointerLeave`,f=`onPointerEnter`,p=`pointer`),d=c==null?s:Vi(c),m=l==null?s:Vi(l),s=new u(h,p+`leave`,c,n,i),s.target=d,s.relatedTarget=m,h=null,zi(i)===r&&(u=new u(f,p+`enter`,l,n,i),u.target=m,u.relatedTarget=d,h=u),d=h,c&&l)b:{for(u=c,f=l,p=0,m=u;m;m=mi(m))p++;for(m=0,h=f;h;h=mi(h))m++;for(;0<p-m;)u=mi(u),p--;for(;0<m-p;)f=mi(f),m--;for(;p--;){if(u===f||f!==null&&u===f.alternate)break b;u=mi(u),f=mi(f)}u=null}else u=null;c!==null&&hi(o,s,c,u,!1),l!==null&&d!==null&&hi(o,d,l,u,!0)}}a:{if(s=r?Vi(r):window,c=s.nodeName&&s.nodeName.toLowerCase(),c===`select`||c===`input`&&s.type===`file`)var g=gr;else if(ur(s)){if(_r)g=Er;else{g=wr;var _=Cr}}else(c=s.nodeName)&&c.toLowerCase()===`input`&&(s.type===`checkbox`||s.type===`radio`)&&(g=Tr);if(g&&=g(e,r)){dr(o,g,n,i);break a}_&&_(e,s,r),e===`focusout`&&(_=s._wrapperState)&&_.controlled&&s.type===`number`&&ge(s,`number`,s.value)}switch(_=r?Vi(r):window,e){case`focusin`:(ur(_)||_.contentEditable===`true`)&&(Lr=_,Rr=r,zr=null);break;case`focusout`:zr=Rr=Lr=null;break;case`mousedown`:Br=!0;break;case`contextmenu`:case`mouseup`:case`dragend`:Br=!1,Vr(o,n,i);break;case`selectionchange`:if(Ir)break;case`keydown`:case`keyup`:Vr(o,n,i)}var v;if(Qn)b:{switch(e){case`compositionstart`:var y=`onCompositionStart`;break b;case`compositionend`:y=`onCompositionEnd`;break b;case`compositionupdate`:y=`onCompositionUpdate`;break b}y=void 0}else or?ir(e,n)&&(y=`onCompositionEnd`):e===`keydown`&&n.keyCode===229&&(y=`onCompositionStart`);y&&(tr&&n.locale!==`ko`&&(or||y!==`onCompositionStart`?y===`onCompositionEnd`&&or&&(v=Sn()):(yn=i,bn=`value`in yn?yn.value:yn.textContent,or=!0)),_=pi(r,y),0<_.length&&(y=new Bn(y,e,null,n,i),o.push({event:y,listeners:_}),v?y.data=v:(v=ar(n),v!==null&&(y.data=v)))),(v=er?sr(e,n):cr(e,n))&&(r=pi(r,`onBeforeInput`),0<r.length&&(i=new Bn(`onBeforeInput`,`beforeinput`,null,n,i),o.push({event:i,listeners:r}),i.data=v))}ai(o,t)})}function fi(e,t,n){return{instance:e,listener:t,currentTarget:n}}function pi(e,t){for(var n=t+`Capture`,r=[];e!==null;){var i=e,a=i.stateNode;i.tag===5&&a!==null&&(i=a,a=qe(e,n),a!=null&&r.unshift(fi(e,a,i)),a=qe(e,t),a!=null&&r.push(fi(e,a,i))),e=e.return}return r}function mi(e){if(e===null)return null;do e=e.return;while(e&&e.tag!==5);return e||null}function hi(e,t,n,r,i){for(var a=t._reactName,o=[];n!==null&&n!==r;){var s=n,c=s.alternate,l=s.stateNode;if(c!==null&&c===r)break;s.tag===5&&l!==null&&(s=l,i?(c=qe(n,a),c!=null&&o.unshift(fi(n,c,s))):i||(c=qe(n,a),c!=null&&o.push(fi(n,c,s)))),n=n.return}o.length!==0&&e.push({event:t,listeners:o})}var gi=/\r\n?/g,_i=/\u0000|\uFFFD/g;function vi(e){return(typeof e==`string`?e:``+e).replace(gi,`
|
|
6
|
-
`).replace(_i,``)}function yi(e,t,n){if(t=vi(t),vi(e)!==t&&n)throw Error(r(425))}function bi(){}var xi=null,Si=null;function Ci(e,t){return e===`textarea`||e===`noscript`||typeof t.children==`string`||typeof t.children==`number`||typeof t.dangerouslySetInnerHTML==`object`&&t.dangerouslySetInnerHTML!==null&&t.dangerouslySetInnerHTML.__html!=null}var wi=typeof setTimeout==`function`?setTimeout:void 0,Ti=typeof clearTimeout==`function`?clearTimeout:void 0,Ei=typeof Promise==`function`?Promise:void 0,Di=typeof queueMicrotask==`function`?queueMicrotask:Ei===void 0?wi:function(e){return Ei.resolve(null).then(e).catch(Oi)};function Oi(e){setTimeout(function(){throw e})}function ki(e,t){var n=t,r=0;do{var i=n.nextSibling;if(e.removeChild(n),i&&i.nodeType===8){if(n=i.data,n===`/$`){if(r===0){e.removeChild(i),un(t);return}r--}else n!==`$`&&n!==`$?`&&n!==`$!`||r++}n=i}while(n);un(t)}function Ai(e){for(;e!=null;e=e.nextSibling){var t=e.nodeType;if(t===1||t===3)break;if(t===8){if(t=e.data,t===`$`||t===`$!`||t===`$?`)break;if(t===`/$`)return null}}return e}function ji(e){e=e.previousSibling;for(var t=0;e;){if(e.nodeType===8){var n=e.data;if(n===`$`||n===`$!`||n===`$?`){if(t===0)return e;t--}else n===`/$`&&t++}e=e.previousSibling}return null}var Mi=Math.random().toString(36).slice(2),Ni=`__reactFiber$`+Mi,Pi=`__reactProps$`+Mi,Fi=`__reactContainer$`+Mi,Ii=`__reactEvents$`+Mi,Li=`__reactListeners$`+Mi,Ri=`__reactHandles$`+Mi;function zi(e){var t=e[Ni];if(t)return t;for(var n=e.parentNode;n;){if(t=n[Fi]||n[Ni]){if(n=t.alternate,t.child!==null||n!==null&&n.child!==null)for(e=ji(e);e!==null;){if(n=e[Ni])return n;e=ji(e)}return t}e=n,n=e.parentNode}return null}function Bi(e){return e=e[Ni]||e[Fi],!e||e.tag!==5&&e.tag!==6&&e.tag!==13&&e.tag!==3?null:e}function Vi(e){if(e.tag===5||e.tag===6)return e.stateNode;throw Error(r(33))}function Hi(e){return e[Pi]||null}var Ui=[],U=-1;function Wi(e){return{current:e}}function Gi(e){0>U||(e.current=Ui[U],Ui[U]=null,U--)}function Ki(e,t){U++,Ui[U]=e.current,e.current=t}var qi={},Ji=Wi(qi),Yi=Wi(!1),Xi=qi;function Zi(e,t){var n=e.type.contextTypes;if(!n)return qi;var r=e.stateNode;if(r&&r.__reactInternalMemoizedUnmaskedChildContext===t)return r.__reactInternalMemoizedMaskedChildContext;var i={},a;for(a in n)i[a]=t[a];return r&&(e=e.stateNode,e.__reactInternalMemoizedUnmaskedChildContext=t,e.__reactInternalMemoizedMaskedChildContext=i),i}function Qi(e){return e=e.childContextTypes,e!=null}function $i(){Gi(Yi),Gi(Ji)}function ea(e,t,n){if(Ji.current!==qi)throw Error(r(168));Ki(Ji,t),Ki(Yi,n)}function ta(e,t,n){var i=e.stateNode;if(t=t.childContextTypes,typeof i.getChildContext!=`function`)return n;for(var a in i=i.getChildContext(),i)if(!(a in t))throw Error(r(108,oe(e)||`Unknown`,a));return z({},n,i)}function na(e){return e=(e=e.stateNode)&&e.__reactInternalMemoizedMergedChildContext||qi,Xi=Ji.current,Ki(Ji,e),Ki(Yi,Yi.current),!0}function ra(e,t,n){var i=e.stateNode;if(!i)throw Error(r(169));n?(e=ta(e,t,Xi),i.__reactInternalMemoizedMergedChildContext=e,Gi(Yi),Gi(Ji),Ki(Ji,e)):Gi(Yi),Ki(Yi,n)}var ia=null,aa=!1,oa=!1;function sa(e){ia===null?ia=[e]:ia.push(e)}function ca(e){aa=!0,sa(e)}function la(){if(!oa&&ia!==null){oa=!0;var e=0,t=Bt;try{var n=ia;for(Bt=1;e<n.length;e++){var r=n[e];do r=r(!0);while(r!==null)}ia=null,aa=!1}catch(t){throw ia!==null&&(ia=ia.slice(e+1)),ut(gt,la),t}finally{Bt=t,oa=!1}}return null}var ua=[],da=0,fa=null,pa=0,ma=[],ha=0,ga=null,_a=1,va=``;function ya(e,t){ua[da++]=pa,ua[da++]=fa,fa=e,pa=t}function ba(e,t,n){ma[ha++]=_a,ma[ha++]=va,ma[ha++]=ga,ga=e;var r=_a;e=va;var i=32-wt(r)-1;r&=~(1<<i),n+=1;var a=32-wt(t)+i;if(30<a){var o=i-i%5;a=(r&(1<<o)-1).toString(32),r>>=o,i-=o,_a=1<<32-wt(t)+i|n<<i|r,va=a+e}else _a=1<<a|n<<i|r,va=e}function xa(e){e.return!==null&&(ya(e,1),ba(e,1,0))}function Sa(e){for(;e===fa;)fa=ua[--da],ua[da]=null,pa=ua[--da],ua[da]=null;for(;e===ga;)ga=ma[--ha],ma[ha]=null,va=ma[--ha],ma[ha]=null,_a=ma[--ha],ma[ha]=null}var Ca=null,wa=null,Ta=!1,Ea=null;function Da(e,t){var n=nu(5,null,null,0);n.elementType=`DELETED`,n.stateNode=t,n.return=e,t=e.deletions,t===null?(e.deletions=[n],e.flags|=16):t.push(n)}function Oa(e,t){switch(e.tag){case 5:var n=e.type;return t=t.nodeType!==1||n.toLowerCase()!==t.nodeName.toLowerCase()?null:t,t!==null&&(e.stateNode=t,Ca=e,wa=Ai(t.firstChild),!0);case 6:return t=e.pendingProps===``||t.nodeType!==3?null:t,t!==null&&(e.stateNode=t,Ca=e,wa=null,!0);case 13:return t=t.nodeType===8?t:null,t!==null&&(n=ga===null?null:{id:_a,overflow:va},e.memoizedState={dehydrated:t,treeContext:n,retryLane:1073741824},n=nu(18,null,null,0),n.stateNode=t,n.return=e,e.child=n,Ca=e,wa=null,!0);default:return!1}}function ka(e){return!!(e.mode&1)&&!(e.flags&128)}function Aa(e){if(Ta){var t=wa;if(t){var n=t;if(!Oa(e,t)){if(ka(e))throw Error(r(418));t=Ai(n.nextSibling);var i=Ca;t&&Oa(e,t)?Da(i,n):(e.flags=e.flags&-4097|2,Ta=!1,Ca=e)}}else{if(ka(e))throw Error(r(418));e.flags=e.flags&-4097|2,Ta=!1,Ca=e}}}function ja(e){for(e=e.return;e!==null&&e.tag!==5&&e.tag!==3&&e.tag!==13;)e=e.return;Ca=e}function Ma(e){if(e!==Ca)return!1;if(!Ta)return ja(e),Ta=!0,!1;var t;if((t=e.tag!==3)&&!(t=e.tag!==5)&&(t=e.type,t=t!==`head`&&t!==`body`&&!Ci(e.type,e.memoizedProps)),t&&=wa){if(ka(e))throw Na(),Error(r(418));for(;t;)Da(e,t),t=Ai(t.nextSibling)}if(ja(e),e.tag===13){if(e=e.memoizedState,e=e===null?null:e.dehydrated,!e)throw Error(r(317));a:{for(e=e.nextSibling,t=0;e;){if(e.nodeType===8){var n=e.data;if(n===`/$`){if(t===0){wa=Ai(e.nextSibling);break a}t--}else n!==`$`&&n!==`$!`&&n!==`$?`||t++}e=e.nextSibling}wa=null}}else wa=Ca?Ai(e.stateNode.nextSibling):null;return!0}function Na(){for(var e=wa;e;)e=Ai(e.nextSibling)}function Pa(){wa=Ca=null,Ta=!1}function Fa(e){Ea===null?Ea=[e]:Ea.push(e)}var Ia=C.ReactCurrentBatchConfig;function La(e,t,n){if(e=n.ref,e!==null&&typeof e!=`function`&&typeof e!=`object`){if(n._owner){if(n=n._owner,n){if(n.tag!==1)throw Error(r(309));var i=n.stateNode}if(!i)throw Error(r(147,e));var a=i,o=``+e;return t!==null&&t.ref!==null&&typeof t.ref==`function`&&t.ref._stringRef===o?t.ref:(t=function(e){var t=a.refs;e===null?delete t[o]:t[o]=e},t._stringRef=o,t)}if(typeof e!=`string`)throw Error(r(284));if(!n._owner)throw Error(r(290,e))}return e}function Ra(e,t){throw e=Object.prototype.toString.call(t),Error(r(31,e===`[object Object]`?`object with keys {`+Object.keys(t).join(`, `)+`}`:e))}function za(e){var t=e._init;return t(e._payload)}function Ba(e){function t(t,n){if(e){var r=t.deletions;r===null?(t.deletions=[n],t.flags|=16):r.push(n)}}function n(n,r){if(!e)return null;for(;r!==null;)t(n,r),r=r.sibling;return null}function i(e,t){for(e=new Map;t!==null;)t.key===null?e.set(t.index,t):e.set(t.key,t),t=t.sibling;return e}function a(e,t){return e=au(e,t),e.index=0,e.sibling=null,e}function o(t,n,r){return t.index=r,e?(r=t.alternate,r===null?(t.flags|=2,n):(r=r.index,r<n?(t.flags|=2,n):r)):(t.flags|=1048576,n)}function s(t){return e&&t.alternate===null&&(t.flags|=2),t}function c(e,t,n,r){return t===null||t.tag!==6?(t=lu(n,e.mode,r),t.return=e,t):(t=a(t,n),t.return=e,t)}function l(e,t,n,r){var i=n.type;return i===E?d(e,t,n.props.children,r,n.key):t!==null&&(t.elementType===i||typeof i==`object`&&i&&i.$$typeof===F&&za(i)===t.type)?(r=a(t,n.props),r.ref=La(e,t,n),r.return=e,r):(r=ou(n.type,n.key,n.props,null,e.mode,r),r.ref=La(e,t,n),r.return=e,r)}function u(e,t,n,r){return t===null||t.tag!==4||t.stateNode.containerInfo!==n.containerInfo||t.stateNode.implementation!==n.implementation?(t=uu(n,e.mode,r),t.return=e,t):(t=a(t,n.children||[]),t.return=e,t)}function d(e,t,n,r,i){return t===null||t.tag!==7?(t=su(n,e.mode,r,i),t.return=e,t):(t=a(t,n),t.return=e,t)}function f(e,t,n){if(typeof t==`string`&&t!==``||typeof t==`number`)return t=lu(``+t,e.mode,n),t.return=e,t;if(typeof t==`object`&&t){switch(t.$$typeof){case w:return n=ou(t.type,t.key,t.props,null,e.mode,n),n.ref=La(e,null,t),n.return=e,n;case T:return t=uu(t,e.mode,n),t.return=e,t;case F:var r=t._init;return f(e,r(t._payload),n)}if(_e(t)||R(t))return t=su(t,e.mode,n,null),t.return=e,t;Ra(e,t)}return null}function p(e,t,n,r){var i=t===null?null:t.key;if(typeof n==`string`&&n!==``||typeof n==`number`)return i===null?c(e,t,``+n,r):null;if(typeof n==`object`&&n){switch(n.$$typeof){case w:return n.key===i?l(e,t,n,r):null;case T:return n.key===i?u(e,t,n,r):null;case F:return i=n._init,p(e,t,i(n._payload),r)}if(_e(n)||R(n))return i===null?d(e,t,n,r,null):null;Ra(e,n)}return null}function m(e,t,n,r,i){if(typeof r==`string`&&r!==``||typeof r==`number`)return e=e.get(n)||null,c(t,e,``+r,i);if(typeof r==`object`&&r){switch(r.$$typeof){case w:return e=e.get(r.key===null?n:r.key)||null,l(t,e,r,i);case T:return e=e.get(r.key===null?n:r.key)||null,u(t,e,r,i);case F:var a=r._init;return m(e,t,n,a(r._payload),i)}if(_e(r)||R(r))return e=e.get(n)||null,d(t,e,r,i,null);Ra(t,r)}return null}function h(r,a,s,c){for(var l=null,u=null,d=a,h=a=0,g=null;d!==null&&h<s.length;h++){d.index>h?(g=d,d=null):g=d.sibling;var _=p(r,d,s[h],c);if(_===null){d===null&&(d=g);break}e&&d&&_.alternate===null&&t(r,d),a=o(_,a,h),u===null?l=_:u.sibling=_,u=_,d=g}if(h===s.length)return n(r,d),Ta&&ya(r,h),l;if(d===null){for(;h<s.length;h++)d=f(r,s[h],c),d!==null&&(a=o(d,a,h),u===null?l=d:u.sibling=d,u=d);return Ta&&ya(r,h),l}for(d=i(r,d);h<s.length;h++)g=m(d,r,h,s[h],c),g!==null&&(e&&g.alternate!==null&&d.delete(g.key===null?h:g.key),a=o(g,a,h),u===null?l=g:u.sibling=g,u=g);return e&&d.forEach(function(e){return t(r,e)}),Ta&&ya(r,h),l}function g(a,s,c,l){var u=R(c);if(typeof u!=`function`)throw Error(r(150));if(c=u.call(c),c==null)throw Error(r(151));for(var d=u=null,h=s,g=s=0,_=null,v=c.next();h!==null&&!v.done;g++,v=c.next()){h.index>g?(_=h,h=null):_=h.sibling;var y=p(a,h,v.value,l);if(y===null){h===null&&(h=_);break}e&&h&&y.alternate===null&&t(a,h),s=o(y,s,g),d===null?u=y:d.sibling=y,d=y,h=_}if(v.done)return n(a,h),Ta&&ya(a,g),u;if(h===null){for(;!v.done;g++,v=c.next())v=f(a,v.value,l),v!==null&&(s=o(v,s,g),d===null?u=v:d.sibling=v,d=v);return Ta&&ya(a,g),u}for(h=i(a,h);!v.done;g++,v=c.next())v=m(h,a,g,v.value,l),v!==null&&(e&&v.alternate!==null&&h.delete(v.key===null?g:v.key),s=o(v,s,g),d===null?u=v:d.sibling=v,d=v);return e&&h.forEach(function(e){return t(a,e)}),Ta&&ya(a,g),u}function _(e,r,i,o){if(typeof i==`object`&&i&&i.type===E&&i.key===null&&(i=i.props.children),typeof i==`object`&&i){switch(i.$$typeof){case w:a:{for(var c=i.key,l=r;l!==null;){if(l.key===c){if(c=i.type,c===E){if(l.tag===7){n(e,l.sibling),r=a(l,i.props.children),r.return=e,e=r;break a}}else if(l.elementType===c||typeof c==`object`&&c&&c.$$typeof===F&&za(c)===l.type){n(e,l.sibling),r=a(l,i.props),r.ref=La(e,l,i),r.return=e,e=r;break a}n(e,l);break}t(e,l),l=l.sibling}i.type===E?(r=su(i.props.children,e.mode,o,i.key),r.return=e,e=r):(o=ou(i.type,i.key,i.props,null,e.mode,o),o.ref=La(e,r,i),o.return=e,e=o)}return s(e);case T:a:{for(l=i.key;r!==null;){if(r.key===l){if(r.tag===4&&r.stateNode.containerInfo===i.containerInfo&&r.stateNode.implementation===i.implementation){n(e,r.sibling),r=a(r,i.children||[]),r.return=e,e=r;break a}n(e,r);break}t(e,r),r=r.sibling}r=uu(i,e.mode,o),r.return=e,e=r}return s(e);case F:return l=i._init,_(e,r,l(i._payload),o)}if(_e(i))return h(e,r,i,o);if(R(i))return g(e,r,i,o);Ra(e,i)}return typeof i==`string`&&i!==``||typeof i==`number`?(i=``+i,r!==null&&r.tag===6?(n(e,r.sibling),r=a(r,i),r.return=e,e=r):(n(e,r),r=lu(i,e.mode,o),r.return=e,e=r),s(e)):n(e,r)}return _}var Va=Ba(!0),Ha=Ba(!1),Ua=Wi(null),Wa=null,Ga=null,Ka=null;function qa(){Ka=Ga=Wa=null}function Ja(e){var t=Ua.current;Gi(Ua),e._currentValue=t}function Ya(e,t,n){for(;e!==null;){var r=e.alternate;if((e.childLanes&t)===t?r!==null&&(r.childLanes&t)!==t&&(r.childLanes|=t):(e.childLanes|=t,r!==null&&(r.childLanes|=t)),e===n)break;e=e.return}}function Xa(e,t){Wa=e,Ka=Ga=null,e=e.dependencies,e!==null&&e.firstContext!==null&&((e.lanes&t)!==0&&(Bs=!0),e.firstContext=null)}function Za(e){var t=e._currentValue;if(Ka!==e){if(e={context:e,memoizedValue:t,next:null},Ga===null){if(Wa===null)throw Error(r(308));Ga=e,Wa.dependencies={lanes:0,firstContext:e}}else Ga=Ga.next=e}return t}var Qa=null;function $a(e){Qa===null?Qa=[e]:Qa.push(e)}function eo(e,t,n,r){var i=t.interleaved;return i===null?(n.next=n,$a(t)):(n.next=i.next,i.next=n),t.interleaved=n,to(e,r)}function to(e,t){e.lanes|=t;var n=e.alternate;for(n!==null&&(n.lanes|=t),n=e,e=e.return;e!==null;)e.childLanes|=t,n=e.alternate,n!==null&&(n.childLanes|=t),n=e,e=e.return;return n.tag===3?n.stateNode:null}var no=!1;function ro(e){e.updateQueue={baseState:e.memoizedState,firstBaseUpdate:null,lastBaseUpdate:null,shared:{pending:null,interleaved:null,lanes:0},effects:null}}function io(e,t){e=e.updateQueue,t.updateQueue===e&&(t.updateQueue={baseState:e.baseState,firstBaseUpdate:e.firstBaseUpdate,lastBaseUpdate:e.lastBaseUpdate,shared:e.shared,effects:e.effects})}function ao(e,t){return{eventTime:e,lane:t,tag:0,payload:null,callback:null,next:null}}function oo(e,t,n){var r=e.updateQueue;if(r===null)return null;if(r=r.shared,Xc&2){var i=r.pending;return i===null?t.next=t:(t.next=i.next,i.next=t),r.pending=t,to(e,n)}return i=r.interleaved,i===null?(t.next=t,$a(r)):(t.next=i.next,i.next=t),r.interleaved=t,to(e,n)}function so(e,t,n){if(t=t.updateQueue,t!==null&&(t=t.shared,n&4194240)){var r=t.lanes;r&=e.pendingLanes,n|=r,t.lanes=n,zt(e,n)}}function co(e,t){var n=e.updateQueue,r=e.alternate;if(r!==null&&(r=r.updateQueue,n===r)){var i=null,a=null;if(n=n.firstBaseUpdate,n!==null){do{var o={eventTime:n.eventTime,lane:n.lane,tag:n.tag,payload:n.payload,callback:n.callback,next:null};a===null?i=a=o:a=a.next=o,n=n.next}while(n!==null);a===null?i=a=t:a=a.next=t}else i=a=t;n={baseState:r.baseState,firstBaseUpdate:i,lastBaseUpdate:a,shared:r.shared,effects:r.effects},e.updateQueue=n}else e=n.lastBaseUpdate,e===null?n.firstBaseUpdate=t:e.next=t,n.lastBaseUpdate=t}function lo(e,t,n,r){var i=e.updateQueue;no=!1;var a=i.firstBaseUpdate,o=i.lastBaseUpdate,s=i.shared.pending;if(s!==null){i.shared.pending=null;var c=s,l=c.next;c.next=null,o===null?a=l:o.next=l,o=c;var u=e.alternate;u!==null&&(u=u.updateQueue,s=u.lastBaseUpdate,s!==o&&(s===null?u.firstBaseUpdate=l:s.next=l,u.lastBaseUpdate=c))}if(a!==null){var d=i.baseState;o=0,u=l=c=null,s=a;do{var f=s.lane,p=s.eventTime;if((r&f)===f){u!==null&&(u=u.next={eventTime:p,lane:0,tag:s.tag,payload:s.payload,callback:s.callback,next:null});a:{var m=e,h=s;switch(f=t,p=n,h.tag){case 1:if(m=h.payload,typeof m==`function`){d=m.call(p,d,f);break a}d=m;break a;case 3:m.flags=m.flags&-65537|128;case 0:if(m=h.payload,f=typeof m==`function`?m.call(p,d,f):m,f==null)break a;d=z({},d,f);break a;case 2:no=!0}}s.callback!==null&&s.lane!==0&&(e.flags|=64,f=i.effects,f===null?i.effects=[s]:f.push(s))}else p={eventTime:p,lane:f,tag:s.tag,payload:s.payload,callback:s.callback,next:null},u===null?(l=u=p,c=d):u=u.next=p,o|=f;if(s=s.next,s===null){if(s=i.shared.pending,s===null)break;f=s,s=f.next,f.next=null,i.lastBaseUpdate=f,i.shared.pending=null}}while(1);if(u===null&&(c=d),i.baseState=c,i.firstBaseUpdate=l,i.lastBaseUpdate=u,t=i.shared.interleaved,t!==null){i=t;do o|=i.lane,i=i.next;while(i!==t)}else a===null&&(i.shared.lanes=0);il|=o,e.lanes=o,e.memoizedState=d}}function uo(e,t,n){if(e=t.effects,t.effects=null,e!==null)for(t=0;t<e.length;t++){var i=e[t],a=i.callback;if(a!==null){if(i.callback=null,i=n,typeof a!=`function`)throw Error(r(191,a));a.call(i)}}}var fo={},po=Wi(fo),mo=Wi(fo),ho=Wi(fo);function go(e){if(e===fo)throw Error(r(174));return e}function _o(e,t){switch(Ki(ho,t),Ki(mo,e),Ki(po,fo),e=t.nodeType,e){case 9:case 11:t=(t=t.documentElement)?t.namespaceURI:we(null,``);break;default:e=e===8?t.parentNode:t,t=e.namespaceURI||null,e=e.tagName,t=we(t,e)}Gi(po),Ki(po,t)}function vo(){Gi(po),Gi(mo),Gi(ho)}function yo(e){go(ho.current);var t=go(po.current),n=we(t,e.type);t!==n&&(Ki(mo,e),Ki(po,n))}function bo(e){mo.current===e&&(Gi(po),Gi(mo))}var xo=Wi(0);function So(e){for(var t=e;t!==null;){if(t.tag===13){var n=t.memoizedState;if(n!==null&&(n=n.dehydrated,n===null||n.data===`$?`||n.data===`$!`))return t}else if(t.tag===19&&t.memoizedProps.revealOrder!==void 0){if(t.flags&128)return t}else if(t.child!==null){t.child.return=t,t=t.child;continue}if(t===e)break;for(;t.sibling===null;){if(t.return===null||t.return===e)return null;t=t.return}t.sibling.return=t.return,t=t.sibling}return null}var Co=[];function wo(){for(var e=0;e<Co.length;e++)Co[e]._workInProgressVersionPrimary=null;Co.length=0}var To=C.ReactCurrentDispatcher,Eo=C.ReactCurrentBatchConfig,Do=0,Oo=null,ko=null,Ao=null,jo=!1,Mo=!1,No=0,Po=0;function Fo(){throw Error(r(321))}function Io(e,t){if(t===null)return!1;for(var n=0;n<t.length&&n<e.length;n++)if(!Or(e[n],t[n]))return!1;return!0}function Lo(e,t,n,i,a,o){if(Do=o,Oo=t,t.memoizedState=null,t.updateQueue=null,t.lanes=0,To.current=e===null||e.memoizedState===null?bs:xs,e=n(i,a),Mo){o=0;do{if(Mo=!1,No=0,25<=o)throw Error(r(301));o+=1,Ao=ko=null,t.updateQueue=null,To.current=Ss,e=n(i,a)}while(Mo)}if(To.current=ys,t=ko!==null&&ko.next!==null,Do=0,Ao=ko=Oo=null,jo=!1,t)throw Error(r(300));return e}function Ro(){var e=No!==0;return No=0,e}function zo(){var e={memoizedState:null,baseState:null,baseQueue:null,queue:null,next:null};return Ao===null?Oo.memoizedState=Ao=e:Ao=Ao.next=e,Ao}function Bo(){if(ko===null){var e=Oo.alternate;e=e===null?null:e.memoizedState}else e=ko.next;var t=Ao===null?Oo.memoizedState:Ao.next;if(t!==null)Ao=t,ko=e;else{if(e===null)throw Error(r(310));ko=e,e={memoizedState:ko.memoizedState,baseState:ko.baseState,baseQueue:ko.baseQueue,queue:ko.queue,next:null},Ao===null?Oo.memoizedState=Ao=e:Ao=Ao.next=e}return Ao}function Vo(e,t){return typeof t==`function`?t(e):t}function Ho(e){var t=Bo(),n=t.queue;if(n===null)throw Error(r(311));n.lastRenderedReducer=e;var i=ko,a=i.baseQueue,o=n.pending;if(o!==null){if(a!==null){var s=a.next;a.next=o.next,o.next=s}i.baseQueue=a=o,n.pending=null}if(a!==null){o=a.next,i=i.baseState;var c=s=null,l=null,u=o;do{var d=u.lane;if((Do&d)===d)l!==null&&(l=l.next={lane:0,action:u.action,hasEagerState:u.hasEagerState,eagerState:u.eagerState,next:null}),i=u.hasEagerState?u.eagerState:e(i,u.action);else{var f={lane:d,action:u.action,hasEagerState:u.hasEagerState,eagerState:u.eagerState,next:null};l===null?(c=l=f,s=i):l=l.next=f,Oo.lanes|=d,il|=d}u=u.next}while(u!==null&&u!==o);l===null?s=i:l.next=c,Or(i,t.memoizedState)||(Bs=!0),t.memoizedState=i,t.baseState=s,t.baseQueue=l,n.lastRenderedState=i}if(e=n.interleaved,e!==null){a=e;do o=a.lane,Oo.lanes|=o,il|=o,a=a.next;while(a!==e)}else a===null&&(n.lanes=0);return[t.memoizedState,n.dispatch]}function Uo(e){var t=Bo(),n=t.queue;if(n===null)throw Error(r(311));n.lastRenderedReducer=e;var i=n.dispatch,a=n.pending,o=t.memoizedState;if(a!==null){n.pending=null;var s=a=a.next;do o=e(o,s.action),s=s.next;while(s!==a);Or(o,t.memoizedState)||(Bs=!0),t.memoizedState=o,t.baseQueue===null&&(t.baseState=o),n.lastRenderedState=o}return[o,i]}function Wo(){}function Go(e,t){var n=Oo,i=Bo(),a=t(),o=!Or(i.memoizedState,a);if(o&&(i.memoizedState=a,Bs=!0),i=i.queue,rs(Jo.bind(null,n,i,e),[e]),i.getSnapshot!==t||o||Ao!==null&&Ao.memoizedState.tag&1){if(n.flags|=2048,Qo(9,qo.bind(null,n,i,a,t),void 0,null),Zc===null)throw Error(r(349));Do&30||Ko(n,t,a)}return a}function Ko(e,t,n){e.flags|=16384,e={getSnapshot:t,value:n},t=Oo.updateQueue,t===null?(t={lastEffect:null,stores:null},Oo.updateQueue=t,t.stores=[e]):(n=t.stores,n===null?t.stores=[e]:n.push(e))}function qo(e,t,n,r){t.value=n,t.getSnapshot=r,Yo(t)&&Xo(e)}function Jo(e,t,n){return n(function(){Yo(t)&&Xo(e)})}function Yo(e){var t=e.getSnapshot;e=e.value;try{var n=t();return!Or(e,n)}catch{return!0}}function Xo(e){var t=to(e,1);t!==null&&wl(t,e,1,-1)}function Zo(e){var t=zo();return typeof e==`function`&&(e=e()),t.memoizedState=t.baseState=e,e={pending:null,interleaved:null,lanes:0,dispatch:null,lastRenderedReducer:Vo,lastRenderedState:e},t.queue=e,e=e.dispatch=hs.bind(null,Oo,e),[t.memoizedState,e]}function Qo(e,t,n,r){return e={tag:e,create:t,destroy:n,deps:r,next:null},t=Oo.updateQueue,t===null?(t={lastEffect:null,stores:null},Oo.updateQueue=t,t.lastEffect=e.next=e):(n=t.lastEffect,n===null?t.lastEffect=e.next=e:(r=n.next,n.next=e,e.next=r,t.lastEffect=e)),e}function $o(){return Bo().memoizedState}function es(e,t,n,r){var i=zo();Oo.flags|=e,i.memoizedState=Qo(1|t,n,void 0,r===void 0?null:r)}function ts(e,t,n,r){var i=Bo();r=r===void 0?null:r;var a=void 0;if(ko!==null){var o=ko.memoizedState;if(a=o.destroy,r!==null&&Io(r,o.deps)){i.memoizedState=Qo(t,n,a,r);return}}Oo.flags|=e,i.memoizedState=Qo(1|t,n,a,r)}function ns(e,t){return es(8390656,8,e,t)}function rs(e,t){return ts(2048,8,e,t)}function is(e,t){return ts(4,2,e,t)}function as(e,t){return ts(4,4,e,t)}function os(e,t){if(typeof t==`function`)return e=e(),t(e),function(){t(null)};if(t!=null)return e=e(),t.current=e,function(){t.current=null}}function ss(e,t,n){return n=n==null?null:n.concat([e]),ts(4,4,os.bind(null,t,e),n)}function cs(){}function ls(e,t){var n=Bo();t=t===void 0?null:t;var r=n.memoizedState;return r!==null&&t!==null&&Io(t,r[1])?r[0]:(n.memoizedState=[e,t],e)}function us(e,t){var n=Bo();t=t===void 0?null:t;var r=n.memoizedState;return r!==null&&t!==null&&Io(t,r[1])?r[0]:(e=e(),n.memoizedState=[e,t],e)}function ds(e,t,n){return Do&21?(Or(n,t)||(n=Ft(),Oo.lanes|=n,il|=n,e.baseState=!0),t):(e.baseState&&(e.baseState=!1,Bs=!0),e.memoizedState=n)}function fs(e,t){var n=Bt;Bt=n!==0&&4>n?n:4,e(!0);var r=Eo.transition;Eo.transition={};try{e(!1),t()}finally{Bt=n,Eo.transition=r}}function ps(){return Bo().memoizedState}function ms(e,t,n){var r=Cl(e);if(n={lane:r,action:n,hasEagerState:!1,eagerState:null,next:null},gs(e))_s(t,n);else if(n=eo(e,t,n,r),n!==null){var i=Sl();wl(n,e,r,i),vs(n,t,r)}}function hs(e,t,n){var r=Cl(e),i={lane:r,action:n,hasEagerState:!1,eagerState:null,next:null};if(gs(e))_s(t,i);else{var a=e.alternate;if(e.lanes===0&&(a===null||a.lanes===0)&&(a=t.lastRenderedReducer,a!==null))try{var o=t.lastRenderedState,s=a(o,n);if(i.hasEagerState=!0,i.eagerState=s,Or(s,o)){var c=t.interleaved;c===null?(i.next=i,$a(t)):(i.next=c.next,c.next=i),t.interleaved=i;return}}catch{}n=eo(e,t,i,r),n!==null&&(i=Sl(),wl(n,e,r,i),vs(n,t,r))}}function gs(e){var t=e.alternate;return e===Oo||t!==null&&t===Oo}function _s(e,t){Mo=jo=!0;var n=e.pending;n===null?t.next=t:(t.next=n.next,n.next=t),e.pending=t}function vs(e,t,n){if(n&4194240){var r=t.lanes;r&=e.pendingLanes,n|=r,t.lanes=n,zt(e,n)}}var ys={readContext:Za,useCallback:Fo,useContext:Fo,useEffect:Fo,useImperativeHandle:Fo,useInsertionEffect:Fo,useLayoutEffect:Fo,useMemo:Fo,useReducer:Fo,useRef:Fo,useState:Fo,useDebugValue:Fo,useDeferredValue:Fo,useTransition:Fo,useMutableSource:Fo,useSyncExternalStore:Fo,useId:Fo,unstable_isNewReconciler:!1},bs={readContext:Za,useCallback:function(e,t){return zo().memoizedState=[e,t===void 0?null:t],e},useContext:Za,useEffect:ns,useImperativeHandle:function(e,t,n){return n=n==null?null:n.concat([e]),es(4194308,4,os.bind(null,t,e),n)},useLayoutEffect:function(e,t){return es(4194308,4,e,t)},useInsertionEffect:function(e,t){return es(4,2,e,t)},useMemo:function(e,t){var n=zo();return t=t===void 0?null:t,e=e(),n.memoizedState=[e,t],e},useReducer:function(e,t,n){var r=zo();return t=n===void 0?t:n(t),r.memoizedState=r.baseState=t,e={pending:null,interleaved:null,lanes:0,dispatch:null,lastRenderedReducer:e,lastRenderedState:t},r.queue=e,e=e.dispatch=ms.bind(null,Oo,e),[r.memoizedState,e]},useRef:function(e){var t=zo();return e={current:e},t.memoizedState=e},useState:Zo,useDebugValue:cs,useDeferredValue:function(e){return zo().memoizedState=e},useTransition:function(){var e=Zo(!1),t=e[0];return e=fs.bind(null,e[1]),zo().memoizedState=e,[t,e]},useMutableSource:function(){},useSyncExternalStore:function(e,t,n){var i=Oo,a=zo();if(Ta){if(n===void 0)throw Error(r(407));n=n()}else{if(n=t(),Zc===null)throw Error(r(349));Do&30||Ko(i,t,n)}a.memoizedState=n;var o={value:n,getSnapshot:t};return a.queue=o,ns(Jo.bind(null,i,o,e),[e]),i.flags|=2048,Qo(9,qo.bind(null,i,o,n,t),void 0,null),n},useId:function(){var e=zo(),t=Zc.identifierPrefix;if(Ta){var n=va,r=_a;n=(r&~(1<<32-wt(r)-1)).toString(32)+n,t=`:`+t+`R`+n,n=No++,0<n&&(t+=`H`+n.toString(32)),t+=`:`}else n=Po++,t=`:`+t+`r`+n.toString(32)+`:`;return e.memoizedState=t},unstable_isNewReconciler:!1},xs={readContext:Za,useCallback:ls,useContext:Za,useEffect:rs,useImperativeHandle:ss,useInsertionEffect:is,useLayoutEffect:as,useMemo:us,useReducer:Ho,useRef:$o,useState:function(){return Ho(Vo)},useDebugValue:cs,useDeferredValue:function(e){return ds(Bo(),ko.memoizedState,e)},useTransition:function(){return[Ho(Vo)[0],Bo().memoizedState]},useMutableSource:Wo,useSyncExternalStore:Go,useId:ps,unstable_isNewReconciler:!1},Ss={readContext:Za,useCallback:ls,useContext:Za,useEffect:rs,useImperativeHandle:ss,useInsertionEffect:is,useLayoutEffect:as,useMemo:us,useReducer:Uo,useRef:$o,useState:function(){return Uo(Vo)},useDebugValue:cs,useDeferredValue:function(e){var t=Bo();return ko===null?t.memoizedState=e:ds(t,ko.memoizedState,e)},useTransition:function(){return[Uo(Vo)[0],Bo().memoizedState]},useMutableSource:Wo,useSyncExternalStore:Go,useId:ps,unstable_isNewReconciler:!1};function Cs(e,t){if(e&&e.defaultProps){for(var n in t=z({},t),e=e.defaultProps,e)t[n]===void 0&&(t[n]=e[n]);return t}return t}function ws(e,t,n,r){t=e.memoizedState,n=n(r,t),n=n==null?t:z({},t,n),e.memoizedState=n,e.lanes===0&&(e.updateQueue.baseState=n)}var Ts={isMounted:function(e){return(e=e._reactInternals)?it(e)===e:!1},enqueueSetState:function(e,t,n){e=e._reactInternals;var r=Sl(),i=Cl(e),a=ao(r,i);a.payload=t,n!=null&&(a.callback=n),t=oo(e,a,i),t!==null&&(wl(t,e,i,r),so(t,e,i))},enqueueReplaceState:function(e,t,n){e=e._reactInternals;var r=Sl(),i=Cl(e),a=ao(r,i);a.tag=1,a.payload=t,n!=null&&(a.callback=n),t=oo(e,a,i),t!==null&&(wl(t,e,i,r),so(t,e,i))},enqueueForceUpdate:function(e,t){e=e._reactInternals;var n=Sl(),r=Cl(e),i=ao(n,r);i.tag=2,t!=null&&(i.callback=t),t=oo(e,i,r),t!==null&&(wl(t,e,r,n),so(t,e,r))}};function Es(e,t,n,r,i,a,o){return e=e.stateNode,typeof e.shouldComponentUpdate==`function`?e.shouldComponentUpdate(r,a,o):t.prototype&&t.prototype.isPureReactComponent?!kr(n,r)||!kr(i,a):!0}function Ds(e,t,n){var r=!1,i=qi,a=t.contextType;return typeof a==`object`&&a?a=Za(a):(i=Qi(t)?Xi:Ji.current,r=t.contextTypes,a=(r=r!=null)?Zi(e,i):qi),t=new t(n,a),e.memoizedState=t.state!==null&&t.state!==void 0?t.state:null,t.updater=Ts,e.stateNode=t,t._reactInternals=e,r&&(e=e.stateNode,e.__reactInternalMemoizedUnmaskedChildContext=i,e.__reactInternalMemoizedMaskedChildContext=a),t}function Os(e,t,n,r){e=t.state,typeof t.componentWillReceiveProps==`function`&&t.componentWillReceiveProps(n,r),typeof t.UNSAFE_componentWillReceiveProps==`function`&&t.UNSAFE_componentWillReceiveProps(n,r),t.state!==e&&Ts.enqueueReplaceState(t,t.state,null)}function ks(e,t,n,r){var i=e.stateNode;i.props=n,i.state=e.memoizedState,i.refs={},ro(e);var a=t.contextType;typeof a==`object`&&a?i.context=Za(a):(a=Qi(t)?Xi:Ji.current,i.context=Zi(e,a)),i.state=e.memoizedState,a=t.getDerivedStateFromProps,typeof a==`function`&&(ws(e,t,a,n),i.state=e.memoizedState),typeof t.getDerivedStateFromProps==`function`||typeof i.getSnapshotBeforeUpdate==`function`||typeof i.UNSAFE_componentWillMount!=`function`&&typeof i.componentWillMount!=`function`||(t=i.state,typeof i.componentWillMount==`function`&&i.componentWillMount(),typeof i.UNSAFE_componentWillMount==`function`&&i.UNSAFE_componentWillMount(),t!==i.state&&Ts.enqueueReplaceState(i,i.state,null),lo(e,n,i,r),i.state=e.memoizedState),typeof i.componentDidMount==`function`&&(e.flags|=4194308)}function As(e,t){try{var n=``,r=t;do n+=ie(r),r=r.return;while(r);var i=n}catch(e){i=`
|
|
7
|
-
Error generating stack: `+e.message+`
|
|
8
|
-
`+e.stack}return{value:e,source:t,stack:i,digest:null}}function js(e,t,n){return{value:e,source:null,stack:n??null,digest:t??null}}function Ms(e,t){try{console.error(t.value)}catch(e){setTimeout(function(){throw e})}}var Ns=typeof WeakMap==`function`?WeakMap:Map;function Ps(e,t,n){n=ao(-1,n),n.tag=3,n.payload={element:null};var r=t.value;return n.callback=function(){fl||(fl=!0,pl=r),Ms(e,t)},n}function Fs(e,t,n){n=ao(-1,n),n.tag=3;var r=e.type.getDerivedStateFromError;if(typeof r==`function`){var i=t.value;n.payload=function(){return r(i)},n.callback=function(){Ms(e,t)}}var a=e.stateNode;return a!==null&&typeof a.componentDidCatch==`function`&&(n.callback=function(){Ms(e,t),typeof r!=`function`&&(ml===null?ml=new Set([this]):ml.add(this));var n=t.stack;this.componentDidCatch(t.value,{componentStack:n===null?``:n})}),n}function Is(e,t,n){var r=e.pingCache;if(r===null){r=e.pingCache=new Ns;var i=new Set;r.set(t,i)}else i=r.get(t),i===void 0&&(i=new Set,r.set(t,i));i.has(n)||(i.add(n),e=Yl.bind(null,e,t,n),t.then(e,e))}function Ls(e){do{var t;if((t=e.tag===13)&&(t=e.memoizedState,t=t===null||t.dehydrated!==null),t)return e;e=e.return}while(e!==null);return null}function Rs(e,t,n,r,i){return e.mode&1?(e.flags|=65536,e.lanes=i,e):(e===t?e.flags|=65536:(e.flags|=128,n.flags|=131072,n.flags&=-52805,n.tag===1&&(n.alternate===null?n.tag=17:(t=ao(-1,1),t.tag=2,oo(n,t,1))),n.lanes|=1),e)}var zs=C.ReactCurrentOwner,Bs=!1;function Vs(e,t,n,r){t.child=e===null?Ha(t,null,n,r):Va(t,e.child,n,r)}function Hs(e,t,n,r,i){n=n.render;var a=t.ref;return Xa(t,i),r=Lo(e,t,n,r,a,i),n=Ro(),e!==null&&!Bs?(t.updateQueue=e.updateQueue,t.flags&=-2053,e.lanes&=~i,cc(e,t,i)):(Ta&&n&&xa(t),t.flags|=1,Vs(e,t,r,i),t.child)}function Us(e,t,n,r,i){if(e===null){var a=n.type;return typeof a==`function`&&!ru(a)&&a.defaultProps===void 0&&n.compare===null&&n.defaultProps===void 0?(t.tag=15,t.type=a,Ws(e,t,a,r,i)):(e=ou(n.type,null,r,t,t.mode,i),e.ref=t.ref,e.return=t,t.child=e)}if(a=e.child,(e.lanes&i)===0){var o=a.memoizedProps;if(n=n.compare,n=n===null?kr:n,n(o,r)&&e.ref===t.ref)return cc(e,t,i)}return t.flags|=1,e=au(a,r),e.ref=t.ref,e.return=t,t.child=e}function Ws(e,t,n,r,i){if(e!==null){var a=e.memoizedProps;if(kr(a,r)&&e.ref===t.ref){if(Bs=!1,t.pendingProps=r=a,(e.lanes&i)!==0)e.flags&131072&&(Bs=!0);else return t.lanes=e.lanes,cc(e,t,i)}}return qs(e,t,n,r,i)}function Gs(e,t,n){var r=t.pendingProps,i=r.children,a=e===null?null:e.memoizedState;if(r.mode===`hidden`){if(!(t.mode&1))t.memoizedState={baseLanes:0,cachePool:null,transitions:null},Ki(tl,el),el|=n;else{if(!(n&1073741824))return e=a===null?n:a.baseLanes|n,t.lanes=t.childLanes=1073741824,t.memoizedState={baseLanes:e,cachePool:null,transitions:null},t.updateQueue=null,Ki(tl,el),el|=e,null;t.memoizedState={baseLanes:0,cachePool:null,transitions:null},r=a===null?n:a.baseLanes,Ki(tl,el),el|=r}}else a===null?r=n:(r=a.baseLanes|n,t.memoizedState=null),Ki(tl,el),el|=r;return Vs(e,t,i,n),t.child}function Ks(e,t){var n=t.ref;(e===null&&n!==null||e!==null&&e.ref!==n)&&(t.flags|=512,t.flags|=2097152)}function qs(e,t,n,r,i){var a=Qi(n)?Xi:Ji.current;return a=Zi(t,a),Xa(t,i),n=Lo(e,t,n,r,a,i),r=Ro(),e!==null&&!Bs?(t.updateQueue=e.updateQueue,t.flags&=-2053,e.lanes&=~i,cc(e,t,i)):(Ta&&r&&xa(t),t.flags|=1,Vs(e,t,n,i),t.child)}function Js(e,t,n,r,i){if(Qi(n)){var a=!0;na(t)}else a=!1;if(Xa(t,i),t.stateNode===null)sc(e,t),Ds(t,n,r),ks(t,n,r,i),r=!0;else if(e===null){var o=t.stateNode,s=t.memoizedProps;o.props=s;var c=o.context,l=n.contextType;typeof l==`object`&&l?l=Za(l):(l=Qi(n)?Xi:Ji.current,l=Zi(t,l));var u=n.getDerivedStateFromProps,d=typeof u==`function`||typeof o.getSnapshotBeforeUpdate==`function`;d||typeof o.UNSAFE_componentWillReceiveProps!=`function`&&typeof o.componentWillReceiveProps!=`function`||(s!==r||c!==l)&&Os(t,o,r,l),no=!1;var f=t.memoizedState;o.state=f,lo(t,r,o,i),c=t.memoizedState,s!==r||f!==c||Yi.current||no?(typeof u==`function`&&(ws(t,n,u,r),c=t.memoizedState),(s=no||Es(t,n,s,r,f,c,l))?(d||typeof o.UNSAFE_componentWillMount!=`function`&&typeof o.componentWillMount!=`function`||(typeof o.componentWillMount==`function`&&o.componentWillMount(),typeof o.UNSAFE_componentWillMount==`function`&&o.UNSAFE_componentWillMount()),typeof o.componentDidMount==`function`&&(t.flags|=4194308)):(typeof o.componentDidMount==`function`&&(t.flags|=4194308),t.memoizedProps=r,t.memoizedState=c),o.props=r,o.state=c,o.context=l,r=s):(typeof o.componentDidMount==`function`&&(t.flags|=4194308),r=!1)}else{o=t.stateNode,io(e,t),s=t.memoizedProps,l=t.type===t.elementType?s:Cs(t.type,s),o.props=l,d=t.pendingProps,f=o.context,c=n.contextType,typeof c==`object`&&c?c=Za(c):(c=Qi(n)?Xi:Ji.current,c=Zi(t,c));var p=n.getDerivedStateFromProps;(u=typeof p==`function`||typeof o.getSnapshotBeforeUpdate==`function`)||typeof o.UNSAFE_componentWillReceiveProps!=`function`&&typeof o.componentWillReceiveProps!=`function`||(s!==d||f!==c)&&Os(t,o,r,c),no=!1,f=t.memoizedState,o.state=f,lo(t,r,o,i);var m=t.memoizedState;s!==d||f!==m||Yi.current||no?(typeof p==`function`&&(ws(t,n,p,r),m=t.memoizedState),(l=no||Es(t,n,l,r,f,m,c)||!1)?(u||typeof o.UNSAFE_componentWillUpdate!=`function`&&typeof o.componentWillUpdate!=`function`||(typeof o.componentWillUpdate==`function`&&o.componentWillUpdate(r,m,c),typeof o.UNSAFE_componentWillUpdate==`function`&&o.UNSAFE_componentWillUpdate(r,m,c)),typeof o.componentDidUpdate==`function`&&(t.flags|=4),typeof o.getSnapshotBeforeUpdate==`function`&&(t.flags|=1024)):(typeof o.componentDidUpdate!=`function`||s===e.memoizedProps&&f===e.memoizedState||(t.flags|=4),typeof o.getSnapshotBeforeUpdate!=`function`||s===e.memoizedProps&&f===e.memoizedState||(t.flags|=1024),t.memoizedProps=r,t.memoizedState=m),o.props=r,o.state=m,o.context=c,r=l):(typeof o.componentDidUpdate!=`function`||s===e.memoizedProps&&f===e.memoizedState||(t.flags|=4),typeof o.getSnapshotBeforeUpdate!=`function`||s===e.memoizedProps&&f===e.memoizedState||(t.flags|=1024),r=!1)}return Ys(e,t,n,r,a,i)}function Ys(e,t,n,r,i,a){Ks(e,t);var o=!!(t.flags&128);if(!r&&!o)return i&&ra(t,n,!1),cc(e,t,a);r=t.stateNode,zs.current=t;var s=o&&typeof n.getDerivedStateFromError!=`function`?null:r.render();return t.flags|=1,e!==null&&o?(t.child=Va(t,e.child,null,a),t.child=Va(t,null,s,a)):Vs(e,t,s,a),t.memoizedState=r.state,i&&ra(t,n,!0),t.child}function Xs(e){var t=e.stateNode;t.pendingContext?ea(e,t.pendingContext,t.pendingContext!==t.context):t.context&&ea(e,t.context,!1),_o(e,t.containerInfo)}function Zs(e,t,n,r,i){return Pa(),Fa(i),t.flags|=256,Vs(e,t,n,r),t.child}var Qs={dehydrated:null,treeContext:null,retryLane:0};function $s(e){return{baseLanes:e,cachePool:null,transitions:null}}function ec(e,t,n){var r=t.pendingProps,i=xo.current,a=!1,o=!!(t.flags&128),s;if((s=o)||(s=e!==null&&e.memoizedState===null?!1:!!(i&2)),s?(a=!0,t.flags&=-129):(e===null||e.memoizedState!==null)&&(i|=1),Ki(xo,i&1),e===null)return Aa(t),e=t.memoizedState,e!==null&&(e=e.dehydrated,e!==null)?(t.lanes=t.mode&1?e.data===`$!`?8:1073741824:1,null):(o=r.children,e=r.fallback,a?(r=t.mode,a=t.child,o={mode:`hidden`,children:o},!(r&1)&&a!==null?(a.childLanes=0,a.pendingProps=o):a=cu(o,r,0,null),e=su(e,r,n,null),a.return=t,e.return=t,a.sibling=e,t.child=a,t.child.memoizedState=$s(n),t.memoizedState=Qs,e):tc(t,o));if(i=e.memoizedState,i!==null&&(s=i.dehydrated,s!==null))return rc(e,t,o,r,s,i,n);if(a){a=r.fallback,o=t.mode,i=e.child,s=i.sibling;var c={mode:`hidden`,children:r.children};return!(o&1)&&t.child!==i?(r=t.child,r.childLanes=0,r.pendingProps=c,t.deletions=null):(r=au(i,c),r.subtreeFlags=i.subtreeFlags&14680064),s===null?(a=su(a,o,n,null),a.flags|=2):a=au(s,a),a.return=t,r.return=t,r.sibling=a,t.child=r,r=a,a=t.child,o=e.child.memoizedState,o=o===null?$s(n):{baseLanes:o.baseLanes|n,cachePool:null,transitions:o.transitions},a.memoizedState=o,a.childLanes=e.childLanes&~n,t.memoizedState=Qs,r}return a=e.child,e=a.sibling,r=au(a,{mode:`visible`,children:r.children}),!(t.mode&1)&&(r.lanes=n),r.return=t,r.sibling=null,e!==null&&(n=t.deletions,n===null?(t.deletions=[e],t.flags|=16):n.push(e)),t.child=r,t.memoizedState=null,r}function tc(e,t){return t=cu({mode:`visible`,children:t},e.mode,0,null),t.return=e,e.child=t}function nc(e,t,n,r){return r!==null&&Fa(r),Va(t,e.child,null,n),e=tc(t,t.pendingProps.children),e.flags|=2,t.memoizedState=null,e}function rc(e,t,n,i,a,o,s){if(n)return t.flags&256?(t.flags&=-257,i=js(Error(r(422))),nc(e,t,s,i)):t.memoizedState===null?(o=i.fallback,a=t.mode,i=cu({mode:`visible`,children:i.children},a,0,null),o=su(o,a,s,null),o.flags|=2,i.return=t,o.return=t,i.sibling=o,t.child=i,t.mode&1&&Va(t,e.child,null,s),t.child.memoizedState=$s(s),t.memoizedState=Qs,o):(t.child=e.child,t.flags|=128,null);if(!(t.mode&1))return nc(e,t,s,null);if(a.data===`$!`){if(i=a.nextSibling&&a.nextSibling.dataset,i)var c=i.dgst;return i=c,o=Error(r(419)),i=js(o,i,void 0),nc(e,t,s,i)}if(c=(s&e.childLanes)!==0,Bs||c){if(i=Zc,i!==null){switch(s&-s){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&(i.suspendedLanes|s))===0?a:0,a!==0&&a!==o.retryLane&&(o.retryLane=a,to(e,a),wl(i,e,a,-1))}return Rl(),i=js(Error(r(421))),nc(e,t,s,i)}return a.data===`$?`?(t.flags|=128,t.child=e.child,t=Zl.bind(null,e),a._reactRetry=t,null):(e=o.treeContext,wa=Ai(a.nextSibling),Ca=t,Ta=!0,Ea=null,e!==null&&(ma[ha++]=_a,ma[ha++]=va,ma[ha++]=ga,_a=e.id,va=e.overflow,ga=t),t=tc(t,i.children),t.flags|=4096,t)}function ic(e,t,n){e.lanes|=t;var r=e.alternate;r!==null&&(r.lanes|=t),Ya(e.return,t,n)}function ac(e,t,n,r,i){var a=e.memoizedState;a===null?e.memoizedState={isBackwards:t,rendering:null,renderingStartTime:0,last:r,tail:n,tailMode:i}:(a.isBackwards=t,a.rendering=null,a.renderingStartTime=0,a.last=r,a.tail=n,a.tailMode=i)}function oc(e,t,n){var r=t.pendingProps,i=r.revealOrder,a=r.tail;if(Vs(e,t,r.children,n),r=xo.current,r&2)r=r&1|2,t.flags|=128;else{if(e!==null&&e.flags&128)a:for(e=t.child;e!==null;){if(e.tag===13)e.memoizedState!==null&&ic(e,n,t);else if(e.tag===19)ic(e,n,t);else if(e.child!==null){e.child.return=e,e=e.child;continue}if(e===t)break a;for(;e.sibling===null;){if(e.return===null||e.return===t)break a;e=e.return}e.sibling.return=e.return,e=e.sibling}r&=1}if(Ki(xo,r),!(t.mode&1))t.memoizedState=null;else switch(i){case`forwards`:for(n=t.child,i=null;n!==null;)e=n.alternate,e!==null&&So(e)===null&&(i=n),n=n.sibling;n=i,n===null?(i=t.child,t.child=null):(i=n.sibling,n.sibling=null),ac(t,!1,i,n,a);break;case`backwards`:for(n=null,i=t.child,t.child=null;i!==null;){if(e=i.alternate,e!==null&&So(e)===null){t.child=i;break}e=i.sibling,i.sibling=n,n=i,i=e}ac(t,!0,n,null,a);break;case`together`:ac(t,!1,null,null,void 0);break;default:t.memoizedState=null}return t.child}function sc(e,t){!(t.mode&1)&&e!==null&&(e.alternate=null,t.alternate=null,t.flags|=2)}function cc(e,t,n){if(e!==null&&(t.dependencies=e.dependencies),il|=t.lanes,(n&t.childLanes)===0)return null;if(e!==null&&t.child!==e.child)throw Error(r(153));if(t.child!==null){for(e=t.child,n=au(e,e.pendingProps),t.child=n,n.return=t;e.sibling!==null;)e=e.sibling,n=n.sibling=au(e,e.pendingProps),n.return=t;n.sibling=null}return t.child}function lc(e,t,n){switch(t.tag){case 3:Xs(t),Pa();break;case 5:yo(t);break;case 1:Qi(t.type)&&na(t);break;case 4:_o(t,t.stateNode.containerInfo);break;case 10:var r=t.type._context,i=t.memoizedProps.value;Ki(Ua,r._currentValue),r._currentValue=i;break;case 13:if(r=t.memoizedState,r!==null)return r.dehydrated===null?(n&t.child.childLanes)===0?(Ki(xo,xo.current&1),e=cc(e,t,n),e===null?null:e.sibling):ec(e,t,n):(Ki(xo,xo.current&1),t.flags|=128,null);Ki(xo,xo.current&1);break;case 19:if(r=(n&t.childLanes)!==0,e.flags&128){if(r)return oc(e,t,n);t.flags|=128}if(i=t.memoizedState,i!==null&&(i.rendering=null,i.tail=null,i.lastEffect=null),Ki(xo,xo.current),r)break;return null;case 22:case 23:return t.lanes=0,Gs(e,t,n)}return cc(e,t,n)}var uc=function(e,t){for(var n=t.child;n!==null;){if(n.tag===5||n.tag===6)e.appendChild(n.stateNode);else if(n.tag!==4&&n.child!==null){n.child.return=n,n=n.child;continue}if(n===t)break;for(;n.sibling===null;){if(n.return===null||n.return===t)return;n=n.return}n.sibling.return=n.return,n=n.sibling}},dc=function(e,t,n,r){var i=e.memoizedProps;if(i!==r){e=t.stateNode,go(po.current);var o=null;switch(n){case`input`:i=V(e,i),r=V(e,r),o=[];break;case`select`:i=z({},i,{value:void 0}),r=z({},r,{value:void 0}),o=[];break;case`textarea`:i=ye(e,i),r=ye(e,r),o=[];break;default:typeof i.onClick!=`function`&&typeof r.onClick==`function`&&(e.onclick=bi)}Ne(n,r);var s;for(u in n=null,i)if(!r.hasOwnProperty(u)&&i.hasOwnProperty(u)&&i[u]!=null){if(u===`style`){var c=i[u];for(s in c)c.hasOwnProperty(s)&&(n||={},n[s]=``)}else u!==`dangerouslySetInnerHTML`&&u!==`children`&&u!==`suppressContentEditableWarning`&&u!==`suppressHydrationWarning`&&u!==`autoFocus`&&(a.hasOwnProperty(u)?o||=[]:(o||=[]).push(u,null))}for(u in r){var l=r[u];if(c=i?.[u],r.hasOwnProperty(u)&&l!==c&&(l!=null||c!=null)){if(u===`style`){if(c){for(s in c)!c.hasOwnProperty(s)||l&&l.hasOwnProperty(s)||(n||={},n[s]=``);for(s in l)l.hasOwnProperty(s)&&c[s]!==l[s]&&(n||={},n[s]=l[s])}else n||(o||=[],o.push(u,n)),n=l}else u===`dangerouslySetInnerHTML`?(l=l?l.__html:void 0,c=c?c.__html:void 0,l!=null&&c!==l&&(o||=[]).push(u,l)):u===`children`?typeof l!=`string`&&typeof l!=`number`||(o||=[]).push(u,``+l):u!==`suppressContentEditableWarning`&&u!==`suppressHydrationWarning`&&(a.hasOwnProperty(u)?(l!=null&&u===`onScroll`&&oi(`scroll`,e),o||c===l||(o=[])):(o||=[]).push(u,l))}}n&&(o||=[]).push(`style`,n);var u=o;(t.updateQueue=u)&&(t.flags|=4)}},fc=function(e,t,n,r){n!==r&&(t.flags|=4)};function pc(e,t){if(!Ta)switch(e.tailMode){case`hidden`:t=e.tail;for(var n=null;t!==null;)t.alternate!==null&&(n=t),t=t.sibling;n===null?e.tail=null:n.sibling=null;break;case`collapsed`:n=e.tail;for(var r=null;n!==null;)n.alternate!==null&&(r=n),n=n.sibling;r===null?t||e.tail===null?e.tail=null:e.tail.sibling=null:r.sibling=null}}function mc(e){var t=e.alternate!==null&&e.alternate.child===e.child,n=0,r=0;if(t)for(var i=e.child;i!==null;)n|=i.lanes|i.childLanes,r|=i.subtreeFlags&14680064,r|=i.flags&14680064,i.return=e,i=i.sibling;else for(i=e.child;i!==null;)n|=i.lanes|i.childLanes,r|=i.subtreeFlags,r|=i.flags,i.return=e,i=i.sibling;return e.subtreeFlags|=r,e.childLanes=n,t}function hc(e,t,n){var i=t.pendingProps;switch(Sa(t),t.tag){case 2:case 16:case 15:case 0:case 11:case 7:case 8:case 12:case 9:case 14:return mc(t),null;case 1:return Qi(t.type)&&$i(),mc(t),null;case 3:return i=t.stateNode,vo(),Gi(Yi),Gi(Ji),wo(),i.pendingContext&&(i.context=i.pendingContext,i.pendingContext=null),(e===null||e.child===null)&&(Ma(t)?t.flags|=4:e===null||e.memoizedState.isDehydrated&&!(t.flags&256)||(t.flags|=1024,Ea!==null&&(Ol(Ea),Ea=null))),mc(t),null;case 5:bo(t);var o=go(ho.current);if(n=t.type,e!==null&&t.stateNode!=null)dc(e,t,n,i,o),e.ref!==t.ref&&(t.flags|=512,t.flags|=2097152);else{if(!i){if(t.stateNode===null)throw Error(r(166));return mc(t),null}if(e=go(po.current),Ma(t)){i=t.stateNode,n=t.type;var s=t.memoizedProps;switch(i[Ni]=t,i[Pi]=s,e=!!(t.mode&1),n){case`dialog`:oi(`cancel`,i),oi(`close`,i);break;case`iframe`:case`object`:case`embed`:oi(`load`,i);break;case`video`:case`audio`:for(o=0;o<ni.length;o++)oi(ni[o],i);break;case`source`:oi(`error`,i);break;case`img`:case`image`:case`link`:oi(`error`,i),oi(`load`,i);break;case`details`:oi(`toggle`,i);break;case`input`:fe(i,s),oi(`invalid`,i);break;case`select`:i._wrapperState={wasMultiple:!!s.multiple},oi(`invalid`,i);break;case`textarea`:be(i,s),oi(`invalid`,i)}for(var c in Ne(n,s),o=null,s)if(s.hasOwnProperty(c)){var l=s[c];c===`children`?typeof l==`string`?i.textContent!==l&&(!0!==s.suppressHydrationWarning&&yi(i.textContent,l,e),o=[`children`,l]):typeof l==`number`&&i.textContent!==``+l&&(!0!==s.suppressHydrationWarning&&yi(i.textContent,l,e),o=[`children`,``+l]):a.hasOwnProperty(c)&&l!=null&&c===`onScroll`&&oi(`scroll`,i)}switch(n){case`input`:le(i),he(i,s,!0);break;case`textarea`:le(i),Se(i);break;case`select`:case`option`:break;default:typeof s.onClick==`function`&&(i.onclick=bi)}i=o,t.updateQueue=i,i!==null&&(t.flags|=4)}else{c=o.nodeType===9?o:o.ownerDocument,e===`http://www.w3.org/1999/xhtml`&&(e=Ce(n)),e===`http://www.w3.org/1999/xhtml`?n===`script`?(e=c.createElement(`div`),e.innerHTML=`<script><\/script>`,e=e.removeChild(e.firstChild)):typeof i.is==`string`?e=c.createElement(n,{is:i.is}):(e=c.createElement(n),n===`select`&&(c=e,i.multiple?c.multiple=!0:i.size&&(c.size=i.size))):e=c.createElementNS(e,n),e[Ni]=t,e[Pi]=i,uc(e,t,!1,!1),t.stateNode=e;a:{switch(c=Pe(n,i),n){case`dialog`:oi(`cancel`,e),oi(`close`,e),o=i;break;case`iframe`:case`object`:case`embed`:oi(`load`,e),o=i;break;case`video`:case`audio`:for(o=0;o<ni.length;o++)oi(ni[o],e);o=i;break;case`source`:oi(`error`,e),o=i;break;case`img`:case`image`:case`link`:oi(`error`,e),oi(`load`,e),o=i;break;case`details`:oi(`toggle`,e),o=i;break;case`input`:fe(e,i),o=V(e,i),oi(`invalid`,e);break;case`option`:o=i;break;case`select`:e._wrapperState={wasMultiple:!!i.multiple},o=z({},i,{value:void 0}),oi(`invalid`,e);break;case`textarea`:be(e,i),o=ye(e,i),oi(`invalid`,e);break;default:o=i}for(s in Ne(n,o),l=o,l)if(l.hasOwnProperty(s)){var u=l[s];s===`style`?je(e,u):s===`dangerouslySetInnerHTML`?(u=u?u.__html:void 0,u!=null&&Ee(e,u)):s===`children`?typeof u==`string`?(n!==`textarea`||u!==``)&&De(e,u):typeof u==`number`&&De(e,``+u):s!==`suppressContentEditableWarning`&&s!==`suppressHydrationWarning`&&s!==`autoFocus`&&(a.hasOwnProperty(s)?u!=null&&s===`onScroll`&&oi(`scroll`,e):u!=null&&S(e,s,u,c))}switch(n){case`input`:le(e),he(e,i,!1);break;case`textarea`:le(e),Se(e);break;case`option`:i.value!=null&&e.setAttribute(`value`,``+se(i.value));break;case`select`:e.multiple=!!i.multiple,s=i.value,s==null?i.defaultValue!=null&&ve(e,!!i.multiple,i.defaultValue,!0):ve(e,!!i.multiple,s,!1);break;default:typeof o.onClick==`function`&&(e.onclick=bi)}switch(n){case`button`:case`input`:case`select`:case`textarea`:i=!!i.autoFocus;break a;case`img`:i=!0;break a;default:i=!1}}i&&(t.flags|=4)}t.ref!==null&&(t.flags|=512,t.flags|=2097152)}return mc(t),null;case 6:if(e&&t.stateNode!=null)fc(e,t,e.memoizedProps,i);else{if(typeof i!=`string`&&t.stateNode===null)throw Error(r(166));if(n=go(ho.current),go(po.current),Ma(t)){if(i=t.stateNode,n=t.memoizedProps,i[Ni]=t,(s=i.nodeValue!==n)&&(e=Ca,e!==null))switch(e.tag){case 3:yi(i.nodeValue,n,!!(e.mode&1));break;case 5:!0!==e.memoizedProps.suppressHydrationWarning&&yi(i.nodeValue,n,!!(e.mode&1))}s&&(t.flags|=4)}else i=(n.nodeType===9?n:n.ownerDocument).createTextNode(i),i[Ni]=t,t.stateNode=i}return mc(t),null;case 13:if(Gi(xo),i=t.memoizedState,e===null||e.memoizedState!==null&&e.memoizedState.dehydrated!==null){if(Ta&&wa!==null&&t.mode&1&&!(t.flags&128))Na(),Pa(),t.flags|=98560,s=!1;else if(s=Ma(t),i!==null&&i.dehydrated!==null){if(e===null){if(!s)throw Error(r(318));if(s=t.memoizedState,s=s===null?null:s.dehydrated,!s)throw Error(r(317));s[Ni]=t}else Pa(),!(t.flags&128)&&(t.memoizedState=null),t.flags|=4;mc(t),s=!1}else Ea!==null&&(Ol(Ea),Ea=null),s=!0;if(!s)return t.flags&65536?t:null}return t.flags&128?(t.lanes=n,t):(i=i!==null,i!==(e!==null&&e.memoizedState!==null)&&i&&(t.child.flags|=8192,t.mode&1&&(e===null||xo.current&1?nl===0&&(nl=3):Rl())),t.updateQueue!==null&&(t.flags|=4),mc(t),null);case 4:return vo(),e===null&&li(t.stateNode.containerInfo),mc(t),null;case 10:return Ja(t.type._context),mc(t),null;case 17:return Qi(t.type)&&$i(),mc(t),null;case 19:if(Gi(xo),s=t.memoizedState,s===null)return mc(t),null;if(i=!!(t.flags&128),c=s.rendering,c===null){if(i)pc(s,!1);else{if(nl!==0||e!==null&&e.flags&128)for(e=t.child;e!==null;){if(c=So(e),c!==null){for(t.flags|=128,pc(s,!1),i=c.updateQueue,i!==null&&(t.updateQueue=i,t.flags|=4),t.subtreeFlags=0,i=n,n=t.child;n!==null;)s=n,e=i,s.flags&=14680066,c=s.alternate,c===null?(s.childLanes=0,s.lanes=e,s.child=null,s.subtreeFlags=0,s.memoizedProps=null,s.memoizedState=null,s.updateQueue=null,s.dependencies=null,s.stateNode=null):(s.childLanes=c.childLanes,s.lanes=c.lanes,s.child=c.child,s.subtreeFlags=0,s.deletions=null,s.memoizedProps=c.memoizedProps,s.memoizedState=c.memoizedState,s.updateQueue=c.updateQueue,s.type=c.type,e=c.dependencies,s.dependencies=e===null?null:{lanes:e.lanes,firstContext:e.firstContext}),n=n.sibling;return Ki(xo,xo.current&1|2),t.child}e=e.sibling}s.tail!==null&&mt()>ul&&(t.flags|=128,i=!0,pc(s,!1),t.lanes=4194304)}}else{if(!i){if(e=So(c),e!==null){if(t.flags|=128,i=!0,n=e.updateQueue,n!==null&&(t.updateQueue=n,t.flags|=4),pc(s,!0),s.tail===null&&s.tailMode===`hidden`&&!c.alternate&&!Ta)return mc(t),null}else 2*mt()-s.renderingStartTime>ul&&n!==1073741824&&(t.flags|=128,i=!0,pc(s,!1),t.lanes=4194304)}s.isBackwards?(c.sibling=t.child,t.child=c):(n=s.last,n===null?t.child=c:n.sibling=c,s.last=c)}return s.tail===null?(mc(t),null):(t=s.tail,s.rendering=t,s.tail=t.sibling,s.renderingStartTime=mt(),t.sibling=null,n=xo.current,Ki(xo,i?n&1|2:n&1),t);case 22:case 23:return Pl(),i=t.memoizedState!==null,e!==null&&e.memoizedState!==null!==i&&(t.flags|=8192),i&&t.mode&1?el&1073741824&&(mc(t),t.subtreeFlags&6&&(t.flags|=8192)):mc(t),null;case 24:return null;case 25:return null}throw Error(r(156,t.tag))}function gc(e,t){switch(Sa(t),t.tag){case 1:return Qi(t.type)&&$i(),e=t.flags,e&65536?(t.flags=e&-65537|128,t):null;case 3:return vo(),Gi(Yi),Gi(Ji),wo(),e=t.flags,e&65536&&!(e&128)?(t.flags=e&-65537|128,t):null;case 5:return bo(t),null;case 13:if(Gi(xo),e=t.memoizedState,e!==null&&e.dehydrated!==null){if(t.alternate===null)throw Error(r(340));Pa()}return e=t.flags,e&65536?(t.flags=e&-65537|128,t):null;case 19:return Gi(xo),null;case 4:return vo(),null;case 10:return Ja(t.type._context),null;case 22:case 23:return Pl(),null;case 24:return null;default:return null}}var _c=!1,vc=!1,yc=typeof WeakSet==`function`?WeakSet:Set,bc=null;function xc(e,t){var n=e.ref;if(n!==null){if(typeof n==`function`)try{n(null)}catch(n){Jl(e,t,n)}else n.current=null}}function Sc(e,t,n){try{n()}catch(n){Jl(e,t,n)}}var Cc=!1;function wc(e,t){if(xi=fn,e=Nr(),Pr(e)){if(`selectionStart`in e)var n={start:e.selectionStart,end:e.selectionEnd};else a:{n=(n=e.ownerDocument)&&n.defaultView||window;var i=n.getSelection&&n.getSelection();if(i&&i.rangeCount!==0){n=i.anchorNode;var a=i.anchorOffset,o=i.focusNode;i=i.focusOffset;try{n.nodeType,o.nodeType}catch{n=null;break a}var s=0,c=-1,l=-1,u=0,d=0,f=e,p=null;b:for(;;){for(var m;f!==n||a!==0&&f.nodeType!==3||(c=s+a),f!==o||i!==0&&f.nodeType!==3||(l=s+i),f.nodeType===3&&(s+=f.nodeValue.length),(m=f.firstChild)!==null;)p=f,f=m;for(;;){if(f===e)break b;if(p===n&&++u===a&&(c=s),p===o&&++d===i&&(l=s),(m=f.nextSibling)!==null)break;f=p,p=f.parentNode}f=m}n=c===-1||l===-1?null:{start:c,end:l}}else n=null}n||={start:0,end:0}}else n=null;for(Si={focusedElem:e,selectionRange:n},fn=!1,bc=t;bc!==null;)if(t=bc,e=t.child,t.subtreeFlags&1028&&e!==null)e.return=t,bc=e;else for(;bc!==null;){t=bc;try{var h=t.alternate;if(t.flags&1024)switch(t.tag){case 0:case 11:case 15:break;case 1:if(h!==null){var g=h.memoizedProps,_=h.memoizedState,v=t.stateNode;v.__reactInternalSnapshotBeforeUpdate=v.getSnapshotBeforeUpdate(t.elementType===t.type?g:Cs(t.type,g),_)}break;case 3:var y=t.stateNode.containerInfo;y.nodeType===1?y.textContent=``:y.nodeType===9&&y.documentElement&&y.removeChild(y.documentElement);break;case 5:case 6:case 4:case 17:break;default:throw Error(r(163))}}catch(e){Jl(t,t.return,e)}if(e=t.sibling,e!==null){e.return=t.return,bc=e;break}bc=t.return}return h=Cc,Cc=!1,h}function Tc(e,t,n){var r=t.updateQueue;if(r=r===null?null:r.lastEffect,r!==null){var i=r=r.next;do{if((i.tag&e)===e){var a=i.destroy;i.destroy=void 0,a!==void 0&&Sc(t,n,a)}i=i.next}while(i!==r)}}function Ec(e,t){if(t=t.updateQueue,t=t===null?null:t.lastEffect,t!==null){var n=t=t.next;do{if((n.tag&e)===e){var r=n.create;n.destroy=r()}n=n.next}while(n!==t)}}function Dc(e){var t=e.ref;if(t!==null){var n=e.stateNode;switch(e.tag){case 5:e=n;break;default:e=n}typeof t==`function`?t(e):t.current=e}}function Oc(e){var t=e.alternate;t!==null&&(e.alternate=null,Oc(t)),e.child=null,e.deletions=null,e.sibling=null,e.tag===5&&(t=e.stateNode,t!==null&&(delete t[Ni],delete t[Pi],delete t[Ii],delete t[Li],delete t[Ri])),e.stateNode=null,e.return=null,e.dependencies=null,e.memoizedProps=null,e.memoizedState=null,e.pendingProps=null,e.stateNode=null,e.updateQueue=null}function kc(e){return e.tag===5||e.tag===3||e.tag===4}function Ac(e){a:for(;;){for(;e.sibling===null;){if(e.return===null||kc(e.return))return null;e=e.return}for(e.sibling.return=e.return,e=e.sibling;e.tag!==5&&e.tag!==6&&e.tag!==18;){if(e.flags&2||e.child===null||e.tag===4)continue a;e.child.return=e,e=e.child}if(!(e.flags&2))return e.stateNode}}function jc(e,t,n){var r=e.tag;if(r===5||r===6)e=e.stateNode,t?n.nodeType===8?n.parentNode.insertBefore(e,t):n.insertBefore(e,t):(n.nodeType===8?(t=n.parentNode,t.insertBefore(e,n)):(t=n,t.appendChild(e)),n=n._reactRootContainer,n!=null||t.onclick!==null||(t.onclick=bi));else if(r!==4&&(e=e.child,e!==null))for(jc(e,t,n),e=e.sibling;e!==null;)jc(e,t,n),e=e.sibling}function Mc(e,t,n){var r=e.tag;if(r===5||r===6)e=e.stateNode,t?n.insertBefore(e,t):n.appendChild(e);else if(r!==4&&(e=e.child,e!==null))for(Mc(e,t,n),e=e.sibling;e!==null;)Mc(e,t,n),e=e.sibling}var Nc=null,Pc=!1;function Fc(e,t,n){for(n=n.child;n!==null;)Ic(e,t,n),n=n.sibling}function Ic(e,t,n){if(St&&typeof St.onCommitFiberUnmount==`function`)try{St.onCommitFiberUnmount(xt,n)}catch{}switch(n.tag){case 5:vc||xc(n,t);case 6:var r=Nc,i=Pc;Nc=null,Fc(e,t,n),Nc=r,Pc=i,Nc!==null&&(Pc?(e=Nc,n=n.stateNode,e.nodeType===8?e.parentNode.removeChild(n):e.removeChild(n)):Nc.removeChild(n.stateNode));break;case 18:Nc!==null&&(Pc?(e=Nc,n=n.stateNode,e.nodeType===8?ki(e.parentNode,n):e.nodeType===1&&ki(e,n),un(e)):ki(Nc,n.stateNode));break;case 4:r=Nc,i=Pc,Nc=n.stateNode.containerInfo,Pc=!0,Fc(e,t,n),Nc=r,Pc=i;break;case 0:case 11:case 14:case 15:if(!vc&&(r=n.updateQueue,r!==null&&(r=r.lastEffect,r!==null))){i=r=r.next;do{var a=i,o=a.destroy;a=a.tag,o!==void 0&&(a&2||a&4)&&Sc(n,t,o),i=i.next}while(i!==r)}Fc(e,t,n);break;case 1:if(!vc&&(xc(n,t),r=n.stateNode,typeof r.componentWillUnmount==`function`))try{r.props=n.memoizedProps,r.state=n.memoizedState,r.componentWillUnmount()}catch(e){Jl(n,t,e)}Fc(e,t,n);break;case 21:Fc(e,t,n);break;case 22:n.mode&1?(vc=(r=vc)||n.memoizedState!==null,Fc(e,t,n),vc=r):Fc(e,t,n);break;default:Fc(e,t,n)}}function Lc(e){var t=e.updateQueue;if(t!==null){e.updateQueue=null;var n=e.stateNode;n===null&&(n=e.stateNode=new yc),t.forEach(function(t){var r=Ql.bind(null,e,t);n.has(t)||(n.add(t),t.then(r,r))})}}function Rc(e,t){var n=t.deletions;if(n!==null)for(var i=0;i<n.length;i++){var a=n[i];try{var o=e,s=t,c=s;a:for(;c!==null;){switch(c.tag){case 5:Nc=c.stateNode,Pc=!1;break a;case 3:Nc=c.stateNode.containerInfo,Pc=!0;break a;case 4:Nc=c.stateNode.containerInfo,Pc=!0;break a}c=c.return}if(Nc===null)throw Error(r(160));Ic(o,s,a),Nc=null,Pc=!1;var l=a.alternate;l!==null&&(l.return=null),a.return=null}catch(e){Jl(a,t,e)}}if(t.subtreeFlags&12854)for(t=t.child;t!==null;)zc(t,e),t=t.sibling}function zc(e,t){var n=e.alternate,i=e.flags;switch(e.tag){case 0:case 11:case 14:case 15:if(Rc(t,e),Bc(e),i&4){try{Tc(3,e,e.return),Ec(3,e)}catch(t){Jl(e,e.return,t)}try{Tc(5,e,e.return)}catch(t){Jl(e,e.return,t)}}break;case 1:Rc(t,e),Bc(e),i&512&&n!==null&&xc(n,n.return);break;case 5:if(Rc(t,e),Bc(e),i&512&&n!==null&&xc(n,n.return),e.flags&32){var a=e.stateNode;try{De(a,``)}catch(t){Jl(e,e.return,t)}}if(i&4&&(a=e.stateNode,a!=null)){var o=e.memoizedProps,s=n===null?o:n.memoizedProps,c=e.type,l=e.updateQueue;if(e.updateQueue=null,l!==null)try{c===`input`&&o.type===`radio`&&o.name!=null&&pe(a,o),Pe(c,s);var u=Pe(c,o);for(s=0;s<l.length;s+=2){var d=l[s],f=l[s+1];d===`style`?je(a,f):d===`dangerouslySetInnerHTML`?Ee(a,f):d===`children`?De(a,f):S(a,d,f,u)}switch(c){case`input`:me(a,o);break;case`textarea`:xe(a,o);break;case`select`:var p=a._wrapperState.wasMultiple;a._wrapperState.wasMultiple=!!o.multiple;var m=o.value;m==null?p!==!!o.multiple&&(o.defaultValue==null?ve(a,!!o.multiple,o.multiple?[]:``,!1):ve(a,!!o.multiple,o.defaultValue,!0)):ve(a,!!o.multiple,m,!1)}a[Pi]=o}catch(t){Jl(e,e.return,t)}}break;case 6:if(Rc(t,e),Bc(e),i&4){if(e.stateNode===null)throw Error(r(162));a=e.stateNode,o=e.memoizedProps;try{a.nodeValue=o}catch(t){Jl(e,e.return,t)}}break;case 3:if(Rc(t,e),Bc(e),i&4&&n!==null&&n.memoizedState.isDehydrated)try{un(t.containerInfo)}catch(t){Jl(e,e.return,t)}break;case 4:Rc(t,e),Bc(e);break;case 13:Rc(t,e),Bc(e),a=e.child,a.flags&8192&&(o=a.memoizedState!==null,a.stateNode.isHidden=o,!o||a.alternate!==null&&a.alternate.memoizedState!==null||(ll=mt())),i&4&&Lc(e);break;case 22:if(d=n!==null&&n.memoizedState!==null,e.mode&1?(vc=(u=vc)||d,Rc(t,e),vc=u):Rc(t,e),Bc(e),i&8192){if(u=e.memoizedState!==null,(e.stateNode.isHidden=u)&&!d&&e.mode&1)for(bc=e,d=e.child;d!==null;){for(f=bc=d;bc!==null;){switch(p=bc,m=p.child,p.tag){case 0:case 11:case 14:case 15:Tc(4,p,p.return);break;case 1:xc(p,p.return);var h=p.stateNode;if(typeof h.componentWillUnmount==`function`){i=p,n=p.return;try{t=i,h.props=t.memoizedProps,h.state=t.memoizedState,h.componentWillUnmount()}catch(e){Jl(i,n,e)}}break;case 5:xc(p,p.return);break;case 22:if(p.memoizedState!==null){Wc(f);continue}}m===null?Wc(f):(m.return=p,bc=m)}d=d.sibling}a:for(d=null,f=e;;){if(f.tag===5){if(d===null){d=f;try{a=f.stateNode,u?(o=a.style,typeof o.setProperty==`function`?o.setProperty(`display`,`none`,`important`):o.display=`none`):(c=f.stateNode,l=f.memoizedProps.style,s=l!=null&&l.hasOwnProperty(`display`)?l.display:null,c.style.display=Ae(`display`,s))}catch(t){Jl(e,e.return,t)}}}else if(f.tag===6){if(d===null)try{f.stateNode.nodeValue=u?``:f.memoizedProps}catch(t){Jl(e,e.return,t)}}else if((f.tag!==22&&f.tag!==23||f.memoizedState===null||f===e)&&f.child!==null){f.child.return=f,f=f.child;continue}if(f===e)break a;for(;f.sibling===null;){if(f.return===null||f.return===e)break a;d===f&&(d=null),f=f.return}d===f&&(d=null),f.sibling.return=f.return,f=f.sibling}}break;case 19:Rc(t,e),Bc(e),i&4&&Lc(e);break;case 21:break;default:Rc(t,e),Bc(e)}}function Bc(e){var t=e.flags;if(t&2){try{a:{for(var n=e.return;n!==null;){if(kc(n)){var i=n;break a}n=n.return}throw Error(r(160))}switch(i.tag){case 5:var a=i.stateNode;i.flags&32&&(De(a,``),i.flags&=-33),Mc(e,Ac(e),a);break;case 3:case 4:var o=i.stateNode.containerInfo;jc(e,Ac(e),o);break;default:throw Error(r(161))}}catch(t){Jl(e,e.return,t)}e.flags&=-3}t&4096&&(e.flags&=-4097)}function Vc(e,t,n){bc=e,Hc(e,t,n)}function Hc(e,t,n){for(var r=!!(e.mode&1);bc!==null;){var i=bc,a=i.child;if(i.tag===22&&r){var o=i.memoizedState!==null||_c;if(!o){var s=i.alternate,c=s!==null&&s.memoizedState!==null||vc;s=_c;var l=vc;if(_c=o,(vc=c)&&!l)for(bc=i;bc!==null;)o=bc,c=o.child,o.tag===22&&o.memoizedState!==null||c===null?Gc(i):(c.return=o,bc=c);for(;a!==null;)bc=a,Hc(a,t,n),a=a.sibling;bc=i,_c=s,vc=l}Uc(e,t,n)}else i.subtreeFlags&8772&&a!==null?(a.return=i,bc=a):Uc(e,t,n)}}function Uc(e){for(;bc!==null;){var t=bc;if(t.flags&8772){var n=t.alternate;try{if(t.flags&8772)switch(t.tag){case 0:case 11:case 15:vc||Ec(5,t);break;case 1:var i=t.stateNode;if(t.flags&4&&!vc){if(n===null)i.componentDidMount();else{var a=t.elementType===t.type?n.memoizedProps:Cs(t.type,n.memoizedProps);i.componentDidUpdate(a,n.memoizedState,i.__reactInternalSnapshotBeforeUpdate)}}var o=t.updateQueue;o!==null&&uo(t,o,i);break;case 3:var s=t.updateQueue;if(s!==null){if(n=null,t.child!==null)switch(t.child.tag){case 5:n=t.child.stateNode;break;case 1:n=t.child.stateNode}uo(t,s,n)}break;case 5:var c=t.stateNode;if(n===null&&t.flags&4){n=c;var l=t.memoizedProps;switch(t.type){case`button`:case`input`:case`select`:case`textarea`:l.autoFocus&&n.focus();break;case`img`:l.src&&(n.src=l.src)}}break;case 6:break;case 4:break;case 12:break;case 13:if(t.memoizedState===null){var u=t.alternate;if(u!==null){var d=u.memoizedState;if(d!==null){var f=d.dehydrated;f!==null&&un(f)}}}break;case 19:case 17:case 21:case 22:case 23:case 25:break;default:throw Error(r(163))}vc||t.flags&512&&Dc(t)}catch(e){Jl(t,t.return,e)}}if(t===e){bc=null;break}if(n=t.sibling,n!==null){n.return=t.return,bc=n;break}bc=t.return}}function Wc(e){for(;bc!==null;){var t=bc;if(t===e){bc=null;break}var n=t.sibling;if(n!==null){n.return=t.return,bc=n;break}bc=t.return}}function Gc(e){for(;bc!==null;){var t=bc;try{switch(t.tag){case 0:case 11:case 15:var n=t.return;try{Ec(4,t)}catch(e){Jl(t,n,e)}break;case 1:var r=t.stateNode;if(typeof r.componentDidMount==`function`){var i=t.return;try{r.componentDidMount()}catch(e){Jl(t,i,e)}}var a=t.return;try{Dc(t)}catch(e){Jl(t,a,e)}break;case 5:var o=t.return;try{Dc(t)}catch(e){Jl(t,o,e)}}}catch(e){Jl(t,t.return,e)}if(t===e){bc=null;break}var s=t.sibling;if(s!==null){s.return=t.return,bc=s;break}bc=t.return}}var Kc=Math.ceil,qc=C.ReactCurrentDispatcher,Jc=C.ReactCurrentOwner,Yc=C.ReactCurrentBatchConfig,Xc=0,Zc=null,Qc=null,$c=0,el=0,tl=Wi(0),nl=0,rl=null,il=0,al=0,ol=0,sl=null,cl=null,ll=0,ul=1/0,dl=null,fl=!1,pl=null,ml=null,hl=!1,gl=null,_l=0,vl=0,yl=null,bl=-1,xl=0;function Sl(){return Xc&6?mt():bl===-1?bl=mt():bl}function Cl(e){return e.mode&1?Xc&2&&$c!==0?$c&-$c:Ia.transition===null?(e=Bt,e===0&&(e=window.event,e=e===void 0?16:vn(e.type)),e):(xl===0&&(xl=Ft()),xl):1}function wl(e,t,n,i){if(50<vl)throw vl=0,yl=null,Error(r(185));Lt(e,n,i),(!(Xc&2)||e!==Zc)&&(e===Zc&&(!(Xc&2)&&(al|=n),nl===4&&Al(e,$c)),Tl(e,i),n===1&&Xc===0&&!(t.mode&1)&&(ul=mt()+500,aa&&la()))}function Tl(e,t){var n=e.callbackNode;Nt(e,t);var r=jt(e,e===Zc?$c:0);if(r===0)n!==null&&dt(n),e.callbackNode=null,e.callbackPriority=0;else if(t=r&-r,e.callbackPriority!==t){if(n!=null&&dt(n),t===1)e.tag===0?ca(jl.bind(null,e)):sa(jl.bind(null,e)),Di(function(){!(Xc&6)&&la()}),n=null;else{switch(Vt(r)){case 1:n=gt;break;case 4:n=_t;break;case 16:n=vt;break;case 536870912:n=bt;break;default:n=vt}n=eu(n,El.bind(null,e))}e.callbackPriority=t,e.callbackNode=n}}function El(e,t){if(bl=-1,xl=0,Xc&6)throw Error(r(327));var n=e.callbackNode;if(Kl()&&e.callbackNode!==n)return null;var i=jt(e,e===Zc?$c:0);if(i===0)return null;if(i&30||(i&e.expiredLanes)!==0||t)t=zl(e,i);else{t=i;var a=Xc;Xc|=2;var o=Ll();(Zc!==e||$c!==t)&&(dl=null,ul=mt()+500,Fl(e,t));do try{Vl();break}catch(t){Il(e,t)}while(1);qa(),qc.current=o,Xc=a,Qc===null?(Zc=null,$c=0,t=nl):t=0}if(t!==0){if(t===2&&(a=Pt(e),a!==0&&(i=a,t=Dl(e,a))),t===1)throw n=rl,Fl(e,0),Al(e,i),Tl(e,mt()),n;if(t===6)Al(e,i);else{if(a=e.current.alternate,!(i&30)&&!kl(a)&&(t=zl(e,i),t===2&&(o=Pt(e),o!==0&&(i=o,t=Dl(e,o))),t===1))throw n=rl,Fl(e,0),Al(e,i),Tl(e,mt()),n;switch(e.finishedWork=a,e.finishedLanes=i,t){case 0:case 1:throw Error(r(345));case 2:Wl(e,cl,dl);break;case 3:if(Al(e,i),(i&130023424)===i&&(t=ll+500-mt(),10<t)){if(jt(e,0)!==0)break;if(a=e.suspendedLanes,(a&i)!==i){Sl(),e.pingedLanes|=e.suspendedLanes&a;break}e.timeoutHandle=wi(Wl.bind(null,e,cl,dl),t);break}Wl(e,cl,dl);break;case 4:if(Al(e,i),(i&4194240)===i)break;for(t=e.eventTimes,a=-1;0<i;){var s=31-wt(i);o=1<<s,s=t[s],s>a&&(a=s),i&=~o}if(i=a,i=mt()-i,i=(120>i?120:480>i?480:1080>i?1080:1920>i?1920:3e3>i?3e3:4320>i?4320:1960*Kc(i/1960))-i,10<i){e.timeoutHandle=wi(Wl.bind(null,e,cl,dl),i);break}Wl(e,cl,dl);break;case 5:Wl(e,cl,dl);break;default:throw Error(r(329))}}}return Tl(e,mt()),e.callbackNode===n?El.bind(null,e):null}function Dl(e,t){var n=sl;return e.current.memoizedState.isDehydrated&&(Fl(e,t).flags|=256),e=zl(e,t),e!==2&&(t=cl,cl=n,t!==null&&Ol(t)),e}function Ol(e){cl===null?cl=e:cl.push.apply(cl,e)}function kl(e){for(var t=e;;){if(t.flags&16384){var n=t.updateQueue;if(n!==null&&(n=n.stores,n!==null))for(var r=0;r<n.length;r++){var i=n[r],a=i.getSnapshot;i=i.value;try{if(!Or(a(),i))return!1}catch{return!1}}}if(n=t.child,t.subtreeFlags&16384&&n!==null)n.return=t,t=n;else{if(t===e)break;for(;t.sibling===null;){if(t.return===null||t.return===e)return!0;t=t.return}t.sibling.return=t.return,t=t.sibling}}return!0}function Al(e,t){for(t&=~ol,t&=~al,e.suspendedLanes|=t,e.pingedLanes&=~t,e=e.expirationTimes;0<t;){var n=31-wt(t),r=1<<n;e[n]=-1,t&=~r}}function jl(e){if(Xc&6)throw Error(r(327));Kl();var t=jt(e,0);if(!(t&1))return Tl(e,mt()),null;var n=zl(e,t);if(e.tag!==0&&n===2){var i=Pt(e);i!==0&&(t=i,n=Dl(e,i))}if(n===1)throw n=rl,Fl(e,0),Al(e,t),Tl(e,mt()),n;if(n===6)throw Error(r(345));return e.finishedWork=e.current.alternate,e.finishedLanes=t,Wl(e,cl,dl),Tl(e,mt()),null}function Ml(e,t){var n=Xc;Xc|=1;try{return e(t)}finally{Xc=n,Xc===0&&(ul=mt()+500,aa&&la())}}function Nl(e){gl!==null&&gl.tag===0&&!(Xc&6)&&Kl();var t=Xc;Xc|=1;var n=Yc.transition,r=Bt;try{if(Yc.transition=null,Bt=1,e)return e()}finally{Bt=r,Yc.transition=n,Xc=t,!(Xc&6)&&la()}}function Pl(){el=tl.current,Gi(tl)}function Fl(e,t){e.finishedWork=null,e.finishedLanes=0;var n=e.timeoutHandle;if(n!==-1&&(e.timeoutHandle=-1,Ti(n)),Qc!==null)for(n=Qc.return;n!==null;){var r=n;switch(Sa(r),r.tag){case 1:r=r.type.childContextTypes,r!=null&&$i();break;case 3:vo(),Gi(Yi),Gi(Ji),wo();break;case 5:bo(r);break;case 4:vo();break;case 13:Gi(xo);break;case 19:Gi(xo);break;case 10:Ja(r.type._context);break;case 22:case 23:Pl()}n=n.return}if(Zc=e,Qc=e=au(e.current,null),$c=el=t,nl=0,rl=null,ol=al=il=0,cl=sl=null,Qa!==null){for(t=0;t<Qa.length;t++)if(n=Qa[t],r=n.interleaved,r!==null){n.interleaved=null;var i=r.next,a=n.pending;if(a!==null){var o=a.next;a.next=i,r.next=o}n.pending=r}Qa=null}return e}function Il(e,t){do{var n=Qc;try{if(qa(),To.current=ys,jo){for(var i=Oo.memoizedState;i!==null;){var a=i.queue;a!==null&&(a.pending=null),i=i.next}jo=!1}if(Do=0,Ao=ko=Oo=null,Mo=!1,No=0,Jc.current=null,n===null||n.return===null){nl=1,rl=t,Qc=null;break}a:{var o=e,s=n.return,c=n,l=t;if(t=$c,c.flags|=32768,typeof l==`object`&&l&&typeof l.then==`function`){var u=l,d=c,f=d.tag;if(!(d.mode&1)&&(f===0||f===11||f===15)){var p=d.alternate;p?(d.updateQueue=p.updateQueue,d.memoizedState=p.memoizedState,d.lanes=p.lanes):(d.updateQueue=null,d.memoizedState=null)}var m=Ls(s);if(m!==null){m.flags&=-257,Rs(m,s,c,o,t),m.mode&1&&Is(o,u,t),t=m,l=u;var h=t.updateQueue;if(h===null){var g=new Set;g.add(l),t.updateQueue=g}else h.add(l);break a}if(!(t&1)){Is(o,u,t),Rl();break a}l=Error(r(426))}else if(Ta&&c.mode&1){var _=Ls(s);if(_!==null){!(_.flags&65536)&&(_.flags|=256),Rs(_,s,c,o,t),Fa(As(l,c));break a}}o=l=As(l,c),nl!==4&&(nl=2),sl===null?sl=[o]:sl.push(o),o=s;do{switch(o.tag){case 3:o.flags|=65536,t&=-t,o.lanes|=t;var v=Ps(o,l,t);co(o,v);break a;case 1:c=l;var y=o.type,b=o.stateNode;if(!(o.flags&128)&&(typeof y.getDerivedStateFromError==`function`||b!==null&&typeof b.componentDidCatch==`function`&&(ml===null||!ml.has(b)))){o.flags|=65536,t&=-t,o.lanes|=t;var x=Fs(o,c,t);co(o,x);break a}}o=o.return}while(o!==null)}Ul(n)}catch(e){t=e,Qc===n&&n!==null&&(Qc=n=n.return);continue}break}while(1)}function Ll(){var e=qc.current;return qc.current=ys,e===null?ys:e}function Rl(){(nl===0||nl===3||nl===2)&&(nl=4),Zc===null||!(il&268435455)&&!(al&268435455)||Al(Zc,$c)}function zl(e,t){var n=Xc;Xc|=2;var i=Ll();(Zc!==e||$c!==t)&&(dl=null,Fl(e,t));do try{Bl();break}catch(t){Il(e,t)}while(1);if(qa(),Xc=n,qc.current=i,Qc!==null)throw Error(r(261));return Zc=null,$c=0,nl}function Bl(){for(;Qc!==null;)Hl(Qc)}function Vl(){for(;Qc!==null&&!ft();)Hl(Qc)}function Hl(e){var t=$l(e.alternate,e,el);e.memoizedProps=e.pendingProps,t===null?Ul(e):Qc=t,Jc.current=null}function Ul(e){var t=e;do{var n=t.alternate;if(e=t.return,t.flags&32768){if(n=gc(n,t),n!==null){n.flags&=32767,Qc=n;return}if(e!==null)e.flags|=32768,e.subtreeFlags=0,e.deletions=null;else{nl=6,Qc=null;return}}else if(n=hc(n,t,el),n!==null){Qc=n;return}if(t=t.sibling,t!==null){Qc=t;return}Qc=t=e}while(t!==null);nl===0&&(nl=5)}function Wl(e,t,n){var r=Bt,i=Yc.transition;try{Yc.transition=null,Bt=1,Gl(e,t,n,r)}finally{Yc.transition=i,Bt=r}return null}function Gl(e,t,n,i){do Kl();while(gl!==null);if(Xc&6)throw Error(r(327));n=e.finishedWork;var a=e.finishedLanes;if(n===null)return null;if(e.finishedWork=null,e.finishedLanes=0,n===e.current)throw Error(r(177));e.callbackNode=null,e.callbackPriority=0;var o=n.lanes|n.childLanes;if(Rt(e,o),e===Zc&&(Qc=Zc=null,$c=0),!(n.subtreeFlags&2064)&&!(n.flags&2064)||hl||(hl=!0,eu(vt,function(){return Kl(),null})),o=!!(n.flags&15990),n.subtreeFlags&15990||o){o=Yc.transition,Yc.transition=null;var s=Bt;Bt=1;var c=Xc;Xc|=4,Jc.current=null,wc(e,n),zc(n,e),Fr(Si),fn=!!xi,Si=xi=null,e.current=n,Vc(n,e,a),pt(),Xc=c,Bt=s,Yc.transition=o}else e.current=n;if(hl&&(hl=!1,gl=e,_l=a),o=e.pendingLanes,o===0&&(ml=null),Ct(n.stateNode,i),Tl(e,mt()),t!==null)for(i=e.onRecoverableError,n=0;n<t.length;n++)a=t[n],i(a.value,{componentStack:a.stack,digest:a.digest});if(fl)throw fl=!1,e=pl,pl=null,e;return _l&1&&e.tag!==0&&Kl(),o=e.pendingLanes,o&1?e===yl?vl++:(vl=0,yl=e):vl=0,la(),null}function Kl(){if(gl!==null){var e=Vt(_l),t=Yc.transition,n=Bt;try{if(Yc.transition=null,Bt=16>e?16:e,gl===null)var i=!1;else{if(e=gl,gl=null,_l=0,Xc&6)throw Error(r(331));var a=Xc;for(Xc|=4,bc=e.current;bc!==null;){var o=bc,s=o.child;if(bc.flags&16){var c=o.deletions;if(c!==null){for(var l=0;l<c.length;l++){var u=c[l];for(bc=u;bc!==null;){var d=bc;switch(d.tag){case 0:case 11:case 15:Tc(8,d,o)}var f=d.child;if(f!==null)f.return=d,bc=f;else for(;bc!==null;){d=bc;var p=d.sibling,m=d.return;if(Oc(d),d===u){bc=null;break}if(p!==null){p.return=m,bc=p;break}bc=m}}}var h=o.alternate;if(h!==null){var g=h.child;if(g!==null){h.child=null;do{var _=g.sibling;g.sibling=null,g=_}while(g!==null)}}bc=o}}if(o.subtreeFlags&2064&&s!==null)s.return=o,bc=s;else b:for(;bc!==null;){if(o=bc,o.flags&2048)switch(o.tag){case 0:case 11:case 15:Tc(9,o,o.return)}var v=o.sibling;if(v!==null){v.return=o.return,bc=v;break b}bc=o.return}}var y=e.current;for(bc=y;bc!==null;){s=bc;var b=s.child;if(s.subtreeFlags&2064&&b!==null)b.return=s,bc=b;else b:for(s=y;bc!==null;){if(c=bc,c.flags&2048)try{switch(c.tag){case 0:case 11:case 15:Ec(9,c)}}catch(e){Jl(c,c.return,e)}if(c===s){bc=null;break b}var x=c.sibling;if(x!==null){x.return=c.return,bc=x;break b}bc=c.return}}if(Xc=a,la(),St&&typeof St.onPostCommitFiberRoot==`function`)try{St.onPostCommitFiberRoot(xt,e)}catch{}i=!0}return i}finally{Bt=n,Yc.transition=t}}return!1}function ql(e,t,n){t=As(n,t),t=Ps(e,t,1),e=oo(e,t,1),t=Sl(),e!==null&&(Lt(e,1,t),Tl(e,t))}function Jl(e,t,n){if(e.tag===3)ql(e,e,n);else for(;t!==null;){if(t.tag===3){ql(t,e,n);break}if(t.tag===1){var r=t.stateNode;if(typeof t.type.getDerivedStateFromError==`function`||typeof r.componentDidCatch==`function`&&(ml===null||!ml.has(r))){e=As(n,e),e=Fs(t,e,1),t=oo(t,e,1),e=Sl(),t!==null&&(Lt(t,1,e),Tl(t,e));break}}t=t.return}}function Yl(e,t,n){var r=e.pingCache;r!==null&&r.delete(t),t=Sl(),e.pingedLanes|=e.suspendedLanes&n,Zc===e&&($c&n)===n&&(nl===4||nl===3&&($c&130023424)===$c&&500>mt()-ll?Fl(e,0):ol|=n),Tl(e,t)}function Xl(e,t){t===0&&(e.mode&1?(t=kt,kt<<=1,!(kt&130023424)&&(kt=4194304)):t=1);var n=Sl();e=to(e,t),e!==null&&(Lt(e,t,n),Tl(e,n))}function Zl(e){var t=e.memoizedState,n=0;t!==null&&(n=t.retryLane),Xl(e,n)}function Ql(e,t){var n=0;switch(e.tag){case 13:var i=e.stateNode,a=e.memoizedState;a!==null&&(n=a.retryLane);break;case 19:i=e.stateNode;break;default:throw Error(r(314))}i!==null&&i.delete(t),Xl(e,n)}var $l=function(e,t,n){if(e!==null){if(e.memoizedProps!==t.pendingProps||Yi.current)Bs=!0;else{if((e.lanes&n)===0&&!(t.flags&128))return Bs=!1,lc(e,t,n);Bs=!!(e.flags&131072)}}else Bs=!1,Ta&&t.flags&1048576&&ba(t,pa,t.index);switch(t.lanes=0,t.tag){case 2:var i=t.type;sc(e,t),e=t.pendingProps;var a=Zi(t,Ji.current);Xa(t,n),a=Lo(null,t,i,e,a,n);var o=Ro();return t.flags|=1,typeof a==`object`&&a&&typeof a.render==`function`&&a.$$typeof===void 0?(t.tag=1,t.memoizedState=null,t.updateQueue=null,Qi(i)?(o=!0,na(t)):o=!1,t.memoizedState=a.state!==null&&a.state!==void 0?a.state:null,ro(t),a.updater=Ts,t.stateNode=a,a._reactInternals=t,ks(t,i,e,n),t=Ys(null,t,i,!0,o,n)):(t.tag=0,Ta&&o&&xa(t),Vs(null,t,a,n),t=t.child),t;case 16:i=t.elementType;a:{switch(sc(e,t),e=t.pendingProps,a=i._init,i=a(i._payload),t.type=i,a=t.tag=iu(i),e=Cs(i,e),a){case 0:t=qs(null,t,i,e,n);break a;case 1:t=Js(null,t,i,e,n);break a;case 11:t=Hs(null,t,i,e,n);break a;case 14:t=Us(null,t,i,Cs(i.type,e),n);break a}throw Error(r(306,i,``))}return t;case 0:return i=t.type,a=t.pendingProps,a=t.elementType===i?a:Cs(i,a),qs(e,t,i,a,n);case 1:return i=t.type,a=t.pendingProps,a=t.elementType===i?a:Cs(i,a),Js(e,t,i,a,n);case 3:a:{if(Xs(t),e===null)throw Error(r(387));i=t.pendingProps,o=t.memoizedState,a=o.element,io(e,t),lo(t,i,null,n);var s=t.memoizedState;if(i=s.element,o.isDehydrated){if(o={element:i,isDehydrated:!1,cache:s.cache,pendingSuspenseBoundaries:s.pendingSuspenseBoundaries,transitions:s.transitions},t.updateQueue.baseState=o,t.memoizedState=o,t.flags&256){a=As(Error(r(423)),t),t=Zs(e,t,i,n,a);break a}if(i!==a){a=As(Error(r(424)),t),t=Zs(e,t,i,n,a);break a}for(wa=Ai(t.stateNode.containerInfo.firstChild),Ca=t,Ta=!0,Ea=null,n=Ha(t,null,i,n),t.child=n;n;)n.flags=n.flags&-3|4096,n=n.sibling}else{if(Pa(),i===a){t=cc(e,t,n);break a}Vs(e,t,i,n)}t=t.child}return t;case 5:return yo(t),e===null&&Aa(t),i=t.type,a=t.pendingProps,o=e===null?null:e.memoizedProps,s=a.children,Ci(i,a)?s=null:o!==null&&Ci(i,o)&&(t.flags|=32),Ks(e,t),Vs(e,t,s,n),t.child;case 6:return e===null&&Aa(t),null;case 13:return ec(e,t,n);case 4:return _o(t,t.stateNode.containerInfo),i=t.pendingProps,e===null?t.child=Va(t,null,i,n):Vs(e,t,i,n),t.child;case 11:return i=t.type,a=t.pendingProps,a=t.elementType===i?a:Cs(i,a),Hs(e,t,i,a,n);case 7:return Vs(e,t,t.pendingProps,n),t.child;case 8:return Vs(e,t,t.pendingProps.children,n),t.child;case 12:return Vs(e,t,t.pendingProps.children,n),t.child;case 10:a:{if(i=t.type._context,a=t.pendingProps,o=t.memoizedProps,s=a.value,Ki(Ua,i._currentValue),i._currentValue=s,o!==null){if(Or(o.value,s)){if(o.children===a.children&&!Yi.current){t=cc(e,t,n);break a}}else for(o=t.child,o!==null&&(o.return=t);o!==null;){var c=o.dependencies;if(c!==null){s=o.child;for(var l=c.firstContext;l!==null;){if(l.context===i){if(o.tag===1){l=ao(-1,n&-n),l.tag=2;var u=o.updateQueue;if(u!==null){u=u.shared;var d=u.pending;d===null?l.next=l:(l.next=d.next,d.next=l),u.pending=l}}o.lanes|=n,l=o.alternate,l!==null&&(l.lanes|=n),Ya(o.return,n,t),c.lanes|=n;break}l=l.next}}else if(o.tag===10)s=o.type===t.type?null:o.child;else if(o.tag===18){if(s=o.return,s===null)throw Error(r(341));s.lanes|=n,c=s.alternate,c!==null&&(c.lanes|=n),Ya(s,n,t),s=o.sibling}else s=o.child;if(s!==null)s.return=o;else for(s=o;s!==null;){if(s===t){s=null;break}if(o=s.sibling,o!==null){o.return=s.return,s=o;break}s=s.return}o=s}}Vs(e,t,a.children,n),t=t.child}return t;case 9:return a=t.type,i=t.pendingProps.children,Xa(t,n),a=Za(a),i=i(a),t.flags|=1,Vs(e,t,i,n),t.child;case 14:return i=t.type,a=Cs(i,t.pendingProps),a=Cs(i.type,a),Us(e,t,i,a,n);case 15:return Ws(e,t,t.type,t.pendingProps,n);case 17:return i=t.type,a=t.pendingProps,a=t.elementType===i?a:Cs(i,a),sc(e,t),t.tag=1,Qi(i)?(e=!0,na(t)):e=!1,Xa(t,n),Ds(t,i,a),ks(t,i,a,n),Ys(null,t,i,!0,e,n);case 19:return oc(e,t,n);case 22:return Gs(e,t,n)}throw Error(r(156,t.tag))};function eu(e,t){return ut(e,t)}function tu(e,t,n,r){this.tag=e,this.key=n,this.sibling=this.child=this.return=this.stateNode=this.type=this.elementType=null,this.index=0,this.ref=null,this.pendingProps=t,this.dependencies=this.memoizedState=this.updateQueue=this.memoizedProps=null,this.mode=r,this.subtreeFlags=this.flags=0,this.deletions=null,this.childLanes=this.lanes=0,this.alternate=null}function nu(e,t,n,r){return new tu(e,t,n,r)}function ru(e){return e=e.prototype,!(!e||!e.isReactComponent)}function iu(e){if(typeof e==`function`)return+!!ru(e);if(e!=null){if(e=e.$$typeof,e===j)return 11;if(e===P)return 14}return 2}function au(e,t){var n=e.alternate;return n===null?(n=nu(e.tag,t,e.key,e.mode),n.elementType=e.elementType,n.type=e.type,n.stateNode=e.stateNode,n.alternate=e,e.alternate=n):(n.pendingProps=t,n.type=e.type,n.flags=0,n.subtreeFlags=0,n.deletions=null),n.flags=e.flags&14680064,n.childLanes=e.childLanes,n.lanes=e.lanes,n.child=e.child,n.memoizedProps=e.memoizedProps,n.memoizedState=e.memoizedState,n.updateQueue=e.updateQueue,t=e.dependencies,n.dependencies=t===null?null:{lanes:t.lanes,firstContext:t.firstContext},n.sibling=e.sibling,n.index=e.index,n.ref=e.ref,n}function ou(e,t,n,i,a,o){var s=2;if(i=e,typeof e==`function`)ru(e)&&(s=1);else if(typeof e==`string`)s=5;else a:switch(e){case E:return su(n.children,a,o,t);case D:s=8,a|=8;break;case O:return e=nu(12,n,t,a|2),e.elementType=O,e.lanes=o,e;case M:return e=nu(13,n,t,a),e.elementType=M,e.lanes=o,e;case N:return e=nu(19,n,t,a),e.elementType=N,e.lanes=o,e;case I:return cu(n,a,o,t);default:if(typeof e==`object`&&e)switch(e.$$typeof){case k:s=10;break a;case A:s=9;break a;case j:s=11;break a;case P:s=14;break a;case F:s=16,i=null;break a}throw Error(r(130,e==null?e:typeof e,``))}return t=nu(s,n,t,a),t.elementType=e,t.type=i,t.lanes=o,t}function su(e,t,n,r){return e=nu(7,e,r,t),e.lanes=n,e}function cu(e,t,n,r){return e=nu(22,e,r,t),e.elementType=I,e.lanes=n,e.stateNode={isHidden:!1},e}function lu(e,t,n){return e=nu(6,e,null,t),e.lanes=n,e}function uu(e,t,n){return t=nu(4,e.children===null?[]:e.children,e.key,t),t.lanes=n,t.stateNode={containerInfo:e.containerInfo,pendingChildren:null,implementation:e.implementation},t}function du(e,t,n,r,i){this.tag=t,this.containerInfo=e,this.finishedWork=this.pingCache=this.current=this.pendingChildren=null,this.timeoutHandle=-1,this.callbackNode=this.pendingContext=this.context=null,this.callbackPriority=0,this.eventTimes=It(0),this.expirationTimes=It(-1),this.entangledLanes=this.finishedLanes=this.mutableReadLanes=this.expiredLanes=this.pingedLanes=this.suspendedLanes=this.pendingLanes=0,this.entanglements=It(0),this.identifierPrefix=r,this.onRecoverableError=i,this.mutableSourceEagerHydrationData=null}function fu(e,t,n,r,i,a,o,s,c){return e=new du(e,t,n,s,c),t===1?(t=1,!0===a&&(t|=8)):t=0,a=nu(3,null,null,t),e.current=a,a.stateNode=e,a.memoizedState={element:r,isDehydrated:n,cache:null,transitions:null,pendingSuspenseBoundaries:null},ro(a),e}function pu(e,t,n){var r=3<arguments.length&&arguments[3]!==void 0?arguments[3]:null;return{$$typeof:T,key:r==null?null:``+r,children:e,containerInfo:t,implementation:n}}function mu(e){if(!e)return qi;e=e._reactInternals;a:{if(it(e)!==e||e.tag!==1)throw Error(r(170));var t=e;do{switch(t.tag){case 3:t=t.stateNode.context;break a;case 1:if(Qi(t.type)){t=t.stateNode.__reactInternalMemoizedMergedChildContext;break a}}t=t.return}while(t!==null);throw Error(r(171))}if(e.tag===1){var n=e.type;if(Qi(n))return ta(e,n,t)}return t}function hu(e,t,n,r,i,a,o,s,c){return e=fu(n,r,!0,e,i,a,o,s,c),e.context=mu(null),n=e.current,r=Sl(),i=Cl(n),a=ao(r,i),a.callback=t??null,oo(n,a,i),e.current.lanes=i,Lt(e,i,r),Tl(e,r),e}function gu(e,t,n,r){var i=t.current,a=Sl(),o=Cl(i);return n=mu(n),t.context===null?t.context=n:t.pendingContext=n,t=ao(a,o),t.payload={element:e},r=r===void 0?null:r,r!==null&&(t.callback=r),e=oo(i,t,o),e!==null&&(wl(e,i,o,a),so(e,i,o)),o}function _u(e){if(e=e.current,!e.child)return null;switch(e.child.tag){case 5:return e.child.stateNode;default:return e.child.stateNode}}function vu(e,t){if(e=e.memoizedState,e!==null&&e.dehydrated!==null){var n=e.retryLane;e.retryLane=n!==0&&n<t?n:t}}function yu(e,t){vu(e,t),(e=e.alternate)&&vu(e,t)}function bu(){return null}var xu=typeof reportError==`function`?reportError:function(e){console.error(e)};function Su(e){this._internalRoot=e}Cu.prototype.render=Su.prototype.render=function(e){var t=this._internalRoot;if(t===null)throw Error(r(409));gu(e,t,null,null)},Cu.prototype.unmount=Su.prototype.unmount=function(){var e=this._internalRoot;if(e!==null){this._internalRoot=null;var t=e.containerInfo;Nl(function(){gu(null,e,null,null)}),t[Fi]=null}};function Cu(e){this._internalRoot=e}Cu.prototype.unstable_scheduleHydration=function(e){if(e){var t=Gt();e={blockedOn:null,target:e,priority:t};for(var n=0;n<$t.length&&t!==0&&t<$t[n].priority;n++);$t.splice(n,0,e),n===0&&an(e)}};function wu(e){return!(!e||e.nodeType!==1&&e.nodeType!==9&&e.nodeType!==11)}function Tu(e){return!(!e||e.nodeType!==1&&e.nodeType!==9&&e.nodeType!==11&&(e.nodeType!==8||e.nodeValue!==` react-mount-point-unstable `))}function Eu(){}function Du(e,t,n,r,i){if(i){if(typeof r==`function`){var a=r;r=function(){var e=_u(o);a.call(e)}}var o=hu(t,r,e,0,null,!1,!1,``,Eu);return e._reactRootContainer=o,e[Fi]=o.current,li(e.nodeType===8?e.parentNode:e),Nl(),o}for(;i=e.lastChild;)e.removeChild(i);if(typeof r==`function`){var s=r;r=function(){var e=_u(c);s.call(e)}}var c=fu(e,0,!1,null,null,!1,!1,``,Eu);return e._reactRootContainer=c,e[Fi]=c.current,li(e.nodeType===8?e.parentNode:e),Nl(function(){gu(t,c,n,r)}),c}function Ou(e,t,n,r,i){var a=n._reactRootContainer;if(a){var o=a;if(typeof i==`function`){var s=i;i=function(){var e=_u(o);s.call(e)}}gu(t,o,e,i)}else o=Du(n,t,e,i,r);return _u(o)}Ht=function(e){switch(e.tag){case 3:var t=e.stateNode;if(t.current.memoizedState.isDehydrated){var n=At(t.pendingLanes);n!==0&&(zt(t,n|1),Tl(t,mt()),!(Xc&6)&&(ul=mt()+500,la()))}break;case 13:Nl(function(){var t=to(e,1);t!==null&&wl(t,e,1,Sl())}),yu(e,1)}},Ut=function(e){if(e.tag===13){var t=to(e,134217728);t!==null&&wl(t,e,134217728,Sl()),yu(e,134217728)}},Wt=function(e){if(e.tag===13){var t=Cl(e),n=to(e,t);n!==null&&wl(n,e,t,Sl()),yu(e,t)}},Gt=function(){return Bt},Kt=function(e,t){var n=Bt;try{return Bt=e,t()}finally{Bt=n}},Le=function(e,t,n){switch(t){case`input`:if(me(e,n),t=n.name,n.type===`radio`&&t!=null){for(n=e;n.parentNode;)n=n.parentNode;for(n=n.querySelectorAll(`input[name=`+JSON.stringify(``+t)+`][type="radio"]`),t=0;t<n.length;t++){var i=n[t];if(i!==e&&i.form===e.form){var a=Hi(i);if(!a)throw Error(r(90));ue(i),me(i,a)}}}break;case`textarea`:xe(e,n);break;case`select`:t=n.value,t!=null&&ve(e,!!n.multiple,t,!1)}},Ue=Ml,We=Nl;var ku={usingClientEntryPoint:!1,Events:[Bi,Vi,Hi,Ve,He,Ml]},Au={findFiberByHostInstance:zi,bundleType:0,version:`18.3.1`,rendererPackageName:`react-dom`},ju={bundleType:Au.bundleType,version:Au.version,rendererPackageName:Au.rendererPackageName,rendererConfig:Au.rendererConfig,overrideHookState:null,overrideHookStateDeletePath:null,overrideHookStateRenamePath:null,overrideProps:null,overridePropsDeletePath:null,overridePropsRenamePath:null,setErrorHandler:null,setSuspenseHandler:null,scheduleUpdate:null,currentDispatcherRef:C.ReactCurrentDispatcher,findHostInstanceByFiber:function(e){return e=ct(e),e===null?null:e.stateNode},findFiberByHostInstance:Au.findFiberByHostInstance||bu,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 Mu=__REACT_DEVTOOLS_GLOBAL_HOOK__;if(!Mu.isDisabled&&Mu.supportsFiber)try{xt=Mu.inject(ju),St=Mu}catch{}}e.__SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED=ku,e.createPortal=function(e,t){var n=2<arguments.length&&arguments[2]!==void 0?arguments[2]:null;if(!wu(t))throw Error(r(200));return pu(e,t,null,n)},e.createRoot=function(e,t){if(!wu(e))throw Error(r(299));var n=!1,i=``,a=xu;return t!=null&&(!0===t.unstable_strictMode&&(n=!0),t.identifierPrefix!==void 0&&(i=t.identifierPrefix),t.onRecoverableError!==void 0&&(a=t.onRecoverableError)),t=fu(e,1,!1,null,null,n,!1,i,a),e[Fi]=t.current,li(e.nodeType===8?e.parentNode:e),new Su(t)},e.findDOMNode=function(e){if(e==null)return null;if(e.nodeType===1)return e;var t=e._reactInternals;if(t===void 0)throw typeof e.render==`function`?Error(r(188)):(e=Object.keys(e).join(`,`),Error(r(268,e)));return e=ct(t),e=e===null?null:e.stateNode,e},e.flushSync=function(e){return Nl(e)},e.hydrate=function(e,t,n){if(!Tu(t))throw Error(r(200));return Ou(null,e,t,!0,n)},e.hydrateRoot=function(e,t,n){if(!wu(e))throw Error(r(405));var i=n!=null&&n.hydratedSources||null,a=!1,o=``,s=xu;if(n!=null&&(!0===n.unstable_strictMode&&(a=!0),n.identifierPrefix!==void 0&&(o=n.identifierPrefix),n.onRecoverableError!==void 0&&(s=n.onRecoverableError)),t=hu(t,null,e,1,n??null,a,!1,o,s),e[Fi]=t.current,li(e),i)for(e=0;e<i.length;e++)n=i[e],a=n._getVersion,a=a(n._source),t.mutableSourceEagerHydrationData==null?t.mutableSourceEagerHydrationData=[n,a]:t.mutableSourceEagerHydrationData.push(n,a);return new Cu(t)},e.render=function(e,t,n){if(!Tu(t))throw Error(r(200));return Ou(null,e,t,!1,n)},e.unmountComponentAtNode=function(e){if(!Tu(e))throw Error(r(40));return e._reactRootContainer?(Nl(function(){Ou(null,null,e,!1,function(){e._reactRootContainer=null,e[Fi]=null})}),!0):!1},e.unstable_batchedUpdates=Ml,e.unstable_renderSubtreeIntoContainer=function(e,t,n,i){if(!Tu(n))throw Error(r(200));if(e==null||e._reactInternals===void 0)throw Error(r(38));return Ou(e,t,n,!1,i)},e.version=`18.3.1-next-f1338f8080-20240426`})),h=o(((e,t)=>{function n(){if(typeof __REACT_DEVTOOLS_GLOBAL_HOOK__<`u`&&typeof __REACT_DEVTOOLS_GLOBAL_HOOK__.checkDCE==`function`)try{__REACT_DEVTOOLS_GLOBAL_HOOK__.checkDCE(n)}catch(e){console.error(e)}}n(),t.exports=m()})),g=o((e=>{var t=h();e.createRoot=t.createRoot,e.hydrateRoot=t.hydrateRoot}))(),_=l(d(),1),v=1,y=1e6,b=0;function x(){return b=(b+1)%(2**53-1),b.toString()}var S=new Map,C=e=>{if(S.has(e))return;let t=setTimeout(()=>{S.delete(e),D({type:`REMOVE_TOAST`,toastId:e})},y);S.set(e,t)},w=(e,t)=>{switch(t.type){case`ADD_TOAST`:return{...e,toasts:[t.toast,...e.toasts].slice(0,v)};case`UPDATE_TOAST`:return{...e,toasts:e.toasts.map(e=>e.id===t.toast.id?{...e,...t.toast}:e)};case`DISMISS_TOAST`:{let{toastId:n}=t;return n?C(n):e.toasts.forEach(e=>{C(e.id)}),{...e,toasts:e.toasts.map(e=>e.id===n||n===void 0?{...e,open:!1}:e)}}case`REMOVE_TOAST`:return t.toastId===void 0?{...e,toasts:[]}:{...e,toasts:e.toasts.filter(e=>e.id!==t.toastId)}}},T=[],E={toasts:[]};function D(e){E=w(E,e),T.forEach(e=>{e(E)})}function O({...e}){let t=x(),n=e=>D({type:`UPDATE_TOAST`,toast:{...e,id:t}}),r=()=>D({type:`DISMISS_TOAST`,toastId:t});return D({type:`ADD_TOAST`,toast:{...e,id:t,open:!0,onOpenChange:e=>{e||r()}}}),{id:t,dismiss:r,update:n}}function k(){let[e,t]=_.useState(E);return _.useEffect(()=>(T.push(t),()=>{let e=T.indexOf(t);e>-1&&T.splice(e,1)}),[e]),{...e,toast:O,dismiss:e=>D({type:`DISMISS_TOAST`,toastId:e})}}var A=l(h(),1);typeof window<`u`&&window.document&&window.document.createElement;function j(e,t,{checkForDefaultPrevented:n=!0}={}){return function(r){if(e?.(r),n===!1||!r.defaultPrevented)return t?.(r)}}function M(e,t){if(typeof e==`function`)return e(t);e!=null&&(e.current=t)}function N(...e){return t=>{let n=!1,r=e.map(e=>{let r=M(e,t);return!n&&typeof r==`function`&&(n=!0),r});if(n)return()=>{for(let t=0;t<r.length;t++){let n=r[t];typeof n==`function`?n():M(e[t],null)}}}}function P(...e){return _.useCallback(N(...e),e)}var F=o((e=>{var t=d(),n=Symbol.for(`react.element`),r=Symbol.for(`react.fragment`),i=Object.prototype.hasOwnProperty,a=t.__SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED.ReactCurrentOwner,o={key:!0,ref:!0,__self:!0,__source:!0};function s(e,t,r){var s,c={},l=null,u=null;for(s in r!==void 0&&(l=``+r),t.key!==void 0&&(l=``+t.key),t.ref!==void 0&&(u=t.ref),t)i.call(t,s)&&!o.hasOwnProperty(s)&&(c[s]=t[s]);if(e&&e.defaultProps)for(s in t=e.defaultProps,t)c[s]===void 0&&(c[s]=t[s]);return{$$typeof:n,type:e,key:l,ref:u,props:c,_owner:a.current}}e.Fragment=r,e.jsx=s,e.jsxs=s})),I=o(((e,t)=>{t.exports=F()}))();function L(e,t){let n=_.createContext(t),r=e=>{let{children:t,...r}=e,i=_.useMemo(()=>r,Object.values(r));return(0,I.jsx)(n.Provider,{value:i,children:t})};r.displayName=e+`Provider`;function i(r){let i=_.useContext(n);if(i)return i;if(t!==void 0)return t;throw Error(`\`${r}\` must be used within \`${e}\``)}return[r,i]}function R(e,t=[]){let n=[];function r(t,r){let i=_.createContext(r),a=n.length;n=[...n,r];let o=t=>{let{scope:n,children:r,...o}=t,s=n?.[e]?.[a]||i,c=_.useMemo(()=>o,Object.values(o));return(0,I.jsx)(s.Provider,{value:c,children:r})};o.displayName=t+`Provider`;function s(n,o){let s=o?.[e]?.[a]||i,c=_.useContext(s);if(c)return c;if(r!==void 0)return r;throw Error(`\`${n}\` must be used within \`${t}\``)}return[o,s]}let i=()=>{let t=n.map(e=>_.createContext(e));return function(n){let r=n?.[e]||t;return _.useMemo(()=>({[`__scope${e}`]:{...n,[e]:r}}),[n,r])}};return i.scopeName=e,[r,z(i,...t)]}function z(...e){let t=e[0];if(e.length===1)return t;let n=()=>{let n=e.map(e=>({useScope:e(),scopeName:e.scopeName}));return function(e){let r=n.reduce((t,{useScope:n,scopeName:r})=>{let i=n(e)[`__scope${r}`];return{...t,...i}},{});return _.useMemo(()=>({[`__scope${t.scopeName}`]:r}),[r])}};return n.scopeName=t.scopeName,n}function ee(e){let t=te(e),n=_.forwardRef((e,n)=>{let{children:r,...i}=e,a=_.Children.toArray(r),o=a.find(re);if(o){let e=o.props.children,r=a.map(t=>t===o?_.Children.count(e)>1?_.Children.only(null):_.isValidElement(e)?e.props.children:null:t);return(0,I.jsx)(t,{...i,ref:n,children:_.isValidElement(e)?_.cloneElement(e,void 0,r):null})}return(0,I.jsx)(t,{...i,ref:n,children:r})});return n.displayName=`${e}.Slot`,n}function te(e){let t=_.forwardRef((e,t)=>{let{children:n,...r}=e;if(_.isValidElement(n)){let e=ae(n),i=ie(r,n.props);return n.type!==_.Fragment&&(i.ref=t?N(t,e):e),_.cloneElement(n,i)}return _.Children.count(n)>1?_.Children.only(null):null});return t.displayName=`${e}.SlotClone`,t}var ne=Symbol(`radix.slottable`);function re(e){return _.isValidElement(e)&&typeof e.type==`function`&&`__radixId`in e.type&&e.type.__radixId===ne}function ie(e,t){let n={...t};for(let r in t){let i=e[r],a=t[r];/^on[A-Z]/.test(r)?i&&a?n[r]=(...e)=>{let t=a(...e);return i(...e),t}:i&&(n[r]=i):r===`style`?n[r]={...i,...a}:r===`className`&&(n[r]=[i,a].filter(Boolean).join(` `))}return{...e,...n}}function ae(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 oe(e){let t=e+`CollectionProvider`,[n,r]=R(t),[i,a]=n(t,{collectionRef:{current:null},itemMap:new Map}),o=e=>{let{scope:t,children:n}=e,r=_.useRef(null),a=_.useRef(new Map).current;return(0,I.jsx)(i,{scope:t,itemMap:a,collectionRef:r,children:n})};o.displayName=t;let s=e+`CollectionSlot`,c=ee(s),l=_.forwardRef((e,t)=>{let{scope:n,children:r}=e,i=P(t,a(s,n).collectionRef);return(0,I.jsx)(c,{ref:i,children:r})});l.displayName=s;let u=e+`CollectionItemSlot`,d=`data-radix-collection-item`,f=ee(u),p=_.forwardRef((e,t)=>{let{scope:n,children:r,...i}=e,o=_.useRef(null),s=P(t,o),c=a(u,n);return _.useEffect(()=>(c.itemMap.set(o,{ref:o,...i}),()=>void c.itemMap.delete(o))),(0,I.jsx)(f,{[d]:``,ref:s,children:r})});p.displayName=u;function m(t){let n=a(e+`CollectionConsumer`,t);return _.useCallback(()=>{let e=n.collectionRef.current;if(!e)return[];let t=Array.from(e.querySelectorAll(`[${d}]`));return Array.from(n.itemMap.values()).sort((e,n)=>t.indexOf(e.ref.current)-t.indexOf(n.ref.current))},[n.collectionRef,n.itemMap])}return[{Provider:o,Slot:l,ItemSlot:p},m,r]}function se(e){let t=ce(e),n=_.forwardRef((e,n)=>{let{children:r,...i}=e,a=_.Children.toArray(r),o=a.find(le);if(o){let e=o.props.children,r=a.map(t=>t===o?_.Children.count(e)>1?_.Children.only(null):_.isValidElement(e)?e.props.children:null:t);return(0,I.jsx)(t,{...i,ref:n,children:_.isValidElement(e)?_.cloneElement(e,void 0,r):null})}return(0,I.jsx)(t,{...i,ref:n,children:r})});return n.displayName=`${e}.Slot`,n}function ce(e){let t=_.forwardRef((e,t)=>{let{children:n,...r}=e;if(_.isValidElement(n)){let e=de(n),i=ue(r,n.props);return n.type!==_.Fragment&&(i.ref=t?N(t,e):e),_.cloneElement(n,i)}return _.Children.count(n)>1?_.Children.only(null):null});return t.displayName=`${e}.SlotClone`,t}var B=Symbol(`radix.slottable`);function le(e){return _.isValidElement(e)&&typeof e.type==`function`&&`__radixId`in e.type&&e.type.__radixId===B}function ue(e,t){let n={...t};for(let r in t){let i=e[r],a=t[r];/^on[A-Z]/.test(r)?i&&a?n[r]=(...e)=>{let t=a(...e);return i(...e),t}:i&&(n[r]=i):r===`style`?n[r]={...i,...a}:r===`className`&&(n[r]=[i,a].filter(Boolean).join(` `))}return{...e,...n}}function de(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 V=[`a`,`button`,`div`,`form`,`h2`,`h3`,`img`,`input`,`label`,`li`,`nav`,`ol`,`p`,`select`,`span`,`svg`,`ul`].reduce((e,t)=>{let n=se(`Primitive.${t}`),r=_.forwardRef((e,r)=>{let{asChild:i,...a}=e,o=i?n:t;return typeof window<`u`&&(window[Symbol.for(`radix-ui`)]=!0),(0,I.jsx)(o,{...a,ref:r})});return r.displayName=`Primitive.${t}`,{...e,[t]:r}},{});function fe(e,t){e&&A.flushSync(()=>e.dispatchEvent(t))}function pe(e){let t=_.useRef(e);return _.useEffect(()=>{t.current=e}),_.useMemo(()=>(...e)=>t.current?.(...e),[])}function me(e,t=globalThis?.document){let n=pe(e);_.useEffect(()=>{let e=e=>{e.key===`Escape`&&n(e)};return t.addEventListener(`keydown`,e,{capture:!0}),()=>t.removeEventListener(`keydown`,e,{capture:!0})},[n,t])}var he=`DismissableLayer`,ge=`dismissableLayer.update`,_e=`dismissableLayer.pointerDownOutside`,ve=`dismissableLayer.focusOutside`,ye,be=_.createContext({layers:new Set,layersWithOutsidePointerEventsDisabled:new Set,branches:new Set}),xe=_.forwardRef((e,t)=>{let{disableOutsidePointerEvents:n=!1,onEscapeKeyDown:r,onPointerDownOutside:i,onFocusOutside:a,onInteractOutside:o,onDismiss:s,...c}=e,l=_.useContext(be),[u,d]=_.useState(null),f=u?.ownerDocument??globalThis?.document,[,p]=_.useState({}),m=P(t,e=>d(e)),h=Array.from(l.layers),[g]=[...l.layersWithOutsidePointerEventsDisabled].slice(-1),v=h.indexOf(g),y=u?h.indexOf(u):-1,b=l.layersWithOutsidePointerEventsDisabled.size>0,x=y>=v,S=we(e=>{let t=e.target,n=[...l.branches].some(e=>e.contains(t));x&&!n&&(i?.(e),o?.(e),e.defaultPrevented||s?.())},f),C=Te(e=>{let t=e.target;[...l.branches].some(e=>e.contains(t))||(a?.(e),o?.(e),e.defaultPrevented||s?.())},f);return me(e=>{y===l.layers.size-1&&(r?.(e),!e.defaultPrevented&&s&&(e.preventDefault(),s()))},f),_.useEffect(()=>{if(u)return n&&(l.layersWithOutsidePointerEventsDisabled.size===0&&(ye=f.body.style.pointerEvents,f.body.style.pointerEvents=`none`),l.layersWithOutsidePointerEventsDisabled.add(u)),l.layers.add(u),Ee(),()=>{n&&l.layersWithOutsidePointerEventsDisabled.size===1&&(f.body.style.pointerEvents=ye)}},[u,f,n,l]),_.useEffect(()=>()=>{u&&(l.layers.delete(u),l.layersWithOutsidePointerEventsDisabled.delete(u),Ee())},[u,l]),_.useEffect(()=>{let e=()=>p({});return document.addEventListener(ge,e),()=>document.removeEventListener(ge,e)},[]),(0,I.jsx)(V.div,{...c,ref:m,style:{pointerEvents:b?x?`auto`:`none`:void 0,...e.style},onFocusCapture:j(e.onFocusCapture,C.onFocusCapture),onBlurCapture:j(e.onBlurCapture,C.onBlurCapture),onPointerDownCapture:j(e.onPointerDownCapture,S.onPointerDownCapture)})});xe.displayName=he;var Se=`DismissableLayerBranch`,Ce=_.forwardRef((e,t)=>{let n=_.useContext(be),r=_.useRef(null),i=P(t,r);return _.useEffect(()=>{let e=r.current;if(e)return n.branches.add(e),()=>{n.branches.delete(e)}},[n.branches]),(0,I.jsx)(V.div,{...e,ref:i})});Ce.displayName=Se;function we(e,t=globalThis?.document){let n=pe(e),r=_.useRef(!1),i=_.useRef(()=>{});return _.useEffect(()=>{let e=e=>{if(e.target&&!r.current){let r=function(){De(_e,n,a,{discrete:!0})},a={originalEvent:e};e.pointerType===`touch`?(t.removeEventListener(`click`,i.current),i.current=r,t.addEventListener(`click`,i.current,{once:!0})):r()}else t.removeEventListener(`click`,i.current);r.current=!1},a=window.setTimeout(()=>{t.addEventListener(`pointerdown`,e)},0);return()=>{window.clearTimeout(a),t.removeEventListener(`pointerdown`,e),t.removeEventListener(`click`,i.current)}},[t,n]),{onPointerDownCapture:()=>r.current=!0}}function Te(e,t=globalThis?.document){let n=pe(e),r=_.useRef(!1);return _.useEffect(()=>{let e=e=>{e.target&&!r.current&&De(ve,n,{originalEvent:e},{discrete:!1})};return t.addEventListener(`focusin`,e),()=>t.removeEventListener(`focusin`,e)},[t,n]),{onFocusCapture:()=>r.current=!0,onBlurCapture:()=>r.current=!1}}function Ee(){let e=new CustomEvent(ge);document.dispatchEvent(e)}function De(e,t,n,{discrete:r}){let i=n.originalEvent.target,a=new CustomEvent(e,{bubbles:!1,cancelable:!0,detail:n});t&&i.addEventListener(e,t,{once:!0}),r?fe(i,a):i.dispatchEvent(a)}var Oe=xe,ke=Ce,Ae=globalThis?.document?_.useLayoutEffect:()=>{},je=`Portal`,Me=_.forwardRef((e,t)=>{let{container:n,...r}=e,[i,a]=_.useState(!1);Ae(()=>a(!0),[]);let o=n||i&&globalThis?.document?.body;return o?A.createPortal((0,I.jsx)(V.div,{...r,ref:t}),o):null});Me.displayName=je;function Ne(e,t){return _.useReducer((e,n)=>t[e][n]??e,e)}var Pe=e=>{let{present:t,children:n}=e,r=Fe(t),i=typeof n==`function`?n({present:r.isPresent}):_.Children.only(n),a=P(r.ref,Le(i));return typeof n==`function`||r.isPresent?_.cloneElement(i,{ref:a}):null};Pe.displayName=`Presence`;function Fe(e){let[t,n]=_.useState(),r=_.useRef(null),i=_.useRef(e),a=_.useRef(`none`),[o,s]=Ne(e?`mounted`:`unmounted`,{mounted:{UNMOUNT:`unmounted`,ANIMATION_OUT:`unmountSuspended`},unmountSuspended:{MOUNT:`mounted`,ANIMATION_END:`unmounted`},unmounted:{MOUNT:`mounted`}});return _.useEffect(()=>{let e=Ie(r.current);a.current=o===`mounted`?e:`none`},[o]),Ae(()=>{let t=r.current,n=i.current;if(n!==e){let r=a.current,o=Ie(t);e?s(`MOUNT`):o===`none`||t?.display===`none`?s(`UNMOUNT`):s(n&&r!==o?`ANIMATION_OUT`:`UNMOUNT`),i.current=e}},[e,s]),Ae(()=>{if(t){let e,n=t.ownerDocument.defaultView??window,o=a=>{let o=Ie(r.current).includes(CSS.escape(a.animationName));if(a.target===t&&o&&(s(`ANIMATION_END`),!i.current)){let r=t.style.animationFillMode;t.style.animationFillMode=`forwards`,e=n.setTimeout(()=>{t.style.animationFillMode===`forwards`&&(t.style.animationFillMode=r)})}},c=e=>{e.target===t&&(a.current=Ie(r.current))};return t.addEventListener(`animationstart`,c),t.addEventListener(`animationcancel`,o),t.addEventListener(`animationend`,o),()=>{n.clearTimeout(e),t.removeEventListener(`animationstart`,c),t.removeEventListener(`animationcancel`,o),t.removeEventListener(`animationend`,o)}}s(`ANIMATION_END`)},[t,s]),{isPresent:[`mounted`,`unmountSuspended`].includes(o),ref:_.useCallback(e=>{r.current=e?getComputedStyle(e):null,n(e)},[])}}function Ie(e){return e?.animationName||`none`}function Le(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 Re=_.useInsertionEffect||Ae;function ze({prop:e,defaultProp:t,onChange:n=()=>{},caller:r}){let[i,a,o]=Be({defaultProp:t,onChange:n}),s=e!==void 0,c=s?e:i;{let t=_.useRef(e!==void 0);_.useEffect(()=>{let e=t.current;e!==s&&console.warn(`${r} is changing from ${e?`controlled`:`uncontrolled`} to ${s?`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.`),t.current=s},[s,r])}return[c,_.useCallback(t=>{if(s){let n=Ve(t)?t(e):t;n!==e&&o.current?.(n)}else a(t)},[s,e,a,o])]}function Be({defaultProp:e,onChange:t}){let[n,r]=_.useState(e),i=_.useRef(n),a=_.useRef(t);return Re(()=>{a.current=t},[t]),_.useEffect(()=>{i.current!==n&&(a.current?.(n),i.current=n)},[n,i]),[n,r,a]}function Ve(e){return typeof e==`function`}var He=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`}),Ue=`VisuallyHidden`,We=_.forwardRef((e,t)=>(0,I.jsx)(V.span,{...e,ref:t,style:{...He,...e.style}}));We.displayName=Ue;var Ge=We,Ke=`ToastProvider`,[qe,Je,Ye]=oe(`Toast`),[Xe,Ze]=R(`Toast`,[Ye]),[Qe,$e]=Xe(Ke),et=e=>{let{__scopeToast:t,label:n=`Notification`,duration:r=5e3,swipeDirection:i=`right`,swipeThreshold:a=50,children:o}=e,[s,c]=_.useState(null),[l,u]=_.useState(0),d=_.useRef(!1),f=_.useRef(!1);return n.trim()||console.error(`Invalid prop \`label\` supplied to \`${Ke}\`. Expected non-empty \`string\`.`),(0,I.jsx)(qe.Provider,{scope:t,children:(0,I.jsx)(Qe,{scope:t,label:n,duration:r,swipeDirection:i,swipeThreshold:a,toastCount:l,viewport:s,onViewportChange:c,onToastAdd:_.useCallback(()=>u(e=>e+1),[]),onToastRemove:_.useCallback(()=>u(e=>e-1),[]),isFocusedToastEscapeKeyDownRef:d,isClosePausedRef:f,children:o})})};et.displayName=Ke;var tt=`ToastViewport`,nt=[`F8`],rt=`toast.viewportPause`,it=`toast.viewportResume`,at=_.forwardRef((e,t)=>{let{__scopeToast:n,hotkey:r=nt,label:i=`Notifications ({hotkey})`,...a}=e,o=$e(tt,n),s=Je(n),c=_.useRef(null),l=_.useRef(null),u=_.useRef(null),d=_.useRef(null),f=P(t,d,o.onViewportChange),p=r.join(`+`).replace(/Key/g,``).replace(/Digit/g,``),m=o.toastCount>0;_.useEffect(()=>{let e=e=>{r.length!==0&&r.every(t=>e[t]||e.code===t)&&d.current?.focus()};return document.addEventListener(`keydown`,e),()=>document.removeEventListener(`keydown`,e)},[r]),_.useEffect(()=>{let e=c.current,t=d.current;if(m&&e&&t){let n=()=>{if(!o.isClosePausedRef.current){let e=new CustomEvent(rt);t.dispatchEvent(e),o.isClosePausedRef.current=!0}},r=()=>{if(o.isClosePausedRef.current){let e=new CustomEvent(it);t.dispatchEvent(e),o.isClosePausedRef.current=!1}},i=t=>{e.contains(t.relatedTarget)||r()},a=()=>{e.contains(document.activeElement)||r()};return e.addEventListener(`focusin`,n),e.addEventListener(`focusout`,i),e.addEventListener(`pointermove`,n),e.addEventListener(`pointerleave`,a),window.addEventListener(`blur`,n),window.addEventListener(`focus`,r),()=>{e.removeEventListener(`focusin`,n),e.removeEventListener(`focusout`,i),e.removeEventListener(`pointermove`,n),e.removeEventListener(`pointerleave`,a),window.removeEventListener(`blur`,n),window.removeEventListener(`focus`,r)}}},[m,o.isClosePausedRef]);let h=_.useCallback(({tabbingDirection:e})=>{let t=s().map(t=>{let n=t.ref.current,r=[n,...Mt(n)];return e===`forwards`?r:r.reverse()});return(e===`forwards`?t.reverse():t).flat()},[s]);return _.useEffect(()=>{let e=d.current;if(e){let t=t=>{let n=t.altKey||t.ctrlKey||t.metaKey;if(t.key===`Tab`&&!n){let n=document.activeElement,r=t.shiftKey;if(t.target===e&&r){l.current?.focus();return}let i=h({tabbingDirection:r?`backwards`:`forwards`}),a=i.findIndex(e=>e===n);Nt(i.slice(a+1))?t.preventDefault():r?l.current?.focus():u.current?.focus()}};return e.addEventListener(`keydown`,t),()=>e.removeEventListener(`keydown`,t)}},[s,h]),(0,I.jsxs)(ke,{ref:c,role:`region`,"aria-label":i.replace(`{hotkey}`,p),tabIndex:-1,style:{pointerEvents:m?void 0:`none`},children:[m&&(0,I.jsx)(st,{ref:l,onFocusFromOutsideViewport:()=>{Nt(h({tabbingDirection:`forwards`}))}}),(0,I.jsx)(qe.Slot,{scope:n,children:(0,I.jsx)(V.ol,{tabIndex:-1,...a,ref:f})}),m&&(0,I.jsx)(st,{ref:u,onFocusFromOutsideViewport:()=>{Nt(h({tabbingDirection:`backwards`}))}})]})});at.displayName=tt;var ot=`ToastFocusProxy`,st=_.forwardRef((e,t)=>{let{__scopeToast:n,onFocusFromOutsideViewport:r,...i}=e,a=$e(ot,n);return(0,I.jsx)(We,{tabIndex:0,...i,ref:t,style:{position:`fixed`},onFocus:e=>{let t=e.relatedTarget;a.viewport?.contains(t)||r()}})});st.displayName=ot;var ct=`Toast`,lt=`toast.swipeStart`,ut=`toast.swipeMove`,dt=`toast.swipeCancel`,ft=`toast.swipeEnd`,pt=_.forwardRef((e,t)=>{let{forceMount:n,open:r,defaultOpen:i,onOpenChange:a,...o}=e,[s,c]=ze({prop:r,defaultProp:i??!0,onChange:a,caller:ct});return(0,I.jsx)(Pe,{present:n||s,children:(0,I.jsx)(gt,{open:s,...o,ref:t,onClose:()=>c(!1),onPause:pe(e.onPause),onResume:pe(e.onResume),onSwipeStart:j(e.onSwipeStart,e=>{e.currentTarget.setAttribute(`data-swipe`,`start`)}),onSwipeMove:j(e.onSwipeMove,e=>{let{x:t,y:n}=e.detail.delta;e.currentTarget.setAttribute(`data-swipe`,`move`),e.currentTarget.style.setProperty(`--radix-toast-swipe-move-x`,`${t}px`),e.currentTarget.style.setProperty(`--radix-toast-swipe-move-y`,`${n}px`)}),onSwipeCancel:j(e.onSwipeCancel,e=>{e.currentTarget.setAttribute(`data-swipe`,`cancel`),e.currentTarget.style.removeProperty(`--radix-toast-swipe-move-x`),e.currentTarget.style.removeProperty(`--radix-toast-swipe-move-y`),e.currentTarget.style.removeProperty(`--radix-toast-swipe-end-x`),e.currentTarget.style.removeProperty(`--radix-toast-swipe-end-y`)}),onSwipeEnd:j(e.onSwipeEnd,e=>{let{x:t,y:n}=e.detail.delta;e.currentTarget.setAttribute(`data-swipe`,`end`),e.currentTarget.style.removeProperty(`--radix-toast-swipe-move-x`),e.currentTarget.style.removeProperty(`--radix-toast-swipe-move-y`),e.currentTarget.style.setProperty(`--radix-toast-swipe-end-x`,`${t}px`),e.currentTarget.style.setProperty(`--radix-toast-swipe-end-y`,`${n}px`),c(!1)})})})});pt.displayName=ct;var[mt,ht]=Xe(ct,{onClose(){}}),gt=_.forwardRef((e,t)=>{let{__scopeToast:n,type:r=`foreground`,duration:i,open:a,onClose:o,onEscapeKeyDown:s,onPause:c,onResume:l,onSwipeStart:u,onSwipeMove:d,onSwipeCancel:f,onSwipeEnd:p,...m}=e,h=$e(ct,n),[g,v]=_.useState(null),y=P(t,e=>v(e)),b=_.useRef(null),x=_.useRef(null),S=i||h.duration,C=_.useRef(0),w=_.useRef(S),T=_.useRef(0),{onToastAdd:E,onToastRemove:D}=h,O=pe(()=>{g?.contains(document.activeElement)&&h.viewport?.focus(),o()}),k=_.useCallback(e=>{e&&e!==1/0&&(window.clearTimeout(T.current),C.current=new Date().getTime(),T.current=window.setTimeout(O,e))},[O]);_.useEffect(()=>{let e=h.viewport;if(e){let t=()=>{k(w.current),l?.()},n=()=>{let e=new Date().getTime()-C.current;w.current-=e,window.clearTimeout(T.current),c?.()};return e.addEventListener(rt,n),e.addEventListener(it,t),()=>{e.removeEventListener(rt,n),e.removeEventListener(it,t)}}},[h.viewport,S,c,l,k]),_.useEffect(()=>{a&&!h.isClosePausedRef.current&&k(S)},[a,S,h.isClosePausedRef,k]),_.useEffect(()=>(E(),()=>D()),[E,D]);let M=_.useMemo(()=>g?Dt(g):null,[g]);return h.viewport?(0,I.jsxs)(I.Fragment,{children:[M&&(0,I.jsx)(_t,{__scopeToast:n,role:`status`,"aria-live":r===`foreground`?`assertive`:`polite`,children:M}),(0,I.jsx)(mt,{scope:n,onClose:O,children:A.createPortal((0,I.jsx)(qe.ItemSlot,{scope:n,children:(0,I.jsx)(Oe,{asChild:!0,onEscapeKeyDown:j(s,()=>{h.isFocusedToastEscapeKeyDownRef.current||O(),h.isFocusedToastEscapeKeyDownRef.current=!1}),children:(0,I.jsx)(V.li,{tabIndex:0,"data-state":a?`open`:`closed`,"data-swipe-direction":h.swipeDirection,...m,ref:y,style:{userSelect:`none`,touchAction:`none`,...e.style},onKeyDown:j(e.onKeyDown,e=>{e.key===`Escape`&&(s?.(e.nativeEvent),e.nativeEvent.defaultPrevented||(h.isFocusedToastEscapeKeyDownRef.current=!0,O()))}),onPointerDown:j(e.onPointerDown,e=>{e.button===0&&(b.current={x:e.clientX,y:e.clientY})}),onPointerMove:j(e.onPointerMove,e=>{if(!b.current)return;let t=e.clientX-b.current.x,n=e.clientY-b.current.y,r=!!x.current,i=[`left`,`right`].includes(h.swipeDirection),a=[`left`,`up`].includes(h.swipeDirection)?Math.min:Math.max,o=i?a(0,t):0,s=i?0:a(0,n),c=e.pointerType===`touch`?10:2,l={x:o,y:s},f={originalEvent:e,delta:l};r?(x.current=l,Ot(ut,d,f,{discrete:!1})):kt(l,h.swipeDirection,c)?(x.current=l,Ot(lt,u,f,{discrete:!1}),e.target.setPointerCapture(e.pointerId)):(Math.abs(t)>c||Math.abs(n)>c)&&(b.current=null)}),onPointerUp:j(e.onPointerUp,e=>{let t=x.current,n=e.target;if(n.hasPointerCapture(e.pointerId)&&n.releasePointerCapture(e.pointerId),x.current=null,b.current=null,t){let n=e.currentTarget,r={originalEvent:e,delta:t};kt(t,h.swipeDirection,h.swipeThreshold)?Ot(ft,p,r,{discrete:!0}):Ot(dt,f,r,{discrete:!0}),n.addEventListener(`click`,e=>e.preventDefault(),{once:!0})}})})})}),h.viewport)})]}):null}),_t=e=>{let{__scopeToast:t,children:n,...r}=e,i=$e(ct,t),[a,o]=_.useState(!1),[s,c]=_.useState(!1);return At(()=>o(!0)),_.useEffect(()=>{let e=window.setTimeout(()=>c(!0),1e3);return()=>window.clearTimeout(e)},[]),s?null:(0,I.jsx)(Me,{asChild:!0,children:(0,I.jsx)(We,{...r,children:a&&(0,I.jsxs)(I.Fragment,{children:[i.label,` `,n]})})})},vt=`ToastTitle`,yt=_.forwardRef((e,t)=>{let{__scopeToast:n,...r}=e;return(0,I.jsx)(V.div,{...r,ref:t})});yt.displayName=vt;var bt=`ToastDescription`,xt=_.forwardRef((e,t)=>{let{__scopeToast:n,...r}=e;return(0,I.jsx)(V.div,{...r,ref:t})});xt.displayName=bt;var St=`ToastAction`,Ct=_.forwardRef((e,t)=>{let{altText:n,...r}=e;return n.trim()?(0,I.jsx)(Et,{altText:n,asChild:!0,children:(0,I.jsx)(Tt,{...r,ref:t})}):(console.error(`Invalid prop \`altText\` supplied to \`${St}\`. Expected non-empty \`string\`.`),null)});Ct.displayName=St;var wt=`ToastClose`,Tt=_.forwardRef((e,t)=>{let{__scopeToast:n,...r}=e,i=ht(wt,n);return(0,I.jsx)(Et,{asChild:!0,children:(0,I.jsx)(V.button,{type:`button`,...r,ref:t,onClick:j(e.onClick,i.onClose)})})});Tt.displayName=wt;var Et=_.forwardRef((e,t)=>{let{__scopeToast:n,altText:r,...i}=e;return(0,I.jsx)(V.div,{"data-radix-toast-announce-exclude":``,"data-radix-toast-announce-alt":r||void 0,...i,ref:t})});function Dt(e){let t=[];return Array.from(e.childNodes).forEach(e=>{if(e.nodeType===e.TEXT_NODE&&e.textContent&&t.push(e.textContent),jt(e)){let n=e.ariaHidden||e.hidden||e.style.display===`none`,r=e.dataset.radixToastAnnounceExclude===``;if(!n){if(r){let n=e.dataset.radixToastAnnounceAlt;n&&t.push(n)}else t.push(...Dt(e))}}}),t}function Ot(e,t,n,{discrete:r}){let i=n.originalEvent.currentTarget,a=new CustomEvent(e,{bubbles:!0,cancelable:!0,detail:n});t&&i.addEventListener(e,t,{once:!0}),r?fe(i,a):i.dispatchEvent(a)}var kt=(e,t,n=0)=>{let r=Math.abs(e.x),i=Math.abs(e.y),a=r>i;return t===`left`||t===`right`?a&&r>n:!a&&i>n};function At(e=()=>{}){let t=pe(e);Ae(()=>{let e=0,n=0;return e=window.requestAnimationFrame(()=>n=window.requestAnimationFrame(t)),()=>{window.cancelAnimationFrame(e),window.cancelAnimationFrame(n)}},[t])}function jt(e){return e.nodeType===e.ELEMENT_NODE}function Mt(e){let t=[],n=document.createTreeWalker(e,NodeFilter.SHOW_ELEMENT,{acceptNode:e=>{let t=e.tagName===`INPUT`&&e.type===`hidden`;return e.disabled||e.hidden||t?NodeFilter.FILTER_SKIP:e.tabIndex>=0?NodeFilter.FILTER_ACCEPT:NodeFilter.FILTER_SKIP}});for(;n.nextNode();)t.push(n.currentNode);return t}function Nt(e){let t=document.activeElement;return e.some(e=>e===t||(e.focus(),document.activeElement!==t))}var Pt=et,Ft=at,It=pt,Lt=yt,Rt=xt,zt=Ct,Bt=Tt;function Vt(e){var t,n,r=``;if(typeof e==`string`||typeof e==`number`)r+=e;else if(typeof e==`object`){if(Array.isArray(e)){var i=e.length;for(t=0;t<i;t++)e[t]&&(n=Vt(e[t]))&&(r&&(r+=` `),r+=n)}else for(n in e)e[n]&&(r&&(r+=` `),r+=n)}return r}function Ht(){for(var e,t,n=0,r=``,i=arguments.length;n<i;n++)(e=arguments[n])&&(t=Vt(e))&&(r&&(r+=` `),r+=t);return r}var Ut=e=>typeof e==`boolean`?`${e}`:e===0?`0`:e,Wt=Ht,Gt=(e,t)=>n=>{if(t?.variants==null)return Wt(e,n?.class,n?.className);let{variants:r,defaultVariants:i}=t,a=Object.keys(r).map(e=>{let t=n?.[e],a=i?.[e];if(t===null)return null;let o=Ut(t)||Ut(a);return r[e][o]}),o=n&&Object.entries(n).reduce((e,t)=>{let[n,r]=t;return r===void 0||(e[n]=r),e},{});return Wt(e,a,t?.compoundVariants?.reduce((e,t)=>{let{class:n,className:r,...a}=t;return Object.entries(a).every(e=>{let[t,n]=e;return Array.isArray(n)?n.includes({...i,...o}[t]):{...i,...o}[t]===n})?[...e,n,r]:e},[]),n?.class,n?.className)},Kt=e=>e.replace(/([a-z0-9])([A-Z])/g,`$1-$2`).toLowerCase(),qt=(...e)=>e.filter((e,t,n)=>!!e&&e.trim()!==``&&n.indexOf(e)===t).join(` `).trim(),Jt={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`},Yt=(0,_.forwardRef)(({color:e=`currentColor`,size:t=24,strokeWidth:n=2,absoluteStrokeWidth:r,className:i=``,children:a,iconNode:o,...s},c)=>(0,_.createElement)(`svg`,{ref:c,...Jt,width:t,height:t,stroke:e,strokeWidth:r?Number(n)*24/Number(t):n,className:qt(`lucide`,i),...s},[...o.map(([e,t])=>(0,_.createElement)(e,t)),...Array.isArray(a)?a:[a]])),H=(e,t)=>{let n=(0,_.forwardRef)(({className:n,...r},i)=>(0,_.createElement)(Yt,{ref:i,iconNode:t,className:qt(`lucide-${Kt(e)}`,n),...r}));return n.displayName=`${e}`,n},Xt=H(`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`}]]),Zt=H(`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`}]]),Qt=H(`ArrowLeft`,[[`path`,{d:`m12 19-7-7 7-7`,key:`1l729n`}],[`path`,{d:`M19 12H5`,key:`x3x0zl`}]]),$t=H(`Ban`,[[`circle`,{cx:`12`,cy:`12`,r:`10`,key:`1mglay`}],[`path`,{d:`m4.9 4.9 14.2 14.2`,key:`1m5liu`}]]),en=H(`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`}]]),tn=H(`Brain`,[[`path`,{d:`M12 5a3 3 0 1 0-5.997.125 4 4 0 0 0-2.526 5.77 4 4 0 0 0 .556 6.588A4 4 0 1 0 12 18Z`,key:`l5xja`}],[`path`,{d:`M12 5a3 3 0 1 1 5.997.125 4 4 0 0 1 2.526 5.77 4 4 0 0 1-.556 6.588A4 4 0 1 1 12 18Z`,key:`ep3f8r`}],[`path`,{d:`M15 13a4.5 4.5 0 0 1-3-4 4.5 4.5 0 0 1-3 4`,key:`1p4c4q`}],[`path`,{d:`M17.599 6.5a3 3 0 0 0 .399-1.375`,key:`tmeiqw`}],[`path`,{d:`M6.003 5.125A3 3 0 0 0 6.401 6.5`,key:`105sqy`}],[`path`,{d:`M3.477 10.896a4 4 0 0 1 .585-.396`,key:`ql3yin`}],[`path`,{d:`M19.938 10.5a4 4 0 0 1 .585.396`,key:`1qfode`}],[`path`,{d:`M6 18a4 4 0 0 1-1.967-.516`,key:`2e4loj`}],[`path`,{d:`M19.967 17.484A4 4 0 0 1 18 18`,key:`159ez6`}]]),nn=H(`CalendarRange`,[[`rect`,{width:`18`,height:`18`,x:`3`,y:`4`,rx:`2`,key:`1hopcy`}],[`path`,{d:`M16 2v4`,key:`4m81vk`}],[`path`,{d:`M3 10h18`,key:`8toen8`}],[`path`,{d:`M8 2v4`,key:`1cmpym`}],[`path`,{d:`M17 14h-6`,key:`bkmgh3`}],[`path`,{d:`M13 18H7`,key:`bb0bb7`}],[`path`,{d:`M7 14h.01`,key:`1qa3f1`}],[`path`,{d:`M17 18h.01`,key:`1bdyru`}]]),rn=H(`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`}]]),an=H(`Check`,[[`path`,{d:`M20 6 9 17l-5-5`,key:`1gmf2c`}]]),on=H(`ChevronDown`,[[`path`,{d:`m6 9 6 6 6-6`,key:`qrunsl`}]]),sn=H(`ChevronRight`,[[`path`,{d:`m9 18 6-6-6-6`,key:`mthhwq`}]]),cn=H(`ChevronUp`,[[`path`,{d:`m18 15-6-6-6 6`,key:`153udz`}]]),ln=H(`ChevronsUpDown`,[[`path`,{d:`m7 15 5 5 5-5`,key:`1hf1tw`}],[`path`,{d:`m7 9 5-5 5 5`,key:`sgt6xg`}]]),un=H(`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`}]]),dn=H(`CircleCheck`,[[`circle`,{cx:`12`,cy:`12`,r:`10`,key:`1mglay`}],[`path`,{d:`m9 12 2 2 4-4`,key:`dzmm74`}]]),fn=H(`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`}]]),pn=H(`CircleMinus`,[[`circle`,{cx:`12`,cy:`12`,r:`10`,key:`1mglay`}],[`path`,{d:`M8 12h8`,key:`1wcyev`}]]),mn=H(`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`}]]),hn=H(`Circle`,[[`circle`,{cx:`12`,cy:`12`,r:`10`,key:`1mglay`}]]),gn=H(`Clock3`,[[`circle`,{cx:`12`,cy:`12`,r:`10`,key:`1mglay`}],[`polyline`,{points:`12 6 12 12 16.5 12`,key:`1aq6pp`}]]),_n=H(`Clock`,[[`circle`,{cx:`12`,cy:`12`,r:`10`,key:`1mglay`}],[`polyline`,{points:`12 6 12 12 16 14`,key:`68esgv`}]]),vn=H(`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`}]]),yn=H(`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`}]]),bn=H(`Earth`,[[`path`,{d:`M21.54 15H17a2 2 0 0 0-2 2v4.54`,key:`1djwo0`}],[`path`,{d:`M7 3.34V5a3 3 0 0 0 3 3a2 2 0 0 1 2 2c0 1.1.9 2 2 2a2 2 0 0 0 2-2c0-1.1.9-2 2-2h3.17`,key:`1tzkfa`}],[`path`,{d:`M11 21.95V18a2 2 0 0 0-2-2a2 2 0 0 1-2-2v-1a2 2 0 0 0-2-2H2.05`,key:`14pb5j`}],[`circle`,{cx:`12`,cy:`12`,r:`10`,key:`1mglay`}]]),xn=H(`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`}]]),Sn=H(`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`}]]),Cn=H(`EyeOff`,[[`path`,{d:`M10.733 5.076a10.744 10.744 0 0 1 11.205 6.575 1 1 0 0 1 0 .696 10.747 10.747 0 0 1-1.444 2.49`,key:`ct8e1f`}],[`path`,{d:`M14.084 14.158a3 3 0 0 1-4.242-4.242`,key:`151rxh`}],[`path`,{d:`M17.479 17.499a10.75 10.75 0 0 1-15.417-5.151 1 1 0 0 1 0-.696 10.75 10.75 0 0 1 4.446-5.143`,key:`13bj9a`}],[`path`,{d:`m2 2 20 20`,key:`1ooewy`}]]),wn=H(`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`}]]),Tn=H(`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`}]]),En=H(`FileSpreadsheet`,[[`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:`M8 13h2`,key:`yr2amv`}],[`path`,{d:`M14 13h2`,key:`un5t4a`}],[`path`,{d:`M8 17h2`,key:`2yhykz`}],[`path`,{d:`M14 17h2`,key:`10kma7`}]]),Dn=H(`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`}]]),On=H(`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`}]]),kn=H(`Folder`,[[`path`,{d:`M20 20a2 2 0 0 0 2-2V8a2 2 0 0 0-2-2h-7.9a2 2 0 0 1-1.69-.9L9.6 3.9A2 2 0 0 0 7.93 3H4a2 2 0 0 0-2 2v13a2 2 0 0 0 2 2Z`,key:`1kt360`}]]),An=H(`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`}]]),jn=H(`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`}]]),Mn=H(`House`,[[`path`,{d:`M15 21v-8a1 1 0 0 0-1-1h-4a1 1 0 0 0-1 1v8`,key:`5wwlr5`}],[`path`,{d:`M3 10a2 2 0 0 1 .709-1.528l7-5.999a2 2 0 0 1 2.582 0l7 5.999A2 2 0 0 1 21 10v9a2 2 0 0 1-2 2H5a2 2 0 0 1-2-2z`,key:`1d0kgt`}]]),Nn=H(`Info`,[[`circle`,{cx:`12`,cy:`12`,r:`10`,key:`1mglay`}],[`path`,{d:`M12 16v-4`,key:`1dtifu`}],[`path`,{d:`M12 8h.01`,key:`e9boi3`}]]),Pn=H(`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`}]]),Fn=H(`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`}]]),In=H(`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`}]]),Ln=H(`Link2`,[[`path`,{d:`M9 17H7A5 5 0 0 1 7 7h2`,key:`8i5ue5`}],[`path`,{d:`M15 7h2a5 5 0 1 1 0 10h-2`,key:`1b9ql8`}],[`line`,{x1:`8`,x2:`16`,y1:`12`,y2:`12`,key:`1jonct`}]]),Rn=H(`ListPlus`,[[`path`,{d:`M11 12H3`,key:`51ecnj`}],[`path`,{d:`M16 6H3`,key:`1wxfjs`}],[`path`,{d:`M16 18H3`,key:`12xzn7`}],[`path`,{d:`M18 9v6`,key:`1twb98`}],[`path`,{d:`M21 12h-6`,key:`bt1uis`}]]),zn=H(`LoaderCircle`,[[`path`,{d:`M21 12a9 9 0 1 1-6.219-8.56`,key:`13zald`}]]),Bn=H(`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`}]]),Vn=H(`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`}]]),Hn=H(`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`}]]),Un=H(`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`}]]),Wn=H(`PanelLeft`,[[`rect`,{width:`18`,height:`18`,x:`3`,y:`3`,rx:`2`,key:`afitv7`}],[`path`,{d:`M9 3v18`,key:`fh3hqa`}]]),Gn=H(`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`}]]),Kn=H(`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`}]]),qn=H(`Paperclip`,[[`path`,{d:`m21.44 11.05-9.19 9.19a6 6 0 0 1-8.49-8.49l8.57-8.57A4 4 0 1 1 18 8.84l-8.59 8.57a2 2 0 0 1-2.83-2.83l8.49-8.48`,key:`1u3ebp`}]]),Jn=H(`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`}]]),Yn=H(`Play`,[[`polygon`,{points:`6 3 20 12 6 21 6 3`,key:`1oa8hb`}]]),Xn=H(`Plus`,[[`path`,{d:`M5 12h14`,key:`1ays0h`}],[`path`,{d:`M12 5v14`,key:`s699le`}]]),Zn=H(`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`}]]),Qn=H(`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`}]]),$n=H(`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`}]]),er=H(`Search`,[[`circle`,{cx:`11`,cy:`11`,r:`8`,key:`4ej97u`}],[`path`,{d:`m21 21-4.3-4.3`,key:`1qie3q`}]]),tr=H(`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`}]]),nr=H(`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`}]]),rr=H(`ShieldAlert`,[[`path`,{d:`M20 13c0 5-3.5 7.5-7.66 8.95a1 1 0 0 1-.67-.01C7.5 20.5 4 18 4 13V6a1 1 0 0 1 1-1c2 0 4.5-1.2 6.24-2.72a1.17 1.17 0 0 1 1.52 0C14.51 3.81 17 5 19 5a1 1 0 0 1 1 1z`,key:`oel41y`}],[`path`,{d:`M12 8v4`,key:`1got3b`}],[`path`,{d:`M12 16h.01`,key:`1drbdi`}]]),ir=H(`ShieldCheck`,[[`path`,{d:`M20 13c0 5-3.5 7.5-7.66 8.95a1 1 0 0 1-.67-.01C7.5 20.5 4 18 4 13V6a1 1 0 0 1 1-1c2 0 4.5-1.2 6.24-2.72a1.17 1.17 0 0 1 1.52 0C14.51 3.81 17 5 19 5a1 1 0 0 1 1 1z`,key:`oel41y`}],[`path`,{d:`m9 12 2 2 4-4`,key:`dzmm74`}]]),ar=H(`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`}]]),or=H(`SquarePen`,[[`path`,{d:`M12 3H5a2 2 0 0 0-2 2v14a2 2 0 0 0 2 2h14a2 2 0 0 0 2-2v-7`,key:`1m0v6g`}],[`path`,{d:`M18.375 2.625a1 1 0 0 1 3 3l-9.013 9.014a2 2 0 0 1-.853.505l-2.873.84a.5.5 0 0 1-.62-.62l.84-2.873a2 2 0 0 1 .506-.852z`,key:`ohrbg2`}]]),sr=H(`Square`,[[`rect`,{width:`18`,height:`18`,x:`3`,y:`3`,rx:`2`,key:`afitv7`}]]),cr=H(`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`}]]),lr=H(`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`}]]),ur=H(`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`}]]),dr=H(`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`}]]),fr=H(`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`}]]),pr=H(`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`}]]),mr=H(`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`}]]),hr=H(`X`,[[`path`,{d:`M18 6 6 18`,key:`1bl5f8`}],[`path`,{d:`m6 6 12 12`,key:`d8bk6v`}]]),gr=(e,t)=>{let n=Array(e.length+t.length);for(let t=0;t<e.length;t++)n[t]=e[t];for(let r=0;r<t.length;r++)n[e.length+r]=t[r];return n},_r=(e,t)=>({classGroupId:e,validator:t}),vr=(e=new Map,t=null,n)=>({nextPart:e,validators:t,classGroupId:n}),yr=`-`,br=[],xr=`arbitrary..`,Sr=e=>{let t=Tr(e),{conflictingClassGroups:n,conflictingClassGroupModifiers:r}=e;return{getClassGroupId:e=>{if(e.startsWith(`[`)&&e.endsWith(`]`))return wr(e);let n=e.split(yr);return Cr(n,+(n[0]===``&&n.length>1),t)},getConflictingClassGroupIds:(e,t)=>{if(t){let t=r[e],i=n[e];return t?i?gr(i,t):t:i||br}return n[e]||br}}},Cr=(e,t,n)=>{if(e.length-t===0)return n.classGroupId;let r=e[t],i=n.nextPart.get(r);if(i){let n=Cr(e,t+1,i);if(n)return n}let a=n.validators;if(a===null)return;let o=t===0?e.join(yr):e.slice(t).join(yr),s=a.length;for(let e=0;e<s;e++){let t=a[e];if(t.validator(o))return t.classGroupId}},wr=e=>e.slice(1,-1).indexOf(`:`)===-1?void 0:(()=>{let t=e.slice(1,-1),n=t.indexOf(`:`),r=t.slice(0,n);return r?xr+r:void 0})(),Tr=e=>{let{theme:t,classGroups:n}=e;return Er(n,t)},Er=(e,t)=>{let n=vr();for(let r in e){let i=e[r];Dr(i,n,r,t)}return n},Dr=(e,t,n,r)=>{let i=e.length;for(let a=0;a<i;a++){let i=e[a];Or(i,t,n,r)}},Or=(e,t,n,r)=>{typeof e==`string`?kr(e,t,n):typeof e==`function`?Ar(e,t,n,r):jr(e,t,n,r)},kr=(e,t,n)=>{let r=e===``?t:Mr(t,e);r.classGroupId=n},Ar=(e,t,n,r)=>{Nr(e)?Dr(e(r),t,n,r):(t.validators===null&&(t.validators=[]),t.validators.push(_r(n,e)))},jr=(e,t,n,r)=>{let i=Object.entries(e),a=i.length;for(let e=0;e<a;e++){let[a,o]=i[e];Dr(o,Mr(t,a),n,r)}},Mr=(e,t)=>{let n=e,r=t.split(yr),i=r.length;for(let e=0;e<i;e++){let t=r[e],i=n.nextPart.get(t);i||(i=vr(),n.nextPart.set(t,i)),n=i}return n},Nr=e=>`isThemeGetter`in e&&e.isThemeGetter===!0,Pr=e=>{if(e<1)return{get:()=>void 0,set:()=>{}};let t=0,n=Object.create(null),r=Object.create(null),i=(i,a)=>{n[i]=a,t++,t>e&&(t=0,r=n,n=Object.create(null))};return{get(e){let t=n[e];if(t!==void 0)return t;if((t=r[e])!==void 0)return i(e,t),t},set(e,t){e in n?n[e]=t:i(e,t)}}},Fr=`!`,Ir=`:`,Lr=[],Rr=(e,t,n,r,i)=>({modifiers:e,hasImportantModifier:t,baseClassName:n,maybePostfixModifierPosition:r,isExternal:i}),zr=e=>{let{prefix:t,experimentalParseClassName:n}=e,r=e=>{let t=[],n=0,r=0,i=0,a,o=e.length;for(let s=0;s<o;s++){let o=e[s];if(n===0&&r===0){if(o===Ir){t.push(e.slice(i,s)),i=s+1;continue}if(o===`/`){a=s;continue}}o===`[`?n++:o===`]`?n--:o===`(`?r++:o===`)`&&r--}let s=t.length===0?e:e.slice(i),c=s,l=!1;s.endsWith(Fr)?(c=s.slice(0,-1),l=!0):s.startsWith(Fr)&&(c=s.slice(1),l=!0);let u=a&&a>i?a-i:void 0;return Rr(t,l,c,u)};if(t){let e=t+Ir,n=r;r=t=>t.startsWith(e)?n(t.slice(e.length)):Rr(Lr,!1,t,void 0,!0)}if(n){let e=r;r=t=>n({className:t,parseClassName:e})}return r},Br=e=>{let t=new Map;return e.orderSensitiveModifiers.forEach((e,n)=>{t.set(e,1e6+n)}),e=>{let n=[],r=[];for(let i=0;i<e.length;i++){let a=e[i],o=a[0]===`[`,s=t.has(a);o||s?(r.length>0&&(r.sort(),n.push(...r),r=[]),n.push(a)):r.push(a)}return r.length>0&&(r.sort(),n.push(...r)),n}},Vr=e=>({cache:Pr(e.cacheSize),parseClassName:zr(e),sortModifiers:Br(e),postfixLookupClassGroupIds:Hr(e),...Sr(e)}),Hr=e=>{let t=Object.create(null),n=e.postfixLookupClassGroups;if(n)for(let e=0;e<n.length;e++)t[n[e]]=!0;return t},Ur=/\s+/,Wr=(e,t)=>{let{parseClassName:n,getClassGroupId:r,getConflictingClassGroupIds:i,sortModifiers:a,postfixLookupClassGroupIds:o}=t,s=[],c=e.trim().split(Ur),l=``;for(let e=c.length-1;e>=0;--e){let t=c[e],{isExternal:u,modifiers:d,hasImportantModifier:f,baseClassName:p,maybePostfixModifierPosition:m}=n(t);if(u){l=t+(l.length>0?` `+l:l);continue}let h=!!m,g;if(h){g=r(p.substring(0,m));let e=g&&o[g]?r(p):void 0;e&&e!==g&&(g=e,h=!1)}else g=r(p);if(!g){if(!h||(g=r(p),!g)){l=t+(l.length>0?` `+l:l);continue}h=!1}let _=d.length===0?``:d.length===1?d[0]:a(d).join(`:`),v=f?_+Fr:_,y=v+g;if(s.indexOf(y)>-1)continue;s.push(y);let b=i(g,h);for(let e=0;e<b.length;++e){let t=b[e];s.push(v+t)}l=t+(l.length>0?` `+l:l)}return l},Gr=(...e)=>{let t=0,n,r,i=``;for(;t<e.length;)(n=e[t++])&&(r=Kr(n))&&(i&&(i+=` `),i+=r);return i},Kr=e=>{if(typeof e==`string`)return e;let t,n=``;for(let r=0;r<e.length;r++)e[r]&&(t=Kr(e[r]))&&(n&&(n+=` `),n+=t);return n},qr=(e,...t)=>{let n,r,i,a,o=o=>(n=Vr(t.reduce((e,t)=>t(e),e())),r=n.cache.get,i=n.cache.set,a=s,s(o)),s=e=>{let t=r(e);if(t)return t;let a=Wr(e,n);return i(e,a),a};return a=o,(...e)=>a(Gr(...e))},Jr=[],Yr=e=>{let t=t=>t[e]||Jr;return t.isThemeGetter=!0,t.themeKey=e,t},Xr=/^\[(?:(\w[\w-]*):)?(.+)\]$/i,Zr=/^\((?:(\w[\w-]*):)?(.+)\)$/i,Qr=/^\d+(?:\.\d+)?\/\d+(?:\.\d+)?$/,$r=/^(\d+(\.\d+)?)?(xs|sm|md|lg|xl)$/,ei=/\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$/,ti=/^(rgba?|hsla?|hwb|(ok)?(lab|lch)|color-mix|color|light-dark)\(.+\)$/,ni=/^(inset_)?-?((\d+)?\.?(\d+)[a-z]+|0)_-?((\d+)?\.?(\d+)[a-z]+|0)/,ri=/^(url|image|image-set|cross-fade|element|(repeating-)?(linear|radial|conic)-gradient)\(.+\)$/,ii=e=>Qr.test(e),ai=e=>!!e&&!Number.isNaN(Number(e)),oi=e=>!!e&&Number.isInteger(Number(e)),si=e=>e.endsWith(`%`)&&ai(e.slice(0,-1)),ci=e=>$r.test(e),li=()=>!0,ui=e=>ei.test(e)&&!ti.test(e),di=()=>!1,fi=e=>ni.test(e),pi=e=>ri.test(e),mi=e=>!_i(e)&&!Ti(e),hi=e=>e.startsWith(`@container`)&&(e[10]===`/`&&e[11]!==void 0||e[11]===`s`&&e[16]!==void 0&&e.startsWith(`-size/`,10)||e[11]===`n`&&e[18]!==void 0&&e.startsWith(`-normal/`,10)),gi=e=>Ni(e,Li,di),_i=e=>Xr.test(e),vi=e=>Ni(e,Ri,ui),yi=e=>Ni(e,zi,ai),bi=e=>Ni(e,Vi,li),xi=e=>Ni(e,Bi,di),Si=e=>Ni(e,Fi,di),Ci=e=>Ni(e,Ii,pi),wi=e=>Ni(e,Hi,fi),Ti=e=>Zr.test(e),Ei=e=>Pi(e,Ri),Di=e=>Pi(e,Bi),Oi=e=>Pi(e,Fi),ki=e=>Pi(e,Li),Ai=e=>Pi(e,Ii),ji=e=>Pi(e,Hi,!0),Mi=e=>Pi(e,Vi,!0),Ni=(e,t,n)=>{let r=Xr.exec(e);return r?r[1]?t(r[1]):n(r[2]):!1},Pi=(e,t,n=!1)=>{let r=Zr.exec(e);return r?r[1]?t(r[1]):n:!1},Fi=e=>e===`position`||e===`percentage`,Ii=e=>e===`image`||e===`url`,Li=e=>e===`length`||e===`size`||e===`bg-size`,Ri=e=>e===`length`,zi=e=>e===`number`,Bi=e=>e===`family-name`,Vi=e=>e===`number`||e===`weight`,Hi=e=>e===`shadow`,Ui=qr(()=>{let e=Yr(`color`),t=Yr(`font`),n=Yr(`text`),r=Yr(`font-weight`),i=Yr(`tracking`),a=Yr(`leading`),o=Yr(`breakpoint`),s=Yr(`container`),c=Yr(`spacing`),l=Yr(`radius`),u=Yr(`shadow`),d=Yr(`inset-shadow`),f=Yr(`text-shadow`),p=Yr(`drop-shadow`),m=Yr(`blur`),h=Yr(`perspective`),g=Yr(`aspect`),_=Yr(`ease`),v=Yr(`animate`),y=()=>[`auto`,`avoid`,`all`,`avoid-page`,`page`,`left`,`right`,`column`],b=()=>[`center`,`top`,`bottom`,`left`,`right`,`top-left`,`left-top`,`top-right`,`right-top`,`bottom-right`,`right-bottom`,`bottom-left`,`left-bottom`],x=()=>[...b(),Ti,_i],S=()=>[`auto`,`hidden`,`clip`,`visible`,`scroll`],C=()=>[`auto`,`contain`,`none`],w=()=>[Ti,_i,c],T=()=>[ii,`full`,`auto`,...w()],E=()=>[oi,`none`,`subgrid`,Ti,_i],D=()=>[`auto`,{span:[`full`,oi,Ti,_i]},oi,Ti,_i],O=()=>[oi,`auto`,Ti,_i],k=()=>[`auto`,`min`,`max`,`fr`,Ti,_i],A=()=>[`start`,`end`,`center`,`between`,`around`,`evenly`,`stretch`,`baseline`,`center-safe`,`end-safe`],j=()=>[`start`,`end`,`center`,`stretch`,`center-safe`,`end-safe`],M=()=>[`auto`,...w()],N=()=>[ii,`auto`,`full`,`dvw`,`dvh`,`lvw`,`lvh`,`svw`,`svh`,`min`,`max`,`fit`,...w()],P=()=>[s,ii,`screen`,`full`,`dvw`,`lvw`,`svw`,`min`,`max`,`fit`,...w()],F=()=>[ii,`screen`,`full`,`lh`,`dvh`,`lvh`,`svh`,`min`,`max`,`fit`,...w()],I=()=>[e,Ti,_i],L=()=>[...b(),Oi,Si,{position:[Ti,_i]}],R=()=>[`no-repeat`,{repeat:[``,`x`,`y`,`space`,`round`]}],z=()=>[`auto`,`cover`,`contain`,ki,gi,{size:[Ti,_i]}],ee=()=>[si,Ei,vi],te=()=>[``,`none`,`full`,l,Ti,_i],ne=()=>[``,ai,Ei,vi],re=()=>[`solid`,`dashed`,`dotted`,`double`],ie=()=>[`normal`,`multiply`,`screen`,`overlay`,`darken`,`lighten`,`color-dodge`,`color-burn`,`hard-light`,`soft-light`,`difference`,`exclusion`,`hue`,`saturation`,`color`,`luminosity`],ae=()=>[ai,si,Oi,Si],oe=()=>[``,`none`,m,Ti,_i],se=()=>[`none`,ai,Ti,_i],ce=()=>[`none`,ai,Ti,_i],B=()=>[ai,Ti,_i],le=()=>[ii,`full`,...w()];return{cacheSize:500,theme:{animate:[`spin`,`ping`,`pulse`,`bounce`],aspect:[`video`],blur:[ci],breakpoint:[ci],color:[li],container:[ci],"drop-shadow":[ci],ease:[`in`,`out`,`in-out`],font:[mi],"font-weight":[`thin`,`extralight`,`light`,`normal`,`medium`,`semibold`,`bold`,`extrabold`,`black`],"inset-shadow":[ci],leading:[`none`,`tight`,`snug`,`normal`,`relaxed`,`loose`],perspective:[`dramatic`,`near`,`normal`,`midrange`,`distant`,`none`],radius:[ci],shadow:[ci],spacing:[`px`,ai],text:[ci],"text-shadow":[ci],tracking:[`tighter`,`tight`,`normal`,`wide`,`wider`,`widest`]},classGroups:{aspect:[{aspect:[`auto`,`square`,ii,_i,Ti,g]}],container:[`container`],"container-type":[{"@container":[``,`normal`,`size`,Ti,_i]}],"container-named":[hi],columns:[{columns:[ai,`auto`,_i,Ti,s]}],"break-after":[{"break-after":y()}],"break-before":[{"break-before":y()}],"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`],sr:[`sr-only`,`not-sr-only`],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:x()}],overflow:[{overflow:S()}],"overflow-x":[{"overflow-x":S()}],"overflow-y":[{"overflow-y":S()}],overscroll:[{overscroll:C()}],"overscroll-x":[{"overscroll-x":C()}],"overscroll-y":[{"overscroll-y":C()}],position:[`static`,`fixed`,`absolute`,`relative`,`sticky`],inset:[{inset:T()}],"inset-x":[{"inset-x":T()}],"inset-y":[{"inset-y":T()}],start:[{"inset-s":T(),start:T()}],end:[{"inset-e":T(),end:T()}],"inset-bs":[{"inset-bs":T()}],"inset-be":[{"inset-be":T()}],top:[{top:T()}],right:[{right:T()}],bottom:[{bottom:T()}],left:[{left:T()}],visibility:[`visible`,`invisible`,`collapse`],z:[{z:[oi,`auto`,Ti,_i]}],basis:[{basis:[ii,`full`,`auto`,s,...w()]}],"flex-direction":[{flex:[`row`,`row-reverse`,`col`,`col-reverse`]}],"flex-wrap":[{flex:[`nowrap`,`wrap`,`wrap-reverse`]}],flex:[{flex:[ai,ii,`auto`,`initial`,`none`,_i]}],grow:[{grow:[``,ai,Ti,_i]}],shrink:[{shrink:[``,ai,Ti,_i]}],order:[{order:[oi,`first`,`last`,`none`,Ti,_i]}],"grid-cols":[{"grid-cols":E()}],"col-start-end":[{col:D()}],"col-start":[{"col-start":O()}],"col-end":[{"col-end":O()}],"grid-rows":[{"grid-rows":E()}],"row-start-end":[{row:D()}],"row-start":[{"row-start":O()}],"row-end":[{"row-end":O()}],"grid-flow":[{"grid-flow":[`row`,`col`,`dense`,`row-dense`,`col-dense`]}],"auto-cols":[{"auto-cols":k()}],"auto-rows":[{"auto-rows":k()}],gap:[{gap:w()}],"gap-x":[{"gap-x":w()}],"gap-y":[{"gap-y":w()}],"justify-content":[{justify:[...A(),`normal`]}],"justify-items":[{"justify-items":[...j(),`normal`]}],"justify-self":[{"justify-self":[`auto`,...j()]}],"align-content":[{content:[`normal`,...A()]}],"align-items":[{items:[...j(),{baseline:[``,`last`]}]}],"align-self":[{self:[`auto`,...j(),{baseline:[``,`last`]}]}],"place-content":[{"place-content":A()}],"place-items":[{"place-items":[...j(),`baseline`]}],"place-self":[{"place-self":[`auto`,...j()]}],p:[{p:w()}],px:[{px:w()}],py:[{py:w()}],ps:[{ps:w()}],pe:[{pe:w()}],pbs:[{pbs:w()}],pbe:[{pbe:w()}],pt:[{pt:w()}],pr:[{pr:w()}],pb:[{pb:w()}],pl:[{pl:w()}],m:[{m:M()}],mx:[{mx:M()}],my:[{my:M()}],ms:[{ms:M()}],me:[{me:M()}],mbs:[{mbs:M()}],mbe:[{mbe:M()}],mt:[{mt:M()}],mr:[{mr:M()}],mb:[{mb:M()}],ml:[{ml:M()}],"space-x":[{"space-x":w()}],"space-x-reverse":[`space-x-reverse`],"space-y":[{"space-y":w()}],"space-y-reverse":[`space-y-reverse`],size:[{size:N()}],"inline-size":[{inline:[`auto`,...P()]}],"min-inline-size":[{"min-inline":[`auto`,...P()]}],"max-inline-size":[{"max-inline":[`none`,...P()]}],"block-size":[{block:[`auto`,...F()]}],"min-block-size":[{"min-block":[`auto`,...F()]}],"max-block-size":[{"max-block":[`none`,...F()]}],w:[{w:[s,`screen`,...N()]}],"min-w":[{"min-w":[s,`screen`,`none`,...N()]}],"max-w":[{"max-w":[s,`screen`,`none`,`prose`,{screen:[o]},...N()]}],h:[{h:[`screen`,`lh`,...N()]}],"min-h":[{"min-h":[`screen`,`lh`,`none`,...N()]}],"max-h":[{"max-h":[`screen`,`lh`,`none`,...N()]}],"font-size":[{text:[`base`,n,Ei,vi]}],"font-smoothing":[`antialiased`,`subpixel-antialiased`],"font-style":[`italic`,`not-italic`],"font-weight":[{font:[r,Mi,bi]}],"font-stretch":[{"font-stretch":[`ultra-condensed`,`extra-condensed`,`condensed`,`semi-condensed`,`normal`,`semi-expanded`,`expanded`,`extra-expanded`,`ultra-expanded`,si,_i]}],"font-family":[{font:[Di,xi,t]}],"font-features":[{"font-features":[_i]}],"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:[i,Ti,_i]}],"line-clamp":[{"line-clamp":[ai,`none`,Ti,yi]}],leading:[{leading:[`none`,a,...w()]}],"list-image":[{"list-image":[`none`,Ti,_i]}],"list-style-position":[{list:[`inside`,`outside`]}],"list-style-type":[{list:[`disc`,`decimal`,`none`,Ti,_i]}],"text-alignment":[{text:[`left`,`center`,`right`,`justify`,`start`,`end`]}],"placeholder-color":[{placeholder:I()}],"text-color":[{text:I()}],"text-decoration":[`underline`,`overline`,`line-through`,`no-underline`],"text-decoration-style":[{decoration:[...re(),`wavy`]}],"text-decoration-thickness":[{decoration:[ai,`from-font`,`auto`,Ti,vi]}],"text-decoration-color":[{decoration:I()}],"underline-offset":[{"underline-offset":[ai,`auto`,Ti,_i]}],"text-transform":[`uppercase`,`lowercase`,`capitalize`,`normal-case`],"text-overflow":[`truncate`,`text-ellipsis`,`text-clip`],"text-wrap":[{text:[`wrap`,`nowrap`,`balance`,`pretty`]}],indent:[{indent:w()}],"tab-size":[{tab:[oi,Ti,_i]}],"vertical-align":[{align:[`baseline`,`top`,`middle`,`bottom`,`text-top`,`text-bottom`,`sub`,`super`,Ti,_i]}],whitespace:[{whitespace:[`normal`,`nowrap`,`pre`,`pre-line`,`pre-wrap`,`break-spaces`]}],break:[{break:[`normal`,`words`,`all`,`keep`]}],wrap:[{wrap:[`break-word`,`anywhere`,`normal`]}],hyphens:[{hyphens:[`none`,`manual`,`auto`]}],content:[{content:[`none`,Ti,_i]}],"bg-attachment":[{bg:[`fixed`,`local`,`scroll`]}],"bg-clip":[{"bg-clip":[`border`,`padding`,`content`,`text`]}],"bg-origin":[{"bg-origin":[`border`,`padding`,`content`]}],"bg-position":[{bg:L()}],"bg-repeat":[{bg:R()}],"bg-size":[{bg:z()}],"bg-image":[{bg:[`none`,{linear:[{to:[`t`,`tr`,`r`,`br`,`b`,`bl`,`l`,`tl`]},oi,Ti,_i],radial:[``,Ti,_i],conic:[``,oi,Ti,_i]},Ai,Ci]}],"bg-color":[{bg:I()}],"gradient-from-pos":[{from:ee()}],"gradient-via-pos":[{via:ee()}],"gradient-to-pos":[{to:ee()}],"gradient-from":[{from:I()}],"gradient-via":[{via:I()}],"gradient-to":[{to:I()}],rounded:[{rounded:te()}],"rounded-s":[{"rounded-s":te()}],"rounded-e":[{"rounded-e":te()}],"rounded-t":[{"rounded-t":te()}],"rounded-r":[{"rounded-r":te()}],"rounded-b":[{"rounded-b":te()}],"rounded-l":[{"rounded-l":te()}],"rounded-ss":[{"rounded-ss":te()}],"rounded-se":[{"rounded-se":te()}],"rounded-ee":[{"rounded-ee":te()}],"rounded-es":[{"rounded-es":te()}],"rounded-tl":[{"rounded-tl":te()}],"rounded-tr":[{"rounded-tr":te()}],"rounded-br":[{"rounded-br":te()}],"rounded-bl":[{"rounded-bl":te()}],"border-w":[{border:ne()}],"border-w-x":[{"border-x":ne()}],"border-w-y":[{"border-y":ne()}],"border-w-s":[{"border-s":ne()}],"border-w-e":[{"border-e":ne()}],"border-w-bs":[{"border-bs":ne()}],"border-w-be":[{"border-be":ne()}],"border-w-t":[{"border-t":ne()}],"border-w-r":[{"border-r":ne()}],"border-w-b":[{"border-b":ne()}],"border-w-l":[{"border-l":ne()}],"divide-x":[{"divide-x":ne()}],"divide-x-reverse":[`divide-x-reverse`],"divide-y":[{"divide-y":ne()}],"divide-y-reverse":[`divide-y-reverse`],"border-style":[{border:[...re(),`hidden`,`none`]}],"divide-style":[{divide:[...re(),`hidden`,`none`]}],"border-color":[{border:I()}],"border-color-x":[{"border-x":I()}],"border-color-y":[{"border-y":I()}],"border-color-s":[{"border-s":I()}],"border-color-e":[{"border-e":I()}],"border-color-bs":[{"border-bs":I()}],"border-color-be":[{"border-be":I()}],"border-color-t":[{"border-t":I()}],"border-color-r":[{"border-r":I()}],"border-color-b":[{"border-b":I()}],"border-color-l":[{"border-l":I()}],"divide-color":[{divide:I()}],"outline-style":[{outline:[...re(),`none`,`hidden`]}],"outline-offset":[{"outline-offset":[ai,Ti,_i]}],"outline-w":[{outline:[``,ai,Ei,vi]}],"outline-color":[{outline:I()}],shadow:[{shadow:[``,`inner`,`none`,u,ji,wi]}],"shadow-color":[{shadow:I()}],"inset-shadow":[{"inset-shadow":[`none`,d,ji,wi]}],"inset-shadow-color":[{"inset-shadow":I()}],"ring-w":[{ring:ne()}],"ring-w-inset":[`ring-inset`],"ring-color":[{ring:I()}],"ring-offset-w":[{"ring-offset":[ai,vi]}],"ring-offset-color":[{"ring-offset":I()}],"inset-ring-w":[{"inset-ring":ne()}],"inset-ring-color":[{"inset-ring":I()}],"text-shadow":[{"text-shadow":[`none`,f,ji,wi]}],"text-shadow-color":[{"text-shadow":I()}],opacity:[{opacity:[ai,Ti,_i]}],"mix-blend":[{"mix-blend":[...ie(),`plus-darker`,`plus-lighter`]}],"bg-blend":[{"bg-blend":ie()}],"mask-clip":[{"mask-clip":[`border`,`padding`,`content`,`fill`,`stroke`,`view`]},`mask-no-clip`],"mask-composite":[{mask:[`add`,`subtract`,`intersect`,`exclude`]}],"mask-image-linear-pos":[{"mask-linear":[ai]}],"mask-image-linear-from-pos":[{"mask-linear-from":ae()}],"mask-image-linear-to-pos":[{"mask-linear-to":ae()}],"mask-image-linear-from-color":[{"mask-linear-from":I()}],"mask-image-linear-to-color":[{"mask-linear-to":I()}],"mask-image-t-from-pos":[{"mask-t-from":ae()}],"mask-image-t-to-pos":[{"mask-t-to":ae()}],"mask-image-t-from-color":[{"mask-t-from":I()}],"mask-image-t-to-color":[{"mask-t-to":I()}],"mask-image-r-from-pos":[{"mask-r-from":ae()}],"mask-image-r-to-pos":[{"mask-r-to":ae()}],"mask-image-r-from-color":[{"mask-r-from":I()}],"mask-image-r-to-color":[{"mask-r-to":I()}],"mask-image-b-from-pos":[{"mask-b-from":ae()}],"mask-image-b-to-pos":[{"mask-b-to":ae()}],"mask-image-b-from-color":[{"mask-b-from":I()}],"mask-image-b-to-color":[{"mask-b-to":I()}],"mask-image-l-from-pos":[{"mask-l-from":ae()}],"mask-image-l-to-pos":[{"mask-l-to":ae()}],"mask-image-l-from-color":[{"mask-l-from":I()}],"mask-image-l-to-color":[{"mask-l-to":I()}],"mask-image-x-from-pos":[{"mask-x-from":ae()}],"mask-image-x-to-pos":[{"mask-x-to":ae()}],"mask-image-x-from-color":[{"mask-x-from":I()}],"mask-image-x-to-color":[{"mask-x-to":I()}],"mask-image-y-from-pos":[{"mask-y-from":ae()}],"mask-image-y-to-pos":[{"mask-y-to":ae()}],"mask-image-y-from-color":[{"mask-y-from":I()}],"mask-image-y-to-color":[{"mask-y-to":I()}],"mask-image-radial":[{"mask-radial":[Ti,_i]}],"mask-image-radial-from-pos":[{"mask-radial-from":ae()}],"mask-image-radial-to-pos":[{"mask-radial-to":ae()}],"mask-image-radial-from-color":[{"mask-radial-from":I()}],"mask-image-radial-to-color":[{"mask-radial-to":I()}],"mask-image-radial-shape":[{"mask-radial":[`circle`,`ellipse`]}],"mask-image-radial-size":[{"mask-radial":[{closest:[`side`,`corner`],farthest:[`side`,`corner`]}]}],"mask-image-radial-pos":[{"mask-radial-at":b()}],"mask-image-conic-pos":[{"mask-conic":[ai]}],"mask-image-conic-from-pos":[{"mask-conic-from":ae()}],"mask-image-conic-to-pos":[{"mask-conic-to":ae()}],"mask-image-conic-from-color":[{"mask-conic-from":I()}],"mask-image-conic-to-color":[{"mask-conic-to":I()}],"mask-mode":[{mask:[`alpha`,`luminance`,`match`]}],"mask-origin":[{"mask-origin":[`border`,`padding`,`content`,`fill`,`stroke`,`view`]}],"mask-position":[{mask:L()}],"mask-repeat":[{mask:R()}],"mask-size":[{mask:z()}],"mask-type":[{"mask-type":[`alpha`,`luminance`]}],"mask-image":[{mask:[`none`,Ti,_i]}],filter:[{filter:[``,`none`,Ti,_i]}],blur:[{blur:oe()}],brightness:[{brightness:[ai,Ti,_i]}],contrast:[{contrast:[ai,Ti,_i]}],"drop-shadow":[{"drop-shadow":[``,`none`,p,ji,wi]}],"drop-shadow-color":[{"drop-shadow":I()}],grayscale:[{grayscale:[``,ai,Ti,_i]}],"hue-rotate":[{"hue-rotate":[ai,Ti,_i]}],invert:[{invert:[``,ai,Ti,_i]}],saturate:[{saturate:[ai,Ti,_i]}],sepia:[{sepia:[``,ai,Ti,_i]}],"backdrop-filter":[{"backdrop-filter":[``,`none`,Ti,_i]}],"backdrop-blur":[{"backdrop-blur":oe()}],"backdrop-brightness":[{"backdrop-brightness":[ai,Ti,_i]}],"backdrop-contrast":[{"backdrop-contrast":[ai,Ti,_i]}],"backdrop-grayscale":[{"backdrop-grayscale":[``,ai,Ti,_i]}],"backdrop-hue-rotate":[{"backdrop-hue-rotate":[ai,Ti,_i]}],"backdrop-invert":[{"backdrop-invert":[``,ai,Ti,_i]}],"backdrop-opacity":[{"backdrop-opacity":[ai,Ti,_i]}],"backdrop-saturate":[{"backdrop-saturate":[ai,Ti,_i]}],"backdrop-sepia":[{"backdrop-sepia":[``,ai,Ti,_i]}],"border-collapse":[{border:[`collapse`,`separate`]}],"border-spacing":[{"border-spacing":w()}],"border-spacing-x":[{"border-spacing-x":w()}],"border-spacing-y":[{"border-spacing-y":w()}],"table-layout":[{table:[`auto`,`fixed`]}],caption:[{caption:[`top`,`bottom`]}],transition:[{transition:[``,`all`,`colors`,`opacity`,`shadow`,`transform`,`none`,Ti,_i]}],"transition-behavior":[{transition:[`normal`,`discrete`]}],duration:[{duration:[ai,`initial`,Ti,_i]}],ease:[{ease:[`linear`,`initial`,_,Ti,_i]}],delay:[{delay:[ai,Ti,_i]}],animate:[{animate:[`none`,v,Ti,_i]}],backface:[{backface:[`hidden`,`visible`]}],perspective:[{perspective:[h,Ti,_i]}],"perspective-origin":[{"perspective-origin":x()}],rotate:[{rotate:se()}],"rotate-x":[{"rotate-x":se()}],"rotate-y":[{"rotate-y":se()}],"rotate-z":[{"rotate-z":se()}],scale:[{scale:ce()}],"scale-x":[{"scale-x":ce()}],"scale-y":[{"scale-y":ce()}],"scale-z":[{"scale-z":ce()}],"scale-3d":[`scale-3d`],skew:[{skew:B()}],"skew-x":[{"skew-x":B()}],"skew-y":[{"skew-y":B()}],transform:[{transform:[Ti,_i,``,`none`,`gpu`,`cpu`]}],"transform-origin":[{origin:x()}],"transform-style":[{transform:[`3d`,`flat`]}],translate:[{translate:le()}],"translate-x":[{"translate-x":le()}],"translate-y":[{"translate-y":le()}],"translate-z":[{"translate-z":le()}],"translate-none":[`translate-none`],zoom:[{zoom:[oi,Ti,_i]}],accent:[{accent:I()}],appearance:[{appearance:[`none`,`auto`]}],"caret-color":[{caret:I()}],"color-scheme":[{scheme:[`normal`,`dark`,`light`,`light-dark`,`only-dark`,`only-light`]}],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`,Ti,_i]}],"field-sizing":[{"field-sizing":[`fixed`,`content`]}],"pointer-events":[{"pointer-events":[`auto`,`none`]}],resize:[{resize:[`none`,``,`y`,`x`]}],"scroll-behavior":[{scroll:[`auto`,`smooth`]}],"scrollbar-thumb-color":[{"scrollbar-thumb":I()}],"scrollbar-track-color":[{"scrollbar-track":I()}],"scrollbar-gutter":[{"scrollbar-gutter":[`auto`,`stable`,`both`]}],"scrollbar-w":[{scrollbar:[`auto`,`thin`,`none`]}],"scroll-m":[{"scroll-m":w()}],"scroll-mx":[{"scroll-mx":w()}],"scroll-my":[{"scroll-my":w()}],"scroll-ms":[{"scroll-ms":w()}],"scroll-me":[{"scroll-me":w()}],"scroll-mbs":[{"scroll-mbs":w()}],"scroll-mbe":[{"scroll-mbe":w()}],"scroll-mt":[{"scroll-mt":w()}],"scroll-mr":[{"scroll-mr":w()}],"scroll-mb":[{"scroll-mb":w()}],"scroll-ml":[{"scroll-ml":w()}],"scroll-p":[{"scroll-p":w()}],"scroll-px":[{"scroll-px":w()}],"scroll-py":[{"scroll-py":w()}],"scroll-ps":[{"scroll-ps":w()}],"scroll-pe":[{"scroll-pe":w()}],"scroll-pbs":[{"scroll-pbs":w()}],"scroll-pbe":[{"scroll-pbe":w()}],"scroll-pt":[{"scroll-pt":w()}],"scroll-pr":[{"scroll-pr":w()}],"scroll-pb":[{"scroll-pb":w()}],"scroll-pl":[{"scroll-pl":w()}],"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`,Ti,_i]}],fill:[{fill:[`none`,...I()]}],"stroke-w":[{stroke:[ai,Ei,vi,yi]}],stroke:[{stroke:[`none`,...I()]}],"forced-color-adjust":[{"forced-color-adjust":[`auto`,`none`]}]},conflictingClassGroups:{"container-named":[`container-type`],overflow:[`overflow-x`,`overflow-y`],overscroll:[`overscroll-x`,`overscroll-y`],inset:[`inset-x`,`inset-y`,`inset-bs`,`inset-be`,`start`,`end`,`top`,`right`,`bottom`,`left`],"inset-x":[`start`,`end`,`right`,`left`],"inset-y":[`inset-bs`,`inset-be`,`top`,`bottom`],flex:[`basis`,`grow`,`shrink`],gap:[`gap-x`,`gap-y`],p:[`px`,`py`,`ps`,`pe`,`pbs`,`pbe`,`pt`,`pr`,`pb`,`pl`],px:[`ps`,`pe`,`pr`,`pl`],py:[`pbs`,`pbe`,`pt`,`pb`],m:[`mx`,`my`,`ms`,`me`,`mbs`,`mbe`,`mt`,`mr`,`mb`,`ml`],mx:[`ms`,`me`,`mr`,`ml`],my:[`mbs`,`mbe`,`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-x`,`border-w-y`,`border-w-s`,`border-w-e`,`border-w-bs`,`border-w-be`,`border-w-t`,`border-w-r`,`border-w-b`,`border-w-l`],"border-w-x":[`border-w-s`,`border-w-e`,`border-w-r`,`border-w-l`],"border-w-y":[`border-w-bs`,`border-w-be`,`border-w-t`,`border-w-b`],"border-color":[`border-color-x`,`border-color-y`,`border-color-s`,`border-color-e`,`border-color-bs`,`border-color-be`,`border-color-t`,`border-color-r`,`border-color-b`,`border-color-l`],"border-color-x":[`border-color-s`,`border-color-e`,`border-color-r`,`border-color-l`],"border-color-y":[`border-color-bs`,`border-color-be`,`border-color-t`,`border-color-b`],translate:[`translate-x`,`translate-y`,`translate-none`],"translate-none":[`translate`,`translate-x`,`translate-y`,`translate-z`],"scroll-m":[`scroll-mx`,`scroll-my`,`scroll-ms`,`scroll-me`,`scroll-mbs`,`scroll-mbe`,`scroll-mt`,`scroll-mr`,`scroll-mb`,`scroll-ml`],"scroll-mx":[`scroll-ms`,`scroll-me`,`scroll-mr`,`scroll-ml`],"scroll-my":[`scroll-mbs`,`scroll-mbe`,`scroll-mt`,`scroll-mb`],"scroll-p":[`scroll-px`,`scroll-py`,`scroll-ps`,`scroll-pe`,`scroll-pbs`,`scroll-pbe`,`scroll-pt`,`scroll-pr`,`scroll-pb`,`scroll-pl`],"scroll-px":[`scroll-ps`,`scroll-pe`,`scroll-pr`,`scroll-pl`],"scroll-py":[`scroll-pbs`,`scroll-pbe`,`scroll-pt`,`scroll-pb`],touch:[`touch-x`,`touch-y`,`touch-pz`],"touch-x":[`touch`],"touch-y":[`touch`],"touch-pz":[`touch`]},conflictingClassGroupModifiers:{"font-size":[`leading`]},postfixLookupClassGroups:[`container-type`],orderSensitiveModifiers:[`*`,`**`,`after`,`backdrop`,`before`,`details-content`,`file`,`first-letter`,`first-line`,`marker`,`placeholder`,`selection`]}});function U(...e){return Ui(Ht(e))}function Wi(e){return e===null?`–`:`${Math.round(e*100)}%`}function Gi(e,t=``){return typeof e==`string`&&e.trim().length>0?e.trim():t}var Ki=Pt,qi=_.forwardRef(({className:e,...t},n)=>(0,I.jsx)(Ft,{ref:n,className:U(`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}));qi.displayName=Ft.displayName;var Ji=Gt(`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-(--radix-toast-swipe-end-x) data-[swipe=move]:translate-x-(--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 sm:data-[state=open]: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`}}),Yi=_.forwardRef(({className:e,variant:t,...n},r)=>(0,I.jsx)(It,{ref:r,className:U(Ji({variant:t}),e),...n}));Yi.displayName=It.displayName;var Xi=_.forwardRef(({className:e,...t},n)=>(0,I.jsx)(zt,{ref:n,className:U(`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 hover:group-[.destructive]:border-destructive/30 hover:group-[.destructive]:bg-destructive hover:group-[.destructive]:text-destructive-foreground focus:outline-hidden focus:ring-2 focus:ring-ring focus:ring-offset-2 focus:group-[.destructive]:ring-destructive disabled:pointer-events-none disabled:opacity-50`,e),...t}));Xi.displayName=zt.displayName;var Zi=_.forwardRef(({className:e,...t},n)=>(0,I.jsx)(Bt,{ref:n,className:U(`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 hover:group-[.destructive]:text-red-50 focus:opacity-100 focus:outline-hidden focus:ring-2 focus:group-[.destructive]:ring-red-400 focus:group-[.destructive]:ring-offset-red-600`,e),"toast-close":``,...t,children:(0,I.jsx)(hr,{className:`h-4 w-4`})}));Zi.displayName=Bt.displayName;var Qi=_.forwardRef(({className:e,...t},n)=>(0,I.jsx)(Lt,{ref:n,className:U(`text-sm font-semibold`,e),...t}));Qi.displayName=Lt.displayName;var $i=_.forwardRef(({className:e,...t},n)=>(0,I.jsx)(Rt,{ref:n,className:U(`text-sm opacity-90`,e),...t}));$i.displayName=Rt.displayName;function ea(){let{toasts:e}=k();return(0,I.jsxs)(Ki,{children:[e.map(function({id:e,title:t,description:n,action:r,...i}){return(0,I.jsxs)(Yi,{...i,children:[(0,I.jsxs)(`div`,{className:`grid gap-1`,children:[t&&(0,I.jsx)(Qi,{children:t}),n&&(0,I.jsx)($i,{children:n})]}),r,(0,I.jsx)(Zi,{})]},e)}),(0,I.jsx)(qi,{})]})}var ta=[`light`,`dark`],na=`(prefers-color-scheme: dark)`,ra=_.createContext(void 0),ia={setTheme:e=>{},themes:[]},aa=()=>_.useContext(ra)??ia;_.memo(({forcedTheme:e,storageKey:t,attribute:n,enableSystem:r,enableColorScheme:i,defaultTheme:a,value:o,attrs:s,nonce:c})=>{let l=a===`system`,u=n===`class`?`var d=document.documentElement,c=d.classList;${`c.remove(${s.map(e=>`'${e}'`).join(`,`)})`};`:`var d=document.documentElement,n='${n}',s='setAttribute';`,d=i?ta.includes(a)&&a?`if(e==='light'||e==='dark'||!e)d.style.colorScheme=e||'${a}'`:`if(e==='light'||e==='dark')d.style.colorScheme=e`:``,f=(e,t=!1,r=!0)=>{let a=o?o[e]:e,s=t?e+`|| ''`:`'${a}'`,c=``;return i&&r&&!t&&ta.includes(e)&&(c+=`d.style.colorScheme = '${e}';`),n===`class`?c+=t||a?`c.add(${s})`:`null`:a&&(c+=`d[s](n,${s})`),c},p=e?`!function(){${u}${f(e)}}()`:r?`!function(){try{${u}var e=localStorage.getItem('${t}');if('system'===e||(!e&&${l})){var t='${na}',m=window.matchMedia(t);if(m.media!==t||m.matches){${f(`dark`)}}else{${f(`light`)}}}else if(e){${o?`var x=${JSON.stringify(o)};`:``}${f(o?`x[e]`:`e`,!0)}}${l?``:`else{`+f(a,!1,!1)+`}`}${d}}catch(e){}}()`:`!function(){try{${u}var e=localStorage.getItem('${t}');if(e){${o?`var x=${JSON.stringify(o)};`:``}${f(o?`x[e]`:`e`,!0)}}else{${f(a,!1,!1)};}${d}}catch(t){}}();`;return _.createElement(`script`,{nonce:c,dangerouslySetInnerHTML:{__html:p}})});var oa=e=>{switch(e){case`success`:return la;case`info`:return da;case`warning`:return ua;case`error`:return fa;default:return null}},sa=Array(12).fill(0),ca=({visible:e,className:t})=>_.createElement(`div`,{className:[`sonner-loading-wrapper`,t].filter(Boolean).join(` `),"data-visible":e},_.createElement(`div`,{className:`sonner-spinner`},sa.map((e,t)=>_.createElement(`div`,{className:`sonner-loading-bar`,key:`spinner-bar-${t}`})))),la=_.createElement(`svg`,{xmlns:`http://www.w3.org/2000/svg`,viewBox:`0 0 20 20`,fill:`currentColor`,height:`20`,width:`20`},_.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`})),ua=_.createElement(`svg`,{xmlns:`http://www.w3.org/2000/svg`,viewBox:`0 0 24 24`,fill:`currentColor`,height:`20`,width:`20`},_.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`})),da=_.createElement(`svg`,{xmlns:`http://www.w3.org/2000/svg`,viewBox:`0 0 20 20`,fill:`currentColor`,height:`20`,width:`20`},_.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`})),fa=_.createElement(`svg`,{xmlns:`http://www.w3.org/2000/svg`,viewBox:`0 0 20 20`,fill:`currentColor`,height:`20`,width:`20`},_.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`})),pa=_.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`},_.createElement(`line`,{x1:`18`,y1:`6`,x2:`6`,y2:`18`}),_.createElement(`line`,{x1:`6`,y1:`6`,x2:`18`,y2:`18`})),ma=()=>{let[e,t]=_.useState(document.hidden);return _.useEffect(()=>{let e=()=>{t(document.hidden)};return document.addEventListener(`visibilitychange`,e),()=>window.removeEventListener(`visibilitychange`,e)},[]),e},ha=1,ga=new 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=>{let{message:t,...n}=e,r=typeof e?.id==`number`||e.id?.length>0?e.id:ha++,i=this.toasts.find(e=>e.id===r),a=e.dismissible===void 0||e.dismissible;return this.dismissedToasts.has(r)&&this.dismissedToasts.delete(r),i?this.toasts=this.toasts.map(n=>n.id===r?(this.publish({...n,...e,id:r,title:t}),{...n,...e,id:r,dismissible:a,title:t}):n):this.addToast({title:t,...n,dismissible:a,id:r}),r},this.dismiss=e=>(this.dismissedToasts.add(e),e||this.toasts.forEach(e=>{this.subscribers.forEach(t=>t({id:e.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`?void 0:t.description}));let r=e instanceof Promise?e:e(),i=n!==void 0,a,o=r.then(async e=>{if(a=[`resolve`,e],_.isValidElement(e))i=!1,this.create({id:n,type:`default`,message:e});else if(va(e)&&!e.ok){i=!1;let r=typeof t.error==`function`?await t.error(`HTTP error! status: ${e.status}`):t.error,a=typeof t.description==`function`?await t.description(`HTTP error! status: ${e.status}`):t.description;this.create({id:n,type:`error`,message:r,description:a})}else if(t.success!==void 0){i=!1;let r=typeof t.success==`function`?await t.success(e):t.success,a=typeof t.description==`function`?await t.description(e):t.description;this.create({id:n,type:`success`,message:r,description:a})}}).catch(async e=>{if(a=[`reject`,e],t.error!==void 0){i=!1;let r=typeof t.error==`function`?await t.error(e):t.error,a=typeof t.description==`function`?await t.description(e):t.description;this.create({id:n,type:`error`,message:r,description:a})}}).finally(()=>{var e;i&&(this.dismiss(n),n=void 0),(e=t.finally)==null||e.call(t)}),s=()=>new Promise((e,t)=>o.then(()=>a[0]===`reject`?t(a[1]):e(a[1])).catch(t));return typeof n!=`string`&&typeof n!=`number`?{unwrap:s}:Object.assign(n,{unwrap:s})},this.custom=(e,t)=>{let n=t?.id||ha++;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}},_a=(e,t)=>{let n=t?.id||ha++;return ga.addToast({title:e,...t,id:n}),n},va=e=>e&&typeof e==`object`&&`ok`in e&&typeof e.ok==`boolean`&&`status`in e&&typeof e.status==`number`;Object.assign(_a,{success:ga.success,info:ga.info,warning:ga.warning,error:ga.error,custom:ga.custom,message:ga.message,promise:ga.promise,dismiss:ga.dismiss,loading:ga.loading},{getHistory:()=>ga.toasts,getToasts:()=>ga.getActiveToasts()});function ya(e,{insertAt:t}={}){if(!e||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))}ya(`: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 ba(e){return e.label!==void 0}var xa=3,Sa=`32px`,Ca=`16px`,wa=4e3,Ta=356,Ea=14,Da=20,Oa=200;function ka(...e){return e.filter(Boolean).join(` `)}function Aa(e){let[t,n]=e.split(`-`),r=[];return t&&r.push(t),n&&r.push(n),r}var ja=e=>{let{invert:t,toast:n,unstyled:r,interacting:i,setHeights:a,visibleToasts:o,heights:s,index:c,toasts:l,expanded:u,removeToast:d,defaultRichColors:f,closeButton:p,style:m,cancelButtonStyle:h,actionButtonStyle:g,className:v=``,descriptionClassName:y=``,duration:b,position:x,gap:S,loadingIcon:C,expandByDefault:w,classNames:T,icons:E,closeButtonAriaLabel:D=`Close toast`,pauseWhenPageIsHidden:O}=e,[k,A]=_.useState(null),[j,M]=_.useState(null),[N,P]=_.useState(!1),[F,I]=_.useState(!1),[L,R]=_.useState(!1),[z,ee]=_.useState(!1),[te,ne]=_.useState(!1),[re,ie]=_.useState(0),[ae,oe]=_.useState(0),se=_.useRef(n.duration||b||wa),ce=_.useRef(null),B=_.useRef(null),le=c===0,ue=c+1<=o,de=n.type,V=n.dismissible!==!1,fe=n.className||``,pe=n.descriptionClassName||``,me=_.useMemo(()=>s.findIndex(e=>e.toastId===n.id)||0,[s,n.id]),he=_.useMemo(()=>n.closeButton??p,[n.closeButton,p]),ge=_.useMemo(()=>n.duration||b||wa,[n.duration,b]),_e=_.useRef(0),ve=_.useRef(0),ye=_.useRef(0),be=_.useRef(null),[xe,Se]=x.split(`-`),Ce=_.useMemo(()=>s.reduce((e,t,n)=>n>=me?e:e+t.height,0),[s,me]),we=ma(),Te=n.invert||t,Ee=de===`loading`;ve.current=_.useMemo(()=>me*S+Ce,[me,Ce]),_.useEffect(()=>{se.current=ge},[ge]),_.useEffect(()=>{P(!0)},[]),_.useEffect(()=>{let e=B.current;if(e){let t=e.getBoundingClientRect().height;return oe(t),a(e=>[{toastId:n.id,height:t,position:n.position},...e]),()=>a(e=>e.filter(e=>e.toastId!==n.id))}},[a,n.id]),_.useLayoutEffect(()=>{if(!N)return;let e=B.current,t=e.style.height;e.style.height=`auto`;let r=e.getBoundingClientRect().height;e.style.height=t,oe(r),a(e=>e.find(e=>e.toastId===n.id)?e.map(e=>e.toastId===n.id?{...e,height:r}:e):[{toastId:n.id,height:r,position:n.position},...e])},[N,n.title,n.description,a,n.id]);let De=_.useCallback(()=>{I(!0),ie(ve.current),a(e=>e.filter(e=>e.toastId!==n.id)),setTimeout(()=>{d(n)},Oa)},[n,d,a,ve]);_.useEffect(()=>{if(n.promise&&de===`loading`||n.duration===1/0||n.type===`loading`)return;let e;return u||i||O&&we?(()=>{if(ye.current<_e.current){let e=new Date().getTime()-_e.current;se.current-=e}ye.current=new Date().getTime()})():se.current!==1/0&&(_e.current=new Date().getTime(),e=setTimeout(()=>{var e;(e=n.onAutoClose)==null||e.call(n,n),De()},se.current)),()=>clearTimeout(e)},[u,i,n,de,O,we,De]),_.useEffect(()=>{n.delete&&De()},[De,n.delete]);function Oe(){return E!=null&&E.loading?_.createElement(`div`,{className:ka(T?.loader,n?.classNames?.loader,`sonner-loader`),"data-visible":de===`loading`},E.loading):C?_.createElement(`div`,{className:ka(T?.loader,n?.classNames?.loader,`sonner-loader`),"data-visible":de===`loading`},C):_.createElement(ca,{className:ka(T?.loader,n?.classNames?.loader),visible:de===`loading`})}return _.createElement(`li`,{tabIndex:0,ref:B,className:ka(v,fe,T?.toast,n?.classNames?.toast,T?.default,T?.[de],n?.classNames?.[de]),"data-sonner-toast":``,"data-rich-colors":n.richColors??f,"data-styled":!(n.jsx||n.unstyled||r),"data-mounted":N,"data-promise":!!n.promise,"data-swiped":te,"data-removed":F,"data-visible":ue,"data-y-position":xe,"data-x-position":Se,"data-index":c,"data-front":le,"data-swiping":L,"data-dismissible":V,"data-type":de,"data-invert":Te,"data-swipe-out":z,"data-swipe-direction":j,"data-expanded":!!(u||w&&N),style:{"--index":c,"--toasts-before":c,"--z-index":l.length-c,"--offset":`${F?re:ve.current}px`,"--initial-height":w?`auto`:`${ae}px`,...m,...n.style},onDragEnd:()=>{R(!1),A(null),be.current=null},onPointerDown:e=>{Ee||!V||(ce.current=new Date,ie(ve.current),e.target.setPointerCapture(e.pointerId),e.target.tagName!==`BUTTON`&&(R(!0),be.current={x:e.clientX,y:e.clientY}))},onPointerUp:()=>{var e;if(z||!V)return;be.current=null;let t=Number(B.current?.style.getPropertyValue(`--swipe-amount-x`).replace(`px`,``)||0),r=Number(B.current?.style.getPropertyValue(`--swipe-amount-y`).replace(`px`,``)||0),i=new Date().getTime()-ce.current?.getTime(),a=k===`x`?t:r,o=Math.abs(a)/i;Math.abs(a)>=Da||o>.11?(ie(ve.current),(e=n.onDismiss)==null||e.call(n,n),M(k===`x`?t>0?`right`:`left`:r>0?`down`:`up`),De(),ee(!0),ne(!1)):(R(!1),A(null))},onPointerMove:t=>{var n,r;if(!be.current||!V||window.getSelection()?.toString().length>0)return;let i=t.clientY-be.current.y,a=t.clientX-be.current.x,o=e.swipeDirections??Aa(x);!k&&(Math.abs(a)>1||Math.abs(i)>1)&&A(Math.abs(a)>Math.abs(i)?`x`:`y`);let s={x:0,y:0};k===`y`?(o.includes(`top`)||o.includes(`bottom`))&&(o.includes(`top`)&&i<0||o.includes(`bottom`)&&i>0)&&(s.y=i):k===`x`&&(o.includes(`left`)||o.includes(`right`))&&(o.includes(`left`)&&a<0||o.includes(`right`)&&a>0)&&(s.x=a),(Math.abs(s.x)>0||Math.abs(s.y)>0)&&ne(!0),(n=B.current)==null||n.style.setProperty(`--swipe-amount-x`,`${s.x}px`),(r=B.current)==null||r.style.setProperty(`--swipe-amount-y`,`${s.y}px`)}},he&&!n.jsx?_.createElement(`button`,{"aria-label":D,"data-disabled":Ee,"data-close-button":!0,onClick:Ee||!V?()=>{}:()=>{var e;De(),(e=n.onDismiss)==null||e.call(n,n)},className:ka(T?.closeButton,n?.classNames?.closeButton)},E?.close??pa):null,n.jsx||(0,_.isValidElement)(n.title)?n.jsx?n.jsx:typeof n.title==`function`?n.title():n.title:_.createElement(_.Fragment,null,de||n.icon||n.promise?_.createElement(`div`,{"data-icon":``,className:ka(T?.icon,n?.classNames?.icon)},n.promise||n.type===`loading`&&!n.icon?n.icon||Oe():null,n.type===`loading`?null:n.icon||E?.[de]||oa(de)):null,_.createElement(`div`,{"data-content":``,className:ka(T?.content,n?.classNames?.content)},_.createElement(`div`,{"data-title":``,className:ka(T?.title,n?.classNames?.title)},typeof n.title==`function`?n.title():n.title),n.description?_.createElement(`div`,{"data-description":``,className:ka(y,pe,T?.description,n?.classNames?.description)},typeof n.description==`function`?n.description():n.description):null),(0,_.isValidElement)(n.cancel)?n.cancel:n.cancel&&ba(n.cancel)?_.createElement(`button`,{"data-button":!0,"data-cancel":!0,style:n.cancelButtonStyle||h,onClick:e=>{var t,r;ba(n.cancel)&&V&&((r=(t=n.cancel).onClick)==null||r.call(t,e),De())},className:ka(T?.cancelButton,n?.classNames?.cancelButton)},n.cancel.label):null,(0,_.isValidElement)(n.action)?n.action:n.action&&ba(n.action)?_.createElement(`button`,{"data-button":!0,"data-action":!0,style:n.actionButtonStyle||g,onClick:e=>{var t,r;ba(n.action)&&((r=(t=n.action).onClick)==null||r.call(t,e),!e.defaultPrevented&&De())},className:ka(T?.actionButton,n?.classNames?.actionButton)},n.action.label):null))};function Ma(){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 Na(e,t){let n={};return[e,t].forEach((e,t)=>{let r=t===1,i=r?`--mobile-offset`:`--offset`,a=r?Ca:Sa;function o(e){[`top`,`right`,`bottom`,`left`].forEach(t=>{n[`${i}-${t}`]=typeof e==`number`?`${e}px`:e})}typeof e==`number`||typeof e==`string`?o(e):typeof e==`object`?[`top`,`right`,`bottom`,`left`].forEach(t=>{e[t]===void 0?n[`${i}-${t}`]=a:n[`${i}-${t}`]=typeof e[t]==`number`?`${e[t]}px`:e[t]}):o(a)}),n}var Pa=(0,_.forwardRef)(function(e,t){let{invert:n,position:r=`bottom-right`,hotkey:i=[`altKey`,`KeyT`],expand:a,closeButton:o,className:s,offset:c,mobileOffset:l,theme:u=`light`,richColors:d,duration:f,style:p,visibleToasts:m=xa,toastOptions:h,dir:g=Ma(),gap:v=Ea,loadingIcon:y,icons:b,containerAriaLabel:x=`Notifications`,pauseWhenPageIsHidden:S}=e,[C,w]=_.useState([]),T=_.useMemo(()=>Array.from(new Set([r].concat(C.filter(e=>e.position).map(e=>e.position)))),[C,r]),[E,D]=_.useState([]),[O,k]=_.useState(!1),[j,M]=_.useState(!1),[N,P]=_.useState(u===`system`?typeof window<`u`&&window.matchMedia&&window.matchMedia(`(prefers-color-scheme: dark)`).matches?`dark`:`light`:u),F=_.useRef(null),I=i.join(`+`).replace(/Key/g,``).replace(/Digit/g,``),L=_.useRef(null),R=_.useRef(!1),z=_.useCallback(e=>{w(t=>{var n;return(n=t.find(t=>t.id===e.id))!=null&&n.delete||ga.dismiss(e.id),t.filter(({id:t})=>t!==e.id)})},[]);return _.useEffect(()=>ga.subscribe(e=>{e.dismiss?w(t=>t.map(t=>t.id===e.id?{...t,delete:!0}:t)):setTimeout(()=>{A.flushSync(()=>{w(t=>{let n=t.findIndex(t=>t.id===e.id);return n===-1?[e,...t]:[...t.slice(0,n),{...t[n],...e},...t.slice(n+1)]})})})}),[]),_.useEffect(()=>{if(u!==`system`){P(u);return}if(u===`system`&&(window.matchMedia&&window.matchMedia(`(prefers-color-scheme: dark)`).matches?P(`dark`):P(`light`)),typeof window>`u`)return;let e=window.matchMedia(`(prefers-color-scheme: dark)`);try{e.addEventListener(`change`,({matches:e})=>{P(e?`dark`:`light`)})}catch{e.addListener(({matches:e})=>{try{P(e?`dark`:`light`)}catch(e){console.error(e)}})}},[u]),_.useEffect(()=>{C.length<=1&&k(!1)},[C]),_.useEffect(()=>{let e=e=>{var t,n;i.every(t=>e[t]||e.code===t)&&(k(!0),(t=F.current)==null||t.focus()),e.code===`Escape`&&(document.activeElement===F.current||(n=F.current)!=null&&n.contains(document.activeElement))&&k(!1)};return document.addEventListener(`keydown`,e),()=>document.removeEventListener(`keydown`,e)},[i]),_.useEffect(()=>{if(F.current)return()=>{L.current&&(L.current.focus({preventScroll:!0}),L.current=null,R.current=!1)}},[F.current]),_.createElement(`section`,{ref:t,"aria-label":`${x} ${I}`,tabIndex:-1,"aria-live":`polite`,"aria-relevant":`additions text`,"aria-atomic":`false`,suppressHydrationWarning:!0},T.map((t,r)=>{let[i,u]=t.split(`-`);return C.length?_.createElement(`ol`,{key:t,dir:g===`auto`?Ma():g,tabIndex:-1,ref:F,className:s,"data-sonner-toaster":!0,"data-theme":N,"data-y-position":i,"data-lifted":O&&C.length>1&&!a,"data-x-position":u,style:{"--front-toast-height":`${E[0]?.height||0}px`,"--width":`${Ta}px`,"--gap":`${v}px`,...p,...Na(c,l)},onBlur:e=>{R.current&&!e.currentTarget.contains(e.relatedTarget)&&(R.current=!1,L.current&&=(L.current.focus({preventScroll:!0}),null))},onFocus:e=>{e.target instanceof HTMLElement&&e.target.dataset.dismissible===`false`||R.current||(R.current=!0,L.current=e.relatedTarget)},onMouseEnter:()=>k(!0),onMouseMove:()=>k(!0),onMouseLeave:()=>{j||k(!1)},onDragEnd:()=>k(!1),onPointerDown:e=>{e.target instanceof HTMLElement&&e.target.dataset.dismissible===`false`||M(!0)},onPointerUp:()=>M(!1)},C.filter(e=>!e.position&&r===0||e.position===t).map((r,i)=>_.createElement(ja,{key:r.id,icons:b,index:i,toast:r,defaultRichColors:d,duration:h?.duration??f,className:h?.className,descriptionClassName:h?.descriptionClassName,invert:n,visibleToasts:m,closeButton:h?.closeButton??o,interacting:j,position:t,style:h?.style,unstyled:h?.unstyled,classNames:h?.classNames,cancelButtonStyle:h?.cancelButtonStyle,actionButtonStyle:h?.actionButtonStyle,removeToast:z,toasts:C.filter(e=>e.position==r.position),heights:E.filter(e=>e.position==r.position),setHeights:D,expandByDefault:a,gap:v,loadingIcon:y,expanded:O,pauseWhenPageIsHidden:S,swipeDirections:e.swipeDirections}))):null}))}),Fa=({...e})=>{let{theme:t=`system`}=aa();return(0,I.jsx)(Pa,{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})},Ia=_.useId||(()=>void 0),La=0;function Ra(e){let[t,n]=_.useState(Ia());return Ae(()=>{e||n(e=>e??String(La++))},[e]),e||(t?`radix-${t}`:``)}var za=[`top`,`right`,`bottom`,`left`],Ba=Math.min,Va=Math.max,Ha=Math.round,Ua=Math.floor,Wa=e=>({x:e,y:e}),Ga={left:`right`,right:`left`,bottom:`top`,top:`bottom`},Ka={start:`end`,end:`start`};function qa(e,t,n){return Va(e,Ba(t,n))}function Ja(e,t){return typeof e==`function`?e(t):e}function Ya(e){return e.split(`-`)[0]}function Xa(e){return e.split(`-`)[1]}function Za(e){return e===`x`?`y`:`x`}function Qa(e){return e===`y`?`height`:`width`}var $a=new Set([`top`,`bottom`]);function eo(e){return $a.has(Ya(e))?`y`:`x`}function to(e){return Za(eo(e))}function no(e,t,n){n===void 0&&(n=!1);let r=Xa(e),i=to(e),a=Qa(i),o=i===`x`?r===(n?`end`:`start`)?`right`:`left`:r===`start`?`bottom`:`top`;return t.reference[a]>t.floating[a]&&(o=fo(o)),[o,fo(o)]}function ro(e){let t=fo(e);return[io(e),t,io(t)]}function io(e){return e.replace(/start|end/g,e=>Ka[e])}var ao=[`left`,`right`],oo=[`right`,`left`],so=[`top`,`bottom`],co=[`bottom`,`top`];function lo(e,t,n){switch(e){case`top`:case`bottom`:return n?t?oo:ao:t?ao:oo;case`left`:case`right`:return t?so:co;default:return[]}}function uo(e,t,n,r){let i=Xa(e),a=lo(Ya(e),n===`start`,r);return i&&(a=a.map(e=>e+`-`+i),t&&(a=a.concat(a.map(io)))),a}function fo(e){return e.replace(/left|right|bottom|top/g,e=>Ga[e])}function po(e){return{top:0,right:0,bottom:0,left:0,...e}}function mo(e){return typeof e==`number`?{top:e,right:e,bottom:e,left:e}:po(e)}function ho(e){let{x:t,y:n,width:r,height:i}=e;return{width:r,height:i,top:n,left:t,right:t+r,bottom:n+i,x:t,y:n}}function go(e,t,n){let{reference:r,floating:i}=e,a=eo(t),o=to(t),s=Qa(o),c=Ya(t),l=a===`y`,u=r.x+r.width/2-i.width/2,d=r.y+r.height/2-i.height/2,f=r[s]/2-i[s]/2,p;switch(c){case`top`:p={x:u,y:r.y-i.height};break;case`bottom`:p={x:u,y:r.y+r.height};break;case`right`:p={x:r.x+r.width,y:d};break;case`left`:p={x:r.x-i.width,y:d};break;default:p={x:r.x,y:r.y}}switch(Xa(t)){case`start`:p[o]-=f*(n&&l?-1:1);break;case`end`:p[o]+=f*(n&&l?-1:1)}return p}async function _o(e,t){t===void 0&&(t={});let{x:n,y:r,platform:i,rects:a,elements:o,strategy:s}=e,{boundary:c=`clippingAncestors`,rootBoundary:l=`viewport`,elementContext:u=`floating`,altBoundary:d=!1,padding:f=0}=Ja(t,e),p=mo(f),m=o[d?u===`floating`?`reference`:`floating`:u],h=ho(await i.getClippingRect({element:await(i.isElement==null?void 0:i.isElement(m))??!0?m:m.contextElement||await(i.getDocumentElement==null?void 0:i.getDocumentElement(o.floating)),boundary:c,rootBoundary:l,strategy:s})),g=u===`floating`?{x:n,y:r,width:a.floating.width,height:a.floating.height}:a.reference,_=await(i.getOffsetParent==null?void 0:i.getOffsetParent(o.floating)),v=await(i.isElement==null?void 0:i.isElement(_))&&await(i.getScale==null?void 0:i.getScale(_))||{x:1,y:1},y=ho(i.convertOffsetParentRelativeRectToViewportRelativeRect?await i.convertOffsetParentRelativeRectToViewportRelativeRect({elements:o,rect:g,offsetParent:_,strategy:s}):g);return{top:(h.top-y.top+p.top)/v.y,bottom:(y.bottom-h.bottom+p.bottom)/v.y,left:(h.left-y.left+p.left)/v.x,right:(y.right-h.right+p.right)/v.x}}var vo=async(e,t,n)=>{let{placement:r=`bottom`,strategy:i=`absolute`,middleware:a=[],platform:o}=n,s=a.filter(Boolean),c=await(o.isRTL==null?void 0:o.isRTL(t)),l=await o.getElementRects({reference:e,floating:t,strategy:i}),{x:u,y:d}=go(l,r,c),f=r,p={},m=0;for(let n=0;n<s.length;n++){let{name:a,fn:h}=s[n],{x:g,y:_,data:v,reset:y}=await h({x:u,y:d,initialPlacement:r,placement:f,strategy:i,middlewareData:p,rects:l,platform:{...o,detectOverflow:o.detectOverflow??_o},elements:{reference:e,floating:t}});u=g??u,d=_??d,p={...p,[a]:{...p[a],...v}},y&&m<=50&&(m++,typeof y==`object`&&(y.placement&&(f=y.placement),y.rects&&(l=y.rects===!0?await o.getElementRects({reference:e,floating:t,strategy:i}):y.rects),{x:u,y:d}=go(l,f,c)),n=-1)}return{x:u,y:d,placement:f,strategy:i,middlewareData:p}},yo=e=>({name:`arrow`,options:e,async fn(t){let{x:n,y:r,placement:i,rects:a,platform:o,elements:s,middlewareData:c}=t,{element:l,padding:u=0}=Ja(e,t)||{};if(l==null)return{};let d=mo(u),f={x:n,y:r},p=to(i),m=Qa(p),h=await o.getDimensions(l),g=p===`y`,_=g?`top`:`left`,v=g?`bottom`:`right`,y=g?`clientHeight`:`clientWidth`,b=a.reference[m]+a.reference[p]-f[p]-a.floating[m],x=f[p]-a.reference[p],S=await(o.getOffsetParent==null?void 0:o.getOffsetParent(l)),C=S?S[y]:0;(!C||!await(o.isElement==null?void 0:o.isElement(S)))&&(C=s.floating[y]||a.floating[m]);let w=b/2-x/2,T=C/2-h[m]/2-1,E=Ba(d[_],T),D=Ba(d[v],T),O=E,k=C-h[m]-D,A=C/2-h[m]/2+w,j=qa(O,A,k),M=!c.arrow&&Xa(i)!=null&&A!==j&&a.reference[m]/2-(A<O?E:D)-h[m]/2<0,N=M?A<O?A-O:A-k:0;return{[p]:f[p]+N,data:{[p]:j,centerOffset:A-j-N,...M&&{alignmentOffset:N}},reset:M}}}),bo=function(e){return e===void 0&&(e={}),{name:`flip`,options:e,async fn(t){var n;let{placement:r,middlewareData:i,rects:a,initialPlacement:o,platform:s,elements:c}=t,{mainAxis:l=!0,crossAxis:u=!0,fallbackPlacements:d,fallbackStrategy:f=`bestFit`,fallbackAxisSideDirection:p=`none`,flipAlignment:m=!0,...h}=Ja(e,t);if((n=i.arrow)!=null&&n.alignmentOffset)return{};let g=Ya(r),_=eo(o),v=Ya(o)===o,y=await(s.isRTL==null?void 0:s.isRTL(c.floating)),b=d||(v||!m?[fo(o)]:ro(o)),x=p!==`none`;!d&&x&&b.push(...uo(o,m,p,y));let S=[o,...b],C=await s.detectOverflow(t,h),w=[],T=i.flip?.overflows||[];if(l&&w.push(C[g]),u){let e=no(r,a,y);w.push(C[e[0]],C[e[1]])}if(T=[...T,{placement:r,overflows:w}],!w.every(e=>e<=0)){let e=(i.flip?.index||0)+1,t=S[e];if(t&&(u!==`alignment`||_===eo(t)||T.every(e=>eo(e.placement)!==_||e.overflows[0]>0)))return{data:{index:e,overflows:T},reset:{placement:t}};let n=T.filter(e=>e.overflows[0]<=0).sort((e,t)=>e.overflows[1]-t.overflows[1])[0]?.placement;if(!n)switch(f){case`bestFit`:{let e=T.filter(e=>{if(x){let t=eo(e.placement);return t===_||t===`y`}return!0}).map(e=>[e.placement,e.overflows.filter(e=>e>0).reduce((e,t)=>e+t,0)]).sort((e,t)=>e[1]-t[1])[0]?.[0];e&&(n=e);break}case`initialPlacement`:n=o}if(r!==n)return{reset:{placement:n}}}return{}}}};function xo(e,t){return{top:e.top-t.height,right:e.right-t.width,bottom:e.bottom-t.height,left:e.left-t.width}}function So(e){return za.some(t=>e[t]>=0)}var Co=function(e){return e===void 0&&(e={}),{name:`hide`,options:e,async fn(t){let{rects:n,platform:r}=t,{strategy:i=`referenceHidden`,...a}=Ja(e,t);switch(i){case`referenceHidden`:{let e=xo(await r.detectOverflow(t,{...a,elementContext:`reference`}),n.reference);return{data:{referenceHiddenOffsets:e,referenceHidden:So(e)}}}case`escaped`:{let e=xo(await r.detectOverflow(t,{...a,altBoundary:!0}),n.floating);return{data:{escapedOffsets:e,escaped:So(e)}}}default:return{}}}}},wo=new Set([`left`,`top`]);async function To(e,t){let{placement:n,platform:r,elements:i}=e,a=await(r.isRTL==null?void 0:r.isRTL(i.floating)),o=Ya(n),s=Xa(n),c=eo(n)===`y`,l=wo.has(o)?-1:1,u=a&&c?-1:1,d=Ja(t,e),{mainAxis:f,crossAxis:p,alignmentAxis:m}=typeof d==`number`?{mainAxis:d,crossAxis:0,alignmentAxis:null}:{mainAxis:d.mainAxis||0,crossAxis:d.crossAxis||0,alignmentAxis:d.alignmentAxis};return s&&typeof m==`number`&&(p=s===`end`?m*-1:m),c?{x:p*u,y:f*l}:{x:f*l,y:p*u}}var Eo=function(e){return e===void 0&&(e=0),{name:`offset`,options:e,async fn(t){var n;let{x:r,y:i,placement:a,middlewareData:o}=t,s=await To(t,e);return a===o.offset?.placement&&(n=o.arrow)!=null&&n.alignmentOffset?{}:{x:r+s.x,y:i+s.y,data:{...s,placement:a}}}}},Do=function(e){return e===void 0&&(e={}),{name:`shift`,options:e,async fn(t){let{x:n,y:r,placement:i,platform:a}=t,{mainAxis:o=!0,crossAxis:s=!1,limiter:c={fn:e=>{let{x:t,y:n}=e;return{x:t,y:n}}},...l}=Ja(e,t),u={x:n,y:r},d=await a.detectOverflow(t,l),f=eo(Ya(i)),p=Za(f),m=u[p],h=u[f];if(o){let e=p===`y`?`top`:`left`,t=p===`y`?`bottom`:`right`,n=m+d[e],r=m-d[t];m=qa(n,m,r)}if(s){let e=f===`y`?`top`:`left`,t=f===`y`?`bottom`:`right`,n=h+d[e],r=h-d[t];h=qa(n,h,r)}let g=c.fn({...t,[p]:m,[f]:h});return{...g,data:{x:g.x-n,y:g.y-r,enabled:{[p]:o,[f]:s}}}}}},Oo=function(e){return e===void 0&&(e={}),{options:e,fn(t){let{x:n,y:r,placement:i,rects:a,middlewareData:o}=t,{offset:s=0,mainAxis:c=!0,crossAxis:l=!0}=Ja(e,t),u={x:n,y:r},d=eo(i),f=Za(d),p=u[f],m=u[d],h=Ja(s,t),g=typeof h==`number`?{mainAxis:h,crossAxis:0}:{mainAxis:0,crossAxis:0,...h};if(c){let e=f===`y`?`height`:`width`,t=a.reference[f]-a.floating[e]+g.mainAxis,n=a.reference[f]+a.reference[e]-g.mainAxis;p<t?p=t:p>n&&(p=n)}if(l){let e=f===`y`?`width`:`height`,t=wo.has(Ya(i)),n=a.reference[d]-a.floating[e]+(t&&o.offset?.[d]||0)+(t?0:g.crossAxis),r=a.reference[d]+a.reference[e]+(t?0:o.offset?.[d]||0)-(t?g.crossAxis:0);m<n?m=n:m>r&&(m=r)}return{[f]:p,[d]:m}}}},ko=function(e){return e===void 0&&(e={}),{name:`size`,options:e,async fn(t){var n,r;let{placement:i,rects:a,platform:o,elements:s}=t,{apply:c=()=>{},...l}=Ja(e,t),u=await o.detectOverflow(t,l),d=Ya(i),f=Xa(i),p=eo(i)===`y`,{width:m,height:h}=a.floating,g,_;d===`top`||d===`bottom`?(g=d,_=f===(await(o.isRTL==null?void 0:o.isRTL(s.floating))?`start`:`end`)?`left`:`right`):(_=d,g=f===`end`?`top`:`bottom`);let v=h-u.top-u.bottom,y=m-u.left-u.right,b=Ba(h-u[g],v),x=Ba(m-u[_],y),S=!t.middlewareData.shift,C=b,w=x;if((n=t.middlewareData.shift)!=null&&n.enabled.x&&(w=y),(r=t.middlewareData.shift)!=null&&r.enabled.y&&(C=v),S&&!f){let e=Va(u.left,0),t=Va(u.right,0),n=Va(u.top,0),r=Va(u.bottom,0);p?w=m-2*(e!==0||t!==0?e+t:Va(u.left,u.right)):C=h-2*(n!==0||r!==0?n+r:Va(u.top,u.bottom))}await c({...t,availableWidth:w,availableHeight:C});let T=await o.getDimensions(s.floating);return m!==T.width||h!==T.height?{reset:{rects:!0}}:{}}}};function Ao(){return typeof window<`u`}function jo(e){return Po(e)?(e.nodeName||``).toLowerCase():`#document`}function Mo(e){var t;return(e==null||(t=e.ownerDocument)==null?void 0:t.defaultView)||window}function No(e){return((Po(e)?e.ownerDocument:e.document)||window.document)?.documentElement}function Po(e){return Ao()?e instanceof Node||e instanceof Mo(e).Node:!1}function Fo(e){return Ao()?e instanceof Element||e instanceof Mo(e).Element:!1}function Io(e){return Ao()?e instanceof HTMLElement||e instanceof Mo(e).HTMLElement:!1}function Lo(e){return!Ao()||typeof ShadowRoot>`u`?!1:e instanceof ShadowRoot||e instanceof Mo(e).ShadowRoot}var Ro=new Set([`inline`,`contents`]);function zo(e){let{overflow:t,overflowX:n,overflowY:r,display:i}=Qo(e);return/auto|scroll|overlay|hidden|clip/.test(t+r+n)&&!Ro.has(i)}var Bo=new Set([`table`,`td`,`th`]);function Vo(e){return Bo.has(jo(e))}var Ho=[`:popover-open`,`:modal`];function Uo(e){return Ho.some(t=>{try{return e.matches(t)}catch{return!1}})}var Wo=[`transform`,`translate`,`scale`,`rotate`,`perspective`],Go=[`transform`,`translate`,`scale`,`rotate`,`perspective`,`filter`],Ko=[`paint`,`layout`,`strict`,`content`];function qo(e){let t=Yo(),n=Fo(e)?Qo(e):e;return Wo.some(e=>n[e]?n[e]!==`none`:!1)||(n.containerType?n.containerType!==`normal`:!1)||!t&&(n.backdropFilter?n.backdropFilter!==`none`:!1)||!t&&(n.filter?n.filter!==`none`:!1)||Go.some(e=>(n.willChange||``).includes(e))||Ko.some(e=>(n.contain||``).includes(e))}function Jo(e){let t=es(e);for(;Io(t)&&!Zo(t);){if(qo(t))return t;if(Uo(t))return null;t=es(t)}return null}function Yo(){return typeof CSS>`u`||!CSS.supports?!1:CSS.supports(`-webkit-backdrop-filter`,`none`)}var Xo=new Set([`html`,`body`,`#document`]);function Zo(e){return Xo.has(jo(e))}function Qo(e){return Mo(e).getComputedStyle(e)}function $o(e){return Fo(e)?{scrollLeft:e.scrollLeft,scrollTop:e.scrollTop}:{scrollLeft:e.scrollX,scrollTop:e.scrollY}}function es(e){if(jo(e)===`html`)return e;let t=e.assignedSlot||e.parentNode||Lo(e)&&e.host||No(e);return Lo(t)?t.host:t}function ts(e){let t=es(e);return Zo(t)?e.ownerDocument?e.ownerDocument.body:e.body:Io(t)&&zo(t)?t:ts(t)}function ns(e,t,n){t===void 0&&(t=[]),n===void 0&&(n=!0);let r=ts(e),i=r===e.ownerDocument?.body,a=Mo(r);if(i){let e=rs(a);return t.concat(a,a.visualViewport||[],zo(r)?r:[],e&&n?ns(e):[])}return t.concat(r,ns(r,[],n))}function rs(e){return e.parent&&Object.getPrototypeOf(e.parent)?e.frameElement:null}function is(e){let t=Qo(e),n=parseFloat(t.width)||0,r=parseFloat(t.height)||0,i=Io(e),a=i?e.offsetWidth:n,o=i?e.offsetHeight:r,s=Ha(n)!==a||Ha(r)!==o;return s&&(n=a,r=o),{width:n,height:r,$:s}}function as(e){return Fo(e)?e:e.contextElement}function os(e){let t=as(e);if(!Io(t))return Wa(1);let n=t.getBoundingClientRect(),{width:r,height:i,$:a}=is(t),o=(a?Ha(n.width):n.width)/r,s=(a?Ha(n.height):n.height)/i;return(!o||!Number.isFinite(o))&&(o=1),(!s||!Number.isFinite(s))&&(s=1),{x:o,y:s}}var ss=Wa(0);function cs(e){let t=Mo(e);return!Yo()||!t.visualViewport?ss:{x:t.visualViewport.offsetLeft,y:t.visualViewport.offsetTop}}function ls(e,t,n){return t===void 0&&(t=!1),!n||t&&n!==Mo(e)?!1:t}function us(e,t,n,r){t===void 0&&(t=!1),n===void 0&&(n=!1);let i=e.getBoundingClientRect(),a=as(e),o=Wa(1);t&&(r?Fo(r)&&(o=os(r)):o=os(e));let s=ls(a,n,r)?cs(a):Wa(0),c=(i.left+s.x)/o.x,l=(i.top+s.y)/o.y,u=i.width/o.x,d=i.height/o.y;if(a){let e=Mo(a),t=r&&Fo(r)?Mo(r):r,n=e,i=rs(n);for(;i&&r&&t!==n;){let e=os(i),t=i.getBoundingClientRect(),r=Qo(i),a=t.left+(i.clientLeft+parseFloat(r.paddingLeft))*e.x,o=t.top+(i.clientTop+parseFloat(r.paddingTop))*e.y;c*=e.x,l*=e.y,u*=e.x,d*=e.y,c+=a,l+=o,n=Mo(i),i=rs(n)}}return ho({width:u,height:d,x:c,y:l})}function ds(e,t){let n=$o(e).scrollLeft;return t?t.left+n:us(No(e)).left+n}function fs(e,t){let n=e.getBoundingClientRect();return{x:n.left+t.scrollLeft-ds(e,n),y:n.top+t.scrollTop}}function ps(e){let{elements:t,rect:n,offsetParent:r,strategy:i}=e,a=i===`fixed`,o=No(r),s=t?Uo(t.floating):!1;if(r===o||s&&a)return n;let c={scrollLeft:0,scrollTop:0},l=Wa(1),u=Wa(0),d=Io(r);if((d||!d&&!a)&&((jo(r)!==`body`||zo(o))&&(c=$o(r)),Io(r))){let e=us(r);l=os(r),u.x=e.x+r.clientLeft,u.y=e.y+r.clientTop}let f=o&&!d&&!a?fs(o,c):Wa(0);return{width:n.width*l.x,height:n.height*l.y,x:n.x*l.x-c.scrollLeft*l.x+u.x+f.x,y:n.y*l.y-c.scrollTop*l.y+u.y+f.y}}function ms(e){return Array.from(e.getClientRects())}function hs(e){let t=No(e),n=$o(e),r=e.ownerDocument.body,i=Va(t.scrollWidth,t.clientWidth,r.scrollWidth,r.clientWidth),a=Va(t.scrollHeight,t.clientHeight,r.scrollHeight,r.clientHeight),o=-n.scrollLeft+ds(e),s=-n.scrollTop;return Qo(r).direction===`rtl`&&(o+=Va(t.clientWidth,r.clientWidth)-i),{width:i,height:a,x:o,y:s}}var gs=25;function _s(e,t){let n=Mo(e),r=No(e),i=n.visualViewport,a=r.clientWidth,o=r.clientHeight,s=0,c=0;if(i){a=i.width,o=i.height;let e=Yo();(!e||e&&t===`fixed`)&&(s=i.offsetLeft,c=i.offsetTop)}let l=ds(r);if(l<=0){let e=r.ownerDocument,t=e.body,n=getComputedStyle(t),i=e.compatMode===`CSS1Compat`&&parseFloat(n.marginLeft)+parseFloat(n.marginRight)||0,o=Math.abs(r.clientWidth-t.clientWidth-i);o<=gs&&(a-=o)}else l<=gs&&(a+=l);return{width:a,height:o,x:s,y:c}}var vs=new Set([`absolute`,`fixed`]);function ys(e,t){let n=us(e,!0,t===`fixed`),r=n.top+e.clientTop,i=n.left+e.clientLeft,a=Io(e)?os(e):Wa(1);return{width:e.clientWidth*a.x,height:e.clientHeight*a.y,x:i*a.x,y:r*a.y}}function bs(e,t,n){let r;if(t===`viewport`)r=_s(e,n);else if(t===`document`)r=hs(No(e));else if(Fo(t))r=ys(t,n);else{let n=cs(e);r={x:t.x-n.x,y:t.y-n.y,width:t.width,height:t.height}}return ho(r)}function xs(e,t){let n=es(e);return n===t||!Fo(n)||Zo(n)?!1:Qo(n).position===`fixed`||xs(n,t)}function Ss(e,t){let n=t.get(e);if(n)return n;let r=ns(e,[],!1).filter(e=>Fo(e)&&jo(e)!==`body`),i=null,a=Qo(e).position===`fixed`,o=a?es(e):e;for(;Fo(o)&&!Zo(o);){let t=Qo(o),n=qo(o);!n&&t.position===`fixed`&&(i=null),(a?!n&&!i:!n&&t.position===`static`&&i&&vs.has(i.position)||zo(o)&&!n&&xs(e,o))?r=r.filter(e=>e!==o):i=t,o=es(o)}return t.set(e,r),r}function Cs(e){let{element:t,boundary:n,rootBoundary:r,strategy:i}=e,a=[...n===`clippingAncestors`?Uo(t)?[]:Ss(t,this._c):[].concat(n),r],o=a[0],s=a.reduce((e,n)=>{let r=bs(t,n,i);return e.top=Va(r.top,e.top),e.right=Ba(r.right,e.right),e.bottom=Ba(r.bottom,e.bottom),e.left=Va(r.left,e.left),e},bs(t,o,i));return{width:s.right-s.left,height:s.bottom-s.top,x:s.left,y:s.top}}function ws(e){let{width:t,height:n}=is(e);return{width:t,height:n}}function Ts(e,t,n){let r=Io(t),i=No(t),a=n===`fixed`,o=us(e,!0,a,t),s={scrollLeft:0,scrollTop:0},c=Wa(0);function l(){c.x=ds(i)}if(r||!r&&!a){if((jo(t)!==`body`||zo(i))&&(s=$o(t)),r){let e=us(t,!0,a,t);c.x=e.x+t.clientLeft,c.y=e.y+t.clientTop}else i&&l()}a&&!r&&i&&l();let u=i&&!r&&!a?fs(i,s):Wa(0);return{x:o.left+s.scrollLeft-c.x-u.x,y:o.top+s.scrollTop-c.y-u.y,width:o.width,height:o.height}}function Es(e){return Qo(e).position===`static`}function Ds(e,t){if(!Io(e)||Qo(e).position===`fixed`)return null;if(t)return t(e);let n=e.offsetParent;return No(e)===n&&(n=n.ownerDocument.body),n}function Os(e,t){let n=Mo(e);if(Uo(e))return n;if(!Io(e)){let t=es(e);for(;t&&!Zo(t);){if(Fo(t)&&!Es(t))return t;t=es(t)}return n}let r=Ds(e,t);for(;r&&Vo(r)&&Es(r);)r=Ds(r,t);return r&&Zo(r)&&Es(r)&&!qo(r)?n:r||Jo(e)||n}var ks=async function(e){let t=this.getOffsetParent||Os,n=this.getDimensions,r=await n(e.floating);return{reference:Ts(e.reference,await t(e.floating),e.strategy),floating:{x:0,y:0,width:r.width,height:r.height}}};function As(e){return Qo(e).direction===`rtl`}var js={convertOffsetParentRelativeRectToViewportRelativeRect:ps,getDocumentElement:No,getClippingRect:Cs,getOffsetParent:Os,getElementRects:ks,getClientRects:ms,getDimensions:ws,getScale:os,isElement:Fo,isRTL:As};function Ms(e,t){return e.x===t.x&&e.y===t.y&&e.width===t.width&&e.height===t.height}function Ns(e,t){let n=null,r,i=No(e);function a(){var e;clearTimeout(r),(e=n)==null||e.disconnect(),n=null}function o(s,c){s===void 0&&(s=!1),c===void 0&&(c=1),a();let l=e.getBoundingClientRect(),{left:u,top:d,width:f,height:p}=l;if(s||t(),!f||!p)return;let m=Ua(d),h=Ua(i.clientWidth-(u+f)),g=Ua(i.clientHeight-(d+p)),_=Ua(u),v={rootMargin:-m+`px `+-h+`px `+-g+`px `+-_+`px`,threshold:Va(0,Ba(1,c))||1},y=!0;function b(t){let n=t[0].intersectionRatio;if(n!==c){if(!y)return o();n?o(!1,n):r=setTimeout(()=>{o(!1,1e-7)},1e3)}n===1&&!Ms(l,e.getBoundingClientRect())&&o(),y=!1}try{n=new IntersectionObserver(b,{...v,root:i.ownerDocument})}catch{n=new IntersectionObserver(b,v)}n.observe(e)}return o(!0),a}function Ps(e,t,n,r){r===void 0&&(r={});let{ancestorScroll:i=!0,ancestorResize:a=!0,elementResize:o=typeof ResizeObserver==`function`,layoutShift:s=typeof IntersectionObserver==`function`,animationFrame:c=!1}=r,l=as(e),u=i||a?[...l?ns(l):[],...ns(t)]:[];u.forEach(e=>{i&&e.addEventListener(`scroll`,n,{passive:!0}),a&&e.addEventListener(`resize`,n)});let d=l&&s?Ns(l,n):null,f=-1,p=null;o&&(p=new ResizeObserver(e=>{let[r]=e;r&&r.target===l&&p&&(p.unobserve(t),cancelAnimationFrame(f),f=requestAnimationFrame(()=>{var e;(e=p)==null||e.observe(t)})),n()}),l&&!c&&p.observe(l),p.observe(t));let m,h=c?us(e):null;c&&g();function g(){let t=us(e);h&&!Ms(h,t)&&n(),h=t,m=requestAnimationFrame(g)}return n(),()=>{var e;u.forEach(e=>{i&&e.removeEventListener(`scroll`,n),a&&e.removeEventListener(`resize`,n)}),d?.(),(e=p)==null||e.disconnect(),p=null,c&&cancelAnimationFrame(m)}}var Fs=Eo,Is=Do,Ls=bo,Rs=ko,zs=Co,Bs=yo,Vs=Oo,Hs=(e,t,n)=>{let r=new Map,i={platform:js,...n},a={...i.platform,_c:r};return vo(e,t,{...i,platform:a})},Us=typeof document<`u`?_.useLayoutEffect:function(){};function Ws(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,i;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(!Ws(e[r],t[r]))return!1;return!0}if(i=Object.keys(e),n=i.length,n!==Object.keys(t).length)return!1;for(r=n;r--!==0;)if(!{}.hasOwnProperty.call(t,i[r]))return!1;for(r=n;r--!==0;){let n=i[r];if(!(n===`_owner`&&e.$$typeof)&&!Ws(e[n],t[n]))return!1}return!0}return e!==e&&t!==t}function Gs(e){return typeof window>`u`?1:(e.ownerDocument.defaultView||window).devicePixelRatio||1}function Ks(e,t){let n=Gs(e);return Math.round(t*n)/n}function qs(e){let t=_.useRef(e);return Us(()=>{t.current=e}),t}function Js(e){e===void 0&&(e={});let{placement:t=`bottom`,strategy:n=`absolute`,middleware:r=[],platform:i,elements:{reference:a,floating:o}={},transform:s=!0,whileElementsMounted:c,open:l}=e,[u,d]=_.useState({x:0,y:0,strategy:n,placement:t,middlewareData:{},isPositioned:!1}),[f,p]=_.useState(r);Ws(f,r)||p(r);let[m,h]=_.useState(null),[g,v]=_.useState(null),y=_.useCallback(e=>{e!==C.current&&(C.current=e,h(e))},[]),b=_.useCallback(e=>{e!==w.current&&(w.current=e,v(e))},[]),x=a||m,S=o||g,C=_.useRef(null),w=_.useRef(null),T=_.useRef(u),E=c!=null,D=qs(c),O=qs(i),k=qs(l),j=_.useCallback(()=>{if(!C.current||!w.current)return;let e={placement:t,strategy:n,middleware:f};O.current&&(e.platform=O.current),Hs(C.current,w.current,e).then(e=>{let t={...e,isPositioned:k.current!==!1};M.current&&!Ws(T.current,t)&&(T.current=t,A.flushSync(()=>{d(t)}))})},[f,t,n,O,k]);Us(()=>{l===!1&&T.current.isPositioned&&(T.current.isPositioned=!1,d(e=>({...e,isPositioned:!1})))},[l]);let M=_.useRef(!1);Us(()=>(M.current=!0,()=>{M.current=!1}),[]),Us(()=>{if(x&&(C.current=x),S&&(w.current=S),x&&S){if(D.current)return D.current(x,S,j);j()}},[x,S,j,D,E]);let N=_.useMemo(()=>({reference:C,floating:w,setReference:y,setFloating:b}),[y,b]),P=_.useMemo(()=>({reference:x,floating:S}),[x,S]),F=_.useMemo(()=>{let e={position:n,left:0,top:0};if(!P.floating)return e;let t=Ks(P.floating,u.x),r=Ks(P.floating,u.y);return s?{...e,transform:`translate(`+t+`px, `+r+`px)`,...Gs(P.floating)>=1.5&&{willChange:`transform`}}:{position:n,left:t,top:r}},[n,s,P.floating,u.x,u.y]);return _.useMemo(()=>({...u,update:j,refs:N,elements:P,floatingStyles:F}),[u,j,N,P,F])}var Ys=e=>{function t(e){return{}.hasOwnProperty.call(e,`current`)}return{name:`arrow`,options:e,fn(n){let{element:r,padding:i}=typeof e==`function`?e(n):e;return r&&t(r)?r.current==null?{}:Bs({element:r.current,padding:i}).fn(n):r?Bs({element:r,padding:i}).fn(n):{}}}},Xs=(e,t)=>({...Fs(e),options:[e,t]}),Zs=(e,t)=>({...Is(e),options:[e,t]}),Qs=(e,t)=>({...Vs(e),options:[e,t]}),$s=(e,t)=>({...Ls(e),options:[e,t]}),ec=(e,t)=>({...Rs(e),options:[e,t]}),tc=(e,t)=>({...zs(e),options:[e,t]}),nc=(e,t)=>({...Ys(e),options:[e,t]}),rc=`Arrow`,ic=_.forwardRef((e,t)=>{let{children:n,width:r=10,height:i=5,...a}=e;return(0,I.jsx)(V.svg,{...a,ref:t,width:r,height:i,viewBox:`0 0 30 10`,preserveAspectRatio:`none`,children:e.asChild?n:(0,I.jsx)(`polygon`,{points:`0,0 30,0 15,10`})})});ic.displayName=rc;var ac=ic;function oc(e){let[t,n]=_.useState(void 0);return Ae(()=>{if(e){n({width:e.offsetWidth,height:e.offsetHeight});let t=new ResizeObserver(t=>{if(!Array.isArray(t)||!t.length)return;let r=t[0],i,a;if(`borderBoxSize`in r){let e=r.borderBoxSize,t=Array.isArray(e)?e[0]:e;i=t.inlineSize,a=t.blockSize}else i=e.offsetWidth,a=e.offsetHeight;n({width:i,height:a})});return t.observe(e,{box:`border-box`}),()=>t.unobserve(e)}n(void 0)},[e]),t}var sc=`Popper`,[cc,lc]=R(sc),[uc,dc]=cc(sc),fc=e=>{let{__scopePopper:t,children:n}=e,[r,i]=_.useState(null);return(0,I.jsx)(uc,{scope:t,anchor:r,onAnchorChange:i,children:n})};fc.displayName=sc;var pc=`PopperAnchor`,mc=_.forwardRef((e,t)=>{let{__scopePopper:n,virtualRef:r,...i}=e,a=dc(pc,n),o=_.useRef(null),s=P(t,o),c=_.useRef(null);return _.useEffect(()=>{let e=c.current;c.current=r?.current||o.current,e!==c.current&&a.onAnchorChange(c.current)}),r?null:(0,I.jsx)(V.div,{...i,ref:s})});mc.displayName=pc;var hc=`PopperContent`,[gc,_c]=cc(hc),vc=_.forwardRef((e,t)=>{let{__scopePopper:n,side:r=`bottom`,sideOffset:i=0,align:a=`center`,alignOffset:o=0,arrowPadding:s=0,avoidCollisions:c=!0,collisionBoundary:l=[],collisionPadding:u=0,sticky:d=`partial`,hideWhenDetached:f=!1,updatePositionStrategy:p=`optimized`,onPlaced:m,...h}=e,g=dc(hc,n),[v,y]=_.useState(null),b=P(t,e=>y(e)),[x,S]=_.useState(null),C=oc(x),w=C?.width??0,T=C?.height??0,E=r+(a===`center`?``:`-`+a),D=typeof u==`number`?u:{top:0,right:0,bottom:0,left:0,...u},O=Array.isArray(l)?l:[l],k=O.length>0,A={padding:D,boundary:O.filter(Sc),altBoundary:k},{refs:j,floatingStyles:M,placement:N,isPositioned:F,middlewareData:L}=Js({strategy:`fixed`,placement:E,whileElementsMounted:(...e)=>Ps(...e,{animationFrame:p===`always`}),elements:{reference:g.anchor},middleware:[Xs({mainAxis:i+T,alignmentAxis:o}),c&&Zs({mainAxis:!0,crossAxis:!1,limiter:d===`partial`?Qs():void 0,...A}),c&&$s({...A}),ec({...A,apply:({elements:e,rects:t,availableWidth:n,availableHeight:r})=>{let{width:i,height:a}=t.reference,o=e.floating.style;o.setProperty(`--radix-popper-available-width`,`${n}px`),o.setProperty(`--radix-popper-available-height`,`${r}px`),o.setProperty(`--radix-popper-anchor-width`,`${i}px`),o.setProperty(`--radix-popper-anchor-height`,`${a}px`)}}),x&&nc({element:x,padding:s}),Cc({arrowWidth:w,arrowHeight:T}),f&&tc({strategy:`referenceHidden`,...A})]}),[R,z]=wc(N),ee=pe(m);Ae(()=>{F&&ee?.()},[F,ee]);let te=L.arrow?.x,ne=L.arrow?.y,re=L.arrow?.centerOffset!==0,[ie,ae]=_.useState();return Ae(()=>{v&&ae(window.getComputedStyle(v).zIndex)},[v]),(0,I.jsx)(`div`,{ref:j.setFloating,"data-radix-popper-content-wrapper":``,style:{...M,transform:F?M.transform:`translate(0, -200%)`,minWidth:`max-content`,zIndex:ie,"--radix-popper-transform-origin":[L.transformOrigin?.x,L.transformOrigin?.y].join(` `),...L.hide?.referenceHidden&&{visibility:`hidden`,pointerEvents:`none`}},dir:e.dir,children:(0,I.jsx)(gc,{scope:n,placedSide:R,onArrowChange:S,arrowX:te,arrowY:ne,shouldHideArrow:re,children:(0,I.jsx)(V.div,{"data-side":R,"data-align":z,...h,ref:b,style:{...h.style,animation:F?void 0:`none`}})})})});vc.displayName=hc;var yc=`PopperArrow`,bc={top:`bottom`,right:`left`,bottom:`top`,left:`right`},xc=_.forwardRef(function(e,t){let{__scopePopper:n,...r}=e,i=_c(yc,n),a=bc[i.placedSide];return(0,I.jsx)(`span`,{ref:i.onArrowChange,style:{position:`absolute`,left:i.arrowX,top:i.arrowY,[a]: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:(0,I.jsx)(ac,{...r,ref:t,style:{...r.style,display:`block`}})})});xc.displayName=yc;function Sc(e){return e!==null}var Cc=e=>({name:`transformOrigin`,options:e,fn(t){let{placement:n,rects:r,middlewareData:i}=t,a=i.arrow?.centerOffset!==0,o=a?0:e.arrowWidth,s=a?0:e.arrowHeight,[c,l]=wc(n),u={start:`0%`,center:`50%`,end:`100%`}[l],d=(i.arrow?.x??0)+o/2,f=(i.arrow?.y??0)+s/2,p=``,m=``;return c===`bottom`?(p=a?u:`${d}px`,m=`${-s}px`):c===`top`?(p=a?u:`${d}px`,m=`${r.floating.height+s}px`):c===`right`?(p=`${-s}px`,m=a?u:`${f}px`):c===`left`&&(p=`${r.floating.width+s}px`,m=a?u:`${f}px`),{data:{x:p,y:m}}}});function wc(e){let[t,n=`center`]=e.split(`-`);return[t,n]}var Tc=fc,Ec=mc,Dc=vc,Oc=xc,kc=Symbol(`radix.slottable`);function Ac(e){let t=({children:e})=>(0,I.jsx)(I.Fragment,{children:e});return t.displayName=`${e}.Slottable`,t.__radixId=kc,t}var[jc,Mc]=R(`Tooltip`,[lc]),Nc=lc(),Pc=`TooltipProvider`,Fc=700,Ic=`tooltip.open`,[Lc,Rc]=jc(Pc),zc=e=>{let{__scopeTooltip:t,delayDuration:n=Fc,skipDelayDuration:r=300,disableHoverableContent:i=!1,children:a}=e,o=_.useRef(!0),s=_.useRef(!1),c=_.useRef(0);return _.useEffect(()=>{let e=c.current;return()=>window.clearTimeout(e)},[]),(0,I.jsx)(Lc,{scope:t,isOpenDelayedRef:o,delayDuration:n,onOpen:_.useCallback(()=>{window.clearTimeout(c.current),o.current=!1},[]),onClose:_.useCallback(()=>{window.clearTimeout(c.current),c.current=window.setTimeout(()=>o.current=!0,r)},[r]),isPointerInTransitRef:s,onPointerInTransitChange:_.useCallback(e=>{s.current=e},[]),disableHoverableContent:i,children:a})};zc.displayName=Pc;var Bc=`Tooltip`,[Vc,Hc]=jc(Bc),Uc=e=>{let{__scopeTooltip:t,children:n,open:r,defaultOpen:i,onOpenChange:a,disableHoverableContent:o,delayDuration:s}=e,c=Rc(Bc,e.__scopeTooltip),l=Nc(t),[u,d]=_.useState(null),f=Ra(),p=_.useRef(0),m=o??c.disableHoverableContent,h=s??c.delayDuration,g=_.useRef(!1),[v,y]=ze({prop:r,defaultProp:i??!1,onChange:e=>{e?(c.onOpen(),document.dispatchEvent(new CustomEvent(Ic))):c.onClose(),a?.(e)},caller:Bc}),b=_.useMemo(()=>v?g.current?`delayed-open`:`instant-open`:`closed`,[v]),x=_.useCallback(()=>{window.clearTimeout(p.current),p.current=0,g.current=!1,y(!0)},[y]),S=_.useCallback(()=>{window.clearTimeout(p.current),p.current=0,y(!1)},[y]),C=_.useCallback(()=>{window.clearTimeout(p.current),p.current=window.setTimeout(()=>{g.current=!0,y(!0),p.current=0},h)},[h,y]);return _.useEffect(()=>()=>{p.current&&=(window.clearTimeout(p.current),0)},[]),(0,I.jsx)(Tc,{...l,children:(0,I.jsx)(Vc,{scope:t,contentId:f,open:v,stateAttribute:b,trigger:u,onTriggerChange:d,onTriggerEnter:_.useCallback(()=>{c.isOpenDelayedRef.current?C():x()},[c.isOpenDelayedRef,C,x]),onTriggerLeave:_.useCallback(()=>{m?S():(window.clearTimeout(p.current),p.current=0)},[S,m]),onOpen:x,onClose:S,disableHoverableContent:m,children:n})})};Uc.displayName=Bc;var Wc=`TooltipTrigger`,Gc=_.forwardRef((e,t)=>{let{__scopeTooltip:n,...r}=e,i=Hc(Wc,n),a=Rc(Wc,n),o=Nc(n),s=P(t,_.useRef(null),i.onTriggerChange),c=_.useRef(!1),l=_.useRef(!1),u=_.useCallback(()=>c.current=!1,[]);return _.useEffect(()=>()=>document.removeEventListener(`pointerup`,u),[u]),(0,I.jsx)(Ec,{asChild:!0,...o,children:(0,I.jsx)(V.button,{"aria-describedby":i.open?i.contentId:void 0,"data-state":i.stateAttribute,...r,ref:s,onPointerMove:j(e.onPointerMove,e=>{e.pointerType!==`touch`&&!l.current&&!a.isPointerInTransitRef.current&&(i.onTriggerEnter(),l.current=!0)}),onPointerLeave:j(e.onPointerLeave,()=>{i.onTriggerLeave(),l.current=!1}),onPointerDown:j(e.onPointerDown,()=>{i.open&&i.onClose(),c.current=!0,document.addEventListener(`pointerup`,u,{once:!0})}),onFocus:j(e.onFocus,()=>{c.current||i.onOpen()}),onBlur:j(e.onBlur,i.onClose),onClick:j(e.onClick,i.onClose)})})});Gc.displayName=Wc;var Kc=`TooltipPortal`,[qc,Jc]=jc(Kc,{forceMount:void 0}),Yc=e=>{let{__scopeTooltip:t,forceMount:n,children:r,container:i}=e,a=Hc(Kc,t);return(0,I.jsx)(qc,{scope:t,forceMount:n,children:(0,I.jsx)(Pe,{present:n||a.open,children:(0,I.jsx)(Me,{asChild:!0,container:i,children:r})})})};Yc.displayName=Kc;var Xc=`TooltipContent`,Zc=_.forwardRef((e,t)=>{let n=Jc(Xc,e.__scopeTooltip),{forceMount:r=n.forceMount,side:i=`top`,...a}=e,o=Hc(Xc,e.__scopeTooltip);return(0,I.jsx)(Pe,{present:r||o.open,children:o.disableHoverableContent?(0,I.jsx)(nl,{side:i,...a,ref:t}):(0,I.jsx)(Qc,{side:i,...a,ref:t})})}),Qc=_.forwardRef((e,t)=>{let n=Hc(Xc,e.__scopeTooltip),r=Rc(Xc,e.__scopeTooltip),i=_.useRef(null),a=P(t,i),[o,s]=_.useState(null),{trigger:c,onClose:l}=n,u=i.current,{onPointerInTransitChange:d}=r,f=_.useCallback(()=>{s(null),d(!1)},[d]),p=_.useCallback((e,t)=>{let n=e.currentTarget,r={x:e.clientX,y:e.clientY},i=ol(r,al(r,n.getBoundingClientRect())),a=sl(t.getBoundingClientRect()),o=ll([...i,...a]);s(o),d(!0)},[d]);return _.useEffect(()=>()=>f(),[f]),_.useEffect(()=>{if(c&&u){let e=e=>p(e,u),t=e=>p(e,c);return c.addEventListener(`pointerleave`,e),u.addEventListener(`pointerleave`,t),()=>{c.removeEventListener(`pointerleave`,e),u.removeEventListener(`pointerleave`,t)}}},[c,u,p,f]),_.useEffect(()=>{if(o){let e=e=>{let t=e.target,n={x:e.clientX,y:e.clientY},r=c?.contains(t)||u?.contains(t),i=!cl(n,o);r?f():i&&(f(),l())};return document.addEventListener(`pointermove`,e),()=>document.removeEventListener(`pointermove`,e)}},[c,u,o,l,f]),(0,I.jsx)(nl,{...e,ref:a})}),[$c,el]=jc(Bc,{isInside:!1}),tl=Ac(`TooltipContent`),nl=_.forwardRef((e,t)=>{let{__scopeTooltip:n,children:r,"aria-label":i,onEscapeKeyDown:a,onPointerDownOutside:o,...s}=e,c=Hc(Xc,n),l=Nc(n),{onClose:u}=c;return _.useEffect(()=>(document.addEventListener(Ic,u),()=>document.removeEventListener(Ic,u)),[u]),_.useEffect(()=>{if(c.trigger){let e=e=>{e.target?.contains(c.trigger)&&u()};return window.addEventListener(`scroll`,e,{capture:!0}),()=>window.removeEventListener(`scroll`,e,{capture:!0})}},[c.trigger,u]),(0,I.jsx)(xe,{asChild:!0,disableOutsidePointerEvents:!1,onEscapeKeyDown:a,onPointerDownOutside:o,onFocusOutside:e=>e.preventDefault(),onDismiss:u,children:(0,I.jsxs)(Dc,{"data-state":c.stateAttribute,...l,...s,ref:t,style:{...s.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:[(0,I.jsx)(tl,{children:r}),(0,I.jsx)($c,{scope:n,isInside:!0,children:(0,I.jsx)(Ge,{id:c.contentId,role:`tooltip`,children:i||r})})]})})});Zc.displayName=Xc;var rl=`TooltipArrow`,il=_.forwardRef((e,t)=>{let{__scopeTooltip:n,...r}=e,i=Nc(n);return el(rl,n).isInside?null:(0,I.jsx)(Oc,{...i,...r,ref:t})});il.displayName=rl;function al(e,t){let n=Math.abs(t.top-e.y),r=Math.abs(t.bottom-e.y),i=Math.abs(t.right-e.x),a=Math.abs(t.left-e.x);switch(Math.min(n,r,i,a)){case a:return`left`;case i:return`right`;case n:return`top`;case r:return`bottom`;default:throw Error(`unreachable`)}}function ol(e,t,n=5){let 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})}return r}function sl(e){let{top:t,right:n,bottom:r,left:i}=e;return[{x:i,y:t},{x:n,y:t},{x:n,y:r},{x:i,y:r}]}function cl(e,t){let{x:n,y:r}=e,i=!1;for(let e=0,a=t.length-1;e<t.length;a=e++){let o=t[e],s=t[a],c=o.x,l=o.y,u=s.x,d=s.y;l>r!=d>r&&n<(u-c)*(r-l)/(d-l)+c&&(i=!i)}return i}function ll(e){let t=e.slice();return t.sort((e,t)=>e.x<t.x?-1:e.x>t.x?1:e.y<t.y?-1:+(e.y>t.y)),ul(t)}function ul(e){if(e.length<=1)return e.slice();let t=[];for(let n=0;n<e.length;n++){let r=e[n];for(;t.length>=2;){let e=t[t.length-1],n=t[t.length-2];if((e.x-n.x)*(r.y-n.y)>=(e.y-n.y)*(r.x-n.x))t.pop();else break}t.push(r)}t.pop();let n=[];for(let t=e.length-1;t>=0;t--){let r=e[t];for(;n.length>=2;){let e=n[n.length-1],t=n[n.length-2];if((e.x-t.x)*(r.y-t.y)>=(e.y-t.y)*(r.x-t.x))n.pop();else break}n.push(r)}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 dl=zc,fl=Uc,pl=Gc,ml=Yc,hl=Zc,gl=dl,_l=fl,vl=pl,yl=_.forwardRef(({className:e,sideOffset:t=4,...n},r)=>(0,I.jsx)(ml,{children:(0,I.jsx)(hl,{ref:r,sideOffset:t,className:U(`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})}));yl.displayName=hl.displayName;var bl=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(){}},xl=new class extends bl{#e;#t;#n;constructor(){super(),this.#n=e=>{if(typeof window<`u`&&window.addEventListener){let t=()=>e();return window.addEventListener(`visibilitychange`,t,!1),()=>{window.removeEventListener(`visibilitychange`,t)}}}}onSubscribe(){this.#t||this.setEventListener(this.#n)}onUnsubscribe(){this.hasListeners()||(this.#t?.(),this.#t=void 0)}setEventListener(e){this.#n=e,this.#t?.(),this.#t=e(e=>{typeof e==`boolean`?this.setFocused(e):this.onFocus()})}setFocused(e){this.#e!==e&&(this.#e=e,this.onFocus())}onFocus(){let e=this.isFocused();this.listeners.forEach(t=>{t(e)})}isFocused(){return typeof this.#e==`boolean`?this.#e:globalThis.document?.visibilityState!==`hidden`}},Sl={setTimeout:(e,t)=>setTimeout(e,t),clearTimeout:e=>clearTimeout(e),setInterval:(e,t)=>setInterval(e,t),clearInterval:e=>clearInterval(e)},Cl=new class{#e=Sl;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)}};function wl(e){setTimeout(e,0)}var Tl=typeof window>`u`||`Deno`in globalThis;function El(){}function Dl(e,t){return typeof e==`function`?e(t):e}function Ol(e){return typeof e==`number`&&e>=0&&e!==1/0}function kl(e,t){return Math.max(e+(t||0)-Date.now(),0)}function Al(e,t){return typeof e==`function`?e(t):e}function jl(e,t){return typeof e==`function`?e(t):e}function Ml(e,t){let{type:n=`all`,exact:r,fetchStatus:i,predicate:a,queryKey:o,stale:s}=e;if(o){if(r){if(t.queryHash!==Pl(o,t.options))return!1}else if(!Il(t.queryKey,o))return!1}if(n!==`all`){let e=t.isActive();if(n===`active`&&!e||n===`inactive`&&e)return!1}return!(typeof s==`boolean`&&t.isStale()!==s||i&&i!==t.state.fetchStatus||a&&!a(t))}function Nl(e,t){let{exact:n,status:r,predicate:i,mutationKey:a}=e;if(a){if(!t.options.mutationKey)return!1;if(n){if(Fl(t.options.mutationKey)!==Fl(a))return!1}else if(!Il(t.options.mutationKey,a))return!1}return!(r&&t.state.status!==r||i&&!i(t))}function Pl(e,t){return(t?.queryKeyHashFn||Fl)(e)}function Fl(e){return JSON.stringify(e,(e,t)=>Bl(t)?Object.keys(t).sort().reduce((e,n)=>(e[n]=t[n],e),{}):t)}function Il(e,t){return e===t?!0:typeof e==typeof t&&e&&t&&typeof e==`object`&&typeof t==`object`?Object.keys(t).every(n=>Il(e[n],t[n])):!1}var Ll=Object.prototype.hasOwnProperty;function Rl(e,t,n=0){if(e===t)return e;if(n>500)return t;let r=zl(e)&&zl(t);if(!r&&!(Bl(e)&&Bl(t)))return t;let i=(r?e:Object.keys(e)).length,a=r?t:Object.keys(t),o=a.length,s=r?Array(o):{},c=0;for(let l=0;l<o;l++){let o=r?l:a[l],u=e[o],d=t[o];if(u===d){s[o]=u,(r?l<i:Ll.call(e,o))&&c++;continue}if(u===null||d===null||typeof u!=`object`||typeof d!=`object`){s[o]=d;continue}let f=Rl(u,d,n+1);s[o]=f,f===u&&c++}return i===o&&c===i?e:s}function zl(e){return Array.isArray(e)&&e.length===Object.keys(e).length}function Bl(e){if(!Vl(e))return!1;let t=e.constructor;if(t===void 0)return!0;let n=t.prototype;return!(!Vl(n)||!n.hasOwnProperty(`isPrototypeOf`)||Object.getPrototypeOf(e)!==Object.prototype)}function Vl(e){return Object.prototype.toString.call(e)===`[object Object]`}function Hl(e){return new Promise(t=>{Cl.setTimeout(t,e)})}function Ul(e,t,n){return typeof n.structuralSharing==`function`?n.structuralSharing(e,t):n.structuralSharing===!1?t:Rl(e,t)}function Wl(e,t,n=0){let r=[...e,t];return n&&r.length>n?r.slice(1):r}function Gl(e,t,n=0){let r=[t,...e];return n&&r.length>n?r.slice(0,-1):r}var Kl=Symbol();function ql(e,t){return!e.queryFn&&t?.initialPromise?()=>t.initialPromise:!e.queryFn||e.queryFn===Kl?()=>Promise.reject(Error(`Missing queryFn: '${e.queryHash}'`)):e.queryFn}function Jl(e,t,n){let r=!1,i;return Object.defineProperty(e,"signal",{enumerable:!0,get:()=>(i??=t(),r||(r=!0,i.aborted?n():i.addEventListener(`abort`,n,{once:!0})),i)}),e}var Yl=(()=>{let e=()=>Tl;return{isServer(){return e()},setIsServer(t){e=t}}})();function Xl(){let e,t,n=new Promise((n,r)=>{e=n,t=r});n.status=`pending`,n.catch(()=>{});function r(e){Object.assign(n,e),delete n.resolve,delete n.reject}return n.resolve=t=>{r({status:`fulfilled`,value:t}),e(t)},n.reject=e=>{r({status:`rejected`,reason:e}),t(e)},n}var Zl=wl;function Ql(){let e=[],t=0,n=e=>{e()},r=e=>{e()},i=Zl,a=r=>{t?e.push(r):i(()=>{n(r)})},o=()=>{let t=e;e=[],t.length&&i(()=>{r(()=>{t.forEach(e=>{n(e)})})})};return{batch:e=>{let n;t++;try{n=e()}finally{t--,t||o()}return n},batchCalls:e=>(...t)=>{a(()=>{e(...t)})},schedule:a,setNotifyFunction:e=>{n=e},setBatchNotifyFunction:e=>{r=e},setScheduler:e=>{i=e}}}var $l=Ql(),eu=new class extends bl{#e=!0;#t;#n;constructor(){super(),this.#n=e=>{if(typeof window<`u`&&window.addEventListener){let 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.#t||this.setEventListener(this.#n)}onUnsubscribe(){this.hasListeners()||(this.#t?.(),this.#t=void 0)}setEventListener(e){this.#n=e,this.#t?.(),this.#t=e(this.setOnline.bind(this))}setOnline(e){this.#e!==e&&(this.#e=e,this.listeners.forEach(t=>{t(e)}))}isOnline(){return this.#e}};function tu(e){return Math.min(1e3*2**e,3e4)}function nu(e){return(e??`online`)!==`online`||eu.isOnline()}var ru=class extends Error{constructor(e){super(`CancelledError`),this.revert=e?.revert,this.silent=e?.silent}};function iu(e){let t=!1,n=0,r,i=Xl(),a=()=>i.status!==`pending`,o=t=>{if(!a()){let n=new ru(t);f(n),e.onCancel?.(n)}},s=()=>{t=!0},c=()=>{t=!1},l=()=>xl.isFocused()&&(e.networkMode===`always`||eu.isOnline())&&e.canRun(),u=()=>nu(e.networkMode)&&e.canRun(),d=e=>{a()||(r?.(),i.resolve(e))},f=e=>{a()||(r?.(),i.reject(e))},p=()=>new Promise(t=>{r=e=>{(a()||l())&&t(e)},e.onPause?.()}).then(()=>{r=void 0,a()||e.onContinue?.()}),m=()=>{if(a())return;let r,i=n===0?e.initialPromise:void 0;try{r=i??e.fn()}catch(e){r=Promise.reject(e)}Promise.resolve(r).then(d).catch(r=>{if(a())return;let i=e.retry??(Yl.isServer()?0:3),o=e.retryDelay??tu,s=typeof o==`function`?o(n,r):o,c=i===!0||typeof i==`number`&&n<i||typeof i==`function`&&i(n,r);t||!c?f(r):(n++,e.onFail?.(n,r),Hl(s).then(()=>l()?void 0:p()).then(()=>{t?f(r):m()}))})};return{promise:i,status:()=>i.status,cancel:o,continue:()=>(r?.(),i),cancelRetry:s,continueRetry:c,canStart:u,start:()=>(u()?m():p().then(m),i)}}var au=class{#e;destroy(){this.clearGcTimeout()}scheduleGc(){this.clearGcTimeout(),Ol(this.gcTime)&&(this.#e=Cl.setTimeout(()=>{this.optionalRemove()},this.gcTime))}updateGcTime(e){this.gcTime=Math.max(this.gcTime||0,e??(Yl.isServer()?1/0:3e5))}clearGcTimeout(){this.#e!==void 0&&(Cl.clearTimeout(this.#e),this.#e=void 0)}};function ou(e){return{onFetch:(t,n)=>{let r=t.options,i=t.fetchOptions?.meta?.fetchMore?.direction,a=t.state.data?.pages||[],o=t.state.data?.pageParams||[],s={pages:[],pageParams:[]},c=0,l=async()=>{let n=!1,l=e=>{Jl(e,()=>t.signal,()=>n=!0)},u=ql(t.options,t.fetchOptions),d=async(e,r,i)=>{if(n)return Promise.reject(t.signal.reason);if(r==null&&e.pages.length)return Promise.resolve(e);let a=(()=>{let e={client:t.client,queryKey:t.queryKey,pageParam:r,direction:i?`backward`:`forward`,meta:t.options.meta};return l(e),e})(),o=await u(a),{maxPages:s}=t.options,c=i?Gl:Wl;return{pages:c(e.pages,o,s),pageParams:c(e.pageParams,r,s)}};if(i&&a.length){let e=i===`backward`,t=e?cu:su,n={pages:a,pageParams:o};s=await d(n,t(r,n),e)}else{let t=e??a.length;do{let e=c===0?o[0]??r.initialPageParam:su(r,s);if(c>0&&e==null)break;s=await d(s,e),c++}while(c<t)}return s};t.fetchFn=t.options.persister?()=>t.options.persister?.(l,{client:t.client,queryKey:t.queryKey,meta:t.options.meta,signal:t.signal},n):l}}}function su(e,{pages:t,pageParams:n}){let r=t.length-1;return t.length>0?e.getNextPageParam(t[r],t,n[r],n):void 0}function cu(e,{pages:t,pageParams:n}){return t.length>0?e.getPreviousPageParam?.(t[0],t,n[0],n):void 0}var lu=class extends au{#e;#t;#n;#r;#i;#a;#o;#s;constructor(e){super(),this.#s=!1,this.#o=e.defaultOptions,this.setOptions(e.options),this.observers=[],this.#i=e.client,this.#r=this.#i.getQueryCache(),this.queryKey=e.queryKey,this.queryHash=e.queryHash,this.#t=fu(this.options),this.state=e.state??this.#t,this.scheduleGc()}get meta(){return this.options.meta}get queryType(){return this.#e}get promise(){return this.#a?.promise}setOptions(e){if(this.options={...this.#o,...e},e?._type&&(this.#e=e._type),this.updateGcTime(this.options.gcTime),this.state&&this.state.data===void 0){let e=fu(this.options);e.data!==void 0&&(this.setState(du(e.data,e.dataUpdatedAt)),this.#t=e)}}optionalRemove(){!this.observers.length&&this.state.fetchStatus===`idle`&&this.#r.remove(this)}setData(e,t){let n=Ul(this.state.data,e,this.options);return this.#l({data:n,type:`success`,dataUpdatedAt:t?.updatedAt,manual:t?.manual}),n}setState(e){this.#l({type:`setState`,state:e})}cancel(e){let t=this.#a?.promise;return this.#a?.cancel(e),t?t.then(El).catch(El):Promise.resolve()}destroy(){super.destroy(),this.cancel({silent:!0})}get resetState(){return this.#t}reset(){this.destroy(),this.setState(this.resetState)}isActive(){return this.observers.some(e=>jl(e.options.enabled,this)!==!1)}isDisabled(){return this.getObserversCount()>0?!this.isActive():this.options.queryFn===Kl||!this.isFetched()}isFetched(){return this.state.dataUpdateCount+this.state.errorUpdateCount>0}isStatic(){return this.getObserversCount()>0&&this.observers.some(e=>Al(e.options.staleTime,this)===`static`)}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:!kl(this.state.dataUpdatedAt,e)}onFocus(){this.observers.find(e=>e.shouldFetchOnWindowFocus())?.refetch({cancelRefetch:!1}),this.#a?.continue()}onOnline(){this.observers.find(e=>e.shouldFetchOnReconnect())?.refetch({cancelRefetch:!1}),this.#a?.continue()}addObserver(e){this.observers.includes(e)||(this.observers.push(e),this.clearGcTimeout(),this.#r.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.#a&&(this.#s||this.#c()?this.#a.cancel({revert:!0}):this.#a.cancelRetry()),this.scheduleGc()),this.#r.notify({type:`observerRemoved`,query:this,observer:e}))}getObserversCount(){return this.observers.length}#c(){return this.state.fetchStatus===`paused`&&this.state.status===`pending`}invalidate(){this.state.isInvalidated||this.#l({type:`invalidate`})}async fetch(e,t){if(this.state.fetchStatus!==`idle`&&this.#a?.status()!==`rejected`){if(this.state.data!==void 0&&t?.cancelRefetch)this.cancel({silent:!0});else if(this.#a)return this.#a.continueRetry(),this.#a.promise}if(e&&this.setOptions(e),!this.options.queryFn){let e=this.observers.find(e=>e.options.queryFn);e&&this.setOptions(e.options)}let n=new AbortController,r=e=>{Object.defineProperty(e,"signal",{enumerable:!0,get:()=>(this.#s=!0,n.signal)})},i=()=>{let e=ql(this.options,t),n=(()=>{let e={client:this.#i,queryKey:this.queryKey,meta:this.meta};return r(e),e})();return this.#s=!1,this.options.persister?this.options.persister(e,n,this):e(n)},a=(()=>{let e={fetchOptions:t,options:this.options,queryKey:this.queryKey,client:this.#i,state:this.state,fetchFn:i};return r(e),e})();(this.#e===`infinite`?ou(this.options.pages):this.options.behavior)?.onFetch(a,this),this.#n=this.state,(this.state.fetchStatus===`idle`||this.state.fetchMeta!==a.fetchOptions?.meta)&&this.#l({type:`fetch`,meta:a.fetchOptions?.meta}),this.#a=iu({initialPromise:t?.initialPromise,fn:a.fetchFn,onCancel:e=>{e instanceof ru&&e.revert&&this.setState({...this.#n,fetchStatus:`idle`}),n.abort()},onFail:(e,t)=>{this.#l({type:`failed`,failureCount:e,error:t})},onPause:()=>{this.#l({type:`pause`})},onContinue:()=>{this.#l({type:`continue`})},retry:a.options.retry,retryDelay:a.options.retryDelay,networkMode:a.options.networkMode,canRun:()=>!0});try{let e=await this.#a.start();if(e===void 0)throw Error(`${this.queryHash} data is undefined`);return this.setData(e),this.#r.config.onSuccess?.(e,this),this.#r.config.onSettled?.(e,this.state.error,this),e}catch(e){if(e instanceof ru){if(e.silent)return this.#a.promise;if(e.revert){if(this.state.data===void 0)throw e;return this.state.data}}throw this.#l({type:`error`,error:e}),this.#r.config.onError?.(e,this),this.#r.config.onSettled?.(this.state.data,e,this),e}finally{this.scheduleGc()}}#l(e){let t=t=>{switch(e.type){case`failed`:return{...t,fetchFailureCount:e.failureCount,fetchFailureReason:e.error};case`pause`:return{...t,fetchStatus:`paused`};case`continue`:return{...t,fetchStatus:`fetching`};case`fetch`:return{...t,...uu(t.data,this.options),fetchMeta:e.meta??null};case`success`:let n={...t,...du(e.data,e.dataUpdatedAt),dataUpdateCount:t.dataUpdateCount+1,...!e.manual&&{fetchStatus:`idle`,fetchFailureCount:0,fetchFailureReason:null}};return this.#n=e.manual?n:void 0,n;case`error`:let r=e.error;return{...t,error:r,errorUpdateCount:t.errorUpdateCount+1,errorUpdatedAt:Date.now(),fetchFailureCount:t.fetchFailureCount+1,fetchFailureReason:r,fetchStatus:`idle`,status:`error`,isInvalidated:!0};case`invalidate`:return{...t,isInvalidated:!0};case`setState`:return{...t,...e.state}}};this.state=t(this.state),$l.batch(()=>{this.observers.forEach(e=>{e.onQueryUpdate()}),this.#r.notify({query:this,type:`updated`,action:e})})}};function uu(e,t){return{fetchFailureCount:0,fetchFailureReason:null,fetchStatus:nu(t.networkMode)?`fetching`:`paused`,...e===void 0&&{error:null,status:`pending`}}}function du(e,t){return{data:e,dataUpdatedAt:t??Date.now(),error:null,isInvalidated:!1,status:`success`}}function fu(e){let 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`}}var pu=class extends au{#e;#t;#n;#r;constructor(e){super(),this.#e=e.client,this.mutationId=e.mutationId,this.#n=e.mutationCache,this.#t=[],this.state=e.state||mu(),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.#t.includes(e)||(this.#t.push(e),this.clearGcTimeout(),this.#n.notify({type:`observerAdded`,mutation:this,observer:e}))}removeObserver(e){this.#t=this.#t.filter(t=>t!==e),this.scheduleGc(),this.#n.notify({type:`observerRemoved`,mutation:this,observer:e})}optionalRemove(){this.#t.length||(this.state.status===`pending`?this.scheduleGc():this.#n.remove(this))}continue(){return this.#r?.continue()??this.execute(this.state.variables)}async execute(e){let t=()=>{this.#i({type:`continue`})},n={client:this.#e,meta:this.options.meta,mutationKey:this.options.mutationKey};this.#r=iu({fn:()=>this.options.mutationFn?this.options.mutationFn(e,n):Promise.reject(Error(`No mutationFn found`)),onFail:(e,t)=>{this.#i({type:`failed`,failureCount:e,error:t})},onPause:()=>{this.#i({type:`pause`})},onContinue:t,retry:this.options.retry??0,retryDelay:this.options.retryDelay,networkMode:this.options.networkMode,canRun:()=>this.#n.canRun(this)});let r=this.state.status===`pending`,i=!this.#r.canStart();try{if(r)t();else{this.#i({type:`pending`,variables:e,isPaused:i}),this.#n.config.onMutate&&await this.#n.config.onMutate(e,this,n);let t=await this.options.onMutate?.(e,n);t!==this.state.context&&this.#i({type:`pending`,context:t,variables:e,isPaused:i})}let a=await this.#r.start();return await this.#n.config.onSuccess?.(a,e,this.state.context,this,n),await this.options.onSuccess?.(a,e,this.state.context,n),await this.#n.config.onSettled?.(a,null,this.state.variables,this.state.context,this,n),await this.options.onSettled?.(a,null,e,this.state.context,n),this.#i({type:`success`,data:a}),a}catch(t){try{await this.#n.config.onError?.(t,e,this.state.context,this,n)}catch(e){Promise.reject(e)}try{await this.options.onError?.(t,e,this.state.context,n)}catch(e){Promise.reject(e)}try{await this.#n.config.onSettled?.(void 0,t,this.state.variables,this.state.context,this,n)}catch(e){Promise.reject(e)}try{await this.options.onSettled?.(void 0,t,e,this.state.context,n)}catch(e){Promise.reject(e)}throw this.#i({type:`error`,error:t}),t}finally{this.#n.runNext(this)}}#i(e){let t=t=>{switch(e.type){case`failed`:return{...t,failureCount:e.failureCount,failureReason:e.error};case`pause`:return{...t,isPaused:!0};case`continue`:return{...t,isPaused:!1};case`pending`:return{...t,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{...t,data:e.data,failureCount:0,failureReason:null,error:null,status:`success`,isPaused:!1};case`error`:return{...t,data:void 0,error:e.error,failureCount:t.failureCount+1,failureReason:e.error,isPaused:!1,status:`error`}}};this.state=t(this.state),$l.batch(()=>{this.#t.forEach(t=>{t.onMutationUpdate(e)}),this.#n.notify({mutation:this,type:`updated`,action:e})})}};function mu(){return{context:void 0,data:void 0,error:null,failureCount:0,failureReason:null,isPaused:!1,status:`idle`,variables:void 0,submittedAt:0}}var hu=class extends bl{constructor(e={}){super(),this.config=e,this.#e=new Set,this.#t=new Map,this.#n=0}#e;#t;#n;build(e,t,n){let r=new pu({client:e,mutationCache:this,mutationId:++this.#n,options:e.defaultMutationOptions(t),state:n});return this.add(r),r}add(e){this.#e.add(e);let t=gu(e);if(typeof t==`string`){let n=this.#t.get(t);n?n.push(e):this.#t.set(t,[e])}this.notify({type:`added`,mutation:e})}remove(e){if(this.#e.delete(e)){let t=gu(e);if(typeof t==`string`){let n=this.#t.get(t);if(n){if(n.length>1){let t=n.indexOf(e);t!==-1&&n.splice(t,1)}else n[0]===e&&this.#t.delete(t)}}}this.notify({type:`removed`,mutation:e})}canRun(e){let t=gu(e);if(typeof t==`string`){let n=this.#t.get(t)?.find(e=>e.state.status===`pending`);return!n||n===e}return!0}runNext(e){let t=gu(e);return typeof t==`string`?(this.#t.get(t)?.find(t=>t!==e&&t.state.isPaused))?.continue()??Promise.resolve():Promise.resolve()}clear(){$l.batch(()=>{this.#e.forEach(e=>{this.notify({type:`removed`,mutation:e})}),this.#e.clear(),this.#t.clear()})}getAll(){return Array.from(this.#e)}find(e){let t={exact:!0,...e};return this.getAll().find(e=>Nl(t,e))}findAll(e={}){return this.getAll().filter(t=>Nl(e,t))}notify(e){$l.batch(()=>{this.listeners.forEach(t=>{t(e)})})}resumePausedMutations(){let e=this.getAll().filter(e=>e.state.isPaused);return $l.batch(()=>Promise.all(e.map(e=>e.continue().catch(El))))}};function gu(e){return e.options.scope?.id}var _u=class extends bl{constructor(e={}){super(),this.config=e,this.#e=new Map}#e;build(e,t,n){let r=t.queryKey,i=t.queryHash??Pl(r,t),a=this.get(i);return a||(a=new lu({client:e,queryKey:r,queryHash:i,options:e.defaultQueryOptions(t),state:n,defaultOptions:e.getQueryDefaults(r)}),this.add(a)),a}add(e){this.#e.has(e.queryHash)||(this.#e.set(e.queryHash,e),this.notify({type:`added`,query:e}))}remove(e){let t=this.#e.get(e.queryHash);t&&(e.destroy(),t===e&&this.#e.delete(e.queryHash),this.notify({type:`removed`,query:e}))}clear(){$l.batch(()=>{this.getAll().forEach(e=>{this.remove(e)})})}get(e){return this.#e.get(e)}getAll(){return[...this.#e.values()]}find(e){let t={exact:!0,...e};return this.getAll().find(e=>Ml(t,e))}findAll(e={}){let t=this.getAll();return Object.keys(e).length>0?t.filter(t=>Ml(e,t)):t}notify(e){$l.batch(()=>{this.listeners.forEach(t=>{t(e)})})}onFocus(){$l.batch(()=>{this.getAll().forEach(e=>{e.onFocus()})})}onOnline(){$l.batch(()=>{this.getAll().forEach(e=>{e.onOnline()})})}},vu=class{#e;#t;#n;#r;#i;#a;#o;#s;constructor(e={}){this.#e=e.queryCache||new _u,this.#t=e.mutationCache||new hu,this.#n=e.defaultOptions||{},this.#r=new Map,this.#i=new Map,this.#a=0}mount(){this.#a++,this.#a===1&&(this.#o=xl.subscribe(async e=>{e&&(await this.resumePausedMutations(),this.#e.onFocus())}),this.#s=eu.subscribe(async e=>{e&&(await this.resumePausedMutations(),this.#e.onOnline())}))}unmount(){this.#a--,this.#a===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.#t.findAll({...e,status:`pending`}).length}getQueryData(e){let t=this.defaultQueryOptions({queryKey:e});return this.#e.get(t.queryHash)?.state.data}ensureQueryData(e){let 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(Al(t.staleTime,n))&&this.prefetchQuery(t),Promise.resolve(r))}getQueriesData(e){return this.#e.findAll(e).map(({queryKey:e,state:t})=>[e,t.data])}setQueryData(e,t,n){let r=this.defaultQueryOptions({queryKey:e}),i=this.#e.get(r.queryHash)?.state.data,a=Dl(t,i);if(a!==void 0)return this.#e.build(this,r).setData(a,{...n,manual:!0})}setQueriesData(e,t,n){return $l.batch(()=>this.#e.findAll(e).map(({queryKey:e})=>[e,this.setQueryData(e,t,n)]))}getQueryState(e){let t=this.defaultQueryOptions({queryKey:e});return this.#e.get(t.queryHash)?.state}removeQueries(e){let t=this.#e;$l.batch(()=>{t.findAll(e).forEach(e=>{t.remove(e)})})}resetQueries(e,t){let n=this.#e;return $l.batch(()=>(n.findAll(e).forEach(e=>{e.reset()}),this.refetchQueries({type:`active`,...e},t)))}cancelQueries(e,t={}){let n={revert:!0,...t},r=$l.batch(()=>this.#e.findAll(e).map(e=>e.cancel(n)));return Promise.all(r).then(El).catch(El)}invalidateQueries(e,t={}){return $l.batch(()=>(this.#e.findAll(e).forEach(e=>{e.invalidate()}),e?.refetchType===`none`?Promise.resolve():this.refetchQueries({...e,type:e?.refetchType??e?.type??`active`},t)))}refetchQueries(e,t={}){let n={...t,cancelRefetch:t.cancelRefetch??!0},r=$l.batch(()=>this.#e.findAll(e).filter(e=>!e.isDisabled()&&!e.isStatic()).map(e=>{let t=e.fetch(void 0,n);return n.throwOnError||(t=t.catch(El)),e.state.fetchStatus===`paused`?Promise.resolve():t}));return Promise.all(r).then(El)}fetchQuery(e){let t=this.defaultQueryOptions(e);t.retry===void 0&&(t.retry=!1);let n=this.#e.build(this,t);return n.isStaleByTime(Al(t.staleTime,n))?n.fetch(t):Promise.resolve(n.state.data)}prefetchQuery(e){return this.fetchQuery(e).then(El).catch(El)}fetchInfiniteQuery(e){return e._type=`infinite`,this.fetchQuery(e)}prefetchInfiniteQuery(e){return this.fetchInfiniteQuery(e).then(El).catch(El)}ensureInfiniteQueryData(e){return e._type=`infinite`,this.ensureQueryData(e)}resumePausedMutations(){return eu.isOnline()?this.#t.resumePausedMutations():Promise.resolve()}getQueryCache(){return this.#e}getMutationCache(){return this.#t}getDefaultOptions(){return this.#n}setDefaultOptions(e){this.#n=e}setQueryDefaults(e,t){this.#r.set(Fl(e),{queryKey:e,defaultOptions:t})}getQueryDefaults(e){let t=[...this.#r.values()],n={};return t.forEach(t=>{Il(e,t.queryKey)&&Object.assign(n,t.defaultOptions)}),n}setMutationDefaults(e,t){this.#i.set(Fl(e),{mutationKey:e,defaultOptions:t})}getMutationDefaults(e){let t=[...this.#i.values()],n={};return t.forEach(t=>{Il(e,t.mutationKey)&&Object.assign(n,t.defaultOptions)}),n}defaultQueryOptions(e){if(e._defaulted)return e;let t={...this.#n.queries,...this.getQueryDefaults(e.queryKey),...e,_defaulted:!0};return t.queryHash||=Pl(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===Kl&&(t.enabled=!1),t}defaultMutationOptions(e){return e?._defaulted?e:{...this.#n.mutations,...e?.mutationKey&&this.getMutationDefaults(e.mutationKey),...e,_defaulted:!0}}clear(){this.#e.clear(),this.#t.clear()}},yu=_.createContext(void 0),bu=({client:e,children:t})=>(_.useEffect(()=>(e.mount(),()=>{e.unmount()}),[e]),(0,I.jsx)(yu.Provider,{value:e,children:t})),xu=`modulepreload`,Su=function(e){return`/`+e},Cu={},wu=function(e){return e.pathname.endsWith(`.css`)},Tu=function(e,t,n){if(t in e)return e[t];let r=n();if(!r){e[t]=void 0;return}let i=r.then(()=>{e[t]=void 0},n=>{throw e[t]=void 0,n});return e[t]=i,i},Eu=function(e,t,n){let r=Promise.resolve();if(t&&t.length>0){let e,i=document.querySelector(`meta[property=csp-nonce]`),a=i?.nonce||i?.getAttribute(`nonce`);function o(e){return Promise.all(e.map(e=>Promise.resolve(e).then(e=>({status:`fulfilled`,value:e}),e=>({status:`rejected`,reason:e}))))}function s(e){return import.meta.resolve?new URL(import.meta.resolve(e)):new URL(e,import.meta.url)}r=o(t.map(t=>{t=Su(t,n);let r=s(t),i=wu(r);return Tu(Cu,r.href,()=>{if(e===void 0){e={all:new Set,styles:new Set};let t=document.getElementsByTagName(`link`);for(let n=t.length-1;n>=0;n--){let r=t[n];e.all.add(r.href),r.rel===`stylesheet`&&e.styles.add(r.href)}}if((i?e.styles:e.all).has(r.href))return;let t=document.createElement(`link`);if(t.rel=i?`stylesheet`:xu,i||(t.as=`script`),t.crossOrigin=``,t.href=r.href,a&&t.setAttribute(`nonce`,a),document.head.appendChild(t),i)return new Promise((e,n)=>{t.addEventListener(`load`,e),t.addEventListener(`error`,()=>n(Error(`Unable to preload CSS for ${r}`)))})})}).filter(e=>e!==void 0))}function i(e){let t=new Event(`vite:preloadError`,{cancelable:!0});if(t.payload=e,window.dispatchEvent(t),!t.defaultPrevented)throw e}return r.then(t=>{for(let e of t||[])e.status===`rejected`&&i(e.reason);return e().catch(i)})},Du=/^(?:[a-z][a-z0-9+.-]*:|[\\/]{2})/i,Ou=/^[\\/]{2}/;function ku(e,t){return t+e.replace(/\\/g,`/`)}var Au=`popstate`;function ju(e){return typeof e==`object`&&!!e&&`pathname`in e&&`search`in e&&`hash`in e&&`state`in e&&`key`in e}function Mu(e={}){function t(e,t){let n=t.state?.masked,{pathname:r,search:i,hash:a}=n||e.location;return Iu(``,{pathname:r,search:i,hash:a},t.state&&t.state.usr||null,t.state&&t.state.key||`default`,n?{pathname:e.location.pathname,search:e.location.search,hash:e.location.hash}:void 0)}function n(e,t){return typeof t==`string`?t:Lu(t)}return zu(t,n,null,e)}function Nu(e,t){if(e===!1||e==null)throw Error(t)}function Pu(e,t){if(!e){typeof console<`u`&&console.warn(t);try{throw Error(t)}catch{}}}function eee(){return Math.random().toString(36).substring(2,10)}function Fu(e,t){return{usr:e.state,key:e.key,idx:t,masked:e.mask?{pathname:e.pathname,search:e.search,hash:e.hash}:void 0}}function Iu(e,t,n=null,r,i){return{pathname:typeof e==`string`?e:e.pathname,search:``,hash:``,...typeof t==`string`?Ru(t):t,state:n,key:t&&t.key||r||eee(),mask:i}}function Lu({pathname:e=`/`,search:t=``,hash:n=``}){return t&&t!==`?`&&(e+=t.charAt(0)===`?`?t:`?`+t),n&&n!==`#`&&(e+=n.charAt(0)===`#`?n:`#`+n),e}function Ru(e){let t={};if(e){let n=e.indexOf(`#`);n>=0&&(t.hash=e.substring(n),e=e.substring(0,n));let r=e.indexOf(`?`);r>=0&&(t.search=e.substring(r),e=e.substring(0,r)),e&&(t.pathname=e)}return t}function zu(e,t,n,r={}){let{window:i=document.defaultView,v5Compat:a=!1}=r,o=i.history,s=`POP`,c=null,l=u();l??(l=0,o.replaceState({...o.state,idx:l},``));function u(){return(o.state||{idx:null}).idx}function d(){s=`POP`;let e=u(),t=e==null?null:e-l;l=e,c&&c({action:s,location:h.location,delta:t})}function f(e,t){s=`PUSH`;let r=ju(e)?e:Iu(h.location,e,t);n&&n(r,e),l=u()+1;let d=Fu(r,l),f=h.createHref(r.mask||r);try{o.pushState(d,``,f)}catch(e){if(e instanceof DOMException&&e.name===`DataCloneError`)throw e;i.location.assign(f)}a&&c&&c({action:s,location:h.location,delta:1})}function p(e,t){s=`REPLACE`;let r=ju(e)?e:Iu(h.location,e,t);n&&n(r,e),l=u();let i=Fu(r,l),d=h.createHref(r.mask||r);o.replaceState(i,``,d),a&&c&&c({action:s,location:h.location,delta:0})}function m(e){return Bu(i,e)}let h={get action(){return s},get location(){return e(i,o)},listen(e){if(c)throw Error(`A history only accepts one active listener`);return i.addEventListener(Au,d),c=e,()=>{i.removeEventListener(Au,d),c=null}},createHref(e){return t(i,e)},createURL:m,encodeLocation(e){let t=m(e);return{pathname:t.pathname,search:t.search,hash:t.hash}},push:f,replace:p,go(e){return o.go(e)}};return h}function Bu(e,t,n=!1){let r=`http://localhost`;e&&(r=e.location.origin===`null`?e.location.href:e.location.origin),Nu(r,`No window.location.(origin|href) available to create URL`);let i=typeof t==`string`?t:Lu(t);return i=i.replace(/ $/,`%20`),!n&&Ou.test(i)&&(i=r+i),new URL(i,r)}function Vu(e,t,n=`/`){return Hu(e,t,n,!1)}function Hu(e,t,n,r,i){let a=od((typeof t==`string`?Ru(t):t).pathname||`/`,n);if(a==null)return null;let o=i??Uu(e),s=null,c=ad(a);for(let e=0;s==null&&e<o.length;++e)s=td(o[e],c,r);return s}function Uu(e){let t=Wu(e);return Ku(t),t}function Wu(e,t=[],n=[],r=``,i=!1){let a=(e,a,o=i,s)=>{let c={relativePath:s===void 0?e.path||``:s,caseSensitive:e.caseSensitive===!0,childrenIndex:a,route:e};if(c.relativePath.startsWith(`/`)){if(!c.relativePath.startsWith(r)&&o)return;Nu(c.relativePath.startsWith(r),`Absolute route path "${c.relativePath}" nested under path "${r}" is not valid. An absolute child route path must start with the combined path of all its parent routes.`),c.relativePath=c.relativePath.slice(r.length)}let l=md([r,c.relativePath]),u=n.concat(c);e.children&&e.children.length>0&&(Nu(e.index!==!0,`Index routes must not have child routes. Please remove all child routes from route path "${l}".`),Wu(e.children,t,u,l,o)),(e.path!=null||e.index)&&t.push({path:l,score:tee(l,e.index),routesMeta:u.map((e,t)=>{let[n,r]=id(e.relativePath,e.caseSensitive,t===u.length-1);return{...e,matcher:n,compiledParams:r}})})};return e.forEach((e,t)=>{if(e.path===``||!e.path?.includes(`?`))a(e,t);else for(let n of Gu(e.path))a(e,t,!0,n)}),t}function Gu(e){let t=e.split(`/`);if(t.length===0)return[];let[n,...r]=t,i=n.endsWith(`?`),a=n.replace(/\?$/,``);if(r.length===0)return i?[a,``]:[a];let o=Gu(r.join(`/`)),s=[];return s.push(...o.map(e=>e===``?a:[a,e].join(`/`))),i&&s.push(...o),s.map(t=>e.startsWith(`/`)&&t===``?`/`:t)}function Ku(e){e.sort((e,t)=>e.score===t.score?ed(e.routesMeta.map(e=>e.childrenIndex),t.routesMeta.map(e=>e.childrenIndex)):t.score-e.score)}var qu=/^:[\w-]+$/,Ju=3,Yu=2,Xu=1,Zu=10,Qu=-2,$u=e=>e===`*`;function tee(e,t){let n=e.split(`/`),r=n.length;return n.some($u)&&(r+=Qu),t&&(r+=Yu),n.filter(e=>!$u(e)).reduce((e,t)=>e+(qu.test(t)?Ju:t===``?Xu:Zu),r)}function ed(e,t){return e.length===t.length&&e.slice(0,-1).every((e,n)=>e===t[n])?e[e.length-1]-t[t.length-1]:0}function td(e,t,n=!1){let{routesMeta:r}=e,i={},a=`/`,o=[];for(let e=0;e<r.length;++e){let s=r[e],c=e===r.length-1,l=a===`/`?t:t.slice(a.length)||`/`,u={path:s.relativePath,caseSensitive:s.caseSensitive,end:c},d=s.matcher&&s.compiledParams?rd(u,l,s.matcher,s.compiledParams):nd(u,l),f=s.route;if(!d&&c&&n&&!r[r.length-1].route.index&&(d=nd({path:s.relativePath,caseSensitive:s.caseSensitive,end:!1},l)),!d)return null;Object.assign(i,d.params),o.push({params:i,pathname:md([a,d.pathname]),pathnameBase:gd(md([a,d.pathnameBase])),route:f}),d.pathnameBase!==`/`&&(a=md([a,d.pathnameBase]))}return o}function nd(e,t){typeof e==`string`&&(e={path:e,caseSensitive:!1,end:!0});let[n,r]=id(e.path,e.caseSensitive,e.end);return rd(e,t,n,r)}function rd(e,t,n,r){let i=t.match(n);if(!i)return null;let a=i[0],o=a.replace(/(.)\/+$/,`$1`),s=i.slice(1);return{params:r.reduce((e,{paramName:t,isOptional:n},r)=>{if(t===`*`){let e=s[r]||``;o=a.slice(0,a.length-e.length).replace(/(.)\/+$/,`$1`)}let i=s[r];return e[t]=n&&!i?void 0:(i||``).replace(/%2F/g,`/`),e},{}),pathname:a,pathnameBase:o,pattern:e}}function id(e,t=!1,n=!0){Pu(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=[],i=`^`+e.replace(/\/*\*?$/,``).replace(/^\/*/,`/`).replace(/[\\.*+^${}|()[\]]/g,`\\$&`).replace(/\/:([\w-]+)(\?)?/g,(e,t,n,i,a)=>{if(r.push({paramName:t,isOptional:n!=null}),n){let t=a.charAt(i+e.length);return t&&t!==`/`?`/([^\\/]*)`:`(?:/([^\\/]*))?`}return`/([^\\/]+)`}).replace(/\/([\w-]+)\?(\/|$)/g,`(/$1)?$2`);return e.endsWith(`*`)?(r.push({paramName:`*`}),i+=e===`*`||e===`/*`?`(.*)$`:`(?:\\/(.+)|\\/*)$`):n?i+=`\\/*$`:e!==``&&e!==`/`&&(i+=`(?:(?=\\/|$))`),[new RegExp(i,t?void 0:`i`),r]}function ad(e){try{return e.split(`/`).map(e=>decodeURIComponent(e).replace(/\//g,`%2F`)).join(`/`)}catch(t){return Pu(!1,`The URL path "${e}" could not be decoded because it is a malformed URL segment. This is probably due to a bad percent encoding (${t}).`),e}}function od(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)||`/`}function sd(e,t=`/`){let{pathname:n,search:r=``,hash:i=``}=typeof e==`string`?Ru(e):e,a;return n?(n=pd(n),a=n.startsWith(`/`)?cd(n.substring(1),`/`):cd(n,t)):a=t,{pathname:a,search:_d(r),hash:vd(i)}}function cd(e,t){let n=hd(t).split(`/`);return e.split(`/`).forEach(e=>{e===`..`?n.length>1&&n.pop():e!==`.`&&n.push(e)}),n.length>1?n.join(`/`):`/`}function ld(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 ud(e){return e.filter((e,t)=>t===0||e.route.path&&e.route.path.length>0)}function dd(e){let t=ud(e);return t.map((e,n)=>n===t.length-1?e.pathname:e.pathnameBase)}function fd(e,t,n,r=!1){let i;typeof e==`string`?i=Ru(e):(i={...e},Nu(!i.pathname||!i.pathname.includes(`?`),ld(`?`,`pathname`,`search`,i)),Nu(!i.pathname||!i.pathname.includes(`#`),ld(`#`,`pathname`,`hash`,i)),Nu(!i.search||!i.search.includes(`#`),ld(`#`,`search`,`hash`,i)));let a=e===``||i.pathname===``,o=a?`/`:i.pathname,s;if(o==null)s=n;else{let e=t.length-1;if(!r&&o.startsWith(`..`)){let t=o.split(`/`);for(;t[0]===`..`;)t.shift(),--e;i.pathname=t.join(`/`)}s=e>=0?t[e]:`/`}let c=sd(i,s),l=o&&o!==`/`&&o.endsWith(`/`),u=(a||o===`.`)&&n.endsWith(`/`);return!c.pathname.endsWith(`/`)&&(l||u)&&(c.pathname+=`/`),c}var pd=e=>e.replace(/[\\/]{2,}/g,`/`),md=e=>pd(e.join(`/`)),hd=e=>e.replace(/\/+$/,``),gd=e=>hd(e).replace(/^\/*/,`/`),_d=e=>!e||e===`?`?``:e.startsWith(`?`)?e:`?`+e,vd=e=>!e||e===`#`?``:e.startsWith(`#`)?e:`#`+e,yd=class{constructor(e,t,n,r=!1){this.status=e,this.statusText=t||``,this.internal=r,n instanceof Error?(this.data=n.toString(),this.error=n):this.data=n}};function nee(e){return e!=null&&typeof e.status==`number`&&typeof e.statusText==`string`&&typeof e.internal==`boolean`&&`data`in e}function ree(e){return md(e.map(e=>e.route.path).filter(Boolean))||`/`}var bd=typeof window<`u`&&window.document!==void 0&&window.document.createElement!==void 0;function xd(e,t){let n=e;if(typeof n!=`string`||!Du.test(n))return{absoluteURL:void 0,isExternal:!1,to:n};let r=n,i=!1;if(bd)try{let e=new URL(window.location.href),r=Ou.test(n)?new URL(ku(n,e.protocol)):new URL(n),a=od(r.pathname,t);r.origin===e.origin&&a!=null?n=a+r.search+r.hash:i=!0}catch{Pu(!1,`<Link to="${n}"> contains an invalid URL which will probably break when clicked - please update to a valid URL path.`)}return{absoluteURL:r,isExternal:i,to:n}}Object.getOwnPropertyNames(Object.prototype).sort().join(`\0`);var Sd=[`POST`,`PUT`,`PATCH`,`DELETE`];new Set(Sd);var Cd=[`GET`,...Sd];new Set(Cd);var wd=[`about:`,`blob:`,`chrome:`,`chrome-untrusted:`,`content:`,`data:`,`devtools:`,`file:`,`filesystem:`,`javascript:`];function Td(e){try{return wd.includes(new URL(e).protocol)}catch{return!1}}var Ed=_.createContext(null);Ed.displayName=`DataRouter`;var Dd=_.createContext(null);Dd.displayName=`DataRouterState`;var Od=_.createContext(!1);function kd(){return _.useContext(Od)}var Ad=_.createContext({isTransitioning:!1});Ad.displayName=`ViewTransition`;var jd=_.createContext(new Map);jd.displayName=`Fetchers`;var Md=_.createContext(null);Md.displayName=`Await`;var Nd=_.createContext(null);Nd.displayName=`Navigation`;var Pd=_.createContext(null);Pd.displayName=`Location`;var Fd=_.createContext({outlet:null,matches:[],isDataRoute:!1});Fd.displayName=`Route`;var Id=_.createContext(null);Id.displayName=`RouteError`;var Ld=`REACT_ROUTER_ERROR`,Rd=`REDIRECT`,zd=`ROUTE_ERROR_RESPONSE`;function Bd(e){if(e.startsWith(`${Ld}:${Rd}:{`))try{let t=JSON.parse(e.slice(28));if(typeof t==`object`&&t&&typeof t.status==`number`&&typeof t.statusText==`string`&&typeof t.location==`string`&&typeof t.reloadDocument==`boolean`&&typeof t.replace==`boolean`)return t}catch{}}function Vd(e){if(e.startsWith(`${Ld}:${zd}:{`))try{let t=JSON.parse(e.slice(40));if(typeof t==`object`&&t&&typeof t.status==`number`&&typeof t.statusText==`string`)return new yd(t.status,t.statusText,t.data)}catch{}}function Hd(e,{relative:t}={}){Nu(Ud(),`useHref() may be used only in the context of a <Router> component.`);let{basename:n,navigator:r}=_.useContext(Nd),{hash:i,pathname:a,search:o}=Qd(e,{relative:t}),s=a;return n!==`/`&&(s=a===`/`?n:md([n,a])),r.createHref({pathname:s,search:o,hash:i})}function Ud(){return _.useContext(Pd)!=null}function Wd(){return Nu(Ud(),`useLocation() may be used only in the context of a <Router> component.`),_.useContext(Pd).location}var Gd=`You should call navigate() in a React.useEffect(), not when your component is first rendered.`;function Kd(e){_.useContext(Nd).static||_.useLayoutEffect(e)}function qd(){let{isDataRoute:e}=_.useContext(Fd);return e?dee():Jd()}function Jd(){Nu(Ud(),`useNavigate() may be used only in the context of a <Router> component.`);let e=_.useContext(Ed),{basename:t,navigator:n}=_.useContext(Nd),{matches:r}=_.useContext(Fd),{pathname:i}=Wd(),a=JSON.stringify(dd(r)),o=_.useRef(!1);return Kd(()=>{o.current=!0}),_.useCallback((r,s={})=>{if(Pu(o.current,Gd),!o.current)return;if(typeof r==`number`){n.go(r);return}let c=fd(r,JSON.parse(a),i,s.relative===`path`);e==null&&t!==`/`&&(c.pathname=c.pathname===`/`?t:md([t,c.pathname])),(s.replace?n.replace:n.push)(c,s.state,s)},[t,n,a,i,e])}var Yd=_.createContext(null);function Xd(e){let t=_.useContext(Fd).outlet;return _.useMemo(()=>t&&_.createElement(Yd.Provider,{value:e},t),[t,e])}function Zd(){let{matches:e}=_.useContext(Fd);return e[e.length-1]?.params??{}}function Qd(e,{relative:t}={}){let{matches:n}=_.useContext(Fd),{pathname:r}=Wd(),i=JSON.stringify(dd(n));return _.useMemo(()=>fd(e,JSON.parse(i),r,t===`path`),[e,i,r,t])}function $d(e,t){return ef(e,t)}function ef(e,t,n){Nu(Ud(),`useRoutes() may be used only in the context of a <Router> component.`);let{navigator:r}=_.useContext(Nd),{matches:i}=_.useContext(Fd),a=i[i.length-1],o=a?a.params:{},s=a?a.pathname:`/`,c=a?a.pathnameBase:`/`,l=a&&a.route;{let e=l&&l.path||``;uf(s,!l||e.endsWith(`*`)||e.endsWith(`*?`),`You rendered descendant <Routes> (or called \`useRoutes()\`) at "${s}" (under <Route path="${e}">) but the parent route path has no trailing "*". This means if you navigate deeper, the parent won't match anymore and therefore the child routes will never render.
|
|
10
|
-
|
|
11
|
-
Please change the parent <Route path="${e}"> to <Route path="${e===`/`?`*`:`${e}/*`}">.`)}let u=Wd(),d;if(t){let e=typeof t==`string`?Ru(t):t;Nu(c===`/`||e.pathname?.startsWith(c),`When overriding the location using \`<Routes location>\` or \`useRoutes(routes, location)\`, the location pathname must begin with the portion of the URL pathname that was matched by all parent routes. The current pathname base is "${c}" but pathname "${e.pathname}" was given in the \`location\` prop.`),d=e}else d=u;let f=d.pathname||`/`,p=f;if(c!==`/`){let e=c.replace(/^\//,``).split(`/`);p=`/`+f.replace(/^\//,``).split(`/`).slice(e.length).join(`/`)}let m=n&&n.state.matches.length?n.state.matches.map(e=>Object.assign(e,{route:n.manifest[e.route.id]||e.route})):Vu(e,{pathname:p});Pu(l||m!=null,`No routes matched location "${d.pathname}${d.search}${d.hash}" `),Pu(m==null||m[m.length-1].route.element!==void 0||m[m.length-1].route.Component!==void 0||m[m.length-1].route.lazy!==void 0,`Matched leaf route at location "${d.pathname}${d.search}${d.hash}" does not have an element or Component. This means it will render an <Outlet /> with a null value by default resulting in an "empty" page.`);let h=aee(m&&m.map(e=>Object.assign({},e,{params:Object.assign({},o,e.params),pathname:md([c,r.encodeLocation?r.encodeLocation(e.pathname.replace(/%/g,`%25`).replace(/\?/g,`%3F`).replace(/#/g,`%23`)).pathname:e.pathname]),pathnameBase:e.pathnameBase===`/`?c:md([c,r.encodeLocation?r.encodeLocation(e.pathnameBase.replace(/%/g,`%25`).replace(/\?/g,`%3F`).replace(/#/g,`%23`)).pathname:e.pathnameBase])})),i,n);return t&&h?_.createElement(Pd.Provider,{value:{location:{pathname:`/`,search:``,hash:``,state:null,key:`default`,mask:void 0,...d},navigationType:`POP`}},h):h}function tf(){let e=uee(),t=nee(e)?`${e.status} ${e.statusText}`:e instanceof Error?e.message:JSON.stringify(e),n=e instanceof Error?e.stack:null,r=`rgba(200,200,200, 0.5)`,i={padding:`0.5rem`,backgroundColor:r},a={padding:`2px 4px`,backgroundColor:r},o=null;return console.error(`Error handled by React Router default ErrorBoundary:`,e),o=_.createElement(_.Fragment,null,_.createElement(`p`,null,`💿 Hey developer 👋`),_.createElement(`p`,null,`You can provide a way better UX than this when your app throws errors by providing your own `,_.createElement(`code`,{style:a},`ErrorBoundary`),` or`,` `,_.createElement(`code`,{style:a},`errorElement`),` prop on your route.`)),_.createElement(_.Fragment,null,_.createElement(`h2`,null,`Unexpected Application Error!`),_.createElement(`h3`,{style:{fontStyle:`italic`}},t),n?_.createElement(`pre`,{style:i},n):null,o)}var nf=_.createElement(tf,null),rf=class extends _.Component{constructor(e){super(e),this.state={location:e.location,revalidation:e.revalidation,error:e.error}}static getDerivedStateFromError(e){return{error:e}}static getDerivedStateFromProps(e,t){return t.location!==e.location||t.revalidation!==`idle`&&e.revalidation===`idle`?{error:e.error,location:e.location,revalidation:e.revalidation}:{error:e.error===void 0?t.error:e.error,location:t.location,revalidation:e.revalidation||t.revalidation}}componentDidCatch(e,t){this.props.onError?this.props.onError(e,t):console.error(`React Router caught the following error during render`,e)}render(){let e=this.state.error;if(this.context&&typeof e==`object`&&e&&`digest`in e&&typeof e.digest==`string`){let t=Vd(e.digest);t&&(e=t)}let t=e===void 0?this.props.children:_.createElement(Fd.Provider,{value:this.props.routeContext},_.createElement(Id.Provider,{value:e,children:this.props.component}));return this.context?_.createElement(of,{error:e},t):t}};rf.contextType=Od;var af=new WeakMap;function of({children:e,error:t}){let{basename:n}=_.useContext(Nd);if(typeof t==`object`&&t&&`digest`in t&&typeof t.digest==`string`){let e=Bd(t.digest);if(e){let r=af.get(t);if(r)throw r;let i=xd(e.location,n),a=i.absoluteURL||i.to;if(Td(a))throw Error(`Invalid redirect location`);if(bd&&!af.get(t)){if(i.isExternal||e.reloadDocument)window.location.href=a;else{let n=Promise.resolve().then(()=>window.__reactRouterDataRouter.navigate(i.to,{replace:e.replace}));throw af.set(t,n),n}}return _.createElement(`meta`,{httpEquiv:`refresh`,content:`0;url=${a}`})}}return e}function iee({routeContext:e,match:t,children:n}){let r=_.useContext(Ed);return r&&r.static&&r.staticContext&&(t.route.errorElement||t.route.ErrorBoundary)&&(r.staticContext._deepestRenderedBoundaryId=t.route.id),_.createElement(Fd.Provider,{value:e},n)}function aee(e,t=[],n){let r=n?.state;if(e==null){if(!r)return null;if(r.errors)e=r.matches;else if(t.length===0&&!r.initialized&&r.matches.length>0)e=r.matches;else return null}let i=e,a=r?.errors;if(a!=null){let e=i.findIndex(e=>e.route.id&&a?.[e.route.id]!==void 0);Nu(e>=0,`Could not find a matching route for errors on route IDs: ${Object.keys(a).join(`,`)}`),i=i.slice(0,Math.min(i.length,e+1))}let o=!1,s=-1;if(n&&r){o=r.renderFallback;for(let e=0;e<i.length;e++){let t=i[e];if((t.route.HydrateFallback||t.route.hydrateFallbackElement)&&(s=e),t.route.id){let{loaderData:e,errors:a}=r,c=t.route.loader&&!e.hasOwnProperty(t.route.id)&&(!a||a[t.route.id]===void 0);if(t.route.lazy||c){n.isStatic&&(o=!0),i=s>=0?i.slice(0,s+1):[i[0]];break}}}}let c=n?.onError,l=r&&c?(e,t)=>{c(e,{location:r.location,params:r.matches?.[0]?.params??{},pattern:ree(r.matches),errorInfo:t})}:void 0;return i.reduceRight((e,n,c)=>{let u,d=!1,f=null,p=null;r&&(u=a&&n.route.id?a[n.route.id]:void 0,f=n.route.errorElement||nf,o&&(s<0&&c===0?(uf(`route-fallback`,!1,"No `HydrateFallback` element provided to render during initial hydration"),d=!0,p=null):s===c&&(d=!0,p=n.route.hydrateFallbackElement||null)));let m=t.concat(i.slice(0,c+1)),h=()=>{let t;return t=u?f:d?p:n.route.Component?_.createElement(n.route.Component,null):n.route.element?n.route.element:e,_.createElement(iee,{match:n,routeContext:{outlet:e,matches:m,isDataRoute:r!=null},children:t})};return r&&(n.route.ErrorBoundary||n.route.errorElement||c===0)?_.createElement(rf,{location:r.location,revalidation:r.revalidation,component:f,error:u,children:h(),routeContext:{outlet:null,matches:m,isDataRoute:!0},onError:l}):h()},null)}function sf(e){return`${e} must be used within a data router. See https://reactrouter.com/en/main/routers/picking-a-router.`}function oee(e){let t=_.useContext(Ed);return Nu(t,sf(e)),t}function see(e){let t=_.useContext(Dd);return Nu(t,sf(e)),t}function cee(e){let t=_.useContext(Fd);return Nu(t,sf(e)),t}function cf(e){let t=cee(e),n=t.matches[t.matches.length-1];return Nu(n.route.id,`${e} can only be used on routes that contain a unique "id"`),n.route.id}function lee(){return cf(`useRouteId`)}function uee(){let e=_.useContext(Id),t=see(`useRouteError`),n=cf(`useRouteError`);return e===void 0?t.errors?.[n]:e}function dee(){let{router:e}=oee(`useNavigate`),t=cf(`useNavigate`),n=_.useRef(!1);return Kd(()=>{n.current=!0}),_.useCallback(async(r,i={})=>{Pu(n.current,Gd),n.current&&(typeof r==`number`?await e.navigate(r):await e.navigate(r,{fromRouteId:t,...i}))},[e,t])}var lf={};function uf(e,t,n){!t&&!lf[e]&&(lf[e]=!0,Pu(!1,n))}_.memo(fee);function fee({routes:e,manifest:t,future:n,state:r,isStatic:i,onError:a}){return ef(e,void 0,{manifest:t,state:r,isStatic:i,onError:a,future:n})}function df({to:e,replace:t,state:n,relative:r}){Nu(Ud(),`<Navigate> may be used only in the context of a <Router> component.`);let{static:i}=_.useContext(Nd);Pu(!i,`<Navigate> must not be used on the initial render in a <StaticRouter>. This is a no-op, but you should modify your code so the <Navigate> is only ever rendered in response to some user interaction or state change.`);let{matches:a}=_.useContext(Fd),{pathname:o}=Wd(),s=qd(),c=fd(e,dd(a),o,r===`path`),l=JSON.stringify(c);return _.useEffect(()=>{s(JSON.parse(l),{replace:t,state:n,relative:r})},[s,l,r,t,n]),null}function ff(e){return Xd(e.context)}function pf(e){Nu(!1,`A <Route> is only ever to be used as the child of <Routes> element, never rendered directly. Please wrap your <Route> in a <Routes>.`)}function mf({basename:e=`/`,children:t=null,location:n,navigationType:r=`POP`,navigator:i,static:a=!1,useTransitions:o}){Nu(!Ud(),`You cannot render a <Router> inside another <Router>. You should never have more than one in your app.`);let s=e.replace(/^\/*/,`/`),c=_.useMemo(()=>({basename:s,navigator:i,static:a,useTransitions:o,future:{}}),[s,i,a,o]);typeof n==`string`&&(n=Ru(n));let{pathname:l=`/`,search:u=``,hash:d=``,state:f=null,key:p=`default`,mask:m}=n,h=_.useMemo(()=>{let e=od(l,s);return e==null?null:{location:{pathname:e,search:u,hash:d,state:f,key:p,mask:m},navigationType:r}},[s,l,u,d,f,p,r,m]);return Pu(h!=null,`<Router basename="${s}"> is not able to match the URL "${l}${u}${d}" because it does not start with the basename, so the <Router> won't render anything.`),h==null?null:_.createElement(Nd.Provider,{value:c},_.createElement(Pd.Provider,{children:t,value:h}))}function hf({children:e,location:t}){return $d(gf(e),t)}_.Component;function gf(e,t=[]){let n=[];return _.Children.forEach(e,(e,r)=>{if(!_.isValidElement(e))return;let i=[...t,r];if(e.type===_.Fragment){n.push.apply(n,gf(e.props.children,i));return}Nu(e.type===pf,`[${typeof e.type==`string`?e.type:e.type.name}] is not a <Route> component. All component children of <Routes> must be a <Route> or <React.Fragment>`),Nu(!e.props.index||!e.props.children,`An index route cannot have child routes.`);let a={id:e.props.id||i.join(`-`),caseSensitive:e.props.caseSensitive,element:e.props.element,Component:e.props.Component,index:e.props.index,path:e.props.path,middleware:e.props.middleware,loader:e.props.loader,action:e.props.action,hydrateFallbackElement:e.props.hydrateFallbackElement,HydrateFallback:e.props.HydrateFallback,errorElement:e.props.errorElement,ErrorBoundary:e.props.ErrorBoundary,hasErrorBoundary:e.props.hasErrorBoundary===!0||e.props.ErrorBoundary!=null||e.props.errorElement!=null,shouldRevalidate:e.props.shouldRevalidate,handle:e.props.handle,lazy:e.props.lazy};e.props.children&&(a.children=gf(e.props.children,i)),n.push(a)}),n}var _f=`get`,vf=`application/x-www-form-urlencoded`;function yf(e){return typeof HTMLElement<`u`&&e instanceof HTMLElement}function bf(e){return yf(e)&&e.tagName.toLowerCase()===`button`}function xf(e){return yf(e)&&e.tagName.toLowerCase()===`form`}function Sf(e){return yf(e)&&e.tagName.toLowerCase()===`input`}function Cf(e){return!!(e.metaKey||e.altKey||e.ctrlKey||e.shiftKey)}function wf(e,t){return e.button===0&&(!t||t===`_self`)&&!Cf(e)}function Tf(e=``){return 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(e=>[n,e]):[[n,r]])},[]))}function Ef(e,t){let n=Tf(e);return t&&t.forEach((e,r)=>{n.has(r)||t.getAll(r).forEach(e=>{n.append(r,e)})}),n}var Df=null;function Of(){if(Df===null)try{new FormData(document.createElement(`form`),0),Df=!1}catch{Df=!0}return Df}var kf=new Set([`application/x-www-form-urlencoded`,`multipart/form-data`,`text/plain`]);function Af(e){return e!=null&&!kf.has(e)?(Pu(!1,`"${e}" is not a valid \`encType\` for \`<Form>\`/\`<fetcher.Form>\` and will default to "${vf}"`),null):e}function jf(e,t){let n,r,i,a,o;if(xf(e)){let o=e.getAttribute(`action`);r=o?od(o,t):null,n=e.getAttribute(`method`)||_f,i=Af(e.getAttribute(`enctype`))||vf,a=new FormData(e)}else if(bf(e)||Sf(e)&&(e.type===`submit`||e.type===`image`)){let o=e.form;if(o==null)throw Error(`Cannot submit a <button> or <input type="submit"> without a <form>`);let s=e.getAttribute(`formaction`)||o.getAttribute(`action`);if(r=s?od(s,t):null,n=e.getAttribute(`formmethod`)||o.getAttribute(`method`)||_f,i=Af(e.getAttribute(`formenctype`))||Af(o.getAttribute(`enctype`))||vf,a=new FormData(o,e),!Of()){let{name:t,type:n,value:r}=e;if(n===`image`){let e=t?`${t}.`:``;a.append(`${e}x`,`0`),a.append(`${e}y`,`0`)}else t&&a.append(t,r)}}else if(yf(e))throw Error(`Cannot submit element that is not <form>, <button>, or <input type="submit|image">`);else n=_f,r=null,i=vf,o=e;return a&&i===`text/plain`&&(o=a,a=void 0),{action:r,method:n.toLowerCase(),encType:i,formData:a,body:o}}Object.getOwnPropertyNames(Object.prototype).sort().join(`\0`);function Mf(e,t){if(e===!1||e==null)throw Error(t)}function Nf(e,t,n,r){let i=typeof e==`string`?new URL(e,typeof window>`u`?`server://singlefetch/`:window.location.origin):e;return i.pathname=n?i.pathname.endsWith(`/`)?`${i.pathname}_.${r}`:`${i.pathname}.${r}`:i.pathname===`/`?`_root.${r}`:t&&od(i.pathname,t)===`/`?`${hd(t)}/_root.${r}`:`${hd(i.pathname)}.${r}`,i}async function Pf(e,t){if(e.id in t)return t[e.id];try{let n=await Eu(()=>import(e.module),[]);return t[e.id]=n,n}catch(t){return console.error(`Error loading route module \`${e.module}\`, reloading page...`),console.error(t),window.__reactRouterContext&&window.__reactRouterContext.isSpaMode,window.location.reload(),new Promise(()=>{})}}function Ff(e){return e!=null&&typeof e.page==`string`}function If(e){return e==null?!1:e.href==null?e.rel===`preload`&&typeof e.imageSrcSet==`string`&&typeof e.imageSizes==`string`:typeof e.rel==`string`&&typeof e.href==`string`}async function Lf(e,t,n){return Hf((await Promise.all(e.map(async e=>{let r=t.routes[e.route.id];if(r){let e=await Pf(r,n);return e.links?e.links():[]}return[]}))).flat(1).filter(If).filter(e=>e.rel===`stylesheet`||e.rel===`preload`).map(e=>e.rel===`stylesheet`?{...e,rel:`prefetch`,as:`style`}:{...e,rel:`prefetch`}))}function Rf(e,t,n,r,i,a){let o=(e,t)=>!n[t]||e.route.id!==n[t].route.id,s=(e,t)=>n[t].pathname!==e.pathname||n[t].route.path?.endsWith(`*`)&&n[t].params[`*`]!==e.params[`*`];return a===`assets`?t.filter((e,t)=>o(e,t)||s(e,t)):a===`data`?t.filter((t,a)=>{let c=r.routes[t.route.id];if(!c||!c.hasLoader)return!1;if(o(t,a)||s(t,a))return!0;if(t.route.shouldRevalidate){let r=t.route.shouldRevalidate({currentUrl:new URL(i.pathname+i.search+i.hash,window.origin),currentParams:n[0]?.params||{},nextUrl:new URL(e,window.origin),nextParams:t.params,defaultShouldRevalidate:!0});if(typeof r==`boolean`)return r}return!0}):[]}function zf(e,t,{includeHydrateFallback:n}={}){return Bf(e.map(e=>{let r=t.routes[e.route.id];if(!r)return[];let i=[r.module];return r.clientActionModule&&(i=i.concat(r.clientActionModule)),r.clientLoaderModule&&(i=i.concat(r.clientLoaderModule)),n&&r.hydrateFallbackModule&&(i=i.concat(r.hydrateFallbackModule)),r.imports&&(i=i.concat(r.imports)),i}).flat(1))}function Bf(e){return[...new Set(e)]}function Vf(e){let t={},n=Object.keys(e).sort();for(let r of n)t[r]=e[r];return t}function Hf(e,t){let n=new Set,r=new Set(t);return e.reduce((e,i)=>{if(t&&!Ff(i)&&i.as===`script`&&i.href&&r.has(i.href))return e;let a=JSON.stringify(Vf(i));return n.has(a)||(n.add(a),e.push({key:a,link:i})),e},[])}function Uf(){let e=_.useContext(Ed);return Mf(e,`You must render this element inside a <DataRouterContext.Provider> element`),e}function Wf(){let e=_.useContext(Dd);return Mf(e,`You must render this element inside a <DataRouterStateContext.Provider> element`),e}var Gf=_.createContext(void 0);Gf.displayName=`FrameworkContext`;function Kf(){let e=_.useContext(Gf);return Mf(e,`You must render this element inside a <HydratedRouter> element`),e}function qf(e,t){let n=_.useContext(Gf),[r,i]=_.useState(!1),[a,o]=_.useState(!1),{onFocus:s,onBlur:c,onMouseEnter:l,onMouseLeave:u,onTouchStart:d}=t,f=_.useRef(null);_.useEffect(()=>{if(e===`render`&&o(!0),e===`viewport`){let e=new IntersectionObserver(e=>{e.forEach(e=>{o(e.isIntersecting)})},{threshold:.5});return f.current&&e.observe(f.current),()=>{e.disconnect()}}},[e]),_.useEffect(()=>{if(r){let e=setTimeout(()=>{o(!0)},100);return()=>{clearTimeout(e)}}},[r]);let p=()=>{i(!0)},m=()=>{i(!1),o(!1)};return n?e===`intent`?[a,f,{onFocus:Jf(s,p),onBlur:Jf(c,m),onMouseEnter:Jf(l,p),onMouseLeave:Jf(u,m),onTouchStart:Jf(d,p)}]:[a,f,{}]:[!1,f,{}]}function Jf(e,t){return n=>{e&&e(n),n.defaultPrevented||t(n)}}function Yf({page:e,...t}){let n=kd(),{nonce:r}=Kf(),{router:i}=Uf(),a=_.useMemo(()=>Vu(i.routes,e,i.basename),[i.routes,e,i.basename]);return a?(t.nonce==null&&r&&(t={...t,nonce:r}),n?_.createElement(Zf,{page:e,matches:a,...t}):_.createElement(Qf,{page:e,matches:a,...t})):null}function Xf(e){let{manifest:t,routeModules:n}=Kf(),[r,i]=_.useState([]);return _.useEffect(()=>{let r=!1;return Lf(e,t,n).then(e=>{r||i(e)}),()=>{r=!0}},[e,t,n]),r}function Zf({page:e,matches:t,...n}){let r=Wd(),{future:i}=Kf(),{basename:a}=Uf(),o=_.useMemo(()=>{if(e===r.pathname+r.search+r.hash)return[];let n=Nf(e,a,i.v8_trailingSlashAwareDataRequests,`rsc`),o=!1,s=[];for(let e of t)typeof e.route.shouldRevalidate==`function`?o=!0:s.push(e.route.id);return o&&s.length>0&&n.searchParams.set(`_routes`,s.join(`,`)),[n.pathname+n.search]},[a,i.v8_trailingSlashAwareDataRequests,e,r,t]);return _.createElement(_.Fragment,null,o.map(e=>_.createElement(`link`,{key:e,rel:`prefetch`,as:`fetch`,href:e,...n})))}function Qf({page:e,matches:t,...n}){let r=Wd(),{future:i,manifest:a,routeModules:o}=Kf(),{basename:s}=Uf(),{loaderData:c,matches:l}=Wf(),u=_.useMemo(()=>Rf(e,t,l,a,r,`data`),[e,t,l,a,r]),d=_.useMemo(()=>Rf(e,t,l,a,r,`assets`),[e,t,l,a,r]),f=_.useMemo(()=>{if(e===r.pathname+r.search+r.hash)return[];let n=new Set,l=!1;if(t.forEach(e=>{let t=a.routes[e.route.id];t&&t.hasLoader&&(!u.some(t=>t.route.id===e.route.id)&&e.route.id in c&&o[e.route.id]?.shouldRevalidate||t.hasClientLoader?l=!0:n.add(e.route.id))}),n.size===0)return[];let d=Nf(e,s,i.v8_trailingSlashAwareDataRequests,`data`);return l&&n.size>0&&d.searchParams.set(`_routes`,t.filter(e=>n.has(e.route.id)).map(e=>e.route.id).join(`,`)),[d.pathname+d.search]},[s,i.v8_trailingSlashAwareDataRequests,c,r,a,u,t,e,o]),p=_.useMemo(()=>zf(d,a),[d,a]),m=Xf(d);return _.createElement(_.Fragment,null,f.map(e=>_.createElement(`link`,{key:e,rel:`prefetch`,as:`fetch`,href:e,...n})),p.map(e=>_.createElement(`link`,{key:e,rel:`modulepreload`,href:e,...n})),m.map(({key:e,link:t})=>_.createElement(`link`,{key:e,nonce:n.nonce,...t,crossOrigin:t.crossOrigin??n.crossOrigin})))}function $f(...e){return t=>{e.forEach(e=>{typeof e==`function`?e(t):e!=null&&(e.current=t)})}}_.Component;var ep=typeof window<`u`&&window.document!==void 0&&window.document.createElement!==void 0;try{ep&&(window.__reactRouterVersion=`7.18.2`)}catch{}function tp({basename:e,children:t,useTransitions:n,window:r}){let i=_.useRef();i.current??=Mu({window:r,v5Compat:!0});let a=i.current,[o,s]=_.useState({action:a.action,location:a.location}),c=_.useCallback(e=>{n===!1?s(e):_.startTransition(()=>s(e))},[n]);return _.useLayoutEffect(()=>a.listen(c),[a,c]),_.createElement(mf,{basename:e,children:t,location:o.location,navigationType:o.action,navigator:a,useTransitions:n})}var np=_.forwardRef(function({onClick:e,discover:t=`render`,prefetch:n=`none`,relative:r,reloadDocument:i,replace:a,mask:o,state:s,target:c,to:l,preventScrollReset:u,viewTransition:d,defaultShouldRevalidate:f,...p},m){let{basename:h,navigator:g,useTransitions:v}=_.useContext(Nd),y=typeof l==`string`&&Du.test(l),b=xd(l,h);l=b.to;let x=Hd(l,{relative:r}),S=Wd(),C=null;if(o){let e=fd(o,[],S.mask?S.mask.pathname:`/`,!0);h!==`/`&&(e.pathname=e.pathname===`/`?h:md([h,e.pathname])),C=g.createHref(e)}let[w,T,E]=qf(n,p),D=sp(l,{replace:a,mask:o,state:s,target:c,preventScrollReset:u,relative:r,viewTransition:d,defaultShouldRevalidate:f,useTransitions:v});function O(t){e&&e(t),t.defaultPrevented||D(t)}let k=!(b.isExternal||i),A=_.createElement(`a`,{...p,...E,href:(k?C:void 0)||b.absoluteURL||x,onClick:k?O:e,ref:$f(m,T),target:c,"data-discover":!y&&t===`render`?`true`:void 0});return w&&!y?_.createElement(_.Fragment,null,A,_.createElement(Yf,{page:x})):A});np.displayName=`Link`;var rp=_.forwardRef(function({"aria-current":e=`page`,caseSensitive:t=!1,className:n=``,end:r=!1,style:i,to:a,viewTransition:o,children:s,...c},l){let u=Qd(a,{relative:c.relative}),d=Wd(),f=_.useContext(Dd),{navigator:p,basename:m}=_.useContext(Nd),h=f!=null&&pp(u)&&o===!0,g=p.encodeLocation?p.encodeLocation(u).pathname:u.pathname,v=d.pathname,y=f&&f.navigation&&f.navigation.location?f.navigation.location.pathname:null;t||(v=v.toLowerCase(),y=y?y.toLowerCase():null,g=g.toLowerCase()),y&&m&&(y=od(y,m)||y);let b=g!==`/`&&g.endsWith(`/`)?g.length-1:g.length,x=v===g||!r&&v.startsWith(g)&&v.charAt(b)===`/`,S=y!=null&&(y===g||!r&&y.startsWith(g)&&y.charAt(g.length)===`/`),C={isActive:x,isPending:S,isTransitioning:h},w=x?e:void 0,T;T=typeof n==`function`?n(C):[n,x?`active`:null,S?`pending`:null,h?`transitioning`:null].filter(Boolean).join(` `);let E=typeof i==`function`?i(C):i;return _.createElement(np,{...c,"aria-current":w,className:T,ref:l,style:E,to:a,viewTransition:o},typeof s==`function`?s(C):s)});rp.displayName=`NavLink`;var ip=_.forwardRef(({discover:e=`render`,fetcherKey:t,navigate:n,reloadDocument:r,replace:i,state:a,method:o=_f,action:s,onSubmit:c,relative:l,preventScrollReset:u,viewTransition:d,defaultShouldRevalidate:f,...p},m)=>{let{useTransitions:h}=_.useContext(Nd),g=dp(),v=fp(s,{relative:l}),y=o.toLowerCase()===`get`?`get`:`post`,b=typeof s==`string`&&Du.test(s);return _.createElement(`form`,{ref:m,method:y,action:v,onSubmit:r?c:e=>{if(c&&c(e),e.defaultPrevented)return;e.preventDefault();let r=e.nativeEvent.submitter,s=r?.getAttribute(`formmethod`)||o,p=()=>g(r||e.currentTarget,{fetcherKey:t,method:s,navigate:n,replace:i,state:a,relative:l,preventScrollReset:u,viewTransition:d,defaultShouldRevalidate:f});h&&n!==!1?_.startTransition(()=>p()):p()},...p,"data-discover":!b&&e===`render`?`true`:void 0})});ip.displayName=`Form`;function ap(e){return`${e} must be used within a data router. See https://reactrouter.com/en/main/routers/picking-a-router.`}function op(e){let t=_.useContext(Ed);return Nu(t,ap(e)),t}function sp(e,{target:t,replace:n,mask:r,state:i,preventScrollReset:a,relative:o,viewTransition:s,defaultShouldRevalidate:c,useTransitions:l}={}){let u=qd(),d=Wd(),f=Qd(e,{relative:o});return _.useCallback(p=>{if(wf(p,t)){p.preventDefault();let t=n===void 0?Lu(d)===Lu(f):n,m=()=>u(e,{replace:t,mask:r,state:i,preventScrollReset:a,relative:o,viewTransition:s,defaultShouldRevalidate:c});l?_.startTransition(()=>m()):m()}},[d,u,f,n,r,i,t,e,a,o,s,c,l])}function cp(e){Pu(typeof URLSearchParams<`u`,"You cannot use the `useSearchParams` hook in a browser that does not support the URLSearchParams API. If you need to support Internet Explorer 11, we recommend you load a polyfill such as https://github.com/ungap/url-search-params.");let t=_.useRef(Tf(e)),n=_.useRef(!1),r=Wd(),i=_.useMemo(()=>Ef(r.search,n.current?null:t.current),[r.search]),a=qd();return[i,_.useCallback((e,t)=>{let r=Tf(typeof e==`function`?e(new URLSearchParams(i)):e);n.current=!0,a(`?`+r,t)},[a,i])]}var lp=0,up=()=>`__${String(++lp)}__`;function dp(){let{router:e}=op(`useSubmit`),{basename:t}=_.useContext(Nd),n=lee(),r=e.fetch,i=e.navigate;return _.useCallback(async(e,a={})=>{let{action:o,method:s,encType:c,formData:l,body:u}=jf(e,t);if(a.navigate===!1){let e=a.fetcherKey||up();await r(e,n,a.action||o,{defaultShouldRevalidate:a.defaultShouldRevalidate,preventScrollReset:a.preventScrollReset,formData:l,body:u,formMethod:a.method||s,formEncType:a.encType||c,flushSync:a.flushSync})}else await i(a.action||o,{defaultShouldRevalidate:a.defaultShouldRevalidate,preventScrollReset:a.preventScrollReset,formData:l,body:u,formMethod:a.method||s,formEncType:a.encType||c,replace:a.replace,state:a.state,fromRouteId:n,flushSync:a.flushSync,viewTransition:a.viewTransition})},[r,i,t,n])}function fp(e,{relative:t}={}){let{basename:n}=_.useContext(Nd),r=_.useContext(Fd);Nu(r,`useFormAction must be used inside a RouteContext`);let[i]=r.matches.slice(-1),a={...Qd(e||`.`,{relative:t})},o=Wd();if(e==null){a.search=o.search;let e=new URLSearchParams(a.search),t=e.getAll(`index`);if(t.some(e=>e===``)){e.delete(`index`),t.filter(e=>e).forEach(t=>e.append(`index`,t));let n=e.toString();a.search=n?`?${n}`:``}}return(!e||e===`.`)&&i.route.index&&(a.search=a.search?a.search.replace(/^\?/,`?index&`):`?index`),n!==`/`&&(a.pathname=a.pathname===`/`?n:md([n,a.pathname])),Lu(a)}function pp(e,{relative:t}={}){let n=_.useContext(Ad);Nu(n!=null,"`useViewTransitionState` must be used within `react-router-dom`'s `RouterProvider`. Did you accidentally import `RouterProvider` from `react-router`?");let{basename:r}=op(`useViewTransitionState`),i=Qd(e,{relative:t});if(!n.isTransitioning)return!1;let a=od(n.currentLocation.pathname,r)||n.currentLocation.pathname,o=od(n.nextLocation.pathname,r)||n.nextLocation.pathname;return nd(i.pathname,o)!=null||nd(i.pathname,a)!=null}var mp=Symbol.for(`react.lazy`),hp=_.use;function gp(e){return typeof e==`object`&&!!e&&`then`in e}function _p(e){return typeof e==`object`&&!!e&&`$$typeof`in e&&e.$$typeof===mp&&`_payload`in e&&gp(e._payload)}function vp(e){let t=bp(e),n=_.forwardRef((e,n)=>{let{children:r,...i}=e;_p(r)&&typeof hp==`function`&&(r=hp(r._payload));let a=_.Children.toArray(r),o=a.find(Sp);if(o){let e=o.props.children,r=a.map(t=>t===o?_.Children.count(e)>1?_.Children.only(null):_.isValidElement(e)?e.props.children:null:t);return(0,I.jsx)(t,{...i,ref:n,children:_.isValidElement(e)?_.cloneElement(e,void 0,r):null})}return(0,I.jsx)(t,{...i,ref:n,children:r})});return n.displayName=`${e}.Slot`,n}var yp=vp(`Slot`);function bp(e){let t=_.forwardRef((e,t)=>{let{children:n,...r}=e;if(_p(n)&&typeof hp==`function`&&(n=hp(n._payload)),_.isValidElement(n)){let e=wp(n),i=Cp(r,n.props);return n.type!==_.Fragment&&(i.ref=t?N(t,e):e),_.cloneElement(n,i)}return _.Children.count(n)>1?_.Children.only(null):null});return t.displayName=`${e}.SlotClone`,t}var xp=Symbol(`radix.slottable`);function Sp(e){return _.isValidElement(e)&&typeof e.type==`function`&&`__radixId`in e.type&&e.type.__radixId===xp}function Cp(e,t){let n={...t};for(let r in t){let i=e[r],a=t[r];/^on[A-Z]/.test(r)?i&&a?n[r]=(...e)=>{let t=a(...e);return i(...e),t}:i&&(n[r]=i):r===`style`?n[r]={...i,...a}:r===`className`&&(n[r]=[i,a].filter(Boolean).join(` `))}return{...e,...n}}function wp(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 Tp=768;function Ep(){let[e,t]=_.useState(void 0);return _.useEffect(()=>{let e=window.matchMedia(`(max-width: 767px)`),n=()=>{t(window.innerWidth<Tp)};return e.addEventListener(`change`,n),t(window.innerWidth<Tp),()=>e.removeEventListener(`change`,n)},[]),!!e}var Dp=Gt(`inline-flex items-center justify-center gap-2 whitespace-nowrap rounded-md text-sm font-medium ring-offset-background transition-colors focus-visible:outline-hidden 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`}}),W=_.forwardRef(({className:e,variant:t,size:n,asChild:r=!1,...i},a)=>(0,I.jsx)(r?yp:`button`,{className:U(Dp({variant:t,size:n,className:e})),ref:a,...i}));W.displayName=`Button`;var Op=_.forwardRef(({className:e,type:t,...n},r)=>(0,I.jsx)(`input`,{type:t,className:U(`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-hidden 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}));Op.displayName=`Input`;var kp=[`a`,`button`,`div`,`form`,`h2`,`h3`,`img`,`input`,`label`,`li`,`nav`,`ol`,`p`,`select`,`span`,`svg`,`ul`].reduce((e,t)=>{let n=vp(`Primitive.${t}`),r=_.forwardRef((e,r)=>{let{asChild:i,...a}=e,o=i?n:t;return typeof window<`u`&&(window[Symbol.for(`radix-ui`)]=!0),(0,I.jsx)(o,{...a,ref:r})});return r.displayName=`Primitive.${t}`,{...e,[t]:r}},{}),Ap=`Separator`,jp=`horizontal`,Mp=[`horizontal`,`vertical`],Np=_.forwardRef((e,t)=>{let{decorative:n,orientation:r=jp,...i}=e,a=Pp(r)?r:jp,o=n?{role:`none`}:{"aria-orientation":a===`vertical`?a:void 0,role:`separator`};return(0,I.jsx)(kp.div,{"data-orientation":a,...o,...i,ref:t})});Np.displayName=Ap;function Pp(e){return Mp.includes(e)}var Fp=Np,Ip=_.forwardRef(({className:e,orientation:t=`horizontal`,decorative:n=!0,...r},i)=>(0,I.jsx)(Fp,{ref:i,decorative:n,orientation:t,className:U(`shrink-0 bg-border`,t===`horizontal`?`h-px w-full`:`h-full w-px`,e),...r}));Ip.displayName=Fp.displayName;var Lp=`focusScope.autoFocusOnMount`,Rp=`focusScope.autoFocusOnUnmount`,zp={bubbles:!1,cancelable:!0},Bp=`FocusScope`,Vp=_.forwardRef((e,t)=>{let{loop:n=!1,trapped:r=!1,onMountAutoFocus:i,onUnmountAutoFocus:a,...o}=e,[s,c]=_.useState(null),l=pe(i),u=pe(a),d=_.useRef(null),f=P(t,e=>c(e)),p=_.useRef({paused:!1,pause(){this.paused=!0},resume(){this.paused=!1}}).current;_.useEffect(()=>{if(r){let e=function(e){if(p.paused||!s)return;let t=e.target;s.contains(t)?d.current=t:Kp(d.current,{select:!0})},t=function(e){if(p.paused||!s)return;let t=e.relatedTarget;t!==null&&(s.contains(t)||Kp(d.current,{select:!0}))},n=function(e){if(document.activeElement===document.body)for(let t of e)t.removedNodes.length>0&&Kp(s)};document.addEventListener(`focusin`,e),document.addEventListener(`focusout`,t);let r=new MutationObserver(n);return s&&r.observe(s,{childList:!0,subtree:!0}),()=>{document.removeEventListener(`focusin`,e),document.removeEventListener(`focusout`,t),r.disconnect()}}},[r,s,p.paused]),_.useEffect(()=>{if(s){qp.add(p);let e=document.activeElement;if(!s.contains(e)){let t=new CustomEvent(Lp,zp);s.addEventListener(Lp,l),s.dispatchEvent(t),t.defaultPrevented||(Hp(gee(Wp(s)),{select:!0}),document.activeElement===e&&Kp(s))}return()=>{s.removeEventListener(Lp,l),setTimeout(()=>{let t=new CustomEvent(Rp,zp);s.addEventListener(Rp,u),s.dispatchEvent(t),t.defaultPrevented||Kp(e??document.body,{select:!0}),s.removeEventListener(Rp,u),qp.remove(p)},0)}}},[s,l,u,p]);let m=_.useCallback(e=>{if(!n&&!r||p.paused)return;let t=e.key===`Tab`&&!e.altKey&&!e.ctrlKey&&!e.metaKey,i=document.activeElement;if(t&&i){let t=e.currentTarget,[r,a]=Up(t);r&&a?!e.shiftKey&&i===a?(e.preventDefault(),n&&Kp(r,{select:!0})):e.shiftKey&&i===r&&(e.preventDefault(),n&&Kp(a,{select:!0})):i===t&&e.preventDefault()}},[n,r,p.paused]);return(0,I.jsx)(V.div,{tabIndex:-1,...o,ref:f,onKeyDown:m})});Vp.displayName=Bp;function Hp(e,{select:t=!1}={}){let n=document.activeElement;for(let r of e)if(Kp(r,{select:t}),document.activeElement!==n)return}function Up(e){let t=Wp(e);return[Gp(t,e),Gp(t.reverse(),e)]}function Wp(e){let t=[],n=document.createTreeWalker(e,NodeFilter.SHOW_ELEMENT,{acceptNode:e=>{let t=e.tagName===`INPUT`&&e.type===`hidden`;return e.disabled||e.hidden||t?NodeFilter.FILTER_SKIP:e.tabIndex>=0?NodeFilter.FILTER_ACCEPT:NodeFilter.FILTER_SKIP}});for(;n.nextNode();)t.push(n.currentNode);return t}function Gp(e,t){for(let n of e)if(!pee(n,{upTo:t}))return n}function pee(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 mee(e){return e instanceof HTMLInputElement&&`select`in e}function Kp(e,{select:t=!1}={}){if(e&&e.focus){let n=document.activeElement;e.focus({preventScroll:!0}),e!==n&&mee(e)&&t&&e.select()}}var qp=hee();function hee(){let e=[];return{add(t){let n=e[0];t!==n&&n?.pause(),e=Jp(e,t),e.unshift(t)},remove(t){e=Jp(e,t),e[0]?.resume()}}}function Jp(e,t){let n=[...e],r=n.indexOf(t);return r!==-1&&n.splice(r,1),n}function gee(e){return e.filter(e=>e.tagName!==`A`)}var Yp=0;function Xp(){_.useEffect(()=>{let e=document.querySelectorAll(`[data-radix-focus-guard]`);return document.body.insertAdjacentElement(`afterbegin`,e[0]??Zp()),document.body.insertAdjacentElement(`beforeend`,e[1]??Zp()),Yp++,()=>{Yp===1&&document.querySelectorAll(`[data-radix-focus-guard]`).forEach(e=>e.remove()),Yp--}},[])}function Zp(){let 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 Qp=function(){return Qp=Object.assign||function(e){for(var t,n=1,r=arguments.length;n<r;n++)for(var i in t=arguments[n],t)Object.prototype.hasOwnProperty.call(t,i)&&(e[i]=t[i]);return e},Qp.apply(this,arguments)};function $p(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 i=0,r=Object.getOwnPropertySymbols(e);i<r.length;i++)t.indexOf(r[i])<0&&Object.prototype.propertyIsEnumerable.call(e,r[i])&&(n[r[i]]=e[r[i]]);return n}function _ee(e,t,n){if(n||arguments.length===2)for(var r=0,i=t.length,a;r<i;r++)(a||!(r in t))&&(a||=Array.prototype.slice.call(t,0,r),a[r]=t[r]);return e.concat(a||Array.prototype.slice.call(t))}var em=`right-scroll-bar-position`,tm=`width-before-scroll-bar`,vee=`with-scroll-bars-hidden`,yee=`--removed-body-scroll-bar-size`;function nm(e,t){return typeof e==`function`?e(t):e&&(e.current=t),e}function bee(e,t){var n=(0,_.useState)(function(){return{value:e,callback:t,facade:{get current(){return n.value},set current(e){var t=n.value;t!==e&&(n.value=e,n.callback(e,t))}}}})[0];return n.callback=t,n.facade}var xee=typeof window<`u`?_.useLayoutEffect:_.useEffect,rm=new WeakMap;function See(e,t){var n=bee(t||null,function(t){return e.forEach(function(e){return nm(e,t)})});return xee(function(){var t=rm.get(n);if(t){var r=new Set(t),i=new Set(e),a=n.current;r.forEach(function(e){i.has(e)||nm(e,null)}),i.forEach(function(e){r.has(e)||nm(e,a)})}rm.set(n,e)},[e]),n}function Cee(e){return e}function wee(e,t){t===void 0&&(t=Cee);var n=[],r=!1;return{read:function(){if(r)throw 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(e){var i=t(e,r);return n.push(i),function(){n=n.filter(function(e){return e!==i})}},assignSyncMedium:function(e){for(r=!0;n.length;){var t=n;n=[],t.forEach(e)}n={push:function(t){return e(t)},filter:function(){return n}}},assignMedium:function(e){r=!0;var t=[];if(n.length){var i=n;n=[],i.forEach(e),t=n}var a=function(){var n=t;t=[],n.forEach(e)},o=function(){return Promise.resolve().then(a)};o(),n={push:function(e){t.push(e),o()},filter:function(e){return t=t.filter(e),n}}}}}function Tee(e){e===void 0&&(e={});var t=wee(null);return t.options=Qp({async:!0,ssr:!1},e),t}var im=function(e){var t=e.sideCar,n=$p(e,[`sideCar`]);if(!t)throw Error("Sidecar: please provide `sideCar` property to import the right car");var r=t.read();if(!r)throw Error(`Sidecar medium not found`);return _.createElement(r,Qp({},n))};im.isSideCarExport=!0;function am(e,t){return e.useMedium(t),im}var om=Tee(),sm=function(){},cm=_.forwardRef(function(e,t){var n=_.useRef(null),r=_.useState({onScrollCapture:sm,onWheelCapture:sm,onTouchMoveCapture:sm}),i=r[0],a=r[1],o=e.forwardProps,s=e.children,c=e.className,l=e.removeScrollBar,u=e.enabled,d=e.shards,f=e.sideCar,p=e.noRelative,m=e.noIsolation,h=e.inert,g=e.allowPinchZoom,v=e.as,y=v===void 0?`div`:v,b=e.gapMode,x=$p(e,[`forwardProps`,`children`,`className`,`removeScrollBar`,`enabled`,`shards`,`sideCar`,`noRelative`,`noIsolation`,`inert`,`allowPinchZoom`,`as`,`gapMode`]),S=f,C=See([n,t]),w=Qp(Qp({},x),i);return _.createElement(_.Fragment,null,u&&_.createElement(S,{sideCar:om,removeScrollBar:l,shards:d,noRelative:p,noIsolation:m,inert:h,setCallbacks:a,allowPinchZoom:!!g,lockRef:n,gapMode:b}),o?_.cloneElement(_.Children.only(s),Qp(Qp({},w),{ref:C})):_.createElement(y,Qp({},w,{className:c,ref:C}),s))});cm.defaultProps={enabled:!0,removeScrollBar:!0,inert:!1},cm.classNames={fullWidth:tm,zeroRight:em};var lm=function(){if(typeof __webpack_nonce__<`u`)return __webpack_nonce__};function um(){if(!document)return null;var e=document.createElement(`style`);e.type=`text/css`;var t=lm();return t&&e.setAttribute(`nonce`,t),e}function dm(e,t){e.styleSheet?e.styleSheet.cssText=t:e.appendChild(document.createTextNode(t))}function fm(e){(document.head||document.getElementsByTagName(`head`)[0]).appendChild(e)}var pm=function(){var e=0,t=null;return{add:function(n){e==0&&(t=um())&&(dm(t,n),fm(t)),e++},remove:function(){e--,!e&&t&&(t.parentNode&&t.parentNode.removeChild(t),t=null)}}},mm=function(){var e=pm();return function(t,n){_.useEffect(function(){return e.add(t),function(){e.remove()}},[t&&n])}},hm=function(){var e=mm();return function(t){var n=t.styles,r=t.dynamic;return e(n,r),null}},gm={left:0,top:0,right:0,gap:0},_m=function(e){return parseInt(e||``,10)||0},vm=function(e){var t=window.getComputedStyle(document.body),n=t[e===`padding`?`paddingLeft`:`marginLeft`],r=t[e===`padding`?`paddingTop`:`marginTop`],i=t[e===`padding`?`paddingRight`:`marginRight`];return[_m(n),_m(r),_m(i)]},ym=function(e){if(e===void 0&&(e=`margin`),typeof window>`u`)return gm;var t=vm(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])}},bm=hm(),xm=`data-scroll-locked`,Sm=function(e,t,n,r){var i=e.left,a=e.top,o=e.right,s=e.gap;return n===void 0&&(n=`margin`),`
|
|
12
|
-
.${vee} {
|
|
13
|
-
overflow: hidden ${r};
|
|
14
|
-
padding-right: ${s}px ${r};
|
|
15
|
-
}
|
|
16
|
-
body[${xm}] {
|
|
17
|
-
overflow: hidden ${r};
|
|
18
|
-
overscroll-behavior: contain;
|
|
19
|
-
${[t&&`position: relative ${r};`,n===`margin`&&`
|
|
20
|
-
padding-left: ${i}px;
|
|
21
|
-
padding-top: ${a}px;
|
|
22
|
-
padding-right: ${o}px;
|
|
23
|
-
margin-left:0;
|
|
24
|
-
margin-top:0;
|
|
25
|
-
margin-right: ${s}px ${r};
|
|
26
|
-
`,n===`padding`&&`padding-right: ${s}px ${r};`].filter(Boolean).join(``)}
|
|
27
|
-
}
|
|
28
|
-
|
|
29
|
-
.${em} {
|
|
30
|
-
right: ${s}px ${r};
|
|
31
|
-
}
|
|
32
|
-
|
|
33
|
-
.${tm} {
|
|
34
|
-
margin-right: ${s}px ${r};
|
|
35
|
-
}
|
|
36
|
-
|
|
37
|
-
.${em} .${em} {
|
|
38
|
-
right: 0 ${r};
|
|
39
|
-
}
|
|
40
|
-
|
|
41
|
-
.${tm} .${tm} {
|
|
42
|
-
margin-right: 0 ${r};
|
|
43
|
-
}
|
|
44
|
-
|
|
45
|
-
body[${xm}] {
|
|
46
|
-
${yee}: ${s}px;
|
|
47
|
-
}
|
|
48
|
-
`},Cm=function(){var e=parseInt(document.body.getAttribute(`data-scroll-locked`)||`0`,10);return isFinite(e)?e:0},wm=function(){_.useEffect(function(){return document.body.setAttribute(xm,(Cm()+1).toString()),function(){var e=Cm()-1;e<=0?document.body.removeAttribute(xm):document.body.setAttribute(xm,e.toString())}},[])},Tm=function(e){var t=e.noRelative,n=e.noImportant,r=e.gapMode,i=r===void 0?`margin`:r;wm();var a=_.useMemo(function(){return ym(i)},[i]);return _.createElement(bm,{styles:Sm(a,!t,i,n?``:`!important`)})},Em=!1;if(typeof window<`u`)try{var Dm=Object.defineProperty({},"passive",{get:function(){return Em=!0,!0}});window.addEventListener(`test`,Dm,Dm),window.removeEventListener(`test`,Dm,Dm)}catch{Em=!1}var Om=Em?{passive:!1}:!1,km=function(e){return e.tagName===`TEXTAREA`},Am=function(e,t){if(!(e instanceof Element))return!1;var n=window.getComputedStyle(e);return n[t]!==`hidden`&&!(n.overflowY===n.overflowX&&!km(e)&&n[t]===`visible`)},jm=function(e){return Am(e,`overflowY`)},Mm=function(e){return Am(e,`overflowX`)},Nm=function(e,t){var n=t.ownerDocument,r=t;do{if(typeof ShadowRoot<`u`&&r instanceof ShadowRoot&&(r=r.host),Im(e,r)){var i=Lm(e,r);if(i[1]>i[2])return!0}r=r.parentNode}while(r&&r!==n.body);return!1},Pm=function(e){return[e.scrollTop,e.scrollHeight,e.clientHeight]},Fm=function(e){return[e.scrollLeft,e.scrollWidth,e.clientWidth]},Im=function(e,t){return e===`v`?jm(t):Mm(t)},Lm=function(e,t){return e===`v`?Pm(t):Fm(t)},Rm=function(e,t){return e===`h`&&t===`rtl`?-1:1},zm=function(e,t,n,r,i){var a=Rm(e,window.getComputedStyle(t).direction),o=a*r,s=n.target,c=t.contains(s),l=!1,u=o>0,d=0,f=0;do{if(!s)break;var p=Lm(e,s),m=p[0],h=p[1]-p[2]-a*m;(m||h)&&Im(e,s)&&(d+=h,f+=m);var g=s.parentNode;s=g&&g.nodeType===Node.DOCUMENT_FRAGMENT_NODE?g.host:g}while(!c&&s!==document.body||c&&(t.contains(s)||t===s));return(u&&(i&&Math.abs(d)<1||!i&&o>d)||!u&&(i&&Math.abs(f)<1||!i&&-o>f))&&(l=!0),l},Bm=function(e){return`changedTouches`in e?[e.changedTouches[0].clientX,e.changedTouches[0].clientY]:[0,0]},Vm=function(e){return[e.deltaX,e.deltaY]},Hm=function(e){return e&&`current`in e?e.current:e},Um=function(e,t){return e[0]===t[0]&&e[1]===t[1]},Wm=function(e){return`
|
|
49
|
-
.block-interactivity-${e} {pointer-events: none;}
|
|
50
|
-
.allow-interactivity-${e} {pointer-events: all;}
|
|
51
|
-
`},Gm=0,Km=[];function qm(e){var t=_.useRef([]),n=_.useRef([0,0]),r=_.useRef(),i=_.useState(Gm++)[0],a=_.useState(hm)[0],o=_.useRef(e);_.useEffect(function(){o.current=e},[e]),_.useEffect(function(){if(e.inert){document.body.classList.add(`block-interactivity-${i}`);var t=_ee([e.lockRef.current],(e.shards||[]).map(Hm),!0).filter(Boolean);return t.forEach(function(e){return e.classList.add(`allow-interactivity-${i}`)}),function(){document.body.classList.remove(`block-interactivity-${i}`),t.forEach(function(e){return e.classList.remove(`allow-interactivity-${i}`)})}}},[e.inert,e.lockRef.current,e.shards]);var s=_.useCallback(function(e,t){if(`touches`in e&&e.touches.length===2||e.type===`wheel`&&e.ctrlKey)return!o.current.allowPinchZoom;var i=Bm(e),a=n.current,s=`deltaX`in e?e.deltaX:a[0]-i[0],c=`deltaY`in e?e.deltaY:a[1]-i[1],l,u=e.target,d=Math.abs(s)>Math.abs(c)?`h`:`v`;if(`touches`in e&&d===`h`&&u.type===`range`)return!1;var f=window.getSelection(),p=f&&f.anchorNode;if(p&&(p===u||p.contains(u)))return!1;var m=Nm(d,u);if(!m)return!0;if(m?l=d:(l=d===`v`?`h`:`v`,m=Nm(d,u)),!m)return!1;if(!r.current&&`changedTouches`in e&&(s||c)&&(r.current=l),!l)return!0;var h=r.current||l;return zm(h,t,e,h===`h`?s:c,!0)},[]),c=_.useCallback(function(e){var n=e;if(Km.length&&Km[Km.length-1]===a){var r=`deltaY`in n?Vm(n):Bm(n),i=t.current.filter(function(e){return e.name===n.type&&(e.target===n.target||n.target===e.shadowParent)&&Um(e.delta,r)})[0];if(i&&i.should)n.cancelable&&n.preventDefault();else if(!i){var c=(o.current.shards||[]).map(Hm).filter(Boolean).filter(function(e){return e.contains(n.target)});(c.length>0?s(n,c[0]):!o.current.noIsolation)&&n.cancelable&&n.preventDefault()}}},[]),l=_.useCallback(function(e,n,r,i){var a={name:e,delta:n,target:r,should:i,shadowParent:Jm(r)};t.current.push(a),setTimeout(function(){t.current=t.current.filter(function(e){return e!==a})},1)},[]),u=_.useCallback(function(e){n.current=Bm(e),r.current=void 0},[]),d=_.useCallback(function(t){l(t.type,Vm(t),t.target,s(t,e.lockRef.current))},[]),f=_.useCallback(function(t){l(t.type,Bm(t),t.target,s(t,e.lockRef.current))},[]);_.useEffect(function(){return Km.push(a),e.setCallbacks({onScrollCapture:d,onWheelCapture:d,onTouchMoveCapture:f}),document.addEventListener(`wheel`,c,Om),document.addEventListener(`touchmove`,c,Om),document.addEventListener(`touchstart`,u,Om),function(){Km=Km.filter(function(e){return e!==a}),document.removeEventListener(`wheel`,c,Om),document.removeEventListener(`touchmove`,c,Om),document.removeEventListener(`touchstart`,u,Om)}},[]);var p=e.removeScrollBar,m=e.inert;return _.createElement(_.Fragment,null,m?_.createElement(a,{styles:Wm(i)}):null,p?_.createElement(Tm,{noRelative:e.noRelative,gapMode:e.gapMode}):null)}function Jm(e){for(var t=null;e!==null;)e instanceof ShadowRoot&&(t=e.host,e=e.host),e=e.parentNode;return t}var Ym=am(om,qm),Xm=_.forwardRef(function(e,t){return _.createElement(cm,Qp({},e,{ref:t,sideCar:Ym}))});Xm.classNames=cm.classNames;var Zm=function(e){return typeof document>`u`?null:(Array.isArray(e)?e[0]:e).ownerDocument.body},Qm=new WeakMap,$m=new WeakMap,eh={},th=0,nh=function(e){return e&&(e.host||nh(e.parentNode))},rh=function(e,t){return t.map(function(t){if(e.contains(t))return t;var n=nh(t);return n&&e.contains(n)?n:(console.error(`aria-hidden`,t,`in not contained inside`,e,`. Doing nothing`),null)}).filter(function(e){return!!e})},ih=function(e,t,n,r){var i=rh(t,Array.isArray(e)?e:[e]);eh[n]||(eh[n]=new WeakMap);var a=eh[n],o=[],s=new Set,c=new Set(i),l=function(e){e&&!s.has(e)&&(s.add(e),l(e.parentNode))};i.forEach(l);var u=function(e){e&&!c.has(e)&&Array.prototype.forEach.call(e.children,function(e){if(s.has(e))u(e);else try{var t=e.getAttribute(r),i=t!==null&&t!==`false`,c=(Qm.get(e)||0)+1,l=(a.get(e)||0)+1;Qm.set(e,c),a.set(e,l),o.push(e),c===1&&i&&$m.set(e,!0),l===1&&e.setAttribute(n,`true`),i||e.setAttribute(r,`true`)}catch(t){console.error(`aria-hidden: cannot operate on `,e,t)}})};return u(t),s.clear(),th++,function(){o.forEach(function(e){var t=Qm.get(e)-1,i=a.get(e)-1;Qm.set(e,t),a.set(e,i),t||($m.has(e)||e.removeAttribute(r),$m.delete(e)),i||e.removeAttribute(n)}),th--,th||(Qm=new WeakMap,Qm=new WeakMap,$m=new WeakMap,eh={})}},ah=function(e,t,n){n===void 0&&(n=`data-aria-hidden`);var r=Array.from(Array.isArray(e)?e:[e]),i=t||Zm(e);return i?(r.push.apply(r,Array.from(i.querySelectorAll(`[aria-live], script`))),ih(r,i,n,`aria-hidden`)):function(){return null}};function oh(e){let t=sh(e),n=_.forwardRef((e,n)=>{let{children:r,...i}=e,a=_.Children.toArray(r),o=a.find(lh);if(o){let e=o.props.children,r=a.map(t=>t===o?_.Children.count(e)>1?_.Children.only(null):_.isValidElement(e)?e.props.children:null:t);return(0,I.jsx)(t,{...i,ref:n,children:_.isValidElement(e)?_.cloneElement(e,void 0,r):null})}return(0,I.jsx)(t,{...i,ref:n,children:r})});return n.displayName=`${e}.Slot`,n}function sh(e){let t=_.forwardRef((e,t)=>{let{children:n,...r}=e;if(_.isValidElement(n)){let e=dh(n),i=uh(r,n.props);return n.type!==_.Fragment&&(i.ref=t?N(t,e):e),_.cloneElement(n,i)}return _.Children.count(n)>1?_.Children.only(null):null});return t.displayName=`${e}.SlotClone`,t}var ch=Symbol(`radix.slottable`);function lh(e){return _.isValidElement(e)&&typeof e.type==`function`&&`__radixId`in e.type&&e.type.__radixId===ch}function uh(e,t){let n={...t};for(let r in t){let i=e[r],a=t[r];/^on[A-Z]/.test(r)?i&&a?n[r]=(...e)=>{let t=a(...e);return i(...e),t}:i&&(n[r]=i):r===`style`?n[r]={...i,...a}:r===`className`&&(n[r]=[i,a].filter(Boolean).join(` `))}return{...e,...n}}function dh(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 fh=`Dialog`,[ph,mh]=R(fh),[hh,gh]=ph(fh),_h=e=>{let{__scopeDialog:t,children:n,open:r,defaultOpen:i,onOpenChange:a,modal:o=!0}=e,s=_.useRef(null),c=_.useRef(null),[l,u]=ze({prop:r,defaultProp:i??!1,onChange:a,caller:fh});return(0,I.jsx)(hh,{scope:t,triggerRef:s,contentRef:c,contentId:Ra(),titleId:Ra(),descriptionId:Ra(),open:l,onOpenChange:u,onOpenToggle:_.useCallback(()=>u(e=>!e),[u]),modal:o,children:n})};_h.displayName=fh;var vh=`DialogTrigger`,yh=_.forwardRef((e,t)=>{let{__scopeDialog:n,...r}=e,i=gh(vh,n),a=P(t,i.triggerRef);return(0,I.jsx)(V.button,{type:`button`,"aria-haspopup":`dialog`,"aria-expanded":i.open,"aria-controls":i.contentId,"data-state":zh(i.open),...r,ref:a,onClick:j(e.onClick,i.onOpenToggle)})});yh.displayName=vh;var bh=`DialogPortal`,[xh,Sh]=ph(bh,{forceMount:void 0}),Ch=e=>{let{__scopeDialog:t,forceMount:n,children:r,container:i}=e,a=gh(bh,t);return(0,I.jsx)(xh,{scope:t,forceMount:n,children:_.Children.map(r,e=>(0,I.jsx)(Pe,{present:n||a.open,children:(0,I.jsx)(Me,{asChild:!0,container:i,children:e})}))})};Ch.displayName=bh;var wh=`DialogOverlay`,Th=_.forwardRef((e,t)=>{let n=Sh(wh,e.__scopeDialog),{forceMount:r=n.forceMount,...i}=e,a=gh(wh,e.__scopeDialog);return a.modal?(0,I.jsx)(Pe,{present:r||a.open,children:(0,I.jsx)(Dh,{...i,ref:t})}):null});Th.displayName=wh;var Eh=oh(`DialogOverlay.RemoveScroll`),Dh=_.forwardRef((e,t)=>{let{__scopeDialog:n,...r}=e,i=gh(wh,n);return(0,I.jsx)(Xm,{as:Eh,allowPinchZoom:!0,shards:[i.contentRef],children:(0,I.jsx)(V.div,{"data-state":zh(i.open),...r,ref:t,style:{pointerEvents:`auto`,...r.style}})})}),Oh=`DialogContent`,kh=_.forwardRef((e,t)=>{let n=Sh(Oh,e.__scopeDialog),{forceMount:r=n.forceMount,...i}=e,a=gh(Oh,e.__scopeDialog);return(0,I.jsx)(Pe,{present:r||a.open,children:a.modal?(0,I.jsx)(Ah,{...i,ref:t}):(0,I.jsx)(jh,{...i,ref:t})})});kh.displayName=Oh;var Ah=_.forwardRef((e,t)=>{let n=gh(Oh,e.__scopeDialog),r=_.useRef(null),i=P(t,n.contentRef,r);return _.useEffect(()=>{let e=r.current;if(e)return ah(e)},[]),(0,I.jsx)(Mh,{...e,ref:i,trapFocus:n.open,disableOutsidePointerEvents:!0,onCloseAutoFocus:j(e.onCloseAutoFocus,e=>{e.preventDefault(),n.triggerRef.current?.focus()}),onPointerDownOutside:j(e.onPointerDownOutside,e=>{let t=e.detail.originalEvent,n=t.button===0&&t.ctrlKey===!0;(t.button===2||n)&&e.preventDefault()}),onFocusOutside:j(e.onFocusOutside,e=>e.preventDefault())})}),jh=_.forwardRef((e,t)=>{let n=gh(Oh,e.__scopeDialog),r=_.useRef(!1),i=_.useRef(!1);return(0,I.jsx)(Mh,{...e,ref:t,trapFocus:!1,disableOutsidePointerEvents:!1,onCloseAutoFocus:t=>{e.onCloseAutoFocus?.(t),t.defaultPrevented||(r.current||n.triggerRef.current?.focus(),t.preventDefault()),r.current=!1,i.current=!1},onInteractOutside:t=>{e.onInteractOutside?.(t),t.defaultPrevented||(r.current=!0,t.detail.originalEvent.type===`pointerdown`&&(i.current=!0));let a=t.target;n.triggerRef.current?.contains(a)&&t.preventDefault(),t.detail.originalEvent.type===`focusin`&&i.current&&t.preventDefault()}})}),Mh=_.forwardRef((e,t)=>{let{__scopeDialog:n,trapFocus:r,onOpenAutoFocus:i,onCloseAutoFocus:a,...o}=e,s=gh(Oh,n),c=_.useRef(null),l=P(t,c);return Xp(),(0,I.jsxs)(I.Fragment,{children:[(0,I.jsx)(Vp,{asChild:!0,loop:!0,trapped:r,onMountAutoFocus:i,onUnmountAutoFocus:a,children:(0,I.jsx)(xe,{role:`dialog`,id:s.contentId,"aria-describedby":s.descriptionId,"aria-labelledby":s.titleId,"data-state":zh(s.open),...o,ref:l,onDismiss:()=>s.onOpenChange(!1)})}),(0,I.jsxs)(I.Fragment,{children:[(0,I.jsx)(Uh,{titleId:s.titleId}),(0,I.jsx)(Gh,{contentRef:c,descriptionId:s.descriptionId})]})]})}),Nh=`DialogTitle`,Ph=_.forwardRef((e,t)=>{let{__scopeDialog:n,...r}=e,i=gh(Nh,n);return(0,I.jsx)(V.h2,{id:i.titleId,...r,ref:t})});Ph.displayName=Nh;var Fh=`DialogDescription`,Ih=_.forwardRef((e,t)=>{let{__scopeDialog:n,...r}=e,i=gh(Fh,n);return(0,I.jsx)(V.p,{id:i.descriptionId,...r,ref:t})});Ih.displayName=Fh;var Lh=`DialogClose`,Rh=_.forwardRef((e,t)=>{let{__scopeDialog:n,...r}=e,i=gh(Lh,n);return(0,I.jsx)(V.button,{type:`button`,...r,ref:t,onClick:j(e.onClick,()=>i.onOpenChange(!1))})});Rh.displayName=Lh;function zh(e){return e?`open`:`closed`}var Bh=`DialogTitleWarning`,[Vh,Hh]=L(Bh,{contentName:Oh,titleName:Nh,docsSlug:`dialog`}),Uh=({titleId:e})=>{let t=Hh(Bh),n=`\`${t.contentName}\` requires a \`${t.titleName}\` for the component to be accessible for screen reader users.
|
|
52
|
-
|
|
53
|
-
If you want to hide the \`${t.titleName}\`, you can wrap it with our VisuallyHidden component.
|
|
54
|
-
|
|
55
|
-
For more information, see https://radix-ui.com/primitives/docs/components/${t.docsSlug}`;return _.useEffect(()=>{e&&(document.getElementById(e)||console.error(n))},[n,e]),null},Wh=`DialogDescriptionWarning`,Gh=({contentRef:e,descriptionId:t})=>{let n=`Warning: Missing \`Description\` or \`aria-describedby={undefined}\` for {${Hh(Wh).contentName}}.`;return _.useEffect(()=>{let r=e.current?.getAttribute(`aria-describedby`);t&&r&&(document.getElementById(t)||console.warn(n))},[n,e,t]),null},Kh=_h,qh=yh,Jh=Ch,Yh=Th,Xh=kh,Zh=Ph,Qh=Ih,$h=Rh,eg=Kh,tg=Jh,ng=_.forwardRef(({className:e,...t},n)=>(0,I.jsx)(Yh,{className:U(`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}));ng.displayName=Yh.displayName;var rg=Gt(`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`}}),ig=_.forwardRef(({side:e=`right`,className:t,children:n,...r},i)=>(0,I.jsxs)(tg,{children:[(0,I.jsx)(ng,{}),(0,I.jsxs)(Xh,{ref:i,className:U(rg({side:e}),t),...r,children:[n,(0,I.jsxs)($h,{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-hidden focus:ring-2 focus:ring-ring focus:ring-offset-2 disabled:pointer-events-none`,children:[(0,I.jsx)(hr,{className:`h-4 w-4`}),(0,I.jsx)(`span`,{className:`sr-only`,children:`Close`})]})]})]}));ig.displayName=Xh.displayName;var ag=({className:e,...t})=>(0,I.jsx)(`div`,{className:U(`flex flex-col space-y-2 text-center sm:text-left`,e),...t});ag.displayName=`SheetHeader`;var og=_.forwardRef(({className:e,...t},n)=>(0,I.jsx)(Zh,{ref:n,className:U(`text-lg font-semibold text-foreground`,e),...t}));og.displayName=Zh.displayName;var sg=_.forwardRef(({className:e,...t},n)=>(0,I.jsx)(Qh,{ref:n,className:U(`text-sm text-muted-foreground`,e),...t}));sg.displayName=Qh.displayName;function cg({className:e,...t}){return(0,I.jsx)(`div`,{className:U(`animate-pulse rounded-md bg-muted`,e),...t})}var lg=`sidebar:state`,ug=604800,dg=`16rem`,fg=`18rem`,pg=`3rem`,mg=`b`,hg=_.createContext(null);function gg(){let e=_.useContext(hg);if(!e)throw Error(`useSidebar must be used within a SidebarProvider.`);return e}var _g=_.forwardRef(({defaultOpen:e=!0,open:t,onOpenChange:n,className:r,style:i,children:a,...o},s)=>{let c=Ep(),[l,u]=_.useState(!1),[d,f]=_.useState(e),p=t??d,m=_.useCallback(e=>{let t=typeof e==`function`?e(p):e;n?n(t):f(t),document.cookie=`${lg}=${t}; path=/; max-age=${ug}`},[n,p]),h=_.useCallback(()=>c?u(e=>!e):m(e=>!e),[c,m,u]);_.useEffect(()=>{let e=e=>{e.key===mg&&(e.metaKey||e.ctrlKey)&&(e.preventDefault(),h())};return window.addEventListener(`keydown`,e),()=>window.removeEventListener(`keydown`,e)},[h]);let g=p?`expanded`:`collapsed`,v=_.useMemo(()=>({state:g,open:p,setOpen:m,isMobile:c,openMobile:l,setOpenMobile:u,toggleSidebar:h}),[g,p,m,c,l,u,h]);return(0,I.jsx)(hg.Provider,{value:v,children:(0,I.jsx)(gl,{delayDuration:0,children:(0,I.jsx)(`div`,{style:{"--sidebar-width":dg,"--sidebar-width-icon":pg,...i},className:U(`group/sidebar-wrapper flex min-h-svh w-full has-data-[variant=inset]:bg-sidebar`,r),ref:s,...o,children:a})})})});_g.displayName=`SidebarProvider`;var vg=_.forwardRef(({side:e=`left`,variant:t=`sidebar`,collapsible:n=`offcanvas`,className:r,children:i,...a},o)=>{let{isMobile:s,state:c,openMobile:l,setOpenMobile:u}=gg();return n===`none`?(0,I.jsx)(`div`,{className:U(`flex h-full w-(--sidebar-width) flex-col bg-sidebar text-sidebar-foreground`,r),ref:o,...a,children:i}):s?(0,I.jsx)(eg,{open:l,onOpenChange:u,...a,children:(0,I.jsx)(ig,{"data-sidebar":`sidebar`,"data-mobile":`true`,className:`w-(--sidebar-width) bg-sidebar p-0 text-sidebar-foreground [&>button]:hidden`,style:{"--sidebar-width":fg},side:e,children:(0,I.jsx)(`div`,{className:`flex h-full w-full flex-col`,children:i})})}):(0,I.jsxs)(`div`,{ref:o,className:`group peer hidden text-sidebar-foreground md:block`,"data-state":c,"data-collapsible":c===`collapsed`?n:``,"data-variant":t,"data-side":e,children:[(0,I.jsx)(`div`,{className:U(`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)+(--spacing(4)))]`:`group-data-[collapsible=icon]:w-(--sidebar-width-icon)`)}),(0,I.jsx)(`div`,{className:U(`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-(--sidebar-width)`:`right-0 group-data-[collapsible=offcanvas]:-right-(--sidebar-width)`,t===`floating`||t===`inset`?`p-2 group-data-[collapsible=icon]:w-[calc(var(--sidebar-width-icon)+(--spacing(4))+2px)]`:`group-data-[collapsible=icon]:w-(--sidebar-width-icon) group-data-[side=left]:border-r group-data-[side=right]:border-l`,r),...a,children:(0,I.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-sm`,children:i})})]})});vg.displayName=`Sidebar`;var yg=_.forwardRef(({className:e,onClick:t,...n},r)=>{let{toggleSidebar:i}=gg();return(0,I.jsxs)(W,{ref:r,"data-sidebar":`trigger`,variant:`ghost`,size:`icon`,className:U(`h-7 w-7`,e),onClick:e=>{t?.(e),i()},...n,children:[(0,I.jsx)(Wn,{}),(0,I.jsx)(`span`,{className:`sr-only`,children:`Toggle Sidebar`})]})});yg.displayName=`SidebarTrigger`;var bg=_.forwardRef(({className:e,...t},n)=>{let{toggleSidebar:r}=gg();return(0,I.jsx)(`button`,{ref:n,"data-sidebar":`rail`,"aria-label":`Toggle Sidebar`,tabIndex:-1,onClick:r,title:`Toggle Sidebar`,className:U(`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`,`in-data-[side=left]:cursor-w-resize in-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 hover:group-data-[collapsible=offcanvas]:bg-sidebar`,`[[data-side=left][data-collapsible=offcanvas]_&]:-right-2`,`[[data-side=right][data-collapsible=offcanvas]_&]:-left-2`,e),...t})});bg.displayName=`SidebarRail`;var xg=_.forwardRef(({className:e,...t},n)=>(0,I.jsx)(`main`,{ref:n,className:U(`relative flex min-h-svh flex-1 flex-col bg-background`,`peer-data-[variant=inset]:min-h-[calc(100svh-(--spacing(4)))] md:peer-data-[variant=inset]:m-2 md:peer-data-[variant=inset]:peer-data-[state=collapsed]:ml-2 md:peer-data-[variant=inset]:ml-0 md:peer-data-[variant=inset]:rounded-xl md:peer-data-[variant=inset]:shadow-sm`,e),...t}));xg.displayName=`SidebarInset`;var Sg=_.forwardRef(({className:e,...t},n)=>(0,I.jsx)(Op,{ref:n,"data-sidebar":`input`,className:U(`h-8 w-full bg-background shadow-none focus-visible:ring-2 focus-visible:ring-sidebar-ring`,e),...t}));Sg.displayName=`SidebarInput`;var Cg=_.forwardRef(({className:e,...t},n)=>(0,I.jsx)(`div`,{ref:n,"data-sidebar":`header`,className:U(`flex flex-col gap-2 p-2`,e),...t}));Cg.displayName=`SidebarHeader`;var wg=_.forwardRef(({className:e,...t},n)=>(0,I.jsx)(`div`,{ref:n,"data-sidebar":`footer`,className:U(`flex flex-col gap-2 p-2`,e),...t}));wg.displayName=`SidebarFooter`;var Tg=_.forwardRef(({className:e,...t},n)=>(0,I.jsx)(Ip,{ref:n,"data-sidebar":`separator`,className:U(`mx-2 w-auto bg-sidebar-border`,e),...t}));Tg.displayName=`SidebarSeparator`;var Eg=_.forwardRef(({className:e,...t},n)=>(0,I.jsx)(`div`,{ref:n,"data-sidebar":`content`,className:U(`flex min-h-0 flex-1 flex-col gap-2 overflow-auto group-data-[collapsible=icon]:overflow-hidden`,e),...t}));Eg.displayName=`SidebarContent`;var Dg=_.forwardRef(({className:e,...t},n)=>(0,I.jsx)(`div`,{ref:n,"data-sidebar":`group`,className:U(`relative flex w-full min-w-0 flex-col p-2`,e),...t}));Dg.displayName=`SidebarGroup`;var Og=_.forwardRef(({className:e,asChild:t=!1,...n},r)=>(0,I.jsx)(t?yp:`div`,{ref:r,"data-sidebar":`group-label`,className:U(`flex h-8 shrink-0 items-center rounded-md px-2 text-xs font-medium text-sidebar-foreground/70 outline-hidden 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}));Og.displayName=`SidebarGroupLabel`;var kg=_.forwardRef(({className:e,asChild:t=!1,...n},r)=>(0,I.jsx)(t?yp:`button`,{ref:r,"data-sidebar":`group-action`,className:U(`absolute right-3 top-3.5 flex aspect-square w-5 items-center justify-center rounded-md p-0 text-sidebar-foreground outline-hidden 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 md:after:hidden`,`group-data-[collapsible=icon]:hidden`,e),...n}));kg.displayName=`SidebarGroupAction`;var Ag=_.forwardRef(({className:e,...t},n)=>(0,I.jsx)(`div`,{ref:n,"data-sidebar":`group-content`,className:U(`w-full text-sm`,e),...t}));Ag.displayName=`SidebarGroupContent`;var jg=_.forwardRef(({className:e,...t},n)=>(0,I.jsx)(`ul`,{ref:n,"data-sidebar":`menu`,className:U(`flex w-full min-w-0 flex-col gap-1`,e),...t}));jg.displayName=`SidebarMenu`;var Mg=_.forwardRef(({className:e,...t},n)=>(0,I.jsx)(`li`,{ref:n,"data-sidebar":`menu-item`,className:U(`group/menu-item relative`,e),...t}));Mg.displayName=`SidebarMenuItem`;var Ng=Gt(`peer/menu-button flex w-full items-center gap-2 overflow-hidden rounded-md p-2 text-left text-sm outline-hidden 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`}}),Pg=_.forwardRef(({asChild:e=!1,isActive:t=!1,variant:n=`default`,size:r=`default`,tooltip:i,className:a,...o},s)=>{let c=e?yp:`button`,{isMobile:l,state:u}=gg(),d=(0,I.jsx)(c,{ref:s,"data-sidebar":`menu-button`,"data-size":r,"data-active":t,className:U(Ng({variant:n,size:r}),a),...o});return i?(typeof i==`string`&&(i={children:i}),(0,I.jsxs)(_l,{children:[(0,I.jsx)(vl,{asChild:!0,children:d}),(0,I.jsx)(yl,{side:`right`,align:`center`,hidden:u!==`collapsed`||l,...i})]})):d});Pg.displayName=`SidebarMenuButton`;var Fg=_.forwardRef(({className:e,asChild:t=!1,showOnHover:n=!1,...r},i)=>(0,I.jsx)(t?yp:`button`,{ref:i,"data-sidebar":`menu-action`,className:U(`absolute right-1 top-1.5 flex aspect-square w-5 items-center justify-center rounded-md p-0 text-sidebar-foreground outline-hidden 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 md:after: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}));Fg.displayName=`SidebarMenuAction`;var Ig=_.forwardRef(({className:e,...t},n)=>(0,I.jsx)(`div`,{ref:n,"data-sidebar":`menu-badge`,className:U(`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}));Ig.displayName=`SidebarMenuBadge`;var Lg=_.forwardRef(({className:e,showIcon:t=!1,...n},r)=>{let i=_.useMemo(()=>`${Math.floor(Math.random()*40)+50}%`,[]);return(0,I.jsxs)(`div`,{ref:r,"data-sidebar":`menu-skeleton`,className:U(`flex h-8 items-center gap-2 rounded-md px-2`,e),...n,children:[t&&(0,I.jsx)(cg,{className:`size-4 rounded-md`,"data-sidebar":`menu-skeleton-icon`}),(0,I.jsx)(cg,{className:`h-4 max-w-(--skeleton-width) flex-1`,"data-sidebar":`menu-skeleton-text`,style:{"--skeleton-width":i}})]})});Lg.displayName=`SidebarMenuSkeleton`;var Rg=_.forwardRef(({className:e,...t},n)=>(0,I.jsx)(`ul`,{ref:n,"data-sidebar":`menu-sub`,className:U(`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}));Rg.displayName=`SidebarMenuSub`;var zg=_.forwardRef(({...e},t)=>(0,I.jsx)(`li`,{ref:t,...e}));zg.displayName=`SidebarMenuSubItem`;var Bg=_.forwardRef(({asChild:e=!1,size:t=`md`,isActive:n,className:r,...i},a)=>(0,I.jsx)(e?yp:`a`,{ref:a,"data-sidebar":`menu-sub-button`,"data-size":t,"data-active":n,className:U(`flex h-7 min-w-0 -translate-x-px items-center gap-2 overflow-hidden rounded-md px-2 text-sidebar-foreground outline-hidden 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),...i}));Bg.displayName=`SidebarMenuSubButton`;var Vg=(0,_.forwardRef)(({className:e,activeClassName:t,pendingClassName:n,to:r,...i},a)=>(0,I.jsx)(rp,{ref:a,to:r,className:({isActive:r,isPending:i})=>U(e,r&&t,i&&n),...i}));Vg.displayName=`NavLink`;function Hg({width:e=24,height:t=24,from:n=`#53afba`,to:r=`#76fffb`,...i}){let a=`grad-${(0,_.useId)().slice(1)}`;return(0,I.jsxs)(`svg`,{className:`inline-block`,width:e,height:t,viewBox:`0 0 1648 1648`,xmlns:`http://www.w3.org/2000/svg`,...i,children:[(0,I.jsx)(`defs`,{children:(0,I.jsxs)(`linearGradient`,{id:a,x1:`0%`,y1:`0%`,x2:`100%`,y2:`0%`,children:[(0,I.jsx)(`stop`,{offset:`0%`,style:{stopColor:n}}),(0,I.jsx)(`stop`,{offset:`100%`,style:{stopColor:r}})]})}),(0,I.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(#${a})`,fillRule:`evenodd`})]})}function Ug(e){return(0,I.jsx)(`img`,{src:`/mcp.svg`,alt:``,"aria-hidden":`true`,...e})}var Wg=[{title:`Home`,items:[{title:`Dashboard`,url:`/`,icon:Fn}]},{title:`Lab`,items:[{title:`MCP Evaluations`,url:`/mcp-evaluations`,icon:On},{title:`Analyze MCP`,url:`/tool-analysis`,icon:Bn},{title:`OAuth Debugger`,url:`/oauth-debugger`,icon:ir}]},{title:`Libraries`,items:[{title:`Test Cases`,url:`/libraries/test-cases`,icon:Tn},{title:`MCP servers`,url:`/libraries/servers`,icon:Ug},{title:`Agents`,url:`/libraries/agents`,icon:en}]},{title:`Execution`,items:[{title:`Run Evaluation`,url:`/run`,icon:Yn},{title:`Evaluation Results`,url:`/results`,icon:rn},{title:`Compare Evaluations`,url:`/compare`,icon:An},{title:`MCP Analysis Results`,url:`/tool-analysis-results`,icon:Hn},{title:`Custom Reports`,url:`/markdown-reports`,icon:Un}]},{title:`Workspace`,items:[{title:`Settings`,url:`/settings`,icon:nr},{title:`MCPLab MCP server`,url:`/settings/mcp`,icon:Ln}]}];function Gg(e={version:null}){let t=e.version??null,{state:n}=gg(),r=n===`collapsed`,i=Wd(),a=(0,_.useMemo)(()=>Wg,[]);return(0,I.jsxs)(vg,{collapsible:`icon`,children:[(0,I.jsx)(Cg,{className:`border-b border-sidebar-border py-3 ${r?`px-2`:`px-4`}`,children:(0,I.jsxs)(`div`,{className:`flex items-center ${r?`justify-center overflow-visible`:`gap-2.5 overflow-hidden`}`,children:[(0,I.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:(0,I.jsx)(Hg,{width:22,height:22,from:`#f97316`,to:`#fb923c`})}),!r&&(0,I.jsxs)(`div`,{className:`flex flex-col`,children:[(0,I.jsx)(`span`,{className:`text-sm font-semibold text-sidebar-foreground`,children:`MCPLab`}),(0,I.jsx)(`span`,{className:`text-xs text-muted-foreground`,children:`MCP Evaluation Lab`})]})]})}),(0,I.jsx)(Eg,{children:a.map((e,t)=>(0,I.jsxs)(`div`,{children:[t>0&&!r&&(0,I.jsx)(Tg,{className:`my-1.5`}),(0,I.jsxs)(Dg,{className:r?`px-2`:`px-3 py-2`,children:[!r&&(0,I.jsx)(Og,{className:`px-1 pb-1.5 text-[10px] font-semibold uppercase tracking-[0.08em] text-muted-foreground/90`,children:e.title}),(0,I.jsx)(Ag,{children:(0,I.jsx)(jg,{children:e.items.map(e=>(0,I.jsx)(Mg,{children:(0,I.jsx)(Pg,{asChild:!0,isActive:e.url===`/`?i.pathname===`/`:e.url===`/settings`?i.pathname===`/settings`:i.pathname.startsWith(e.url),tooltip:e.title,children:(0,I.jsxs)(Vg,{to:e.url,end:e.url===`/`||e.url===`/settings`,activeClassName:`bg-sidebar-accent text-sidebar-accent-foreground`,children:[(0,I.jsx)(e.icon,{className:`h-4 w-4`}),(0,I.jsx)(`span`,{children:e.title})]})})},e.title))})})]})]},e.title))}),(0,I.jsxs)(wg,{className:r?`px-2 py-2`:`px-3 py-3`,children:[(0,I.jsx)(Tg,{className:`my-1.5`}),(0,I.jsxs)(`div`,{className:`flex ${r?`justify-center`:`items-center justify-center gap-2`} w-full`,children:[(0,I.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:[(0,I.jsx)(jn,{className:`h-4 w-4 shrink-0`}),!r&&(0,I.jsx)(`span`,{className:`text-xs text-sidebar-foreground/85`,children:`v${t??`unknown`}`})]}),!r&&(0,I.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 `,(0,I.jsx)(`span`,{className:`text-[#00e5ff] hover:text-[#00b8d4]`,children:`Inspectr`})]})]})]})]})}function Kg({label:e=`Queue processing`}){return(0,I.jsx)(`span`,{role:`img`,"aria-label":e,className:`inline-block h-3 w-3 shrink-0 animate-spin rounded-full border-2 border-emerald-500 border-t-transparent motion-reduce:animate-none`})}var qg=_.forwardRef(({...e},t)=>(0,I.jsx)(`nav`,{ref:t,"aria-label":`breadcrumb`,...e}));qg.displayName=`Breadcrumb`;var Jg=_.forwardRef(({className:e,...t},n)=>(0,I.jsx)(`ol`,{ref:n,className:U(`flex flex-wrap items-center gap-1.5 wrap-break-word text-sm text-muted-foreground sm:gap-2.5`,e),...t}));Jg.displayName=`BreadcrumbList`;var Yg=_.forwardRef(({className:e,...t},n)=>(0,I.jsx)(`li`,{ref:n,className:U(`inline-flex items-center gap-1.5`,e),...t}));Yg.displayName=`BreadcrumbItem`;var Xg=_.forwardRef(({asChild:e,className:t,...n},r)=>(0,I.jsx)(e?yp:`a`,{ref:r,className:U(`transition-colors hover:text-foreground`,t),...n}));Xg.displayName=`BreadcrumbLink`;var Zg=_.forwardRef(({className:e,...t},n)=>(0,I.jsx)(`span`,{ref:n,role:`link`,"aria-disabled":`true`,"aria-current":`page`,className:U(`font-normal text-foreground`,e),...t}));Zg.displayName=`BreadcrumbPage`;var Qg=({children:e,className:t,...n})=>(0,I.jsx)(`li`,{role:`presentation`,"aria-hidden":`true`,className:U(`[&>svg]:size-3.5`,t),...n,children:e??(0,I.jsx)(sn,{})});Qg.displayName=`BreadcrumbSeparator`;function $g(){return{input:0,output:0,total:0,hasInput:!1,hasOutput:!1,hasTotal:!1}}function e_(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 t_(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 n_(e){let t=$g();for(let n of e)e_(t,n);return t_(t)}var Eee={png:`image/png`,jpg:`image/jpeg`,jpeg:`image/jpeg`,gif:`image/gif`,webp:`image/webp`,pdf:`application/pdf`,txt:`text/plain`,md:`text/markdown`,csv:`text/csv`};function Dee(e){return e.startsWith(`image/`)?`image`:`document`}function Oee(e){return e?.split(`.`).pop()?.toLowerCase()??``}function kee(e){if(e.media_type)return e.media_type;if(e.path)return Eee[Oee(e.path)]}function r_(e){let t={passed:0,failed:0,not_evaluated:0,not_executed:0,total:0};for(let n of e){if(n.status===`passed`)t.passed+=1;else if(n.status===`failed`)t.failed+=1;else if(n.status===`not_evaluated`||n.status===`not_applicable`)t.not_evaluated+=1;else if(n.status===`not_executed`)t.not_executed=(t.not_executed??0)+1;else continue;t.total+=1}return t}var i_={openai:{label:`OpenAI Decisions`,modelLabel:`Decision model`,defaultModel:`gpt-6-luna`,models:[`gpt-6-luna`],editableModel:!1,credentials:`Requires OPENAI_API_KEY on the MCPLab backend.`},cloudflare:{label:`Cloudflare Clef`,modelLabel:`Decision model`,defaultModel:`clef-flash`,models:[`clef-flash`,`clef`],editableModel:!1,credentials:`Requires CLOUDFLARE_ACCOUNT_ID and CLOUDFLARE_AUTH_TOKEN on the MCPLab backend.`},typesafe:{label:`TypeSafe Jev`,modelLabel:`Decision model`,defaultModel:`jev-1.13.0`,models:[`jev-1.13.0`],editableModel:!0,credentials:`Requires TYPESAFE_API_KEY on the MCPLab backend.`},ollama:{label:`Ollama`,modelLabel:`Ollama model name`,defaultModel:`clef-flash`,models:[`clef-flash`,`clef`,`nimble`,`tev1:4b`,`tev1:0.8b`],editableModel:!0,credentials:`Requests use the MCPLab backend. Install a supported decision model on your Ollama server; models are not downloaded automatically.`},azure_foundry:{label:`Azure Foundry`,modelLabel:`Deployment name`,defaultModel:`Microsoft-Decision-1`,models:[`Microsoft-Decision-1`],editableModel:!0,credentials:`Requires AZURE_FOUNDRY_ENDPOINT and AZURE_FOUNDRY_API_KEY (or AZURE_OPENAI_API_KEY for the same resource) on the MCPLab backend. Enter the name of your Microsoft-Decision-1 deployment, which may differ from the model name. Use the Foundry resource endpoint, not the project endpoint. If the deployment Target URI ends in /models, MCPLab removes that suffix.`}},a_={passThreshold:.9,failThreshold:.1,baseUrl:`http://localhost:11434`};function o_(e){return e!=null&&e.enabled!==!1}function s_(e){if(!e||typeof e!=`object`||Array.isArray(e))throw Error(`Decision engine configuration must be an object.`);let t=e,n=t.enabled;if(n!==void 0&&typeof n!=`boolean`)throw Error(`Decision engine enabled must be a boolean.`);let r=t.provider;if(typeof r!=`string`||!Object.hasOwn(i_,r))throw Error(`Choose a supported decision engine provider.`);let i=r,a=i_[i];if(typeof t.model!=`string`||!t.model.trim())throw Error(`Decision engine model is required.`);let o=t.model.trim();if(!a.editableModel&&!a.models.includes(o))throw Error(`${a.label} supports ${a.models.join(` or `)}.`);let s=t.passThreshold===void 0?a_.passThreshold:t.passThreshold,c=t.failThreshold===void 0?a_.failThreshold:t.failThreshold;if(typeof s!=`number`||typeof c!=`number`||!Number.isFinite(s)||!Number.isFinite(c)||c<0||c>=s||s>1)throw Error(`Decision thresholds must satisfy 0 ≤ fail probability < pass probability ≤ 1.`);if(i!==`ollama`&&t.baseUrl!==void 0)throw Error(`A server URL can only be configured for Ollama.`);let l;if(i===`ollama`){if(t.baseUrl!==void 0&&typeof t.baseUrl!=`string`)throw Error(`Ollama server URL must be a string.`);let e=new URL(t.baseUrl?.trim()||a_.baseUrl);if(![`http:`,`https:`].includes(e.protocol)||e.username||e.password||e.search||e.hash)throw Error(`Ollama server URL must be HTTP or HTTPS without credentials, query, or fragment.`);l=e.toString().replace(/\/+$/,``)}return{provider:i,model:o,passThreshold:s,failThreshold:c,...l?{baseUrl:l}:{},...n===void 0?{}:{enabled:n}}}var Aee=class{add(e,t,n){if(typeof arguments[0]!=`string`)for(let e in arguments[0])this.add(e,arguments[0][e],arguments[1]);else(Array.isArray(e)?e:[e]).forEach(function(e){this[e]=this[e]||[],t&&this[e][n?`unshift`:`push`](t)},this)}run(e,t){this[e]=this[e]||[],this[e].forEach(function(e){e.call(t&&t.context?t.context:t,t)})}},jee=class{constructor(e){this.jsep=e,this.registered={}}register(){[...arguments].forEach(e=>{if(typeof e!=`object`||!e.name||!e.init)throw Error(`Invalid JSEP plugin format`);this.registered[e.name]||(e.init(this.jsep),this.registered[e.name]=e)})}},c_=class e{static get version(){return`1.4.0`}static toString(){return`JavaScript Expression Parser (JSEP) v`+e.version}static addUnaryOp(t){return e.max_unop_len=Math.max(t.length,e.max_unop_len),e.unary_ops[t]=1,e}static addBinaryOp(t,n,r){return e.max_binop_len=Math.max(t.length,e.max_binop_len),e.binary_ops[t]=n,r?e.right_associative.add(t):e.right_associative.delete(t),e}static addIdentifierChar(t){return e.additional_identifier_chars.add(t),e}static addLiteral(t,n){return e.literals[t]=n,e}static removeUnaryOp(t){return delete e.unary_ops[t],t.length===e.max_unop_len&&(e.max_unop_len=e.getMaxKeyLen(e.unary_ops)),e}static removeAllUnaryOps(){return e.unary_ops={},e.max_unop_len=0,e}static removeIdentifierChar(t){return e.additional_identifier_chars.delete(t),e}static removeBinaryOp(t){return delete e.binary_ops[t],t.length===e.max_binop_len&&(e.max_binop_len=e.getMaxKeyLen(e.binary_ops)),e.right_associative.delete(t),e}static removeAllBinaryOps(){return e.binary_ops={},e.max_binop_len=0,e}static removeLiteral(t){return delete e.literals[t],e}static removeAllLiterals(){return e.literals={},e}get char(){return this.expr.charAt(this.index)}get code(){return this.expr.charCodeAt(this.index)}constructor(e){this.expr=e,this.index=0}static parse(t){return new e(t).parse()}static getMaxKeyLen(e){return Math.max(0,...Object.keys(e).map(e=>e.length))}static isDecimalDigit(e){return e>=48&&e<=57}static binaryPrecedence(t){return e.binary_ops[t]||0}static isIdentifierStart(t){return t>=65&&t<=90||t>=97&&t<=122||t>=128&&!e.binary_ops[String.fromCharCode(t)]||e.additional_identifier_chars.has(String.fromCharCode(t))}static isIdentifierPart(t){return e.isIdentifierStart(t)||e.isDecimalDigit(t)}throwError(e){let t=Error(e+` at character `+this.index);throw t.index=this.index,t.description=e,t}runHook(t,n){if(e.hooks[t]){let r={context:this,node:n};return e.hooks.run(t,r),r.node}return n}searchHook(t){if(e.hooks[t]){let n={context:this};return e.hooks[t].find(function(e){return e.call(n.context,n),n.node}),n.node}}gobbleSpaces(){let t=this.code;for(;t===e.SPACE_CODE||t===e.TAB_CODE||t===e.LF_CODE||t===e.CR_CODE;)t=this.expr.charCodeAt(++this.index);this.runHook(`gobble-spaces`)}parse(){this.runHook(`before-all`);let t=this.gobbleExpressions(),n=t.length===1?t[0]:{type:e.COMPOUND,body:t};return this.runHook(`after-all`,n)}gobbleExpressions(t){let n=[],r,i;for(;this.index<this.expr.length;)if(r=this.code,r===e.SEMCOL_CODE||r===e.COMMA_CODE)this.index++;else if(i=this.gobbleExpression())n.push(i);else if(this.index<this.expr.length){if(r===t)break;this.throwError(`Unexpected "`+this.char+`"`)}return n}gobbleExpression(){let e=this.searchHook(`gobble-expression`)||this.gobbleBinaryExpression();return this.gobbleSpaces(),this.runHook(`after-expression`,e)}gobbleBinaryOp(){this.gobbleSpaces();let t=this.expr.substr(this.index,e.max_binop_len),n=t.length;for(;n>0;){if(e.binary_ops.hasOwnProperty(t)&&(!e.isIdentifierStart(this.code)||this.index+t.length<this.expr.length&&!e.isIdentifierPart(this.expr.charCodeAt(this.index+t.length))))return this.index+=n,t;t=t.substr(0,--n)}return!1}gobbleBinaryExpression(){let t,n,r,i,a,o,s,c,l;if(o=this.gobbleToken(),!o||(n=this.gobbleBinaryOp(),!n))return o;for(a={value:n,prec:e.binaryPrecedence(n),right_a:e.right_associative.has(n)},s=this.gobbleToken(),s||this.throwError(`Expected expression after `+n),i=[o,a,s];n=this.gobbleBinaryOp();){if(r=e.binaryPrecedence(n),r===0){this.index-=n.length;break}a={value:n,prec:r,right_a:e.right_associative.has(n)},l=n;let c=e=>a.right_a&&e.right_a?r>e.prec:r<=e.prec;for(;i.length>2&&c(i[i.length-2]);)s=i.pop(),n=i.pop().value,o=i.pop(),t={type:e.BINARY_EXP,operator:n,left:o,right:s},i.push(t);t=this.gobbleToken(),t||this.throwError(`Expected expression after `+l),i.push(a,t)}for(c=i.length-1,t=i[c];c>1;)t={type:e.BINARY_EXP,operator:i[c-1].value,left:i[c-2],right:t},c-=2;return t}gobbleToken(){let t,n,r,i;if(this.gobbleSpaces(),i=this.searchHook(`gobble-token`),i)return this.runHook(`after-token`,i);if(t=this.code,e.isDecimalDigit(t)||t===e.PERIOD_CODE)return this.gobbleNumericLiteral();if(t===e.SQUOTE_CODE||t===e.DQUOTE_CODE)i=this.gobbleStringLiteral();else if(t===e.OBRACK_CODE)i=this.gobbleArray();else{for(n=this.expr.substr(this.index,e.max_unop_len),r=n.length;r>0;){if(e.unary_ops.hasOwnProperty(n)&&(!e.isIdentifierStart(this.code)||this.index+n.length<this.expr.length&&!e.isIdentifierPart(this.expr.charCodeAt(this.index+n.length)))){this.index+=r;let t=this.gobbleToken();return t||this.throwError(`missing unaryOp argument`),this.runHook(`after-token`,{type:e.UNARY_EXP,operator:n,argument:t,prefix:!0})}n=n.substr(0,--r)}e.isIdentifierStart(t)?(i=this.gobbleIdentifier(),e.literals.hasOwnProperty(i.name)?i={type:e.LITERAL,value:e.literals[i.name],raw:i.name}:i.name===e.this_str&&(i={type:e.THIS_EXP})):t===e.OPAREN_CODE&&(i=this.gobbleGroup())}return i?(i=this.gobbleTokenProperty(i),this.runHook(`after-token`,i)):this.runHook(`after-token`,!1)}gobbleTokenProperty(t){this.gobbleSpaces();let n=this.code;for(;n===e.PERIOD_CODE||n===e.OBRACK_CODE||n===e.OPAREN_CODE||n===e.QUMARK_CODE;){let r;if(n===e.QUMARK_CODE){if(this.expr.charCodeAt(this.index+1)!==e.PERIOD_CODE)break;r=!0,this.index+=2,this.gobbleSpaces(),n=this.code}this.index++,n===e.OBRACK_CODE?(t={type:e.MEMBER_EXP,computed:!0,object:t,property:this.gobbleExpression()},t.property||this.throwError(`Unexpected "`+this.char+`"`),this.gobbleSpaces(),n=this.code,n!==e.CBRACK_CODE&&this.throwError(`Unclosed [`),this.index++):n===e.OPAREN_CODE?t={type:e.CALL_EXP,arguments:this.gobbleArguments(e.CPAREN_CODE),callee:t}:(n===e.PERIOD_CODE||r)&&(r&&this.index--,this.gobbleSpaces(),t={type:e.MEMBER_EXP,computed:!1,object:t,property:this.gobbleIdentifier()}),r&&(t.optional=!0),this.gobbleSpaces(),n=this.code}return t}gobbleNumericLiteral(){let t=``,n,r;for(;e.isDecimalDigit(this.code);)t+=this.expr.charAt(this.index++);if(this.code===e.PERIOD_CODE)for(t+=this.expr.charAt(this.index++);e.isDecimalDigit(this.code);)t+=this.expr.charAt(this.index++);if(n=this.char,n===`e`||n===`E`){for(t+=this.expr.charAt(this.index++),n=this.char,(n===`+`||n===`-`)&&(t+=this.expr.charAt(this.index++));e.isDecimalDigit(this.code);)t+=this.expr.charAt(this.index++);e.isDecimalDigit(this.expr.charCodeAt(this.index-1))||this.throwError(`Expected exponent (`+t+this.char+`)`)}return r=this.code,e.isIdentifierStart(r)?this.throwError(`Variable names cannot start with a number (`+t+this.char+`)`):(r===e.PERIOD_CODE||t.length===1&&t.charCodeAt(0)===e.PERIOD_CODE)&&this.throwError(`Unexpected period`),{type:e.LITERAL,value:parseFloat(t),raw:t}}gobbleStringLiteral(){let t=``,n=this.index,r=this.expr.charAt(this.index++),i=!1;for(;this.index<this.expr.length;){let e=this.expr.charAt(this.index++);if(e===r){i=!0;break}if(e===`\\`)switch(e=this.expr.charAt(this.index++),e){case`n`:t+=`
|
|
56
|
-
`;break;case`r`:t+=`\r`;break;case`t`:t+=` `;break;case`b`:t+=`\b`;break;case`f`:t+=`\f`;break;case`v`:t+=`\v`;break;default:t+=e}else t+=e}return i||this.throwError(`Unclosed quote after "`+t+`"`),{type:e.LITERAL,value:t,raw:this.expr.substring(n,this.index)}}gobbleIdentifier(){let t=this.code,n=this.index;for(e.isIdentifierStart(t)?this.index++:this.throwError(`Unexpected `+this.char);this.index<this.expr.length&&(t=this.code,e.isIdentifierPart(t));)this.index++;return{type:e.IDENTIFIER,name:this.expr.slice(n,this.index)}}gobbleArguments(t){let n=[],r=!1,i=0;for(;this.index<this.expr.length;){this.gobbleSpaces();let a=this.code;if(a===t){r=!0,this.index++,t===e.CPAREN_CODE&&i&&i>=n.length&&this.throwError(`Unexpected token `+String.fromCharCode(t));break}if(a===e.COMMA_CODE){if(this.index++,i++,i!==n.length){if(t===e.CPAREN_CODE)this.throwError(`Unexpected token ,`);else if(t===e.CBRACK_CODE)for(let e=n.length;e<i;e++)n.push(null)}}else if(n.length!==i&&i!==0)this.throwError(`Expected comma`);else{let t=this.gobbleExpression();(!t||t.type===e.COMPOUND)&&this.throwError(`Expected comma`),n.push(t)}}return r||this.throwError(`Expected `+String.fromCharCode(t)),n}gobbleGroup(){this.index++;let t=this.gobbleExpressions(e.CPAREN_CODE);if(this.code===e.CPAREN_CODE)return this.index++,t.length===1?t[0]:t.length?{type:e.SEQUENCE_EXP,expressions:t}:!1;this.throwError(`Unclosed (`)}gobbleArray(){return this.index++,{type:e.ARRAY_EXP,elements:this.gobbleArguments(e.CBRACK_CODE)}}},Mee=new Aee;Object.assign(c_,{hooks:Mee,plugins:new jee(c_),COMPOUND:`Compound`,SEQUENCE_EXP:`SequenceExpression`,IDENTIFIER:`Identifier`,MEMBER_EXP:`MemberExpression`,LITERAL:`Literal`,THIS_EXP:`ThisExpression`,CALL_EXP:`CallExpression`,UNARY_EXP:`UnaryExpression`,BINARY_EXP:`BinaryExpression`,ARRAY_EXP:`ArrayExpression`,TAB_CODE:9,LF_CODE:10,CR_CODE:13,SPACE_CODE:32,PERIOD_CODE:46,COMMA_CODE:44,SQUOTE_CODE:39,DQUOTE_CODE:34,OPAREN_CODE:40,CPAREN_CODE:41,OBRACK_CODE:91,CBRACK_CODE:93,QUMARK_CODE:63,SEMCOL_CODE:59,COLON_CODE:58,unary_ops:{"-":1,"!":1,"~":1,"+":1},binary_ops:{"||":1,"??":1,"&&":2,"|":3,"^":4,"&":5,"==":6,"!=":6,"===":6,"!==":6,"<":7,">":7,"<=":7,">=":7,"<<":8,">>":8,">>>":8,"+":9,"-":9,"*":10,"/":10,"%":10,"**":11},right_associative:new Set([`**`]),additional_identifier_chars:new Set([`$`,`_`]),literals:{true:!0,false:!1,null:null},this_str:`this`}),c_.max_unop_len=c_.getMaxKeyLen(c_.unary_ops),c_.max_binop_len=c_.getMaxKeyLen(c_.binary_ops);var l_=e=>new c_(e).parse(),Nee=Object.getOwnPropertyNames(class{});Object.getOwnPropertyNames(c_).filter(e=>!Nee.includes(e)&&l_[e]===void 0).forEach(e=>{l_[e]=c_[e]}),l_.Jsep=c_;var Pee=`ConditionalExpression`;l_.plugins.register({name:`ternary`,init(e){e.hooks.add(`after-expression`,function(t){if(t.node&&this.code===e.QUMARK_CODE){this.index++;let n=t.node,r=this.gobbleExpression();if(r||this.throwError(`Expected expression`),this.gobbleSpaces(),this.code===e.COLON_CODE){this.index++;let i=this.gobbleExpression();if(i||this.throwError(`Expected expression`),t.node={type:Pee,test:n,consequent:r,alternate:i},n.operator&&e.binary_ops[n.operator]<=.9){let r=n;for(;r.right.operator&&e.binary_ops[r.right.operator]<=.9;)r=r.right;t.node.test=r.right,r.right=t.node,t.node=n}}else this.throwError(`Expected :`)}})}});var u_=47,Fee=92,Iee={name:`regex`,init(e){e.hooks.add(`gobble-token`,function(t){if(this.code===u_){let n=++this.index,r=!1;for(;this.index<this.expr.length;){if(this.code===u_&&!r){let r=this.expr.slice(n,this.index),i=``;for(;++this.index<this.expr.length;){let e=this.code;if(e>=97&&e<=122||e>=65&&e<=90||e>=48&&e<=57)i+=this.char;else break}let a;try{a=new RegExp(r,i)}catch(e){this.throwError(e.message)}return t.node={type:e.LITERAL,value:a,raw:this.expr.slice(n-1,this.index)},t.node=this.gobbleTokenProperty(t.node),t.node}this.code===e.OBRACK_CODE?r=!0:r&&this.code===e.CBRACK_CODE&&(r=!1),this.index+=this.code===Fee?2:1}this.throwError(`Unclosed Regex`)}})}},d_=43,f_={name:`assignment`,assignmentOperators:new Set([`=`,`*=`,`**=`,`/=`,`%=`,`+=`,`-=`,`<<=`,`>>=`,`>>>=`,`&=`,`^=`,`|=`,`||=`,`&&=`,`??=`]),updateOperators:[d_,45],assignmentPrecedence:.9,init(e){let t=[e.IDENTIFIER,e.MEMBER_EXP];f_.assignmentOperators.forEach(t=>e.addBinaryOp(t,f_.assignmentPrecedence,!0)),e.hooks.add(`gobble-token`,function(e){let n=this.code;f_.updateOperators.some(e=>e===n&&e===this.expr.charCodeAt(this.index+1))&&(this.index+=2,e.node={type:`UpdateExpression`,operator:n===d_?`++`:`--`,argument:this.gobbleTokenProperty(this.gobbleIdentifier()),prefix:!0},(!e.node.argument||!t.includes(e.node.argument.type))&&this.throwError(`Unexpected ${e.node.operator}`))}),e.hooks.add(`after-token`,function(e){if(e.node){let n=this.code;f_.updateOperators.some(e=>e===n&&e===this.expr.charCodeAt(this.index+1))&&(t.includes(e.node.type)||this.throwError(`Unexpected ${e.node.operator}`),this.index+=2,e.node={type:`UpdateExpression`,operator:n===d_?`++`:`--`,argument:e.node,prefix:!1})}}),e.hooks.add(`after-expression`,function(e){e.node&&n(e.node)});function n(e){f_.assignmentOperators.has(e.operator)?(e.type=`AssignmentExpression`,n(e.left),n(e.right)):e.operator||Object.values(e).forEach(e=>{e&&typeof e==`object`&&n(e)})}}};l_.plugins.register(Iee,f_),l_.addUnaryOp(`typeof`),l_.addUnaryOp(`void`),l_.addLiteral(`null`,null),l_.addLiteral(`undefined`,void 0);var Lee=new Set([`constructor`,`__proto__`,`__defineGetter__`,`__defineSetter__`,`__lookupGetter__`,`__lookupSetter__`]),p_={evalAst(e,t){switch(e.type){case`BinaryExpression`:case`LogicalExpression`:return p_.evalBinaryExpression(e,t);case`Compound`:return p_.evalCompound(e,t);case`ConditionalExpression`:return p_.evalConditionalExpression(e,t);case`Identifier`:return p_.evalIdentifier(e,t);case`Literal`:return p_.evalLiteral(e,t);case`MemberExpression`:return p_.evalMemberExpression(e,t);case`UnaryExpression`:return p_.evalUnaryExpression(e,t);case`ArrayExpression`:return p_.evalArrayExpression(e,t);case`CallExpression`:return p_.evalCallExpression(e,t);case`AssignmentExpression`:return p_.evalAssignmentExpression(e,t);default:throw SyntaxError(`Unexpected expression`,e)}},evalBinaryExpression(e,t){return{"||":(e,t)=>e||t(),"&&":(e,t)=>e&&t(),"|":(e,t)=>e|t(),"^":(e,t)=>e^t(),"&":(e,t)=>e&t(),"==":(e,t)=>e==t(),"!=":(e,t)=>e!=t(),"===":(e,t)=>e===t(),"!==":(e,t)=>e!==t(),"<":(e,t)=>e<t(),">":(e,t)=>e>t(),"<=":(e,t)=>e<=t(),">=":(e,t)=>e>=t(),"<<":(e,t)=>e<<t(),">>":(e,t)=>e>>t(),">>>":(e,t)=>e>>>t(),"+":(e,t)=>e+t(),"-":(e,t)=>e-t(),"*":(e,t)=>e*t(),"/":(e,t)=>e/t(),"%":(e,t)=>e%t()}[e.operator](p_.evalAst(e.left,t),()=>p_.evalAst(e.right,t))},evalCompound(e,t){let n;for(let r=0;r<e.body.length;r++){e.body[r].type===`Identifier`&&[`var`,`let`,`const`].includes(e.body[r].name)&&e.body[r+1]&&e.body[r+1].type===`AssignmentExpression`&&(r+=1);let i=e.body[r];n=p_.evalAst(i,t)}return n},evalConditionalExpression(e,t){return p_.evalAst(e.test,t)?p_.evalAst(e.consequent,t):p_.evalAst(e.alternate,t)},evalIdentifier(e,t){if(Object.hasOwn(t,e.name))return t[e.name];throw ReferenceError(`${e.name} is not defined`)},evalLiteral(e){return e.value},evalMemberExpression(e,t){let n=String(e.computed?p_.evalAst(e.property):e.property.name),r=p_.evalAst(e.object,t);if(r==null||!Object.hasOwn(r,n)&&Lee.has(n))throw TypeError(`Cannot read properties of ${r} (reading '${n}')`);let i=r[n];return typeof i==`function`?i.bind(r):i},evalUnaryExpression(e,t){return{"-":e=>-p_.evalAst(e,t),"!":e=>!p_.evalAst(e,t),"~":e=>~p_.evalAst(e,t),"+":e=>+p_.evalAst(e,t),typeof:e=>typeof p_.evalAst(e,t),void:e=>void p_.evalAst(e,t)}[e.operator](e.argument)},evalArrayExpression(e,t){return e.elements.map(e=>p_.evalAst(e,t))},evalCallExpression(e,t){let n=e.arguments.map(e=>p_.evalAst(e,t)),r=p_.evalAst(e.callee,t);if(r===Function)throw Error(`Function constructor is disabled`);return r(...n)},evalAssignmentExpression(e,t){if(e.left.type!==`Identifier`)throw SyntaxError(`Invalid left-hand side in assignment`);let n=e.left.name;return t[n]=p_.evalAst(e.right,t),t[n]}},Ree=class{constructor(e){this.code=e,this.ast=l_(this.code)}runInNewContext(e){let t=Object.assign(Object.create(null),e);return p_.evalAst(this.ast,t)}};function m_(e,t){return e=e.slice(),e.push(t),e}function h_(e,t){return t=t.slice(),t.unshift(e),t}var zee=class extends Error{constructor(e){super(`JSONPath should not be called with "new" (it prevents return of (unwrapped) scalar values)`),this.avoidNew=!0,this.value=e,this.name=`NewError`}};function g_(e,t,n,r,i){if(!(this instanceof g_))try{return new g_(e,t,n,r,i)}catch(e){if(!e.avoidNew)throw e;return e.value}typeof e==`string`&&(i=r,r=n,n=t,t=e,e=null);let a=e&&typeof e==`object`;if(e||={},this.json=e.json||n,this.path=e.path||t,this.resultType=e.resultType||`value`,this.flatten=e.flatten||!1,this.wrap=!Object.hasOwn(e,`wrap`)||e.wrap,this.sandbox=e.sandbox||{},this.eval=e.eval===void 0?`safe`:e.eval,this.ignoreEvalErrors=e.ignoreEvalErrors!==void 0&&e.ignoreEvalErrors,this.parent=e.parent||null,this.parentProperty=e.parentProperty||null,this.callback=e.callback||r||null,this.otherTypeCallback=e.otherTypeCallback||i||function(){throw TypeError(`You must supply an otherTypeCallback callback option with the @other() operator.`)},e.autostart!==!1){let r={path:a?e.path:t};a?`json`in e&&(r.json=e.json):r.json=n;let i=this.evaluate(r);if(!i||typeof i!=`object`)throw new zee(i);return i}}g_.prototype.evaluate=function(e,t,n,r){let i=this.parent,a=this.parentProperty,{flatten:o,wrap:s}=this;if(this.currResultType=this.resultType,this.currEval=this.eval,this.currSandbox=this.sandbox,n||=this.callback,this.currOtherTypeCallback=r||this.otherTypeCallback,t||=this.json,e||=this.path,e&&typeof e==`object`&&!Array.isArray(e)){if(!e.path&&e.path!==``)throw TypeError(`You must supply a "path" property when providing an object argument to JSONPath.evaluate().`);if(!Object.hasOwn(e,`json`))throw TypeError(`You must supply a "json" property when providing an object argument to JSONPath.evaluate().`);({json:t}=e),o=Object.hasOwn(e,`flatten`)?e.flatten:o,this.currResultType=Object.hasOwn(e,`resultType`)?e.resultType:this.currResultType,this.currSandbox=Object.hasOwn(e,`sandbox`)?e.sandbox:this.currSandbox,s=Object.hasOwn(e,`wrap`)?e.wrap:s,this.currEval=Object.hasOwn(e,`eval`)?e.eval:this.currEval,n=Object.hasOwn(e,`callback`)?e.callback:n,this.currOtherTypeCallback=Object.hasOwn(e,`otherTypeCallback`)?e.otherTypeCallback:this.currOtherTypeCallback,i=Object.hasOwn(e,`parent`)?e.parent:i,a=Object.hasOwn(e,`parentProperty`)?e.parentProperty:a,e=e.path}if(i||=null,a||=null,Array.isArray(e)&&(e=g_.toPathString(e)),!e&&e!==``||!t)return;let c=g_.toPathArray(e);c[0]===`$`&&c.length>1&&c.shift(),this._hasParentSelector=null;let l=this._trace(c,t,[`$`],i,a,n).filter(function(e){return e&&!e.isParentSelector});return l.length?!s&&l.length===1&&!l[0].hasArrExpr?this._getPreferredOutput(l[0]):l.reduce((e,t)=>{let n=this._getPreferredOutput(t);return o&&Array.isArray(n)?e=e.concat(n):e.push(n),e},[]):s?[]:void 0},g_.prototype._getPreferredOutput=function(e){let t=this.currResultType;switch(t){case`all`:{let t=Array.isArray(e.path)?e.path:g_.toPathArray(e.path);return e.pointer=g_.toPointer(t),e.path=typeof e.path==`string`?e.path:g_.toPathString(e.path),e}case`value`:case`parent`:case`parentProperty`:return e[t];case`path`:return g_.toPathString(e[t]);case`pointer`:return g_.toPointer(e.path);default:throw TypeError(`Unknown result type`)}},g_.prototype._handleCallback=function(e,t,n){if(t){let r=this._getPreferredOutput(e);e.path=typeof e.path==`string`?e.path:g_.toPathString(e.path),t(r,n,e)}},g_.prototype._trace=function(e,t,n,r,i,a,o,s){let c;if(!e.length)return c={path:n,value:t,parent:r,parentProperty:i,hasArrExpr:o},this._handleCallback(c,a,`value`),c;let l=e[0],u=e.slice(1),d=[];function f(e){Array.isArray(e)?e.forEach(e=>{d.push(e)}):d.push(e)}if((typeof l!=`string`||s)&&t&&Object.hasOwn(t,l))f(this._trace(u,t[l],m_(n,l),t,l,a,o));else if(l===`*`)this._walk(t,e=>{f(this._trace(u,t[e],m_(n,e),t,e,a,!0,!0))});else if(l===`..`)f(this._trace(u,t,n,r,i,a,o)),this._walk(t,r=>{typeof t[r]==`object`&&f(this._trace(e.slice(),t[r],m_(n,r),t,r,a,!0))});else if(l===`^`)return this._hasParentSelector=!0,{path:n.slice(0,-1),expr:u,isParentSelector:!0};else if(l===`~`)return c={path:m_(n,l),value:i,parent:r,parentProperty:null},this._handleCallback(c,a,`property`),c;else if(l===`$`)f(this._trace(u,t,n,null,null,a,o));else if(/^(-?\d*):(-?\d*):?(\d*)$/u.test(l))f(this._slice(l,u,t,n,r,i,a));else if(l.indexOf(`?(`)===0){if(this.currEval===!1)throw Error(`Eval [?(expr)] prevented in JSONPath expression.`);let e=l.replace(/^\?\((.*?)\)$/u,`$1`),o=/@.?([^?]*)[['](\??\(.*?\))(?!.\)\])[\]']/gu.exec(e);o?this._walk(t,e=>{let s=[o[2]],c=o[1]?t[e][o[1]]:t[e];this._trace(s,c,n,r,i,a,!0).length>0&&f(this._trace(u,t[e],m_(n,e),t,e,a,!0))}):this._walk(t,o=>{this._eval(e,t[o],o,n,r,i)&&f(this._trace(u,t[o],m_(n,o),t,o,a,!0))})}else if(l[0]===`(`){if(this.currEval===!1)throw Error(`Eval [(expr)] prevented in JSONPath expression.`);f(this._trace(h_(this._eval(l,t,n.at(-1),n.slice(0,-1),r,i),u),t,n,r,i,a,o))}else if(l[0]===`@`){let e=!1,o=l.slice(1,-2);switch(o){case`scalar`:(!t||![`object`,`function`].includes(typeof t))&&(e=!0);break;case`boolean`:case`string`:case`undefined`:case`function`:typeof t===o&&(e=!0);break;case`integer`:Number.isFinite(t)&&!(t%1)&&(e=!0);break;case`number`:Number.isFinite(t)&&(e=!0);break;case`nonFinite`:typeof t==`number`&&!Number.isFinite(t)&&(e=!0);break;case`object`:t&&typeof t===o&&(e=!0);break;case`array`:Array.isArray(t)&&(e=!0);break;case`other`:e=this.currOtherTypeCallback(t,n,r,i);break;case`null`:t===null&&(e=!0);break;default:throw TypeError(`Unknown value type `+o)}if(e)return c={path:n,value:t,parent:r,parentProperty:i},this._handleCallback(c,a,`value`),c}else if(l[0]==="`"&&t&&Object.hasOwn(t,l.slice(1))){let e=l.slice(1);f(this._trace(u,t[e],m_(n,e),t,e,a,o,!0))}else if(l.includes(`,`)){let e=l.split(`,`);for(let o of e)f(this._trace(h_(o,u),t,n,r,i,a,!0))}else!s&&t&&Object.hasOwn(t,l)&&f(this._trace(u,t[l],m_(n,l),t,l,a,o,!0));if(this._hasParentSelector)for(let e=0;e<d.length;e++){let n=d[e];if(n&&n.isParentSelector){let s=this._trace(n.expr,t,n.path,r,i,a,o);if(Array.isArray(s)){d[e]=s[0];let t=s.length;for(let n=1;n<t;n++)e++,d.splice(e,0,s[n])}else d[e]=s}}return d},g_.prototype._walk=function(e,t){if(Array.isArray(e)){let n=e.length;for(let e=0;e<n;e++)t(e)}else e&&typeof e==`object`&&Object.keys(e).forEach(e=>{t(e)})},g_.prototype._slice=function(e,t,n,r,i,a,o){if(!Array.isArray(n))return;let s=n.length,c=e.split(`:`),l=c[2]&&Number.parseInt(c[2])||1,u=c[0]&&Number.parseInt(c[0])||0,d=c[1]&&Number.parseInt(c[1])||s;u=u<0?Math.max(0,u+s):Math.min(s,u),d=d<0?Math.max(0,d+s):Math.min(s,d);let f=[];for(let e=u;e<d;e+=l)this._trace(h_(e,t),n,r,i,a,o,!0).forEach(e=>{f.push(e)});return f},g_.prototype._eval=function(e,t,n,r,i,a){this.currSandbox._$_parentProperty=a,this.currSandbox._$_parent=i,this.currSandbox._$_property=n,this.currSandbox._$_root=this.json,this.currSandbox._$_v=t;let o=e.includes(`@path`);o&&(this.currSandbox._$_path=g_.toPathString(r.concat([n])));let s=this.currEval+`Script:`+e;if(!g_.cache[s]){let t=e.replaceAll(`@parentProperty`,`_$_parentProperty`).replaceAll(`@parent`,`_$_parent`).replaceAll(`@property`,`_$_property`).replaceAll(`@root`,`_$_root`).replaceAll(/@([.\s)[])/gu,`_$_v$1`);if(o&&(t=t.replaceAll(`@path`,`_$_path`)),this.currEval===`safe`||this.currEval===!0||this.currEval===void 0)g_.cache[s]=new this.safeVm.Script(t);else if(this.currEval===`native`)g_.cache[s]=new this.vm.Script(t);else if(typeof this.currEval==`function`&&this.currEval.prototype&&Object.hasOwn(this.currEval.prototype,`runInNewContext`)){let e=this.currEval;g_.cache[s]=new e(t)}else if(typeof this.currEval==`function`)g_.cache[s]={runInNewContext:e=>this.currEval(t,e)};else throw TypeError(`Unknown "eval" property "${this.currEval}"`)}try{return g_.cache[s].runInNewContext(this.currSandbox)}catch(t){if(this.ignoreEvalErrors)return!1;throw Error(`jsonPath: `+t.message+`: `+e)}},g_.cache={},g_.toPathString=function(e){let t=e,n=t.length,r=`$`;for(let e=1;e<n;e++)/^(~|\^|@.*?\(\))$/u.test(t[e])||(r+=/^[0-9*]+$/u.test(t[e])?`[`+t[e]+`]`:`['`+t[e]+`']`);return r},g_.toPointer=function(e){let t=e,n=t.length,r=``;for(let e=1;e<n;e++)/^(~|\^|@.*?\(\))$/u.test(t[e])||(r+=`/`+t[e].toString().replaceAll(`~`,`~0`).replaceAll(`/`,`~1`));return r},g_.toPathArray=function(e){let{cache:t}=g_;if(t[e])return t[e].concat();let n=[];return t[e]=e.replaceAll(/@(?:null|boolean|number|string|integer|undefined|nonFinite|scalar|array|object|function|other)\(\)/gu,`;$&;`).replaceAll(/[['](\??\(.*?\))[\]'](?!.\])/gu,function(e,t){return`[#`+(n.push(t)-1)+`]`}).replaceAll(/\[['"]([^'\]]*)['"]\]/gu,function(e,t){return`['`+t.replaceAll(`.`,`%@%`).replaceAll(`~`,`%%@@%%`)+`']`}).replaceAll(`~`,`;~;`).replaceAll(/['"]?\.['"]?(?![^[]*\])|\[['"]?/gu,`;`).replaceAll(`%@%`,`.`).replaceAll(`%%@@%%`,`~`).replaceAll(/(?:;)?(\^+)(?:;)?/gu,function(e,t){return`;`+t.split(``).join(`;`)+`;`}).replaceAll(/;;;|;;/gu,`;..;`).replaceAll(/;$|'?\]|'$/gu,``).split(`;`).map(function(e){let t=e.match(/#(\d+)/u);return!t||!t[1]?e:n[t[1]]}),t[e].concat()},g_.prototype.safeVm={Script:Ree};var Bee=function(e,t,n){let r=e.length;for(let i=0;i<r;i++){let r=e[i];n(r)&&t.push(e.splice(i--,1)[0])}},Vee=class{constructor(e){this.code=e}runInNewContext(e){let t=this.code,n=Object.keys(e),r=[];Bee(n,r,t=>typeof e[t]==`function`);let i=n.map(t=>e[t]);t=r.reduce((t,n)=>{let r=e[n].toString();return/function/u.test(r)||(r=`function `+r),`var `+n+`=`+r+`;`+t},``)+t,!/(['"])use strict\1/u.test(t)&&!n.includes(`arguments`)&&(t=`var arguments = undefined;`+t),t=t.replace(/;\s*$/u,``);let a=t.lastIndexOf(`;`),o=a===-1?` return `+t:t.slice(0,a+1)+` return `+t.slice(a+1);return Function(...n,o)(...i)}};g_.prototype.vm={Script:Vee};function __(e){let t=e.type===`contains`?`contains ${e.value}`:e.type===`regex`?`matches regex ${e.pattern}`:e.equals===void 0?`JSONPath ${e.path} exists`:`JSONPath ${e.path} == ${String(e.equals)}`;return`Tool input · ${e.tool} ${t}`}function Hee(e){return e.type===`contains`||e.type===`regex`}function v_(e,t){if(t===`tool_not_used`)return`Tool input assertion failed: tool not used: ${e.tool}`;if(t===`invalid_regex`&&e.type===`regex`)return`Tool input assertion failed: invalid regex ${e.pattern}`;let n=e.type===`contains`?`contains ${e.value}`:e.type===`regex`?`regex ${e.pattern}`:e.equals===void 0?`JSONPath ${e.path} exists`:`JSONPath ${e.path} == ${String(e.equals)}`;return t===`invalid_jsonpath`&&e.type===`jsonpath`?`Tool input assertion failed: invalid JSONPath ${e.path} (expected: ${n})`:t===`serialization`&&Hee(e)?`Tool input assertion failed: could not serialize tool input for ${e.tool} (expected: ${n})`:`Tool input assertion failed: ${e.tool} input did not match (expected: ${n})`}function y_(e){return e.length>0?`Tool sequence · ${e.join(` -> `)}`:`Tool sequence`}function b_(e,t,n=0){let r=t-n;return r<=0?null:e/r}function x_(e){return e==null?void 0:String(e)}var Uee={openai:`openai`,anthropic:`anthropic`,azure:`azure_openai`,azure_foundry:`azure_foundry`,google:`openai`,custom:`openai`};function Wee(e,t){return`${e}-${t+1}`}function Gee(e,t){return t.type===`browser`?{id:e,name:String(t.name||e),type:`browser`,provider:t.provider,model:``,maxTokens:0,url:t.url,newConversationBetweenScenarios:t.newConversationBetweenScenarios}:{id:e,name:String(t.name||e),type:`llm`,provider:t.provider===`azure_openai`?`azure`:t.provider,model:t.model,...w_(t.temperature),maxTokens:t.max_tokens??2048,maxTurns:t.max_turns,systemPrompt:t.system}}function S_(e){return e.type===`browser`?{id:e.id,name:e.name,type:`browser`,provider:e.provider,url:e.url,...e.newConversationBetweenScenarios===void 0?{}:{new_conversation_between_scenarios:e.newConversationBetweenScenarios}}:{id:e.id,name:e.name,provider:Uee[e.provider],model:e.model,...w_(e.temperature),max_tokens:e.maxTokens,max_turns:e.maxTurns,system:e.systemPrompt}}function C_(e){return Gi(e)||void 0}function w_(e){return e===void 0?{}:{temperature:e}}function Kee(e){let t=e.media_type??kee(e)??`application/octet-stream`;return{type:Dee(t),media_type:t,data:e.data??``,...e.url?{url:e.url}:{},...e.name?{name:e.name}:{}}}function qee(e){switch(e.type){case`regex`:return{type:`response_regex`,value:e.pattern};case`contains`:return{type:`response_contains`,value:e.value};case`not_contains`:return{type:`response_not_contains`,value:e.value};case`starts_with`:return{type:`response_starts_with`,value:e.value};case`ends_with`:return{type:`response_ends_with`,value:e.value};case`equals`:return{type:`response_equals`,value:e.value};case`jsonpath`:return{type:`response_jsonpath`,path:e.path,equals:e.equals};case`jsonpath_exists`:return{type:`response_jsonpath_exists`,path:e.path};case`jsonpath_not_exists`:return{type:`response_jsonpath_not_exists`,path:e.path};default:throw Error(`Unsupported response assertion type in config: ${String(e?.type??`(missing type)`)}`)}}function Jee(e){return{type:`tool_input_${e.type}`,tool:e.tool,...e.path?{path:e.path}:{},...e.equals===void 0?{}:{equals:e.equals},...e.value===void 0?{}:{value:e.value},...e.pattern===void 0?{}:{value:e.pattern}}}function Yee(e){if(e.type===`required_tool`||e.type===`forbidden_tool`||e.type===`tool_sequence`||e.type.startsWith(`tool_input_`)||e.type===`agent_check`)return null;let t=x_(e.value);return e.type===`response_contains`?t?{type:`contains`,value:t}:null:e.type===`response_not_contains`?t?{type:`not_contains`,value:t}:null:e.type===`response_starts_with`?t?{type:`starts_with`,value:t}:null:e.type===`response_ends_with`?t?{type:`ends_with`,value:t}:null:e.type===`response_equals`?t?{type:`equals`,value:t}:null:e.type===`response_regex`?t?{type:`regex`,pattern:t}:null:e.type===`response_jsonpath`?e.path?.trim()?e.equals===void 0?{type:`jsonpath`,path:e.path.trim()}:{type:`jsonpath`,path:e.path.trim(),equals:e.equals}:null:e.type===`response_jsonpath_exists`?e.path?.trim()?{type:`jsonpath_exists`,path:e.path.trim()}:null:e.type===`response_jsonpath_not_exists`&&e.path?.trim()?{type:`jsonpath_not_exists`,path:e.path.trim()}:null}function Xee(e,t){let n=e.filter(e=>e.type===`required_tool`).map(e=>e.value).filter(e=>typeof e==`string`&&e.length>0),r=e.filter(e=>e.type===`forbidden_tool`).map(e=>e.value).filter(e=>typeof e==`string`&&e.length>0),i=e.find(e=>e.type===`tool_sequence`)?.sequence?.map(e=>e.trim()).filter(e=>typeof e==`string`&&e.length>0),a=e.map(e=>Yee(e)).filter(e=>!!e),o=e.filter(e=>e.type.startsWith(`tool_input_`)).flatMap(e=>{if(!e.tool)return[];let t=x_(e.value);return e.type===`tool_input_contains`&&t!==void 0?[{type:`contains`,tool:e.tool,value:t}]:e.type===`tool_input_regex`&&t!==void 0?[{type:`regex`,tool:e.tool,pattern:t}]:e.type===`tool_input_jsonpath`&&e.path?[{type:`jsonpath`,tool:e.tool,path:e.path,...e.equals===void 0?{}:{equals:e.equals}}]:[]}),s=e.filter(e=>e.type===`agent_check`).flatMap(e=>e.label?.trim()&&e.prompt?.trim()?[{label:e.label.trim(),prompt:e.prompt.trim()}]:[]),c=n.length>0||r.length>0?{...n.length>0?{required_tools:n}:{},...r.length>0?{forbidden_tools:r}:{}}:void 0,l={...t?.include_prompt?{include_prompt:!0}:{},...t?.include_tool_sequence?{include_tool_sequence:!0}:{},...t?.include_tool_inputs?{include_tool_inputs:!0}:{}},u=Object.keys(l).length>0;if(c||i?.length||o.length!==0||a.length!==0||s.length!==0||u)return{...c?{tool_constraints:c}:{},...i&&i.length>0?{tool_sequence:i}:{},...o.length>0?{tool_input_assertions:o}:{},...a.length>0?{response_assertions:a}:{},...s.length>0?{agent_assertions:s}:{},...u?{agent_context:l}:{}}}function Zee(e){if(e.length!==0)return e.map(e=>({name:e.name,from:`final_text`,regex:e.pattern}))}function T_(e,t){let n=Xee(e.evalRules,e.agentContext),r=Zee(e.extractRules);return{id:e.id,name:C_(e.name),mcp_servers:t,prompt:e.prompt,attachments:e.attachments,eval:n,extract:r}}function E_(e){if(!(`id`in e)||!e.id)return null;let t=String(e.id),n=e.auth;return{id:t,server:{id:t,name:String(e.name||t),transport:`streamable-http`,url:String(e.url||``),authType:n?.type===`bearer`?`bearer`:n?.type===`api_key`||n?.type===`oauth_client_credentials`?`api-key`:n?.type===`oauth_authorization_code`?`oauth2`:`none`,authValue:n?.type===`bearer`?String(n.token||``)||(n.env?`\${${n.env}}`:void 0):n?.type===`api_key`?String(n.value||``):void 0,apiKeyHeaderName:n?.type===`api_key`?String(n.header_name||``):void 0,oauthClientId:n?.type===`oauth_authorization_code`&&String(n.client_id||``)||void 0,oauthClientSecret:n?.type===`oauth_authorization_code`&&String(n.client_secret||``)||void 0,oauthRedirectUrl:n?.type===`oauth_authorization_code`&&String(n.redirect_url||``)||void 0,oauthScope:(n?.type===`oauth_authorization_code`||n?.type===`oauth_client_credentials`)&&String(n.scope||``)||void 0,oauthMode:n?.type===`oauth_authorization_code`?n.mode:void 0,oauthAuthorizationUrl:n?.type===`oauth_authorization_code`&&String(n.authorization_url||``)||void 0,oauthTokenEndpoint:n?.type===`oauth_authorization_code`&&String(n.token_url||``)||void 0,oauthTokenUrl:n?.type===`oauth_client_credentials`?String(n.token_url||``):void 0,oauthClientIdEnv:n?.type===`oauth_client_credentials`?String(n.client_id_env||``):void 0,oauthClientSecretEnv:n?.type===`oauth_client_credentials`?String(n.client_secret_env||``):void 0,oauthAudience:n?.type===`oauth_client_credentials`&&String(n.audience||``)||void 0}}}function D_(e){let 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:[],i=new Map,a=[],o=[];for(let e of n){if(`ref`in e){let t=String(e.ref||``).trim();if(!t)continue;i.set(t,t),o.push({kind:`referenced`,ref:t});continue}let t=String(e.id||e.name||``).trim();if(!t)continue;let n=t;i.set(t,n);let r=e.auth?.type===`bearer`?`bearer`:e.auth?.type===`api_key`||e.auth?.type===`oauth_client_credentials`?`api-key`:e.auth?.type===`oauth_authorization_code`?`oauth2`:`none`,s={id:n,name:String(e.name||t),transport:`streamable-http`,url:e.url,authType:r,authValue:e.auth?.type===`bearer`?e.auth.token??(e.auth.env?`\${${e.auth.env}}`:void 0):e.auth?.type===`api_key`?e.auth.value:void 0,apiKeyHeaderName:e.auth?.type===`api_key`?e.auth.header_name:void 0,oauthClientId:e.auth?.type===`oauth_authorization_code`?e.auth.client_id:void 0,oauthClientSecret:e.auth?.type===`oauth_authorization_code`?e.auth.client_secret:void 0,oauthRedirectUrl:e.auth?.type===`oauth_authorization_code`?e.auth.redirect_url:void 0,oauthScope:e.auth?.type===`oauth_authorization_code`||e.auth?.type===`oauth_client_credentials`?e.auth.scope:void 0,oauthMode:e.auth?.type===`oauth_authorization_code`?e.auth.mode:void 0,oauthAuthorizationUrl:e.auth?.type===`oauth_authorization_code`?e.auth.authorization_url:void 0,oauthTokenEndpoint:e.auth?.type===`oauth_authorization_code`?e.auth.token_url:void 0,oauthTokenUrl:e.auth?.type===`oauth_client_credentials`?e.auth.token_url:void 0,oauthClientIdEnv:e.auth?.type===`oauth_client_credentials`?e.auth.client_id_env:void 0,oauthClientSecretEnv:e.auth?.type===`oauth_client_credentials`?e.auth.client_secret_env:void 0,oauthAudience:e.auth?.type===`oauth_client_credentials`?e.auth.audience:void 0};a.push(s),o.push({kind:`inline`,server:s})}let s=[],c=[];for(let e of r){if(`ref`in e){let t=String(e.ref||``).trim();if(!t)continue;c.push({kind:`referenced`,ref:t});continue}let t=String(e.id||e.name||``).trim();if(!t)continue;let n=Gee(t,e);s.push(n),c.push({kind:`inline`,agent:n})}let l=[],u=[];return e.config.scenarios.forEach((e,t)=>{if(`ref`in e){let t=String(e.ref||``).trim();if(!t)return;let n=e.mcp_servers,r=Array.isArray(n)?n.flatMap(e=>{let t=e;if(`ref`in t&&t.ref)return[{kind:`referenced`,ref:String(t.ref)}];let n=E_(t);return n?[{kind:`inline`,server:n.server}]:[]}):void 0;u.push({kind:`referenced`,ref:t,...r?{mcpServers:r}:{}});return}let n=[];for(let t of e.eval?.tool_constraints?.required_tools??[])n.push({type:`required_tool`,value:t});for(let t of e.eval?.tool_constraints?.forbidden_tools??[])n.push({type:`forbidden_tool`,value:t});e.eval?.tool_sequence?.length&&n.push({type:`tool_sequence`,sequence:[...e.eval.tool_sequence]});for(let t of e.eval?.response_assertions??[])n.push(qee(t));for(let t of e.eval?.tool_input_assertions??[])n.push(Jee(t));for(let t of e.eval?.agent_assertions??[])n.push({type:`agent_check`,label:t.label,prompt:t.prompt});let r=e.eval?.agent_context&&(e.eval.agent_context.include_prompt||e.eval.agent_context.include_tool_sequence||e.eval.agent_context.include_tool_inputs)?{include_prompt:e.eval.agent_context.include_prompt,include_tool_sequence:e.eval.agent_context.include_tool_sequence,include_tool_inputs:e.eval.agent_context.include_tool_inputs}:void 0,s={id:e.id||Wee(`scn`,t),name:C_(e.name)||e.id||`Scenario ${t+1}`,serverIds:(()=>{if((e.servers??[]).length>0)return e.servers.map(e=>i.get(e)??e).filter(Boolean);let t=e.mcp_servers;return Array.isArray(t)?t.flatMap(e=>{if(`ref`in e&&e.ref)return[String(e.ref)];let t=E_(e);if(t){let e=t.id;return i.has(e)||(i.set(e,e),a.push(t.server),o.push({kind:`inline`,server:a[a.length-1]})),[e]}return[]}):[]})(),prompt:e.prompt,attachments:e.attachments?.map(Kee),evalRules:n,extractRules:(e.extract??[]).map(e=>({name:e.name,pattern:e.regex})),...r?{agentContext:r}:{}};l.push(s),u.push({kind:`inline`,scenario:s})}),{id:e.id,name:t||e.name,configName:t,configHash:e.hash,...typeof e.config.description==`string`&&e.config.description.trim()?{description:e.config.description.trim()}:{},...e.relativePath?{relativePath:e.relativePath}:{},...e.suitePath===void 0?{}:{suitePath:e.suitePath},loadError:e.error,loadWarnings:e.warnings,servers:a,serverEntries:o,agents:s,agentEntries:c,scenarios:l,scenarioEntries:u,runDefaults:e.config.run_defaults?.selected_agents&&e.config.run_defaults.selected_agents.length>0?{selectedAgentNames:[...e.config.run_defaults.selected_agents]}:void 0,createdAt:e.mtime,updatedAt:e.mtime,sourcePath:e.path}}function Qee(e){let t=D_({id:`library`,name:`library`,path:`library`,mtime:new Date(0).toISOString(),hash:``,config:{servers:Object.entries(e.servers).map(([e,t])=>({id:e,name:C_(t.name)||e,transport:t.transport,url:t.url,auth:t.auth})),agents:Object.entries(e.agents).map(([e,t])=>({id:e,...t})),scenarios:e.scenarios.map((e,t)=>({...e,name:C_(e.name)||e.id||`Scenario ${t+1}`}))}});return{servers:t.servers,agents:t.agents,scenarios:t.scenarios,browserProviders:e.browserProviders??{}}}function O_(e){let t=new Map,n=e=>{let t=e.id,n=e.authValue?.trim()??``,r=e.apiKeyHeaderName?.trim()??``,i=e.authType===`bearer`?(()=>{if(!n)throw Error(`Server '${t}' is missing bearer token value`);return{type:`bearer`,token:n}})():e.authType===`api-key`&&!e.oauthTokenUrl?{type:`api_key`,...r?{header_name:r}:{},value:(()=>{if(!n)throw Error(`Server '${t}' is missing API key value`);return n})()}:e.authType===`api-key`?{type:`oauth_client_credentials`,token_url:e.oauthTokenUrl||``,client_id_env:e.oauthClientIdEnv||``,client_secret_env:e.oauthClientSecretEnv||``,...e.oauthScope?{scope:e.oauthScope}:{},...e.oauthAudience?{audience:e.oauthAudience}:{}}:e.authType===`oauth2`?{type:`oauth_authorization_code`,...e.oauthMode===`dcr`?{mode:`dcr`}:{},...e.oauthMode!==`dcr`&&e.oauthClientId?{client_id:e.oauthClientId}:{},...e.oauthClientSecret?{client_secret:e.oauthClientSecret}:{},...e.oauthRedirectUrl?{redirect_url:e.oauthRedirectUrl}:{},...e.oauthScope?{scope:e.oauthScope}:{},...e.oauthAuthorizationUrl?{authorization_url:e.oauthAuthorizationUrl}:{},...e.oauthTokenEndpoint?{token_url:e.oauthTokenEndpoint}:{}}:void 0;return{id:t,...e.name&&e.name!==t?{name:e.name}:{},transport:`http`,url:e.url||`http://localhost:3000/mcp`,...i===void 0?{}:{auth:i}}},r=e.serverEntries&&e.serverEntries.length>0?e.serverEntries:[...e.servers.map(e=>({kind:`inline`,server:e}))],i=new Set,a=new Map,o=r.flatMap(e=>{if(e.kind===`referenced`){let n=String(e.ref||``).trim();return!n||i.has(n)?[]:(i.add(n),t.set(n,n),[{ref:n}])}let r=n(e.server);return t.set(e.server.id,r.id),a.set(r.id,r),[r]}),s=e=>S_(e),c=e.agentEntries&&e.agentEntries.length>0?e.agentEntries:[...e.agents.map(e=>({kind:`inline`,agent:e}))],l=new Set,u=c.flatMap(e=>{if(e.kind===`referenced`){let t=String(e.ref||``).trim();return!t||l.has(t)?[]:(l.add(t),[{ref:t}])}return[s(e.agent)]}),d=e=>T_(e,e.serverIds.length>0?e.serverIds.map(e=>{let n=t.get(e)??e;return a.get(n)??{ref:n}}):void 0),f=e.scenarioEntries&&e.scenarioEntries.length>0?e.scenarioEntries.map(e=>e.kind===`referenced`?{ref:e.ref,...Array.isArray(e.mcpServers)?{mcp_servers:e.mcpServers.map(e=>e.kind===`referenced`?{ref:e.ref}:n(e.server))}:{}}:d(e.scenario)):[...e.scenarios.map(e=>d(e))];return{name:e.configName?.trim()||void 0,description:e.description?.trim()||void 0,servers:o,agents:u,scenarios:f,run_defaults:e.runDefaults?.selectedAgentNames&&e.runDefaults.selectedAgentNames.length>0?{selected_agents:[...e.runDefaults.selectedAgentNames]}:void 0}}function $ee(e){return{servers:Object.fromEntries((e.servers??[]).map(e=>[e.id,(()=>{let t=e.authValue?.trim()??``,n=e.apiKeyHeaderName?.trim()??``;return{...e.name&&e.name!==e.id?{name:e.name}:{},transport:`http`,url:e.url||`http://localhost:3000/mcp`,auth:e.authType===`bearer`?(()=>{if(!t)throw Error(`Server '${e.id}' is missing bearer token value`);return{type:`bearer`,token:t}})():e.authType===`api-key`&&!e.oauthTokenUrl?{type:`api_key`,...n?{header_name:n}:{},value:(()=>{if(!t)throw Error(`Server '${e.id}' is missing API key value`);return t})()}:e.authType===`api-key`?{type:`oauth_client_credentials`,token_url:e.oauthTokenUrl||``,client_id_env:e.oauthClientIdEnv||``,client_secret_env:e.oauthClientSecretEnv||``,...e.oauthScope?{scope:e.oauthScope}:{},...e.oauthAudience?{audience:e.oauthAudience}:{}}:e.authType===`oauth2`?{type:`oauth_authorization_code`,...e.oauthMode===`dcr`?{mode:`dcr`}:{},...e.oauthMode!==`dcr`&&e.oauthClientId?{client_id:e.oauthClientId}:{},...e.oauthClientSecret?{client_secret:e.oauthClientSecret}:{},...e.oauthRedirectUrl?{redirect_url:e.oauthRedirectUrl}:{},...e.oauthScope?{scope:e.oauthScope}:{},...e.oauthAuthorizationUrl?{authorization_url:e.oauthAuthorizationUrl}:{},...e.oauthTokenEndpoint?{token_url:e.oauthTokenEndpoint}:{}}:void 0}})()])),agents:Object.fromEntries(e.agents.map(e=>{let{id:t,...n}=S_(e);return[e.id,n]})),scenarios:e.scenarios.map(e=>T_(e,e.serverIds.length>0?e.serverIds.map(e=>({ref:e})):void 0)),browserProviders:e.browserProviders}}function k_(e,t){if(e)return`${e}::${t??``}`}function A_(e){return e.type===`text`}function j_(e,t){if(!t)return e.tool_calls.map((t,n)=>({name:t,arguments:{},duration:e.tool_durations_ms[n]??0,timestamp:new Date().toISOString()}));let n=[],r=new Map;for(let e of t.messages)for(let t of e.content)t.type===`tool_use`?n.push({id:t.id,name:t.name,input:t.input??{},ts:e.ts}):t.type===`tool_result`&&r.set(t.tool_use_id,{durationMs:t.duration_ms,tsEnd:t.ts_end});return n.map((t,n)=>{let i=r.get(t.id);return{name:t.name,arguments:t.input,duration:i?.durationMs??e.tool_durations_ms[n]??0,timestamp:i?.tsEnd??t.ts??new Date().toISOString()}})}function M_(e,t){let n=[];if(!e)return t&&n.push({id:`user_prompt-0`,kind:`user_prompt`,text:t,timestamp:void 0}),n;let r,i=e.messages??[];for(let e=0;e<i.length;e+=1){let t=i[e];if(t.role===`user`)for(let e of t.content)e.type===`text`?n.push({id:`user_prompt-${n.length}`,kind:`user_prompt`,text:e.text,timestamp:t.ts}):e.type===`image`?n.push({id:`attachment-${n.length}`,kind:`user_prompt`,text:`[Attached image: ${e.name??`image`}]`,timestamp:t.ts}):e.type===`document`&&n.push({id:`attachment-${n.length}`,kind:`user_prompt`,text:`[Attached document: ${e.name??`document`} (${e.media_type})]`,timestamp:t.ts});else if(t.role===`assistant`){let a=t.content.filter(e=>e.type===`tool_use`);for(let e of t.content)e.type===`text`&&(n.push({id:`assistant_thought-${n.length}`,kind:`assistant_thought`,text:e.text,timestamp:t.ts}),r=n.length-1);let o=i[e+1],s=o?.role===`tool`;if(a.length>0&&s){let r=new Map,i=[];for(let e of o.content)e.type===`tool_result`&&(e.tool_use_id?r.set(e.tool_use_id,e):i.push(e));for(let e of a){n.push({id:`tool_call-${n.length}`,kind:`tool_call`,text:N_(e.input??{}),toolName:e.name,timestamp:t.ts,estimatedTokens:e.estimated_tokens?{inputTokens:e.estimated_tokens.input,outputTokens:e.estimated_tokens.output,totalTokens:e.estimated_tokens.total}:void 0,estimatedTokenMethod:e.estimated_tokens?.method});let i=r.get(e.id);if(!i)continue;let a=i.content.filter(A_).map(e=>e.text).join(`
|
|
57
|
-
`);n.push({id:`tool_result-${n.length}`,kind:`tool_result`,text:a,toolName:i.name,ok:!i.is_error,durationMs:i.duration_ms,timestamp:i.ts_end??o.ts,estimatedTokens:i.estimated_tokens?{inputTokens:i.estimated_tokens.input,outputTokens:i.estimated_tokens.output,totalTokens:i.estimated_tokens.total}:void 0,estimatedTokenMethod:i.estimated_tokens?.method}),r.delete(e.id)}for(let e of[...r.values(),...i]){let t=e.content.filter(A_).map(e=>e.text).join(`
|
|
58
|
-
`);n.push({id:`tool_result-${n.length}`,kind:`tool_result`,text:t,toolName:e.name,ok:!e.is_error,durationMs:e.duration_ms,timestamp:e.ts_end??o.ts,estimatedTokens:e.estimated_tokens?{inputTokens:e.estimated_tokens.input,outputTokens:e.estimated_tokens.output,totalTokens:e.estimated_tokens.total}:void 0,estimatedTokenMethod:e.estimated_tokens?.method})}e+=1}else for(let e of a)n.push({id:`tool_call-${n.length}`,kind:`tool_call`,text:N_(e.input??{}),toolName:e.name,timestamp:t.ts,estimatedTokens:e.estimated_tokens?{inputTokens:e.estimated_tokens.input,outputTokens:e.estimated_tokens.output,totalTokens:e.estimated_tokens.total}:void 0,estimatedTokenMethod:e.estimated_tokens?.method})}else if(t.role===`tool`)for(let e of t.content){if(e.type!==`tool_result`)continue;let r=e.content.filter(A_).map(e=>e.text).join(`
|
|
59
|
-
`);n.push({id:`tool_result-${n.length}`,kind:`tool_result`,text:r,toolName:e.name,ok:!e.is_error,durationMs:e.duration_ms,timestamp:e.ts_end??t.ts,estimatedTokens:e.estimated_tokens?{inputTokens:e.estimated_tokens.input,outputTokens:e.estimated_tokens.output,totalTokens:e.estimated_tokens.total}:void 0,estimatedTokenMethod:e.estimated_tokens?.method})}}return typeof r==`number`&&n[r]&&(n[r]={...n[r],kind:`assistant_final`}),n}function N_(e){try{return JSON.stringify(e)}catch{return String(e)}}function P_(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 F_(e,t){if(typeof e!=`number`||t<=0)return Array(t).fill(void 0);let n=Math.floor(e/t),r=e%t;return Array.from({length:t},(e,t)=>n+ +(t<r))}function I_(e){let t=$g(),n=$g(),r=new Map;if(!e)return{assistant:null,tool:null,perTool:{}};for(let i of e.messages??[]){if(i.role!==`assistant`)continue;P_(t,i.usage);let e=i.content.filter(e=>e.type===`tool_use`);if(e.length===0)continue;if(e.every(e=>!!e.estimated_tokens)){for(let t of e){let e=t.estimated_tokens;n.input+=e.input,n.hasInput=!0,n.output+=e.output,n.hasOutput=!0,n.total+=e.total,n.hasTotal=!0;let i=r.get(t.name)??$g();i.input+=e.input,i.hasInput=!0,i.output+=e.output,i.hasOutput=!0,i.total+=e.total,i.hasTotal=!0,r.set(t.name,i)}continue}P_(n,i.usage);let a=F_(i.usage?.input_tokens,e.length),o=F_(i.usage?.output_tokens,e.length),s=F_(i.usage?.total_tokens,e.length);for(let t=0;t<e.length;t+=1){let n=e[t].name,i=r.get(n)??$g(),c=a[t],l=o[t],u=s[t];typeof c==`number`&&(i.input+=c,i.hasInput=!0),typeof l==`number`&&(i.output+=l,i.hasOutput=!0),typeof u==`number`&&(i.total+=u,i.hasTotal=!0),r.set(n,i)}}let i={};for(let[e,t]of Array.from(r.entries()).sort((e,t)=>e[0].localeCompare(t[0]))){let n=t_(t);n&&(i[e]=n)}return{assistant:t_(t),tool:t_(n),perTool:i}}function L_(e,t){if(t){let e=Date.parse(t.ts_start),n=Date.parse(t.ts_end);if(Number.isFinite(e)&&Number.isFinite(n))return Math.max(0,n-e)}return e.tool_durations_ms.reduce((e,t)=>e+t,0)}function R_(e){return r_(e.flatMap(e=>e.checkResults??[]))}function z_(e){return e?.map(e=>({...e,status:e.status===`not_applicable`?`not_evaluated`:e.status}))}function B_(e,t=[],n){let r=new Map;for(let e of t){let t=k_(e.scenario_id,e.agent);if(!t)continue;let n=r.get(t)??[];n.push(e),r.set(t,n)}let i=e.scenarios.map(e=>{let t=r.get(`${e.scenario_id}::${e.agent}`)??[],n=new Map;for(let e of t)n.set(e.run_index,e);let i=e.runs.map((e,r)=>{let i=n.get(e.run_index)??t[r],a=I_(i);return{runIndex:e.run_index,passed:e.pass,outcome:e.outcome,error:e.error,stopReason:e.stop_reason,toolCalls:j_(e,i),assistantTokenUsage:a.assistant,toolTokenUsage:a.tool,toolTokenUsageByTool:a.perTool,finalAnswer:e.final_text,conversation:M_(i),duration:L_(e,i),extractedValues:Object.fromEntries(Object.entries(e.extracted).map(([e,t])=>[e,String(t??``)])),failureReasons:e.failures,checkResults:z_(e.check_results)}}),a=$g(),o=$g(),s=new Map;for(let e of i){e_(a,e.assistantTokenUsage),e_(o,e.toolTokenUsage);for(let[t,n]of Object.entries(e.toolTokenUsageByTool??{})){let e=s.get(t)??$g();e_(e,n),s.set(t,e)}}let c={};for(let[e,t]of Array.from(s.entries()).sort((e,t)=>e[0].localeCompare(t[0]))){let n=t_(t);n&&(c[e]=n)}let l=i.length===0?0:Math.round(i.reduce((e,t)=>e+t.duration,0)/i.length),u=i.length===0?0:i.reduce((e,t)=>e+t.toolCalls.length,0)/i.length;return{scenarioId:e.scenario_id,scenarioName:e.scenario_name||e.scenario_id,agentId:e.agent,agentName:e.agent,provider:e.provider,model:e.model,runs:i,passRate:i.some(e=>e.outcome!==`stopped`)?e.pass_rate:null,avgToolCalls:u,avgDuration:l,checkCounts:R_(i),assistantTokenUsage:t_(a),toolTokenUsage:t_(o),toolTokenUsageByTool:c}}),a=$g(),o=$g();for(let e of i)e_(a,e.assistantTokenUsage),e_(o,e.toolTokenUsage);let s=i.reduce((e,t)=>(e.passed+=t.checkCounts?.passed??0,e.failed+=t.checkCounts?.failed??0,e.not_evaluated+=t.checkCounts?.not_evaluated??0,e.not_executed+=t.checkCounts?.not_executed??0,e.total+=t.checkCounts?.total??0,e),{passed:0,failed:0,not_evaluated:0,not_executed:0,total:0});return{id:n??e.metadata.run_id,configId:``,configHash:e.metadata.config_hash,configPath:e.metadata.config_path,configName:e.metadata.config_name,langsmithTraceUrls:e.metadata.langsmith_trace_urls,rerunAgents:e.metadata.rerun_agents,rerunScenarioIds:e.metadata.rerun_scenario_ids,rerunServerOverrideAll:e.metadata.rerun_server_override_all,rerunNewConversationBeforeStart:e.metadata.rerun_new_conversation_before_start,rerunNewConversationBetweenScenarios:e.metadata.rerun_new_conversation_between_scenarios,rerunScenarioServerOverrides:e.metadata.rerun_scenario_server_overrides,timestamp:e.metadata.timestamp,runNote:e.metadata.run_note,mcpServerVersions:e.metadata.mcp_server_versions??{},scenarios:i,assistantTokenUsage:t_(a),toolTokenUsage:t_(o),overallPassRate:e.summary.total_runs<=(e.summary.outcomes?.stopped??i.flatMap(e=>e.runs).filter(e=>e.outcome===`stopped`).length)?null: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),checkCounts:s,totalToolDurationMs:typeof e.metadata.total_tool_duration_ms==`number`?Math.max(0,e.metadata.total_tool_duration_ms??0):0,outcomes:e.summary.outcomes,executionSource:e.metadata.execution_source,executionClient:e.metadata.execution_client,evaluationRunId:e.metadata.evaluation_run_id??e.metadata.evaluation_group_id}}function V_(e,t){let n=I_(t??void 0);return{runIndex:e.run_index,passed:e.pass,outcome:e.outcome,error:e.error,stopReason:e.stop_reason,toolCalls:j_(e,t??void 0),assistantTokenUsage:n.assistant,toolTokenUsage:n.tool,toolTokenUsageByTool:n.perTool,finalAnswer:e.final_text,conversation:M_(t??void 0),duration:L_(e,t??void 0),extractedValues:Object.fromEntries(Object.entries(e.extracted).map(([e,t])=>[e,String(t??``)])),failureReasons:e.failures,checkResults:z_(e.check_results)}}function H_(){return typeof window>`u`?``:window.location.port===`8685`?`http://127.0.0.1:8787`:``}var U_=H_(),W_=class extends Error{status;constructor(e,t){super(t),this.status=e,this.name=`ApiError`}};async function G_(e,t){let n=await fetch(`${U_}${e}`,{...t,headers:{"content-type":`application/json`,...t?.headers||{}}});if(!n.ok){let e=await n.text();throw new W_(n.status,`Request failed (${n.status}): ${e}`)}return await n.json()}async function K_(e,t){let n=await fetch(`${U_}${e}`,{...t,headers:{...t?.body?{"content-type":`application/json`}:{},...t?.headers||{}}});if(!n.ok){let e=await n.text();throw new W_(n.status,`Request failed (${n.status}): ${e}`)}return n.text()}var q_={session_started:!0,turn_started:!0,tool_call_requested:!0,tool_call_approved:!0,tool_call_denied:!0,tool_call_resolved:!0,assistant_message_delta:!0,assistant_reasoning_delta:!0,assistant_message_completed:!0,session_snapshot:!0,session_warning:!0,session_error:!0,session_finished:!0};function J_(e,t){let n=new EventSource(`${U_}${e}`),r=e.replace(/\/events$/,``),i=Object.keys(q_),a=!1,o=()=>{a||(a=!0,n.close())},s=e=>{if(!a&&typeof e.data==`string`&&e.data)try{let n=JSON.parse(e.data);n.type===`session_finished`&&o(),t(n)}catch{}};for(let e of i)n.addEventListener(e,s);return n.onerror=()=>{a||(n.readyState===2?o():fetch(`${U_}${r}`,{method:`GET`,cache:`no-store`,headers:{accept:`application/json`}}).then(e=>{(e.status===404||e.status===410)&&o()}).catch(()=>{}))},()=>o()}function Y_(e,t,n){if(typeof n!=`number`||!Number.isFinite(n))return;let r=Math.floor(n);r<=0||e.set(t,String(r))}function X_(e,t,n){if(typeof n!=`number`||!Number.isFinite(n))return;let r=Math.floor(n);r<0||e.set(t,String(r))}var G={health:()=>G_(`/api/health`),getSettings:()=>G_(`/api/settings`),testAgentConnection:(e,t)=>G_(`/api/agents/test`,{method:`POST`,body:JSON.stringify(e),signal:t}),testDecisionConnection:(e,t)=>G_(`/api/settings/decision/test`,{method:`POST`,body:JSON.stringify(e),signal:t}),updateSettings:e=>G_(`/api/settings`,{method:`PUT`,body:JSON.stringify(e)}),listConfigs:()=>G_(`/api/evals`),createConfig:(e,t)=>G_(`/api/evals`,{method:`POST`,body:JSON.stringify({fileName:e,config:t})}),updateConfig:(e,t,n)=>G_(`/api/evals/${e}`,{method:`PUT`,body:JSON.stringify({config:t,fileName:n})}),deleteConfig:e=>G_(`/api/evals/${e}`,{method:`DELETE`}),listRuns:e=>{let t=new URLSearchParams;return e?.since?.trim()&&t.set(`since`,e.since.trim()),e?.until?.trim()&&t.set(`until`,e.until.trim()),typeof e?.lastDays==`number`&&Number.isFinite(e.lastDays)&&e.lastDays>0&&t.set(`last_days`,String(Math.floor(e.lastDays))),e?.scenario?.trim()&&t.set(`scenario`,e.scenario.trim()),Y_(t,`limit`,e?.limit),X_(t,`offset`,e?.offset),G_(`/api/runs${t.size>0?`?${t.toString()}`:``}`)},getLatestPassRatesByConfigIds:e=>G_(`/api/runs/latest-pass-rates`,{method:`POST`,body:JSON.stringify(e)}).then(e=>e.byConfigId),listMarkdownReports:e=>{let t=new URLSearchParams;return Y_(t,`limit`,e?.limit),X_(t,`offset`,e?.offset),G_(`/api/markdown-reports${t.size>0?`?${t.toString()}`:``}`)},listToolAnalysisServers:()=>G_(`/api/tool-analysis-results/servers`).then(e=>e.data),getMarkdownReport:e=>G_(`/api/markdown-reports/content?path=${encodeURIComponent(e)}`),getMarkdownReportById:e=>G_(`/api/markdown-reports/${encodeURIComponent(e)}`),deleteMarkdownReport:e=>G_(`/api/markdown-reports?path=${encodeURIComponent(e)}`,{method:`DELETE`}).then(()=>void 0),getRun:e=>G_(`/api/runs/${e}`),deleteRun:e=>G_(`/api/runs/${e}`,{method:`DELETE`}),updateRunNote:(e,t)=>G_(`/api/runs/${encodeURIComponent(e)}/note`,{method:`PATCH`,body:JSON.stringify({runNote:t??``})}).then(()=>void 0),getRunTrace:e=>G_(`/api/runs/${e}/trace`),applyResultAssistantReport:e=>G_(`/api/runs/${encodeURIComponent(e.runId)}/assistant/apply-report`,{method:`POST`,body:JSON.stringify({markdown:e.markdown,outputPath:e.outputPath,overwrite:e.overwrite})}),createResultAssistantSession:(e,t)=>G_(`/api/result-assistant/sessions`,{method:`POST`,body:JSON.stringify(e),signal:t}),getResultAssistantSession:e=>G_(`/api/result-assistant/sessions/${e}`),sendResultAssistantMessage:(e,t,n,r)=>G_(`/api/result-assistant/sessions/${e}/messages`,{method:`POST`,body:JSON.stringify({message:t,...r?{turnId:r}:{}}),signal:n}),cancelResultAssistantTurn:(e,t)=>G_(`/api/result-assistant/sessions/${e}/turns/${encodeURIComponent(t)}/cancel`,{method:`POST`,body:JSON.stringify({})}),approveResultAssistantToolCall:(e,t,n)=>G_(`/api/result-assistant/sessions/${e}/tool-calls/${t}/approve`,{method:`POST`,body:JSON.stringify(n===void 0?{}:{argumentsOverride:n})}),denyResultAssistantToolCall:(e,t,n)=>G_(`/api/result-assistant/sessions/${e}/tool-calls/${t}/deny`,{method:`POST`,body:JSON.stringify(n?{message:n}:{})}),closeResultAssistantSession:e=>G_(`/api/result-assistant/sessions/${e}`,{method:`DELETE`}).then(()=>void 0),subscribeResultAssistantSessionEvents:(e,t)=>J_(`/api/result-assistant/sessions/${e}/events`,t),getLibraries:()=>G_(`/api/libraries`),saveLibraries:e=>G_(`/api/libraries`,{method:`PUT`,body:JSON.stringify(e)}),startRun:e=>G_(`/api/runs`,{method:`POST`,body:JSON.stringify(e)}),runScenarioPreview:e=>G_(`/api/runs/preview`,{method:`POST`,body:JSON.stringify(e)}),listProviderModels:e=>G_(`/api/providers/models?provider=${encodeURIComponent(e)}`),createScenarioAssistantSession:(e,t)=>G_(`/api/scenario-assistant/sessions`,{method:`POST`,body:JSON.stringify(e),signal:t}),getScenarioAssistantSession:e=>G_(`/api/scenario-assistant/sessions/${e}`),sendScenarioAssistantMessage:(e,t,n,r)=>G_(`/api/scenario-assistant/sessions/${e}/messages`,{method:`POST`,body:JSON.stringify({message:t,...r?{turnId:r}:{}}),signal:n}),cancelScenarioAssistantTurn:(e,t)=>G_(`/api/scenario-assistant/sessions/${e}/turns/${encodeURIComponent(t)}/cancel`,{method:`POST`,body:JSON.stringify({})}),approveScenarioAssistantToolCall:(e,t,n)=>G_(`/api/scenario-assistant/sessions/${e}/tool-calls/${t}/approve`,{method:`POST`,body:JSON.stringify(n===void 0?{}:{argumentsOverride:n})}),denyScenarioAssistantToolCall:(e,t,n)=>G_(`/api/scenario-assistant/sessions/${e}/tool-calls/${t}/deny`,{method:`POST`,body:JSON.stringify(n?{message:n}:{})}),approveAllScenarioAssistantToolCalls:e=>G_(`/api/scenario-assistant/sessions/${e}/tool-calls/approve-all`,{method:`POST`,body:JSON.stringify({})}),closeScenarioAssistantSession:e=>G_(`/api/scenario-assistant/sessions/${e}`,{method:`DELETE`}),subscribeScenarioAssistantSessionEvents:(e,t)=>J_(`/api/scenario-assistant/sessions/${e}/events`,t),discoverToolsForAnalysis:e=>G_(`/api/tool-analysis/discover-tools`,{method:`POST`,body:JSON.stringify(e)}),startToolAnalysis:e=>G_(`/api/tool-analysis/jobs`,{method:`POST`,body:JSON.stringify(e)}),getToolAnalysisResult:e=>G_(`/api/tool-analysis/jobs/${e}/result`),stopToolAnalysis:e=>G_(`/api/tool-analysis/jobs/${e}/stop`,{method:`POST`}),subscribeToolAnalysisJob:(e,t)=>{let n=new EventSource(`${U_}/api/tool-analysis/jobs/${e}/events`),r=!1,i=()=>{r||(r=!0,n.close())},a=e=>{if(!r&&typeof e.data==`string`&&e.data)try{let n=JSON.parse(e.data);t(n),(n.type===`completed`||n.type===`error`)&&i()}catch{}};return n.addEventListener(`started`,a),n.addEventListener(`log`,a),n.addEventListener(`completed`,a),n.addEventListener(`error`,a),n.onerror=()=>{r||(t({type:`error`,ts:new Date().toISOString(),payload:{message:`SSE connection error`}}),i())},()=>i()},listToolAnalysisResults:e=>{let t=new URLSearchParams;return Y_(t,`limit`,e?.limit),X_(t,`offset`,e?.offset),e?.server?.trim()&&t.set(`server`,e.server.trim()),G_(`/api/tool-analysis-results${t.size>0?`?${t.toString()}`:``}`)},getToolAnalysisSavedResult:e=>G_(`/api/tool-analysis-results/${e}`),deleteToolAnalysisSavedResult:e=>G_(`/api/tool-analysis-results/${e}`,{method:`DELETE`}).then(()=>void 0),createOAuthDebuggerSession:e=>G_(`/api/oauth-debugger/sessions`,{method:`POST`,body:JSON.stringify(e)}),getOAuthDebuggerSession:e=>G_(`/api/oauth-debugger/sessions/${e}`),startOAuthDebuggerSession:e=>G_(`/api/oauth-debugger/sessions/${e}/start`,{method:`POST`,body:JSON.stringify({})}),subscribeOAuthDebuggerSession:(e,t)=>{let n=new EventSource(`${U_}/api/oauth-debugger/sessions/${e}/events`),r=!1,i=()=>{r||(r=!0,n.close())},a=e=>{if(!r&&typeof e.data==`string`&&e.data)try{let n=JSON.parse(e.data);t(n),(n.type===`completed`||n.type===`error`||n.type===`stopped`)&&i()}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(e=>n.addEventListener(e,a)),n.onerror=()=>{r||(t({type:`error`,ts:new Date().toISOString(),payload:{message:`SSE connection error`}}),i())},()=>i()},submitOAuthDebuggerManualCallback:(e,t)=>G_(`/api/oauth-debugger/sessions/${e}/manual-callback`,{method:`POST`,body:JSON.stringify(t)}),stopOAuthDebuggerSession:e=>G_(`/api/oauth-debugger/sessions/${e}/stop`,{method:`POST`,body:JSON.stringify({})}),exportOAuthDebuggerSession:(e,t)=>t===`json`?G_(`/api/oauth-debugger/sessions/${e}/export?format=json`):K_(`/api/oauth-debugger/sessions/${e}/export?format=${t}`),createOAuthRuntimeSession:e=>G_(`/api/oauth-runtime/sessions`,{method:`POST`,body:JSON.stringify(e)}),getOAuthRuntimeSession:e=>G_(`/api/oauth-runtime/sessions/${e}`),getOAuthRuntimeSessionToken:e=>G_(`/api/oauth-runtime/sessions/${e}/token`),submitOAuthRuntimeCallback:(e,t)=>G_(`/api/oauth-runtime/sessions/${e}/callback`,{method:`POST`,body:JSON.stringify(t)}),cancelOAuthRuntimeSession:e=>G_(`/api/oauth-runtime/sessions/${e}/cancel`,{method:`POST`,body:JSON.stringify({})}),ensureOAuthServers:e=>G_(`/api/oauth-runtime/servers/ensure`,{method:`POST`,body:JSON.stringify(e)}),stopRun:e=>G_(`/api/runs/jobs/${e}/stop`,{method:`POST`}),stopEvaluationRun:e=>G_(`/api/runs/evaluations/${encodeURIComponent(e)}/stop`,{method:`POST`}),stopScenario:(e,t,n)=>G_(`/api/runs/jobs/${encodeURIComponent(e)}/scenarios/${encodeURIComponent(t)}/agents/${encodeURIComponent(n)}/stop`,{method:`POST`}),removeEvaluationRun:e=>G_(`/api/runs/queue/evaluations/${encodeURIComponent(e)}`,{method:`DELETE`}),openRover:e=>G_(`/api/rover/open`,{method:`POST`,body:JSON.stringify({jobId:e})}),resumeRover:e=>G_(`/api/rover/jobs/${encodeURIComponent(e)}/resume`,{method:`POST`}),getRoverStatus:()=>G_(`/api/rover/status`),getRunQueue:()=>G_(`/api/runs/queue`),subscribeRunQueue:e=>{if(typeof SharedWorker>`u`){let t=new EventSource(`${U_}/api/runs/queue/events`),n=!1;return t.onopen=()=>{n||e({type:`connected`,ts:new Date().toISOString(),payload:{message:`SSE connected`}})},t.addEventListener(`queue_event`,t=>{if(!n)try{e(JSON.parse(t.data))}catch{}}),t.onerror=()=>{n||(e({type:`error`,ts:new Date().toISOString(),payload:{message:`SSE connection error`,reconnecting:t.readyState!==2}}),t.readyState===2&&(t.onerror=null,n=!0))},()=>{n||(n=!0,t.close())}}let t=new SharedWorker(new URL(`/assets/sse-queue-worker-Iwmqd2oW.js`,``+import.meta.url),{type:`module`}),n=!1;return t.onerror=()=>{n||e({type:`error`,ts:new Date().toISOString(),payload:{message:`Queue worker failed to load`}})},t.port.onmessage=r=>{n||typeof r.data==`object`&&r.data&&(r.data.type===`ping`?t.port.postMessage({type:`pong`}):e(r.data))},t.port.start(),t.port.postMessage({type:`init`,baseUrl:U_}),()=>{n||(n=!0,t.port.postMessage({type:`close`}),t.port.onmessage=null,t.port.close())}},removeQueuedRun:e=>G_(`/api/runs/queue/${e}`,{method:`DELETE`}).then(()=>void 0),resumeQueue:()=>G_(`/api/runs/queue/resume`,{method:`POST`}),subscribeRunJob:(e,t)=>{let n=new EventSource(`${U_}/api/runs/jobs/${e}/events`),r=!1,i=()=>{r||(r=!0,n.close())},a=e=>{if(!r&&typeof e.data==`string`&&e.data)try{let n=JSON.parse(e.data);t(n),(n.type===`completed`||n.type===`error`)&&i()}catch{}};return n.addEventListener(`queued`,a),n.addEventListener(`started`,a),n.addEventListener(`log`,a),n.addEventListener(`completed`,a),n.addEventListener(`error`,a),n.addEventListener(`oauth_required`,a),n.onerror=()=>{r||(t({type:`error`,ts:new Date().toISOString(),payload:{message:`SSE connection error`}}),i())},()=>{i()}}};function Z_(e){if(e.sourcePath){let t=e.sourcePath.split(`/`);return t[t.length-1].replace(/\.(yaml|yml)$/i,``)}return e.name||`config-${Date.now()}`}function Q_(e){return e||`config-${Date.now()}`}var $_={async health(){return G.health()},async listConfigs(){return(await G.listConfigs()).map(D_)},async createConfig(e){return D_(await G.createConfig(Z_(e),O_(e)))},async updateConfig(e){return D_(await G.updateConfig(e.id,O_(e),Q_(e.name)))},async deleteConfig(e){await G.deleteConfig(e)},async listResults(e){let t=0,n=[];for(;;){let r=await G.listRuns({...e,limit:100,offset:t});if(n.push(...r.data),!r.has_more||r.next_offset===null)break;t=r.next_offset}let r=n.map(async e=>{let[{runId:t,results:n},r]=await Promise.all([G.getRun(e.runId),G.getRunTrace(e.runId)]);return B_(n,r.records,t)});return Promise.all(r)},async listRunSummaries(e){let t=Math.max(1,Math.min(100,e?.limit??100)),n=Math.max(0,e?.offset??0),r=[];for(;;){let i=await G.listRuns({...e,limit:t,offset:n});if(r.push(...i.data),!i.has_more||i.next_offset===null)break;n=i.next_offset}return r},async listRunSummariesPage(e){return G.listRuns(e)},async getLatestPassRatesByConfigIds(e){return G.getLatestPassRatesByConfigIds(e)},async getResult(e){try{let[{runId:t,results:n},r]=await Promise.all([G.getRun(e),G.getRunTrace(e)]);return B_(n,r.records,t)}catch{return}},async deleteResult(e){await G.deleteRun(e)},async updateRunNote(e,t){await G.updateRunNote(e,t)},async listMarkdownReports(e){if(e?.limit!==void 0||e?.offset!==void 0)return(await G.listMarkdownReports(e)).data;let t=[],n=0;for(;;){let e=await G.listMarkdownReports({limit:100,offset:n});if(t.push(...e.data),!e.has_more||e.next_offset===null)break;n=e.next_offset}return t},async listMarkdownReportsPage(e){return G.listMarkdownReports(e)},async getMarkdownReport(e){return G.getMarkdownReport(e)},async getMarkdownReportById(e){return G.getMarkdownReportById(e)},async deleteMarkdownReport(e){await G.deleteMarkdownReport(e)},async startRun(e){let t=await G.startRun(e);return typeof window<`u`&&window.dispatchEvent(new Event(`mcplab:run-queue-changed`)),t},async runScenarioPreview(e){let t=await G.runScenarioPreview(e),n=t.scenario.run;if(!n)throw Error(`Preview run did not return a run result`);return{runId:t.runId,scenarioId:t.scenario.scenarioId,agentName:t.scenario.agent,run:V_(n,t.scenario.traceRecord)}},async stopRun(e){await G.stopRun(e)},async stopScenario(e,t,n){return G.stopScenario(e,t,n)},async stopEvaluationRun(e){await G.stopEvaluationRun(e)},async removeEvaluationRun(e){await G.removeEvaluationRun(e)},async openRover(e){return G.openRover(e)},async resumeRover(e){return G.resumeRover(e)},async getRoverStatus(){return G.getRoverStatus()},async getRunQueue(){return G.getRunQueue()},subscribeRunQueue(e){return G.subscribeRunQueue(e)},async removeQueuedRun(e){await G.removeQueuedRun(e)},async resumeQueue(){return G.resumeQueue()},subscribeRunJob(e,t){return G.subscribeRunJob(e,t)},async applyResultAssistantReport(e){return G.applyResultAssistantReport(e)},async createResultAssistantSession(e,t){return G.createResultAssistantSession(e,t)},async getResultAssistantSession(e){return G.getResultAssistantSession(e)},async sendResultAssistantMessage(e,t,n,r){return G.sendResultAssistantMessage(e,t,n,r)},async cancelResultAssistantTurn(e,t){return G.cancelResultAssistantTurn(e,t)},async approveResultAssistantToolCall(e,t,n){return G.approveResultAssistantToolCall(e,t,n)},async denyResultAssistantToolCall(e,t,n){return G.denyResultAssistantToolCall(e,t,n)},async closeResultAssistantSession(e){await G.closeResultAssistantSession(e)},subscribeResultAssistantSessionEvents(e,t){return G.subscribeResultAssistantSessionEvents(e,t)},async getLibraries(){return Qee(await G.getLibraries())},async saveLibraries(e){await G.saveLibraries($ee(e))},async listProviderModels(e){return G.listProviderModels(e)},async testAgentConnection(e,t){return G.testAgentConnection(S_(e),t)},async getWorkspaceSettings(){return G.getSettings()},async updateWorkspaceSettings(e){return G.updateSettings(e)},async testDecisionConnection(e,t){return G.testDecisionConnection(e,t)},async createScenarioAssistantSession(e,t){return G.createScenarioAssistantSession(e,t)},async getScenarioAssistantSession(e){return G.getScenarioAssistantSession(e)},async sendScenarioAssistantMessage(e,t,n,r){return G.sendScenarioAssistantMessage(e,t,n,r)},async cancelScenarioAssistantTurn(e,t){return G.cancelScenarioAssistantTurn(e,t)},async approveScenarioAssistantToolCall(e,t,n){return G.approveScenarioAssistantToolCall(e,t,n)},async denyScenarioAssistantToolCall(e,t,n){return G.denyScenarioAssistantToolCall(e,t,n)},async approveAllScenarioAssistantToolCalls(e){return G.approveAllScenarioAssistantToolCalls(e)},async closeScenarioAssistantSession(e){await G.closeScenarioAssistantSession(e)},subscribeScenarioAssistantSessionEvents(e,t){return G.subscribeScenarioAssistantSessionEvents(e,t)},async discoverToolsForAnalysis(e){return G.discoverToolsForAnalysis(e)},async startToolAnalysis(e){return G.startToolAnalysis(e)},subscribeToolAnalysisJob(e,t){return G.subscribeToolAnalysisJob(e,t)},async getToolAnalysisResult(e){return G.getToolAnalysisResult(e)},async stopToolAnalysis(e){return G.stopToolAnalysis(e)},async listToolAnalysisResults(e){if(e?.limit!==void 0||e?.offset!==void 0)return(await G.listToolAnalysisResults(e)).data;let t=[],n=0;for(;;){let e=await G.listToolAnalysisResults({limit:100,offset:n});if(t.push(...e.data),!e.has_more||e.next_offset===null)break;n=e.next_offset}return t},async listToolAnalysisResultsPage(e){return G.listToolAnalysisResults(e)},async listToolAnalysisServers(){return G.listToolAnalysisServers()},async getToolAnalysisSavedResult(e){return G.getToolAnalysisSavedResult(e)},async deleteToolAnalysisSavedResult(e){await G.deleteToolAnalysisSavedResult(e)},async createOAuthDebuggerSession(e){return G.createOAuthDebuggerSession(e)},async getOAuthDebuggerSession(e){return G.getOAuthDebuggerSession(e)},async startOAuthDebuggerSession(e){return G.startOAuthDebuggerSession(e)},subscribeOAuthDebuggerSession(e,t){return G.subscribeOAuthDebuggerSession(e,t)},async submitOAuthDebuggerManualCallback(e,t){return G.submitOAuthDebuggerManualCallback(e,t)},async stopOAuthDebuggerSession(e){return G.stopOAuthDebuggerSession(e)},async exportOAuthDebuggerSession(e,t){return G.exportOAuthDebuggerSession(e,t)},async createOAuthRuntimeSession(e){return G.createOAuthRuntimeSession(e)},async getOAuthRuntimeSession(e){return G.getOAuthRuntimeSession(e)},async getOAuthRuntimeSessionToken(e){return G.getOAuthRuntimeSessionToken(e)},async submitOAuthRuntimeCallback(e,t){return G.submitOAuthRuntimeCallback(e,t)},async cancelOAuthRuntimeSession(e){return G.cancelOAuthRuntimeSession(e)},async ensureOAuthServers(e){return G.ensureOAuthServers(e)}},ev=(0,_.createContext)(null);function tv({children:e}){let t=`workspace`,[n,r]=(0,_.useState)(`checking`),[i,a]=(0,_.useState)(null);(0,_.useEffect)(()=>{r(`checking`),G.health().then(e=>{r(`connected`),a(typeof e?.version==`string`?e.version:null)}).catch(()=>{r(`disconnected`),a(null)})},[t]);let o=(0,_.useMemo)(()=>$_,[]);return(0,I.jsx)(ev.Provider,{value:{mode:t,connection:n,version:i,source:o},children:e})}function nv(){let e=(0,_.useContext)(ev);if(!e)throw Error(`useDataSource must be used within DataSourceProvider`);return e}var rv=5,iv=2e3;function av(e){return e.filter(e=>e.status===`blocked_auth`&&e.blockedReason===`oauth_required`).length}function ov(e){let t=e?.active??null;return{active:t,active_jobs:Array.isArray(e?.active_jobs)?e.active_jobs:t?[t]:[],admitting_jobs:Array.isArray(e?.admitting_jobs)?e.admitting_jobs:[],queued:Array.isArray(e?.queued)?e.queued:[]}}function sv(){let{source:e}=nv(),[t,n]=(0,_.useState)({active:null,active_jobs:[],admitting_jobs:[],queued:[]}),[r,i]=(0,_.useState)(`connecting`),[a,o]=(0,_.useState)(0),[s,c]=(0,_.useState)(0),l=(0,_.useRef)(`connecting`),u=(0,_.useRef)(0),d=(0,_.useRef)(new Set);return(0,_.useEffect)(()=>{let t=!1,r=0,a=null,s=null,c=0,f=r=>{let i=u.current;e.getRunQueue().then(e=>{if(t||r!==c||i!==u.current)return;let a=ov(e);d.current=new Set([...a.active_jobs,...a.admitting_jobs].map(e=>e.jobId)),n(a)}).catch(()=>{})},p=()=>{a!==null&&(window.clearTimeout(a),a=null)},m=()=>{if(t)return;p();let h=++c;i(`connecting`),l.current=`connecting`,s?.(),s=e.subscribeRunQueue(e=>{let t=e.payload.event;if(e.type===`connected`)r=0,i(`connected`),l.current=`connected`;else if(e.type===`queue_event`&&t){u.current+=1;let e=ov(t),r=new Set([...e.active_jobs,...e.admitting_jobs,...e.queued].map(e=>e.jobId)),a=[...d.current].filter(e=>!r.has(e)).length;a>0&&o(e=>e+a),d.current=new Set([...e.active_jobs,...e.admitting_jobs].map(e=>e.jobId)),i(`connected`),l.current=`connected`,n(e)}else if(e.type===`error`){if(s?.(),s=null,r>=rv){i(`disconnected`),l.current=`disconnected`;return}r+=1,i(`connecting`),l.current=`connecting`;let e=iv*2**(r-1);a=window.setTimeout(()=>{m()},e)}}),f(h)};m();let h=()=>f(c);window.addEventListener(`mcplab:run-queue-changed`,h);let g=()=>{l.current!==`connected`&&m()};return window.addEventListener(`focus`,g),()=>{t=!0,s?.(),p(),window.removeEventListener(`focus`,g),window.removeEventListener(`mcplab:run-queue-changed`,h)}},[e,s]),(0,_.useMemo)(()=>{let e=t.active_jobs.length>0||t.admitting_jobs.length>0,n=t.active_jobs.length+t.admitting_jobs.length,i=t.queued.length,o=av(t.queued);return{isRunning:e,runningCount:n,completionVersion:a,queuedCount:i,oauthBlockedCount:o,streamStatus:r,reconnectStream:()=>{c(e=>e+1)}}},[t,r])}var cv=(e,t)=>{if(e===`/`)return[{label:`Dashboard`}];let n=[{label:`Dashboard`,to:`/`}];if(nd(`/mcp-evaluations/:id/edit`,e))return n.push({label:`MCP Evaluations`,to:`/mcp-evaluations`},{label:`MCP Evaluation`,to:e.replace(/\/edit$/,``)},{label:`Edit`}),n;if(nd(`/mcp-evaluations/:id`,e))return n.push({label:`MCP Evaluations`,to:`/mcp-evaluations`},{label:`MCP Evaluation`}),n;if(nd(`/mcp-evaluations`,e))return n.push({label:`MCP Evaluations`}),n;if(nd(`/settings/mcp`,e))return n.push({label:`Settings`,to:`/settings`},{label:`MCP Connection`}),n;if(nd(`/settings`,e))return n.push({label:`Settings`}),n;if(nd(`/tool-analysis`,e))return n.push({label:`Analyze MCP Tools`}),n;if(nd(`/tool-analysis-results/:id`,e)){let t=nd(`/tool-analysis-results/:id`,e);return n.push({label:`Tool Analysis Results`,to:`/tool-analysis-results`},{label:t?.params.id??`Report`}),n}if(nd(`/tool-analysis-results`,e))return n.push({label:`Tool Analysis Results`}),n;if(nd(`/markdown-reports/view`,e))return n.push({label:`Markdown Reports`,to:`/markdown-reports`},{label:`View Report`}),n;if(nd(`/markdown-reports`,e))return n.push({label:`Markdown Reports`}),n;if(nd(`/oauth-debugger`,e))return n.push({label:`OAuth Debugger`}),n;if(nd(`/results/:id`,e))return n.push({label:`Evaluation Results`,to:`/results`},{label:`Result`}),n;if(nd(`/results`,e))return n.push({label:`Evaluation Results`}),n;if(nd(`/run`,e))return n.push({label:`Run Evaluation`}),n;if(nd(`/libraries/servers/:serverId`,e)){let t=nd(`/libraries/servers/:serverId`,e),r=t?.params.serverId?decodeURIComponent(t.params.serverId):`Server`;return n.push({label:`Libraries`,to:`/libraries/servers`},{label:`MCP servers`,to:`/libraries/servers`},{label:r===`new`?`New Server`:r}),n}if(nd(`/libraries/servers`,e))return n.push({label:`Libraries`,to:`/libraries/servers`},{label:`MCP servers`}),n;if(nd(`/libraries/agents/:agentName`,e)){let t=nd(`/libraries/agents/:agentName`,e),r=t?.params.agentName?decodeURIComponent(t.params.agentName):`Agent`;return n.push({label:`Libraries`,to:`/libraries/agents`},{label:`Agents`,to:`/libraries/agents`},{label:r===`new`?`New Agent`:r}),n}if(nd(`/libraries/agents`,e))return n.push({label:`Libraries`,to:`/libraries/agents`},{label:`Agents`}),n;if(nd(`/libraries/test-cases/:testCaseId`,e)){let t=nd(`/libraries/test-cases/:testCaseId`,e),r=t?.params.testCaseId?decodeURIComponent(t.params.testCaseId):`Test Case`;return n.push({label:`Libraries`,to:`/libraries/test-cases`},{label:`Test Cases`,to:`/libraries/test-cases`},{label:r}),n}if(nd(`/libraries/test-cases`,e))return n.push({label:`Libraries`,to:`/libraries/test-cases`},{label:`Test Cases`}),n;if(nd(`/compare/results`,e))return n.push({label:`Compare Evaluations`,to:`/compare`},{label:`Full Result Compare`}),n;if(nd(`/compare`,e)){let e=new URLSearchParams(t).get(`mode`)===`within-run`?`Agents`:`Runs`;return n.push({label:`Compare Evaluations`,to:`/compare`},{label:e}),n}return n};function lv(){let e=Wd(),t=new URLSearchParams(e.search).get(`embed`)===`1`,n=cv(e.pathname,e.search),{version:r}=nv(),{isRunning:i,runningCount:a,queuedCount:o,oauthBlockedCount:s,streamStatus:c,reconnectStream:l}=sv(),u=o+a;return t?(0,I.jsx)(`main`,{className:`min-h-screen overflow-auto bg-background p-4`,children:(0,I.jsx)(ff,{})}):(0,I.jsx)(_g,{children:(0,I.jsxs)(`div`,{className:`flex min-h-screen w-full`,children:[(0,I.jsx)(Gg,{version:r}),(0,I.jsxs)(`div`,{className:`flex flex-1 flex-col`,children:[(0,I.jsxs)(`header`,{className:`flex h-12 items-center gap-2 border-b bg-card px-4`,children:[(0,I.jsx)(yg,{}),(0,I.jsx)(qg,{children:(0,I.jsx)(Jg,{children:n.map((e,t)=>{let r=t===n.length-1;return(0,I.jsxs)(_.Fragment,{children:[(0,I.jsx)(Yg,{children:e.to&&!r?(0,I.jsx)(Xg,{asChild:!0,children:(0,I.jsx)(np,{to:e.to,children:e.label})}):(0,I.jsx)(Zg,{children:e.label})}),!r&&(0,I.jsx)(Qg,{})]},`${e.label}-${t}`)})})}),(0,I.jsxs)(`div`,{className:`ml-auto flex items-center gap-2`,children:[(i||o>0||s>0)&&(0,I.jsxs)(np,{to:`/run`,className:`inline-flex items-center gap-2 rounded-full border px-2.5 py-1 hover:bg-muted/50 transition-colors`,title:`Open Run Evaluation queue`,children:[(0,I.jsx)(`span`,{className:`text-xs text-muted-foreground`,children:`Run Queue`}),(0,I.jsx)(`span`,{className:`inline-flex min-w-5 items-center justify-center rounded-full px-1.5 py-0.5 text-xs font-semibold ${s>0?`bg-yellow-500/20 text-yellow-800 dark:text-yellow-300`:`bg-muted text-foreground`}`,children:u}),i&&(0,I.jsx)(Kg,{}),s>0&&(0,I.jsx)(`span`,{className:`text-xs text-yellow-700 dark:text-yellow-400`,children:`OAuth wait`})]}),(0,I.jsxs)(`button`,{type:`button`,className:`inline-flex items-center gap-2 rounded-full border px-2.5 py-1 disabled:opacity-70`,onClick:()=>{c===`disconnected`&&l()},disabled:c===`connecting`,title:c===`disconnected`?`Retry queue connection`:c===`connecting`?`Connecting to queue stream...`:`Queue stream connected`,children:[(0,I.jsx)(`span`,{className:`h-2 w-2 rounded-full ${c===`connected`?`bg-emerald-500`:c===`connecting`?`bg-amber-400`:`bg-rose-500`}`,"aria-hidden":`true`}),(0,I.jsx)(`span`,{className:`text-xs ${c===`connected`?`text-emerald-700`:c===`connecting`?`text-muted-foreground`:`text-destructive`}`,children:c})]})]})]}),(0,I.jsx)(`main`,{className:`flex-1 overflow-auto p-6`,children:(0,I.jsx)(ff,{})})]})]})})}var uv=(0,_.createContext)(null);function dv({children:e}){let{source:t}=nv(),[n,r]=(0,_.useState)([]),[i,a]=(0,_.useState)(!0),o=(0,_.useCallback)(async()=>{a(!0);try{let e=await t.listConfigs();r(e)}finally{a(!1)}},[t]);(0,_.useEffect)(()=>{o()},[o]);let s=(0,_.useCallback)(e=>n.find(t=>t.id===e),[n]),c=(0,_.useCallback)(async e=>{let n=await t.createConfig(e);return r(e=>[...e,n]),n},[t]),l=(0,_.useCallback)(async(e,n)=>{let i=await t.updateConfig({...n,id:e});return r(t=>t.map(t=>t.id===e?i:t)),i},[t]),u=(0,_.useCallback)(async e=>{await t.deleteConfig(e),r(t=>t.filter(t=>t.id!==e))},[t]),d=(0,_.useCallback)(async e=>{let i=n.find(t=>t.id===e);if(!i)throw Error(`Config not found`);let a={...structuredClone(i),id:`cfg-${Date.now()}`,name:`${i.name} (Copy)`,createdAt:new Date().toISOString(),updatedAt:new Date().toISOString()},o=await t.createConfig(a);return r(e=>[...e,o]),o},[n,t]);return(0,I.jsx)(uv.Provider,{value:{configs:n,loading:i,getConfig:s,addConfig:c,updateConfig:l,deleteConfig:u,cloneConfig:d,reload:o},children:e})}function fv(){let e=(0,_.useContext)(uv);if(!e)throw Error(`useConfigs must be used within ConfigProvider`);return e}var pv=(0,_.createContext)(null);function mv({children:e}){let{source:t}=nv(),[n,r]=(0,_.useState)({servers:[],agents:[],scenarios:[],browserProviders:{}}),[i,a]=(0,_.useState)(!0),o=(0,_.useCallback)(async()=>{a(!0);try{let e=await t.getLibraries();r(e)}finally{a(!1)}},[t]);(0,_.useEffect)(()=>{o()},[t]),(0,_.useEffect)(()=>{let e=()=>{o()};return window.addEventListener(`focus`,e),()=>{window.removeEventListener(`focus`,e)}},[t]);let s=(0,_.useCallback)(async e=>{r(e),await t.saveLibraries(e)},[t]),c=(0,_.useMemo)(()=>({...n,loading:i,setServers:async e=>s({...n,servers:e}),setAgents:async e=>s({...n,agents:e}),setScenarios:async e=>s({...n,scenarios:e}),reload:o}),[n,i,o,s]);return(0,I.jsx)(pv.Provider,{value:c,children:e})}function hv(){let e=(0,_.useContext)(pv);if(!e)throw Error(`useLibraries must be used within LibraryProvider`);return e}var K=_.forwardRef(({className:e,...t},n)=>(0,I.jsx)(`div`,{ref:n,className:U(`rounded-lg border bg-card text-card-foreground shadow-xs`,e),...t}));K.displayName=`Card`;var gv=_.forwardRef(({className:e,...t},n)=>(0,I.jsx)(`div`,{ref:n,className:U(`flex flex-col space-y-1.5 p-6`,e),...t}));gv.displayName=`CardHeader`;var _v=_.forwardRef(({className:e,...t},n)=>(0,I.jsx)(`h3`,{ref:n,className:U(`text-2xl font-semibold leading-none tracking-tight`,e),...t}));_v.displayName=`CardTitle`;var vv=_.forwardRef(({className:e,...t},n)=>(0,I.jsx)(`p`,{ref:n,className:U(`text-sm text-muted-foreground`,e),...t}));vv.displayName=`CardDescription`;var q=_.forwardRef(({className:e,...t},n)=>(0,I.jsx)(`div`,{ref:n,className:U(`p-6 pt-0`,e),...t}));q.displayName=`CardContent`;var yv=_.forwardRef(({className:e,...t},n)=>(0,I.jsx)(`div`,{ref:n,className:U(`flex items-center p-6 pt-0`,e),...t}));yv.displayName=`CardFooter`;var bv=_.forwardRef(({className:e,containerClassName:t,...n},r)=>(0,I.jsx)(`div`,{className:U(`relative w-full overflow-auto`,t),children:(0,I.jsx)(`table`,{ref:r,className:U(`w-full caption-bottom text-sm`,e),...n})}));bv.displayName=`Table`;var xv=_.forwardRef(({className:e,...t},n)=>(0,I.jsx)(`thead`,{ref:n,className:U(`[&_tr]:border-b`,e),...t}));xv.displayName=`TableHeader`;var Sv=_.forwardRef(({className:e,...t},n)=>(0,I.jsx)(`tbody`,{ref:n,className:U(`[&_tr:last-child]:border-0`,e),...t}));Sv.displayName=`TableBody`;var Cv=_.forwardRef(({className:e,...t},n)=>(0,I.jsx)(`tfoot`,{ref:n,className:U(`border-t bg-muted/50 font-medium last:[&>tr]:border-b-0`,e),...t}));Cv.displayName=`TableFooter`;var wv=_.forwardRef(({className:e,...t},n)=>(0,I.jsx)(`tr`,{ref:n,className:U(`border-b transition-colors data-[state=selected]:bg-muted hover:bg-muted/50`,e),...t}));wv.displayName=`TableRow`;var Tv=_.forwardRef(({className:e,...t},n)=>(0,I.jsx)(`th`,{ref:n,className:U(`h-12 px-4 text-left align-middle font-medium text-muted-foreground has-[[role=checkbox]]:pr-0`,e),...t}));Tv.displayName=`TableHead`;var J=_.forwardRef(({className:e,...t},n)=>(0,I.jsx)(`td`,{ref:n,className:U(`p-4 align-middle has-[[role=checkbox]]:pr-0`,e),...t}));J.displayName=`TableCell`;var Ev=_.forwardRef(({className:e,...t},n)=>(0,I.jsx)(`caption`,{ref:n,className:U(`mt-4 text-sm text-muted-foreground`,e),...t}));Ev.displayName=`TableCaption`;function Dv({title:e,value:t,subtitle:n,icon:r,trend:i,compact:a=!1}){return(0,I.jsx)(K,{className:a?`h-fit self-start`:void 0,children:(0,I.jsx)(q,{className:a?`p-2`:`p-4`,children:(0,I.jsxs)(`div`,{className:`flex items-start justify-between`,children:[(0,I.jsxs)(`div`,{className:a?`space-y-0.5`:`space-y-1`,children:[(0,I.jsx)(`p`,{className:`text-xs font-medium text-muted-foreground uppercase tracking-wider`,children:e}),(0,I.jsx)(`p`,{className:a?`text-lg font-bold`:`text-2xl font-bold`,children:t}),n&&(0,I.jsxs)(`p`,{className:`text-xs ${i===`up`?`text-success`:i===`down`?`text-destructive`:`text-muted-foreground`}`,children:[i===`up`&&`↑ `,i===`down`&&`↓ `,n]})]}),(0,I.jsx)(`div`,{className:a?`rounded-lg bg-primary/10 p-0.5`:`rounded-lg bg-primary/10 p-2`,children:(0,I.jsx)(r,{className:`h-4 w-4 text-primary`})})]})})})}var Ov=Gt(`inline-flex items-center rounded-full border px-2.5 py-0.5 text-xs font-semibold transition-colors focus:outline-hidden 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`}}),Y=_.forwardRef(({className:e,variant:t,asChild:n,...r},i)=>(0,I.jsx)(n?yp:`div`,{ref:i,className:U(Ov({variant:t}),e),...r}));Y.displayName=`Badge`;function kv({rate:e,className:t}){let n=e===null?null:Math.round(e*100);return n===null?(0,I.jsx)(Y,{variant:`secondary`,className:`font-mono text-xs text-muted-foreground ${t??``}`,title:`Nothing evaluated`,children:`–`}):(0,I.jsxs)(Y,{variant:n>=80?`default`:n>=50?`secondary`:`destructive`,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 Av=o(((e,t)=>{t.exports=Array.isArray})),jv=o(((e,t)=>{t.exports=typeof global==`object`&&global&&global.Object===Object&&global})),Mv=o(((e,t)=>{var n=jv(),r=typeof self==`object`&&self&&self.Object===Object&&self;t.exports=n||r||Function(`return this`)()})),Nv=o(((e,t)=>{t.exports=Mv().Symbol})),Pv=o(((e,t)=>{var n=Nv(),r=Object.prototype,i=r.hasOwnProperty,a=r.toString,o=n?n.toStringTag:void 0;function s(e){var t=i.call(e,o),n=e[o];try{e[o]=void 0;var r=!0}catch{}var s=a.call(e);return r&&(t?e[o]=n:delete e[o]),s}t.exports=s})),Fv=o(((e,t)=>{var n=Object.prototype.toString;function r(e){return n.call(e)}t.exports=r})),Iv=o(((e,t)=>{var n=Nv(),r=Pv(),i=Fv(),a=`[object Null]`,o=`[object Undefined]`,s=n?n.toStringTag:void 0;function c(e){return e==null?e===void 0?o:a:s&&s in Object(e)?r(e):i(e)}t.exports=c})),Lv=o(((e,t)=>{function n(e){return typeof e==`object`&&!!e}t.exports=n})),Rv=o(((e,t)=>{var n=Iv(),r=Lv(),i=`[object Symbol]`;function a(e){return typeof e==`symbol`||r(e)&&n(e)==i}t.exports=a})),zv=o(((e,t)=>{var n=Av(),r=Rv(),i=/\.|\[(?:[^[\]]*|(["'])(?:(?!\1)[^\\]|\\.)*?\1)\]/,a=/^\w*$/;function o(e,t){if(n(e))return!1;var o=typeof e;return o==`number`||o==`symbol`||o==`boolean`||e==null||r(e)?!0:a.test(e)||!i.test(e)||t!=null&&e in Object(t)}t.exports=o})),Bv=o(((e,t)=>{function n(e){var t=typeof e;return e!=null&&(t==`object`||t==`function`)}t.exports=n})),Vv=o(((e,t)=>{var n=Iv(),r=Bv(),i=`[object AsyncFunction]`,a=`[object Function]`,o=`[object GeneratorFunction]`,s=`[object Proxy]`;function c(e){if(!r(e))return!1;var t=n(e);return t==a||t==o||t==i||t==s}t.exports=c})),Hv=o(((e,t)=>{t.exports=Mv()[`__core-js_shared__`]})),Uv=o(((e,t)=>{var n=Hv(),r=function(){var e=/[^.]+$/.exec(n&&n.keys&&n.keys.IE_PROTO||``);return e?`Symbol(src)_1.`+e:``}();function i(e){return!!r&&r in e}t.exports=i})),Wv=o(((e,t)=>{var n=Function.prototype.toString;function r(e){if(e!=null){try{return n.call(e)}catch{}try{return e+``}catch{}}return``}t.exports=r})),Gv=o(((e,t)=>{var n=Vv(),r=Uv(),i=Bv(),a=Wv(),o=/[\\^$.*+?()[\]{}|]/g,s=/^\[object .+?Constructor\]$/,c=Function.prototype,l=Object.prototype,u=c.toString,d=l.hasOwnProperty,f=RegExp(`^`+u.call(d).replace(o,`\\$&`).replace(/hasOwnProperty|(function).*?(?=\\\()| for .+?(?=\\\])/g,`$1.*?`)+`$`);function p(e){return!i(e)||r(e)?!1:(n(e)?f:s).test(a(e))}t.exports=p})),Kv=o(((e,t)=>{function n(e,t){return e?.[t]}t.exports=n})),qv=o(((e,t)=>{var n=Gv(),r=Kv();function i(e,t){var i=r(e,t);return n(i)?i:void 0}t.exports=i})),Jv=o(((e,t)=>{t.exports=qv()(Object,`create`)})),Yv=o(((e,t)=>{var n=Jv();function r(){this.__data__=n?n(null):{},this.size=0}t.exports=r})),Xv=o(((e,t)=>{function n(e){var t=this.has(e)&&delete this.__data__[e];return this.size-=+!!t,t}t.exports=n})),Zv=o(((e,t)=>{var n=Jv(),r=`__lodash_hash_undefined__`,i=Object.prototype.hasOwnProperty;function a(e){var t=this.__data__;if(n){var a=t[e];return a===r?void 0:a}return i.call(t,e)?t[e]:void 0}t.exports=a})),Qv=o(((e,t)=>{var n=Jv(),r=Object.prototype.hasOwnProperty;function i(e){var t=this.__data__;return n?t[e]!==void 0:r.call(t,e)}t.exports=i})),$v=o(((e,t)=>{var n=Jv(),r=`__lodash_hash_undefined__`;function i(e,t){var i=this.__data__;return this.size+=+!this.has(e),i[e]=n&&t===void 0?r:t,this}t.exports=i})),ey=o(((e,t)=>{var n=Yv(),r=Xv(),i=Zv(),a=Qv(),o=$v();function s(e){var t=-1,n=e==null?0:e.length;for(this.clear();++t<n;){var r=e[t];this.set(r[0],r[1])}}s.prototype.clear=n,s.prototype.delete=r,s.prototype.get=i,s.prototype.has=a,s.prototype.set=o,t.exports=s})),ty=o(((e,t)=>{function n(){this.__data__=[],this.size=0}t.exports=n})),ny=o(((e,t)=>{function n(e,t){return e===t||e!==e&&t!==t}t.exports=n})),ry=o(((e,t)=>{var n=ny();function r(e,t){for(var r=e.length;r--;)if(n(e[r][0],t))return r;return-1}t.exports=r})),iy=o(((e,t)=>{var n=ry(),r=Array.prototype.splice;function i(e){var t=this.__data__,i=n(t,e);return i<0?!1:(i==t.length-1?t.pop():r.call(t,i,1),--this.size,!0)}t.exports=i})),ay=o(((e,t)=>{var n=ry();function r(e){var t=this.__data__,r=n(t,e);return r<0?void 0:t[r][1]}t.exports=r})),oy=o(((e,t)=>{var n=ry();function r(e){return n(this.__data__,e)>-1}t.exports=r})),sy=o(((e,t)=>{var n=ry();function r(e,t){var r=this.__data__,i=n(r,e);return i<0?(++this.size,r.push([e,t])):r[i][1]=t,this}t.exports=r})),cy=o(((e,t)=>{var n=ty(),r=iy(),i=ay(),a=oy(),o=sy();function s(e){var t=-1,n=e==null?0:e.length;for(this.clear();++t<n;){var r=e[t];this.set(r[0],r[1])}}s.prototype.clear=n,s.prototype.delete=r,s.prototype.get=i,s.prototype.has=a,s.prototype.set=o,t.exports=s})),ly=o(((e,t)=>{t.exports=qv()(Mv(),`Map`)})),uy=o(((e,t)=>{var n=ey(),r=cy(),i=ly();function a(){this.size=0,this.__data__={hash:new n,map:new(i||r),string:new n}}t.exports=a})),dy=o(((e,t)=>{function n(e){var t=typeof e;return t==`string`||t==`number`||t==`symbol`||t==`boolean`?e!==`__proto__`:e===null}t.exports=n})),fy=o(((e,t)=>{var n=dy();function r(e,t){var r=e.__data__;return n(t)?r[typeof t==`string`?`string`:`hash`]:r.map}t.exports=r})),py=o(((e,t)=>{var n=fy();function r(e){var t=n(this,e).delete(e);return this.size-=+!!t,t}t.exports=r})),my=o(((e,t)=>{var n=fy();function r(e){return n(this,e).get(e)}t.exports=r})),hy=o(((e,t)=>{var n=fy();function r(e){return n(this,e).has(e)}t.exports=r})),gy=o(((e,t)=>{var n=fy();function r(e,t){var r=n(this,e),i=r.size;return r.set(e,t),this.size+=r.size==i?0:1,this}t.exports=r})),_y=o(((e,t)=>{var n=uy(),r=py(),i=my(),a=hy(),o=gy();function s(e){var t=-1,n=e==null?0:e.length;for(this.clear();++t<n;){var r=e[t];this.set(r[0],r[1])}}s.prototype.clear=n,s.prototype.delete=r,s.prototype.get=i,s.prototype.has=a,s.prototype.set=o,t.exports=s})),vy=o(((e,t)=>{var n=_y(),r=`Expected a function`;function i(e,t){if(typeof e!=`function`||t!=null&&typeof t!=`function`)throw TypeError(r);var a=function(){var n=arguments,r=t?t.apply(this,n):n[0],i=a.cache;if(i.has(r))return i.get(r);var o=e.apply(this,n);return a.cache=i.set(r,o)||i,o};return a.cache=new(i.Cache||n),a}i.Cache=n,t.exports=i})),yy=o(((e,t)=>{var n=vy(),r=500;function i(e){var t=n(e,function(e){return i.size===r&&i.clear(),e}),i=t.cache;return t}t.exports=i})),by=o(((e,t)=>{var n=yy(),r=/[^.[\]]+|\[(?:(-?\d+(?:\.\d+)?)|(["'])((?:(?!\2)[^\\]|\\.)*?)\2)\]|(?=(?:\.|\[\])(?:\.|\[\]|$))/g,i=/\\(\\)?/g;t.exports=n(function(e){var t=[];return e.charCodeAt(0)===46&&t.push(``),e.replace(r,function(e,n,r,a){t.push(r?a.replace(i,`$1`):n||e)}),t})})),xy=o(((e,t)=>{function n(e,t){for(var n=-1,r=e==null?0:e.length,i=Array(r);++n<r;)i[n]=t(e[n],n,e);return i}t.exports=n})),Sy=o(((e,t)=>{var n=Nv(),r=xy(),i=Av(),a=Rv(),o=1/0,s=n?n.prototype:void 0,c=s?s.toString:void 0;function l(e){if(typeof e==`string`)return e;if(i(e))return r(e,l)+``;if(a(e))return c?c.call(e):``;var t=e+``;return t==`0`&&1/e==-o?`-0`:t}t.exports=l})),Cy=o(((e,t)=>{var n=Sy();function r(e){return e==null?``:n(e)}t.exports=r})),wy=o(((e,t)=>{var n=Av(),r=zv(),i=by(),a=Cy();function o(e,t){return n(e)?e:r(e,t)?[e]:i(a(e))}t.exports=o})),Ty=o(((e,t)=>{var n=Rv(),r=1/0;function i(e){if(typeof e==`string`||n(e))return e;var t=e+``;return t==`0`&&1/e==-r?`-0`:t}t.exports=i})),Ey=o(((e,t)=>{var n=wy(),r=Ty();function i(e,t){t=n(t,e);for(var i=0,a=t.length;e!=null&&i<a;)e=e[r(t[i++])];return i&&i==a?e:void 0}t.exports=i})),Dy=o(((e,t)=>{var n=Ey();function r(e,t,r){var i=e==null?void 0:n(e,t);return i===void 0?r:i}t.exports=r})),Oy=o(((e,t)=>{function n(e){return e==null}t.exports=n})),ky=o(((e,t)=>{var n=Iv(),r=Av(),i=Lv(),a=`[object String]`;function o(e){return typeof e==`string`||!r(e)&&i(e)&&n(e)==a}t.exports=o})),Ay=o((e=>{var t=Symbol.for(`react.element`),n=Symbol.for(`react.portal`),r=Symbol.for(`react.fragment`),i=Symbol.for(`react.strict_mode`),a=Symbol.for(`react.profiler`),o=Symbol.for(`react.provider`),s=Symbol.for(`react.context`),c=Symbol.for(`react.server_context`),l=Symbol.for(`react.forward_ref`),u=Symbol.for(`react.suspense`),d=Symbol.for(`react.suspense_list`),f=Symbol.for(`react.memo`),p=Symbol.for(`react.lazy`);function m(e){if(typeof e==`object`&&e){var m=e.$$typeof;switch(m){case t:switch(e=e.type,e){case r:case a:case i:case u:case d:return e;default:switch(e&&=e.$$typeof,e){case c:case s:case l:case p:case f:case o:return e;default:return m}}case n:return m}}}e.isFragment=function(e){return m(e)===r}})),jy=o(((e,t)=>{t.exports=Ay()})),My=o(((e,t)=>{var n=Iv(),r=Lv(),i=`[object Number]`;function a(e){return typeof e==`number`||r(e)&&n(e)==i}t.exports=a})),Ny=o(((e,t)=>{var n=My();function r(e){return n(e)&&e!=+e}t.exports=r})),Py=l(ky()),Fy=l(Ny()),Iy=l(Dy()),Ly=l(My()),Ry=l(Oy()),zy=function(e){return e===0?0:e>0?1:-1},By=function(e){return(0,Py.default)(e)&&e.indexOf(`%`)===e.length-1},Vy=function(e){return(0,Ly.default)(e)&&!(0,Fy.default)(e)},Hy=function(e){return(0,Ry.default)(e)},Uy=function(e){return Vy(e)||(0,Py.default)(e)},Wy=0,Gy=function(e){var t=++Wy;return`${e||``}${t}`},Ky=function(e,t){var n=arguments.length>2&&arguments[2]!==void 0?arguments[2]:0,r=arguments.length>3&&arguments[3]!==void 0&&arguments[3];if(!Vy(e)&&!(0,Py.default)(e))return n;var i;if(By(e)){var a=e.indexOf(`%`);i=t*parseFloat(e.slice(0,a))/100}else i=+e;return(0,Fy.default)(i)&&(i=n),r&&i>t&&(i=t),i},qy=function(e){if(!e)return null;var t=Object.keys(e);return t&&t.length?e[t[0]]:null},Jy=function(e){if(!Array.isArray(e))return!1;for(var t=e.length,n={},r=0;r<t;r++)if(!n[e[r]])n[e[r]]=!0;else return!0;return!1},Yy=function(e,t){return Vy(e)&&Vy(t)?function(n){return e+n*(t-e)}:function(){return t}};function Xy(e,t,n){return!e||!e.length?null:e.find(function(e){return e&&(typeof t==`function`?t(e):(0,Iy.default)(e,t))===n})}var Zy=function(e,t){return Vy(e)&&Vy(t)?e-t:(0,Py.default)(e)&&(0,Py.default)(t)?e.localeCompare(t):e instanceof Date&&t instanceof Date?e.getTime()-t.getTime():String(e).localeCompare(String(t))};function Qy(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}var $y=l(Bv());function eb(e){"@babel/helpers - typeof";return eb=typeof Symbol==`function`&&typeof Symbol.iterator==`symbol`?function(e){return typeof e}:function(e){return e&&typeof Symbol==`function`&&e.constructor===Symbol&&e!==Symbol.prototype?`symbol`:typeof e},eb(e)}var tb=[`viewBox`,`children`],nb=`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`.split(`.`),rb=[`points`,`pathLength`],ib={svg:tb,polygon:rb,polyline:rb},ab=`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`.split(`.`),ob=function(e,t){if(!e||typeof e==`function`||typeof e==`boolean`)return null;var n=e;if((0,_.isValidElement)(e)&&(n=e.props),!(0,$y.default)(n))return null;var r={};return Object.keys(n).forEach(function(e){ab.includes(e)&&(r[e]=t||function(t){return n[e](n,t)})}),r},sb=function(e,t,n){return function(r){return e(t,n,r),null}},cb=function(e,t,n){if(!(0,$y.default)(e)||eb(e)!==`object`)return null;var r=null;return Object.keys(e).forEach(function(i){var a=e[i];ab.includes(i)&&typeof a==`function`&&(r||={},r[i]=sb(a,t,n))}),r},lb=l(Vv()),ub=jy(),db=[`children`],fb=[`children`];function pb(e,t){if(e==null)return{};var n=mb(e,t),r,i;if(Object.getOwnPropertySymbols){var a=Object.getOwnPropertySymbols(e);for(i=0;i<a.length;i++)r=a[i],!(t.indexOf(r)>=0)&&Object.prototype.propertyIsEnumerable.call(e,r)&&(n[r]=e[r])}return n}function mb(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 hb(e){"@babel/helpers - typeof";return hb=typeof Symbol==`function`&&typeof Symbol.iterator==`symbol`?function(e){return typeof e}:function(e){return e&&typeof Symbol==`function`&&e.constructor===Symbol&&e!==Symbol.prototype?`symbol`:typeof e},hb(e)}var gb={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`},_b=function(e){return typeof e==`string`?e:e?e.displayName||e.name||`Component`:``},vb=null,yb=null,bb=function e(t){if(t===vb&&Array.isArray(yb))return yb;var n=[];return _.Children.forEach(t,function(t){(0,Ry.default)(t)||((0,ub.isFragment)(t)?n=n.concat(e(t.props.children)):n.push(t))}),yb=n,vb=t,n};function xb(e,t){var n=[],r=[];return r=Array.isArray(t)?t.map(function(e){return _b(e)}):[_b(t)],bb(e).forEach(function(e){var t=(0,Iy.default)(e,`type.displayName`)||(0,Iy.default)(e,`type.name`);r.indexOf(t)!==-1&&n.push(e)}),n}function Sb(e,t){var n=xb(e,t);return n&&n[0]}var Cb=function(e){if(!e||!e.props)return!1;var t=e.props,n=t.width,r=t.height;return!(!Vy(n)||n<=0||!Vy(r)||r<=0)},wb=`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`.split(`.`),Tb=function(e){return e&&e.type&&(0,Py.default)(e.type)&&wb.indexOf(e.type)>=0},Eb=function(e){return e&&hb(e)===`object`&&`clipDot`in e},Db=function(e,t,n,r){var i=ib?.[r]??[];return t.startsWith(`data-`)||!(0,lb.default)(e)&&(r&&i.includes(t)||nb.includes(t))||n&&ab.includes(t)},Ob=function(e,t,n){if(!e||typeof e==`function`||typeof e==`boolean`)return null;var r=e;if((0,_.isValidElement)(e)&&(r=e.props),!(0,$y.default)(r))return null;var i={};return Object.keys(r).forEach(function(e){Db(r?.[e],e,t,n)&&(i[e]=r[e])}),i},kb=function e(t,n){if(t===n)return!0;var r=_.Children.count(t);if(r!==_.Children.count(n))return!1;if(r===0)return!0;if(r===1)return Ab(Array.isArray(t)?t[0]:t,Array.isArray(n)?n[0]:n);for(var i=0;i<r;i++){var a=t[i],o=n[i];if(Array.isArray(a)||Array.isArray(o)){if(!e(a,o))return!1}else if(!Ab(a,o))return!1}return!0},Ab=function(e,t){if((0,Ry.default)(e)&&(0,Ry.default)(t))return!0;if(!(0,Ry.default)(e)&&!(0,Ry.default)(t)){var n=e.props||{},r=n.children,i=pb(n,db),a=t.props||{},o=a.children,s=pb(a,fb);return r&&o?Qy(i,s)&&kb(r,o):!r&&!o&&Qy(i,s)}return!1},jb=function(e,t){var n=[],r={};return bb(e).forEach(function(e,i){if(Tb(e))n.push(e);else if(e){var a=_b(e.type),o=t[a]||{},s=o.handler,c=o.once;if(s&&(!c||!r[a])){var l=s(e,a,i);n.push(l),r[a]=!0}}}),n},Mb=function(e){var t=e&&e.type;return t&&gb[t]?gb[t]:null},Nb=function(e,t){return bb(t).indexOf(e)},Pb=[`children`,`width`,`height`,`viewBox`,`className`,`style`,`title`,`desc`];function Fb(){return Fb=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},Fb.apply(this,arguments)}function Ib(e,t){if(e==null)return{};var n=Lb(e,t),r,i;if(Object.getOwnPropertySymbols){var a=Object.getOwnPropertySymbols(e);for(i=0;i<a.length;i++)r=a[i],!(t.indexOf(r)>=0)&&Object.prototype.propertyIsEnumerable.call(e,r)&&(n[r]=e[r])}return n}function Lb(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 Rb(e){var t=e.children,n=e.width,r=e.height,i=e.viewBox,a=e.className,o=e.style,s=e.title,c=e.desc,l=Ib(e,Pb),u=i||{width:n,height:r,x:0,y:0},d=Ht(`recharts-surface`,a);return _.createElement(`svg`,Fb({},Ob(l,!0,`svg`),{className:d,width:n,height:r,style:o,viewBox:`${u.x} ${u.y} ${u.width} ${u.height}`}),_.createElement(`title`,null,s),_.createElement(`desc`,null,c),t)}var zb=[`children`,`className`];function Bb(){return Bb=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},Bb.apply(this,arguments)}function Vb(e,t){if(e==null)return{};var n=Hb(e,t),r,i;if(Object.getOwnPropertySymbols){var a=Object.getOwnPropertySymbols(e);for(i=0;i<a.length;i++)r=a[i],!(t.indexOf(r)>=0)&&Object.prototype.propertyIsEnumerable.call(e,r)&&(n[r]=e[r])}return n}function Hb(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 Ub=_.forwardRef(function(e,t){var n=e.children,r=e.className,i=Vb(e,zb),a=Ht(`recharts-layer`,r);return _.createElement(`g`,Bb({className:a},Ob(i,!0),{ref:t}),n)}),Wb=o(((e,t)=>{function n(e,t,n){var r=-1,i=e.length;t<0&&(t=-t>i?0:i+t),n=n>i?i:n,n<0&&(n+=i),i=t>n?0:n-t>>>0,t>>>=0;for(var a=Array(i);++r<i;)a[r]=e[r+t];return a}t.exports=n})),Gb=o(((e,t)=>{var n=Wb();function r(e,t,r){var i=e.length;return r=r===void 0?i:r,!t&&r>=i?e:n(e,t,r)}t.exports=r})),Kb=o(((e,t)=>{var n=RegExp(`[\\u200d\\ud800-\\udfff\\u0300-\\u036f\\ufe20-\\ufe2f\\u20d0-\\u20ff\\ufe0e\\ufe0f]`);function r(e){return n.test(e)}t.exports=r})),qb=o(((e,t)=>{function n(e){return e.split(``)}t.exports=n})),Jb=o(((e,t)=>{var n=`\\ud800-\\udfff`,r=`\\u0300-\\u036f\\ufe20-\\ufe2f\\u20d0-\\u20ff`,i=`\\ufe0e\\ufe0f`,a=`[`+n+`]`,o=`[`+r+`]`,s=`\\ud83c[\\udffb-\\udfff]`,c=`(?:`+o+`|`+s+`)`,l=`[^`+n+`]`,u=`(?:\\ud83c[\\udde6-\\uddff]){2}`,d=`[\\ud800-\\udbff][\\udc00-\\udfff]`,f=`\\u200d`,p=c+`?`,m=`[`+i+`]?`,h=`(?:`+f+`(?:`+[l,u,d].join(`|`)+`)`+m+p+`)*`,g=m+p+h,_=`(?:`+[l+o+`?`,o,u,d,a].join(`|`)+`)`,v=RegExp(s+`(?=`+s+`)|`+_+g,`g`);function y(e){return e.match(v)||[]}t.exports=y})),Yb=o(((e,t)=>{var n=qb(),r=Kb(),i=Jb();function a(e){return r(e)?i(e):n(e)}t.exports=a})),Xb=o(((e,t)=>{var n=Gb(),r=Kb(),i=Yb(),a=Cy();function o(e){return function(t){t=a(t);var o=r(t)?i(t):void 0,s=o?o[0]:t.charAt(0),c=o?n(o,1).join(``):t.slice(1);return s[e]()+c}}t.exports=o})),Zb=o(((e,t)=>{t.exports=Xb()(`toUpperCase`)}));function Qb(e){return function(){return e}}var $b=Math.cos,ex=Math.sin,tx=Math.sqrt,nx=Math.PI;nx/2;var rx=2*nx,ix=Math.PI,ax=2*ix,ox=1e-6,sx=ax-ox;function cx(e){this._+=e[0];for(let t=1,n=e.length;t<n;++t)this._+=arguments[t]+e[t]}function lx(e){let t=Math.floor(e);if(!(t>=0))throw Error(`invalid digits: ${e}`);if(t>15)return cx;let n=10**t;return function(e){this._+=e[0];for(let t=1,r=e.length;t<r;++t)this._+=Math.round(arguments[t]*n)/n+e[t]}}var ux=class{constructor(e){this._x0=this._y0=this._x1=this._y1=null,this._=``,this._append=e==null?cx:lx(e)}moveTo(e,t){this._append`M${this._x0=this._x1=+e},${this._y0=this._y1=+t}`}closePath(){this._x1!==null&&(this._x1=this._x0,this._y1=this._y0,this._append`Z`)}lineTo(e,t){this._append`L${this._x1=+e},${this._y1=+t}`}quadraticCurveTo(e,t,n,r){this._append`Q${+e},${+t},${this._x1=+n},${this._y1=+r}`}bezierCurveTo(e,t,n,r,i,a){this._append`C${+e},${+t},${+n},${+r},${this._x1=+i},${this._y1=+a}`}arcTo(e,t,n,r,i){if(e=+e,t=+t,n=+n,r=+r,i=+i,i<0)throw Error(`negative radius: ${i}`);let a=this._x1,o=this._y1,s=n-e,c=r-t,l=a-e,u=o-t,d=l*l+u*u;if(this._x1===null)this._append`M${this._x1=e},${this._y1=t}`;else if(d>ox){if(!(Math.abs(u*s-c*l)>ox)||!i)this._append`L${this._x1=e},${this._y1=t}`;else{let f=n-a,p=r-o,m=s*s+c*c,h=f*f+p*p,g=Math.sqrt(m),_=Math.sqrt(d),v=i*Math.tan((ix-Math.acos((m+d-h)/(2*g*_)))/2),y=v/_,b=v/g;Math.abs(y-1)>ox&&this._append`L${e+y*l},${t+y*u}`,this._append`A${i},${i},0,0,${+(u*f>l*p)},${this._x1=e+b*s},${this._y1=t+b*c}`}}}arc(e,t,n,r,i,a){if(e=+e,t=+t,n=+n,a=!!a,n<0)throw Error(`negative radius: ${n}`);let o=n*Math.cos(r),s=n*Math.sin(r),c=e+o,l=t+s,u=1^a,d=a?r-i:i-r;this._x1===null?this._append`M${c},${l}`:(Math.abs(this._x1-c)>ox||Math.abs(this._y1-l)>ox)&&this._append`L${c},${l}`,n&&(d<0&&(d=d%ax+ax),d>sx?this._append`A${n},${n},0,1,${u},${e-o},${t-s}A${n},${n},0,1,${u},${this._x1=c},${this._y1=l}`:d>ox&&this._append`A${n},${n},0,${+(d>=ix)},${u},${this._x1=e+n*Math.cos(i)},${this._y1=t+n*Math.sin(i)}`)}rect(e,t,n,r){this._append`M${this._x0=this._x1=+e},${this._y0=this._y1=+t}h${n=+n}v${+r}h${-n}Z`}toString(){return this._}};ux.prototype;function dx(e){let t=3;return e.digits=function(n){if(!arguments.length)return t;if(n==null)t=null;else{let e=Math.floor(n);if(!(e>=0))throw RangeError(`invalid digits: ${n}`);t=e}return e},()=>new ux(t)}Array.prototype.slice;function fx(e){return typeof e==`object`&&`length`in e?e:Array.from(e)}function px(e){this._context=e}px.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)}}};function mx(e){return new px(e)}function hx(e){return e[0]}function gx(e){return e[1]}function _x(e,t){var n=Qb(!0),r=null,i=mx,a=null,o=dx(s);e=typeof e==`function`?e:e===void 0?hx:Qb(e),t=typeof t==`function`?t:t===void 0?gx:Qb(t);function s(s){var c,l=(s=fx(s)).length,u,d=!1,f;for(r??(a=i(f=o())),c=0;c<=l;++c)!(c<l&&n(u=s[c],c,s))===d&&((d=!d)?a.lineStart():a.lineEnd()),d&&a.point(+e(u,c,s),+t(u,c,s));if(f)return a=null,f+``||null}return s.x=function(t){return arguments.length?(e=typeof t==`function`?t:Qb(+t),s):e},s.y=function(e){return arguments.length?(t=typeof e==`function`?e:Qb(+e),s):t},s.defined=function(e){return arguments.length?(n=typeof e==`function`?e:Qb(!!e),s):n},s.curve=function(e){return arguments.length?(i=e,r!=null&&(a=i(r)),s):i},s.context=function(e){return arguments.length?(e==null?r=a=null:a=i(r=e),s):r},s}function vx(e,t,n){var r=null,i=Qb(!0),a=null,o=mx,s=null,c=dx(l);e=typeof e==`function`?e:e===void 0?hx:Qb(+e),t=typeof t==`function`?t:Qb(t===void 0?0:+t),n=typeof n==`function`?n:n===void 0?gx:Qb(+n);function l(l){var u,d,f,p=(l=fx(l)).length,m,h=!1,g,_=Array(p),v=Array(p);for(a??(s=o(g=c())),u=0;u<=p;++u){if(!(u<p&&i(m=l[u],u,l))===h){if(h=!h)d=u,s.areaStart(),s.lineStart();else{for(s.lineEnd(),s.lineStart(),f=u-1;f>=d;--f)s.point(_[f],v[f]);s.lineEnd(),s.areaEnd()}}h&&(_[u]=+e(m,u,l),v[u]=+t(m,u,l),s.point(r?+r(m,u,l):_[u],n?+n(m,u,l):v[u]))}if(g)return s=null,g+``||null}function u(){return _x().defined(i).curve(o).context(a)}return l.x=function(t){return arguments.length?(e=typeof t==`function`?t:Qb(+t),r=null,l):e},l.x0=function(t){return arguments.length?(e=typeof t==`function`?t:Qb(+t),l):e},l.x1=function(e){return arguments.length?(r=e==null?null:typeof e==`function`?e:Qb(+e),l):r},l.y=function(e){return arguments.length?(t=typeof e==`function`?e:Qb(+e),n=null,l):t},l.y0=function(e){return arguments.length?(t=typeof e==`function`?e:Qb(+e),l):t},l.y1=function(e){return arguments.length?(n=e==null?null:typeof e==`function`?e:Qb(+e),l):n},l.lineX0=l.lineY0=function(){return u().x(e).y(t)},l.lineY1=function(){return u().x(e).y(n)},l.lineX1=function(){return u().x(r).y(t)},l.defined=function(e){return arguments.length?(i=typeof e==`function`?e:Qb(!!e),l):i},l.curve=function(e){return arguments.length?(o=e,a!=null&&(s=o(a)),l):o},l.context=function(e){return arguments.length?(e==null?a=s=null:s=o(a=e),l):a},l}var yx=class{constructor(e,t){this._context=e,this._x=t}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(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._x?this._context.bezierCurveTo(this._x0=(this._x0+e)/2,this._y0,this._x0,t,e,t):this._context.bezierCurveTo(this._x0,this._y0=(this._y0+t)/2,e,this._y0,e,t)}this._x0=e,this._y0=t}};function bx(e){return new yx(e,!0)}function xx(e){return new yx(e,!1)}var Sx={draw(e,t){let n=tx(t/nx);e.moveTo(n,0),e.arc(0,0,n,0,rx)}},Cx={draw(e,t){let n=tx(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()}},wx=tx(1/3),Tx=wx*2,Ex={draw(e,t){let n=tx(t/Tx),r=n*wx;e.moveTo(0,-n),e.lineTo(r,0),e.lineTo(0,n),e.lineTo(-r,0),e.closePath()}},Dx={draw(e,t){let n=tx(t),r=-n/2;e.rect(r,r,n,n)}},Ox=.8908130915292852,kx=ex(nx/10)/ex(7*nx/10),Ax=ex(rx/10)*kx,jx=-$b(rx/10)*kx,Mx={draw(e,t){let n=tx(t*Ox),r=Ax*n,i=jx*n;e.moveTo(0,-n),e.lineTo(r,i);for(let t=1;t<5;++t){let a=rx*t/5,o=$b(a),s=ex(a);e.lineTo(s*n,-o*n),e.lineTo(o*r-s*i,s*r+o*i)}e.closePath()}},Nx=tx(3),Px={draw(e,t){let n=-tx(t/(Nx*3));e.moveTo(0,n*2),e.lineTo(-Nx*n,-n),e.lineTo(Nx*n,-n),e.closePath()}},Fx=-.5,Ix=tx(3)/2,Lx=1/tx(12),Rx=(Lx/2+1)*3,zx={draw(e,t){let n=tx(t/Rx),r=n/2,i=n*Lx,a=r,o=n*Lx+n,s=-a,c=o;e.moveTo(r,i),e.lineTo(a,o),e.lineTo(s,c),e.lineTo(Fx*r-Ix*i,Ix*r+Fx*i),e.lineTo(Fx*a-Ix*o,Ix*a+Fx*o),e.lineTo(Fx*s-Ix*c,Ix*s+Fx*c),e.lineTo(Fx*r+Ix*i,Fx*i-Ix*r),e.lineTo(Fx*a+Ix*o,Fx*o-Ix*a),e.lineTo(Fx*s+Ix*c,Fx*c-Ix*s),e.closePath()}};function Bx(e,t){let n=null,r=dx(i);e=typeof e==`function`?e:Qb(e||Sx),t=typeof t==`function`?t:Qb(t===void 0?64:+t);function i(){let i;if(n||=i=r(),e.apply(this,arguments).draw(n,+t.apply(this,arguments)),i)return n=null,i+``||null}return i.type=function(t){return arguments.length?(e=typeof t==`function`?t:Qb(t),i):e},i.size=function(e){return arguments.length?(t=typeof e==`function`?e:Qb(+e),i):t},i.context=function(e){return arguments.length?(n=e??null,i):n},i}function Vx(){}function Hx(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 Ux(e){this._context=e}Ux.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:Hx(this,this._x1,this._y1);case 2:this._context.lineTo(this._x1,this._y1)}(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:Hx(this,e,t)}this._x0=this._x1,this._x1=e,this._y0=this._y1,this._y1=t}};function Wx(e){return new Ux(e)}function Gx(e){this._context=e}Gx.prototype={areaStart:Vx,areaEnd:Vx,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)}},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:Hx(this,e,t)}this._x0=this._x1,this._x1=e,this._y0=this._y1,this._y1=t}};function Kx(e){return new Gx(e)}function qx(e){this._context=e}qx.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:Hx(this,e,t)}this._x0=this._x1,this._x1=e,this._y0=this._y1,this._y1=t}};function Jx(e){return new qx(e)}function Yx(e){this._context=e}Yx.prototype={areaStart:Vx,areaEnd:Vx,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 Xx(e){return new Yx(e)}function Zx(e){return e<0?-1:1}function Qx(e,t,n){var r=e._x1-e._x0,i=t-e._x1,a=(e._y1-e._y0)/(r||i<0&&-0),o=(n-e._y1)/(i||r<0&&-0),s=(a*i+o*r)/(r+i);return(Zx(a)+Zx(o))*Math.min(Math.abs(a),Math.abs(o),.5*Math.abs(s))||0}function $x(e,t){var n=e._x1-e._x0;return n?(3*(e._y1-e._y0)/n-t)/2:t}function eS(e,t,n){var r=e._x0,i=e._y0,a=e._x1,o=e._y1,s=(a-r)/3;e._context.bezierCurveTo(r+s,i+s*t,a-s,o-s*n,a,o)}function tS(e){this._context=e}tS.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:eS(this,this._t0,$x(this,this._t0))}(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,eS(this,$x(this,n=Qx(this,e,t)),n);break;default:eS(this,this._t0,n=Qx(this,e,t))}this._x0=this._x1,this._x1=e,this._y0=this._y1,this._y1=t,this._t0=n}}};function nS(e){this._context=new rS(e)}(nS.prototype=Object.create(tS.prototype)).point=function(e,t){tS.prototype.point.call(this,t,e)};function rS(e){this._context=e}rS.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,i,a){this._context.bezierCurveTo(t,e,r,n,a,i)}};function iS(e){return new tS(e)}function aS(e){return new nS(e)}function oS(e){this._context=e}oS.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=sS(e),i=sS(t),a=0,o=1;o<n;++a,++o)this._context.bezierCurveTo(r[0][a],i[0][a],r[1][a],i[1][a],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 sS(e){var t,n=e.length-1,r,i=Array(n),a=Array(n),o=Array(n);for(i[0]=0,a[0]=2,o[0]=e[0]+2*e[1],t=1;t<n-1;++t)i[t]=1,a[t]=4,o[t]=4*e[t]+2*e[t+1];for(i[n-1]=2,a[n-1]=7,o[n-1]=8*e[n-1]+e[n],t=1;t<n;++t)r=i[t]/a[t-1],a[t]-=r,o[t]-=r*o[t-1];for(i[n-1]=o[n-1]/a[n-1],t=n-2;t>=0;--t)i[t]=(o[t]-i[t+1])/a[t];for(a[n-1]=(e[n]+i[n-1])/2,t=0;t<n-1;++t)a[t]=2*e[t+1]-i[t+1];return[i,a]}function cS(e){return new oS(e)}function lS(e,t){this._context=e,this._t=t}lS.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)}}this._x=e,this._y=t}};function uS(e){return new lS(e,.5)}function dS(e){return new lS(e,0)}function fS(e){return new lS(e,1)}function pS(e,t){if((o=e.length)>1)for(var n=1,r,i,a=e[t[0]],o,s=a.length;n<o;++n)for(i=a,a=e[t[n]],r=0;r<s;++r)a[r][1]+=a[r][0]=isNaN(i[r][1])?i[r][0]:i[r][1]}function mS(e){for(var t=e.length,n=Array(t);--t>=0;)n[t]=t;return n}function hS(e,t){return e[t]}function gS(e){let t=[];return t.key=e,t}function _S(){var e=Qb([]),t=mS,n=pS,r=hS;function i(i){var a=Array.from(e.apply(this,arguments),gS),o,s=a.length,c=-1,l;for(let e of i)for(o=0,++c;o<s;++o)(a[o][c]=[0,+r(e,a[o].key,c,i)]).data=e;for(o=0,l=fx(t(a));o<s;++o)a[l[o]].index=o;return n(a,l),a}return i.keys=function(t){return arguments.length?(e=typeof t==`function`?t:Qb(Array.from(t)),i):e},i.value=function(e){return arguments.length?(r=typeof e==`function`?e:Qb(+e),i):r},i.order=function(e){return arguments.length?(t=e==null?mS:typeof e==`function`?e:Qb(Array.from(e)),i):t},i.offset=function(e){return arguments.length?(n=e??pS,i):n},i}function vS(e,t){if((r=e.length)>0){for(var n,r,i=0,a=e[0].length,o;i<a;++i){for(o=n=0;n<r;++n)o+=e[n][i][1]||0;if(o)for(n=0;n<r;++n)e[n][i][1]/=o}pS(e,t)}}function yS(e,t){if((i=e.length)>0){for(var n=0,r=e[t[0]],i,a=r.length;n<a;++n){for(var o=0,s=0;o<i;++o)s+=e[o][n][1]||0;r[n][1]+=r[n][0]=-s/2}pS(e,t)}}function bS(e,t){if((o=e.length)>0&&(a=(i=e[t[0]]).length)>0){for(var n=0,r=1,i,a,o;r<a;++r){for(var s=0,c=0,l=0;s<o;++s){for(var u=e[t[s]],d=u[r][1]||0,f=(d-(u[r-1][1]||0))/2,p=0;p<s;++p){var m=e[t[p]],h=m[r][1]||0,g=m[r-1][1]||0;f+=h-g}c+=d,l+=f*d}i[r-1][1]+=i[r-1][0]=n,c&&(n-=l/c)}i[r-1][1]+=i[r-1][0]=n,pS(e,t)}}var xS=l(Zb());function SS(e){"@babel/helpers - typeof";return SS=typeof Symbol==`function`&&typeof Symbol.iterator==`symbol`?function(e){return typeof e}:function(e){return e&&typeof Symbol==`function`&&e.constructor===Symbol&&e!==Symbol.prototype?`symbol`:typeof e},SS(e)}var CS=[`type`,`size`,`sizeType`];function wS(){return wS=Object.assign?Object.assign.bind():function(e){for(var t=1;t<arguments.length;t++){var n=arguments[t];for(var r in n)Object.prototype.hasOwnProperty.call(n,r)&&(e[r]=n[r])}return e},wS.apply(this,arguments)}function TS(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter(function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable})),n.push.apply(n,r)}return n}function ES(e){for(var t=1;t<arguments.length;t++){var n=arguments[t]==null?{}:arguments[t];t%2?TS(Object(n),!0).forEach(function(t){DS(e,t,n[t])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):TS(Object(n)).forEach(function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(n,t))})}return e}function DS(e,t,n){return t=OS(t),t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function OS(e){var t=kS(e,`string`);return SS(t)==`symbol`?t:t+``}function kS(e,t){if(SS(e)!=`object`||!e)return e;var n=e[Symbol.toPrimitive];if(n!==void 0){var r=n.call(e,t||`default`);if(SS(r)!=`object`)return r;throw TypeError(`@@toPrimitive must return a primitive value.`)}return(t===`string`?String:Number)(e)}function AS(e,t){if(e==null)return{};var n=jS(e,t),r,i;if(Object.getOwnPropertySymbols){var a=Object.getOwnPropertySymbols(e);for(i=0;i<a.length;i++)r=a[i],!(t.indexOf(r)>=0)&&Object.prototype.propertyIsEnumerable.call(e,r)&&(n[r]=e[r])}return n}function jS(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 MS={symbolCircle:Sx,symbolCross:Cx,symbolDiamond:Ex,symbolSquare:Dx,symbolStar:Mx,symbolTriangle:Px,symbolWye:zx},NS=Math.PI/180,PS=function(e){return MS[`symbol${(0,xS.default)(e)}`]||Sx},FS=function(e,t,n){if(t===`area`)return e;switch(n){case`cross`:return 5*e*e/9;case`diamond`:return .5*e*e/Math.sqrt(3);case`square`:return e*e;case`star`:var r=18*NS;return 1.25*e*e*(Math.tan(r)-Math.tan(r*2)*Math.tan(r)**2);case`triangle`:return Math.sqrt(3)*e*e/4;case`wye`:return(21-10*Math.sqrt(3))*e*e/8;default:return Math.PI*e*e/4}},IS=function(e,t){MS[`symbol${(0,xS.default)(e)}`]=t},LS=function(e){var t=e.type,n=t===void 0?`circle`:t,r=e.size,i=r===void 0?64:r,a=e.sizeType,o=a===void 0?`area`:a,s=ES(ES({},AS(e,CS)),{},{type:n,size:i,sizeType:o}),c=function(){var e=PS(n);return Bx().type(e).size(FS(i,o,n))()},l=s.className,u=s.cx,d=s.cy,f=Ob(s,!0);return u===+u&&d===+d&&i===+i?_.createElement(`path`,wS({},f,{className:Ht(`recharts-symbols`,l),transform:`translate(${u}, ${d})`,d:c()})):null};LS.registerSymbol=IS;function RS(e){"@babel/helpers - typeof";return RS=typeof Symbol==`function`&&typeof Symbol.iterator==`symbol`?function(e){return typeof e}:function(e){return e&&typeof Symbol==`function`&&e.constructor===Symbol&&e!==Symbol.prototype?`symbol`:typeof e},RS(e)}function zS(){return zS=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},zS.apply(this,arguments)}function BS(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter(function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable})),n.push.apply(n,r)}return n}function VS(e){for(var t=1;t<arguments.length;t++){var n=arguments[t]==null?{}:arguments[t];t%2?BS(Object(n),!0).forEach(function(t){KS(e,t,n[t])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):BS(Object(n)).forEach(function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(n,t))})}return e}function ete(e,t){if(!(e instanceof t))throw TypeError(`Cannot call a class as a function`)}function HS(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,qS(r.key),r)}}function tte(e,t,n){return t&&HS(e.prototype,t),n&&HS(e,n),Object.defineProperty(e,"prototype",{writable:!1}),e}function nte(e,t,n){return t=WS(t),rte(e,US()?Reflect.construct(t,n||[],WS(e).constructor):t.apply(e,n))}function rte(e,t){if(t&&(RS(t)===`object`||typeof t==`function`))return t;if(t!==void 0)throw TypeError(`Derived constructors may only return object or undefined`);return ite(e)}function ite(e){if(e===void 0)throw ReferenceError(`this hasn't been initialised - super() hasn't been called`);return e}function US(){try{var e=!Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],function(){}))}catch{}return(US=function(){return!!e})()}function WS(e){return WS=Object.setPrototypeOf?Object.getPrototypeOf.bind():function(e){return e.__proto__||Object.getPrototypeOf(e)},WS(e)}function ate(e,t){if(typeof t!=`function`&&t!==null)throw TypeError(`Super expression must either be null or a function`);e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,writable:!0,configurable:!0}}),Object.defineProperty(e,"prototype",{writable:!1}),t&&GS(e,t)}function GS(e,t){return GS=Object.setPrototypeOf?Object.setPrototypeOf.bind():function(e,t){return e.__proto__=t,e},GS(e,t)}function KS(e,t,n){return t=qS(t),t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function qS(e){var t=ote(e,`string`);return RS(t)==`symbol`?t:t+``}function ote(e,t){if(RS(e)!=`object`||!e)return e;var n=e[Symbol.toPrimitive];if(n!==void 0){var r=n.call(e,t||`default`);if(RS(r)!=`object`)return r;throw TypeError(`@@toPrimitive must return a primitive value.`)}return(t===`string`?String:Number)(e)}var JS=32,YS=function(e){function t(){return ete(this,t),nte(this,t,arguments)}return ate(t,e),tte(t,[{key:`renderIcon`,value:function(e){var t=this.props.inactiveColor,n=JS/2,r=JS/6,i=JS/3,a=e.inactive?t:e.color;if(e.type===`plainline`)return _.createElement(`line`,{strokeWidth:4,fill:`none`,stroke:a,strokeDasharray:e.payload.strokeDasharray,x1:0,y1:n,x2:JS,y2:n,className:`recharts-legend-icon`});if(e.type===`line`)return _.createElement(`path`,{strokeWidth:4,fill:`none`,stroke:a,d:`M0,${n}h${i}
|
|
60
|
-
A${r},${r},0,1,1,${2*i},${n}
|
|
61
|
-
H${JS}M${2*i},${n}
|
|
62
|
-
A${r},${r},0,1,1,${i},${n}`,className:`recharts-legend-icon`});if(e.type===`rect`)return _.createElement(`path`,{stroke:`none`,fill:a,d:`M0,${JS/8}h${JS}v${JS*3/4}h${-JS}z`,className:`recharts-legend-icon`});if(_.isValidElement(e.legendIcon)){var o=VS({},e);return delete o.legendIcon,_.cloneElement(e.legendIcon,o)}return _.createElement(LS,{fill:a,cx:n,cy:n,size:JS,sizeType:`diameter`,type:e.type})}},{key:`renderItems`,value:function(){var e=this,t=this.props,n=t.payload,r=t.iconSize,i=t.layout,a=t.formatter,o=t.inactiveColor,s={x:0,y:0,width:JS,height:JS},c={display:i===`horizontal`?`inline-block`:`block`,marginRight:10},l={display:`inline-block`,verticalAlign:`middle`,marginRight:4};return n.map(function(t,n){var i=t.formatter||a,u=Ht(KS(KS({"recharts-legend-item":!0},`legend-item-${n}`,!0),`inactive`,t.inactive));if(t.type===`none`)return null;var d=(0,lb.default)(t.value)?null:t.value;(0,lb.default)(t.value);var f=t.inactive?o:t.color;return _.createElement(`li`,zS({className:u,style:c,key:`legend-item-${n}`},cb(e.props,t,n)),_.createElement(Rb,{width:r,height:r,viewBox:s,style:l},e.renderIcon(t)),_.createElement(`span`,{className:`recharts-legend-item-text`,style:{color:f}},i?i(d,t,n):d))})}},{key:`render`,value:function(){var e=this.props,t=e.payload,n=e.layout,r=e.align;if(!t||!t.length)return null;var i={padding:0,margin:0,textAlign:n===`horizontal`?r:`left`};return _.createElement(`ul`,{className:`recharts-default-legend`,style:i},this.renderItems())}}])}(_.PureComponent);KS(YS,`displayName`,`Legend`),KS(YS,`defaultProps`,{iconSize:14,layout:`horizontal`,align:`center`,verticalAlign:`middle`,inactiveColor:`#ccc`});var ste=o(((e,t)=>{var n=cy();function r(){this.__data__=new n,this.size=0}t.exports=r})),cte=o(((e,t)=>{function n(e){var t=this.__data__,n=t.delete(e);return this.size=t.size,n}t.exports=n})),lte=o(((e,t)=>{function n(e){return this.__data__.get(e)}t.exports=n})),ute=o(((e,t)=>{function n(e){return this.__data__.has(e)}t.exports=n})),dte=o(((e,t)=>{var n=cy(),r=ly(),i=_y(),a=200;function o(e,t){var o=this.__data__;if(o instanceof n){var s=o.__data__;if(!r||s.length<a-1)return s.push([e,t]),this.size=++o.size,this;o=this.__data__=new i(s)}return o.set(e,t),this.size=o.size,this}t.exports=o})),XS=o(((e,t)=>{var n=cy(),r=ste(),i=cte(),a=lte(),o=ute(),s=dte();function c(e){var t=this.__data__=new n(e);this.size=t.size}c.prototype.clear=r,c.prototype.delete=i,c.prototype.get=a,c.prototype.has=o,c.prototype.set=s,t.exports=c})),fte=o(((e,t)=>{function n(e){return this.__data__.set(e,`__lodash_hash_undefined__`),this}t.exports=n})),pte=o(((e,t)=>{function n(e){return this.__data__.has(e)}t.exports=n})),ZS=o(((e,t)=>{var n=_y(),r=fte(),i=pte();function a(e){var t=-1,r=e==null?0:e.length;for(this.__data__=new n;++t<r;)this.add(e[t])}a.prototype.add=a.prototype.push=r,a.prototype.has=i,t.exports=a})),QS=o(((e,t)=>{function n(e,t){for(var n=-1,r=e==null?0:e.length;++n<r;)if(t(e[n],n,e))return!0;return!1}t.exports=n})),$S=o(((e,t)=>{function n(e,t){return e.has(t)}t.exports=n})),eC=o(((e,t)=>{var n=ZS(),r=QS(),i=$S(),a=1,o=2;function s(e,t,s,c,l,u){var d=s&a,f=e.length,p=t.length;if(f!=p&&!(d&&p>f))return!1;var m=u.get(e),h=u.get(t);if(m&&h)return m==t&&h==e;var g=-1,_=!0,v=s&o?new n:void 0;for(u.set(e,t),u.set(t,e);++g<f;){var y=e[g],b=t[g];if(c)var x=d?c(b,y,g,t,e,u):c(y,b,g,e,t,u);if(x!==void 0){if(x)continue;_=!1;break}if(v){if(!r(t,function(e,t){if(!i(v,t)&&(y===e||l(y,e,s,c,u)))return v.push(t)})){_=!1;break}}else if(!(y===b||l(y,b,s,c,u))){_=!1;break}}return u.delete(e),u.delete(t),_}t.exports=s})),mte=o(((e,t)=>{t.exports=Mv().Uint8Array})),hte=o(((e,t)=>{function n(e){var t=-1,n=Array(e.size);return e.forEach(function(e,r){n[++t]=[r,e]}),n}t.exports=n})),tC=o(((e,t)=>{function n(e){var t=-1,n=Array(e.size);return e.forEach(function(e){n[++t]=e}),n}t.exports=n})),gte=o(((e,t)=>{var n=Nv(),r=mte(),i=ny(),a=eC(),o=hte(),s=tC(),c=1,l=2,u=`[object Boolean]`,d=`[object Date]`,f=`[object Error]`,p=`[object Map]`,m=`[object Number]`,h=`[object RegExp]`,g=`[object Set]`,_=`[object String]`,v=`[object Symbol]`,y=`[object ArrayBuffer]`,b=`[object DataView]`,x=n?n.prototype:void 0,S=x?x.valueOf:void 0;function C(e,t,n,x,C,w,T){switch(n){case b:if(e.byteLength!=t.byteLength||e.byteOffset!=t.byteOffset)return!1;e=e.buffer,t=t.buffer;case y:return!(e.byteLength!=t.byteLength||!w(new r(e),new r(t)));case u:case d:case m:return i(+e,+t);case f:return e.name==t.name&&e.message==t.message;case h:case _:return e==t+``;case p:var E=o;case g:var D=x&c;if(E||=s,e.size!=t.size&&!D)return!1;var O=T.get(e);if(O)return O==t;x|=l,T.set(e,t);var k=a(E(e),E(t),x,C,w,T);return T.delete(e),k;case v:if(S)return S.call(e)==S.call(t)}return!1}t.exports=C})),nC=o(((e,t)=>{function n(e,t){for(var n=-1,r=t.length,i=e.length;++n<r;)e[i+n]=t[n];return e}t.exports=n})),_te=o(((e,t)=>{var n=nC(),r=Av();function i(e,t,i){var a=t(e);return r(e)?a:n(a,i(e))}t.exports=i})),vte=o(((e,t)=>{function n(e,t){for(var n=-1,r=e==null?0:e.length,i=0,a=[];++n<r;){var o=e[n];t(o,n,e)&&(a[i++]=o)}return a}t.exports=n})),yte=o(((e,t)=>{function n(){return[]}t.exports=n})),bte=o(((e,t)=>{var n=vte(),r=yte(),i=Object.prototype.propertyIsEnumerable,a=Object.getOwnPropertySymbols;t.exports=a?function(e){return e==null?[]:(e=Object(e),n(a(e),function(t){return i.call(e,t)}))}:r})),xte=o(((e,t)=>{function n(e,t){for(var n=-1,r=Array(e);++n<e;)r[n]=t(n);return r}t.exports=n})),Ste=o(((e,t)=>{var n=Iv(),r=Lv(),i=`[object Arguments]`;function a(e){return r(e)&&n(e)==i}t.exports=a})),rC=o(((e,t)=>{var n=Ste(),r=Lv(),i=Object.prototype,a=i.hasOwnProperty,o=i.propertyIsEnumerable;t.exports=n(function(){return arguments}())?n:function(e){return r(e)&&a.call(e,`callee`)&&!o.call(e,`callee`)}})),Cte=o(((e,t)=>{function n(){return!1}t.exports=n})),iC=o(((e,t)=>{var n=Mv(),r=Cte(),i=typeof e==`object`&&e&&!e.nodeType&&e,a=i&&typeof t==`object`&&t&&!t.nodeType&&t,o=a&&a.exports===i?n.Buffer:void 0;t.exports=(o?o.isBuffer:void 0)||r})),aC=o(((e,t)=>{var n=/^(?:0|[1-9]\d*)$/;function r(e,t){var r=typeof e;return t??=9007199254740991,!!t&&(r==`number`||r!=`symbol`&&n.test(e))&&e>-1&&e%1==0&&e<t}t.exports=r})),oC=o(((e,t)=>{function n(e){return typeof e==`number`&&e>-1&&e%1==0&&e<=9007199254740991}t.exports=n})),wte=o(((e,t)=>{var n=Iv(),r=oC(),i=Lv(),a=`[object Arguments]`,o=`[object Array]`,s=`[object Boolean]`,c=`[object Date]`,l=`[object Error]`,u=`[object Function]`,d=`[object Map]`,f=`[object Number]`,p=`[object Object]`,m=`[object RegExp]`,h=`[object Set]`,g=`[object String]`,_=`[object WeakMap]`,v=`[object ArrayBuffer]`,y=`[object DataView]`,b=`[object Float32Array]`,x=`[object Float64Array]`,S=`[object Int8Array]`,C=`[object Int16Array]`,w=`[object Int32Array]`,T=`[object Uint8Array]`,E=`[object Uint8ClampedArray]`,D=`[object Uint16Array]`,O=`[object Uint32Array]`,k={};k[b]=k[x]=k[S]=k[C]=k[w]=k[T]=k[E]=k[D]=k[O]=!0,k[a]=k[o]=k[v]=k[s]=k[y]=k[c]=k[l]=k[u]=k[d]=k[f]=k[p]=k[m]=k[h]=k[g]=k[_]=!1;function A(e){return i(e)&&r(e.length)&&!!k[n(e)]}t.exports=A})),sC=o(((e,t)=>{function n(e){return function(t){return e(t)}}t.exports=n})),Tte=o(((e,t)=>{var n=jv(),r=typeof e==`object`&&e&&!e.nodeType&&e,i=r&&typeof t==`object`&&t&&!t.nodeType&&t,a=i&&i.exports===r&&n.process;t.exports=function(){try{return i&&i.require&&i.require(`util`).types||a&&a.binding&&a.binding(`util`)}catch{}}()})),cC=o(((e,t)=>{var n=wte(),r=sC(),i=Tte(),a=i&&i.isTypedArray;t.exports=a?r(a):n})),Ete=o(((e,t)=>{var n=xte(),r=rC(),i=Av(),a=iC(),o=aC(),s=cC(),c=Object.prototype.hasOwnProperty;function l(e,t){var l=i(e),u=!l&&r(e),d=!l&&!u&&a(e),f=!l&&!u&&!d&&s(e),p=l||u||d||f,m=p?n(e.length,String):[],h=m.length;for(var g in e)(t||c.call(e,g))&&!(p&&(g==`length`||d&&(g==`offset`||g==`parent`)||f&&(g==`buffer`||g==`byteLength`||g==`byteOffset`)||o(g,h)))&&m.push(g);return m}t.exports=l})),Dte=o(((e,t)=>{var n=Object.prototype;function r(e){var t=e&&e.constructor;return e===(typeof t==`function`&&t.prototype||n)}t.exports=r})),lC=o(((e,t)=>{function n(e,t){return function(n){return e(t(n))}}t.exports=n})),Ote=o(((e,t)=>{t.exports=lC()(Object.keys,Object)})),kte=o(((e,t)=>{var n=Dte(),r=Ote(),i=Object.prototype.hasOwnProperty;function a(e){if(!n(e))return r(e);var t=[];for(var a in Object(e))i.call(e,a)&&a!=`constructor`&&t.push(a);return t}t.exports=a})),uC=o(((e,t)=>{var n=Vv(),r=oC();function i(e){return e!=null&&r(e.length)&&!n(e)}t.exports=i})),dC=o(((e,t)=>{var n=Ete(),r=kte(),i=uC();function a(e){return i(e)?n(e):r(e)}t.exports=a})),Ate=o(((e,t)=>{var n=_te(),r=bte(),i=dC();function a(e){return n(e,i,r)}t.exports=a})),jte=o(((e,t)=>{var n=Ate(),r=1,i=Object.prototype.hasOwnProperty;function a(e,t,a,o,s,c){var l=a&r,u=n(e),d=u.length;if(d!=n(t).length&&!l)return!1;for(var f=d;f--;){var p=u[f];if(!(l?p in t:i.call(t,p)))return!1}var m=c.get(e),h=c.get(t);if(m&&h)return m==t&&h==e;var g=!0;c.set(e,t),c.set(t,e);for(var _=l;++f<d;){p=u[f];var v=e[p],y=t[p];if(o)var b=l?o(y,v,p,t,e,c):o(v,y,p,e,t,c);if(!(b===void 0?v===y||s(v,y,a,o,c):b)){g=!1;break}_||=p==`constructor`}if(g&&!_){var x=e.constructor,S=t.constructor;x!=S&&`constructor`in e&&`constructor`in t&&!(typeof x==`function`&&x instanceof x&&typeof S==`function`&&S instanceof S)&&(g=!1)}return c.delete(e),c.delete(t),g}t.exports=a})),Mte=o(((e,t)=>{t.exports=qv()(Mv(),`DataView`)})),Nte=o(((e,t)=>{t.exports=qv()(Mv(),`Promise`)})),fC=o(((e,t)=>{t.exports=qv()(Mv(),`Set`)})),Pte=o(((e,t)=>{t.exports=qv()(Mv(),`WeakMap`)})),Fte=o(((e,t)=>{var n=Mte(),r=ly(),i=Nte(),a=fC(),o=Pte(),s=Iv(),c=Wv(),l=`[object Map]`,u=`[object Object]`,d=`[object Promise]`,f=`[object Set]`,p=`[object WeakMap]`,m=`[object DataView]`,h=c(n),g=c(r),_=c(i),v=c(a),y=c(o),b=s;(n&&b(new n(new ArrayBuffer(1)))!=m||r&&b(new r)!=l||i&&b(i.resolve())!=d||a&&b(new a)!=f||o&&b(new o)!=p)&&(b=function(e){var t=s(e),n=t==u?e.constructor:void 0,r=n?c(n):``;if(r)switch(r){case h:return m;case g:return l;case _:return d;case v:return f;case y:return p}return t}),t.exports=b})),Ite=o(((e,t)=>{var n=XS(),r=eC(),i=gte(),a=jte(),o=Fte(),s=Av(),c=iC(),l=cC(),u=1,d=`[object Arguments]`,f=`[object Array]`,p=`[object Object]`,m=Object.prototype.hasOwnProperty;function h(e,t,h,g,_,v){var y=s(e),b=s(t),x=y?f:o(e),S=b?f:o(t);x=x==d?p:x,S=S==d?p:S;var C=x==p,w=S==p,T=x==S;if(T&&c(e)){if(!c(t))return!1;y=!0,C=!1}if(T&&!C)return v||=new n,y||l(e)?r(e,t,h,g,_,v):i(e,t,x,h,g,_,v);if(!(h&u)){var E=C&&m.call(e,`__wrapped__`),D=w&&m.call(t,`__wrapped__`);if(E||D){var O=E?e.value():e,k=D?t.value():t;return v||=new n,_(O,k,h,g,v)}}return T?(v||=new n,a(e,t,h,g,_,v)):!1}t.exports=h})),pC=o(((e,t)=>{var n=Ite(),r=Lv();function i(e,t,a,o,s){return e===t?!0:e==null||t==null||!r(e)&&!r(t)?e!==e&&t!==t:n(e,t,a,o,i,s)}t.exports=i})),Lte=o(((e,t)=>{var n=XS(),r=pC(),i=1,a=2;function o(e,t,o,s){var c=o.length,l=c,u=!s;if(e==null)return!l;for(e=Object(e);c--;){var d=o[c];if(u&&d[2]?d[1]!==e[d[0]]:!(d[0]in e))return!1}for(;++c<l;){d=o[c];var f=d[0],p=e[f],m=d[1];if(u&&d[2]){if(p===void 0&&!(f in e))return!1}else{var h=new n;if(s)var g=s(p,m,f,e,t,h);if(!(g===void 0?r(m,p,i|a,s,h):g))return!1}}return!0}t.exports=o})),mC=o(((e,t)=>{var n=Bv();function r(e){return e===e&&!n(e)}t.exports=r})),Rte=o(((e,t)=>{var n=mC(),r=dC();function i(e){for(var t=r(e),i=t.length;i--;){var a=t[i],o=e[a];t[i]=[a,o,n(o)]}return t}t.exports=i})),hC=o(((e,t)=>{function n(e,t){return function(n){return n!=null&&n[e]===t&&(t!==void 0||e in Object(n))}}t.exports=n})),zte=o(((e,t)=>{var n=Lte(),r=Rte(),i=hC();function a(e){var t=r(e);return t.length==1&&t[0][2]?i(t[0][0],t[0][1]):function(r){return r===e||n(r,e,t)}}t.exports=a})),Bte=o(((e,t)=>{function n(e,t){return e!=null&&t in Object(e)}t.exports=n})),Vte=o(((e,t)=>{var n=wy(),r=rC(),i=Av(),a=aC(),o=oC(),s=Ty();function c(e,t,c){t=n(t,e);for(var l=-1,u=t.length,d=!1;++l<u;){var f=s(t[l]);if(!(d=e!=null&&c(e,f)))break;e=e[f]}return d||++l!=u?d:(u=e==null?0:e.length,!!u&&o(u)&&a(f,u)&&(i(e)||r(e)))}t.exports=c})),Hte=o(((e,t)=>{var n=Bte(),r=Vte();function i(e,t){return e!=null&&r(e,t,n)}t.exports=i})),Ute=o(((e,t)=>{var n=pC(),r=Dy(),i=Hte(),a=zv(),o=mC(),s=hC(),c=Ty(),l=1,u=2;function d(e,t){return a(e)&&o(t)?s(c(e),t):function(a){var o=r(a,e);return o===void 0&&o===t?i(a,e):n(t,o,l|u)}}t.exports=d})),gC=o(((e,t)=>{function n(e){return e}t.exports=n})),Wte=o(((e,t)=>{function n(e){return function(t){return t?.[e]}}t.exports=n})),Gte=o(((e,t)=>{var n=Ey();function r(e){return function(t){return n(t,e)}}t.exports=r})),Kte=o(((e,t)=>{var n=Wte(),r=Gte(),i=zv(),a=Ty();function o(e){return i(e)?n(a(e)):r(e)}t.exports=o})),_C=o(((e,t)=>{var n=zte(),r=Ute(),i=gC(),a=Av(),o=Kte();function s(e){return typeof e==`function`?e:e==null?i:typeof e==`object`?a(e)?r(e[0],e[1]):n(e):o(e)}t.exports=s})),vC=o(((e,t)=>{function n(e,t,n,r){for(var i=e.length,a=n+(r?1:-1);r?a--:++a<i;)if(t(e[a],a,e))return a;return-1}t.exports=n})),qte=o(((e,t)=>{function n(e){return e!==e}t.exports=n})),Jte=o(((e,t)=>{function n(e,t,n){for(var r=n-1,i=e.length;++r<i;)if(e[r]===t)return r;return-1}t.exports=n})),Yte=o(((e,t)=>{var n=vC(),r=qte(),i=Jte();function a(e,t,a){return t===t?i(e,t,a):n(e,r,a)}t.exports=a})),Xte=o(((e,t)=>{var n=Yte();function r(e,t){return!!(e!=null&&e.length)&&n(e,t,0)>-1}t.exports=r})),Zte=o(((e,t)=>{function n(e,t,n){for(var r=-1,i=e==null?0:e.length;++r<i;)if(n(t,e[r]))return!0;return!1}t.exports=n})),Qte=o(((e,t)=>{function n(){}t.exports=n})),$te=o(((e,t)=>{var n=fC(),r=Qte(),i=tC();t.exports=n&&1/i(new n([,-0]))[1]==1/0?function(e){return new n(e)}:r})),ene=o(((e,t)=>{var n=ZS(),r=Xte(),i=Zte(),a=$S(),o=$te(),s=tC(),c=200;function l(e,t,l){var u=-1,d=r,f=e.length,p=!0,m=[],h=m;if(l)p=!1,d=i;else if(f>=c){var g=t?null:o(e);if(g)return s(g);p=!1,d=a,h=new n}else h=t?[]:m;outer:for(;++u<f;){var _=e[u],v=t?t(_):_;if(_=l||_!==0?_:0,p&&v===v){for(var y=h.length;y--;)if(h[y]===v)continue outer;t&&h.push(v),m.push(_)}else d(h,v,l)||(h!==m&&h.push(v),m.push(_))}return m}t.exports=l})),yC=l(o(((e,t)=>{var n=_C(),r=ene();function i(e,t){return e&&e.length?r(e,n(t,2)):[]}t.exports=i}))());function bC(e,t,n){return t===!0?(0,yC.default)(e,n):(0,lb.default)(t)?(0,yC.default)(e,t):e}function xC(e){"@babel/helpers - typeof";return xC=typeof Symbol==`function`&&typeof Symbol.iterator==`symbol`?function(e){return typeof e}:function(e){return e&&typeof Symbol==`function`&&e.constructor===Symbol&&e!==Symbol.prototype?`symbol`:typeof e},xC(e)}var tne=[`ref`];function SC(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter(function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable})),n.push.apply(n,r)}return n}function CC(e){for(var t=1;t<arguments.length;t++){var n=arguments[t]==null?{}:arguments[t];t%2?SC(Object(n),!0).forEach(function(t){OC(e,t,n[t])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):SC(Object(n)).forEach(function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(n,t))})}return e}function nne(e,t){if(!(e instanceof t))throw TypeError(`Cannot call a class as a function`)}function wC(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,kC(r.key),r)}}function rne(e,t,n){return t&&wC(e.prototype,t),n&&wC(e,n),Object.defineProperty(e,"prototype",{writable:!1}),e}function ine(e,t,n){return t=EC(t),ane(e,TC()?Reflect.construct(t,n||[],EC(e).constructor):t.apply(e,n))}function ane(e,t){if(t&&(xC(t)===`object`||typeof t==`function`))return t;if(t!==void 0)throw TypeError(`Derived constructors may only return object or undefined`);return one(e)}function one(e){if(e===void 0)throw ReferenceError(`this hasn't been initialised - super() hasn't been called`);return e}function TC(){try{var e=!Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],function(){}))}catch{}return(TC=function(){return!!e})()}function EC(e){return EC=Object.setPrototypeOf?Object.getPrototypeOf.bind():function(e){return e.__proto__||Object.getPrototypeOf(e)},EC(e)}function sne(e,t){if(typeof t!=`function`&&t!==null)throw 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&&DC(e,t)}function DC(e,t){return DC=Object.setPrototypeOf?Object.setPrototypeOf.bind():function(e,t){return e.__proto__=t,e},DC(e,t)}function OC(e,t,n){return t=kC(t),t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function kC(e){var t=cne(e,`string`);return xC(t)==`symbol`?t:t+``}function cne(e,t){if(xC(e)!=`object`||!e)return e;var n=e[Symbol.toPrimitive];if(n!==void 0){var r=n.call(e,t||`default`);if(xC(r)!=`object`)return r;throw TypeError(`@@toPrimitive must return a primitive value.`)}return(t===`string`?String:Number)(e)}function lne(e,t){if(e==null)return{};var n=une(e,t),r,i;if(Object.getOwnPropertySymbols){var a=Object.getOwnPropertySymbols(e);for(i=0;i<a.length;i++)r=a[i],!(t.indexOf(r)>=0)&&Object.prototype.propertyIsEnumerable.call(e,r)&&(n[r]=e[r])}return n}function une(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 dne(e){return e.value}function fne(e,t){if(_.isValidElement(e))return _.cloneElement(e,t);if(typeof e==`function`)return _.createElement(e,t);t.ref;var n=lne(t,tne);return _.createElement(YS,n)}var AC=1,jC=function(e){function t(){var e;nne(this,t);var n=[...arguments];return e=ine(this,t,[].concat(n)),OC(e,`lastBoundingBox`,{width:-1,height:-1}),e}return sne(t,e),rne(t,[{key:`componentDidMount`,value:function(){this.updateBBox()}},{key:`componentDidUpdate`,value:function(){this.updateBBox()}},{key:`getBBox`,value:function(){if(this.wrapperNode&&this.wrapperNode.getBoundingClientRect){var e=this.wrapperNode.getBoundingClientRect();return e.height=this.wrapperNode.offsetHeight,e.width=this.wrapperNode.offsetWidth,e}return null}},{key:`updateBBox`,value:function(){var e=this.props.onBBoxUpdate,t=this.getBBox();t?(Math.abs(t.width-this.lastBoundingBox.width)>AC||Math.abs(t.height-this.lastBoundingBox.height)>AC)&&(this.lastBoundingBox.width=t.width,this.lastBoundingBox.height=t.height,e&&e(t)):(this.lastBoundingBox.width!==-1||this.lastBoundingBox.height!==-1)&&(this.lastBoundingBox.width=-1,this.lastBoundingBox.height=-1,e&&e(null))}},{key:`getBBoxSnapshot`,value:function(){return this.lastBoundingBox.width>=0&&this.lastBoundingBox.height>=0?CC({},this.lastBoundingBox):{width:0,height:0}}},{key:`getDefaultPosition`,value:function(e){var t=this.props,n=t.layout,r=t.align,i=t.verticalAlign,a=t.margin,o=t.chartWidth,s=t.chartHeight,c,l;if(!e||(e.left===void 0||e.left===null)&&(e.right===void 0||e.right===null)){if(r===`center`&&n===`vertical`){var u=this.getBBoxSnapshot();c={left:((o||0)-u.width)/2}}else c=r===`right`?{right:a&&a.right||0}:{left:a&&a.left||0}}if(!e||(e.top===void 0||e.top===null)&&(e.bottom===void 0||e.bottom===null)){if(i===`middle`){var d=this.getBBoxSnapshot();l={top:((s||0)-d.height)/2}}else l=i===`bottom`?{bottom:a&&a.bottom||0}:{top:a&&a.top||0}}return CC(CC({},c),l)}},{key:`render`,value:function(){var e=this,t=this.props,n=t.content,r=t.width,i=t.height,a=t.wrapperStyle,o=t.payloadUniqBy,s=t.payload,c=CC(CC({position:`absolute`,width:r||`auto`,height:i||`auto`},this.getDefaultPosition(a)),a);return _.createElement(`div`,{className:`recharts-legend-wrapper`,style:c,ref:function(t){e.wrapperNode=t}},fne(n,CC(CC({},this.props),{},{payload:bC(s,o,dne)})))}}],[{key:`getWithHeight`,value:function(e,t){var n=CC(CC({},this.defaultProps),e.props).layout;return n===`vertical`&&Vy(e.props.height)?{height:e.props.height}:n===`horizontal`?{width:e.props.width||t}:null}}])}(_.PureComponent);OC(jC,`displayName`,`Legend`),OC(jC,`defaultProps`,{iconSize:14,layout:`horizontal`,align:`center`,verticalAlign:`bottom`});var pne=o(((e,t)=>{var n=Nv(),r=rC(),i=Av(),a=n?n.isConcatSpreadable:void 0;function o(e){return i(e)||r(e)||!!(a&&e&&e[a])}t.exports=o})),MC=o(((e,t)=>{var n=nC(),r=pne();function i(e,t,a,o,s){var c=-1,l=e.length;for(a||=r,s||=[];++c<l;){var u=e[c];t>0&&a(u)?t>1?i(u,t-1,a,o,s):n(s,u):o||(s[s.length]=u)}return s}t.exports=i})),mne=o(((e,t)=>{function n(e){return function(t,n,r){for(var i=-1,a=Object(t),o=r(t),s=o.length;s--;){var c=o[e?s:++i];if(n(a[c],c,a)===!1)break}return t}}t.exports=n})),hne=o(((e,t)=>{t.exports=mne()()})),NC=o(((e,t)=>{var n=hne(),r=dC();function i(e,t){return e&&n(e,t,r)}t.exports=i})),gne=o(((e,t)=>{var n=uC();function r(e,t){return function(r,i){if(r==null)return r;if(!n(r))return e(r,i);for(var a=r.length,o=t?a:-1,s=Object(r);(t?o--:++o<a)&&i(s[o],o,s)!==!1;);return r}}t.exports=r})),PC=o(((e,t)=>{var n=NC();t.exports=gne()(n)})),FC=o(((e,t)=>{var n=PC(),r=uC();function i(e,t){var i=-1,a=r(e)?Array(e.length):[];return n(e,function(e,n,r){a[++i]=t(e,n,r)}),a}t.exports=i})),_ne=o(((e,t)=>{function n(e,t){var n=e.length;for(e.sort(t);n--;)e[n]=e[n].value;return e}t.exports=n})),vne=o(((e,t)=>{var n=Rv();function r(e,t){if(e!==t){var r=e!==void 0,i=e===null,a=e===e,o=n(e),s=t!==void 0,c=t===null,l=t===t,u=n(t);if(!c&&!u&&!o&&e>t||o&&s&&l&&!c&&!u||i&&s&&l||!r&&l||!a)return 1;if(!i&&!o&&!u&&e<t||u&&r&&a&&!i&&!o||c&&r&&a||!s&&a||!l)return-1}return 0}t.exports=r})),yne=o(((e,t)=>{var n=vne();function r(e,t,r){for(var i=-1,a=e.criteria,o=t.criteria,s=a.length,c=r.length;++i<s;){var l=n(a[i],o[i]);if(l)return i>=c?l:l*(r[i]==`desc`?-1:1)}return e.index-t.index}t.exports=r})),bne=o(((e,t)=>{var n=xy(),r=Ey(),i=_C(),a=FC(),o=_ne(),s=sC(),c=yne(),l=gC(),u=Av();function d(e,t,d){t=t.length?n(t,function(e){return u(e)?function(t){return r(t,e.length===1?e[0]:e)}:e}):[l];var f=-1;return t=n(t,s(i)),o(a(e,function(e,r,i){return{criteria:n(t,function(t){return t(e)}),index:++f,value:e}}),function(e,t){return c(e,t,d)})}t.exports=d})),xne=o(((e,t)=>{function n(e,t,n){switch(n.length){case 0:return e.call(t);case 1:return e.call(t,n[0]);case 2:return e.call(t,n[0],n[1]);case 3:return e.call(t,n[0],n[1],n[2])}return e.apply(t,n)}t.exports=n})),Sne=o(((e,t)=>{var n=xne(),r=Math.max;function i(e,t,i){return t=r(t===void 0?e.length-1:t,0),function(){for(var a=arguments,o=-1,s=r(a.length-t,0),c=Array(s);++o<s;)c[o]=a[t+o];o=-1;for(var l=Array(t+1);++o<t;)l[o]=a[o];return l[t]=i(c),n(e,this,l)}}t.exports=i})),Cne=o(((e,t)=>{function n(e){return function(){return e}}t.exports=n})),IC=o(((e,t)=>{var n=qv();t.exports=function(){try{var e=n(Object,`defineProperty`);return e({},``,{}),e}catch{}}()})),wne=o(((e,t)=>{var n=Cne(),r=IC(),i=gC();t.exports=r?function(e,t){return r(e,`toString`,{configurable:!0,enumerable:!1,value:n(t),writable:!0})}:i})),Tne=o(((e,t)=>{var n=Date.now;function r(e){var t=0,r=0;return function(){var i=n(),a=16-(i-r);if(r=i,a>0){if(++t>=800)return arguments[0]}else t=0;return e.apply(void 0,arguments)}}t.exports=r})),Ene=o(((e,t)=>{var n=wne();t.exports=Tne()(n)})),Dne=o(((e,t)=>{var n=gC(),r=Sne(),i=Ene();function a(e,t){return i(r(e,t,n),e+``)}t.exports=a})),LC=o(((e,t)=>{var n=ny(),r=uC(),i=aC(),a=Bv();function o(e,t,o){if(!a(o))return!1;var s=typeof t;return(s==`number`?r(o)&&i(t,o.length):s==`string`&&t in o)?n(o[t],e):!1}t.exports=o})),RC=l(o(((e,t)=>{var n=MC(),r=bne(),i=Dne(),a=LC();t.exports=i(function(e,t){if(e==null)return[];var i=t.length;return i>1&&a(e,t[0],t[1])?t=[]:i>2&&a(t[0],t[1],t[2])&&(t=[t[0]]),r(e,n(t,1),[])})}))());function zC(e){"@babel/helpers - typeof";return zC=typeof Symbol==`function`&&typeof Symbol.iterator==`symbol`?function(e){return typeof e}:function(e){return e&&typeof Symbol==`function`&&e.constructor===Symbol&&e!==Symbol.prototype?`symbol`:typeof e},zC(e)}function BC(){return BC=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},BC.apply(this,arguments)}function One(e,t){return Mne(e)||jne(e,t)||Ane(e,t)||kne()}function kne(){throw TypeError(`Invalid attempt to destructure non-iterable instance.
|
|
63
|
-
In order to be iterable, non-array objects must have a [Symbol.iterator]() method.`)}function Ane(e,t){if(e){if(typeof e==`string`)return VC(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 VC(e,t)}}function VC(e,t){(t==null||t>e.length)&&(t=e.length);for(var n=0,r=Array(t);n<t;n++)r[n]=e[n];return r}function jne(e,t){var n=e==null?null:typeof Symbol<`u`&&e[Symbol.iterator]||e[`@@iterator`];if(n!=null){var r,i,a,o,s=[],c=!0,l=!1;try{if(a=(n=n.call(e)).next,t===0){if(Object(n)!==n)return;c=!1}else for(;!(c=(r=a.call(n)).done)&&(s.push(r.value),s.length!==t);c=!0);}catch(e){l=!0,i=e}finally{try{if(!c&&n.return!=null&&(o=n.return(),Object(o)!==o))return}finally{if(l)throw i}}return s}}function Mne(e){if(Array.isArray(e))return e}function HC(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter(function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable})),n.push.apply(n,r)}return n}function UC(e){for(var t=1;t<arguments.length;t++){var n=arguments[t]==null?{}:arguments[t];t%2?HC(Object(n),!0).forEach(function(t){WC(e,t,n[t])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):HC(Object(n)).forEach(function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(n,t))})}return e}function WC(e,t,n){return t=GC(t),t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function GC(e){var t=KC(e,`string`);return zC(t)==`symbol`?t:t+``}function KC(e,t){if(zC(e)!=`object`||!e)return e;var n=e[Symbol.toPrimitive];if(n!==void 0){var r=n.call(e,t||`default`);if(zC(r)!=`object`)return r;throw TypeError(`@@toPrimitive must return a primitive value.`)}return(t===`string`?String:Number)(e)}function qC(e){return Array.isArray(e)&&Uy(e[0])&&Uy(e[1])?e.join(` ~ `):e}var JC=function(e){var t=e.separator,n=t===void 0?` : `:t,r=e.contentStyle,i=r===void 0?{}:r,a=e.itemStyle,o=a===void 0?{}:a,s=e.labelStyle,c=s===void 0?{}:s,l=e.payload,u=e.formatter,d=e.itemSorter,f=e.wrapperClassName,p=e.labelClassName,m=e.label,h=e.labelFormatter,g=e.accessibilityLayer,v=g!==void 0&&g,y=function(){if(l&&l.length){var e={padding:0,margin:0},t=(d?(0,RC.default)(l,d):l).map(function(e,t){if(e.type===`none`)return null;var r=UC({display:`block`,paddingTop:4,paddingBottom:4,color:e.color||`#000`},o),i=e.formatter||u||qC,a=e.value,s=e.name,c=a,d=s;if(i&&c!=null&&d!=null){var f=i(a,s,e,t,l);if(Array.isArray(f)){var p=One(f,2);c=p[0],d=p[1]}else c=f}return _.createElement(`li`,{className:`recharts-tooltip-item`,key:`tooltip-item-${t}`,style:r},Uy(d)?_.createElement(`span`,{className:`recharts-tooltip-item-name`},d):null,Uy(d)?_.createElement(`span`,{className:`recharts-tooltip-item-separator`},n):null,_.createElement(`span`,{className:`recharts-tooltip-item-value`},c),_.createElement(`span`,{className:`recharts-tooltip-item-unit`},e.unit||``))});return _.createElement(`ul`,{className:`recharts-tooltip-item-list`,style:e},t)}return null},b=UC({margin:0,padding:10,backgroundColor:`#fff`,border:`1px solid #ccc`,whiteSpace:`nowrap`},i),x=UC({margin:0},c),S=!(0,Ry.default)(m),C=S?m:``,w=Ht(`recharts-default-tooltip`,f),T=Ht(`recharts-tooltip-label`,p);S&&h&&l!=null&&(C=h(m,l));var E=v?{role:`status`,"aria-live":`assertive`}:{};return _.createElement(`div`,BC({className:w,style:b},E),_.createElement(`p`,{className:T,style:x},_.isValidElement(C)?C:`${C}`),y())};function YC(e){"@babel/helpers - typeof";return YC=typeof Symbol==`function`&&typeof Symbol.iterator==`symbol`?function(e){return typeof e}:function(e){return e&&typeof Symbol==`function`&&e.constructor===Symbol&&e!==Symbol.prototype?`symbol`:typeof e},YC(e)}function XC(e,t,n){return t=ZC(t),t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function ZC(e){var t=QC(e,`string`);return YC(t)==`symbol`?t:t+``}function QC(e,t){if(YC(e)!=`object`||!e)return e;var n=e[Symbol.toPrimitive];if(n!==void 0){var r=n.call(e,t||`default`);if(YC(r)!=`object`)return r;throw TypeError(`@@toPrimitive must return a primitive value.`)}return(t===`string`?String:Number)(e)}var $C=`recharts-tooltip-wrapper`,ew={visibility:`hidden`};function tw(e){var t=e.coordinate,n=e.translateX,r=e.translateY;return Ht($C,XC(XC(XC(XC({},`${$C}-right`,Vy(n)&&t&&Vy(t.x)&&n>=t.x),`${$C}-left`,Vy(n)&&t&&Vy(t.x)&&n<t.x),`${$C}-bottom`,Vy(r)&&t&&Vy(t.y)&&r>=t.y),`${$C}-top`,Vy(r)&&t&&Vy(t.y)&&r<t.y))}function nw(e){var t=e.allowEscapeViewBox,n=e.coordinate,r=e.key,i=e.offsetTopLeft,a=e.position,o=e.reverseDirection,s=e.tooltipDimension,c=e.viewBox,l=e.viewBoxDimension;if(a&&Vy(a[r]))return a[r];var u=n[r]-s-i,d=n[r]+i;return t[r]?o[r]?u:d:o[r]?u<c[r]?Math.max(d,c[r]):Math.max(u,c[r]):d+s>c[r]+l?Math.max(u,c[r]):Math.max(d,c[r])}function rw(e){var t=e.translateX,n=e.translateY;return{transform:e.useTranslate3d?`translate3d(${t}px, ${n}px, 0)`:`translate(${t}px, ${n}px)`}}function iw(e){var t=e.allowEscapeViewBox,n=e.coordinate,r=e.offsetTopLeft,i=e.position,a=e.reverseDirection,o=e.tooltipBox,s=e.useTranslate3d,c=e.viewBox,l,u,d;return o.height>0&&o.width>0&&n?(u=nw({allowEscapeViewBox:t,coordinate:n,key:`x`,offsetTopLeft:r,position:i,reverseDirection:a,tooltipDimension:o.width,viewBox:c,viewBoxDimension:c.width}),d=nw({allowEscapeViewBox:t,coordinate:n,key:`y`,offsetTopLeft:r,position:i,reverseDirection:a,tooltipDimension:o.height,viewBox:c,viewBoxDimension:c.height}),l=rw({translateX:u,translateY:d,useTranslate3d:s})):l=ew,{cssProperties:l,cssClasses:tw({translateX:u,translateY:d,coordinate:n})}}function aw(e){"@babel/helpers - typeof";return aw=typeof Symbol==`function`&&typeof Symbol.iterator==`symbol`?function(e){return typeof e}:function(e){return e&&typeof Symbol==`function`&&e.constructor===Symbol&&e!==Symbol.prototype?`symbol`:typeof e},aw(e)}function ow(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter(function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable})),n.push.apply(n,r)}return n}function sw(e){for(var t=1;t<arguments.length;t++){var n=arguments[t]==null?{}:arguments[t];t%2?ow(Object(n),!0).forEach(function(t){vw(e,t,n[t])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):ow(Object(n)).forEach(function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(n,t))})}return e}function cw(e,t){if(!(e instanceof t))throw TypeError(`Cannot call a class as a function`)}function lw(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,yw(r.key),r)}}function uw(e,t,n){return t&&lw(e.prototype,t),n&&lw(e,n),Object.defineProperty(e,"prototype",{writable:!1}),e}function dw(e,t,n){return t=hw(t),fw(e,mw()?Reflect.construct(t,n||[],hw(e).constructor):t.apply(e,n))}function fw(e,t){if(t&&(aw(t)===`object`||typeof t==`function`))return t;if(t!==void 0)throw TypeError(`Derived constructors may only return object or undefined`);return pw(e)}function pw(e){if(e===void 0)throw ReferenceError(`this hasn't been initialised - super() hasn't been called`);return e}function mw(){try{var e=!Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],function(){}))}catch{}return(mw=function(){return!!e})()}function hw(e){return hw=Object.setPrototypeOf?Object.getPrototypeOf.bind():function(e){return e.__proto__||Object.getPrototypeOf(e)},hw(e)}function gw(e,t){if(typeof t!=`function`&&t!==null)throw 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&&_w(e,t)}function _w(e,t){return _w=Object.setPrototypeOf?Object.setPrototypeOf.bind():function(e,t){return e.__proto__=t,e},_w(e,t)}function vw(e,t,n){return t=yw(t),t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function yw(e){var t=bw(e,`string`);return aw(t)==`symbol`?t:t+``}function bw(e,t){if(aw(e)!=`object`||!e)return e;var n=e[Symbol.toPrimitive];if(n!==void 0){var r=n.call(e,t||`default`);if(aw(r)!=`object`)return r;throw TypeError(`@@toPrimitive must return a primitive value.`)}return(t===`string`?String:Number)(e)}var xw=1,Sw=function(e){function t(){var e;cw(this,t);var n=[...arguments];return e=dw(this,t,[].concat(n)),vw(e,`state`,{dismissed:!1,dismissedAtCoordinate:{x:0,y:0},lastBoundingBox:{width:-1,height:-1}}),vw(e,`handleKeyDown`,function(t){t.key===`Escape`&&e.setState({dismissed:!0,dismissedAtCoordinate:{x:e.props.coordinate?.x??0,y:e.props.coordinate?.y??0}})}),e}return gw(t,e),uw(t,[{key:`updateBBox`,value:function(){if(this.wrapperNode&&this.wrapperNode.getBoundingClientRect){var e=this.wrapperNode.getBoundingClientRect();(Math.abs(e.width-this.state.lastBoundingBox.width)>xw||Math.abs(e.height-this.state.lastBoundingBox.height)>xw)&&this.setState({lastBoundingBox:{width:e.width,height:e.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(){this.props.active&&this.updateBBox(),this.state.dismissed&&(this.props.coordinate?.x!==this.state.dismissedAtCoordinate.x||this.props.coordinate?.y!==this.state.dismissedAtCoordinate.y)&&(this.state.dismissed=!1)}},{key:`render`,value:function(){var e=this,t=this.props,n=t.active,r=t.allowEscapeViewBox,i=t.animationDuration,a=t.animationEasing,o=t.children,s=t.coordinate,c=t.hasPayload,l=t.isAnimationActive,u=t.offset,d=t.position,f=t.reverseDirection,p=t.useTranslate3d,m=t.viewBox,h=t.wrapperStyle,g=iw({allowEscapeViewBox:r,coordinate:s,offsetTopLeft:u,position:d,reverseDirection:f,tooltipBox:this.state.lastBoundingBox,useTranslate3d:p,viewBox:m}),v=g.cssClasses,y=g.cssProperties,b=sw(sw({transition:l&&n?`transform ${i}ms ${a}`:void 0},y),{},{pointerEvents:`none`,visibility:!this.state.dismissed&&n&&c?`visible`:`hidden`,position:`absolute`,top:0,left:0},h);return _.createElement(`div`,{tabIndex:-1,className:v,style:b,ref:function(t){e.wrapperNode=t}},o)}}])}(_.PureComponent),Cw={isSsr:function(){return!(typeof window<`u`&&window.document&&window.document.createElement&&window.setTimeout)}(),get:function(e){return Cw[e]},set:function(e,t){if(typeof e==`string`)Cw[e]=t;else{var n=Object.keys(e);n&&n.length&&n.forEach(function(t){Cw[t]=e[t]})}}};function ww(e){"@babel/helpers - typeof";return ww=typeof Symbol==`function`&&typeof Symbol.iterator==`symbol`?function(e){return typeof e}:function(e){return e&&typeof Symbol==`function`&&e.constructor===Symbol&&e!==Symbol.prototype?`symbol`:typeof e},ww(e)}function Tw(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter(function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable})),n.push.apply(n,r)}return n}function Ew(e){for(var t=1;t<arguments.length;t++){var n=arguments[t]==null?{}:arguments[t];t%2?Tw(Object(n),!0).forEach(function(t){Lw(e,t,n[t])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):Tw(Object(n)).forEach(function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(n,t))})}return e}function Dw(e,t){if(!(e instanceof t))throw TypeError(`Cannot call a class as a function`)}function Ow(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,Rw(r.key),r)}}function kw(e,t,n){return t&&Ow(e.prototype,t),n&&Ow(e,n),Object.defineProperty(e,"prototype",{writable:!1}),e}function Aw(e,t,n){return t=Pw(t),jw(e,Nw()?Reflect.construct(t,n||[],Pw(e).constructor):t.apply(e,n))}function jw(e,t){if(t&&(ww(t)===`object`||typeof t==`function`))return t;if(t!==void 0)throw TypeError(`Derived constructors may only return object or undefined`);return Mw(e)}function Mw(e){if(e===void 0)throw ReferenceError(`this hasn't been initialised - super() hasn't been called`);return e}function Nw(){try{var e=!Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],function(){}))}catch{}return(Nw=function(){return!!e})()}function Pw(e){return Pw=Object.setPrototypeOf?Object.getPrototypeOf.bind():function(e){return e.__proto__||Object.getPrototypeOf(e)},Pw(e)}function Fw(e,t){if(typeof t!=`function`&&t!==null)throw 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&&Iw(e,t)}function Iw(e,t){return Iw=Object.setPrototypeOf?Object.setPrototypeOf.bind():function(e,t){return e.__proto__=t,e},Iw(e,t)}function Lw(e,t,n){return t=Rw(t),t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function Rw(e){var t=zw(e,`string`);return ww(t)==`symbol`?t:t+``}function zw(e,t){if(ww(e)!=`object`||!e)return e;var n=e[Symbol.toPrimitive];if(n!==void 0){var r=n.call(e,t||`default`);if(ww(r)!=`object`)return r;throw TypeError(`@@toPrimitive must return a primitive value.`)}return(t===`string`?String:Number)(e)}function Bw(e){return e.dataKey}function Vw(e,t){return _.isValidElement(e)?_.cloneElement(e,t):typeof e==`function`?_.createElement(e,t):_.createElement(JC,t)}var Hw=function(e){function t(){return Dw(this,t),Aw(this,t,arguments)}return Fw(t,e),kw(t,[{key:`render`,value:function(){var e=this,t=this.props,n=t.active,r=t.allowEscapeViewBox,i=t.animationDuration,a=t.animationEasing,o=t.content,s=t.coordinate,c=t.filterNull,l=t.isAnimationActive,u=t.offset,d=t.payload,f=t.payloadUniqBy,p=t.position,m=t.reverseDirection,h=t.useTranslate3d,g=t.viewBox,v=t.wrapperStyle,y=d??[];c&&y.length&&(y=bC(d.filter(function(t){return t.value!=null&&(t.hide!==!0||e.props.includeHidden)}),f,Bw));var b=y.length>0;return _.createElement(Sw,{allowEscapeViewBox:r,animationDuration:i,animationEasing:a,isAnimationActive:l,active:n,coordinate:s,hasPayload:b,offset:u,position:p,reverseDirection:m,useTranslate3d:h,viewBox:g,wrapperStyle:v},Vw(o,Ew(Ew({},this.props),{},{payload:y})))}}])}(_.PureComponent);Lw(Hw,`displayName`,`Tooltip`),Lw(Hw,`defaultProps`,{accessibilityLayer:!1,allowEscapeViewBox:{x:!1,y:!1},animationDuration:400,animationEasing:`ease`,contentStyle:{},coordinate:{x:0,y:0},cursor:!0,cursorStyle:{},filterNull:!0,isAnimationActive:!Cw.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 Uw=o(((e,t)=>{var n=Mv();t.exports=function(){return n.Date.now()}})),Ww=o(((e,t)=>{var n=/\s/;function r(e){for(var t=e.length;t--&&n.test(e.charAt(t)););return t}t.exports=r})),Gw=o(((e,t)=>{var n=Ww(),r=/^\s+/;function i(e){return e&&e.slice(0,n(e)+1).replace(r,``)}t.exports=i})),Kw=o(((e,t)=>{var n=Gw(),r=Bv(),i=Rv(),a=NaN,o=/^[-+]0x[0-9a-f]+$/i,s=/^0b[01]+$/i,c=/^0o[0-7]+$/i,l=parseInt;function u(e){if(typeof e==`number`)return e;if(i(e))return a;if(r(e)){var t=typeof e.valueOf==`function`?e.valueOf():e;e=r(t)?t+``:t}if(typeof e!=`string`)return e===0?e:+e;e=n(e);var u=s.test(e);return u||c.test(e)?l(e.slice(2),u?2:8):o.test(e)?a:+e}t.exports=u})),qw=o(((e,t)=>{var n=Bv(),r=Uw(),i=Kw(),a=`Expected a function`,o=Math.max,s=Math.min;function c(e,t,c){var l,u,d,f,p,m,h=0,g=!1,_=!1,v=!0;if(typeof e!=`function`)throw TypeError(a);t=i(t)||0,n(c)&&(g=!!c.leading,_=`maxWait`in c,d=_?o(i(c.maxWait)||0,t):d,v=`trailing`in c?!!c.trailing:v);function y(t){var n=l,r=u;return l=u=void 0,h=t,f=e.apply(r,n),f}function b(e){return h=e,p=setTimeout(C,t),g?y(e):f}function x(e){var n=e-m,r=e-h,i=t-n;return _?s(i,d-r):i}function S(e){var n=e-m,r=e-h;return m===void 0||n>=t||n<0||_&&r>=d}function C(){var e=r();if(S(e))return w(e);p=setTimeout(C,x(e))}function w(e){return p=void 0,v&&l?y(e):(l=u=void 0,f)}function T(){p!==void 0&&clearTimeout(p),h=0,l=m=u=p=void 0}function E(){return p===void 0?f:w(r())}function D(){var e=r(),n=S(e);if(l=arguments,u=this,m=e,n){if(p===void 0)return b(m);if(_)return clearTimeout(p),p=setTimeout(C,t),y(m)}return p===void 0&&(p=setTimeout(C,t)),f}return D.cancel=T,D.flush=E,D}t.exports=c})),Jw=l(o(((e,t)=>{var n=qw(),r=Bv(),i=`Expected a function`;function a(e,t,a){var o=!0,s=!0;if(typeof e!=`function`)throw TypeError(i);return r(a)&&(o=`leading`in a?!!a.leading:o,s=`trailing`in a?!!a.trailing:s),n(e,t,{leading:o,maxWait:t,trailing:s})}t.exports=a}))());function Yw(e){"@babel/helpers - typeof";return Yw=typeof Symbol==`function`&&typeof Symbol.iterator==`symbol`?function(e){return typeof e}:function(e){return e&&typeof Symbol==`function`&&e.constructor===Symbol&&e!==Symbol.prototype?`symbol`:typeof e},Yw(e)}function Xw(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter(function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable})),n.push.apply(n,r)}return n}function Zw(e){for(var t=1;t<arguments.length;t++){var n=arguments[t]==null?{}:arguments[t];t%2?Xw(Object(n),!0).forEach(function(t){Qw(e,t,n[t])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):Xw(Object(n)).forEach(function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(n,t))})}return e}function Qw(e,t,n){return t=$w(t),t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function $w(e){var t=eT(e,`string`);return Yw(t)==`symbol`?t:t+``}function eT(e,t){if(Yw(e)!=`object`||!e)return e;var n=e[Symbol.toPrimitive];if(n!==void 0){var r=n.call(e,t||`default`);if(Yw(r)!=`object`)return r;throw TypeError(`@@toPrimitive must return a primitive value.`)}return(t===`string`?String:Number)(e)}function tT(e,t){return oT(e)||aT(e,t)||rT(e,t)||nT()}function nT(){throw TypeError(`Invalid attempt to destructure non-iterable instance.
|
|
64
|
-
In order to be iterable, non-array objects must have a [Symbol.iterator]() method.`)}function rT(e,t){if(e){if(typeof e==`string`)return iT(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 iT(e,t)}}function iT(e,t){(t==null||t>e.length)&&(t=e.length);for(var n=0,r=Array(t);n<t;n++)r[n]=e[n];return r}function aT(e,t){var n=e==null?null:typeof Symbol<`u`&&e[Symbol.iterator]||e[`@@iterator`];if(n!=null){var r,i,a,o,s=[],c=!0,l=!1;try{if(a=(n=n.call(e)).next,t===0){if(Object(n)!==n)return;c=!1}else for(;!(c=(r=a.call(n)).done)&&(s.push(r.value),s.length!==t);c=!0);}catch(e){l=!0,i=e}finally{try{if(!c&&n.return!=null&&(o=n.return(),Object(o)!==o))return}finally{if(l)throw i}}return s}}function oT(e){if(Array.isArray(e))return e}var sT=(0,_.forwardRef)(function(e,t){var n=e.aspect,r=e.initialDimension,i=r===void 0?{width:-1,height:-1}:r,a=e.width,o=a===void 0?`100%`:a,s=e.height,c=s===void 0?`100%`:s,l=e.minWidth,u=l===void 0?0:l,d=e.minHeight,f=e.maxHeight,p=e.children,m=e.debounce,h=m===void 0?0:m,g=e.id,v=e.className,y=e.onResize,b=e.style,x=b===void 0?{}:b,S=(0,_.useRef)(null),C=(0,_.useRef)();C.current=y,(0,_.useImperativeHandle)(t,function(){return Object.defineProperty(S.current,"current",{get:function(){return console.warn(`The usage of ref.current.current is deprecated and will no longer be supported.`),S.current},configurable:!0})});var w=tT((0,_.useState)({containerWidth:i.width,containerHeight:i.height}),2),T=w[0],E=w[1],D=(0,_.useCallback)(function(e,t){E(function(n){var r=Math.round(e),i=Math.round(t);return n.containerWidth===r&&n.containerHeight===i?n:{containerWidth:r,containerHeight:i}})},[]);(0,_.useEffect)(function(){var e=function(e){var t,n=e[0].contentRect,r=n.width,i=n.height;D(r,i),(t=C.current)==null||t.call(C,r,i)};h>0&&(e=(0,Jw.default)(e,h,{trailing:!0,leading:!1}));var t=new ResizeObserver(e),n=S.current.getBoundingClientRect(),r=n.width,i=n.height;return D(r,i),t.observe(S.current),function(){t.disconnect()}},[D,h]);var O=(0,_.useMemo)(function(){var e=T.containerWidth,t=T.containerHeight;if(e<0||t<0)return null;By(o)||By(c);var r=By(o)?e:o,i=By(c)?t:c;n&&n>0&&(r?i=r/n:i&&(r=i*n),f&&i>f&&(i=f));var a=!Array.isArray(p)&&_b(p.type).endsWith(`Chart`);return _.Children.map(p,function(e){return _.isValidElement(e)?(0,_.cloneElement)(e,Zw({width:r,height:i},a?{style:Zw({height:`100%`,width:`100%`,maxHeight:i,maxWidth:r},e.props.style)}:{})):e})},[n,p,c,f,d,u,T,o]);return _.createElement(`div`,{id:g?`${g}`:void 0,className:Ht(`recharts-responsive-container`,v),style:Zw(Zw({},x),{},{width:o,height:c,minWidth:u,minHeight:d,maxHeight:f}),ref:S},O)}),cT=function(e){return null};cT.displayName=`Cell`;function lT(e){"@babel/helpers - typeof";return lT=typeof Symbol==`function`&&typeof Symbol.iterator==`symbol`?function(e){return typeof e}:function(e){return e&&typeof Symbol==`function`&&e.constructor===Symbol&&e!==Symbol.prototype?`symbol`:typeof e},lT(e)}function uT(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter(function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable})),n.push.apply(n,r)}return n}function dT(e){for(var t=1;t<arguments.length;t++){var n=arguments[t]==null?{}:arguments[t];t%2?uT(Object(n),!0).forEach(function(t){fT(e,t,n[t])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):uT(Object(n)).forEach(function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(n,t))})}return e}function fT(e,t,n){return t=pT(t),t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function pT(e){var t=mT(e,`string`);return lT(t)==`symbol`?t:t+``}function mT(e,t){if(lT(e)!=`object`||!e)return e;var n=e[Symbol.toPrimitive];if(n!==void 0){var r=n.call(e,t||`default`);if(lT(r)!=`object`)return r;throw TypeError(`@@toPrimitive must return a primitive value.`)}return(t===`string`?String:Number)(e)}var hT={widthCache:{},cacheCount:0},gT=2e3,_T={position:`absolute`,top:`-20000px`,left:0,padding:0,margin:0,border:`none`,whiteSpace:`pre`},vT=`recharts_measurement_span`;function yT(e){var t=dT({},e);return Object.keys(t).forEach(function(e){t[e]||delete t[e]}),t}var bT=function(e){var t=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{};if(e==null||Cw.isSsr)return{width:0,height:0};var n=yT(t),r=JSON.stringify({text:e,copyStyle:n});if(hT.widthCache[r])return hT.widthCache[r];try{var i=document.getElementById(vT);i||(i=document.createElement(`span`),i.setAttribute(`id`,vT),i.setAttribute(`aria-hidden`,`true`),document.body.appendChild(i));var a=dT(dT({},_T),n);Object.assign(i.style,a),i.textContent=`${e}`;var o=i.getBoundingClientRect(),s={width:o.width,height:o.height};return hT.widthCache[r]=s,++hT.cacheCount>gT&&(hT.cacheCount=0,hT.widthCache={}),s}catch{return{width:0,height:0}}},xT=function(e){return{top:e.top+window.scrollY-document.documentElement.clientTop,left:e.left+window.scrollX-document.documentElement.clientLeft}};function ST(e){"@babel/helpers - typeof";return ST=typeof Symbol==`function`&&typeof Symbol.iterator==`symbol`?function(e){return typeof e}:function(e){return e&&typeof Symbol==`function`&&e.constructor===Symbol&&e!==Symbol.prototype?`symbol`:typeof e},ST(e)}function CT(e,t){return OT(e)||DT(e,t)||TT(e,t)||wT()}function wT(){throw TypeError(`Invalid attempt to destructure non-iterable instance.
|
|
65
|
-
In order to be iterable, non-array objects must have a [Symbol.iterator]() method.`)}function TT(e,t){if(e){if(typeof e==`string`)return ET(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 ET(e,t)}}function ET(e,t){(t==null||t>e.length)&&(t=e.length);for(var n=0,r=Array(t);n<t;n++)r[n]=e[n];return r}function DT(e,t){var n=e==null?null:typeof Symbol<`u`&&e[Symbol.iterator]||e[`@@iterator`];if(n!=null){var r,i,a,o,s=[],c=!0,l=!1;try{if(a=(n=n.call(e)).next,t===0){if(Object(n)!==n)return;c=!1}else for(;!(c=(r=a.call(n)).done)&&(s.push(r.value),s.length!==t);c=!0);}catch(e){l=!0,i=e}finally{try{if(!c&&n.return!=null&&(o=n.return(),Object(o)!==o))return}finally{if(l)throw i}}return s}}function OT(e){if(Array.isArray(e))return e}function kT(e,t){if(!(e instanceof t))throw TypeError(`Cannot call a class as a function`)}function AT(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,MT(r.key),r)}}function jT(e,t,n){return t&&AT(e.prototype,t),n&&AT(e,n),Object.defineProperty(e,"prototype",{writable:!1}),e}function MT(e){var t=NT(e,`string`);return ST(t)==`symbol`?t:t+``}function NT(e,t){if(ST(e)!=`object`||!e)return e;var n=e[Symbol.toPrimitive];if(n!==void 0){var r=n.call(e,t||`default`);if(ST(r)!=`object`)return r;throw TypeError(`@@toPrimitive must return a primitive value.`)}return(t===`string`?String:Number)(e)}var PT=/(-?\d+(?:\.\d+)?[a-zA-Z%]*)([*/])(-?\d+(?:\.\d+)?[a-zA-Z%]*)/,FT=/(-?\d+(?:\.\d+)?[a-zA-Z%]*)([+-])(-?\d+(?:\.\d+)?[a-zA-Z%]*)/,IT=/^px|cm|vh|vw|em|rem|%|mm|in|pt|pc|ex|ch|vmin|vmax|Q$/,LT=/(-?\d+(?:\.\d+)?)([a-zA-Z%]+)?/,RT={cm:96/2.54,mm:96/25.4,pt:96/72,pc:16,in:96,Q:96/101.6,px:1},zT=Object.keys(RT),BT=`NaN`;function VT(e,t){return e*RT[t]}var HT=function(){function e(t,n){kT(this,e),this.num=t,this.unit=n,this.num=t,this.unit=n,Number.isNaN(t)&&(this.unit=``),n!==``&&!IT.test(n)&&(this.num=NaN,this.unit=``),zT.includes(n)&&(this.num=VT(t,n),this.unit=`px`)}return jT(e,[{key:`add`,value:function(t){return this.unit===t.unit?new e(this.num+t.num,this.unit):new e(NaN,``)}},{key:`subtract`,value:function(t){return this.unit===t.unit?new e(this.num-t.num,this.unit):new e(NaN,``)}},{key:`multiply`,value:function(t){return this.unit!==``&&t.unit!==``&&this.unit!==t.unit?new e(NaN,``):new e(this.num*t.num,this.unit||t.unit)}},{key:`divide`,value:function(t){return this.unit!==``&&t.unit!==``&&this.unit!==t.unit?new e(NaN,``):new e(this.num/t.num,this.unit||t.unit)}},{key:`toString`,value:function(){return`${this.num}${this.unit}`}},{key:`isNaN`,value:function(){return Number.isNaN(this.num)}}],[{key:`parse`,value:function(t){var n=CT(LT.exec(t)??[],3),r=n[1],i=n[2];return new e(parseFloat(r),i??``)}}])}();function UT(e){if(e.includes(BT))return BT;for(var t=e;t.includes(`*`)||t.includes(`/`);){var n=CT(PT.exec(t)??[],4),r=n[1],i=n[2],a=n[3],o=HT.parse(r??``),s=HT.parse(a??``),c=i===`*`?o.multiply(s):o.divide(s);if(c.isNaN())return BT;t=t.replace(PT,c.toString())}for(;t.includes(`+`)||/.-\d+(?:\.\d+)?/.test(t);){var l=CT(FT.exec(t)??[],4),u=l[1],d=l[2],f=l[3],p=HT.parse(u??``),m=HT.parse(f??``),h=d===`+`?p.add(m):p.subtract(m);if(h.isNaN())return BT;t=t.replace(FT,h.toString())}return t}var WT=/\(([^()]*)\)/;function GT(e){for(var t=e;t.includes(`(`);){var n=CT(WT.exec(t),2)[1];t=t.replace(WT,UT(n))}return t}function KT(e){var t=e.replace(/\s+/g,``);return t=GT(t),t=UT(t),t}function qT(e){try{return KT(e)}catch{return BT}}function JT(e){var t=qT(e.slice(5,-1));return t===BT?``:t}var YT=[`x`,`y`,`lineHeight`,`capHeight`,`scaleToFit`,`textAnchor`,`verticalAnchor`,`fill`],XT=[`dx`,`dy`,`angle`,`className`,`breakAll`];function ZT(){return ZT=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},ZT.apply(this,arguments)}function QT(e,t){if(e==null)return{};var n=$T(e,t),r,i;if(Object.getOwnPropertySymbols){var a=Object.getOwnPropertySymbols(e);for(i=0;i<a.length;i++)r=a[i],!(t.indexOf(r)>=0)&&Object.prototype.propertyIsEnumerable.call(e,r)&&(n[r]=e[r])}return n}function $T(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 eE(e,t){return aE(e)||iE(e,t)||nE(e,t)||tE()}function tE(){throw TypeError(`Invalid attempt to destructure non-iterable instance.
|
|
66
|
-
In order to be iterable, non-array objects must have a [Symbol.iterator]() method.`)}function nE(e,t){if(e){if(typeof e==`string`)return rE(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 rE(e,t)}}function rE(e,t){(t==null||t>e.length)&&(t=e.length);for(var n=0,r=Array(t);n<t;n++)r[n]=e[n];return r}function iE(e,t){var n=e==null?null:typeof Symbol<`u`&&e[Symbol.iterator]||e[`@@iterator`];if(n!=null){var r,i,a,o,s=[],c=!0,l=!1;try{if(a=(n=n.call(e)).next,t===0){if(Object(n)!==n)return;c=!1}else for(;!(c=(r=a.call(n)).done)&&(s.push(r.value),s.length!==t);c=!0);}catch(e){l=!0,i=e}finally{try{if(!c&&n.return!=null&&(o=n.return(),Object(o)!==o))return}finally{if(l)throw i}}return s}}function aE(e){if(Array.isArray(e))return e}var oE=/[ \f\n\r\t\v\u2028\u2029]+/,sE=function(e){var t=e.children,n=e.breakAll,r=e.style;try{var i=[];return(0,Ry.default)(t)||(i=n?t.toString().split(``):t.toString().split(oE)),{wordsWithComputedWidth:i.map(function(e){return{word:e,width:bT(e,r).width}}),spaceWidth:n?0:bT(`\xA0`,r).width}}catch{return null}},cE=function(e,t,n,r,i){var a=e.maxLines,o=e.children,s=e.style,c=e.breakAll,l=Vy(a),u=o,d=function(){return(arguments.length>0&&arguments[0]!==void 0?arguments[0]:[]).reduce(function(e,t){var a=t.word,o=t.width,s=e[e.length-1];if(s&&(r==null||i||s.width+o+n<Number(r)))s.words.push(a),s.width+=o+n;else{var c={words:[a],width:o};e.push(c)}return e},[])},f=d(t),p=function(e){return e.reduce(function(e,t){return e.width>t.width?e:t})};if(!l)return f;for(var m=`…`,h=function(e){var t=sE({breakAll:c,style:s,children:u.slice(0,e)+m}).wordsWithComputedWidth,n=d(t);return[n.length>a||p(n).width>Number(r),n]},g=0,_=u.length-1,v=0,y;g<=_&&v<=u.length-1;){var b=Math.floor((g+_)/2),x=eE(h(b-1),2),S=x[0],C=x[1],w=eE(h(b),1)[0];if(!S&&!w&&(g=b+1),S&&w&&(_=b-1),!S&&w){y=C;break}v++}return y||f},lE=function(e){return[{words:(0,Ry.default)(e)?[]:e.toString().split(oE)}]},uE=function(e){var t=e.width,n=e.scaleToFit,r=e.children,i=e.style,a=e.breakAll,o=e.maxLines;if((t||n)&&!Cw.isSsr){var s,c,l=sE({breakAll:a,children:r,style:i});if(l){var u=l.wordsWithComputedWidth,d=l.spaceWidth;s=u,c=d}else return lE(r);return cE({breakAll:a,children:r,maxLines:o,style:i},s,c,t,n)}return lE(r)},dE=`#808080`,fE=function(e){var t=e.x,n=t===void 0?0:t,r=e.y,i=r===void 0?0:r,a=e.lineHeight,o=a===void 0?`1em`:a,s=e.capHeight,c=s===void 0?`0.71em`:s,l=e.scaleToFit,u=l!==void 0&&l,d=e.textAnchor,f=d===void 0?`start`:d,p=e.verticalAnchor,m=p===void 0?`end`:p,h=e.fill,g=h===void 0?dE:h,v=QT(e,YT),y=(0,_.useMemo)(function(){return uE({breakAll:v.breakAll,children:v.children,maxLines:v.maxLines,scaleToFit:u,style:v.style,width:v.width})},[v.breakAll,v.children,v.maxLines,u,v.style,v.width]),b=v.dx,x=v.dy,S=v.angle,C=v.className,w=v.breakAll,T=QT(v,XT);if(!Uy(n)||!Uy(i))return null;var E=n+(Vy(b)?b:0),D=i+(Vy(x)?x:0),O;switch(m){case`start`:O=JT(`calc(${c})`);break;case`middle`:O=JT(`calc(${(y.length-1)/2} * -${o} + (${c} / 2))`);break;default:O=JT(`calc(${y.length-1} * -${o})`)}var k=[];if(u){var A=y[0].width,j=v.width;k.push(`scale(${(Vy(j)?j/A:1)/A})`)}return S&&k.push(`rotate(${S}, ${E}, ${D})`),k.length&&(T.transform=k.join(` `)),_.createElement(`text`,ZT({},Ob(T,!0),{x:E,y:D,className:Ht(`recharts-text`,C),textAnchor:f,fill:g.includes(`url`)?dE:g}),y.map(function(e,t){var n=e.words.join(w?``:` `);return _.createElement(`tspan`,{x:E,dy:t===0?O:o,key:`${n}-${t}`},n)}))};function pE(e,t){return e==null||t==null?NaN:e<t?-1:e>t?1:e>=t?0:NaN}function mE(e,t){return e==null||t==null?NaN:t<e?-1:t>e?1:t>=e?0:NaN}function hE(e){let t,n,r;e.length===2?(t=e===pE||e===mE?e:gE,n=e,r=e):(t=pE,n=(t,n)=>pE(e(t),n),r=(t,n)=>e(t)-n);function i(e,r,i=0,a=e.length){if(i<a){if(t(r,r)!==0)return a;do{let t=i+a>>>1;n(e[t],r)<0?i=t+1:a=t}while(i<a)}return i}function a(e,r,i=0,a=e.length){if(i<a){if(t(r,r)!==0)return a;do{let t=i+a>>>1;n(e[t],r)<=0?i=t+1:a=t}while(i<a)}return i}function o(e,t,n=0,a=e.length){let o=i(e,t,n,a-1);return o>n&&r(e[o-1],t)>-r(e[o],t)?o-1:o}return{left:i,center:o,right:a}}function gE(){return 0}function _E(e){return e===null?NaN:+e}function*vE(e,t){if(t===void 0)for(let t of e)t!=null&&(t=+t)>=t&&(yield t);else{let n=-1;for(let r of e)(r=t(r,++n,e))!=null&&(r=+r)>=r&&(yield r)}}var yE=hE(pE),bE=yE.right;yE.left,hE(_E).center;var xE=class extends Map{constructor(e,t=TE){if(super(),Object.defineProperties(this,{_intern:{value:new Map},_key:{value:t}}),e!=null)for(let[t,n]of e)this.set(t,n)}get(e){return super.get(SE(this,e))}has(e){return super.has(SE(this,e))}set(e,t){return super.set(CE(this,e),t)}delete(e){return super.delete(wE(this,e))}};function SE({_intern:e,_key:t},n){let r=t(n);return e.has(r)?e.get(r):n}function CE({_intern:e,_key:t},n){let r=t(n);return e.has(r)?e.get(r):(e.set(r,n),n)}function wE({_intern:e,_key:t},n){let r=t(n);return e.has(r)&&(n=e.get(r),e.delete(r)),n}function TE(e){return typeof e==`object`&&e?e.valueOf():e}function EE(e=pE){if(e===pE)return DE;if(typeof e!=`function`)throw TypeError(`compare is not a function`);return(t,n)=>{let r=e(t,n);return r||r===0?r:(e(n,n)===0)-(e(t,t)===0)}}function DE(e,t){return(e==null||!(e>=e))-(t==null||!(t>=t))||(e<t?-1:+(e>t))}var OE=Math.sqrt(50),kE=Math.sqrt(10),AE=Math.sqrt(2);function jE(e,t,n){let r=(t-e)/Math.max(0,n),i=Math.floor(Math.log10(r)),a=r/10**i,o=a>=OE?10:a>=kE?5:a>=AE?2:1,s,c,l;return i<0?(l=10**-i/o,s=Math.round(e*l),c=Math.round(t*l),s/l<e&&++s,c/l>t&&--c,l=-l):(l=10**i*o,s=Math.round(e/l),c=Math.round(t/l),s*l<e&&++s,c*l>t&&--c),c<s&&.5<=n&&n<2?jE(e,t,n*2):[s,c,l]}function ME(e,t,n){if(t=+t,e=+e,n=+n,!(n>0))return[];if(e===t)return[e];let r=t<e,[i,a,o]=r?jE(t,e,n):jE(e,t,n);if(!(a>=i))return[];let s=a-i+1,c=Array(s);if(r){if(o<0)for(let e=0;e<s;++e)c[e]=(a-e)/-o;else for(let e=0;e<s;++e)c[e]=(a-e)*o}else if(o<0)for(let e=0;e<s;++e)c[e]=(i+e)/-o;else for(let e=0;e<s;++e)c[e]=(i+e)*o;return c}function NE(e,t,n){return t=+t,e=+e,n=+n,jE(e,t,n)[2]}function PE(e,t,n){t=+t,e=+e,n=+n;let r=t<e,i=r?NE(t,e,n):NE(e,t,n);return(r?-1:1)*(i<0?1/-i:i)}function FE(e,t){let n;if(t===void 0)for(let t of e)t!=null&&(n<t||n===void 0&&t>=t)&&(n=t);else{let r=-1;for(let i of e)(i=t(i,++r,e))!=null&&(n<i||n===void 0&&i>=i)&&(n=i)}return n}function IE(e,t){let n;if(t===void 0)for(let t of e)t!=null&&(n>t||n===void 0&&t>=t)&&(n=t);else{let r=-1;for(let i of e)(i=t(i,++r,e))!=null&&(n>i||n===void 0&&i>=i)&&(n=i)}return n}function LE(e,t,n=0,r=1/0,i){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(i=i===void 0?DE:EE(i);r>n;){if(r-n>600){let a=r-n+1,o=t-n+1,s=Math.log(a),c=.5*Math.exp(2*s/3),l=.5*Math.sqrt(s*c*(a-c)/a)*(o-a/2<0?-1:1),u=Math.max(n,Math.floor(t-o*c/a+l)),d=Math.min(r,Math.floor(t+(a-o)*c/a+l));LE(e,t,u,d,i)}let a=e[t],o=n,s=r;for(RE(e,n,t),i(e[r],a)>0&&RE(e,n,r);o<s;){for(RE(e,o,s),++o,--s;i(e[o],a)<0;)++o;for(;i(e[s],a)>0;)--s}i(e[n],a)===0?RE(e,n,s):(++s,RE(e,s,r)),s<=t&&(n=s+1),t<=s&&(r=s-1)}return e}function RE(e,t,n){let r=e[t];e[t]=e[n],e[n]=r}function zE(e,t,n){if(e=Float64Array.from(vE(e,n)),(r=e.length)&&!isNaN(t=+t)){if(t<=0||r<2)return IE(e);if(t>=1)return FE(e);var r,i=(r-1)*t,a=Math.floor(i),o=FE(LE(e,a).subarray(0,a+1));return o+(IE(e.subarray(a+1))-o)*(i-a)}}function BE(e,t,n=_E){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,i=(r-1)*t,a=Math.floor(i),o=+n(e[a],a,e);return o+(+n(e[a+1],a+1,e)-o)*(i-a)}}function VE(e,t,n){e=+e,t=+t,n=(i=arguments.length)<2?(t=e,e=0,1):i<3?1:+n;for(var r=-1,i=Math.max(0,Math.ceil((t-e)/n))|0,a=Array(i);++r<i;)a[r]=e+r*n;return a}function HE(e,t){switch(arguments.length){case 0:break;case 1:this.range(e);break;default:this.range(t).domain(e)}return this}function UE(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)}return this}var WE=Symbol(`implicit`);function GE(){var e=new xE,t=[],n=[],r=WE;function i(i){let a=e.get(i);if(a===void 0){if(r!==WE)return r;e.set(i,a=t.push(i)-1)}return n[a%n.length]}return i.domain=function(n){if(!arguments.length)return t.slice();t=[],e=new xE;for(let r of n)e.has(r)||e.set(r,t.push(r)-1);return i},i.range=function(e){return arguments.length?(n=Array.from(e),i):n.slice()},i.unknown=function(e){return arguments.length?(r=e,i):r},i.copy=function(){return GE(t,n).unknown(r)},HE.apply(i,arguments),i}function KE(){var e=GE().unknown(void 0),t=e.domain,n=e.range,r=0,i=1,a,o,s=!1,c=0,l=0,u=.5;delete e.unknown;function d(){var e=t().length,d=i<r,f=d?i:r,p=d?r:i;a=(p-f)/Math.max(1,e-c+l*2),s&&(a=Math.floor(a)),f+=(p-f-a*(e-c))*u,o=a*(1-c),s&&(f=Math.round(f),o=Math.round(o));var m=VE(e).map(function(e){return f+a*e});return n(d?m.reverse():m)}return e.domain=function(e){return arguments.length?(t(e),d()):t()},e.range=function(e){return arguments.length?([r,i]=e,r=+r,i=+i,d()):[r,i]},e.rangeRound=function(e){return[r,i]=e,r=+r,i=+i,s=!0,d()},e.bandwidth=function(){return o},e.step=function(){return a},e.round=function(e){return arguments.length?(s=!!e,d()):s},e.padding=function(e){return arguments.length?(c=Math.min(1,l=+e),d()):c},e.paddingInner=function(e){return arguments.length?(c=Math.min(1,e),d()):c},e.paddingOuter=function(e){return arguments.length?(l=+e,d()):l},e.align=function(e){return arguments.length?(u=Math.max(0,Math.min(1,e)),d()):u},e.copy=function(){return KE(t(),[r,i]).round(s).paddingInner(c).paddingOuter(l).align(u)},HE.apply(d(),arguments)}function qE(e){var t=e.copy;return e.padding=e.paddingOuter,delete e.paddingInner,delete e.paddingOuter,e.copy=function(){return qE(t())},e}function JE(){return qE(KE.apply(null,arguments).paddingInner(1))}function YE(e,t,n){e.prototype=t.prototype=n,n.constructor=e}function XE(e,t){var n=Object.create(e.prototype);for(var r in t)n[r]=t[r];return n}function ZE(){}var QE=.7,$E=1/QE,eD=`\\s*([+-]?\\d+)\\s*`,tD=`\\s*([+-]?(?:\\d*\\.)?\\d+(?:[eE][+-]?\\d+)?)\\s*`,nD=`\\s*([+-]?(?:\\d*\\.)?\\d+(?:[eE][+-]?\\d+)?)%\\s*`,rD=/^#([0-9a-f]{3,8})$/,iD=RegExp(`^rgb\\(${eD},${eD},${eD}\\)$`),aD=RegExp(`^rgb\\(${nD},${nD},${nD}\\)$`),oD=RegExp(`^rgba\\(${eD},${eD},${eD},${tD}\\)$`),sD=RegExp(`^rgba\\(${nD},${nD},${nD},${tD}\\)$`),cD=RegExp(`^hsl\\(${tD},${nD},${nD}\\)$`),lD=RegExp(`^hsla\\(${tD},${nD},${nD},${tD}\\)$`),uD={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};YE(ZE,hD,{copy(e){return Object.assign(new this.constructor,this,e)},displayable(){return this.rgb().displayable()},hex:dD,formatHex:dD,formatHex8:fD,formatHsl:pD,formatRgb:mD,toString:mD});function dD(){return this.rgb().formatHex()}function fD(){return this.rgb().formatHex8()}function pD(){return OD(this).formatHsl()}function mD(){return this.rgb().formatRgb()}function hD(e){var t,n;return e=(e+``).trim().toLowerCase(),(t=rD.exec(e))?(n=t[1].length,t=parseInt(t[1],16),n===6?gD(t):n===3?new bD(t>>8&15|t>>4&240,t>>4&15|t&240,(t&15)<<4|t&15,1):n===8?_D(t>>24&255,t>>16&255,t>>8&255,(t&255)/255):n===4?_D(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=iD.exec(e))?new bD(t[1],t[2],t[3],1):(t=aD.exec(e))?new bD(t[1]*255/100,t[2]*255/100,t[3]*255/100,1):(t=oD.exec(e))?_D(t[1],t[2],t[3],t[4]):(t=sD.exec(e))?_D(t[1]*255/100,t[2]*255/100,t[3]*255/100,t[4]):(t=cD.exec(e))?DD(t[1],t[2]/100,t[3]/100,1):(t=lD.exec(e))?DD(t[1],t[2]/100,t[3]/100,t[4]):uD.hasOwnProperty(e)?gD(uD[e]):e===`transparent`?new bD(NaN,NaN,NaN,0):null}function gD(e){return new bD(e>>16&255,e>>8&255,e&255,1)}function _D(e,t,n,r){return r<=0&&(e=t=n=NaN),new bD(e,t,n,r)}function vD(e){return e instanceof ZE||(e=hD(e)),e?(e=e.rgb(),new bD(e.r,e.g,e.b,e.opacity)):new bD}function yD(e,t,n,r){return arguments.length===1?vD(e):new bD(e,t,n,r??1)}function bD(e,t,n,r){this.r=+e,this.g=+t,this.b=+n,this.opacity=+r}YE(bD,yD,XE(ZE,{brighter(e){return e=e==null?$E:$E**+e,new bD(this.r*e,this.g*e,this.b*e,this.opacity)},darker(e){return e=e==null?QE:QE**+e,new bD(this.r*e,this.g*e,this.b*e,this.opacity)},rgb(){return this},clamp(){return new bD(TD(this.r),TD(this.g),TD(this.b),wD(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:xD,formatHex:xD,formatHex8:SD,formatRgb:CD,toString:CD}));function xD(){return`#${ED(this.r)}${ED(this.g)}${ED(this.b)}`}function SD(){return`#${ED(this.r)}${ED(this.g)}${ED(this.b)}${ED((isNaN(this.opacity)?1:this.opacity)*255)}`}function CD(){let e=wD(this.opacity);return`${e===1?`rgb(`:`rgba(`}${TD(this.r)}, ${TD(this.g)}, ${TD(this.b)}${e===1?`)`:`, ${e})`}`}function wD(e){return isNaN(e)?1:Math.max(0,Math.min(1,e))}function TD(e){return Math.max(0,Math.min(255,Math.round(e)||0))}function ED(e){return e=TD(e),(e<16?`0`:``)+e.toString(16)}function DD(e,t,n,r){return r<=0?e=t=n=NaN:n<=0||n>=1?e=t=NaN:t<=0&&(e=NaN),new AD(e,t,n,r)}function OD(e){if(e instanceof AD)return new AD(e.h,e.s,e.l,e.opacity);if(e instanceof ZE||(e=hD(e)),!e)return new AD;if(e instanceof AD)return e;e=e.rgb();var t=e.r/255,n=e.g/255,r=e.b/255,i=Math.min(t,n,r),a=Math.max(t,n,r),o=NaN,s=a-i,c=(a+i)/2;return s?(o=t===a?(n-r)/s+(n<r)*6:n===a?(r-t)/s+2:(t-n)/s+4,s/=c<.5?a+i:2-a-i,o*=60):s=c>0&&c<1?0:o,new AD(o,s,c,e.opacity)}function kD(e,t,n,r){return arguments.length===1?OD(e):new AD(e,t,n,r??1)}function AD(e,t,n,r){this.h=+e,this.s=+t,this.l=+n,this.opacity=+r}YE(AD,kD,XE(ZE,{brighter(e){return e=e==null?$E:$E**+e,new AD(this.h,this.s,this.l*e,this.opacity)},darker(e){return e=e==null?QE:QE**+e,new AD(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,i=2*n-r;return new bD(ND(e>=240?e-240:e+120,i,r),ND(e,i,r),ND(e<120?e+240:e-120,i,r),this.opacity)},clamp(){return new AD(jD(this.h),MD(this.s),MD(this.l),wD(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(){let e=wD(this.opacity);return`${e===1?`hsl(`:`hsla(`}${jD(this.h)}, ${MD(this.s)*100}%, ${MD(this.l)*100}%${e===1?`)`:`, ${e})`}`}}));function jD(e){return e=(e||0)%360,e<0?e+360:e}function MD(e){return Math.max(0,Math.min(1,e||0))}function ND(e,t,n){return(e<60?t+(n-t)*e/60:e<180?n:e<240?t+(n-t)*(240-e)/60:t)*255}var PD=e=>()=>e;function FD(e,t){return function(n){return e+n*t}}function ID(e,t,n){return e**=+n,t=t**+n-e,n=1/n,function(r){return(e+r*t)**+n}}function LD(e){return(e=+e)==1?RD:function(t,n){return n-t?ID(t,n,e):PD(isNaN(t)?n:t)}}function RD(e,t){var n=t-e;return n?FD(e,n):PD(isNaN(e)?t:e)}var zD=(function e(t){var n=LD(t);function r(e,t){var r=n((e=yD(e)).r,(t=yD(t)).r),i=n(e.g,t.g),a=n(e.b,t.b),o=RD(e.opacity,t.opacity);return function(t){return e.r=r(t),e.g=i(t),e.b=a(t),e.opacity=o(t),e+``}}return r.gamma=e,r})(1);function BD(e,t){t||=[];var n=e?Math.min(t.length,e.length):0,r=t.slice(),i;return function(a){for(i=0;i<n;++i)r[i]=e[i]*(1-a)+t[i]*a;return r}}function VD(e){return ArrayBuffer.isView(e)&&!(e instanceof DataView)}function HD(e,t){for(var n=t?t.length:0,r=e?Math.min(n,e.length):0,i=Array(r),a=Array(n),o=0;o<r;++o)i[o]=ZD(e[o],t[o]);for(;o<n;++o)a[o]=t[o];return function(e){for(o=0;o<r;++o)a[o]=i[o](e);return a}}function UD(e,t){var n=new Date;return e=+e,t=+t,function(r){return n.setTime(e*(1-r)+t*r),n}}function WD(e,t){return e=+e,t=+t,function(n){return e*(1-n)+t*n}}function GD(e,t){var n={},r={},i;for(i in(typeof e!=`object`||!e)&&(e={}),(typeof t!=`object`||!t)&&(t={}),t)i in e?n[i]=ZD(e[i],t[i]):r[i]=t[i];return function(e){for(i in n)r[i]=n[i](e);return r}}var KD=/[-+]?(?:\d+\.?\d*|\.?\d+)(?:[eE][-+]?\d+)?/g,qD=new RegExp(KD.source,`g`);function JD(e){return function(){return e}}function YD(e){return function(t){return e(t)+``}}function XD(e,t){var n=KD.lastIndex=qD.lastIndex=0,r,i,a,o=-1,s=[],c=[];for(e+=``,t+=``;(r=KD.exec(e))&&(i=qD.exec(t));)(a=i.index)>n&&(a=t.slice(n,a),s[o]?s[o]+=a:s[++o]=a),(r=r[0])===(i=i[0])?s[o]?s[o]+=i:s[++o]=i:(s[++o]=null,c.push({i:o,x:WD(r,i)})),n=qD.lastIndex;return n<t.length&&(a=t.slice(n),s[o]?s[o]+=a:s[++o]=a),s.length<2?c[0]?YD(c[0].x):JD(t):(t=c.length,function(e){for(var n=0,r;n<t;++n)s[(r=c[n]).i]=r.x(e);return s.join(``)})}function ZD(e,t){var n=typeof t,r;return t==null||n===`boolean`?PD(t):(n===`number`?WD:n===`string`?(r=hD(t))?(t=r,zD):XD:t instanceof hD?zD:t instanceof Date?UD:VD(t)?BD:Array.isArray(t)?HD:typeof t.valueOf!=`function`&&typeof t.toString!=`function`||isNaN(t)?GD:WD)(e,t)}function QD(e,t){return e=+e,t=+t,function(n){return Math.round(e*(1-n)+t*n)}}function $D(e,t){t===void 0&&(t=e,e=ZD);for(var n=0,r=t.length-1,i=t[0],a=Array(r<0?0:r);n<r;)a[n]=e(i,i=t[++n]);return function(e){var t=Math.max(0,Math.min(r-1,Math.floor(e*=r)));return a[t](e-t)}}function eO(e){return function(){return e}}function tO(e){return+e}var nO=[0,1];function rO(e){return e}function iO(e,t){return(t-=e=+e)?function(n){return(n-e)/t}:eO(isNaN(t)?NaN:.5)}function aO(e,t){var n;return e>t&&(n=e,e=t,t=n),function(n){return Math.max(e,Math.min(t,n))}}function oO(e,t,n){var r=e[0],i=e[1],a=t[0],o=t[1];return i<r?(r=iO(i,r),a=n(o,a)):(r=iO(r,i),a=n(a,o)),function(e){return a(r(e))}}function sO(e,t,n){var r=Math.min(e.length,t.length)-1,i=Array(r),a=Array(r),o=-1;for(e[r]<e[0]&&(e=e.slice().reverse(),t=t.slice().reverse());++o<r;)i[o]=iO(e[o],e[o+1]),a[o]=n(t[o],t[o+1]);return function(t){var n=bE(e,t,1,r)-1;return a[n](i[n](t))}}function cO(e,t){return t.domain(e.domain()).range(e.range()).interpolate(e.interpolate()).clamp(e.clamp()).unknown(e.unknown())}function lO(){var e=nO,t=nO,n=ZD,r,i,a,o=rO,s,c,l;function u(){var n=Math.min(e.length,t.length);return o!==rO&&(o=aO(e[0],e[n-1])),s=n>2?sO:oO,c=l=null,d}function d(i){return i==null||isNaN(i=+i)?a:(c||=s(e.map(r),t,n))(r(o(i)))}return d.invert=function(n){return o(i((l||=s(t,e.map(r),WD))(n)))},d.domain=function(t){return arguments.length?(e=Array.from(t,tO),u()):e.slice()},d.range=function(e){return arguments.length?(t=Array.from(e),u()):t.slice()},d.rangeRound=function(e){return t=Array.from(e),n=QD,u()},d.clamp=function(e){return arguments.length?(o=e?!0:rO,u()):o!==rO},d.interpolate=function(e){return arguments.length?(n=e,u()):n},d.unknown=function(e){return arguments.length?(a=e,d):a},function(e,t){return r=e,i=t,u()}}function uO(){return lO()(rO,rO)}function dO(e){return Math.abs(e=Math.round(e))>=1e21?e.toLocaleString(`en`).replace(/,/g,``):e.toString(10)}function fO(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 pO(e){return e=fO(Math.abs(e)),e?e[1]:NaN}function mO(e,t){return function(n,r){for(var i=n.length,a=[],o=0,s=e[0],c=0;i>0&&s>0&&(c+s+1>r&&(s=Math.max(1,r-c)),a.push(n.substring(i-=s,i+s)),!((c+=s+1)>r));)s=e[o=(o+1)%e.length];return a.reverse().join(t)}}function hO(e){return function(t){return t.replace(/[0-9]/g,function(t){return e[+t]})}}var gO=/^(?:(.)?([<>=^]))?([+\-( ])?([$#])?(0)?(\d+)?(,)?(\.\d+)?(~)?([a-z%])?$/i;function _O(e){if(!(t=gO.exec(e)))throw Error(`invalid format: `+e);var t;return new vO({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]})}_O.prototype=vO.prototype;function vO(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+``}vO.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 yO(e){out:for(var t=e.length,n=1,r=-1,i;n<t;++n)switch(e[n]){case`.`:r=i=n;break;case`0`:r===0&&(r=n),i=n;break;default:if(!+e[n])break out;r>0&&(r=0)}return r>0?e.slice(0,r)+e.slice(i+1):e}var bO;function xO(e,t){var n=fO(e,t);if(!n)return bO=void 0,e.toPrecision(t);var r=n[0],i=n[1],a=i-(bO=Math.max(-8,Math.min(8,Math.floor(i/3)))*3)+1,o=r.length;return a===o?r:a>o?r+Array(a-o+1).join(`0`):a>0?r.slice(0,a)+`.`+r.slice(a):`0.`+Array(1-a).join(`0`)+fO(e,Math.max(0,t+a-1))[0]}function SO(e,t){var n=fO(e,t);if(!n)return e+``;var r=n[0],i=n[1];return i<0?`0.`+Array(-i).join(`0`)+r:r.length>i+1?r.slice(0,i+1)+`.`+r.slice(i+1):r+Array(i-r.length+2).join(`0`)}var CO={"%":(e,t)=>(e*100).toFixed(t),b:e=>Math.round(e).toString(2),c:e=>e+``,d:dO,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)=>SO(e*100,t),r:SO,s:xO,X:e=>Math.round(e).toString(16).toUpperCase(),x:e=>Math.round(e).toString(16)};function wO(e){return e}var TO=Array.prototype.map,EO=[`y`,`z`,`a`,`f`,`p`,`n`,`µ`,`m`,``,`k`,`M`,`G`,`T`,`P`,`E`,`Z`,`Y`];function DO(e){var t=e.grouping===void 0||e.thousands===void 0?wO:mO(TO.call(e.grouping,Number),e.thousands+``),n=e.currency===void 0?``:e.currency[0]+``,r=e.currency===void 0?``:e.currency[1]+``,i=e.decimal===void 0?`.`:e.decimal+``,a=e.numerals===void 0?wO:hO(TO.call(e.numerals,String)),o=e.percent===void 0?`%`:e.percent+``,s=e.minus===void 0?`−`:e.minus+``,c=e.nan===void 0?`NaN`:e.nan+``;function l(e,l){e=_O(e);var u=e.fill,d=e.align,f=e.sign,p=e.symbol,m=e.zero,h=e.width,g=e.comma,_=e.precision,v=e.trim,y=e.type;y===`n`?(g=!0,y=`g`):CO[y]||(_===void 0&&(_=12),v=!0,y=`g`),(m||u===`0`&&d===`=`)&&(m=!0,u=`0`,d=`=`);var b=(l&&l.prefix!==void 0?l.prefix:``)+(p===`$`?n:p===`#`&&/[boxX]/.test(y)?`0`+y.toLowerCase():``),x=(p===`$`?r:/[%p]/.test(y)?o:``)+(l&&l.suffix!==void 0?l.suffix:``),S=CO[y],C=/[defgprs%]/.test(y);_=_===void 0?6:/[gprs]/.test(y)?Math.max(1,Math.min(21,_)):Math.max(0,Math.min(20,_));function w(e){var n=b,r=x,o,l,p;if(y===`c`)r=S(e)+r,e=``;else{e=+e;var w=e<0||1/e<0;if(e=isNaN(e)?c:S(Math.abs(e),_),v&&(e=yO(e)),w&&+e==0&&f!==`+`&&(w=!1),n=(w?f===`(`?f:s:f===`-`||f===`(`?``:f)+n,r=(y===`s`&&!isNaN(e)&&bO!==void 0?EO[8+bO/3]:``)+r+(w&&f===`(`?`)`:``),C){for(o=-1,l=e.length;++o<l;)if(p=e.charCodeAt(o),48>p||p>57){r=(p===46?i+e.slice(o+1):e.slice(o))+r,e=e.slice(0,o);break}}}g&&!m&&(e=t(e,1/0));var T=n.length+e.length+r.length,E=T<h?Array(h-T+1).join(u):``;switch(g&&m&&(e=t(E+e,E.length?h-r.length:1/0),E=``),d){case`<`:e=n+e+r+E;break;case`=`:e=n+E+e+r;break;case`^`:e=E.slice(0,T=E.length>>1)+n+e+r+E.slice(T);break;default:e=E+n+e+r}return a(e)}return w.toString=function(){return e+``},w}function u(e,t){var n=Math.max(-8,Math.min(8,Math.floor(pO(t)/3)))*3,r=10**-n,i=l((e=_O(e),e.type=`f`,e),{suffix:EO[8+n/3]});return function(e){return i(r*e)}}return{format:l,formatPrefix:u}}var OO,kO,AO;jO({thousands:`,`,grouping:[3],currency:[`$`,``]});function jO(e){return OO=DO(e),kO=OO.format,AO=OO.formatPrefix,OO}function MO(e){return Math.max(0,-pO(Math.abs(e)))}function NO(e,t){return Math.max(0,Math.max(-8,Math.min(8,Math.floor(pO(t)/3)))*3-pO(Math.abs(e)))}function PO(e,t){return e=Math.abs(e),t=Math.abs(t)-e,Math.max(0,pO(t)-pO(e))+1}function FO(e,t,n,r){var i=PE(e,t,n),a;switch(r=_O(r??`,f`),r.type){case`s`:var o=Math.max(Math.abs(e),Math.abs(t));return r.precision==null&&!isNaN(a=NO(i,o))&&(r.precision=a),AO(r,o);case``:case`e`:case`g`:case`p`:case`r`:r.precision==null&&!isNaN(a=PO(i,Math.max(Math.abs(e),Math.abs(t))))&&(r.precision=a-(r.type===`e`));break;case`f`:case`%`:r.precision==null&&!isNaN(a=MO(i))&&(r.precision=a-(r.type===`%`)*2)}return kO(r)}function IO(e){var t=e.domain;return e.ticks=function(e){var n=t();return ME(n[0],n[n.length-1],e??10)},e.tickFormat=function(e,n){var r=t();return FO(r[0],r[r.length-1],e??10,n)},e.nice=function(n){n??=10;var r=t(),i=0,a=r.length-1,o=r[i],s=r[a],c,l,u=10;for(s<o&&(l=o,o=s,s=l,l=i,i=a,a=l);u-->0;){if(l=NE(o,s,n),l===c)return r[i]=o,r[a]=s,t(r);if(l>0)o=Math.floor(o/l)*l,s=Math.ceil(s/l)*l;else if(l<0)o=Math.ceil(o*l)/l,s=Math.floor(s*l)/l;else break;c=l}return e},e}function LO(){var e=uO();return e.copy=function(){return cO(e,LO())},HE.apply(e,arguments),IO(e)}function RO(e){var t;function n(e){return e==null||isNaN(e=+e)?t:e}return n.invert=n,n.domain=n.range=function(t){return arguments.length?(e=Array.from(t,tO),n):e.slice()},n.unknown=function(e){return arguments.length?(t=e,n):t},n.copy=function(){return RO(e).unknown(t)},e=arguments.length?Array.from(e,tO):[0,1],IO(n)}function zO(e,t){e=e.slice();var n=0,r=e.length-1,i=e[n],a=e[r],o;return a<i&&(o=n,n=r,r=o,o=i,i=a,a=o),e[n]=t.floor(i),e[r]=t.ceil(a),e}function BO(e){return Math.log(e)}function VO(e){return Math.exp(e)}function HO(e){return-Math.log(-e)}function UO(e){return-Math.exp(-e)}function WO(e){return isFinite(e)?+(`1e`+e):e<0?0:e}function GO(e){return e===10?WO:e===Math.E?Math.exp:t=>e**+t}function KO(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 qO(e){return(t,n)=>-e(-t,n)}function JO(e){let t=e(BO,VO),n=t.domain,r=10,i,a;function o(){return i=KO(r),a=GO(r),n()[0]<0?(i=qO(i),a=qO(a),e(HO,UO)):e(BO,VO),t}return t.base=function(e){return arguments.length?(r=+e,o()):r},t.domain=function(e){return arguments.length?(n(e),o()):n()},t.ticks=e=>{let t=n(),o=t[0],s=t[t.length-1],c=s<o;c&&([o,s]=[s,o]);let l=i(o),u=i(s),d,f,p=e==null?10:+e,m=[];if(!(r%1)&&u-l<p){if(l=Math.floor(l),u=Math.ceil(u),o>0){for(;l<=u;++l)for(d=1;d<r;++d)if(f=l<0?d/a(-l):d*a(l),!(f<o)){if(f>s)break;m.push(f)}}else for(;l<=u;++l)for(d=r-1;d>=1;--d)if(f=l>0?d/a(-l):d*a(l),!(f<o)){if(f>s)break;m.push(f)}m.length*2<p&&(m=ME(o,s,p))}else m=ME(l,u,Math.min(u-l,p)).map(a);return c?m.reverse():m},t.tickFormat=(e,n)=>{if(e??=10,n??=r===10?`s`:`,`,typeof n!=`function`&&(!(r%1)&&(n=_O(n)).precision==null&&(n.trim=!0),n=kO(n)),e===1/0)return n;let o=Math.max(1,r*e/t.ticks().length);return e=>{let t=e/a(Math.round(i(e)));return t*r<r-.5&&(t*=r),t<=o?n(e):``}},t.nice=()=>n(zO(n(),{floor:e=>a(Math.floor(i(e))),ceil:e=>a(Math.ceil(i(e)))})),t}function YO(){let e=JO(lO()).domain([1,10]);return e.copy=()=>cO(e,YO()).base(e.base()),HE.apply(e,arguments),e}function XO(e){return function(t){return Math.sign(t)*Math.log1p(Math.abs(t/e))}}function ZO(e){return function(t){return Math.sign(t)*Math.expm1(Math.abs(t))*e}}function QO(e){var t=1,n=e(XO(t),ZO(t));return n.constant=function(n){return arguments.length?e(XO(t=+n),ZO(t)):t},IO(n)}function $O(){var e=QO(lO());return e.copy=function(){return cO(e,$O()).constant(e.constant())},HE.apply(e,arguments)}function ek(e){return function(t){return t<0?-((-t)**+e):t**+e}}function tk(e){return e<0?-Math.sqrt(-e):Math.sqrt(e)}function nk(e){return e<0?-e*e:e*e}function rk(e){var t=e(rO,rO),n=1;function r(){return n===1?e(rO,rO):n===.5?e(tk,nk):e(ek(n),ek(1/n))}return t.exponent=function(e){return arguments.length?(n=+e,r()):n},IO(t)}function ik(){var e=rk(lO());return e.copy=function(){return cO(e,ik()).exponent(e.exponent())},HE.apply(e,arguments),e}function ak(){return ik.apply(null,arguments).exponent(.5)}function ok(e){return Math.sign(e)*e*e}function sk(e){return Math.sign(e)*Math.sqrt(Math.abs(e))}function ck(){var e=uO(),t=[0,1],n=!1,r;function i(t){var i=sk(e(t));return isNaN(i)?r:n?Math.round(i):i}return i.invert=function(t){return e.invert(ok(t))},i.domain=function(t){return arguments.length?(e.domain(t),i):e.domain()},i.range=function(n){return arguments.length?(e.range((t=Array.from(n,tO)).map(ok)),i):t.slice()},i.rangeRound=function(e){return i.range(e).round(!0)},i.round=function(e){return arguments.length?(n=!!e,i):n},i.clamp=function(t){return arguments.length?(e.clamp(t),i):e.clamp()},i.unknown=function(e){return arguments.length?(r=e,i):r},i.copy=function(){return ck(e.domain(),t).round(n).clamp(e.clamp()).unknown(r)},HE.apply(i,arguments),IO(i)}function lk(){var e=[],t=[],n=[],r;function i(){var r=0,i=Math.max(1,t.length);for(n=Array(i-1);++r<i;)n[r-1]=BE(e,r/i);return a}function a(e){return e==null||isNaN(e=+e)?r:t[bE(n,e)]}return a.invertExtent=function(r){var i=t.indexOf(r);return i<0?[NaN,NaN]:[i>0?n[i-1]:e[0],i<n.length?n[i]:e[e.length-1]]},a.domain=function(t){if(!arguments.length)return e.slice();e=[];for(let n of t)n!=null&&!isNaN(n=+n)&&e.push(n);return e.sort(pE),i()},a.range=function(e){return arguments.length?(t=Array.from(e),i()):t.slice()},a.unknown=function(e){return arguments.length?(r=e,a):r},a.quantiles=function(){return n.slice()},a.copy=function(){return lk().domain(e).range(t).unknown(r)},HE.apply(a,arguments)}function uk(){var e=0,t=1,n=1,r=[.5],i=[0,1],a;function o(e){return e!=null&&e<=e?i[bE(r,e,0,n)]:a}function s(){var i=-1;for(r=Array(n);++i<n;)r[i]=((i+1)*t-(i-n)*e)/(n+1);return o}return o.domain=function(n){return arguments.length?([e,t]=n,e=+e,t=+t,s()):[e,t]},o.range=function(e){return arguments.length?(n=(i=Array.from(e)).length-1,s()):i.slice()},o.invertExtent=function(a){var o=i.indexOf(a);return o<0?[NaN,NaN]:o<1?[e,r[0]]:o>=n?[r[n-1],t]:[r[o-1],r[o]]},o.unknown=function(e){return arguments.length&&(a=e),o},o.thresholds=function(){return r.slice()},o.copy=function(){return uk().domain([e,t]).range(i).unknown(a)},HE.apply(IO(o),arguments)}function dk(){var e=[.5],t=[0,1],n,r=1;function i(i){return i!=null&&i<=i?t[bE(e,i,0,r)]:n}return i.domain=function(n){return arguments.length?(e=Array.from(n),r=Math.min(e.length,t.length-1),i):e.slice()},i.range=function(n){return arguments.length?(t=Array.from(n),r=Math.min(e.length,t.length-1),i):t.slice()},i.invertExtent=function(n){var r=t.indexOf(n);return[e[r-1],e[r]]},i.unknown=function(e){return arguments.length?(n=e,i):n},i.copy=function(){return dk().domain(e).range(t).unknown(n)},HE.apply(i,arguments)}var fk=new Date,pk=new Date;function mk(e,t,n,r){function i(t){return e(t=arguments.length===0?new Date:new Date(+t)),t}return i.floor=t=>(e(t=new Date(+t)),t),i.ceil=n=>(e(n=new Date(n-1)),t(n,1),e(n),n),i.round=e=>{let t=i(e),n=i.ceil(e);return e-t<n-e?t:n},i.offset=(e,n)=>(t(e=new Date(+e),n==null?1:Math.floor(n)),e),i.range=(n,r,a)=>{let o=[];if(n=i.ceil(n),a=a==null?1:Math.floor(a),!(n<r)||!(a>0))return o;let s;do o.push(s=new Date(+n)),t(n,a),e(n);while(s<n&&n<r);return o},i.filter=n=>mk(t=>{if(t>=t)for(;e(t),!n(t);)t.setTime(t-1)},(e,r)=>{if(e>=e){if(r<0)for(;++r<=0;)for(;t(e,-1),!n(e););else for(;--r>=0;)for(;t(e,1),!n(e););}}),n&&(i.count=(t,r)=>(fk.setTime(+t),pk.setTime(+r),e(fk),e(pk),Math.floor(n(fk,pk))),i.every=e=>(e=Math.floor(e),!isFinite(e)||!(e>0)?null:e>1?i.filter(r?t=>r(t)%e===0:t=>i.count(0,t)%e===0):i)),i}var hk=mk(()=>{},(e,t)=>{e.setTime(+e+t)},(e,t)=>t-e);hk.every=e=>(e=Math.floor(e),!isFinite(e)||!(e>0)?null:e>1?mk(t=>{t.setTime(Math.floor(t/e)*e)},(t,n)=>{t.setTime(+t+n*e)},(t,n)=>(n-t)/e):hk),hk.range;var gk=1e3,_k=gk*60,vk=_k*60,yk=vk*24,bk=yk*7,xk=yk*30,Sk=yk*365,Ck=mk(e=>{e.setTime(e-e.getMilliseconds())},(e,t)=>{e.setTime(+e+t*gk)},(e,t)=>(t-e)/gk,e=>e.getUTCSeconds());Ck.range;var wk=mk(e=>{e.setTime(e-e.getMilliseconds()-e.getSeconds()*gk)},(e,t)=>{e.setTime(+e+t*_k)},(e,t)=>(t-e)/_k,e=>e.getMinutes());wk.range;var Tk=mk(e=>{e.setUTCSeconds(0,0)},(e,t)=>{e.setTime(+e+t*_k)},(e,t)=>(t-e)/_k,e=>e.getUTCMinutes());Tk.range;var Ek=mk(e=>{e.setTime(e-e.getMilliseconds()-e.getSeconds()*gk-e.getMinutes()*_k)},(e,t)=>{e.setTime(+e+t*vk)},(e,t)=>(t-e)/vk,e=>e.getHours());Ek.range;var Dk=mk(e=>{e.setUTCMinutes(0,0,0)},(e,t)=>{e.setTime(+e+t*vk)},(e,t)=>(t-e)/vk,e=>e.getUTCHours());Dk.range;var Ok=mk(e=>e.setHours(0,0,0,0),(e,t)=>e.setDate(e.getDate()+t),(e,t)=>(t-e-(t.getTimezoneOffset()-e.getTimezoneOffset())*_k)/yk,e=>e.getDate()-1);Ok.range;var kk=mk(e=>{e.setUTCHours(0,0,0,0)},(e,t)=>{e.setUTCDate(e.getUTCDate()+t)},(e,t)=>(t-e)/yk,e=>e.getUTCDate()-1);kk.range;var Ak=mk(e=>{e.setUTCHours(0,0,0,0)},(e,t)=>{e.setUTCDate(e.getUTCDate()+t)},(e,t)=>(t-e)/yk,e=>Math.floor(e/yk));Ak.range;function jk(e){return mk(t=>{t.setDate(t.getDate()-(t.getDay()+7-e)%7),t.setHours(0,0,0,0)},(e,t)=>{e.setDate(e.getDate()+t*7)},(e,t)=>(t-e-(t.getTimezoneOffset()-e.getTimezoneOffset())*_k)/bk)}var Mk=jk(0),Nk=jk(1),Pk=jk(2),Fk=jk(3),Ik=jk(4),Lk=jk(5),Rk=jk(6);Mk.range,Nk.range,Pk.range,Fk.range,Ik.range,Lk.range,Rk.range;function zk(e){return mk(t=>{t.setUTCDate(t.getUTCDate()-(t.getUTCDay()+7-e)%7),t.setUTCHours(0,0,0,0)},(e,t)=>{e.setUTCDate(e.getUTCDate()+t*7)},(e,t)=>(t-e)/bk)}var Bk=zk(0),Vk=zk(1),Hk=zk(2),Uk=zk(3),Wk=zk(4),Gk=zk(5),Kk=zk(6);Bk.range,Vk.range,Hk.range,Uk.range,Wk.range,Gk.range,Kk.range;var qk=mk(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());qk.range;var Jk=mk(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());Jk.range;var Yk=mk(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());Yk.every=e=>!isFinite(e=Math.floor(e))||!(e>0)?null:mk(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)}),Yk.range;var Xk=mk(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());Xk.every=e=>!isFinite(e=Math.floor(e))||!(e>0)?null:mk(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)}),Xk.range;function Zk(e,t,n,r,i,a){let o=[[Ck,1,gk],[Ck,5,5*gk],[Ck,15,15*gk],[Ck,30,30*gk],[a,1,_k],[a,5,5*_k],[a,15,15*_k],[a,30,30*_k],[i,1,vk],[i,3,3*vk],[i,6,6*vk],[i,12,12*vk],[r,1,yk],[r,2,2*yk],[n,1,bk],[t,1,xk],[t,3,3*xk],[e,1,Sk]];function s(e,t,n){let r=t<e;r&&([e,t]=[t,e]);let i=n&&typeof n.range==`function`?n:c(e,t,n),a=i?i.range(e,+t+1):[];return r?a.reverse():a}function c(t,n,r){let i=Math.abs(n-t)/r,a=hE(([,,e])=>e).right(o,i);if(a===o.length)return e.every(PE(t/Sk,n/Sk,r));if(a===0)return hk.every(Math.max(PE(t,n,r),1));let[s,c]=o[i/o[a-1][2]<o[a][2]/i?a-1:a];return s.every(c)}return[s,c]}var[Qk,$k]=Zk(Xk,Jk,Bk,Ak,Dk,Tk),[eA,tA]=Zk(Yk,qk,Mk,Ok,Ek,wk);function nA(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 rA(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 iA(e,t,n){return{y:e,m:t,d:n,H:0,M:0,S:0,L:0}}function aA(e){var t=e.dateTime,n=e.date,r=e.time,i=e.periods,a=e.days,o=e.shortDays,s=e.months,c=e.shortMonths,l=fA(i),u=pA(i),d=fA(a),f=pA(a),p=fA(o),m=pA(o),h=fA(s),g=pA(s),_=fA(c),v=pA(c),y={a:N,A:P,b:F,B:I,c:null,d:PA,e:PA,f:zA,g:XA,G:QA,H:FA,I:IA,j:LA,L:RA,m:BA,M:VA,p:L,q:R,Q:xj,s:Sj,S:HA,u:UA,U:WA,V:KA,w:qA,W:JA,x:null,X:null,y:YA,Y:ZA,Z:$A,"%":bj},b={a:z,A:ee,b:te,B:ne,c:null,d:ej,e:ej,f:aj,g:gj,G:vj,H:tj,I:nj,j:rj,L:ij,m:oj,M:sj,p:re,q:ie,Q:xj,s:Sj,S:cj,u:lj,U:uj,V:fj,w:pj,W:mj,x:null,X:null,y:hj,Y:_j,Z:yj,"%":bj},x={a:E,A:D,b:O,B:k,c:A,d:wA,e:wA,f:AA,g:bA,G:yA,H:EA,I:EA,j:TA,L:kA,m:CA,M:DA,p:T,q:SA,Q:MA,s:NA,S:OA,u:hA,U:gA,V:_A,w:mA,W:vA,x:j,X:M,y:bA,Y:yA,Z:xA,"%":jA};y.x=S(n,y),y.X=S(r,y),y.c=S(t,y),b.x=S(n,b),b.X=S(r,b),b.c=S(t,b);function S(e,t){return function(n){var r=[],i=-1,a=0,o=e.length,s,c,l;for(n instanceof Date||(n=new Date(+n));++i<o;)e.charCodeAt(i)===37&&(r.push(e.slice(a,i)),(c=oA[s=e.charAt(++i)])==null?c=s===`e`?` `:`0`:s=e.charAt(++i),(l=t[s])&&(s=l(n,c)),r.push(s),a=i+1);return r.push(e.slice(a,i)),r.join(``)}}function C(e,t){return function(n){var r=iA(1900,void 0,1),i=w(r,e,n+=``,0),a,o;if(i!=n.length)return null;if(`Q`in r)return new Date(r.Q);if(`s`in r)return new Date(r.s*1e3+(`L`in r?r.L:0));if(t&&!(`Z`in r)&&(r.Z=0),`p`in r&&(r.H=r.H%12+r.p*12),r.m===void 0&&(r.m=`q`in r?r.q:0),`V`in r){if(r.V<1||r.V>53)return null;`w`in r||(r.w=1),`Z`in r?(a=rA(iA(r.y,0,1)),o=a.getUTCDay(),a=o>4||o===0?Vk.ceil(a):Vk(a),a=kk.offset(a,(r.V-1)*7),r.y=a.getUTCFullYear(),r.m=a.getUTCMonth(),r.d=a.getUTCDate()+(r.w+6)%7):(a=nA(iA(r.y,0,1)),o=a.getDay(),a=o>4||o===0?Nk.ceil(a):Nk(a),a=Ok.offset(a,(r.V-1)*7),r.y=a.getFullYear(),r.m=a.getMonth(),r.d=a.getDate()+(r.w+6)%7)}else(`W`in r||`U`in r)&&(`w`in r||(r.w=`u`in r?r.u%7:+(`W`in r)),o=`Z`in r?rA(iA(r.y,0,1)).getUTCDay():nA(iA(r.y,0,1)).getDay(),r.m=0,r.d=`W`in r?(r.w+6)%7+r.W*7-(o+5)%7:r.w+r.U*7-(o+6)%7);return`Z`in r?(r.H+=r.Z/100|0,r.M+=r.Z%100,rA(r)):nA(r)}}function w(e,t,n,r){for(var i=0,a=t.length,o=n.length,s,c;i<a;){if(r>=o)return-1;if(s=t.charCodeAt(i++),s===37){if(s=t.charAt(i++),c=x[s in oA?t.charAt(i++):s],!c||(r=c(e,n,r))<0)return-1}else if(s!=n.charCodeAt(r++))return-1}return r}function T(e,t,n){var r=l.exec(t.slice(n));return r?(e.p=u.get(r[0].toLowerCase()),n+r[0].length):-1}function E(e,t,n){var r=p.exec(t.slice(n));return r?(e.w=m.get(r[0].toLowerCase()),n+r[0].length):-1}function D(e,t,n){var r=d.exec(t.slice(n));return r?(e.w=f.get(r[0].toLowerCase()),n+r[0].length):-1}function O(e,t,n){var r=_.exec(t.slice(n));return r?(e.m=v.get(r[0].toLowerCase()),n+r[0].length):-1}function k(e,t,n){var r=h.exec(t.slice(n));return r?(e.m=g.get(r[0].toLowerCase()),n+r[0].length):-1}function A(e,n,r){return w(e,t,n,r)}function j(e,t,r){return w(e,n,t,r)}function M(e,t,n){return w(e,r,t,n)}function N(e){return o[e.getDay()]}function P(e){return a[e.getDay()]}function F(e){return c[e.getMonth()]}function I(e){return s[e.getMonth()]}function L(e){return i[+(e.getHours()>=12)]}function R(e){return 1+~~(e.getMonth()/3)}function z(e){return o[e.getUTCDay()]}function ee(e){return a[e.getUTCDay()]}function te(e){return c[e.getUTCMonth()]}function ne(e){return s[e.getUTCMonth()]}function re(e){return i[+(e.getUTCHours()>=12)]}function ie(e){return 1+~~(e.getUTCMonth()/3)}return{format:function(e){var t=S(e+=``,y);return t.toString=function(){return e},t},parse:function(e){var t=C(e+=``,!1);return t.toString=function(){return e},t},utcFormat:function(e){var t=S(e+=``,b);return t.toString=function(){return e},t},utcParse:function(e){var t=C(e+=``,!0);return t.toString=function(){return e},t}}}var oA={"-":``,_:` `,0:`0`},sA=/^\s*\d+/,cA=/^%/,lA=/[\\^$*+?|[\]().{}]/g;function uA(e,t,n){var r=e<0?`-`:``,i=(r?-e:e)+``,a=i.length;return r+(a<n?Array(n-a+1).join(t)+i:i)}function dA(e){return e.replace(lA,`\\$&`)}function fA(e){return RegExp(`^(?:`+e.map(dA).join(`|`)+`)`,`i`)}function pA(e){return new Map(e.map((e,t)=>[e.toLowerCase(),t]))}function mA(e,t,n){var r=sA.exec(t.slice(n,n+1));return r?(e.w=+r[0],n+r[0].length):-1}function hA(e,t,n){var r=sA.exec(t.slice(n,n+1));return r?(e.u=+r[0],n+r[0].length):-1}function gA(e,t,n){var r=sA.exec(t.slice(n,n+2));return r?(e.U=+r[0],n+r[0].length):-1}function _A(e,t,n){var r=sA.exec(t.slice(n,n+2));return r?(e.V=+r[0],n+r[0].length):-1}function vA(e,t,n){var r=sA.exec(t.slice(n,n+2));return r?(e.W=+r[0],n+r[0].length):-1}function yA(e,t,n){var r=sA.exec(t.slice(n,n+4));return r?(e.y=+r[0],n+r[0].length):-1}function bA(e,t,n){var r=sA.exec(t.slice(n,n+2));return r?(e.y=+r[0]+(+r[0]>68?1900:2e3),n+r[0].length):-1}function xA(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 SA(e,t,n){var r=sA.exec(t.slice(n,n+1));return r?(e.q=r[0]*3-3,n+r[0].length):-1}function CA(e,t,n){var r=sA.exec(t.slice(n,n+2));return r?(e.m=r[0]-1,n+r[0].length):-1}function wA(e,t,n){var r=sA.exec(t.slice(n,n+2));return r?(e.d=+r[0],n+r[0].length):-1}function TA(e,t,n){var r=sA.exec(t.slice(n,n+3));return r?(e.m=0,e.d=+r[0],n+r[0].length):-1}function EA(e,t,n){var r=sA.exec(t.slice(n,n+2));return r?(e.H=+r[0],n+r[0].length):-1}function DA(e,t,n){var r=sA.exec(t.slice(n,n+2));return r?(e.M=+r[0],n+r[0].length):-1}function OA(e,t,n){var r=sA.exec(t.slice(n,n+2));return r?(e.S=+r[0],n+r[0].length):-1}function kA(e,t,n){var r=sA.exec(t.slice(n,n+3));return r?(e.L=+r[0],n+r[0].length):-1}function AA(e,t,n){var r=sA.exec(t.slice(n,n+6));return r?(e.L=Math.floor(r[0]/1e3),n+r[0].length):-1}function jA(e,t,n){var r=cA.exec(t.slice(n,n+1));return r?n+r[0].length:-1}function MA(e,t,n){var r=sA.exec(t.slice(n));return r?(e.Q=+r[0],n+r[0].length):-1}function NA(e,t,n){var r=sA.exec(t.slice(n));return r?(e.s=+r[0],n+r[0].length):-1}function PA(e,t){return uA(e.getDate(),t,2)}function FA(e,t){return uA(e.getHours(),t,2)}function IA(e,t){return uA(e.getHours()%12||12,t,2)}function LA(e,t){return uA(1+Ok.count(Yk(e),e),t,3)}function RA(e,t){return uA(e.getMilliseconds(),t,3)}function zA(e,t){return RA(e,t)+`000`}function BA(e,t){return uA(e.getMonth()+1,t,2)}function VA(e,t){return uA(e.getMinutes(),t,2)}function HA(e,t){return uA(e.getSeconds(),t,2)}function UA(e){var t=e.getDay();return t===0?7:t}function WA(e,t){return uA(Mk.count(Yk(e)-1,e),t,2)}function GA(e){var t=e.getDay();return t>=4||t===0?Ik(e):Ik.ceil(e)}function KA(e,t){return e=GA(e),uA(Ik.count(Yk(e),e)+(Yk(e).getDay()===4),t,2)}function qA(e){return e.getDay()}function JA(e,t){return uA(Nk.count(Yk(e)-1,e),t,2)}function YA(e,t){return uA(e.getFullYear()%100,t,2)}function XA(e,t){return e=GA(e),uA(e.getFullYear()%100,t,2)}function ZA(e,t){return uA(e.getFullYear()%1e4,t,4)}function QA(e,t){var n=e.getDay();return e=n>=4||n===0?Ik(e):Ik.ceil(e),uA(e.getFullYear()%1e4,t,4)}function $A(e){var t=e.getTimezoneOffset();return(t>0?`-`:(t*=-1,`+`))+uA(t/60|0,`0`,2)+uA(t%60,`0`,2)}function ej(e,t){return uA(e.getUTCDate(),t,2)}function tj(e,t){return uA(e.getUTCHours(),t,2)}function nj(e,t){return uA(e.getUTCHours()%12||12,t,2)}function rj(e,t){return uA(1+kk.count(Xk(e),e),t,3)}function ij(e,t){return uA(e.getUTCMilliseconds(),t,3)}function aj(e,t){return ij(e,t)+`000`}function oj(e,t){return uA(e.getUTCMonth()+1,t,2)}function sj(e,t){return uA(e.getUTCMinutes(),t,2)}function cj(e,t){return uA(e.getUTCSeconds(),t,2)}function lj(e){var t=e.getUTCDay();return t===0?7:t}function uj(e,t){return uA(Bk.count(Xk(e)-1,e),t,2)}function dj(e){var t=e.getUTCDay();return t>=4||t===0?Wk(e):Wk.ceil(e)}function fj(e,t){return e=dj(e),uA(Wk.count(Xk(e),e)+(Xk(e).getUTCDay()===4),t,2)}function pj(e){return e.getUTCDay()}function mj(e,t){return uA(Vk.count(Xk(e)-1,e),t,2)}function hj(e,t){return uA(e.getUTCFullYear()%100,t,2)}function gj(e,t){return e=dj(e),uA(e.getUTCFullYear()%100,t,2)}function _j(e,t){return uA(e.getUTCFullYear()%1e4,t,4)}function vj(e,t){var n=e.getUTCDay();return e=n>=4||n===0?Wk(e):Wk.ceil(e),uA(e.getUTCFullYear()%1e4,t,4)}function yj(){return`+0000`}function bj(){return`%`}function xj(e){return+e}function Sj(e){return Math.floor(e/1e3)}var Cj,wj,Tj;Ej({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 Ej(e){return Cj=aA(e),wj=Cj.format,Cj.parse,Tj=Cj.utcFormat,Cj.utcParse,Cj}function Dj(e){return new Date(e)}function Oj(e){return e instanceof Date?+e:+new Date(+e)}function kj(e,t,n,r,i,a,o,s,c,l){var u=uO(),d=u.invert,f=u.domain,p=l(`.%L`),m=l(`:%S`),h=l(`%I:%M`),g=l(`%I %p`),_=l(`%a %d`),v=l(`%b %d`),y=l(`%B`),b=l(`%Y`);function x(e){return(c(e)<e?p:s(e)<e?m:o(e)<e?h:a(e)<e?g:r(e)<e?i(e)<e?_:v:n(e)<e?y:b)(e)}return u.invert=function(e){return new Date(d(e))},u.domain=function(e){return arguments.length?f(Array.from(e,Oj)):f().map(Dj)},u.ticks=function(t){var n=f();return e(n[0],n[n.length-1],t??10)},u.tickFormat=function(e,t){return t==null?x:l(t)},u.nice=function(e){var n=f();return(!e||typeof e.range!=`function`)&&(e=t(n[0],n[n.length-1],e??10)),e?f(zO(n,e)):u},u.copy=function(){return cO(u,kj(e,t,n,r,i,a,o,s,c,l))},u}function Aj(){return HE.apply(kj(eA,tA,Yk,qk,Mk,Ok,Ek,wk,Ck,wj).domain([new Date(2e3,0,1),new Date(2e3,0,2)]),arguments)}function jj(){return HE.apply(kj(Qk,$k,Xk,Jk,Bk,kk,Dk,Tk,Ck,Tj).domain([Date.UTC(2e3,0,1),Date.UTC(2e3,0,2)]),arguments)}function Mj(){var e=0,t=1,n,r,i,a,o=rO,s=!1,c;function l(e){return e==null||isNaN(e=+e)?c:o(i===0?.5:(e=(a(e)-n)*i,s?Math.max(0,Math.min(1,e)):e))}l.domain=function(o){return arguments.length?([e,t]=o,n=a(e=+e),r=a(t=+t),i=n===r?0:1/(r-n),l):[e,t]},l.clamp=function(e){return arguments.length?(s=!!e,l):s},l.interpolator=function(e){return arguments.length?(o=e,l):o};function u(e){return function(t){var n,r;return arguments.length?([n,r]=t,o=e(n,r),l):[o(0),o(1)]}}return l.range=u(ZD),l.rangeRound=u(QD),l.unknown=function(e){return arguments.length?(c=e,l):c},function(o){return a=o,n=o(e),r=o(t),i=n===r?0:1/(r-n),l}}function Nj(e,t){return t.domain(e.domain()).interpolator(e.interpolator()).clamp(e.clamp()).unknown(e.unknown())}function Pj(){var e=IO(Mj()(rO));return e.copy=function(){return Nj(e,Pj())},UE.apply(e,arguments)}function Fj(){var e=JO(Mj()).domain([1,10]);return e.copy=function(){return Nj(e,Fj()).base(e.base())},UE.apply(e,arguments)}function Ij(){var e=QO(Mj());return e.copy=function(){return Nj(e,Ij()).constant(e.constant())},UE.apply(e,arguments)}function Lj(){var e=rk(Mj());return e.copy=function(){return Nj(e,Lj()).exponent(e.exponent())},UE.apply(e,arguments)}function Rj(){return Lj.apply(null,arguments).exponent(.5)}function zj(){var e=[],t=rO;function n(n){if(n!=null&&!isNaN(n=+n))return t((bE(e,n,1)-1)/(e.length-1))}return n.domain=function(t){if(!arguments.length)return e.slice();e=[];for(let n of t)n!=null&&!isNaN(n=+n)&&e.push(n);return e.sort(pE),n},n.interpolator=function(e){return arguments.length?(t=e,n):t},n.range=function(){return e.map((n,r)=>t(r/(e.length-1)))},n.quantiles=function(t){return Array.from({length:t+1},(n,r)=>zE(e,r/t))},n.copy=function(){return zj(t).domain(e)},UE.apply(n,arguments)}function Bj(){var e=0,t=.5,n=1,r=1,i,a,o,s,c,l=rO,u,d=!1,f;function p(e){return isNaN(e=+e)?f:(e=.5+((e=+u(e))-a)*(r*e<r*a?s:c),l(d?Math.max(0,Math.min(1,e)):e))}p.domain=function(l){return arguments.length?([e,t,n]=l,i=u(e=+e),a=u(t=+t),o=u(n=+n),s=i===a?0:.5/(a-i),c=a===o?0:.5/(o-a),r=a<i?-1:1,p):[e,t,n]},p.clamp=function(e){return arguments.length?(d=!!e,p):d},p.interpolator=function(e){return arguments.length?(l=e,p):l};function m(e){return function(t){var n,r,i;return arguments.length?([n,r,i]=t,l=$D(e,[n,r,i]),p):[l(0),l(.5),l(1)]}}return p.range=m(ZD),p.rangeRound=m(QD),p.unknown=function(e){return arguments.length?(f=e,p):f},function(l){return u=l,i=l(e),a=l(t),o=l(n),s=i===a?0:.5/(a-i),c=a===o?0:.5/(o-a),r=a<i?-1:1,p}}function Vj(){var e=IO(Bj()(rO));return e.copy=function(){return Nj(e,Vj())},UE.apply(e,arguments)}function Hj(){var e=JO(Bj()).domain([.1,1,10]);return e.copy=function(){return Nj(e,Hj()).base(e.base())},UE.apply(e,arguments)}function Uj(){var e=QO(Bj());return e.copy=function(){return Nj(e,Uj()).constant(e.constant())},UE.apply(e,arguments)}function Wj(){var e=rk(Bj());return e.copy=function(){return Nj(e,Wj()).exponent(e.exponent())},UE.apply(e,arguments)}function Gj(){return Wj.apply(null,arguments).exponent(.5)}var Kj=s({scaleBand:()=>KE,scaleDiverging:()=>Vj,scaleDivergingLog:()=>Hj,scaleDivergingPow:()=>Wj,scaleDivergingSqrt:()=>Gj,scaleDivergingSymlog:()=>Uj,scaleIdentity:()=>RO,scaleImplicit:()=>WE,scaleLinear:()=>LO,scaleLog:()=>YO,scaleOrdinal:()=>GE,scalePoint:()=>JE,scalePow:()=>ik,scaleQuantile:()=>lk,scaleQuantize:()=>uk,scaleRadial:()=>ck,scaleSequential:()=>Pj,scaleSequentialLog:()=>Fj,scaleSequentialPow:()=>Lj,scaleSequentialQuantile:()=>zj,scaleSequentialSqrt:()=>Rj,scaleSequentialSymlog:()=>Ij,scaleSqrt:()=>ak,scaleSymlog:()=>$O,scaleThreshold:()=>dk,scaleTime:()=>Aj,scaleUtc:()=>jj,tickFormat:()=>FO}),qj=o(((e,t)=>{var n=Rv();function r(e,t,r){for(var i=-1,a=e.length;++i<a;){var o=e[i],s=t(o);if(s!=null&&(c===void 0?s===s&&!n(s):r(s,c)))var c=s,l=o}return l}t.exports=r})),Jj=o(((e,t)=>{function n(e,t){return e>t}t.exports=n})),Yj=o(((e,t)=>{var n=qj(),r=Jj(),i=gC();function a(e){return e&&e.length?n(e,i,r):void 0}t.exports=a})),Xj=o(((e,t)=>{function n(e,t){return e<t}t.exports=n})),Zj=o(((e,t)=>{var n=qj(),r=Xj(),i=gC();function a(e){return e&&e.length?n(e,i,r):void 0}t.exports=a})),Qj=o(((e,t)=>{var n=xy(),r=_C(),i=FC(),a=Av();function o(e,t){return(a(e)?n:i)(e,r(t,3))}t.exports=o})),$j=o(((e,t)=>{var n=MC(),r=Qj();function i(e,t){return n(r(e,t),1)}t.exports=i})),eM=o(((e,t)=>{var n=pC();function r(e,t){return n(e,t)}t.exports=r})),tM=o(((e,t)=>{(function(e){var n=1e9,r={precision:20,rounding:4,toExpNeg:-7,toExpPos:21,LN10:`2.302585092994045684017991454684364207601101488628772976033327900967572609677352480235997205089598298341967784042286`},i=!0,a=`[DecimalError] `,o=a+`Invalid argument: `,s=a+`Exponent out of range: `,c=Math.floor,l=Math.pow,u=/^(\d+(\.\d*)?|\.\d+)(e[+-]?\d+)?$/i,d,f=1e7,p=7,m=9007199254740991,h=c(m/p),g={};g.absoluteValue=g.abs=function(){var e=new this.constructor(this);return e.s&&=1,e},g.comparedTo=g.cmp=function(e){var t,n,r,i,a=this;if(e=new a.constructor(e),a.s!==e.s)return a.s||-e.s;if(a.e!==e.e)return a.e>e.e^a.s<0?1:-1;for(r=a.d.length,i=e.d.length,t=0,n=r<i?r:i;t<n;++t)if(a.d[t]!==e.d[t])return a.d[t]>e.d[t]^a.s<0?1:-1;return r===i?0:r>i^a.s<0?1:-1},g.decimalPlaces=g.dp=function(){var e=this,t=e.d.length-1,n=(t-e.e)*p;if(t=e.d[t],t)for(;t%10==0;t/=10)n--;return n<0?0:n},g.dividedBy=g.div=function(e){return b(this,new this.constructor(e))},g.dividedToIntegerBy=g.idiv=function(e){var t=this,n=t.constructor;return D(b(t,new n(e),0,1),n.precision)},g.equals=g.eq=function(e){return!this.cmp(e)},g.exponent=function(){return S(this)},g.greaterThan=g.gt=function(e){return this.cmp(e)>0},g.greaterThanOrEqualTo=g.gte=function(e){return this.cmp(e)>=0},g.isInteger=g.isint=function(){return this.e>this.d.length-2},g.isNegative=g.isneg=function(){return this.s<0},g.isPositive=g.ispos=function(){return this.s>0},g.isZero=function(){return this.s===0},g.lessThan=g.lt=function(e){return this.cmp(e)<0},g.lessThanOrEqualTo=g.lte=function(e){return this.cmp(e)<1},g.logarithm=g.log=function(e){var t,n=this,r=n.constructor,o=r.precision,s=o+5;if(e===void 0)e=new r(10);else if(e=new r(e),e.s<1||e.eq(d))throw Error(a+`NaN`);if(n.s<1)throw Error(a+(n.s?`NaN`:`-Infinity`));return n.eq(d)?new r(0):(i=!1,t=b(T(n,s),T(e,s),s),i=!0,D(t,o))},g.minus=g.sub=function(e){var t=this;return e=new t.constructor(e),t.s==e.s?O(t,e):_(t,(e.s=-e.s,e))},g.modulo=g.mod=function(e){var t,n=this,r=n.constructor,o=r.precision;if(e=new r(e),!e.s)throw Error(a+`NaN`);return n.s?(i=!1,t=b(n,e,0,1).times(e),i=!0,n.minus(t)):D(new r(n),o)},g.naturalExponential=g.exp=function(){return x(this)},g.naturalLogarithm=g.ln=function(){return T(this)},g.negated=g.neg=function(){var e=new this.constructor(this);return e.s=-e.s||0,e},g.plus=g.add=function(e){var t=this;return e=new t.constructor(e),t.s==e.s?_(t,e):O(t,(e.s=-e.s,e))},g.precision=g.sd=function(e){var t,n,r,i=this;if(e!==void 0&&e!==!!e&&e!==1&&e!==0)throw Error(o+e);if(t=S(i)+1,r=i.d.length-1,n=r*p+1,r=i.d[r],r){for(;r%10==0;r/=10)n--;for(r=i.d[0];r>=10;r/=10)n++}return e&&t>n?t:n},g.squareRoot=g.sqrt=function(){var e,t,n,r,o,s,l,u=this,d=u.constructor;if(u.s<1){if(!u.s)return new d(0);throw Error(a+`NaN`)}for(e=S(u),i=!1,o=Math.sqrt(+u),o==0||o==1/0?(t=y(u.d),(t.length+e)%2==0&&(t+=`0`),o=Math.sqrt(t),e=c((e+1)/2)-(e<0||e%2),o==1/0?t=`5e`+e:(t=o.toExponential(),t=t.slice(0,t.indexOf(`e`)+1)+e),r=new d(t)):r=new d(o.toString()),n=d.precision,o=l=n+3;;)if(s=r,r=s.plus(b(u,s,l+2)).times(.5),y(s.d).slice(0,l)===(t=y(r.d)).slice(0,l)){if(t=t.slice(l-3,l+1),o==l&&t==`4999`){if(D(s,n+1,0),s.times(s).eq(u)){r=s;break}}else if(t!=`9999`)break;l+=4}return i=!0,D(r,n)},g.times=g.mul=function(e){var t,n,r,a,o,s,c,l,u,d=this,p=d.constructor,m=d.d,h=(e=new p(e)).d;if(!d.s||!e.s)return new p(0);for(e.s*=d.s,n=d.e+e.e,l=m.length,u=h.length,l<u&&(o=m,m=h,h=o,s=l,l=u,u=s),o=[],s=l+u,r=s;r--;)o.push(0);for(r=u;--r>=0;){for(t=0,a=l+r;a>r;)c=o[a]+h[r]*m[a-r-1]+t,o[a--]=c%f|0,t=c/f|0;o[a]=(o[a]+t)%f|0}for(;!o[--s];)o.pop();return t?++n:o.shift(),e.d=o,e.e=n,i?D(e,p.precision):e},g.toDecimalPlaces=g.todp=function(e,t){var r=this,i=r.constructor;return r=new i(r),e===void 0?r:(v(e,0,n),t===void 0?t=i.rounding:v(t,0,8),D(r,e+S(r)+1,t))},g.toExponential=function(e,t){var r,i=this,a=i.constructor;return e===void 0?r=k(i,!0):(v(e,0,n),t===void 0?t=a.rounding:v(t,0,8),i=D(new a(i),e+1,t),r=k(i,!0,e+1)),r},g.toFixed=function(e,t){var r,i,a=this,o=a.constructor;return e===void 0?k(a):(v(e,0,n),t===void 0?t=o.rounding:v(t,0,8),i=D(new o(a),e+S(a)+1,t),r=k(i.abs(),!1,e+S(i)+1),a.isneg()&&!a.isZero()?`-`+r:r)},g.toInteger=g.toint=function(){var e=this,t=e.constructor;return D(new t(e),S(e)+1,t.rounding)},g.toNumber=function(){return+this},g.toPower=g.pow=function(e){var t,n,r,o,s,l,u=this,f=u.constructor,h=12,g=+(e=new f(e));if(!e.s)return new f(d);if(u=new f(u),!u.s){if(e.s<1)throw Error(a+`Infinity`);return u}if(u.eq(d))return u;if(r=f.precision,e.eq(d))return D(u,r);if(t=e.e,n=e.d.length-1,l=t>=n,s=u.s,!l){if(s<0)throw Error(a+`NaN`)}else if((n=g<0?-g:g)<=m){for(o=new f(d),t=Math.ceil(r/p+4),i=!1;n%2&&(o=o.times(u),A(o.d,t)),n=c(n/2),n!==0;)u=u.times(u),A(u.d,t);return i=!0,e.s<0?new f(d).div(o):D(o,r)}return s=s<0&&e.d[Math.max(t,n)]&1?-1:1,u.s=1,i=!1,o=e.times(T(u,r+h)),i=!0,o=x(o),o.s=s,o},g.toPrecision=function(e,t){var r,i,a=this,o=a.constructor;return e===void 0?(r=S(a),i=k(a,r<=o.toExpNeg||r>=o.toExpPos)):(v(e,1,n),t===void 0?t=o.rounding:v(t,0,8),a=D(new o(a),e,t),r=S(a),i=k(a,e<=r||r<=o.toExpNeg,e)),i},g.toSignificantDigits=g.tosd=function(e,t){var r=this,i=r.constructor;return e===void 0?(e=i.precision,t=i.rounding):(v(e,1,n),t===void 0?t=i.rounding:v(t,0,8)),D(new i(r),e,t)},g.toString=g.valueOf=g.val=g.toJSON=function(){var e=this,t=S(e),n=e.constructor;return k(e,t<=n.toExpNeg||t>=n.toExpPos)};function _(e,t){var n,r,a,o,s,c,l,u,d=e.constructor,m=d.precision;if(!e.s||!t.s)return t.s||(t=new d(e)),i?D(t,m):t;if(l=e.d,u=t.d,s=e.e,a=t.e,l=l.slice(),o=s-a,o){for(o<0?(r=l,o=-o,c=u.length):(r=u,a=s,c=l.length),s=Math.ceil(m/p),c=s>c?s+1:c+1,o>c&&(o=c,r.length=1),r.reverse();o--;)r.push(0);r.reverse()}for(c=l.length,o=u.length,c-o<0&&(o=c,r=u,u=l,l=r),n=0;o;)n=(l[--o]=l[o]+u[o]+n)/f|0,l[o]%=f;for(n&&(l.unshift(n),++a),c=l.length;l[--c]==0;)l.pop();return t.d=l,t.e=a,i?D(t,m):t}function v(e,t,n){if(e!==~~e||e<t||e>n)throw Error(o+e)}function y(e){var t,n,r,i=e.length-1,a=``,o=e[0];if(i>0){for(a+=o,t=1;t<i;t++)r=e[t]+``,n=p-r.length,n&&(a+=w(n)),a+=r;o=e[t],r=o+``,n=p-r.length,n&&(a+=w(n))}else if(o===0)return`0`;for(;o%10==0;)o/=10;return a+o}var b=(function(){function e(e,t){var n,r=0,i=e.length;for(e=e.slice();i--;)n=e[i]*t+r,e[i]=n%f|0,r=n/f|0;return r&&e.unshift(r),e}function t(e,t,n,r){var i,a;if(n!=r)a=n>r?1:-1;else for(i=a=0;i<n;i++)if(e[i]!=t[i]){a=e[i]>t[i]?1:-1;break}return a}function n(e,t,n){for(var r=0;n--;)e[n]-=r,r=+(e[n]<t[n]),e[n]=r*f+e[n]-t[n];for(;!e[0]&&e.length>1;)e.shift()}return function(r,i,o,s){var c,l,u,d,m,h,g,_,v,y,b,x,C,w,T,E,O,k,A=r.constructor,j=r.s==i.s?1:-1,M=r.d,N=i.d;if(!r.s)return new A(r);if(!i.s)throw Error(a+`Division by zero`);for(l=r.e-i.e,O=N.length,T=M.length,g=new A(j),_=g.d=[],u=0;N[u]==(M[u]||0);)++u;if(N[u]>(M[u]||0)&&--l,x=o==null?o=A.precision:s?o+(S(r)-S(i))+1:o,x<0)return new A(0);if(x=x/p+2|0,u=0,O==1)for(d=0,N=N[0],x++;(u<T||d)&&x--;u++)C=d*f+(M[u]||0),_[u]=C/N|0,d=C%N|0;else{for(d=f/(N[0]+1)|0,d>1&&(N=e(N,d),M=e(M,d),O=N.length,T=M.length),w=O,v=M.slice(0,O),y=v.length;y<O;)v[y++]=0;k=N.slice(),k.unshift(0),E=N[0],N[1]>=f/2&&++E;do d=0,c=t(N,v,O,y),c<0?(b=v[0],O!=y&&(b=b*f+(v[1]||0)),d=b/E|0,d>1?(d>=f&&(d=f-1),m=e(N,d),h=m.length,y=v.length,c=t(m,v,h,y),c==1&&(d--,n(m,O<h?k:N,h))):(d==0&&(c=d=1),m=N.slice()),h=m.length,h<y&&m.unshift(0),n(v,m,y),c==-1&&(y=v.length,c=t(N,v,O,y),c<1&&(d++,n(v,O<y?k:N,y))),y=v.length):c===0&&(d++,v=[0]),_[u++]=d,c&&v[0]?v[y++]=M[w]||0:(v=[M[w]],y=1);while((w++<T||v[0]!==void 0)&&x--)}return _[0]||_.shift(),g.e=l,D(g,s?o+S(g)+1:o)}})();function x(e,t){var n,r,a,o,c,u,f=0,p=0,m=e.constructor,h=m.precision;if(S(e)>16)throw Error(s+S(e));if(!e.s)return new m(d);for(t==null?(i=!1,u=h):u=t,c=new m(.03125);e.abs().gte(.1);)e=e.times(c),p+=5;for(r=Math.log(l(2,p))/Math.LN10*2+5|0,u+=r,n=a=o=new m(d),m.precision=u;;){if(a=D(a.times(e),u),n=n.times(++f),c=o.plus(b(a,n,u)),y(c.d).slice(0,u)===y(o.d).slice(0,u)){for(;p--;)o=D(o.times(o),u);return m.precision=h,t==null?(i=!0,D(o,h)):o}o=c}}function S(e){for(var t=e.e*p,n=e.d[0];n>=10;n/=10)t++;return t}function C(e,t,n){if(t>e.LN10.sd())throw i=!0,n&&(e.precision=n),Error(a+`LN10 precision limit exceeded`);return D(new e(e.LN10),t)}function w(e){for(var t=``;e--;)t+=`0`;return t}function T(e,t){var n,r,o,s,c,l,u,f,p,m=1,h=10,g=e,_=g.d,v=g.constructor,x=v.precision;if(g.s<1)throw Error(a+(g.s?`NaN`:`-Infinity`));if(g.eq(d))return new v(0);if(t==null?(i=!1,f=x):f=t,g.eq(10))return t??(i=!0),C(v,f);if(f+=h,v.precision=f,n=y(_),r=n.charAt(0),s=S(g),Math.abs(s)<0x5543df729c000){for(;r<7&&r!=1||r==1&&n.charAt(1)>3;)g=g.times(e),n=y(g.d),r=n.charAt(0),m++;s=S(g),r>1?(g=new v(`0.`+n),s++):g=new v(r+`.`+n.slice(1))}else return u=C(v,f+2,x).times(s+``),g=T(new v(r+`.`+n.slice(1)),f-h).plus(u),v.precision=x,t==null?(i=!0,D(g,x)):g;for(l=c=g=b(g.minus(d),g.plus(d),f),p=D(g.times(g),f),o=3;;){if(c=D(c.times(p),f),u=l.plus(b(c,new v(o),f)),y(u.d).slice(0,f)===y(l.d).slice(0,f))return l=l.times(2),s!==0&&(l=l.plus(C(v,f+2,x).times(s+``))),l=b(l,new v(m),f),v.precision=x,t==null?(i=!0,D(l,x)):l;l=u,o+=2}}function E(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=c(n/p),e.d=[],r=(n+1)%p,n<0&&(r+=p),r<a){for(r&&e.d.push(+t.slice(0,r)),a-=p;r<a;)e.d.push(+t.slice(r,r+=p));t=t.slice(r),r=p-t.length}else r-=a;for(;r--;)t+=`0`;if(e.d.push(+t),i&&(e.e>h||e.e<-h))throw Error(s+n)}else e.s=0,e.e=0,e.d=[0];return e}function D(e,t,n){var r,a,o,u,d,m,g,_,v=e.d;for(u=1,o=v[0];o>=10;o/=10)u++;if(r=t-u,r<0)r+=p,a=t,g=v[_=0];else{if(_=Math.ceil((r+1)/p),o=v.length,_>=o)return e;for(g=o=v[_],u=1;o>=10;o/=10)u++;r%=p,a=r-p+u}if(n!==void 0&&(o=l(10,u-a-1),d=g/o%10|0,m=t<0||v[_+1]!==void 0||g%o,m=n<4?(d||m)&&(n==0||n==(e.s<0?3:2)):d>5||d==5&&(n==4||m||n==6&&(r>0?a>0?g/l(10,u-a):0:v[_-1])%10&1||n==(e.s<0?8:7))),t<1||!v[0])return m?(o=S(e),v.length=1,t=t-o-1,v[0]=l(10,(p-t%p)%p),e.e=c(-t/p)||0):(v.length=1,v[0]=e.e=e.s=0),e;if(r==0?(v.length=_,o=1,_--):(v.length=_+1,o=l(10,p-r),v[_]=a>0?(g/l(10,u-a)%l(10,a)|0)*o:0),m)for(;;)if(_==0){(v[0]+=o)==f&&(v[0]=1,++e.e);break}else{if(v[_]+=o,v[_]!=f)break;v[_--]=0,o=1}for(r=v.length;v[--r]===0;)v.pop();if(i&&(e.e>h||e.e<-h))throw Error(s+S(e));return e}function O(e,t){var n,r,a,o,s,c,l,u,d,m,h=e.constructor,g=h.precision;if(!e.s||!t.s)return t.s?t.s=-t.s:t=new h(e),i?D(t,g):t;if(l=e.d,m=t.d,r=t.e,u=e.e,l=l.slice(),s=u-r,s){for(d=s<0,d?(n=l,s=-s,c=m.length):(n=m,r=u,c=l.length),a=Math.max(Math.ceil(g/p),c)+2,s>a&&(s=a,n.length=1),n.reverse(),a=s;a--;)n.push(0);n.reverse()}else{for(a=l.length,c=m.length,d=a<c,d&&(c=a),a=0;a<c;a++)if(l[a]!=m[a]){d=l[a]<m[a];break}s=0}for(d&&(n=l,l=m,m=n,t.s=-t.s),c=l.length,a=m.length-c;a>0;--a)l[c++]=0;for(a=m.length;a>s;){if(l[--a]<m[a]){for(o=a;o&&l[--o]===0;)l[o]=f-1;--l[o],l[a]+=f}l[a]-=m[a]}for(;l[--c]===0;)l.pop();for(;l[0]===0;l.shift())--r;return l[0]?(t.d=l,t.e=r,i?D(t,g):t):new h(0)}function k(e,t,n){var r,i=S(e),a=y(e.d),o=a.length;return t?(n&&(r=n-o)>0?a=a.charAt(0)+`.`+a.slice(1)+w(r):o>1&&(a=a.charAt(0)+`.`+a.slice(1)),a=a+(i<0?`e`:`e+`)+i):i<0?(a=`0.`+w(-i-1)+a,n&&(r=n-o)>0&&(a+=w(r))):i>=o?(a+=w(i+1-o),n&&(r=n-i-1)>0&&(a=a+`.`+w(r))):((r=i+1)<o&&(a=a.slice(0,r)+`.`+a.slice(r)),n&&(r=n-o)>0&&(i+1===o&&(a+=`.`),a+=w(r))),e.s<0?`-`+a:a}function A(e,t){if(e.length>t)return e.length=t,!0}function j(e){var t,n,r;function i(e){var t=this;if(!(t instanceof i))return new i(e);if(t.constructor=i,e instanceof i)t.s=e.s,t.e=e.e,t.d=(e=e.d)?e.slice():e;else{if(typeof e==`number`){if(e*0!=0)throw Error(o+e);if(e>0)t.s=1;else if(e<0)e=-e,t.s=-1;else{t.s=0,t.e=0,t.d=[0];return}if(e===~~e&&e<1e7){t.e=0,t.d=[e];return}return E(t,e.toString())}if(typeof e!=`string`)throw Error(o+e);if(e.charCodeAt(0)===45?(e=e.slice(1),t.s=-1):t.s=1,u.test(e))E(t,e);else throw Error(o+e)}}if(i.prototype=g,i.ROUND_UP=0,i.ROUND_DOWN=1,i.ROUND_CEIL=2,i.ROUND_FLOOR=3,i.ROUND_HALF_UP=4,i.ROUND_HALF_DOWN=5,i.ROUND_HALF_EVEN=6,i.ROUND_HALF_CEIL=7,i.ROUND_HALF_FLOOR=8,i.clone=j,i.config=i.set=M,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 i.config(e),i}function M(e){if(!e||typeof e!=`object`)throw Error(a+`Object expected`);var t,r,i,s=[`precision`,1,n,`rounding`,0,8,`toExpNeg`,-1/0,0,`toExpPos`,0,1/0];for(t=0;t<s.length;t+=3)if((i=e[r=s[t]])!==void 0){if(c(i)===i&&i>=s[t+1]&&i<=s[t+2])this[r]=i;else throw Error(o+r+`: `+i)}if((i=e[r=`LN10`])!==void 0){if(i==Math.LN10)this[r]=new this(i);else throw Error(o+r+`: `+i)}return this}r=j(r),r.default=r.Decimal=r,d=new r(1),typeof define==`function`&&define.amd?define(function(){return r}):t!==void 0&&t.exports?t.exports=r:(e||=typeof self<`u`&&self&&self.self==self?self:Function(`return this`)(),e.Decimal=r)})(e)}));function nM(e){return oM(e)||aM(e)||iM(e)||rM()}function rM(){throw TypeError(`Invalid attempt to spread non-iterable instance.
|
|
67
|
-
In order to be iterable, non-array objects must have a [Symbol.iterator]() method.`)}function iM(e,t){if(e){if(typeof e==`string`)return sM(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 sM(e,t)}}function aM(e){if(typeof Symbol<`u`&&Symbol.iterator in Object(e))return Array.from(e)}function oM(e){if(Array.isArray(e))return sM(e)}function sM(e,t){(t==null||t>e.length)&&(t=e.length);for(var n=0,r=Array(t);n<t;n++)r[n]=e[n];return r}var cM=function(e){return e},lM={"@@functional/placeholder":!0},uM=function(e){return e===lM},dM=function(e){return function t(){return arguments.length===0||arguments.length===1&&uM(arguments.length<=0?void 0:arguments[0])?t:e.apply(void 0,arguments)}},fM=function e(t,n){return t===1?n:dM(function(){var r=[...arguments],i=r.filter(function(e){return e!==lM}).length;return i>=t?n.apply(void 0,r):e(t-i,dM(function(){var e=[...arguments],t=r.map(function(t){return uM(t)?e.shift():t});return n.apply(void 0,nM(t).concat(e))}))})},pM=function(e){return fM(e.length,e)},mM=function(e,t){for(var n=[],r=e;r<t;++r)n[r-e]=r;return n},hM=pM(function(e,t){return Array.isArray(t)?t.map(e):Object.keys(t).map(function(e){return t[e]}).map(e)}),gM=function(){var e=[...arguments];if(!e.length)return cM;var t=e.reverse(),n=t[0],r=t.slice(1);return function(){return r.reduce(function(e,t){return t(e)},n.apply(void 0,arguments))}},_M=function(e){return Array.isArray(e)?e.reverse():e.split(``).reverse.join(``)},vM=function(e){var t=null,n=null;return function(){var r=[...arguments];return t&&r.every(function(e,n){return e===t[n]})||(t=r,n=e.apply(void 0,r)),n}},yM=l(tM());function bM(e){return e===0?1:Math.floor(new yM.default(e).abs().log(10).toNumber())+1}function xM(e,t,n){for(var r=new yM.default(e),i=0,a=[];r.lt(t)&&i<1e5;)a.push(r.toNumber()),r=r.add(n),i++;return a}var SM={rangeStep:xM,getDigitCount:bM,interpolateNumber:pM(function(e,t,n){var r=+e;return r+n*(+t-r)}),uninterpolateNumber:pM(function(e,t,n){var r=t-+e;return r||=1/0,(n-e)/r}),uninterpolateTruncation:pM(function(e,t,n){var r=t-+e;return r||=1/0,Math.max(0,Math.min(1,(n-e)/r))})};function CM(e){return EM(e)||TM(e)||kM(e)||wM()}function wM(){throw TypeError(`Invalid attempt to spread non-iterable instance.
|
|
68
|
-
In order to be iterable, non-array objects must have a [Symbol.iterator]() method.`)}function TM(e){if(typeof Symbol<`u`&&Symbol.iterator in Object(e))return Array.from(e)}function EM(e){if(Array.isArray(e))return AM(e)}function DM(e,t){return MM(e)||jM(e,t)||kM(e,t)||OM()}function OM(){throw TypeError(`Invalid attempt to destructure non-iterable instance.
|
|
69
|
-
In order to be iterable, non-array objects must have a [Symbol.iterator]() method.`)}function kM(e,t){if(e){if(typeof e==`string`)return AM(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 AM(e,t)}}function AM(e,t){(t==null||t>e.length)&&(t=e.length);for(var n=0,r=Array(t);n<t;n++)r[n]=e[n];return r}function jM(e,t){if(typeof Symbol<`u`&&Symbol.iterator in Object(e)){var n=[],r=!0,i=!1,a=void 0;try{for(var o=e[Symbol.iterator](),s;!(r=(s=o.next()).done)&&(n.push(s.value),!(t&&n.length===t));r=!0);}catch(e){i=!0,a=e}finally{try{!r&&o.return!=null&&o.return()}finally{if(i)throw a}}return n}}function MM(e){if(Array.isArray(e))return e}function NM(e){var t=DM(e,2),n=t[0],r=t[1],i=n,a=r;return n>r&&(i=r,a=n),[i,a]}function PM(e,t,n){if(e.lte(0))return new yM.default(0);var r=SM.getDigitCount(e.toNumber()),i=new yM.default(10).pow(r),a=e.div(i),o=r===1?.1:.05,s=new yM.default(Math.ceil(a.div(o).toNumber())).add(n).mul(o).mul(i);return t?s:new yM.default(Math.ceil(s))}function FM(e,t,n){var r=1,i=new yM.default(e);if(!i.isint()&&n){var a=Math.abs(e);a<1?(r=new yM.default(10).pow(SM.getDigitCount(e)-1),i=new yM.default(Math.floor(i.div(r).toNumber())).mul(r)):a>1&&(i=new yM.default(Math.floor(e)))}else e===0?i=new yM.default(Math.floor((t-1)/2)):n||(i=new yM.default(Math.floor(e)));var o=Math.floor((t-1)/2);return gM(hM(function(e){return i.add(new yM.default(e-o).mul(r)).toNumber()}),mM)(0,t)}function IM(e,t,n,r){var i=arguments.length>4&&arguments[4]!==void 0?arguments[4]:0;if(!Number.isFinite((t-e)/(n-1)))return{step:new yM.default(0),tickMin:new yM.default(0),tickMax:new yM.default(0)};var a=PM(new yM.default(t).sub(e).div(n-1),r,i),o;e<=0&&t>=0?o=new yM.default(0):(o=new yM.default(e).add(t).div(2),o=o.sub(new yM.default(o).mod(a)));var s=Math.ceil(o.sub(e).div(a).toNumber()),c=Math.ceil(new yM.default(t).sub(o).div(a).toNumber()),l=s+c+1;return l>n?IM(e,t,n,r,i+1):(l<n&&(c=t>0?c+(n-l):c,s=t>0?s:s+(n-l)),{step:a,tickMin:o.sub(new yM.default(s).mul(a)),tickMax:o.add(new yM.default(c).mul(a))})}function LM(e){var t=DM(e,2),n=t[0],r=t[1],i=arguments.length>1&&arguments[1]!==void 0?arguments[1]:6,a=arguments.length>2&&arguments[2]!==void 0?arguments[2]:!0,o=Math.max(i,2),s=DM(NM([n,r]),2),c=s[0],l=s[1];if(c===-1/0||l===1/0){var u=l===1/0?[c].concat(CM(mM(0,i-1).map(function(){return 1/0}))):[].concat(CM(mM(0,i-1).map(function(){return-1/0})),[l]);return n>r?_M(u):u}if(c===l)return FM(c,i,a);var d=IM(c,l,o,a),f=d.step,p=d.tickMin,m=d.tickMax,h=SM.rangeStep(p,m.add(new yM.default(.1).mul(f)),f);return n>r?_M(h):h}function RM(e,t){var n=DM(e,2),r=n[0],i=n[1],a=arguments.length>2&&arguments[2]!==void 0?arguments[2]:!0,o=DM(NM([r,i]),2),s=o[0],c=o[1];if(s===-1/0||c===1/0)return[r,i];if(s===c)return[s];var l=Math.max(t,2),u=PM(new yM.default(c).sub(s).div(l-1),a,0),d=[].concat(CM(SM.rangeStep(new yM.default(s),new yM.default(c).sub(new yM.default(.99).mul(u)),u)),[c]);return r>i?_M(d):d}var zM=vM(LM),BM=vM(RM),VM=`Invariant failed`;function HM(e,t){if(!e)throw Error(VM)}var UM=[`offset`,`layout`,`width`,`dataKey`,`data`,`dataPointFormatter`,`xAxis`,`yAxis`];function WM(e){"@babel/helpers - typeof";return WM=typeof Symbol==`function`&&typeof Symbol.iterator==`symbol`?function(e){return typeof e}:function(e){return e&&typeof Symbol==`function`&&e.constructor===Symbol&&e!==Symbol.prototype?`symbol`:typeof e},WM(e)}function GM(){return GM=Object.assign?Object.assign.bind():function(e){for(var t=1;t<arguments.length;t++){var n=arguments[t];for(var r in n)Object.prototype.hasOwnProperty.call(n,r)&&(e[r]=n[r])}return e},GM.apply(this,arguments)}function KM(e,t){return ZM(e)||XM(e,t)||JM(e,t)||qM()}function qM(){throw TypeError(`Invalid attempt to destructure non-iterable instance.
|
|
70
|
-
In order to be iterable, non-array objects must have a [Symbol.iterator]() method.`)}function JM(e,t){if(e){if(typeof e==`string`)return YM(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 YM(e,t)}}function YM(e,t){(t==null||t>e.length)&&(t=e.length);for(var n=0,r=Array(t);n<t;n++)r[n]=e[n];return r}function XM(e,t){var n=e==null?null:typeof Symbol<`u`&&e[Symbol.iterator]||e[`@@iterator`];if(n!=null){var r,i,a,o,s=[],c=!0,l=!1;try{if(a=(n=n.call(e)).next,t===0){if(Object(n)!==n)return;c=!1}else for(;!(c=(r=a.call(n)).done)&&(s.push(r.value),s.length!==t);c=!0);}catch(e){l=!0,i=e}finally{try{if(!c&&n.return!=null&&(o=n.return(),Object(o)!==o))return}finally{if(l)throw i}}return s}}function ZM(e){if(Array.isArray(e))return e}function QM(e,t){if(e==null)return{};var n=$M(e,t),r,i;if(Object.getOwnPropertySymbols){var a=Object.getOwnPropertySymbols(e);for(i=0;i<a.length;i++)r=a[i],!(t.indexOf(r)>=0)&&Object.prototype.propertyIsEnumerable.call(e,r)&&(n[r]=e[r])}return n}function $M(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 eN(e,t){if(!(e instanceof t))throw TypeError(`Cannot call a class as a function`)}function tN(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,dN(r.key),r)}}function nN(e,t,n){return t&&tN(e.prototype,t),n&&tN(e,n),Object.defineProperty(e,"prototype",{writable:!1}),e}function rN(e,t,n){return t=sN(t),iN(e,oN()?Reflect.construct(t,n||[],sN(e).constructor):t.apply(e,n))}function iN(e,t){if(t&&(WM(t)===`object`||typeof t==`function`))return t;if(t!==void 0)throw TypeError(`Derived constructors may only return object or undefined`);return aN(e)}function aN(e){if(e===void 0)throw ReferenceError(`this hasn't been initialised - super() hasn't been called`);return e}function oN(){try{var e=!Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],function(){}))}catch{}return(oN=function(){return!!e})()}function sN(e){return sN=Object.setPrototypeOf?Object.getPrototypeOf.bind():function(e){return e.__proto__||Object.getPrototypeOf(e)},sN(e)}function cN(e,t){if(typeof t!=`function`&&t!==null)throw 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&&lN(e,t)}function lN(e,t){return lN=Object.setPrototypeOf?Object.setPrototypeOf.bind():function(e,t){return e.__proto__=t,e},lN(e,t)}function uN(e,t,n){return t=dN(t),t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function dN(e){var t=fN(e,`string`);return WM(t)==`symbol`?t:t+``}function fN(e,t){if(WM(e)!=`object`||!e)return e;var n=e[Symbol.toPrimitive];if(n!==void 0){var r=n.call(e,t||`default`);if(WM(r)!=`object`)return r;throw TypeError(`@@toPrimitive must return a primitive value.`)}return(t===`string`?String:Number)(e)}var pN=function(e){function t(){return eN(this,t),rN(this,t,arguments)}return cN(t,e),nN(t,[{key:`render`,value:function(){var e=this.props,t=e.offset,n=e.layout,r=e.width,i=e.dataKey,a=e.data,o=e.dataPointFormatter,s=e.xAxis,c=e.yAxis,l=Ob(QM(e,UM),!1);this.props.direction===`x`&&s.type!==`number`&&HM(!1);var u=a.map(function(e){var a=o(e,i),u=a.x,d=a.y,f=a.value,p=a.errorVal;if(!p)return null;var m=[],h,g;if(Array.isArray(p)){var v=KM(p,2);h=v[0],g=v[1]}else h=g=p;if(n===`vertical`){var y=s.scale,b=d+t,x=b+r,S=b-r,C=y(f-h),w=y(f+g);m.push({x1:w,y1:x,x2:w,y2:S}),m.push({x1:C,y1:b,x2:w,y2:b}),m.push({x1:C,y1:x,x2:C,y2:S})}else if(n===`horizontal`){var T=c.scale,E=u+t,D=E-r,O=E+r,k=T(f-h),A=T(f+g);m.push({x1:D,y1:A,x2:O,y2:A}),m.push({x1:E,y1:k,x2:E,y2:A}),m.push({x1:D,y1:k,x2:O,y2:k})}return _.createElement(Ub,GM({className:`recharts-errorBar`,key:`bar-${m.map(function(e){return`${e.x1}-${e.x2}-${e.y1}-${e.y2}`})}`},l),m.map(function(e){return _.createElement(`line`,GM({},e,{key:`line-${e.x1}-${e.x2}-${e.y1}-${e.y2}`}))}))});return _.createElement(Ub,{className:`recharts-errorBars`},u)}}])}(_.Component);uN(pN,`defaultProps`,{stroke:`black`,strokeWidth:1.5,width:5,offset:0,layout:`horizontal`}),uN(pN,`displayName`,`ErrorBar`);function mN(e){"@babel/helpers - typeof";return mN=typeof Symbol==`function`&&typeof Symbol.iterator==`symbol`?function(e){return typeof e}:function(e){return e&&typeof Symbol==`function`&&e.constructor===Symbol&&e!==Symbol.prototype?`symbol`:typeof e},mN(e)}function hN(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter(function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable})),n.push.apply(n,r)}return n}function gN(e){for(var t=1;t<arguments.length;t++){var n=arguments[t]==null?{}:arguments[t];t%2?hN(Object(n),!0).forEach(function(t){_N(e,t,n[t])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):hN(Object(n)).forEach(function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(n,t))})}return e}function _N(e,t,n){return t=vN(t),t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function vN(e){var t=yN(e,`string`);return mN(t)==`symbol`?t:t+``}function yN(e,t){if(mN(e)!=`object`||!e)return e;var n=e[Symbol.toPrimitive];if(n!==void 0){var r=n.call(e,t||`default`);if(mN(r)!=`object`)return r;throw TypeError(`@@toPrimitive must return a primitive value.`)}return(t===`string`?String:Number)(e)}var bN=function(e){var t=e.children,n=e.formattedGraphicalItems,r=e.legendWidth,i=e.legendContent,a=Sb(t,jC);if(!a)return null;var o=jC.defaultProps,s=o===void 0?{}:gN(gN({},o),a.props),c=a.props&&a.props.payload?a.props&&a.props.payload:i===`children`?(n||[]).reduce(function(e,t){var n=t.item,r=t.props,i=r.sectors||r.data||[];return e.concat(i.map(function(e){return{type:a.props.iconType||n.props.legendType,value:e.name,color:e.fill,payload:e}}))},[]):(n||[]).map(function(e){var t=e.item,n=t.type.defaultProps,r=n===void 0?{}:gN(gN({},n),t.props),i=r.dataKey,a=r.name,o=r.legendType;return{inactive:r.hide,dataKey:i,type:s.iconType||o||`square`,color:BN(t),value:a||i,payload:r}});return gN(gN(gN({},s),jC.getWithHeight(a,r)),{},{payload:c,item:a})},xN=l(Yj()),SN=l(Zj()),CN=l($j()),wN=l(eM());function TN(e){"@babel/helpers - typeof";return TN=typeof Symbol==`function`&&typeof Symbol.iterator==`symbol`?function(e){return typeof e}:function(e){return e&&typeof Symbol==`function`&&e.constructor===Symbol&&e!==Symbol.prototype?`symbol`:typeof e},TN(e)}function EN(e){return AN(e)||kN(e)||ON(e)||DN()}function DN(){throw TypeError(`Invalid attempt to spread non-iterable instance.
|
|
71
|
-
In order to be iterable, non-array objects must have a [Symbol.iterator]() method.`)}function ON(e,t){if(e){if(typeof e==`string`)return jN(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 jN(e,t)}}function kN(e){if(typeof Symbol<`u`&&e[Symbol.iterator]!=null||e[`@@iterator`]!=null)return Array.from(e)}function AN(e){if(Array.isArray(e))return jN(e)}function jN(e,t){(t==null||t>e.length)&&(t=e.length);for(var n=0,r=Array(t);n<t;n++)r[n]=e[n];return r}function MN(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter(function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable})),n.push.apply(n,r)}return n}function NN(e){for(var t=1;t<arguments.length;t++){var n=arguments[t]==null?{}:arguments[t];t%2?MN(Object(n),!0).forEach(function(t){PN(e,t,n[t])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):MN(Object(n)).forEach(function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(n,t))})}return e}function PN(e,t,n){return t=FN(t),t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function FN(e){var t=IN(e,`string`);return TN(t)==`symbol`?t:t+``}function IN(e,t){if(TN(e)!=`object`||!e)return e;var n=e[Symbol.toPrimitive];if(n!==void 0){var r=n.call(e,t||`default`);if(TN(r)!=`object`)return r;throw TypeError(`@@toPrimitive must return a primitive value.`)}return(t===`string`?String:Number)(e)}function LN(e,t,n){return(0,Ry.default)(e)||(0,Ry.default)(t)?n:Uy(t)?(0,Iy.default)(e,t,n):(0,lb.default)(t)?t(e):n}function RN(e,t,n,r){var i=(0,CN.default)(e,function(e){return LN(e,t)});if(n===`number`){var a=i.filter(function(e){return Vy(e)||parseFloat(e)});return a.length?[(0,SN.default)(a),(0,xN.default)(a)]:[1/0,-1/0]}return(r?i.filter(function(e){return!(0,Ry.default)(e)}):i).map(function(e){return Uy(e)||e instanceof Date?e:``})}var zN=function(e){var t=arguments.length>1&&arguments[1]!==void 0?arguments[1]:[],n=arguments.length>2?arguments[2]:void 0,r=arguments.length>3?arguments[3]:void 0,i=-1,a=t?.length??0;if(a<=1)return 0;if(r&&r.axisType===`angleAxis`&&Math.abs(Math.abs(r.range[1]-r.range[0])-360)<=1e-6)for(var o=r.range,s=0;s<a;s++){var c=s>0?n[s-1].coordinate:n[a-1].coordinate,l=n[s].coordinate,u=s>=a-1?n[0].coordinate:n[s+1].coordinate,d=void 0;if(zy(l-c)!==zy(u-l)){var f=[];if(zy(u-l)===zy(o[1]-o[0])){d=u;var p=l+o[1]-o[0];f[0]=Math.min(p,(p+c)/2),f[1]=Math.max(p,(p+c)/2)}else{d=c;var m=u+o[1]-o[0];f[0]=Math.min(l,(m+l)/2),f[1]=Math.max(l,(m+l)/2)}var h=[Math.min(l,(d+l)/2),Math.max(l,(d+l)/2)];if(e>h[0]&&e<=h[1]||e>=f[0]&&e<=f[1]){i=n[s].index;break}}else{var g=Math.min(c,u),_=Math.max(c,u);if(e>(g+l)/2&&e<=(_+l)/2){i=n[s].index;break}}}else for(var v=0;v<a;v++)if(v===0&&e<=(t[v].coordinate+t[v+1].coordinate)/2||v>0&&v<a-1&&e>(t[v].coordinate+t[v-1].coordinate)/2&&e<=(t[v].coordinate+t[v+1].coordinate)/2||v===a-1&&e>(t[v].coordinate+t[v-1].coordinate)/2){i=t[v].index;break}return i},BN=function(e){var t,n=e.type.displayName,r=(t=e.type)!=null&&t.defaultProps?NN(NN({},e.type.defaultProps),e.props):e.props,i=r.stroke,a=r.fill,o;switch(n){case`Line`:o=i;break;case`Area`:case`Radar`:o=i&&i!==`none`?i:a;break;default:o=a}return o},VN=function(e){var t=e.barSize,n=e.totalSize,r=e.stackGroups,i=r===void 0?{}:r;if(!i)return{};for(var a={},o=Object.keys(i),s=0,c=o.length;s<c;s++)for(var l=i[o[s]].stackGroups,u=Object.keys(l),d=0,f=u.length;d<f;d++){var p=l[u[d]],m=p.items,h=p.cateAxisId,g=m.filter(function(e){return _b(e.type).indexOf(`Bar`)>=0});if(g&&g.length){var _=g[0].type.defaultProps,v=_===void 0?g[0].props:NN(NN({},_),g[0].props),y=v.barSize,b=v[h];a[b]||(a[b]=[]);var x=(0,Ry.default)(y)?t:y;a[b].push({item:g[0],stackList:g.slice(1),barSize:(0,Ry.default)(x)?void 0:Ky(x,n,0)})}}return a},HN=function(e){var t=e.barGap,n=e.barCategoryGap,r=e.bandSize,i=e.sizeList,a=i===void 0?[]:i,o=e.maxBarSize,s=a.length;if(s<1)return null;var c=Ky(t,r,0,!0),l,u=[];if(a[0].barSize===+a[0].barSize){var d=!1,f=r/s,p=a.reduce(function(e,t){return e+t.barSize||0},0);p+=(s-1)*c,p>=r&&(p-=(s-1)*c,c=0),p>=r&&f>0&&(d=!0,f*=.9,p=s*f);var m={offset:((r-p)/2|0)-c,size:0};l=a.reduce(function(e,t){var n={item:t.item,position:{offset:m.offset+m.size+c,size:d?f:t.barSize}},r=[].concat(EN(e),[n]);return m=r[r.length-1].position,t.stackList&&t.stackList.length&&t.stackList.forEach(function(e){r.push({item:e,position:m})}),r},u)}else{var h=Ky(n,r,0,!0);r-2*h-(s-1)*c<=0&&(c=0);var g=(r-2*h-(s-1)*c)/s;g>1&&(g>>=0);var _=o===+o?Math.min(g,o):g;l=a.reduce(function(e,t,n){var r=[].concat(EN(e),[{item:t.item,position:{offset:h+(g+c)*n+(g-_)/2,size:_}}]);return t.stackList&&t.stackList.length&&t.stackList.forEach(function(e){r.push({item:e,position:r[r.length-1].position})}),r},u)}return l},UN=function(e,t,n,r){var i=n.children,a=n.width,o=n.margin,s=bN({children:i,legendWidth:a-(o.left||0)-(o.right||0)});if(s){var c=r||{},l=c.width,u=c.height,d=s.align,f=s.verticalAlign,p=s.layout;if((p===`vertical`||p===`horizontal`&&f===`middle`)&&d!==`center`&&Vy(e[d]))return NN(NN({},e),{},PN({},d,e[d]+(l||0)));if((p===`horizontal`||p===`vertical`&&d===`center`)&&f!==`middle`&&Vy(e[f]))return NN(NN({},e),{},PN({},f,e[f]+(u||0)))}return e},WN=function(e,t,n){return(0,Ry.default)(t)?!0:e===`horizontal`?t===`yAxis`:e===`vertical`||n===`x`?t===`xAxis`:n!==`y`||t===`yAxis`},GN=function(e,t,n,r,i){var a=t.props.children,o=xb(a,pN).filter(function(e){return WN(r,i,e.props.direction)});if(o&&o.length){var s=o.map(function(e){return e.props.dataKey});return e.reduce(function(e,t){var r=LN(t,n);if((0,Ry.default)(r))return e;var i=Array.isArray(r)?[(0,SN.default)(r),(0,xN.default)(r)]:[r,r],a=s.reduce(function(e,n){var r=LN(t,n,0),a=i[0]-Math.abs(Array.isArray(r)?r[0]:r),o=i[1]+Math.abs(Array.isArray(r)?r[1]:r);return[Math.min(a,e[0]),Math.max(o,e[1])]},[1/0,-1/0]);return[Math.min(a[0],e[0]),Math.max(a[1],e[1])]},[1/0,-1/0])}return null},KN=function(e,t,n,r,i){var a=t.map(function(t){return GN(e,t,n,i,r)}).filter(function(e){return!(0,Ry.default)(e)});return a&&a.length?a.reduce(function(e,t){return[Math.min(e[0],t[0]),Math.max(e[1],t[1])]},[1/0,-1/0]):null},qN=function(e,t,n,r,i){var a=t.map(function(t){var a=t.props.dataKey;return n===`number`&&a&&GN(e,t,a,r)||RN(e,a,n,i)});if(n===`number`)return a.reduce(function(e,t){return[Math.min(e[0],t[0]),Math.max(e[1],t[1])]},[1/0,-1/0]);var o={};return a.reduce(function(e,t){for(var n=0,r=t.length;n<r;n++)o[t[n]]||(o[t[n]]=!0,e.push(t[n]));return e},[])},JN=function(e,t){return e===`horizontal`&&t===`xAxis`||e===`vertical`&&t===`yAxis`||e===`centric`&&t===`angleAxis`||e===`radial`&&t===`radiusAxis`},YN=function(e,t,n){if(!e)return null;var r=e.scale,i=e.duplicateDomain,a=e.type,o=e.range,s=e.realScaleType===`scaleBand`?r.bandwidth()/2:2,c=(t||n)&&a===`category`&&r.bandwidth?r.bandwidth()/s:0;return c=e.axisType===`angleAxis`&&o?.length>=2?zy(o[0]-o[1])*2*c:c,t&&(e.ticks||e.niceTicks)?(e.ticks||e.niceTicks).map(function(e){return{coordinate:r(i?i.indexOf(e):e)+c,value:e,offset:c}}).filter(function(e){return!(0,Fy.default)(e.coordinate)}):e.isCategorical&&e.categoricalDomain?e.categoricalDomain.map(function(e,t){return{coordinate:r(e)+c,value:e,index:t,offset:c}}):r.ticks&&!n?r.ticks(e.tickCount).map(function(e){return{coordinate:r(e)+c,value:e,offset:c}}):r.domain().map(function(e,t){return{coordinate:r(e)+c,value:i?i[e]:e,index:t,offset:c}})},XN=new WeakMap,ZN=function(e,t){if(typeof t!=`function`)return e;XN.has(e)||XN.set(e,new WeakMap);var n=XN.get(e);if(n.has(t))return n.get(t);var r=function(){e.apply(void 0,arguments),t.apply(void 0,arguments)};return n.set(t,r),r},QN=function(e,t,n){var r=e.scale,i=e.type,a=e.layout,o=e.axisType;if(r===`auto`)return a===`radial`&&o===`radiusAxis`?{scale:KE(),realScaleType:`band`}:a===`radial`&&o===`angleAxis`?{scale:LO(),realScaleType:`linear`}:i===`category`&&t&&(t.indexOf(`LineChart`)>=0||t.indexOf(`AreaChart`)>=0||t.indexOf(`ComposedChart`)>=0&&!n)?{scale:JE(),realScaleType:`point`}:i===`category`?{scale:KE(),realScaleType:`band`}:{scale:LO(),realScaleType:`linear`};if((0,Py.default)(r)){var s=`scale${(0,xS.default)(r)}`;return{scale:(Kj[s]||JE)(),realScaleType:Kj[s]?s:`point`}}return(0,lb.default)(r)?{scale:r}:{scale:JE(),realScaleType:`point`}},$N=1e-4,eP=function(e){var t=e.domain();if(!(!t||t.length<=2)){var n=t.length,r=e.range(),i=Math.min(r[0],r[1])-$N,a=Math.max(r[0],r[1])+$N,o=e(t[0]),s=e(t[n-1]);(o<i||o>a||s<i||s>a)&&e.domain([t[0],t[n-1]])}},tP=function(e,t){if(!e)return null;for(var n=0,r=e.length;n<r;n++)if(e[n].item===t)return e[n].position;return null},nP=function(e,t){if(!t||t.length!==2||!Vy(t[0])||!Vy(t[1]))return e;var n=Math.min(t[0],t[1]),r=Math.max(t[0],t[1]),i=[e[0],e[1]];return(!Vy(e[0])||e[0]<n)&&(i[0]=n),(!Vy(e[1])||e[1]>r)&&(i[1]=r),i[0]>r&&(i[0]=r),i[1]<n&&(i[1]=n),i},rP={sign:function(e){var t=e.length;if(!(t<=0))for(var n=0,r=e[0].length;n<r;++n)for(var i=0,a=0,o=0;o<t;++o){var s=(0,Fy.default)(e[o][n][1])?e[o][n][0]:e[o][n][1];s>=0?(e[o][n][0]=i,e[o][n][1]=i+s,i=e[o][n][1]):(e[o][n][0]=a,e[o][n][1]=a+s,a=e[o][n][1])}},expand:vS,none:pS,silhouette:yS,wiggle:bS,positive:function(e){var t=e.length;if(!(t<=0))for(var n=0,r=e[0].length;n<r;++n)for(var i=0,a=0;a<t;++a){var o=(0,Fy.default)(e[a][n][1])?e[a][n][0]:e[a][n][1];o>=0?(e[a][n][0]=i,e[a][n][1]=i+o,i=e[a][n][1]):(e[a][n][0]=0,e[a][n][1]=0)}}},Nne=function(e,t,n){var r=t.map(function(e){return e.props.dataKey}),i=rP[n];return _S().keys(r).value(function(e,t){return+LN(e,t,0)}).order(mS).offset(i)(e)},Pne=function(e,t,n,r,i,a){if(!e)return null;var o=(a?t.reverse():t).reduce(function(e,t){var i,a=(i=t.type)!=null&&i.defaultProps?NN(NN({},t.type.defaultProps),t.props):t.props,o=a.stackId;if(a.hide)return e;var s=a[n],c=e[s]||{hasStack:!1,stackGroups:{}};if(Uy(o)){var l=c.stackGroups[o]||{numericAxisId:n,cateAxisId:r,items:[]};l.items.push(t),c.hasStack=!0,c.stackGroups[o]=l}else c.stackGroups[Gy(`_stackId_`)]={numericAxisId:n,cateAxisId:r,items:[t]};return NN(NN({},e),{},PN({},s,c))},{});return Object.keys(o).reduce(function(t,a){var s=o[a];return s.hasStack&&(s.stackGroups=Object.keys(s.stackGroups).reduce(function(t,a){var o=s.stackGroups[a];return NN(NN({},t),{},PN({},a,{numericAxisId:n,cateAxisId:r,items:o.items,stackedData:Nne(e,o.items,i)}))},{})),NN(NN({},t),{},PN({},a,s))},{})},iP=function(e,t){var n=t.realScaleType,r=t.type,i=t.tickCount,a=t.originalDomain,o=t.allowDecimals,s=n||t.scale;if(s!==`auto`&&s!==`linear`)return null;if(i&&r===`number`&&a&&(a[0]===`auto`||a[1]===`auto`)){var c=e.domain();if(!c.length)return null;var l=zM(c,i,o);return e.domain([(0,SN.default)(l),(0,xN.default)(l)]),{niceTicks:l}}return i&&r===`number`?{niceTicks:BM(e.domain(),i,o)}:null};function aP(e){var t=e.axis,n=e.ticks,r=e.bandSize,i=e.entry,a=e.index,o=e.dataKey;if(t.type===`category`){if(!t.allowDuplicatedCategory&&t.dataKey&&!(0,Ry.default)(i[t.dataKey])){var s=Xy(n,`value`,i[t.dataKey]);if(s)return s.coordinate+r/2}return n[a]?n[a].coordinate+r/2:null}var c=LN(i,(0,Ry.default)(o)?t.dataKey:o);return(0,Ry.default)(c)?null:t.scale(c)}var oP=function(e){var t=e.axis,n=e.ticks,r=e.offset,i=e.bandSize,a=e.entry,o=e.index;if(t.type===`category`)return n[o]?n[o].coordinate+r:null;var s=LN(a,t.dataKey,t.domain[o]);return(0,Ry.default)(s)?null:t.scale(s)-i/2+r},Fne=function(e){var t=e.numericAxis,n=t.scale.domain();if(t.type===`number`){var r=Math.min(n[0],n[1]),i=Math.max(n[0],n[1]);return r<=0&&i>=0?0:i<0?i:r}return n[0]},Ine=function(e,t){var n,r=((n=e.type)!=null&&n.defaultProps?NN(NN({},e.type.defaultProps),e.props):e.props).stackId;if(Uy(r)){var i=t[r];if(i){var a=i.items.indexOf(e);return a>=0?i.stackedData[a]:null}}return null},Lne=function(e){return e.reduce(function(e,t){return[(0,SN.default)(t.concat([e[0]]).filter(Vy)),(0,xN.default)(t.concat([e[1]]).filter(Vy))]},[1/0,-1/0])},sP=function(e,t,n){return Object.keys(e).reduce(function(r,i){var a=e[i].stackedData.reduce(function(e,r){var i=Lne(r.slice(t,n+1));return[Math.min(e[0],i[0]),Math.max(e[1],i[1])]},[1/0,-1/0]);return[Math.min(a[0],r[0]),Math.max(a[1],r[1])]},[1/0,-1/0]).map(function(e){return e===1/0||e===-1/0?0:e})},cP=/^dataMin[\s]*-[\s]*([0-9]+([.]{1}[0-9]+){0,1})$/,lP=/^dataMax[\s]*\+[\s]*([0-9]+([.]{1}[0-9]+){0,1})$/,uP=function(e,t,n){if((0,lb.default)(e))return e(t,n);if(!Array.isArray(e))return t;var r=[];if(Vy(e[0]))r[0]=n?e[0]:Math.min(e[0],t[0]);else if(cP.test(e[0])){var i=+cP.exec(e[0])[1];r[0]=t[0]-i}else r[0]=(0,lb.default)(e[0])?e[0](t[0]):t[0];if(Vy(e[1]))r[1]=n?e[1]:Math.max(e[1],t[1]);else if(lP.test(e[1])){var a=+lP.exec(e[1])[1];r[1]=t[1]+a}else r[1]=(0,lb.default)(e[1])?e[1](t[1]):t[1];return r},dP=function(e,t,n){if(e&&e.scale&&e.scale.bandwidth){var r=e.scale.bandwidth();if(!n||r>0)return r}if(e&&t&&t.length>=2){for(var i=(0,RC.default)(t,function(e){return e.coordinate}),a=1/0,o=1,s=i.length;o<s;o++){var c=i[o],l=i[o-1];a=Math.min((c.coordinate||0)-(l.coordinate||0),a)}return a===1/0?0:a}return n?void 0:0},fP=function(e,t,n){return!e||!e.length||(0,wN.default)(e,(0,Iy.default)(n,`type.defaultProps.domain`))?t:e},pP=function(e,t){var n=e.type.defaultProps?NN(NN({},e.type.defaultProps),e.props):e.props,r=n.dataKey,i=n.name,a=n.unit,o=n.formatter,s=n.tooltipType,c=n.chartType,l=n.hide;return NN(NN({},Ob(e,!1)),{},{dataKey:r,unit:a,formatter:o,name:i||r,color:BN(e),value:LN(t,r),type:s,payload:t,chartType:c,hide:l})};function mP(e){"@babel/helpers - typeof";return mP=typeof Symbol==`function`&&typeof Symbol.iterator==`symbol`?function(e){return typeof e}:function(e){return e&&typeof Symbol==`function`&&e.constructor===Symbol&&e!==Symbol.prototype?`symbol`:typeof e},mP(e)}function hP(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter(function(t){return Object.getOwnPropertyDescriptor(e,t).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?hP(Object(n),!0).forEach(function(t){_P(e,t,n[t])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):hP(Object(n)).forEach(function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(n,t))})}return e}function _P(e,t,n){return t=Rne(t),t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function Rne(e){var t=zne(e,`string`);return mP(t)==`symbol`?t:t+``}function zne(e,t){if(mP(e)!=`object`||!e)return e;var n=e[Symbol.toPrimitive];if(n!==void 0){var r=n.call(e,t||`default`);if(mP(r)!=`object`)return r;throw TypeError(`@@toPrimitive must return a primitive value.`)}return(t===`string`?String:Number)(e)}function Bne(e,t){return Wne(e)||Une(e,t)||Hne(e,t)||Vne()}function Vne(){throw TypeError(`Invalid attempt to destructure non-iterable instance.
|
|
72
|
-
In order to be iterable, non-array objects must have a [Symbol.iterator]() method.`)}function Hne(e,t){if(e){if(typeof e==`string`)return vP(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 vP(e,t)}}function vP(e,t){(t==null||t>e.length)&&(t=e.length);for(var n=0,r=Array(t);n<t;n++)r[n]=e[n];return r}function Une(e,t){var n=e==null?null:typeof Symbol<`u`&&e[Symbol.iterator]||e[`@@iterator`];if(n!=null){var r,i,a,o,s=[],c=!0,l=!1;try{if(a=(n=n.call(e)).next,t===0){if(Object(n)!==n)return;c=!1}else for(;!(c=(r=a.call(n)).done)&&(s.push(r.value),s.length!==t);c=!0);}catch(e){l=!0,i=e}finally{try{if(!c&&n.return!=null&&(o=n.return(),Object(o)!==o))return}finally{if(l)throw i}}return s}}function Wne(e){if(Array.isArray(e))return e}var yP=Math.PI/180,Gne=function(e){return e*180/Math.PI},bP=function(e,t,n,r){return{x:e+Math.cos(-yP*r)*n,y:t+Math.sin(-yP*r)*n}},xP=function(e,t){var n=arguments.length>2&&arguments[2]!==void 0?arguments[2]:{top:0,right:0,bottom:0,left:0};return Math.min(Math.abs(e-(n.left||0)-(n.right||0)),Math.abs(t-(n.top||0)-(n.bottom||0)))/2},Kne=function(e,t,n,r,i){var a=e.width,o=e.height,s=e.startAngle,c=e.endAngle,l=Ky(e.cx,a,a/2),u=Ky(e.cy,o,o/2),d=xP(a,o,n),f=Ky(e.innerRadius,d,0),p=Ky(e.outerRadius,d,d*.8);return Object.keys(t).reduce(function(e,n){var a=t[n],o=a.domain,d=a.reversed,m;if((0,Ry.default)(a.range))r===`angleAxis`?m=[s,c]:r===`radiusAxis`&&(m=[f,p]),d&&(m=[m[1],m[0]]);else{m=a.range;var h=Bne(m,2);s=h[0],c=h[1]}var g=QN(a,i),_=g.realScaleType,v=g.scale;v.domain(o).range(m),eP(v);var y=iP(v,gP(gP({},a),{},{realScaleType:_})),b=gP(gP(gP({},a),y),{},{range:m,radius:p,realScaleType:_,scale:v,cx:l,cy:u,innerRadius:f,outerRadius:p,startAngle:s,endAngle:c});return gP(gP({},e),{},_P({},n,b))},{})},qne=function(e,t){var n=e.x,r=e.y,i=t.x,a=t.y;return Math.sqrt((n-i)**2+(r-a)**2)},Jne=function(e,t){var n=e.x,r=e.y,i=t.cx,a=t.cy,o=qne({x:n,y:r},{x:i,y:a});if(o<=0)return{radius:o};var s=(n-i)/o,c=Math.acos(s);return r>a&&(c=2*Math.PI-c),{radius:o,angle:Gne(c),angleInRadian:c}},Yne=function(e){var t=e.startAngle,n=e.endAngle,r=Math.floor(t/360),i=Math.floor(n/360),a=Math.min(r,i);return{startAngle:t-a*360,endAngle:n-a*360}},Xne=function(e,t){var n=t.startAngle,r=t.endAngle,i=Math.floor(n/360),a=Math.floor(r/360);return e+Math.min(i,a)*360},SP=function(e,t){var n=e.x,r=e.y,i=Jne({x:n,y:r},t),a=i.radius,o=i.angle,s=t.innerRadius,c=t.outerRadius;if(a<s||a>c)return!1;if(a===0)return!0;var l=Yne(t),u=l.startAngle,d=l.endAngle,f=o,p;if(u<=d){for(;f>d;)f-=360;for(;f<u;)f+=360;p=f>=u&&f<=d}else{for(;f>u;)f-=360;for(;f<d;)f+=360;p=f>=d&&f<=u}return p?gP(gP({},t),{},{radius:a,angle:Xne(f,t)}):null},CP=function(e){return!(0,_.isValidElement)(e)&&!(0,lb.default)(e)&&typeof e!=`boolean`?e.className:``};function wP(e){"@babel/helpers - typeof";return wP=typeof Symbol==`function`&&typeof Symbol.iterator==`symbol`?function(e){return typeof e}:function(e){return e&&typeof Symbol==`function`&&e.constructor===Symbol&&e!==Symbol.prototype?`symbol`:typeof e},wP(e)}var Zne=[`offset`];function Qne(e){return nre(e)||tre(e)||ere(e)||$ne()}function $ne(){throw TypeError(`Invalid attempt to spread non-iterable instance.
|
|
73
|
-
In order to be iterable, non-array objects must have a [Symbol.iterator]() method.`)}function ere(e,t){if(e){if(typeof e==`string`)return TP(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 TP(e,t)}}function tre(e){if(typeof Symbol<`u`&&e[Symbol.iterator]!=null||e[`@@iterator`]!=null)return Array.from(e)}function nre(e){if(Array.isArray(e))return TP(e)}function TP(e,t){(t==null||t>e.length)&&(t=e.length);for(var n=0,r=Array(t);n<t;n++)r[n]=e[n];return r}function rre(e,t){if(e==null)return{};var n=ire(e,t),r,i;if(Object.getOwnPropertySymbols){var a=Object.getOwnPropertySymbols(e);for(i=0;i<a.length;i++)r=a[i],!(t.indexOf(r)>=0)&&Object.prototype.propertyIsEnumerable.call(e,r)&&(n[r]=e[r])}return n}function ire(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 EP(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter(function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable})),n.push.apply(n,r)}return n}function DP(e){for(var t=1;t<arguments.length;t++){var n=arguments[t]==null?{}:arguments[t];t%2?EP(Object(n),!0).forEach(function(t){are(e,t,n[t])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):EP(Object(n)).forEach(function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(n,t))})}return e}function are(e,t,n){return t=ore(t),t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function ore(e){var t=sre(e,`string`);return wP(t)==`symbol`?t:t+``}function sre(e,t){if(wP(e)!=`object`||!e)return e;var n=e[Symbol.toPrimitive];if(n!==void 0){var r=n.call(e,t||`default`);if(wP(r)!=`object`)return r;throw TypeError(`@@toPrimitive must return a primitive value.`)}return(t===`string`?String:Number)(e)}function OP(){return OP=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},OP.apply(this,arguments)}var cre=function(e){var t=e.value,n=e.formatter,r=(0,Ry.default)(e.children)?t:e.children;return(0,lb.default)(n)?n(r):r},lre=function(e,t){return zy(t-e)*Math.min(Math.abs(t-e),360)},ure=function(e,t,n){var r=e.position,i=e.viewBox,a=e.offset,o=e.className,s=i,c=s.cx,l=s.cy,u=s.innerRadius,d=s.outerRadius,f=s.startAngle,p=s.endAngle,m=s.clockWise,h=(u+d)/2,g=lre(f,p),v=g>=0?1:-1,y,b;r===`insideStart`?(y=f+v*a,b=m):r===`insideEnd`?(y=p-v*a,b=!m):r===`end`&&(y=p+v*a,b=m),b=g<=0?b:!b;var x=bP(c,l,h,y),S=bP(c,l,h,y+(b?1:-1)*359),C=`M${x.x},${x.y}
|
|
74
|
-
A${h},${h},0,1,${+!b},
|
|
75
|
-
${S.x},${S.y}`,w=(0,Ry.default)(e.id)?Gy(`recharts-radial-line-`):e.id;return _.createElement(`text`,OP({},n,{dominantBaseline:`central`,className:Ht(`recharts-radial-bar-label`,o)}),_.createElement(`defs`,null,_.createElement(`path`,{id:w,d:C})),_.createElement(`textPath`,{xlinkHref:`#${w}`},t))},dre=function(e){var t=e.viewBox,n=e.offset,r=e.position,i=t,a=i.cx,o=i.cy,s=i.innerRadius,c=i.outerRadius,l=(i.startAngle+i.endAngle)/2;if(r===`outside`){var u=bP(a,o,c+n,l),d=u.x;return{x:d,y:u.y,textAnchor:d>=a?`start`:`end`,verticalAnchor:`middle`}}if(r===`center`)return{x:a,y:o,textAnchor:`middle`,verticalAnchor:`middle`};if(r===`centerTop`)return{x:a,y:o,textAnchor:`middle`,verticalAnchor:`start`};if(r===`centerBottom`)return{x:a,y:o,textAnchor:`middle`,verticalAnchor:`end`};var f=bP(a,o,(s+c)/2,l);return{x:f.x,y:f.y,textAnchor:`middle`,verticalAnchor:`middle`}},fre=function(e){var t=e.viewBox,n=e.parentViewBox,r=e.offset,i=e.position,a=t,o=a.x,s=a.y,c=a.width,l=a.height,u=l>=0?1:-1,d=u*r,f=u>0?`end`:`start`,p=u>0?`start`:`end`,m=c>=0?1:-1,h=m*r,g=m>0?`end`:`start`,_=m>0?`start`:`end`;if(i===`top`)return DP(DP({},{x:o+c/2,y:s-u*r,textAnchor:`middle`,verticalAnchor:f}),n?{height:Math.max(s-n.y,0),width:c}:{});if(i===`bottom`)return DP(DP({},{x:o+c/2,y:s+l+d,textAnchor:`middle`,verticalAnchor:p}),n?{height:Math.max(n.y+n.height-(s+l),0),width:c}:{});if(i===`left`){var v={x:o-h,y:s+l/2,textAnchor:g,verticalAnchor:`middle`};return DP(DP({},v),n?{width:Math.max(v.x-n.x,0),height:l}:{})}if(i===`right`){var y={x:o+c+h,y:s+l/2,textAnchor:_,verticalAnchor:`middle`};return DP(DP({},y),n?{width:Math.max(n.x+n.width-y.x,0),height:l}:{})}var b=n?{width:c,height:l}:{};return i===`insideLeft`?DP({x:o+h,y:s+l/2,textAnchor:_,verticalAnchor:`middle`},b):i===`insideRight`?DP({x:o+c-h,y:s+l/2,textAnchor:g,verticalAnchor:`middle`},b):i===`insideTop`?DP({x:o+c/2,y:s+d,textAnchor:`middle`,verticalAnchor:p},b):i===`insideBottom`?DP({x:o+c/2,y:s+l-d,textAnchor:`middle`,verticalAnchor:f},b):i===`insideTopLeft`?DP({x:o+h,y:s+d,textAnchor:_,verticalAnchor:p},b):i===`insideTopRight`?DP({x:o+c-h,y:s+d,textAnchor:g,verticalAnchor:p},b):i===`insideBottomLeft`?DP({x:o+h,y:s+l-d,textAnchor:_,verticalAnchor:f},b):i===`insideBottomRight`?DP({x:o+c-h,y:s+l-d,textAnchor:g,verticalAnchor:f},b):(0,$y.default)(i)&&(Vy(i.x)||By(i.x))&&(Vy(i.y)||By(i.y))?DP({x:o+Ky(i.x,c),y:s+Ky(i.y,l),textAnchor:`end`,verticalAnchor:`end`},b):DP({x:o+c/2,y:s+l/2,textAnchor:`middle`,verticalAnchor:`middle`},b)},pre=function(e){return`cx`in e&&Vy(e.cx)};function kP(e){var t=e.offset,n=t===void 0?5:t,r=rre(e,Zne),i=DP({offset:n},r),a=i.viewBox,o=i.position,s=i.value,c=i.children,l=i.content,u=i.className,d=u===void 0?``:u,f=i.textBreakAll;if(!a||(0,Ry.default)(s)&&(0,Ry.default)(c)&&!(0,_.isValidElement)(l)&&!(0,lb.default)(l))return null;if((0,_.isValidElement)(l))return(0,_.cloneElement)(l,i);var p;if((0,lb.default)(l)){if(p=(0,_.createElement)(l,i),(0,_.isValidElement)(p))return p}else p=cre(i);var m=pre(a),h=Ob(i,!0);if(m&&(o===`insideStart`||o===`insideEnd`||o===`end`))return ure(i,p,h);var g=m?dre(i):fre(i);return _.createElement(fE,OP({className:Ht(`recharts-label`,d)},h,g,{breakAll:f}),p)}kP.displayName=`Label`;var AP=function(e){var t=e.cx,n=e.cy,r=e.angle,i=e.startAngle,a=e.endAngle,o=e.r,s=e.radius,c=e.innerRadius,l=e.outerRadius,u=e.x,d=e.y,f=e.top,p=e.left,m=e.width,h=e.height,g=e.clockWise,_=e.labelViewBox;if(_)return _;if(Vy(m)&&Vy(h)){if(Vy(u)&&Vy(d))return{x:u,y:d,width:m,height:h};if(Vy(f)&&Vy(p))return{x:f,y:p,width:m,height:h}}return Vy(u)&&Vy(d)?{x:u,y:d,width:0,height:0}:Vy(t)&&Vy(n)?{cx:t,cy:n,startAngle:i||r||0,endAngle:a||r||0,innerRadius:c||0,outerRadius:l||s||o||0,clockWise:g}:e.viewBox?e.viewBox:{}},mre=function(e,t){return e?e===!0?_.createElement(kP,{key:`label-implicit`,viewBox:t}):Uy(e)?_.createElement(kP,{key:`label-implicit`,viewBox:t,value:e}):(0,_.isValidElement)(e)?e.type===kP?(0,_.cloneElement)(e,{key:`label-implicit`,viewBox:t}):_.createElement(kP,{key:`label-implicit`,content:e,viewBox:t}):(0,lb.default)(e)?_.createElement(kP,{key:`label-implicit`,content:e,viewBox:t}):(0,$y.default)(e)?_.createElement(kP,OP({viewBox:t},e,{key:`label-implicit`})):null:null};kP.parseViewBox=AP,kP.renderCallByParent=function(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,i=AP(e),a=xb(r,kP).map(function(e,n){return(0,_.cloneElement)(e,{viewBox:t||i,key:`label-${n}`})});return n?[mre(e.label,t||i)].concat(Qne(a)):a};var hre=l(o(((e,t)=>{function n(e){var t=e==null?0:e.length;return t?e[t-1]:void 0}t.exports=n}))());function jP(e){"@babel/helpers - typeof";return jP=typeof Symbol==`function`&&typeof Symbol.iterator==`symbol`?function(e){return typeof e}:function(e){return e&&typeof Symbol==`function`&&e.constructor===Symbol&&e!==Symbol.prototype?`symbol`:typeof e},jP(e)}var gre=[`valueAccessor`],_re=[`data`,`dataKey`,`clockWise`,`id`,`textBreakAll`];function vre(e){return Sre(e)||xre(e)||bre(e)||yre()}function yre(){throw TypeError(`Invalid attempt to spread non-iterable instance.
|
|
76
|
-
In order to be iterable, non-array objects must have a [Symbol.iterator]() method.`)}function bre(e,t){if(e){if(typeof e==`string`)return MP(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 MP(e,t)}}function xre(e){if(typeof Symbol<`u`&&e[Symbol.iterator]!=null||e[`@@iterator`]!=null)return Array.from(e)}function Sre(e){if(Array.isArray(e))return MP(e)}function MP(e,t){(t==null||t>e.length)&&(t=e.length);for(var n=0,r=Array(t);n<t;n++)r[n]=e[n];return r}function NP(){return NP=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},NP.apply(this,arguments)}function PP(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter(function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable})),n.push.apply(n,r)}return n}function FP(e){for(var t=1;t<arguments.length;t++){var n=arguments[t]==null?{}:arguments[t];t%2?PP(Object(n),!0).forEach(function(t){Cre(e,t,n[t])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):PP(Object(n)).forEach(function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(n,t))})}return e}function Cre(e,t,n){return t=wre(t),t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function wre(e){var t=Tre(e,`string`);return jP(t)==`symbol`?t:t+``}function Tre(e,t){if(jP(e)!=`object`||!e)return e;var n=e[Symbol.toPrimitive];if(n!==void 0){var r=n.call(e,t||`default`);if(jP(r)!=`object`)return r;throw TypeError(`@@toPrimitive must return a primitive value.`)}return(t===`string`?String:Number)(e)}function IP(e,t){if(e==null)return{};var n=Ere(e,t),r,i;if(Object.getOwnPropertySymbols){var a=Object.getOwnPropertySymbols(e);for(i=0;i<a.length;i++)r=a[i],!(t.indexOf(r)>=0)&&Object.prototype.propertyIsEnumerable.call(e,r)&&(n[r]=e[r])}return n}function Ere(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 Dre=function(e){return Array.isArray(e.value)?(0,hre.default)(e.value):e.value};function LP(e){var t=e.valueAccessor,n=t===void 0?Dre:t,r=IP(e,gre),i=r.data,a=r.dataKey,o=r.clockWise,s=r.id,c=r.textBreakAll,l=IP(r,_re);return!i||!i.length?null:_.createElement(Ub,{className:`recharts-label-list`},i.map(function(e,t){var r=(0,Ry.default)(a)?n(e,t):LN(e&&e.payload,a),i=(0,Ry.default)(s)?{}:{id:`${s}-${t}`};return _.createElement(kP,NP({},Ob(e,!0),l,i,{parentViewBox:e.parentViewBox,value:r,textBreakAll:c,viewBox:kP.parseViewBox((0,Ry.default)(o)?e:FP(FP({},e),{},{clockWise:o})),key:`label-${t}`,index:t}))}))}LP.displayName=`LabelList`;function Ore(e,t){return e?e===!0?_.createElement(LP,{key:`labelList-implicit`,data:t}):_.isValidElement(e)||(0,lb.default)(e)?_.createElement(LP,{key:`labelList-implicit`,data:t,content:e}):(0,$y.default)(e)?_.createElement(LP,NP({data:t},e,{key:`labelList-implicit`})):null:null}function kre(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,i=xb(r,LP).map(function(e,n){return(0,_.cloneElement)(e,{data:t,key:`labelList-${n}`})});return n?[Ore(e.label,t)].concat(vre(i)):i}LP.renderCallByParent=kre;function RP(e){"@babel/helpers - typeof";return RP=typeof Symbol==`function`&&typeof Symbol.iterator==`symbol`?function(e){return typeof e}:function(e){return e&&typeof Symbol==`function`&&e.constructor===Symbol&&e!==Symbol.prototype?`symbol`:typeof e},RP(e)}function zP(){return zP=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},zP.apply(this,arguments)}function BP(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter(function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable})),n.push.apply(n,r)}return n}function VP(e){for(var t=1;t<arguments.length;t++){var n=arguments[t]==null?{}:arguments[t];t%2?BP(Object(n),!0).forEach(function(t){Are(e,t,n[t])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):BP(Object(n)).forEach(function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(n,t))})}return e}function Are(e,t,n){return t=jre(t),t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function jre(e){var t=Mre(e,`string`);return RP(t)==`symbol`?t:t+``}function Mre(e,t){if(RP(e)!=`object`||!e)return e;var n=e[Symbol.toPrimitive];if(n!==void 0){var r=n.call(e,t||`default`);if(RP(r)!=`object`)return r;throw TypeError(`@@toPrimitive must return a primitive value.`)}return(t===`string`?String:Number)(e)}var Nre=function(e,t){return zy(t-e)*Math.min(Math.abs(t-e),359.999)},HP=function(e){var t=e.cx,n=e.cy,r=e.radius,i=e.angle,a=e.sign,o=e.isExternal,s=e.cornerRadius,c=e.cornerIsExternal,l=s*(o?1:-1)+r,u=Math.asin(s/l)/yP,d=c?i:i+a*u,f=bP(t,n,l,d),p=bP(t,n,r,d),m=c?i-a*u:i;return{center:f,circleTangency:p,lineTangency:bP(t,n,l*Math.cos(u*yP),m),theta:u}},UP=function(e){var t=e.cx,n=e.cy,r=e.innerRadius,i=e.outerRadius,a=e.startAngle,o=e.endAngle,s=Nre(a,o),c=a+s,l=bP(t,n,i,a),u=bP(t,n,i,c),d=`M ${l.x},${l.y}
|
|
77
|
-
A ${i},${i},0,
|
|
78
|
-
${+(Math.abs(s)>180)},${+(a>c)},
|
|
79
|
-
${u.x},${u.y}
|
|
80
|
-
`;if(r>0){var f=bP(t,n,r,a),p=bP(t,n,r,c);d+=`L ${p.x},${p.y}
|
|
81
|
-
A ${r},${r},0,
|
|
82
|
-
${+(Math.abs(s)>180)},${+(a<=c)},
|
|
83
|
-
${f.x},${f.y} Z`}else d+=`L ${t},${n} Z`;return d},Pre=function(e){var t=e.cx,n=e.cy,r=e.innerRadius,i=e.outerRadius,a=e.cornerRadius,o=e.forceCornerRadius,s=e.cornerIsExternal,c=e.startAngle,l=e.endAngle,u=zy(l-c),d=HP({cx:t,cy:n,radius:i,angle:c,sign:u,cornerRadius:a,cornerIsExternal:s}),f=d.circleTangency,p=d.lineTangency,m=d.theta,h=HP({cx:t,cy:n,radius:i,angle:l,sign:-u,cornerRadius:a,cornerIsExternal:s}),g=h.circleTangency,_=h.lineTangency,v=h.theta,y=s?Math.abs(c-l):Math.abs(c-l)-m-v;if(y<0)return o?`M ${p.x},${p.y}
|
|
84
|
-
a${a},${a},0,0,1,${a*2},0
|
|
85
|
-
a${a},${a},0,0,1,${-a*2},0
|
|
86
|
-
`:UP({cx:t,cy:n,innerRadius:r,outerRadius:i,startAngle:c,endAngle:l});var b=`M ${p.x},${p.y}
|
|
87
|
-
A${a},${a},0,0,${+(u<0)},${f.x},${f.y}
|
|
88
|
-
A${i},${i},0,${+(y>180)},${+(u<0)},${g.x},${g.y}
|
|
89
|
-
A${a},${a},0,0,${+(u<0)},${_.x},${_.y}
|
|
90
|
-
`;if(r>0){var x=HP({cx:t,cy:n,radius:r,angle:c,sign:u,isExternal:!0,cornerRadius:a,cornerIsExternal:s}),S=x.circleTangency,C=x.lineTangency,w=x.theta,T=HP({cx:t,cy:n,radius:r,angle:l,sign:-u,isExternal:!0,cornerRadius:a,cornerIsExternal:s}),E=T.circleTangency,D=T.lineTangency,O=T.theta,k=s?Math.abs(c-l):Math.abs(c-l)-w-O;if(k<0&&a===0)return`${b}L${t},${n}Z`;b+=`L${D.x},${D.y}
|
|
91
|
-
A${a},${a},0,0,${+(u<0)},${E.x},${E.y}
|
|
92
|
-
A${r},${r},0,${+(k>180)},${+(u>0)},${S.x},${S.y}
|
|
93
|
-
A${a},${a},0,0,${+(u<0)},${C.x},${C.y}Z`}else b+=`L${t},${n}Z`;return b},Fre={cx:0,cy:0,innerRadius:0,outerRadius:0,startAngle:0,endAngle:0,cornerRadius:0,forceCornerRadius:!1,cornerIsExternal:!1},WP=function(e){var t=VP(VP({},Fre),e),n=t.cx,r=t.cy,i=t.innerRadius,a=t.outerRadius,o=t.cornerRadius,s=t.forceCornerRadius,c=t.cornerIsExternal,l=t.startAngle,u=t.endAngle,d=t.className;if(a<i||l===u)return null;var f=Ht(`recharts-sector`,d),p=a-i,m=Ky(o,p,0,!0),h=m>0&&Math.abs(l-u)<360?Pre({cx:n,cy:r,innerRadius:i,outerRadius:a,cornerRadius:Math.min(m,p/2),forceCornerRadius:s,cornerIsExternal:c,startAngle:l,endAngle:u}):UP({cx:n,cy:r,innerRadius:i,outerRadius:a,startAngle:l,endAngle:u});return _.createElement(`path`,zP({},Ob(t,!0),{className:f,d:h,role:`img`}))};function GP(e){"@babel/helpers - typeof";return GP=typeof Symbol==`function`&&typeof Symbol.iterator==`symbol`?function(e){return typeof e}:function(e){return e&&typeof Symbol==`function`&&e.constructor===Symbol&&e!==Symbol.prototype?`symbol`:typeof e},GP(e)}function KP(){return KP=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},KP.apply(this,arguments)}function qP(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter(function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable})),n.push.apply(n,r)}return n}function JP(e){for(var t=1;t<arguments.length;t++){var n=arguments[t]==null?{}:arguments[t];t%2?qP(Object(n),!0).forEach(function(t){Ire(e,t,n[t])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):qP(Object(n)).forEach(function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(n,t))})}return e}function Ire(e,t,n){return t=Lre(t),t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function Lre(e){var t=Rre(e,`string`);return GP(t)==`symbol`?t:t+``}function Rre(e,t){if(GP(e)!=`object`||!e)return e;var n=e[Symbol.toPrimitive];if(n!==void 0){var r=n.call(e,t||`default`);if(GP(r)!=`object`)return r;throw TypeError(`@@toPrimitive must return a primitive value.`)}return(t===`string`?String:Number)(e)}var YP={curveBasisClosed:Kx,curveBasisOpen:Jx,curveBasis:Wx,curveBumpX:bx,curveBumpY:xx,curveLinearClosed:Xx,curveLinear:mx,curveMonotoneX:iS,curveMonotoneY:aS,curveNatural:cS,curveStep:uS,curveStepAfter:fS,curveStepBefore:dS},XP=function(e){return e.x===+e.x&&e.y===+e.y},ZP=function(e){return e.x},QP=function(e){return e.y},zre=function(e,t){if((0,lb.default)(e))return e;var n=`curve${(0,xS.default)(e)}`;return(n===`curveMonotone`||n===`curveBump`)&&t?YP[`${n}${t===`vertical`?`Y`:`X`}`]:YP[n]||mx},Bre=function(e){var t=e.type,n=t===void 0?`linear`:t,r=e.points,i=r===void 0?[]:r,a=e.baseLine,o=e.layout,s=e.connectNulls,c=s!==void 0&&s,l=zre(n,o),u=c?i.filter(function(e){return XP(e)}):i,d;if(Array.isArray(a)){var f=c?a.filter(function(e){return XP(e)}):a,p=u.map(function(e,t){return JP(JP({},e),{},{base:f[t]})});return d=o===`vertical`?vx().y(QP).x1(ZP).x0(function(e){return e.base.x}):vx().x(ZP).y1(QP).y0(function(e){return e.base.y}),d.defined(XP).curve(l),d(p)}return d=o===`vertical`&&Vy(a)?vx().y(QP).x1(ZP).x0(a):Vy(a)?vx().x(ZP).y1(QP).y0(a):_x().x(ZP).y(QP),d.defined(XP).curve(l),d(u)},$P=function(e){var t=e.className,n=e.points,r=e.path,i=e.pathRef;if((!n||!n.length)&&!r)return null;var a=n&&n.length?Bre(e):r;return _.createElement(`path`,KP({},Ob(e,!1),ob(e),{className:Ht(`recharts-curve`,t),d:a,ref:i}))},Vre=o(((e,t)=>{t.exports=`SECRET_DO_NOT_PASS_THIS_OR_YOU_WILL_BE_FIRED`})),Hre=o(((e,t)=>{var n=Vre();function r(){}function i(){}i.resetWarningCache=r,t.exports=function(){function e(e,t,r,i,a,o){if(o!==n){var s=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 s.name=`Invariant Violation`,s}}e.isRequired=e;function t(){return e}var a={array:e,bigint:e,bool:e,func:e,number:e,object:e,string:e,symbol:e,any:e,arrayOf:t,element:e,elementType:e,instanceOf:t,node:e,objectOf:t,oneOf:t,oneOfType:t,shape:t,exact:t,checkPropTypes:i,resetWarningCache:r};return a.PropTypes=a,a}})),Ure=o(((e,t)=>{t.exports=Hre()()})),{getOwnPropertyNames:Wre,getOwnPropertySymbols:Gre}=Object,{hasOwnProperty:Kre}=Object.prototype;function eF(e,t){return function(n,r,i){return e(n,r,i)&&t(n,r,i)}}function tF(e){return function(t,n,r){if(!t||!n||typeof t!=`object`||typeof n!=`object`)return e(t,n,r);let{cache:i}=r,a=i.get(t),o=i.get(n);if(a&&o)return a===n&&o===t;i.set(t,n),i.set(n,t);let s=e(t,n,r);return i.delete(t),i.delete(n),s}}function qre(e){return e?.[Symbol.toStringTag]}function nF(e){return Wre(e).concat(Gre(e))}var Jre=Object.hasOwn||((e,t)=>Kre.call(e,t));function rF(e,t){return e===t||!e&&!t&&e!==e&&t!==t}var Yre=`__v`,Xre=`__o`,Zre=`_owner`,{getOwnPropertyDescriptor:iF,keys:aF}=Object;function Qre(e,t){return e.byteLength===t.byteLength&&lF(new Uint8Array(e),new Uint8Array(t))}function $re(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 eie(e,t){return e.byteLength===t.byteLength&&lF(new Uint8Array(e.buffer,e.byteOffset,e.byteLength),new Uint8Array(t.buffer,t.byteOffset,t.byteLength))}function tie(e,t){return rF(e.getTime(),t.getTime())}function nie(e,t){return e.name===t.name&&e.message===t.message&&e.cause===t.cause&&e.stack===t.stack}function rie(e,t){return e===t}function oF(e,t,n){let r=e.size;if(r!==t.size)return!1;if(!r)return!0;let i=Array(r),a=e.entries(),o,s,c=0;for(;(o=a.next())&&!o.done;){let r=t.entries(),a=!1,l=0;for(;(s=r.next())&&!s.done;){if(i[l]){l++;continue}let r=o.value,u=s.value;if(n.equals(r[0],u[0],c,l,e,t,n)&&n.equals(r[1],u[1],r[0],u[0],e,t,n)){a=i[l]=!0;break}l++}if(!a)return!1;c++}return!0}var iie=rF;function aie(e,t,n){let r=aF(e),i=r.length;if(aF(t).length!==i)return!1;for(;i-->0;)if(!uF(e,t,n,r[i]))return!1;return!0}function sF(e,t,n){let r=nF(e),i=r.length;if(nF(t).length!==i)return!1;let a,o,s;for(;i-->0;)if(a=r[i],!uF(e,t,n,a)||(o=iF(e,a),s=iF(t,a),(o||s)&&(!o||!s||o.configurable!==s.configurable||o.enumerable!==s.enumerable||o.writable!==s.writable)))return!1;return!0}function oie(e,t){return rF(e.valueOf(),t.valueOf())}function sie(e,t){return e.source===t.source&&e.flags===t.flags}function cF(e,t,n){let r=e.size;if(r!==t.size)return!1;if(!r)return!0;let i=Array(r),a=e.values(),o,s;for(;(o=a.next())&&!o.done;){let r=t.values(),a=!1,c=0;for(;(s=r.next())&&!s.done;){if(!i[c]&&n.equals(o.value,s.value,o.value,s.value,e,t,n)){a=i[c]=!0;break}c++}if(!a)return!1}return!0}function lF(e,t){let n=e.byteLength;if(t.byteLength!==n||e.byteOffset!==t.byteOffset)return!1;for(;n-->0;)if(e[n]!==t[n])return!1;return!0}function cie(e,t){return e.hostname===t.hostname&&e.pathname===t.pathname&&e.protocol===t.protocol&&e.port===t.port&&e.hash===t.hash&&e.username===t.username&&e.password===t.password}function uF(e,t,n,r){return(r===Zre||r===Xre||r===Yre)&&(e.$$typeof||t.$$typeof)?!0:Jre(t,r)&&n.equals(e[r],t[r],r,r,e,t,n)}var lie=`[object ArrayBuffer]`,uie=`[object Arguments]`,die=`[object Boolean]`,fie=`[object DataView]`,pie=`[object Date]`,mie=`[object Error]`,hie=`[object Map]`,gie=`[object Number]`,_ie=`[object Object]`,vie=`[object RegExp]`,yie=`[object Set]`,bie=`[object String]`,xie={"[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},Sie=`[object URL]`,Cie=Object.prototype.toString;function wie({areArrayBuffersEqual:e,areArraysEqual:t,areDataViewsEqual:n,areDatesEqual:r,areErrorsEqual:i,areFunctionsEqual:a,areMapsEqual:o,areNumbersEqual:s,areObjectsEqual:c,arePrimitiveWrappersEqual:l,areRegExpsEqual:u,areSetsEqual:d,areTypedArraysEqual:f,areUrlsEqual:p,unknownTagComparators:m}){return function(h,g,_){if(h===g)return!0;if(h==null||g==null)return!1;let v=typeof h;if(v!==typeof g)return!1;if(v!==`object`)return v===`number`?s(h,g,_):v===`function`&&a(h,g,_);let y=h.constructor;if(y!==g.constructor)return!1;if(y===Object)return c(h,g,_);if(Array.isArray(h))return t(h,g,_);if(y===Date)return r(h,g,_);if(y===RegExp)return u(h,g,_);if(y===Map)return o(h,g,_);if(y===Set)return d(h,g,_);let b=Cie.call(h);if(b===pie)return r(h,g,_);if(b===vie)return u(h,g,_);if(b===hie)return o(h,g,_);if(b===yie)return d(h,g,_);if(b===_ie)return typeof h.then!=`function`&&typeof g.then!=`function`&&c(h,g,_);if(b===Sie)return p(h,g,_);if(b===mie)return i(h,g,_);if(b===uie)return c(h,g,_);if(xie[b])return f(h,g,_);if(b===lie)return e(h,g,_);if(b===fie)return n(h,g,_);if(b===die||b===gie||b===bie)return l(h,g,_);if(m){let e=m[b];if(!e){let t=qre(h);t&&(e=m[t])}if(e)return e(h,g,_)}return!1}}function Tie({circular:e,createCustomConfig:t,strict:n}){let r={areArrayBuffersEqual:Qre,areArraysEqual:n?sF:$re,areDataViewsEqual:eie,areDatesEqual:tie,areErrorsEqual:nie,areFunctionsEqual:rie,areMapsEqual:n?eF(oF,sF):oF,areNumbersEqual:iie,areObjectsEqual:n?sF:aie,arePrimitiveWrappersEqual:oie,areRegExpsEqual:sie,areSetsEqual:n?eF(cF,sF):cF,areTypedArraysEqual:n?eF(lF,sF):lF,areUrlsEqual:cie,unknownTagComparators:void 0};if(t&&(r=Object.assign({},r,t(r))),e){let e=tF(r.areArraysEqual),t=tF(r.areMapsEqual),n=tF(r.areObjectsEqual),i=tF(r.areSetsEqual);r=Object.assign({},r,{areArraysEqual:e,areMapsEqual:t,areObjectsEqual:n,areSetsEqual:i})}return r}function Eie(e){return function(t,n,r,i,a,o,s){return e(t,n,s)}}function Die({circular:e,comparator:t,createState:n,equals:r,strict:i}){if(n)return function(a,o){let{cache:s=e?new WeakMap:void 0,meta:c}=n();return t(a,o,{cache:s,equals:r,meta:c,strict:i})};if(e)return function(e,n){return t(e,n,{cache:new WeakMap,equals:r,meta:void 0,strict:i})};let a={cache:void 0,equals:r,meta:void 0,strict:i};return function(e,n){return t(e,n,a)}}var Oie=dF();dF({strict:!0}),dF({circular:!0}),dF({circular:!0,strict:!0}),dF({createInternalComparator:()=>rF}),dF({strict:!0,createInternalComparator:()=>rF}),dF({circular:!0,createInternalComparator:()=>rF}),dF({circular:!0,createInternalComparator:()=>rF,strict:!0});function dF(e={}){let{circular:t=!1,createInternalComparator:n,createState:r,strict:i=!1}=e,a=wie(Tie(e));return Die({circular:t,comparator:a,createState:r,equals:n?n(a):Eie(a),strict:i})}function kie(e){typeof requestAnimationFrame<`u`&&requestAnimationFrame(e)}function fF(e){var t=arguments.length>1&&arguments[1]!==void 0?arguments[1]:0,n=-1;requestAnimationFrame(function r(i){n<0&&(n=i),i-n>t?(e(i),n=-1):kie(r)})}function pF(e){"@babel/helpers - typeof";return pF=typeof Symbol==`function`&&typeof Symbol.iterator==`symbol`?function(e){return typeof e}:function(e){return e&&typeof Symbol==`function`&&e.constructor===Symbol&&e!==Symbol.prototype?`symbol`:typeof e},pF(e)}function Aie(e){return Pie(e)||Nie(e)||Mie(e)||jie()}function jie(){throw TypeError(`Invalid attempt to destructure non-iterable instance.
|
|
94
|
-
In order to be iterable, non-array objects must have a [Symbol.iterator]() method.`)}function Mie(e,t){if(e){if(typeof e==`string`)return mF(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 mF(e,t)}}function mF(e,t){(t==null||t>e.length)&&(t=e.length);for(var n=0,r=Array(t);n<t;n++)r[n]=e[n];return r}function Nie(e){if(typeof Symbol<`u`&&e[Symbol.iterator]!=null||e[`@@iterator`]!=null)return Array.from(e)}function Pie(e){if(Array.isArray(e))return e}function Fie(){var e={},t=function(){return null},n=!1,r=function r(i){if(!n){if(Array.isArray(i)){if(!i.length)return;var a=Aie(i),o=a[0],s=a.slice(1);if(typeof o==`number`){fF(r.bind(null,s),o);return}r(o),fF(r.bind(null,s))}else pF(i)===`object`&&(e=i,t(e)),typeof i==`function`&&i()}};return{stop:function(){n=!0},start:function(e){n=!1,r(e)},subscribe:function(e){return t=e,function(){t=function(){return null}}}}}function hF(e){"@babel/helpers - typeof";return hF=typeof Symbol==`function`&&typeof Symbol.iterator==`symbol`?function(e){return typeof e}:function(e){return e&&typeof Symbol==`function`&&e.constructor===Symbol&&e!==Symbol.prototype?`symbol`:typeof e},hF(e)}function gF(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter(function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable})),n.push.apply(n,r)}return n}function _F(e){for(var t=1;t<arguments.length;t++){var n=arguments[t]==null?{}:arguments[t];t%2?gF(Object(n),!0).forEach(function(t){vF(e,t,n[t])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):gF(Object(n)).forEach(function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(n,t))})}return e}function vF(e,t,n){return t=Iie(t),t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function Iie(e){var t=Lie(e,`string`);return hF(t)===`symbol`?t:String(t)}function Lie(e,t){if(hF(e)!==`object`||e===null)return e;var n=e[Symbol.toPrimitive];if(n!==void 0){var r=n.call(e,t||`default`);if(hF(r)!==`object`)return r;throw TypeError(`@@toPrimitive must return a primitive value.`)}return(t===`string`?String:Number)(e)}var Rie=function(e,t){return[Object.keys(e),Object.keys(t)].reduce(function(e,t){return e.filter(function(e){return t.includes(e)})})},zie=function(e){return e},Bie=function(e){return e.replace(/([A-Z])/g,function(e){return`-${e.toLowerCase()}`})},yF=function(e,t){return Object.keys(t).reduce(function(n,r){return _F(_F({},n),{},vF({},r,e(r,t[r])))},{})},bF=function(e,t,n){return e.map(function(e){return`${Bie(e)} ${t}ms ${n}`}).join(`,`)};function Vie(e,t){return Wie(e)||Uie(e,t)||xF(e,t)||Hie()}function Hie(){throw TypeError(`Invalid attempt to destructure non-iterable instance.
|
|
95
|
-
In order to be iterable, non-array objects must have a [Symbol.iterator]() method.`)}function Uie(e,t){var n=e==null?null:typeof Symbol<`u`&&e[Symbol.iterator]||e[`@@iterator`];if(n!=null){var r,i,a,o,s=[],c=!0,l=!1;try{if(a=(n=n.call(e)).next,t===0){if(Object(n)!==n)return;c=!1}else for(;!(c=(r=a.call(n)).done)&&(s.push(r.value),s.length!==t);c=!0);}catch(e){l=!0,i=e}finally{try{if(!c&&n.return!=null&&(o=n.return(),Object(o)!==o))return}finally{if(l)throw i}}return s}}function Wie(e){if(Array.isArray(e))return e}function Gie(e){return Jie(e)||qie(e)||xF(e)||Kie()}function Kie(){throw TypeError(`Invalid attempt to spread non-iterable instance.
|
|
96
|
-
In order to be iterable, non-array objects must have a [Symbol.iterator]() method.`)}function xF(e,t){if(e){if(typeof e==`string`)return SF(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 SF(e,t)}}function qie(e){if(typeof Symbol<`u`&&e[Symbol.iterator]!=null||e[`@@iterator`]!=null)return Array.from(e)}function Jie(e){if(Array.isArray(e))return SF(e)}function SF(e,t){(t==null||t>e.length)&&(t=e.length);for(var n=0,r=Array(t);n<t;n++)r[n]=e[n];return r}var CF=1e-4,wF=function(e,t){return[0,3*e,3*t-6*e,3*e-3*t+1]},TF=function(e,t){return e.map(function(e,n){return e*t**+n}).reduce(function(e,t){return e+t})},EF=function(e,t){return function(n){return TF(wF(e,t),n)}},Yie=function(e,t){return function(n){var r=wF(e,t);return TF([].concat(Gie(r.map(function(e,t){return e*t}).slice(1)),[0]),n)}},DF=function(){var e=[...arguments],t=e[0],n=e[1],r=e[2],i=e[3];if(e.length===1)switch(e[0]){case`linear`:t=0,n=0,r=1,i=1;break;case`ease`:t=.25,n=.1,r=.25,i=1;break;case`ease-in`:t=.42,n=0,r=1,i=1;break;case`ease-out`:t=.42,n=0,r=.58,i=1;break;case`ease-in-out`:t=0,n=0,r=.58,i=1;break;default:var a=e[0].split(`(`);if(a[0]===`cubic-bezier`&&a[1].split(`)`)[0].split(`,`).length===4){var o=Vie(a[1].split(`)`)[0].split(`,`).map(function(e){return parseFloat(e)}),4);t=o[0],n=o[1],r=o[2],i=o[3]}}[t,r,n,i].every(function(e){return typeof e==`number`&&e>=0&&e<=1});var s=EF(t,r),c=EF(n,i),l=Yie(t,r),u=function(e){return e>1?1:e<0?0:e},d=function(e){for(var t=e>1?1:e,n=t,r=0;r<8;++r){var i=s(n)-t,a=l(n);if(Math.abs(i-t)<CF||a<CF)return c(n);n=u(n-i/a)}return c(n)};return d.isStepper=!1,d},Xie=function(){var e=arguments.length>0&&arguments[0]!==void 0?arguments[0]:{},t=e.stiff,n=t===void 0?100:t,r=e.damping,i=r===void 0?8:r,a=e.dt,o=a===void 0?17:a,s=function(e,t,r){var a=r+(-(e-t)*n-r*i)*o/1e3,s=r*o/1e3+e;return Math.abs(s-t)<CF&&Math.abs(a)<CF?[t,0]:[s,a]};return s.isStepper=!0,s.dt=o,s},Zie=function(){var e=[...arguments][0];if(typeof e==`string`)switch(e){case`ease`:case`ease-in-out`:case`ease-out`:case`ease-in`:case`linear`:return DF(e);case`spring`:return Xie();default:if(e.split(`(`)[0]===`cubic-bezier`)return DF(e)}return typeof e==`function`?e:null};function OF(e){"@babel/helpers - typeof";return OF=typeof Symbol==`function`&&typeof Symbol.iterator==`symbol`?function(e){return typeof e}:function(e){return e&&typeof Symbol==`function`&&e.constructor===Symbol&&e!==Symbol.prototype?`symbol`:typeof e},OF(e)}function kF(e){return eae(e)||$ie(e)||NF(e)||Qie()}function Qie(){throw TypeError(`Invalid attempt to spread non-iterable instance.
|
|
97
|
-
In order to be iterable, non-array objects must have a [Symbol.iterator]() method.`)}function $ie(e){if(typeof Symbol<`u`&&e[Symbol.iterator]!=null||e[`@@iterator`]!=null)return Array.from(e)}function eae(e){if(Array.isArray(e))return PF(e)}function AF(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter(function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable})),n.push.apply(n,r)}return n}function jF(e){for(var t=1;t<arguments.length;t++){var n=arguments[t]==null?{}:arguments[t];t%2?AF(Object(n),!0).forEach(function(t){MF(e,t,n[t])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):AF(Object(n)).forEach(function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(n,t))})}return e}function MF(e,t,n){return t=tae(t),t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function tae(e){var t=nae(e,`string`);return OF(t)===`symbol`?t:String(t)}function nae(e,t){if(OF(e)!==`object`||e===null)return e;var n=e[Symbol.toPrimitive];if(n!==void 0){var r=n.call(e,t||`default`);if(OF(r)!==`object`)return r;throw TypeError(`@@toPrimitive must return a primitive value.`)}return(t===`string`?String:Number)(e)}function rae(e,t){return oae(e)||aae(e,t)||NF(e,t)||iae()}function iae(){throw TypeError(`Invalid attempt to destructure non-iterable instance.
|
|
98
|
-
In order to be iterable, non-array objects must have a [Symbol.iterator]() method.`)}function NF(e,t){if(e){if(typeof e==`string`)return PF(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 PF(e,t)}}function PF(e,t){(t==null||t>e.length)&&(t=e.length);for(var n=0,r=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,i,a,o,s=[],c=!0,l=!1;try{if(a=(n=n.call(e)).next,t===0){if(Object(n)!==n)return;c=!1}else for(;!(c=(r=a.call(n)).done)&&(s.push(r.value),s.length!==t);c=!0);}catch(e){l=!0,i=e}finally{try{if(!c&&n.return!=null&&(o=n.return(),Object(o)!==o))return}finally{if(l)throw i}}return s}}function oae(e){if(Array.isArray(e))return e}var FF=function(e,t,n){return e+(t-e)*n},IF=function(e){return e.from!==e.to},sae=function e(t,n,r){var i=yF(function(e,n){if(IF(n)){var r=rae(t(n.from,n.to,n.velocity),2),i=r[0],a=r[1];return jF(jF({},n),{},{from:i,velocity:a})}return n},n);return r<1?yF(function(e,t){return IF(t)?jF(jF({},t),{},{velocity:FF(t.velocity,i[e].velocity,r),from:FF(t.from,i[e].from,r)}):t},n):e(t,i,r-1)},cae=(function(e,t,n,r,i){var a=Rie(e,t),o=a.reduce(function(n,r){return jF(jF({},n),{},MF({},r,[e[r],t[r]]))},{}),s=a.reduce(function(n,r){return jF(jF({},n),{},MF({},r,{from:e[r],velocity:0,to:t[r]}))},{}),c=-1,l,u,d=function(){return null},f=function(){return yF(function(e,t){return t.from},s)},p=function(){return!Object.values(s).filter(IF).length};return d=n.isStepper?function(r){l||=r;var a=(r-l)/n.dt;s=sae(n,s,a),i(jF(jF(jF({},e),t),f(s))),l=r,p()||(c=requestAnimationFrame(d))}:function(a){u||=a;var s=(a-u)/r,l=yF(function(e,t){return FF.apply(void 0,kF(t).concat([n(s)]))},o);if(i(jF(jF(jF({},e),t),l)),s<1)c=requestAnimationFrame(d);else{var f=yF(function(e,t){return FF.apply(void 0,kF(t).concat([n(1)]))},o);i(jF(jF(jF({},e),t),f))}},function(){return requestAnimationFrame(d),function(){cancelAnimationFrame(c)}}}),LF=l(Ure());function RF(e){"@babel/helpers - typeof";return RF=typeof Symbol==`function`&&typeof Symbol.iterator==`symbol`?function(e){return typeof e}:function(e){return e&&typeof Symbol==`function`&&e.constructor===Symbol&&e!==Symbol.prototype?`symbol`:typeof e},RF(e)}var lae=[`children`,`begin`,`duration`,`attributeName`,`easing`,`isActive`,`steps`,`from`,`to`,`canBegin`,`onAnimationEnd`,`shouldReAnimate`,`onAnimationReStart`];function uae(e,t){if(e==null)return{};var n=dae(e,t),r,i;if(Object.getOwnPropertySymbols){var a=Object.getOwnPropertySymbols(e);for(i=0;i<a.length;i++)r=a[i],!(t.indexOf(r)>=0)&&Object.prototype.propertyIsEnumerable.call(e,r)&&(n[r]=e[r])}return n}function dae(e,t){if(e==null)return{};for(var n={},r=Object.keys(e),i,a=0;a<r.length;a++)i=r[a],!(t.indexOf(i)>=0)&&(n[i]=e[i]);return n}function zF(e){return hae(e)||mae(e)||pae(e)||fae()}function fae(){throw TypeError(`Invalid attempt to spread non-iterable instance.
|
|
99
|
-
In order to be iterable, non-array objects must have a [Symbol.iterator]() method.`)}function pae(e,t){if(e){if(typeof e==`string`)return BF(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 BF(e,t)}}function mae(e){if(typeof Symbol<`u`&&e[Symbol.iterator]!=null||e[`@@iterator`]!=null)return Array.from(e)}function hae(e){if(Array.isArray(e))return BF(e)}function BF(e,t){(t==null||t>e.length)&&(t=e.length);for(var n=0,r=Array(t);n<t;n++)r[n]=e[n];return r}function VF(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter(function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable})),n.push.apply(n,r)}return n}function HF(e){for(var t=1;t<arguments.length;t++){var n=arguments[t]==null?{}:arguments[t];t%2?VF(Object(n),!0).forEach(function(t){UF(e,t,n[t])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):VF(Object(n)).forEach(function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(n,t))})}return e}function UF(e,t,n){return t=GF(t),t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function gae(e,t){if(!(e instanceof t))throw TypeError(`Cannot call a class as a function`)}function WF(e,t){for(var n=0;n<t.length;n++){var r=t[n];r.enumerable=r.enumerable||!1,r.configurable=!0,`value`in r&&(r.writable=!0),Object.defineProperty(e,GF(r.key),r)}}function _ae(e,t,n){return t&&WF(e.prototype,t),n&&WF(e,n),Object.defineProperty(e,"prototype",{writable:!1}),e}function GF(e){var t=vae(e,`string`);return RF(t)===`symbol`?t:String(t)}function vae(e,t){if(RF(e)!==`object`||e===null)return e;var n=e[Symbol.toPrimitive];if(n!==void 0){var r=n.call(e,t||`default`);if(RF(r)!==`object`)return r;throw TypeError(`@@toPrimitive must return a primitive value.`)}return(t===`string`?String:Number)(e)}function yae(e,t){if(typeof t!=`function`&&t!==null)throw 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&&KF(e,t)}function KF(e,t){return KF=Object.setPrototypeOf?Object.setPrototypeOf.bind():function(e,t){return e.__proto__=t,e},KF(e,t)}function bae(e){var t=xae();return function(){var n=YF(e),r;if(t){var i=YF(this).constructor;r=Reflect.construct(n,arguments,i)}else r=n.apply(this,arguments);return qF(this,r)}}function qF(e,t){if(t&&(RF(t)===`object`||typeof t==`function`))return t;if(t!==void 0)throw TypeError(`Derived constructors may only return object or undefined`);return JF(e)}function JF(e){if(e===void 0)throw ReferenceError(`this hasn't been initialised - super() hasn't been called`);return e}function xae(){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 YF(e){return YF=Object.setPrototypeOf?Object.getPrototypeOf.bind():function(e){return e.__proto__||Object.getPrototypeOf(e)},YF(e)}var XF=function(e){yae(n,e);var t=bae(n);function n(e,r){var i;gae(this,n),i=t.call(this,e,r);var a=i.props,o=a.isActive,s=a.attributeName,c=a.from,l=a.to,u=a.steps,d=a.children,f=a.duration;if(i.handleStyleChange=i.handleStyleChange.bind(JF(i)),i.changeStyle=i.changeStyle.bind(JF(i)),!o||f<=0)return i.state={style:{}},typeof d==`function`&&(i.state={style:l}),qF(i);if(u&&u.length)i.state={style:u[0].style};else if(c){if(typeof d==`function`)return i.state={style:c},qF(i);i.state={style:s?UF({},s,c):c}}else i.state={style:{}};return i}return _ae(n,[{key:`componentDidMount`,value:function(){var e=this.props,t=e.isActive,n=e.canBegin;this.mounted=!0,t&&n&&this.runAnimation(this.props)}},{key:`componentDidUpdate`,value:function(e){var t=this.props,n=t.isActive,r=t.canBegin,i=t.attributeName,a=t.shouldReAnimate,o=t.to,s=t.from,c=this.state.style;if(r){if(!n){var l={style:i?UF({},i,o):o};this.state&&c&&(i&&c[i]!==o||!i&&c!==o)&&this.setState(l)}else if(!(Oie(e.to,o)&&e.canBegin&&e.isActive)){var u=!e.canBegin||!e.isActive;this.manager&&this.manager.stop(),this.stopJSAnimation&&this.stopJSAnimation();var d=u||a?s:e.to;if(this.state&&c){var f={style:i?UF({},i,d):d};(i&&c[i]!==d||!i&&c!==d)&&this.setState(f)}this.runAnimation(HF(HF({},this.props),{},{from:d,begin:0}))}}}},{key:`componentWillUnmount`,value:function(){this.mounted=!1;var e=this.props.onAnimationEnd;this.unSubscribe&&this.unSubscribe(),this.manager&&=(this.manager.stop(),null),this.stopJSAnimation&&this.stopJSAnimation(),e&&e()}},{key:`handleStyleChange`,value:function(e){this.changeStyle(e)}},{key:`changeStyle`,value:function(e){this.mounted&&this.setState({style:e})}},{key:`runJSAnimation`,value:function(e){var t=this,n=e.from,r=e.to,i=e.duration,a=e.easing,o=e.begin,s=e.onAnimationEnd,c=e.onAnimationStart,l=cae(n,r,Zie(a),i,this.changeStyle);this.manager.start([c,o,function(){t.stopJSAnimation=l()},i,s])}},{key:`runStepAnimation`,value:function(e){var t=this,n=e.steps,r=e.begin,i=e.onAnimationStart,a=n[0],o=a.style,s=a.duration,c=s===void 0?0:s;return this.manager.start([i].concat(zF(n.reduce(function(e,r,i){if(i===0)return e;var a=r.duration,o=r.easing,s=o===void 0?`ease`:o,c=r.style,l=r.properties,u=r.onAnimationEnd,d=i>0?n[i-1]:r,f=l||Object.keys(c);if(typeof s==`function`||s===`spring`)return[].concat(zF(e),[t.runJSAnimation.bind(t,{from:d.style,to:c,duration:a,easing:s}),a]);var p=bF(f,a,s),m=HF(HF(HF({},d.style),c),{},{transition:p});return[].concat(zF(e),[m,a,u]).filter(zie)},[o,Math.max(c,r)])),[e.onAnimationEnd]))}},{key:`runAnimation`,value:function(e){this.manager||=Fie();var t=e.begin,n=e.duration,r=e.attributeName,i=e.to,a=e.easing,o=e.onAnimationStart,s=e.onAnimationEnd,c=e.steps,l=e.children,u=this.manager;if(this.unSubscribe=u.subscribe(this.handleStyleChange),typeof a==`function`||typeof l==`function`||a===`spring`)this.runJSAnimation(e);else if(c.length>1)this.runStepAnimation(e);else{var d=r?UF({},r,i):i,f=bF(Object.keys(d),n,a);u.start([o,t,HF(HF({},d),{},{transition:f}),n,s])}}},{key:`render`,value:function(){var e=this.props,t=e.children;e.begin;var n=e.duration;e.attributeName,e.easing;var r=e.isActive;e.steps,e.from,e.to,e.canBegin,e.onAnimationEnd,e.shouldReAnimate,e.onAnimationReStart;var i=uae(e,lae),a=_.Children.count(t),o=this.state.style;if(typeof t==`function`)return t(o);if(!r||a===0||n<=0)return t;var s=function(e){var t=e.props,n=t.style,r=n===void 0?{}:n,a=t.className;return(0,_.cloneElement)(e,HF(HF({},i),{},{style:HF(HF({},r),o),className:a}))};return a===1?s(_.Children.only(t)):_.createElement(`div`,null,_.Children.map(t,function(e){return s(e)}))}}]),n}(_.PureComponent);XF.displayName=`Animate`,XF.defaultProps={begin:0,duration:1e3,from:``,to:``,attributeName:``,easing:`ease`,isActive:!0,canBegin:!0,steps:[],onAnimationEnd:function(){},onAnimationStart:function(){}},XF.propTypes={from:LF.default.oneOfType([LF.default.object,LF.default.string]),to:LF.default.oneOfType([LF.default.object,LF.default.string]),attributeName:LF.default.string,duration:LF.default.number,begin:LF.default.number,easing:LF.default.oneOfType([LF.default.string,LF.default.func]),steps:LF.default.arrayOf(LF.default.shape({duration:LF.default.number.isRequired,style:LF.default.object.isRequired,easing:LF.default.oneOfType([LF.default.oneOf([`ease`,`ease-in`,`ease-out`,`ease-in-out`,`linear`]),LF.default.func]),properties:LF.default.arrayOf(`string`),onAnimationEnd:LF.default.func})),children:LF.default.oneOfType([LF.default.node,LF.default.func]),isActive:LF.default.bool,canBegin:LF.default.bool,onAnimationEnd:LF.default.func,shouldReAnimate:LF.default.bool,onAnimationStart:LF.default.func,onAnimationReStart:LF.default.func};var ZF=XF;function QF(e){"@babel/helpers - typeof";return QF=typeof Symbol==`function`&&typeof Symbol.iterator==`symbol`?function(e){return typeof e}:function(e){return e&&typeof Symbol==`function`&&e.constructor===Symbol&&e!==Symbol.prototype?`symbol`:typeof e},QF(e)}function $F(){return $F=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},$F.apply(this,arguments)}function Sae(e,t){return Eae(e)||Tae(e,t)||wae(e,t)||Cae()}function Cae(){throw TypeError(`Invalid attempt to destructure non-iterable instance.
|
|
100
|
-
In order to be iterable, non-array objects must have a [Symbol.iterator]() method.`)}function wae(e,t){if(e){if(typeof e==`string`)return eI(e,t);var n=Object.prototype.toString.call(e).slice(8,-1);if(n===`Object`&&e.constructor&&(n=e.constructor.name),n===`Map`||n===`Set`)return Array.from(e);if(n===`Arguments`||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n))return eI(e,t)}}function eI(e,t){(t==null||t>e.length)&&(t=e.length);for(var n=0,r=Array(t);n<t;n++)r[n]=e[n];return r}function Tae(e,t){var n=e==null?null:typeof Symbol<`u`&&e[Symbol.iterator]||e[`@@iterator`];if(n!=null){var r,i,a,o,s=[],c=!0,l=!1;try{if(a=(n=n.call(e)).next,t===0){if(Object(n)!==n)return;c=!1}else for(;!(c=(r=a.call(n)).done)&&(s.push(r.value),s.length!==t);c=!0);}catch(e){l=!0,i=e}finally{try{if(!c&&n.return!=null&&(o=n.return(),Object(o)!==o))return}finally{if(l)throw i}}return s}}function Eae(e){if(Array.isArray(e))return e}function tI(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter(function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable})),n.push.apply(n,r)}return n}function nI(e){for(var t=1;t<arguments.length;t++){var n=arguments[t]==null?{}:arguments[t];t%2?tI(Object(n),!0).forEach(function(t){Dae(e,t,n[t])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):tI(Object(n)).forEach(function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(n,t))})}return e}function Dae(e,t,n){return t=Oae(t),t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function Oae(e){var t=kae(e,`string`);return QF(t)==`symbol`?t:t+``}function kae(e,t){if(QF(e)!=`object`||!e)return e;var n=e[Symbol.toPrimitive];if(n!==void 0){var r=n.call(e,t||`default`);if(QF(r)!=`object`)return r;throw TypeError(`@@toPrimitive must return a primitive value.`)}return(t===`string`?String:Number)(e)}var rI=function(e,t,n,r,i){var a=Math.min(Math.abs(n)/2,Math.abs(r)/2),o=r>=0?1:-1,s=n>=0?1:-1,c=+(r>=0&&n>=0||r<0&&n<0),l;if(a>0&&i instanceof Array){for(var u=[0,0,0,0],d=0,f=4;d<f;d++)u[d]=i[d]>a?a:i[d];l=`M${e},${t+o*u[0]}`,u[0]>0&&(l+=`A ${u[0]},${u[0]},0,0,${c},${e+s*u[0]},${t}`),l+=`L ${e+n-s*u[1]},${t}`,u[1]>0&&(l+=`A ${u[1]},${u[1]},0,0,${c},
|
|
101
|
-
${e+n},${t+o*u[1]}`),l+=`L ${e+n},${t+r-o*u[2]}`,u[2]>0&&(l+=`A ${u[2]},${u[2]},0,0,${c},
|
|
102
|
-
${e+n-s*u[2]},${t+r}`),l+=`L ${e+s*u[3]},${t+r}`,u[3]>0&&(l+=`A ${u[3]},${u[3]},0,0,${c},
|
|
103
|
-
${e},${t+r-o*u[3]}`),l+=`Z`}else if(a>0&&i===+i&&i>0){var p=Math.min(a,i);l=`M ${e},${t+o*p}
|
|
104
|
-
A ${p},${p},0,0,${c},${e+s*p},${t}
|
|
105
|
-
L ${e+n-s*p},${t}
|
|
106
|
-
A ${p},${p},0,0,${c},${e+n},${t+o*p}
|
|
107
|
-
L ${e+n},${t+r-o*p}
|
|
108
|
-
A ${p},${p},0,0,${c},${e+n-s*p},${t+r}
|
|
109
|
-
L ${e+s*p},${t+r}
|
|
110
|
-
A ${p},${p},0,0,${c},${e},${t+r-o*p} Z`}else l=`M ${e},${t} h ${n} v ${r} h ${-n} Z`;return l},Aae=function(e,t){if(!e||!t)return!1;var n=e.x,r=e.y,i=t.x,a=t.y,o=t.width,s=t.height;if(Math.abs(o)>0&&Math.abs(s)>0){var c=Math.min(i,i+o),l=Math.max(i,i+o),u=Math.min(a,a+s),d=Math.max(a,a+s);return n>=c&&n<=l&&r>=u&&r<=d}return!1},jae={x:0,y:0,width:0,height:0,radius:0,isAnimationActive:!1,isUpdateAnimationActive:!1,animationBegin:0,animationDuration:1500,animationEasing:`ease`},iI=function(e){var t=nI(nI({},jae),e),n=(0,_.useRef)(),r=Sae((0,_.useState)(-1),2),i=r[0],a=r[1];(0,_.useEffect)(function(){if(n.current&&n.current.getTotalLength)try{var e=n.current.getTotalLength();e&&a(e)}catch{}},[]);var o=t.x,s=t.y,c=t.width,l=t.height,u=t.radius,d=t.className,f=t.animationEasing,p=t.animationDuration,m=t.animationBegin,h=t.isAnimationActive,g=t.isUpdateAnimationActive;if(o!==+o||s!==+s||c!==+c||l!==+l||c===0||l===0)return null;var v=Ht(`recharts-rectangle`,d);return g?_.createElement(ZF,{canBegin:i>0,from:{width:c,height:l,x:o,y:s},to:{width:c,height:l,x:o,y:s},duration:p,animationEasing:f,isActive:g},function(e){var r=e.width,a=e.height,o=e.x,s=e.y;return _.createElement(ZF,{canBegin:i>0,from:`0px ${i===-1?1:i}px`,to:`${i}px 0px`,attributeName:`strokeDasharray`,begin:m,duration:p,isActive:h,easing:f},_.createElement(`path`,$F({},Ob(t,!0),{className:v,d:rI(o,s,r,a,u),ref:n})))}):_.createElement(`path`,$F({},Ob(t,!0),{className:v,d:rI(o,s,c,l,u)}))},Mae=[`points`,`className`,`baseLinePoints`,`connectNulls`];function aI(){return aI=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},aI.apply(this,arguments)}function Nae(e,t){if(e==null)return{};var n=Pae(e,t),r,i;if(Object.getOwnPropertySymbols){var a=Object.getOwnPropertySymbols(e);for(i=0;i<a.length;i++)r=a[i],!(t.indexOf(r)>=0)&&Object.prototype.propertyIsEnumerable.call(e,r)&&(n[r]=e[r])}return n}function Pae(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 oI(e){return Rae(e)||Lae(e)||Iae(e)||Fae()}function Fae(){throw TypeError(`Invalid attempt to spread non-iterable instance.
|
|
111
|
-
In order to be iterable, non-array objects must have a [Symbol.iterator]() method.`)}function Iae(e,t){if(e){if(typeof e==`string`)return sI(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 sI(e,t)}}function Lae(e){if(typeof Symbol<`u`&&e[Symbol.iterator]!=null||e[`@@iterator`]!=null)return Array.from(e)}function Rae(e){if(Array.isArray(e))return sI(e)}function sI(e,t){(t==null||t>e.length)&&(t=e.length);for(var n=0,r=Array(t);n<t;n++)r[n]=e[n];return r}var cI=function(e){return e&&e.x===+e.x&&e.y===+e.y},zae=function(){var e=arguments.length>0&&arguments[0]!==void 0?arguments[0]:[],t=[[]];return e.forEach(function(e){cI(e)?t[t.length-1].push(e):t[t.length-1].length>0&&t.push([])}),cI(e[0])&&t[t.length-1].push(e[0]),t[t.length-1].length<=0&&(t=t.slice(0,-1)),t},lI=function(e,t){var n=zae(e);t&&(n=[n.reduce(function(e,t){return[].concat(oI(e),oI(t))},[])]);var r=n.map(function(e){return e.reduce(function(e,t,n){return`${e}${n===0?`M`:`L`}${t.x},${t.y}`},``)}).join(``);return n.length===1?`${r}Z`:r},Bae=function(e,t,n){var r=lI(e,n);return`${r.slice(-1)===`Z`?r.slice(0,-1):r}L${lI(t.reverse(),n).slice(1)}`},Vae=function(e){var t=e.points,n=e.className,r=e.baseLinePoints,i=e.connectNulls,a=Nae(e,Mae);if(!t||!t.length)return null;var o=Ht(`recharts-polygon`,n);if(r&&r.length){var s=a.stroke&&a.stroke!==`none`,c=Bae(t,r,i);return _.createElement(`g`,{className:o},_.createElement(`path`,aI({},Ob(a,!0),{fill:c.slice(-1)===`Z`?a.fill:`none`,stroke:`none`,d:c})),s?_.createElement(`path`,aI({},Ob(a,!0),{fill:`none`,d:lI(t,i)})):null,s?_.createElement(`path`,aI({},Ob(a,!0),{fill:`none`,d:lI(r,i)})):null)}var l=lI(t,i);return _.createElement(`path`,aI({},Ob(a,!0),{fill:l.slice(-1)===`Z`?a.fill:`none`,className:o,d:l}))};function uI(){return uI=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},uI.apply(this,arguments)}var dI=function(e){var t=e.cx,n=e.cy,r=e.r,i=e.className,a=Ht(`recharts-dot`,i);return t===+t&&n===+n&&r===+r?_.createElement(`circle`,uI({},Ob(e,!1),ob(e),{className:a,cx:t,cy:n,r})):null};function fI(e){"@babel/helpers - typeof";return fI=typeof Symbol==`function`&&typeof Symbol.iterator==`symbol`?function(e){return typeof e}:function(e){return e&&typeof Symbol==`function`&&e.constructor===Symbol&&e!==Symbol.prototype?`symbol`:typeof e},fI(e)}var Hae=[`x`,`y`,`top`,`left`,`width`,`height`,`className`];function pI(){return pI=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},pI.apply(this,arguments)}function mI(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter(function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable})),n.push.apply(n,r)}return n}function Uae(e){for(var t=1;t<arguments.length;t++){var n=arguments[t]==null?{}:arguments[t];t%2?mI(Object(n),!0).forEach(function(t){Wae(e,t,n[t])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):mI(Object(n)).forEach(function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(n,t))})}return e}function Wae(e,t,n){return t=Gae(t),t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function Gae(e){var t=Kae(e,`string`);return fI(t)==`symbol`?t:t+``}function Kae(e,t){if(fI(e)!=`object`||!e)return e;var n=e[Symbol.toPrimitive];if(n!==void 0){var r=n.call(e,t||`default`);if(fI(r)!=`object`)return r;throw TypeError(`@@toPrimitive must return a primitive value.`)}return(t===`string`?String:Number)(e)}function qae(e,t){if(e==null)return{};var n=Jae(e,t),r,i;if(Object.getOwnPropertySymbols){var a=Object.getOwnPropertySymbols(e);for(i=0;i<a.length;i++)r=a[i],!(t.indexOf(r)>=0)&&Object.prototype.propertyIsEnumerable.call(e,r)&&(n[r]=e[r])}return n}function Jae(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 Yae=function(e,t,n,r,i,a){return`M${e},${i}v${r}M${a},${t}h${n}`},Xae=function(e){var t=e.x,n=t===void 0?0:t,r=e.y,i=r===void 0?0:r,a=e.top,o=a===void 0?0:a,s=e.left,c=s===void 0?0:s,l=e.width,u=l===void 0?0:l,d=e.height,f=d===void 0?0:d,p=e.className,m=qae(e,Hae),h=Uae({x:n,y:i,top:o,left:c,width:u,height:f},m);return!Vy(n)||!Vy(i)||!Vy(u)||!Vy(f)||!Vy(o)||!Vy(c)?null:_.createElement(`path`,pI({},Ob(h,!0),{className:Ht(`recharts-cross`,p),d:Yae(n,i,u,f,o,c)}))},Zae=o(((e,t)=>{var n=qj(),r=Jj(),i=_C();function a(e,t){return e&&e.length?n(e,i(t,2),r):void 0}t.exports=a})),Qae=o(((e,t)=>{var n=qj(),r=_C(),i=Xj();function a(e,t){return e&&e.length?n(e,r(t,2),i):void 0}t.exports=a})),$ae=l(Zae()),eoe=l(Qae()),toe=[`cx`,`cy`,`angle`,`ticks`,`axisLine`],noe=[`ticks`,`tick`,`angle`,`tickFormatter`,`stroke`];function hI(e){"@babel/helpers - typeof";return hI=typeof Symbol==`function`&&typeof Symbol.iterator==`symbol`?function(e){return typeof e}:function(e){return e&&typeof Symbol==`function`&&e.constructor===Symbol&&e!==Symbol.prototype?`symbol`:typeof e},hI(e)}function gI(){return gI=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},gI.apply(this,arguments)}function _I(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter(function(t){return Object.getOwnPropertyDescriptor(e,t).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?_I(Object(n),!0).forEach(function(t){wI(e,t,n[t])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):_I(Object(n)).forEach(function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(n,t))})}return e}function yI(e,t){if(e==null)return{};var n=roe(e,t),r,i;if(Object.getOwnPropertySymbols){var a=Object.getOwnPropertySymbols(e);for(i=0;i<a.length;i++)r=a[i],!(t.indexOf(r)>=0)&&Object.prototype.propertyIsEnumerable.call(e,r)&&(n[r]=e[r])}return n}function roe(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 ioe(e,t){if(!(e instanceof t))throw TypeError(`Cannot call a class as a function`)}function bI(e,t){for(var n=0;n<t.length;n++){var r=t[n];r.enumerable=r.enumerable||!1,r.configurable=!0,`value`in r&&(r.writable=!0),Object.defineProperty(e,TI(r.key),r)}}function aoe(e,t,n){return t&&bI(e.prototype,t),n&&bI(e,n),Object.defineProperty(e,"prototype",{writable:!1}),e}function ooe(e,t,n){return t=SI(t),soe(e,xI()?Reflect.construct(t,n||[],SI(e).constructor):t.apply(e,n))}function soe(e,t){if(t&&(hI(t)===`object`||typeof t==`function`))return t;if(t!==void 0)throw TypeError(`Derived constructors may only return object or undefined`);return coe(e)}function coe(e){if(e===void 0)throw ReferenceError(`this hasn't been initialised - super() hasn't been called`);return e}function xI(){try{var e=!Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],function(){}))}catch{}return(xI=function(){return!!e})()}function SI(e){return SI=Object.setPrototypeOf?Object.getPrototypeOf.bind():function(e){return e.__proto__||Object.getPrototypeOf(e)},SI(e)}function loe(e,t){if(typeof t!=`function`&&t!==null)throw 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&&CI(e,t)}function CI(e,t){return CI=Object.setPrototypeOf?Object.setPrototypeOf.bind():function(e,t){return e.__proto__=t,e},CI(e,t)}function wI(e,t,n){return t=TI(t),t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function TI(e){var t=uoe(e,`string`);return hI(t)==`symbol`?t:t+``}function uoe(e,t){if(hI(e)!=`object`||!e)return e;var n=e[Symbol.toPrimitive];if(n!==void 0){var r=n.call(e,t||`default`);if(hI(r)!=`object`)return r;throw TypeError(`@@toPrimitive must return a primitive value.`)}return(t===`string`?String:Number)(e)}var EI=function(e){function t(){return ioe(this,t),ooe(this,t,arguments)}return loe(t,e),aoe(t,[{key:`getTickValueCoord`,value:function(e){var t=e.coordinate,n=this.props,r=n.angle,i=n.cx,a=n.cy;return bP(i,a,t,r)}},{key:`getTickTextAnchor`,value:function(){var e=this.props.orientation,t;switch(e){case`left`:t=`end`;break;case`right`:t=`start`;break;default:t=`middle`}return t}},{key:`getViewBox`,value:function(){var e=this.props,t=e.cx,n=e.cy,r=e.angle,i=e.ticks,a=(0,$ae.default)(i,function(e){return e.coordinate||0});return{cx:t,cy:n,startAngle:r,endAngle:r,innerRadius:(0,eoe.default)(i,function(e){return e.coordinate||0}).coordinate||0,outerRadius:a.coordinate||0}}},{key:`renderAxisLine`,value:function(){var e=this.props,t=e.cx,n=e.cy,r=e.angle,i=e.ticks,a=e.axisLine,o=yI(e,toe),s=i.reduce(function(e,t){return[Math.min(e[0],t.coordinate),Math.max(e[1],t.coordinate)]},[1/0,-1/0]),c=bP(t,n,s[0],r),l=bP(t,n,s[1],r),u=vI(vI(vI({},Ob(o,!1)),{},{fill:`none`},Ob(a,!1)),{},{x1:c.x,y1:c.y,x2:l.x,y2:l.y});return _.createElement(`line`,gI({className:`recharts-polar-radius-axis-line`},u))}},{key:`renderTicks`,value:function(){var e=this,n=this.props,r=n.ticks,i=n.tick,a=n.angle,o=n.tickFormatter,s=n.stroke,c=yI(n,noe),l=this.getTickTextAnchor(),u=Ob(c,!1),d=Ob(i,!1),f=r.map(function(n,r){var c=e.getTickValueCoord(n),f=vI(vI(vI(vI({textAnchor:l,transform:`rotate(${90-a}, ${c.x}, ${c.y})`},u),{},{stroke:`none`,fill:s},d),{},{index:r},c),{},{payload:n});return _.createElement(Ub,gI({className:Ht(`recharts-polar-radius-axis-tick`,CP(i)),key:`tick-${n.coordinate}`},cb(e.props,n,r)),t.renderTickItem(i,f,o?o(n.value,r):n.value))});return _.createElement(Ub,{className:`recharts-polar-radius-axis-ticks`},f)}},{key:`render`,value:function(){var e=this.props,t=e.ticks,n=e.axisLine,r=e.tick;return!t||!t.length?null:_.createElement(Ub,{className:Ht(`recharts-polar-radius-axis`,this.props.className)},n&&this.renderAxisLine(),r&&this.renderTicks(),kP.renderCallByParent(this.props,this.getViewBox()))}}],[{key:`renderTickItem`,value:function(e,t,n){return _.isValidElement(e)?_.cloneElement(e,t):(0,lb.default)(e)?e(t):_.createElement(fE,gI({},t,{className:`recharts-polar-radius-axis-tick-value`}),n)}}])}(_.PureComponent);wI(EI,`displayName`,`PolarRadiusAxis`),wI(EI,`axisType`,`radiusAxis`),wI(EI,`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 DI(e){"@babel/helpers - typeof";return DI=typeof Symbol==`function`&&typeof Symbol.iterator==`symbol`?function(e){return typeof e}:function(e){return e&&typeof Symbol==`function`&&e.constructor===Symbol&&e!==Symbol.prototype?`symbol`:typeof e},DI(e)}function OI(){return OI=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},OI.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(t){return Object.getOwnPropertyDescriptor(e,t).enumerable})),n.push.apply(n,r)}return n}function AI(e){for(var t=1;t<arguments.length;t++){var n=arguments[t]==null?{}:arguments[t];t%2?kI(Object(n),!0).forEach(function(t){FI(e,t,n[t])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):kI(Object(n)).forEach(function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(n,t))})}return e}function doe(e,t){if(!(e instanceof t))throw TypeError(`Cannot call a class as a function`)}function jI(e,t){for(var n=0;n<t.length;n++){var r=t[n];r.enumerable=r.enumerable||!1,r.configurable=!0,`value`in r&&(r.writable=!0),Object.defineProperty(e,II(r.key),r)}}function foe(e,t,n){return t&&jI(e.prototype,t),n&&jI(e,n),Object.defineProperty(e,"prototype",{writable:!1}),e}function poe(e,t,n){return t=NI(t),moe(e,MI()?Reflect.construct(t,n||[],NI(e).constructor):t.apply(e,n))}function moe(e,t){if(t&&(DI(t)===`object`||typeof t==`function`))return t;if(t!==void 0)throw TypeError(`Derived constructors may only return object or undefined`);return hoe(e)}function hoe(e){if(e===void 0)throw ReferenceError(`this hasn't been initialised - super() hasn't been called`);return e}function MI(){try{var e=!Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],function(){}))}catch{}return(MI=function(){return!!e})()}function NI(e){return NI=Object.setPrototypeOf?Object.getPrototypeOf.bind():function(e){return e.__proto__||Object.getPrototypeOf(e)},NI(e)}function goe(e,t){if(typeof t!=`function`&&t!==null)throw 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&&PI(e,t)}function PI(e,t){return PI=Object.setPrototypeOf?Object.setPrototypeOf.bind():function(e,t){return e.__proto__=t,e},PI(e,t)}function FI(e,t,n){return t=II(t),t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function II(e){var t=_oe(e,`string`);return DI(t)==`symbol`?t:t+``}function _oe(e,t){if(DI(e)!=`object`||!e)return e;var n=e[Symbol.toPrimitive];if(n!==void 0){var r=n.call(e,t||`default`);if(DI(r)!=`object`)return r;throw TypeError(`@@toPrimitive must return a primitive value.`)}return(t===`string`?String:Number)(e)}var voe=Math.PI/180,LI=1e-5,RI=function(e){function t(){return doe(this,t),poe(this,t,arguments)}return goe(t,e),foe(t,[{key:`getTickLineCoord`,value:function(e){var t=this.props,n=t.cx,r=t.cy,i=t.radius,a=t.orientation,o=t.tickSize||8,s=bP(n,r,i,e.coordinate),c=bP(n,r,i+(a===`inner`?-1:1)*o,e.coordinate);return{x1:s.x,y1:s.y,x2:c.x,y2:c.y}}},{key:`getTickTextAnchor`,value:function(e){var t=this.props.orientation,n=Math.cos(-e.coordinate*voe);return n>LI?t===`outer`?`start`:`end`:n<-LI?t===`outer`?`end`:`start`:`middle`}},{key:`renderAxisLine`,value:function(){var e=this.props,t=e.cx,n=e.cy,r=e.radius,i=e.axisLine,a=e.axisLineType,o=AI(AI({},Ob(this.props,!1)),{},{fill:`none`},Ob(i,!1));if(a===`circle`)return _.createElement(dI,OI({className:`recharts-polar-angle-axis-line`},o,{cx:t,cy:n,r}));var s=this.props.ticks.map(function(e){return bP(t,n,r,e.coordinate)});return _.createElement(Vae,OI({className:`recharts-polar-angle-axis-line`},o,{points:s}))}},{key:`renderTicks`,value:function(){var e=this,n=this.props,r=n.ticks,i=n.tick,a=n.tickLine,o=n.tickFormatter,s=n.stroke,c=Ob(this.props,!1),l=Ob(i,!1),u=AI(AI({},c),{},{fill:`none`},Ob(a,!1)),d=r.map(function(n,r){var d=e.getTickLineCoord(n),f=AI(AI(AI({textAnchor:e.getTickTextAnchor(n)},c),{},{stroke:`none`,fill:s},l),{},{index:r,payload:n,x:d.x2,y:d.y2});return _.createElement(Ub,OI({className:Ht(`recharts-polar-angle-axis-tick`,CP(i)),key:`tick-${n.coordinate}`},cb(e.props,n,r)),a&&_.createElement(`line`,OI({className:`recharts-polar-angle-axis-tick-line`},u,d)),i&&t.renderTickItem(i,f,o?o(n.value,r):n.value))});return _.createElement(Ub,{className:`recharts-polar-angle-axis-ticks`},d)}},{key:`render`,value:function(){var e=this.props,t=e.ticks,n=e.radius,r=e.axisLine;return n<=0||!t||!t.length?null:_.createElement(Ub,{className:Ht(`recharts-polar-angle-axis`,this.props.className)},r&&this.renderAxisLine(),this.renderTicks())}}],[{key:`renderTickItem`,value:function(e,t,n){return _.isValidElement(e)?_.cloneElement(e,t):(0,lb.default)(e)?e(t):_.createElement(fE,OI({},t,{className:`recharts-polar-angle-axis-tick-value`}),n)}}])}(_.PureComponent);FI(RI,`displayName`,`PolarAngleAxis`),FI(RI,`axisType`,`angleAxis`),FI(RI,`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 zI=o(((e,t)=>{t.exports=lC()(Object.getPrototypeOf,Object)})),BI=o(((e,t)=>{var n=Iv(),r=zI(),i=Lv(),a=`[object Object]`,o=Function.prototype,s=Object.prototype,c=o.toString,l=s.hasOwnProperty,u=c.call(Object);function d(e){if(!i(e)||n(e)!=a)return!1;var t=r(e);if(t===null)return!0;var o=l.call(t,`constructor`)&&t.constructor;return typeof o==`function`&&o instanceof o&&c.call(o)==u}t.exports=d})),VI=o(((e,t)=>{var n=Iv(),r=Lv(),i=`[object Boolean]`;function a(e){return e===!0||e===!1||r(e)&&n(e)==i}t.exports=a}));function HI(e){"@babel/helpers - typeof";return HI=typeof Symbol==`function`&&typeof Symbol.iterator==`symbol`?function(e){return typeof e}:function(e){return e&&typeof Symbol==`function`&&e.constructor===Symbol&&e!==Symbol.prototype?`symbol`:typeof e},HI(e)}function UI(){return UI=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},UI.apply(this,arguments)}function WI(e,t){return YI(e)||JI(e,t)||KI(e,t)||GI()}function GI(){throw TypeError(`Invalid attempt to destructure non-iterable instance.
|
|
112
|
-
In order to be iterable, non-array objects must have a [Symbol.iterator]() method.`)}function KI(e,t){if(e){if(typeof e==`string`)return qI(e,t);var n=Object.prototype.toString.call(e).slice(8,-1);if(n===`Object`&&e.constructor&&(n=e.constructor.name),n===`Map`||n===`Set`)return Array.from(e);if(n===`Arguments`||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n))return qI(e,t)}}function qI(e,t){(t==null||t>e.length)&&(t=e.length);for(var n=0,r=Array(t);n<t;n++)r[n]=e[n];return r}function JI(e,t){var n=e==null?null:typeof Symbol<`u`&&e[Symbol.iterator]||e[`@@iterator`];if(n!=null){var r,i,a,o,s=[],c=!0,l=!1;try{if(a=(n=n.call(e)).next,t===0){if(Object(n)!==n)return;c=!1}else for(;!(c=(r=a.call(n)).done)&&(s.push(r.value),s.length!==t);c=!0);}catch(e){l=!0,i=e}finally{try{if(!c&&n.return!=null&&(o=n.return(),Object(o)!==o))return}finally{if(l)throw i}}return s}}function YI(e){if(Array.isArray(e))return e}function XI(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter(function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable})),n.push.apply(n,r)}return n}function ZI(e){for(var t=1;t<arguments.length;t++){var n=arguments[t]==null?{}:arguments[t];t%2?XI(Object(n),!0).forEach(function(t){QI(e,t,n[t])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):XI(Object(n)).forEach(function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(n,t))})}return e}function QI(e,t,n){return t=$I(t),t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function $I(e){var t=eL(e,`string`);return HI(t)==`symbol`?t:t+``}function eL(e,t){if(HI(e)!=`object`||!e)return e;var n=e[Symbol.toPrimitive];if(n!==void 0){var r=n.call(e,t||`default`);if(HI(r)!=`object`)return r;throw TypeError(`@@toPrimitive must return a primitive value.`)}return(t===`string`?String:Number)(e)}var tL=function(e,t,n,r,i){var a=n-r,o=`M ${e},${t}`;return o+=`L ${e+n},${t}`,o+=`L ${e+n-a/2},${t+i}`,o+=`L ${e+n-a/2-r},${t+i}`,o+=`L ${e},${t} Z`,o},nL={x:0,y:0,upperWidth:0,lowerWidth:0,height:0,isUpdateAnimationActive:!1,animationBegin:0,animationDuration:1500,animationEasing:`ease`},rL=function(e){var t=ZI(ZI({},nL),e),n=(0,_.useRef)(),r=WI((0,_.useState)(-1),2),i=r[0],a=r[1];(0,_.useEffect)(function(){if(n.current&&n.current.getTotalLength)try{var e=n.current.getTotalLength();e&&a(e)}catch{}},[]);var o=t.x,s=t.y,c=t.upperWidth,l=t.lowerWidth,u=t.height,d=t.className,f=t.animationEasing,p=t.animationDuration,m=t.animationBegin,h=t.isUpdateAnimationActive;if(o!==+o||s!==+s||c!==+c||l!==+l||u!==+u||c===0&&l===0||u===0)return null;var g=Ht(`recharts-trapezoid`,d);return h?_.createElement(ZF,{canBegin:i>0,from:{upperWidth:0,lowerWidth:0,height:u,x:o,y:s},to:{upperWidth:c,lowerWidth:l,height:u,x:o,y:s},duration:p,animationEasing:f,isActive:h},function(e){var r=e.upperWidth,a=e.lowerWidth,o=e.height,s=e.x,c=e.y;return _.createElement(ZF,{canBegin:i>0,from:`0px ${i===-1?1:i}px`,to:`${i}px 0px`,attributeName:`strokeDasharray`,begin:m,duration:p,easing:f},_.createElement(`path`,UI({},Ob(t,!0),{className:g,d:tL(s,c,r,a,o),ref:n})))}):_.createElement(`g`,null,_.createElement(`path`,UI({},Ob(t,!0),{className:g,d:tL(o,s,c,l,u)})))},iL=l(BI()),aL=l(VI()),oL=[`option`,`shapeType`,`propTransformer`,`activeClassName`,`isActive`];function sL(e){"@babel/helpers - typeof";return sL=typeof Symbol==`function`&&typeof Symbol.iterator==`symbol`?function(e){return typeof e}:function(e){return e&&typeof Symbol==`function`&&e.constructor===Symbol&&e!==Symbol.prototype?`symbol`:typeof e},sL(e)}function cL(e,t){if(e==null)return{};var n=lL(e,t),r,i;if(Object.getOwnPropertySymbols){var a=Object.getOwnPropertySymbols(e);for(i=0;i<a.length;i++)r=a[i],!(t.indexOf(r)>=0)&&Object.prototype.propertyIsEnumerable.call(e,r)&&(n[r]=e[r])}return n}function lL(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 uL(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter(function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable})),n.push.apply(n,r)}return n}function dL(e){for(var t=1;t<arguments.length;t++){var n=arguments[t]==null?{}:arguments[t];t%2?uL(Object(n),!0).forEach(function(t){fL(e,t,n[t])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):uL(Object(n)).forEach(function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(n,t))})}return e}function fL(e,t,n){return t=pL(t),t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function pL(e){var t=mL(e,`string`);return sL(t)==`symbol`?t:t+``}function mL(e,t){if(sL(e)!=`object`||!e)return e;var n=e[Symbol.toPrimitive];if(n!==void 0){var r=n.call(e,t||`default`);if(sL(r)!=`object`)return r;throw TypeError(`@@toPrimitive must return a primitive value.`)}return(t===`string`?String:Number)(e)}function hL(e,t){return dL(dL({},t),e)}function gL(e,t){return e===`symbols`}function _L(e){var t=e.shapeType,n=e.elementProps;switch(t){case`rectangle`:return _.createElement(iI,n);case`trapezoid`:return _.createElement(rL,n);case`sector`:return _.createElement(WP,n);case`symbols`:if(gL(t,n))return _.createElement(LS,n);break;default:return null}}function vL(e){return(0,_.isValidElement)(e)?e.props:e}function yL(e){var t=e.option,n=e.shapeType,r=e.propTransformer,i=r===void 0?hL:r,a=e.activeClassName,o=a===void 0?`recharts-active-shape`:a,s=e.isActive,c=cL(e,oL),l;if((0,_.isValidElement)(t))l=(0,_.cloneElement)(t,dL(dL({},c),vL(t)));else if((0,lb.default)(t))l=t(c);else if((0,iL.default)(t)&&!(0,aL.default)(t)){var u=i(t,c);l=_.createElement(_L,{shapeType:n,elementProps:u})}else{var d=c;l=_.createElement(_L,{shapeType:n,elementProps:d})}return s?_.createElement(Ub,{className:o},l):l}function bL(e,t){return t!=null&&`trapezoids`in e.props}function xL(e,t){return t!=null&&`sectors`in e.props}function SL(e,t){return t!=null&&`points`in e.props}function CL(e,t){var n,r,i=e.x===(t==null||(n=t.labelViewBox)==null?void 0:n.x)||e.x===t.x,a=e.y===(t==null||(r=t.labelViewBox)==null?void 0:r.y)||e.y===t.y;return i&&a}function wL(e,t){var n=e.endAngle===t.endAngle,r=e.startAngle===t.startAngle;return n&&r}function TL(e,t){var n=e.x===t.x,r=e.y===t.y,i=e.z===t.z;return n&&r&&i}function EL(e,t){var n;return bL(e,t)?n=CL:xL(e,t)?n=wL:SL(e,t)&&(n=TL),n}function DL(e,t){var n;return bL(e,t)?n=`trapezoids`:xL(e,t)?n=`sectors`:SL(e,t)&&(n=`points`),n}function OL(e,t){if(bL(e,t)){var n;return(n=t.tooltipPayload)==null||(n=n[0])==null||(n=n.payload)==null?void 0:n.payload}if(xL(e,t)){var r;return(r=t.tooltipPayload)==null||(r=r[0])==null||(r=r.payload)==null?void 0:r.payload}return SL(e,t)?t.payload:{}}function kL(e){var t=e.activeTooltipItem,n=e.graphicalItem,r=e.itemData,i=DL(n,t),a=OL(n,t),o=r.filter(function(e,r){var o=(0,wN.default)(a,e),s=n.props[i].filter(function(e){return EL(n,t)(e,t)}),c=r===n.props[i].indexOf(s[s.length-1]);return o&&c});return r.indexOf(o[o.length-1])}var AL;function jL(e){"@babel/helpers - typeof";return jL=typeof Symbol==`function`&&typeof Symbol.iterator==`symbol`?function(e){return typeof e}:function(e){return e&&typeof Symbol==`function`&&e.constructor===Symbol&&e!==Symbol.prototype?`symbol`:typeof e},jL(e)}function ML(){return ML=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},ML.apply(this,arguments)}function NL(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter(function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable})),n.push.apply(n,r)}return n}function PL(e){for(var t=1;t<arguments.length;t++){var n=arguments[t]==null?{}:arguments[t];t%2?NL(Object(n),!0).forEach(function(t){GL(e,t,n[t])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):NL(Object(n)).forEach(function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(n,t))})}return e}function FL(e,t){if(!(e instanceof t))throw TypeError(`Cannot call a class as a function`)}function IL(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,KL(r.key),r)}}function LL(e,t,n){return t&&IL(e.prototype,t),n&&IL(e,n),Object.defineProperty(e,"prototype",{writable:!1}),e}function RL(e,t,n){return t=HL(t),zL(e,VL()?Reflect.construct(t,n||[],HL(e).constructor):t.apply(e,n))}function zL(e,t){if(t&&(jL(t)===`object`||typeof t==`function`))return t;if(t!==void 0)throw TypeError(`Derived constructors may only return object or undefined`);return BL(e)}function BL(e){if(e===void 0)throw ReferenceError(`this hasn't been initialised - super() hasn't been called`);return e}function VL(){try{var e=!Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],function(){}))}catch{}return(VL=function(){return!!e})()}function HL(e){return HL=Object.setPrototypeOf?Object.getPrototypeOf.bind():function(e){return e.__proto__||Object.getPrototypeOf(e)},HL(e)}function UL(e,t){if(typeof t!=`function`&&t!==null)throw 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&&WL(e,t)}function WL(e,t){return WL=Object.setPrototypeOf?Object.setPrototypeOf.bind():function(e,t){return e.__proto__=t,e},WL(e,t)}function GL(e,t,n){return t=KL(t),t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function KL(e){var t=qL(e,`string`);return jL(t)==`symbol`?t:t+``}function qL(e,t){if(jL(e)!=`object`||!e)return e;var n=e[Symbol.toPrimitive];if(n!==void 0){var r=n.call(e,t||`default`);if(jL(r)!=`object`)return r;throw TypeError(`@@toPrimitive must return a primitive value.`)}return(t===`string`?String:Number)(e)}var JL=function(e){function t(e){var n;return FL(this,t),n=RL(this,t,[e]),GL(n,`pieRef`,null),GL(n,`sectorRefs`,[]),GL(n,`id`,Gy(`recharts-pie-`)),GL(n,`handleAnimationEnd`,function(){var e=n.props.onAnimationEnd;n.setState({isAnimationFinished:!0}),(0,lb.default)(e)&&e()}),GL(n,`handleAnimationStart`,function(){var e=n.props.onAnimationStart;n.setState({isAnimationFinished:!1}),(0,lb.default)(e)&&e()}),n.state={isAnimationFinished:!e.isAnimationActive,prevIsAnimationActive:e.isAnimationActive,prevAnimationId:e.animationId,sectorToFocus:0},n}return UL(t,e),LL(t,[{key:`isActiveIndex`,value:function(e){var t=this.props.activeIndex;return Array.isArray(t)?t.indexOf(e)!==-1:e===t}},{key:`hasActiveIndex`,value:function(){var e=this.props.activeIndex;return Array.isArray(e)?e.length!==0:e||e===0}},{key:`renderLabels`,value:function(e){if(this.props.isAnimationActive&&!this.state.isAnimationFinished)return null;var n=this.props,r=n.label,i=n.labelLine,a=n.dataKey,o=n.valueKey,s=Ob(this.props,!1),c=Ob(r,!1),l=Ob(i,!1),u=r&&r.offsetRadius||20,d=e.map(function(e,n){var d=(e.startAngle+e.endAngle)/2,f=bP(e.cx,e.cy,e.outerRadius+u,d),p=PL(PL(PL(PL({},s),e),{},{stroke:`none`},c),{},{index:n,textAnchor:t.getTextAnchor(f.x,e.cx)},f),m=PL(PL(PL(PL({},s),e),{},{fill:`none`,stroke:e.fill},l),{},{index:n,points:[bP(e.cx,e.cy,e.outerRadius,d),f]}),h=a;return(0,Ry.default)(a)&&(0,Ry.default)(o)?h=`value`:(0,Ry.default)(a)&&(h=o),_.createElement(Ub,{key:`label-${e.startAngle}-${e.endAngle}-${e.midAngle}-${n}`},i&&t.renderLabelLineItem(i,m,`line`),t.renderLabelItem(r,p,LN(e,h)))});return _.createElement(Ub,{className:`recharts-pie-labels`},d)}},{key:`renderSectorsStatically`,value:function(e){var t=this,n=this.props,r=n.activeShape,i=n.blendStroke,a=n.inactiveShape;return e.map(function(n,o){if(n?.startAngle===0&&n?.endAngle===0&&e.length!==1)return null;var s=t.isActiveIndex(o),c=a&&t.hasActiveIndex()?a:null,l=s?r:c,u=PL(PL({},n),{},{stroke:i?n.fill:n.stroke,tabIndex:-1});return _.createElement(Ub,ML({ref:function(e){e&&!t.sectorRefs.includes(e)&&t.sectorRefs.push(e)},tabIndex:-1,className:`recharts-pie-sector`},cb(t.props,n,o),{key:`sector-${n?.startAngle}-${n?.endAngle}-${n.midAngle}-${o}`}),_.createElement(yL,ML({option:l,isActive:s,shapeType:`sector`},u)))})}},{key:`renderSectorsWithAnimation`,value:function(){var e=this,t=this.props,n=t.sectors,r=t.isAnimationActive,i=t.animationBegin,a=t.animationDuration,o=t.animationEasing,s=t.animationId,c=this.state,l=c.prevSectors,u=c.prevIsAnimationActive;return _.createElement(ZF,{begin:i,duration:a,isActive:r,easing:o,from:{t:0},to:{t:1},key:`pie-${s}-${u}`,onAnimationStart:this.handleAnimationStart,onAnimationEnd:this.handleAnimationEnd},function(t){var r=t.t,i=[],a=(n&&n[0]).startAngle;return n.forEach(function(e,t){var n=l&&l[t],o=t>0?(0,Iy.default)(e,`paddingAngle`,0):0;if(n){var s=Yy(n.endAngle-n.startAngle,e.endAngle-e.startAngle),c=PL(PL({},e),{},{startAngle:a+o,endAngle:a+s(r)+o});i.push(c),a=c.endAngle}else{var u=e.endAngle,d=e.startAngle,f=Yy(0,u-d)(r),p=PL(PL({},e),{},{startAngle:a+o,endAngle:a+f+o});i.push(p),a=p.endAngle}}),_.createElement(Ub,null,e.renderSectorsStatically(i))})}},{key:`attachKeyboardHandlers`,value:function(e){var t=this;e.onkeydown=function(e){if(!e.altKey)switch(e.key){case`ArrowLeft`:var n=++t.state.sectorToFocus%t.sectorRefs.length;t.sectorRefs[n].focus(),t.setState({sectorToFocus:n});break;case`ArrowRight`:var r=--t.state.sectorToFocus<0?t.sectorRefs.length-1:t.state.sectorToFocus%t.sectorRefs.length;t.sectorRefs[r].focus(),t.setState({sectorToFocus:r});break;case`Escape`:t.sectorRefs[t.state.sectorToFocus].blur(),t.setState({sectorToFocus:0})}}}},{key:`renderSectors`,value:function(){var e=this.props,t=e.sectors,n=e.isAnimationActive,r=this.state.prevSectors;return n&&t&&t.length&&(!r||!(0,wN.default)(r,t))?this.renderSectorsWithAnimation():this.renderSectorsStatically(t)}},{key:`componentDidMount`,value:function(){this.pieRef&&this.attachKeyboardHandlers(this.pieRef)}},{key:`render`,value:function(){var e=this,t=this.props,n=t.hide,r=t.sectors,i=t.className,a=t.label,o=t.cx,s=t.cy,c=t.innerRadius,l=t.outerRadius,u=t.isAnimationActive,d=this.state.isAnimationFinished;if(n||!r||!r.length||!Vy(o)||!Vy(s)||!Vy(c)||!Vy(l))return null;var f=Ht(`recharts-pie`,i);return _.createElement(Ub,{tabIndex:this.props.rootTabIndex,className:f,ref:function(t){e.pieRef=t}},this.renderSectors(),a&&this.renderLabels(r),kP.renderCallByParent(this.props,null,!1),(!u||d)&&LP.renderCallByParent(this.props,r,!1))}}],[{key:`getDerivedStateFromProps`,value:function(e,t){return t.prevIsAnimationActive===e.isAnimationActive?e.isAnimationActive&&e.animationId!==t.prevAnimationId?{prevAnimationId:e.animationId,curSectors:e.sectors,prevSectors:t.curSectors,isAnimationFinished:!0}:e.sectors===t.curSectors?null:{curSectors:e.sectors,isAnimationFinished:!0}:{prevIsAnimationActive:e.isAnimationActive,prevAnimationId:e.animationId,curSectors:e.sectors,prevSectors:[],isAnimationFinished:!0}}},{key:`getTextAnchor`,value:function(e,t){return e>t?`start`:e<t?`end`:`middle`}},{key:`renderLabelLineItem`,value:function(e,t,n){if(_.isValidElement(e))return _.cloneElement(e,t);if((0,lb.default)(e))return e(t);var r=Ht(`recharts-pie-label-line`,typeof e==`boolean`?``:e.className);return _.createElement($P,ML({},t,{key:n,type:`linear`,className:r}))}},{key:`renderLabelItem`,value:function(e,t,n){if(_.isValidElement(e))return _.cloneElement(e,t);var r=n;if((0,lb.default)(e)&&(r=e(t),_.isValidElement(r)))return r;var i=Ht(`recharts-pie-label-text`,typeof e!=`boolean`&&!(0,lb.default)(e)?e.className:``);return _.createElement(fE,ML({},t,{alignmentBaseline:`middle`,className:i}),r)}}])}(_.PureComponent);AL=JL,GL(JL,`displayName`,`Pie`),GL(JL,`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:!Cw.isSsr,animationBegin:400,animationDuration:1500,animationEasing:`ease`,nameKey:`name`,blendStroke:!1,rootTabIndex:0}),GL(JL,`parseDeltaAngle`,function(e,t){return zy(t-e)*Math.min(Math.abs(t-e),360)}),GL(JL,`getRealPieData`,function(e){var t=e.data,n=e.children,r=Ob(e,!1),i=xb(n,cT);return t&&t.length?t.map(function(e,t){return PL(PL(PL({payload:e},r),e),i&&i[t]&&i[t].props)}):i&&i.length?i.map(function(e){return PL(PL({},r),e.props)}):[]}),GL(JL,`parseCoordinateOfPie`,function(e,t){var n=t.top,r=t.left,i=t.width,a=t.height,o=xP(i,a);return{cx:r+Ky(e.cx,i,i/2),cy:n+Ky(e.cy,a,a/2),innerRadius:Ky(e.innerRadius,o,0),outerRadius:Ky(e.outerRadius,o,o*.8),maxRadius:e.maxRadius||Math.sqrt(i*i+a*a)/2}}),GL(JL,`getComposedData`,function(e){var t=e.item,n=e.offset,r=t.type.defaultProps===void 0?t.props:PL(PL({},t.type.defaultProps),t.props),i=AL.getRealPieData(r);if(!i||!i.length)return null;var a=r.cornerRadius,o=r.startAngle,s=r.endAngle,c=r.paddingAngle,l=r.dataKey,u=r.nameKey,d=r.valueKey,f=r.tooltipType,p=Math.abs(r.minAngle),m=AL.parseCoordinateOfPie(r,n),h=AL.parseDeltaAngle(o,s),g=Math.abs(h),_=l;(0,Ry.default)(l)&&(0,Ry.default)(d)?_=`value`:(0,Ry.default)(l)&&(_=d);var v=i.filter(function(e){return LN(e,_,0)!==0}).length,y=(g>=360?v:v-1)*c,b=g-v*p-y,x=i.reduce(function(e,t){var n=LN(t,_,0);return e+(Vy(n)?n:0)},0),S;if(x>0){var C;S=i.map(function(e,t){var n=LN(e,_,0),r=LN(e,u,t),i=(Vy(n)?n:0)/x,s=t?C.endAngle+zy(h)*c*(n===0?0:1):o,l=s+zy(h)*((n===0?0:p)+i*b),d=(s+l)/2,g=(m.innerRadius+m.outerRadius)/2;return C=PL(PL(PL({percent:i,cornerRadius:a,name:r,tooltipPayload:[{name:r,value:n,payload:e,dataKey:_,type:f}],midAngle:d,middleRadius:g,tooltipPosition:bP(m.cx,m.cy,g,d)},e),m),{},{value:LN(e,_),startAngle:s,endAngle:l,payload:e,paddingAngle:zy(h)*c}),C})}return PL(PL({},m),{},{sectors:S,data:i})});var YL=o(((e,t)=>{var n=Math.ceil,r=Math.max;function i(e,t,i,a){for(var o=-1,s=r(n((t-e)/(i||1)),0),c=Array(s);s--;)c[a?s:++o]=e,e+=i;return c}t.exports=i})),XL=o(((e,t)=>{var n=Kw(),r=1/0,i=17976931348623157e292;function a(e){return e?(e=n(e),e===r||e===-r?(e<0?-1:1)*i:e===e?e:0):e===0?e:0}t.exports=a})),ZL=o(((e,t)=>{var n=YL(),r=LC(),i=XL();function a(e){return function(t,a,o){return o&&typeof o!=`number`&&r(t,a,o)&&(a=o=void 0),t=i(t),a===void 0?(a=t,t=0):a=i(a),o=o===void 0?t<a?1:-1:i(o),n(t,a,o,e)}}t.exports=a})),QL=o(((e,t)=>{t.exports=ZL()()}));function $L(e){"@babel/helpers - typeof";return $L=typeof Symbol==`function`&&typeof Symbol.iterator==`symbol`?function(e){return typeof e}:function(e){return e&&typeof Symbol==`function`&&e.constructor===Symbol&&e!==Symbol.prototype?`symbol`:typeof e},$L(e)}function eR(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter(function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable})),n.push.apply(n,r)}return n}function tR(e){for(var t=1;t<arguments.length;t++){var n=arguments[t]==null?{}:arguments[t];t%2?eR(Object(n),!0).forEach(function(t){nR(e,t,n[t])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):eR(Object(n)).forEach(function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(n,t))})}return e}function nR(e,t,n){return t=rR(t),t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function rR(e){var t=iR(e,`string`);return $L(t)==`symbol`?t:t+``}function iR(e,t){if($L(e)!=`object`||!e)return e;var n=e[Symbol.toPrimitive];if(n!==void 0){var r=n.call(e,t||`default`);if($L(r)!=`object`)return r;throw TypeError(`@@toPrimitive must return a primitive value.`)}return(t===`string`?String:Number)(e)}var aR=[`Webkit`,`Moz`,`O`,`ms`],oR=function(e,t){if(!e)return null;var n=e.replace(/(\w)/,function(e){return e.toUpperCase()}),r=aR.reduce(function(e,r){return tR(tR({},e),{},nR({},r+n,t))},{});return r[e]=t,r},sR=l(QL());function cR(e){"@babel/helpers - typeof";return cR=typeof Symbol==`function`&&typeof Symbol.iterator==`symbol`?function(e){return typeof e}:function(e){return e&&typeof Symbol==`function`&&e.constructor===Symbol&&e!==Symbol.prototype?`symbol`:typeof e},cR(e)}function lR(){return lR=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},lR.apply(this,arguments)}function uR(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter(function(t){return Object.getOwnPropertyDescriptor(e,t).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?uR(Object(n),!0).forEach(function(t){SR(e,t,n[t])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):uR(Object(n)).forEach(function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(n,t))})}return e}function fR(e,t){if(!(e instanceof t))throw TypeError(`Cannot call a class as a function`)}function pR(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,CR(r.key),r)}}function mR(e,t,n){return t&&pR(e.prototype,t),n&&pR(e,n),Object.defineProperty(e,"prototype",{writable:!1}),e}function hR(e,t,n){return t=yR(t),gR(e,vR()?Reflect.construct(t,n||[],yR(e).constructor):t.apply(e,n))}function gR(e,t){if(t&&(cR(t)===`object`||typeof t==`function`))return t;if(t!==void 0)throw TypeError(`Derived constructors may only return object or undefined`);return _R(e)}function _R(e){if(e===void 0)throw ReferenceError(`this hasn't been initialised - super() hasn't been called`);return e}function vR(){try{var e=!Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],function(){}))}catch{}return(vR=function(){return!!e})()}function yR(e){return yR=Object.setPrototypeOf?Object.getPrototypeOf.bind():function(e){return e.__proto__||Object.getPrototypeOf(e)},yR(e)}function bR(e,t){if(typeof t!=`function`&&t!==null)throw 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&&xR(e,t)}function xR(e,t){return xR=Object.setPrototypeOf?Object.setPrototypeOf.bind():function(e,t){return e.__proto__=t,e},xR(e,t)}function SR(e,t,n){return t=CR(t),t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function CR(e){var t=wR(e,`string`);return cR(t)==`symbol`?t:t+``}function wR(e,t){if(cR(e)!=`object`||!e)return e;var n=e[Symbol.toPrimitive];if(n!==void 0){var r=n.call(e,t||`default`);if(cR(r)!=`object`)return r;throw TypeError(`@@toPrimitive must return a primitive value.`)}return(t===`string`?String:Number)(e)}var TR=function(e){var t=e.data,n=e.startIndex,r=e.endIndex,i=e.x,a=e.width,o=e.travellerWidth;if(!t||!t.length)return{};var s=t.length,c=JE().domain((0,sR.default)(0,s)).range([i,i+a-o]),l=c.domain().map(function(e){return c(e)});return{isTextActive:!1,isSlideMoving:!1,isTravellerMoving:!1,isTravellerFocused:!1,startX:c(n),endX:c(r),scale:c,scaleValues:l}},ER=function(e){return e.changedTouches&&!!e.changedTouches.length},DR=function(e){function t(e){var n;return fR(this,t),n=hR(this,t,[e]),SR(n,`handleDrag`,function(e){n.leaveTimer&&(clearTimeout(n.leaveTimer),n.leaveTimer=null),n.state.isTravellerMoving?n.handleTravellerMove(e):n.state.isSlideMoving&&n.handleSlideDrag(e)}),SR(n,`handleTouchMove`,function(e){e.changedTouches!=null&&e.changedTouches.length>0&&n.handleDrag(e.changedTouches[0])}),SR(n,`handleDragEnd`,function(){n.setState({isTravellerMoving:!1,isSlideMoving:!1},function(){var e=n.props,t=e.endIndex,r=e.onDragEnd,i=e.startIndex;r?.({endIndex:t,startIndex:i})}),n.detachDragEndListener()}),SR(n,`handleLeaveWrapper`,function(){(n.state.isTravellerMoving||n.state.isSlideMoving)&&(n.leaveTimer=window.setTimeout(n.handleDragEnd,n.props.leaveTimeOut))}),SR(n,`handleEnterSlideOrTraveller`,function(){n.setState({isTextActive:!0})}),SR(n,`handleLeaveSlideOrTraveller`,function(){n.setState({isTextActive:!1})}),SR(n,`handleSlideDragStart`,function(e){var t=ER(e)?e.changedTouches[0]:e;n.setState({isTravellerMoving:!1,isSlideMoving:!0,slideMoveStartX:t.pageX}),n.attachDragEndListener()}),n.travellerDragStartHandlers={startX:n.handleTravellerDragStart.bind(n,`startX`),endX:n.handleTravellerDragStart.bind(n,`endX`)},n.state={},n}return bR(t,e),mR(t,[{key:`componentWillUnmount`,value:function(){this.leaveTimer&&=(clearTimeout(this.leaveTimer),null),this.detachDragEndListener()}},{key:`getIndex`,value:function(e){var n=e.startX,r=e.endX,i=this.state.scaleValues,a=this.props,o=a.gap,s=a.data.length-1,c=Math.min(n,r),l=Math.max(n,r),u=t.getIndexInRange(i,c),d=t.getIndexInRange(i,l);return{startIndex:u-u%o,endIndex:d===s?s:d-d%o}}},{key:`getTextOfTick`,value:function(e){var t=this.props,n=t.data,r=t.tickFormatter,i=t.dataKey,a=LN(n[e],i,e);return(0,lb.default)(r)?r(a,e):a}},{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(e){var t=this.state,n=t.slideMoveStartX,r=t.startX,i=t.endX,a=this.props,o=a.x,s=a.width,c=a.travellerWidth,l=a.startIndex,u=a.endIndex,d=a.onChange,f=e.pageX-n;f>0?f=Math.min(f,o+s-c-i,o+s-c-r):f<0&&(f=Math.max(f,o-r,o-i));var p=this.getIndex({startX:r+f,endX:i+f});(p.startIndex!==l||p.endIndex!==u)&&d&&d(p),this.setState({startX:r+f,endX:i+f,slideMoveStartX:e.pageX})}},{key:`handleTravellerDragStart`,value:function(e,t){var n=ER(t)?t.changedTouches[0]:t;this.setState({isSlideMoving:!1,isTravellerMoving:!0,movingTravellerId:e,brushMoveStartX:n.pageX}),this.attachDragEndListener()}},{key:`handleTravellerMove`,value:function(e){var t=this.state,n=t.brushMoveStartX,r=t.movingTravellerId,i=t.endX,a=t.startX,o=this.state[r],s=this.props,c=s.x,l=s.width,u=s.travellerWidth,d=s.onChange,f=s.gap,p=s.data,m={startX:this.state.startX,endX:this.state.endX},h=e.pageX-n;h>0?h=Math.min(h,c+l-u-o):h<0&&(h=Math.max(h,c-o)),m[r]=o+h;var g=this.getIndex(m),_=g.startIndex,v=g.endIndex,y=function(){var e=p.length-1;return r===`startX`&&(i>a?_%f===0:v%f===0)||i<a&&v===e||r===`endX`&&(i>a?v%f===0:_%f===0)||i>a&&v===e};this.setState(SR(SR({},r,o+h),`brushMoveStartX`,e.pageX),function(){d&&y()&&d(g)})}},{key:`handleTravellerMoveKeyboard`,value:function(e,t){var n=this,r=this.state,i=r.scaleValues,a=r.startX,o=r.endX,s=this.state[t],c=i.indexOf(s);if(c!==-1){var l=c+e;if(!(l===-1||l>=i.length)){var u=i[l];t===`startX`&&u>=o||t===`endX`&&u<=a||this.setState(SR({},t,u),function(){n.props.onChange(n.getIndex({startX:n.state.startX,endX:n.state.endX}))})}}}},{key:`renderBackground`,value:function(){var e=this.props,t=e.x,n=e.y,r=e.width,i=e.height,a=e.fill,o=e.stroke;return _.createElement(`rect`,{stroke:o,fill:a,x:t,y:n,width:r,height:i})}},{key:`renderPanorama`,value:function(){var e=this.props,t=e.x,n=e.y,r=e.width,i=e.height,a=e.data,o=e.children,s=e.padding,c=_.Children.only(o);return c?_.cloneElement(c,{x:t,y:n,width:r,height:i,margin:s,compact:!0,data:a}):null}},{key:`renderTravellerLayer`,value:function(e,n){var r=this,i=this.props,a=i.y,o=i.travellerWidth,s=i.height,c=i.traveller,l=i.ariaLabel,u=i.data,d=i.startIndex,f=i.endIndex,p=Math.max(e,this.props.x),m=dR(dR({},Ob(this.props,!1)),{},{x:p,y:a,width:o,height:s}),h=l||`Min value: ${u[d]?.name}, Max value: ${u[f]?.name}`;return _.createElement(Ub,{tabIndex:0,role:`slider`,"aria-label":h,"aria-valuenow":e,className:`recharts-brush-traveller`,onMouseEnter:this.handleEnterSlideOrTraveller,onMouseLeave:this.handleLeaveSlideOrTraveller,onMouseDown:this.travellerDragStartHandlers[n],onTouchStart:this.travellerDragStartHandlers[n],onKeyDown:function(e){[`ArrowLeft`,`ArrowRight`].includes(e.key)&&(e.preventDefault(),e.stopPropagation(),r.handleTravellerMoveKeyboard(e.key===`ArrowRight`?1:-1,n))},onFocus:function(){r.setState({isTravellerFocused:!0})},onBlur:function(){r.setState({isTravellerFocused:!1})},style:{cursor:`col-resize`}},t.renderTraveller(c,m))}},{key:`renderSlide`,value:function(e,t){var n=this.props,r=n.y,i=n.height,a=n.stroke,o=n.travellerWidth,s=Math.min(e,t)+o,c=Math.max(Math.abs(t-e)-o,0);return _.createElement(`rect`,{className:`recharts-brush-slide`,onMouseEnter:this.handleEnterSlideOrTraveller,onMouseLeave:this.handleLeaveSlideOrTraveller,onMouseDown:this.handleSlideDragStart,onTouchStart:this.handleSlideDragStart,style:{cursor:`move`},stroke:`none`,fill:a,fillOpacity:.2,x:s,y:r,width:c,height:i})}},{key:`renderText`,value:function(){var e=this.props,t=e.startIndex,n=e.endIndex,r=e.y,i=e.height,a=e.travellerWidth,o=e.stroke,s=this.state,c=s.startX,l=s.endX,u=5,d={pointerEvents:`none`,fill:o};return _.createElement(Ub,{className:`recharts-brush-texts`},_.createElement(fE,lR({textAnchor:`end`,verticalAnchor:`middle`,x:Math.min(c,l)-u,y:r+i/2},d),this.getTextOfTick(t)),_.createElement(fE,lR({textAnchor:`start`,verticalAnchor:`middle`,x:Math.max(c,l)+a+u,y:r+i/2},d),this.getTextOfTick(n)))}},{key:`render`,value:function(){var e=this.props,t=e.data,n=e.className,r=e.children,i=e.x,a=e.y,o=e.width,s=e.height,c=e.alwaysShowText,l=this.state,u=l.startX,d=l.endX,f=l.isTextActive,p=l.isSlideMoving,m=l.isTravellerMoving,h=l.isTravellerFocused;if(!t||!t.length||!Vy(i)||!Vy(a)||!Vy(o)||!Vy(s)||o<=0||s<=0)return null;var g=Ht(`recharts-brush`,n),v=_.Children.count(r)===1,y=oR(`userSelect`,`none`);return _.createElement(Ub,{className:g,onMouseLeave:this.handleLeaveWrapper,onTouchMove:this.handleTouchMove,style:y},this.renderBackground(),v&&this.renderPanorama(),this.renderSlide(u,d),this.renderTravellerLayer(u,`startX`),this.renderTravellerLayer(d,`endX`),(f||p||m||h||c)&&this.renderText())}}],[{key:`renderDefaultTraveller`,value:function(e){var t=e.x,n=e.y,r=e.width,i=e.height,a=e.stroke,o=Math.floor(n+i/2)-1;return _.createElement(_.Fragment,null,_.createElement(`rect`,{x:t,y:n,width:r,height:i,fill:a,stroke:`none`}),_.createElement(`line`,{x1:t+1,y1:o,x2:t+r-1,y2:o,fill:`none`,stroke:`#fff`}),_.createElement(`line`,{x1:t+1,y1:o+2,x2:t+r-1,y2:o+2,fill:`none`,stroke:`#fff`}))}},{key:`renderTraveller`,value:function(e,n){return _.isValidElement(e)?_.cloneElement(e,n):(0,lb.default)(e)?e(n):t.renderDefaultTraveller(n)}},{key:`getDerivedStateFromProps`,value:function(e,t){var n=e.data,r=e.width,i=e.x,a=e.travellerWidth,o=e.updateId,s=e.startIndex,c=e.endIndex;if(n!==t.prevData||o!==t.prevUpdateId)return dR({prevData:n,prevTravellerWidth:a,prevUpdateId:o,prevX:i,prevWidth:r},n&&n.length?TR({data:n,width:r,x:i,travellerWidth:a,startIndex:s,endIndex:c}):{scale:null,scaleValues:null});if(t.scale&&(r!==t.prevWidth||i!==t.prevX||a!==t.prevTravellerWidth)){t.scale.range([i,i+r-a]);var l=t.scale.domain().map(function(e){return t.scale(e)});return{prevData:n,prevTravellerWidth:a,prevUpdateId:o,prevX:i,prevWidth:r,startX:t.scale(e.startIndex),endX:t.scale(e.endIndex),scaleValues:l}}return null}},{key:`getIndexInRange`,value:function(e,t){for(var n=e.length,r=0,i=n-1;i-r>1;){var a=Math.floor((r+i)/2);e[a]>t?i=a:r=a}return t>=e[i]?i:r}}])}(_.PureComponent);SR(DR,`displayName`,`Brush`),SR(DR,`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 OR=o(((e,t)=>{var n=PC();function r(e,t){var r;return n(e,function(e,n,i){return r=t(e,n,i),!r}),!!r}t.exports=r})),kR=o(((e,t)=>{var n=QS(),r=_C(),i=OR(),a=Av(),o=LC();function s(e,t,s){var c=a(e)?n:i;return s&&o(e,t,s)&&(t=void 0),c(e,r(t,3))}t.exports=s})),AR=function(e,t){var n=e.alwaysShow,r=e.ifOverflow;return n&&(r=`extendDomain`),r===t},jR=o(((e,t)=>{var n=IC();function r(e,t,r){t==`__proto__`&&n?n(e,t,{configurable:!0,enumerable:!0,value:r,writable:!0}):e[t]=r}t.exports=r})),MR=o(((e,t)=>{var n=jR(),r=NC(),i=_C();function a(e,t){var a={};return t=i(t,3),r(e,function(e,r,i){n(a,r,t(e,r,i))}),a}t.exports=a})),NR=o(((e,t)=>{function n(e,t){for(var n=-1,r=e==null?0:e.length;++n<r;)if(!t(e[n],n,e))return!1;return!0}t.exports=n})),PR=o(((e,t)=>{var n=PC();function r(e,t){var r=!0;return n(e,function(e,n,i){return r=!!t(e,n,i),r}),r}t.exports=r})),FR=o(((e,t)=>{var n=NR(),r=PR(),i=_C(),a=Av(),o=LC();function s(e,t,s){var c=a(e)?n:r;return s&&o(e,t,s)&&(t=void 0),c(e,i(t,3))}t.exports=s})),IR=[`x`,`y`];function LR(e){"@babel/helpers - typeof";return LR=typeof Symbol==`function`&&typeof Symbol.iterator==`symbol`?function(e){return typeof e}:function(e){return e&&typeof Symbol==`function`&&e.constructor===Symbol&&e!==Symbol.prototype?`symbol`:typeof e},LR(e)}function RR(){return RR=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},RR.apply(this,arguments)}function zR(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter(function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable})),n.push.apply(n,r)}return n}function BR(e){for(var t=1;t<arguments.length;t++){var n=arguments[t]==null?{}:arguments[t];t%2?zR(Object(n),!0).forEach(function(t){VR(e,t,n[t])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):zR(Object(n)).forEach(function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(n,t))})}return e}function VR(e,t,n){return t=HR(t),t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function HR(e){var t=UR(e,`string`);return LR(t)==`symbol`?t:t+``}function UR(e,t){if(LR(e)!=`object`||!e)return e;var n=e[Symbol.toPrimitive];if(n!==void 0){var r=n.call(e,t||`default`);if(LR(r)!=`object`)return r;throw TypeError(`@@toPrimitive must return a primitive value.`)}return(t===`string`?String:Number)(e)}function WR(e,t){if(e==null)return{};var n=GR(e,t),r,i;if(Object.getOwnPropertySymbols){var a=Object.getOwnPropertySymbols(e);for(i=0;i<a.length;i++)r=a[i],!(t.indexOf(r)>=0)&&Object.prototype.propertyIsEnumerable.call(e,r)&&(n[r]=e[r])}return n}function GR(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 KR(e,t){var n=e.x,r=e.y,i=WR(e,IR),a=`${n}`,o=parseInt(a,10),s=`${r}`,c=parseInt(s,10),l=`${t.height||i.height}`,u=parseInt(l,10),d=`${t.width||i.width}`,f=parseInt(d,10);return BR(BR(BR(BR(BR({},t),i),o?{x:o}:{}),c?{y:c}:{}),{},{height:u,width:f,name:t.name,radius:t.radius})}function qR(e){return _.createElement(yL,RR({shapeType:`rectangle`,propTransformer:KR,activeClassName:`recharts-active-bar`},e))}var JR=function(e){var t=arguments.length>1&&arguments[1]!==void 0?arguments[1]:0;return function(n,r){if(typeof e==`number`)return e;var i=Vy(n)||Hy(n);return i?e(n,r):(!i&&HM(!1),t)}},YR=[`value`,`background`],XR;function ZR(e){"@babel/helpers - typeof";return ZR=typeof Symbol==`function`&&typeof Symbol.iterator==`symbol`?function(e){return typeof e}:function(e){return e&&typeof Symbol==`function`&&e.constructor===Symbol&&e!==Symbol.prototype?`symbol`:typeof e},ZR(e)}function QR(e,t){if(e==null)return{};var n=$R(e,t),r,i;if(Object.getOwnPropertySymbols){var a=Object.getOwnPropertySymbols(e);for(i=0;i<a.length;i++)r=a[i],!(t.indexOf(r)>=0)&&Object.prototype.propertyIsEnumerable.call(e,r)&&(n[r]=e[r])}return n}function $R(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 ez(){return ez=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},ez.apply(this,arguments)}function tz(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter(function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable})),n.push.apply(n,r)}return n}function nz(e){for(var t=1;t<arguments.length;t++){var n=arguments[t]==null?{}:arguments[t];t%2?tz(Object(n),!0).forEach(function(t){pz(e,t,n[t])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):tz(Object(n)).forEach(function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(n,t))})}return e}function rz(e,t){if(!(e instanceof t))throw TypeError(`Cannot call a class as a function`)}function iz(e,t){for(var n=0;n<t.length;n++){var r=t[n];r.enumerable=r.enumerable||!1,r.configurable=!0,`value`in r&&(r.writable=!0),Object.defineProperty(e,mz(r.key),r)}}function az(e,t,n){return t&&iz(e.prototype,t),n&&iz(e,n),Object.defineProperty(e,"prototype",{writable:!1}),e}function oz(e,t,n){return t=uz(t),sz(e,lz()?Reflect.construct(t,n||[],uz(e).constructor):t.apply(e,n))}function sz(e,t){if(t&&(ZR(t)===`object`||typeof t==`function`))return t;if(t!==void 0)throw TypeError(`Derived constructors may only return object or undefined`);return cz(e)}function cz(e){if(e===void 0)throw ReferenceError(`this hasn't been initialised - super() hasn't been called`);return e}function lz(){try{var e=!Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],function(){}))}catch{}return(lz=function(){return!!e})()}function uz(e){return uz=Object.setPrototypeOf?Object.getPrototypeOf.bind():function(e){return e.__proto__||Object.getPrototypeOf(e)},uz(e)}function dz(e,t){if(typeof t!=`function`&&t!==null)throw 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&&fz(e,t)}function fz(e,t){return fz=Object.setPrototypeOf?Object.setPrototypeOf.bind():function(e,t){return e.__proto__=t,e},fz(e,t)}function pz(e,t,n){return t=mz(t),t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function mz(e){var t=hz(e,`string`);return ZR(t)==`symbol`?t:t+``}function hz(e,t){if(ZR(e)!=`object`||!e)return e;var n=e[Symbol.toPrimitive];if(n!==void 0){var r=n.call(e,t||`default`);if(ZR(r)!=`object`)return r;throw TypeError(`@@toPrimitive must return a primitive value.`)}return(t===`string`?String:Number)(e)}var gz=function(e){function t(){var e;rz(this,t);var n=[...arguments];return e=oz(this,t,[].concat(n)),pz(e,`state`,{isAnimationFinished:!1}),pz(e,`id`,Gy(`recharts-bar-`)),pz(e,`handleAnimationEnd`,function(){var t=e.props.onAnimationEnd;e.setState({isAnimationFinished:!0}),t&&t()}),pz(e,`handleAnimationStart`,function(){var t=e.props.onAnimationStart;e.setState({isAnimationFinished:!1}),t&&t()}),e}return dz(t,e),az(t,[{key:`renderRectanglesStatically`,value:function(e){var t=this,n=this.props,r=n.shape,i=n.dataKey,a=n.activeIndex,o=n.activeBar,s=Ob(this.props,!1);return e&&e.map(function(e,n){var c=n===a,l=c?o:r,u=nz(nz(nz({},s),e),{},{isActive:c,option:l,index:n,dataKey:i,onAnimationStart:t.handleAnimationStart,onAnimationEnd:t.handleAnimationEnd});return _.createElement(Ub,ez({className:`recharts-bar-rectangle`},cb(t.props,e,n),{key:`rectangle-${e?.x}-${e?.y}-${e?.value}-${n}`}),_.createElement(qR,u))})}},{key:`renderRectanglesWithAnimation`,value:function(){var e=this,t=this.props,n=t.data,r=t.layout,i=t.isAnimationActive,a=t.animationBegin,o=t.animationDuration,s=t.animationEasing,c=t.animationId,l=this.state.prevData;return _.createElement(ZF,{begin:a,duration:o,isActive:i,easing:s,from:{t:0},to:{t:1},key:`bar-${c}`,onAnimationEnd:this.handleAnimationEnd,onAnimationStart:this.handleAnimationStart},function(t){var i=t.t,a=n.map(function(e,t){var n=l&&l[t];if(n){var a=Yy(n.x,e.x),o=Yy(n.y,e.y),s=Yy(n.width,e.width),c=Yy(n.height,e.height);return nz(nz({},e),{},{x:a(i),y:o(i),width:s(i),height:c(i)})}if(r===`horizontal`){var u=Yy(0,e.height)(i);return nz(nz({},e),{},{y:e.y+e.height-u,height:u})}var d=Yy(0,e.width)(i);return nz(nz({},e),{},{width:d})});return _.createElement(Ub,null,e.renderRectanglesStatically(a))})}},{key:`renderRectangles`,value:function(){var e=this.props,t=e.data,n=e.isAnimationActive,r=this.state.prevData;return n&&t&&t.length&&(!r||!(0,wN.default)(r,t))?this.renderRectanglesWithAnimation():this.renderRectanglesStatically(t)}},{key:`renderBackground`,value:function(){var e=this,t=this.props,n=t.data,r=t.dataKey,i=t.activeIndex,a=Ob(this.props.background,!1);return n.map(function(t,n){t.value;var o=t.background,s=QR(t,YR);if(!o)return null;var c=nz(nz(nz(nz(nz({},s),{},{fill:`#eee`},o),a),cb(e.props,t,n)),{},{onAnimationStart:e.handleAnimationStart,onAnimationEnd:e.handleAnimationEnd,dataKey:r,index:n,className:`recharts-bar-background-rectangle`});return _.createElement(qR,ez({key:`background-bar-${n}`,option:e.props.background,isActive:n===i},c))})}},{key:`renderErrorBar`,value:function(e,t){if(this.props.isAnimationActive&&!this.state.isAnimationFinished)return null;var n=this.props,r=n.data,i=n.xAxis,a=n.yAxis,o=n.layout,s=n.children,c=xb(s,pN);if(!c)return null;var l=o===`vertical`?r[0].height/2:r[0].width/2,u=function(e,t){var n=Array.isArray(e.value)?e.value[1]:e.value;return{x:e.x,y:e.y,value:n,errorVal:LN(e,t)}},d={clipPath:e?`url(#clipPath-${t})`:null};return _.createElement(Ub,d,c.map(function(e){return _.cloneElement(e,{key:`error-bar-${t}-${e.props.dataKey}`,data:r,xAxis:i,yAxis:a,layout:o,offset:l,dataPointFormatter:u})}))}},{key:`render`,value:function(){var e=this.props,t=e.hide,n=e.data,r=e.className,i=e.xAxis,a=e.yAxis,o=e.left,s=e.top,c=e.width,l=e.height,u=e.isAnimationActive,d=e.background,f=e.id;if(t||!n||!n.length)return null;var p=this.state.isAnimationFinished,m=Ht(`recharts-bar`,r),h=i&&i.allowDataOverflow,g=a&&a.allowDataOverflow,v=h||g,y=(0,Ry.default)(f)?this.id:f;return _.createElement(Ub,{className:m},h||g?_.createElement(`defs`,null,_.createElement(`clipPath`,{id:`clipPath-${y}`},_.createElement(`rect`,{x:h?o:o-c/2,y:g?s:s-l/2,width:h?c:c*2,height:g?l:l*2}))):null,_.createElement(Ub,{className:`recharts-bar-rectangles`,clipPath:v?`url(#clipPath-${y})`:null},d?this.renderBackground():null,this.renderRectangles()),this.renderErrorBar(v,y),(!u||p)&&LP.renderCallByParent(this.props,n))}}],[{key:`getDerivedStateFromProps`,value:function(e,t){return e.animationId===t.prevAnimationId?e.data===t.curData?null:{curData:e.data}:{prevAnimationId:e.animationId,curData:e.data,prevData:t.curData}}}])}(_.PureComponent);XR=gz,pz(gz,`displayName`,`Bar`),pz(gz,`defaultProps`,{xAxisId:0,yAxisId:0,legendType:`rect`,minPointSize:0,hide:!1,data:[],layout:`vertical`,activeBar:!1,isAnimationActive:!Cw.isSsr,animationBegin:0,animationDuration:400,animationEasing:`ease`}),pz(gz,`getComposedData`,function(e){var t=e.props,n=e.item,r=e.barPosition,i=e.bandSize,a=e.xAxis,o=e.yAxis,s=e.xAxisTicks,c=e.yAxisTicks,l=e.stackedData,u=e.dataStartIndex,d=e.displayedData,f=e.offset,p=tP(r,n);if(!p)return null;var m=t.layout,h=n.type.defaultProps,g=h===void 0?n.props:nz(nz({},h),n.props),_=g.dataKey,v=g.children,y=g.minPointSize,b=m===`horizontal`?o:a,x=l?b.scale.domain():null,S=Fne({numericAxis:b}),C=xb(v,cT);return nz({data:d.map(function(e,t){var r,d,f,h,g,v;l?r=nP(l[u+t],x):(r=LN(e,_),Array.isArray(r)||(r=[S,r]));var b=JR(y,XR.defaultProps.minPointSize)(r[1],t);if(m===`horizontal`){var w=[o.scale(r[0]),o.scale(r[1])],T=w[0],E=w[1];d=oP({axis:a,ticks:s,bandSize:i,offset:p.offset,entry:e,index:t}),f=E??T??void 0,h=p.size;var D=T-E;if(g=Number.isNaN(D)?0:D,v={x:d,y:o.y,width:h,height:o.height},Math.abs(b)>0&&Math.abs(g)<Math.abs(b)){var O=zy(g||b)*(Math.abs(b)-Math.abs(g));f-=O,g+=O}}else{var k=[a.scale(r[0]),a.scale(r[1])],A=k[0],j=k[1];if(d=A,f=oP({axis:o,ticks:c,bandSize:i,offset:p.offset,entry:e,index:t}),h=j-A,g=p.size,v={x:a.x,y:f,width:a.width,height:g},Math.abs(b)>0&&Math.abs(h)<Math.abs(b)){var M=zy(h||b)*(Math.abs(b)-Math.abs(h));h+=M}}return nz(nz(nz({},e),{},{x:d,y:f,width:h,height:g,value:l?r:r[1],payload:e,background:v},C&&C[t]&&C[t].props),{},{tooltipPayload:[pP(n,e)],tooltipPosition:{x:d+h/2,y:f+g/2}})}),layout:m},f)});var _z=l(MR()),vz=l(FR());function yz(e){"@babel/helpers - typeof";return yz=typeof Symbol==`function`&&typeof Symbol.iterator==`symbol`?function(e){return typeof e}:function(e){return e&&typeof Symbol==`function`&&e.constructor===Symbol&&e!==Symbol.prototype?`symbol`:typeof e},yz(e)}function bz(e,t){if(!(e instanceof t))throw TypeError(`Cannot call a class as a function`)}function xz(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,Ez(r.key),r)}}function Sz(e,t,n){return t&&xz(e.prototype,t),n&&xz(e,n),Object.defineProperty(e,"prototype",{writable:!1}),e}function Cz(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter(function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable})),n.push.apply(n,r)}return n}function wz(e){for(var t=1;t<arguments.length;t++){var n=arguments[t]==null?{}:arguments[t];t%2?Cz(Object(n),!0).forEach(function(t){Tz(e,t,n[t])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):Cz(Object(n)).forEach(function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(n,t))})}return e}function Tz(e,t,n){return t=Ez(t),t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function Ez(e){var t=Dz(e,`string`);return yz(t)==`symbol`?t:t+``}function Dz(e,t){if(yz(e)!=`object`||!e)return e;var n=e[Symbol.toPrimitive];if(n!==void 0){var r=n.call(e,t||`default`);if(yz(r)!=`object`)return r;throw TypeError(`@@toPrimitive must return a primitive value.`)}return(t===`string`?String:Number)(e)}var Oz=function(e,t,n,r,i){var a=e.width,o=e.height,s=e.layout,c=e.children,l=Object.keys(t),u={left:n.left,leftMirror:n.left,right:a-n.right,rightMirror:a-n.right,top:n.top,topMirror:n.top,bottom:o-n.bottom,bottomMirror:o-n.bottom},d=!!Sb(c,gz);return l.reduce(function(a,o){var c=t[o],l=c.orientation,f=c.domain,p=c.padding,m=p===void 0?{}:p,h=c.mirror,g=c.reversed,_=`${l}${h?`Mirror`:``}`,v,y,b,x,S;if(c.type===`number`&&(c.padding===`gap`||c.padding===`no-gap`)){var C=f[1]-f[0],w=1/0,T=c.categoricalDomain.sort(Zy);if(T.forEach(function(e,t){t>0&&(w=Math.min((e||0)-(T[t-1]||0),w))}),Number.isFinite(w)){var E=w/C,D=c.layout===`vertical`?n.height:n.width;if(c.padding===`gap`&&(v=E*D/2),c.padding===`no-gap`){var O=Ky(e.barCategoryGap,E*D),k=E*D/2;v=k-O-(k-O)/D*O}}}y=r===`xAxis`?[n.left+(m.left||0)+(v||0),n.left+n.width-(m.right||0)-(v||0)]:r===`yAxis`?s===`horizontal`?[n.top+n.height-(m.bottom||0),n.top+(m.top||0)]:[n.top+(m.top||0)+(v||0),n.top+n.height-(m.bottom||0)-(v||0)]:c.range,g&&(y=[y[1],y[0]]);var A=QN(c,i,d),j=A.scale,M=A.realScaleType;j.domain(f).range(y),eP(j);var N=iP(j,wz(wz({},c),{},{realScaleType:M}));r===`xAxis`?(S=l===`top`&&!h||l===`bottom`&&h,b=n.left,x=u[_]-S*c.height):r===`yAxis`&&(S=l===`left`&&!h||l===`right`&&h,b=u[_]-S*c.width,x=n.top);var P=wz(wz(wz({},c),N),{},{realScaleType:M,x:b,y:x,scale:j,width:r===`xAxis`?n.width:c.width,height:r===`yAxis`?n.height:c.height});return P.bandSize=dP(P,N),!c.hide&&r===`xAxis`?u[_]+=(S?-1:1)*P.height:c.hide||(u[_]+=(S?-1:1)*P.width),wz(wz({},a),{},Tz({},o,P))},{})},kz=function(e,t){var n=e.x,r=e.y,i=t.x,a=t.y;return{x:Math.min(n,i),y:Math.min(r,a),width:Math.abs(i-n),height:Math.abs(a-r)}},Az=function(e){var t=e.x1,n=e.y1,r=e.x2,i=e.y2;return kz({x:t,y:n},{x:r,y:i})},jz=function(){function e(t){bz(this,e),this.scale=t}return Sz(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(e){var t=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{},n=t.bandAware,r=t.position;if(e!==void 0){if(r)switch(r){case`start`:return this.scale(e);case`middle`:var i=this.bandwidth?this.bandwidth()/2:0;return this.scale(e)+i;case`end`:var a=this.bandwidth?this.bandwidth():0;return this.scale(e)+a;default:return this.scale(e)}if(n){var o=this.bandwidth?this.bandwidth()/2:0;return this.scale(e)+o}return this.scale(e)}}},{key:`isInRange`,value:function(e){var t=this.range(),n=t[0],r=t[t.length-1];return n<=r?e>=n&&e<=r:e>=r&&e<=n}}],[{key:`create`,value:function(t){return new e(t)}}])}();Tz(jz,`EPS`,1e-4);var Mz=function(e){var t=Object.keys(e).reduce(function(t,n){return wz(wz({},t),{},Tz({},n,jz.create(e[n])))},{});return wz(wz({},t),{},{apply:function(e){var n=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{},r=n.bandAware,i=n.position;return(0,_z.default)(e,function(e,n){return t[n].apply(e,{bandAware:r,position:i})})},isInRange:function(e){return(0,vz.default)(e,function(e,n){return t[n].isInRange(e)})}})};function Nz(e){return(e%180+180)%180}var Pz=function(e){var t=e.width,n=e.height,r=Nz(arguments.length>1&&arguments[1]!==void 0?arguments[1]:0)*Math.PI/180,i=Math.atan(n/t),a=r>i&&r<Math.PI-i?n/Math.sin(r):t/Math.cos(r);return Math.abs(a)},Fz=o(((e,t)=>{var n=_C(),r=uC(),i=dC();function a(e){return function(t,a,o){var s=Object(t);if(!r(t)){var c=n(a,3);t=i(t),a=function(e){return c(s[e],e,s)}}var l=e(t,a,o);return l>-1?s[c?t[l]:l]:void 0}}t.exports=a})),Iz=o(((e,t)=>{var n=XL();function r(e){var t=n(e),r=t%1;return t===t?r?t-r:t:0}t.exports=r})),Lz=o(((e,t)=>{var n=vC(),r=_C(),i=Iz(),a=Math.max;function o(e,t,o){var s=e==null?0:e.length;if(!s)return-1;var c=o==null?0:i(o);return c<0&&(c=a(s+c,0)),n(e,r(t,3),c)}t.exports=o})),Rz=o(((e,t)=>{t.exports=Fz()(Lz())})),zz=(0,l(vy()).default)(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(``)});Rz();var Bz=(0,_.createContext)(void 0),Vz=(0,_.createContext)(void 0),Hz=(0,_.createContext)(void 0),Uz=(0,_.createContext)({}),Wz=(0,_.createContext)(void 0),Gz=(0,_.createContext)(0),Kz=(0,_.createContext)(0),qz=function(e){var t=e.state,n=t.xAxisMap,r=t.yAxisMap,i=t.offset,a=e.clipPathId,o=e.children,s=e.width,c=e.height,l=zz(i);return _.createElement(Bz.Provider,{value:n},_.createElement(Vz.Provider,{value:r},_.createElement(Uz.Provider,{value:i},_.createElement(Hz.Provider,{value:l},_.createElement(Wz.Provider,{value:a},_.createElement(Gz.Provider,{value:c},_.createElement(Kz.Provider,{value:s},o)))))))},Jz=function(){return(0,_.useContext)(Wz)},Yz=function(e){var t=(0,_.useContext)(Bz);t??HM(!1);var n=t[e];return n??HM(!1),n},Xz=function(e){var t=(0,_.useContext)(Vz);t??HM(!1);var n=t[e];return n??HM(!1),n},Zz=function(){return(0,_.useContext)(Hz)},Qz=function(){return(0,_.useContext)(Kz)},$z=function(){return(0,_.useContext)(Gz)},eB=l(kR());function tB(e){"@babel/helpers - typeof";return tB=typeof Symbol==`function`&&typeof Symbol.iterator==`symbol`?function(e){return typeof e}:function(e){return e&&typeof Symbol==`function`&&e.constructor===Symbol&&e!==Symbol.prototype?`symbol`:typeof e},tB(e)}function nB(e,t){if(!(e instanceof t))throw TypeError(`Cannot call a class as a function`)}function rB(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,hB(r.key),r)}}function iB(e,t,n){return t&&rB(e.prototype,t),n&&rB(e,n),Object.defineProperty(e,"prototype",{writable:!1}),e}function aB(e,t,n){return t=lB(t),oB(e,cB()?Reflect.construct(t,n||[],lB(e).constructor):t.apply(e,n))}function oB(e,t){if(t&&(tB(t)===`object`||typeof t==`function`))return t;if(t!==void 0)throw TypeError(`Derived constructors may only return object or undefined`);return sB(e)}function sB(e){if(e===void 0)throw ReferenceError(`this hasn't been initialised - super() hasn't been called`);return e}function cB(){try{var e=!Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],function(){}))}catch{}return(cB=function(){return!!e})()}function lB(e){return lB=Object.setPrototypeOf?Object.getPrototypeOf.bind():function(e){return e.__proto__||Object.getPrototypeOf(e)},lB(e)}function uB(e,t){if(typeof t!=`function`&&t!==null)throw 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&&dB(e,t)}function dB(e,t){return dB=Object.setPrototypeOf?Object.setPrototypeOf.bind():function(e,t){return e.__proto__=t,e},dB(e,t)}function fB(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter(function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable})),n.push.apply(n,r)}return n}function pB(e){for(var t=1;t<arguments.length;t++){var n=arguments[t]==null?{}:arguments[t];t%2?fB(Object(n),!0).forEach(function(t){mB(e,t,n[t])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):fB(Object(n)).forEach(function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(n,t))})}return e}function mB(e,t,n){return t=hB(t),t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function hB(e){var t=gB(e,`string`);return tB(t)==`symbol`?t:t+``}function gB(e,t){if(tB(e)!=`object`||!e)return e;var n=e[Symbol.toPrimitive];if(n!==void 0){var r=n.call(e,t||`default`);if(tB(r)!=`object`)return r;throw TypeError(`@@toPrimitive must return a primitive value.`)}return(t===`string`?String:Number)(e)}function _B(e,t){return SB(e)||xB(e,t)||yB(e,t)||vB()}function vB(){throw TypeError(`Invalid attempt to destructure non-iterable instance.
|
|
113
|
-
In order to be iterable, non-array objects must have a [Symbol.iterator]() method.`)}function yB(e,t){if(e){if(typeof e==`string`)return bB(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 bB(e,t)}}function bB(e,t){(t==null||t>e.length)&&(t=e.length);for(var n=0,r=Array(t);n<t;n++)r[n]=e[n];return r}function xB(e,t){var n=e==null?null:typeof Symbol<`u`&&e[Symbol.iterator]||e[`@@iterator`];if(n!=null){var r,i,a,o,s=[],c=!0,l=!1;try{if(a=(n=n.call(e)).next,t===0){if(Object(n)!==n)return;c=!1}else for(;!(c=(r=a.call(n)).done)&&(s.push(r.value),s.length!==t);c=!0);}catch(e){l=!0,i=e}finally{try{if(!c&&n.return!=null&&(o=n.return(),Object(o)!==o))return}finally{if(l)throw i}}return s}}function SB(e){if(Array.isArray(e))return e}function CB(){return CB=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},CB.apply(this,arguments)}var wB=function(e,t){return _.isValidElement(e)?_.cloneElement(e,t):(0,lb.default)(e)?e(t):_.createElement(`line`,CB({},t,{className:`recharts-reference-line-line`}))},TB=function(e,t,n,r,i,a,o,s,c){var l=i.x,u=i.y,d=i.width,f=i.height;if(n){var p=c.y,m=e.y.apply(p,{position:a});if(AR(c,`discard`)&&!e.y.isInRange(m))return null;var h=[{x:l+d,y:m},{x:l,y:m}];return s===`left`?h.reverse():h}if(t){var g=c.x,_=e.x.apply(g,{position:a});if(AR(c,`discard`)&&!e.x.isInRange(_))return null;var v=[{x:_,y:u+f},{x:_,y:u}];return o===`top`?v.reverse():v}if(r){var y=c.segment.map(function(t){return e.apply(t,{position:a})});return AR(c,`discard`)&&(0,eB.default)(y,function(t){return!e.isInRange(t)})?null:y}return null};function EB(e){var t=e.x,n=e.y,r=e.segment,i=e.xAxisId,a=e.yAxisId,o=e.shape,s=e.className;e.alwaysShow;var c=Jz(),l=Yz(i),u=Xz(a),d=Zz();if(!c||!d)return null;var f=TB(Mz({x:l.scale,y:u.scale}),Uy(t),Uy(n),r&&r.length===2,d,e.position,l.orientation,u.orientation,e);if(!f)return null;var p=_B(f,2),m=p[0],h=m.x,g=m.y,v=p[1],y=v.x,b=v.y,x=pB(pB({clipPath:AR(e,`hidden`)?`url(#${c})`:void 0},Ob(e,!0)),{},{x1:h,y1:g,x2:y,y2:b});return _.createElement(Ub,{className:Ht(`recharts-reference-line`,s)},wB(o,x),kP.renderCallByParent(e,Az({x1:h,y1:g,x2:y,y2:b})))}var DB=function(e){function t(){return nB(this,t),aB(this,t,arguments)}return uB(t,e),iB(t,[{key:`render`,value:function(){return _.createElement(EB,this.props)}}])}(_.Component);mB(DB,`displayName`,`ReferenceLine`),mB(DB,`defaultProps`,{isFront:!1,ifOverflow:`discard`,xAxisId:0,yAxisId:0,fill:`none`,stroke:`#ccc`,fillOpacity:1,strokeWidth:1,position:`middle`});function OB(){return OB=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},OB.apply(this,arguments)}function kB(e){"@babel/helpers - typeof";return kB=typeof Symbol==`function`&&typeof Symbol.iterator==`symbol`?function(e){return typeof e}:function(e){return e&&typeof Symbol==`function`&&e.constructor===Symbol&&e!==Symbol.prototype?`symbol`:typeof e},kB(e)}function AB(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter(function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable})),n.push.apply(n,r)}return n}function jB(e){for(var t=1;t<arguments.length;t++){var n=arguments[t]==null?{}:arguments[t];t%2?AB(Object(n),!0).forEach(function(t){HB(e,t,n[t])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):AB(Object(n)).forEach(function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(n,t))})}return e}function MB(e,t){if(!(e instanceof t))throw TypeError(`Cannot call a class as a function`)}function NB(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,UB(r.key),r)}}function PB(e,t,n){return t&&NB(e.prototype,t),n&&NB(e,n),Object.defineProperty(e,"prototype",{writable:!1}),e}function FB(e,t,n){return t=zB(t),IB(e,RB()?Reflect.construct(t,n||[],zB(e).constructor):t.apply(e,n))}function IB(e,t){if(t&&(kB(t)===`object`||typeof t==`function`))return t;if(t!==void 0)throw TypeError(`Derived constructors may only return object or undefined`);return LB(e)}function LB(e){if(e===void 0)throw ReferenceError(`this hasn't been initialised - super() hasn't been called`);return e}function RB(){try{var e=!Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],function(){}))}catch{}return(RB=function(){return!!e})()}function zB(e){return zB=Object.setPrototypeOf?Object.getPrototypeOf.bind():function(e){return e.__proto__||Object.getPrototypeOf(e)},zB(e)}function BB(e,t){if(typeof t!=`function`&&t!==null)throw 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&&VB(e,t)}function VB(e,t){return VB=Object.setPrototypeOf?Object.setPrototypeOf.bind():function(e,t){return e.__proto__=t,e},VB(e,t)}function HB(e,t,n){return t=UB(t),t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function UB(e){var t=WB(e,`string`);return kB(t)==`symbol`?t:t+``}function WB(e,t){if(kB(e)!=`object`||!e)return e;var n=e[Symbol.toPrimitive];if(n!==void 0){var r=n.call(e,t||`default`);if(kB(r)!=`object`)return r;throw TypeError(`@@toPrimitive must return a primitive value.`)}return(t===`string`?String:Number)(e)}var GB=function(e){var t=e.x,n=e.y,r=e.xAxis,i=e.yAxis,a=Mz({x:r.scale,y:i.scale}),o=a.apply({x:t,y:n},{bandAware:!0});return AR(e,`discard`)&&!a.isInRange(o)?null:o},KB=function(e){function t(){return MB(this,t),FB(this,t,arguments)}return BB(t,e),PB(t,[{key:`render`,value:function(){var e=this.props,n=e.x,r=e.y,i=e.r;e.alwaysShow;var a=e.clipPathId,o=Uy(n),s=Uy(r);if(!o||!s)return null;var c=GB(this.props);if(!c)return null;var l=c.x,u=c.y,d=this.props,f=d.shape,p=d.className,m=jB(jB({clipPath:AR(this.props,`hidden`)?`url(#${a})`:void 0},Ob(this.props,!0)),{},{cx:l,cy:u});return _.createElement(Ub,{className:Ht(`recharts-reference-dot`,p)},t.renderDot(f,m),kP.renderCallByParent(this.props,{x:l-i,y:u-i,width:2*i,height:2*i}))}}])}(_.Component);HB(KB,`displayName`,`ReferenceDot`),HB(KB,`defaultProps`,{isFront:!1,ifOverflow:`discard`,xAxisId:0,yAxisId:0,r:10,fill:`#fff`,stroke:`#ccc`,fillOpacity:1,strokeWidth:1}),HB(KB,`renderDot`,function(e,t){return _.isValidElement(e)?_.cloneElement(e,t):(0,lb.default)(e)?e(t):_.createElement(dI,OB({},t,{cx:t.cx,cy:t.cy,className:`recharts-reference-dot-dot`}))});function qB(){return qB=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},qB.apply(this,arguments)}function JB(e){"@babel/helpers - typeof";return JB=typeof Symbol==`function`&&typeof Symbol.iterator==`symbol`?function(e){return typeof e}:function(e){return e&&typeof Symbol==`function`&&e.constructor===Symbol&&e!==Symbol.prototype?`symbol`:typeof e},JB(e)}function YB(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter(function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable})),n.push.apply(n,r)}return n}function XB(e){for(var t=1;t<arguments.length;t++){var n=arguments[t]==null?{}:arguments[t];t%2?YB(Object(n),!0).forEach(function(t){sV(e,t,n[t])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):YB(Object(n)).forEach(function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(n,t))})}return e}function ZB(e,t){if(!(e instanceof t))throw TypeError(`Cannot call a class as a function`)}function QB(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,cV(r.key),r)}}function $B(e,t,n){return t&&QB(e.prototype,t),n&&QB(e,n),Object.defineProperty(e,"prototype",{writable:!1}),e}function eV(e,t,n){return t=iV(t),tV(e,rV()?Reflect.construct(t,n||[],iV(e).constructor):t.apply(e,n))}function tV(e,t){if(t&&(JB(t)===`object`||typeof t==`function`))return t;if(t!==void 0)throw TypeError(`Derived constructors may only return object or undefined`);return nV(e)}function nV(e){if(e===void 0)throw ReferenceError(`this hasn't been initialised - super() hasn't been called`);return e}function rV(){try{var e=!Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],function(){}))}catch{}return(rV=function(){return!!e})()}function iV(e){return iV=Object.setPrototypeOf?Object.getPrototypeOf.bind():function(e){return e.__proto__||Object.getPrototypeOf(e)},iV(e)}function aV(e,t){if(typeof t!=`function`&&t!==null)throw 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&&oV(e,t)}function oV(e,t){return oV=Object.setPrototypeOf?Object.setPrototypeOf.bind():function(e,t){return e.__proto__=t,e},oV(e,t)}function sV(e,t,n){return t=cV(t),t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function cV(e){var t=lV(e,`string`);return JB(t)==`symbol`?t:t+``}function lV(e,t){if(JB(e)!=`object`||!e)return e;var n=e[Symbol.toPrimitive];if(n!==void 0){var r=n.call(e,t||`default`);if(JB(r)!=`object`)return r;throw TypeError(`@@toPrimitive must return a primitive value.`)}return(t===`string`?String:Number)(e)}var uV=function(e,t,n,r,i){var a=i.x1,o=i.x2,s=i.y1,c=i.y2,l=i.xAxis,u=i.yAxis;if(!l||!u)return null;var d=Mz({x:l.scale,y:u.scale}),f={x:e?d.x.apply(a,{position:`start`}):d.x.rangeMin,y:n?d.y.apply(s,{position:`start`}):d.y.rangeMin},p={x:t?d.x.apply(o,{position:`end`}):d.x.rangeMax,y:r?d.y.apply(c,{position:`end`}):d.y.rangeMax};return AR(i,`discard`)&&(!d.isInRange(f)||!d.isInRange(p))?null:kz(f,p)},dV=function(e){function t(){return ZB(this,t),eV(this,t,arguments)}return aV(t,e),$B(t,[{key:`render`,value:function(){var e=this.props,n=e.x1,r=e.x2,i=e.y1,a=e.y2,o=e.className;e.alwaysShow;var s=e.clipPathId,c=Uy(n),l=Uy(r),u=Uy(i),d=Uy(a),f=this.props.shape;if(!c&&!l&&!u&&!d&&!f)return null;var p=uV(c,l,u,d,this.props);if(!p&&!f)return null;var m=AR(this.props,`hidden`)?`url(#${s})`:void 0;return _.createElement(Ub,{className:Ht(`recharts-reference-area`,o)},t.renderRect(f,XB(XB({clipPath:m},Ob(this.props,!0)),p)),kP.renderCallByParent(this.props,p))}}])}(_.Component);sV(dV,`displayName`,`ReferenceArea`),sV(dV,`defaultProps`,{isFront:!1,ifOverflow:`discard`,xAxisId:0,yAxisId:0,r:10,fill:`#ccc`,fillOpacity:.5,stroke:`none`,strokeWidth:1}),sV(dV,`renderRect`,function(e,t){return _.isValidElement(e)?_.cloneElement(e,t):(0,lb.default)(e)?e(t):_.createElement(iI,qB({},t,{className:`recharts-reference-area-rect`}))});function fV(e,t,n){if(t<1)return[];if(t===1&&n===void 0)return e;for(var r=[],i=0;i<e.length;i+=t)if(n===void 0||n(e[i])===!0)r.push(e[i]);else return;return r}function pV(e,t,n){return Pz({width:e.width+t.width,height:e.height+t.height},n)}function mV(e,t,n){var r=n===`width`,i=e.x,a=e.y,o=e.width,s=e.height;return t===1?{start:r?i:a,end:r?i+o:a+s}:{start:r?i+o:a+s,end:r?i:a}}function hV(e,t,n,r,i){if(e*t<e*r||e*t>e*i)return!1;var a=n();return e*(t-e*a/2-r)>=0&&e*(t+e*a/2-i)<=0}function gV(e,t){return fV(e,t+1)}function _V(e,t,n,r,i){for(var a=(r||[]).slice(),o=t.start,s=t.end,c=0,l=1,u=o,d=function(){var t=r?.[c];if(t===void 0)return{v:fV(r,l)};var a=c,d,f=function(){return d===void 0&&(d=n(t,a)),d},p=t.coordinate,m=c===0||hV(e,p,f,u,s);m||(c=0,u=o,l+=1),m&&(u=p+e*(f()/2+i),c+=l)},f;l<=a.length;)if(f=d(),f)return f.v;return[]}function vV(e){"@babel/helpers - typeof";return vV=typeof Symbol==`function`&&typeof Symbol.iterator==`symbol`?function(e){return typeof e}:function(e){return e&&typeof Symbol==`function`&&e.constructor===Symbol&&e!==Symbol.prototype?`symbol`:typeof e},vV(e)}function yV(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter(function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable})),n.push.apply(n,r)}return n}function bV(e){for(var t=1;t<arguments.length;t++){var n=arguments[t]==null?{}:arguments[t];t%2?yV(Object(n),!0).forEach(function(t){xV(e,t,n[t])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):yV(Object(n)).forEach(function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(n,t))})}return e}function xV(e,t,n){return t=SV(t),t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function SV(e){var t=CV(e,`string`);return vV(t)==`symbol`?t:t+``}function CV(e,t){if(vV(e)!=`object`||!e)return e;var n=e[Symbol.toPrimitive];if(n!==void 0){var r=n.call(e,t||`default`);if(vV(r)!=`object`)return r;throw TypeError(`@@toPrimitive must return a primitive value.`)}return(t===`string`?String:Number)(e)}function wV(e,t,n,r,i){for(var a=(r||[]).slice(),o=a.length,s=t.start,c=t.end,l=function(t){var r=a[t],l,u=function(){return l===void 0&&(l=n(r,t)),l};if(t===o-1){var d=e*(r.coordinate+e*u()/2-c);a[t]=r=bV(bV({},r),{},{tickCoord:d>0?r.coordinate-d*e:r.coordinate})}else a[t]=r=bV(bV({},r),{},{tickCoord:r.coordinate});hV(e,r.tickCoord,u,s,c)&&(c=r.tickCoord-e*(u()/2+i),a[t]=bV(bV({},r),{},{isShow:!0}))},u=o-1;u>=0;u--)l(u);return a}function TV(e,t,n,r,i,a){var o=(r||[]).slice(),s=o.length,c=t.start,l=t.end;if(a){var u=r[s-1],d=n(u,s-1),f=e*(u.coordinate+e*d/2-l);o[s-1]=u=bV(bV({},u),{},{tickCoord:f>0?u.coordinate-f*e:u.coordinate}),hV(e,u.tickCoord,function(){return d},c,l)&&(l=u.tickCoord-e*(d/2+i),o[s-1]=bV(bV({},u),{},{isShow:!0}))}for(var p=a?s-1:s,m=function(t){var r=o[t],a,s=function(){return a===void 0&&(a=n(r,t)),a};if(t===0){var u=e*(r.coordinate-e*s()/2-c);o[t]=r=bV(bV({},r),{},{tickCoord:u<0?r.coordinate-u*e:r.coordinate})}else o[t]=r=bV(bV({},r),{},{tickCoord:r.coordinate});hV(e,r.tickCoord,s,c,l)&&(c=r.tickCoord+e*(s()/2+i),o[t]=bV(bV({},r),{},{isShow:!0}))},h=0;h<p;h++)m(h);return o}function EV(e,t,n){var r=e.tick,i=e.ticks,a=e.viewBox,o=e.minTickGap,s=e.orientation,c=e.interval,l=e.tickFormatter,u=e.unit,d=e.angle;if(!i||!i.length||!r)return[];if(Vy(c)||Cw.isSsr)return gV(i,typeof c==`number`&&Vy(c)?c:0);var f=[],p=s===`top`||s===`bottom`?`width`:`height`,m=u&&p===`width`?bT(u,{fontSize:t,letterSpacing:n}):{width:0,height:0},h=function(e,r){var i=(0,lb.default)(l)?l(e.value,r):e.value;return p===`width`?pV(bT(i,{fontSize:t,letterSpacing:n}),m,d):bT(i,{fontSize:t,letterSpacing:n})[p]},g=i.length>=2?zy(i[1].coordinate-i[0].coordinate):1,_=mV(a,g,p);return c===`equidistantPreserveStart`?_V(g,_,h,i,o):(f=c===`preserveStart`||c===`preserveStartEnd`?TV(g,_,h,i,o,c===`preserveStartEnd`):wV(g,_,h,i,o),f.filter(function(e){return e.isShow}))}var DV=[`viewBox`],OV=[`viewBox`],kV=[`ticks`];function AV(e){"@babel/helpers - typeof";return AV=typeof Symbol==`function`&&typeof Symbol.iterator==`symbol`?function(e){return typeof e}:function(e){return e&&typeof Symbol==`function`&&e.constructor===Symbol&&e!==Symbol.prototype?`symbol`:typeof e},AV(e)}function jV(){return jV=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},jV.apply(this,arguments)}function MV(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter(function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable})),n.push.apply(n,r)}return n}function NV(e){for(var t=1;t<arguments.length;t++){var n=arguments[t]==null?{}:arguments[t];t%2?MV(Object(n),!0).forEach(function(t){KV(e,t,n[t])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):MV(Object(n)).forEach(function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(n,t))})}return e}function PV(e,t){if(e==null)return{};var n=FV(e,t),r,i;if(Object.getOwnPropertySymbols){var a=Object.getOwnPropertySymbols(e);for(i=0;i<a.length;i++)r=a[i],!(t.indexOf(r)>=0)&&Object.prototype.propertyIsEnumerable.call(e,r)&&(n[r]=e[r])}return n}function FV(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 IV(e,t){if(!(e instanceof t))throw TypeError(`Cannot call a class as a function`)}function LV(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,qV(r.key),r)}}function RV(e,t,n){return t&&LV(e.prototype,t),n&&LV(e,n),Object.defineProperty(e,"prototype",{writable:!1}),e}function zV(e,t,n){return t=UV(t),BV(e,HV()?Reflect.construct(t,n||[],UV(e).constructor):t.apply(e,n))}function BV(e,t){if(t&&(AV(t)===`object`||typeof t==`function`))return t;if(t!==void 0)throw TypeError(`Derived constructors may only return object or undefined`);return VV(e)}function VV(e){if(e===void 0)throw ReferenceError(`this hasn't been initialised - super() hasn't been called`);return e}function HV(){try{var e=!Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],function(){}))}catch{}return(HV=function(){return!!e})()}function UV(e){return UV=Object.setPrototypeOf?Object.getPrototypeOf.bind():function(e){return e.__proto__||Object.getPrototypeOf(e)},UV(e)}function WV(e,t){if(typeof t!=`function`&&t!==null)throw 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&&GV(e,t)}function GV(e,t){return GV=Object.setPrototypeOf?Object.setPrototypeOf.bind():function(e,t){return e.__proto__=t,e},GV(e,t)}function KV(e,t,n){return t=qV(t),t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function qV(e){var t=JV(e,`string`);return AV(t)==`symbol`?t:t+``}function JV(e,t){if(AV(e)!=`object`||!e)return e;var n=e[Symbol.toPrimitive];if(n!==void 0){var r=n.call(e,t||`default`);if(AV(r)!=`object`)return r;throw TypeError(`@@toPrimitive must return a primitive value.`)}return(t===`string`?String:Number)(e)}var YV=function(e){function t(e){var n;return IV(this,t),n=zV(this,t,[e]),n.state={fontSize:``,letterSpacing:``},n}return WV(t,e),RV(t,[{key:`shouldComponentUpdate`,value:function(e,t){var n=e.viewBox,r=PV(e,DV),i=this.props,a=i.viewBox,o=PV(i,OV);return!Qy(n,a)||!Qy(r,o)||!Qy(t,this.state)}},{key:`componentDidMount`,value:function(){var e=this.layerReference;if(e){var t=e.getElementsByClassName(`recharts-cartesian-axis-tick-value`)[0];t&&this.setState({fontSize:window.getComputedStyle(t).fontSize,letterSpacing:window.getComputedStyle(t).letterSpacing})}}},{key:`getTickLineCoord`,value:function(e){var t=this.props,n=t.x,r=t.y,i=t.width,a=t.height,o=t.orientation,s=t.tickSize,c=t.mirror,l=t.tickMargin,u,d,f,p,m,h,g=c?-1:1,_=e.tickSize||s,v=Vy(e.tickCoord)?e.tickCoord:e.coordinate;switch(o){case`top`:u=d=e.coordinate,p=r+ +!c*a,f=p-g*_,h=f-g*l,m=v;break;case`left`:f=p=e.coordinate,d=n+ +!c*i,u=d-g*_,m=u-g*l,h=v;break;case`right`:f=p=e.coordinate,d=n+ +c*i,u=d+g*_,m=u+g*l,h=v;break;default:u=d=e.coordinate,p=r+ +c*a,f=p+g*_,h=f+g*l,m=v}return{line:{x1:u,y1:f,x2:d,y2:p},tick:{x:m,y:h}}}},{key:`getTickTextAnchor`,value:function(){var e=this.props,t=e.orientation,n=e.mirror,r;switch(t){case`left`:r=n?`start`:`end`;break;case`right`:r=n?`end`:`start`;break;default:r=`middle`}return r}},{key:`getTickVerticalAnchor`,value:function(){var e=this.props,t=e.orientation,n=e.mirror,r=`end`;switch(t){case`left`:case`right`:r=`middle`;break;case`top`:r=n?`start`:`end`;break;default:r=n?`end`:`start`}return r}},{key:`renderAxisLine`,value:function(){var e=this.props,t=e.x,n=e.y,r=e.width,i=e.height,a=e.orientation,o=e.mirror,s=e.axisLine,c=NV(NV(NV({},Ob(this.props,!1)),Ob(s,!1)),{},{fill:`none`});if(a===`top`||a===`bottom`){var l=+(a===`top`&&!o||a===`bottom`&&o);c=NV(NV({},c),{},{x1:t,y1:n+l*i,x2:t+r,y2:n+l*i})}else{var u=+(a===`left`&&!o||a===`right`&&o);c=NV(NV({},c),{},{x1:t+u*r,y1:n,x2:t+u*r,y2:n+i})}return _.createElement(`line`,jV({},c,{className:Ht(`recharts-cartesian-axis-line`,(0,Iy.default)(s,`className`))}))}},{key:`renderTicks`,value:function(e,n,r){var i=this,a=this.props,o=a.tickLine,s=a.stroke,c=a.tick,l=a.tickFormatter,u=a.unit,d=EV(NV(NV({},this.props),{},{ticks:e}),n,r),f=this.getTickTextAnchor(),p=this.getTickVerticalAnchor(),m=Ob(this.props,!1),h=Ob(c,!1),g=NV(NV({},m),{},{fill:`none`},Ob(o,!1)),v=d.map(function(e,n){var r=i.getTickLineCoord(e),a=r.line,v=r.tick,y=NV(NV(NV(NV({textAnchor:f,verticalAnchor:p},m),{},{stroke:`none`,fill:s},h),v),{},{index:n,payload:e,visibleTicksCount:d.length,tickFormatter:l});return _.createElement(Ub,jV({className:`recharts-cartesian-axis-tick`,key:`tick-${e.value}-${e.coordinate}-${e.tickCoord}`},cb(i.props,e,n)),o&&_.createElement(`line`,jV({},g,a,{className:Ht(`recharts-cartesian-axis-tick-line`,(0,Iy.default)(o,`className`))})),c&&t.renderTickItem(c,y,`${(0,lb.default)(l)?l(e.value,n):e.value}${u||``}`))});return _.createElement(`g`,{className:`recharts-cartesian-axis-ticks`},v)}},{key:`render`,value:function(){var e=this,t=this.props,n=t.axisLine,r=t.width,i=t.height,a=t.ticksGenerator,o=t.className;if(t.hide)return null;var s=this.props,c=s.ticks,l=PV(s,kV),u=c;return(0,lb.default)(a)&&(u=c&&c.length>0?a(this.props):a(l)),r<=0||i<=0||!u||!u.length?null:_.createElement(Ub,{className:Ht(`recharts-cartesian-axis`,o),ref:function(t){e.layerReference=t}},n&&this.renderAxisLine(),this.renderTicks(u,this.state.fontSize,this.state.letterSpacing),kP.renderCallByParent(this.props))}}],[{key:`renderTickItem`,value:function(e,t,n){var r,i=Ht(t.className,`recharts-cartesian-axis-tick-value`);return r=_.isValidElement(e)?_.cloneElement(e,NV(NV({},t),{},{className:i})):(0,lb.default)(e)?e(NV(NV({},t),{},{className:i})):_.createElement(fE,jV({},t,{className:`recharts-cartesian-axis-tick-value`}),n),r}}])}(_.Component);KV(YV,`displayName`,`CartesianAxis`),KV(YV,`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 XV=[`type`,`layout`,`connectNulls`,`ref`],ZV=[`key`];function QV(e){"@babel/helpers - typeof";return QV=typeof Symbol==`function`&&typeof Symbol.iterator==`symbol`?function(e){return typeof e}:function(e){return e&&typeof Symbol==`function`&&e.constructor===Symbol&&e!==Symbol.prototype?`symbol`:typeof e},QV(e)}function $V(e,t){if(e==null)return{};var n=eH(e,t),r,i;if(Object.getOwnPropertySymbols){var a=Object.getOwnPropertySymbols(e);for(i=0;i<a.length;i++)r=a[i],!(t.indexOf(r)>=0)&&Object.prototype.propertyIsEnumerable.call(e,r)&&(n[r]=e[r])}return n}function eH(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 tH(){return tH=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},tH.apply(this,arguments)}function nH(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter(function(t){return Object.getOwnPropertyDescriptor(e,t).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?nH(Object(n),!0).forEach(function(t){bH(e,t,n[t])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):nH(Object(n)).forEach(function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(n,t))})}return e}function iH(e){return cH(e)||sH(e)||oH(e)||aH()}function aH(){throw TypeError(`Invalid attempt to spread non-iterable instance.
|
|
114
|
-
In order to be iterable, non-array objects must have a [Symbol.iterator]() method.`)}function oH(e,t){if(e){if(typeof e==`string`)return lH(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 lH(e,t)}}function sH(e){if(typeof Symbol<`u`&&e[Symbol.iterator]!=null||e[`@@iterator`]!=null)return Array.from(e)}function cH(e){if(Array.isArray(e))return lH(e)}function lH(e,t){(t==null||t>e.length)&&(t=e.length);for(var n=0,r=Array(t);n<t;n++)r[n]=e[n];return r}function uH(e,t){if(!(e instanceof t))throw TypeError(`Cannot call a class as a function`)}function dH(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,xH(r.key),r)}}function fH(e,t,n){return t&&dH(e.prototype,t),n&&dH(e,n),Object.defineProperty(e,"prototype",{writable:!1}),e}function pH(e,t,n){return t=_H(t),mH(e,gH()?Reflect.construct(t,n||[],_H(e).constructor):t.apply(e,n))}function mH(e,t){if(t&&(QV(t)===`object`||typeof t==`function`))return t;if(t!==void 0)throw TypeError(`Derived constructors may only return object or undefined`);return hH(e)}function hH(e){if(e===void 0)throw ReferenceError(`this hasn't been initialised - super() hasn't been called`);return e}function gH(){try{var e=!Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],function(){}))}catch{}return(gH=function(){return!!e})()}function _H(e){return _H=Object.setPrototypeOf?Object.getPrototypeOf.bind():function(e){return e.__proto__||Object.getPrototypeOf(e)},_H(e)}function vH(e,t){if(typeof t!=`function`&&t!==null)throw 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&&yH(e,t)}function yH(e,t){return yH=Object.setPrototypeOf?Object.setPrototypeOf.bind():function(e,t){return e.__proto__=t,e},yH(e,t)}function bH(e,t,n){return t=xH(t),t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function xH(e){var t=SH(e,`string`);return QV(t)==`symbol`?t:t+``}function SH(e,t){if(QV(e)!=`object`||!e)return e;var n=e[Symbol.toPrimitive];if(n!==void 0){var r=n.call(e,t||`default`);if(QV(r)!=`object`)return r;throw TypeError(`@@toPrimitive must return a primitive value.`)}return(t===`string`?String:Number)(e)}var CH=function(e){function t(){var e;uH(this,t);var n=[...arguments];return e=pH(this,t,[].concat(n)),bH(e,`state`,{isAnimationFinished:!0,totalLength:0}),bH(e,`generateSimpleStrokeDasharray`,function(e,t){return`${t}px ${e-t}px`}),bH(e,`getStrokeDasharray`,function(n,r,i){var a=i.reduce(function(e,t){return e+t});if(!a)return e.generateSimpleStrokeDasharray(r,n);for(var o=Math.floor(n/a),s=n%a,c=r-n,l=[],u=0,d=0;u<i.length;d+=i[u],++u)if(d+i[u]>s){l=[].concat(iH(i.slice(0,u)),[s-d]);break}var f=l.length%2==0?[0,c]:[c];return[].concat(iH(t.repeat(i,o)),iH(l),f).map(function(e){return`${e}px`}).join(`, `)}),bH(e,`id`,Gy(`recharts-line-`)),bH(e,`pathRef`,function(t){e.mainCurve=t}),bH(e,`handleAnimationEnd`,function(){e.setState({isAnimationFinished:!0}),e.props.onAnimationEnd&&e.props.onAnimationEnd()}),bH(e,`handleAnimationStart`,function(){e.setState({isAnimationFinished:!1}),e.props.onAnimationStart&&e.props.onAnimationStart()}),e}return vH(t,e),fH(t,[{key:`componentDidMount`,value:function(){if(this.props.isAnimationActive){var e=this.getTotalLength();this.setState({totalLength:e})}}},{key:`componentDidUpdate`,value:function(){if(this.props.isAnimationActive){var e=this.getTotalLength();e!==this.state.totalLength&&this.setState({totalLength:e})}}},{key:`getTotalLength`,value:function(){var e=this.mainCurve;try{return e&&e.getTotalLength&&e.getTotalLength()||0}catch{return 0}}},{key:`renderErrorBar`,value:function(e,t){if(this.props.isAnimationActive&&!this.state.isAnimationFinished)return null;var n=this.props,r=n.points,i=n.xAxis,a=n.yAxis,o=n.layout,s=n.children,c=xb(s,pN);if(!c)return null;var l=function(e,t){return{x:e.x,y:e.y,value:e.value,errorVal:LN(e.payload,t)}},u={clipPath:e?`url(#clipPath-${t})`:null};return _.createElement(Ub,u,c.map(function(e){return _.cloneElement(e,{key:`bar-${e.props.dataKey}`,data:r,xAxis:i,yAxis:a,layout:o,dataPointFormatter:l})}))}},{key:`renderDots`,value:function(e,n,r){if(this.props.isAnimationActive&&!this.state.isAnimationFinished)return null;var i=this.props,a=i.dot,o=i.points,s=i.dataKey,c=Ob(this.props,!1),l=Ob(a,!0),u=o.map(function(e,n){var r=rH(rH(rH({key:`dot-${n}`,r:3},c),l),{},{index:n,cx:e.x,cy:e.y,value:e.value,dataKey:s,payload:e.payload,points:o});return t.renderDotItem(a,r)}),d={clipPath:e?`url(#clipPath-${n?``:`dots-`}${r})`:null};return _.createElement(Ub,tH({className:`recharts-line-dots`,key:`dots`},d),u)}},{key:`renderCurveStatically`,value:function(e,t,n,r){var i=this.props,a=i.type,o=i.layout,s=i.connectNulls;i.ref;var c=rH(rH(rH({},Ob($V(i,XV),!0)),{},{fill:`none`,className:`recharts-line-curve`,clipPath:t?`url(#clipPath-${n})`:null,points:e},r),{},{type:a,layout:o,connectNulls:s});return _.createElement($P,tH({},c,{pathRef:this.pathRef}))}},{key:`renderCurveWithAnimation`,value:function(e,t){var n=this,r=this.props,i=r.points,a=r.strokeDasharray,o=r.isAnimationActive,s=r.animationBegin,c=r.animationDuration,l=r.animationEasing,u=r.animationId,d=r.animateNewValues,f=r.width,p=r.height,m=this.state,h=m.prevPoints,g=m.totalLength;return _.createElement(ZF,{begin:s,duration:c,isActive:o,easing:l,from:{t:0},to:{t:1},key:`line-${u}`,onAnimationEnd:this.handleAnimationEnd,onAnimationStart:this.handleAnimationStart},function(r){var o=r.t;if(h){var s=h.length/i.length,c=i.map(function(e,t){var n=Math.floor(t*s);if(h[n]){var r=h[n],i=Yy(r.x,e.x),a=Yy(r.y,e.y);return rH(rH({},e),{},{x:i(o),y:a(o)})}if(d){var c=Yy(f*2,e.x),l=Yy(p/2,e.y);return rH(rH({},e),{},{x:c(o),y:l(o)})}return rH(rH({},e),{},{x:e.x,y:e.y})});return n.renderCurveStatically(c,e,t)}var l=Yy(0,g)(o),u;if(a){var m=`${a}`.split(/[,\s]+/gim).map(function(e){return parseFloat(e)});u=n.getStrokeDasharray(l,g,m)}else u=n.generateSimpleStrokeDasharray(g,l);return n.renderCurveStatically(i,e,t,{strokeDasharray:u})})}},{key:`renderCurve`,value:function(e,t){var n=this.props,r=n.points,i=n.isAnimationActive,a=this.state,o=a.prevPoints,s=a.totalLength;return i&&r&&r.length&&(!o&&s>0||!(0,wN.default)(o,r))?this.renderCurveWithAnimation(e,t):this.renderCurveStatically(r,e,t)}},{key:`render`,value:function(){var e=this.props,t=e.hide,n=e.dot,r=e.points,i=e.className,a=e.xAxis,o=e.yAxis,s=e.top,c=e.left,l=e.width,u=e.height,d=e.isAnimationActive,f=e.id;if(t||!r||!r.length)return null;var p=this.state.isAnimationFinished,m=r.length===1,h=Ht(`recharts-line`,i),g=a&&a.allowDataOverflow,v=o&&o.allowDataOverflow,y=g||v,b=(0,Ry.default)(f)?this.id:f,x=Ob(n,!1)??{r:3,strokeWidth:2},S=x.r,C=S===void 0?3:S,w=x.strokeWidth,T=w===void 0?2:w,E=(Eb(n)?n:{}).clipDot,D=E===void 0||E,O=C*2+T;return _.createElement(Ub,{className:h},g||v?_.createElement(`defs`,null,_.createElement(`clipPath`,{id:`clipPath-${b}`},_.createElement(`rect`,{x:g?c:c-l/2,y:v?s:s-u/2,width:g?l:l*2,height:v?u:u*2})),!D&&_.createElement(`clipPath`,{id:`clipPath-dots-${b}`},_.createElement(`rect`,{x:c-O/2,y:s-O/2,width:l+O,height:u+O}))):null,!m&&this.renderCurve(y,b),this.renderErrorBar(y,b),(m||n)&&this.renderDots(y,D,b),(!d||p)&&LP.renderCallByParent(this.props,r))}}],[{key:`getDerivedStateFromProps`,value:function(e,t){return e.animationId===t.prevAnimationId?e.points===t.curPoints?null:{curPoints:e.points}:{prevAnimationId:e.animationId,curPoints:e.points,prevPoints:t.curPoints}}},{key:`repeat`,value:function(e,t){for(var n=e.length%2==0?e:[].concat(iH(e),[0]),r=[],i=0;i<t;++i)r=[].concat(iH(r),iH(n));return r}},{key:`renderDotItem`,value:function(e,t){var n;if(_.isValidElement(e))n=_.cloneElement(e,t);else if((0,lb.default)(e))n=e(t);else{var r=t.key,i=$V(t,ZV),a=Ht(`recharts-line-dot`,typeof e==`boolean`?``:e.className);n=_.createElement(dI,tH({key:r},i,{className:a}))}return n}}])}(_.PureComponent);bH(CH,`displayName`,`Line`),bH(CH,`defaultProps`,{xAxisId:0,yAxisId:0,connectNulls:!1,activeDot:!0,dot:!0,legendType:`line`,stroke:`#3182bd`,strokeWidth:1,fill:`#fff`,points:[],isAnimationActive:!Cw.isSsr,animateNewValues:!0,animationBegin:0,animationDuration:1500,animationEasing:`ease`,hide:!1,label:!1}),bH(CH,`getComposedData`,function(e){var t=e.props,n=e.xAxis,r=e.yAxis,i=e.xAxisTicks,a=e.yAxisTicks,o=e.dataKey,s=e.bandSize,c=e.displayedData,l=e.offset,u=t.layout;return rH({points:c.map(function(e,t){var c=LN(e,o);return u===`horizontal`?{x:aP({axis:n,ticks:i,bandSize:s,entry:e,index:t}),y:(0,Ry.default)(c)?null:r.scale(c),value:c,payload:e}:{x:(0,Ry.default)(c)?null:n.scale(c),y:aP({axis:r,ticks:a,bandSize:s,entry:e,index:t}),value:c,payload:e}}),layout:u},l)});function wH(e){"@babel/helpers - typeof";return wH=typeof Symbol==`function`&&typeof Symbol.iterator==`symbol`?function(e){return typeof e}:function(e){return e&&typeof Symbol==`function`&&e.constructor===Symbol&&e!==Symbol.prototype?`symbol`:typeof e},wH(e)}function TH(e,t){if(!(e instanceof t))throw TypeError(`Cannot call a class as a function`)}function EH(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,IH(r.key),r)}}function DH(e,t,n){return t&&EH(e.prototype,t),n&&EH(e,n),Object.defineProperty(e,"prototype",{writable:!1}),e}function OH(e,t,n){return t=MH(t),kH(e,jH()?Reflect.construct(t,n||[],MH(e).constructor):t.apply(e,n))}function kH(e,t){if(t&&(wH(t)===`object`||typeof t==`function`))return t;if(t!==void 0)throw TypeError(`Derived constructors may only return object or undefined`);return AH(e)}function AH(e){if(e===void 0)throw ReferenceError(`this hasn't been initialised - super() hasn't been called`);return e}function jH(){try{var e=!Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],function(){}))}catch{}return(jH=function(){return!!e})()}function MH(e){return MH=Object.setPrototypeOf?Object.getPrototypeOf.bind():function(e){return e.__proto__||Object.getPrototypeOf(e)},MH(e)}function NH(e,t){if(typeof t!=`function`&&t!==null)throw 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&&PH(e,t)}function PH(e,t){return PH=Object.setPrototypeOf?Object.setPrototypeOf.bind():function(e,t){return e.__proto__=t,e},PH(e,t)}function FH(e,t,n){return t=IH(t),t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function IH(e){var t=LH(e,`string`);return wH(t)==`symbol`?t:t+``}function LH(e,t){if(wH(e)!=`object`||!e)return e;var n=e[Symbol.toPrimitive];if(n!==void 0){var r=n.call(e,t||`default`);if(wH(r)!=`object`)return r;throw TypeError(`@@toPrimitive must return a primitive value.`)}return(t===`string`?String:Number)(e)}function RH(){return RH=Object.assign?Object.assign.bind():function(e){for(var t=1;t<arguments.length;t++){var n=arguments[t];for(var r in n)Object.prototype.hasOwnProperty.call(n,r)&&(e[r]=n[r])}return e},RH.apply(this,arguments)}function zH(e){var t=e.xAxisId,n=Qz(),r=$z(),i=Yz(t);return i==null?null:_.createElement(YV,RH({},i,{className:Ht(`recharts-${i.axisType} ${i.axisType}`,i.className),viewBox:{x:0,y:0,width:n,height:r},ticksGenerator:function(e){return YN(e,!0)}}))}var BH=function(e){function t(){return TH(this,t),OH(this,t,arguments)}return NH(t,e),DH(t,[{key:`render`,value:function(){return _.createElement(zH,this.props)}}])}(_.Component);FH(BH,`displayName`,`XAxis`),FH(BH,`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 VH(e){"@babel/helpers - typeof";return VH=typeof Symbol==`function`&&typeof Symbol.iterator==`symbol`?function(e){return typeof e}:function(e){return e&&typeof Symbol==`function`&&e.constructor===Symbol&&e!==Symbol.prototype?`symbol`:typeof e},VH(e)}function HH(e,t){if(!(e instanceof t))throw TypeError(`Cannot call a class as a function`)}function UH(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,$H(r.key),r)}}function WH(e,t,n){return t&&UH(e.prototype,t),n&&UH(e,n),Object.defineProperty(e,"prototype",{writable:!1}),e}function GH(e,t,n){return t=YH(t),KH(e,JH()?Reflect.construct(t,n||[],YH(e).constructor):t.apply(e,n))}function KH(e,t){if(t&&(VH(t)===`object`||typeof t==`function`))return t;if(t!==void 0)throw TypeError(`Derived constructors may only return object or undefined`);return qH(e)}function qH(e){if(e===void 0)throw ReferenceError(`this hasn't been initialised - super() hasn't been called`);return e}function JH(){try{var e=!Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],function(){}))}catch{}return(JH=function(){return!!e})()}function YH(e){return YH=Object.setPrototypeOf?Object.getPrototypeOf.bind():function(e){return e.__proto__||Object.getPrototypeOf(e)},YH(e)}function XH(e,t){if(typeof t!=`function`&&t!==null)throw 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&&ZH(e,t)}function ZH(e,t){return ZH=Object.setPrototypeOf?Object.setPrototypeOf.bind():function(e,t){return e.__proto__=t,e},ZH(e,t)}function QH(e,t,n){return t=$H(t),t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function $H(e){var t=eU(e,`string`);return VH(t)==`symbol`?t:t+``}function eU(e,t){if(VH(e)!=`object`||!e)return e;var n=e[Symbol.toPrimitive];if(n!==void 0){var r=n.call(e,t||`default`);if(VH(r)!=`object`)return r;throw TypeError(`@@toPrimitive must return a primitive value.`)}return(t===`string`?String:Number)(e)}function tU(){return tU=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},tU.apply(this,arguments)}var nU=function(e){var t=e.yAxisId,n=Qz(),r=$z(),i=Xz(t);return i==null?null:_.createElement(YV,tU({},i,{className:Ht(`recharts-${i.axisType} ${i.axisType}`,i.className),viewBox:{x:0,y:0,width:n,height:r},ticksGenerator:function(e){return YN(e,!0)}}))},rU=function(e){function t(){return HH(this,t),GH(this,t,arguments)}return XH(t,e),WH(t,[{key:`render`,value:function(){return _.createElement(nU,this.props)}}])}(_.Component);QH(rU,`displayName`,`YAxis`),QH(rU,`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 iU(e){return cU(e)||sU(e)||oU(e)||aU()}function aU(){throw TypeError(`Invalid attempt to spread non-iterable instance.
|
|
115
|
-
In order to be iterable, non-array objects must have a [Symbol.iterator]() method.`)}function oU(e,t){if(e){if(typeof e==`string`)return lU(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 lU(e,t)}}function sU(e){if(typeof Symbol<`u`&&e[Symbol.iterator]!=null||e[`@@iterator`]!=null)return Array.from(e)}function cU(e){if(Array.isArray(e))return lU(e)}function lU(e,t){(t==null||t>e.length)&&(t=e.length);for(var n=0,r=Array(t);n<t;n++)r[n]=e[n];return r}var uU=function(e,t,n,r,i){var a=xb(e,DB),o=xb(e,KB),s=[].concat(iU(a),iU(o)),c=xb(e,dV),l=`${r}Id`,u=r[0],d=t;if(s.length&&(d=s.reduce(function(e,t){if(t.props[l]===n&&AR(t.props,`extendDomain`)&&Vy(t.props[u])){var r=t.props[u];return[Math.min(e[0],r),Math.max(e[1],r)]}return e},d)),c.length){var f=`${u}1`,p=`${u}2`;d=c.reduce(function(e,t){if(t.props[l]===n&&AR(t.props,`extendDomain`)&&Vy(t.props[f])&&Vy(t.props[p])){var r=t.props[f],i=t.props[p];return[Math.min(e[0],r,i),Math.max(e[1],r,i)]}return e},d)}return i&&i.length&&(d=i.reduce(function(e,t){return Vy(t)?[Math.min(e[0],t),Math.max(e[1],t)]:e},d)),d},dU=new(l(o(((e,t)=>{var n=Object.prototype.hasOwnProperty,r=`~`;function i(){}Object.create&&(i.prototype=Object.create(null),new i().__proto__||(r=!1));function a(e,t,n){this.fn=e,this.context=t,this.once=n||!1}function o(e,t,n,i,o){if(typeof n!=`function`)throw TypeError(`The listener must be a function`);var s=new a(n,i||e,o),c=r?r+t:t;return e._events[c]?e._events[c].fn?e._events[c]=[e._events[c],s]:e._events[c].push(s):(e._events[c]=s,e._eventsCount++),e}function s(e,t){--e._eventsCount===0?e._events=new i:delete e._events[t]}function c(){this._events=new i,this._eventsCount=0}c.prototype.eventNames=function(){var e=[],t,i;if(this._eventsCount===0)return e;for(i in t=this._events)n.call(t,i)&&e.push(r?i.slice(1):i);return Object.getOwnPropertySymbols?e.concat(Object.getOwnPropertySymbols(t)):e},c.prototype.listeners=function(e){var t=r?r+e:e,n=this._events[t];if(!n)return[];if(n.fn)return[n.fn];for(var i=0,a=n.length,o=Array(a);i<a;i++)o[i]=n[i].fn;return o},c.prototype.listenerCount=function(e){var t=r?r+e:e,n=this._events[t];return n?n.fn?1:n.length:0},c.prototype.emit=function(e,t,n,i,a,o){var s=r?r+e:e;if(!this._events[s])return!1;var c=this._events[s],l=arguments.length,u,d;if(c.fn){switch(c.once&&this.removeListener(e,c.fn,void 0,!0),l){case 1:return c.fn.call(c.context),!0;case 2:return c.fn.call(c.context,t),!0;case 3:return c.fn.call(c.context,t,n),!0;case 4:return c.fn.call(c.context,t,n,i),!0;case 5:return c.fn.call(c.context,t,n,i,a),!0;case 6:return c.fn.call(c.context,t,n,i,a,o),!0}for(d=1,u=Array(l-1);d<l;d++)u[d-1]=arguments[d];c.fn.apply(c.context,u)}else{var f=c.length,p;for(d=0;d<f;d++)switch(c[d].once&&this.removeListener(e,c[d].fn,void 0,!0),l){case 1:c[d].fn.call(c[d].context);break;case 2:c[d].fn.call(c[d].context,t);break;case 3:c[d].fn.call(c[d].context,t,n);break;case 4:c[d].fn.call(c[d].context,t,n,i);break;default:if(!u)for(p=1,u=Array(l-1);p<l;p++)u[p-1]=arguments[p];c[d].fn.apply(c[d].context,u)}}return!0},c.prototype.on=function(e,t,n){return o(this,e,t,n,!1)},c.prototype.once=function(e,t,n){return o(this,e,t,n,!0)},c.prototype.removeListener=function(e,t,n,i){var a=r?r+e:e;if(!this._events[a])return this;if(!t)return s(this,a),this;var o=this._events[a];if(o.fn)o.fn===t&&(!i||o.once)&&(!n||o.context===n)&&s(this,a);else{for(var c=0,l=[],u=o.length;c<u;c++)(o[c].fn!==t||i&&!o[c].once||n&&o[c].context!==n)&&l.push(o[c]);l.length?this._events[a]=l.length===1?l[0]:l:s(this,a)}return this},c.prototype.removeAllListeners=function(e){var t;return e?(t=r?r+e:e,this._events[t]&&s(this,t)):(this._events=new i,this._eventsCount=0),this},c.prototype.off=c.prototype.removeListener,c.prototype.addListener=c.prototype.on,c.prefixed=r,c.EventEmitter=c,t!==void 0&&(t.exports=c)}))())).default,fU=`recharts.syncMouseEvents`;function pU(e){"@babel/helpers - typeof";return pU=typeof Symbol==`function`&&typeof Symbol.iterator==`symbol`?function(e){return typeof e}:function(e){return e&&typeof Symbol==`function`&&e.constructor===Symbol&&e!==Symbol.prototype?`symbol`:typeof e},pU(e)}function mU(e,t){if(!(e instanceof t))throw TypeError(`Cannot call a class as a function`)}function hU(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,vU(r.key),r)}}function gU(e,t,n){return t&&hU(e.prototype,t),n&&hU(e,n),Object.defineProperty(e,"prototype",{writable:!1}),e}function _U(e,t,n){return t=vU(t),t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function vU(e){var t=yU(e,`string`);return pU(t)==`symbol`?t:t+``}function yU(e,t){if(pU(e)!=`object`||!e)return e;var n=e[Symbol.toPrimitive];if(n!==void 0){var r=n.call(e,t||`default`);if(pU(r)!=`object`)return r;throw TypeError(`@@toPrimitive must return a primitive value.`)}return(t===`string`?String:Number)(e)}var bU=function(){function e(){mU(this,e),_U(this,`activeIndex`,0),_U(this,`coordinateList`,[]),_U(this,`layout`,`horizontal`)}return gU(e,[{key:`setDetails`,value:function(e){var t=e.coordinateList,n=t===void 0?null:t,r=e.container,i=r===void 0?null:r,a=e.layout,o=a===void 0?null:a,s=e.offset,c=s===void 0?null:s,l=e.mouseHandlerCallback,u=l===void 0?null:l;this.coordinateList=n??this.coordinateList??[],this.container=i??this.container,this.layout=o??this.layout,this.offset=c??this.offset,this.mouseHandlerCallback=u??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(e){if(this.coordinateList.length!==0)switch(e.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()}}},{key:`setIndex`,value:function(e){this.activeIndex=e}},{key:`spoofMouse`,value:function(){if(this.layout===`horizontal`&&this.coordinateList.length!==0){var e=this.container.getBoundingClientRect(),t=e.x,n=e.y,r=e.height,i=this.coordinateList[this.activeIndex].coordinate,a=window?.scrollX||0,o=window?.scrollY||0,s=t+i+a,c=n+this.offset.top+r/2+o;this.mouseHandlerCallback({pageX:s,pageY:c})}}}])}();function xU(e,t,n){if(n===`number`&&t===!0&&Array.isArray(e)){var r=e?.[0],i=e?.[1];if(r&&i&&Vy(r)&&Vy(i))return!0}return!1}function SU(e,t,n,r){var i=r/2;return{stroke:`none`,fill:`#ccc`,x:e===`horizontal`?t.x-i:n.left+.5,y:e===`horizontal`?n.top+.5:t.y-i,width:e===`horizontal`?r:n.width-1,height:e===`horizontal`?n.height-1:r}}function CU(e){var t=e.cx,n=e.cy,r=e.radius,i=e.startAngle,a=e.endAngle;return{points:[bP(t,n,r,i),bP(t,n,r,a)],cx:t,cy:n,radius:r,startAngle:i,endAngle:a}}function wU(e,t,n){var r,i,a,o;if(e===`horizontal`)r=t.x,a=r,i=n.top,o=n.top+n.height;else if(e===`vertical`)i=t.y,o=i,r=n.left,a=n.left+n.width;else if(t.cx!=null&&t.cy!=null){if(e===`centric`){var s=t.cx,c=t.cy,l=t.innerRadius,u=t.outerRadius,d=t.angle,f=bP(s,c,l,d),p=bP(s,c,u,d);r=f.x,i=f.y,a=p.x,o=p.y}else return CU(t)}return[{x:r,y:i},{x:a,y:o}]}function TU(e){"@babel/helpers - typeof";return TU=typeof Symbol==`function`&&typeof Symbol.iterator==`symbol`?function(e){return typeof e}:function(e){return e&&typeof Symbol==`function`&&e.constructor===Symbol&&e!==Symbol.prototype?`symbol`:typeof e},TU(e)}function EU(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter(function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable})),n.push.apply(n,r)}return n}function DU(e){for(var t=1;t<arguments.length;t++){var n=arguments[t]==null?{}:arguments[t];t%2?EU(Object(n),!0).forEach(function(t){OU(e,t,n[t])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):EU(Object(n)).forEach(function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(n,t))})}return e}function OU(e,t,n){return t=kU(t),t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function kU(e){var t=AU(e,`string`);return TU(t)==`symbol`?t:t+``}function AU(e,t){if(TU(e)!=`object`||!e)return e;var n=e[Symbol.toPrimitive];if(n!==void 0){var r=n.call(e,t||`default`);if(TU(r)!=`object`)return r;throw TypeError(`@@toPrimitive must return a primitive value.`)}return(t===`string`?String:Number)(e)}function jU(e){var t=e.element,n=e.tooltipEventType,r=e.isActive,i=e.activeCoordinate,a=e.activePayload,o=e.offset,s=e.activeTooltipIndex,c=e.tooltipAxisBandSize,l=e.layout,u=e.chartName,d=t.props.cursor??t.type.defaultProps?.cursor;if(!t||!d||!r||!i||u!==`ScatterChart`&&n!==`axis`)return null;var f,p=$P;if(u===`ScatterChart`)f=i,p=Xae;else if(u===`BarChart`)f=SU(l,i,o,c),p=iI;else if(l===`radial`){var m=CU(i),h=m.cx,g=m.cy,v=m.radius;f={cx:h,cy:g,startAngle:m.startAngle,endAngle:m.endAngle,innerRadius:v,outerRadius:v},p=WP}else f={points:wU(l,i,o)},p=$P;var y=DU(DU(DU(DU({stroke:`#ccc`,pointerEvents:`none`},o),f),Ob(d,!1)),{},{payload:a,payloadIndex:s,className:Ht(`recharts-tooltip-cursor`,d.className)});return(0,_.isValidElement)(d)?(0,_.cloneElement)(d,y):(0,_.createElement)(p,y)}var MU=[`item`],NU=[`children`,`className`,`width`,`height`,`style`,`compact`,`title`,`desc`];function PU(e){"@babel/helpers - typeof";return PU=typeof Symbol==`function`&&typeof Symbol.iterator==`symbol`?function(e){return typeof e}:function(e){return e&&typeof Symbol==`function`&&e.constructor===Symbol&&e!==Symbol.prototype?`symbol`:typeof e},PU(e)}function FU(){return FU=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},FU.apply(this,arguments)}function IU(e,t){return zU(e)||RU(e,t)||eW(e,t)||LU()}function LU(){throw TypeError(`Invalid attempt to destructure non-iterable instance.
|
|
116
|
-
In order to be iterable, non-array objects must have a [Symbol.iterator]() method.`)}function RU(e,t){var n=e==null?null:typeof Symbol<`u`&&e[Symbol.iterator]||e[`@@iterator`];if(n!=null){var r,i,a,o,s=[],c=!0,l=!1;try{if(a=(n=n.call(e)).next,t===0){if(Object(n)!==n)return;c=!1}else for(;!(c=(r=a.call(n)).done)&&(s.push(r.value),s.length!==t);c=!0);}catch(e){l=!0,i=e}finally{try{if(!c&&n.return!=null&&(o=n.return(),Object(o)!==o))return}finally{if(l)throw i}}return s}}function zU(e){if(Array.isArray(e))return e}function BU(e,t){if(e==null)return{};var n=VU(e,t),r,i;if(Object.getOwnPropertySymbols){var a=Object.getOwnPropertySymbols(e);for(i=0;i<a.length;i++)r=a[i],!(t.indexOf(r)>=0)&&Object.prototype.propertyIsEnumerable.call(e,r)&&(n[r]=e[r])}return n}function VU(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 HU(e,t){if(!(e instanceof t))throw TypeError(`Cannot call a class as a function`)}function UU(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,oW(r.key),r)}}function WU(e,t,n){return t&&UU(e.prototype,t),n&&UU(e,n),Object.defineProperty(e,"prototype",{writable:!1}),e}function GU(e,t,n){return t=YU(t),KU(e,JU()?Reflect.construct(t,n||[],YU(e).constructor):t.apply(e,n))}function KU(e,t){if(t&&(PU(t)===`object`||typeof t==`function`))return t;if(t!==void 0)throw TypeError(`Derived constructors may only return object or undefined`);return qU(e)}function qU(e){if(e===void 0)throw ReferenceError(`this hasn't been initialised - super() hasn't been called`);return e}function JU(){try{var e=!Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],function(){}))}catch{}return(JU=function(){return!!e})()}function YU(e){return YU=Object.setPrototypeOf?Object.getPrototypeOf.bind():function(e){return e.__proto__||Object.getPrototypeOf(e)},YU(e)}function XU(e,t){if(typeof t!=`function`&&t!==null)throw 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&&ZU(e,t)}function ZU(e,t){return ZU=Object.setPrototypeOf?Object.setPrototypeOf.bind():function(e,t){return e.__proto__=t,e},ZU(e,t)}function QU(e){return nW(e)||tW(e)||eW(e)||$U()}function $U(){throw TypeError(`Invalid attempt to spread non-iterable instance.
|
|
117
|
-
In order to be iterable, non-array objects must have a [Symbol.iterator]() method.`)}function eW(e,t){if(e){if(typeof e==`string`)return rW(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 rW(e,t)}}function tW(e){if(typeof Symbol<`u`&&e[Symbol.iterator]!=null||e[`@@iterator`]!=null)return Array.from(e)}function nW(e){if(Array.isArray(e))return rW(e)}function rW(e,t){(t==null||t>e.length)&&(t=e.length);for(var n=0,r=Array(t);n<t;n++)r[n]=e[n];return r}function iW(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter(function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable})),n.push.apply(n,r)}return n}function X(e){for(var t=1;t<arguments.length;t++){var n=arguments[t]==null?{}:arguments[t];t%2?iW(Object(n),!0).forEach(function(t){aW(e,t,n[t])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):iW(Object(n)).forEach(function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(n,t))})}return e}function aW(e,t,n){return t=oW(t),t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function oW(e){var t=sW(e,`string`);return PU(t)==`symbol`?t:t+``}function sW(e,t){if(PU(e)!=`object`||!e)return e;var n=e[Symbol.toPrimitive];if(n!==void 0){var r=n.call(e,t||`default`);if(PU(r)!=`object`)return r;throw TypeError(`@@toPrimitive must return a primitive value.`)}return(t===`string`?String:Number)(e)}var cW={xAxis:[`bottom`,`top`],yAxis:[`left`,`right`]},lW={width:`100%`,height:`100%`},uW={x:0,y:0};function dW(e){return e}var fW=function(e,t){return t===`horizontal`?e.x:t===`vertical`?e.y:t===`centric`?e.angle:e.radius},pW=function(e,t,n,r){var i=t.find(function(e){return e&&e.index===n});if(i){if(e===`horizontal`)return{x:i.coordinate,y:r.y};if(e===`vertical`)return{x:r.x,y:i.coordinate};if(e===`centric`){var a=i.coordinate,o=r.radius;return X(X(X({},r),bP(r.cx,r.cy,o,a)),{},{angle:a,radius:o})}var s=i.coordinate,c=r.angle;return X(X(X({},r),bP(r.cx,r.cy,s,c)),{},{angle:c,radius:s})}return uW},mW=function(e,t){var n=t.graphicalItems,r=t.dataStartIndex,i=t.dataEndIndex,a=(n??[]).reduce(function(e,t){var n=t.props.data;return n&&n.length?[].concat(QU(e),QU(n)):e},[]);return a.length>0?a:e&&e.length&&Vy(r)&&Vy(i)?e.slice(r,i+1):[]};function hW(e){return e===`number`?[0,`auto`]:void 0}var gW=function(e,t,n,r){var i=e.graphicalItems,a=e.tooltipAxis,o=mW(t,e);return n<0||!i||!i.length||n>=o.length?null:i.reduce(function(i,s){var c=s.props.data??t;c&&e.dataStartIndex+e.dataEndIndex!==0&&e.dataEndIndex-e.dataStartIndex>=n&&(c=c.slice(e.dataStartIndex,e.dataEndIndex+1));var l=a.dataKey&&!a.allowDuplicatedCategory?Xy(c===void 0?o:c,a.dataKey,r):c&&c[n]||o[n];return l?[].concat(QU(i),[pP(s,l)]):i},[])},_W=function(e,t,n,r){var i=r||{x:e.chartX,y:e.chartY},a=fW(i,n),o=e.orderedTooltipTicks,s=e.tooltipAxis,c=e.tooltipTicks,l=zN(a,o,c,s);if(l>=0&&c){var u=c[l]&&c[l].value;return{activeTooltipIndex:l,activeLabel:u,activePayload:gW(e,t,l,u),activeCoordinate:pW(n,o,l,i)}}return null},vW=function(e,t){var n=t.axes,r=t.graphicalItems,i=t.axisType,a=t.axisIdKey,o=t.stackGroups,s=t.dataStartIndex,c=t.dataEndIndex,l=e.layout,u=e.children,d=e.stackOffset,f=JN(l,i);return n.reduce(function(t,n){var p=n.type.defaultProps===void 0?n.props:X(X({},n.type.defaultProps),n.props),m=p.type,h=p.dataKey,g=p.allowDataOverflow,_=p.allowDuplicatedCategory,v=p.scale,y=p.ticks,b=p.includeHidden,x=p[a];if(t[x])return t;var S=mW(e.data,{graphicalItems:r.filter(function(e){return(a in e.props?e.props[a]:e.type.defaultProps?.[a])===x}),dataStartIndex:s,dataEndIndex:c}),C=S.length,w,T,E;xU(p.domain,g,m)&&(w=uP(p.domain,null,g),f&&(m===`number`||v!==`auto`)&&(E=RN(S,h,`category`)));var D=hW(m);if(!w||w.length===0){var O=p.domain??D;if(h){if(w=RN(S,h,m),m===`category`&&f){var k=Jy(w);_&&k?(T=w,w=(0,sR.default)(0,C)):_||(w=fP(O,w,n).reduce(function(e,t){return e.indexOf(t)>=0?e:[].concat(QU(e),[t])},[]))}else if(m===`category`)w=_?w.filter(function(e){return e!==``&&!(0,Ry.default)(e)}):fP(O,w,n).reduce(function(e,t){return e.indexOf(t)>=0||t===``||(0,Ry.default)(t)?e:[].concat(QU(e),[t])},[]);else if(m===`number`){var A=KN(S,r.filter(function(e){var t=a in e.props?e.props[a]:e.type.defaultProps?.[a],n=`hide`in e.props?e.props.hide:e.type.defaultProps?.hide;return t===x&&(b||!n)}),h,i,l);A&&(w=A)}f&&(m===`number`||v!==`auto`)&&(E=RN(S,h,`category`))}else w=f?(0,sR.default)(0,C):o&&o[x]&&o[x].hasStack&&m===`number`?d===`expand`?[0,1]:sP(o[x].stackGroups,s,c):qN(S,r.filter(function(e){var t=a in e.props?e.props[a]:e.type.defaultProps[a],n=`hide`in e.props?e.props.hide:e.type.defaultProps.hide;return t===x&&(b||!n)}),m,l,!0);if(m===`number`)w=uU(u,w,x,i,y),O&&(w=uP(O,w,g));else if(m===`category`&&O){var j=O;w.every(function(e){return j.indexOf(e)>=0})&&(w=j)}}return X(X({},t),{},aW({},x,X(X({},p),{},{axisType:i,domain:w,categoricalDomain:E,duplicateDomain:T,originalDomain:p.domain??D,isCategorical:f,layout:l})))},{})},yW=function(e,t){var n=t.graphicalItems,r=t.Axis,i=t.axisType,a=t.axisIdKey,o=t.stackGroups,s=t.dataStartIndex,c=t.dataEndIndex,l=e.layout,u=e.children,d=mW(e.data,{graphicalItems:n,dataStartIndex:s,dataEndIndex:c}),f=d.length,p=JN(l,i),m=-1;return n.reduce(function(e,t){var h=(t.type.defaultProps===void 0?t.props:X(X({},t.type.defaultProps),t.props))[a],g=hW(`number`);if(!e[h]){m++;var _;return p?_=(0,sR.default)(0,f):o&&o[h]&&o[h].hasStack?(_=sP(o[h].stackGroups,s,c),_=uU(u,_,h,i)):(_=uP(g,qN(d,n.filter(function(e){var t=a in e.props?e.props[a]:e.type.defaultProps?.[a],n=`hide`in e.props?e.props.hide:e.type.defaultProps?.hide;return t===h&&!n}),`number`,l),r.defaultProps.allowDataOverflow),_=uU(u,_,h,i)),X(X({},e),{},aW({},h,X(X({axisType:i},r.defaultProps),{},{hide:!0,orientation:(0,Iy.default)(cW,`${i}.${m%2}`,null),domain:_,originalDomain:g,isCategorical:p,layout:l})))}return e},{})},bW=function(e,t){var n=t.axisType,r=n===void 0?`xAxis`:n,i=t.AxisComp,a=t.graphicalItems,o=t.stackGroups,s=t.dataStartIndex,c=t.dataEndIndex,l=e.children,u=`${r}Id`,d=xb(l,i),f={};return d&&d.length?f=vW(e,{axes:d,graphicalItems:a,axisType:r,axisIdKey:u,stackGroups:o,dataStartIndex:s,dataEndIndex:c}):a&&a.length&&(f=yW(e,{Axis:i,graphicalItems:a,axisType:r,axisIdKey:u,stackGroups:o,dataStartIndex:s,dataEndIndex:c})),f},xW=function(e){var t=qy(e),n=YN(t,!1,!0);return{tooltipTicks:n,orderedTooltipTicks:(0,RC.default)(n,function(e){return e.coordinate}),tooltipAxis:t,tooltipAxisBandSize:dP(t,n)}},SW=function(e){var t=e.children,n=e.defaultShowTooltip,r=Sb(t,DR),i=0,a=0;return e.data&&e.data.length!==0&&(a=e.data.length-1),r&&r.props&&(r.props.startIndex>=0&&(i=r.props.startIndex),r.props.endIndex>=0&&(a=r.props.endIndex)),{chartX:0,chartY:0,dataStartIndex:i,dataEndIndex:a,activeTooltipIndex:-1,isTooltipActive:!!n}},CW=function(e){return!e||!e.length?!1:e.some(function(e){var t=_b(e&&e.type);return t&&t.indexOf(`Bar`)>=0})},wW=function(e){return e===`horizontal`?{numericAxisName:`yAxis`,cateAxisName:`xAxis`}:e===`vertical`?{numericAxisName:`xAxis`,cateAxisName:`yAxis`}:e===`centric`?{numericAxisName:`radiusAxis`,cateAxisName:`angleAxis`}:{numericAxisName:`angleAxis`,cateAxisName:`radiusAxis`}},TW=function(e,t){var n=e.props,r=e.graphicalItems,i=e.xAxisMap,a=i===void 0?{}:i,o=e.yAxisMap,s=o===void 0?{}:o,c=n.width,l=n.height,u=n.children,d=n.margin||{},f=Sb(u,DR),p=Sb(u,jC),m=Object.keys(s).reduce(function(e,t){var n=s[t],r=n.orientation;return!n.mirror&&!n.hide?X(X({},e),{},aW({},r,e[r]+n.width)):e},{left:d.left||0,right:d.right||0}),h=X(X({},Object.keys(a).reduce(function(e,t){var n=a[t],r=n.orientation;return!n.mirror&&!n.hide?X(X({},e),{},aW({},r,(0,Iy.default)(e,`${r}`)+n.height)):e},{top:d.top||0,bottom:d.bottom||0})),m),g=h.bottom;f&&(h.bottom+=f.props.height||DR.defaultProps.height),p&&t&&(h=UN(h,r,n,t));var _=c-h.left-h.right,v=l-h.top-h.bottom;return X(X({brushBottom:g},h),{},{width:Math.max(_,0),height:Math.max(v,0)})},EW=function(e,t){if(t===`xAxis`)return e[t].width;if(t===`yAxis`)return e[t].height},DW=function(e){var t=e.chartName,n=e.GraphicalChild,r=e.defaultTooltipEventType,i=r===void 0?`axis`:r,a=e.validateTooltipEventTypes,o=a===void 0?[`axis`]:a,s=e.axisComponents,c=e.legendContent,l=e.formatAxisMap,u=e.defaultProps,d=function(e,t){var n=t.graphicalItems,r=t.stackGroups,i=t.offset,a=t.updateId,o=t.dataStartIndex,c=t.dataEndIndex,l=e.barSize,u=e.layout,d=e.barGap,f=e.barCategoryGap,p=e.maxBarSize,m=wW(u),h=m.numericAxisName,g=m.cateAxisName,_=CW(n),v=[];return n.forEach(function(n,m){var y=mW(e.data,{graphicalItems:[n],dataStartIndex:o,dataEndIndex:c}),b=n.type.defaultProps===void 0?n.props:X(X({},n.type.defaultProps),n.props),x=b.dataKey,S=b.maxBarSize,C=b[`${h}Id`],w=b[`${g}Id`],T=s.reduce(function(e,n){var r=t[`${n.axisType}Map`],i=b[`${n.axisType}Id`];!(r&&r[i]||n.axisType===`zAxis`)&&HM(!1);var a=r[i];return X(X({},e),{},aW(aW({},n.axisType,a),`${n.axisType}Ticks`,YN(a)))},{}),E=T[g],D=T[`${g}Ticks`],O=r&&r[C]&&r[C].hasStack&&Ine(n,r[C].stackGroups),k=_b(n.type).indexOf(`Bar`)>=0,A=dP(E,D),j=[],M=_&&VN({barSize:l,stackGroups:r,totalSize:EW(T,g)});if(k){var N=(0,Ry.default)(S)?p:S,P=dP(E,D,!0)??N??0;j=HN({barGap:d,barCategoryGap:f,bandSize:P===A?A:P,sizeList:M[w],maxBarSize:N}),P!==A&&(j=j.map(function(e){return X(X({},e),{},{position:X(X({},e.position),{},{offset:e.position.offset-P/2})})}))}var F=n&&n.type&&n.type.getComposedData;F&&v.push({props:X(X({},F(X(X({},T),{},{displayedData:y,props:e,dataKey:x,item:n,bandSize:A,barPosition:j,offset:i,stackedData:O,layout:u,dataStartIndex:o,dataEndIndex:c}))),{},aW(aW(aW({key:n.key||`item-${m}`},h,T[h]),g,T[g]),`animationId`,a)),childIndex:Nb(n,e.children),item:n})}),v},f=function(e,r){var i=e.props,a=e.dataStartIndex,o=e.dataEndIndex,c=e.updateId;if(!Cb({props:i}))return null;var u=i.children,f=i.layout,p=i.stackOffset,m=i.data,h=i.reverseStackOrder,g=wW(f),_=g.numericAxisName,v=g.cateAxisName,y=xb(u,n),b=Pne(m,y,`${_}Id`,`${v}Id`,p,h),x=s.reduce(function(e,t){var n=`${t.axisType}Map`;return X(X({},e),{},aW({},n,bW(i,X(X({},t),{},{graphicalItems:y,stackGroups:t.axisType===_&&b,dataStartIndex:a,dataEndIndex:o}))))},{}),S=TW(X(X({},x),{},{props:i,graphicalItems:y}),r?.legendBBox);Object.keys(x).forEach(function(e){x[e]=l(i,x[e],S,e.replace(`Map`,``),t)});var C=x[`${v}Map`],w=xW(C);return X(X({formattedGraphicalItems:d(i,X(X({},x),{},{dataStartIndex:a,dataEndIndex:o,updateId:c,graphicalItems:y,stackGroups:b,offset:S})),graphicalItems:y,offset:S,stackGroups:b},w),x)},p=function(e){function n(e){var r;return HU(this,n),r=GU(this,n,[e]),aW(r,`eventEmitterSymbol`,Symbol(`rechartsEventEmitter`)),aW(r,`accessibilityManager`,new bU),aW(r,`handleLegendBBoxUpdate`,function(e){if(e){var t=r.state,n=t.dataStartIndex,i=t.dataEndIndex,a=t.updateId;r.setState(X({legendBBox:e},f({props:r.props,dataStartIndex:n,dataEndIndex:i,updateId:a},X(X({},r.state),{},{legendBBox:e}))))}}),aW(r,`handleReceiveSyncEvent`,function(e,t,n){if(r.props.syncId===e){if(n===r.eventEmitterSymbol&&typeof r.props.syncMethod!=`function`)return;r.applySyncEvent(t)}}),aW(r,`handleBrushChange`,function(e){var t=e.startIndex,n=e.endIndex;if(t!==r.state.dataStartIndex||n!==r.state.dataEndIndex){var i=r.state.updateId;r.setState(function(){return X({dataStartIndex:t,dataEndIndex:n},f({props:r.props,dataStartIndex:t,dataEndIndex:n,updateId:i},r.state))}),r.triggerSyncEvent({dataStartIndex:t,dataEndIndex:n})}}),aW(r,`handleMouseEnter`,function(e){var t=r.getMouseInfo(e);if(t){var n=X(X({},t),{},{isTooltipActive:!0});r.setState(n),r.triggerSyncEvent(n);var i=r.props.onMouseEnter;(0,lb.default)(i)&&i(n,e)}}),aW(r,`triggeredAfterMouseMove`,function(e){var t=r.getMouseInfo(e),n=t?X(X({},t),{},{isTooltipActive:!0}):{isTooltipActive:!1};r.setState(n),r.triggerSyncEvent(n);var i=r.props.onMouseMove;(0,lb.default)(i)&&i(n,e)}),aW(r,`handleItemMouseEnter`,function(e){r.setState(function(){return{isTooltipActive:!0,activeItem:e,activePayload:e.tooltipPayload,activeCoordinate:e.tooltipPosition||{x:e.cx,y:e.cy}}})}),aW(r,`handleItemMouseLeave`,function(){r.setState(function(){return{isTooltipActive:!1}})}),aW(r,`handleMouseMove`,function(e){e.persist(),r.throttleTriggeredAfterMouseMove(e)}),aW(r,`handleMouseLeave`,function(e){r.throttleTriggeredAfterMouseMove.cancel();var t={isTooltipActive:!1};r.setState(t),r.triggerSyncEvent(t);var n=r.props.onMouseLeave;(0,lb.default)(n)&&n(t,e)}),aW(r,`handleOuterEvent`,function(e){var t=Mb(e),n=(0,Iy.default)(r.props,`${t}`);t&&(0,lb.default)(n)&&n((/.*touch.*/i.test(t)?r.getMouseInfo(e.changedTouches[0]):r.getMouseInfo(e))??{},e)}),aW(r,`handleClick`,function(e){var t=r.getMouseInfo(e);if(t){var n=X(X({},t),{},{isTooltipActive:!0});r.setState(n),r.triggerSyncEvent(n);var i=r.props.onClick;(0,lb.default)(i)&&i(n,e)}}),aW(r,`handleMouseDown`,function(e){var t=r.props.onMouseDown;(0,lb.default)(t)&&t(r.getMouseInfo(e),e)}),aW(r,`handleMouseUp`,function(e){var t=r.props.onMouseUp;(0,lb.default)(t)&&t(r.getMouseInfo(e),e)}),aW(r,`handleTouchMove`,function(e){e.changedTouches!=null&&e.changedTouches.length>0&&r.throttleTriggeredAfterMouseMove(e.changedTouches[0])}),aW(r,`handleTouchStart`,function(e){e.changedTouches!=null&&e.changedTouches.length>0&&r.handleMouseDown(e.changedTouches[0])}),aW(r,`handleTouchEnd`,function(e){e.changedTouches!=null&&e.changedTouches.length>0&&r.handleMouseUp(e.changedTouches[0])}),aW(r,`handleDoubleClick`,function(e){var t=r.props.onDoubleClick;(0,lb.default)(t)&&t(r.getMouseInfo(e),e)}),aW(r,`handleContextMenu`,function(e){var t=r.props.onContextMenu;(0,lb.default)(t)&&t(r.getMouseInfo(e),e)}),aW(r,`triggerSyncEvent`,function(e){r.props.syncId!==void 0&&dU.emit(fU,r.props.syncId,e,r.eventEmitterSymbol)}),aW(r,`applySyncEvent`,function(e){var t=r.props,n=t.layout,i=t.syncMethod,a=r.state.updateId,o=e.dataStartIndex,s=e.dataEndIndex;if(e.dataStartIndex!==void 0||e.dataEndIndex!==void 0)r.setState(X({dataStartIndex:o,dataEndIndex:s},f({props:r.props,dataStartIndex:o,dataEndIndex:s,updateId:a},r.state)));else if(e.activeTooltipIndex!==void 0){var c=e.chartX,l=e.chartY,u=e.activeTooltipIndex,d=r.state,p=d.offset,m=d.tooltipTicks;if(!p)return;if(typeof i==`function`)u=i(m,e);else if(i===`value`){u=-1;for(var h=0;h<m.length;h++)if(m[h].value===e.activeLabel){u=h;break}}var g=X(X({},p),{},{x:p.left,y:p.top}),_=Math.min(c,g.x+g.width),v=Math.min(l,g.y+g.height),y=m[u]&&m[u].value,b=gW(r.state,r.props.data,u),x=m[u]?{x:n===`horizontal`?m[u].coordinate:_,y:n===`horizontal`?v:m[u].coordinate}:uW;r.setState(X(X({},e),{},{activeLabel:y,activeCoordinate:x,activePayload:b,activeTooltipIndex:u}))}else r.setState(e)}),aW(r,`renderCursor`,function(e){var n=r.state,i=n.isTooltipActive,a=n.activeCoordinate,o=n.activePayload,s=n.offset,c=n.activeTooltipIndex,l=n.tooltipAxisBandSize,u=r.getTooltipEventType(),d=e.props.active??i,f=r.props.layout,p=e.key||`_recharts-cursor`;return _.createElement(jU,{key:p,activeCoordinate:a,activePayload:o,activeTooltipIndex:c,chartName:t,element:e,isActive:d,layout:f,offset:s,tooltipAxisBandSize:l,tooltipEventType:u})}),aW(r,`renderPolarAxis`,function(e,t,n){var i=(0,Iy.default)(e,`type.axisType`),a=(0,Iy.default)(r.state,`${i}Map`),o=e.type.defaultProps,s=o===void 0?e.props:X(X({},o),e.props),c=a&&a[s[`${i}Id`]];return(0,_.cloneElement)(e,X(X({},c),{},{className:Ht(i,c.className),key:e.key||`${t}-${n}`,ticks:YN(c,!0)}))}),aW(r,`renderPolarGrid`,function(e){var t=e.props,n=t.radialLines,i=t.polarAngles,a=t.polarRadius,o=r.state,s=o.radiusAxisMap,c=o.angleAxisMap,l=qy(s),u=qy(c),d=u.cx,f=u.cy,p=u.innerRadius,m=u.outerRadius;return(0,_.cloneElement)(e,{polarAngles:Array.isArray(i)?i:YN(u,!0).map(function(e){return e.coordinate}),polarRadius:Array.isArray(a)?a:YN(l,!0).map(function(e){return e.coordinate}),cx:d,cy:f,innerRadius:p,outerRadius:m,key:e.key||`polar-grid`,radialLines:n})}),aW(r,`renderLegend`,function(){var e=r.state.formattedGraphicalItems,t=r.props,n=t.children,i=t.width,a=t.height,o=r.props.margin||{},s=bN({children:n,formattedGraphicalItems:e,legendWidth:i-(o.left||0)-(o.right||0),legendContent:c});if(!s)return null;var l=s.item,u=BU(s,MU);return(0,_.cloneElement)(l,X(X({},u),{},{chartWidth:i,chartHeight:a,margin:o,onBBoxUpdate:r.handleLegendBBoxUpdate}))}),aW(r,`renderTooltip`,function(){var e=r.props,t=e.children,n=e.accessibilityLayer,i=Sb(t,Hw);if(!i)return null;var a=r.state,o=a.isTooltipActive,s=a.activeCoordinate,c=a.activePayload,l=a.activeLabel,u=a.offset,d=i.props.active??o;return(0,_.cloneElement)(i,{viewBox:X(X({},u),{},{x:u.left,y:u.top}),active:d,label:l,payload:d?c:[],coordinate:s,accessibilityLayer:n})}),aW(r,`renderBrush`,function(e){var t=r.props,n=t.margin,i=t.data,a=r.state,o=a.offset,s=a.dataStartIndex,c=a.dataEndIndex,l=a.updateId;return(0,_.cloneElement)(e,{key:e.key||`_recharts-brush`,onChange:ZN(r.handleBrushChange,e.props.onChange),data:i,x:Vy(e.props.x)?e.props.x:o.left,y:Vy(e.props.y)?e.props.y:o.top+o.height+o.brushBottom-(n.bottom||0),width:Vy(e.props.width)?e.props.width:o.width,startIndex:s,endIndex:c,updateId:`brush-${l}`})}),aW(r,`renderReferenceElement`,function(e,t,n){if(!e)return null;var i=r.clipPathId,a=r.state,o=a.xAxisMap,s=a.yAxisMap,c=a.offset,l=e.type.defaultProps||{},u=e.props,d=u.xAxisId,f=d===void 0?l.xAxisId:d,p=u.yAxisId,m=p===void 0?l.yAxisId:p;return(0,_.cloneElement)(e,{key:e.key||`${t}-${n}`,xAxis:o[f],yAxis:s[m],viewBox:{x:c.left,y:c.top,width:c.width,height:c.height},clipPathId:i})}),aW(r,`renderActivePoints`,function(e){var t=e.item,r=e.activePoint,i=e.basePoint,a=e.childIndex,o=e.isRange,s=[],c=t.props.key,l=t.item.type.defaultProps===void 0?t.item.props:X(X({},t.item.type.defaultProps),t.item.props),u=l.activeDot,d=l.dataKey,f=X(X({index:a,dataKey:d,cx:r.x,cy:r.y,r:4,fill:BN(t.item),strokeWidth:2,stroke:`#fff`,payload:r.payload,value:r.value},Ob(u,!1)),ob(u));return s.push(n.renderActiveDot(u,f,`${c}-activePoint-${a}`)),i?s.push(n.renderActiveDot(u,X(X({},f),{},{cx:i.x,cy:i.y}),`${c}-basePoint-${a}`)):o&&s.push(null),s}),aW(r,`renderGraphicChild`,function(e,t,n){var i=r.filterFormatItem(e,t,n);if(!i)return null;var a=r.getTooltipEventType(),o=r.state,s=o.isTooltipActive,c=o.tooltipAxis,l=o.activeTooltipIndex,u=o.activeLabel,d=r.props.children,f=Sb(d,Hw),p=i.props,m=p.points,h=p.isRange,g=p.baseLine,v=i.item.type.defaultProps===void 0?i.item.props:X(X({},i.item.type.defaultProps),i.item.props),y=v.activeDot,b=v.hide,x=v.activeBar,S=v.activeShape,C=!!(!b&&s&&f&&(y||x||S)),w={};a!==`axis`&&f&&f.props.trigger===`click`?w={onClick:ZN(r.handleItemMouseEnter,e.props.onClick)}:a!==`axis`&&(w={onMouseLeave:ZN(r.handleItemMouseLeave,e.props.onMouseLeave),onMouseEnter:ZN(r.handleItemMouseEnter,e.props.onMouseEnter)});var T=(0,_.cloneElement)(e,X(X({},i.props),w));function E(e){return typeof c.dataKey==`function`?c.dataKey(e.payload):null}if(C){if(l>=0){var D,O;if(c.dataKey&&!c.allowDuplicatedCategory){var k=typeof c.dataKey==`function`?E:`payload.${c.dataKey.toString()}`;D=Xy(m,k,u),O=h&&g&&Xy(g,k,u)}else D=m?.[l],O=h&&g&&g[l];if(S||x){var A=e.props.activeIndex===void 0?l:e.props.activeIndex;return[(0,_.cloneElement)(e,X(X(X({},i.props),w),{},{activeIndex:A})),null,null]}if(!(0,Ry.default)(D))return[T].concat(QU(r.renderActivePoints({item:i,activePoint:D,basePoint:O,childIndex:l,isRange:h})))}else{var j=(r.getItemByXY(r.state.activeCoordinate)??{graphicalItem:T}).graphicalItem,M=j.item,N=M===void 0?e:M,P=j.childIndex,F=X(X(X({},i.props),w),{},{activeIndex:P});return[(0,_.cloneElement)(N,F),null,null]}}return h?[T,null,null]:[T,null]}),aW(r,`renderCustomized`,function(e,t,n){return(0,_.cloneElement)(e,X(X({key:`recharts-customized-${n}`},r.props),r.state))}),aW(r,`renderMap`,{CartesianGrid:{handler:dW,once:!0},ReferenceArea:{handler:r.renderReferenceElement},ReferenceLine:{handler:dW},ReferenceDot:{handler:r.renderReferenceElement},XAxis:{handler:dW},YAxis:{handler:dW},Brush:{handler:r.renderBrush,once:!0},Bar:{handler:r.renderGraphicChild},Line:{handler:r.renderGraphicChild},Area:{handler:r.renderGraphicChild},Radar:{handler:r.renderGraphicChild},RadialBar:{handler:r.renderGraphicChild},Scatter:{handler:r.renderGraphicChild},Pie:{handler:r.renderGraphicChild},Funnel:{handler:r.renderGraphicChild},Tooltip:{handler:r.renderCursor,once:!0},PolarGrid:{handler:r.renderPolarGrid,once:!0},PolarAngleAxis:{handler:r.renderPolarAxis},PolarRadiusAxis:{handler:r.renderPolarAxis},Customized:{handler:r.renderCustomized}}),r.clipPathId=`${e.id??Gy(`recharts`)}-clip`,r.throttleTriggeredAfterMouseMove=(0,Jw.default)(r.triggeredAfterMouseMove,e.throttleDelay??1e3/60),r.state={},r}return XU(n,e),WU(n,[{key:`componentDidMount`,value:function(){this.addListener(),this.accessibilityManager.setDetails({container:this.container,offset:{left:this.props.margin.left??0,top:this.props.margin.top??0},coordinateList:this.state.tooltipTicks,mouseHandlerCallback:this.triggeredAfterMouseMove,layout:this.props.layout}),this.displayDefaultTooltip()}},{key:`displayDefaultTooltip`,value:function(){var e=this.props,t=e.children,n=e.data,r=e.height,i=e.layout,a=Sb(t,Hw);if(a){var o=a.props.defaultIndex;if(!(typeof o!=`number`||o<0||o>this.state.tooltipTicks.length-1)){var s=this.state.tooltipTicks[o]&&this.state.tooltipTicks[o].value,c=gW(this.state,n,o,s),l=this.state.tooltipTicks[o].coordinate,u=(this.state.offset.top+r)/2,d=i===`horizontal`?{x:l,y:u}:{y:l,x:u},f=this.state.formattedGraphicalItems.find(function(e){return e.item.type.name===`Scatter`});f&&(d=X(X({},d),f.props.points[o].tooltipPosition),c=f.props.points[o].tooltipPayload);var p={activeTooltipIndex:o,isTooltipActive:!0,activeLabel:s,activePayload:c,activeCoordinate:d};this.setState(p),this.renderCursor(a),this.accessibilityManager.setIndex(o)}}}},{key:`getSnapshotBeforeUpdate`,value:function(e,t){return this.props.accessibilityLayer&&(this.state.tooltipTicks!==t.tooltipTicks&&this.accessibilityManager.setDetails({coordinateList:this.state.tooltipTicks}),this.props.layout!==e.layout&&this.accessibilityManager.setDetails({layout:this.props.layout}),this.props.margin!==e.margin&&this.accessibilityManager.setDetails({offset:{left:this.props.margin.left??0,top:this.props.margin.top??0}})),null}},{key:`componentDidUpdate`,value:function(e){kb([Sb(e.children,Hw)],[Sb(this.props.children,Hw)])||this.displayDefaultTooltip()}},{key:`componentWillUnmount`,value:function(){this.removeListener(),this.throttleTriggeredAfterMouseMove.cancel()}},{key:`getTooltipEventType`,value:function(){var e=Sb(this.props.children,Hw);if(e&&typeof e.props.shared==`boolean`){var t=e.props.shared?`axis`:`item`;return o.indexOf(t)>=0?t:i}return i}},{key:`getMouseInfo`,value:function(e){if(!this.container)return null;var t=this.container,n=t.getBoundingClientRect(),r=xT(n),i={chartX:Math.round(e.pageX-r.left),chartY:Math.round(e.pageY-r.top)},a=n.width/t.offsetWidth||1,o=this.inRange(i.chartX,i.chartY,a);if(!o)return null;var s=this.state,c=s.xAxisMap,l=s.yAxisMap,u=this.getTooltipEventType(),d=_W(this.state,this.props.data,this.props.layout,o);if(u!==`axis`&&c&&l){var f=qy(c).scale,p=qy(l).scale,m=f&&f.invert?f.invert(i.chartX):null,h=p&&p.invert?p.invert(i.chartY):null;return X(X({},i),{},{xValue:m,yValue:h},d)}return d?X(X({},i),d):null}},{key:`inRange`,value:function(e,t){var n=arguments.length>2&&arguments[2]!==void 0?arguments[2]:1,r=this.props.layout,i=e/n,a=t/n;if(r===`horizontal`||r===`vertical`){var o=this.state.offset;return i>=o.left&&i<=o.left+o.width&&a>=o.top&&a<=o.top+o.height?{x:i,y:a}:null}var s=this.state,c=s.angleAxisMap,l=s.radiusAxisMap;if(c&&l){var u=qy(c);return SP({x:i,y:a},u)}return null}},{key:`parseEventsOfWrapper`,value:function(){var e=this.props.children,t=this.getTooltipEventType(),n=Sb(e,Hw),r={};return n&&t===`axis`&&(r=n.props.trigger===`click`?{onClick:this.handleClick}:{onMouseEnter:this.handleMouseEnter,onDoubleClick:this.handleDoubleClick,onMouseMove:this.handleMouseMove,onMouseLeave:this.handleMouseLeave,onTouchMove:this.handleTouchMove,onTouchStart:this.handleTouchStart,onTouchEnd:this.handleTouchEnd,onContextMenu:this.handleContextMenu}),X(X({},ob(this.props,this.handleOuterEvent)),r)}},{key:`addListener`,value:function(){dU.on(fU,this.handleReceiveSyncEvent)}},{key:`removeListener`,value:function(){dU.removeListener(fU,this.handleReceiveSyncEvent)}},{key:`filterFormatItem`,value:function(e,t,n){for(var r=this.state.formattedGraphicalItems,i=0,a=r.length;i<a;i++){var o=r[i];if(o.item===e||o.props.key===e.key||t===_b(o.item.type)&&n===o.childIndex)return o}return null}},{key:`renderClipPath`,value:function(){var e=this.clipPathId,t=this.state.offset,n=t.left,r=t.top,i=t.height,a=t.width;return _.createElement(`defs`,null,_.createElement(`clipPath`,{id:e},_.createElement(`rect`,{x:n,y:r,height:i,width:a})))}},{key:`getXScales`,value:function(){var e=this.state.xAxisMap;return e?Object.entries(e).reduce(function(e,t){var n=IU(t,2),r=n[0],i=n[1];return X(X({},e),{},aW({},r,i.scale))},{}):null}},{key:`getYScales`,value:function(){var e=this.state.yAxisMap;return e?Object.entries(e).reduce(function(e,t){var n=IU(t,2),r=n[0],i=n[1];return X(X({},e),{},aW({},r,i.scale))},{}):null}},{key:`getXScaleByAxisId`,value:function(e){var t;return(t=this.state.xAxisMap)==null||(t=t[e])==null?void 0:t.scale}},{key:`getYScaleByAxisId`,value:function(e){var t;return(t=this.state.yAxisMap)==null||(t=t[e])==null?void 0:t.scale}},{key:`getItemByXY`,value:function(e){var t=this.state,n=t.formattedGraphicalItems,r=t.activeItem;if(n&&n.length)for(var i=0,a=n.length;i<a;i++){var o=n[i],s=o.props,c=o.item,l=c.type.defaultProps===void 0?c.props:X(X({},c.type.defaultProps),c.props),u=_b(c.type);if(u===`Bar`){var d=(s.data||[]).find(function(t){return Aae(e,t)});if(d)return{graphicalItem:o,payload:d}}else if(u===`RadialBar`){var f=(s.data||[]).find(function(t){return SP(e,t)});if(f)return{graphicalItem:o,payload:f}}else if(bL(o,r)||xL(o,r)||SL(o,r)){var p=kL({graphicalItem:o,activeTooltipItem:r,itemData:l.data}),m=l.activeIndex===void 0?p:l.activeIndex;return{graphicalItem:X(X({},o),{},{childIndex:m}),payload:SL(o,r)?l.data[p]:o.props.data[p]}}}return null}},{key:`render`,value:function(){var e=this;if(!Cb(this))return null;var t=this.props,n=t.children,r=t.className,i=t.width,a=t.height,o=t.style,s=t.compact,c=t.title,l=t.desc,u=Ob(BU(t,NU),!1);if(s)return _.createElement(qz,{state:this.state,width:this.props.width,height:this.props.height,clipPathId:this.clipPathId},_.createElement(Rb,FU({},u,{width:i,height:a,title:c,desc:l}),this.renderClipPath(),jb(n,this.renderMap)));this.props.accessibilityLayer&&(u.tabIndex=this.props.tabIndex??0,u.role=this.props.role??`application`,u.onKeyDown=function(t){e.accessibilityManager.keyboardEvent(t)},u.onFocus=function(){e.accessibilityManager.focus()});var d=this.parseEventsOfWrapper();return _.createElement(qz,{state:this.state,width:this.props.width,height:this.props.height,clipPathId:this.clipPathId},_.createElement(`div`,FU({className:Ht(`recharts-wrapper`,r),style:X({position:`relative`,cursor:`default`,width:i,height:a},o)},d,{ref:function(t){e.container=t}}),_.createElement(Rb,FU({},u,{width:i,height:a,title:c,desc:l,style:lW}),this.renderClipPath(),jb(n,this.renderMap)),this.renderLegend(),this.renderTooltip()))}}])}(_.Component);aW(p,`displayName`,t),aW(p,`defaultProps`,X({layout:`horizontal`,stackOffset:`none`,barCategoryGap:`10%`,barGap:4,margin:{top:5,right:5,bottom:5,left:5},reverseStackOrder:!1,syncMethod:`index`},u)),aW(p,`getDerivedStateFromProps`,function(e,t){var n=e.dataKey,r=e.data,i=e.children,a=e.width,o=e.height,s=e.layout,c=e.stackOffset,l=e.margin,u=t.dataStartIndex,d=t.dataEndIndex;if(t.updateId===void 0){var p=SW(e);return X(X(X({},p),{},{updateId:0},f(X(X({props:e},p),{},{updateId:0}),t)),{},{prevDataKey:n,prevData:r,prevWidth:a,prevHeight:o,prevLayout:s,prevStackOffset:c,prevMargin:l,prevChildren:i})}if(n!==t.prevDataKey||r!==t.prevData||a!==t.prevWidth||o!==t.prevHeight||s!==t.prevLayout||c!==t.prevStackOffset||!Qy(l,t.prevMargin)){var m=SW(e),h={chartX:t.chartX,chartY:t.chartY,isTooltipActive:t.isTooltipActive},g=X(X({},_W(t,r,s)),{},{updateId:t.updateId+1}),_=X(X(X({},m),h),g);return X(X(X({},_),f(X({props:e},_),t)),{},{prevDataKey:n,prevData:r,prevWidth:a,prevHeight:o,prevLayout:s,prevStackOffset:c,prevMargin:l,prevChildren:i})}if(!kb(i,t.prevChildren)){var v=Sb(i,DR),y=v?v.props?.startIndex??u:u,b=v?v.props?.endIndex??d:d,x=y!==u||b!==d,S=!(0,Ry.default)(r)&&!x?t.updateId:t.updateId+1;return X(X({updateId:S},f(X(X({props:e},t),{},{updateId:S,dataStartIndex:y,dataEndIndex:b}),t)),{},{prevChildren:i,dataStartIndex:y,dataEndIndex:b})}return null}),aW(p,`renderActiveDot`,function(e,t,n){var r=(0,_.isValidElement)(e)?(0,_.cloneElement)(e,t):(0,lb.default)(e)?e(t):_.createElement(dI,t);return _.createElement(Ub,{className:`recharts-active-dot`,key:n},r)});var m=(0,_.forwardRef)(function(e,t){return _.createElement(p,FU({},e,{ref:t}))});return m.displayName=p.displayName,m},OW=DW({chartName:`LineChart`,GraphicalChild:CH,axisComponents:[{axisType:`xAxis`,AxisComp:BH},{axisType:`yAxis`,AxisComp:rU}],formatAxisMap:Oz}),kW=DW({chartName:`BarChart`,GraphicalChild:gz,defaultTooltipEventType:`axis`,validateTooltipEventTypes:[`axis`,`item`],axisComponents:[{axisType:`xAxis`,AxisComp:BH},{axisType:`yAxis`,AxisComp:rU}],formatAxisMap:Oz}),AW=DW({chartName:`PieChart`,GraphicalChild:JL,validateTooltipEventTypes:[`item`],defaultTooltipEventType:`item`,legendContent:`children`,axisComponents:[{axisType:`angleAxis`,AxisComp:RI},{axisType:`radiusAxis`,AxisComp:EI}],formatAxisMap:Kne,defaultProps:{layout:`centric`,startAngle:0,endAngle:360,cx:`50%`,cy:`50%`,innerRadius:0,outerRadius:`80%`}});function jW(e){return Array.from(new Map(e.scenarios.map(e=>{let t=String(e.scenarioId??``).trim(),n=String(e.scenarioName??``).trim();return!t&&!n?null:[t||n,n||t]}).filter(e=>!!e)).values())}function MW(e){let t=jW(e),n=e.scenarios.map(e=>e.agentName||e.agentId).filter(Boolean),r=Array.from(new Set(n.length>0?n:e.rerunAgents??[])),i=Array.from(new Set(e.scenarios.map(e=>e.model).filter(e=>!!e))),a=t.slice(0,2).join(`, `),o=t.length>2?` +${t.length-2}`:``,s=i.slice(0,2).join(`, `),c=i.length>2?` +${i.length-2}`:``,l=e.configName?.trim()||``,u=e.configPath?.trim()||``,d=l||u;return{scenarioCount:t.length,agentCount:r.length,scopePreview:d||(a?`${a}${o}`:`n/a`),modelSummary:s?`${s}${c}`:``}}function NW(e){let t=typeof e.toolTokensTotal==`number`?e.toolTokensTotal:null;return{id:e.runId,evaluationRunId:e.evaluationRunId,configId:``,configHash:e.configHash,configPath:e.configPath,configName:e.configName,langsmithTraceUrls:e.langsmithTraceUrls,rerunAgents:e.rerunAgents,rerunScenarioIds:e.rerunScenarioIds,rerunServerOverrideAll:e.rerunServerOverrideAll,rerunScenarioServerOverrides:e.rerunScenarioServerOverrides,timestamp:e.timestamp,runNote:e.runNote,mcpServerVersions:e.mcpServerVersions??{},scenarios:(e.scenarioIds??[]).map((t,n)=>({scenarioId:t,scenarioName:e.scenarioNames?.[n]??t,agentId:e.agentIds?.[n]??``,agentName:e.agentIds?.[n]??``,runs:[],passRate:null,avgToolCalls:0,avgDuration:0})),assistantTokenUsage:null,toolTokenUsage:t===null?null:{inputTokens:null,outputTokens:null,totalTokens:t},overallPassRate:e.passRate,totalScenarios:e.totalScenarios,totalRuns:e.totalRuns,avgToolCalls:e.avgToolCalls,avgLatency:Math.round(e.avgLatencyMs??0),totalDurationMs:typeof e.totalDurationMs==`number`?Math.max(0,e.totalDurationMs):void 0,totalToolDurationMs:typeof e.totalToolDurationMs==`number`?Math.max(0,e.totalToolDurationMs):void 0,outcomes:e.outcomes,executionSource:e.executionSource,executionClient:e.executionClient,checkCounts:e.checkCounts}}var PW=6048e5;function FW(e){return e.length===0?0:e.reduce((e,t)=>e+t,0)/e.length}function IW(e,t=0){let n=Number(e.toFixed(t));return`${n>0?`+`:``}${n.toFixed(t)}`}var LW=()=>{let{configs:e}=fv(),{source:t}=nv(),[n,r]=(0,_.useState)(!0),[i,a]=(0,_.useState)([]),[o,s]=(0,_.useState)([]),[c,l]=(0,_.useState)([]),[u,d]=(0,_.useState)(`timestamp`),[f,p]=(0,_.useState)(`desc`),m=e=>{u===e?p(e=>e===`asc`?`desc`:`asc`):(d(e),p(`desc`))};(0,_.useEffect)(()=>{let e=!0;r(!0);let n=Date.now(),i=n-2592e6,o=n-PW,c=o-PW,u=new Date(i).toISOString(),d=new Date(o).toISOString(),f=new Date(c).toISOString(),p=new Date(o-1).toISOString(),m=new Date(n).toISOString(),h=async(e,n)=>t.listRunSummaries?(await t.listRunSummaries({since:e,until:n})).map(NW):t.listResults({since:e,until:n});return Promise.all([h(u,m),h(d,m),h(f,p)]).then(([t,n,r])=>{e&&(a(t),s(n),l(r))}).finally(()=>{e&&r(!1)}),()=>{e=!1}},[t]);let h=e.length,g=i.length,v=o.map(e=>e.overallPassRate).filter(e=>e!==null),y=v.length>0?FW(v):null,b=o.length===0?0:Math.round(o.reduce((e,t)=>e+t.avgLatency,0)/o.length),x=c.map(e=>e.overallPassRate).filter(e=>e!==null),S=x.length>0?FW(x):null,C=FW(c.map(e=>e.avgLatency)),w=y===null||S===null?null:(y-S)*100,T=b-C,E=c.length>0,D=w===null?`No prior-week baseline`:`${IW(w,1)}% from last week`,O=E?`${IW(T,0)}ms from last week`:`No prior-week baseline`,k=w===null?`neutral`:w>0?`up`:w<0?`down`:`neutral`,A=E?T<0?`up`:T>0?`down`:`neutral`:`neutral`,j=(0,_.useMemo)(()=>[...i].sort((e,t)=>{let n=0;return u===`timestamp`&&(n=new Date(e.timestamp).getTime()-new Date(t.timestamp).getTime()),u===`passRate`&&(n=(e.overallPassRate??-1)-(t.overallPassRate??-1)),u===`latency`&&(n=e.avgLatency-t.avgLatency),u===`scenarios`&&(n=e.totalScenarios-t.totalScenarios),f===`asc`?n:-n}),[i,u,f]),M=j.slice(0,20),N=e=>{let t=e.toolTokenUsage?.totalTokens;return typeof t==`number`?t.toLocaleString():`n/a`},P=[...j].reverse().map(e=>({date:new Date(e.timestamp).toLocaleDateString(`en-US`,{month:`short`,day:`numeric`}),passRate:e.overallPassRate===null?null:Math.round(e.overallPassRate*100),latency:e.avgLatency}));return(0,I.jsxs)(`div`,{className:`space-y-6`,children:[(0,I.jsxs)(`div`,{className:`flex items-start justify-between gap-4`,children:[(0,I.jsxs)(`div`,{children:[(0,I.jsxs)(`h1`,{className:`inline-flex items-center gap-2 text-2xl font-bold`,children:[(0,I.jsx)(Fn,{className:`h-6 w-6`}),`Dashboard`]}),(0,I.jsx)(`p`,{className:`text-sm text-muted-foreground`,children:`Overview of your MCP evaluation runs`})]}),(0,I.jsxs)(`div`,{className:`flex gap-3`,children:[(0,I.jsx)(W,{asChild:!0,children:(0,I.jsxs)(np,{to:`/mcp-evaluations/new`,children:[(0,I.jsx)(nr,{className:`mr-2 h-4 w-4`}),`New MCP Evaluation`]})}),(0,I.jsx)(W,{variant:`outline`,asChild:!0,children:(0,I.jsxs)(np,{to:`/run`,children:[(0,I.jsx)(Yn,{className:`mr-2 h-4 w-4`}),`Run Evaluation`]})}),(0,I.jsx)(W,{variant:`outline`,asChild:!0,children:(0,I.jsxs)(np,{to:`/results`,children:[(0,I.jsx)(rn,{className:`mr-2 h-4 w-4`}),`Browse Results`]})})]})]}),(0,I.jsxs)(`div`,{className:`grid gap-4 sm:grid-cols-2 lg:grid-cols-4`,children:[(0,I.jsx)(Dv,{title:`MCP Evaluations`,value:h,icon:Pn,subtitle:`${h} active`}),(0,I.jsx)(Dv,{title:`Total Runs`,value:g,icon:Xt,subtitle:`Last 30 days`}),(0,I.jsx)(Dv,{title:`Pass Rate`,value:n?`–`:Wi(y),icon:rn,subtitle:n?`Loading...`:D,trend:n?`neutral`:k}),(0,I.jsx)(Dv,{title:`Avg Latency`,value:n?`—`:`${b}ms`,icon:cr,subtitle:n?`Loading...`:O,trend:n?`neutral`:A})]}),(0,I.jsxs)(`div`,{className:`grid gap-6 lg:grid-cols-2`,children:[(0,I.jsxs)(K,{children:[(0,I.jsx)(gv,{className:`pb-3`,children:(0,I.jsx)(_v,{className:`text-base`,children:`Pass Rate Trend`})}),(0,I.jsx)(q,{children:(0,I.jsx)(sT,{width:`100%`,height:200,children:(0,I.jsxs)(OW,{data:P,children:[(0,I.jsx)(BH,{dataKey:`date`,tick:{fontSize:11},tickLine:!1,axisLine:!1}),(0,I.jsx)(rU,{domain:[0,100],tick:{fontSize:11},tickLine:!1,axisLine:!1,tickFormatter:e=>`${e}%`}),(0,I.jsx)(Hw,{formatter:e=>[`${e}%`,`Pass Rate`]}),(0,I.jsx)(CH,{type:`monotone`,dataKey:`passRate`,stroke:`hsl(38, 92%, 50%)`,strokeWidth:2,dot:{r:3,fill:`hsl(38, 92%, 50%)`}})]})})})]}),(0,I.jsxs)(K,{children:[(0,I.jsx)(gv,{className:`pb-3`,children:(0,I.jsx)(_v,{className:`text-base`,children:`Recent Tool Latency (ms)`})}),(0,I.jsx)(q,{children:(0,I.jsx)(sT,{width:`100%`,height:200,children:(0,I.jsxs)(OW,{data:P,children:[(0,I.jsx)(BH,{dataKey:`date`,tick:{fontSize:11},tickLine:!1,axisLine:!1}),(0,I.jsx)(rU,{tick:{fontSize:11},tickLine:!1,axisLine:!1}),(0,I.jsx)(Hw,{formatter:e=>[`${e}ms`,`Latency`]}),(0,I.jsx)(CH,{type:`monotone`,dataKey:`latency`,stroke:`hsl(200, 80%, 50%)`,strokeWidth:2,dot:{r:3,fill:`hsl(200, 80%, 50%)`}})]})})})]})]}),(0,I.jsx)(`div`,{className:`grid gap-6`,children:(0,I.jsxs)(K,{children:[(0,I.jsx)(gv,{className:`pb-3`,children:(0,I.jsx)(_v,{className:`text-base`,children:`Recent Runs`})}),(0,I.jsxs)(q,{className:`p-0`,children:[(0,I.jsxs)(bv,{children:[(0,I.jsx)(xv,{children:(0,I.jsxs)(wv,{children:[(0,I.jsx)(Tv,{children:`Run ID`}),(0,I.jsx)(Tv,{children:`Evaluated`}),(0,I.jsx)(Tv,{children:(0,I.jsxs)(`button`,{type:`button`,className:`inline-flex items-center gap-1 hover:text-foreground`,onClick:()=>m(`timestamp`),children:[`Timestamp`,u===`timestamp`?f===`asc`?(0,I.jsx)(cn,{className:`h-3.5 w-3.5`}):(0,I.jsx)(on,{className:`h-3.5 w-3.5`}):(0,I.jsx)(ln,{className:`h-3.5 w-3.5 text-muted-foreground`})]})}),(0,I.jsx)(Tv,{className:`text-right`,children:(0,I.jsxs)(`button`,{type:`button`,className:`inline-flex w-full items-center justify-end gap-1 hover:text-foreground`,onClick:()=>m(`passRate`),children:[`Pass Rate`,u===`passRate`?f===`asc`?(0,I.jsx)(cn,{className:`h-3.5 w-3.5`}):(0,I.jsx)(on,{className:`h-3.5 w-3.5`}):(0,I.jsx)(ln,{className:`h-3.5 w-3.5 text-muted-foreground`})]})}),(0,I.jsx)(Tv,{className:`text-right`,children:(0,I.jsxs)(`button`,{type:`button`,className:`inline-flex items-center gap-1 hover:text-foreground`,onClick:()=>m(`scenarios`),children:[`Scenarios`,u===`scenarios`?f===`asc`?(0,I.jsx)(cn,{className:`h-3.5 w-3.5`}):(0,I.jsx)(on,{className:`h-3.5 w-3.5`}):(0,I.jsx)(ln,{className:`h-3.5 w-3.5 text-muted-foreground`})]})}),(0,I.jsx)(Tv,{className:`text-right`,children:`Avg Tools`}),(0,I.jsx)(Tv,{className:`text-right`,children:`Tool Tokens`})]})}),(0,I.jsxs)(Sv,{children:[M.length===0&&(0,I.jsx)(wv,{children:(0,I.jsx)(J,{colSpan:7,className:`py-8 text-center text-sm text-muted-foreground`,children:`No runs in the past 30 days.`})}),M.map(e=>(0,I.jsxs)(wv,{className:`cursor-pointer`,children:[(0,I.jsx)(J,{children:(0,I.jsx)(np,{to:`/results/${e.id}`,className:`font-mono text-xs text-primary hover:underline`,children:e.id})}),(0,I.jsx)(J,{className:`text-[11px] text-muted-foreground`,children:(()=>{let t=MW(e);return(0,I.jsxs)(`div`,{className:`space-y-0.5`,children:[(0,I.jsxs)(`div`,{children:[`Evaluated: `,t.scenarioCount,` scenario`,t.scenarioCount===1?``:`s`,` · `,t.agentCount,` agent`,t.agentCount===1?``:`s`,t.modelSummary?` · ${t.modelSummary}`:``]}),(0,I.jsx)(`div`,{className:`font-mono text-xs text-foreground/80`,children:t.scopePreview})]})})()}),(0,I.jsx)(J,{className:`text-xs text-muted-foreground`,children:(0,I.jsxs)(`div`,{className:`flex items-center gap-1`,children:[(0,I.jsx)(_n,{className:`h-3 w-3`}),new Date(e.timestamp).toLocaleString()]})}),(0,I.jsx)(J,{className:`text-right`,children:(0,I.jsx)(kv,{rate:e.overallPassRate})}),(0,I.jsx)(J,{className:`text-right font-mono text-sm`,children:e.totalScenarios}),(0,I.jsx)(J,{className:`text-right font-mono text-sm`,children:e.avgToolCalls.toFixed(0)}),(0,I.jsx)(J,{className:`text-right font-mono text-sm`,children:N(e)})]},e.id))]})]}),j.length>20&&(0,I.jsx)(`div`,{className:`border-t p-4 text-center`,children:(0,I.jsx)(W,{variant:`outline`,asChild:!0,children:(0,I.jsx)(np,{to:`/results`,children:`Show more`})})})]})]})})]})};function RW({value:e,onValueChange:t,placeholder:n=`Search...`,className:r,inputClassName:i,clearAriaLabel:a=`Clear search`}){return(0,I.jsxs)(`div`,{className:U(`relative`,r),children:[(0,I.jsx)(Op,{value:e,onChange:e=>t(e.target.value),placeholder:n,className:U(`h-9 w-[240px] pr-8`,i)}),e&&(0,I.jsx)(W,{type:`button`,variant:`ghost`,size:`icon`,className:`absolute right-1 top-1/2 h-7 w-7 -translate-y-1/2 border border-border/60`,onClick:()=>t(``),"aria-label":a,children:(0,I.jsx)(hr,{className:`h-4 w-4`})})]})}var zW=_.createContext(void 0);function BW(e){let t=_.useContext(zW);return e||t||`ltr`}var VW=`rovingFocusGroup.onEntryFocus`,HW={bubbles:!1,cancelable:!0},UW=`RovingFocusGroup`,[WW,GW,KW]=oe(UW),[qW,JW]=R(UW,[KW]),[YW,XW]=qW(UW),ZW=_.forwardRef((e,t)=>(0,I.jsx)(WW.Provider,{scope:e.__scopeRovingFocusGroup,children:(0,I.jsx)(WW.Slot,{scope:e.__scopeRovingFocusGroup,children:(0,I.jsx)(QW,{...e,ref:t})})}));ZW.displayName=UW;var QW=_.forwardRef((e,t)=>{let{__scopeRovingFocusGroup:n,orientation:r,loop:i=!1,dir:a,currentTabStopId:o,defaultCurrentTabStopId:s,onCurrentTabStopIdChange:c,onEntryFocus:l,preventScrollOnEntryFocus:u=!1,...d}=e,f=_.useRef(null),p=P(t,f),m=BW(a),[h,g]=ze({prop:o,defaultProp:s??null,onChange:c,caller:UW}),[v,y]=_.useState(!1),b=pe(l),x=GW(n),S=_.useRef(!1),[C,w]=_.useState(0);return _.useEffect(()=>{let e=f.current;if(e)return e.addEventListener(VW,b),()=>e.removeEventListener(VW,b)},[b]),(0,I.jsx)(YW,{scope:n,orientation:r,dir:m,loop:i,currentTabStopId:h,onItemFocus:_.useCallback(e=>g(e),[g]),onItemShiftTab:_.useCallback(()=>y(!0),[]),onFocusableItemAdd:_.useCallback(()=>w(e=>e+1),[]),onFocusableItemRemove:_.useCallback(()=>w(e=>e-1),[]),children:(0,I.jsx)(V.div,{tabIndex:v||C===0?-1:0,"data-orientation":r,...d,ref:p,style:{outline:`none`,...e.style},onMouseDown:j(e.onMouseDown,()=>{S.current=!0}),onFocus:j(e.onFocus,e=>{let t=!S.current;if(e.target===e.currentTarget&&t&&!v){let t=new CustomEvent(VW,HW);if(e.currentTarget.dispatchEvent(t),!t.defaultPrevented){let e=x().filter(e=>e.focusable);iG([e.find(e=>e.active),e.find(e=>e.id===h),...e].filter(Boolean).map(e=>e.ref.current),u)}}S.current=!1}),onBlur:j(e.onBlur,()=>y(!1))})})}),$W=`RovingFocusGroupItem`,eG=_.forwardRef((e,t)=>{let{__scopeRovingFocusGroup:n,focusable:r=!0,active:i=!1,tabStopId:a,children:o,...s}=e,c=Ra(),l=a||c,u=XW($W,n),d=u.currentTabStopId===l,f=GW(n),{onFocusableItemAdd:p,onFocusableItemRemove:m,currentTabStopId:h}=u;return _.useEffect(()=>{if(r)return p(),()=>m()},[r,p,m]),(0,I.jsx)(WW.ItemSlot,{scope:n,id:l,focusable:r,active:i,children:(0,I.jsx)(V.span,{tabIndex:d?0:-1,"data-orientation":u.orientation,...s,ref:t,onMouseDown:j(e.onMouseDown,e=>{r?u.onItemFocus(l):e.preventDefault()}),onFocus:j(e.onFocus,()=>u.onItemFocus(l)),onKeyDown:j(e.onKeyDown,e=>{if(e.key===`Tab`&&e.shiftKey){u.onItemShiftTab();return}if(e.target!==e.currentTarget)return;let t=rG(e,u.orientation,u.dir);if(t!==void 0){if(e.metaKey||e.ctrlKey||e.altKey||e.shiftKey)return;e.preventDefault();let n=f().filter(e=>e.focusable).map(e=>e.ref.current);if(t===`last`)n.reverse();else if(t===`prev`||t===`next`){t===`prev`&&n.reverse();let r=n.indexOf(e.currentTarget);n=u.loop?aG(n,r+1):n.slice(r+1)}setTimeout(()=>iG(n))}}),children:typeof o==`function`?o({isCurrentTabStop:d,hasTabStop:h!=null}):o})})});eG.displayName=$W;var tG={ArrowLeft:`prev`,ArrowUp:`prev`,ArrowRight:`next`,ArrowDown:`next`,PageUp:`first`,Home:`first`,PageDown:`last`,End:`last`};function nG(e,t){return t===`rtl`?e===`ArrowLeft`?`ArrowRight`:e===`ArrowRight`?`ArrowLeft`:e:e}function rG(e,t,n){let r=nG(e.key,n);if(!(t===`vertical`&&[`ArrowLeft`,`ArrowRight`].includes(r))&&!(t===`horizontal`&&[`ArrowUp`,`ArrowDown`].includes(r)))return tG[r]}function iG(e,t=!1){let n=document.activeElement;for(let r of e)if(r===n||(r.focus({preventScroll:t}),document.activeElement!==n))return}function aG(e,t){return e.map((n,r)=>e[(t+r)%e.length])}var oG=ZW,sG=eG;function cG(e){let t=lG(e),n=_.forwardRef((e,n)=>{let{children:r,...i}=e,a=_.Children.toArray(r),o=a.find(dG);if(o){let e=o.props.children,r=a.map(t=>t===o?_.Children.count(e)>1?_.Children.only(null):_.isValidElement(e)?e.props.children:null:t);return(0,I.jsx)(t,{...i,ref:n,children:_.isValidElement(e)?_.cloneElement(e,void 0,r):null})}return(0,I.jsx)(t,{...i,ref:n,children:r})});return n.displayName=`${e}.Slot`,n}function lG(e){let t=_.forwardRef((e,t)=>{let{children:n,...r}=e;if(_.isValidElement(n)){let e=pG(n),i=fG(r,n.props);return n.type!==_.Fragment&&(i.ref=t?N(t,e):e),_.cloneElement(n,i)}return _.Children.count(n)>1?_.Children.only(null):null});return t.displayName=`${e}.SlotClone`,t}var uG=Symbol(`radix.slottable`);function dG(e){return _.isValidElement(e)&&typeof e.type==`function`&&`__radixId`in e.type&&e.type.__radixId===uG}function fG(e,t){let n={...t};for(let r in t){let i=e[r],a=t[r];/^on[A-Z]/.test(r)?i&&a?n[r]=(...e)=>{let t=a(...e);return i(...e),t}:i&&(n[r]=i):r===`style`?n[r]={...i,...a}:r===`className`&&(n[r]=[i,a].filter(Boolean).join(` `))}return{...e,...n}}function pG(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 mG=[`Enter`,` `],hG=[`ArrowDown`,`PageUp`,`Home`],gG=[`ArrowUp`,`PageDown`,`End`],_G=[...hG,...gG],vG={ltr:[...mG,`ArrowRight`],rtl:[...mG,`ArrowLeft`]},yG={ltr:[`ArrowLeft`],rtl:[`ArrowRight`]},bG=`Menu`,[xG,SG,CG]=oe(bG),[wG,TG]=R(bG,[CG,lc,JW]),EG=lc(),DG=JW(),[OG,kG]=wG(bG),[AG,jG]=wG(bG),MG=e=>{let{__scopeMenu:t,open:n=!1,children:r,dir:i,onOpenChange:a,modal:o=!0}=e,s=EG(t),[c,l]=_.useState(null),u=_.useRef(!1),d=pe(a),f=BW(i);return _.useEffect(()=>{let e=()=>{u.current=!0,document.addEventListener(`pointerdown`,t,{capture:!0,once:!0}),document.addEventListener(`pointermove`,t,{capture:!0,once:!0})},t=()=>u.current=!1;return document.addEventListener(`keydown`,e,{capture:!0}),()=>{document.removeEventListener(`keydown`,e,{capture:!0}),document.removeEventListener(`pointerdown`,t,{capture:!0}),document.removeEventListener(`pointermove`,t,{capture:!0})}},[]),(0,I.jsx)(Tc,{...s,children:(0,I.jsx)(OG,{scope:t,open:n,onOpenChange:d,content:c,onContentChange:l,children:(0,I.jsx)(AG,{scope:t,onClose:_.useCallback(()=>d(!1),[d]),isUsingKeyboardRef:u,dir:f,modal:o,children:r})})})};MG.displayName=bG;var NG=`MenuAnchor`,PG=_.forwardRef((e,t)=>{let{__scopeMenu:n,...r}=e,i=EG(n);return(0,I.jsx)(Ec,{...i,...r,ref:t})});PG.displayName=NG;var FG=`MenuPortal`,[IG,LG]=wG(FG,{forceMount:void 0}),RG=e=>{let{__scopeMenu:t,forceMount:n,children:r,container:i}=e,a=kG(FG,t);return(0,I.jsx)(IG,{scope:t,forceMount:n,children:(0,I.jsx)(Pe,{present:n||a.open,children:(0,I.jsx)(Me,{asChild:!0,container:i,children:r})})})};RG.displayName=FG;var zG=`MenuContent`,[BG,VG]=wG(zG),HG=_.forwardRef((e,t)=>{let n=LG(zG,e.__scopeMenu),{forceMount:r=n.forceMount,...i}=e,a=kG(zG,e.__scopeMenu),o=jG(zG,e.__scopeMenu);return(0,I.jsx)(xG.Provider,{scope:e.__scopeMenu,children:(0,I.jsx)(Pe,{present:r||a.open,children:(0,I.jsx)(xG.Slot,{scope:e.__scopeMenu,children:o.modal?(0,I.jsx)(UG,{...i,ref:t}):(0,I.jsx)(WG,{...i,ref:t})})})})}),UG=_.forwardRef((e,t)=>{let n=kG(zG,e.__scopeMenu),r=_.useRef(null),i=P(t,r);return _.useEffect(()=>{let e=r.current;if(e)return ah(e)},[]),(0,I.jsx)(KG,{...e,ref:i,trapFocus:n.open,disableOutsidePointerEvents:n.open,disableOutsideScroll:!0,onFocusOutside:j(e.onFocusOutside,e=>e.preventDefault(),{checkForDefaultPrevented:!1}),onDismiss:()=>n.onOpenChange(!1)})}),WG=_.forwardRef((e,t)=>{let n=kG(zG,e.__scopeMenu);return(0,I.jsx)(KG,{...e,ref:t,trapFocus:!1,disableOutsidePointerEvents:!1,disableOutsideScroll:!1,onDismiss:()=>n.onOpenChange(!1)})}),GG=cG(`MenuContent.ScrollLock`),KG=_.forwardRef((e,t)=>{let{__scopeMenu:n,loop:r=!1,trapFocus:i,onOpenAutoFocus:a,onCloseAutoFocus:o,disableOutsidePointerEvents:s,onEntryFocus:c,onEscapeKeyDown:l,onPointerDownOutside:u,onFocusOutside:d,onInteractOutside:f,onDismiss:p,disableOutsideScroll:m,...h}=e,g=kG(zG,n),v=jG(zG,n),y=EG(n),b=DG(n),x=SG(n),[S,C]=_.useState(null),w=_.useRef(null),T=P(t,w,g.onContentChange),E=_.useRef(0),D=_.useRef(``),O=_.useRef(0),k=_.useRef(null),A=_.useRef(`right`),M=_.useRef(0),N=m?Xm:_.Fragment,F=m?{as:GG,allowPinchZoom:!0}:void 0,L=e=>{let t=D.current+e,n=x().filter(e=>!e.disabled),r=document.activeElement,i=n.find(e=>e.ref.current===r)?.textValue,a=DK(n.map(e=>e.textValue),t,i),o=n.find(e=>e.textValue===a)?.ref.current;(function e(t){D.current=t,window.clearTimeout(E.current),t!==``&&(E.current=window.setTimeout(()=>e(``),1e3))})(t),o&&setTimeout(()=>o.focus())};_.useEffect(()=>()=>window.clearTimeout(E.current),[]),Xp();let R=_.useCallback(e=>A.current===k.current?.side&&kK(e,k.current?.area),[]);return(0,I.jsx)(BG,{scope:n,searchRef:D,onItemEnter:_.useCallback(e=>{R(e)&&e.preventDefault()},[R]),onItemLeave:_.useCallback(e=>{R(e)||(w.current?.focus(),C(null))},[R]),onTriggerLeave:_.useCallback(e=>{R(e)&&e.preventDefault()},[R]),pointerGraceTimerRef:O,onPointerGraceIntentChange:_.useCallback(e=>{k.current=e},[]),children:(0,I.jsx)(N,{...F,children:(0,I.jsx)(Vp,{asChild:!0,trapped:i,onMountAutoFocus:j(a,e=>{e.preventDefault(),w.current?.focus({preventScroll:!0})}),onUnmountAutoFocus:o,children:(0,I.jsx)(xe,{asChild:!0,disableOutsidePointerEvents:s,onEscapeKeyDown:l,onPointerDownOutside:u,onFocusOutside:d,onInteractOutside:f,onDismiss:p,children:(0,I.jsx)(oG,{asChild:!0,...b,dir:v.dir,orientation:`vertical`,loop:r,currentTabStopId:S,onCurrentTabStopIdChange:C,onEntryFocus:j(c,e=>{v.isUsingKeyboardRef.current||e.preventDefault()}),preventScrollOnEntryFocus:!0,children:(0,I.jsx)(Dc,{role:`menu`,"aria-orientation":`vertical`,"data-state":SK(g.open),"data-radix-menu-content":``,dir:v.dir,...y,...h,ref:T,style:{outline:`none`,...h.style},onKeyDown:j(h.onKeyDown,e=>{let t=e.target.closest(`[data-radix-menu-content]`)===e.currentTarget,n=e.ctrlKey||e.altKey||e.metaKey,r=e.key.length===1;t&&(e.key===`Tab`&&e.preventDefault(),!n&&r&&L(e.key));let i=w.current;if(e.target!==i||!_G.includes(e.key))return;e.preventDefault();let a=x().filter(e=>!e.disabled).map(e=>e.ref.current);gG.includes(e.key)&&a.reverse(),TK(a)}),onBlur:j(e.onBlur,e=>{e.currentTarget.contains(e.target)||(window.clearTimeout(E.current),D.current=``)}),onPointerMove:j(e.onPointerMove,AK(e=>{let t=e.target,n=M.current!==e.clientX;if(e.currentTarget.contains(t)&&n){let t=e.clientX>M.current?`right`:`left`;A.current=t,M.current=e.clientX}}))})})})})})})});HG.displayName=zG;var qG=`MenuGroup`,JG=_.forwardRef((e,t)=>{let{__scopeMenu:n,...r}=e;return(0,I.jsx)(V.div,{role:`group`,...r,ref:t})});JG.displayName=qG;var YG=`MenuLabel`,XG=_.forwardRef((e,t)=>{let{__scopeMenu:n,...r}=e;return(0,I.jsx)(V.div,{...r,ref:t})});XG.displayName=YG;var ZG=`MenuItem`,QG=`menu.itemSelect`,$G=_.forwardRef((e,t)=>{let{disabled:n=!1,onSelect:r,...i}=e,a=_.useRef(null),o=jG(ZG,e.__scopeMenu),s=VG(ZG,e.__scopeMenu),c=P(t,a),l=_.useRef(!1),u=()=>{let e=a.current;if(!n&&e){let t=new CustomEvent(QG,{bubbles:!0,cancelable:!0});e.addEventListener(QG,e=>r?.(e),{once:!0}),fe(e,t),t.defaultPrevented?l.current=!1:o.onClose()}};return(0,I.jsx)(eK,{...i,ref:c,disabled:n,onClick:j(e.onClick,u),onPointerDown:t=>{e.onPointerDown?.(t),l.current=!0},onPointerUp:j(e.onPointerUp,e=>{l.current||e.currentTarget?.click()}),onKeyDown:j(e.onKeyDown,e=>{let t=s.searchRef.current!==``;n||t&&e.key===` `||mG.includes(e.key)&&(e.currentTarget.click(),e.preventDefault())})})});$G.displayName=ZG;var eK=_.forwardRef((e,t)=>{let{__scopeMenu:n,disabled:r=!1,textValue:i,...a}=e,o=VG(ZG,n),s=DG(n),c=_.useRef(null),l=P(t,c),[u,d]=_.useState(!1),[f,p]=_.useState(``);return _.useEffect(()=>{let e=c.current;e&&p((e.textContent??``).trim())},[a.children]),(0,I.jsx)(xG.ItemSlot,{scope:n,disabled:r,textValue:i??f,children:(0,I.jsx)(sG,{asChild:!0,...s,focusable:!r,children:(0,I.jsx)(V.div,{role:`menuitem`,"data-highlighted":u?``:void 0,"aria-disabled":r||void 0,"data-disabled":r?``:void 0,...a,ref:l,onPointerMove:j(e.onPointerMove,AK(e=>{r?o.onItemLeave(e):(o.onItemEnter(e),e.defaultPrevented||e.currentTarget.focus({preventScroll:!0}))})),onPointerLeave:j(e.onPointerLeave,AK(e=>o.onItemLeave(e))),onFocus:j(e.onFocus,()=>d(!0)),onBlur:j(e.onBlur,()=>d(!1))})})})}),tK=`MenuCheckboxItem`,nK=_.forwardRef((e,t)=>{let{checked:n=!1,onCheckedChange:r,...i}=e;return(0,I.jsx)(uK,{scope:e.__scopeMenu,checked:n,children:(0,I.jsx)($G,{role:`menuitemcheckbox`,"aria-checked":CK(n)?`mixed`:n,...i,ref:t,"data-state":wK(n),onSelect:j(i.onSelect,()=>r?.(CK(n)?!0:!n),{checkForDefaultPrevented:!1})})})});nK.displayName=tK;var rK=`MenuRadioGroup`,[iK,aK]=wG(rK,{value:void 0,onValueChange:()=>{}}),oK=_.forwardRef((e,t)=>{let{value:n,onValueChange:r,...i}=e,a=pe(r);return(0,I.jsx)(iK,{scope:e.__scopeMenu,value:n,onValueChange:a,children:(0,I.jsx)(JG,{...i,ref:t})})});oK.displayName=rK;var sK=`MenuRadioItem`,cK=_.forwardRef((e,t)=>{let{value:n,...r}=e,i=aK(sK,e.__scopeMenu),a=n===i.value;return(0,I.jsx)(uK,{scope:e.__scopeMenu,checked:a,children:(0,I.jsx)($G,{role:`menuitemradio`,"aria-checked":a,...r,ref:t,"data-state":wK(a),onSelect:j(r.onSelect,()=>i.onValueChange?.(n),{checkForDefaultPrevented:!1})})})});cK.displayName=sK;var lK=`MenuItemIndicator`,[uK,dK]=wG(lK,{checked:!1}),fK=_.forwardRef((e,t)=>{let{__scopeMenu:n,forceMount:r,...i}=e,a=dK(lK,n);return(0,I.jsx)(Pe,{present:r||CK(a.checked)||a.checked===!0,children:(0,I.jsx)(V.span,{...i,ref:t,"data-state":wK(a.checked)})})});fK.displayName=lK;var pK=`MenuSeparator`,mK=_.forwardRef((e,t)=>{let{__scopeMenu:n,...r}=e;return(0,I.jsx)(V.div,{role:`separator`,"aria-orientation":`horizontal`,...r,ref:t})});mK.displayName=pK;var hK=`MenuArrow`,gK=_.forwardRef((e,t)=>{let{__scopeMenu:n,...r}=e,i=EG(n);return(0,I.jsx)(Oc,{...i,...r,ref:t})});gK.displayName=hK;var[yoe,_K]=wG(`MenuSub`),vK=`MenuSubTrigger`,yK=_.forwardRef((e,t)=>{let n=kG(vK,e.__scopeMenu),r=jG(vK,e.__scopeMenu),i=_K(vK,e.__scopeMenu),a=VG(vK,e.__scopeMenu),o=_.useRef(null),{pointerGraceTimerRef:s,onPointerGraceIntentChange:c}=a,l={__scopeMenu:e.__scopeMenu},u=_.useCallback(()=>{o.current&&window.clearTimeout(o.current),o.current=null},[]);return _.useEffect(()=>u,[u]),_.useEffect(()=>{let e=s.current;return()=>{window.clearTimeout(e),c(null)}},[s,c]),(0,I.jsx)(PG,{asChild:!0,...l,children:(0,I.jsx)(eK,{id:i.triggerId,"aria-haspopup":`menu`,"aria-expanded":n.open,"aria-controls":i.contentId,"data-state":SK(n.open),...e,ref:N(t,i.onTriggerChange),onClick:t=>{e.onClick?.(t),!(e.disabled||t.defaultPrevented)&&(t.currentTarget.focus(),n.open||n.onOpenChange(!0))},onPointerMove:j(e.onPointerMove,AK(t=>{a.onItemEnter(t),!t.defaultPrevented&&!e.disabled&&!n.open&&!o.current&&(a.onPointerGraceIntentChange(null),o.current=window.setTimeout(()=>{n.onOpenChange(!0),u()},100))})),onPointerLeave:j(e.onPointerLeave,AK(e=>{u();let t=n.content?.getBoundingClientRect();if(t){let r=n.content?.dataset.side,i=r===`right`,o=i?-5:5,c=t[i?`left`:`right`],l=t[i?`right`:`left`];a.onPointerGraceIntentChange({area:[{x:e.clientX+o,y:e.clientY},{x:c,y:t.top},{x:l,y:t.top},{x:l,y:t.bottom},{x:c,y:t.bottom}],side:r}),window.clearTimeout(s.current),s.current=window.setTimeout(()=>a.onPointerGraceIntentChange(null),300)}else{if(a.onTriggerLeave(e),e.defaultPrevented)return;a.onPointerGraceIntentChange(null)}})),onKeyDown:j(e.onKeyDown,t=>{let i=a.searchRef.current!==``;e.disabled||i&&t.key===` `||vG[r.dir].includes(t.key)&&(n.onOpenChange(!0),n.content?.focus(),t.preventDefault())})})})});yK.displayName=vK;var bK=`MenuSubContent`,xK=_.forwardRef((e,t)=>{let n=LG(zG,e.__scopeMenu),{forceMount:r=n.forceMount,...i}=e,a=kG(zG,e.__scopeMenu),o=jG(zG,e.__scopeMenu),s=_K(bK,e.__scopeMenu),c=_.useRef(null),l=P(t,c);return(0,I.jsx)(xG.Provider,{scope:e.__scopeMenu,children:(0,I.jsx)(Pe,{present:r||a.open,children:(0,I.jsx)(xG.Slot,{scope:e.__scopeMenu,children:(0,I.jsx)(KG,{id:s.contentId,"aria-labelledby":s.triggerId,...i,ref:l,align:`start`,side:o.dir===`rtl`?`left`:`right`,disableOutsidePointerEvents:!1,disableOutsideScroll:!1,trapFocus:!1,onOpenAutoFocus:e=>{o.isUsingKeyboardRef.current&&c.current?.focus(),e.preventDefault()},onCloseAutoFocus:e=>e.preventDefault(),onFocusOutside:j(e.onFocusOutside,e=>{e.target!==s.trigger&&a.onOpenChange(!1)}),onEscapeKeyDown:j(e.onEscapeKeyDown,e=>{o.onClose(),e.preventDefault()}),onKeyDown:j(e.onKeyDown,e=>{let t=e.currentTarget.contains(e.target),n=yG[o.dir].includes(e.key);t&&n&&(a.onOpenChange(!1),s.trigger?.focus(),e.preventDefault())})})})})})});xK.displayName=bK;function SK(e){return e?`open`:`closed`}function CK(e){return e===`indeterminate`}function wK(e){return CK(e)?`indeterminate`:e?`checked`:`unchecked`}function TK(e){let t=document.activeElement;for(let n of e)if(n===t||(n.focus(),document.activeElement!==t))return}function EK(e,t){return e.map((n,r)=>e[(t+r)%e.length])}function DK(e,t,n){let r=t.length>1&&Array.from(t).every(e=>e===t[0])?t[0]:t,i=n?e.indexOf(n):-1,a=EK(e,Math.max(i,0));r.length===1&&(a=a.filter(e=>e!==n));let o=a.find(e=>e.toLowerCase().startsWith(r.toLowerCase()));return o===n?void 0:o}function OK(e,t){let{x:n,y:r}=e,i=!1;for(let e=0,a=t.length-1;e<t.length;a=e++){let o=t[e],s=t[a],c=o.x,l=o.y,u=s.x,d=s.y;l>r!=d>r&&n<(u-c)*(r-l)/(d-l)+c&&(i=!i)}return i}function kK(e,t){return t?OK({x:e.clientX,y:e.clientY},t):!1}function AK(e){return t=>t.pointerType===`mouse`?e(t):void 0}var jK=MG,MK=PG,NK=RG,PK=HG,FK=JG,IK=XG,LK=$G,RK=nK,zK=oK,BK=cK,VK=fK,HK=mK,UK=gK,WK=yK,GK=xK,KK=`DropdownMenu`,[qK,boe]=R(KK,[TG]),JK=TG(),[YK,XK]=qK(KK),ZK=e=>{let{__scopeDropdownMenu:t,children:n,dir:r,open:i,defaultOpen:a,onOpenChange:o,modal:s=!0}=e,c=JK(t),l=_.useRef(null),[u,d]=ze({prop:i,defaultProp:a??!1,onChange:o,caller:KK});return(0,I.jsx)(YK,{scope:t,triggerId:Ra(),triggerRef:l,contentId:Ra(),open:u,onOpenChange:d,onOpenToggle:_.useCallback(()=>d(e=>!e),[d]),modal:s,children:(0,I.jsx)(jK,{...c,open:u,onOpenChange:d,dir:r,modal:s,children:n})})};ZK.displayName=KK;var QK=`DropdownMenuTrigger`,$K=_.forwardRef((e,t)=>{let{__scopeDropdownMenu:n,disabled:r=!1,...i}=e,a=XK(QK,n),o=JK(n);return(0,I.jsx)(MK,{asChild:!0,...o,children:(0,I.jsx)(V.button,{type:`button`,id:a.triggerId,"aria-haspopup":`menu`,"aria-expanded":a.open,"aria-controls":a.open?a.contentId:void 0,"data-state":a.open?`open`:`closed`,"data-disabled":r?``:void 0,disabled:r,...i,ref:N(t,a.triggerRef),onPointerDown:j(e.onPointerDown,e=>{!r&&e.button===0&&e.ctrlKey===!1&&(a.onOpenToggle(),a.open||e.preventDefault())}),onKeyDown:j(e.onKeyDown,e=>{r||([`Enter`,` `].includes(e.key)&&a.onOpenToggle(),e.key===`ArrowDown`&&a.onOpenChange(!0),[`Enter`,` `,`ArrowDown`].includes(e.key)&&e.preventDefault())})})})});$K.displayName=QK;var eq=`DropdownMenuPortal`,tq=e=>{let{__scopeDropdownMenu:t,...n}=e,r=JK(t);return(0,I.jsx)(NK,{...r,...n})};tq.displayName=eq;var nq=`DropdownMenuContent`,rq=_.forwardRef((e,t)=>{let{__scopeDropdownMenu:n,...r}=e,i=XK(nq,n),a=JK(n),o=_.useRef(!1);return(0,I.jsx)(PK,{id:i.contentId,"aria-labelledby":i.triggerId,...a,...r,ref:t,onCloseAutoFocus:j(e.onCloseAutoFocus,e=>{o.current||i.triggerRef.current?.focus(),o.current=!1,e.preventDefault()}),onInteractOutside:j(e.onInteractOutside,e=>{let t=e.detail.originalEvent,n=t.button===0&&t.ctrlKey===!0,r=t.button===2||n;(!i.modal||r)&&(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)`}})});rq.displayName=nq;var iq=`DropdownMenuGroup`,aq=_.forwardRef((e,t)=>{let{__scopeDropdownMenu:n,...r}=e,i=JK(n);return(0,I.jsx)(FK,{...i,...r,ref:t})});aq.displayName=iq;var oq=`DropdownMenuLabel`,sq=_.forwardRef((e,t)=>{let{__scopeDropdownMenu:n,...r}=e,i=JK(n);return(0,I.jsx)(IK,{...i,...r,ref:t})});sq.displayName=oq;var cq=`DropdownMenuItem`,lq=_.forwardRef((e,t)=>{let{__scopeDropdownMenu:n,...r}=e,i=JK(n);return(0,I.jsx)(LK,{...i,...r,ref:t})});lq.displayName=cq;var uq=`DropdownMenuCheckboxItem`,dq=_.forwardRef((e,t)=>{let{__scopeDropdownMenu:n,...r}=e,i=JK(n);return(0,I.jsx)(RK,{...i,...r,ref:t})});dq.displayName=uq;var fq=`DropdownMenuRadioGroup`,pq=_.forwardRef((e,t)=>{let{__scopeDropdownMenu:n,...r}=e,i=JK(n);return(0,I.jsx)(zK,{...i,...r,ref:t})});pq.displayName=fq;var mq=`DropdownMenuRadioItem`,hq=_.forwardRef((e,t)=>{let{__scopeDropdownMenu:n,...r}=e,i=JK(n);return(0,I.jsx)(BK,{...i,...r,ref:t})});hq.displayName=mq;var gq=`DropdownMenuItemIndicator`,_q=_.forwardRef((e,t)=>{let{__scopeDropdownMenu:n,...r}=e,i=JK(n);return(0,I.jsx)(VK,{...i,...r,ref:t})});_q.displayName=gq;var vq=`DropdownMenuSeparator`,yq=_.forwardRef((e,t)=>{let{__scopeDropdownMenu:n,...r}=e,i=JK(n);return(0,I.jsx)(HK,{...i,...r,ref:t})});yq.displayName=vq;var bq=`DropdownMenuArrow`,xq=_.forwardRef((e,t)=>{let{__scopeDropdownMenu:n,...r}=e,i=JK(n);return(0,I.jsx)(UK,{...i,...r,ref:t})});xq.displayName=bq;var Sq=`DropdownMenuSubTrigger`,Cq=_.forwardRef((e,t)=>{let{__scopeDropdownMenu:n,...r}=e,i=JK(n);return(0,I.jsx)(WK,{...i,...r,ref:t})});Cq.displayName=Sq;var wq=`DropdownMenuSubContent`,Tq=_.forwardRef((e,t)=>{let{__scopeDropdownMenu:n,...r}=e,i=JK(n);return(0,I.jsx)(GK,{...i,...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)`}})});Tq.displayName=wq;var Eq=ZK,Dq=$K,Oq=tq,kq=rq,Aq=sq,jq=lq,Mq=dq,Nq=hq,Pq=_q,Fq=yq,Iq=Cq,Lq=Tq,Rq=Eq,zq=Dq,Bq=_.forwardRef(({className:e,inset:t,children:n,...r},i)=>(0,I.jsxs)(Iq,{ref:i,className:U(`flex cursor-default select-none items-center rounded-sm px-2 py-1.5 text-sm outline-hidden data-[state=open]:bg-accent focus:bg-accent`,t&&`pl-8`,e),...r,children:[n,(0,I.jsx)(sn,{className:`ml-auto h-4 w-4`})]}));Bq.displayName=Iq.displayName;var Vq=_.forwardRef(({className:e,...t},n)=>(0,I.jsx)(Lq,{ref:n,className:U(`z-50 min-w-32 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}));Vq.displayName=Lq.displayName;var Hq=_.forwardRef(({className:e,sideOffset:t=4,...n},r)=>(0,I.jsx)(Oq,{children:(0,I.jsx)(kq,{ref:r,sideOffset:t,className:U(`z-50 min-w-32 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})}));Hq.displayName=kq.displayName;var Uq=_.forwardRef(({className:e,inset:t,...n},r)=>(0,I.jsx)(jq,{ref:r,className:U(`relative flex cursor-default select-none items-center rounded-sm px-2 py-1.5 text-sm outline-hidden transition-colors data-disabled:pointer-events-none data-disabled:opacity-50 focus:bg-accent focus:text-accent-foreground`,t&&`pl-8`,e),...n}));Uq.displayName=jq.displayName;var Wq=_.forwardRef(({className:e,children:t,checked:n,...r},i)=>(0,I.jsxs)(Mq,{ref:i,className:U(`relative flex cursor-default select-none items-center rounded-sm py-1.5 pl-8 pr-2 text-sm outline-hidden transition-colors data-disabled:pointer-events-none data-disabled:opacity-50 focus:bg-accent focus:text-accent-foreground`,e),checked:n,...r,children:[(0,I.jsx)(`span`,{className:`absolute left-2 flex h-3.5 w-3.5 items-center justify-center`,children:(0,I.jsx)(Pq,{children:(0,I.jsx)(an,{className:`h-4 w-4`})})}),t]}));Wq.displayName=Mq.displayName;var Gq=_.forwardRef(({className:e,children:t,...n},r)=>(0,I.jsxs)(Nq,{ref:r,className:U(`relative flex cursor-default select-none items-center rounded-sm py-1.5 pl-8 pr-2 text-sm outline-hidden transition-colors data-disabled:pointer-events-none data-disabled:opacity-50 focus:bg-accent focus:text-accent-foreground`,e),...n,children:[(0,I.jsx)(`span`,{className:`absolute left-2 flex h-3.5 w-3.5 items-center justify-center`,children:(0,I.jsx)(Pq,{children:(0,I.jsx)(hn,{className:`h-2 w-2 fill-current`})})}),t]}));Gq.displayName=Nq.displayName;var Kq=_.forwardRef(({className:e,inset:t,...n},r)=>(0,I.jsx)(Aq,{ref:r,className:U(`px-2 py-1.5 text-sm font-semibold`,t&&`pl-8`,e),...n}));Kq.displayName=Aq.displayName;var qq=_.forwardRef(({className:e,...t},n)=>(0,I.jsx)(Fq,{ref:n,className:U(`-mx-1 my-1 h-px bg-muted`,e),...t}));qq.displayName=Fq.displayName;function Jq(e,[t,n]){return Math.min(n,Math.max(t,e))}function Yq(e){let t=Xq(e),n=_.forwardRef((e,n)=>{let{children:r,...i}=e,a=_.Children.toArray(r),o=a.find(Qq);if(o){let e=o.props.children,r=a.map(t=>t===o?_.Children.count(e)>1?_.Children.only(null):_.isValidElement(e)?e.props.children:null:t);return(0,I.jsx)(t,{...i,ref:n,children:_.isValidElement(e)?_.cloneElement(e,void 0,r):null})}return(0,I.jsx)(t,{...i,ref:n,children:r})});return n.displayName=`${e}.Slot`,n}function Xq(e){let t=_.forwardRef((e,t)=>{let{children:n,...r}=e;if(_.isValidElement(n)){let e=eJ(n),i=$q(r,n.props);return n.type!==_.Fragment&&(i.ref=t?N(t,e):e),_.cloneElement(n,i)}return _.Children.count(n)>1?_.Children.only(null):null});return t.displayName=`${e}.SlotClone`,t}var Zq=Symbol(`radix.slottable`);function Qq(e){return _.isValidElement(e)&&typeof e.type==`function`&&`__radixId`in e.type&&e.type.__radixId===Zq}function $q(e,t){let n={...t};for(let r in t){let i=e[r],a=t[r];/^on[A-Z]/.test(r)?i&&a?n[r]=(...e)=>{let t=a(...e);return i(...e),t}:i&&(n[r]=i):r===`style`?n[r]={...i,...a}:r===`className`&&(n[r]=[i,a].filter(Boolean).join(` `))}return{...e,...n}}function eJ(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 tJ(e){let t=_.useRef({value:e,previous:e});return _.useMemo(()=>(t.current.value!==e&&(t.current.previous=t.current.value,t.current.value=e),t.current.previous),[e])}var nJ=[` `,`Enter`,`ArrowUp`,`ArrowDown`],rJ=[` `,`Enter`],iJ=`Select`,[aJ,oJ,sJ]=oe(iJ),[cJ,xoe]=R(iJ,[sJ,lc]),lJ=lc(),[uJ,dJ]=cJ(iJ),[fJ,pJ]=cJ(iJ),mJ=e=>{let{__scopeSelect:t,children:n,open:r,defaultOpen:i,onOpenChange:a,value:o,defaultValue:s,onValueChange:c,dir:l,name:u,autoComplete:d,disabled:f,required:p,form:m}=e,h=lJ(t),[g,v]=_.useState(null),[y,b]=_.useState(null),[x,S]=_.useState(!1),C=BW(l),[w,T]=ze({prop:r,defaultProp:i??!1,onChange:a,caller:iJ}),[E,D]=ze({prop:o,defaultProp:s,onChange:c,caller:iJ}),O=_.useRef(null),k=!g||m||!!g.closest(`form`),[A,j]=_.useState(new Set),M=Array.from(A).map(e=>e.props.value).join(`;`);return(0,I.jsx)(Tc,{...h,children:(0,I.jsxs)(uJ,{required:p,scope:t,trigger:g,onTriggerChange:v,valueNode:y,onValueNodeChange:b,valueNodeHasChildren:x,onValueNodeHasChildrenChange:S,contentId:Ra(),value:E,onValueChange:D,open:w,onOpenChange:T,dir:C,triggerPointerDownPosRef:O,disabled:f,children:[(0,I.jsx)(aJ.Provider,{scope:t,children:(0,I.jsx)(fJ,{scope:e.__scopeSelect,onNativeOptionAdd:_.useCallback(e=>{j(t=>new Set(t).add(e))},[]),onNativeOptionRemove:_.useCallback(e=>{j(t=>{let n=new Set(t);return n.delete(e),n})},[]),children:n})}),k?(0,I.jsxs)(lY,{"aria-hidden":!0,required:p,tabIndex:-1,name:u,autoComplete:d,value:E,onChange:e=>D(e.target.value),disabled:f,form:m,children:[E===void 0?(0,I.jsx)(`option`,{value:``}):null,Array.from(A)]},M):null]})})};mJ.displayName=iJ;var hJ=`SelectTrigger`,gJ=_.forwardRef((e,t)=>{let{__scopeSelect:n,disabled:r=!1,...i}=e,a=lJ(n),o=dJ(hJ,n),s=o.disabled||r,c=P(t,o.onTriggerChange),l=oJ(n),u=_.useRef(`touch`),[d,f,p]=dY(e=>{let t=l().filter(e=>!e.disabled),n=fY(t,e,t.find(e=>e.value===o.value));n!==void 0&&o.onValueChange(n.value)}),m=e=>{s||(o.onOpenChange(!0),p()),e&&(o.triggerPointerDownPosRef.current={x:Math.round(e.pageX),y:Math.round(e.pageY)})};return(0,I.jsx)(Ec,{asChild:!0,...a,children:(0,I.jsx)(V.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:s,"data-disabled":s?``:void 0,"data-placeholder":uY(o.value)?``:void 0,...i,ref:c,onClick:j(i.onClick,e=>{e.currentTarget.focus(),u.current!==`mouse`&&m(e)}),onPointerDown:j(i.onPointerDown,e=>{u.current=e.pointerType;let t=e.target;t.hasPointerCapture(e.pointerId)&&t.releasePointerCapture(e.pointerId),e.button===0&&e.ctrlKey===!1&&e.pointerType===`mouse`&&(m(e),e.preventDefault())}),onKeyDown:j(i.onKeyDown,e=>{let t=d.current!==``;!(e.ctrlKey||e.altKey||e.metaKey)&&e.key.length===1&&f(e.key),!(t&&e.key===` `)&&nJ.includes(e.key)&&(m(),e.preventDefault())})})})});gJ.displayName=hJ;var _J=`SelectValue`,vJ=_.forwardRef((e,t)=>{let{__scopeSelect:n,className:r,style:i,children:a,placeholder:o=``,...s}=e,c=dJ(_J,n),{onValueNodeHasChildrenChange:l}=c,u=a!==void 0,d=P(t,c.onValueNodeChange);return Ae(()=>{l(u)},[l,u]),(0,I.jsx)(V.span,{...s,ref:d,style:{pointerEvents:`none`},children:uY(c.value)?(0,I.jsx)(I.Fragment,{children:o}):a})});vJ.displayName=_J;var yJ=`SelectIcon`,bJ=_.forwardRef((e,t)=>{let{__scopeSelect:n,children:r,...i}=e;return(0,I.jsx)(V.span,{"aria-hidden":!0,...i,ref:t,children:r||`▼`})});bJ.displayName=yJ;var xJ=`SelectPortal`,SJ=e=>(0,I.jsx)(Me,{asChild:!0,...e});SJ.displayName=xJ;var CJ=`SelectContent`,wJ=_.forwardRef((e,t)=>{let n=dJ(CJ,e.__scopeSelect),[r,i]=_.useState();if(Ae(()=>{i(new DocumentFragment)},[]),!n.open){let t=r;return t?A.createPortal((0,I.jsx)(EJ,{scope:e.__scopeSelect,children:(0,I.jsx)(aJ.Slot,{scope:e.__scopeSelect,children:(0,I.jsx)(`div`,{children:e.children})})}),t):null}return(0,I.jsx)(AJ,{...e,ref:t})});wJ.displayName=CJ;var TJ=10,[EJ,DJ]=cJ(CJ),OJ=`SelectContentImpl`,kJ=Yq(`SelectContent.RemoveScroll`),AJ=_.forwardRef((e,t)=>{let{__scopeSelect:n,position:r=`item-aligned`,onCloseAutoFocus:i,onEscapeKeyDown:a,onPointerDownOutside:o,side:s,sideOffset:c,align:l,alignOffset:u,arrowPadding:d,collisionBoundary:f,collisionPadding:p,sticky:m,hideWhenDetached:h,avoidCollisions:g,...v}=e,y=dJ(CJ,n),[b,x]=_.useState(null),[S,C]=_.useState(null),w=P(t,e=>x(e)),[T,E]=_.useState(null),[D,O]=_.useState(null),k=oJ(n),[A,M]=_.useState(!1),N=_.useRef(!1);_.useEffect(()=>{if(b)return ah(b)},[b]),Xp();let F=_.useCallback(e=>{let[t,...n]=k().map(e=>e.ref.current),[r]=n.slice(-1),i=document.activeElement;for(let n of e)if(n===i||(n?.scrollIntoView({block:`nearest`}),n===t&&S&&(S.scrollTop=0),n===r&&S&&(S.scrollTop=S.scrollHeight),n?.focus(),document.activeElement!==i))return},[k,S]),L=_.useCallback(()=>F([T,b]),[F,T,b]);_.useEffect(()=>{A&&L()},[A,L]);let{onOpenChange:R,triggerPointerDownPosRef:z}=y;_.useEffect(()=>{if(b){let e={x:0,y:0},t=t=>{e={x:Math.abs(Math.round(t.pageX)-(z.current?.x??0)),y:Math.abs(Math.round(t.pageY)-(z.current?.y??0))}},n=n=>{e.x<=10&&e.y<=10?n.preventDefault():b.contains(n.target)||R(!1),document.removeEventListener(`pointermove`,t),z.current=null};return z.current!==null&&(document.addEventListener(`pointermove`,t),document.addEventListener(`pointerup`,n,{capture:!0,once:!0})),()=>{document.removeEventListener(`pointermove`,t),document.removeEventListener(`pointerup`,n,{capture:!0})}}},[b,R,z]),_.useEffect(()=>{let e=()=>R(!1);return window.addEventListener(`blur`,e),window.addEventListener(`resize`,e),()=>{window.removeEventListener(`blur`,e),window.removeEventListener(`resize`,e)}},[R]);let[ee,te]=dY(e=>{let t=k().filter(e=>!e.disabled),n=fY(t,e,t.find(e=>e.ref.current===document.activeElement));n&&setTimeout(()=>n.ref.current.focus())}),ne=_.useCallback((e,t,n)=>{let r=!N.current&&!n;(y.value!==void 0&&y.value===t||r)&&(E(e),r&&(N.current=!0))},[y.value]),re=_.useCallback(()=>b?.focus(),[b]),ie=_.useCallback((e,t,n)=>{let r=!N.current&&!n;(y.value!==void 0&&y.value===t||r)&&O(e)},[y.value]),ae=r===`popper`?PJ:MJ,oe=ae===PJ?{side:s,sideOffset:c,align:l,alignOffset:u,arrowPadding:d,collisionBoundary:f,collisionPadding:p,sticky:m,hideWhenDetached:h,avoidCollisions:g}:{};return(0,I.jsx)(EJ,{scope:n,content:b,viewport:S,onViewportChange:C,itemRefCallback:ne,selectedItem:T,onItemLeave:re,itemTextRefCallback:ie,focusSelectedItem:L,selectedItemText:D,position:r,isPositioned:A,searchRef:ee,children:(0,I.jsx)(Xm,{as:kJ,allowPinchZoom:!0,children:(0,I.jsx)(Vp,{asChild:!0,trapped:y.open,onMountAutoFocus:e=>{e.preventDefault()},onUnmountAutoFocus:j(i,e=>{y.trigger?.focus({preventScroll:!0}),e.preventDefault()}),children:(0,I.jsx)(xe,{asChild:!0,disableOutsidePointerEvents:!0,onEscapeKeyDown:a,onPointerDownOutside:o,onFocusOutside:e=>e.preventDefault(),onDismiss:()=>y.onOpenChange(!1),children:(0,I.jsx)(ae,{role:`listbox`,id:y.contentId,"data-state":y.open?`open`:`closed`,dir:y.dir,onContextMenu:e=>e.preventDefault(),...v,...oe,onPlaced:()=>M(!0),ref:w,style:{display:`flex`,flexDirection:`column`,outline:`none`,...v.style},onKeyDown:j(v.onKeyDown,e=>{let t=e.ctrlKey||e.altKey||e.metaKey;if(e.key===`Tab`&&e.preventDefault(),!t&&e.key.length===1&&te(e.key),[`ArrowUp`,`ArrowDown`,`Home`,`End`].includes(e.key)){let t=k().filter(e=>!e.disabled).map(e=>e.ref.current);if([`ArrowUp`,`End`].includes(e.key)&&(t=t.slice().reverse()),[`ArrowUp`,`ArrowDown`].includes(e.key)){let n=e.target,r=t.indexOf(n);t=t.slice(r+1)}setTimeout(()=>F(t)),e.preventDefault()}})})})})})})});AJ.displayName=OJ;var jJ=`SelectItemAlignedPosition`,MJ=_.forwardRef((e,t)=>{let{__scopeSelect:n,onPlaced:r,...i}=e,a=dJ(CJ,n),o=DJ(CJ,n),[s,c]=_.useState(null),[l,u]=_.useState(null),d=P(t,e=>u(e)),f=oJ(n),p=_.useRef(!1),m=_.useRef(!0),{viewport:h,selectedItem:g,selectedItemText:v,focusSelectedItem:y}=o,b=_.useCallback(()=>{if(a.trigger&&a.valueNode&&s&&l&&h&&g&&v){let e=a.trigger.getBoundingClientRect(),t=l.getBoundingClientRect(),n=a.valueNode.getBoundingClientRect(),i=v.getBoundingClientRect();if(a.dir!==`rtl`){let r=i.left-t.left,a=n.left-r,o=e.left-a,c=e.width+o,l=Math.max(c,t.width),u=window.innerWidth-TJ,d=Jq(a,[TJ,Math.max(TJ,u-l)]);s.style.minWidth=c+`px`,s.style.left=d+`px`}else{let r=t.right-i.right,a=window.innerWidth-n.right-r,o=window.innerWidth-e.right-a,c=e.width+o,l=Math.max(c,t.width),u=window.innerWidth-TJ,d=Jq(a,[TJ,Math.max(TJ,u-l)]);s.style.minWidth=c+`px`,s.style.right=d+`px`}let o=f(),c=window.innerHeight-TJ*2,u=h.scrollHeight,d=window.getComputedStyle(l),m=parseInt(d.borderTopWidth,10),_=parseInt(d.paddingTop,10),y=parseInt(d.borderBottomWidth,10),b=parseInt(d.paddingBottom,10),x=m+_+u+b+y,S=Math.min(g.offsetHeight*5,x),C=window.getComputedStyle(h),w=parseInt(C.paddingTop,10),T=parseInt(C.paddingBottom,10),E=e.top+e.height/2-TJ,D=c-E,O=g.offsetHeight/2,k=g.offsetTop+O,A=m+_+k,j=x-A;if(A<=E){let e=o.length>0&&g===o[o.length-1].ref.current;s.style.bottom=`0px`;let t=l.clientHeight-h.offsetTop-h.offsetHeight,n=A+Math.max(D,O+(e?T:0)+t+y);s.style.height=n+`px`}else{let e=o.length>0&&g===o[0].ref.current;s.style.top=`0px`;let t=Math.max(E,m+h.offsetTop+(e?w:0)+O)+j;s.style.height=t+`px`,h.scrollTop=A-E+h.offsetTop}s.style.margin=`${TJ}px 0`,s.style.minHeight=S+`px`,s.style.maxHeight=c+`px`,r?.(),requestAnimationFrame(()=>p.current=!0)}},[f,a.trigger,a.valueNode,s,l,h,g,v,a.dir,r]);Ae(()=>b(),[b]);let[x,S]=_.useState();Ae(()=>{l&&S(window.getComputedStyle(l).zIndex)},[l]);let C=_.useCallback(e=>{e&&m.current===!0&&(b(),y?.(),m.current=!1)},[b,y]);return(0,I.jsx)(FJ,{scope:n,contentWrapper:s,shouldExpandOnScrollRef:p,onScrollButtonChange:C,children:(0,I.jsx)(`div`,{ref:c,style:{display:`flex`,flexDirection:`column`,position:`fixed`,zIndex:x},children:(0,I.jsx)(V.div,{...i,ref:d,style:{boxSizing:`border-box`,maxHeight:`100%`,...i.style}})})})});MJ.displayName=jJ;var NJ=`SelectPopperPosition`,PJ=_.forwardRef((e,t)=>{let{__scopeSelect:n,align:r=`start`,collisionPadding:i=TJ,...a}=e,o=lJ(n);return(0,I.jsx)(Dc,{...o,...a,ref:t,align:r,collisionPadding:i,style:{boxSizing:`border-box`,...a.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)`}})});PJ.displayName=NJ;var[FJ,IJ]=cJ(CJ,{}),LJ=`SelectViewport`,RJ=_.forwardRef((e,t)=>{let{__scopeSelect:n,nonce:r,...i}=e,a=DJ(LJ,n),o=IJ(LJ,n),s=P(t,a.onViewportChange),c=_.useRef(0);return(0,I.jsxs)(I.Fragment,{children:[(0,I.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}),(0,I.jsx)(aJ.Slot,{scope:n,children:(0,I.jsx)(V.div,{"data-radix-select-viewport":``,role:`presentation`,...i,ref:s,style:{position:`relative`,flex:1,overflow:`hidden auto`,...i.style},onScroll:j(i.onScroll,e=>{let t=e.currentTarget,{contentWrapper:n,shouldExpandOnScrollRef:r}=o;if(r?.current&&n){let e=Math.abs(c.current-t.scrollTop);if(e>0){let r=window.innerHeight-TJ*2,i=parseFloat(n.style.minHeight),a=parseFloat(n.style.height),o=Math.max(i,a);if(o<r){let i=o+e,a=Math.min(r,i),s=i-a;n.style.height=a+`px`,n.style.bottom===`0px`&&(t.scrollTop=s>0?s:0,n.style.justifyContent=`flex-end`)}}}c.current=t.scrollTop})})})]})});RJ.displayName=LJ;var zJ=`SelectGroup`,[BJ,VJ]=cJ(zJ),HJ=_.forwardRef((e,t)=>{let{__scopeSelect:n,...r}=e,i=Ra();return(0,I.jsx)(BJ,{scope:n,id:i,children:(0,I.jsx)(V.div,{role:`group`,"aria-labelledby":i,...r,ref:t})})});HJ.displayName=zJ;var UJ=`SelectLabel`,WJ=_.forwardRef((e,t)=>{let{__scopeSelect:n,...r}=e,i=VJ(UJ,n);return(0,I.jsx)(V.div,{id:i.id,...r,ref:t})});WJ.displayName=UJ;var GJ=`SelectItem`,[KJ,qJ]=cJ(GJ),JJ=_.forwardRef((e,t)=>{let{__scopeSelect:n,value:r,disabled:i=!1,textValue:a,...o}=e,s=dJ(GJ,n),c=DJ(GJ,n),l=s.value===r,[u,d]=_.useState(a??``),[f,p]=_.useState(!1),m=P(t,e=>c.itemRefCallback?.(e,r,i)),h=Ra(),g=_.useRef(`touch`),v=()=>{i||(s.onValueChange(r),s.onOpenChange(!1))};if(r===``)throw 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(0,I.jsx)(KJ,{scope:n,value:r,disabled:i,textId:h,isSelected:l,onItemTextChange:_.useCallback(e=>{d(t=>t||(e?.textContent??``).trim())},[]),children:(0,I.jsx)(aJ.ItemSlot,{scope:n,value:r,disabled:i,textValue:u,children:(0,I.jsx)(V.div,{role:`option`,"aria-labelledby":h,"data-highlighted":f?``:void 0,"aria-selected":l&&f,"data-state":l?`checked`:`unchecked`,"aria-disabled":i||void 0,"data-disabled":i?``:void 0,tabIndex:i?void 0:-1,...o,ref:m,onFocus:j(o.onFocus,()=>p(!0)),onBlur:j(o.onBlur,()=>p(!1)),onClick:j(o.onClick,()=>{g.current!==`mouse`&&v()}),onPointerUp:j(o.onPointerUp,()=>{g.current===`mouse`&&v()}),onPointerDown:j(o.onPointerDown,e=>{g.current=e.pointerType}),onPointerMove:j(o.onPointerMove,e=>{g.current=e.pointerType,i?c.onItemLeave?.():g.current===`mouse`&&e.currentTarget.focus({preventScroll:!0})}),onPointerLeave:j(o.onPointerLeave,e=>{e.currentTarget===document.activeElement&&c.onItemLeave?.()}),onKeyDown:j(o.onKeyDown,e=>{(c.searchRef?.current===``||e.key!==` `)&&(rJ.includes(e.key)&&v(),e.key===` `&&e.preventDefault())})})})})});JJ.displayName=GJ;var YJ=`SelectItemText`,XJ=_.forwardRef((e,t)=>{let{__scopeSelect:n,className:r,style:i,...a}=e,o=dJ(YJ,n),s=DJ(YJ,n),c=qJ(YJ,n),l=pJ(YJ,n),[u,d]=_.useState(null),f=P(t,e=>d(e),c.onItemTextChange,e=>s.itemTextRefCallback?.(e,c.value,c.disabled)),p=u?.textContent,m=_.useMemo(()=>(0,I.jsx)(`option`,{value:c.value,disabled:c.disabled,children:p},c.value),[c.disabled,c.value,p]),{onNativeOptionAdd:h,onNativeOptionRemove:g}=l;return Ae(()=>(h(m),()=>g(m)),[h,g,m]),(0,I.jsxs)(I.Fragment,{children:[(0,I.jsx)(V.span,{id:c.textId,...a,ref:f}),c.isSelected&&o.valueNode&&!o.valueNodeHasChildren?A.createPortal(a.children,o.valueNode):null]})});XJ.displayName=YJ;var ZJ=`SelectItemIndicator`,QJ=_.forwardRef((e,t)=>{let{__scopeSelect:n,...r}=e;return qJ(ZJ,n).isSelected?(0,I.jsx)(V.span,{"aria-hidden":!0,...r,ref:t}):null});QJ.displayName=ZJ;var $J=`SelectScrollUpButton`,eY=_.forwardRef((e,t)=>{let n=DJ($J,e.__scopeSelect),r=IJ($J,e.__scopeSelect),[i,a]=_.useState(!1),o=P(t,r.onScrollButtonChange);return Ae(()=>{if(n.viewport&&n.isPositioned){let e=function(){let e=t.scrollTop>0;a(e)},t=n.viewport;return e(),t.addEventListener(`scroll`,e),()=>t.removeEventListener(`scroll`,e)}},[n.viewport,n.isPositioned]),i?(0,I.jsx)(rY,{...e,ref:o,onAutoScroll:()=>{let{viewport:e,selectedItem:t}=n;e&&t&&(e.scrollTop-=t.offsetHeight)}}):null});eY.displayName=$J;var tY=`SelectScrollDownButton`,nY=_.forwardRef((e,t)=>{let n=DJ(tY,e.__scopeSelect),r=IJ(tY,e.__scopeSelect),[i,a]=_.useState(!1),o=P(t,r.onScrollButtonChange);return Ae(()=>{if(n.viewport&&n.isPositioned){let e=function(){let e=t.scrollHeight-t.clientHeight,n=Math.ceil(t.scrollTop)<e;a(n)},t=n.viewport;return e(),t.addEventListener(`scroll`,e),()=>t.removeEventListener(`scroll`,e)}},[n.viewport,n.isPositioned]),i?(0,I.jsx)(rY,{...e,ref:o,onAutoScroll:()=>{let{viewport:e,selectedItem:t}=n;e&&t&&(e.scrollTop+=t.offsetHeight)}}):null});nY.displayName=tY;var rY=_.forwardRef((e,t)=>{let{__scopeSelect:n,onAutoScroll:r,...i}=e,a=DJ(`SelectScrollButton`,n),o=_.useRef(null),s=oJ(n),c=_.useCallback(()=>{o.current!==null&&(window.clearInterval(o.current),o.current=null)},[]);return _.useEffect(()=>()=>c(),[c]),Ae(()=>{s().find(e=>e.ref.current===document.activeElement)?.ref.current?.scrollIntoView({block:`nearest`})},[s]),(0,I.jsx)(V.div,{"aria-hidden":!0,...i,ref:t,style:{flexShrink:0,...i.style},onPointerDown:j(i.onPointerDown,()=>{o.current===null&&(o.current=window.setInterval(r,50))}),onPointerMove:j(i.onPointerMove,()=>{a.onItemLeave?.(),o.current===null&&(o.current=window.setInterval(r,50))}),onPointerLeave:j(i.onPointerLeave,()=>{c()})})}),iY=`SelectSeparator`,aY=_.forwardRef((e,t)=>{let{__scopeSelect:n,...r}=e;return(0,I.jsx)(V.div,{"aria-hidden":!0,...r,ref:t})});aY.displayName=iY;var oY=`SelectArrow`,sY=_.forwardRef((e,t)=>{let{__scopeSelect:n,...r}=e,i=lJ(n),a=dJ(oY,n),o=DJ(oY,n);return a.open&&o.position===`popper`?(0,I.jsx)(Oc,{...i,...r,ref:t}):null});sY.displayName=oY;var cY=`SelectBubbleInput`,lY=_.forwardRef(({__scopeSelect:e,value:t,...n},r)=>{let i=_.useRef(null),a=P(r,i),o=tJ(t);return _.useEffect(()=>{let e=i.current;if(!e)return;let n=window.HTMLSelectElement.prototype,r=Object.getOwnPropertyDescriptor(n,`value`).set;if(o!==t&&r){let n=new Event(`change`,{bubbles:!0});r.call(e,t),e.dispatchEvent(n)}},[o,t]),(0,I.jsx)(V.select,{...n,style:{...He,...n.style},ref:a,defaultValue:t})});lY.displayName=cY;function uY(e){return e===``||e===void 0}function dY(e){let t=pe(e),n=_.useRef(``),r=_.useRef(0),i=_.useCallback(e=>{let i=n.current+e;t(i),(function e(t){n.current=t,window.clearTimeout(r.current),t!==``&&(r.current=window.setTimeout(()=>e(``),1e3))})(i)},[t]),a=_.useCallback(()=>{n.current=``,window.clearTimeout(r.current)},[]);return _.useEffect(()=>()=>window.clearTimeout(r.current),[]),[n,i,a]}function fY(e,t,n){let r=t.length>1&&Array.from(t).every(e=>e===t[0])?t[0]:t,i=n?e.indexOf(n):-1,a=pY(e,Math.max(i,0));r.length===1&&(a=a.filter(e=>e!==n));let o=a.find(e=>e.textValue.toLowerCase().startsWith(r.toLowerCase()));return o===n?void 0:o}function pY(e,t){return e.map((n,r)=>e[(t+r)%e.length])}var mY=mJ,hY=gJ,gY=vJ,_Y=bJ,vY=SJ,yY=wJ,bY=RJ,xY=WJ,SY=JJ,CY=XJ,wY=QJ,TY=eY,EY=nY,DY=aY,OY=mY,kY=gY,AY=_.forwardRef(({className:e,children:t,...n},r)=>(0,I.jsxs)(hY,{ref:r,className:U(`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-hidden 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,(0,I.jsx)(_Y,{asChild:!0,children:(0,I.jsx)(on,{className:`h-4 w-4 opacity-50`})})]}));AY.displayName=hY.displayName;var jY=_.forwardRef(({className:e,...t},n)=>(0,I.jsx)(TY,{ref:n,className:U(`flex cursor-default items-center justify-center py-1`,e),...t,children:(0,I.jsx)(cn,{className:`h-4 w-4`})}));jY.displayName=TY.displayName;var MY=_.forwardRef(({className:e,...t},n)=>(0,I.jsx)(EY,{ref:n,className:U(`flex cursor-default items-center justify-center py-1`,e),...t,children:(0,I.jsx)(on,{className:`h-4 w-4`})}));MY.displayName=EY.displayName;var NY=_.forwardRef(({className:e,children:t,position:n=`popper`,...r},i)=>(0,I.jsx)(vY,{children:(0,I.jsxs)(yY,{ref:i,className:U(`relative z-50 max-h-96 min-w-32 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:[(0,I.jsx)(jY,{}),(0,I.jsx)(bY,{className:U(`p-1`,n===`popper`&&`h-(--radix-select-trigger-height) w-full min-w-(--radix-select-trigger-width)`),children:t}),(0,I.jsx)(MY,{})]})}));NY.displayName=yY.displayName;var PY=_.forwardRef(({className:e,...t},n)=>(0,I.jsx)(xY,{ref:n,className:U(`py-1.5 pl-8 pr-2 text-sm font-semibold`,e),...t}));PY.displayName=xY.displayName;var Z=_.forwardRef(({className:e,children:t,...n},r)=>(0,I.jsxs)(SY,{ref:r,className:U(`relative flex w-full cursor-default select-none items-center rounded-sm py-1.5 pl-8 pr-2 text-sm outline-hidden data-disabled:pointer-events-none data-disabled:opacity-50 focus:bg-accent focus:text-accent-foreground`,e),...n,children:[(0,I.jsx)(`span`,{className:`absolute left-2 flex h-3.5 w-3.5 items-center justify-center`,children:(0,I.jsx)(wY,{children:(0,I.jsx)(an,{className:`h-4 w-4`})})}),(0,I.jsx)(CY,{children:t})]}));Z.displayName=SY.displayName;var FY=_.forwardRef(({className:e,...t},n)=>(0,I.jsx)(DY,{ref:n,className:U(`-mx-1 my-1 h-px bg-muted`,e),...t}));FY.displayName=DY.displayName;function IY(e){let t=(e.agentEntries&&e.agentEntries.length>0?e.agentEntries:e.agents.map(e=>({kind:`inline`,agent:e}))).map(e=>e.kind===`inline`?e.agent.id:e.ref).map(e=>e.trim()).filter(Boolean),n=(e.runDefaults?.selectedAgentNames??[]).filter(e=>t.includes(e));return n.length>0?n:t}function LY(e){return e.relativePath?.trim()||e.sourcePath?.trim()||void 0}var RY=e=>e.configName?.trim()||e.name,zY=`(root)`,BY=`__ROOT__`,VY=`mcplab.configurations.collapsedSuites`,HY=e=>e.suitePath&&e.suitePath.trim().length>0?e.suitePath.trim():null,UY=e=>e??zY,WY=e=>e===null?BY:`suite:${e}`,GY=e=>e===BY?null:e.startsWith(`suite:`)?e.slice(6):null,KY=(e,t)=>t===null?e===null:e===null?!1:e===t||e.startsWith(`${t}/`),qY=e=>{for(let t of e){let e=t.scenarioEntries??[];for(let t of e){if(t.kind===`inline`&&t.scenario?.id)return String(t.scenario.id);if(t.kind===`referenced`&&t.ref)return String(t.ref)}let n=t.scenarios??[];for(let e of n)if(e?.id)return String(e.id)}return null},JY=e=>qY([e]),YY=e=>{let t=JY(e);return t?{href:`/results?scenario=${encodeURIComponent(t)}`,tooltipLabel:`Open results filtered by scenario ${t}`}:{href:`/results`,tooltipLabel:`Open results`}},XY=`bg-red-400.bg-red-500.bg-orange-400.bg-orange-500.bg-amber-400.bg-amber-500.bg-yellow-400.bg-yellow-500.bg-lime-400.bg-lime-500.bg-green-400.bg-green-500.bg-emerald-400.bg-emerald-500.bg-teal-400.bg-teal-500.bg-cyan-400.bg-cyan-500.bg-sky-400.bg-sky-500.bg-blue-400.bg-blue-500.bg-indigo-400.bg-indigo-500.bg-violet-400.bg-violet-500.bg-purple-400.bg-purple-500.bg-fuchsia-400.bg-fuchsia-500.bg-pink-400.bg-pink-500.bg-rose-400.bg-rose-500`.split(`.`);function ZY(e){return e===null?`bg-slate-400`:XY[e.split(``).reduce((e,t)=>(e+t.charCodeAt(0))%XY.length,0)]??`bg-slate-400`}var QY=()=>{let{configs:e,deleteConfig:t,cloneConfig:n,loading:r,reload:i}=fv(),{source:a}=nv(),o=qd(),[s,c]=(0,_.useState)(`name`),[l,u]=(0,_.useState)(`asc`),[d,f]=(0,_.useState)(``),[p,m]=(0,_.useState)(`all`),[h,g]=(0,_.useState)(()=>{try{let e=window.localStorage.getItem(VY);if(!e)return new Set;let t=JSON.parse(e);return Array.isArray(t)?new Set(t.filter(e=>typeof e==`string`)):new Set}catch(e){return console.warn(`Failed to restore collapsed suites from localStorage`,e),new Set}}),[v,y]=(0,_.useState)(new Set),[b,x]=(0,_.useState)(new Set),[S,C]=(0,_.useState)(new Set),[w,T]=(0,_.useState)({}),E=d.trim().toLowerCase(),D=e=>{s===e?u(e=>e===`asc`?`desc`:`asc`):(c(e),u(e===`updatedAt`?`desc`:`asc`))};(0,_.useEffect)(()=>{i();let e=()=>{i()};return window.addEventListener(`focus`,e),()=>{window.removeEventListener(`focus`,e)}},[i]),(0,_.useEffect)(()=>{let t=!1;return(async()=>{try{if(a.getLatestPassRatesByConfigIds){let n=await a.getLatestPassRatesByConfigIds({lastDays:365,configs:e.map(e=>({id:e.id,sourcePath:e.sourcePath,relativePath:e.relativePath,configHash:e.configHash}))});t||T(n);return}T({})}catch{t||T({})}})(),()=>{t=!0}},[e,a]);let k=async(e,n)=>{await t(e),O({title:`Deleted`,description:`"${n}" has been removed.`})},A=async e=>{let t=await n(e);O({title:`Cloned`,description:`Created "${RY(t)}".`}),o(`/mcp-evaluations/${t.id}`)},j=e=>e.agentEntries?.length??e.agents?.length??0,M=e=>e.scenarioEntries?.length??e.scenarios?.length??0,N=(0,_.useMemo)(()=>{let t=new Set;for(let n of e){let e=HY(n);if(t.add(e),!e)continue;let r=e.split(`/`).filter(Boolean);for(let e=1;e<r.length;e+=1)t.add(r.slice(0,e).join(`/`))}return Array.from(t).sort((e,t)=>UY(e).localeCompare(UY(t)))},[e]),P=(0,_.useMemo)(()=>e.filter(e=>{let t=HY(e),n=p===`all`?void 0:GY(p),r=UY(t);return n!==void 0&&!KY(t,n)?!1:E.length===0||[RY(e),e.id,e.description??``,e.loadError??``,r,e.relativePath??``].join(` `).toLowerCase().includes(E)}),[e,E,p]),F=(0,_.useMemo)(()=>[...P].sort((e,t)=>{let n=0;return s===`name`&&(n=RY(e).localeCompare(RY(t))),s===`scenarios`&&(n=M(e)-M(t)),s===`agents`&&(n=j(e)-j(t)),s===`updatedAt`&&(n=new Date(e.updatedAt).getTime()-new Date(t.updatedAt).getTime()),l===`asc`?n:-n}),[P,s,l]),L=e=>s===e?l===`asc`?(0,I.jsx)(cn,{className:`h-3.5 w-3.5`}):(0,I.jsx)(on,{className:`h-3.5 w-3.5`}):(0,I.jsx)(ln,{className:`h-3.5 w-3.5 text-muted-foreground`}),R=e=>{g(t=>{let n=new Set(t);return n.has(e)?n.delete(e):n.add(e),n})},z=async(t,n,r)=>{if(b.has(t))return;let i=e.find(e=>e.id===t),o=i?IY(i):[];x(e=>new Set(e).add(t));try{await a.startRun({configPath:n,runsPerScenario:1,...o.length>0?{agents:o}:{}}),y(e=>new Set(e).add(t)),window.setTimeout(()=>{y(e=>{let n=new Set(e);return n.delete(t),n})},2e3),O({title:`Queued`,description:`"${r}" added to run queue.`})}catch(e){O({title:`Could not queue evaluation`,description:e instanceof Error?e.message:String(e),variant:`destructive`})}finally{x(e=>{let n=new Set(e);return n.delete(t),n})}};(0,_.useEffect)(()=>{try{window.localStorage.setItem(VY,JSON.stringify(Array.from(h)))}catch(e){console.warn(`Failed to persist collapsed suites to localStorage (quota/private mode?)`,e)}},[h]);let ee=async(e,t,n)=>{if(!S.has(e)){C(t=>new Set(t).add(e));try{let e=n.filter(e=>typeof e.sourcePath==`string`&&e.sourcePath.trim().length>0);if(e.length===0){O({title:`No runnable evaluations`,description:`Suite "${t}" has no evaluation files with a source path.`,variant:`destructive`});return}let r=await Promise.allSettled(e.map(e=>{let t=IY(e);return a.startRun({configPath:String(e.sourcePath),runsPerScenario:1,...t.length>0?{agents:t}:{}})})),i=r.filter(e=>e.status===`fulfilled`).length,o=r.length-i,s=r.find(e=>e.status===`rejected`),c=s?s.reason instanceof Error?s.reason.message:String(s.reason):void 0;O({title:o===0?`Suite queued`:`Suite queued with errors`,description:o===0?`Queued ${i} evaluation${i===1?``:`s`} for suite "${t}".`:`Queued ${i}/${e.length} evaluations for suite "${t}" (${o} failed${c?`: ${c}`:``}).`,variant:o===0?`default`:`destructive`})}catch(e){O({title:`Could not queue suite`,description:e instanceof Error?e.message:String(e),variant:`destructive`})}finally{C(t=>{let n=new Set(t);return n.delete(e),n})}}},te=(0,_.useMemo)(()=>{let e=new Map;for(let t of F){let n=HY(t),r=e.get(n);r?r.push(t):e.set(n,[t])}return Array.from(e.entries()).sort((e,t)=>UY(e[0]).localeCompare(UY(t[0])))},[F]);return(0,I.jsxs)(`div`,{className:`space-y-6`,children:[(0,I.jsxs)(`div`,{className:`flex items-center justify-between`,children:[(0,I.jsxs)(`div`,{children:[(0,I.jsxs)(`h1`,{className:`inline-flex items-center gap-2 text-2xl font-bold`,children:[(0,I.jsx)(On,{className:`h-6 w-6`}),`MCP Evaluations`]}),(0,I.jsx)(`p`,{className:`text-sm text-muted-foreground`,children:`Manage your MCP evaluation suites`})]}),(0,I.jsxs)(`div`,{className:`flex gap-2`,children:[(0,I.jsx)(RW,{value:d,onValueChange:f,placeholder:`Search evaluations...`}),(0,I.jsxs)(OY,{value:p,onValueChange:m,children:[(0,I.jsx)(AY,{className:`h-9 w-[200px]`,children:(0,I.jsx)(kY,{placeholder:`All suites`})}),(0,I.jsxs)(NY,{children:[(0,I.jsx)(Z,{value:`all`,children:`All suites`}),N.map(e=>(0,I.jsx)(Z,{value:WY(e),children:UY(e)},WY(e)))]})]}),(0,I.jsxs)(W,{variant:`outline`,size:`sm`,onClick:()=>void i(),children:[(0,I.jsx)(Qn,{className:`mr-2 h-4 w-4`}),`Refresh`]}),(0,I.jsxs)(W,{variant:`outline`,size:`sm`,children:[(0,I.jsx)(dr,{className:`mr-2 h-4 w-4`}),`Import YAML`]}),(0,I.jsx)(W,{size:`sm`,asChild:!0,children:(0,I.jsxs)(np,{to:`/mcp-evaluations/new`,children:[(0,I.jsx)(Xn,{className:`mr-2 h-4 w-4`}),`Create New`]})})]})]}),(0,I.jsx)(K,{children:(0,I.jsx)(q,{className:`p-0`,children:(0,I.jsxs)(bv,{children:[(0,I.jsx)(xv,{children:(0,I.jsxs)(wv,{children:[(0,I.jsx)(Tv,{children:(0,I.jsxs)(`button`,{type:`button`,className:`inline-flex items-center gap-1 hover:text-foreground`,onClick:()=>D(`name`),children:[`Name`,L(`name`)]})}),(0,I.jsx)(Tv,{className:`text-right`,children:(0,I.jsxs)(`button`,{type:`button`,className:`inline-flex items-center gap-1 hover:text-foreground`,onClick:()=>D(`scenarios`),children:[`Scenarios`,L(`scenarios`)]})}),(0,I.jsx)(Tv,{className:`text-right`,children:(0,I.jsxs)(`button`,{type:`button`,className:`inline-flex items-center gap-1 hover:text-foreground`,onClick:()=>D(`agents`),children:[`Agents`,L(`agents`)]})}),(0,I.jsx)(Tv,{className:`text-right`,children:(0,I.jsxs)(`button`,{type:`button`,className:`inline-flex items-center gap-1 hover:text-foreground`,onClick:()=>D(`updatedAt`),children:[`Last Updated`,L(`updatedAt`)]})}),(0,I.jsx)(Tv,{className:`text-right`,children:`Last Run`}),(0,I.jsx)(Tv,{className:`w-[220px] text-right`})]})}),(0,I.jsxs)(Sv,{children:[te.map(([e,t])=>{let n=UY(e),r=WY(e),i=h.has(r),a=S.has(r);return(0,I.jsxs)(_.Fragment,{children:[(0,I.jsx)(wv,{className:`bg-muted/40 hover:bg-muted/40`,children:(0,I.jsx)(J,{colSpan:6,className:`py-2`,children:(0,I.jsxs)(`div`,{className:`flex items-center justify-between gap-2`,children:[(0,I.jsxs)(`button`,{type:`button`,className:`inline-flex h-6 items-center gap-2 text-xs leading-none hover:text-foreground`,onClick:()=>R(r),"aria-expanded":!i,"aria-label":`${i?`Expand`:`Collapse`} suite ${n}`,children:[(0,I.jsx)(sn,{className:`h-3.5 w-3.5 text-muted-foreground transition-transform ${i?``:`rotate-90`}`,"aria-hidden":`true`}),(0,I.jsx)(`span`,{className:`h-2 w-2 rounded-full ${ZY(e)}`,"aria-hidden":`true`}),e===null?(0,I.jsx)(Mn,{className:`h-3.5 w-3.5 text-muted-foreground`,"aria-hidden":`true`}):(0,I.jsx)(kn,{className:`h-3.5 w-3.5 text-muted-foreground`,"aria-hidden":`true`}),(0,I.jsx)(`span`,{className:`font-medium`,children:n}),(0,I.jsxs)(`span`,{className:`text-muted-foreground`,children:[`(`,t.length,`)`]})]}),(0,I.jsxs)(W,{type:`button`,size:`sm`,variant:`outline`,className:`h-7 px-2 text-xs`,disabled:a,onClick:()=>void ee(r,n,t),children:[(0,I.jsx)(Yn,{className:`mr-1 h-3.5 w-3.5`}),a?`Queueing...`:`Run Suite`]})]})})},`suite-${r}`),!i&&t.map(e=>{let t=YY(e),n=LY(e);return(0,I.jsxs)(wv,{children:[(0,I.jsx)(J,{children:(0,I.jsxs)(`div`,{children:[(0,I.jsx)(np,{to:`/mcp-evaluations/${e.id}`,className:`font-medium text-sm hover:text-primary`,children:RY(e)}),e.loadError&&(0,I.jsxs)(Y,{variant:`destructive`,className:`ml-2 align-middle text-[10px]`,children:[(0,I.jsx)(ur,{className:`mr-1 h-3 w-3`}),`Broken`]}),n&&(0,I.jsx)(`div`,{className:`mt-0.5`,children:(0,I.jsx)(`span`,{className:`text-xs text-muted-foreground font-mono`,children:n})}),e.loadError&&(0,I.jsx)(`p`,{className:`text-xs text-destructive mt-0.5 break-all`,children:e.loadError})]})}),(0,I.jsx)(J,{className:`text-right font-mono text-sm`,children:M(e)}),(0,I.jsx)(J,{className:`text-right font-mono text-sm`,children:j(e)}),(0,I.jsx)(J,{className:`text-right text-xs text-muted-foreground`,children:(0,I.jsxs)(`div`,{className:`inline-flex items-center gap-1`,children:[(0,I.jsx)(_n,{className:`h-3 w-3`}),new Date(e.updatedAt).toLocaleDateString()]})}),(0,I.jsx)(J,{className:`text-right`,children:Object.hasOwn(w,e.id)?(0,I.jsx)(`div`,{className:`inline-flex justify-end`,children:(0,I.jsx)(kv,{rate:w[e.id]})}):``}),(0,I.jsx)(J,{className:`w-[220px] whitespace-nowrap`,children:(0,I.jsxs)(`div`,{className:`flex items-center justify-end gap-2`,children:[(0,I.jsxs)(Rq,{children:[(0,I.jsx)(zq,{asChild:!0,children:(0,I.jsx)(W,{variant:`ghost`,size:`icon`,className:`h-8 w-8`,children:(0,I.jsx)(xn,{className:`h-4 w-4`})})}),(0,I.jsxs)(Hq,{align:`end`,children:[(0,I.jsxs)(Uq,{onClick:()=>o(`/mcp-evaluations/${e.id}`),children:[(0,I.jsx)(Jn,{className:`mr-2 h-3.5 w-3.5`}),`Edit`]}),(0,I.jsxs)(Uq,{onClick:()=>void A(e.id),children:[(0,I.jsx)(vn,{className:`mr-2 h-3.5 w-3.5`}),`Clone`]}),(0,I.jsxs)(Uq,{className:`text-destructive`,onClick:()=>void k(e.id,RY(e)),children:[(0,I.jsx)(lr,{className:`mr-2 h-3.5 w-3.5`}),`Delete`]})]})]}),(0,I.jsx)(gl,{children:(0,I.jsxs)(_l,{children:[(0,I.jsx)(vl,{asChild:!0,children:(0,I.jsx)(W,{size:`icon`,variant:`outline`,className:`h-8 w-8`,asChild:!0,"aria-label":t.tooltipLabel,children:(0,I.jsxs)(np,{to:t.href,children:[(0,I.jsx)(rn,{className:`h-3.5 w-3.5`}),(0,I.jsx)(`span`,{className:`sr-only`,children:t.tooltipLabel})]})})}),(0,I.jsx)(yl,{children:t.tooltipLabel})]})}),(0,I.jsx)(gl,{children:(0,I.jsxs)(_l,{children:[(0,I.jsx)(vl,{asChild:!0,children:(0,I.jsx)(W,{size:`sm`,variant:`outline`,className:`h-8 px-2 text-xs ${v.has(e.id)?`border-green-600 bg-green-600 text-white hover:bg-green-700 hover:text-white`:``}`,disabled:b.has(e.id)||!e.sourcePath,onClick:()=>e.sourcePath&&void z(e.id,e.sourcePath,RY(e)),"aria-label":`Queue ${RY(e)}`,children:v.has(e.id)?`Queued`:b.has(e.id)?`Queueing...`:(0,I.jsxs)(I.Fragment,{children:[(0,I.jsx)(Rn,{className:`h-3.5 w-3.5`}),(0,I.jsx)(`span`,{className:`sr-only`,children:`Queue evaluation`})]})})}),(0,I.jsx)(yl,{children:`Queue evaluation run`})]})}),(0,I.jsx)(W,{size:`sm`,variant:`outline`,asChild:!0,children:(0,I.jsxs)(np,{to:`/run?configId=${encodeURIComponent(e.id)}`,children:[(0,I.jsx)(Yn,{className:`h-3.5 w-3.5`}),`Run`]})})]})})]},e.id)})]},`suite-group-${r}`)}),!r&&e.length===0&&(0,I.jsx)(wv,{children:(0,I.jsx)(J,{colSpan:6,className:`text-center py-12 text-muted-foreground`,children:`No MCP evaluations yet. Create your first one to get started.`})}),!r&&e.length>0&&F.length===0&&(0,I.jsx)(wv,{children:(0,I.jsx)(J,{colSpan:6,className:`text-center py-12 text-muted-foreground`,children:`No MCP evaluations match this filter.`})}),r&&(0,I.jsx)(wv,{children:(0,I.jsx)(J,{colSpan:6,className:`text-center py-12 text-muted-foreground`,children:`Loading MCP evaluations...`})})]})]})})})]})},$Y=[`a`,`button`,`div`,`form`,`h2`,`h3`,`img`,`input`,`label`,`li`,`nav`,`ol`,`p`,`select`,`span`,`svg`,`ul`].reduce((e,t)=>{let n=vp(`Primitive.${t}`),r=_.forwardRef((e,r)=>{let{asChild:i,...a}=e,o=i?n:t;return typeof window<`u`&&(window[Symbol.for(`radix-ui`)]=!0),(0,I.jsx)(o,{...a,ref:r})});return r.displayName=`Primitive.${t}`,{...e,[t]:r}},{}),eX=`Label`,tX=_.forwardRef((e,t)=>(0,I.jsx)($Y.label,{...e,ref:t,onMouseDown:t=>{t.target.closest(`button, input, select, textarea`)||(e.onMouseDown?.(t),!t.defaultPrevented&&t.detail>1&&t.preventDefault())}}));tX.displayName=eX;var nX=tX,rX=Gt(`text-sm font-medium leading-none peer-disabled:cursor-not-allowed peer-disabled:opacity-70`),Q=_.forwardRef(({className:e,...t},n)=>(0,I.jsx)(nX,{ref:n,className:U(rX(),e),...t}));Q.displayName=nX.displayName;var iX=_.forwardRef(({className:e,...t},n)=>(0,I.jsx)(`textarea`,{className:U(`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-hidden focus-visible:ring-2 focus-visible:ring-ring focus-visible:ring-offset-2 disabled:cursor-not-allowed disabled:opacity-50`,e),ref:n,...t}));iX.displayName=`Textarea`;var aX=`Tabs`,[oX,Soe]=R(aX,[JW]),sX=JW(),[cX,lX]=oX(aX),uX=_.forwardRef((e,t)=>{let{__scopeTabs:n,value:r,onValueChange:i,defaultValue:a,orientation:o=`horizontal`,dir:s,activationMode:c=`automatic`,...l}=e,u=BW(s),[d,f]=ze({prop:r,onChange:i,defaultProp:a??``,caller:aX});return(0,I.jsx)(cX,{scope:n,baseId:Ra(),value:d,onValueChange:f,orientation:o,dir:u,activationMode:c,children:(0,I.jsx)(V.div,{dir:u,"data-orientation":o,...l,ref:t})})});uX.displayName=aX;var dX=`TabsList`,fX=_.forwardRef((e,t)=>{let{__scopeTabs:n,loop:r=!0,...i}=e,a=lX(dX,n),o=sX(n);return(0,I.jsx)(oG,{asChild:!0,...o,orientation:a.orientation,dir:a.dir,loop:r,children:(0,I.jsx)(V.div,{role:`tablist`,"aria-orientation":a.orientation,...i,ref:t})})});fX.displayName=dX;var pX=`TabsTrigger`,mX=_.forwardRef((e,t)=>{let{__scopeTabs:n,value:r,disabled:i=!1,...a}=e,o=lX(pX,n),s=sX(n),c=_X(o.baseId,r),l=vX(o.baseId,r),u=r===o.value;return(0,I.jsx)(sG,{asChild:!0,...s,focusable:!i,active:u,children:(0,I.jsx)(V.button,{type:`button`,role:`tab`,"aria-selected":u,"aria-controls":l,"data-state":u?`active`:`inactive`,"data-disabled":i?``:void 0,disabled:i,id:c,...a,ref:t,onMouseDown:j(e.onMouseDown,e=>{!i&&e.button===0&&e.ctrlKey===!1?o.onValueChange(r):e.preventDefault()}),onKeyDown:j(e.onKeyDown,e=>{[` `,`Enter`].includes(e.key)&&o.onValueChange(r)}),onFocus:j(e.onFocus,()=>{let e=o.activationMode!==`manual`;!u&&!i&&e&&o.onValueChange(r)})})})});mX.displayName=pX;var hX=`TabsContent`,gX=_.forwardRef((e,t)=>{let{__scopeTabs:n,value:r,forceMount:i,children:a,...o}=e,s=lX(hX,n),c=_X(s.baseId,r),l=vX(s.baseId,r),u=r===s.value,d=_.useRef(u);return _.useEffect(()=>{let e=requestAnimationFrame(()=>d.current=!1);return()=>cancelAnimationFrame(e)},[]),(0,I.jsx)(Pe,{present:i||u,children:({present:n})=>(0,I.jsx)(V.div,{"data-state":u?`active`:`inactive`,"data-orientation":s.orientation,role:`tabpanel`,"aria-labelledby":c,hidden:!n,id:l,tabIndex:0,...o,ref:t,style:{...e.style,animationDuration:d.current?`0s`:void 0},children:n&&a})})});gX.displayName=hX;function _X(e,t){return`${e}-trigger-${t}`}function vX(e,t){return`${e}-content-${t}`}var yX=uX,bX=fX,xX=mX,SX=gX,CX=yX,wX=_.forwardRef(({className:e,...t},n)=>(0,I.jsx)(bX,{ref:n,className:U(`inline-flex h-10 items-center justify-center rounded-md bg-muted p-1 text-muted-foreground`,e),...t}));wX.displayName=bX.displayName;var TX=_.forwardRef(({className:e,...t},n)=>(0,I.jsx)(xX,{ref:n,className:U(`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-xs focus-visible:outline-hidden focus-visible:ring-2 focus-visible:ring-ring focus-visible:ring-offset-2 disabled:pointer-events-none disabled:opacity-50`,e),...t}));TX.displayName=xX.displayName;var EX=_.forwardRef(({className:e,...t},n)=>(0,I.jsx)(SX,{ref:n,className:U(`mt-2 ring-offset-background focus-visible:outline-hidden focus-visible:ring-2 focus-visible:ring-ring focus-visible:ring-offset-2`,e),...t}));EX.displayName=SX.displayName;var DX={openai:`OpenAI`,anthropic:`Anthropic`,azure:`Azure OpenAI`,azure_openai:`Azure OpenAI`,azure_foundry:`Azure Foundry`,google:`Google`};function OX(e){return DX[e]??e}var kX={openai:`bg-emerald-100 text-emerald-800`,anthropic:`bg-orange-100 text-orange-800`,azure:`bg-blue-100 text-blue-800`,azure_openai:`bg-blue-100 text-blue-800`,azure_foundry:`bg-blue-100 text-blue-800`,google:`bg-yellow-100 text-yellow-800`,custom:`bg-gray-100 text-gray-800`};function AX({provider:e}){return(0,I.jsx)(`span`,{className:`inline-flex items-center rounded-full px-2 py-0.5 text-xs font-medium ${kX[e]??kX.custom}`,children:OX(e)})}var jX=`Checkbox`,[MX,Coe]=R(jX),[NX,PX]=MX(jX);function FX(e){let{__scopeCheckbox:t,checked:n,children:r,defaultChecked:i,disabled:a,form:o,name:s,onCheckedChange:c,required:l,value:u=`on`,internal_do_not_use_render:d}=e,[f,p]=ze({prop:n,defaultProp:i??!1,onChange:c,caller:jX}),[m,h]=_.useState(null),[g,v]=_.useState(null),y=_.useRef(!1),b=!m||!!o||!!m.closest(`form`),x={checked:f,disabled:a,setChecked:p,control:m,setControl:h,name:s,form:o,value:u,hasConsumerStoppedPropagationRef:y,required:l,defaultChecked:!WX(i)&&i,isFormControl:b,bubbleInput:g,setBubbleInput:v};return(0,I.jsx)(NX,{scope:t,...x,children:UX(d)?d(x):r})}var IX=`CheckboxTrigger`,LX=_.forwardRef(({__scopeCheckbox:e,onKeyDown:t,onClick:n,...r},i)=>{let{control:a,value:o,disabled:s,checked:c,required:l,setControl:u,setChecked:d,hasConsumerStoppedPropagationRef:f,isFormControl:p,bubbleInput:m}=PX(IX,e),h=P(i,u),g=_.useRef(c);return _.useEffect(()=>{let e=a?.form;if(e){let t=()=>d(g.current);return e.addEventListener(`reset`,t),()=>e.removeEventListener(`reset`,t)}},[a,d]),(0,I.jsx)(V.button,{type:`button`,role:`checkbox`,"aria-checked":WX(c)?`mixed`:c,"aria-required":l,"data-state":GX(c),"data-disabled":s?``:void 0,disabled:s,value:o,...r,ref:h,onKeyDown:j(t,e=>{e.key===`Enter`&&e.preventDefault()}),onClick:j(n,e=>{d(e=>WX(e)?!0:!e),m&&p&&(f.current=e.isPropagationStopped(),f.current||e.stopPropagation())})})});LX.displayName=IX;var RX=_.forwardRef((e,t)=>{let{__scopeCheckbox:n,name:r,checked:i,defaultChecked:a,required:o,disabled:s,value:c,onCheckedChange:l,form:u,...d}=e;return(0,I.jsx)(FX,{__scopeCheckbox:n,checked:i,defaultChecked:a,disabled:s,required:o,onCheckedChange:l,name:r,form:u,value:c,internal_do_not_use_render:({isFormControl:e})=>(0,I.jsxs)(I.Fragment,{children:[(0,I.jsx)(LX,{...d,ref:t,__scopeCheckbox:n}),e&&(0,I.jsx)(HX,{__scopeCheckbox:n})]})})});RX.displayName=jX;var zX=`CheckboxIndicator`,BX=_.forwardRef((e,t)=>{let{__scopeCheckbox:n,forceMount:r,...i}=e,a=PX(zX,n);return(0,I.jsx)(Pe,{present:r||WX(a.checked)||a.checked===!0,children:(0,I.jsx)(V.span,{"data-state":GX(a.checked),"data-disabled":a.disabled?``:void 0,...i,ref:t,style:{pointerEvents:`none`,...e.style}})})});BX.displayName=zX;var VX=`CheckboxBubbleInput`,HX=_.forwardRef(({__scopeCheckbox:e,...t},n)=>{let{control:r,hasConsumerStoppedPropagationRef:i,checked:a,defaultChecked:o,required:s,disabled:c,name:l,value:u,form:d,bubbleInput:f,setBubbleInput:p}=PX(VX,e),m=P(n,p),h=tJ(a),g=oc(r);_.useEffect(()=>{let e=f;if(!e)return;let t=window.HTMLInputElement.prototype,n=Object.getOwnPropertyDescriptor(t,`checked`).set,r=!i.current;if(h!==a&&n){let t=new Event(`click`,{bubbles:r});e.indeterminate=WX(a),n.call(e,!WX(a)&&a),e.dispatchEvent(t)}},[f,h,a,i]);let v=_.useRef(!WX(a)&&a);return(0,I.jsx)(V.input,{type:`checkbox`,"aria-hidden":!0,defaultChecked:o??v.current,required:s,disabled:c,name:l,value:u,form:d,...t,tabIndex:-1,ref:m,style:{...t.style,...g,position:`absolute`,pointerEvents:`none`,opacity:0,margin:0,transform:`translateX(-100%)`}})});HX.displayName=VX;function UX(e){return typeof e==`function`}function WX(e){return e===`indeterminate`}function GX(e){return WX(e)?`indeterminate`:e?`checked`:`unchecked`}var KX=_.forwardRef(({className:e,...t},n)=>(0,I.jsx)(RX,{ref:n,className:U(`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-hidden focus-visible:ring-2 focus-visible:ring-ring focus-visible:ring-offset-2 disabled:cursor-not-allowed disabled:opacity-50`,e),...t,children:(0,I.jsx)(BX,{className:U(`flex items-center justify-center text-current`),children:(0,I.jsx)(an,{className:`h-4 w-4`})})}));KX.displayName=RX.displayName;var qX=`Collapsible`,[JX,woe]=R(qX),[YX,XX]=JX(qX),ZX=_.forwardRef((e,t)=>{let{__scopeCollapsible:n,open:r,defaultOpen:i,disabled:a,onOpenChange:o,...s}=e,[c,l]=ze({prop:r,defaultProp:i??!1,onChange:o,caller:qX});return(0,I.jsx)(YX,{scope:n,disabled:a,contentId:Ra(),open:c,onOpenToggle:_.useCallback(()=>l(e=>!e),[l]),children:(0,I.jsx)(V.div,{"data-state":rZ(c),"data-disabled":a?``:void 0,...s,ref:t})})});ZX.displayName=qX;var QX=`CollapsibleTrigger`,$X=_.forwardRef((e,t)=>{let{__scopeCollapsible:n,...r}=e,i=XX(QX,n);return(0,I.jsx)(V.button,{type:`button`,"aria-controls":i.contentId,"aria-expanded":i.open||!1,"data-state":rZ(i.open),"data-disabled":i.disabled?``:void 0,disabled:i.disabled,...r,ref:t,onClick:j(e.onClick,i.onOpenToggle)})});$X.displayName=QX;var eZ=`CollapsibleContent`,tZ=_.forwardRef((e,t)=>{let{forceMount:n,...r}=e,i=XX(eZ,e.__scopeCollapsible);return(0,I.jsx)(Pe,{present:n||i.open,children:({present:e})=>(0,I.jsx)(nZ,{...r,ref:t,present:e})})});tZ.displayName=eZ;var nZ=_.forwardRef((e,t)=>{let{__scopeCollapsible:n,present:r,children:i,...a}=e,o=XX(eZ,n),[s,c]=_.useState(r),l=_.useRef(null),u=P(t,l),d=_.useRef(0),f=d.current,p=_.useRef(0),m=p.current,h=o.open||s,g=_.useRef(h),v=_.useRef(void 0);return _.useEffect(()=>{let e=requestAnimationFrame(()=>g.current=!1);return()=>cancelAnimationFrame(e)},[]),Ae(()=>{let e=l.current;if(e){v.current=v.current||{transitionDuration:e.style.transitionDuration,animationName:e.style.animationName},e.style.transitionDuration=`0s`,e.style.animationName=`none`;let t=e.getBoundingClientRect();d.current=t.height,p.current=t.width,g.current||(e.style.transitionDuration=v.current.transitionDuration,e.style.animationName=v.current.animationName),c(r)}},[o.open,r]),(0,I.jsx)(V.div,{"data-state":rZ(o.open),"data-disabled":o.disabled?``:void 0,id:o.contentId,hidden:!h,...a,ref:u,style:{"--radix-collapsible-content-height":f?`${f}px`:void 0,"--radix-collapsible-content-width":m?`${m}px`:void 0,...e.style},children:h&&i})});function rZ(e){return e?`open`:`closed`}var iZ=ZX,aZ=$X,oZ=tZ;function sZ(e){return e.length>0?`Tool sequence · ${e.join(` -> `)}`:`Tool sequence`}function cZ(e,t){let n=t||{};return(e[e.length-1]===``?[...e,``]:e).join((n.padRight?` `:``)+`,`+(n.padLeft===!1?``:` `)).trim()}var lZ=/^[$_\p{ID_Start}][$_\u{200C}\u{200D}\p{ID_Continue}]*$/u,uZ=/^[$_\p{ID_Start}][-$_\u{200C}\u{200D}\p{ID_Continue}]*$/u,dZ={};function fZ(e,t){return((t||dZ).jsx?uZ:lZ).test(e)}var pZ=/[ \t\n\f\r]/g;function mZ(e){return typeof e==`object`?e.type===`text`&&hZ(e.value):hZ(e)}function hZ(e){return e.replace(pZ,``)===``}var gZ=class{constructor(e,t,n){this.normal=t,this.property=e,n&&(this.space=n)}};gZ.prototype.normal={},gZ.prototype.property={},gZ.prototype.space=void 0;function _Z(e,t){let n={},r={};for(let t of e)Object.assign(n,t.property),Object.assign(r,t.normal);return new gZ(n,r,t)}function vZ(e){return e.toLowerCase()}var yZ=class{constructor(e,t){this.attribute=t,this.property=e}};yZ.prototype.attribute=``,yZ.prototype.booleanish=!1,yZ.prototype.boolean=!1,yZ.prototype.commaOrSpaceSeparated=!1,yZ.prototype.commaSeparated=!1,yZ.prototype.defined=!1,yZ.prototype.mustUseProperty=!1,yZ.prototype.number=!1,yZ.prototype.overloadedBoolean=!1,yZ.prototype.property=``,yZ.prototype.spaceSeparated=!1,yZ.prototype.space=void 0;var bZ=s({boolean:()=>SZ,booleanish:()=>CZ,commaOrSpaceSeparated:()=>DZ,commaSeparated:()=>EZ,number:()=>$,overloadedBoolean:()=>wZ,spaceSeparated:()=>TZ}),xZ=0,SZ=OZ(),CZ=OZ(),wZ=OZ(),$=OZ(),TZ=OZ(),EZ=OZ(),DZ=OZ();function OZ(){return 2**++xZ}var kZ=Object.keys(bZ),AZ=class extends yZ{constructor(e,t,n,r){let i=-1;if(super(e,t),jZ(this,`space`,r),typeof n==`number`)for(;++i<kZ.length;){let e=kZ[i];jZ(this,kZ[i],(n&bZ[e])===bZ[e])}}};AZ.prototype.defined=!0;function jZ(e,t,n){n&&(e[t]=n)}function MZ(e){let t={},n={};for(let[r,i]of Object.entries(e.properties)){let a=new AZ(r,e.transform(e.attributes||{},r),i,e.space);e.mustUseProperty&&e.mustUseProperty.includes(r)&&(a.mustUseProperty=!0),t[r]=a,n[vZ(r)]=r,n[vZ(a.attribute)]=r}return new gZ(t,n,e.space)}var NZ=MZ({properties:{ariaActiveDescendant:null,ariaAtomic:CZ,ariaAutoComplete:null,ariaBusy:CZ,ariaChecked:CZ,ariaColCount:$,ariaColIndex:$,ariaColSpan:$,ariaControls:TZ,ariaCurrent:null,ariaDescribedBy:TZ,ariaDetails:null,ariaDisabled:CZ,ariaDropEffect:TZ,ariaErrorMessage:null,ariaExpanded:CZ,ariaFlowTo:TZ,ariaGrabbed:CZ,ariaHasPopup:null,ariaHidden:CZ,ariaInvalid:null,ariaKeyShortcuts:null,ariaLabel:null,ariaLabelledBy:TZ,ariaLevel:$,ariaLive:null,ariaModal:CZ,ariaMultiLine:CZ,ariaMultiSelectable:CZ,ariaOrientation:null,ariaOwns:TZ,ariaPlaceholder:null,ariaPosInSet:$,ariaPressed:CZ,ariaReadOnly:CZ,ariaRelevant:null,ariaRequired:CZ,ariaRoleDescription:TZ,ariaRowCount:$,ariaRowIndex:$,ariaRowSpan:$,ariaSelected:CZ,ariaSetSize:$,ariaSort:null,ariaValueMax:$,ariaValueMin:$,ariaValueNow:$,ariaValueText:null,role:null},transform(e,t){return t===`role`?t:`aria-`+t.slice(4).toLowerCase()}});function PZ(e,t){return t in e?e[t]:t}function FZ(e,t){return PZ(e,t.toLowerCase())}var IZ=MZ({attributes:{acceptcharset:`accept-charset`,classname:`class`,htmlfor:`for`,httpequiv:`http-equiv`},mustUseProperty:[`checked`,`multiple`,`muted`,`selected`],properties:{abbr:null,accept:EZ,acceptCharset:TZ,accessKey:TZ,action:null,allow:null,allowFullScreen:SZ,allowPaymentRequest:SZ,allowUserMedia:SZ,alpha:SZ,alt:null,as:null,async:SZ,autoCapitalize:null,autoComplete:TZ,autoFocus:SZ,autoPlay:SZ,blocking:TZ,capture:null,charSet:null,checked:SZ,cite:null,className:TZ,closedBy:null,colorSpace:null,cols:$,colSpan:$,command:null,commandFor:null,content:null,contentEditable:CZ,controls:SZ,controlsList:TZ,coords:$|EZ,crossOrigin:null,data:null,dateTime:null,decoding:null,default:SZ,defer:SZ,dir:null,dirName:null,disabled:SZ,download:wZ,draggable:CZ,encType:null,enterKeyHint:null,fetchPriority:null,form:null,formAction:null,formEncType:null,formMethod:null,formNoValidate:SZ,formTarget:null,headers:TZ,height:$,hidden:wZ,high:$,href:null,hrefLang:null,htmlFor:TZ,httpEquiv:TZ,id:null,imageSizes:null,imageSrcSet:null,inert:SZ,inputMode:null,integrity:null,is:null,isMap:SZ,itemId:null,itemProp:TZ,itemRef:TZ,itemScope:SZ,itemType:TZ,kind:null,label:null,lang:null,language:null,list:null,loading:null,loop:SZ,low:$,manifest:null,max:null,maxLength:$,media:null,method:null,min:null,minLength:$,multiple:SZ,muted:SZ,name:null,nonce:null,noModule:SZ,noValidate:SZ,onAbort:null,onAfterPrint:null,onAuxClick:null,onBeforeMatch:null,onBeforePrint:null,onBeforeToggle:null,onBeforeUnload:null,onBlur:null,onCancel:null,onCanPlay:null,onCanPlayThrough:null,onChange:null,onClick:null,onClose:null,onContextLost:null,onContextMenu:null,onContextRestored:null,onCopy:null,onCueChange:null,onCut:null,onDblClick:null,onDrag:null,onDragEnd:null,onDragEnter:null,onDragExit:null,onDragLeave:null,onDragOver:null,onDragStart:null,onDrop:null,onDurationChange:null,onEmptied:null,onEnded:null,onError:null,onFocus:null,onFormData:null,onHashChange:null,onInput:null,onInvalid:null,onKeyDown:null,onKeyPress:null,onKeyUp:null,onLanguageChange:null,onLoad:null,onLoadedData:null,onLoadedMetadata:null,onLoadEnd:null,onLoadStart:null,onMessage:null,onMessageError:null,onMouseDown:null,onMouseEnter:null,onMouseLeave:null,onMouseMove:null,onMouseOut:null,onMouseOver:null,onMouseUp:null,onOffline:null,onOnline:null,onPageHide:null,onPageShow:null,onPaste:null,onPause:null,onPlay:null,onPlaying:null,onPopState:null,onProgress:null,onRateChange:null,onRejectionHandled:null,onReset:null,onResize:null,onScroll:null,onScrollEnd:null,onSecurityPolicyViolation:null,onSeeked:null,onSeeking:null,onSelect:null,onSlotChange:null,onStalled:null,onStorage:null,onSubmit:null,onSuspend:null,onTimeUpdate:null,onToggle:null,onUnhandledRejection:null,onUnload:null,onVolumeChange:null,onWaiting:null,onWheel:null,open:SZ,optimum:$,pattern:null,ping:TZ,placeholder:null,playsInline:SZ,popover:null,popoverTarget:null,popoverTargetAction:null,poster:null,preload:null,readOnly:SZ,referrerPolicy:null,rel:TZ,required:SZ,reversed:SZ,rows:$,rowSpan:$,sandbox:TZ,scope:null,scoped:SZ,seamless:SZ,selected:SZ,shadowRootClonable:SZ,shadowRootCustomElementRegistry:SZ,shadowRootDelegatesFocus:SZ,shadowRootMode:null,shadowRootSerializable:SZ,shape:null,size:$,sizes:null,slot:null,span:$,spellCheck:CZ,src:null,srcDoc:null,srcLang:null,srcSet:null,start:$,step:null,style:null,tabIndex:$,target:null,title:null,translate:null,type:null,typeMustMatch:SZ,useMap:null,value:CZ,width:$,wrap:null,writingSuggestions:null,align:null,aLink:null,archive:TZ,axis:null,background:null,bgColor:null,border:$,borderColor:null,bottomMargin:$,cellPadding:null,cellSpacing:null,char:null,charOff:null,classId:null,clear:null,code:null,codeBase:null,codeType:null,color:null,compact:SZ,declare:SZ,event:null,face:null,frame:null,frameBorder:null,hSpace:$,leftMargin:$,link:null,longDesc:null,lowSrc:null,marginHeight:$,marginWidth:$,noResize:SZ,noHref:SZ,noShade:SZ,noWrap:SZ,object:null,profile:null,prompt:null,rev:null,rightMargin:$,rules:null,scheme:null,scrolling:CZ,standby:null,summary:null,text:null,topMargin:$,valueType:null,version:null,vAlign:null,vLink:null,vSpace:$,allowTransparency:null,autoCorrect:null,autoSave:null,credentialless:SZ,disablePictureInPicture:SZ,disableRemotePlayback:SZ,exportParts:EZ,part:TZ,prefix:null,property:null,results:$,security:null,unselectable:null},space:`html`,transform:FZ}),LZ=MZ({attributes:{accentHeight:`accent-height`,alignmentBaseline:`alignment-baseline`,arabicForm:`arabic-form`,baselineShift:`baseline-shift`,capHeight:`cap-height`,className:`class`,clipPath:`clip-path`,clipRule:`clip-rule`,colorInterpolation:`color-interpolation`,colorInterpolationFilters:`color-interpolation-filters`,colorProfile:`color-profile`,colorRendering:`color-rendering`,crossOrigin:`crossorigin`,dataType:`datatype`,dominantBaseline:`dominant-baseline`,enableBackground:`enable-background`,fillOpacity:`fill-opacity`,fillRule:`fill-rule`,floodColor:`flood-color`,floodOpacity:`flood-opacity`,fontFamily:`font-family`,fontSize:`font-size`,fontSizeAdjust:`font-size-adjust`,fontStretch:`font-stretch`,fontStyle:`font-style`,fontVariant:`font-variant`,fontWeight:`font-weight`,glyphName:`glyph-name`,glyphOrientationHorizontal:`glyph-orientation-horizontal`,glyphOrientationVertical:`glyph-orientation-vertical`,hrefLang:`hreflang`,horizAdvX:`horiz-adv-x`,horizOriginX:`horiz-origin-x`,horizOriginY:`horiz-origin-y`,imageRendering:`image-rendering`,letterSpacing:`letter-spacing`,lightingColor:`lighting-color`,markerEnd:`marker-end`,markerMid:`marker-mid`,markerStart:`marker-start`,maskType:`mask-type`,navDown:`nav-down`,navDownLeft:`nav-down-left`,navDownRight:`nav-down-right`,navLeft:`nav-left`,navNext:`nav-next`,navPrev:`nav-prev`,navRight:`nav-right`,navUp:`nav-up`,navUpLeft:`nav-up-left`,navUpRight:`nav-up-right`,onAbort:`onabort`,onActivate:`onactivate`,onAfterPrint:`onafterprint`,onBeforePrint:`onbeforeprint`,onBegin:`onbegin`,onCancel:`oncancel`,onCanPlay:`oncanplay`,onCanPlayThrough:`oncanplaythrough`,onChange:`onchange`,onClick:`onclick`,onClose:`onclose`,onCopy:`oncopy`,onCueChange:`oncuechange`,onCut:`oncut`,onDblClick:`ondblclick`,onDrag:`ondrag`,onDragEnd:`ondragend`,onDragEnter:`ondragenter`,onDragExit:`ondragexit`,onDragLeave:`ondragleave`,onDragOver:`ondragover`,onDragStart:`ondragstart`,onDrop:`ondrop`,onDurationChange:`ondurationchange`,onEmptied:`onemptied`,onEnd:`onend`,onEnded:`onended`,onError:`onerror`,onFocus:`onfocus`,onFocusIn:`onfocusin`,onFocusOut:`onfocusout`,onHashChange:`onhashchange`,onInput:`oninput`,onInvalid:`oninvalid`,onKeyDown:`onkeydown`,onKeyPress:`onkeypress`,onKeyUp:`onkeyup`,onLoad:`onload`,onLoadedData:`onloadeddata`,onLoadedMetadata:`onloadedmetadata`,onLoadStart:`onloadstart`,onMessage:`onmessage`,onMouseDown:`onmousedown`,onMouseEnter:`onmouseenter`,onMouseLeave:`onmouseleave`,onMouseMove:`onmousemove`,onMouseOut:`onmouseout`,onMouseOver:`onmouseover`,onMouseUp:`onmouseup`,onMouseWheel:`onmousewheel`,onOffline:`onoffline`,onOnline:`ononline`,onPageHide:`onpagehide`,onPageShow:`onpageshow`,onPaste:`onpaste`,onPause:`onpause`,onPlay:`onplay`,onPlaying:`onplaying`,onPopState:`onpopstate`,onProgress:`onprogress`,onRateChange:`onratechange`,onRepeat:`onrepeat`,onReset:`onreset`,onResize:`onresize`,onScroll:`onscroll`,onSeeked:`onseeked`,onSeeking:`onseeking`,onSelect:`onselect`,onShow:`onshow`,onStalled:`onstalled`,onStorage:`onstorage`,onSubmit:`onsubmit`,onSuspend:`onsuspend`,onTimeUpdate:`ontimeupdate`,onToggle:`ontoggle`,onUnload:`onunload`,onVolumeChange:`onvolumechange`,onWaiting:`onwaiting`,onZoom:`onzoom`,overlinePosition:`overline-position`,overlineThickness:`overline-thickness`,paintOrder:`paint-order`,panose1:`panose-1`,pointerEvents:`pointer-events`,referrerPolicy:`referrerpolicy`,renderingIntent:`rendering-intent`,shapeRendering:`shape-rendering`,stopColor:`stop-color`,stopOpacity:`stop-opacity`,strikethroughPosition:`strikethrough-position`,strikethroughThickness:`strikethrough-thickness`,strokeDashArray:`stroke-dasharray`,strokeDashOffset:`stroke-dashoffset`,strokeLineCap:`stroke-linecap`,strokeLineJoin:`stroke-linejoin`,strokeMiterLimit:`stroke-miterlimit`,strokeOpacity:`stroke-opacity`,strokeWidth:`stroke-width`,tabIndex:`tabindex`,textAnchor:`text-anchor`,textDecoration:`text-decoration`,textRendering:`text-rendering`,transformOrigin:`transform-origin`,typeOf:`typeof`,underlinePosition:`underline-position`,underlineThickness:`underline-thickness`,unicodeBidi:`unicode-bidi`,unicodeRange:`unicode-range`,unitsPerEm:`units-per-em`,vAlphabetic:`v-alphabetic`,vHanging:`v-hanging`,vIdeographic:`v-ideographic`,vMathematical:`v-mathematical`,vectorEffect:`vector-effect`,vertAdvY:`vert-adv-y`,vertOriginX:`vert-origin-x`,vertOriginY:`vert-origin-y`,wordSpacing:`word-spacing`,writingMode:`writing-mode`,xHeight:`x-height`,playbackOrder:`playbackorder`,timelineBegin:`timelinebegin`},properties:{about:DZ,accentHeight:$,accumulate:null,additive:null,alignmentBaseline:null,alphabetic:$,amplitude:$,arabicForm:null,ascent:$,attributeName:null,attributeType:null,azimuth:$,bandwidth:null,baselineShift:null,baseFrequency:null,baseProfile:null,bbox:null,begin:null,bias:$,by:null,calcMode:null,capHeight:$,className:TZ,clip:null,clipPath:null,clipPathUnits:null,clipRule:null,color:null,colorInterpolation:null,colorInterpolationFilters:null,colorProfile:null,colorRendering:null,content:null,contentScriptType:null,contentStyleType:null,crossOrigin:null,cursor:null,cx:null,cy:null,d:null,dataType:null,defaultAction:null,descent:$,diffuseConstant:$,direction:null,display:null,dur:null,divisor:$,dominantBaseline:null,download:SZ,dx:null,dy:null,edgeMode:null,editable:null,elevation:$,enableBackground:null,end:null,event:null,exponent:$,externalResourcesRequired:null,fill:null,fillOpacity:$,fillRule:null,filter:null,filterRes:null,filterUnits:null,floodColor:null,floodOpacity:null,focusable:null,focusHighlight:null,fontFamily:null,fontSize:null,fontSizeAdjust:null,fontStretch:null,fontStyle:null,fontVariant:null,fontWeight:null,format:null,fr:null,from:null,fx:null,fy:null,g1:EZ,g2:EZ,glyphName:EZ,glyphOrientationHorizontal:null,glyphOrientationVertical:null,glyphRef:null,gradientTransform:null,gradientUnits:null,handler:null,hanging:$,hatchContentUnits:null,hatchUnits:null,height:null,href:null,hrefLang:null,horizAdvX:$,horizOriginX:$,horizOriginY:$,id:null,ideographic:$,imageRendering:null,initialVisibility:null,in:null,in2:null,intercept:$,k:$,k1:$,k2:$,k3:$,k4:$,kernelMatrix:DZ,kernelUnitLength:null,keyPoints:null,keySplines:null,keyTimes:null,kerning:null,lang:null,lengthAdjust:null,letterSpacing:null,lightingColor:null,limitingConeAngle:$,local:null,markerEnd:null,markerMid:null,markerStart:null,markerHeight:null,markerUnits:null,markerWidth:null,mask:null,maskContentUnits:null,maskType:null,maskUnits:null,mathematical:null,max:null,media:null,mediaCharacterEncoding:null,mediaContentEncodings:null,mediaSize:$,mediaTime:null,method:null,min:null,mode:null,name:null,navDown:null,navDownLeft:null,navDownRight:null,navLeft:null,navNext:null,navPrev:null,navRight:null,navUp:null,navUpLeft:null,navUpRight:null,numOctaves:null,observer:null,offset:null,onAbort:null,onActivate:null,onAfterPrint:null,onBeforePrint:null,onBegin:null,onCancel:null,onCanPlay:null,onCanPlayThrough:null,onChange:null,onClick:null,onClose:null,onCopy:null,onCueChange:null,onCut:null,onDblClick:null,onDrag:null,onDragEnd:null,onDragEnter:null,onDragExit:null,onDragLeave:null,onDragOver:null,onDragStart:null,onDrop:null,onDurationChange:null,onEmptied:null,onEnd:null,onEnded:null,onError:null,onFocus:null,onFocusIn:null,onFocusOut:null,onHashChange:null,onInput:null,onInvalid:null,onKeyDown:null,onKeyPress:null,onKeyUp:null,onLoad:null,onLoadedData:null,onLoadedMetadata:null,onLoadStart:null,onMessage:null,onMouseDown:null,onMouseEnter:null,onMouseLeave:null,onMouseMove:null,onMouseOut:null,onMouseOver:null,onMouseUp:null,onMouseWheel:null,onOffline:null,onOnline:null,onPageHide:null,onPageShow:null,onPaste:null,onPause:null,onPlay:null,onPlaying:null,onPopState:null,onProgress:null,onRateChange:null,onRepeat:null,onReset:null,onResize:null,onScroll:null,onSeeked:null,onSeeking:null,onSelect:null,onShow:null,onStalled:null,onStorage:null,onSubmit:null,onSuspend:null,onTimeUpdate:null,onToggle:null,onUnload:null,onVolumeChange:null,onWaiting:null,onZoom:null,opacity:null,operator:null,order:null,orient:null,orientation:null,origin:null,overflow:null,overlay:null,overlinePosition:$,overlineThickness:$,paintOrder:null,panose1:null,path:null,pathLength:$,patternContentUnits:null,patternTransform:null,patternUnits:null,phase:null,ping:TZ,pitch:null,playbackOrder:null,pointerEvents:null,points:null,pointsAtX:$,pointsAtY:$,pointsAtZ:$,preserveAlpha:null,preserveAspectRatio:null,primitiveUnits:null,propagate:null,property:DZ,r:null,radius:null,referrerPolicy:null,refX:null,refY:null,rel:DZ,rev:DZ,renderingIntent:null,repeatCount:null,repeatDur:null,requiredExtensions:DZ,requiredFeatures:DZ,requiredFonts:DZ,requiredFormats:DZ,resource:null,restart:null,result:null,rotate:null,rx:null,ry:null,scale:null,seed:null,shapeRendering:null,side:null,slope:null,snapshotTime:null,specularConstant:$,specularExponent:$,spreadMethod:null,spacing:null,startOffset:null,stdDeviation:null,stemh:null,stemv:null,stitchTiles:null,stopColor:null,stopOpacity:null,strikethroughPosition:$,strikethroughThickness:$,string:null,stroke:null,strokeDashArray:DZ,strokeDashOffset:null,strokeLineCap:null,strokeLineJoin:null,strokeMiterLimit:$,strokeOpacity:$,strokeWidth:null,style:null,surfaceScale:$,syncBehavior:null,syncBehaviorDefault:null,syncMaster:null,syncTolerance:null,syncToleranceDefault:null,systemLanguage:DZ,tabIndex:$,tableValues:null,target:null,targetX:$,targetY:$,textAnchor:null,textDecoration:null,textRendering:null,textLength:null,timelineBegin:null,title:null,transformBehavior:null,type:null,typeOf:DZ,to:null,transform:null,transformOrigin:null,u1:null,u2:null,underlinePosition:$,underlineThickness:$,unicode:null,unicodeBidi:null,unicodeRange:null,unitsPerEm:$,values:null,vAlphabetic:$,vMathematical:$,vectorEffect:null,vHanging:$,vIdeographic:$,version:null,vertAdvY:$,vertOriginX:$,vertOriginY:$,viewBox:null,viewTarget:null,visibility:null,width:null,widths:null,wordSpacing:null,writingMode:null,x:null,x1:null,x2:null,xChannelSelector:null,xHeight:$,y:null,y1:null,y2:null,yChannelSelector:null,z:null,zoomAndPan:null},space:`svg`,transform:PZ}),RZ=MZ({properties:{xLinkActuate:null,xLinkArcRole:null,xLinkHref:null,xLinkRole:null,xLinkShow:null,xLinkTitle:null,xLinkType:null},space:`xlink`,transform(e,t){return`xlink:`+t.slice(5).toLowerCase()}}),zZ=MZ({attributes:{xmlnsxlink:`xmlns:xlink`},properties:{xmlnsXLink:null,xmlns:null},space:`xmlns`,transform:FZ}),BZ=MZ({properties:{xmlBase:null,xmlLang:null,xmlSpace:null},space:`xml`,transform(e,t){return`xml:`+t.slice(3).toLowerCase()}}),VZ={classId:`classID`,dataType:`datatype`,itemId:`itemID`,strokeDashArray:`strokeDasharray`,strokeDashOffset:`strokeDashoffset`,strokeLineCap:`strokeLinecap`,strokeLineJoin:`strokeLinejoin`,strokeMiterLimit:`strokeMiterlimit`,typeOf:`typeof`,xLinkActuate:`xlinkActuate`,xLinkArcRole:`xlinkArcrole`,xLinkHref:`xlinkHref`,xLinkRole:`xlinkRole`,xLinkShow:`xlinkShow`,xLinkTitle:`xlinkTitle`,xLinkType:`xlinkType`,xmlnsXLink:`xmlnsXlink`},HZ=/[A-Z]/g,UZ=/-[a-z]/g,WZ=/^data[-\w.:]+$/i;function GZ(e,t){let n=vZ(t),r=t,i=yZ;if(n in e.normal)return e.property[e.normal[n]];if(n.length>4&&n.slice(0,4)===`data`&&WZ.test(t)){if(t.charAt(4)===`-`){let e=t.slice(5).replace(UZ,qZ);r=`data`+e.charAt(0).toUpperCase()+e.slice(1)}else{let e=t.slice(4);if(!UZ.test(e)){let n=e.replace(HZ,KZ);n.charAt(0)!==`-`&&(n=`-`+n),t=`data`+n}}i=AZ}return new i(r,t)}function KZ(e){return`-`+e.toLowerCase()}function qZ(e){return e.charAt(1).toUpperCase()}var JZ=_Z([NZ,IZ,RZ,zZ,BZ],`html`),YZ=_Z([NZ,LZ,RZ,zZ,BZ],`svg`);function XZ(e){return e.join(` `).trim()}var ZZ=o(((e,t)=>{var n=/\/\*[^*]*\*+([^/*][^*]*\*+)*\//g,r=/\n/g,i=/^\s*/,a=/^(\*?[-#/*\\\w]+(\[[0-9a-z_-]+\])?)\s*/,o=/^:\s*/,s=/^((?:'(?:\\'|.)*?'|"(?:\\"|.)*?"|\([^)]*?\)|[^};])+)/,c=/^[;\s]*/,l=/^\s+|\s+$/g;function u(e,t){if(typeof e!=`string`)throw TypeError(`First argument must be a string`);if(!e)return[];t||={};var l=1,u=1;function f(e){var t=e.match(r);t&&(l+=t.length);var n=e.lastIndexOf(`
|
|
118
|
-
`);u=~n?e.length-n:u+e.length}function p(){var e={line:l,column:u};return function(t){return t.position=new m(e),_(),t}}function m(e){this.start=e,this.end={line:l,column:u},this.source=t.source}m.prototype.content=e;function h(n){var r=Error(t.source+`:`+l+`:`+u+`: `+n);if(r.reason=n,r.filename=t.source,r.line=l,r.column=u,r.source=e,!t.silent)throw r}function g(t){var n=t.exec(e);if(n){var r=n[0];return f(r),e=e.slice(r.length),n}}function _(){g(i)}function v(e){var t;for(e||=[];t=y();)t!==!1&&e.push(t);return e}function y(){var t=p();if(e.charAt(0)==`/`&&e.charAt(1)==`*`){for(var n=2;e.charAt(n)!=``&&(e.charAt(n)!=`*`||e.charAt(n+1)!=`/`);)++n;if(n+=2,e.charAt(n-1)===``)return h(`End of comment missing`);var r=e.slice(2,n-2);return u+=2,f(r),e=e.slice(n),u+=2,t({type:`comment`,comment:r})}}function b(){var e=p(),t=g(a);if(t){if(y(),!g(o))return h(`property missing ':'`);var r=g(s),i=e({type:`declaration`,property:d(t[0].replace(n,``)),value:r?d(r[0].replace(n,``)):``});return g(c),i}}function x(){var e=[];v(e);for(var t;t=b();)t!==!1&&(e.push(t),v(e));return e}return _(),x()}function d(e){return e?e.replace(l,``):``}t.exports=u})),QZ=o((e=>{var t=e&&e.__importDefault||function(e){return e&&e.__esModule?e:{default:e}};Object.defineProperty(e,"__esModule",{value:!0}),e.default=r;var n=t(ZZ());function r(e,t){let r=null;if(!e||typeof e!=`string`)return r;let i=(0,n.default)(e),a=typeof t==`function`;return i.forEach(e=>{if(e.type!==`declaration`)return;let{property:n,value:i}=e;a?t(n,i,e):i&&(r||={},r[n]=i)}),r}})),$Z=o((e=>{Object.defineProperty(e,"__esModule",{value:!0}),e.camelCase=void 0;var t=/^--[a-zA-Z0-9_-]+$/,n=/-([a-z])/g,r=/^[^-]+$/,i=/^-(webkit|moz|ms|o|khtml)-/,a=/^-(ms)-/,o=function(e){return!e||r.test(e)||t.test(e)},s=function(e,t){return t.toUpperCase()},c=function(e,t){return`${t}-`};e.camelCase=function(e,t){return t===void 0&&(t={}),o(e)?e:(e=e.toLowerCase(),e=t.reactCompat?e.replace(a,c):e.replace(i,c),e.replace(n,s))}})),eQ=o(((e,t)=>{var n=(e&&e.__importDefault||function(e){return e&&e.__esModule?e:{default:e}})(QZ()),r=$Z();function i(e,t){var i={};return!e||typeof e!=`string`||(0,n.default)(e,function(e,n){e&&n&&(i[(0,r.camelCase)(e,t)]=n)}),i}i.default=i,t.exports=i})),tQ=rQ(`end`),nQ=rQ(`start`);function rQ(e){return t;function t(t){let n=t&&t.position&&t.position[e]||{};if(typeof n.line==`number`&&n.line>0&&typeof n.column==`number`&&n.column>0)return{line:n.line,column:n.column,offset:typeof n.offset==`number`&&n.offset>-1?n.offset:void 0}}}function iQ(e){let t=nQ(e),n=tQ(e);if(t&&n)return{start:t,end:n}}function aQ(e){return!e||typeof e!=`object`?``:`position`in e||`type`in e?sQ(e.position):`start`in e||`end`in e?sQ(e):`line`in e||`column`in e?oQ(e):``}function oQ(e){return cQ(e&&e.line)+`:`+cQ(e&&e.column)}function sQ(e){return oQ(e&&e.start)+`-`+oQ(e&&e.end)}function cQ(e){return e&&typeof e==`number`?e:1}var lQ=class extends Error{constructor(e,t,n){super(),typeof t==`string`&&(n=t,t=void 0);let r=``,i={},a=!1;if(t&&(i=`line`in t&&`column`in t||`start`in t&&`end`in t?{place:t}:`type`in t?{ancestors:[t],place:t.position}:{...t}),typeof e==`string`?r=e:!i.cause&&e&&(a=!0,r=e.message,i.cause=e),!i.ruleId&&!i.source&&typeof n==`string`){let e=n.indexOf(`:`);e===-1?i.ruleId=n:(i.source=n.slice(0,e),i.ruleId=n.slice(e+1))}if(!i.place&&i.ancestors&&i.ancestors){let e=i.ancestors[i.ancestors.length-1];e&&(i.place=e.position)}let o=i.place&&`start`in i.place?i.place.start:i.place;this.ancestors=i.ancestors||void 0,this.cause=i.cause||void 0,this.column=o?o.column:void 0,this.fatal=void 0,this.file=``,this.message=r,this.line=o?o.line:void 0,this.name=aQ(i.place)||`1:1`,this.place=i.place||void 0,this.reason=this.message,this.ruleId=i.ruleId||void 0,this.source=i.source||void 0,this.stack=a&&i.cause&&typeof i.cause.stack==`string`?i.cause.stack:``,this.actual=void 0,this.expected=void 0,this.note=void 0,this.url=void 0}};lQ.prototype.file=``,lQ.prototype.name=``,lQ.prototype.reason=``,lQ.prototype.message=``,lQ.prototype.stack=``,lQ.prototype.column=void 0,lQ.prototype.line=void 0,lQ.prototype.ancestors=void 0,lQ.prototype.cause=void 0,lQ.prototype.fatal=void 0,lQ.prototype.place=void 0,lQ.prototype.ruleId=void 0,lQ.prototype.source=void 0;var uQ=l(eQ(),1),dQ={}.hasOwnProperty,fQ=new Map,pQ=/[A-Z]/g,mQ=new Set([`table`,`tbody`,`thead`,`tfoot`,`tr`]),hQ=new Set([`td`,`th`]),gQ=`https://github.com/syntax-tree/hast-util-to-jsx-runtime`;function _Q(e,t){if(!t||t.Fragment===void 0)throw TypeError("Expected `Fragment` in options");let n=t.filePath||void 0,r;if(t.development){if(typeof t.jsxDEV!=`function`)throw TypeError("Expected `jsxDEV` in options when `development: true`");r=OQ(n,t.jsxDEV)}else{if(typeof t.jsx!=`function`)throw TypeError("Expected `jsx` in production options");if(typeof t.jsxs!=`function`)throw TypeError("Expected `jsxs` in production options");r=DQ(n,t.jsx,t.jsxs)}let i={Fragment:t.Fragment,ancestors:[],components:t.components||{},create:r,elementAttributeNameCase:t.elementAttributeNameCase||`react`,evaluater:t.createEvaluater?t.createEvaluater():void 0,filePath:n,ignoreInvalidStyle:t.ignoreInvalidStyle||!1,passKeys:t.passKeys!==!1,passNode:t.passNode||!1,schema:t.space===`svg`?YZ:JZ,stylePropertyNameCase:t.stylePropertyNameCase||`dom`,tableCellAlignToStyle:t.tableCellAlignToStyle!==!1},a=vQ(i,e,void 0);return a&&typeof a!=`string`?a:i.create(e,i.Fragment,{children:a||void 0},void 0)}function vQ(e,t,n){if(t.type===`element`)return yQ(e,t,n);if(t.type===`mdxFlowExpression`||t.type===`mdxTextExpression`)return bQ(e,t);if(t.type===`mdxJsxFlowElement`||t.type===`mdxJsxTextElement`)return SQ(e,t,n);if(t.type===`mdxjsEsm`)return xQ(e,t);if(t.type===`root`)return CQ(e,t,n);if(t.type===`text`)return wQ(e,t)}function yQ(e,t,n){let r=e.schema,i=r;t.tagName.toLowerCase()===`svg`&&r.space===`html`&&(i=YZ,e.schema=i),e.ancestors.push(t);let a=PQ(e,t.tagName,!1),o=kQ(e,t),s=jQ(e,t);return mQ.has(t.tagName)&&(s=s.filter(function(e){return typeof e!=`string`||!mZ(e)})),TQ(e,o,a,t),EQ(o,s),e.ancestors.pop(),e.schema=r,e.create(t,a,o,n)}function bQ(e,t){if(t.data&&t.data.estree&&e.evaluater){let n=t.data.estree.body[0];return n.type,e.evaluater.evaluateExpression(n.expression)}FQ(e,t.position)}function xQ(e,t){if(t.data&&t.data.estree&&e.evaluater)return e.evaluater.evaluateProgram(t.data.estree);FQ(e,t.position)}function SQ(e,t,n){let r=e.schema,i=r;t.name===`svg`&&r.space===`html`&&(i=YZ,e.schema=i),e.ancestors.push(t);let a=t.name===null?e.Fragment:PQ(e,t.name,!0),o=AQ(e,t),s=jQ(e,t);return TQ(e,o,a,t),EQ(o,s),e.ancestors.pop(),e.schema=r,e.create(t,a,o,n)}function CQ(e,t,n){let r={};return EQ(r,jQ(e,t)),e.create(t,e.Fragment,r,n)}function wQ(e,t){return t.value}function TQ(e,t,n,r){typeof n!=`string`&&n!==e.Fragment&&e.passNode&&(t.node=r)}function EQ(e,t){if(t.length>0){let n=t.length>1?t:t[0];n&&(e.children=n)}}function DQ(e,t,n){return r;function r(e,r,i,a){let o=Array.isArray(i.children)?n:t;return a?o(r,i,a):o(r,i)}}function OQ(e,t){return n;function n(n,r,i,a){let o=Array.isArray(i.children),s=nQ(n);return t(r,i,a,o,{columnNumber:s?s.column-1:void 0,fileName:e,lineNumber:s?s.line:void 0},void 0)}}function kQ(e,t){let n={},r,i;for(i in t.properties)if(i!==`children`&&dQ.call(t.properties,i)){let a=MQ(e,i,t.properties[i]);if(a){let[i,o]=a;e.tableCellAlignToStyle&&i===`align`&&typeof o==`string`&&hQ.has(t.tagName)?r=o:n[i]=o}}if(r){let t=n.style||={};t[e.stylePropertyNameCase===`css`?`text-align`:`textAlign`]=r}return n}function AQ(e,t){let n={};for(let r of t.attributes)if(r.type===`mdxJsxExpressionAttribute`){if(r.data&&r.data.estree&&e.evaluater){let t=r.data.estree.body[0];t.type;let i=t.expression;i.type;let a=i.properties[0];a.type,Object.assign(n,e.evaluater.evaluateExpression(a.argument))}else FQ(e,t.position)}else{let i=r.name,a;if(r.value&&typeof r.value==`object`){if(r.value.data&&r.value.data.estree&&e.evaluater){let t=r.value.data.estree.body[0];t.type,a=e.evaluater.evaluateExpression(t.expression)}else FQ(e,t.position)}else a=r.value===null||r.value;n[i]=a}return n}function jQ(e,t){let n=[],r=-1,i=e.passKeys?new Map:fQ;for(;++r<t.children.length;){let a=t.children[r],o;if(e.passKeys){let e=a.type===`element`?a.tagName:a.type===`mdxJsxFlowElement`||a.type===`mdxJsxTextElement`?a.name:void 0;if(e){let t=i.get(e)||0;o=e+`-`+t,i.set(e,t+1)}}let s=vQ(e,a,o);s!==void 0&&n.push(s)}return n}function MQ(e,t,n){let r=GZ(e.schema,t);if(!(n==null||typeof n==`number`&&Number.isNaN(n))){if(Array.isArray(n)&&(n=r.commaSeparated?cZ(n):XZ(n)),r.property===`style`){let t=typeof n==`object`?n:NQ(e,String(n));return e.stylePropertyNameCase===`css`&&(t=IQ(t)),[`style`,t]}return[e.elementAttributeNameCase===`react`&&r.space?VZ[r.property]||r.property:r.attribute,n]}}function NQ(e,t){try{return(0,uQ.default)(t,{reactCompat:!0})}catch(t){if(e.ignoreInvalidStyle)return{};let n=t,r=new lQ("Cannot parse `style` attribute",{ancestors:e.ancestors,cause:n,ruleId:`style`,source:`hast-util-to-jsx-runtime`});throw r.file=e.filePath||void 0,r.url=gQ+`#cannot-parse-style-attribute`,r}}function PQ(e,t,n){let r;if(!n)r={type:`Literal`,value:t};else if(t.includes(`.`)){let e=t.split(`.`),n=-1,i;for(;++n<e.length;){let t=fZ(e[n])?{type:`Identifier`,name:e[n]}:{type:`Literal`,value:e[n]};i=i?{type:`MemberExpression`,object:i,property:t,computed:!!(n&&t.type===`Literal`),optional:!1}:t}r=i}else r=fZ(t)&&!/^[a-z]/.test(t)?{type:`Identifier`,name:t}:{type:`Literal`,value:t};if(r.type===`Literal`){let t=r.value;return dQ.call(e.components,t)?e.components[t]:t}if(e.evaluater)return e.evaluater.evaluateExpression(r);FQ(e)}function FQ(e,t){let n=new lQ("Cannot handle MDX estrees without `createEvaluater`",{ancestors:e.ancestors,place:t,ruleId:`mdx-estree`,source:`hast-util-to-jsx-runtime`});throw n.file=e.filePath||void 0,n.url=gQ+`#cannot-handle-mdx-estrees-without-createevaluater`,n}function IQ(e){let t={},n;for(n in e)dQ.call(e,n)&&(t[LQ(n)]=e[n]);return t}function LQ(e){let t=e.replace(pQ,RQ);return t.slice(0,3)===`ms-`&&(t=`-`+t),t}function RQ(e){return`-`+e.toLowerCase()}var zQ={action:[`form`],cite:[`blockquote`,`del`,`ins`,`q`],data:[`object`],formAction:[`button`,`input`],href:[`a`,`area`,`base`,`link`],icon:[`menuitem`],itemId:null,manifest:[`html`],ping:[`a`,`area`],poster:[`video`],src:[`audio`,`embed`,`iframe`,`img`,`input`,`script`,`source`,`track`,`video`]},BQ={};function VQ(e,t){let n=t||BQ;return HQ(e,typeof n.includeImageAlt!=`boolean`||n.includeImageAlt,typeof n.includeHtml!=`boolean`||n.includeHtml)}function HQ(e,t,n){if(WQ(e)){if(`value`in e)return e.type===`html`&&!n?``:e.value;if(t&&`alt`in e&&e.alt)return e.alt;if(`children`in e)return UQ(e.children,t,n)}return Array.isArray(e)?UQ(e,t,n):``}function UQ(e,t,n){let r=[],i=-1;for(;++i<e.length;)r[i]=HQ(e[i],t,n);return r.join(``)}function WQ(e){return!!(e&&typeof e==`object`)}var GQ=document.createElement(`i`);function KQ(e){let t=`&`+e+`;`;GQ.innerHTML=t;let n=GQ.textContent;return n.charCodeAt(n.length-1)===59&&e!==`semi`?!1:n!==t&&n}function qQ(e,t,n,r){let i=e.length,a=0,o;if(t=t<0?-t>i?0:i+t:t>i?i:t,n=n>0?n:0,r.length<1e4)o=Array.from(r),o.unshift(t,n),e.splice(...o);else for(n&&e.splice(t,n);a<r.length;)o=r.slice(a,a+1e4),o.unshift(t,0),e.splice(...o),a+=1e4,t+=1e4}function JQ(e,t){return e.length>0?(qQ(e,e.length,0,t),e):t}var YQ={}.hasOwnProperty;function XQ(e){let t={},n=-1;for(;++n<e.length;)ZQ(t,e[n]);return t}function ZQ(e,t){let n;for(n in t){let r=(YQ.call(e,n)?e[n]:void 0)||(e[n]={}),i=t[n],a;if(i)for(a in i){YQ.call(r,a)||(r[a]=[]);let e=i[a];QQ(r[a],Array.isArray(e)?e:e?[e]:[])}}}function QQ(e,t){let n=-1,r=[];for(;++n<t.length;)(t[n].add===`after`?e:r).push(t[n]);qQ(e,0,0,r)}function $Q(e,t){let n=Number.parseInt(e,t);return n<9||n===11||n>13&&n<32||n>126&&n<160||n>55295&&n<57344||n>64975&&n<65008||(n&65535)==65535||(n&65535)==65534||n>1114111?`�`:String.fromCodePoint(n)}function e$(e){return e.replace(/[\t\n\r ]+/g,` `).replace(/^ | $/g,``).toLowerCase().toUpperCase()}var t$=p$(/[A-Za-z]/),n$=p$(/[\dA-Za-z]/),r$=p$(/[#-'*+\--9=?A-Z^-~]/);function i$(e){return e!==null&&(e<32||e===127)}var a$=p$(/\d/),o$=p$(/[\dA-Fa-f]/),s$=p$(/[!-/:-@[-`{-~]/);function c$(e){return e!==null&&e<-2}function l$(e){return e!==null&&(e<0||e===32)}function u$(e){return e===-2||e===-1||e===32}var d$=p$(/\p{P}|\p{S}/u),f$=p$(/\s/);function p$(e){return t;function t(t){return t!==null&&t>-1&&e.test(String.fromCharCode(t))}}function m$(e){let t=[],n=-1,r=0,i=0;for(;++n<e.length;){let a=e.charCodeAt(n),o=``;if(a===37&&n$(e.charCodeAt(n+1))&&n$(e.charCodeAt(n+2)))i=2;else if(a<128)/[!#$&-;=?-Z_a-z~]/.test(String.fromCharCode(a))||(o=String.fromCharCode(a));else if(a>55295&&a<57344){let t=e.charCodeAt(n+1);a<56320&&t>56319&&t<57344?(o=String.fromCharCode(a,t),i=1):o=`�`}else o=String.fromCharCode(a);o&&=(t.push(e.slice(r,n),encodeURIComponent(o)),r=n+i+1,``),i&&=(n+=i,0)}return t.join(``)+e.slice(r)}function h$(e,t,n,r){let i=r?r-1:1/0,a=0;return o;function o(r){return u$(r)?(e.enter(n),s(r)):t(r)}function s(r){return u$(r)&&a++<i?(e.consume(r),s):(e.exit(n),t(r))}}function g$(e,t,n,r,i,a){let o=0;return s;function s(t){return a>0&&u$(t)?(e.enter(r),c(t)):l(t)}function c(t){return u$(t)&&o<a?(e.consume(t),o++,c):(e.exit(r),l(t))}function l(e){return o>=i?t(e):n(e)}}var _$={tokenize:v$};function v$(e){let t=e.attempt(this.parser.constructs.contentInitial,r,i),n;return t;function r(n){if(n===null)e.consume(n);else return e.enter(`lineEnding`),e.consume(n),e.exit(`lineEnding`),h$(e,t,`linePrefix`)}function i(t){return e.enter(`paragraph`),a(t)}function a(t){let r=e.enter(`chunkText`,{contentType:`text`,previous:n});return n&&(n.next=r),n=r,o(t)}function o(t){if(t===null)e.exit(`chunkText`),e.exit(`paragraph`),e.consume(t);else return c$(t)?(e.consume(t),e.exit(`chunkText`),a):(e.consume(t),o)}}var y$=class{constructor(){this.index=new Map,this.map=[]}add(e,t,n){b$(this,e,t,n,!1)}addBefore(e,t,n){b$(this,e,t,n,!0)}consume(e){if(this.map.sort(function(e,t){return e[0]-t[0]}),this.map.length===0)return;let t=this.map.length,n=[];for(;t>0;)--t,n.push(e.slice(this.map[t][0]+this.map[t][1]),this.map[t][2]),e.length=this.map[t][0];n.push(e.slice()),e.length=0;let r=n.pop();for(;r;){for(let t of r)e.push(t);r=n.pop()}this.map.length=0,this.index.clear()}};function b$(e,t,n,r,i){if(n===0&&r.length===0)return;let a=e.index.get(t);if(a){a[1]+=n,i?(r.push(...a[2]),a[2]=r):a[2].push(...r);return}let o=[t,n,r];e.map.push(o),e.index.set(t,o)}var x$={tokenize:C$},S$={tokenize:w$};function C$(e){let t=this,n=[],r=0,i,a,o;return s;function s(i){if(r<n.length){let a=n[r];return t.containerState=a[1],e.attempt(a[0].continuation,c,l)(i)}return l(i)}function c(e){if(r++,t.containerState._closeFlow){t.containerState._closeFlow=void 0,i&&v();let n=t.events.length,a=n,o;for(;a--;)if(t.events[a][0]===`exit`&&t.events[a][1].type===`chunkFlow`){o=t.events[a][1].end;break}_(r);let s=n;for(;s<t.events.length;)t.events[s][1].end={...o},s++;let c=new y$;return c.add(a+1,0,t.events.slice(n)),c.add(n,s-n,[]),c.consume(t.events),l(e)}return s(e)}function l(a){if(r===n.length){if(!i)return f(a);if(i.currentConstruct&&i.currentConstruct.concrete)return m(a);t.interrupt=!(!i.currentConstruct||i._gfmTableDynamicInterruptHack)}return t.containerState={},e.check(S$,u,d)(a)}function u(e){return i&&v(),_(r),f(e)}function d(e){return t.parser.lazy[t.now().line]=r!==n.length,o=t.now().offset,m(e)}function f(n){return t.containerState={},e.attempt(S$,p,m)(n)}function p(e){return r++,n.push([t.currentConstruct,t.containerState]),f(e)}function m(n){if(n===null)i&&v(),_(0),e.consume(n);else return i||=t.parser.flow(t.now()),e.enter(`chunkFlow`,{_tokenizer:i,contentType:`flow`,previous:a}),h(n)}function h(n){if(n===null)g(e.exit(`chunkFlow`),!0),_(0),e.consume(n);else return c$(n)?(e.consume(n),g(e.exit(`chunkFlow`)),r=0,t.interrupt=void 0,s):(e.consume(n),h)}function g(e,n){let s=t.sliceStream(e);if(n&&s.push(null),e.previous=a,a&&(a.next=e),a=e,i.defineSkip(e.start),i.write(s),t.parser.lazy[e.start.line]){let e=i.events.length;for(;e--;)if(i.events[e][1].start.offset<o&&(!i.events[e][1].end||i.events[e][1].end.offset>o))return;let n=t.events.length,a=n,s,c;for(;a--;)if(t.events[a][0]===`exit`&&t.events[a][1].type===`chunkFlow`){if(s){c=t.events[a][1].end;break}s=!0}for(_(r),e=n;e<t.events.length;)t.events[e][1].end={...c},e++;let l=new y$;l.add(a+1,0,t.events.slice(n)),l.add(n,e-n,[]),l.consume(t.events)}}function _(r){let i=n.length;for(;i-->r;){let r=n[i];t.containerState=r[1],r[0].exit.call(t,e)}n.length=r}function v(){i.write([null]),a=void 0,i=void 0,t.containerState._closeFlow=void 0}}function w$(e,t,n){return h$(e,e.attempt(this.parser.constructs.document,t,n),`linePrefix`,this.parser.constructs.disable.null.includes(`codeIndented`)?void 0:4)}function T$(e){if(e===null||l$(e)||f$(e))return 1;if(d$(e))return 2}function E$(e,t,n){let r=[],i=-1;for(;++i<e.length;){let a=e[i].resolveAll;a&&!r.includes(a)&&(t=a(t,n),r.push(a))}return t}var D$={name:`attention`,resolveAll:O$,tokenize:k$};function O$(e,t){let n=-1,r;for(;++n<e.length;)if(e[n][0]===`enter`&&e[n][1].type===`attentionSequence`&&e[n][1]._close){let i=n;for(;i--;)if(e[i][0]===`exit`&&e[i][1].type===`attentionSequence`&&e[i][1]._open&&t.sliceSerialize(e[i][1]).charCodeAt(0)===t.sliceSerialize(e[n][1]).charCodeAt(0)){if((e[i][1]._close||e[n][1]._open)&&(e[n][1].end.offset-e[n][1].start.offset)%3&&!((e[i][1].end.offset-e[i][1].start.offset+e[n][1].end.offset-e[n][1].start.offset)%3))continue;let a=e[i][1].end.offset-e[i][1].start.offset>1&&e[n][1].end.offset-e[n][1].start.offset>1?2:1,o={...e[i][1].end},s={...e[n][1].start};A$(o,-a),A$(s,a);let c={type:a>1?`strongSequence`:`emphasisSequence`,start:o,end:{...e[i][1].end}},l={type:a>1?`strongSequence`:`emphasisSequence`,start:{...e[n][1].start},end:s},u={type:a>1?`strongText`:`emphasisText`,start:{...e[i][1].end},end:{...e[n][1].start}},d={type:a>1?`strong`:`emphasis`,start:{...c.start},end:{...l.end}};e[i][1].end={...c.start},e[n][1].start={...l.end},r=[],e[i][1].end.offset-e[i][1].start.offset&&(r=JQ(r,[[`enter`,e[i][1],t],[`exit`,e[i][1],t]])),r=JQ(r,[[`enter`,d,t],[`enter`,c,t],[`exit`,c,t],[`enter`,u,t]]),r=JQ(r,E$(t.parser.constructs.insideSpan.null,e.slice(i+1,n),t)),r=JQ(r,[[`exit`,u,t],[`enter`,l,t],[`exit`,l,t],[`exit`,d,t]]);let f=0;e[n][1].end.offset-e[n][1].start.offset&&(f=2,r=JQ(r,[[`enter`,e[n][1],t],[`exit`,e[n][1],t]])),qQ(e,i-1,n-i+3,r),n=i+r.length-f-2;break}}for(n=-1;++n<e.length;)e[n][1].type===`attentionSequence`&&(e[n][1].type=`data`);return e}function k$(e,t){let n=this.parser.constructs.attentionMarkers.null,r=this.previous,i=T$(r),a;return o;function o(t){return a=t,e.enter(`attentionSequence`),s(t)}function s(o){if(o===a)return e.consume(o),s;let c=e.exit(`attentionSequence`),l=T$(o),u=!l||l===2&&i||n.includes(o)&&o!==42&&o!==95,d=!i||i===2&&l||n.includes(r)&&r!==42&&r!==95;return c._open=!!(a===42?u:u&&(i||!d)),c._close=!!(a===42?d:d&&(l||!u)),t(o)}}function A$(e,t){e.column+=t,e.offset+=t,e._bufferIndex+=t}var j$={name:`autolink`,tokenize:M$};function M$(e,t,n){let r=0;return i;function i(t){return e.enter(`autolink`),e.enter(`autolinkMarker`),e.consume(t),e.exit(`autolinkMarker`),e.enter(`autolinkProtocol`),a}function a(t){return t$(t)?(e.consume(t),o):t===64?n(t):l(t)}function o(e){return e===43||e===45||e===46||n$(e)?(r=1,s(e)):l(e)}function s(t){return t===58?(e.consume(t),r=0,c):(t===43||t===45||t===46||n$(t))&&r++<32?(e.consume(t),s):(r=0,l(t))}function c(r){return r===62?(e.exit(`autolinkProtocol`),e.enter(`autolinkMarker`),e.consume(r),e.exit(`autolinkMarker`),e.exit(`autolink`),t):r===null||r===32||r===60||i$(r)?n(r):(e.consume(r),c)}function l(t){return t===64?(e.consume(t),u):r$(t)?(e.consume(t),l):n(t)}function u(e){return n$(e)?d(e):n(e)}function d(n){return n===46?(e.consume(n),r=0,u):n===62?(e.exit(`autolinkProtocol`).type=`autolinkEmail`,e.enter(`autolinkMarker`),e.consume(n),e.exit(`autolinkMarker`),e.exit(`autolink`),t):f(n)}function f(t){if((t===45||n$(t))&&r++<63){let n=t===45?f:d;return e.consume(t),n}return n(t)}}var N$={partial:!0,tokenize:P$};function P$(e,t,n){return r;function r(t){return u$(t)?h$(e,i,`linePrefix`)(t):i(t)}function i(e){return e===null||c$(e)?t(e):n(e)}}var F$={continuation:{tokenize:L$},exit:R$,name:`blockQuote`,tokenize:I$};function I$(e,t,n){let r=this;return i;function i(t){if(t===62){let n=r.containerState;return n.open||=(e.enter(`blockQuote`,{_container:!0}),!0),e.enter(`blockQuotePrefix`),e.enter(`blockQuoteMarker`),e.consume(t),e.exit(`blockQuoteMarker`),a}return n(t)}function a(n){return u$(n)?(e.enter(`blockQuotePrefixWhitespace`),e.consume(n),e.exit(`blockQuotePrefixWhitespace`),e.exit(`blockQuotePrefix`),t):(e.exit(`blockQuotePrefix`),t(n))}}function L$(e,t,n){let r=this;return i;function i(t){return u$(t)?h$(e,a,`linePrefix`,r.parser.constructs.disable.null.includes(`codeIndented`)?void 0:4)(t):a(t)}function a(r){return e.attempt(F$,t,n)(r)}}function R$(e){e.exit(`blockQuote`)}var z$={name:`characterEscape`,tokenize:B$};function B$(e,t,n){return r;function r(t){return e.enter(`characterEscape`),e.enter(`escapeMarker`),e.consume(t),e.exit(`escapeMarker`),i}function i(r){return s$(r)?(e.enter(`characterEscapeValue`),e.consume(r),e.exit(`characterEscapeValue`),e.exit(`characterEscape`),t):n(r)}}var V$={name:`characterReference`,tokenize:H$};function H$(e,t,n){let r=this,i=0,a,o;return s;function s(t){return e.enter(`characterReference`),e.enter(`characterReferenceMarker`),e.consume(t),e.exit(`characterReferenceMarker`),c}function c(t){return t===35?(e.enter(`characterReferenceMarkerNumeric`),e.consume(t),e.exit(`characterReferenceMarkerNumeric`),l):(e.enter(`characterReferenceValue`),a=31,o=n$,u(t))}function l(t){return t===88||t===120?(e.enter(`characterReferenceMarkerHexadecimal`),e.consume(t),e.exit(`characterReferenceMarkerHexadecimal`),e.enter(`characterReferenceValue`),a=6,o=o$,u):(e.enter(`characterReferenceValue`),a=7,o=a$,u(t))}function u(s){if(s===59&&i){let i=e.exit(`characterReferenceValue`);return o===n$&&!KQ(r.sliceSerialize(i))?n(s):(e.enter(`characterReferenceMarker`),e.consume(s),e.exit(`characterReferenceMarker`),e.exit(`characterReference`),t)}return o(s)&&i++<a?(e.consume(s),u):n(s)}}var U$={partial:!0,tokenize:W$};function W$(e,t,n){let r=this;return i;function i(t){return t===null?n(t):(e.enter(`lineEnding`),e.consume(t),e.exit(`lineEnding`),a)}function a(e){return r.parser.lazy[r.now().line]?n(e):t(e)}}var G$={concrete:!0,name:`codeFenced`,tokenize:K$};function K$(e,t,n){let r=this,i={partial:!0,tokenize:x},a=0,o=0,s;return c;function c(e){return l(e)}function l(t){let n=r.events[r.events.length-1];return a=n&&n[1].type===`linePrefix`?n[2].sliceSerialize(n[1],!0).length:0,s=t,e.enter(`codeFenced`),e.enter(`codeFencedFence`),e.enter(`codeFencedFenceSequence`),u(t)}function u(t){return t===s?(o++,e.consume(t),u):o<3?n(t):(e.exit(`codeFencedFenceSequence`),u$(t)?h$(e,d,`whitespace`)(t):d(t))}function d(n){return n===null||c$(n)?(e.exit(`codeFencedFence`),r.interrupt?t(n):e.check(U$,h,b)(n)):(e.enter(`codeFencedFenceInfo`),e.enter(`chunkString`,{contentType:`string`}),f(n))}function f(t){return t===null||c$(t)?(e.exit(`chunkString`),e.exit(`codeFencedFenceInfo`),d(t)):u$(t)?(e.exit(`chunkString`),e.exit(`codeFencedFenceInfo`),h$(e,p,`whitespace`)(t)):t===96&&t===s?n(t):(e.consume(t),f)}function p(t){return t===null||c$(t)?d(t):(e.enter(`codeFencedFenceMeta`),e.enter(`chunkString`,{contentType:`string`}),m(t))}function m(t){return t===null||c$(t)?(e.exit(`chunkString`),e.exit(`codeFencedFenceMeta`),d(t)):t===96&&t===s?n(t):(e.consume(t),m)}function h(t){return e.attempt(i,b,g)(t)}function g(t){return e.enter(`lineEnding`),e.consume(t),e.exit(`lineEnding`),_}function _(t){return a>0&&u$(t)?h$(e,v,`linePrefix`,a+1)(t):v(t)}function v(t){return t===null||c$(t)?e.check(U$,h,b)(t):(e.enter(`codeFlowValue`),y(t))}function y(t){return t===null||c$(t)?(e.exit(`codeFlowValue`),v(t)):(e.consume(t),y)}function b(n){return e.exit(`codeFenced`),t(n)}function x(e,t,n){let i=0;return a;function a(t){return e.enter(`lineEnding`),e.consume(t),e.exit(`lineEnding`),c}function c(t){return e.enter(`codeFencedFence`),u$(t)?h$(e,l,`linePrefix`,r.parser.constructs.disable.null.includes(`codeIndented`)?void 0:4)(t):l(t)}function l(t){return t===s?(e.enter(`codeFencedFenceSequence`),u(t)):n(t)}function u(t){return t===s?(i++,e.consume(t),u):i>=o?(e.exit(`codeFencedFenceSequence`),u$(t)?h$(e,d,`whitespace`)(t):d(t)):n(t)}function d(r){return r===null||c$(r)?(e.exit(`codeFencedFence`),t(r)):n(r)}}}var q$={name:`codeIndented`,tokenize:Y$},J$={partial:!0,tokenize:X$};function Y$(e,t,n){return r;function r(t){return e.enter(`codeIndented`),g$(e,i,n,`linePrefix`,4,4)(t)}function i(t){return t===null?o(t):c$(t)?e.attempt(J$,i,o)(t):(e.enter(`codeFlowValue`),a(t))}function a(t){return t===null||c$(t)?(e.exit(`codeFlowValue`),i(t)):(e.consume(t),a)}function o(n){return e.exit(`codeIndented`),t(n)}}function X$(e,t,n){let r=this;return i;function i(o){return r.parser.lazy[r.now().line]?n(o):c$(o)?(e.enter(`lineEnding`),e.consume(o),e.exit(`lineEnding`),i):g$(e,t,a,`linePrefix`,4,4)(o)}function a(e){return c$(e)?i(e):n(e)}}var Z$={name:`codeText`,previous:$$,resolve:Q$,tokenize:e1};function Q$(e){let t=e.length-4,n=3,r,i;if((e[n][1].type===`lineEnding`||e[n][1].type===`space`)&&(e[t][1].type===`lineEnding`||e[t][1].type===`space`)){for(r=n;++r<t;)if(e[r][1].type===`codeTextData`){e[n][1].type=`codeTextPadding`,e[t][1].type=`codeTextPadding`,n+=2,t-=2;break}}for(r=n-1,t++;++r<=t;)i===void 0?r!==t&&e[r][1].type!==`lineEnding`&&(i=r):(r===t||e[r][1].type===`lineEnding`)&&(e[i][1].type=`codeTextData`,r!==i+2&&(e[i][1].end=e[r-1][1].end,e.splice(i+2,r-i-2),t-=r-i-2,r=i+2),i=void 0);return e}function $$(e){return e!==96||this.events[this.events.length-1][1].type===`characterEscape`}function e1(e,t,n){let r=0,i,a;return o;function o(t){return e.enter(`codeText`),e.enter(`codeTextSequence`),s(t)}function s(t){return t===96?(e.consume(t),r++,s):(e.exit(`codeTextSequence`),c(t))}function c(t){return t===null?n(t):t===32?(e.enter(`space`),e.consume(t),e.exit(`space`),c):t===96?(a=e.enter(`codeTextSequence`),i=0,u(t)):c$(t)?(e.enter(`lineEnding`),e.consume(t),e.exit(`lineEnding`),c):(e.enter(`codeTextData`),l(t))}function l(t){return t===null||t===32||t===96||c$(t)?(e.exit(`codeTextData`),c(t)):(e.consume(t),l)}function u(n){return n===96?(e.consume(n),i++,u):i===r?(e.exit(`codeTextSequence`),e.exit(`codeText`),t(n)):(a.type=`codeTextData`,l(n))}}var t1=class{constructor(e){this.left=e?[...e]:[],this.right=[]}get(e){if(e<0||e>=this.left.length+this.right.length)throw RangeError("Cannot access index `"+e+"` in a splice buffer of size `"+(this.left.length+this.right.length)+"`");return e<this.left.length?this.left[e]:this.right[this.right.length-e+this.left.length-1]}get length(){return this.left.length+this.right.length}shift(){return this.setCursor(0),this.right.pop()}slice(e,t){let n=t??1/0;return n<this.left.length?this.left.slice(e,n):e>this.left.length?this.right.slice(this.right.length-n+this.left.length,this.right.length-e+this.left.length).reverse():this.left.slice(e).concat(this.right.slice(this.right.length-n+this.left.length).reverse())}splice(e,t,n){let r=t||0;this.setCursor(Math.trunc(e));let i=this.right.splice(this.right.length-r,1/0);return n&&n1(this.left,n),i.reverse()}pop(){return this.setCursor(1/0),this.left.pop()}push(e){this.setCursor(1/0),this.left.push(e)}pushMany(e){this.setCursor(1/0),n1(this.left,e)}unshift(e){this.setCursor(0),this.right.push(e)}unshiftMany(e){this.setCursor(0),n1(this.right,e.reverse())}setCursor(e){if(!(e===this.left.length||e>this.left.length&&this.right.length===0||e<0&&this.left.length===0)){if(e<this.left.length){let t=this.left.splice(e,1/0);n1(this.right,t.reverse())}else{let t=this.right.splice(this.left.length+this.right.length-e,1/0);n1(this.left,t.reverse())}}}};function n1(e,t){let n=0;if(t.length<1e4)e.push(...t);else for(;n<t.length;)e.push(...t.slice(n,n+1e4)),n+=1e4}function r1(e){let t={},n=-1,r,i,a,o,s,c,l,u=new t1(e);for(;++n<u.length;){for(;n in t;)n=t[n];if(r=u.get(n),n&&r[1].type===`chunkFlow`&&u.get(n-1)[1].type===`listItemPrefix`&&(c=r[1]._tokenizer.events,a=0,a<c.length&&c[a][1].type===`lineEndingBlank`&&(a+=2),a<c.length&&c[a][1].type===`content`))for(;++a<c.length&&c[a][1].type!==`content`;)c[a][1].type===`chunkText`&&(c[a][1]._isInFirstContentOfListItem=!0,a++);if(r[0]===`enter`)r[1].contentType&&(Object.assign(t,i1(u,n)),n=t[n],l=!0);else if(r[1]._container){for(a=n,i=void 0;a--;)if(o=u.get(a),o[1].type===`lineEnding`||o[1].type===`lineEndingBlank`)o[0]===`enter`&&(i&&(u.get(i)[1].type=`lineEndingBlank`),o[1].type=`lineEnding`,i=a);else if(o[1].type!==`linePrefix`&&o[1].type!==`listItemIndent`)break;i&&(r[1].end={...u.get(i)[1].start},s=u.slice(i,n),s.unshift(r),u.splice(i,n-i+1,s))}}return qQ(e,0,1/0,u.slice(0)),!l}function i1(e,t){let n=e.get(t)[1],r=e.get(t)[2],i=t-1,a=[],o=n._tokenizer;o||(o=r.parser[n.contentType](n.start),n._contentTypeTextTrailing&&(o._contentTypeTextTrailing=!0));let s=o.events,c=[],l={},u,d,f=-1,p=n,m=0,h=0,g=[h];for(;p;){for(;e.get(++i)[1]!==p;);a.push(i),p._tokenizer||(u=r.sliceStream(p),p.next||u.push(null),d&&o.defineSkip(p.start),p._isInFirstContentOfListItem&&(o._gfmTasklistFirstContentOfListItem=!0),o.write(u),p._isInFirstContentOfListItem&&(o._gfmTasklistFirstContentOfListItem=void 0)),d=p,p=p.next}for(p=n;++f<s.length;)s[f][0]===`exit`&&s[f-1][0]===`enter`&&s[f][1].type===s[f-1][1].type&&s[f][1].start.line!==s[f][1].end.line&&(h=f+1,g.push(h),p._tokenizer=void 0,p.previous=void 0,p=p.next);for(o.events=[],p?(p._tokenizer=void 0,p.previous=void 0):g.pop(),f=g.length;f--;){let t=s.slice(g[f],g[f+1]),n=a.pop();c.push([n,n+t.length-1]),e.splice(n,2,t)}for(c.reverse(),f=-1;++f<c.length;)l[m+c[f][0]]=m+c[f][1],m+=c[f][1]-c[f][0]-1;return l}var a1={resolve:s1,tokenize:c1},o1={partial:!0,tokenize:l1};function s1(e){return r1(e),e}function c1(e,t){let n;return r;function r(t){return e.enter(`content`),n=e.enter(`chunkContent`,{contentType:`content`}),i(t)}function i(t){return t===null?a(t):c$(t)?e.check(o1,o,a)(t):(e.consume(t),i)}function a(n){return e.exit(`chunkContent`),e.exit(`content`),t(n)}function o(t){return e.consume(t),e.exit(`chunkContent`),n.next=e.enter(`chunkContent`,{contentType:`content`,previous:n}),n=n.next,i}}function l1(e,t,n){let r=this;return i;function i(t){return e.exit(`chunkContent`),e.enter(`lineEnding`),e.consume(t),e.exit(`lineEnding`),h$(e,a,`linePrefix`)}function a(i){if(i===null||c$(i))return n(i);let a=r.events[r.events.length-1];return!r.parser.constructs.disable.null.includes(`codeIndented`)&&a&&a[1].type===`linePrefix`&&a[2].sliceSerialize(a[1],!0).length>=4?t(i):e.interrupt(r.parser.constructs.flow,n,t)(i)}}function u1(e,t,n,r,i,a,o,s,c){let l=c||1/0,u=0;return d;function d(t){return t===60?(e.enter(r),e.enter(i),e.enter(a),e.consume(t),e.exit(a),f):t===null||t===32||t===41||i$(t)?n(t):(e.enter(r),e.enter(o),e.enter(s),e.enter(`chunkString`,{contentType:`string`}),h(t))}function f(n){return n===62?(e.enter(a),e.consume(n),e.exit(a),e.exit(i),e.exit(r),t):(e.enter(s),e.enter(`chunkString`,{contentType:`string`}),p(n))}function p(t){return t===62?(e.exit(`chunkString`),e.exit(s),f(t)):t===null||t===60||c$(t)?n(t):(e.consume(t),t===92?m:p)}function m(t){return t===60||t===62||t===92?(e.consume(t),p):p(t)}function h(i){return!u&&(i===null||i===41||l$(i))?(e.exit(`chunkString`),e.exit(s),e.exit(o),e.exit(r),t(i)):u<l&&i===40?(e.consume(i),u++,h):i===41?(e.consume(i),u--,h):i===null||i===32||i===40||i$(i)?n(i):(e.consume(i),i===92?g:h)}function g(t){return t===40||t===41||t===92?(e.consume(t),h):h(t)}}function d1(e,t,n,r,i,a){let o=this,s=0,c;return l;function l(t){return e.enter(r),e.enter(i),e.consume(t),e.exit(i),e.enter(a),u}function u(l){return s>999||l===null||l===91||l===93&&!c||l===94&&!s&&`_hiddenFootnoteSupport`in o.parser.constructs?n(l):l===93?(e.exit(a),e.enter(i),e.consume(l),e.exit(i),e.exit(r),t):c$(l)?(e.enter(`lineEnding`),e.consume(l),e.exit(`lineEnding`),u):(e.enter(`chunkString`,{contentType:`string`}),d(l))}function d(t){return t===null||t===91||t===93||c$(t)||s++>999?(e.exit(`chunkString`),u(t)):(e.consume(t),c||=!u$(t),t===92?f:d)}function f(t){return t===91||t===92||t===93?(e.consume(t),s++,d):d(t)}}function f1(e,t,n,r,i,a){let o;return s;function s(t){return t===34||t===39||t===40?(e.enter(r),e.enter(i),e.consume(t),e.exit(i),o=t===40?41:t,c):n(t)}function c(n){return n===o?(e.enter(i),e.consume(n),e.exit(i),e.exit(r),t):(e.enter(a),l(n))}function l(t){return t===o?(e.exit(a),c(o)):t===null?n(t):c$(t)?(e.enter(`lineEnding`),e.consume(t),e.exit(`lineEnding`),h$(e,l,`linePrefix`)):(e.enter(`chunkString`,{contentType:`string`}),u(t))}function u(t){return t===o||t===null||c$(t)?(e.exit(`chunkString`),l(t)):(e.consume(t),t===92?d:u)}function d(t){return t===o||t===92?(e.consume(t),u):u(t)}}function p1(e,t){let n;return r;function r(i){return c$(i)?(e.enter(`lineEnding`),e.consume(i),e.exit(`lineEnding`),n=!0,r):u$(i)?h$(e,r,n?`linePrefix`:`lineSuffix`)(i):t(i)}}var m1={name:`definition`,tokenize:g1},h1={partial:!0,tokenize:_1};function g1(e,t,n){let r=this,i;return a;function a(t){return e.enter(`definition`),o(t)}function o(t){return d1.call(r,e,s,n,`definitionLabel`,`definitionLabelMarker`,`definitionLabelString`)(t)}function s(t){return i=e$(r.sliceSerialize(r.events[r.events.length-1][1]).slice(1,-1)),t===58?(e.enter(`definitionMarker`),e.consume(t),e.exit(`definitionMarker`),c):n(t)}function c(t){return l$(t)?p1(e,l)(t):l(t)}function l(t){return u1(e,u,n,`definitionDestination`,`definitionDestinationLiteral`,`definitionDestinationLiteralMarker`,`definitionDestinationRaw`,`definitionDestinationString`)(t)}function u(t){return e.attempt(h1,d,d)(t)}function d(t){return u$(t)?h$(e,f,`whitespace`)(t):f(t)}function f(a){return a===null||c$(a)?(e.exit(`definition`),r.parser.defined.push(i),t(a)):n(a)}}function _1(e,t,n){return r;function r(t){return l$(t)?p1(e,i)(t):n(t)}function i(t){return f1(e,a,n,`definitionTitle`,`definitionTitleMarker`,`definitionTitleString`)(t)}function a(t){return u$(t)?h$(e,o,`whitespace`)(t):o(t)}function o(e){return e===null||c$(e)?t(e):n(e)}}var v1={name:`hardBreakEscape`,tokenize:y1};function y1(e,t,n){return r;function r(t){return e.enter(`hardBreakEscape`),e.consume(t),i}function i(r){return c$(r)?(e.exit(`hardBreakEscape`),t(r)):n(r)}}var b1={name:`headingAtx`,resolve:x1,tokenize:S1};function x1(e,t){let n=e.length-2,r=3;if(e[r][1].type===`whitespace`&&(r+=2),n-2>r&&e[n][1].type===`whitespace`&&(n-=2),e[n][1].type===`atxHeadingSequence`&&(r===n-1||n-4>r&&e[n-2][1].type===`whitespace`)&&(n-=r+1===n?2:4),n>r){let i={type:`atxHeadingText`,start:e[r][1].start,end:e[n][1].end},a={type:`chunkText`,start:e[r][1].start,end:e[n][1].end,contentType:`text`};qQ(e,r,n-r+1,[[`enter`,i,t],[`enter`,a,t],[`exit`,a,t],[`exit`,i,t]])}return e}function S1(e,t,n){let r=0;return i;function i(t){return e.enter(`atxHeading`),a(t)}function a(t){return e.enter(`atxHeadingSequence`),o(t)}function o(t){return t===35&&r++<6?(e.consume(t),o):t===null||l$(t)?(e.exit(`atxHeadingSequence`),s(t)):n(t)}function s(n){return n===35?(e.enter(`atxHeadingSequence`),c(n)):n===null||c$(n)?(e.exit(`atxHeading`),t(n)):u$(n)?h$(e,s,`whitespace`)(n):(e.enter(`atxHeadingText`),l(n))}function c(t){return t===35?(e.consume(t),c):(e.exit(`atxHeadingSequence`),s(t))}function l(t){return t===null||t===35||l$(t)?(e.exit(`atxHeadingText`),s(t)):(e.consume(t),l)}}var C1=`address.article.aside.base.basefont.blockquote.body.caption.center.col.colgroup.dd.details.dialog.dir.div.dl.dt.fieldset.figcaption.figure.footer.form.frame.frameset.h1.h2.h3.h4.h5.h6.head.header.hr.html.iframe.legend.li.link.main.menu.menuitem.nav.noframes.ol.optgroup.option.p.param.search.section.summary.table.tbody.td.tfoot.th.thead.title.tr.track.ul`.split(`.`),w1=[`pre`,`script`,`style`,`textarea`],T1={concrete:!0,name:`htmlFlow`,resolveTo:D1,tokenize:O1},E1={partial:!0,tokenize:k1};function D1(e){let t=e.length;for(;t--&&(e[t][0]!==`enter`||e[t][1].type!==`htmlFlow`););return t>1&&e[t-2][1].type===`linePrefix`&&(e[t][1].start=e[t-2][1].start,e[t+1][1].start=e[t-2][1].start,e.splice(t-2,2)),e}function O1(e,t,n){let r=this,i,a,o,s,c;return l;function l(e){return u(e)}function u(t){return e.enter(`htmlFlow`),e.enter(`htmlFlowData`),e.consume(t),d}function d(s){return s===33?(e.consume(s),f):s===47?(e.consume(s),a=!0,h):s===63?(e.consume(s),i=3,r.interrupt?t:I):t$(s)?(e.consume(s),o=String.fromCharCode(s),g):n(s)}function f(a){return a===45?(e.consume(a),i=2,p):a===91?(e.consume(a),i=5,s=0,m):t$(a)?(e.consume(a),i=4,r.interrupt?t:I):n(a)}function p(i){return i===45?(e.consume(i),r.interrupt?t:I):n(i)}function m(i){return i===`CDATA[`.charCodeAt(s++)?(e.consume(i),s===6?r.interrupt?t:O:m):n(i)}function h(t){return t$(t)?(e.consume(t),o=String.fromCharCode(t),g):n(t)}function g(s){if(s===null||s===47||s===62||l$(s)){let c=s===47,l=o.toLowerCase();return!c&&!a&&w1.includes(l)?(i=1,r.interrupt?t(s):O(s)):C1.includes(o.toLowerCase())?(i=6,c?(e.consume(s),_):r.interrupt?t(s):O(s)):(i=7,r.interrupt&&!r.parser.lazy[r.now().line]?n(s):a?v(s):y(s))}return s===45||n$(s)?(e.consume(s),o+=String.fromCharCode(s),g):n(s)}function _(i){return i===62?(e.consume(i),r.interrupt?t:O):n(i)}function v(t){return u$(t)?(e.consume(t),v):E(t)}function y(t){return t===47?(e.consume(t),E):t===58||t===95||t$(t)?(e.consume(t),b):u$(t)?(e.consume(t),y):E(t)}function b(t){return t===45||t===46||t===58||t===95||n$(t)?(e.consume(t),b):x(t)}function x(t){return t===61?(e.consume(t),S):u$(t)?(e.consume(t),x):y(t)}function S(t){return t===null||t===60||t===61||t===62||t===96?n(t):t===34||t===39?(e.consume(t),c=t,C):u$(t)?(e.consume(t),S):w(t)}function C(t){return t===c?(e.consume(t),c=null,T):t===null||c$(t)?n(t):(e.consume(t),C)}function w(t){return t===null||t===34||t===39||t===47||t===60||t===61||t===62||t===96||l$(t)?x(t):(e.consume(t),w)}function T(e){return e===47||e===62||u$(e)?y(e):n(e)}function E(t){return t===62?(e.consume(t),D):n(t)}function D(t){return t===null||c$(t)?O(t):u$(t)?(e.consume(t),D):n(t)}function O(t){return t===45&&i===2?(e.consume(t),M):t===60&&i===1?(e.consume(t),N):t===62&&i===4?(e.consume(t),L):t===63&&i===3?(e.consume(t),I):t===93&&i===5?(e.consume(t),F):c$(t)&&(i===6||i===7)?(e.exit(`htmlFlowData`),e.check(E1,R,k)(t)):t===null||c$(t)?(e.exit(`htmlFlowData`),k(t)):(e.consume(t),O)}function k(t){return e.check(U$,A,R)(t)}function A(t){return e.enter(`lineEnding`),e.consume(t),e.exit(`lineEnding`),j}function j(t){return t===null||c$(t)?k(t):(e.enter(`htmlFlowData`),O(t))}function M(t){return t===45?(e.consume(t),I):O(t)}function N(t){return t===47?(e.consume(t),o=``,P):O(t)}function P(t){if(t===62){let n=o.toLowerCase();return w1.includes(n)?(e.consume(t),L):O(t)}return t$(t)&&o.length<8?(e.consume(t),o+=String.fromCharCode(t),P):O(t)}function F(t){return t===93?(e.consume(t),I):O(t)}function I(t){return t===62?(e.consume(t),L):t===45&&i===2?(e.consume(t),I):O(t)}function L(t){return t===null||c$(t)?(e.exit(`htmlFlowData`),R(t)):(e.consume(t),L)}function R(n){return e.exit(`htmlFlow`),t(n)}}function k1(e,t,n){return r;function r(r){return e.enter(`lineEnding`),e.consume(r),e.exit(`lineEnding`),e.attempt(N$,t,n)}}var A1={name:`htmlText`,tokenize:j1};function j1(e,t,n){let r=this,i,a,o;return s;function s(t){return e.enter(`htmlText`),e.enter(`htmlTextData`),e.consume(t),c}function c(t){return t===33?(e.consume(t),l):t===47?(e.consume(t),x):t===63?(e.consume(t),y):t$(t)?(e.consume(t),w):n(t)}function l(t){return t===45?(e.consume(t),u):t===91?(e.consume(t),a=0,m):t$(t)?(e.consume(t),v):n(t)}function u(t){return t===45?(e.consume(t),p):n(t)}function d(t){return t===null?n(t):t===45?(e.consume(t),f):c$(t)?(o=d,N(t)):(e.consume(t),d)}function f(t){return t===45?(e.consume(t),p):d(t)}function p(e){return e===62?M(e):e===45?f(e):d(e)}function m(t){return t===`CDATA[`.charCodeAt(a++)?(e.consume(t),a===6?h:m):n(t)}function h(t){return t===null?n(t):t===93?(e.consume(t),g):c$(t)?(o=h,N(t)):(e.consume(t),h)}function g(t){return t===93?(e.consume(t),_):h(t)}function _(t){return t===62?M(t):t===93?(e.consume(t),_):h(t)}function v(t){return t===null||t===62?M(t):c$(t)?(o=v,N(t)):(e.consume(t),v)}function y(t){return t===null?n(t):t===63?(e.consume(t),b):c$(t)?(o=y,N(t)):(e.consume(t),y)}function b(e){return e===62?M(e):y(e)}function x(t){return t$(t)?(e.consume(t),S):n(t)}function S(t){return t===45||n$(t)?(e.consume(t),S):C(t)}function C(t){return c$(t)?(o=C,N(t)):u$(t)?(e.consume(t),C):M(t)}function w(t){return t===45||n$(t)?(e.consume(t),w):t===47||t===62||l$(t)?T(t):n(t)}function T(t){return t===47?(e.consume(t),M):t===58||t===95||t$(t)?(e.consume(t),E):c$(t)?(o=T,N(t)):u$(t)?(e.consume(t),T):M(t)}function E(t){return t===45||t===46||t===58||t===95||n$(t)?(e.consume(t),E):D(t)}function D(t){return t===61?(e.consume(t),O):c$(t)?(o=D,N(t)):u$(t)?(e.consume(t),D):T(t)}function O(t){return t===null||t===60||t===61||t===62||t===96?n(t):t===34||t===39?(e.consume(t),i=t,k):c$(t)?(o=O,N(t)):u$(t)?(e.consume(t),O):(e.consume(t),A)}function k(t){return t===i?(e.consume(t),i=void 0,j):t===null?n(t):c$(t)?(o=k,N(t)):(e.consume(t),k)}function A(t){return t===null||t===34||t===39||t===60||t===61||t===96?n(t):t===47||t===62||l$(t)?T(t):(e.consume(t),A)}function j(e){return e===47||e===62||l$(e)?T(e):n(e)}function M(r){return r===62?(e.consume(r),e.exit(`htmlTextData`),e.exit(`htmlText`),t):n(r)}function N(t){return e.exit(`htmlTextData`),e.enter(`lineEnding`),e.consume(t),e.exit(`lineEnding`),P}function P(t){return u$(t)?h$(e,F,`linePrefix`,r.parser.constructs.disable.null.includes(`codeIndented`)?void 0:4)(t):F(t)}function F(t){return e.enter(`htmlTextData`),o(t)}}var M1={name:`labelEnd`,resolveAll:I1,resolveTo:L1,tokenize:R1},N1={tokenize:z1},P1={tokenize:B1},F1={tokenize:V1};function I1(e){let t=-1,n=[];for(;++t<e.length;){let r=e[t][1];if(n.push(e[t]),r.type===`labelImage`||r.type===`labelLink`||r.type===`labelEnd`){let e=r.type===`labelImage`?4:2;r.type=`data`,t+=e}}return e.length!==n.length&&qQ(e,0,e.length,n),e}function L1(e,t){let n=e.length,r=0,i,a,o;for(;n--;){let t=e[n][1];if(i){if(t.type===`link`||t.type===`labelLink`&&t._inactive)break;e[n][0]===`enter`&&t.type===`labelLink`&&(t._inactive=!0)}else if(a){if(e[n][0]===`enter`&&(t.type===`labelImage`||t.type===`labelLink`)&&!t._balanced&&(i=n,t.type!==`labelLink`)){r=2;break}}else t.type===`labelEnd`&&(a=n)}let s={type:e[i][1].type===`labelLink`?`link`:`image`,start:{...e[i][1].start},end:{...e[e.length-1][1].end}},c={type:`label`,start:{...e[i][1].start},end:{...e[a][1].end}},l={type:`labelText`,start:{...e[i+r+2][1].end},end:{...e[a-2][1].start}};return o=[[`enter`,s,t],[`enter`,c,t]],o=JQ(o,e.slice(i+1,i+r+3)),o=JQ(o,[[`enter`,l,t]]),o=JQ(o,E$(t.parser.constructs.insideSpan.null,e.slice(i+r+4,a-3),t)),o=JQ(o,[[`exit`,l,t],e[a-2],e[a-1],[`exit`,c,t]]),o=JQ(o,e.slice(a+1)),o=JQ(o,[[`exit`,s,t]]),qQ(e,i,e.length,o),e}function R1(e,t,n){let r=this,i=r._labelStarts,a,o;if(i){for(;i.length>0&&i[i.length-1]._balanced;)i.pop();a=i[i.length-1]}return s;function s(t){return a?a._inactive?d(t):(o=r.parser.defined.includes(e$(r.sliceSerialize({start:a.end,end:r.now()}))),e.enter(`labelEnd`),e.enter(`labelMarker`),e.consume(t),e.exit(`labelMarker`),e.exit(`labelEnd`),c):n(t)}function c(t){return t===40?e.attempt(N1,u,o?u:d)(t):t===91?e.attempt(P1,u,o?l:d)(t):o?u(t):d(t)}function l(t){return e.attempt(F1,u,d)(t)}function u(e){return i.pop(),t(e)}function d(e){return a._balanced=!0,n(e)}}function z1(e,t,n){return r;function r(t){return e.enter(`resource`),e.enter(`resourceMarker`),e.consume(t),e.exit(`resourceMarker`),i}function i(t){return l$(t)?p1(e,a)(t):a(t)}function a(t){return t===41?u(t):u1(e,o,s,`resourceDestination`,`resourceDestinationLiteral`,`resourceDestinationLiteralMarker`,`resourceDestinationRaw`,`resourceDestinationString`,32)(t)}function o(t){return l$(t)?p1(e,c)(t):u(t)}function s(e){return n(e)}function c(t){return t===34||t===39||t===40?f1(e,l,n,`resourceTitle`,`resourceTitleMarker`,`resourceTitleString`)(t):u(t)}function l(t){return l$(t)?p1(e,u)(t):u(t)}function u(r){return r===41?(e.enter(`resourceMarker`),e.consume(r),e.exit(`resourceMarker`),e.exit(`resource`),t):n(r)}}function B1(e,t,n){let r=this;return i;function i(t){return d1.call(r,e,a,o,`reference`,`referenceMarker`,`referenceString`)(t)}function a(e){return r.parser.defined.includes(e$(r.sliceSerialize(r.events[r.events.length-1][1]).slice(1,-1)))?t(e):n(e)}function o(e){return n(e)}}function V1(e,t,n){return r;function r(t){return e.enter(`reference`),e.enter(`referenceMarker`),e.consume(t),e.exit(`referenceMarker`),i}function i(r){return r===93?(e.enter(`referenceMarker`),e.consume(r),e.exit(`referenceMarker`),e.exit(`reference`),t):n(r)}}var H1={name:`labelStartImage`,resolveAll:M1.resolveAll,tokenize:U1};function U1(e,t,n){let r=this,i;return a;function a(t){return e.enter(`labelImage`),e.enter(`labelImageMarker`),e.consume(t),e.exit(`labelImageMarker`),o}function o(t){return t===91?(e.enter(`labelMarker`),e.consume(t),e.exit(`labelMarker`),i=e.exit(`labelImage`),s):n(t)}function s(e){return e===94&&`_hiddenFootnoteSupport`in r.parser.constructs?n(e):(r._labelStarts=r._labelStarts||[],r._labelStarts.push(i),t(e))}}var W1={name:`labelStartLink`,resolveAll:M1.resolveAll,tokenize:G1};function G1(e,t,n){let r=this,i;return a;function a(t){return e.enter(`labelLink`),e.enter(`labelMarker`),e.consume(t),e.exit(`labelMarker`),i=e.exit(`labelLink`),o}function o(e){return e===94&&`_hiddenFootnoteSupport`in r.parser.constructs?n(e):(r._labelStarts=r._labelStarts||[],r._labelStarts.push(i),t(e))}}var K1={name:`lineEnding`,tokenize:q1};function q1(e,t){return n;function n(n){return e.enter(`lineEnding`),e.consume(n),e.exit(`lineEnding`),h$(e,t,`linePrefix`)}}var J1={name:`thematicBreak`,tokenize:Y1};function Y1(e,t,n){let r=0,i;return a;function a(t){return e.enter(`thematicBreak`),o(t)}function o(e){return i=e,s(e)}function s(a){return a===i?(e.enter(`thematicBreakSequence`),c(a)):r>=3&&(a===null||c$(a))?(e.exit(`thematicBreak`),t(a)):n(a)}function c(t){return t===i?(e.consume(t),r++,c):(e.exit(`thematicBreakSequence`),u$(t)?h$(e,s,`whitespace`)(t):s(t))}}var X1={continuation:{tokenize:e0},exit:n0,name:`list`,tokenize:$1},Z1={partial:!0,tokenize:r0},Q1={partial:!0,tokenize:t0};function $1(e,t,n){let r=this,i=r.events[r.events.length-1],a=i&&i[1].type===`linePrefix`?i[2].sliceSerialize(i[1],!0).length:0,o=0;return s;function s(t){let i=r.containerState.type||(t===42||t===43||t===45?`listUnordered`:`listOrdered`);if(i===`listUnordered`?!r.containerState.marker||t===r.containerState.marker:a$(t)){if(r.containerState.type||(r.containerState.type=i,e.enter(i,{_container:!0})),i===`listUnordered`)return e.enter(`listItemPrefix`),t===42||t===45?e.check(J1,n,l)(t):l(t);if(!r.interrupt||t===49)return e.enter(`listItemPrefix`),e.enter(`listItemValue`),c(t)}return n(t)}function c(t){return a$(t)&&++o<10?(e.consume(t),c):(!r.interrupt||o<2)&&(r.containerState.marker?t===r.containerState.marker:t===41||t===46)?(e.exit(`listItemValue`),l(t)):n(t)}function l(t){return e.enter(`listItemMarker`),e.consume(t),e.exit(`listItemMarker`),r.containerState.marker=r.containerState.marker||t,e.check(N$,r.interrupt?n:u,e.attempt(Z1,f,d))}function u(e){return r.containerState.initialBlankLine=!0,a++,f(e)}function d(t){return u$(t)?(e.enter(`listItemPrefixWhitespace`),e.consume(t),e.exit(`listItemPrefixWhitespace`),f):n(t)}function f(n){return r.containerState.size=a+r.sliceSerialize(e.exit(`listItemPrefix`),!0).length,t(n)}}function e0(e,t,n){let r=this;return r.containerState._closeFlow=void 0,e.check(N$,i,a);function i(n){return r.containerState.furtherBlankLines=r.containerState.furtherBlankLines||r.containerState.initialBlankLine,h$(e,t,`listItemIndent`,r.containerState.size+1)(n)}function a(n){return r.containerState.furtherBlankLines||!u$(n)?(r.containerState.furtherBlankLines=void 0,r.containerState.initialBlankLine=void 0,o(n)):(r.containerState.furtherBlankLines=void 0,r.containerState.initialBlankLine=void 0,e.attempt(Q1,t,o)(n))}function o(i){return r.containerState._closeFlow=!0,r.interrupt=void 0,h$(e,e.attempt(X1,t,n),`linePrefix`,r.parser.constructs.disable.null.includes(`codeIndented`)?void 0:4)(i)}}function t0(e,t,n){let r=this;return h$(e,i,`listItemIndent`,r.containerState.size+1);function i(e){let i=r.events[r.events.length-1];return i&&i[1].type===`listItemIndent`&&i[2].sliceSerialize(i[1],!0).length===r.containerState.size?t(e):n(e)}}function n0(e){e.exit(this.containerState.type)}function r0(e,t,n){let r=this;return h$(e,i,`listItemPrefixWhitespace`,r.parser.constructs.disable.null.includes(`codeIndented`)?void 0:5);function i(e){let i=r.events[r.events.length-1];return!u$(e)&&i&&i[1].type===`listItemPrefixWhitespace`?t(e):n(e)}}var i0={name:`setextUnderline`,resolveTo:a0,tokenize:o0};function a0(e,t){let n=new y$,r=e.length,i,a,o;for(;r--;)if(e[r][0]===`enter`){if(e[r][1].type===`content`){i=r;break}e[r][1].type===`paragraph`&&(a=r)}else e[r][1].type===`content`&&n.add(r,1,[]),!o&&e[r][1].type===`definition`&&(o=r);let s={type:`setextHeading`,start:{...e[i][1].start},end:{...e[e.length-1][1].end}};return e[a][1].type=`setextHeadingText`,o?(n.add(a,0,[[`enter`,s,t]]),n.add(o+1,0,[[`exit`,e[i][1],t]]),e[i][1].end={...e[o][1].end}):e[i][1]=s,n.add(e.length,0,[[`exit`,s,t]]),n.consume(e),e}function o0(e,t,n){let r=this,i;return a;function a(t){let a=r.events.length,s;for(;a--;)if(r.events[a][1].type!==`lineEnding`&&r.events[a][1].type!==`linePrefix`&&r.events[a][1].type!==`content`){s=r.events[a][1].type===`paragraph`;break}return!r.parser.lazy[r.now().line]&&(r.interrupt||s)?(e.enter(`setextHeadingLine`),i=t,o(t)):n(t)}function o(t){return e.enter(`setextHeadingLineSequence`),s(t)}function s(t){return t===i?(e.consume(t),s):(e.exit(`setextHeadingLineSequence`),u$(t)?h$(e,c,`lineSuffix`)(t):c(t))}function c(r){return r===null||c$(r)?(e.exit(`setextHeadingLine`),t(r)):n(r)}}var s0={tokenize:c0};function c0(e){let t=this,n=e.attempt(N$,r,e.attempt(this.parser.constructs.flowInitial,i,h$(e,e.attempt(this.parser.constructs.flow,i,e.attempt(a1,i)),`linePrefix`)));return n;function r(r){if(r===null)e.consume(r);else return e.enter(`lineEndingBlank`),e.consume(r),e.exit(`lineEndingBlank`),t.currentConstruct=void 0,n}function i(r){if(r===null)e.consume(r);else return e.enter(`lineEnding`),e.consume(r),e.exit(`lineEnding`),t.currentConstruct=void 0,n}}var l0={resolveAll:p0()},u0=f0(`string`),d0=f0(`text`);function f0(e){return{resolveAll:p0(e===`text`?m0:void 0),tokenize:t};function t(t){let n=this,r=this.parser.constructs[e],i=t.attempt(r,a,o);return a;function a(e){return c(e)?i(e):o(e)}function o(e){if(e===null)t.consume(e);else return t.enter(`data`),t.consume(e),s}function s(e){return c(e)?(t.exit(`data`),i(e)):(t.consume(e),s)}function c(e){if(e===null)return!0;let t=r[e],i=-1;if(t)for(;++i<t.length;){let e=t[i];if(!e.previous||e.previous.call(n,n.previous))return!0}return!1}}}function p0(e){return t;function t(t,n){let r=-1,i;for(;++r<=t.length;)i===void 0?t[r]&&t[r][1].type===`data`&&(i=r,r++):(!t[r]||t[r][1].type!==`data`)&&(r!==i+2&&(t[i][1].end=t[r-1][1].end,t.splice(i+2,r-i-2),r=i+2),i=void 0);return e?e(t,n):t}}function m0(e,t){let n=new y$,r=0;for(;++r<=e.length;)if((r===e.length||e[r][1].type===`lineEnding`)&&e[r-1][1].type===`data`){let i=e[r-1][1],a=t.sliceStream(i),o=a.length,s=-1,c=0,l;for(;o--;){let e=a[o];if(typeof e==`string`){for(s=e.length;e.charCodeAt(s-1)===32;)c++,s--;if(s)break;s=-1}else if(e===-2)l=!0,c++;else if(e!==-1){o++;break}}if(t._contentTypeTextTrailing&&r===e.length&&(c=0),c){let a={type:r===e.length||l||c<2?`lineSuffix`:`hardBreakTrailing`,start:{_bufferIndex:o?s:i.start._bufferIndex+s,_index:i.start._index+o,line:i.end.line,column:i.end.column-c,offset:i.end.offset-c},end:{...i.end}};i.end={...a.start},i.start.offset===i.end.offset?Object.assign(i,a):n.add(r,0,[[`enter`,a,t],[`exit`,a,t]])}r++}return n.consume(e),e}var h0=s({attentionMarkers:()=>C0,contentInitial:()=>_0,disable:()=>w0,document:()=>g0,flow:()=>y0,flowInitial:()=>v0,insideSpan:()=>S0,string:()=>b0,text:()=>x0}),g0={42:X1,43:X1,45:X1,48:X1,49:X1,50:X1,51:X1,52:X1,53:X1,54:X1,55:X1,56:X1,57:X1,62:F$},_0={91:m1},v0={[-2]:q$,[-1]:q$,32:q$},y0={35:b1,42:J1,45:[i0,J1],60:T1,61:i0,95:J1,96:G$,126:G$},b0={38:V$,92:z$},x0={[-5]:K1,[-4]:K1,[-3]:K1,33:H1,38:V$,42:D$,60:[j$,A1],91:W1,92:[v1,z$],93:M1,95:D$,96:Z$},S0={null:[D$,l0]},C0={null:[42,95]},w0={null:[]};function T0(e,t,n){let r={_bufferIndex:-1,_index:0,line:n&&n.line||1,column:n&&n.column||1,offset:n&&n.offset||0},i={},a=[],o=[],s=[],c={attempt:C(x),check:C(S),consume:v,enter:y,exit:b,interrupt:C(S,{interrupt:!0})},l={code:null,containerState:{},defineSkip:h,events:[],now:m,parser:e,previous:null,sliceSerialize:f,sliceStream:p,write:d},u=t.tokenize.call(l,c);return t.resolveAll&&a.push(t),l;function d(e){return o=JQ(o,e),g(),o[o.length-1]===null?(w(t,0),l.events=E$(a,l.events,l),l.events):[]}function f(e,t){return D0(p(e),t)}function p(e){return E0(o,e)}function m(){let{_bufferIndex:e,_index:t,line:n,column:i,offset:a}=r;return{_bufferIndex:e,_index:t,line:n,column:i,offset:a}}function h(e){i[e.line]=e.column,E()}function g(){for(;r._index<o.length;){let e=o[r._index];if(typeof e==`string`){let t=r._index;for(r._bufferIndex<0&&(r._bufferIndex=0);r._index===t&&r._bufferIndex<e.length;)_(e.charCodeAt(r._bufferIndex))}else _(e)}}function _(e){u=u(e)}function v(e){c$(e)?(r.line++,r.column=1,r.offset+=e===-3?2:1,E()):e!==-1&&(r.column++,r.offset++),r._bufferIndex<0?r._index++:(r._bufferIndex++,r._bufferIndex===o[r._index].length&&(r._bufferIndex=-1,r._index++)),l.previous=e}function y(e,t){let n=t||{};return n.type=e,n.start=m(),l.events.push([`enter`,n,l]),s.push(n),n}function b(e){let t=s.pop();return t.end=m(),l.events.push([`exit`,t,l]),t}function x(e,t){w(e,t.from)}function S(e,t){t.restore()}function C(e,t){return n;function n(n,r,i){let a,o,s,u;return Array.isArray(n)?f(n):`tokenize`in n?f([n]):d(n);function d(e){return t;function t(t){let n=t!==null&&e[t],r=t!==null&&e.null;return f([...Array.isArray(n)?n:n?[n]:[],...Array.isArray(r)?r:r?[r]:[]])(t)}}function f(e){return a=e,o=0,e.length===0?i:p(e[o])}function p(e){return n;function n(n){return u=T(),s=e,e.partial||(l.currentConstruct=e),e.name&&l.parser.constructs.disable.null.includes(e.name)?h(n):e.tokenize.call(t?Object.assign(Object.create(l),t):l,c,m,h)(n)}}function m(t){return e(s,u),r}function h(e){return u.restore(),++o<a.length?p(a[o]):i}}}function w(e,t){e.resolveAll&&!a.includes(e)&&a.push(e),e.resolve&&qQ(l.events,t,l.events.length-t,e.resolve(l.events.slice(t),l)),e.resolveTo&&(l.events=e.resolveTo(l.events,l))}function T(){let e=m(),t=l.previous,n=l.currentConstruct,i=l.events.length,a=Array.from(s);return{from:i,restore:o};function o(){r=e,l.previous=t,l.currentConstruct=n,l.events.length=i,s=a,E()}}function E(){r.line in i&&r.column<2&&(r.column=i[r.line],r.offset+=i[r.line]-1)}}function E0(e,t){let n=t.start._index,r=t.start._bufferIndex,i=t.end._index,a=t.end._bufferIndex,o;if(n===i)o=[e[n].slice(r,a)];else{if(o=e.slice(n,i),r>-1){let e=o[0];typeof e==`string`?o[0]=e.slice(r):o.shift()}a>0&&o.push(e[i].slice(0,a))}return o}function D0(e,t){let n=-1,r=[],i;for(;++n<e.length;){let a=e[n],o;if(typeof a==`string`)o=a;else switch(a){case-5:o=`\r`;break;case-4:o=`
|
|
119
|
-
`;break;case-3:o=`\r
|
|
120
|
-
`;break;case-2:o=t?` `:` `;break;case-1:if(!t&&i)continue;o=` `;break;default:o=String.fromCharCode(a)}i=a===-2,r.push(o)}return r.join(``)}function O0(e){let t={constructs:XQ([h0,...(e||{}).extensions||[]]),content:n(_$),defined:[],document:n(x$),flow:n(s0),lazy:{},string:n(u0),text:n(d0)};return t;function n(e){return n;function n(n){return T0(t,e,n)}}}function k0(e){for(;!r1(e););return e}var A0=/[\0\t\n\r]/g;function j0(){let e=1,t=``,n=!0,r;return i;function i(i,a,o){i=t+(typeof i==`string`?i.toString():new TextDecoder(a||void 0).decode(i));let s=[],c=0;for(t=``,n&&=(i.charCodeAt(0)===65279&&c++,void 0);c<i.length;){A0.lastIndex=c;let n=A0.exec(i),a=n&&n.index!==void 0?n.index:i.length,o=i.charCodeAt(a);if(!n){t=i.slice(c);break}if(o===10&&c===a&&r)s.push(-3),r=void 0;else switch(r&&=(s.push(-5),void 0),c<a&&(s.push(i.slice(c,a)),e+=a-c),o){case 0:s.push(65533),e++;break;case 9:{let t=Math.ceil(e/4)*4;for(s.push(-2);e++<t;)s.push(-1);break}case 10:s.push(-4),e=1;break;default:r=!0,e=1}c=a+1}return o&&(r&&s.push(-5),t&&s.push(t),s.push(null)),s}}var M0=/\\([!-/:-@[-`{-~])|&(#(?:\d{1,7}|x[\da-f]{1,6})|[\da-z]{1,31});/gi;function N0(e){return e.replace(M0,P0)}function P0(e,t,n){if(t)return t;if(n.charCodeAt(0)===35){let e=n.charCodeAt(1),t=e===120||e===88;return $Q(n.slice(t?2:1),t?16:10)}return KQ(n)||e}var F0={}.hasOwnProperty;function I0(e,t,n){return t&&typeof t==`object`&&(n=t,t=void 0),L0(n)(k0(O0(n).document().write(j0()(e,t,!0))))}function L0(e){let t={afterExit:[],beforeEnter:[],transforms:[],canContainEols:[`emphasis`,`fragment`,`heading`,`paragraph`,`strong`],enter:{autolink:o(me),autolinkProtocol:E,autolinkEmail:E,atxHeading:o(de),blockQuote:o(se),characterEscape:E,characterReference:E,codeFenced:o(ce),codeFencedFenceInfo:s,codeFencedFenceMeta:s,codeIndented:o(ce,s),codeText:o(B,s),codeTextData:E,data:E,codeFlowValue:E,definition:o(le),definitionDestinationString:s,definitionLabelString:s,definitionTitleString:s,emphasis:o(ue),hardBreakEscape:o(V),hardBreakTrailing:o(V),htmlFlow:o(fe,s),htmlFlowData:E,htmlText:o(fe,s),htmlTextData:E,image:o(pe),label:s,link:o(me),listItem:o(ge),listItemValue:p,listOrdered:o(he,f),listUnordered:o(he),paragraph:o(_e),reference:ee,referenceString:s,resourceDestinationString:s,resourceTitleString:s,setextHeading:o(de),strong:o(ve),thematicBreak:o(be)},exit:{atxHeading:l(),atxHeadingSequence:S,autolink:l(),autolinkEmail:oe,autolinkProtocol:ae,blockQuote:l(),characterEscapeValue:D,characterReferenceMarkerHexadecimal:ne,characterReferenceMarkerNumeric:ne,characterReferenceValue:re,characterReference:ie,codeFenced:l(_),codeFencedFence:g,codeFencedFenceInfo:m,codeFencedFenceMeta:h,codeFlowValue:D,codeIndented:l(v),codeText:l(M),codeTextData:D,data:D,definition:l(),definitionDestinationString:x,definitionLabelString:y,definitionTitleString:b,emphasis:l(),hardBreakEscape:l(k),hardBreakTrailing:l(k),htmlFlow:l(A),htmlFlowData:D,htmlText:l(j),htmlTextData:D,image:l(P),label:I,labelText:F,lineEnding:O,link:l(N),listItem:l(),listOrdered:l(),listUnordered:l(),paragraph:l(),referenceString:te,resourceDestinationString:L,resourceTitleString:R,resource:z,setextHeading:l(T),setextHeadingLineSequence:w,setextHeadingText:C,strong:l(),thematicBreak:l()}};z0(t,(e||{}).mdastExtensions||[]);let n={};return r;function r(e){let r={type:`root`,children:[],position:void 0},o={stack:[r],tokenStack:[],config:t,enter:c,exit:u,buffer:s,resume:d,data:n},l=[],f=[],p=-1;for(;++p<e.length;)f.push(e[p]),(e[p][1].type===`listOrdered`||e[p][1].type===`listUnordered`)&&(e[p][0]===`enter`?l.push(f.length-1):a(f,l.pop()));for(e=f,p=-1;++p<e.length;){let n=t[e[p][0]];e[p][0]===`enter`&&t.beforeEnter.length>0&&i(t.beforeEnter,{...o,sliceSerialize:e[p][2].sliceSerialize},e[p][1]),F0.call(n,e[p][1].type)&&n[e[p][1].type].call({...o,sliceSerialize:e[p][2].sliceSerialize},e[p][1]),e[p][0]===`exit`&&t.afterExit.length>0&&i(t.afterExit,{...o,sliceSerialize:e[p][2].sliceSerialize},e[p][1])}if(o.tokenStack.length>0){let e=o.tokenStack[o.tokenStack.length-1];(e[1]||V0).call(o,void 0,e[0])}for(r.position={start:R0(e.length>0?e[0][1].start:{line:1,column:1,offset:0}),end:R0(e.length>0?e[e.length-2][1].end:{line:1,column:1,offset:0})},p=-1;++p<t.transforms.length;)r=t.transforms[p](r)||r;return r}function i(e,t,n){let r=-1;for(;++r<e.length;)e[r].call(t,n)}function a(e,t){let n=e.length-1,r=t-1,i=-1,a=!1,o,s,c,l,u=[];for(;++r<=n;){let t=e[r];switch(t[1].type){case`listUnordered`:case`listOrdered`:case`blockQuote`:t[0]===`enter`?i++:i--,l=void 0;break;case`lineEndingBlank`:t[0]===`enter`&&(o&&!l&&!i&&!c&&(c=r),l=void 0);break;case`linePrefix`:case`listItemValue`:case`listItemMarker`:case`listItemPrefix`:case`listItemPrefixWhitespace`:break;default:l=void 0}if(!i&&t[0]===`enter`&&t[1].type===`listItemPrefix`||i===-1&&t[0]===`exit`&&(t[1].type===`listUnordered`||t[1].type===`listOrdered`)){if(o){let n=r;for(s=void 0;n--;){let t=e[n];if(t[1].type===`lineEnding`||t[1].type===`lineEndingBlank`){if(t[0]===`exit`)continue;s&&(e[s][1].type=`lineEndingBlank`,a=!0),t[1].type=`lineEnding`,s=n}else if(t[1].type!==`linePrefix`&&t[1].type!==`blockQuotePrefix`&&t[1].type!==`blockQuotePrefixWhitespace`&&t[1].type!==`blockQuoteMarker`&&t[1].type!==`listItemIndent`)break}c&&(!s||c<s)&&(o._spread=!0),o.end=Object.assign({},s?e[s][1].start:t[1].end),u.push({at:s||r,event:[`exit`,o,t[2]]})}if(t[1].type===`listItemPrefix`){let e={type:`listItem`,_spread:!1,start:Object.assign({},t[1].start),end:void 0};o=e,u.push({at:r,event:[`enter`,e,t[2]]}),c=void 0,l=!0}}}let d=e.splice(t),f=0;for(r=-1;++r<d.length;){for(;f<u.length&&u[f].at===t+r;)e.push(u[f++].event);e.push(d[r])}e[t][1]._spread=a}function o(e,t){return n;function n(n){c.call(this,e(n),n),t&&t.call(this,n)}}function s(){this.stack.push({type:`fragment`,children:[]})}function c(e,t,n){this.stack[this.stack.length-1].children.push(e),this.stack.push(e),this.tokenStack.push([t,n||void 0]),e.position={start:R0(t.start),end:void 0}}function l(e){return t;function t(t){e&&e.call(this,t),u.call(this,t)}}function u(e,t){let n=this.stack.pop(),r=this.tokenStack.pop();if(!r)throw Error("Cannot close `"+e.type+"` ("+aQ({start:e.start,end:e.end})+`): it’s not open`);r[0].type!==e.type&&(t?t.call(this,e,r[0]):(r[1]||V0).call(this,e,r[0])),n.position.end=R0(e.end)}function d(){return VQ(this.stack.pop())}function f(){this.data.expectingFirstListItemValue=!0}function p(e){if(this.data.expectingFirstListItemValue){let t=this.stack[this.stack.length-2];t.start=Number.parseInt(this.sliceSerialize(e),10),this.data.expectingFirstListItemValue=void 0}}function m(){let e=this.resume(),t=this.stack[this.stack.length-1];t.lang=e}function h(){let e=this.resume(),t=this.stack[this.stack.length-1];t.meta=e}function g(){this.data.flowCodeInside||(this.buffer(),this.data.flowCodeInside=!0)}function _(){let e=this.resume(),t=this.stack[this.stack.length-1];t.value=e.replace(/^(\r?\n|\r)|(\r?\n|\r)$/g,``),this.data.flowCodeInside=void 0}function v(){let e=this.resume(),t=this.stack[this.stack.length-1];t.value=e.replace(/(\r?\n|\r)$/g,``)}function y(e){let t=this.resume(),n=this.stack[this.stack.length-1];n.label=t,n.identifier=e$(this.sliceSerialize(e)).toLowerCase()}function b(){let e=this.resume(),t=this.stack[this.stack.length-1];t.title=e}function x(){let e=this.resume(),t=this.stack[this.stack.length-1];t.url=e}function S(e){let t=this.stack[this.stack.length-1];t.depth||=this.sliceSerialize(e).length}function C(){this.data.setextHeadingSlurpLineEnding=!0}function w(e){let t=this.stack[this.stack.length-1];t.depth=this.sliceSerialize(e).codePointAt(0)===61?1:2}function T(){this.data.setextHeadingSlurpLineEnding=void 0}function E(e){let t=this.stack[this.stack.length-1].children,n=t[t.length-1];(!n||n.type!==`text`)&&(n=ye(),n.position={start:R0(e.start),end:void 0},t.push(n)),this.stack.push(n)}function D(e){let t=this.stack.pop();t.value+=this.sliceSerialize(e),t.position.end=R0(e.end)}function O(e){let n=this.stack[this.stack.length-1];if(this.data.atHardBreak){let t=n.children[n.children.length-1];t.position.end=R0(e.end),this.data.atHardBreak=void 0}else!this.data.setextHeadingSlurpLineEnding&&t.canContainEols.includes(n.type)&&(E.call(this,e),D.call(this,e))}function k(){this.data.atHardBreak=!0}function A(){let e=this.resume(),t=this.stack[this.stack.length-1];t.value=e}function j(){let e=this.resume(),t=this.stack[this.stack.length-1];t.value=e}function M(){let e=this.resume(),t=this.stack[this.stack.length-1];t.value=e}function N(){let e=this.stack[this.stack.length-1];if(this.data.inReference){let t=this.data.referenceType||`shortcut`;e.type+=`Reference`,e.referenceType=t,delete e.url,delete e.title}else delete e.identifier,delete e.label;this.data.referenceType=void 0}function P(){let e=this.stack[this.stack.length-1];if(this.data.inReference){let t=this.data.referenceType||`shortcut`;e.type+=`Reference`,e.referenceType=t,delete e.url,delete e.title}else delete e.identifier,delete e.label;this.data.referenceType=void 0}function F(e){let t=this.sliceSerialize(e),n=this.stack[this.stack.length-2];n.label=N0(t),n.identifier=e$(t).toLowerCase()}function I(){let e=this.stack[this.stack.length-1],t=this.resume(),n=this.stack[this.stack.length-1];this.data.inReference=!0,n.type===`link`?n.children=e.children:n.alt=t}function L(){let e=this.resume(),t=this.stack[this.stack.length-1];t.url=e}function R(){let e=this.resume(),t=this.stack[this.stack.length-1];t.title=e}function z(){this.data.inReference=void 0}function ee(){this.data.referenceType=`collapsed`}function te(e){let t=this.resume(),n=this.stack[this.stack.length-1];n.label=t,n.identifier=e$(this.sliceSerialize(e)).toLowerCase(),this.data.referenceType=`full`}function ne(e){this.data.characterReferenceType=e.type}function re(e){let t=this.sliceSerialize(e),n=this.data.characterReferenceType,r;n?(r=$Q(t,n===`characterReferenceMarkerNumeric`?10:16),this.data.characterReferenceType=void 0):r=KQ(t);let i=this.stack[this.stack.length-1];i.value+=r}function ie(e){let t=this.stack.pop();t.position.end=R0(e.end)}function ae(e){D.call(this,e);let t=this.stack[this.stack.length-1];t.url=this.sliceSerialize(e)}function oe(e){D.call(this,e);let t=this.stack[this.stack.length-1];t.url=`mailto:`+this.sliceSerialize(e)}function se(){return{type:`blockquote`,children:[],position:void 0}}function ce(){return{type:`code`,lang:null,meta:null,value:``,position:void 0}}function B(){return{type:`inlineCode`,value:``,position:void 0}}function le(){return{type:`definition`,identifier:``,label:null,title:null,url:``,position:void 0}}function ue(){return{type:`emphasis`,children:[],position:void 0}}function de(){return{type:`heading`,depth:0,children:[],position:void 0}}function V(){return{type:`break`,position:void 0}}function fe(){return{type:`html`,value:``,position:void 0}}function pe(){return{type:`image`,title:null,url:``,alt:null,position:void 0}}function me(){return{type:`link`,title:null,url:``,children:[],position:void 0}}function he(e){return{type:`list`,ordered:e.type===`listOrdered`,start:null,spread:e._spread,children:[],position:void 0}}function ge(e){return{type:`listItem`,spread:e._spread,checked:null,children:[],position:void 0}}function _e(){return{type:`paragraph`,children:[],position:void 0}}function ve(){return{type:`strong`,children:[],position:void 0}}function ye(){return{type:`text`,value:``,position:void 0}}function be(){return{type:`thematicBreak`,position:void 0}}}function R0(e){return{line:e.line,column:e.column,offset:e.offset}}function z0(e,t){let n=-1;for(;++n<t.length;){let r=t[n];Array.isArray(r)?z0(e,r):B0(e,r)}}function B0(e,t){let n;for(n in t)if(F0.call(t,n))switch(n){case`canContainEols`:{let r=t[n];r&&e[n].push(...r);break}case`transforms`:{let r=t[n];r&&e[n].push(...r);break}case`afterExit`:case`beforeEnter`:{let r=t[n];r&&e[n].push(r);break}case`enter`:case`exit`:{let r=t[n];r&&Object.assign(e[n],r);break}}}function V0(e,t){throw Error(e?"Cannot close `"+e.type+"` ("+aQ({start:e.start,end:e.end})+"): a different token (`"+t.type+"`, "+aQ({start:t.start,end:t.end})+`) is open`:"Cannot close document, a token (`"+t.type+"`, "+aQ({start:t.start,end:t.end})+`) is still open`)}function H0(e){let t=this;t.parser=n;function n(n){return I0(n,{...t.data(`settings`),...e,extensions:t.data(`micromarkExtensions`)||[],mdastExtensions:t.data(`fromMarkdownExtensions`)||[]})}}function U0(e,t){let n={type:`element`,tagName:`blockquote`,properties:{},children:e.wrap(e.all(t),!0)};return e.patch(t,n),e.applyData(t,n)}function W0(e,t){let n={type:`element`,tagName:`br`,properties:{},children:[]};return e.patch(t,n),[e.applyData(t,n),{type:`text`,value:`
|
|
121
|
-
`}]}function G0(e,t){let n=t.value?t.value+`
|
|
122
|
-
`:``,r={},i=t.lang?t.lang.split(/\s+/):[];i.length>0&&(r.className=[`language-`+i[0]]);let a={type:`element`,tagName:`code`,properties:r,children:[{type:`text`,value:n}]};return t.meta&&(a.data={meta:t.meta}),e.patch(t,a),a=e.applyData(t,a),a={type:`element`,tagName:`pre`,properties:{},children:[a]},e.patch(t,a),a}function K0(e,t){let n={type:`element`,tagName:`del`,properties:{},children:e.all(t)};return e.patch(t,n),e.applyData(t,n)}function q0(e,t){let n={type:`element`,tagName:`em`,properties:{},children:e.all(t)};return e.patch(t,n),e.applyData(t,n)}function J0(e,t){let n=typeof e.options.clobberPrefix==`string`?e.options.clobberPrefix:`user-content-`,r=String(t.identifier).toUpperCase(),i=m$(r.toLowerCase()),a=e.footnoteOrder.indexOf(r),o,s=e.footnoteCounts.get(r);s===void 0?(s=0,e.footnoteOrder.push(r),o=e.footnoteOrder.length):o=a+1,s+=1,e.footnoteCounts.set(r,s);let c={type:`element`,tagName:`a`,properties:{href:`#`+n+`fn-`+i,id:n+`fnref-`+i+(s>1?`-`+s:``),dataFootnoteRef:!0,ariaDescribedBy:[`footnote-label`]},children:[{type:`text`,value:String(o)}]};e.patch(t,c);let l={type:`element`,tagName:`sup`,properties:{},children:[c]};return e.patch(t,l),e.applyData(t,l)}function Y0(e,t){let n={type:`element`,tagName:`h`+t.depth,properties:{},children:e.all(t)};return e.patch(t,n),e.applyData(t,n)}function X0(e,t){if(e.options.allowDangerousHtml){let n={type:`raw`,value:t.value};return e.patch(t,n),e.applyData(t,n)}}function Z0(e,t){let n=t.referenceType,r=`]`;if(n===`collapsed`?r+=`[]`:n===`full`&&(r+=`[`+(t.label||t.identifier)+`]`),t.type===`imageReference`)return[{type:`text`,value:`![`+t.alt+r}];let i=e.all(t),a=i[0];a&&a.type===`text`?a.value=`[`+a.value:i.unshift({type:`text`,value:`[`});let o=i[i.length-1];return o&&o.type===`text`?o.value+=r:i.push({type:`text`,value:r}),i}function Q0(e,t){let n=String(t.identifier).toUpperCase(),r=e.definitionById.get(n);if(!r)return Z0(e,t);let i={src:m$(r.url||``),alt:t.alt};r.title!==null&&r.title!==void 0&&(i.title=r.title);let a={type:`element`,tagName:`img`,properties:i,children:[]};return e.patch(t,a),e.applyData(t,a)}function $0(e,t){let n={src:m$(t.url)};t.alt!==null&&t.alt!==void 0&&(n.alt=t.alt),t.title!==null&&t.title!==void 0&&(n.title=t.title);let r={type:`element`,tagName:`img`,properties:n,children:[]};return e.patch(t,r),e.applyData(t,r)}function e2(e,t){let n={type:`text`,value:t.value.replace(/\r?\n|\r/g,` `)};e.patch(t,n);let r={type:`element`,tagName:`code`,properties:{},children:[n]};return e.patch(t,r),e.applyData(t,r)}function t2(e,t){let n=String(t.identifier).toUpperCase(),r=e.definitionById.get(n);if(!r)return Z0(e,t);let i={href:m$(r.url||``)};r.title!==null&&r.title!==void 0&&(i.title=r.title);let a={type:`element`,tagName:`a`,properties:i,children:e.all(t)};return e.patch(t,a),e.applyData(t,a)}function n2(e,t){let n={href:m$(t.url)};t.title!==null&&t.title!==void 0&&(n.title=t.title);let r={type:`element`,tagName:`a`,properties:n,children:e.all(t)};return e.patch(t,r),e.applyData(t,r)}function Toe(e,t,n){let r=e.all(t),i=n?r2(n):i2(t),a={},o=[];if(typeof t.checked==`boolean`){let e=r[0],n;e&&e.type===`element`&&e.tagName===`p`?n=e:(n={type:`element`,tagName:`p`,properties:{},children:[]},r.unshift(n)),n.children.length>0&&n.children.unshift({type:`text`,value:` `}),n.children.unshift({type:`element`,tagName:`input`,properties:{type:`checkbox`,checked:t.checked,disabled:!0},children:[]}),a.className=[`task-list-item`]}let s=-1;for(;++s<r.length;){let e=r[s];(i||s!==0||e.type!==`element`||e.tagName!==`p`)&&o.push({type:`text`,value:`
|
|
123
|
-
`}),e.type===`element`&&e.tagName===`p`&&!i?o.push(...e.children):o.push(e)}let c=r[r.length-1];c&&(i||c.type!==`element`||c.tagName!==`p`)&&o.push({type:`text`,value:`
|
|
124
|
-
`});let l={type:`element`,tagName:`li`,properties:a,children:o};return e.patch(t,l),e.applyData(t,l)}function r2(e){let t=!1;if(e.type===`list`){t=e.spread||!1;let n=e.children,r=-1;for(;!t&&++r<n.length;)t=i2(n[r])}return t}function i2(e){return e.spread??e.children.length>1}function a2(e,t){let n={},r=e.all(t),i=-1;for(typeof t.start==`number`&&t.start!==1&&(n.start=t.start);++i<r.length;){let e=r[i];if(e.type===`element`&&e.tagName===`li`&&e.properties&&Array.isArray(e.properties.className)&&e.properties.className.includes(`task-list-item`)){n.className=[`contains-task-list`];break}}let a={type:`element`,tagName:t.ordered?`ol`:`ul`,properties:n,children:e.wrap(r,!0)};return e.patch(t,a),e.applyData(t,a)}function o2(e,t){let n={type:`element`,tagName:`p`,properties:{},children:e.all(t)};return e.patch(t,n),e.applyData(t,n)}function s2(e,t){let n={type:`root`,children:e.wrap(e.all(t))};return e.patch(t,n),e.applyData(t,n)}function c2(e,t){let n={type:`element`,tagName:`strong`,properties:{},children:e.all(t)};return e.patch(t,n),e.applyData(t,n)}function l2(e,t){let n=e.all(t),r=n.shift(),i=[];if(r){let n={type:`element`,tagName:`thead`,properties:{},children:e.wrap([r],!0)};e.patch(t.children[0],n),i.push(n)}if(n.length>0){let r={type:`element`,tagName:`tbody`,properties:{},children:e.wrap(n,!0)},a=nQ(t.children[1]),o=tQ(t.children[t.children.length-1]);a&&o&&(r.position={start:a,end:o}),i.push(r)}let a={type:`element`,tagName:`table`,properties:{},children:e.wrap(i,!0)};return e.patch(t,a),e.applyData(t,a)}function u2(e,t,n){let r=n?n.children:void 0,i=(r?r.indexOf(t):1)===0?`th`:`td`,a=n&&n.type===`table`?n.align:void 0,o=a?a.length:t.children.length,s=-1,c=[];for(;++s<o;){let n=t.children[s],r={},o=a?a[s]:void 0;o&&(r.align=o);let l={type:`element`,tagName:i,properties:r,children:[]};n&&(l.children=e.all(n),e.patch(n,l),l=e.applyData(n,l)),c.push(l)}let l={type:`element`,tagName:`tr`,properties:{},children:e.wrap(c,!0)};return e.patch(t,l),e.applyData(t,l)}function d2(e,t){let n={type:`element`,tagName:`td`,properties:{},children:e.all(t)};return e.patch(t,n),e.applyData(t,n)}var f2=9,p2=32;function m2(e){let t=String(e),n=/\r?\n|\r/g,r=n.exec(t),i=0,a=[];for(;r;)a.push(h2(t.slice(i,r.index),i>0,!0),r[0]),i=r.index+r[0].length,r=n.exec(t);return a.push(h2(t.slice(i),i>0,!1)),a.join(``)}function h2(e,t,n){let r=0,i=e.length;if(t){let t=e.codePointAt(r);for(;t===f2||t===p2;)r++,t=e.codePointAt(r)}if(n){let t=e.codePointAt(i-1);for(;t===f2||t===p2;)i--,t=e.codePointAt(i-1)}return i>r?e.slice(r,i):``}function g2(e,t){let n={type:`text`,value:m2(String(t.value))};return e.patch(t,n),e.applyData(t,n)}function _2(e,t){let n={type:`element`,tagName:`hr`,properties:{},children:[]};return e.patch(t,n),e.applyData(t,n)}var v2={blockquote:U0,break:W0,code:G0,delete:K0,emphasis:q0,footnoteReference:J0,heading:Y0,html:X0,imageReference:Q0,image:$0,inlineCode:e2,linkReference:t2,link:n2,listItem:Toe,list:a2,paragraph:o2,root:s2,strong:c2,table:l2,tableCell:d2,tableRow:u2,text:g2,thematicBreak:_2,toml:y2,yaml:y2,definition:y2,footnoteDefinition:y2};function y2(){}var{defineProperty:b2}=Object,x2=typeof self==`object`?self:globalThis,S2=(e,t)=>{switch(e){case`Function`:case`SharedWorker`:case`Worker`:case`eval`:case`setInterval`:case`setTimeout`:throw TypeError(`unable to deserialize `+e)}return new x2[e](t)},C2=(e,t)=>{let n=(t,n)=>(e.set(n,t),t),r=i=>{if(e.has(i))return e.get(i);let[a,o]=t[i];switch(a){case 0:case-1:return n(o,i);case 1:{let e=n([],i);for(let t of o)e.push(r(t));return e}case 2:{let e=n({},i);for(let[t,n]of o){let i=r(t),a=r(n);i===`__proto__`?b2(e,i,{value:a,configurable:!0,enumerable:!0,writable:!0}):e[i]=a}return e}case 3:return n(new Date(o),i);case 4:{let{source:e,flags:t}=o;return n(new RegExp(e,t),i)}case 5:{let e=n(new Map,i);for(let[t,n]of o)e.set(r(t),r(n));return e}case 6:{let e=n(new Set,i);for(let t of o)e.add(r(t));return e}case 7:{let{name:e,message:t}=o;return n(typeof x2[e]==`function`?S2(e,t):Error(t),i)}case 8:return n(BigInt(o),i);case`BigInt`:return n(Object(BigInt(o)),i);case`ArrayBuffer`:return n(new Uint8Array(o).buffer,o);case`DataView`:{let{buffer:e}=new Uint8Array(o);return n(new DataView(e),o)}case`-0`:return-0}return n(S2(a,o),i)};return r},w2=e=>C2(new Map,e)(0),T2=``,{toString:E2}={},{keys:D2,is:O2}=Object,k2=e=>{let t=typeof e;if(t!==`object`||!e)return[0,t];let n=E2.call(e).slice(8,-1);switch(n){case`Array`:return[1,T2];case`Object`:return[2,T2];case`Date`:return[3,T2];case`RegExp`:return[4,T2];case`Map`:return[5,T2];case`Set`:return[6,T2];case`DataView`:return[1,n]}return n.includes(`Array`)?[1,n]:e instanceof Error?[7,e.name||`Error`]:[2,n]},A2=([e,t])=>e===0&&(t===`function`||t===`symbol`),j2=(e,t,n,r)=>{let i=(e,t)=>{let i=r.push(e)-1;return n.set(t,i),i},a=o=>{if(n.has(o))return n.get(o);let[s,c]=k2(o);switch(s){case 0:{let t=o;switch(c){case`bigint`:s=8,t=o.toString();break;case`number`:if(!o&&O2(o,-0))return r.push([`-0`])-1;break;case`function`:case`symbol`:if(e)throw TypeError(`unable to serialize `+c);t=null;break;case`undefined`:return i([-1],o)}return i([s,t],o)}case 1:{if(c){let e=o;return c===`DataView`?e=new Uint8Array(o.buffer):c===`ArrayBuffer`&&(e=new Uint8Array(o)),i([c,[...e]],o)}let e=[],t=i([s,e],o);for(let t of o)e.push(a(t));return t}case 2:{if(c)switch(c){case`BigInt`:return i([c,o.toString()],o);case`Boolean`:case`Number`:case`String`:return i([c,o.valueOf()],o)}if(t&&`toJSON`in o)return a(o.toJSON());let n=[],r=i([s,n],o);for(let t of D2(o))(e||!A2(k2(o[t])))&&n.push([a(t),a(o[t])]);return r}case 3:return i([s,isNaN(o.getTime())?T2:o.toISOString()],o);case 4:{let{source:e,flags:t}=o;return i([s,{source:e,flags:t}],o)}case 5:{let t=[],n=i([s,t],o);for(let[n,r]of o)(e||!(A2(k2(n))||A2(k2(r))))&&t.push([a(n),a(r)]);return n}case 6:{let t=[],n=i([s,t],o);for(let n of o)(e||!A2(k2(n)))&&t.push(a(n));return n}}let{message:l}=o;return i([s,{name:c,message:l}],o)};return a},M2=(e,{json:t,lossy:n}={})=>{let r=[];return j2(!(t||n),!!t,new Map,r)(e),r},N2=typeof structuredClone==`function`?(e,t)=>t&&(`json`in t||`lossy`in t)?w2(M2(e,t)):structuredClone(e):(e,t)=>w2(M2(e,t));function P2(e,t){let n=[{type:`text`,value:`↩`}];return t>1&&n.push({type:`element`,tagName:`sup`,properties:{},children:[{type:`text`,value:String(t)}]}),n}function F2(e,t){return`Back to reference `+(e+1)+(t>1?`-`+t:``)}function I2(e){let t=typeof e.options.clobberPrefix==`string`?e.options.clobberPrefix:`user-content-`,n=e.options.footnoteBackContent||P2,r=e.options.footnoteBackLabel||F2,i=e.options.footnoteLabel||`Footnotes`,a=e.options.footnoteLabelTagName||`h2`,o=e.options.footnoteLabelProperties||{className:[`sr-only`]},s=[],c=-1;for(;++c<e.footnoteOrder.length;){let i=e.footnoteById.get(e.footnoteOrder[c]);if(!i)continue;let a=e.all(i),o=String(i.identifier).toUpperCase(),l=m$(o.toLowerCase()),u=0,d=[],f=e.footnoteCounts.get(o);for(;f!==void 0&&++u<=f;){d.length>0&&d.push({type:`text`,value:` `});let e=typeof n==`string`?n:n(c,u);typeof e==`string`&&(e={type:`text`,value:e}),d.push({type:`element`,tagName:`a`,properties:{href:`#`+t+`fnref-`+l+(u>1?`-`+u:``),dataFootnoteBackref:``,ariaLabel:typeof r==`string`?r:r(c,u),className:[`data-footnote-backref`]},children:Array.isArray(e)?e:[e]})}let p=a[a.length-1];if(p&&p.type===`element`&&p.tagName===`p`){let e=p.children[p.children.length-1];e&&e.type===`text`?e.value+=` `:p.children.push({type:`text`,value:` `}),p.children.push(...d)}else a.push(...d);let m={type:`element`,tagName:`li`,properties:{id:t+`fn-`+l},children:e.wrap(a,!0)};e.patch(i,m),s.push(m)}if(s.length!==0)return{type:`element`,tagName:`section`,properties:{dataFootnotes:!0,className:[`footnotes`]},children:[{type:`element`,tagName:a,properties:{...N2(o),id:`footnote-label`},children:[{type:`text`,value:i}]},{type:`text`,value:`
|
|
125
|
-
`},{type:`element`,tagName:`ol`,properties:{},children:e.wrap(s,!0)},{type:`text`,value:`
|
|
126
|
-
`}]}}var L2=(function(e){if(e==null)return H2;if(typeof e==`function`)return V2(e);if(typeof e==`object`)return Array.isArray(e)?R2(e):z2(e);if(typeof e==`string`)return B2(e);throw Error(`Expected function, string, or object as test`)});function R2(e){let t=[],n=-1;for(;++n<e.length;)t[n]=L2(e[n]);return V2(r);function r(...e){let n=-1;for(;++n<t.length;)if(t[n].apply(this,e))return!0;return!1}}function z2(e){let t=e;return V2(n);function n(n){let r=n,i;for(i in e)if(r[i]!==t[i])return!1;return!0}}function B2(e){return V2(t);function t(t){return t&&t.type===e}}function V2(e){return t;function t(t,n,r){return!!(U2(t)&&e.call(this,t,typeof n==`number`?n:void 0,r||void 0))}}function H2(){return!0}function U2(e){return typeof e==`object`&&!!e&&`type`in e}function W2(e){return e}var G2=[];function K2(e,t,n,r){let i;typeof t==`function`&&typeof n!=`function`?(r=n,n=t):i=t;let a=L2(i),o=r?-1:1;s(e,void 0,[])();function s(e,i,c){let l=e&&typeof e==`object`?e:{};if(typeof l.type==`string`){let t=typeof l.tagName==`string`?l.tagName:typeof l.name==`string`?l.name:void 0;Object.defineProperty(u,"name",{value:`node (`+W2(e.type+(t?`<`+t+`>`:``))+`)`})}return u;function u(){let l=G2,u,d,f;if((!t||a(e,i,c[c.length-1]||void 0))&&(l=q2(n(e,c)),l[0]===!1))return l;if(`children`in e&&e.children){let t=e;if(t.children&&l[0]!==`skip`)for(d=(r?t.children.length:-1)+o,f=c.concat(t);d>-1&&d<t.children.length;){let e=t.children[d];if(u=s(e,d,f)(),u[0]===!1)return u;d=typeof u[1]==`number`?u[1]:d+o}}return l}}}function q2(e){return Array.isArray(e)?e:typeof e==`number`?[!0,e]:e==null?G2:[e]}function J2(e,t,n,r){let i,a,o;typeof t==`function`&&typeof n!=`function`?(a=void 0,o=t,i=n):(a=t,o=n,i=r),K2(e,a,s,i);function s(e,t){let n=t[t.length-1],r=n?n.children.indexOf(e):void 0;return o(e,r,n)}}var Y2={}.hasOwnProperty,X2={};function Z2(e,t){let n=t||X2,r=new Map,i=new Map,a={all:s,applyData:$2,definitionById:r,footnoteById:i,footnoteCounts:new Map,footnoteOrder:[],handlers:{...v2,...n.handlers},one:o,options:n,patch:Q2,wrap:t4};return J2(e,function(e){if(e.type===`definition`||e.type===`footnoteDefinition`){let t=e.type===`definition`?r:i,n=String(e.identifier).toUpperCase();t.has(n)||t.set(n,e)}}),a;function o(e,t){let n=e.type,r=a.handlers[n];if(Y2.call(a.handlers,n)&&r)return r(a,e,t);if(a.options.passThrough&&a.options.passThrough.includes(n)){if(`children`in e){let{children:t,...n}=e,r=N2(n);return r.children=a.all(e),r}return N2(e)}return(a.options.unknownHandler||e4)(a,e,t)}function s(e){let t=[];if(`children`in e){let n=e.children,r=-1;for(;++r<n.length;){let i=a.one(n[r],e);if(i){if(r&&n[r-1].type===`break`&&(!Array.isArray(i)&&i.type===`text`&&(i.value=n4(i.value)),!Array.isArray(i)&&i.type===`element`)){let e=i.children[0];e&&e.type===`text`&&(e.value=n4(e.value))}Array.isArray(i)?t.push(...i):t.push(i)}}}return t}}function Q2(e,t){e.position&&(t.position=iQ(e))}function $2(e,t){let n=t;if(e&&e.data){let t=e.data.hName,r=e.data.hChildren,i=e.data.hProperties;typeof t==`string`&&(n.type===`element`?n.tagName=t:n={type:`element`,tagName:t,properties:{},children:`children`in n?n.children:[n]}),n.type===`element`&&i&&Object.assign(n.properties,N2(i)),`children`in n&&n.children&&r!=null&&(n.children=r)}return n}function e4(e,t){let n=t.data||{},r=`value`in t&&!(Y2.call(n,`hProperties`)||Y2.call(n,`hChildren`))?{type:`text`,value:t.value}:{type:`element`,tagName:`div`,properties:{},children:e.all(t)};return e.patch(t,r),e.applyData(t,r)}function t4(e,t){let n=[],r=-1;for(t&&n.push({type:`text`,value:`
|
|
127
|
-
`});++r<e.length;)r&&n.push({type:`text`,value:`
|
|
128
|
-
`}),n.push(e[r]);return t&&e.length>0&&n.push({type:`text`,value:`
|
|
129
|
-
`}),n}function n4(e){let t=0,n=e.charCodeAt(t);for(;n===9||n===32;)t++,n=e.charCodeAt(t);return e.slice(t)}function r4(e,t){let n=Z2(e,t),r=n.one(e,void 0),i=I2(n),a=Array.isArray(r)?{type:`root`,children:r}:r||{type:`root`,children:[]};return i&&(`children`in a,a.children.push({type:`text`,value:`
|
|
130
|
-
`},i)),a}function i4(e,t){return e&&`run`in e?async function(n,r){let i=r4(n,{file:r,...t});await e.run(i,r)}:function(n,r){return r4(n,{file:r,...e||t})}}function a4(e){if(e)throw e}var o4=o(((e,t)=>{var n=Object.prototype.hasOwnProperty,r=Object.prototype.toString,i=Object.defineProperty,a=Object.getOwnPropertyDescriptor,o=function(e){return typeof Array.isArray==`function`?Array.isArray(e):r.call(e)===`[object Array]`},s=function(e){if(!e||r.call(e)!==`[object Object]`)return!1;var t=n.call(e,`constructor`),i=e.constructor&&e.constructor.prototype&&n.call(e.constructor.prototype,`isPrototypeOf`);if(e.constructor&&!t&&!i)return!1;for(var a in e);return a===void 0||n.call(e,a)},c=function(e,t){i&&t.name===`__proto__`?i(e,t.name,{enumerable:!0,configurable:!0,value:t.newValue,writable:!0}):e[t.name]=t.newValue},l=function(e,t){if(t===`__proto__`){if(!n.call(e,t))return;if(a)return a(e,t).value}return e[t]};t.exports=function e(){var t,n,r,i,a,u,d=arguments[0],f=1,p=arguments.length,m=!1;for(typeof d==`boolean`&&(m=d,d=arguments[1]||{},f=2),(d==null||typeof d!=`object`&&typeof d!=`function`)&&(d={});f<p;++f)if(t=arguments[f],t!=null)for(n in t)r=l(d,n),i=l(t,n),d!==i&&(m&&i&&(s(i)||(a=o(i)))?(a?(a=!1,u=r&&o(r)?r:[]):u=r&&s(r)?r:{},c(d,{name:n,newValue:e(m,u,i)})):i!==void 0&&c(d,{name:n,newValue:i}));return d}}));function s4(e){if(typeof e!=`object`||!e)return!1;let t=Object.getPrototypeOf(e);return(t===null||t===Object.prototype||Object.getPrototypeOf(t)===null)&&!(Symbol.toStringTag in e)&&!(Symbol.iterator in e)}function c4(){let e=[],t={run:n,use:r};return t;function n(...t){let n=-1,r=t.pop();if(typeof r!=`function`)throw TypeError(`Expected function as last argument, not `+r);i(null,...t);function i(a,...o){let s=e[++n],c=-1;if(a)r(a);else{for(;++c<t.length;)(o[c]===null||o[c]===void 0)&&(o[c]=t[c]);t=o,s?l4(s,i)(...o):r(null,...o)}}}function r(n){if(typeof n!=`function`)throw TypeError("Expected `middelware` to be a function, not "+n);return e.push(n),t}}function l4(e,t){let n;return r;function r(...t){let r=e.length>t.length,o;r&&t.push(i);try{o=e.apply(this,t)}catch(e){let t=e;if(r&&n)throw t;return i(t)}r||(o&&o.then&&typeof o.then==`function`?o.then(a,i):o instanceof Error?i(o):a(o))}function i(e,...r){n||(n=!0,t(e,...r))}function a(e){i(null,e)}}var u4={basename:d4,dirname:f4,extname:p4,join:m4,sep:`/`};function d4(e,t){if(t!==void 0&&typeof t!=`string`)throw TypeError(`"ext" argument must be a string`);_4(e);let n=0,r=-1,i=e.length,a;if(t===void 0||t.length===0||t.length>e.length){for(;i--;)if(e.codePointAt(i)===47){if(a){n=i+1;break}}else r<0&&(a=!0,r=i+1);return r<0?``:e.slice(n,r)}if(t===e)return``;let o=-1,s=t.length-1;for(;i--;)if(e.codePointAt(i)===47){if(a){n=i+1;break}}else o<0&&(a=!0,o=i+1),s>-1&&(e.codePointAt(i)===t.codePointAt(s--)?s<0&&(r=i):(s=-1,r=o));return n===r?r=o:r<0&&(r=e.length),e.slice(n,r)}function f4(e){if(_4(e),e.length===0)return`.`;let t=-1,n=e.length,r;for(;--n;)if(e.codePointAt(n)===47){if(r){t=n;break}}else r||=!0;return t<0?e.codePointAt(0)===47?`/`:`.`:t===1&&e.codePointAt(0)===47?`//`:e.slice(0,t)}function p4(e){_4(e);let t=e.length,n=-1,r=0,i=-1,a=0,o;for(;t--;){let s=e.codePointAt(t);if(s===47){if(o){r=t+1;break}}else n<0&&(o=!0,n=t+1),s===46?i<0?i=t:a!==1&&(a=1):i>-1&&(a=-1)}return i<0||n<0||a===0||a===1&&i===n-1&&i===r+1?``:e.slice(i,n)}function m4(...e){let t=-1,n;for(;++t<e.length;)_4(e[t]),e[t]&&(n=n===void 0?e[t]:n+`/`+e[t]);return n===void 0?`.`:h4(n)}function h4(e){_4(e);let t=e.codePointAt(0)===47,n=g4(e,!t);return n.length===0&&!t&&(n=`.`),n.length>0&&e.codePointAt(e.length-1)===47&&(n+=`/`),t?`/`+n:n}function g4(e,t){let n=``,r=0,i=-1,a=0,o=-1,s,c;for(;++o<=e.length;){if(o<e.length)s=e.codePointAt(o);else if(s===47)break;else s=47;if(s===47){if(i!==o-1&&a!==1){if(i!==o-1&&a===2){if(n.length<2||r!==2||n.codePointAt(n.length-1)!==46||n.codePointAt(n.length-2)!==46){if(n.length>2){if(c=n.lastIndexOf(`/`),c!==n.length-1){c<0?(n=``,r=0):(n=n.slice(0,c),r=n.length-1-n.lastIndexOf(`/`)),i=o,a=0;continue}}else if(n.length>0){n=``,r=0,i=o,a=0;continue}}t&&(n=n.length>0?n+`/..`:`..`,r=2)}else n.length>0?n+=`/`+e.slice(i+1,o):n=e.slice(i+1,o),r=o-i-1}i=o,a=0}else s===46&&a>-1?a++:a=-1}return n}function _4(e){if(typeof e!=`string`)throw TypeError(`Path must be a string. Received `+JSON.stringify(e))}var v4={cwd:y4};function y4(){return`/`}function b4(e){return!!(typeof e==`object`&&e&&`href`in e&&e.href&&`protocol`in e&&e.protocol&&e.auth===void 0)}function x4(e){if(typeof e==`string`)e=new URL(e);else if(!b4(e)){let t=TypeError('The "path" argument must be of type string or an instance of URL. Received `'+e+"`");throw t.code=`ERR_INVALID_ARG_TYPE`,t}if(e.protocol!==`file:`){let e=TypeError(`The URL must be of scheme file`);throw e.code=`ERR_INVALID_URL_SCHEME`,e}return S4(e)}function S4(e){if(e.hostname!==``){let e=TypeError(`File URL host must be "localhost" or empty on darwin`);throw e.code=`ERR_INVALID_FILE_URL_HOST`,e}let t=e.pathname,n=-1;for(;++n<t.length;)if(t.codePointAt(n)===37&&t.codePointAt(n+1)===50){let e=t.codePointAt(n+2);if(e===70||e===102){let e=TypeError(`File URL path must not include encoded / characters`);throw e.code=`ERR_INVALID_FILE_URL_PATH`,e}}return decodeURIComponent(t)}var C4=[`history`,`path`,`basename`,`stem`,`extname`,`dirname`],w4=class{constructor(e){let t;t=e?b4(e)?{path:e}:typeof e==`string`||O4(e)?{value:e}:e:{},this.cwd=`cwd`in t?``:v4.cwd(),this.data={},this.history=[],this.messages=[],this.value,this.map,this.result,this.stored;let n=-1;for(;++n<C4.length;){let e=C4[n];e in t&&t[e]!==void 0&&t[e]!==null&&(this[e]=e===`history`?[...t[e]]:t[e])}let r;for(r in t)C4.includes(r)||(this[r]=t[r])}get basename(){return typeof this.path==`string`?u4.basename(this.path):void 0}set basename(e){E4(e,`basename`),T4(e,`basename`),this.path=u4.join(this.dirname||``,e)}get dirname(){return typeof this.path==`string`?u4.dirname(this.path):void 0}set dirname(e){D4(this.basename,`dirname`),this.path=u4.join(e||``,this.basename)}get extname(){return typeof this.path==`string`?u4.extname(this.path):void 0}set extname(e){if(T4(e,`extname`),D4(this.dirname,`extname`),e){if(e.codePointAt(0)!==46)throw Error("`extname` must start with `.`");if(e.includes(`.`,1))throw Error("`extname` cannot contain multiple dots")}this.path=u4.join(this.dirname,this.stem+(e||``))}get path(){return this.history[this.history.length-1]}set path(e){b4(e)&&(e=x4(e)),E4(e,`path`),this.path!==e&&this.history.push(e)}get stem(){return typeof this.path==`string`?u4.basename(this.path,this.extname):void 0}set stem(e){E4(e,`stem`),T4(e,`stem`),this.path=u4.join(this.dirname||``,e+(this.extname||``))}fail(e,t,n){let r=this.message(e,t,n);throw r.fatal=!0,r}info(e,t,n){let r=this.message(e,t,n);return r.fatal=void 0,r}message(e,t,n){let r=new lQ(e,t,n);return this.path&&(r.name=this.path+`:`+r.name,r.file=this.path),r.fatal=!1,this.messages.push(r),r}toString(e){return this.value===void 0?``:typeof this.value==`string`?this.value:new TextDecoder(e||void 0).decode(this.value)}};function T4(e,t){if(e&&e.includes(u4.sep))throw Error("`"+t+"` cannot be a path: did not expect `"+u4.sep+"`")}function E4(e,t){if(!e)throw Error("`"+t+"` cannot be empty")}function D4(e,t){if(!e)throw Error("Setting `"+t+"` requires `path` to be set too")}function O4(e){return!!(e&&typeof e==`object`&&`byteLength`in e&&`byteOffset`in e)}var k4=(function(e){let t=this.constructor.prototype,n=t[e],r=function(){return n.apply(r,arguments)};return Object.setPrototypeOf(r,t),r}),A4=l(o4(),1),j4={}.hasOwnProperty,M4=new class e extends k4{constructor(){super(`copy`),this.Compiler=void 0,this.Parser=void 0,this.attachers=[],this.compiler=void 0,this.freezeIndex=-1,this.frozen=void 0,this.namespace={},this.parser=void 0,this.transformers=c4()}copy(){let t=new e,n=-1;for(;++n<this.attachers.length;){let e=this.attachers[n];t.use(...e)}return t.data((0,A4.default)(!0,{},this.namespace)),t}data(e,t){return typeof e==`string`?arguments.length===2?(F4(`data`,this.frozen),this.namespace[e]=t,this):j4.call(this.namespace,e)&&this.namespace[e]||void 0:e?(F4(`data`,this.frozen),this.namespace=e,this):this.namespace}freeze(){if(this.frozen)return this;let e=this;for(;++this.freezeIndex<this.attachers.length;){let[t,...n]=this.attachers[this.freezeIndex];if(n[0]===!1)continue;n[0]===!0&&(n[0]=void 0);let r=t.call(e,...n);typeof r==`function`&&this.transformers.use(r)}return this.frozen=!0,this.freezeIndex=1/0,this}parse(e){this.freeze();let t=R4(e),n=this.parser||this.Parser;return N4(`parse`,n),n(String(t),t)}process(e,t){let n=this;return this.freeze(),N4(`process`,this.parser||this.Parser),P4(`process`,this.compiler||this.Compiler),t?r(void 0,t):new Promise(r);function r(r,i){let a=R4(e),o=n.parse(a);n.run(o,a,function(e,t,r){if(e||!t||!r)return s(e);let i=t,a=n.stringify(i,r);Doe(a)?r.value=a:r.result=a,s(e,r)});function s(e,n){e||!n?i(e):r?r(n):t(void 0,n)}}}processSync(e){let t=!1,n;return this.freeze(),N4(`processSync`,this.parser||this.Parser),P4(`processSync`,this.compiler||this.Compiler),this.process(e,r),L4(`processSync`,`process`,t),n;function r(e,r){t=!0,a4(e),n=r}}run(e,t,n){I4(e),this.freeze();let r=this.transformers;return!n&&typeof t==`function`&&(n=t,t=void 0),n?i(void 0,n):new Promise(i);function i(i,a){let o=R4(t);r.run(e,o,s);function s(t,r,o){let s=r||e;t?a(t):i?i(s):n(void 0,s,o)}}}runSync(e,t){let n=!1,r;return this.run(e,t,i),L4(`runSync`,`run`,n),r;function i(e,t){a4(e),r=t,n=!0}}stringify(e,t){this.freeze();let n=R4(t),r=this.compiler||this.Compiler;return P4(`stringify`,r),I4(e),r(e,n)}use(e,...t){let n=this.attachers,r=this.namespace;if(F4(`use`,this.frozen),e!=null){if(typeof e==`function`)s(e,t);else if(typeof e==`object`)Array.isArray(e)?o(e):a(e);else throw TypeError("Expected usable value, not `"+e+"`")}return this;function i(e){if(typeof e==`function`)s(e,[]);else if(typeof e==`object`){if(Array.isArray(e)){let[t,...n]=e;s(t,n)}else a(e)}else throw TypeError("Expected usable value, not `"+e+"`")}function a(e){if(!(`plugins`in e)&&!(`settings`in e))throw Error("Expected usable value but received an empty preset, which is probably a mistake: presets typically come with `plugins` and sometimes with `settings`, but this has neither");o(e.plugins),e.settings&&(r.settings=(0,A4.default)(!0,r.settings,e.settings))}function o(e){let t=-1;if(e!=null){if(Array.isArray(e))for(;++t<e.length;){let n=e[t];i(n)}else throw TypeError("Expected a list of plugins, not `"+e+"`")}}function s(e,t){let r=-1,i=-1;for(;++r<n.length;)if(n[r][0]===e){i=r;break}if(i===-1)n.push([e,...t]);else if(t.length>0){let[r,...a]=t,o=n[i][1];s4(o)&&s4(r)&&(r=(0,A4.default)(!0,o,r)),n[i]=[e,r,...a]}}}}().freeze();function N4(e,t){if(typeof t!=`function`)throw TypeError("Cannot `"+e+"` without `parser`")}function P4(e,t){if(typeof t!=`function`)throw TypeError("Cannot `"+e+"` without `compiler`")}function F4(e,t){if(t)throw Error("Cannot call `"+e+"` on a frozen processor.\nCreate a new processor first, by calling it: use `processor()` instead of `processor`.")}function I4(e){if(!s4(e)||typeof e.type!=`string`)throw TypeError("Expected node, got `"+e+"`")}function L4(e,t,n){if(!n)throw Error("`"+e+"` finished async. Use `"+t+"` instead")}function R4(e){return Eoe(e)?e:new w4(e)}function Eoe(e){return!!(e&&typeof e==`object`&&`message`in e&&`messages`in e)}function Doe(e){return typeof e==`string`||Ooe(e)}function Ooe(e){return!!(e&&typeof e==`object`&&`byteLength`in e&&`byteOffset`in e)}var z4=[],B4={allowDangerousHtml:!0},koe=/^(https?|ircs?|mailto|xmpp)$/i,Aoe=[{from:`astPlugins`,id:`remove-buggy-html-in-markdown-parser`},{from:`allowDangerousHtml`,id:`remove-buggy-html-in-markdown-parser`},{from:`allowNode`,id:`replace-allownode-allowedtypes-and-disallowedtypes`,to:`allowElement`},{from:`allowedTypes`,id:`replace-allownode-allowedtypes-and-disallowedtypes`,to:`allowedElements`},{from:`className`,id:`remove-classname`},{from:`disallowedTypes`,id:`replace-allownode-allowedtypes-and-disallowedtypes`,to:`disallowedElements`},{from:`escapeHtml`,id:`remove-buggy-html-in-markdown-parser`},{from:`includeElementIndex`,id:`#remove-includeelementindex`},{from:`includeNodeIndex`,id:`change-includenodeindex-to-includeelementindex`},{from:`linkTarget`,id:`remove-linktarget`},{from:`plugins`,id:`change-plugins-to-remarkplugins`,to:`remarkPlugins`},{from:`rawSourcePos`,id:`#remove-rawsourcepos`},{from:`renderers`,id:`change-renderers-to-components`,to:`components`},{from:`source`,id:`change-source-to-children`,to:`children`},{from:`sourcePos`,id:`#remove-sourcepos`},{from:`transformImageUri`,id:`#add-urltransform`,to:`urlTransform`},{from:`transformLinkUri`,id:`#add-urltransform`,to:`urlTransform`}];function joe(e){let t=Moe(e),n=Noe(e);return Poe(t.runSync(t.parse(n),n),e)}function Moe(e){let t=e.rehypePlugins||z4,n=e.remarkPlugins||z4,r=e.remarkRehypeOptions?{...e.remarkRehypeOptions,...B4}:B4;return M4().use(H0).use(n).use(i4,r).use(t)}function Noe(e){let t=e.children||``,n=new w4;return typeof t==`string`?n.value=t:``+t,n}function Poe(e,t){let n=t.allowedElements,r=t.allowElement,i=t.components,a=t.disallowedElements,o=t.skipHtml,s=t.unwrapDisallowed,c=t.urlTransform||Foe;for(let e of Aoe)Object.hasOwn(t,e.from)&&``+e.from+(e.to?"use `"+e.to+"` instead":`remove it`)+e.id;return J2(e,l),_Q(e,{Fragment:I.Fragment,components:i,ignoreInvalidStyle:!0,jsx:I.jsx,jsxs:I.jsxs,passKeys:!0,passNode:!0});function l(e,t,i){if(e.type===`raw`&&i&&typeof t==`number`)return o?i.children.splice(t,1):i.children[t]={type:`text`,value:e.value},t;if(e.type===`element`){let t;for(t in zQ)if(Object.hasOwn(zQ,t)&&Object.hasOwn(e.properties,t)){let n=e.properties[t],r=zQ[t];(r===null||r.includes(e.tagName))&&(e.properties[t]=c(String(n||``),t,e))}}if(e.type===`element`){let o=n?!n.includes(e.tagName):a?a.includes(e.tagName):!1;if(!o&&r&&typeof t==`number`&&(o=!r(e,t,i)),o&&i&&typeof t==`number`)return s&&e.children?i.children.splice(t,1,...e.children):i.children.splice(t,1),t}}}function Foe(e){let t=e.indexOf(`:`),n=e.indexOf(`?`),r=e.indexOf(`#`),i=e.indexOf(`/`);return t===-1||i!==-1&&t>i||n!==-1&&t>n||r!==-1&&t>r||koe.test(e.slice(0,t))?e:``}function V4(e,t){let n=String(e);if(typeof t!=`string`)throw TypeError(`Expected character`);let r=0,i=n.indexOf(t);for(;i!==-1;)r++,i=n.indexOf(t,i+t.length);return r}function Ioe(e){if(typeof e!=`string`)throw TypeError(`Expected a string`);return e.replace(/[|\\{}()[\]^$+*?.]/g,`\\$&`).replace(/-/g,`\\x2d`)}function Loe(e,t,n){let r=L2((n||{}).ignore||[]),i=Roe(t),a=-1;for(;++a<i.length;)K2(e,`text`,o);function o(e,t){let n=-1,i;for(;++n<t.length;){let e=t[n],a=i?i.children:void 0;if(r(e,a?a.indexOf(e):void 0,i))return;i=e}if(i)return s(e,t)}function s(e,t){let n=t[t.length-1],r=i[a][0],o=i[a][1],s=0,c=n.children.indexOf(e),l=!1,u=[];r.lastIndex=0;let d=r.exec(e.value);for(;d;){let n=d.index,i={index:d.index,input:d.input,stack:[...t,e]},a=o(...d,i);if(typeof a==`string`&&(a=a.length>0?{type:`text`,value:a}:void 0),a===!1)r.lastIndex=n+1;else{if(s!==n&&f({type:`text`,value:e.value.slice(s,n)}),Array.isArray(a))for(let e of a)f(e);else a&&f(a);s=n+d[0].length,l=!0}if(!r.global)break;d=r.exec(e.value)}return l?(s<e.value.length&&f({type:`text`,value:e.value.slice(s)}),n.children.splice(c,1,...u)):u=[e],c+u.length;function f(e){let t=u[u.length-1];t&&t.type===`text`&&e.type===`text`?t.value+=e.value:u.push(e)}}}function Roe(e){if(!Array.isArray(e))throw TypeError(`Expected find and replace tuple or list of tuples`);let t=[],n=!e[0]||Array.isArray(e[0])?e:[e],r=-1;for(;++r<n.length;){let e=n[r];t.push([zoe(e[0]),Boe(e[1])])}return t}function zoe(e){return typeof e==`string`?new RegExp(Ioe(e),`g`):e}function Boe(e){return typeof e==`function`?e:function(){return e}}var H4=`phrasing`,U4=[`autolink`,`link`,`image`,`label`];function Voe(){return{transforms:[Joe],enter:{literalAutolink:Uoe,literalAutolinkEmail:W4,literalAutolinkHttp:W4,literalAutolinkWww:W4},exit:{literalAutolink:qoe,literalAutolinkEmail:Koe,literalAutolinkHttp:Woe,literalAutolinkWww:Goe}}}function Hoe(){return{unsafe:[{character:`@`,before:`[+\\-.\\w]`,after:`[\\-.\\w]`,inConstruct:H4,notInConstruct:U4},{character:`.`,before:`[Ww]`,after:`[\\-.\\w]`,inConstruct:H4,notInConstruct:U4},{character:`:`,before:`[ps]`,after:`\\/`,inConstruct:H4,notInConstruct:U4}]}}function Uoe(e){this.enter({type:`link`,title:null,url:``,children:[]},e)}function W4(e){this.config.enter.autolinkProtocol.call(this,e)}function Woe(e){this.config.exit.autolinkProtocol.call(this,e)}function Goe(e){this.config.exit.data.call(this,e);let t=this.stack[this.stack.length-1];t.type,t.url=`http://`+this.sliceSerialize(e)}function Koe(e){this.config.exit.autolinkEmail.call(this,e)}function qoe(e){this.exit(e)}function Joe(e){Loe(e,[[/(https?:\/\/|www(?=\.))([-.\w]+)([^ \t\r\n]*)/gi,Yoe],[/(?<=^|\s|\p{P}|\p{S})([-.\w+]+)@([-\w]+(?:\.[-\w]+)+)/gu,Xoe]],{ignore:[`link`,`linkReference`]})}function Yoe(e,t,n,r,i){let a=``;if(!G4(i)||(/^w/i.test(t)&&(n=t+n,t=``,a=`http://`),!Zoe(n)))return!1;let o=Qoe(n+r);if(!o[0])return!1;let s={type:`link`,title:null,url:a+t+o[0],children:[{type:`text`,value:t+o[0]}]};return o[1]?[s,{type:`text`,value:o[1]}]:s}function Xoe(e,t,n,r){return!G4(r,!0)||/[-\d_]$/.test(n)?!1:{type:`link`,title:null,url:`mailto:`+t+`@`+n,children:[{type:`text`,value:t+`@`+n}]}}function Zoe(e){let t=e.split(`.`);return!(t.length<2||t[t.length-1]&&(/_/.test(t[t.length-1])||!/[a-zA-Z\d]/.test(t[t.length-1]))||t[t.length-2]&&(/_/.test(t[t.length-2])||!/[a-zA-Z\d]/.test(t[t.length-2])))}function Qoe(e){let t=/[!"&'),.:;<>?\]}]+$/.exec(e);if(!t)return[e,void 0];e=e.slice(0,t.index);let n=t[0],r=n.indexOf(`)`),i=V4(e,`(`),a=V4(e,`)`);for(;r!==-1&&i>a;)e+=n.slice(0,r+1),n=n.slice(r+1),r=n.indexOf(`)`),a++;return[e,n]}function G4(e,t){let n=e.input.charCodeAt(e.index-1);return(e.index===0||f$(n)||d$(n))&&(!t||n!==47)}K4.peek=sse;function $oe(){this.buffer()}function ese(e){this.enter({type:`footnoteReference`,identifier:``,label:``},e)}function tse(){this.buffer()}function nse(e){this.enter({type:`footnoteDefinition`,identifier:``,label:``,children:[]},e)}function rse(e){let t=this.resume(),n=this.stack[this.stack.length-1];n.type,n.identifier=e$(this.sliceSerialize(e)).toLowerCase(),n.label=t}function ise(e){this.exit(e)}function ase(e){let t=this.resume(),n=this.stack[this.stack.length-1];n.type,n.identifier=e$(this.sliceSerialize(e)).toLowerCase(),n.label=t}function ose(e){this.exit(e)}function sse(){return`[`}function K4(e,t,n,r){let i=n.createTracker(r),a=i.move(`[^`),o=n.enter(`footnoteReference`),s=n.enter(`reference`);return a+=i.move(n.safe(n.associationId(e),{after:`]`,before:a})),s(),o(),a+=i.move(`]`),a}function cse(){return{enter:{gfmFootnoteCallString:$oe,gfmFootnoteCall:ese,gfmFootnoteDefinitionLabelString:tse,gfmFootnoteDefinition:nse},exit:{gfmFootnoteCallString:rse,gfmFootnoteCall:ise,gfmFootnoteDefinitionLabelString:ase,gfmFootnoteDefinition:ose}}}function lse(e){let t=!1;return e&&e.firstLineBlank&&(t=!0),{handlers:{footnoteDefinition:n,footnoteReference:K4},unsafe:[{character:`[`,inConstruct:[`label`,`phrasing`,`reference`]}]};function n(e,n,r,i){let a=r.createTracker(i),o=a.move(`[^`),s=r.enter(`footnoteDefinition`),c=r.enter(`label`);return o+=a.move(r.safe(r.associationId(e),{before:o,after:`]`})),c(),o+=a.move(`]:`),e.children&&e.children.length>0&&(a.shift(4),o+=a.move((t?`
|
|
131
|
-
`:` `)+r.indentLines(r.containerFlow(e,a.current()),t?q4:use))),s(),o}}function use(e,t,n){return t===0?e:q4(e,t,n)}function q4(e,t,n){return(n?``:` `)+e}var dse=[`autolink`,`destinationLiteral`,`destinationRaw`,`reference`,`titleQuote`,`titleApostrophe`];J4.attention=gse,J4.peek=_se;function fse(){return{canContainEols:[`delete`],enter:{strikethrough:mse},exit:{strikethrough:hse}}}function pse(){return{handlers:{delete:J4},unsafe:[{character:`~`,inConstruct:`phrasing`,notInConstruct:dse}]}}function mse(e){this.enter({type:`delete`,children:[],position:void 0},e)}function hse(e){this.exit(e)}function J4(e,t,n,r){let i=n.createTracker(r),a=n.stack.includes(`strikethrough`)?`~`:`~~`,o=n.enter(`strikethrough`),s=i.move(a);return s+=n.containerPhrasing(e,{...i.current(),before:s,after:`~`}),s+=i.move(a),o(),s}function gse(){return{construct:`strikethrough`,markers:[`~`],sizes:[2,1]}}function _se(){return`~`}function vse(e){return e.length}function yse(e,t){let n=t||{},r=(n.align||[]).concat(),i=n.stringLength||vse,a=[],o=[],s=[],c=[],l=0,u=-1;for(;++u<e.length;){let t=[],r=[],a=-1;for(e[u].length>l&&(l=e[u].length);++a<e[u].length;){let o=bse(e[u][a]);if(n.alignDelimiters!==!1){let e=i(o);r[a]=e,(c[a]===void 0||e>c[a])&&(c[a]=e)}t.push(o)}o[u]=t,s[u]=r}let d=-1;if(typeof r==`object`&&`length`in r)for(;++d<l;)a[d]=Y4(r[d]);else{let e=Y4(r);for(;++d<l;)a[d]=e}d=-1;let f=[],p=[];for(;++d<l;){let e=a[d],t=``,r=``;e===99?(t=`:`,r=`:`):e===108?t=`:`:e===114&&(r=`:`);let i=n.alignDelimiters===!1?1:Math.max(1,c[d]-t.length-r.length),o=t+`-`.repeat(i)+r;n.alignDelimiters!==!1&&(i=t.length+i+r.length,i>c[d]&&(c[d]=i),p[d]=i),f[d]=o}o.splice(1,0,f),s.splice(1,0,p),u=-1;let m=[];for(;++u<o.length;){let e=o[u],t=s[u];d=-1;let r=[];for(;++d<l;){let i=e[d]||``,o=``,s=``;if(n.alignDelimiters!==!1){let e=c[d]-(t[d]||0),n=a[d];n===114?o=` `.repeat(e):n===99?e%2?(o=` `.repeat(e/2+.5),s=` `.repeat(e/2-.5)):(o=` `.repeat(e/2),s=o):s=` `.repeat(e)}n.delimiterStart!==!1&&!d&&r.push(`|`),n.padding!==!1&&(n.alignDelimiters!==!1||i!==``)&&(n.delimiterStart!==!1||d)&&r.push(` `),n.alignDelimiters!==!1&&r.push(o),r.push(i),n.alignDelimiters!==!1&&r.push(s),n.padding!==!1&&r.push(` `),(n.delimiterEnd!==!1||d!==l-1)&&r.push(`|`)}m.push(n.delimiterEnd===!1?r.join(``).replace(/ +$/,``):r.join(``))}return m.join(`
|
|
132
|
-
`)}function bse(e){return e==null?``:String(e)}function Y4(e){let t=typeof e==`string`?e.codePointAt(0):0;return t===67||t===99?99:t===76||t===108?108:t===82||t===114?114:0}var xse=L2([`break`,`delete`,`emphasis`,`footnote`,`footnoteReference`,`image`,`imageReference`,`inlineCode`,`inlineMath`,`link`,`linkReference`,`mdxJsxTextElement`,`mdxTextExpression`,`strong`,`text`,`textDirective`]);function Sse(e,t,n,r){let i=n.enter(`blockquote`),a=n.createTracker(r);a.move(`> `),a.shift(2);let o=n.indentLines(n.containerFlow(e,a.current()),Cse);return i(),o}function Cse(e,t,n){return`>`+(n?``:` `)+e}function wse(e,t){return X4(e,t.inConstruct,!0)&&!X4(e,t.notInConstruct,!1)}function X4(e,t,n){if(typeof t==`string`&&(t=[t]),!t||t.length===0)return n;let r=-1;for(;++r<t.length;)if(e.includes(t[r]))return!0;return!1}function Z4(e,t,n,r){let i=-1;for(;++i<n.unsafe.length;){let e=n.unsafe[i];if(e.character===`
|
|
133
|
-
`&&!e.before&&!e.after&&wse(n.stack,e))return/[\t ]/.test(r.before)?``:` `}return`\\
|
|
134
|
-
`}function Tse(e,t){let n=String(e),r=n.indexOf(t),i=r,a=0,o=0;if(typeof t!=`string`)throw TypeError(`Expected substring`);for(;r!==-1;)r===i?++a>o&&(o=a):a=1,i=r+t.length,r=n.indexOf(t,i);return o}function Ese(e,t){return!(t.options.fences!==!1||!e.value||e.lang||!/[^\n\r ]/.test(e.value)||/^[\t ]*(?:[\n\r]|$)|(?:^|[\n\r])[\t ]*$/.test(e.value))}function Dse(e){let t=e.options.fence||"`";if(t!=="`"&&t!==`~`)throw Error("Cannot serialize code with `"+t+"` for `options.fence`, expected `` ` `` or `~`");return t}function Ose(e,t,n,r){let i=Dse(n),a=e.value||``;if(Ese(e,n)){let e=n.enter(`codeIndented`),t=n.indentLines(a,kse);return e(),t}let o=n.createTracker(r),s=i.repeat(Math.max(Tse(a,i)+1,3)),c=n.enter(`codeFenced`),l=i==="`"?`GraveAccent`:`Tilde`,u=o.move(s);if(e.lang){let t=n.enter(`codeFencedLang${l}`);u+=o.move(n.safe(e.lang,{before:u,after:` `,encode:["`"],...o.current()})),t()}if(e.lang&&e.meta){let t=n.enter(`codeFencedMeta${l}`);u+=o.move(` `),u+=o.move(n.safe(e.meta,{before:u,after:`
|
|
135
|
-
`,encode:["`"],...o.current()})),t()}return u+=o.move(`
|
|
136
|
-
`),a&&(u+=o.move(a+`
|
|
137
|
-
`)),u+=o.move(s),c(),u}function kse(e,t,n){return(n?``:` `)+e}function Q4(e){let t=e.options.quote||`"`;if(t!==`"`&&t!==`'`)throw Error("Cannot serialize title with `"+t+"` for `options.quote`, expected `\"`, or `'`");return t}function Ase(e,t,n,r){let i=Q4(n),a=i===`"`?`Quote`:`Apostrophe`,o=n.enter(`definition`),s=n.enter(`label`),c=n.createTracker(r),l=c.move(`[`);return l+=c.move(n.safe(n.associationId(e),{before:l,after:`]`,...c.current()})),l+=c.move(`]: `),s(),!e.url||/[\0- \u007F]/.test(e.url)?(s=n.enter(`destinationLiteral`),l+=c.move(`<`),l+=c.move(n.safe(e.url,{before:l,after:`>`,...c.current()})),l+=c.move(`>`)):(s=n.enter(`destinationRaw`),l+=c.move(n.safe(e.url,{before:l,after:e.title?` `:`
|
|
138
|
-
`,...c.current()}))),s(),e.title&&(s=n.enter(`title${a}`),l+=c.move(` `+i),l+=c.move(n.safe(e.title,{before:l,after:i,...c.current()})),l+=c.move(i),s()),o(),l}function jse(e){let t=e.options.emphasis||`*`;if(t!==`*`&&t!==`_`)throw Error("Cannot serialize emphasis with `"+t+"` for `options.emphasis`, expected `*`, or `_`");return t}$4.attention=Mse,$4.peek=Nse;function $4(e,t,n,r){let i=n.enter(`phrasing`),a=n.containerPhrasing({type:`root`,children:[e]},r);return i(),a}function Mse(e,t){return{construct:`emphasis`,markers:jse(t)===`*`?[`*`,`_`]:[`_`,`*`],sizes:[1]}}function Nse(e,t,n){return n.options.emphasis||`*`}function Pse(e){return`&#x`+e.toString(16).toUpperCase()+`;`}function Fse(e,t){let n=!1;return J2(e,function(e){if(`value`in e&&/\r?\n|\r/.test(e.value)||e.type===`break`)return n=!0,!1}),!!((!e.depth||e.depth<3)&&VQ(e)&&(t.options.setext||n))}function Ise(e,t,n,r){let i=Math.max(Math.min(6,e.depth||1),1),a=n.createTracker(r);if(Fse(e,n)){let t=n.enter(`headingSetext`),r=n.enter(`phrasing`),o=n.containerPhrasing(e,{...a.current(),before:`
|
|
139
|
-
`,after:`
|
|
140
|
-
`});return r(),t(),o+`
|
|
141
|
-
`+(i===1?`=`:`-`).repeat(o.length-(Math.max(o.lastIndexOf(`\r`),o.lastIndexOf(`
|
|
142
|
-
`))+1))}let o=`#`.repeat(i),s=n.enter(`headingAtx`),c=n.enter(`phrasing`);a.move(o+` `);let l=n.containerPhrasing(e,{before:`# `,after:`
|
|
143
|
-
`,...a.current()}),u=l.charCodeAt(0);return(u===9||u===32)&&(l=Pse(u)+l.slice(1)),l=l?o+` `+l:o,n.options.closeAtx&&(l+=` `+o),c(),s(),l}e3.peek=Lse;function e3(e){return e.value||``}function Lse(){return`<`}t3.peek=Rse;function t3(e,t,n,r){let i=Q4(n),a=i===`"`?`Quote`:`Apostrophe`,o=n.enter(`image`),s=n.enter(`label`),c=n.createTracker(r),l=c.move(`![`);return l+=c.move(n.safe(e.alt,{before:l,after:`]`,...c.current()})),l+=c.move(`](`),s(),!e.url&&e.title||/[\0- \u007F]/.test(e.url)?(s=n.enter(`destinationLiteral`),l+=c.move(`<`),l+=c.move(n.safe(e.url,{before:l,after:`>`,...c.current()})),l+=c.move(`>`)):(s=n.enter(`destinationRaw`),l+=c.move(n.safe(e.url,{before:l,after:e.title?` `:`)`,...c.current()}))),s(),e.title&&(s=n.enter(`title${a}`),l+=c.move(` `+i),l+=c.move(n.safe(e.title,{before:l,after:i,...c.current()})),l+=c.move(i),s()),l+=c.move(`)`),o(),l}function Rse(){return`!`}n3.peek=zse;function n3(e,t,n,r){let i=e.referenceType,a=n.enter(`imageReference`),o=n.enter(`label`),s=n.createTracker(r),c=s.move(`![`),l=n.safe(e.alt,{before:c,after:`]`,...s.current()});c+=s.move(l+`][`),o();let u=n.stack;n.stack=u.filter(function(e){return e!==`phrasing`}),o=n.enter(`reference`);let d=n.safe(n.associationId(e),{before:c,after:`]`,...s.current()});return o(),n.stack=u,a(),i===`full`||!l||l!==d?c+=s.move(d+`]`):i===`shortcut`?c=c.slice(0,-1):c+=s.move(`]`),c}function zse(){return`!`}r3.peek=Bse;function r3(e,t,n){let r=e.value||``,i="`",a=-1;for(;RegExp("(^|[^`])"+i+"([^`]|$)").test(r);)i+="`";for(/[^\n\r ]/.test(r)&&(/^[\n\r ]/.test(r)&&/[\n\r ]$/.test(r)||/^`|`$/.test(r))&&(r=` `+r+` `);++a<n.unsafe.length;){let e=n.unsafe[a],t=n.compilePattern(e);if(!e.atBreak)continue;let i;for(;i=t.exec(r);){let e=i.index;r.charCodeAt(e)===10&&r.charCodeAt(e-1)===13&&e--,r=r.slice(0,e)+` `+r.slice(i.index+1)}}return i+r+i}function Bse(){return"`"}function i3(e,t){let n=VQ(e);return!(t.options.resourceLink||!e.url||e.title||!e.children||e.children.length!==1||e.children[0].type!==`text`||n!==e.url&&`mailto:`+n!==e.url||!/^[a-z][+\-.a-z]+:/i.test(e.url)||/[\0- <>\u007F]/.test(e.url))}a3.peek=Vse;function a3(e,t,n,r){let i=Q4(n),a=i===`"`?`Quote`:`Apostrophe`,o=n.createTracker(r);if(i3(e,n)){let t=n.stack;n.stack=t.filter(function(e){return e!==`phrasing`});let r=n.enter(`autolink`),i=o.move(`<`);return i+=o.move(n.containerPhrasing(e,{before:i,after:`>`,...o.current()})),i+=o.move(`>`),r(),n.stack=t,i}let s=n.enter(`link`),c=n.enter(`label`),l=o.move(`[`);return l+=o.move(n.containerPhrasing(e,{before:l,after:`](`,...o.current()})),l+=o.move(`](`),c(),!e.url&&e.title||/[\0- \u007F]/.test(e.url)?(c=n.enter(`destinationLiteral`),l+=o.move(`<`),l+=o.move(n.safe(e.url,{before:l,after:`>`,...o.current()})),l+=o.move(`>`)):(c=n.enter(`destinationRaw`),l+=o.move(n.safe(e.url,{before:l,after:e.title?` `:`)`,...o.current()}))),c(),e.title&&(c=n.enter(`title${a}`),l+=o.move(` `+i),l+=o.move(n.safe(e.title,{before:l,after:i,...o.current()})),l+=o.move(i),c()),l+=o.move(`)`),s(),l}function Vse(e,t,n){return i3(e,n)?`<`:`[`}o3.peek=Hse;function o3(e,t,n,r){let i=e.referenceType,a=n.enter(`linkReference`),o=n.enter(`label`),s=n.createTracker(r),c=s.move(`[`),l=n.containerPhrasing(e,{before:c,after:`]`,...s.current()});c+=s.move(l+`][`),o();let u=n.stack;n.stack=u.filter(function(e){return e!==`phrasing`}),o=n.enter(`reference`);let d=n.safe(n.associationId(e),{before:c,after:`]`,...s.current()});return o(),n.stack=u,a(),i===`full`||!l||l!==d?c+=s.move(d+`]`):i===`shortcut`?c=c.slice(0,-1):c+=s.move(`]`),c}function Hse(){return`[`}function s3(e){let t=e.options.bullet||`*`;if(t!==`*`&&t!==`+`&&t!==`-`)throw Error("Cannot serialize items with `"+t+"` for `options.bullet`, expected `*`, `+`, or `-`");return t}function Use(e){let t=s3(e),n=e.options.bulletOther;if(!n)return t===`*`?`-`:`*`;if(n!==`*`&&n!==`+`&&n!==`-`)throw Error("Cannot serialize items with `"+n+"` for `options.bulletOther`, expected `*`, `+`, or `-`");if(n===t)throw Error("Expected `bullet` (`"+t+"`) and `bulletOther` (`"+n+"`) to be different");return n}function Wse(e){let t=e.options.bulletOrdered||`.`;if(t!==`.`&&t!==`)`)throw Error("Cannot serialize items with `"+t+"` for `options.bulletOrdered`, expected `.` or `)`");return t}function c3(e){let t=e.options.rule||`*`;if(t!==`*`&&t!==`-`&&t!==`_`)throw Error("Cannot serialize rules with `"+t+"` for `options.rule`, expected `*`, `-`, or `_`");return t}function Gse(e,t,n,r){let i=n.enter(`list`),a=n.bulletCurrent,o=e.ordered?Wse(n):s3(n),s=e.ordered?o===`.`?`)`:`.`:Use(n),c=t&&n.bulletLastUsed?o===n.bulletLastUsed:!1;if(!e.ordered){let t=e.children?e.children[0]:void 0;if((o===`*`||o===`-`)&&t&&(!t.children||!t.children[0])&&n.stack[n.stack.length-1]===`list`&&n.stack[n.stack.length-2]===`listItem`&&n.stack[n.stack.length-3]===`list`&&n.stack[n.stack.length-4]===`listItem`&&n.indexStack[n.indexStack.length-1]===0&&n.indexStack[n.indexStack.length-2]===0&&n.indexStack[n.indexStack.length-3]===0&&(c=!0),c3(n)===o&&t){let t=-1;for(;++t<e.children.length;){let n=e.children[t];if(n&&n.type===`listItem`&&n.children&&n.children[0]&&n.children[0].type===`thematicBreak`){c=!0;break}}}}c&&(o=s),n.bulletCurrent=o;let l=n.containerFlow(e,r);return n.bulletLastUsed=o,n.bulletCurrent=a,i(),l}function Kse(e){let t=e.options.listItemIndent||`one`;if(t!==`tab`&&t!==`one`&&t!==`mixed`)throw Error("Cannot serialize items with `"+t+"` for `options.listItemIndent`, expected `tab`, `one`, or `mixed`");return t}function qse(e,t,n,r){let i=Kse(n),a=n.bulletCurrent||s3(n);t&&t.type===`list`&&t.ordered&&(a=(typeof t.start==`number`&&t.start>-1?t.start:1)+(n.options.incrementListMarker===!1?0:t.children.indexOf(e))+a);let o=a.length+1;(i===`tab`||i===`mixed`&&(t&&t.type===`list`&&t.spread||e.spread))&&(o=Math.ceil(o/4)*4);let s=n.createTracker(r);s.move(a+` `.repeat(o-a.length)),s.shift(o);let c=n.enter(`listItem`),l=n.indentLines(n.containerFlow(e,s.current()),u);return c(),l;function u(e,t,n){return t?(n?``:` `.repeat(o))+e:(n?a:a+` `.repeat(o-a.length))+e}}function Jse(e,t,n,r){let i=n.enter(`paragraph`),a=n.enter(`phrasing`),o=n.containerPhrasing(e,r);return a(),i(),o}function Yse(e,t,n,r){if(!e.children.some(function(e){return xse(e)}))return n.containerFlow(e,r);let i=n.enter(`phrasing`),a=n.containerPhrasing(e,r);return i(),a}function Xse(e){let t=e.options.strong||`*`;if(t!==`*`&&t!==`_`)throw Error("Cannot serialize strong with `"+t+"` for `options.strong`, expected `*`, or `_`");return t}l3.attention=Zse,l3.peek=Qse;function l3(e,t,n,r){let i=n.enter(`phrasing`),a=n.containerPhrasing({type:`root`,children:[e]},r);return i(),a}function Zse(e,t){return{construct:`strong`,markers:Xse(t)===`*`?[`*`,`_`]:[`_`,`*`],sizes:[2]}}function Qse(e,t,n){return n.options.strong||`*`}function $se(e,t,n,r){let i=t?t.children:[],a=i.indexOf(e);return n.safe(e.value,{...r,afterNode:i[a+1],beforeNode:i[a-1]})}function ece(e){let t=e.options.ruleRepetition||3;if(t<3)throw Error("Cannot serialize rules with repetition `"+t+"` for `options.ruleRepetition`, expected `3` or more");return t}function tce(e,t,n){let r=(c3(n)+(n.options.ruleSpaces?` `:``)).repeat(ece(n));return n.options.ruleSpaces?r.slice(0,-1):r}var u3={blockquote:Sse,break:Z4,code:Ose,definition:Ase,emphasis:$4,hardBreak:Z4,heading:Ise,html:e3,image:t3,imageReference:n3,inlineCode:r3,link:a3,linkReference:o3,list:Gse,listItem:qse,paragraph:Jse,root:Yse,strong:l3,text:$se,thematicBreak:tce};function nce(){return{enter:{table:rce,tableData:f3,tableHeader:f3,tableRow:ace},exit:{codeText:oce,table:ice,tableData:d3,tableHeader:d3,tableRow:d3}}}function rce(e){let t=e._align;this.enter({type:`table`,align:t.map(function(e){return e===`none`?null:e}),children:[]},e),this.data.inTable=!0}function ice(e){this.exit(e),this.data.inTable=void 0}function ace(e){this.enter({type:`tableRow`,children:[]},e)}function d3(e){this.exit(e)}function f3(e){this.enter({type:`tableCell`,children:[]},e)}function oce(e){let t=this.resume();this.data.inTable&&(t=t.replace(/\\([\\|])/g,sce));let n=this.stack[this.stack.length-1];n.type,n.value=t,this.exit(e)}function sce(e,t){return t===`|`?t:e}function cce(e){let t=e||{},n=t.tableCellPadding,r=t.tablePipeAlign,i=t.stringLength,a=n?` `:`|`;return{unsafe:[{character:`\r`,inConstruct:`tableCell`},{character:`
|
|
144
|
-
`,inConstruct:`tableCell`},{atBreak:!0,character:`|`,after:`[ :-]`},{character:`|`,inConstruct:`tableCell`},{atBreak:!0,character:`:`,after:`-`},{atBreak:!0,character:`-`,after:`[:|-]`}],handlers:{inlineCode:f,table:o,tableCell:c,tableRow:s}};function o(e,t,n,r){return l(u(e,n,r),e.align)}function s(e,t,n,r){let i=l([d(e,n,r)]);return i.slice(0,i.indexOf(`
|
|
145
|
-
`))}function c(e,t,n,r){let i=n.enter(`tableCell`),o=n.enter(`phrasing`),s=n.containerPhrasing(e,{...r,before:a,after:a});return o(),i(),s}function l(e,t){return yse(e,{align:t,alignDelimiters:r,padding:n,stringLength:i})}function u(e,t,n){let r=e.children,i=-1,a=[],o=t.enter(`table`);for(;++i<r.length;)a[i]=d(r[i],t,n);return o(),a}function d(e,t,n){let r=e.children,i=-1,a=[],o=t.enter(`tableRow`);for(;++i<r.length;)a[i]=c(r[i],e,t,n);return o(),a}function f(e,t,n){let r=u3.inlineCode(e,t,n);return n.stack.includes(`tableCell`)&&(r=r.replace(/\|/g,`\\$&`)),r}}function lce(){return{exit:{taskListCheckValueChecked:p3,taskListCheckValueUnchecked:p3,paragraph:dce}}}function uce(){return{unsafe:[{atBreak:!0,character:`-`,after:`[:|-]`}],handlers:{listItem:fce}}}function p3(e){let t=this.stack[this.stack.length-2];t.type,t.checked=e.type===`taskListCheckValueChecked`}function dce(e){let t=this.stack[this.stack.length-2];if(t&&t.type===`listItem`&&typeof t.checked==`boolean`){let e=this.stack[this.stack.length-1];e.type;let n=e.children[0];if(n&&n.type===`text`){let r=t.children,i=-1,a;for(;++i<r.length;){let e=r[i];if(e.type===`paragraph`){a=e;break}}a===e&&(n.value=n.value.slice(1),n.value.length===0?e.children.shift():e.position&&n.position&&typeof n.position.start.offset==`number`&&(n.position.start.column++,n.position.start.offset++,e.position.start=Object.assign({},n.position.start)))}}this.exit(e)}function fce(e,t,n,r){let i=e.children[0],a=typeof e.checked==`boolean`&&i&&i.type===`paragraph`,o=`[`+(e.checked?`x`:` `)+`] `,s=n.createTracker(r);a&&s.move(o);let c=u3.listItem(e,t,n,{...r,...s.current()});return a&&(c=c.replace(/^(?:[*+-]|\d+\.)([\r\n]| {1,3})/,l)),c;function l(e){return e+o}}function pce(){return[Voe(),cse(),fse(),nce(),lce()]}function mce(e){return{extensions:[Hoe(),lse(e),pse(),cce(e),uce()]}}var hce={tokenize:xce,partial:!0},m3={tokenize:Sce,partial:!0},h3={tokenize:Cce,partial:!0},g3={tokenize:wce,partial:!0},gce={tokenize:Tce,partial:!0},_3={name:`wwwAutolink`,tokenize:yce,previous:S3},v3={name:`protocolAutolink`,tokenize:bce,previous:C3},y3={name:`emailAutolink`,tokenize:vce,previous:w3},b3={};function _ce(){return{text:b3}}for(var x3=48;x3<123;)b3[x3]=y3,x3++,x3===58?x3=65:x3===91&&(x3=97);b3[43]=y3,b3[45]=y3,b3[46]=y3,b3[95]=y3,b3[72]=[y3,v3],b3[104]=[y3,v3],b3[87]=[y3,_3],b3[119]=[y3,_3];function vce(e,t,n){let r=this,i,a;return o;function o(t){return!T3(t)||!w3.call(r,r.previous)||E3(r.events)?n(t):(e.enter(`literalAutolink`),e.enter(`literalAutolinkEmail`),s(t))}function s(t){return T3(t)?(e.consume(t),s):t===64?(e.consume(t),c):n(t)}function c(t){return t===46?e.check(gce,u,l)(t):t===45||t===95||n$(t)?(a=!0,e.consume(t),c):u(t)}function l(t){return e.consume(t),i=!0,c}function u(o){return a&&i&&t$(r.previous)?(e.exit(`literalAutolinkEmail`),e.exit(`literalAutolink`),t(o)):n(o)}}function yce(e,t,n){let r=this;return i;function i(t){return t!==87&&t!==119||!S3.call(r,r.previous)||E3(r.events)?n(t):(e.enter(`literalAutolink`),e.enter(`literalAutolinkWww`),e.check(hce,e.attempt(m3,e.attempt(h3,a),n),n)(t))}function a(n){return e.exit(`literalAutolinkWww`),e.exit(`literalAutolink`),t(n)}}function bce(e,t,n){let r=this,i=``,a=!1;return o;function o(t){return(t===72||t===104)&&C3.call(r,r.previous)&&!E3(r.events)?(e.enter(`literalAutolink`),e.enter(`literalAutolinkHttp`),i+=String.fromCodePoint(t),e.consume(t),s):n(t)}function s(t){if(t$(t)&&i.length<5)return i+=String.fromCodePoint(t),e.consume(t),s;if(t===58){let n=i.toLowerCase();if(n===`http`||n===`https`)return e.consume(t),c}return n(t)}function c(t){return t===47?(e.consume(t),a?l:(a=!0,c)):n(t)}function l(t){return t===null||i$(t)||l$(t)||f$(t)||d$(t)?n(t):e.attempt(m3,e.attempt(h3,u),n)(t)}function u(n){return e.exit(`literalAutolinkHttp`),e.exit(`literalAutolink`),t(n)}}function xce(e,t,n){let r=0;return i;function i(t){return(t===87||t===119)&&r<3?(r++,e.consume(t),i):t===46&&r===3?(e.consume(t),a):n(t)}function a(e){return e===null?n(e):t(e)}}function Sce(e,t,n){let r,i,a;return o;function o(t){return t===46||t===95?e.check(g3,c,s)(t):t===null||l$(t)||f$(t)||t!==45&&d$(t)?c(t):(a=!0,e.consume(t),o)}function s(t){return t===95?r=!0:(i=r,r=void 0),e.consume(t),o}function c(e){return i||r||!a?n(e):t(e)}}function Cce(e,t){let n=0,r=0;return i;function i(o){return o===40?(n++,e.consume(o),i):o===41&&r<n?a(o):o===33||o===34||o===38||o===39||o===41||o===42||o===44||o===46||o===58||o===59||o===60||o===63||o===93||o===95||o===126?e.check(g3,t,a)(o):o===null||l$(o)||f$(o)?t(o):(e.consume(o),i)}function a(t){return t===41&&r++,e.consume(t),i}}function wce(e,t,n){return r;function r(o){return o===33||o===34||o===39||o===41||o===42||o===44||o===46||o===58||o===59||o===63||o===95||o===126?(e.consume(o),r):o===38?(e.consume(o),a):o===93?(e.consume(o),i):o===60||o===null||l$(o)||f$(o)?t(o):n(o)}function i(e){return e===null||e===40||e===91||l$(e)||f$(e)?t(e):r(e)}function a(e){return t$(e)?o(e):n(e)}function o(t){return t===59?(e.consume(t),r):t$(t)?(e.consume(t),o):n(t)}}function Tce(e,t,n){return r;function r(t){return e.consume(t),i}function i(e){return n$(e)?n(e):t(e)}}function S3(e){return e===null||e===40||e===42||e===95||e===91||e===93||e===126||l$(e)}function C3(e){return!t$(e)}function w3(e){return!(e===47||T3(e))}function T3(e){return e===43||e===45||e===46||e===95||n$(e)}function E3(e){let t=e.length,n=!1;for(;t--;){let r=e[t][1];if((r.type===`labelLink`||r.type===`labelImage`)&&!r._balanced){n=!0;break}if(r._gfmAutolinkLiteralWalkedInto){n=!1;break}}return e.length>0&&!n&&(e[e.length-1][1]._gfmAutolinkLiteralWalkedInto=!0),n}var Ece={tokenize:Pce,partial:!0};function Dce(){return{document:{91:{name:`gfmFootnoteDefinition`,tokenize:jce,continuation:{tokenize:Mce},exit:Nce}},text:{91:{name:`gfmFootnoteCall`,tokenize:Ace},93:{name:`gfmPotentialFootnoteCall`,add:`after`,tokenize:Oce,resolveTo:kce}}}}function Oce(e,t,n){let r=this,i=r.events.length,a=r.parser.gfmFootnotes||(r.parser.gfmFootnotes=[]),o;for(;i--;){let e=r.events[i][1];if(e.type===`labelImage`){o=e;break}if(e.type===`gfmFootnoteCall`||e.type===`labelLink`||e.type===`label`||e.type===`image`||e.type===`link`)break}return s;function s(i){if(!o||!o._balanced)return n(i);let s=e$(r.sliceSerialize({start:o.end,end:r.now()}));return s.codePointAt(0)!==94||!a.includes(s.slice(1))?n(i):(e.enter(`gfmFootnoteCallLabelMarker`),e.consume(i),e.exit(`gfmFootnoteCallLabelMarker`),t(i))}}function kce(e,t){let n=e.length;for(;n--;)if(e[n][1].type===`labelImage`&&e[n][0]===`enter`){e[n][1];break}e[n+1][1].type=`data`,e[n+3][1].type=`gfmFootnoteCallLabelMarker`;let r={type:`gfmFootnoteCall`,start:Object.assign({},e[n+3][1].start),end:Object.assign({},e[e.length-1][1].end)},i={type:`gfmFootnoteCallMarker`,start:Object.assign({},e[n+3][1].end),end:Object.assign({},e[n+3][1].end)};i.end.column++,i.end.offset++,i.end._bufferIndex++;let a={type:`gfmFootnoteCallString`,start:Object.assign({},i.end),end:Object.assign({},e[e.length-1][1].start)},o={type:`chunkString`,contentType:`string`,start:Object.assign({},a.start),end:Object.assign({},a.end)},s=[e[n+1],e[n+2],[`enter`,r,t],e[n+3],e[n+4],[`enter`,i,t],[`exit`,i,t],[`enter`,a,t],[`enter`,o,t],[`exit`,o,t],[`exit`,a,t],e[e.length-2],e[e.length-1],[`exit`,r,t]];return e.splice(n,e.length-n+1,...s),e}function Ace(e,t,n){let r=this,i=r.parser.gfmFootnotes||(r.parser.gfmFootnotes=[]),a=0,o;return s;function s(t){return e.enter(`gfmFootnoteCall`),e.enter(`gfmFootnoteCallLabelMarker`),e.consume(t),e.exit(`gfmFootnoteCallLabelMarker`),c}function c(t){return t===94?(e.enter(`gfmFootnoteCallMarker`),e.consume(t),e.exit(`gfmFootnoteCallMarker`),e.enter(`gfmFootnoteCallString`),e.enter(`chunkString`).contentType=`string`,l):n(t)}function l(s){if(a>999||s===93&&!o||s===null||s===91||l$(s))return n(s);if(s===93){e.exit(`chunkString`);let a=e.exit(`gfmFootnoteCallString`);return i.includes(e$(r.sliceSerialize(a)))?(e.enter(`gfmFootnoteCallLabelMarker`),e.consume(s),e.exit(`gfmFootnoteCallLabelMarker`),e.exit(`gfmFootnoteCall`),t):n(s)}return l$(s)||(o=!0),a++,e.consume(s),s===92?u:l}function u(t){return t===91||t===92||t===93?(e.consume(t),a++,l):l(t)}}function jce(e,t,n){let r=this,i=r.parser.gfmFootnotes||(r.parser.gfmFootnotes=[]),a,o=0,s;return c;function c(t){return e.enter(`gfmFootnoteDefinition`)._container=!0,e.enter(`gfmFootnoteDefinitionLabel`),e.enter(`gfmFootnoteDefinitionLabelMarker`),e.consume(t),e.exit(`gfmFootnoteDefinitionLabelMarker`),l}function l(t){return t===94?(e.enter(`gfmFootnoteDefinitionMarker`),e.consume(t),e.exit(`gfmFootnoteDefinitionMarker`),e.enter(`gfmFootnoteDefinitionLabelString`),e.enter(`chunkString`).contentType=`string`,u):n(t)}function u(t){if(o>999||t===93&&!s||t===null||t===91||l$(t))return n(t);if(t===93){e.exit(`chunkString`);let n=e.exit(`gfmFootnoteDefinitionLabelString`);return a=e$(r.sliceSerialize(n)),e.enter(`gfmFootnoteDefinitionLabelMarker`),e.consume(t),e.exit(`gfmFootnoteDefinitionLabelMarker`),e.exit(`gfmFootnoteDefinitionLabel`),f}return l$(t)||(s=!0),o++,e.consume(t),t===92?d:u}function d(t){return t===91||t===92||t===93?(e.consume(t),o++,u):u(t)}function f(t){return t===58?(e.enter(`definitionMarker`),e.consume(t),e.exit(`definitionMarker`),i.includes(a)||i.push(a),h$(e,p,`gfmFootnoteDefinitionWhitespace`)):n(t)}function p(e){return t(e)}}function Mce(e,t,n){return e.check(N$,t,e.attempt(Ece,t,n))}function Nce(e){e.exit(`gfmFootnoteDefinition`)}function Pce(e,t,n){let r=this;return h$(e,i,`gfmFootnoteDefinitionIndent`,5);function i(e){let i=r.events[r.events.length-1];return i&&i[1].type===`gfmFootnoteDefinitionIndent`&&i[2].sliceSerialize(i[1],!0).length===4?t(e):n(e)}}function Fce(e){let t=(e||{}).singleTilde,n={name:`strikethrough`,tokenize:i,resolveAll:r};return t??=!0,{text:{126:n},insideSpan:{null:[n]},attentionMarkers:{null:[126]}};function r(e,t){let n=-1;for(;++n<e.length;)if(e[n][0]===`enter`&&e[n][1].type===`strikethroughSequenceTemporary`&&e[n][1]._close){let r=n;for(;r--;)if(e[r][0]===`exit`&&e[r][1].type===`strikethroughSequenceTemporary`&&e[r][1]._open&&e[n][1].end.offset-e[n][1].start.offset===e[r][1].end.offset-e[r][1].start.offset){e[n][1].type=`strikethroughSequence`,e[r][1].type=`strikethroughSequence`;let i={type:`strikethrough`,start:Object.assign({},e[r][1].start),end:Object.assign({},e[n][1].end)},a={type:`strikethroughText`,start:Object.assign({},e[r][1].end),end:Object.assign({},e[n][1].start)},o=[[`enter`,i,t],[`enter`,e[r][1],t],[`exit`,e[r][1],t],[`enter`,a,t]],s=t.parser.constructs.insideSpan.null;s&&qQ(o,o.length,0,E$(s,e.slice(r+1,n),t)),qQ(o,o.length,0,[[`exit`,a,t],[`enter`,e[n][1],t],[`exit`,e[n][1],t],[`exit`,i,t]]),qQ(e,r-1,n-r+3,o),n=r+o.length-2;break}}for(n=-1;++n<e.length;)e[n][1].type===`strikethroughSequenceTemporary`&&(e[n][1].type=`data`);return e}function i(e,n,r){let i=this.previous,a=this.events,o=0;return s;function s(t){return i===126&&a[a.length-1][1].type!==`characterEscape`?r(t):(e.enter(`strikethroughSequenceTemporary`),c(t))}function c(a){let s=T$(i);if(a===126)return o>1?r(a):(e.consume(a),o++,c);if(o<2&&!t)return r(a);let l=e.exit(`strikethroughSequenceTemporary`),u=T$(a);return l._open=!u||u===2&&!!s,l._close=!s||s===2&&!!u,n(a)}}}var Ice=class{constructor(){this.map=[],this.index=new Map}add(e,t,n){Lce(this,e,t,n)}consume(e){if(this.map.sort(function(e,t){return e[0]-t[0]}),this.map.length===0)return;let t=this.map.length,n=[];for(;t>0;)--t,n.push(e.slice(this.map[t][0]+this.map[t][1]),this.map[t][2]),e.length=this.map[t][0];n.push(e.slice()),e.length=0;let r=n.pop();for(;r;){for(let t of r)e.push(t);r=n.pop()}this.map.length=0,this.index.clear()}};function Lce(e,t,n,r){if(n===0&&r.length===0)return;let i=e.index.get(t);if(i){i[1]+=n,i[2].push(...r);return}let a=[t,n,r];e.map.push(a),e.index.set(t,a)}function Rce(e,t){let n=!1,r=[];for(;t<e.length;){let i=e[t];if(n){if(i[0]===`enter`)i[1].type===`tableContent`&&r.push(e[t+1][1].type===`tableDelimiterMarker`?`left`:`none`);else if(i[1].type===`tableContent`){if(e[t-1][1].type===`tableDelimiterMarker`){let e=r.length-1;r[e]=r[e]===`left`?`center`:`right`}}else if(i[1].type===`tableDelimiterRow`)break}else i[0]===`enter`&&i[1].type===`tableDelimiterRow`&&(n=!0);t+=1}return r}function zce(){return{flow:{null:{name:`table`,tokenize:Bce,resolveAll:Vce}}}}function Bce(e,t,n){let r=this,i=0,a=0,o;return s;function s(e){let t=r.events.length-1;for(;t>-1;){let{type:e}=r.events[t][1];if(e===`lineEnding`||e===`linePrefix`)t--;else break}let i=t>-1?r.events[t][1].type:null,a=i===`tableHead`||i===`tableRow`?S:c;return a===S&&r.parser.lazy[r.now().line]?n(e):a(e)}function c(t){return e.enter(`tableHead`),e.enter(`tableRow`),l(t)}function l(e){return e===124||(o=!0,a+=1),u(e)}function u(t){return t===null?n(t):c$(t)?a>1?(a=0,r.interrupt=!0,e.exit(`tableRow`),e.enter(`lineEnding`),e.consume(t),e.exit(`lineEnding`),p):n(t):u$(t)?h$(e,u,`whitespace`)(t):(a+=1,o&&(o=!1,i+=1),t===124?(e.enter(`tableCellDivider`),e.consume(t),e.exit(`tableCellDivider`),o=!0,u):(e.enter(`data`),d(t)))}function d(t){return t===null||t===124||l$(t)?(e.exit(`data`),u(t)):(e.consume(t),t===92?f:d)}function f(t){return t===92||t===124?(e.consume(t),d):d(t)}function p(t){return r.interrupt=!1,r.parser.lazy[r.now().line]?n(t):(e.enter(`tableDelimiterRow`),o=!1,u$(t)?h$(e,m,`linePrefix`,r.parser.constructs.disable.null.includes(`codeIndented`)?void 0:4)(t):m(t))}function m(t){return t===45||t===58?g(t):t===124?(o=!0,e.enter(`tableCellDivider`),e.consume(t),e.exit(`tableCellDivider`),h):x(t)}function h(t){return u$(t)?h$(e,g,`whitespace`)(t):g(t)}function g(t){return t===58?(a+=1,o=!0,e.enter(`tableDelimiterMarker`),e.consume(t),e.exit(`tableDelimiterMarker`),_):t===45?(a+=1,_(t)):t===null||c$(t)?b(t):x(t)}function _(t){return t===45?(e.enter(`tableDelimiterFiller`),v(t)):x(t)}function v(t){return t===45?(e.consume(t),v):t===58?(o=!0,e.exit(`tableDelimiterFiller`),e.enter(`tableDelimiterMarker`),e.consume(t),e.exit(`tableDelimiterMarker`),y):(e.exit(`tableDelimiterFiller`),y(t))}function y(t){return u$(t)?h$(e,b,`whitespace`)(t):b(t)}function b(n){return n===124?m(n):n===null||c$(n)?!o||i!==a?x(n):(e.exit(`tableDelimiterRow`),e.exit(`tableHead`),t(n)):x(n)}function x(e){return n(e)}function S(t){return e.enter(`tableRow`),C(t)}function C(n){return n===124?(e.enter(`tableCellDivider`),e.consume(n),e.exit(`tableCellDivider`),C):n===null||c$(n)?(e.exit(`tableRow`),t(n)):u$(n)?h$(e,C,`whitespace`)(n):(e.enter(`data`),w(n))}function w(t){return t===null||t===124||l$(t)?(e.exit(`data`),C(t)):(e.consume(t),t===92?T:w)}function T(t){return t===92||t===124?(e.consume(t),w):w(t)}}function Vce(e,t){let n=-1,r=!0,i=0,a=[0,0,0,0],o=[0,0,0,0],s=!1,c=0,l,u,d,f=new Ice;for(;++n<e.length;){let p=e[n],m=p[1];p[0]===`enter`?m.type===`tableHead`?(s=!1,c!==0&&(O3(f,t,c,l,u),u=void 0,c=0),l={type:`table`,start:Object.assign({},m.start),end:Object.assign({},m.end)},f.add(n,0,[[`enter`,l,t]])):m.type===`tableRow`||m.type===`tableDelimiterRow`?(r=!0,d=void 0,a=[0,0,0,0],o=[0,n+1,0,0],s&&(s=!1,u={type:`tableBody`,start:Object.assign({},m.start),end:Object.assign({},m.end)},f.add(n,0,[[`enter`,u,t]])),i=m.type===`tableDelimiterRow`?2:u?3:1):i&&(m.type===`data`||m.type===`tableDelimiterMarker`||m.type===`tableDelimiterFiller`)?(r=!1,o[2]===0&&(a[1]!==0&&(o[0]=o[1],d=D3(f,t,a,i,void 0,d),a=[0,0,0,0]),o[2]=n)):m.type===`tableCellDivider`&&(r?r=!1:(a[1]!==0&&(o[0]=o[1],d=D3(f,t,a,i,void 0,d)),a=o,o=[a[1],n,0,0])):m.type===`tableHead`?(s=!0,c=n):m.type===`tableRow`||m.type===`tableDelimiterRow`?(c=n,a[1]===0?o[1]!==0&&(d=D3(f,t,o,i,n,d)):(o[0]=o[1],d=D3(f,t,a,i,n,d)),i=0):i&&(m.type===`data`||m.type===`tableDelimiterMarker`||m.type===`tableDelimiterFiller`)&&(o[3]=n)}for(c!==0&&O3(f,t,c,l,u),f.consume(t.events),n=-1;++n<t.events.length;){let e=t.events[n];e[0]===`enter`&&e[1].type===`table`&&(e[1]._align=Rce(t.events,n))}return e}function D3(e,t,n,r,i,a){let o=r===1?`tableHeader`:r===2?`tableDelimiter`:`tableData`;n[0]!==0&&(a.end=Object.assign({},k3(t.events,n[0])),e.add(n[0],0,[[`exit`,a,t]]));let s=k3(t.events,n[1]);if(a={type:o,start:Object.assign({},s),end:Object.assign({},s)},e.add(n[1],0,[[`enter`,a,t]]),n[2]!==0){let i=k3(t.events,n[2]),a=k3(t.events,n[3]),o={type:`tableContent`,start:Object.assign({},i),end:Object.assign({},a)};if(e.add(n[2],0,[[`enter`,o,t]]),r!==2){let r=t.events[n[2]],i=t.events[n[3]];if(r[1].end=Object.assign({},i[1].end),r[1].type=`chunkText`,r[1].contentType=`text`,n[3]>n[2]+1){let t=n[2]+1,r=n[3]-n[2]-1;e.add(t,r,[])}}e.add(n[3]+1,0,[[`exit`,o,t]])}return i!==void 0&&(a.end=Object.assign({},k3(t.events,i)),e.add(i,0,[[`exit`,a,t]]),a=void 0),a}function O3(e,t,n,r,i){let a=[],o=k3(t.events,n);i&&(i.end=Object.assign({},o),a.push([`exit`,i,t])),r.end=Object.assign({},o),a.push([`exit`,r,t]),e.add(n+1,0,a)}function k3(e,t){let n=e[t],r=n[0]===`enter`?`start`:`end`;return n[1][r]}var Hce={name:`tasklistCheck`,tokenize:Wce};function Uce(){return{text:{91:Hce}}}function Wce(e,t,n){let r=this;return i;function i(t){return r.previous!==null||!r._gfmTasklistFirstContentOfListItem?n(t):(e.enter(`taskListCheck`),e.enter(`taskListCheckMarker`),e.consume(t),e.exit(`taskListCheckMarker`),a)}function a(t){return l$(t)?(e.enter(`taskListCheckValueUnchecked`),e.consume(t),e.exit(`taskListCheckValueUnchecked`),o):t===88||t===120?(e.enter(`taskListCheckValueChecked`),e.consume(t),e.exit(`taskListCheckValueChecked`),o):n(t)}function o(t){return t===93?(e.enter(`taskListCheckMarker`),e.consume(t),e.exit(`taskListCheckMarker`),e.exit(`taskListCheck`),s):n(t)}function s(r){return c$(r)?t(r):u$(r)?e.check({tokenize:Gce},t,n)(r):n(r)}}function Gce(e,t,n){return h$(e,r,`whitespace`);function r(e){return e===null?n(e):t(e)}}function Kce(e){return XQ([_ce(),Dce(),Fce(e),zce(),Uce()])}var qce={};function Jce(e){let t=this,n=e||qce,r=t.data(),i=r.micromarkExtensions||=[],a=r.fromMarkdownExtensions||=[],o=r.toMarkdownExtensions||=[];i.push(Kce(n)),a.push(pce()),o.push(mce(n))}function A3({text:e,variant:t=`assistant`,className:n}){return(0,I.jsx)(`div`,{className:U(`space-y-2`,t===`system`&&`text-xs`,n),children:(0,I.jsx)(joe,{remarkPlugins:[Jce],components:t===`system`?Yce:M3,children:e})})}var j3=e=>function({node:t,...n}){return(0,I.jsx)(`h4`,{className:e,...n})},M3={h1:j3(`text-base font-semibold`),h2:j3(`text-sm font-semibold`),h3:j3(`text-sm font-medium`),h4:j3(`text-sm font-medium`),h5:j3(`text-sm font-medium`),h6:j3(`text-sm font-medium`),p:({node:e,...t})=>(0,I.jsx)(`p`,{className:`whitespace-pre-wrap leading-relaxed`,...t}),ul:({node:e,...t})=>(0,I.jsx)(`ul`,{className:`list-disc space-y-1 pl-5 [&_ul]:mt-1 [&_ul]:list-[circle]`,...t}),ol:({node:e,...t})=>(0,I.jsx)(`ol`,{className:`list-decimal space-y-1 pl-5 [&_ol]:mt-1`,...t}),li:({node:e,...t})=>(0,I.jsx)(`li`,{className:`leading-relaxed [&>p]:whitespace-normal [&_ol]:mt-1 [&_ul]:mt-1`,...t}),blockquote:({node:e,...t})=>(0,I.jsx)(`blockquote`,{className:`border-l-2 border-muted-foreground/30 pl-3 text-muted-foreground italic`,...t}),hr:()=>(0,I.jsx)(`hr`,{className:`border-border/60`}),a:({node:e,...t})=>(0,I.jsx)(`a`,{target:`_blank`,rel:`noreferrer`,className:`underline underline-offset-2`,...t}),code:({node:e,className:t,...n})=>(0,I.jsx)(`code`,{className:U(`rounded bg-muted px-1 py-0.5 font-mono text-[0.92em]`,t),...n}),pre:({node:e,children:t})=>{let n=Xce(e);return(0,I.jsxs)(`div`,{className:`rounded-md border bg-muted/70`,children:[n&&(0,I.jsx)(`div`,{className:`border-b px-2 py-1 text-[10px] uppercase tracking-wide text-muted-foreground`,children:n}),(0,I.jsx)(`pre`,{className:`max-h-72 overflow-auto p-2 text-xs [&>code]:bg-transparent [&>code]:p-0 [&>code]:text-xs`,children:t})]})},table:({node:e,...t})=>(0,I.jsx)(`div`,{className:`overflow-x-auto rounded-md border`,children:(0,I.jsx)(`table`,{className:`w-full min-w-[480px] border-collapse text-xs`,...t})}),thead:({node:e,...t})=>(0,I.jsx)(`thead`,{className:`bg-muted/40`,...t}),tr:({node:e,...t})=>(0,I.jsx)(`tr`,{className:`border-t first:border-t-0`,...t}),th:({node:e,...t})=>(0,I.jsx)(`th`,{className:`border-b px-2 py-1.5 text-left font-semibold align-top`,...t}),td:({node:e,...t})=>(0,I.jsx)(`td`,{className:`px-2 py-1.5 align-top`,...t}),img:({node:e,alt:t,...n})=>(0,I.jsx)(`img`,{alt:t??``,className:`max-w-full rounded`,...n})},Yce={...M3,p:({node:e,...t})=>(0,I.jsx)(`p`,{className:`whitespace-pre-wrap leading-normal`,...t})};function Xce(e){let t=e?.children.find(e=>e.type===`element`&&e.tagName===`code`),n=t?.type===`element`?t.properties.className:void 0;return(Array.isArray(n)?n:[]).map(String).find(e=>e.startsWith(`language-`))?.slice(9)}function Zce({message:e,className:t,assistantLabel:n,renderActions:r,header:i,footer:a}){let o=e.role;if(o===`tool`){let n=String(e.text??``).trim();return/^(Approved|Denied) tool call\b/i.test(n)?null:(0,I.jsxs)(`div`,{className:U(`rounded-md border border-sky-500/30 bg-sky-500/10 px-3 py-2 text-sm`,t),children:[(0,I.jsxs)(`div`,{className:`mb-1 flex items-center gap-2 text-[11px] font-semibold uppercase tracking-wide text-sky-700`,children:[(0,I.jsx)(mr,{className:`h-3.5 w-3.5`}),`Tool`,(0,I.jsx)(`span`,{className:`font-normal normal-case text-sky-700/80`,children:new Date(e.createdAt).toLocaleTimeString()})]}),(0,I.jsx)(`p`,{className:`whitespace-pre-wrap text-sky-900`,children:e.text})]})}if(o===`system`)return(0,I.jsxs)(`div`,{className:U(`flex items-start gap-2 text-xs`,t),children:[(0,I.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:(0,I.jsx)(Zn,{className:`h-3 w-3`})}),(0,I.jsx)(`div`,{className:`max-w-[92%] rounded-md border border-amber-400/30 bg-amber-50/70 p-3 text-sm`,children:(0,I.jsx)(A3,{text:e.text,variant:`assistant`})})]});let s=o===`user`,c=s?fr:en;return(0,I.jsxs)(`div`,{className:U(`flex items-start gap-2 text-xs ${s?`justify-end`:`justify-start`}`,t),children:[!s&&(0,I.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:(0,I.jsx)(c,{className:`h-3 w-3`})}),(0,I.jsxs)(`div`,{className:`relative max-w-[92%]`,children:[(0,I.jsxs)(`div`,{className:`max-w-full wrap-break-word rounded-md border px-3 py-2 text-sm ${s?`border-primary/20 bg-primary/10`:`border-border/80 bg-background shadow-xs`}`,children:[!s&&n&&(0,I.jsx)(`p`,{className:`mb-2 text-[11px] font-semibold text-muted-foreground`,children:n}),i&&(0,I.jsx)(`div`,{className:e.text?`mb-2`:void 0,children:i}),s?(0,I.jsx)(`p`,{className:`whitespace-pre-wrap`,children:e.text}):e.text&&(0,I.jsx)(A3,{text:e.text,variant:`assistant`,className:`text-sm`}),a]}),r]}),s&&(0,I.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:(0,I.jsx)(fr,{className:`h-3 w-3`})})]})}function Qce(){return(0,I.jsxs)(`div`,{className:`flex items-start gap-2`,children:[(0,I.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:(0,I.jsx)(en,{className:`h-3 w-3`})}),(0,I.jsxs)(`div`,{className:`inline-flex items-center gap-2 rounded-md border bg-background px-3 py-2 text-sm text-muted-foreground`,children:[(0,I.jsx)(zn,{className:`h-4 w-4 animate-spin`}),`Thinking...`]})]})}function $ce({snippets:e,snippetsLabel:t,onSnippetSelect:n,disabled:r=!1,contentClassName:i=`w-[360px]`}){return(0,I.jsxs)(Rq,{children:[(0,I.jsx)(zq,{asChild:!0,children:(0,I.jsxs)(W,{type:`button`,variant:`ghost`,size:`sm`,className:`h-7 shrink-0 gap-1 px-1.5 text-[11px] font-normal text-muted-foreground/80 hover:text-muted-foreground`,disabled:r,children:[(0,I.jsx)(Xn,{className:`h-3 w-3`}),`Snippets`,(0,I.jsx)(on,{className:`h-3 w-3`})]})}),(0,I.jsxs)(Hq,{align:`start`,className:i,children:[(0,I.jsx)(Kq,{children:t}),(0,I.jsx)(qq,{}),e.map(e=>(0,I.jsx)(Uq,{className:`items-start whitespace-normal px-2 py-2`,onSelect:()=>n(e.prompt),children:(0,I.jsxs)(`div`,{className:`space-y-0.5`,children:[(0,I.jsx)(`div`,{className:`text-xs font-medium leading-tight`,children:e.label}),(0,I.jsx)(`div`,{className:`text-[11px] leading-snug text-muted-foreground`,children:e.description})]})},e.label))]})]})}function ele({input:e,onInputChange:t,onSend:n,onCancel:r,inputPlaceholder:i,snippets:a,snippetsLabel:o,onSnippetSelect:s,loading:c=!1,disabled:l=!1,inputRef:u,snippetContentClassName:d}){let f=l||c;return(0,I.jsxs)(`div`,{className:`rounded-xl border bg-background p-2 shadow-xs`,children:[(0,I.jsx)(iX,{ref:u,value:e,onChange:e=>t(e.target.value),placeholder:i,disabled:l,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:e=>{e.key===`Enter`&&!e.shiftKey&&(e.preventDefault(),f||n())}}),(0,I.jsxs)(`div`,{className:`mt-1 flex items-center justify-between gap-2 px-1 pt-1`,children:[(0,I.jsx)($ce,{snippets:a,snippetsLabel:o,onSnippetSelect:s,disabled:f,contentClassName:d}),c&&r?(0,I.jsxs)(W,{type:`button`,variant:`outline`,size:`sm`,className:`relative h-8 w-8 shrink-0 overflow-hidden rounded-full`,onClick:r,"aria-label":`Cancel assistant message`,title:`Cancel assistant message`,children:[(0,I.jsx)(`span`,{className:`pointer-events-none absolute inset-[2px] rounded-full border border-primary/20 border-t-primary/70 motion-reduce:animate-none animate-[spin_2.2s_linear_infinite]`}),(0,I.jsx)(`span`,{className:`pointer-events-none absolute inset-[4px] rounded-full border border-primary/10 motion-reduce:animate-none animate-pulse`}),(0,I.jsx)(sr,{className:`relative z-10 h-4 w-4`})]}):c?(0,I.jsx)(W,{type:`button`,size:`icon`,className:`h-8 w-8 shrink-0 rounded-full`,disabled:!0,"aria-label":`Assistant is loading`,title:`Assistant is loading`,children:(0,I.jsx)(zn,{className:`h-4 w-4 animate-spin`})}):(0,I.jsx)(W,{type:`button`,size:`icon`,className:`h-8 w-8 shrink-0 rounded-full pr-0.5`,onClick:n,disabled:f||!e.trim(),"aria-label":`Send assistant message`,title:`Send assistant message`,children:(0,I.jsx)(tr,{className:`h-4 w-4`})})]})]})}function N3({reasoning:e}){let t=e.durationMs===void 0,[n,r]=(0,_.useState)(void 0),i=n??t,a=t?`Thinking…`:`Thought for ${tle(e.durationMs)}`,o=e.text.trim();return o?(0,I.jsxs)(iZ,{open:i,onOpenChange:r,children:[(0,I.jsxs)(aZ,{className:`flex items-center gap-2 text-xs text-muted-foreground transition-colors hover:text-foreground`,children:[(0,I.jsx)(tn,{className:U(`h-3.5 w-3.5`,t&&`animate-pulse`)}),a,(0,I.jsx)(on,{className:U(`h-3.5 w-3.5 transition-transform`,i&&`rotate-180`)})]}),(0,I.jsx)(oZ,{className:`mt-1.5 border-l-2 border-border/70 pl-3 text-muted-foreground`,children:(0,I.jsx)(A3,{text:o,variant:`assistant`,className:`text-xs`})})]}):(0,I.jsxs)(`p`,{className:`flex items-center gap-2 text-xs text-muted-foreground`,children:[(0,I.jsx)(tn,{className:`h-3.5 w-3.5`}),a]})}function tle(e){let t=Math.max(1,Math.round(e/1e3));return`${t} second${t===1?``:`s`}`}function P3(e){let t=e.error??``;return e.status===`pending`?{state:`awaiting_approval`,label:`Needs approval`,tone:`attention`,settled:!1}:e.status===`approved`?e.resultPreview===void 0?{state:`running`,label:`Running`,tone:`progress`,settled:!1}:{state:`completed`,label:`Completed`,tone:`success`,settled:!0}:e.status===`denied`?/superseded/i.test(t)?{state:`skipped`,label:`Skipped`,tone:`neutral`,settled:!0,detail:`Not run because a new message replaced this request.`}:{state:`denied`,label:`Denied`,tone:`neutral`,settled:!0}:/outcome unknown/i.test(t)?{state:`outcome_unknown`,label:`Outcome unknown`,tone:`danger`,settled:!0,detail:`The call was interrupted while running; it may or may not have taken effect.`}:/cancelled before execution/i.test(t)?{state:`cancelled`,label:`Cancelled`,tone:`neutral`,settled:!0,detail:`Not run because the response was stopped.`}:/budget exhausted/i.test(t)?{state:`not_run`,label:`Not run`,tone:`neutral`,settled:!0,detail:`Not run because the turn reached its model-call limit.`}:{state:`failed`,label:`Error`,tone:`danger`,settled:!0}}function nle(e){let t=String(e??``).trim();return t&&(t.split(`::`).pop()??t).replace(/^mcplab__/,``).replace(/^mcplab_/,``).replace(/_/g,` `).replace(/\s+/g,` `).trim()||`unknown_tool`}function F3(e){return e.title?.trim()||L3(nle(e.tool))}function rle(e){let t=e.hints;return!t||t.readOnly?[]:[...t.destructive?[{label:`Can change or delete data`,tone:`danger`}]:[],...t.openWorld?[{label:`Reaches external systems`,tone:`caution`}]:[]]}function ile(e){let t=e.arguments;if(R3(t))return Object.entries(t).map(([t,n])=>({key:t,label:e.argumentLabels?.[t]??L3(t),value:sle(n)}))}function I3(e){if(!e.startedAt||!e.completedAt)return;let t=Date.parse(e.completedAt)-Date.parse(e.startedAt);return Number.isFinite(t)&&t>=0?ale(t):void 0}function ale(e){if(e<1e3)return`${Math.round(e)}ms`;let t=e/1e3;return t<60?`${t<10?t.toFixed(1):Math.round(t)}s`:`${Math.floor(t/60)}m ${Math.round(t%60)}s`}function ole(e){if(e.status===`error`&&e.error)return e.error;let t=R3(e.arguments)?e.arguments:{};if(e.tool===`read_mcp_resource`&&typeof t.uri==`string`)return t.uri;if(e.tool===`get_mcp_prompt`&&typeof t.name==`string`)return t.name;if(e.tool===`list_mcp_resources`||e.tool===`list_mcp_prompts`)return typeof t.server==`string`?t.server:`All servers`;let n=Object.values(t).find(e=>typeof e==`string`&&e.trim()||typeof e==`number`);return n===void 0?``:String(n)}function sle(e){if(typeof e==`string`)return e;if(e===void 0)return``;let t=JSON.stringify(e);return t.length>60?JSON.stringify(e,null,2):t}function L3(e){let t=e.replace(/([a-z0-9])([A-Z])/g,`$1 $2`).replace(/[_\-.]+/g,` `).trim().toLowerCase();return t?t[0].toUpperCase()+t.slice(1):e}function R3(e){return typeof e==`object`&&!!e&&!Array.isArray(e)}var z3=5,cle=140,lle={attention:`bg-amber-100 text-amber-800`,progress:`bg-sky-100 text-sky-800`,success:`bg-emerald-100 text-emerald-700`,neutral:`bg-muted text-muted-foreground`,danger:`bg-red-100 text-red-700`},ule={awaiting_approval:rr,running:zn,completed:an,denied:$t,skipped:pn,cancelled:pn,not_run:pn,outcome_unknown:fn,failed:un};function B3({display:e}){let t=ule[e.state];return(0,I.jsx)(`span`,{"aria-hidden":!0,className:U(`inline-flex h-5 w-5 shrink-0 items-center justify-center rounded-md`,lle[e.tone]),children:(0,I.jsx)(t,{className:U(`h-3 w-3`,e.state===`running`&&`animate-spin`)})})}function V3({call:e,disabled:t=!1,allowEdit:n=!1,onApprove:r,onDeny:i}){let a=P3(e),o=F3(e),s=e.status===`pending`,[c,l]=(0,_.useState)(!1),[u,d]=(0,_.useState)(!1),[f,p]=(0,_.useState)(``),[m,h]=(0,_.useState)(!1),[g,v]=(0,_.useState)(``),y=u?K3(f).error:void 0,b=()=>{if(t)return;if(!u)return r?.(e.id);let n=K3(f);n.error||(d(!1),r?.(e.id,n.value))},x=()=>{if(t)return;let n=m?g.trim():``;n?i?.(e.id,n):i?.(e.id)},S=e=>{s&&e.key===`Enter`&&(e.metaKey||e.ctrlKey)&&(e.preventDefault(),((e.target instanceof HTMLElement?e.target.closest(`[data-action]`)?.dataset.action:void 0)??(m?`deny`:`approve`))===`deny`?x():y||b())},C=e.status===`denied`&&e.denyMessage?`“${e.denyMessage}”`:a.state===`failed`?e.error:a.detail,w=I3(e);if(!s)return(0,I.jsxs)(iZ,{open:c,onOpenChange:l,className:`rounded-md border border-border/60 bg-background px-2.5 py-2`,"aria-label":`${o}: ${a.label}`,children:[(0,I.jsxs)(aZ,{className:`flex w-full items-center gap-2 text-left`,"aria-label":`${o}, ${a.label.toLowerCase()}. ${c?`Hide`:`Show`} what was asked`,children:[(0,I.jsx)(B3,{display:a}),(0,I.jsx)(`span`,{className:U(`min-w-0 flex-1 truncate text-sm font-medium`,a.tone===`neutral`&&`text-muted-foreground`),title:e.publicToolName,children:o}),(0,I.jsxs)(`span`,{className:U(`shrink-0 text-xs text-muted-foreground`,a.tone===`danger`&&`font-medium text-red-700`),children:[a.label,w&&(0,I.jsxs)(`span`,{className:`tabular-nums`,children:[` · `,w]})]}),(0,I.jsx)(on,{className:U(`h-3.5 w-3.5 shrink-0 text-muted-foreground transition-transform`,c&&`rotate-180`)})]}),C&&(0,I.jsx)(`p`,{className:U(`mt-1.5 whitespace-pre-wrap pl-7 text-xs`,a.state===`failed`?`text-red-700`:`text-muted-foreground`),children:C}),(0,I.jsxs)(oZ,{className:`space-y-2 pt-2`,children:[(0,I.jsx)(U3,{call:e}),(0,I.jsx)(W3,{call:e})]}),(0,I.jsx)(`output`,{"aria-live":`polite`,className:`sr-only`,children:`${o}: ${a.label}`})]});let T=rle(e);return(0,I.jsxs)(`div`,{role:`group`,"aria-label":`Approval needed: ${o}`,onKeyDown:S,className:`rounded-md border border-amber-300/70 bg-background px-2.5 py-2 shadow-xs`,children:[(0,I.jsxs)(`div`,{className:`flex items-start gap-2`,children:[(0,I.jsx)(B3,{display:a}),(0,I.jsxs)(`div`,{className:`min-w-0 flex-1`,children:[(0,I.jsxs)(`div`,{className:`flex flex-wrap items-center gap-x-2 gap-y-1`,children:[(0,I.jsx)(`span`,{className:`truncate text-sm font-medium`,title:e.publicToolName,children:o}),T.map(e=>(0,I.jsx)(`span`,{className:U(`rounded px-1.5 py-0.5 text-[10px] font-semibold`,e.tone===`danger`?`bg-red-100 text-red-800`:`bg-amber-100 text-amber-900`),children:e.label},e.label))]}),e.description&&(0,I.jsx)(`p`,{className:`mt-0.5 line-clamp-2 text-xs text-muted-foreground`,children:e.description})]}),(0,I.jsx)(`span`,{className:`shrink-0 text-xs text-amber-800`,children:a.label})]}),(0,I.jsx)(`div`,{className:`mt-2`,children:u?(0,I.jsxs)(`div`,{className:`space-y-1`,children:[(0,I.jsx)(iX,{"aria-label":`Edit tool call arguments`,value:f,onChange:e=>p(e.target.value),rows:6,className:`font-mono text-xs`}),y&&(0,I.jsx)(`p`,{className:`text-xs text-destructive`,children:y})]}):(0,I.jsx)(U3,{call:e})}),m&&(0,I.jsx)(iX,{"data-role":`reason`,"aria-label":`Reason for denying`,placeholder:`Tell the assistant why, or what to do instead (optional)`,value:g,onChange:e=>v(e.target.value),rows:2,maxLength:2e3,className:`mt-2 text-xs`,autoFocus:!0}),(0,I.jsxs)(`div`,{className:`mt-2 flex flex-wrap items-center justify-end gap-1.5`,children:[n&&!m&&(0,I.jsx)(W,{type:`button`,size:`sm`,variant:`ghost`,className:`h-7 px-2 text-xs`,disabled:t,onClick:()=>{if(u)return d(!1);p(JSON.stringify(e.arguments??{},null,2)),d(!0)},children:u?`Discard edits`:`Edit arguments`}),!u&&(0,I.jsx)(W,{type:`button`,size:`sm`,variant:`ghost`,className:`h-7 px-2 text-xs`,disabled:t,onClick:()=>h(e=>!e),children:m?`No reason`:`Add reason`}),(0,I.jsx)(W,{type:`button`,size:`sm`,variant:`outline`,className:`h-7 px-2 text-xs`,disabled:t,"data-action":`deny`,"aria-keyshortcuts":m?`Meta+Enter Control+Enter`:void 0,onClick:x,children:`Deny`}),!m&&(0,I.jsx)(W,{type:`button`,size:`sm`,className:`h-7 px-2 text-xs`,disabled:t||!!y,"data-action":`approve`,"aria-keyshortcuts":`Meta+Enter Control+Enter`,onClick:b,children:u?`Approve with edits`:`Approve`})]}),(0,I.jsx)(`output`,{"aria-live":`polite`,className:`sr-only`,children:`Approval needed: ${o}`})]})}function dle({calls:e}){let[t,n]=(0,_.useState)(!1);if(e.length===1)return(0,I.jsx)(H3,{call:e[0]});let r=e.map(e=>P3(e)),i=e.find((e,t)=>!r[t].settled),a=r.filter(e=>e.tone===`danger`).length,o=i?P3(i):a?{state:`failed`,label:``,tone:`danger`,settled:!0}:{state:`completed`,label:``,tone:`success`,settled:!0};return(0,I.jsxs)(iZ,{open:t,onOpenChange:n,className:`rounded-md border border-border/60 bg-background px-2.5 py-1.5`,children:[(0,I.jsxs)(aZ,{className:`flex w-full items-center gap-2 text-left`,children:[(0,I.jsx)(B3,{display:o}),(0,I.jsx)(`span`,{className:`min-w-0 flex-1 truncate text-sm`,children:i?`Running ${F3(i)}…`:`Used ${e.length} tools`}),a>0&&(0,I.jsxs)(`span`,{className:`shrink-0 text-xs text-red-700`,children:[a,` failed`]}),(0,I.jsx)(on,{className:U(`h-3.5 w-3.5 shrink-0 text-muted-foreground transition-transform`,t&&`rotate-180`)})]}),(0,I.jsx)(oZ,{className:`mt-1.5 space-y-0.5 border-t border-border/50 pt-1.5`,children:e.map(e=>(0,I.jsx)(H3,{call:e,bare:!0},e.id))})]})}function H3({call:e,bare:t=!1}){let[n,r]=(0,_.useState)(!1),i=P3(e),a=ole(e),o=I3(e);return(0,I.jsxs)(iZ,{open:n,onOpenChange:r,className:U(!t&&`rounded-md border border-border/60 bg-background px-2.5 py-1.5`),children:[(0,I.jsxs)(aZ,{className:`flex w-full items-center gap-2 rounded text-left hover:bg-muted/40`,"aria-label":`${F3(e)}, ${i.label.toLowerCase()}`,children:[(0,I.jsx)(B3,{display:i}),(0,I.jsx)(`span`,{className:`max-w-[45%] shrink-0 truncate text-xs font-medium`,title:e.publicToolName,children:F3(e)}),(0,I.jsx)(`span`,{className:U(`min-w-0 flex-1 truncate text-xs`,i.tone===`danger`?`text-red-700`:`text-muted-foreground`),children:a}),o&&(0,I.jsx)(`span`,{className:`shrink-0 text-xs tabular-nums text-muted-foreground`,children:o}),(0,I.jsx)(on,{className:U(`h-3 w-3 shrink-0 text-muted-foreground transition-transform`,n&&`rotate-180`)})]}),(0,I.jsxs)(oZ,{className:`space-y-2 py-1.5 pl-7`,children:[i.detail&&(0,I.jsx)(`p`,{className:`text-xs text-muted-foreground`,children:i.detail}),(0,I.jsx)(U3,{call:e}),(0,I.jsx)(W3,{call:e})]})]})}function U3({call:e}){let t=ile(e);return t?t.length?(0,I.jsx)(fle,{fields:t}):(0,I.jsx)(`p`,{className:`text-xs text-muted-foreground`,children:`No arguments`}):(0,I.jsx)(`pre`,{className:`max-h-40 overflow-auto rounded bg-muted/50 p-2 text-xs`,children:JSON.stringify(e.arguments??null,null,2)})}function fle({fields:e}){let[t,n]=(0,_.useState)(!1),r=e.length-z3,i=e.some(e=>G3(e.value)),a=t||r<=0?e:e.slice(0,z3);return(0,I.jsxs)(`div`,{className:`overflow-hidden rounded bg-muted/50 text-xs`,children:[(0,I.jsx)(`dl`,{className:`grid grid-cols-[auto_minmax(0,1fr)] gap-x-4 gap-y-1 px-2.5 py-2`,children:a.map(e=>(0,I.jsxs)(`div`,{className:`contents`,children:[(0,I.jsx)(`dt`,{className:`max-w-32 truncate text-muted-foreground`,title:e.key,children:e.label}),(0,I.jsx)(`dd`,{className:U(`m-0 min-w-0 whitespace-pre-wrap wrap-break-word`,!t&&G3(e.value)&&`line-clamp-3`),children:e.value})]},e.key))}),(r>0||i)&&(0,I.jsxs)(`button`,{type:`button`,"aria-expanded":t,onClick:()=>n(e=>!e),className:`flex w-full items-center justify-between border-t border-border/50 px-2.5 py-1 text-left text-muted-foreground hover:bg-muted`,children:[t?`Show less`:r>0?`${r} more`:`Show all`,(0,I.jsx)(on,{className:U(`h-3 w-3 transition-transform`,t&&`rotate-180`)})]})]})}function W3({call:e}){if(e.status!==`approved`||!e.resultPreview)return null;let t=async()=>{try{await navigator.clipboard.writeText(e.resultPreview??``),O({title:`Copied`})}catch(e){O({title:`Could not copy`,description:e instanceof Error?e.message:String(e),variant:`destructive`})}};return(0,I.jsxs)(`div`,{className:`rounded bg-muted/50 text-xs`,children:[(0,I.jsxs)(`div`,{className:`flex items-center justify-between px-2.5 pt-1.5`,children:[(0,I.jsx)(`span`,{className:`font-medium text-muted-foreground`,children:`Result`}),(0,I.jsxs)(`button`,{type:`button`,"aria-label":`Copy result`,onClick:()=>void t(),className:`inline-flex items-center gap-1 rounded px-1 text-muted-foreground hover:text-foreground`,children:[(0,I.jsx)(vn,{className:`h-3 w-3`}),`Copy`]})]}),(0,I.jsx)(`pre`,{className:`max-h-48 overflow-auto whitespace-pre-wrap wrap-break-word px-2.5 pb-2 pt-1`,children:e.resultPreview})]})}function G3(e){return e.length>cle||e.split(`
|
|
146
|
-
`).length>3}function K3(e){try{let t=JSON.parse(e);return typeof t!=`object`||!t||Array.isArray(t)?{error:`Arguments must be a JSON object.`}:{value:t}}catch{return{error:`Arguments must be valid JSON.`}}}var ple=48;function q3({messages:e,toolCalls:t,busy:n,starting:r=!1,expired:i=!1,onApprove:a,onDeny:o,onApproveAll:s,allowEditArguments:c=!0,renderMessageFooter:l,renderMessageAddon:u,notices:d,composer:f,className:p,scrollClassName:m,composerClassName:h}){let g=(0,_.useRef)(null),v=(0,_.useRef)(null),y=(0,_.useRef)(!0),b=e.at(-1);(0,_.useEffect)(()=>{y.current&&v.current?.scrollIntoView?.({behavior:`smooth`,block:`end`})},[e.length,b?.text,b?.reasoning?.text,t.length,n]);let x=()=>{let e=g.current;e&&(y.current=e.scrollHeight-e.scrollTop-e.clientHeight<ple)},S=e.filter(e=>e.role!==`tool`),C=new Set(e.flatMap(e=>J3(e))),w=t.filter(e=>e.status===`pending`&&!C.has(e.id)),T=n||i,E=b?.role===`assistant`&&b.reasoning!==void 0&&b.reasoning.durationMs===void 0;return(0,I.jsxs)(`div`,{className:U(`flex min-h-0 flex-1 flex-col`,p),children:[(0,I.jsx)(`div`,{ref:g,onScroll:x,className:U(`min-h-0 flex-1 overflow-y-auto`,m),children:(0,I.jsxs)(`div`,{className:`space-y-3 pr-2`,children:[d,S.map((e,n)=>{let r=e.id??`${e.role}-${n}`,i=J3(e),d=e.role===`assistant`&&i.length>0?(0,I.jsx)(mle,{message:e,calls:i.map(e=>t.find(t=>t.id===e)).filter(e=>!!e),disabled:T,allowEdit:c,onApprove:a,onDeny:o,onApproveAll:s}):(0,I.jsx)(Zce,{message:e,assistantLabel:e.role===`assistant`?`Assistant`:void 0,header:e.role===`assistant`&&e.reasoning?(0,I.jsx)(N3,{reasoning:e.reasoning}):void 0,footer:l?.(e),renderActions:e.role===`user`||e.role===`assistant`?(0,I.jsx)(hle,{text:e.text,alignLeft:e.role===`user`}):void 0});return(0,I.jsxs)(`div`,{className:`space-y-2`,children:[d,u?.(e)]},r)}),w.length>0&&(0,I.jsxs)(`div`,{className:`space-y-2`,children:[(0,I.jsx)(`div`,{className:`text-xs font-semibold uppercase tracking-wide text-muted-foreground`,children:`Pending actions`}),w.map(e=>(0,I.jsx)(V3,{call:e,disabled:T,allowEdit:c,onApprove:a,onDeny:o},e.id))]}),i&&(0,I.jsx)(`div`,{className:`rounded-md border border-amber-300 bg-amber-50 px-3 py-2 text-xs text-amber-900`,children:`This assistant session has expired. Send a new message to start a new session.`}),r&&e.length===0&&(0,I.jsxs)(`div`,{className:`flex items-center gap-2 text-sm text-muted-foreground`,children:[(0,I.jsx)(zn,{className:`h-4 w-4 animate-spin`}),`Starting assistant session...`]}),n&&!r&&!E&&(0,I.jsx)(Qce,{}),(0,I.jsx)(`div`,{ref:v})]})}),(0,I.jsx)(`div`,{className:U(`pt-3`,h),children:(0,I.jsx)(ele,{...f})})]})}function mle({message:e,calls:t,disabled:n,allowEdit:r,onApprove:i,onDeny:a,onApproveAll:o}){let s=t.filter(e=>e.requiresApproval===!1),c=t.filter(e=>e.requiresApproval!==!1),l=c.filter(e=>e.status===`pending`).length;return(0,I.jsxs)(`div`,{className:`flex items-start gap-2`,children:[(0,I.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:(0,I.jsx)(en,{className:`h-3 w-3`})}),(0,I.jsxs)(`div`,{className:`w-full min-w-0 max-w-[92%] space-y-2`,children:[e.reasoning&&(0,I.jsx)(N3,{reasoning:e.reasoning}),e.text&&(0,I.jsx)(A3,{text:e.text,className:`text-sm`}),s.length>0&&(0,I.jsx)(dle,{calls:s}),o&&c.length>1&&l>0&&(0,I.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:[(0,I.jsxs)(`span`,{className:`text-xs text-amber-900`,children:[c.length-l,` of `,c.length,` tool calls resolved`]}),(0,I.jsxs)(W,{type:`button`,size:`sm`,className:`h-7 px-2 text-xs`,disabled:n,onClick:o,children:[`Approve All (`,l,`)`]})]}),c.map(e=>(0,I.jsx)(V3,{call:e,disabled:n,allowEdit:r,onApprove:i,onDeny:a},e.id))]})]})}function hle({text:e,alignLeft:t}){let n=async()=>{try{await navigator.clipboard.writeText(e),O({title:`Copied`})}catch(e){O({title:`Could not copy`,description:e instanceof Error?e.message:String(e),variant:`destructive`})}};return(0,I.jsx)(W,{type:`button`,variant:`ghost`,size:`icon`,className:`absolute bottom-1 h-6 w-6 text-muted-foreground ${t?`-left-8`:`-right-8`}`,onClick:()=>void n(),"aria-label":`Copy message`,title:`Copy message`,children:(0,I.jsx)(vn,{className:`h-3.5 w-3.5`})})}function J3(e){return e.pendingToolCallIds??(e.pendingToolCallId?[e.pendingToolCallId]:[])}var gle=Kh,_le=Jh,Y3=_.forwardRef(({className:e,...t},n)=>(0,I.jsx)(Yh,{ref:n,className:U(`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}));Y3.displayName=Yh.displayName;var X3=_.forwardRef(({className:e,children:t,...n},r)=>(0,I.jsxs)(_le,{children:[(0,I.jsx)(Y3,{}),(0,I.jsxs)(Xh,{ref:r,className:U(`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,(0,I.jsxs)($h,{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-hidden focus:ring-2 focus:ring-ring focus:ring-offset-2 disabled:pointer-events-none`,children:[(0,I.jsx)(hr,{className:`h-4 w-4`}),(0,I.jsx)(`span`,{className:`sr-only`,children:`Close`})]})]})]}));X3.displayName=Xh.displayName;var Z3=({className:e,...t})=>(0,I.jsx)(`div`,{className:U(`flex flex-col space-y-1.5 text-center sm:text-left`,e),...t});Z3.displayName=`DialogHeader`;var Q3=_.forwardRef(({className:e,...t},n)=>(0,I.jsx)(Zh,{ref:n,className:U(`text-lg font-semibold leading-none tracking-tight`,e),...t}));Q3.displayName=Zh.displayName;var $3=_.forwardRef(({className:e,...t},n)=>(0,I.jsx)(Qh,{ref:n,className:U(`text-sm text-muted-foreground`,e),...t}));$3.displayName=Qh.displayName;async function vle(e){let{sessionId:t,source:n,serverName:r,onLaunchUrl:i,timeoutMs:a=3e5}=e,o=Date.now()+a,s=!1;for(;Date.now()<o;){let{session:e}=await n.getOAuthRuntimeSession(t),a=e.authorizeLaunchUrl||e.authorizationUrl||``;if(a&&i&&i(a),e.status===`completed`&&e.hasAccessToken){s=!0;break}if(e.status===`error`||e.status===`stopped`)throw Error(`OAuth login failed for '${r}' (${e.status}). ${e.lastError||``}`.trim());await new Promise(e=>setTimeout(e,1500))}if(!s)throw Error(`OAuth login timed out for '${r}'. Authorization was not completed within 5 minutes.`)}var yle=250;async function e6(e){let{serverNames:t,source:n,onServerAuthStart:r,onServerStatus:i,timeoutMs:a=3e5}=e,o=Array.from(new Set(t.filter(Boolean)));if(o.length===0)return;let s=Date.now()+a,c=new Set,l=new Map;for(;Date.now()<s;){let e=await n.ensureOAuthServers({serverNames:o});for(let t of e.servers){let e=`${t.status}:${t.debugState??``}:${t.runtimeSessionId??``}`;l.get(t.serverName)!==e&&(l.set(t.serverName,e),i?.({serverName:t.serverName,status:t.status,debugState:t.debugState,tokenExpiresAt:t.tokenExpiresAt,tokenExpiresInSeconds:t.tokenExpiresInSeconds,message:t.message}))}let t=e.servers.filter(e=>e.status===`auth_required`);if(t.length===0&&e.allReady)return;for(let e of t){let t=e.runtimeSessionId;if(!t)throw Error(e.message||`OAuth login required for '${e.serverName}'.`);c.has(t)||(c.add(t),r?.(e.serverName));let i=(()=>{let e=!1;return t=>{if(e||!t)return;e=!0;let n=t.startsWith(`http`)?t:`${window.location.origin}${t}`;window.open(n,`_blank`,`noopener,noreferrer`)}})();i(e.authorizeLaunchUrl||e.authorizationUrl||``),await vle({sessionId:t,source:n,serverName:e.serverName,onLaunchUrl:i,timeoutMs:Math.max(1e4,s-Date.now())})}await new Promise(e=>{window.setTimeout(e,yle)})}throw Error(`OAuth login timed out before all required servers were authorized.`)}function ble(e,t){return{createSession:n=>e.createResultAssistantSession(t,n),sendMessage:(t,n,r,i)=>e.sendResultAssistantMessage(t,n,r,i),approveToolCall:(t,n,r)=>e.approveResultAssistantToolCall(t,n,r),denyToolCall:(t,n,r)=>e.denyResultAssistantToolCall(t,n,r),...e.cancelResultAssistantTurn?{cancelTurn:(t,n)=>e.cancelResultAssistantTurn(t,n)}:{},closeSession:t=>e.closeResultAssistantSession(t),subscribe:(t,n)=>e.subscribeResultAssistantSessionEvents(t,n)}}function xle(e,t){return{createSession:t,sendMessage:(t,n,r,i)=>e.sendScenarioAssistantMessage(t,n,r,i),approveToolCall:(t,n,r)=>e.approveScenarioAssistantToolCall(t,n,r),denyToolCall:(t,n,r)=>e.denyScenarioAssistantToolCall(t,n,r),approveAllToolCalls:t=>e.approveAllScenarioAssistantToolCalls(t),...e.cancelScenarioAssistantTurn?{cancelTurn:(t,n)=>e.cancelScenarioAssistantTurn(t,n)}:{},closeSession:t=>e.closeScenarioAssistantSession(t),subscribe:(t,n)=>e.subscribeScenarioAssistantSessionEvents(t,n)}}function Sle(e=`Request aborted`){let t=Error(e);return t.name=`AbortError`,t}function t6(e){return e instanceof Error&&e.name===`AbortError`||typeof e==`object`&&!!e&&`name`in e&&e.name===`AbortError`}function Cle(e){let{messages:t,activeTurnId:n,streamingMessage:r,delta:i,kind:a=`text`}=e;if(n!==i.turnId||t.some(e=>e.id===i.messageId))return r;let o=r?.id===i.messageId?r:{id:i.messageId,turnId:i.turnId,text:``,createdAt:i.createdAt};if(o.turnId!==i.turnId)return r;if(a===`reasoning`){let e=o.reasoning??{text:``};return i.offset===e.text.length?{...o,reasoning:{...e,text:e.text+i.delta}}:r}if(i.offset!==o.text.length)return r;let s=o.reasoning;return{...o,text:o.text+i.delta,...s&&s.durationMs===void 0?{reasoning:{...s,durationMs:Date.now()-Date.parse(o.createdAt)}}:{}}}function wle(e,t){return!t||e.some(e=>e.id===t.id)?e:[...e,{id:t.id,role:`assistant`,text:t.text,createdAt:t.createdAt,...t.reasoning?{reasoning:t.reasoning}:{}}]}function Tle(e,t){return!e||e.id!==t.id||t.revision>e.revision}function Ele(e){return e.type===`assistant_message_delta`||e.type===`assistant_reasoning_delta`}function Dle(e){let{open:t,sessionId:n,sessionRef:r,subscribe:i,onSession:a,cancelTurn:o}=e,s=(0,_.useCallback)((e,t=n)=>{if(!t||e.id!==t)return!1;let i=r.current;return Tle(i,e)?(r.current=e,a(e),!0):!1},[a,n,r]);return(0,_.useEffect)(()=>{if(!t||!n||r.current?.id!==n)return;let e=!0,o=i(n,t=>{if(!e||r.current?.id!==n)return;if(Ele(t)){let e=t.payload;if(e.sessionId!==n||e.revision<=r.current.revision)return;let i=r.current;if(!i)return;let o=Cle({messages:i.messages,activeTurnId:i.activeTurnId,streamingMessage:i.streamingMessage,delta:e,kind:t.type===`assistant_reasoning_delta`?`reasoning`:`text`});if(o===i.streamingMessage)return;let s={...i,revision:e.revision,streamingMessage:o};r.current=s,a(s);return}let i=t.payload;i.sessionId===n&&i.session?.id===n&&s(i.session,n)})??(()=>void 0);return()=>{e=!1,o()}},[s,a,t,n,r,i]),{applySnapshot:s,cancelActiveTurn:(0,_.useCallback)((e,t)=>{e&&t&&o&&o(e,t)?.catch(()=>void 0)},[o])}}var n6=e=>e instanceof W_&&e.status===404,r6=e=>e instanceof Error?e.message:String(e),i6=`Assistant session expired. Send a new message to start a fresh session.`;function a6(e){let{open:t,label:n,autoStart:r=!1,recreateExpiredOnSend:i=!1}=e,a=(0,_.useRef)(e.api);a.current=e.api;let o=(0,_.useRef)(e.onSession);o.current=e.onSession;let[s,c]=(0,_.useState)(null),[l,u]=(0,_.useState)(null),[d,f]=(0,_.useState)([]),[p,m]=(0,_.useState)(!1),[h,g]=(0,_.useState)(!1),[v,y]=(0,_.useState)(!1),[b,x]=(0,_.useState)(!1),S=(0,_.useRef)(null),C=(0,_.useRef)(null),w=(0,_.useRef)(null),T=(0,_.useRef)(new AbortController),E=(0,_.useRef)(null),D=(0,_.useRef)(0),k=(0,_.useCallback)(e=>{u(e);let t=new Set(e.messages.map(e=>e.id));f(e=>e.filter(e=>!t.has(e.id))),y(!!E.current||!!e.activeTurnId),o.current?.(e)},[]),{applySnapshot:A,cancelActiveTurn:j}=Dle({open:t,sessionId:s,sessionRef:C,subscribe:(0,_.useCallback)((e,t)=>a.current.subscribe(e,t),[]),onSession:k,cancelTurn:(0,_.useCallback)((e,t)=>a.current.cancelTurn?.(e,t),[])}),M=(0,_.useCallback)((e,t)=>{S.current=e,x(!1),A(t,e),c(e)},[A]),N=(0,_.useCallback)(()=>{S.current=null,C.current=null,w.current=null,c(null)},[]),P=(0,_.useCallback)(()=>{if(S.current)return Promise.resolve(S.current);if(w.current)return w.current;let e=T.current;g(!0);let t=a.current.createSession(e.signal).then(({sessionId:n,session:r})=>{let i=n||r.id;if(e.signal.aborted||w.current!==t)throw a.current.closeSession(i).catch(()=>void 0),Sle(`Assistant session was reset while it was being created`);return M(i,r),i}).finally(()=>{w.current===t&&g(!1)});return w.current=t,t.catch(()=>{w.current===t&&(w.current=null)}),t},[M]),F=(0,_.useCallback)(()=>{T.current.abort(),T.current=new AbortController,w.current=null,g(!1)},[]);(0,_.useEffect)(()=>{r&&t&&!S.current&&!w.current&&P().catch(e=>{t6(e)||O({title:`Could not start ${n}`,description:r6(e),variant:`destructive`})})},[r,t,n,P,s]);let I=(0,_.useCallback)((e,t)=>{S.current===e&&A(t.session,e)},[A]),L=(0,_.useCallback)(async e=>{let t=e.trim();if(!t)return`failed`;let r={localId:++D.current,controller:new AbortController,prompt:t,clientTurnId:crypto.randomUUID(),sessionId:S.current??void 0},o=()=>E.current===r&&!r.controller.signal.aborted;E.current=r;let s={id:r.clientTurnId,role:`user`,text:t,createdAt:new Date().toISOString()};f(e=>[...e,s]),m(!0),y(!0);try{let e=await P();if(!o())return`cancelled`;r.sessionId=e;let n;try{n=await a.current.sendMessage(e,t,r.controller.signal,r.clientTurnId)}catch(s){if(!o()||t6(s))return`cancelled`;if(!i||!n6(s))throw s;if(N(),e=await P(),!o())return`cancelled`;r.sessionId=e,n=await a.current.sendMessage(e,t,r.controller.signal,r.clientTurnId)}return o()?(I(e,n),`sent`):`cancelled`}catch(e){return!o()||t6(e)?`cancelled`:(f(e=>e.filter(e=>e.id!==s.id)),n6(e)&&x(!0),O({title:`${n} error`,description:n6(e)?i6:r6(e),variant:`destructive`}),`failed`)}finally{E.current===r&&(E.current=null,m(!1),y(!!C.current?.activeTurnId))}},[I,N,n,i,P]),R=(0,_.useCallback)(()=>{let e=E.current,t=e?.sessionId??S.current??void 0,n=e?.clientTurnId??C.current?.activeTurnId;if(e||n)return j(t,n),e&&(e.controller.abort(),E.current=null),m(!1),y(!1),e?.prompt},[j]),z=(0,_.useCallback)(async(e,t)=>{let n=S.current;if(n){m(!0),y(!!C.current?.activeTurnId);try{I(n,await t(n))}catch(t){if(S.current!==n)return;n6(t)&&(N(),x(!0)),O({title:`Could not ${e} ${e===`approve all`?`tool calls`:`tool call`}`,description:n6(t)?i6:r6(t),variant:`destructive`})}finally{E.current||(m(!1),y(!!C.current?.activeTurnId))}}},[I,N]),ee=(0,_.useCallback)((e,t)=>z(`approve`,n=>a.current.approveToolCall(n,e,t)),[z]),te=(0,_.useCallback)((e,t)=>z(`deny`,n=>a.current.denyToolCall(n,e,t)),[z]),ne=(0,_.useCallback)(()=>z(`approve all`,e=>a.current.approveAllToolCalls?a.current.approveAllToolCalls(e):Promise.reject(Error(`Approve all is not supported`))),[z]),re=(0,_.useCallback)(()=>{F(),E.current?.controller.abort(),E.current=null;let e=S.current;e&&a.current.closeSession(e).catch(()=>void 0),N(),u(null),f([]),m(!1),y(!1),x(!1)},[N,F]);return(0,_.useEffect)(()=>()=>{T.current.abort(),E.current?.controller.abort();let e=S.current;e&&a.current.closeSession(e).catch(()=>void 0)},[]),{sessionId:s,session:l,messages:(0,_.useMemo)(()=>{let e=l?.messages??[],t=new Set(e.map(e=>e.id));return wle([...e,...d.filter(e=>!t.has(e.id))],l?.streamingMessage)},[l,d]),pendingToolCalls:l?.pendingToolCalls??[],busy:p,starting:h,cancelable:v,expired:b,start:P,send:L,cancel:R,approve:ee,deny:te,approveAll:e.api.approveAllToolCalls?ne:void 0,reset:re}}function Ole(e,t,n){if(e.type===`agent_check`){let n=String(e.label??``).trim();return n?t.find(e=>e.type===`agent_check`&&e.label===n):void 0}if(e.type===`tool_input_contains`||e.type===`tool_input_regex`||e.type===`tool_input_jsonpath`)return t.filter(t=>t.type===e.type&&t.metadata?.tool===e.tool).find(t=>e.type===`tool_input_contains`?x_(e.value)!==void 0&&x_(t.metadata?.value)===x_(e.value):e.type===`tool_input_regex`?x_(e.value)!==void 0&&x_(t.metadata?.pattern)===x_(e.value):t.metadata?.path===e.path&&e.equals===void 0==(t.metadata?.equals===void 0)&&(e.equals===void 0||t.metadata?.equals===e.equals))??t.find(t=>t.type===e.type&&t.label===n(e));let r=n(e);return t.find(t=>t.type===e.type&&t.label===r)}var o6={openai:`OpenAI`,anthropic:`Anthropic`,azure_openai:`Azure OpenAI`,azure_foundry:`Azure Foundry`};function kle(e){if(typeof e?.decision_provider==`string`&&(typeof e.decision_fallback==`string`||e.evaluator===`judge`)){let t=[`Evaluated by LLM judge`];return typeof e.judge_provider==`string`&&t.push(o6[e.judge_provider]??e.judge_provider),typeof e.judge_model==`string`&&t.push(e.judge_model),t.join(` · `)}if(typeof e?.decision_provider!=`string`){if(typeof e?.judge_provider!=`string`)return;let t=[`Evaluation Judge`,o6[e.judge_provider]??e.judge_provider];return typeof e.judge_model==`string`&&t.push(e.judge_model),t.join(` · `)}let t=[`Decision Engine · ${e.decision_provider}`],n=e.decision_requested_model??e.decision_model;typeof n==`string`&&t.push(n);for(let[n,r]of[[`decision_probability`,`probability`],[`decision_pass_threshold`,`pass ≥`],[`decision_fail_threshold`,`fail ≤`]]){let i=e[n];typeof i==`number`&&Number.isFinite(i)&&i>=0&&i<=1&&t.push(`${r} ${i.toFixed(3)}`)}return typeof e.decision_duration_ms==`number`&&Number.isFinite(e.decision_duration_ms)&&t.push(`${Math.round(e.decision_duration_ms)} ms`),t.join(` · `)}function s6(e){return e===`not_evaluated`?`Not evaluated`:e===`not_executed`?`Not executed`:e===`passed`?`Passed`:`Failed`}function c6({evalRules:e,failureReasons:t,runError:n,checkResults:r}){return n||t.find(e=>e.startsWith(`Scenario error:`))?e.map(e=>({rule:e,status:`not_executed`,failureReason:void 0})):r?.length?e.map(e=>{let t=Ole(e,r,l6),n=e.type===`agent_check`?kle(t?.metadata):void 0,i=e.type===`agent_check`&&t?.metadata?.evaluator===`decision`?(typeof t.metadata.decision_prompt==`string`?t.metadata.decision_prompt:e.prompt)?.trim():void 0;return{rule:e,status:t?.status??`not_executed`,failureReason:t?.reason,...i?{decisionInput:i}:{},...n?{decisionDetails:n}:{}}}):e.map(e=>{let n=jle(e,t);return{rule:e,status:n?`failed`:`passed`,failureReason:n}})}function l6(e){return e.type===`required_tool`?`Required tool · ${e.value}`:e.type===`forbidden_tool`?`Forbidden tool · ${e.value}`:e.type===`tool_sequence`?y_(e.sequence??[]):e.type===`tool_input_contains`?__({type:`contains`,tool:String(e.tool??``),value:String(e.value??``)}):e.type===`tool_input_regex`?__({type:`regex`,tool:String(e.tool??``),pattern:String(e.value??``)}):e.type===`tool_input_jsonpath`?__({type:`jsonpath`,tool:String(e.tool??``),path:String(e.path??``),...e.equals===void 0?{}:{equals:e.equals}}):e.type===`response_contains`?`Text contains · ${e.value}`:e.type===`response_not_contains`?`Text does not contain · ${e.value}`:e.type===`response_starts_with`?`Text starts with · ${e.value}`:e.type===`response_ends_with`?`Text ends with · ${e.value}`:e.type===`response_equals`?`Text equals · ${e.value}`:e.type===`response_regex`?`Text matches regex · ${e.value}`:e.type===`response_jsonpath`?e.equals===void 0?`JSONPath exists · ${e.path}`:`JSONPath equals · ${e.path} == ${String(e.equals)}`:e.type===`response_jsonpath_exists`?`JSONPath exists · ${e.path}`:e.type===`response_jsonpath_not_exists`?`JSONPath not exists · ${e.path}`:e.type===`agent_check`?`Agent check · ${e.label}`:`${e.type} · ${e.value}`}function Ale(e){return y_(e).replace(/^Tool sequence · /,``)}function jle(e,t){if(e.type===`tool_input_contains`||e.type===`tool_input_regex`||e.type===`tool_input_jsonpath`){let n=e.type===`tool_input_contains`?{type:`contains`,tool:String(e.tool??``),value:String(e.value??``)}:e.type===`tool_input_regex`?{type:`regex`,tool:String(e.tool??``),pattern:String(e.value??``)}:{type:`jsonpath`,tool:String(e.tool??``),path:String(e.path??``),...e.equals===void 0?{}:{equals:e.equals}},r=[v_(n,`tool_not_used`),v_(n,`input_mismatch`),v_(n,`invalid_regex`),v_(n,`invalid_jsonpath`),v_(n,`serialization`)];return t.find(e=>r.includes(e))}if(e.type===`response_jsonpath_exists`){let n=String(e.path??``).trim();return n?t.find(e=>e.startsWith(`JSONPath assertion failed: ${n}`)||e.startsWith(`JSONPath assertion failed: invalid JSON for path ${n}`)):void 0}let n=x_(e.value);if((e.type===`response_contains`||e.type===`response_not_contains`||e.type===`response_starts_with`||e.type===`response_ends_with`||e.type===`response_equals`||e.type===`response_regex`)&&n===void 0)return;let r=e.type===`required_tool`?`Required tool not used: ${e.value}`:e.type===`forbidden_tool`?`Forbidden tool used: ${e.value}`:e.type===`tool_sequence`?`Tool sequence order was not satisfied: ${(e.sequence??[]).join(` -> `)}`:e.type===`response_contains`?`Contains assertion failed: ${n}`:e.type===`response_not_contains`?`Not-contains assertion failed: ${n}`:e.type===`response_starts_with`?`Starts-with assertion failed: ${n}`:e.type===`response_ends_with`?`Ends-with assertion failed: ${n}`:e.type===`response_equals`?`Equals assertion failed: ${n}`:e.type===`response_regex`?`Regex assertion failed: ${n}`:e.type===`response_jsonpath`?e.equals===void 0?`JSONPath assertion failed: ${e.path}`:`JSONPath equals assertion failed: ${e.path}`:e.type===`response_jsonpath_not_exists`?`JSONPath not-exists assertion failed: ${e.path}`:e.type===`agent_check`?String(e.label??``):``;if(!r)return;let i=t.find(e=>e===r);if(i)return i;if(e.type===`response_regex`){let e=n??``;return e?t.find(t=>t.startsWith(`Regex assertion failed:`)&&t.includes(e)):void 0}return e.type===`response_jsonpath`||e.type===`response_jsonpath_not_exists`?t.find(t=>t.includes(e.path??``)):e.type===`tool_sequence`?t.find(t=>t.startsWith(`Tool sequence order was not satisfied: ${Ale(e.sequence??[])}`)||t.startsWith(`Required tool in sequence not used:`)):t.find(e=>e.startsWith(r))}function u6(e){if(Array.isArray(e.sequence))return e.sequence.map(e=>e.trim()).filter(Boolean);let t=typeof e.value==`string`?e.value.trim():``;return!t||t.toLowerCase()===`tool sequence`?[]:t.split(/\s*(?:->|,|\n)\s*/).map(e=>e.trim()).filter(Boolean)}function Mle(e){let t=[],n=0;for(let r of e)if(r.type===`tool_sequence`){let e=u6(r);e.length>0?t.push({type:`tool_sequence`,sequence:e}):n+=1}else t.push(r);return{rules:t,skippedToolSequences:n}}function Nle(e){if(e.type===`tool_sequence`){let t=u6(e);return t.length>0?`Tool sequence · ${t.join(` -> `)}`:`Tool sequence · No tool steps`}return l6(e)}var Ple={prompt:`Prompt`,evalRules:`Checks`,extractRules:`Value Capture Rules`};function Fle({messageId:e,suggestions:t,scenario:n,onApplyPatch:r,appliedKeys:i,onApplied:a}){let o=t=>i.has(`${e}:${t}`),s=t=>{e&&a(`${e}:${t}`),O({title:`Applied suggestion`,description:`Updated ${Ple[t]}`})},c=()=>{t.prompt&&(r({prompt:t.prompt.replacement}),s(`prompt`))},l=(e,t)=>{let i=Mle(e);r({evalRules:t===`append`?[...n.evalRules,...i.rules]:i.rules}),i.skippedToolSequences>0&&O({title:`Skipped invalid tool sequence`,description:`The assistant suggested a sequence check without any tool steps.`,variant:`destructive`}),s(`evalRules`)},u=(e,t)=>{r({extractRules:t===`append`?[...n.extractRules,...e]:e}),s(`extractRules`)},d=t.notes,f=Array.isArray(d)?d:typeof d==`string`?[d]:[];return(0,I.jsxs)(`div`,{className:`ml-0 space-y-3 rounded-md border border-dashed bg-muted/10 p-3`,children:[(0,I.jsxs)(`div`,{className:`flex items-center gap-2 text-xs font-medium text-muted-foreground`,children:[(0,I.jsx)(ar,{className:`h-3.5 w-3.5`}),`Structured Suggestions`]}),t.prompt&&(0,I.jsx)(Ile,{title:`Prompt`,rationale:t.prompt.rationale,preview:t.prompt.replacement,applied:o(`prompt`),onApply:c}),t.evalRules&&(0,I.jsx)(Lle,{rationale:t.evalRules.rationale,rules:t.evalRules.replacement,applied:o(`evalRules`),onApply:e=>l(e,`append`),onReplace:e=>l(e,`replace`)}),t.extractRules&&(0,I.jsx)(Rle,{rationale:t.extractRules.rationale,rules:t.extractRules.replacement,applied:o(`extractRules`),onApply:e=>u(e,`append`),onReplace:e=>u(e,`replace`)}),f.length>0&&(0,I.jsxs)(`div`,{className:`space-y-2 rounded-md border p-3`,children:[(0,I.jsx)(`h5`,{className:`text-sm font-medium`,children:`Notes`}),(0,I.jsx)(`ul`,{className:`list-disc space-y-1 pl-4 text-xs text-muted-foreground`,children:f.map((t,n)=>(0,I.jsx)(`li`,{children:t},`${e}-note-${n}`))})]})]})}function Ile({title:e,rationale:t,preview:n,applied:r=!1,onApply:i}){return(0,I.jsxs)(`div`,{className:`space-y-2 rounded-md border p-3 ${r?`border-emerald-300 bg-emerald-50/40`:``}`,children:[(0,I.jsx)(`div`,{className:`flex items-center justify-between gap-2`,children:(0,I.jsx)(`h5`,{className:`text-sm font-medium`,children:e})}),t&&(0,I.jsx)(`p`,{className:`text-xs text-muted-foreground`,children:t}),(0,I.jsx)(`pre`,{className:`max-h-56 overflow-auto rounded bg-muted p-2 text-xs whitespace-pre-wrap`,children:n}),(0,I.jsx)(`div`,{className:`flex justify-end`,children:(0,I.jsx)(W,{type:`button`,size:`sm`,className:`h-8`,variant:r?`secondary`:`default`,onClick:i,disabled:r,children:r?(0,I.jsxs)(I.Fragment,{children:[(0,I.jsx)(dn,{className:`mr-1.5 h-3.5 w-3.5`}),`Applied`]}):`Apply`})})]})}function Lle({rationale:e,rules:t,applied:n=!1,onApply:r,onReplace:i}){let[a,o]=(0,_.useState)(()=>new Set(t.map((e,t)=>t))),s=a.size,c=t.filter((e,t)=>a.has(t)),l=s===t.length,u=(e,t)=>{o(n=>{let r=new Set(n);return t?r.add(e):r.delete(e),r})};return(0,I.jsxs)(`div`,{className:`space-y-2 rounded-md border p-3 ${n?`border-emerald-300 bg-emerald-50/40`:``}`,children:[(0,I.jsx)(`div`,{className:`flex items-center justify-between gap-2`,children:(0,I.jsx)(`h5`,{className:`text-sm font-medium`,children:`Checks`})}),e&&(0,I.jsx)(`p`,{className:`text-xs text-muted-foreground`,children:e}),(0,I.jsxs)(`div`,{className:`space-y-2 rounded bg-muted/60 p-2`,children:[(0,I.jsxs)(`div`,{className:`flex items-center justify-between gap-2 px-1`,children:[(0,I.jsxs)(`span`,{className:`text-[11px] text-muted-foreground`,children:[s,` of `,t.length,` selected`]}),(0,I.jsx)(W,{type:`button`,size:`sm`,variant:`ghost`,className:`h-6 px-2 text-[11px]`,disabled:n||t.length===0,onClick:()=>o(l?new Set:new Set(t.map((e,t)=>t))),children:l?`Unselect all`:`Select all`})]}),t.map((e,t)=>{let r=Nle(e),i=`scenario-assistant-check-${t}-${e.type}`;return(0,I.jsxs)(`div`,{className:`flex items-start gap-2 rounded bg-background p-2`,children:[(0,I.jsx)(KX,{id:i,checked:a.has(t),disabled:n,onCheckedChange:e=>u(t,e===!0),"aria-label":`Select ${r}`}),(0,I.jsxs)(`label`,{htmlFor:i,className:`min-w-0 flex-1 cursor-pointer space-y-1`,children:[(0,I.jsx)(`span`,{className:`block text-xs font-medium`,children:r}),(0,I.jsx)(`code`,{className:`block wrap-break-word rounded bg-muted px-1.5 py-1 text-[11px] text-muted-foreground`,children:JSON.stringify(e)})]})]},`${e.type}-${t}`)})]}),(0,I.jsx)(`div`,{className:`flex justify-end gap-2`,children:n?(0,I.jsxs)(W,{type:`button`,size:`sm`,variant:`secondary`,disabled:!0,children:[(0,I.jsx)(dn,{className:`mr-1.5 h-3.5 w-3.5`}),`Applied`]}):(0,I.jsxs)(I.Fragment,{children:[(0,I.jsx)(W,{type:`button`,size:`sm`,className:`h-8`,variant:`outline`,onClick:()=>i(c),disabled:s===0,children:`Replace all`}),(0,I.jsx)(W,{type:`button`,size:`sm`,className:`h-8`,onClick:()=>r(c),disabled:s===0,children:`Add selected`})]})})]})}function Rle({rationale:e,rules:t,applied:n=!1,onApply:r,onReplace:i}){let[a,o]=(0,_.useState)(()=>new Set(t.map((e,t)=>t))),s=a.size,c=t.filter((e,t)=>a.has(t)),l=s===t.length,u=(e,t)=>{o(n=>{let r=new Set(n);return t?r.add(e):r.delete(e),r})};return(0,I.jsxs)(`div`,{className:`space-y-2 rounded-md border p-3 ${n?`border-emerald-300 bg-emerald-50/40`:``}`,children:[(0,I.jsx)(`div`,{className:`flex items-center justify-between gap-2`,children:(0,I.jsx)(`h5`,{className:`text-sm font-medium`,children:`Value Capture Rules`})}),e&&(0,I.jsx)(`p`,{className:`text-xs text-muted-foreground`,children:e}),(0,I.jsxs)(`div`,{className:`space-y-2 rounded bg-muted/60 p-2`,children:[(0,I.jsxs)(`div`,{className:`flex items-center justify-between gap-2 px-1`,children:[(0,I.jsxs)(`span`,{className:`text-[11px] text-muted-foreground`,children:[s,` of `,t.length,` selected`]}),(0,I.jsx)(W,{type:`button`,size:`sm`,variant:`ghost`,className:`h-6 px-2 text-[11px]`,disabled:n||t.length===0,onClick:()=>o(l?new Set:new Set(t.map((e,t)=>t))),children:l?`Unselect all`:`Select all`})]}),t.map((e,t)=>{let r=`${e.name} · ${e.pattern}`,i=`scenario-assistant-extract-${t}-${e.name}`;return(0,I.jsxs)(`div`,{className:`flex items-start gap-2 rounded bg-background p-2`,children:[(0,I.jsx)(KX,{id:i,checked:a.has(t),disabled:n,onCheckedChange:e=>u(t,e===!0),"aria-label":`Select ${r}`}),(0,I.jsxs)(`label`,{htmlFor:i,className:`min-w-0 flex-1 cursor-pointer space-y-1`,children:[(0,I.jsx)(`span`,{className:`block text-xs font-medium`,children:r}),(0,I.jsx)(`code`,{className:`block wrap-break-word rounded bg-muted px-1.5 py-1 text-[11px] text-muted-foreground`,children:JSON.stringify(e)})]})]},`${e.name}-${t}`)})]}),(0,I.jsx)(`div`,{className:`flex justify-end gap-2`,children:n?(0,I.jsxs)(W,{type:`button`,size:`sm`,variant:`secondary`,disabled:!0,children:[(0,I.jsx)(dn,{className:`mr-1.5 h-3.5 w-3.5`}),`Applied`]}):(0,I.jsxs)(I.Fragment,{children:[(0,I.jsx)(W,{type:`button`,size:`sm`,className:`h-8`,variant:`outline`,onClick:()=>i(c),disabled:s===0,children:`Replace all`}),(0,I.jsx)(W,{type:`button`,size:`sm`,className:`h-8`,onClick:()=>r(c),disabled:s===0,children:`Add selected`})]})})]})}var zle=[{label:`Suggest Checks`,description:`Propose stronger evaluation checks for this scenario.`,prompt:`Review the current checks in this scenario and suggest stronger alternatives. For each suggestion, explain what failure mode it catches that the existing checks miss. Prioritize checks that are deterministic, not sensitive to minor phrasing changes, and that would reliably catch regressions.`},{label:`Suggest Value Capture Rules`,description:`Recommend extract/value capture rules for key outputs.`,prompt:`Analyze the expected tool calls and outputs in this scenario and suggest value capture rules that extract the most meaningful structured data. For each rule, explain which field to capture, why it matters for evaluation, and what a good vs. bad captured value looks like.`},{label:`Generate Structured Updates`,description:`Return apply-ready Checks and Value Capture suggestions.`,prompt:[`Propose concrete scenario updates and submit them with the local propose_scenario_changes tool so they can be applied directly.`,`Then explain the proposal in ordinary prose.`,`If tool usage is clear, include at least one required_tool check.`,`For argument validation, use tool_input_contains with tool and value, tool_input_regex with tool and value, or tool_input_jsonpath with tool and path plus optional equals.`,`Prefer deterministic checks and concise capture patterns.`].join(`
|
|
147
|
-
`)},{label:`Improve Prompt Determinism`,description:`Reduce ambiguity and improve reproducibility.`,prompt:`Identify parts of this scenario's prompt or context that are ambiguous, open-ended, or likely to produce different results across runs. Suggest specific rewrites that make the expected behavior more deterministic, without changing the intent of what is being tested.`},{label:`Generate Scenario Draft`,description:`Create a draft scenario from the current context.`,prompt:`Based on the current tool configuration and context, generate a complete scenario draft. Include a clear prompt, realistic expected tool calls with arguments, meaningful checks that validate the core behavior, and at least one value capture rule. Explain your choices so I can adjust them.`}];function Ble({open:e,onOpenChange:t,configId:n,configPath:r,scenario:i,agents:a,servers:o,defaultAssistantAgentName:s,initialUserMessage:c,onApplyPatch:l}){let{source:u}=nv(),[d,f]=(0,_.useState)(``),[p,m]=(0,_.useState)(new Set),h=(0,_.useRef)(null),g=(0,_.useRef)(null),[v,y]=(0,_.useState)(!1),b=(0,_.useRef)(!1),x=s||a[0]?.id||``,S=a.length>0&&i.serverIds.length>0&&!!x,C=(0,_.useCallback)(async()=>(await e6({serverNames:Array.from(new Set(i.serverIds.filter(e=>o.find(t=>t.id===e)?.authType===`oauth2`))),source:u}),u.createScenarioAssistantSession({configId:n,configPath:r,scenarioId:i.id,selectedAssistantAgentName:x,context:{scenario:{id:i.id,name:i.name,prompt:i.prompt,serverNames:i.serverIds,evalRules:i.evalRules,extractRules:i.extractRules},availableServers:o.map(e=>({name:e.name||e.id,url:e.url})),availableAgents:a.map(e=>({name:e.name||e.id,provider:e.provider,model:e.model}))}})),[u,n,r,i,a,o,x]),w=a6({api:(0,_.useMemo)(()=>xle(u,C),[u,C]),open:e,label:`Scenario Assistant`,autoStart:S}),{sessionId:T,session:E}=w,D=w.busy||w.starting,O=w.cancelable,k=()=>{w.reset(),f(``),m(new Set),g.current=null},A=()=>{let e=w.cancel();e!==void 0&&f(e)};(0,_.useEffect)(()=>{!e&&T&&(b.current||v||k())},[e,T,v]),(0,_.useEffect)(()=>{e&&(v&&y(!1),b.current&&=!1)},[e,v]),(0,_.useEffect)(()=>{let e=h.current;if(!e)return;e.style.height=`0px`;let t=Math.min(e.scrollHeight,160);e.style.height=`${Math.max(40,t)}px`},[d,e]);let j=async e=>{if(!T)return;let t=e.trim();t&&(f(``),await w.send(t)===`failed`&&f(e=>e.trim()?e:t))},M=e=>{f(e),requestAnimationFrame(()=>h.current?.focus())};(0,_.useEffect)(()=>{if(!e||!T||!E||!S||w.busy)return;let t=String(c??``).trim();t&&g.current!==t&&(g.current=t,j(t))},[e,T,E,S,c]);let N=(e,t)=>w.approve(e,t),P=(e,t)=>w.deny(e,t),F=()=>w.approveAll?.(),L=()=>{let e=document.activeElement;e instanceof HTMLElement&&e.blur()},R=e=>{e||(L(),y(!1),b.current=!1),t(e)},z=()=>{L(),b.current=!0,y(!0),t(!1)},ee=()=>{L(),b.current=!1,y(!1),T&&k()},te=w.messages;return(0,I.jsxs)(I.Fragment,{children:[!e&&T&&(0,I.jsxs)(`div`,{className:`mt-3 flex items-center justify-between gap-2 rounded-md border bg-background px-3 py-2`,children:[(0,I.jsxs)(`div`,{className:`min-w-0`,children:[(0,I.jsx)(`p`,{className:`text-sm font-medium`,children:`Scenario Assistant (session active)`}),(0,I.jsxs)(`p`,{className:`truncate text-xs text-muted-foreground`,children:[`Resume conversation for `,(0,I.jsx)(`span`,{className:`font-mono`,children:i.id}),E?` · ${E.messages.length} messages`:``]})]}),(0,I.jsxs)(`div`,{className:`flex shrink-0 items-center gap-2`,children:[(0,I.jsxs)(W,{type:`button`,size:`sm`,variant:`outline`,onClick:()=>t(!0),children:[(0,I.jsx)(ar,{className:`mr-1.5 h-3.5 w-3.5`}),`Resume`]}),(0,I.jsx)(W,{type:`button`,size:`sm`,variant:`ghost`,className:`h-8 px-2 text-muted-foreground`,onClick:ee,"aria-label":`Discard assistant session`,title:`Discard assistant session`,children:(0,I.jsx)(hr,{className:`h-4 w-4`})})]})]}),(0,I.jsx)(gle,{open:e,onOpenChange:R,children:(0,I.jsxs)(X3,{className:`max-w-6xl h-[85vh] flex flex-col`,children:[T&&(0,I.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-hidden focus:ring-2 focus:ring-ring focus:ring-offset-2`,onClick:z,"aria-label":`Minimize assistant`,title:`Minimize assistant`,children:[(0,I.jsx)(Vn,{className:`h-4 w-4`}),(0,I.jsx)(`span`,{className:`sr-only`,children:`Minimize`})]}),(0,I.jsx)(Z3,{className:`pr-20`,children:(0,I.jsx)(`div`,{className:`flex items-start justify-between gap-3`,children:(0,I.jsxs)(`div`,{className:`min-w-0`,children:[(0,I.jsxs)(Q3,{className:`flex items-center gap-2`,children:[(0,I.jsx)(ar,{className:`h-4 w-4`}),`Scenario Assistant`]}),(0,I.jsx)($3,{children:`LLM-guided scenario authoring with MCP tool introspection and per-tool-call approval.`})]})})}),S?(0,I.jsxs)(`div`,{className:`min-h-0 flex flex-1 flex-col gap-3`,children:[(0,I.jsx)(`div`,{className:`grid gap-3 sm:grid-cols-1`,children:(0,I.jsxs)(`div`,{className:`space-y-1.5`,children:[(0,I.jsx)(Q,{className:`text-xs`,children:`MCP Context`}),(0,I.jsxs)(`div`,{className:`h-8 rounded-md border px-2 text-xs flex items-center gap-2`,children:[(0,I.jsx)(mr,{className:`h-3.5 w-3.5`}),E?`Loaded ${E.toolsLoaded} tools`:`Preparing...`]})]})}),(0,I.jsx)(q3,{messages:te,toolCalls:E?.pendingToolCalls??[],busy:w.busy,starting:w.starting,expired:w.expired,onApprove:(e,t)=>void N(e,t),onDeny:(e,t)=>void P(e,t),onApproveAll:w.approveAll?()=>void F():void 0,notices:E?.warnings?.map((e,t)=>(0,I.jsx)(`div`,{className:`rounded-md border border-amber-300 bg-amber-50 px-3 py-2 text-xs text-amber-900`,children:e},`${e}-${t}`)),renderMessageAddon:e=>e.suggestions?(0,I.jsx)(Fle,{messageId:e.id,suggestions:e.suggestions,scenario:i,onApplyPatch:l,appliedKeys:p,onApplied:e=>m(t=>new Set([...t,e]))}):null,scrollClassName:`rounded-md border p-3`,composer:{input:d,onInputChange:f,onSend:()=>void j(d),onCancel:T&&O?A:void 0,inputPlaceholder:`Get assistance with creating or refining this scenario ...`,snippets:zle,snippetsLabel:`Scenario Assistant Snippets`,onSnippetSelect:M,loading:D,disabled:!T,inputRef:h,snippetContentClassName:`w-[320px]`}})]}):(0,I.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 d6(e){return typeof e==`number`?e.toLocaleString():`n/a`}function f6(e,t){let n=t?.nonPositiveLabel??`0s`;if(!Number.isFinite(e)||e<=0)return n;let r=Math.floor(e),i=Math.floor(r/3600),a=Math.floor(r%3600/60),o=r%60;return i>0?`${i}h ${a}m ${o}s`:a>0?`${a}m ${o}s`:`${o}s`}function Vle({run:e,fallbackUserPrompt:t}){let[n,r]=(0,_.useState)(!0),[i,a]=(0,_.useState)(!1);return(0,I.jsxs)(`div`,{className:`space-y-2`,children:[(0,I.jsx)(iZ,{open:n,onOpenChange:r,children:(0,I.jsxs)(`div`,{className:`rounded-md border border-muted-foreground/20 bg-card p-2`,children:[(0,I.jsx)(aZ,{asChild:!0,children:(0,I.jsx)(`button`,{type:`button`,className:`mb-2 flex w-full items-center justify-between gap-2 text-left`,children:(0,I.jsxs)(`p`,{className:`flex items-center gap-1 text-[11px] font-semibold uppercase tracking-wide text-muted-foreground`,children:[(0,I.jsx)(on,{className:`h-3.5 w-3.5 transition-transform ${n?`rotate-180`:``}`}),(0,I.jsx)(en,{className:`h-3.5 w-3.5`}),`Final answer`]})})}),(0,I.jsx)(oZ,{children:(0,I.jsx)(g6,{text:e.finalAnswer||`No final answer captured.`,maxLength:1200,className:`text-xs text-foreground`})})]})}),(0,I.jsx)(iZ,{open:i,onOpenChange:a,children:(0,I.jsxs)(`div`,{className:`rounded-md border border-muted-foreground/20 bg-card p-2`,children:[(0,I.jsxs)(`div`,{className:`mb-2 flex flex-wrap items-center justify-between gap-2`,children:[(0,I.jsx)(aZ,{asChild:!0,children:(0,I.jsxs)(`button`,{type:`button`,className:`flex min-w-0 items-center gap-2 text-left`,children:[(0,I.jsx)(on,{className:`h-3.5 w-3.5 transition-transform ${i?`rotate-180`:``}`}),(0,I.jsx)(`p`,{className:`text-[11px] font-semibold uppercase tracking-wide text-muted-foreground`,children:`Conversation trace`})]})}),(0,I.jsxs)(Y,{variant:`outline`,className:`h-5 text-[10px]`,children:[e.toolCalls.length,` tool calls`]})]}),(0,I.jsx)(oZ,{children:(0,I.jsx)(`div`,{className:`space-y-2 rounded-md border bg-muted/20 p-2`,children:e.conversation.length===0?(0,I.jsx)(`p`,{className:`text-xs text-muted-foreground`,children:`No conversation trace captured.`}):e.conversation.map(e=>(0,I.jsx)(Hle,{item:e,fallbackUserPrompt:t},e.id))})})]})})]})}function Hle({item:e,fallbackUserPrompt:t}){if(e.kind===`tool_call`){let t=p6(e,`input`);return(0,I.jsx)(h6,{variant:`call`,title:`Tool call · ${e.toolName||`unknown`}${t}`,text:e.text})}if(e.kind===`tool_result`){let t=p6(e,`output`),n=e.ok?(0,I.jsx)(dn,{className:`h-3.5 w-3.5 text-emerald-700 dark:text-emerald-300`}):(0,I.jsx)(mn,{className:`h-3.5 w-3.5 text-rose-700 dark:text-rose-300`});return(0,I.jsx)(h6,{variant:e.ok?`result_ok`:`result_error`,title:`Tool result · ${e.toolName||`unknown`} · ${e.ok?`ok`:`error`}${typeof e.durationMs==`number`?` · ${e.durationMs}ms`:``}${t}`,text:e.text,icon:n})}let n=e.kind===`user_prompt`,r=m6(e.text,e.kind),i=t?m6(t,`user_prompt`):``,a=n&&!r&&i?i:r,o=n?`User prompt`:e.kind===`assistant_final`?`Agent final`:`Agent`,s=n?fr:en;return(0,I.jsxs)(`div`,{className:`flex items-start gap-2 text-xs ${n?`justify-end`:`justify-start`}`,children:[!n&&(0,I.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:(0,I.jsx)(s,{className:`h-3 w-3`})}),(0,I.jsxs)(`div`,{className:`max-w-[90%] rounded-md p-2 ${n?`bg-primary/10`:`bg-muted/50`}`,children:[(0,I.jsx)(`p`,{className:`mb-1 text-[11px] font-semibold text-muted-foreground ${n?`text-right`:``}`,children:o}),n?(0,I.jsx)(g6,{text:a,maxLength:280,className:`text-xs`}):(0,I.jsx)(g6,{text:a,maxLength:500,className:`text-xs`})]}),n&&(0,I.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:(0,I.jsx)(s,{className:`h-3 w-3`})})]})}function p6(e,t){let n=t===`input`?e.estimatedTokens?.inputTokens:e.estimatedTokens?.outputTokens;return typeof n==`number`?` · estimated ${d6(n)} tokens`:``}function m6(e,t){let n=String(e??``).replace(/^\s+/,``);return t===`user_prompt`?n.replace(/^user:\s*/i,``):t===`assistant_final`||t===`assistant_thought`?n.replace(/^assistant:\s*/i,``):n}function h6({variant:e,title:t,text:n,icon:r}){let[i,a]=(0,_.useState)(!1);return(0,I.jsx)(iZ,{open:i,onOpenChange:a,children:(0,I.jsxs)(`div`,{className:`rounded-md border p-2 text-xs ${{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`}[e]}`,children:[(0,I.jsx)(aZ,{asChild:!0,children:(0,I.jsxs)(`button`,{type:`button`,className:`flex w-full items-center justify-between gap-2 text-left`,children:[(0,I.jsxs)(`div`,{className:`flex items-center gap-1.5 font-mono text-[11px]`,children:[r??(0,I.jsx)(mr,{className:`h-3.5 w-3.5`}),(0,I.jsx)(`span`,{children:t})]}),(0,I.jsx)(`span`,{className:`text-[11px] font-semibold`,children:i?`Hide content`:`Show content`})]})}),(0,I.jsx)(oZ,{children:(0,I.jsx)(`p`,{className:`mt-2 font-mono whitespace-pre-wrap text-foreground`,children:n})})]})})}function g6({text:e,maxLength:t,className:n}){let[r,i]=(0,_.useState)(!1),a=e.length>t,o=r||!a?e:`${e.slice(0,t)}...`;return(0,I.jsxs)(`div`,{children:[(0,I.jsx)(A3,{text:o,className:n}),a&&(0,I.jsx)(`button`,{type:`button`,className:`mt-1 text-[11px] font-medium text-primary hover:underline`,onClick:()=>i(e=>!e),children:r?`Show less`:`Show all`})]})}var _6=[`image/jpeg`,`image/png`,`image/gif`,`image/webp`],v6=[`application/pdf`,`text/plain`,`text/markdown`,`text/csv`];function Ule(e){return _6.includes(e)||v6.includes(e)}function y6({value:e,onValueChange:t,className:n,hideToolSequence:r=!1}){return(0,I.jsxs)(OY,{value:e,onValueChange:e=>t(e),children:[(0,I.jsx)(AY,{className:n,children:(0,I.jsx)(kY,{})}),(0,I.jsxs)(NY,{children:[(0,I.jsx)(Z,{value:`required_tool`,children:`Required Tool`}),(0,I.jsx)(Z,{value:`forbidden_tool`,children:`Forbidden Tool`}),!r&&(0,I.jsx)(Z,{value:`tool_sequence`,children:`Tool Sequence`}),(0,I.jsx)(Z,{value:`agent_check`,children:`Judge Agent`}),(0,I.jsx)(Z,{value:`response_contains`,children:`Text contains`}),(0,I.jsx)(Z,{value:`response_not_contains`,children:`Text does not contain`}),(0,I.jsx)(Z,{value:`response_starts_with`,children:`Text starts with`}),(0,I.jsx)(Z,{value:`response_ends_with`,children:`Text ends with`}),(0,I.jsx)(Z,{value:`response_equals`,children:`Text equals`}),(0,I.jsx)(Z,{value:`response_regex`,children:`Text matches regex`}),(0,I.jsx)(Z,{value:`tool_input_contains`,children:`Tool input contains`}),(0,I.jsx)(Z,{value:`tool_input_regex`,children:`Tool input regex`}),(0,I.jsx)(Z,{value:`tool_input_jsonpath`,children:`Tool input JSONPath`}),(0,I.jsx)(Z,{value:`response_jsonpath`,children:`JSONPath (optional equals)`}),(0,I.jsx)(Z,{value:`response_jsonpath_exists`,children:`JSONPath exists`}),(0,I.jsx)(Z,{value:`response_jsonpath_not_exists`,children:`JSONPath not exists`})]})]})}var Wle=()=>({id:`scn-${Date.now()}`,name:``,serverIds:[],prompt:``,evalRules:[],extractRules:[]});function b6(e){return sZ(e).replace(/^Tool sequence · /,``)}function x6(e){return e.startsWith(`tool_input_`)}function S6(e){let t=e.trim();if(t)return t===`true`?!0:t===`false`?!1:Number.isNaN(Number(t))?t:Number(t)}function C6({scenarios:e,scenarioOrigins:t,scenarioOverrides:n,agents:r,servers:i,configId:a,configPath:o,defaultAssistantAgentName:s,assistantInitialPromptByScenarioId:c,assistantAutoOpenNonceByScenarioId:l,testCaseReturnToPath:u,onChange:d,readOnly:f,allowAdd:p=!f,allowStructureEdits:m=!f}){let h=(t,n)=>{d(e.map((e,r)=>r===t?{...e,...n}:e))},g=t=>d(e.filter((e,n)=>n!==t)),_=()=>d([...e,Wle()]),v=(t,n)=>{let r=t+n;if(r<0||r>=e.length)return;let i=[...e],[a]=i.splice(t,1);i.splice(r,0,a),d(i)};return(0,I.jsxs)(`div`,{className:f?`space-y-2`:`space-y-4`,children:[!f&&(0,I.jsxs)(`div`,{className:`flex items-center justify-between`,children:[(0,I.jsx)(`h3`,{className:`text-sm font-semibold`,children:`Scenarios`}),p&&m&&(0,I.jsxs)(W,{type:`button`,variant:`outline`,size:`sm`,onClick:_,children:[(0,I.jsx)(Xn,{className:`mr-1.5 h-3.5 w-3.5`}),`Add Scenario`]})]}),e.map((d,p)=>(0,I.jsx)(Gle,{scenario:d,scenarioOrigin:t?.[p],hasMcpServerOverride:n?.[p],index:p,total:e.length,agents:r,servers:i,configId:a,configPath:o,defaultAssistantAgentName:s,assistantInitialPrompt:c?.[d.id],assistantAutoOpenNonce:l?.[d.id],testCaseReturnToPath:u,onUpdate:e=>h(p,e),onMoveUp:()=>v(p,-1),onMoveDown:()=>v(p,1),onRemove:()=>g(p),readOnly:f,allowStructureEdits:m},d.id)),e.length===0&&(0,I.jsx)(`p`,{className:`text-sm text-muted-foreground text-center py-6`,children:`No scenarios configured. Add one to get started.`})]})}function Gle({scenario:e,scenarioOrigin:t,hasMcpServerOverride:n,index:r,total:i,agents:a,servers:o,configId:s,configPath:c,defaultAssistantAgentName:l,assistantInitialPrompt:u,assistantAutoOpenNonce:d,testCaseReturnToPath:f,onUpdate:p,onMoveUp:m,onMoveDown:h,onRemove:g,readOnly:v,allowStructureEdits:y}){let{source:b}=nv(),[x,S]=(0,_.useState)(`required_tool`),[C,w]=(0,_.useState)(``),[T,E]=(0,_.useState)(``),[D,k]=(0,_.useState)(``),[A,j]=(0,_.useState)(``),[M,N]=(0,_.useState)(``),[P,F]=(0,_.useState)(``),[L,R]=(0,_.useState)(``),[z,ee]=(0,_.useState)([]),[te,ne]=(0,_.useState)(!1),[re,ie]=(0,_.useState)(null),[ae,oe]=(0,_.useState)(null),[se,ce]=(0,_.useState)(!1),[B,le]=(0,_.useState)(null),[ue,de]=(0,_.useState)(``),[V,fe]=(0,_.useState)(null),[pe,me]=(0,_.useState)(!1),[he,ge]=(0,_.useState)(null),[_e,ve]=(0,_.useState)(``),[ye,be]=(0,_.useState)(``),[xe,Se]=(0,_.useState)(!1),[Ce,we]=(0,_.useState)(l||a[0]?.id||``),[Te,Ee]=(0,_.useState)(!1),[De,Oe]=(0,_.useState)(null),[ke,Ae]=(0,_.useState)(``),je=(0,_.useRef)(null);function Me(t){if(!t)return;let n=Array.from(t),r=Array(n.length).fill(null),i=0,a=0,o=()=>{let t=r.filter(e=>e!==null);t.length>0?(p({attachments:[...e.attachments??[],...t]}),a>0&&O({title:`${a} file${a>1?`s`:``} skipped`,description:`Unsupported file type. Images must be JPEG/PNG/GIF/WebP; documents must be PDF, TXT, MD, or CSV.`,variant:`destructive`})):n.length>0&&O({title:`Could not attach files`,description:a>0?`Unsupported file type. Images must be JPEG/PNG/GIF/WebP; documents must be PDF, TXT, MD, or CSV.`:`Files could not be read.`,variant:`destructive`})};n.forEach((e,t)=>{let s=new FileReader;s.onload=()=>{let c=s.result,l=c.indexOf(`,`),u=l>=0?c.slice(l+1):``;if(u){let n=c.slice(0,l).replace(`data:`,``).replace(`;base64`,``),i=n.startsWith(`image/`);Ule(n)?r[t]={type:i?`image`:`document`,media_type:n,data:u,name:e.name}:a++}++i===n.length&&o()},s.onerror=()=>{++i===n.length&&o()},s.readAsDataURL(e)})}function Ne(t){p({attachments:(e.attachments??[]).filter((e,n)=>n!==t)})}let[Pe,Fe]=(0,_.useState)(null),[Ie,Le]=(0,_.useState)(!v),Re=e=>{let t=e.target;t&&(t.closest(`button, a, input, select, textarea, [role='button']`)||Le(e=>!e))},ze=t=>t?e.evalRules.findIndex(e=>e===t):-1,Be=()=>{if(x6(x)){let t=T.trim();if(!t)return;let n;if(x===`tool_input_jsonpath`){let e=D.trim();if(!e)return;let r=S6(A);n={type:x,tool:t,path:e,...r===void 0?{}:{equals:r}}}else{let e=C.trim();if(!e)return;n={type:x,tool:t,value:e}}let r=[...e.evalRules],i=ze(B);i>=0?r[i]=n:r.push(n),p({evalRules:r}),E(``),k(``),w(``),j(``),le(null),S(`required_tool`);return}if(x===`response_jsonpath`||x===`response_jsonpath_exists`||x===`response_jsonpath_not_exists`){let t=D.trim();if(!t)return;if(x===`response_jsonpath`){let n=S6(A);p({evalRules:[...e.evalRules,{type:x,path:t,...n===void 0?{}:{equals:n}}]})}else p({evalRules:[...e.evalRules,{type:x,path:t}]});k(``),j(``);return}if(x===`agent_check`){let t=M.trim(),n=P.trim();if(!t||!n)return;let r=[...e.evalRules],i={type:`agent_check`,label:t,prompt:n},a=ze(ae);a>=0?r[a]=i:r.push(i),p({evalRules:r}),N(``),F(``),oe(null),ce(!1),S(`required_tool`);return}if(x===`tool_sequence`){let e=z.map(e=>e.trim()).filter(e=>typeof e==`string`&&e.length>0);if(e.length===0)return;Je(e);return}if(!C.trim())return;let t=[...e.evalRules],n={type:x,value:C.trim()},r=ze(B);r>=0?t[r]=n:t.push(n),p({evalRules:t}),w(``),de(``),le(null),S(`required_tool`)},Ve=()=>{let e=L.trim();e&&(ee(t=>[...t,e]),R(``))},He=(e,t)=>{let n=e+t;ee(t=>{if(n<0||n>=t.length)return t;let r=[...t],[i]=r.splice(e,1);return r.splice(n,0,i),r})},Ue=e=>{ee(t=>t.filter((t,n)=>n!==e))},We=e.evalRules.findIndex(e=>e.type===`tool_sequence`),Ge=We>=0?e.evalRules[We]:void 0,Ke=Ge?.type===`tool_sequence`?Ge.sequence??[]:[],qe=We>=0,Je=t=>{let n=[...e.evalRules],r=t.length>0?{type:`tool_sequence`,sequence:t}:null,i=ze(re),a=i>=0?i:We;a>=0?r?n[a]=r:n.splice(a,1):r&&n.push(r),p({evalRules:n}),ne(!1),ee([]),R(``),ie(null),x===`tool_sequence`&&S(`required_tool`)};(0,_.useEffect)(()=>{te&&ee(Ke)},[te,We,Ke.join(`|`)]),(0,_.useEffect)(()=>{ne(x===`tool_sequence`)},[x]),(0,_.useEffect)(()=>{ce(x===`agent_check`)},[x]),(0,_.useEffect)(()=>{re&&ze(re)<0&&ie(null),ae&&ze(ae)<0&&oe(null),B&&ze(B)<0&&le(null)},[e.evalRules,re,ae,B]),(0,_.useEffect)(()=>{re&&x!==`tool_sequence`&&ie(null),ae&&x!==`agent_check`&&oe(null),B&&B.type!==x&&le(null)},[x,re,ae,B]);let Ye=t=>{let n=e.evalRules.filter((e,n)=>n!==t);p({evalRules:n,agentContext:n.some(e=>e.type===`agent_check`)?e.agentContext:void 0})},Xe=[`response_contains`,`response_not_contains`,`response_starts_with`,`response_ends_with`,`response_equals`,`response_regex`,`tool_input_contains`,`tool_input_regex`,`tool_input_jsonpath`],Ze=()=>{_e.trim()&&ye.trim()&&(p({extractRules:[...e.extractRules,{name:_e.trim(),pattern:ye.trim()}]}),ve(``),be(``))},Qe=t=>{p({extractRules:e.extractRules.filter((e,n)=>n!==t)})},$e=t=>{p({serverIds:e.serverIds.includes(t)?e.serverIds.filter(e=>e!==t):[...e.serverIds,t]})},et={required_tool:`Required`,forbidden_tool:`Forbidden`,tool_sequence:`Sequence`,tool_input_contains:`Input Contains`,tool_input_regex:`Input Regex`,tool_input_jsonpath:`Input JSONPath`,response_contains:`Contains`,response_not_contains:`Not Contains`,response_starts_with:`Starts With`,response_ends_with:`Ends With`,response_equals:`Equals`,response_regex:`Regex`,response_jsonpath:`JSONPath`,response_jsonpath_exists:`JSONPath Exists`,response_jsonpath_not_exists:`JSONPath Not Exists`,agent_check:`Agent`},tt={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`,tool_sequence:`border-teal-300/60 bg-teal-500/10 text-teal-700`,tool_input_contains:`border-blue-300/60 bg-blue-500/10 text-blue-700`,tool_input_regex:`border-blue-300/60 bg-blue-500/10 text-blue-700`,tool_input_jsonpath:`border-blue-300/60 bg-blue-500/10 text-blue-700`,response_contains:`border-violet-300/60 bg-violet-500/10 text-violet-700`,response_not_contains:`border-amber-300/60 bg-amber-500/10 text-amber-700`,response_starts_with:`border-cyan-300/60 bg-cyan-500/10 text-cyan-700`,response_ends_with:`border-indigo-300/60 bg-indigo-500/10 text-indigo-700`,response_equals:`border-lime-300/60 bg-lime-500/10 text-lime-700`,response_regex:`border-fuchsia-300/60 bg-fuchsia-500/10 text-fuchsia-700`,response_jsonpath:`border-emerald-300/60 bg-emerald-500/10 text-emerald-700`,response_jsonpath_exists:`border-green-300/60 bg-green-500/10 text-green-700`,response_jsonpath_not_exists:`border-orange-300/60 bg-orange-500/10 text-orange-700`,agent_check:`border-teal-300/60 bg-teal-500/10 text-teal-700`},nt=x===`required_tool`||x===`forbidden_tool`,rt=x6(x),it=x===`response_jsonpath`||x===`response_jsonpath_exists`||x===`response_jsonpath_not_exists`,at=x===`tool_sequence`&&te,ot=x===`agent_check`&&se,st=e.serverIds.filter(e=>o.some(t=>t.id===e)),ct=a.map(e=>e.id).filter(Boolean),lt=st.length>0,[ut,dt]=(0,_.useState)(``),[ft,pt]=(0,_.useState)(0);(0,_.useEffect)(()=>{let e=(u??``).trim();e&&ut!==e&&(Se(!0),dt(e))},[u,ut]),(0,_.useEffect)(()=>{d&&d!==ft&&(Se(!0),pt(d))},[d,ft]),(0,_.useEffect)(()=>{fe(null),ge(null),de(``)},[e.serverIds.join(`|`)]),(0,_.useEffect)(()=>{de(``),k(``),j(``),R(``)},[x]),(0,_.useEffect)(()=>{Ce&&ct.includes(Ce)||we(l||a[0]?.id||``)},[Ce,l,a,ct]);let mt=async()=>{if(Ce){Ee(!0),Oe(null);try{await e6({serverNames:e.serverIds.filter(e=>o.find(t=>t.id===e)?.authType===`oauth2`),source:b});let t=await b.runScenarioPreview({selectedAgentName:Ce,scenario:{id:e.id,name:e.name,prompt:e.prompt,serverNames:e.serverIds,attachments:e.attachments??[],evalRules:e.evalRules,extractRules:e.extractRules}});Fe(t)}catch(e){Oe(e instanceof Error?e.message:String(e))}finally{Ee(!1)}}},ht=()=>{if(!Pe)return;let t=w6(e.evalRules,Pe.run.failureReasons,Pe.run.checkResults),n=t.length?t.map(e=>`${e.status.toUpperCase()} - ${Kle(e.rule)}${e.failureReason?` (${e.failureReason})`:``}`).join(`
|
|
148
|
-
`):`No checks configured.`,r=Object.keys(Pe.run.extractedValues).length>0?Object.entries(Pe.run.extractedValues).map(([e,t])=>`${e}: ${String(t)}`).join(`
|
|
149
|
-
`):`No extracted values.`,i=Pe.run.toolCalls.length>0?Pe.run.toolCalls.map((e,t)=>`${t+1}. ${e.name} (${e.duration}ms)`).join(`
|
|
150
|
-
`):`No tool calls.`,a=[`I ran a prompt preview for scenario '${e.id}' and want you to suggest concrete updates.`,`Run ID: ${Pe.runId}`,`Agent: ${Pe.agentName}`,`Outcome: ${Pe.run.passed?`passed`:`failed`}`,`Duration: ${Pe.run.duration}ms`,``,`Current check outcomes:`,n,``,`Tool sequence:`,i,``,`Extracted values:`,r,``,`Final answer:`,Pe.run.finalAnswer||`(empty)`,``,`If the run has a meaningful ordered tool path, suggest a tool_sequence check using the raw tool names in the tool sequence order, even if other tools appear between them.`,`Use agent_check only for semantic or fuzzy validation;`,`Please propose concrete updates to the Prompt, Checks, and/or Value Capture Rules based on this preview.`].join(`
|
|
151
|
-
`);Ae(a),Se(!0)},gt=async()=>{if(lt&&!v){me(!0),ge(null);try{await e6({serverNames:st.filter(e=>o.find(t=>t.id===e)?.authType===`oauth2`),source:b});let e=new Set;for(let t of st){let n=await b.discoverToolsForAnalysis({serverNames:[t]});for(let t of n.servers)for(let n of t.tools)e.add(n.name)}fe(Array.from(e).sort((e,t)=>e.localeCompare(t)))}catch(e){ge(e instanceof Error?e.message:`Failed to load tools`)}finally{me(!1)}}};return(0,I.jsx)(iZ,{open:Ie,onOpenChange:Le,children:(0,I.jsxs)(K,{className:v?`rounded-md border shadow-none`:`border-dashed`,children:[(0,I.jsxs)(gv,{className:`${v?`px-3 py-3`:`pb-3`} flex-row items-center justify-between space-y-0 cursor-pointer`,onClick:Re,children:[(0,I.jsxs)(`div`,{className:`flex min-w-0 items-center gap-2`,children:[!v&&(0,I.jsx)(aZ,{asChild:!0,children:(0,I.jsx)(W,{type:`button`,variant:`ghost`,size:`icon`,className:`h-7 w-7`,children:(0,I.jsx)(on,{className:`h-3.5 w-3.5 transition-transform ${Ie?`rotate-0`:`-rotate-90`}`})})}),(0,I.jsxs)(`span`,{className:`text-xs text-muted-foreground`,children:[r+1,`.`]}),(0,I.jsx)(_v,{className:`truncate text-sm font-medium`,children:e.name||`Scenario ${r+1}`}),v&&t===`referenced`&&(0,I.jsx)(W,{type:`button`,size:`sm`,variant:`outline`,className:`h-6 px-2 text-xs`,asChild:!0,children:(0,I.jsx)(np,{to:`/libraries/test-cases/${encodeURIComponent(e.id)}${f?`?returnTo=${encodeURIComponent(f)}`:``}`,children:`Edit test`})})]}),v?(0,I.jsxs)(`div`,{className:`flex items-center gap-2`,children:[t&&(0,I.jsx)(Y,{variant:t===`inline`?`secondary`:`outline-solid`,children:t===`referenced`?`Referenced`:`Inline`}),n&&(0,I.jsx)(Y,{variant:`secondary`,children:`Override`}),(0,I.jsx)(aZ,{asChild:!0,children:(0,I.jsx)(W,{type:`button`,size:`icon`,variant:`outline`,className:`h-8 w-8`,"aria-label":Ie?`Collapse scenario details`:`Expand scenario details`,children:(0,I.jsx)(on,{className:`h-4 w-4 transition-transform ${Ie?`rotate-180`:``}`})})})]}):y&&(0,I.jsxs)(`div`,{className:`flex items-center gap-1`,children:[(0,I.jsxs)(W,{type:`button`,variant:`outline`,size:`sm`,className:`h-7 gap-1.5 px-2 text-xs`,onClick:()=>Se(!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:[(0,I.jsx)(ar,{className:`h-3.5 w-3.5 text-amber-500`}),`Ask Assistant`]}),(0,I.jsx)(W,{type:`button`,variant:`ghost`,size:`icon`,className:`h-7 w-7`,onClick:m,disabled:r===0,"aria-label":`Move scenario up`,children:(0,I.jsx)(cn,{className:`h-3.5 w-3.5`})}),(0,I.jsx)(W,{type:`button`,variant:`ghost`,size:`icon`,className:`h-7 w-7`,onClick:h,disabled:r===i-1,"aria-label":`Move scenario down`,children:(0,I.jsx)(on,{className:`h-3.5 w-3.5`})}),(0,I.jsx)(W,{type:`button`,variant:`ghost`,size:`icon`,className:`h-7 w-7`,onClick:g,children:(0,I.jsx)(lr,{className:`h-3.5 w-3.5 text-destructive`})})]})]}),(0,I.jsx)(oZ,{children:(0,I.jsxs)(q,{className:`space-y-3`,children:[(0,I.jsx)(Ble,{open:xe,onOpenChange:e=>{Se(e),e||Ae(``)},configId:s,configPath:c,scenario:e,agents:a,servers:o,defaultAssistantAgentName:l,initialUserMessage:ke||u,onApplyPatch:e=>p({...e.prompt===void 0?{}:{prompt:e.prompt},...e.evalRules===void 0?{}:{evalRules:e.evalRules},...e.extractRules===void 0?{}:{extractRules:e.extractRules}})}),(0,I.jsxs)(`div`,{className:`space-y-1.5`,children:[(0,I.jsx)(Q,{className:`text-xs`,children:`Name`}),(0,I.jsx)(Op,{value:e.name,onChange:e=>p({name:e.target.value}),disabled:v,placeholder:`e.g. List directory`})]}),(0,I.jsxs)(`div`,{className:`space-y-1.5`,children:[(0,I.jsx)(Q,{className:`text-xs`,children:`Servers`}),(0,I.jsxs)(`div`,{className:`flex flex-wrap gap-1.5`,children:[o.map(t=>(0,I.jsx)(Y,{variant:e.serverIds.includes(t.id)?`default`:`outline-solid`,className:`cursor-pointer text-xs ${e.serverIds.includes(t.id)?``:`opacity-50`}`,onClick:()=>!v&&$e(t.id),children:t.name||t.id},t.id)),o.length===0&&(0,I.jsx)(`span`,{className:`text-xs text-muted-foreground`,children:`Add servers above first`})]})]}),(0,I.jsxs)(K,{className:`border bg-card`,children:[(0,I.jsxs)(gv,{className:`pb-2`,children:[(0,I.jsx)(_v,{className:`text-sm`,children:`Prompt`}),(0,I.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.`})]}),(0,I.jsxs)(q,{className:`space-y-3 pt-0`,children:[(0,I.jsx)(iX,{value:e.prompt,onChange:e=>p({prompt:e.target.value}),disabled:v,placeholder:`The prompt to send to the agent...`,rows:4,className:`text-xs`}),(0,I.jsxs)(`div`,{children:[(0,I.jsx)(`input`,{ref:je,type:`file`,accept:[..._6,...v6,`.md`].join(`,`),multiple:!0,className:`hidden`,onChange:e=>Me(e.target.files)}),(e.attachments?.length??0)>0?(0,I.jsxs)(`div`,{className:`flex flex-wrap items-start gap-2`,children:[e.attachments?.map((e,t)=>(0,I.jsxs)(`div`,{className:`group relative`,title:`${e.name??`attachment ${t+1}`}`,children:[(0,I.jsx)(`div`,{className:`flex h-16 w-16 items-center justify-center overflow-hidden rounded border bg-muted`,children:e.type===`image`?(0,I.jsx)(`img`,{src:`data:${e.media_type};base64,${e.data}`,alt:e.name??`attachment ${t+1}`,className:`h-full w-full object-cover`}):(0,I.jsx)(Dn,{className:`h-6 w-6 text-muted-foreground`})}),e.name&&(0,I.jsx)(`p`,{className:`mt-0.5 max-w-[64px] truncate text-center text-xs text-muted-foreground`,children:e.name}),!v&&(0,I.jsx)(`button`,{type:`button`,onClick:()=>Ne(t),className:`absolute -right-1 -top-1 hidden h-4 w-4 items-center justify-center rounded-full bg-destructive text-destructive-foreground group-hover:flex`,"aria-label":`Remove attachment`,children:(0,I.jsx)(hr,{className:`h-2.5 w-2.5`})})]},t)),!v&&(0,I.jsx)(`button`,{type:`button`,onClick:()=>je.current?.click(),className:`flex h-16 w-16 items-center justify-center self-start rounded border border-dashed text-muted-foreground hover:border-foreground hover:text-foreground`,"aria-label":`Attach file`,title:`Attach file (image or document)`,children:(0,I.jsx)(qn,{className:`h-4 w-4`})})]}):!v&&(0,I.jsxs)(`button`,{type:`button`,onClick:()=>je.current?.click(),className:`flex items-center gap-1.5 text-xs text-muted-foreground hover:text-foreground`,children:[(0,I.jsx)(qn,{className:`h-3.5 w-3.5`}),`Attach file`]})]})]})]}),!v&&(0,I.jsxs)(K,{className:`border bg-muted/20`,children:[(0,I.jsxs)(gv,{className:`pb-2`,children:[(0,I.jsx)(_v,{className:`text-sm`,children:`Run Prompt Preview`}),(0,I.jsx)(`p`,{className:`text-xs text-muted-foreground`,children:`Execute the current draft prompt once and inspect final answer, conversation trace, tool calls, and check outcomes.`})]}),(0,I.jsxs)(q,{className:`space-y-3`,children:[(0,I.jsxs)(`div`,{className:`grid gap-2 sm:grid-cols-[1fr_auto]`,children:[(0,I.jsxs)(`div`,{className:`space-y-1`,children:[(0,I.jsx)(Q,{className:`text-xs`,children:`Agent`}),(0,I.jsxs)(OY,{value:Ce,onValueChange:we,children:[(0,I.jsx)(AY,{className:`h-8 text-xs`,children:(0,I.jsx)(kY,{placeholder:`Select agent`})}),(0,I.jsx)(NY,{children:a.map(e=>(0,I.jsx)(Z,{value:e.id,children:e.name||e.id},e.id))})]})]}),(0,I.jsx)(`div`,{className:`flex items-end`,children:(0,I.jsx)(W,{type:`button`,variant:`outline`,size:`sm`,className:`h-8 gap-1.5 px-2 text-xs`,onClick:()=>void mt(),disabled:Te||!Ce||!e.prompt.trim()||e.serverIds.length===0,children:Te?(0,I.jsxs)(I.Fragment,{children:[(0,I.jsx)(zn,{className:`h-3.5 w-3.5 animate-spin`}),`Running...`]}):(0,I.jsxs)(I.Fragment,{children:[(0,I.jsx)(Yn,{className:`h-3.5 w-3.5`}),`Run Prompt`]})})})]}),!e.prompt.trim()&&(0,I.jsx)(`p`,{className:`text-[11px] text-muted-foreground`,children:`Add a prompt to run preview.`}),e.serverIds.length===0&&(0,I.jsx)(`p`,{className:`text-[11px] text-muted-foreground`,children:`Select at least one server to run preview.`}),De&&(0,I.jsx)(`div`,{className:`rounded-md border border-destructive/30 bg-destructive/5 px-3 py-2 text-xs text-destructive`,children:De}),Pe&&(0,I.jsxs)(`div`,{className:`space-y-2`,children:[(0,I.jsxs)(`div`,{className:`flex flex-wrap items-center gap-2 text-xs`,children:[(0,I.jsx)(Y,{variant:Pe.run.passed?`default`:`destructive`,children:Pe.run.passed?`Passed`:`Failed`}),(0,I.jsxs)(Y,{variant:`outline`,children:[Pe.run.duration,`ms`]}),(0,I.jsxs)(Y,{variant:`outline`,children:[Pe.run.toolCalls.length,` tool calls`]}),(0,I.jsx)(Y,{variant:`outline`,className:`font-mono`,children:Pe.agentName}),(0,I.jsxs)(W,{type:`button`,variant:`outline`,size:`sm`,className:`ml-auto h-6 gap-1.5 px-2 text-[11px]`,onClick:ht,children:[(0,I.jsx)(ar,{className:`h-3.5 w-3.5 text-amber-500`}),`Send to Assistant`]})]}),e.evalRules.length===0?(0,I.jsxs)(`div`,{className:`rounded-md border bg-muted/20 p-2`,children:[(0,I.jsx)(`p`,{className:`mb-2 text-[11px] font-semibold uppercase tracking-wide text-muted-foreground`,children:`Check results`}),(0,I.jsx)(`p`,{className:`text-xs text-muted-foreground`,children:`No checks configured for this scenario.`})]}):(()=>{let t=w6(e.evalRules,Pe.run.failureReasons,Pe.run.checkResults),n=t.filter(e=>e.status===`passed`),r=t.filter(e=>e.status===`failed`);return(0,I.jsxs)(`div`,{className:`rounded-md border bg-muted/20 p-2`,children:[(0,I.jsxs)(`div`,{className:`mb-2 flex items-center gap-2`,children:[(0,I.jsx)(`p`,{className:`text-[11px] font-semibold uppercase tracking-wide text-muted-foreground`,children:`Checks`}),(0,I.jsxs)(Y,{variant:`outline`,className:`h-5 border-success/30 bg-success/10 text-success text-[10px]`,children:[n.length,` passed`]}),(0,I.jsxs)(Y,{variant:`outline`,className:`h-5 text-[10px] ${r.length>0?`border-destructive/30 bg-destructive/10 text-destructive`:``}`,children:[r.length,` failed`]})]}),(0,I.jsx)(`div`,{className:`space-y-1`,children:t.map((t,n)=>(0,I.jsxs)(`div`,{className:`flex items-start justify-between gap-2 rounded-md border px-2 py-1.5 text-xs ${t.status===`failed`?`border-destructive/20 bg-destructive/5`:t.status===`not_executed`?`border-amber-500/20 bg-amber-500/5`:t.status===`not_evaluated`?`border-muted-foreground/20 bg-muted/40`:`border-success/20 bg-success/5`}`,children:[(0,I.jsxs)(`div`,{className:`min-w-0`,children:[(0,I.jsxs)(`div`,{className:`flex items-center gap-2`,children:[t.status===`failed`?(0,I.jsx)(mn,{className:`h-3.5 w-3.5 shrink-0 text-destructive`}):t.status===`not_executed`?(0,I.jsx)(gn,{className:`h-3.5 w-3.5 shrink-0 text-amber-600`}):t.status===`not_evaluated`?(0,I.jsx)(gn,{className:`h-3.5 w-3.5 shrink-0 text-muted-foreground`}):(0,I.jsx)(dn,{className:`h-3.5 w-3.5 shrink-0 text-success`}),(0,I.jsx)(`span`,{className:`font-medium`,children:qle(t.rule)})]}),t.failureReason&&(0,I.jsx)(`p`,{className:`mt-1 pl-5 text-[11px] text-muted-foreground`,children:Jle(t.failureReason)})]}),(0,I.jsx)(Y,{variant:`outline`,className:`shrink-0 text-[10px] ${t.status===`failed`?`border-destructive/30 text-destructive`:t.status===`not_executed`?`border-amber-500/30 text-amber-600`:t.status===`not_evaluated`?`border-muted-foreground/30 text-muted-foreground`:`border-success/30 text-success`}`,children:s6(t.status)})]},`${e.id}-preview-check-${n}`))})]})})(),Pe.run.failureReasons.length>0&&(0,I.jsxs)(`div`,{className:`rounded-md border border-destructive/30 bg-destructive/5 px-3 py-2`,children:[(0,I.jsx)(`p`,{className:`mb-1 text-[11px] font-semibold uppercase tracking-wide text-destructive`,children:`Check failures`}),(0,I.jsx)(`ul`,{className:`list-disc space-y-1 pl-4 text-xs text-destructive`,children:Pe.run.failureReasons.map((e,t)=>(0,I.jsx)(`li`,{children:e},`${Pe.runId}-failure-${t}`))})]}),Object.keys(Pe.run.extractedValues).length>0&&(0,I.jsxs)(`div`,{className:`rounded-md border bg-background p-2`,children:[(0,I.jsx)(`p`,{className:`mb-2 text-[11px] font-semibold uppercase tracking-wide text-muted-foreground`,children:`Extracted values`}),(0,I.jsx)(`div`,{className:`grid gap-1.5 sm:grid-cols-2`,children:Object.entries(Pe.run.extractedValues).map(([e,t])=>(0,I.jsxs)(`div`,{className:`rounded border bg-muted/20 px-2 py-1 text-xs`,children:[(0,I.jsx)(`div`,{className:`font-mono text-[11px] text-muted-foreground`,children:e}),(0,I.jsx)(`div`,{className:`break-all`,children:String(t)})]},e))})]}),(0,I.jsx)(Vle,{run:Pe.run,fallbackUserPrompt:e.prompt})]})]})]}),(0,I.jsxs)(`div`,{className:`grid gap-3 lg:grid-cols-2`,children:[(0,I.jsxs)(K,{className:`border bg-muted/20`,children:[(0,I.jsx)(gv,{className:`pb-2`,children:(0,I.jsxs)(`div`,{className:`flex items-start justify-between gap-2`,children:[(0,I.jsxs)(`div`,{className:`min-w-0`,children:[(0,I.jsx)(_v,{className:`text-sm`,children:`Checks`}),(0,I.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.`})]}),!v&&(0,I.jsx)(`div`,{className:`flex items-center gap-2`,children:(0,I.jsxs)(W,{type:`button`,variant:`outline`,size:`sm`,className:`h-7 gap-1.5 px-2 text-xs shrink-0`,onClick:()=>Se(!0),title:`Ask for help improving checks`,children:[(0,I.jsx)(ar,{className:`h-3.5 w-3.5 text-amber-500`}),`Ask Assistant`]})})]})}),(0,I.jsx)(q,{className:`space-y-2`,children:(0,I.jsxs)(`div`,{className:`space-y-2`,children:[(0,I.jsx)(Q,{className:`text-xs`,children:`Checks (pass / fail)`}),(0,I.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.`}),(0,I.jsx)(`div`,{className:`space-y-1.5`,children:e.evalRules.length===0?(0,I.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((e,t)=>(0,I.jsxs)(`div`,{className:`flex items-start justify-between gap-2 rounded-md border bg-background px-2 py-2 text-xs`,children:[(0,I.jsx)(`div`,{className:`min-w-0`,children:(0,I.jsxs)(`div`,{className:`flex items-center gap-2`,children:[(0,I.jsx)(`span`,{className:`rounded-full border px-1.5 py-0.5 text-[10px] font-semibold uppercase tracking-wide ${tt[e.type]}`,children:et[e.type]}),e.type===`agent_check`?(0,I.jsxs)(`div`,{className:`min-w-0`,children:[(0,I.jsx)(`div`,{className:`font-medium leading-tight`,children:e.label||`Unnamed check`}),e.prompt&&(0,I.jsx)(`div`,{className:`mt-0.5 wrap-break-word text-[11px] leading-snug text-muted-foreground`,children:e.prompt})]}):e.type===`tool_sequence`?(0,I.jsx)(`span`,{className:`font-mono break-all`,children:b6(e.sequence??[])}):x6(e.type)?(0,I.jsx)(`span`,{className:`font-mono break-all`,children:e.type===`tool_input_contains`?`${e.tool} contains ${String(e.value)}`:e.type===`tool_input_regex`?`${e.tool} matches ${String(e.value)}`:`${e.tool} · ${e.path} · ${e.equals===void 0?`exists`:`== ${String(e.equals)}`}`}):(0,I.jsx)(`span`,{className:`font-mono break-all`,children:e.path?e.equals===void 0?e.path:`${e.path} == ${String(e.equals)}`:e.value})]})}),!v&&(0,I.jsxs)(`div`,{className:`flex items-center gap-1`,children:[(e.type===`tool_sequence`||e.type===`agent_check`||Xe.includes(e.type))&&(0,I.jsx)(W,{type:`button`,variant:`ghost`,size:`sm`,className:`h-6 px-2 text-[11px]`,onClick:()=>{e.type===`tool_sequence`?(S(`tool_sequence`),ee(e.sequence??[]),ie(e),ne(!0)):e.type===`agent_check`?(S(`agent_check`),oe(e),N(e.label??``),F(e.prompt??``),ce(!0)):(S(e.type),le(e),w(String(e.value??``)),E(e.tool??``),k(e.path??``),j(e.equals===void 0?``:String(e.equals)))},"aria-label":`Edit check ${t+1}`,children:(0,I.jsx)(or,{className:`h-3.5 w-3.5`})}),(0,I.jsx)(W,{type:`button`,variant:`ghost`,size:`icon`,className:`h-6 w-6 shrink-0`,onClick:()=>Ye(t),"aria-label":`Remove check ${t+1}`,children:(0,I.jsx)(hr,{className:`h-3.5 w-3.5`})})]})]},t))}),!v&&(0,I.jsxs)(`div`,{className:`space-y-2`,children:[ot?(0,I.jsxs)(`div`,{className:`space-y-2`,children:[(0,I.jsxs)(`div`,{className:`flex items-end gap-2`,children:[(0,I.jsx)(y6,{value:x,onValueChange:S,className:`h-8 w-58 shrink-0 text-xs`}),(0,I.jsx)(Op,{value:M,onChange:e=>N(e.target.value),placeholder:`Prompt name`,className:`h-8 text-xs`}),(0,I.jsx)(W,{type:`button`,variant:`outline`,size:`sm`,className:`h-8 shrink-0`,onClick:Be,children:ae===null?`Add check`:`Update check`})]}),(0,I.jsx)(iX,{value:P,onChange:e=>F(e.target.value),placeholder:`Judge prompt. Example: Confirm the answer includes a valid earliest and latest timestamp range, and that neither is 'Not available'.`,className:`min-h-[64px] text-xs`})]}):(0,I.jsxs)(`div`,{className:`flex gap-2 items-end`,children:[(0,I.jsx)(y6,{value:x,onValueChange:S,className:`h-8 w-58 shrink-0 text-xs`,hideToolSequence:qe&&x!==`tool_sequence`}),it?(0,I.jsxs)(I.Fragment,{children:[(0,I.jsx)(Op,{value:D,onChange:e=>k(e.target.value),placeholder:`JSONPath (e.g. $.status)`,className:`h-8 text-xs font-mono`,onKeyDown:e=>e.key===`Enter`&&(e.preventDefault(),Be())}),x===`response_jsonpath`&&(0,I.jsx)(Op,{value:A,onChange:e=>j(e.target.value),placeholder:`Equals (optional)`,className:`h-8 w-48 text-xs font-mono`,onKeyDown:e=>e.key===`Enter`&&(e.preventDefault(),Be())})]}):rt?(0,I.jsxs)(I.Fragment,{children:[V&&V.length>0?(0,I.jsxs)(OY,{value:T,onValueChange:E,children:[(0,I.jsx)(AY,{className:`h-8 text-xs font-mono`,children:(0,I.jsx)(kY,{placeholder:`Select tool`})}),(0,I.jsx)(NY,{children:V.map(e=>(0,I.jsx)(Z,{value:e,children:e},e))})]}):(0,I.jsx)(Op,{value:T,onChange:e=>E(e.target.value),placeholder:`Tool name`,className:`h-8 text-xs font-mono`}),x===`tool_input_jsonpath`&&(0,I.jsx)(Op,{value:D,onChange:e=>k(e.target.value),placeholder:`JSONPath (e.g. $.query)`,className:`h-8 text-xs font-mono`}),x===`tool_input_jsonpath`?(0,I.jsx)(Op,{value:A,onChange:e=>j(e.target.value),placeholder:`Equals (optional)`,className:`h-8 w-40 text-xs font-mono`}):(0,I.jsx)(Op,{value:C,onChange:e=>w(e.target.value),placeholder:x===`tool_input_regex`?`Regex pattern`:`Text present in input`,className:`h-8 w-40 text-xs font-mono`})]}):at?(0,I.jsxs)(`div`,{className:`min-w-0 flex-1 flex items-end gap-2`,children:[(0,I.jsx)(Op,{value:L,onChange:e=>R(e.target.value),placeholder:`Tool name`,className:`h-8 text-xs font-mono`,onKeyDown:e=>e.key===`Enter`&&(e.preventDefault(),Ve())}),(0,I.jsx)(W,{type:`button`,variant:`outline`,size:`sm`,className:`h-8 shrink-0`,onClick:Ve,children:`Add step`})]}):(0,I.jsx)(Op,{value:C,onChange:e=>w(e.target.value),placeholder:`Value`,className:`h-8 text-xs font-mono`,onKeyDown:e=>e.key===`Enter`&&(e.preventDefault(),Be())}),(0,I.jsx)(W,{type:`button`,variant:`outline`,size:`sm`,className:`h-8 shrink-0`,onClick:Be,children:B===null?`Add`:`Update check`})]}),at&&(0,I.jsxs)(`div`,{className:`space-y-2 rounded-md border bg-background px-2 py-2`,children:[(0,I.jsxs)(`div`,{className:`flex items-center justify-between gap-2`,children:[(0,I.jsxs)(`div`,{children:[(0,I.jsx)(Q,{className:`text-xs`,children:`Sequence steps`}),(0,I.jsx)(`p`,{className:`text-[11px] text-muted-foreground`,children:`Require these tools in order. Other tools may appear between them.`})]}),!v&&z.length>0&&(0,I.jsxs)(`div`,{className:`flex items-center gap-2`,children:[(0,I.jsx)(W,{type:`button`,variant:`ghost`,size:`sm`,className:`h-7 px-2 text-[11px]`,onClick:()=>ee([]),children:`Clear`}),(0,I.jsx)(W,{type:`button`,variant:`outline`,size:`sm`,className:`h-7 px-2 text-[11px]`,onClick:()=>Je(z),children:qe?`Update sequence`:`Add sequence`})]})]}),z.length===0?(0,I.jsx)(`p`,{className:`rounded-md border border-dashed bg-muted/20 px-2 py-2 text-xs text-muted-foreground`,children:`No ordered tool sequence yet.`}):(0,I.jsx)(`div`,{className:`space-y-1.5`,children:z.map((t,n)=>(0,I.jsxs)(`div`,{className:`flex items-center gap-2 rounded-md border bg-muted/10 px-2 py-1.5`,children:[(0,I.jsxs)(`span`,{className:`text-xs font-medium`,children:[n+1,`.`]}),(0,I.jsx)(`span`,{className:`min-w-0 flex-1 font-mono text-xs break-all`,children:t}),!v&&(0,I.jsxs)(`div`,{className:`flex items-center gap-1`,children:[(0,I.jsx)(W,{type:`button`,variant:`ghost`,size:`icon`,className:`h-6 w-6`,onClick:()=>He(n,-1),disabled:n===0,"aria-label":`Move tool ${n+1} up`,children:(0,I.jsx)(cn,{className:`h-3.5 w-3.5`})}),(0,I.jsx)(W,{type:`button`,variant:`ghost`,size:`icon`,className:`h-6 w-6`,onClick:()=>He(n,1),disabled:n===z.length-1,"aria-label":`Move tool ${n+1} down`,children:(0,I.jsx)(on,{className:`h-3.5 w-3.5`})}),(0,I.jsx)(W,{type:`button`,variant:`ghost`,size:`icon`,className:`h-6 w-6`,onClick:()=>Ue(n),"aria-label":`Remove tool ${n+1}`,children:(0,I.jsx)(hr,{className:`h-3.5 w-3.5`})})]})]},`${e.id}-tool-sequence-draft-${n}`))})]}),nt&&(0,I.jsxs)(`div`,{className:`space-y-1`,children:[(0,I.jsxs)(`div`,{className:`flex items-end gap-2`,children:[(0,I.jsxs)(`div`,{className:`min-w-0 flex-1`,children:[(0,I.jsx)(Q,{className:`mb-1 block text-[11px] text-muted-foreground`,children:`Pick from selected server tools (optional)`}),(0,I.jsxs)(OY,{value:ue,onValueChange:e=>{de(e),w(e)},disabled:pe||!V||V.length===0,children:[(0,I.jsx)(AY,{className:`h-8 text-xs`,children:(0,I.jsx)(kY,{placeholder:pe?`Loading tools...`:V&&V.length>0?`Select tool to insert in value field`:`Load tools first`})}),(0,I.jsx)(NY,{children:(V??[]).map(e=>(0,I.jsx)(Z,{value:e,children:e},e))})]})]}),(0,I.jsx)(W,{type:`button`,variant:`outline`,size:`sm`,className:`h-8 shrink-0`,onClick:gt,disabled:!lt||pe,children:pe?`Loading...`:V?`Refresh tools`:`Load tools`})]}),!lt&&(0,I.jsx)(`p`,{className:`text-[11px] text-muted-foreground`,children:`Select at least one server in this scenario to load tool names.`}),he&&(0,I.jsxs)(`p`,{className:`text-[11px] text-destructive`,children:[`Could not load tools: `,he]})]})]})]})})]}),(0,I.jsxs)(K,{className:`border bg-muted/10`,children:[(0,I.jsx)(gv,{className:`pb-2`,children:(0,I.jsxs)(`div`,{className:`flex items-start justify-between gap-2`,children:[(0,I.jsxs)(`div`,{className:`min-w-0`,children:[(0,I.jsx)(_v,{className:`text-sm`,children:`Value Capture Rules`}),(0,I.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 and comparisons.`})]}),!v&&(0,I.jsxs)(W,{type:`button`,variant:`outline`,size:`sm`,className:`h-7 gap-1.5 px-2 text-xs shrink-0`,onClick:()=>Se(!0),title:`Ask for help improving value capture rules`,children:[(0,I.jsx)(ar,{className:`h-3.5 w-3.5 text-amber-500`}),`Ask Assistant`]})]})}),(0,I.jsx)(q,{className:`space-y-2`,children:(0,I.jsxs)(`div`,{className:`space-y-2`,children:[(0,I.jsx)(Q,{className:`text-xs`,children:`Value Capture Rules`}),(0,I.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.`}),(0,I.jsx)(`div`,{className:`space-y-1.5`,children:e.extractRules.length===0?(0,I.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((e,t)=>(0,I.jsxs)(`div`,{className:`flex items-center justify-between gap-2 rounded-md border bg-background px-2 py-2 text-xs`,children:[(0,I.jsx)(`div`,{className:`min-w-0`,children:(0,I.jsxs)(`div`,{className:`flex items-center gap-2`,children:[(0,I.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:e.name}),(0,I.jsx)(`span`,{className:`text-[11px] font-semibold text-muted-foreground`,children:`regex:`}),(0,I.jsx)(`code`,{className:`font-mono break-all text-foreground`,children:e.pattern})]})}),!v&&(0,I.jsx)(W,{type:`button`,variant:`ghost`,size:`icon`,className:`h-6 w-6 shrink-0`,onClick:()=>Qe(t),"aria-label":`Remove value capture rule ${t+1}`,children:(0,I.jsx)(hr,{className:`h-3.5 w-3.5`})})]},t))}),!v&&(0,I.jsxs)(`div`,{className:`flex gap-2 items-end`,children:[(0,I.jsx)(Op,{value:_e,onChange:e=>ve(e.target.value),placeholder:`Field name`,className:`h-8 text-xs w-36`}),(0,I.jsx)(Op,{value:ye,onChange:e=>be(e.target.value),placeholder:`Regex pattern`,className:`h-8 text-xs font-mono`,onKeyDown:e=>e.key===`Enter`&&(e.preventDefault(),Ze())}),(0,I.jsx)(W,{type:`button`,variant:`outline`,size:`sm`,className:`h-8 shrink-0`,onClick:Ze,children:`Add`})]})]})})]})]}),e.evalRules.some(e=>e.type===`agent_check`)&&(0,I.jsxs)(K,{className:`border bg-muted/10`,children:[(0,I.jsx)(gv,{className:`pb-2`,children:(0,I.jsxs)(`div`,{className:`min-w-0`,children:[(0,I.jsx)(_v,{className:`text-sm`,children:`Judge context`}),(0,I.jsx)(`p`,{className:`mt-1 text-xs text-muted-foreground`,children:`Extra context is shared across all judge checks in this scenario and sent once in the batched judge request.`})]})}),(0,I.jsxs)(q,{className:`space-y-3`,children:[(0,I.jsxs)(`div`,{className:`flex items-start gap-2`,children:[(0,I.jsx)(KX,{id:`judge-ctx-prompt-${e.id}`,checked:e.agentContext?.include_prompt??!1,disabled:v,className:`mt-0.5`,onCheckedChange:t=>{p({agentContext:{...e.agentContext,include_prompt:t===!0}})}}),(0,I.jsxs)(`div`,{children:[(0,I.jsx)(Q,{htmlFor:`judge-ctx-prompt-${e.id}`,className:`cursor-pointer text-xs font-medium`,children:`Include prompt`}),(0,I.jsx)(`p`,{className:`text-[11px] text-muted-foreground`,children:`Sends the scenario prompt so the judge can verify the answer addresses the original question.`})]})]}),(0,I.jsxs)(`div`,{className:`flex items-start gap-2`,children:[(0,I.jsx)(KX,{id:`judge-ctx-tools-${e.id}`,checked:e.agentContext?.include_tool_sequence??!1,disabled:v,className:`mt-0.5`,onCheckedChange:t=>{p({agentContext:{...e.agentContext,include_tool_sequence:t===!0}})}}),(0,I.jsxs)(`div`,{children:[(0,I.jsx)(Q,{htmlFor:`judge-ctx-tools-${e.id}`,className:`cursor-pointer text-xs font-medium`,children:`Include tool sequence`}),(0,I.jsx)(`p`,{className:`text-[11px] text-muted-foreground`,children:`Sends the list of called tool names so the judge can reason about which tools were used.`})]})]}),(0,I.jsxs)(`div`,{className:`flex items-start gap-2`,children:[(0,I.jsx)(KX,{id:`judge-ctx-inputs-${e.id}`,checked:e.agentContext?.include_tool_inputs??!1,disabled:v,className:`mt-0.5`,onCheckedChange:t=>{p({agentContext:{...e.agentContext,include_tool_inputs:t===!0}})}}),(0,I.jsxs)(`div`,{children:[(0,I.jsx)(Q,{htmlFor:`judge-ctx-inputs-${e.id}`,className:`cursor-pointer text-xs font-medium`,children:`Include tool inputs`}),(0,I.jsx)(`p`,{className:`text-[11px] text-muted-foreground`,children:`Sends the called MCP tools and their arguments so the judge can verify how the tools were used.`})]})]})]})]})]})})]})})}function w6(e,t,n){return c6({evalRules:e,failureReasons:t,checkResults:n})}function Kle(e){return e.type===`agent_check`?`${e.type}: ${e.label??``} — ${e.prompt??``}`:e.type===`tool_sequence`?`${e.type}: ${b6(e.sequence??[])}`:x6(e.type)?`${e.type}: ${e.tool??``}: ${T6(e)}`:e.path?`${e.type}: ${T6(e)}`:`${e.type}: ${e.value??``}`}function T6(e){return e.path?e.equals===void 0?e.path:`${e.path} == ${String(e.equals)}`:String(e.value??``)}var qle=l6;function Jle(e){let t=String(e??``).trim(),n=t.match(/^Regex assertion failed:\s*(.+)$/i);return n?`Text match failed: ${n[1]}`:t}function E6(e){let 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}function D6(e){return e??0}function O6(e=`llm`){return e===`browser`?{id:`agt-${Date.now()}`,name:``,type:`browser`,provider:`claude`,model:``,maxTokens:0,url:``,newConversationBetweenScenarios:!0}:{id:`agt-${Date.now()}`,name:``,type:`llm`,provider:`openai`,model:`gpt-4o`,temperature:0,maxTokens:4096}}var Yle=()=>({id:`cfg-${Date.now()}`,name:``,configName:``,description:``,servers:[],serverEntries:[],agents:[],agentEntries:[],scenarios:[],scenarioEntries:[],createdAt:new Date().toISOString(),updatedAt:new Date().toISOString()}),k6=()=>{let{id:e,tab:t}=Zd(),n=Wd(),r=qd(),[i,a]=cp(),{getConfig:o,addConfig:s,updateConfig:c,loading:l}=fv(),{source:u}=nv(),{servers:d,agents:f,scenarios:p}=hv(),m=e===`new`,h=!m&&!!e,g=h?o(e):void 0,[v,y]=(0,_.useState)(m||t===`edit`),[b,x]=(0,_.useState)(()=>g?structuredClone(g):Yle()),[S,C]=(0,_.useState)(``),[w,T]=(0,_.useState)(``),[E,D]=(0,_.useState)({}),[k,A]=(0,_.useState)({}),[j,M]=(0,_.useState)({}),N=(0,_.useMemo)(()=>{let e=t||i.get(`tab`);return e===`agents`||e===`scenarios`?e:`scenarios`},[t,i]),P=`${n.pathname}${n.search}`;(0,_.useEffect)(()=>{g&&!v&&x(structuredClone(g))},[g,v]),(0,_.useEffect)(()=>{t===`edit`&&!m&&y(!0)},[t,m]);let F=e=>x(t=>({...t,...e})),L=(0,_.useMemo)(()=>b.serverEntries&&b.serverEntries.length>0?b.serverEntries:(b.servers??[]).map(e=>({kind:`inline`,server:e})),[b.serverEntries,b.servers]),R=(0,_.useMemo)(()=>b.scenarioEntries&&b.scenarioEntries.length>0?b.scenarioEntries:b.scenarios.map(e=>({kind:`inline`,scenario:e})),[b.scenarioEntries,b.scenarios]),z=e=>{F({scenarioEntries:e,scenarios:e.filter(e=>e.kind===`inline`).map(e=>e.scenario)})},ee=(0,_.useMemo)(()=>b.agentEntries&&b.agentEntries.length>0?b.agentEntries:b.agents.map(e=>({kind:`inline`,agent:e})),[b.agentEntries,b.agents]),te=e=>{F({agentEntries:e,agents:e.filter(e=>e.kind===`inline`).map(e=>e.agent)})},ne=!v,re=b.runDefaults?.selectedAgentNames??[],ie=async()=>{if(!b.name.trim()){O({title:`Validation Error`,description:`Config ID is required.`,variant:`destructive`});return}let e=L.map(e=>e.kind===`referenced`?{kind:`referenced`,ref:d.find(t=>t.id===e.ref)?.id||e.ref}:e),t=ee.map(e=>e.kind===`referenced`?{kind:`referenced`,ref:f.find(t=>t.id===e.ref)?.id||e.ref}:e),n=R.map(e=>{if(e.kind===`referenced`){let t=p.find(t=>t.id===e.ref),n=(e.mcpServers??[]).map(e=>e.kind===`referenced`?{kind:`referenced`,ref:d.find(t=>t.id===e.ref)?.id||e.ref}:e);return{kind:`referenced`,ref:t?.id||e.ref,...e.mcpServers===void 0?{}:{mcpServers:n}}}return e}),i=e.filter(e=>e.kind===`inline`).map(e=>({server:e.server,error:E6(e.server)})).find(e=>!!e.error);if(i?.error){O({title:`Validation Error`,description:i.error,variant:`destructive`});return}if(n.filter(e=>e.kind===`inline`).some(e=>!e.scenario.name?.trim())){O({title:`Validation Error`,description:`Inline scenarios must have a name before saving.`,variant:`destructive`});return}let a=new Set(t.map(e=>e.kind===`inline`?e.agent.id:e.ref)),o=(b.runDefaults?.selectedAgentNames??[]).filter(e=>a.has(e)),l={...b,serverEntries:e,servers:e.filter(e=>e.kind===`inline`).map(e=>e.server),agentEntries:t,agents:t.filter(e=>e.kind===`inline`).map(e=>e.agent),scenarioEntries:n,scenarios:n.filter(e=>e.kind===`inline`).map(e=>e.scenario),runDefaults:o.length>0?{...b.runDefaults??{},selectedAgentNames:o}:void 0,updatedAt:new Date().toISOString()};if(m){let e=await s(l);x(e),O({title:`MCP Evaluation Created`,description:`"${Gi(e.configName,Gi(e.name,e.id))}" has been saved.`}),r(`/mcp-evaluations/${e.id}`)}else{let e=await c(b.id,l);x(e),O({title:`MCP Evaluation Updated`,description:`"${Gi(e.configName,Gi(e.name,e.id))}" has been updated.`}),y(!1),r(`/mcp-evaluations/${e.id}`,{replace:!0})}},ae=Gi(b.configName,Gi(b.name,b.id)),oe=m?`New MCP Evaluation`:v?`Editing: ${ae}`:ae,se=m?`/mcp-evaluations/new`:`/mcp-evaluations/${encodeURIComponent(b.id||e||``)}`,ce=!!g?.loadError,B=(0,_.useMemo)(()=>f.map(e=>({id:e.id,ref:e.id,label:Gi(e.name,e.id),model:e.model})).sort((e,t)=>e.label.localeCompare(t.label)),[f]),le=(e,t)=>{let n=t?Array.from(new Set([...re,e])):re.filter(t=>t!==e);F({runDefaults:{...b.runDefaults??{},selectedAgentNames:n}})},ue=e=>{let t=new Set([...ee.filter(e=>e.kind===`inline`).map(e=>Gi(e.agent.name,e.agent.id)),...f.map(e=>Gi(e.name,e.id))]),n=`${e}-custom`,r=n,i=2;for(;t.has(r);)r=`${n}-${i}`,i+=1;return r},de=()=>{let e=O6(`llm`);te([{kind:`inline`,agent:e},...ee]),D(t=>({...t,[e.id]:!0}))},V=()=>{let e=f.find(e=>e.id===w);if(!e)return;let t=e.id;new Set(ee.filter(e=>e.kind===`referenced`).map(e=>e.ref)).has(t)||te([...ee,{kind:`referenced`,ref:t}]),T(``)},fe=()=>{let e=new Set(ee.filter(e=>e.kind===`referenced`).map(e=>e.ref)),t=f.filter(t=>!e.has(t.id)).map(e=>({kind:`referenced`,ref:e.id}));t.length>0&&te([...ee,...t])},pe=()=>{let e=f.find(e=>e.id===w);if(!e)return;let t=Gi(e.name,e.id),n=ue(t),r={...structuredClone(e),id:`agt-${Date.now()}`,name:n};te([...ee,{kind:`inline`,agent:r}]),D(e=>({...e,[r.id]:!0})),T(``),O({title:`Imported agent as inline`,description:n})},me=e=>{let t=ee[e];if(!t)return;let n=t.kind===`inline`?t.agent.id:t.ref,r=re.filter(e=>e!==n);F({runDefaults:{...b.runDefaults??{},selectedAgentNames:r}}),t.kind===`inline`&&D(e=>{let n={...e};return delete n[t.agent.id],n}),te(ee.filter((t,n)=>n!==e))},he=(e,t)=>{let n=e+t;if(n<0||n>=ee.length)return;let r=[...ee],[i]=r.splice(e,1);r.splice(n,0,i),te(r)},ge=e=>{let t=ee[e];if(!t||t.kind!==`referenced`)return;let n=we(t.ref);if(!n){O({title:`Referenced agent not found`,variant:`destructive`});return}let r=Gi(n.name,n.id),i=ue(r),a={...structuredClone(n),id:`agt-${Date.now()}`,name:i},o=[...ee];if(o[e]={kind:`inline`,agent:a},te(o),re.includes(t.ref)){let e=re.map(e=>e===t.ref?a.id:e);F({runDefaults:{...b.runDefaults??{},selectedAgentNames:Array.from(new Set(e))}})}D(e=>({...e,[a.id]:!0})),O({title:`Referenced agent converted to inline`,description:i})},_e=()=>{let e=p.find(e=>e.id===S);if(!e)return;let t={...structuredClone(e),id:`scn-${Date.now()}`,serverIds:[...e.serverIds]};z([...R,{kind:`inline`,scenario:t}]),M(e=>({...e,[t.id]:!0})),C(``)},ve=()=>{let e={id:`scn-${Date.now()}`,name:``,serverIds:[],prompt:``,evalRules:[],extractRules:[]};z([{kind:`inline`,scenario:e},...R]),M(t=>({...t,[e.id]:!0}))},ye=()=>{let e=p.find(e=>e.id===S);if(!e)return;let t=e.id;new Set(R.filter(e=>e.kind===`referenced`).map(e=>e.ref)).has(t)||z([...R,{kind:`referenced`,ref:t}]),C(``)},be=e=>{let t=R[e];t?.kind===`inline`&&M(e=>{let n={...e};return delete n[t.scenario.id],n}),z(R.filter((t,n)=>n!==e))},xe=(e,t)=>{let n=e+t;if(n<0||n>=R.length)return;let r=[...R],[i]=r.splice(e,1);r.splice(n,0,i),z(r)},Se=e=>{let t=R[e];if(!t||t.kind!==`referenced`)return;let n=Te(t.ref);if(!n){O({title:`Referenced scenario not found`,variant:`destructive`});return}let r=new Set(R.filter(e=>e.kind===`inline`).map(e=>e.scenario.name?.trim().toLowerCase()).filter(Boolean)),i=`${Gi(n.name,n.id)}-custom`,a=i,o=2;for(;r.has(a.toLowerCase());)a=`${i}-${o}`,o+=1;let s=Date.now(),c={...structuredClone(n),id:`scn-${s}`,name:a,serverIds:t.mcpServers&&t.mcpServers.length>0?t.mcpServers.map(e=>e.kind===`referenced`?e.ref:e.server.id):[...n.serverIds]},l=[...R];l[e]={kind:`inline`,scenario:c},z(l),M(e=>({...e,[c.id]:!0})),O({title:`Referenced scenario converted to inline`,description:a})},Ce=e=>d.find(t=>t.id===e),we=e=>f.find(t=>t.id===e),Te=e=>p.find(t=>t.id===e),Ee=L.filter(e=>e.kind===`referenced`).map(e=>e.ref),De=Ee.map(Ce).filter(e=>!!e),Oe=ee.filter(e=>e.kind===`referenced`).map(e=>e.ref),ke=Oe.map(we).filter(e=>!!e);ee.filter(e=>e.kind===`inline`);let Ae=ee.flatMap(e=>{if(e.kind===`referenced`){let t=we(e.ref);return t?[{agent:t,origin:`referenced`,ref:e.ref}]:[]}return[{agent:e.agent,origin:`inline`,ref:void 0}]}),je=R.filter(e=>e.kind===`referenced`).map(e=>e.ref),Me=R.flatMap(e=>{if(e.kind===`referenced`){let t=Te(e.ref);if(!t)return[];if(e.mcpServers===void 0)return[{scenario:t,origin:`referenced`,hasMcpServerOverride:!1}];let n=e.mcpServers.flatMap(e=>e.kind===`referenced`?[e.ref]:[e.server.id]);return[{scenario:{...t,serverIds:n},origin:`referenced`,hasMcpServerOverride:!0}]}return[{scenario:e.scenario,origin:`inline`,hasMcpServerOverride:!1}]}),Ne=Array.from(new Map([...f,...b.agents,...ke].map(e=>[e.id,e])).values()),Pe=Array.from(new Map([...d,...b.servers??[],...De].map(e=>[e.id,e])).values()),Fe=R.filter(e=>e.kind===`referenced`).flatMap(e=>(e.mcpServers??[]).filter(e=>e.kind===`referenced`).map(e=>e.ref)),Ie=Array.from(new Set([...Ee,...Fe].filter(e=>!Ce(e)))),Le=Oe.filter(e=>!we(e)),Re=je.filter(e=>!Te(e));new Set(Ie);let ze=new Set(Re),Be=ee.length,Ve=R.length,He=[...d],Ue=(e,t)=>{let n=R[e];if(!n||n.kind!==`referenced`)return;let r=[...R];r[e]={kind:`referenced`,ref:n.ref,mcpServers:t.map(e=>({kind:`referenced`,ref:e}))},z(r)},We=e=>{let t=R[e];if(!t||t.kind!==`referenced`)return;let n=[...R];n[e]={kind:`referenced`,ref:t.ref},z(n)};return(0,_.useEffect)(()=>{w&&(f.some(e=>e.id===w)||T(``))},[f,w]),(0,I.jsxs)(`div`,{className:`space-y-6`,children:[(0,I.jsxs)(`div`,{className:`flex items-center gap-3`,children:[(0,I.jsx)(W,{variant:`ghost`,size:`icon`,asChild:!0,className:`h-8 w-8`,children:(0,I.jsx)(np,{to:`/mcp-evaluations`,children:(0,I.jsx)(Qt,{className:`h-4 w-4`})})}),(0,I.jsxs)(`div`,{className:`flex-1 min-w-0`,children:[(0,I.jsx)(`h1`,{className:`text-2xl font-bold truncate`,children:oe}),(0,I.jsxs)(`p`,{className:`text-sm text-muted-foreground flex flex-wrap items-center gap-x-2 gap-y-1`,children:[m?`Create a new MCP evaluation`:l?`Loading configuration...`:g?g.loadError?`MCP evaluation could not be fully loaded`:(0,I.jsxs)(I.Fragment,{children:[`Last updated `,(0,I.jsx)(`span`,{children:new Date(b.updatedAt).toLocaleDateString()})]}):`MCP evaluation not found`,!m&&LY(b)&&(0,I.jsxs)(`span`,{"aria-label":`Evaluation file`,className:`inline-flex min-w-0 items-center gap-1 text-xs font-mono`,children:[(0,I.jsx)(`span`,{"aria-hidden":`true`,children:`·`}),(0,I.jsx)(En,{className:`h-3 w-3 shrink-0`,"aria-hidden":`true`}),(0,I.jsx)(`span`,{className:`truncate`,children:LY(b)})]})]})]}),(0,I.jsxs)(`div`,{className:`flex gap-2 shrink-0`,children:[h&&!v&&(0,I.jsx)(W,{size:`sm`,onClick:()=>{y(!0),r(`${se}/edit`)},children:`Edit`}),h&&!v&&g&&!ce&&(0,I.jsx)(W,{size:`sm`,variant:`outline`,asChild:!0,children:(0,I.jsxs)(np,{to:`/run?configId=${encodeURIComponent(g.id)}`,children:[(0,I.jsx)(Yn,{className:`h-3.5 w-3.5`}),`Run Evaluation`]})}),h&&!v&&ce&&(0,I.jsxs)(Y,{variant:`destructive`,className:`py-1 px-3 text-xs`,children:[(0,I.jsx)(ur,{className:`mr-1 h-3 w-3`}),`Broken config`]}),v&&(0,I.jsxs)(I.Fragment,{children:[!m&&(0,I.jsx)(W,{variant:`outline`,size:`sm`,onClick:()=>{x(structuredClone(g)),y(!1),r(se)},children:`Cancel`}),(0,I.jsxs)(W,{size:`sm`,onClick:()=>void ie(),children:[(0,I.jsx)($n,{className:`mr-1.5 h-3.5 w-3.5`}),`Save`]})]})]})]}),ce&&!v&&(0,I.jsx)(K,{className:`border-destructive/40`,children:(0,I.jsxs)(q,{className:`pt-6 space-y-3`,children:[(0,I.jsxs)(`div`,{className:`flex items-start gap-3`,children:[(0,I.jsx)(ur,{className:`mt-0.5 h-5 w-5 text-destructive`}),(0,I.jsxs)(`div`,{className:`min-w-0`,children:[(0,I.jsx)(`p`,{className:`text-sm font-semibold`,children:`This configuration is broken`}),(0,I.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.`})]})]}),(0,I.jsxs)(`div`,{className:`rounded-md border bg-muted/20 p-3`,children:[(0,I.jsx)(`p`,{className:`text-xs font-medium mb-1`,children:`File`}),(0,I.jsx)(`p`,{className:`text-xs font-mono break-all`,children:g&&LY(g)})]}),(0,I.jsxs)(`div`,{className:`rounded-md border border-destructive/30 bg-destructive/5 p-3`,children:[(0,I.jsx)(`p`,{className:`text-xs font-medium mb-1 text-destructive`,children:`Load Error`}),(0,I.jsx)(`p`,{className:`text-xs break-all text-destructive`,children:g?.loadError})]}),(Ie.length>0||Le.length>0||Re.length>0)&&(0,I.jsxs)(`div`,{className:`rounded-md border border-destructive/30 bg-background p-3 space-y-1.5`,children:[(0,I.jsx)(`p`,{className:`text-xs font-medium`,children:`Broken references`}),Ie.length>0&&(0,I.jsxs)(`p`,{className:`text-xs text-muted-foreground`,children:[`Servers:`,` `,(0,I.jsx)(`span`,{className:`text-destructive`,children:Ie.join(`, `)})]}),Le.length>0&&(0,I.jsxs)(`p`,{className:`text-xs text-muted-foreground`,children:[`Agents: `,(0,I.jsx)(`span`,{className:`text-destructive`,children:Le.join(`, `)})]}),Re.length>0&&(0,I.jsxs)(`p`,{className:`text-xs text-muted-foreground`,children:[`Scenarios:`,` `,(0,I.jsx)(`span`,{className:`text-destructive`,children:Re.join(`, `)})]})]}),(0,I.jsx)(`p`,{className:`text-xs text-muted-foreground`,children:`Valid items still render below. Only the missing references are marked as broken.`})]})}),!ce&&(b.loadWarnings?.length??0)>0&&(0,I.jsx)(K,{className:`border-amber-500/30`,children:(0,I.jsxs)(q,{className:`pt-4 space-y-1`,children:[(0,I.jsxs)(`div`,{className:`flex items-center gap-2 text-sm font-medium text-amber-700 dark:text-amber-300`,children:[(0,I.jsx)(ur,{className:`h-4 w-4`}),`Migration warnings`]}),b.loadWarnings?.map((e,t)=>(0,I.jsx)(`p`,{className:`text-xs text-muted-foreground`,children:e},`${e}-${t}`))]})}),(0,I.jsxs)(`div`,{className:`flex gap-4`,children:[(0,I.jsx)(Y,{variant:N===`scenarios`?`default`:`outline-solid`,className:`py-1 px-3 text-xs`,children:(0,I.jsxs)(np,{to:`${se}/scenarios`,className:`inline-flex items-center gap-1.5 whitespace-nowrap`,children:[(0,I.jsx)(Dn,{className:`h-3 w-3`}),Ve,` scenario`,Ve===1?``:`s`]})}),(0,I.jsx)(Y,{variant:N===`agents`?`default`:`outline-solid`,className:`py-1 px-3 text-xs`,children:(0,I.jsxs)(np,{to:`${se}/agents`,className:`inline-flex items-center gap-1.5 whitespace-nowrap`,children:[(0,I.jsx)(en,{className:`h-3 w-3`}),Be,` agent`,Be===1?``:`s`]})})]}),(0,I.jsx)(K,{children:(0,I.jsx)(q,{className:`pt-6 space-y-3`,children:(0,I.jsxs)(`div`,{className:`grid gap-4 ${ne||!m?`sm:grid-cols-2`:`sm:grid-cols-3`}`,children:[!ne&&m&&(0,I.jsxs)(`div`,{className:`space-y-1.5`,children:[(0,I.jsx)(Q,{className:`text-xs`,children:`Config ID`}),(0,I.jsx)(Op,{value:b.name,onChange:e=>F({name:e.target.value}),disabled:ne,placeholder:`e.g. check-weather`})]}),(0,I.jsxs)(`div`,{className:`space-y-1.5`,children:[(0,I.jsx)(Q,{className:`text-xs`,children:`Name`}),(0,I.jsx)(Op,{value:b.configName||``,onChange:e=>F({configName:e.target.value}),disabled:ne,placeholder:`e.g. Weather checks baseline`})]}),(0,I.jsxs)(`div`,{className:`space-y-1.5`,children:[(0,I.jsx)(Q,{className:`text-xs`,children:`Description`}),(0,I.jsx)(Op,{value:b.description||``,onChange:e=>F({description:e.target.value}),disabled:ne,placeholder:`Brief description...`})]})]})})}),(0,I.jsxs)(CX,{value:N,onValueChange:t=>{if(t!==`servers`&&t!==`agents`&&t!==`scenarios`)return;let n=new URLSearchParams(i);n.delete(`tab`),a(n,{replace:!0}),r(e&&e!==`new`?`/mcp-evaluations/${encodeURIComponent(e)}/${t}`:`/mcp-evaluations/${e??`new`}/${t}`,{replace:!0})},className:`space-y-4`,children:[(0,I.jsxs)(wX,{children:[(0,I.jsxs)(TX,{value:`scenarios`,className:`gap-1.5`,children:[(0,I.jsx)(Dn,{className:`h-3.5 w-3.5`}),`Scenarios`]}),(0,I.jsxs)(TX,{value:`agents`,className:`gap-1.5`,children:[(0,I.jsx)(en,{className:`h-3.5 w-3.5`}),`Agents`]})]}),(0,I.jsxs)(EX,{value:`agents`,children:[!ne&&(0,I.jsx)(K,{className:`mb-4`,children:(0,I.jsxs)(q,{className:`pt-4 space-y-3`,children:[(0,I.jsxs)(`div`,{className:`grid gap-2 sm:grid-cols-[1fr_auto]`,children:[(0,I.jsxs)(OY,{value:w,onValueChange:T,children:[(0,I.jsx)(AY,{className:`h-8`,children:(0,I.jsx)(kY,{placeholder:`Select agent from library`})}),(0,I.jsx)(NY,{children:B.map(e=>(0,I.jsx)(Z,{value:e.id,children:e.label},e.id))})]}),(0,I.jsxs)(`div`,{className:`flex gap-2`,children:[(0,I.jsx)(W,{type:`button`,size:`sm`,variant:`outline`,className:`h-8`,disabled:!w,onClick:V,children:`Add Ref`}),(0,I.jsx)(W,{type:`button`,size:`sm`,variant:`outline`,className:`h-8`,disabled:!w,onClick:pe,children:`Import Inline`}),(0,I.jsx)(W,{type:`button`,size:`sm`,variant:`outline`,className:`h-8`,disabled:f.length===0||f.every(e=>ee.some(t=>t.kind===`referenced`&&t.ref===e.id)),onClick:fe,children:`Add All Refs`}),(0,I.jsx)(W,{type:`button`,size:`sm`,variant:`outline`,className:`h-8`,onClick:de,children:`Add agent`})]})]}),(0,I.jsxs)(`div`,{className:`space-y-2`,children:[ee.map((e,t)=>{let n=e.kind===`referenced`?we(e.ref):null,r=e.kind===`inline`?Gi(e.agent.name,e.agent.id):Gi(n?.name,e.ref),i=e.kind===`inline`?e.agent.model:n?.model||`unknown`,a=e.kind===`inline`?e.agent.id:e.ref,o=e.kind===`referenced`&&!n,s=e.kind===`inline`?e.agent.id:e.ref,c=re.includes(s),l=e.kind===`inline`&&!!E[e.agent.id];return(0,I.jsxs)(`div`,{className:`rounded-md border text-sm`,children:[(0,I.jsxs)(`div`,{className:`flex items-center justify-between px-2 py-1.5`,children:[(0,I.jsxs)(`div`,{className:`flex min-w-0 items-center gap-2`,children:[(0,I.jsxs)(`div`,{className:`flex items-center gap-1`,children:[(0,I.jsx)(W,{type:`button`,size:`icon`,variant:`outline`,className:`h-6 w-6`,onClick:()=>he(t,-1),disabled:t===0,"aria-label":`Move agent up`,children:(0,I.jsx)(cn,{className:`h-3 w-3`})}),(0,I.jsx)(W,{type:`button`,size:`icon`,variant:`outline`,className:`h-6 w-6`,onClick:()=>he(t,1),disabled:t===ee.length-1,"aria-label":`Move agent down`,children:(0,I.jsx)(on,{className:`h-3 w-3`})})]}),(0,I.jsxs)(`span`,{className:`text-xs text-muted-foreground`,children:[t+1,`.`]}),(0,I.jsx)(`span`,{className:`truncate font-medium`,children:r}),(0,I.jsx)(Y,{variant:e.kind===`inline`?`secondary`:`outline-solid`,children:e.kind===`inline`?`Inline`:`Referenced`}),(0,I.jsx)(Y,{variant:`outline`,className:`font-mono text-[10px]`,children:i}),c&&(0,I.jsx)(Y,{variant:`outline`,className:`text-xs border-emerald-300 text-emerald-700 bg-emerald-50`,children:`Default`}),o&&(0,I.jsx)(Y,{variant:`destructive`,children:`Missing`})]}),(0,I.jsxs)(`div`,{className:`flex items-center gap-1`,children:[(0,I.jsxs)(`label`,{className:`mx-2 flex items-center gap-1.5 text-xs text-muted-foreground`,children:[(0,I.jsx)(`input`,{type:`checkbox`,checked:c,onChange:e=>le(s,e.target.checked)}),(0,I.jsx)(`span`,{children:`Default`})]}),e.kind===`inline`&&(0,I.jsx)(W,{type:`button`,size:`sm`,variant:`outline`,onClick:()=>D(t=>({...t,[e.agent.id]:!t[e.agent.id]})),children:l?`Collapse`:`Expand`}),e.kind===`referenced`&&(0,I.jsx)(I.Fragment,{children:(0,I.jsx)(W,{type:`button`,size:`sm`,variant:`outline`,onClick:()=>ge(t),disabled:o,children:`Convert to inline`})}),(0,I.jsx)(W,{type:`button`,size:`icon`,variant:`ghost`,className:`h-7 w-7 text-destructive hover:text-destructive`,onClick:()=>me(t),"aria-label":`Remove agent entry`,children:(0,I.jsx)(lr,{className:`h-3.5 w-3.5`})})]})]}),e.kind===`inline`&&e.agent.type!==`browser`&&l&&(0,I.jsxs)(`div`,{className:`border-t px-3 py-3 space-y-3`,children:[(0,I.jsxs)(`div`,{className:`grid gap-3 sm:grid-cols-2`,children:[(0,I.jsxs)(`div`,{className:`space-y-1.5`,children:[(0,I.jsx)(Q,{className:`text-xs`,children:`Name`}),(0,I.jsx)(Op,{value:e.agent.name,onChange:n=>{let r=[...ee];r[t]={kind:`inline`,agent:{...e.agent,name:n.target.value}},te(r)},placeholder:`e.g. GPT-5 Mini custom`})]}),(0,I.jsxs)(`div`,{className:`space-y-1.5`,children:[(0,I.jsx)(Q,{className:`text-xs`,children:`Provider`}),(0,I.jsxs)(OY,{value:e.agent.provider,onValueChange:n=>{let r=e.agent;if(r.type===`browser`)return;let i=[...ee];i[t]={kind:`inline`,agent:{...r,provider:n}},te(i)},children:[(0,I.jsx)(AY,{children:(0,I.jsx)(kY,{})}),(0,I.jsxs)(NY,{children:[(0,I.jsx)(Z,{value:`openai`,children:`OpenAI`}),(0,I.jsx)(Z,{value:`anthropic`,children:`Anthropic`}),(0,I.jsx)(Z,{value:`azure`,children:`Azure OpenAI`}),(0,I.jsx)(Z,{value:`azure_foundry`,children:`Azure Foundry`}),(0,I.jsx)(Z,{value:`google`,children:`Google`}),(0,I.jsx)(Z,{value:`custom`,children:`Custom`})]})]})]})]}),(0,I.jsxs)(`div`,{className:`grid gap-3 sm:grid-cols-2`,children:[(0,I.jsxs)(`div`,{className:`space-y-1.5`,children:[(0,I.jsx)(Q,{className:`text-xs`,children:`Model`}),(0,I.jsx)(Op,{value:e.agent.model,onChange:n=>{let r=[...ee];r[t]={kind:`inline`,agent:{...e.agent,model:n.target.value}},te(r)},className:`font-mono text-xs`})]}),(0,I.jsxs)(`div`,{className:`space-y-1.5`,children:[(0,I.jsx)(Q,{className:`text-xs`,children:`Max Tokens`}),(0,I.jsx)(Op,{type:`number`,min:1,max:128e3,value:e.agent.maxTokens,onChange:n=>{let r=[...ee];r[t]={kind:`inline`,agent:{...e.agent,maxTokens:parseInt(n.target.value)||0}},te(r)},className:`font-mono text-xs`})]})]}),(0,I.jsxs)(`div`,{className:`space-y-1.5`,children:[(0,I.jsx)(Q,{className:`text-xs`,children:`Temperature`}),(0,I.jsx)(Op,{type:`number`,min:0,max:2,step:.01,value:D6(e.agent.temperature),onChange:n=>{let r=e.agent;if(r.type===`browser`)return;let i=[...ee];i[t]={kind:`inline`,agent:{...r,temperature:Number(n.target.value)||0}},te(i)},className:`font-mono text-xs`})]}),(0,I.jsxs)(`div`,{className:`space-y-1.5`,children:[(0,I.jsx)(Q,{className:`text-xs`,children:`System Prompt`}),(0,I.jsx)(iX,{value:e.agent.systemPrompt||``,onChange:n=>{let r=e.agent;if(r.type!==`llm`)return;let i=[...ee];i[t]={kind:`inline`,agent:{...r,systemPrompt:n.target.value}},te(i)},rows:3,className:`text-xs`})]})]})]},`agent-entry-${t}-${a}`)}),ee.length===0&&(0,I.jsx)(`p`,{className:`text-xs text-muted-foreground`,children:`No agents configured yet. Add inline agents or references.`})]}),Le.length>0&&(0,I.jsxs)(`p`,{className:`text-xs text-destructive`,children:[`Missing agent refs: `,Le.join(`, `)]})]})}),ne?(0,I.jsx)(K,{children:(0,I.jsx)(q,{className:`pt-4`,children:(0,I.jsxs)(`div`,{className:`space-y-2`,children:[Ae.map((e,t)=>{let n=Gi(e.agent.name,e.agent.id),r=re.includes(e.origin===`inline`?e.agent.id:e.ref||e.agent.id),i=e.ref??e.agent.id,a=!!k[i];return(0,I.jsxs)(`div`,{className:`rounded-md border p-3`,children:[(0,I.jsxs)(`div`,{className:`flex items-center justify-between gap-2`,children:[(0,I.jsxs)(`div`,{className:`flex min-w-0 items-center gap-2`,children:[(0,I.jsxs)(`span`,{className:`text-xs text-muted-foreground`,children:[t+1,`.`]}),(0,I.jsx)(`div`,{className:`truncate font-medium text-sm`,children:n})]}),(0,I.jsxs)(`div`,{className:`flex items-center gap-2`,children:[r&&(0,I.jsx)(Y,{variant:`outline`,className:`text-xs border-emerald-300 text-emerald-700 bg-emerald-50`,children:`Default`}),(0,I.jsx)(Y,{variant:e.origin===`inline`?`secondary`:`outline-solid`,children:e.origin===`inline`?`Inline`:`Referenced`}),(0,I.jsx)(W,{type:`button`,size:`icon`,variant:`outline`,className:`h-8 w-8`,onClick:()=>A(e=>({...e,[i]:!e[i]})),"aria-label":a?`Collapse agent details`:`Expand agent details`,children:(0,I.jsx)(on,{className:`h-4 w-4 transition-transform ${a?`rotate-180`:``}`})})]})]}),a&&(0,I.jsxs)(`div`,{className:`mt-2 flex flex-wrap items-center gap-1.5 border-t pt-2`,children:[(0,I.jsx)(AX,{provider:e.agent.provider}),(0,I.jsx)(Y,{variant:`outline`,className:`text-xs font-mono`,children:e.agent.model}),(0,I.jsxs)(Y,{variant:`outline`,className:`text-xs font-mono`,children:[`max_tokens: `,e.agent.maxTokens]}),e.agent.type!==`browser`&&(0,I.jsxs)(Y,{variant:`outline`,className:`text-xs font-mono`,children:[`temperature: `,D6(e.agent.temperature)]})]})]},`agent-view-${t}-${e.ref??e.agent.id}`)}),Ae.length===0&&(0,I.jsx)(`p`,{className:`text-sm text-muted-foreground text-center py-6`,children:`No agents configured.`})]})})}):null]}),(0,I.jsxs)(EX,{value:`scenarios`,children:[!ne&&(0,I.jsx)(K,{className:`mb-4`,children:(0,I.jsxs)(q,{className:`pt-4 space-y-3`,children:[(0,I.jsxs)(`div`,{className:`grid gap-2 sm:grid-cols-[1fr_auto]`,children:[(0,I.jsxs)(OY,{value:S,onValueChange:C,children:[(0,I.jsx)(AY,{className:`h-8`,children:(0,I.jsx)(kY,{placeholder:`Select scenario from library`})}),(0,I.jsx)(NY,{children:[...p].sort((e,t)=>Gi(e.name,e.id).localeCompare(Gi(t.name,t.id))).map(e=>(0,I.jsx)(Z,{value:e.id,children:Gi(e.name,e.id)},e.id))})]}),(0,I.jsxs)(`div`,{className:`flex gap-2`,children:[(0,I.jsx)(W,{type:`button`,size:`sm`,variant:`outline`,className:`h-8`,disabled:!S,onClick:ye,children:`Add Ref`}),(0,I.jsx)(W,{type:`button`,size:`sm`,variant:`outline`,className:`h-8`,disabled:!S,onClick:_e,children:`Import Inline`}),(0,I.jsx)(W,{type:`button`,size:`sm`,variant:`outline`,className:`h-8`,onClick:ve,children:`Add scenario`})]})]}),(0,I.jsxs)(`div`,{className:`space-y-2`,children:[R.map((e,t)=>{let n=e.kind===`referenced`?Te(e.ref):null,r=e.kind===`inline`?Gi(e.scenario.name,e.scenario.id):Gi(n?.name,e.ref),i=e.kind===`inline`&&Gi(e.scenario.name).length===0,a=e.kind===`referenced`&&ze.has(e.ref),o=e.kind===`referenced`&&Array.isArray(e.mcpServers),s=e.kind===`inline`&&!!j[e.scenario.id];return(0,I.jsxs)(`div`,{className:`rounded-md border text-sm`,children:[(0,I.jsxs)(`div`,{className:`flex items-center justify-between px-2 py-1.5`,children:[(0,I.jsxs)(`div`,{className:`flex min-w-0 items-center gap-2`,children:[(0,I.jsxs)(`div`,{className:`flex items-center gap-1`,children:[(0,I.jsx)(W,{type:`button`,size:`icon`,variant:`outline`,className:`h-6 w-6`,onClick:()=>xe(t,-1),disabled:t===0,"aria-label":`Move scenario up`,children:(0,I.jsx)(cn,{className:`h-3 w-3`})}),(0,I.jsx)(W,{type:`button`,size:`icon`,variant:`outline`,className:`h-6 w-6`,onClick:()=>xe(t,1),disabled:t===R.length-1,"aria-label":`Move scenario down`,children:(0,I.jsx)(on,{className:`h-3 w-3`})})]}),(0,I.jsxs)(`span`,{className:`text-xs text-muted-foreground`,children:[t+1,`.`]}),(0,I.jsx)(`span`,{className:`truncate font-medium`,children:r}),(0,I.jsx)(Y,{variant:e.kind===`inline`?`secondary`:`outline-solid`,children:e.kind===`inline`?`Inline`:`Referenced`}),o&&(0,I.jsx)(Y,{variant:`secondary`,children:`Override`}),i&&(0,I.jsx)(Y,{variant:`destructive`,children:`Name required`}),a&&(0,I.jsx)(Y,{variant:`destructive`,children:`Missing`})]}),(0,I.jsxs)(`div`,{className:`flex items-center gap-1`,children:[e.kind===`inline`&&(0,I.jsx)(W,{type:`button`,size:`icon`,variant:`outline`,className:`h-7 w-7`,onClick:()=>M(t=>({...t,[e.scenario.id]:!t[e.scenario.id]})),"aria-label":s?`Collapse scenario details`:`Expand scenario details`,children:(0,I.jsx)(on,{className:`h-3.5 w-3.5 transition-transform ${s?`rotate-180`:``}`})}),e.kind===`referenced`&&(0,I.jsx)(I.Fragment,{children:(0,I.jsx)(W,{type:`button`,size:`sm`,variant:`outline`,onClick:()=>Se(t),disabled:a,children:`Convert to inline`})}),(0,I.jsx)(W,{type:`button`,size:`icon`,variant:`ghost`,className:`h-7 w-7 text-destructive hover:text-destructive`,onClick:()=>be(t),"aria-label":`Remove scenario entry`,children:(0,I.jsx)(lr,{className:`h-3.5 w-3.5`})})]})]}),e.kind===`inline`&&s&&(0,I.jsx)(`div`,{className:`border-t px-3 py-3`,children:(0,I.jsx)(C6,{scenarios:[e.scenario],scenarioOrigins:[`inline`],agents:[...b.agents,...ke],servers:Pe,configId:b.id,configPath:b.sourcePath,defaultAssistantAgentName:b.runDefaults?.selectedAgentNames?.[0],onChange:e=>{let n=e[0];if(!n)return;let r=[...R];r[t]={kind:`inline`,scenario:n},z(r)},readOnly:!1,allowAdd:!1,allowStructureEdits:!1})}),e.kind===`referenced`&&!a&&(0,I.jsxs)(`div`,{className:`border-t px-3 py-3 space-y-2`,children:[(0,I.jsx)(`div`,{className:`text-xs text-muted-foreground`,children:`Optional MCP server override for this referenced scenario.`}),(0,I.jsx)(`div`,{className:`flex flex-wrap gap-2`,children:He.map(n=>{let r=(e.mcpServers??[]).some(e=>e.kind===`referenced`&&e.ref===n.id);return(0,I.jsx)(W,{type:`button`,size:`sm`,variant:r?`default`:`outline-solid`,className:`h-7 text-xs ${r?``:`opacity-70`}`,onClick:()=>{let r=(e.mcpServers??[]).filter(e=>e.kind===`referenced`).map(e=>e.ref),i=r.includes(n.id)?r.filter(e=>e!==n.id):[...r,n.id];Ue(t,i)},children:Gi(n.name,n.id)},`${e.ref}-override-server-${n.id}`)})}),o&&(0,I.jsx)(W,{type:`button`,size:`sm`,variant:`ghost`,className:`h-7 text-xs`,onClick:()=>We(t),children:`Reset override`})]})]},`scenario-entry-${t}-${e.kind===`inline`?e.scenario.id:e.ref}`)}),R.length===0&&(0,I.jsx)(`p`,{className:`text-xs text-muted-foreground`,children:`No scenarios configured yet. Add inline scenarios or references.`})]}),Re.length>0&&(0,I.jsxs)(`p`,{className:`text-xs text-destructive`,children:[`Missing scenario refs: `,Re.join(`, `)]})]})}),ne?(0,I.jsx)(K,{children:(0,I.jsx)(q,{className:`pt-4`,children:(0,I.jsx)(C6,{scenarios:Me.map(e=>e.scenario),scenarioOrigins:Me.map(e=>e.origin),scenarioOverrides:Me.map(e=>e.hasMcpServerOverride),agents:Ne,servers:Pe,configId:b.id,configPath:b.sourcePath,defaultAssistantAgentName:b.runDefaults?.selectedAgentNames?.[0],testCaseReturnToPath:P,onChange:()=>{},readOnly:!0})})}):null]})]})]})},Xle=Symbol(`radix.slottable`);function Zle(e){let t=({children:e})=>(0,I.jsx)(I.Fragment,{children:e});return t.displayName=`${e}.Slottable`,t.__radixId=Xle,t}var A6=`AlertDialog`,[Qle,$le]=R(A6,[mh]),j6=mh(),M6=e=>{let{__scopeAlertDialog:t,...n}=e,r=j6(t);return(0,I.jsx)(Kh,{...r,...n,modal:!0})};M6.displayName=A6;var eue=`AlertDialogTrigger`,tue=_.forwardRef((e,t)=>{let{__scopeAlertDialog:n,...r}=e,i=j6(n);return(0,I.jsx)(qh,{...i,...r,ref:t})});tue.displayName=eue;var nue=`AlertDialogPortal`,N6=e=>{let{__scopeAlertDialog:t,...n}=e,r=j6(t);return(0,I.jsx)(Jh,{...r,...n})};N6.displayName=nue;var rue=`AlertDialogOverlay`,P6=_.forwardRef((e,t)=>{let{__scopeAlertDialog:n,...r}=e,i=j6(n);return(0,I.jsx)(Yh,{...i,...r,ref:t})});P6.displayName=rue;var F6=`AlertDialogContent`,[iue,aue]=Qle(F6),oue=Zle(`AlertDialogContent`),I6=_.forwardRef((e,t)=>{let{__scopeAlertDialog:n,children:r,...i}=e,a=j6(n),o=_.useRef(null),s=P(t,o),c=_.useRef(null);return(0,I.jsx)(Vh,{contentName:F6,titleName:L6,docsSlug:`alert-dialog`,children:(0,I.jsx)(iue,{scope:n,cancelRef:c,children:(0,I.jsxs)(Xh,{role:`alertdialog`,...a,...i,ref:s,onOpenAutoFocus:j(i.onOpenAutoFocus,e=>{e.preventDefault(),c.current?.focus({preventScroll:!0})}),onPointerDownOutside:e=>e.preventDefault(),onInteractOutside:e=>e.preventDefault(),children:[(0,I.jsx)(oue,{children:r}),(0,I.jsx)(cue,{contentRef:o})]})})})});I6.displayName=F6;var L6=`AlertDialogTitle`,R6=_.forwardRef((e,t)=>{let{__scopeAlertDialog:n,...r}=e,i=j6(n);return(0,I.jsx)(Zh,{...i,...r,ref:t})});R6.displayName=L6;var z6=`AlertDialogDescription`,B6=_.forwardRef((e,t)=>{let{__scopeAlertDialog:n,...r}=e,i=j6(n);return(0,I.jsx)(Qh,{...i,...r,ref:t})});B6.displayName=z6;var sue=`AlertDialogAction`,V6=_.forwardRef((e,t)=>{let{__scopeAlertDialog:n,...r}=e,i=j6(n);return(0,I.jsx)($h,{...i,...r,ref:t})});V6.displayName=sue;var H6=`AlertDialogCancel`,U6=_.forwardRef((e,t)=>{let{__scopeAlertDialog:n,...r}=e,{cancelRef:i}=aue(H6,n),a=j6(n),o=P(t,i);return(0,I.jsx)($h,{...a,...r,ref:o})});U6.displayName=H6;var cue=({contentRef:e})=>{let t=`\`${F6}\` requires a description for the component to be accessible for screen reader users.
|
|
152
|
-
|
|
153
|
-
You can add a description to the \`${F6}\` by passing a \`${z6}\` component as a child, which also benefits sighted users by adding visible context to the dialog.
|
|
154
|
-
|
|
155
|
-
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 \`${F6}\`. 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.
|
|
156
|
-
|
|
157
|
-
For more information, see https://radix-ui.com/primitives/docs/components/alert-dialog`;return _.useEffect(()=>{document.getElementById(e.current?.getAttribute(`aria-describedby`))||console.warn(t)},[t,e]),null},lue=M6,uue=N6,W6=P6,G6=I6,K6=V6,q6=U6,J6=R6,Y6=B6,X6=lue,due=uue,Z6=_.forwardRef(({className:e,...t},n)=>(0,I.jsx)(W6,{className:U(`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}));Z6.displayName=W6.displayName;var Q6=_.forwardRef(({className:e,...t},n)=>(0,I.jsxs)(due,{children:[(0,I.jsx)(Z6,{}),(0,I.jsx)(G6,{ref:n,className:U(`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})]}));Q6.displayName=G6.displayName;var $6=({className:e,...t})=>(0,I.jsx)(`div`,{className:U(`flex flex-col space-y-2 text-center sm:text-left`,e),...t});$6.displayName=`AlertDialogHeader`;var e8=({className:e,...t})=>(0,I.jsx)(`div`,{className:U(`flex flex-col-reverse sm:flex-row sm:justify-end sm:space-x-2`,e),...t});e8.displayName=`AlertDialogFooter`;var t8=_.forwardRef(({className:e,...t},n)=>(0,I.jsx)(J6,{ref:n,className:U(`text-lg font-semibold`,e),...t}));t8.displayName=J6.displayName;var n8=_.forwardRef(({className:e,...t},n)=>(0,I.jsx)(Y6,{ref:n,className:U(`text-sm text-muted-foreground`,e),...t}));n8.displayName=Y6.displayName;var r8=_.forwardRef(({className:e,...t},n)=>(0,I.jsx)(K6,{ref:n,className:U(Dp(),e),...t}));r8.displayName=K6.displayName;var i8=_.forwardRef(({className:e,...t},n)=>(0,I.jsx)(q6,{ref:n,className:U(Dp({variant:`outline`}),`mt-2 sm:mt-0`,e),...t}));i8.displayName=q6.displayName;var fue=()=>{let{servers:e,setServers:t,reload:n,loading:r}=hv(),i=qd(),[a,o]=(0,_.useState)(null),[s,c]=(0,_.useState)(``),l=s.trim().toLowerCase(),u=e=>e.name?.trim()||e.id,d=async n=>{let r=`${u(n)}-copy`,i=r,a=1;for(;e.some(e=>(e.name?.trim()||e.id)===i);)i=`${r}-${a}`,a+=1;let o={...structuredClone(n),id:`srv-${Date.now()}`,name:i};await t([...e,o]),O({title:`Server duplicated`,description:`Created ${i}.`})},f=async n=>{await t(e.filter(e=>e.id!==n.id)),O({title:`Server deleted`,description:`${u(n)} was removed.`}),o(null)},p=e=>e.transport===`stdio`?[e.command,...e.args||[]].filter(Boolean).join(` `):e.url||``,m=(0,_.useMemo)(()=>[...l.length===0?e:e.filter(e=>[u(e),e.id,e.transport,p(e),e.authType??``].join(` `).toLowerCase().includes(l))].sort((e,t)=>u(e).localeCompare(u(t),void 0,{sensitivity:`base`})),[e,l]);return(0,I.jsxs)(`div`,{className:`space-y-6`,children:[(0,I.jsxs)(`div`,{className:`flex items-start justify-between gap-2`,children:[(0,I.jsxs)(`div`,{children:[(0,I.jsxs)(`h1`,{className:`inline-flex items-center gap-2 text-2xl font-bold`,children:[(0,I.jsx)(`img`,{src:`/mcp.svg`,alt:``,"aria-hidden":`true`,className:`h-6 w-6`}),`MCP Servers`]}),(0,I.jsx)(`p`,{className:`text-sm text-muted-foreground`,children:`Reusable MCP server definitions shared across configurations.`})]}),(0,I.jsxs)(`div`,{className:`flex items-center gap-2`,children:[(0,I.jsx)(RW,{value:s,onValueChange:c,placeholder:`Search MCP servers...`}),(0,I.jsxs)(W,{type:`button`,size:`sm`,variant:`outline`,onClick:()=>void n(),disabled:r,children:[(0,I.jsx)(Qn,{className:`mr-2 h-4 w-4`}),`Refresh`]}),(0,I.jsxs)(W,{type:`button`,size:`sm`,onClick:()=>i(`/libraries/servers/new`),children:[(0,I.jsx)(Xn,{className:`mr-2 h-4 w-4`}),`Add Server`]})]})]}),e.length===0?(0,I.jsxs)(`div`,{className:`flex flex-col items-center justify-center rounded-lg border border-dashed py-16 text-center`,children:[(0,I.jsx)(`p`,{className:`text-sm text-muted-foreground`,children:`No servers configured. Add one to get started.`}),(0,I.jsxs)(W,{type:`button`,size:`sm`,className:`mt-4`,onClick:()=>i(`/libraries/servers/new`),children:[(0,I.jsx)(Xn,{className:`mr-2 h-4 w-4`}),`Add Server`]})]}):m.length===0?(0,I.jsx)(`div`,{className:`flex flex-col items-center justify-center rounded-lg border border-dashed py-12 text-center`,children:(0,I.jsx)(`p`,{className:`text-sm text-muted-foreground`,children:`No servers match this filter.`})}):(0,I.jsx)(K,{children:(0,I.jsx)(q,{className:`p-0`,children:(0,I.jsxs)(bv,{children:[(0,I.jsx)(xv,{children:(0,I.jsxs)(wv,{children:[(0,I.jsx)(Tv,{children:`Name`}),(0,I.jsx)(Tv,{children:`Transport`}),(0,I.jsx)(Tv,{children:`Endpoint`}),(0,I.jsx)(Tv,{children:`Auth`}),(0,I.jsx)(Tv,{className:`text-right`,children:`Actions`})]})}),(0,I.jsx)(Sv,{children:m.map(e=>(0,I.jsxs)(wv,{className:`cursor-pointer hover:bg-muted/50`,onClick:()=>i(`/libraries/servers/${encodeURIComponent(e.id)}`),children:[(0,I.jsx)(J,{className:`font-medium`,children:(0,I.jsxs)(`span`,{className:`inline-flex items-center gap-2`,children:[(0,I.jsx)(`img`,{src:`/mcp.svg`,alt:``,"aria-hidden":`true`,className:`h-4 w-4`}),u(e)]})}),(0,I.jsx)(J,{children:(0,I.jsx)(Y,{variant:`secondary`,className:`font-mono text-xs`,children:e.transport})}),(0,I.jsx)(J,{children:(0,I.jsx)(`span`,{className:`font-mono text-xs text-muted-foreground`,children:p(e)})}),(0,I.jsx)(J,{children:!e.authType||e.authType===`none`?(0,I.jsx)(`span`,{className:`text-xs text-muted-foreground`,children:`—`}):(0,I.jsx)(Y,{variant:`outline`,className:`text-xs`,children:e.authType})}),(0,I.jsx)(J,{className:`text-right`,onClick:e=>e.stopPropagation(),children:(0,I.jsxs)(`div`,{className:`flex items-center justify-end gap-2`,children:[(0,I.jsxs)(W,{type:`button`,size:`sm`,variant:`outline`,className:`text-destructive hover:text-destructive`,onClick:()=>o(e),children:[(0,I.jsx)(lr,{className:`mr-1.5 h-3.5 w-3.5`}),`Delete`]}),(0,I.jsxs)(W,{type:`button`,size:`sm`,variant:`outline`,onClick:()=>void d(e),children:[(0,I.jsx)(vn,{className:`mr-1.5 h-3.5 w-3.5`}),`Duplicate`]}),(0,I.jsxs)(W,{type:`button`,size:`sm`,variant:`outline`,onClick:()=>i(`/libraries/servers/${encodeURIComponent(e.id)}`),children:[(0,I.jsx)(Jn,{className:`mr-1.5 h-3.5 w-3.5`}),`Edit`]})]})})]},e.id))})]})})}),(0,I.jsx)(X6,{open:!!a,onOpenChange:e=>!e&&o(null),children:(0,I.jsxs)(Q6,{children:[(0,I.jsxs)($6,{children:[(0,I.jsx)(t8,{children:`Delete server?`}),(0,I.jsxs)(n8,{children:[`This will permanently remove`,` `,(0,I.jsx)(`span`,{className:`font-mono`,children:a?u(a):``}),` `,`from the library. This action cannot be undone.`]})]}),(0,I.jsxs)(e8,{children:[(0,I.jsx)(i8,{children:`Cancel`}),(0,I.jsx)(r8,{className:`bg-destructive text-destructive-foreground hover:bg-destructive/90`,onClick:()=>{a&&f(a)},children:`Delete Server`})]})]})})]})};function a8({className:e,disabled:t,...n}){let[r,i]=(0,_.useState)(!1);return(0,I.jsxs)(`div`,{className:`relative`,children:[(0,I.jsx)(Op,{...n,disabled:t,type:r?`text`:`password`,className:[e,`pr-9`].filter(Boolean).join(` `)}),(0,I.jsx)(W,{type:`button`,variant:`ghost`,size:`icon`,disabled:t,"aria-label":r?`Hide value`:`Show value`,"aria-pressed":r,title:r?`Hide value`:`Show value`,className:`absolute right-0 top-0 h-full w-9 rounded-l-none`,onClick:()=>i(e=>!e),children:r?(0,I.jsx)(Cn,{className:`h-4 w-4`}):(0,I.jsx)(wn,{className:`h-4 w-4`})})]})}var o8={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`},s8=()=>({id:`srv-${Date.now()}`,name:``,transport:`stdio`,authType:`none`}),pue=()=>{let{serverId:e}=Zd(),t=qd(),{servers:n,setServers:r}=hv(),{source:i}=nv(),a=e===`new`,o=e?decodeURIComponent(e):``,s=a?null:n.find(e=>e.id===o||e.name===o),c=e=>e.name?.trim()||e.id,[l,u]=(0,_.useState)(()=>s??s8()),[d,f]=(0,_.useState)(!1),[p,m]=(0,_.useState)(!1),[h,g]=(0,_.useState)({status:`idle`}),[v,y]=(0,_.useState)(!1),[b,x]=(0,_.useState)(!1),[S,C]=(0,_.useState)([]),[w,T]=(0,_.useState)(!1),E=(0,_.useRef)(null);(0,_.useEffect)(()=>{let e=a?`new:${o||`new`}`:`srv:${o}`;E.current!==e&&(a?(u(s8()),T(!1),E.current=e):s&&(u(s),T(!1),E.current=e))},[a,o,s]);let D=e=>{T(!1),u(t=>({...t,authType:e,...e!==`bearer`&&e!==`api-key`?{authValue:void 0}:{},...e===`api-key`?{apiKeyHeaderName:t.apiKeyHeaderName||`X-API-Key`}:{apiKeyHeaderName:void 0},...e===`oauth2`?{oauthRedirectUrl:t.oauthRedirectUrl||void 0}:{oauthClientId:void 0,oauthClientSecret:void 0,oauthRedirectUrl:void 0,oauthScope:void 0,oauthMode:void 0,oauthAuthorizationUrl:void 0,oauthTokenEndpoint:void 0}}))},k=async()=>{if(y(!0),g({status:`loading`}),C([]),l.authType===`oauth2`)try{x(!0),await e6({serverNames:[l.id],source:i,onServerStatus:e=>{let t=new Date().toLocaleTimeString(),n=typeof e.tokenExpiresInSeconds==`number`?` (valid ${f6(e.tokenExpiresInSeconds,{nonPositiveLabel:`expired`})}; until ${new Date(e.tokenExpiresAt||Date.now()).toLocaleTimeString()})`:``;e.status===`auth_required`?C(n=>[...n,`[${t}] OAuth debug: callback required for '${e.serverName}'`]):e.status===`ready`&&(e.debugState===`refreshed`?C(e=>[...e,`[${t}] OAuth debug: token refreshed (no callback)${n}`]):e.debugState===`reused`?C(e=>[...e,`[${t}] OAuth debug: session/token reused${n}`]):C(e=>[...e,`[${t}] OAuth debug: authorized${n}`]))}})}catch(e){g({status:`error`,message:`OAuth login failed: ${e instanceof Error?e.message:String(e)}`,testedAt:new Date().toISOString()}),x(!1);return}finally{x(!1)}try{let e=(await i.discoverToolsForAnalysis({serverNames:[l.id]})).servers[0];e&&e.warnings.length===0?g({status:`success`,toolNames:e.tools.map(e=>e.name),toolCount:e.tools.length,mcpServerVersion:e.mcpServerVersion,mcpServerImplementation:e.mcpServerImplementation,testedAt:new Date().toISOString()}):g({status:`error`,message:e?.warnings[0]??`Connection failed`,testedAt:new Date().toISOString()})}catch(e){g({status:`error`,message:e instanceof Error?e.message:String(e),testedAt:new Date().toISOString()})}},A=async()=>{if(!l.name.trim()){O({title:`Name is required`,variant:`destructive`});return}let e=E6(l);if(e){O({title:`Validation Error`,description:e,variant:`destructive`});return}let i={...l,authValue:l.authValue?.trim(),apiKeyHeaderName:l.apiKeyHeaderName?.trim()||void 0};m(!0);try{if(a)await r([...n,i]),O({title:`Server created`}),t(`/libraries/servers/${encodeURIComponent(i.id)}`);else{let e=n.map(e=>e.id===s?.id?i:e);await r(e),O({title:`Server saved`}),i.id!==o&&t(`/libraries/servers/${encodeURIComponent(i.id)}`,{replace:!0})}}finally{m(!1)}},j=async()=>{let e=n.filter(e=>e.id!==s?.id);await r(e),O({title:`Server deleted`}),t(`/libraries/servers`)},M=()=>l.transport===`stdio`?[l.command,...l.args||[]].filter(Boolean).join(` `):l.url||``;return!a&&!s?(0,I.jsxs)(`div`,{className:`space-y-4`,children:[(0,I.jsxs)(np,{to:`/libraries/servers`,className:`inline-flex items-center gap-1.5 text-sm text-muted-foreground hover:text-foreground`,children:[(0,I.jsx)(Qt,{className:`h-4 w-4`}),` Servers`]}),(0,I.jsxs)(`p`,{className:`text-sm text-muted-foreground`,children:[`Server "`,o,`" not found.`]})]}):(0,I.jsxs)(`div`,{className:`space-y-6`,children:[(0,I.jsxs)(`div`,{className:`flex items-start justify-between gap-2`,children:[(0,I.jsxs)(`div`,{className:`space-y-1`,children:[(0,I.jsxs)(np,{to:`/libraries/servers`,className:`inline-flex items-center gap-1.5 text-sm text-muted-foreground hover:text-foreground`,children:[(0,I.jsx)(Qt,{className:`h-4 w-4`}),` Servers`]}),(0,I.jsxs)(`h1`,{className:`flex items-center gap-2 text-2xl font-bold`,children:[(0,I.jsx)(`img`,{src:`/mcp.svg`,alt:``,"aria-hidden":`true`,className:`h-6 w-6`}),a?`New Server`:c(l)]})]}),!a&&(0,I.jsxs)(W,{type:`button`,onClick:()=>void k(),disabled:h.status===`loading`||b,children:[(0,I.jsx)(pr,{className:`mr-2 h-4 w-4`}),`Test Connection`]})]}),v&&(0,I.jsxs)(K,{children:[(0,I.jsxs)(gv,{className:`flex-row items-center justify-between space-y-0`,children:[(0,I.jsx)(_v,{className:`text-base`,children:`Connection Test`}),(0,I.jsx)(`button`,{type:`button`,onClick:()=>y(!1),className:`rounded-sm opacity-70 hover:opacity-100`,children:(0,I.jsx)(hr,{className:`h-4 w-4`})})]}),(0,I.jsxs)(q,{className:`space-y-3`,children:[(0,I.jsxs)(`div`,{className:`flex flex-wrap items-center gap-x-2 gap-y-1 text-sm text-muted-foreground`,children:[(0,I.jsx)(`span`,{children:`Server:`}),(0,I.jsx)(`span`,{className:`font-medium text-foreground`,children:c(l)}),(0,I.jsx)(`span`,{className:`mx-1`,children:`·`}),(0,I.jsx)(`span`,{children:`Transport:`}),(0,I.jsx)(`span`,{className:`font-medium text-foreground`,children:l.transport}),M()&&(0,I.jsxs)(I.Fragment,{children:[(0,I.jsx)(`span`,{className:`mx-1`,children:`·`}),(0,I.jsx)(`span`,{children:`Endpoint:`}),(0,I.jsx)(`code`,{className:`font-mono text-xs`,children:M()})]})]}),h.status===`loading`&&(0,I.jsxs)(`div`,{className:`space-y-1`,children:[(0,I.jsxs)(`div`,{className:`flex items-center gap-2 text-sm text-muted-foreground`,children:[(0,I.jsx)(zn,{className:`h-4 w-4 animate-spin`}),b?`Waiting for OAuth login in browser…`:`Connecting to MCP server…`]}),S.length>0&&(0,I.jsx)(`div`,{className:`space-y-0.5`,children:S.map((e,t)=>(0,I.jsx)(`p`,{className:`text-xs text-muted-foreground`,children:e},t))})]}),h.status===`success`&&(0,I.jsxs)(`div`,{className:`space-y-3`,children:[(0,I.jsxs)(`p`,{className:`flex items-center gap-2 text-sm text-emerald-700`,children:[(0,I.jsx)(an,{className:`h-4 w-4 shrink-0`}),`Connected — discovered `,h.toolCount,` tool`,h.toolCount===1?``:`s`]}),h.toolNames.length>0&&(0,I.jsxs)(`div`,{className:`rounded-md bg-muted p-3`,children:[(0,I.jsx)(`p`,{className:`mb-1 text-xs font-medium text-muted-foreground`,children:`First 5 tools:`}),(0,I.jsx)(`ul`,{className:`space-y-0.5`,children:h.toolNames.slice(0,5).map(e=>(0,I.jsx)(`li`,{className:`font-mono text-xs`,children:e},e))})]}),(h.mcpServerImplementation||h.mcpServerVersion)&&(0,I.jsx)(`div`,{className:`rounded-md border bg-muted/40 p-3`,children:(0,I.jsxs)(`div`,{className:`flex items-start gap-2`,children:[h.mcpServerImplementation?.icons?.[0]?.src?(0,I.jsx)(`img`,{src:h.mcpServerImplementation.icons[0].src,alt:h.mcpServerImplementation.title||h.mcpServerImplementation.name,className:`h-7 w-7 rounded-sm border bg-background object-contain`}):null,(0,I.jsxs)(`div`,{className:`min-w-0`,children:[(0,I.jsx)(`p`,{className:`text-xs font-medium text-muted-foreground`,children:`MCP server`}),(0,I.jsx)(`p`,{className:`truncate text-sm`,children:h.mcpServerImplementation?h.mcpServerImplementation.title||h.mcpServerImplementation.name:`Unknown MCP server`}),h.mcpServerVersion?(0,I.jsxs)(`p`,{className:`text-xs text-muted-foreground`,children:[`Version:`,` `,(0,I.jsx)(`code`,{className:`font-mono`,children:h.mcpServerVersion})]}):null,h.mcpServerImplementation?.description?(0,I.jsx)(`p`,{className:`text-xs text-muted-foreground`,children:h.mcpServerImplementation.description}):null]})]})}),(0,I.jsxs)(`p`,{className:`text-xs text-muted-foreground`,children:[`Tested at `,new Date(h.testedAt).toLocaleString()]}),S.length>0&&(0,I.jsx)(`div`,{className:`space-y-0.5`,children:S.map((e,t)=>(0,I.jsx)(`p`,{className:`text-xs text-muted-foreground`,children:e},t))})]}),h.status===`error`&&(0,I.jsxs)(`div`,{className:`space-y-2`,children:[(0,I.jsxs)(`p`,{className:`text-sm text-destructive`,children:[(0,I.jsx)(`span`,{className:`font-medium`,children:`✗ Connection failed`}),` — `,h.message]}),o8[l.transport]&&(0,I.jsxs)(`p`,{className:`rounded-md bg-muted px-3 py-2 text-xs text-muted-foreground`,children:[`Hint: `,o8[l.transport]]}),(0,I.jsxs)(`p`,{className:`text-xs text-muted-foreground`,children:[`Tested at `,new Date(h.testedAt).toLocaleString()]})]})]})]}),(0,I.jsxs)(K,{children:[(0,I.jsx)(gv,{children:(0,I.jsx)(_v,{className:`text-base`,children:`Configuration`})}),(0,I.jsxs)(q,{className:`space-y-4`,children:[(0,I.jsxs)(`div`,{className:`grid gap-4 sm:grid-cols-2`,children:[(0,I.jsxs)(`div`,{className:`space-y-1.5`,children:[(0,I.jsx)(Q,{children:`Name`}),(0,I.jsx)(Op,{value:l.name,onChange:e=>u(t=>({...t,name:e.target.value})),placeholder:`e.g. Filesystem MCP`})]}),(0,I.jsxs)(`div`,{className:`space-y-1.5`,children:[(0,I.jsx)(Q,{children:`Transport`}),(0,I.jsxs)(OY,{value:l.transport,onValueChange:e=>u(t=>({...t,transport:e})),children:[(0,I.jsx)(AY,{children:(0,I.jsx)(kY,{})}),(0,I.jsxs)(NY,{children:[(0,I.jsx)(Z,{value:`stdio`,children:`stdio`}),(0,I.jsx)(Z,{value:`sse`,children:`SSE`}),(0,I.jsx)(Z,{value:`streamable-http`,children:`Streamable HTTP`})]})]})]})]}),l.transport===`stdio`?(0,I.jsxs)(`div`,{className:`grid gap-4 sm:grid-cols-2`,children:[(0,I.jsxs)(`div`,{className:`space-y-1.5`,children:[(0,I.jsx)(Q,{children:`Command`}),(0,I.jsx)(Op,{value:l.command||``,onChange:e=>u(t=>({...t,command:e.target.value})),placeholder:`npx`,className:`font-mono text-xs`})]}),(0,I.jsxs)(`div`,{className:`space-y-1.5`,children:[(0,I.jsx)(Q,{children:`Args (comma-separated)`}),(0,I.jsx)(Op,{value:(l.args||[]).join(`, `),onChange:e=>u(t=>({...t,args:e.target.value.split(`,`).map(e=>e.trim()).filter(Boolean)})),placeholder:`-y, @mcp/server`,className:`font-mono text-xs`})]})]}):(0,I.jsxs)(`div`,{className:`space-y-1.5`,children:[(0,I.jsx)(Q,{children:`URL`}),(0,I.jsx)(Op,{value:l.url||``,onChange:e=>u(t=>({...t,url:e.target.value})),placeholder:`http://localhost:3001/sse`,className:`font-mono text-xs`})]}),(0,I.jsxs)(`div`,{className:`grid gap-4 sm:grid-cols-2`,children:[(0,I.jsxs)(`div`,{className:`space-y-1.5`,children:[(0,I.jsx)(Q,{children:`Auth Type`}),(0,I.jsxs)(OY,{value:l.authType||`none`,onValueChange:e=>D(e),children:[(0,I.jsx)(AY,{children:(0,I.jsx)(kY,{})}),(0,I.jsxs)(NY,{children:[(0,I.jsx)(Z,{value:`none`,children:`None`}),(0,I.jsx)(Z,{value:`bearer`,children:`Bearer Token`}),(0,I.jsx)(Z,{value:`api-key`,children:`API Key`}),(0,I.jsx)(Z,{value:`oauth2`,children:`OAuth 2.0`})]})]})]}),l.authType===`bearer`&&(0,I.jsxs)(`div`,{className:`space-y-1.5`,children:[(0,I.jsx)(Q,{children:`Token`}),(0,I.jsx)(Op,{value:l.authValue||``,onChange:e=>u(t=>({...t,authValue:e.target.value})),placeholder:"${DATABRICKS_TOKEN}",className:`font-mono text-xs`})]})]}),l.authType===`bearer`&&(0,I.jsxs)(`p`,{className:`text-xs text-muted-foreground -mt-1`,children:[`Use `,(0,I.jsx)(`code`,{className:`rounded bg-muted px-1`,children:"${VAR_NAME}"}),` to reference an environment variable, or enter a token directly.`]}),l.authType===`api-key`&&(0,I.jsxs)(`div`,{className:`space-y-3 rounded-md border p-3`,children:[(0,I.jsx)(`div`,{className:`text-xs font-medium text-muted-foreground`,children:`API Key`}),(0,I.jsxs)(`div`,{className:`grid gap-3 sm:grid-cols-2`,children:[(0,I.jsxs)(`div`,{className:`space-y-1.5`,children:[(0,I.jsx)(Q,{className:`text-xs`,children:`Header Name`}),(0,I.jsx)(Op,{value:l.apiKeyHeaderName||`X-API-Key`,onChange:e=>u(t=>({...t,apiKeyHeaderName:e.target.value})),placeholder:`X-API-Key`,className:`font-mono text-xs`})]}),(0,I.jsxs)(`div`,{className:`space-y-1.5`,children:[(0,I.jsx)(Q,{className:`text-xs`,children:`Value`}),(0,I.jsx)(a8,{value:l.authValue||``,onChange:e=>u(t=>({...t,authValue:e.target.value})),placeholder:"${MY_API_KEY}",className:`font-mono text-xs`})]})]}),(0,I.jsxs)(`p`,{className:`text-xs text-muted-foreground`,children:[`Use `,(0,I.jsx)(`code`,{className:`rounded bg-muted px-1`,children:"${VAR_NAME}"}),` to reference an environment variable, or enter a value directly.`]})]}),l.authType===`oauth2`&&(0,I.jsxs)(`div`,{className:`space-y-3 rounded-md border p-3`,children:[(0,I.jsx)(`div`,{className:`text-xs font-medium text-muted-foreground`,children:`OAuth 2.0 Flow`}),(0,I.jsxs)(`div`,{className:`flex gap-2`,children:[(0,I.jsx)(W,{type:`button`,variant:!l.oauthMode||l.oauthMode===`pre_registered`?`default`:`outline-solid`,size:`sm`,onClick:()=>u(e=>({...e,oauthMode:`pre_registered`})),children:`Pre-registered`}),(0,I.jsx)(W,{type:`button`,variant:l.oauthMode===`dcr`?`default`:`outline-solid`,size:`sm`,onClick:()=>u(e=>({...e,oauthMode:`dcr`,oauthClientId:void 0,oauthClientSecret:void 0})),children:`DCR (Dynamic)`})]}),(!l.oauthMode||l.oauthMode===`pre_registered`)&&(0,I.jsxs)(`div`,{className:`grid gap-3 sm:grid-cols-2`,children:[(0,I.jsxs)(`div`,{className:`space-y-1.5`,children:[(0,I.jsx)(Q,{className:`text-xs`,children:`Client ID`}),(0,I.jsx)(Op,{value:l.oauthClientId||``,onChange:e=>u(t=>({...t,oauthClientId:e.target.value})),placeholder:`your-client-id`,className:`font-mono text-xs`})]}),(0,I.jsxs)(`div`,{className:`space-y-1.5`,children:[(0,I.jsx)(Q,{className:`text-xs`,children:`Client Secret (optional)`}),(0,I.jsx)(a8,{value:l.oauthClientSecret||``,onChange:e=>u(t=>({...t,oauthClientSecret:e.target.value})),placeholder:`••••••••`,className:`font-mono text-xs`})]})]}),(0,I.jsxs)(`div`,{className:`space-y-1.5`,children:[(0,I.jsx)(Q,{className:`text-xs`,children:`Scope (optional, space-separated)`}),(0,I.jsx)(Op,{value:l.oauthScope||``,onChange:e=>u(t=>({...t,oauthScope:e.target.value})),placeholder:`openid profile mcp`,className:`font-mono text-xs`})]}),(0,I.jsxs)(`div`,{children:[(0,I.jsxs)(`button`,{type:`button`,className:`flex items-center gap-1 text-xs text-muted-foreground hover:text-foreground`,onClick:()=>T(e=>!e),children:[(0,I.jsx)(`span`,{children:w?`▾`:`▸`}),`Advanced — manual endpoint overrides`]}),w&&(0,I.jsxs)(`div`,{className:`mt-2 grid gap-3 sm:grid-cols-2`,children:[(0,I.jsxs)(`div`,{className:`space-y-1.5`,children:[(0,I.jsx)(Q,{className:`text-xs`,children:`Authorization URL`}),(0,I.jsx)(Op,{value:l.oauthAuthorizationUrl||``,onChange:e=>u(t=>({...t,oauthAuthorizationUrl:e.target.value||void 0})),placeholder:`leave blank to use .well-known discovery`,className:`font-mono text-xs`})]}),(0,I.jsxs)(`div`,{className:`space-y-1.5`,children:[(0,I.jsx)(Q,{className:`text-xs`,children:`Token URL`}),(0,I.jsx)(Op,{value:l.oauthTokenEndpoint||``,onChange:e=>u(t=>({...t,oauthTokenEndpoint:e.target.value||void 0})),placeholder:`leave blank to use .well-known discovery`,className:`font-mono text-xs`})]})]})]})]}),(0,I.jsxs)(`div`,{className:`flex items-center justify-between pt-2`,children:[(0,I.jsx)(`div`,{children:!a&&(0,I.jsx)(W,{type:`button`,variant:`destructive`,size:`sm`,onClick:()=>f(!0),children:`Delete`})}),(0,I.jsxs)(`div`,{className:`flex items-center gap-2`,children:[(0,I.jsx)(W,{type:`button`,variant:`outline`,size:`sm`,onClick:()=>t(`/libraries/servers`),children:`Cancel`}),(0,I.jsxs)(W,{type:`button`,size:`sm`,onClick:()=>void A(),disabled:p,children:[p&&(0,I.jsx)(zn,{className:`mr-2 h-4 w-4 animate-spin`}),a?`Create Server`:`Save`]})]})]})]})]}),(0,I.jsx)(X6,{open:d,onOpenChange:f,children:(0,I.jsxs)(Q6,{children:[(0,I.jsxs)($6,{children:[(0,I.jsx)(t8,{children:`Delete server?`}),(0,I.jsxs)(n8,{children:[`This will permanently remove the server `,(0,I.jsx)(`span`,{className:`font-mono`,children:l.name}),`. This action cannot be undone.`]})]}),(0,I.jsxs)(e8,{children:[(0,I.jsx)(i8,{children:`Cancel`}),(0,I.jsx)(r8,{onClick:()=>void j(),className:`bg-destructive text-destructive-foreground hover:bg-destructive/90`,children:`Delete`})]})]})})]})},mue=({defaultType:e=`llm`})=>{let{agents:t,setAgents:n,reload:r,loading:i}=hv(),a=qd(),[o]=cp(),[s,c]=(0,_.useState)(null),[l,u]=(0,_.useState)(``),d=o.get(`type`)===`browser`?`browser`:e,[f,p]=(0,_.useState)(d),m=l.trim().toLowerCase();(0,_.useEffect)(()=>{p(d)},[d]);let h=e=>{let t=e;p(t),a(`/libraries/agents?type=${t}`)},g=(0,_.useMemo)(()=>({llm:t.filter(e=>(e.type??`llm`)===`llm`).length,browser:t.filter(e=>e.type===`browser`).length}),[t]),v=(0,_.useMemo)(()=>t.filter(e=>(e.type??`llm`)===f?m.length===0||[e.name,e.provider,e.model,e.type===`browser`?e.url:void 0].filter(Boolean).join(` `).toLowerCase().includes(m):!1),[t,m,f]),y=async e=>{let r=`${e.name}-copy`,i=r,a=1;for(;t.some(e=>e.name===i);)i=`${r}-${a}`,a+=1;let o={...structuredClone(e),id:`agt-${Date.now()}`,name:i};await n([...t,o]),O({title:`Agent duplicated`,description:`Created ${i}.`})},b=async e=>{await n(t.filter(t=>t.id!==e.id)),O({title:`Agent deleted`,description:`${e.name} was removed.`}),c(null)};return(0,I.jsxs)(`div`,{className:`space-y-6`,children:[(0,I.jsxs)(`div`,{className:`flex items-start justify-between gap-2`,children:[(0,I.jsxs)(`div`,{children:[(0,I.jsxs)(`h1`,{className:`inline-flex items-center gap-2 text-2xl font-bold`,children:[(0,I.jsx)(en,{className:`h-6 w-6`}),`Agents`]}),(0,I.jsx)(`p`,{className:`text-sm text-muted-foreground`,children:`Reusable agent profiles shared across configurations.`})]}),(0,I.jsxs)(`div`,{className:`flex items-center gap-2`,children:[(0,I.jsx)(RW,{value:l,onValueChange:u,placeholder:`Search agents...`}),(0,I.jsxs)(W,{type:`button`,size:`sm`,variant:`outline`,onClick:()=>void r(),disabled:i,children:[(0,I.jsx)(Qn,{className:`mr-2 h-4 w-4`}),`Refresh`]}),(0,I.jsxs)(W,{type:`button`,size:`sm`,onClick:()=>a(`/libraries/agents/new?type=${f}`),children:[(0,I.jsx)(Xn,{className:`mr-2 h-4 w-4`}),`Add Agent`]})]})]}),t.length===0?(0,I.jsxs)(`div`,{className:`flex flex-col items-center justify-center rounded-lg border border-dashed py-16 text-center`,children:[(0,I.jsx)(`p`,{className:`text-sm text-muted-foreground`,children:`No agents configured. Add one to get started.`}),(0,I.jsxs)(W,{type:`button`,size:`sm`,className:`mt-4`,onClick:()=>a(`/libraries/agents/new?type=${f}`),children:[(0,I.jsx)(Xn,{className:`mr-2 h-4 w-4`}),`Add Agent`]})]}):(0,I.jsxs)(CX,{value:f,onValueChange:h,className:`space-y-4`,children:[(0,I.jsxs)(wX,{className:`grid w-full max-w-md grid-cols-2`,"aria-label":`Agent type`,children:[(0,I.jsxs)(TX,{value:`llm`,children:[`LLM (`,g.llm,`)`]}),(0,I.jsxs)(TX,{value:`browser`,children:[`Browser (`,g.browser,`)`]})]}),v.length===0?(0,I.jsx)(`div`,{className:`flex flex-col items-center justify-center rounded-lg border border-dashed py-12 text-center`,children:(0,I.jsx)(`p`,{className:`text-sm text-muted-foreground`,children:`No agents match this filter.`})}):(0,I.jsx)(K,{children:(0,I.jsx)(q,{className:`p-0`,children:(0,I.jsxs)(bv,{children:[(0,I.jsx)(xv,{children:(0,I.jsxs)(wv,{children:[(0,I.jsx)(Tv,{children:`Name`}),(0,I.jsx)(Tv,{children:`Provider`}),f===`browser`?(0,I.jsxs)(I.Fragment,{children:[(0,I.jsx)(Tv,{children:`URL`}),(0,I.jsx)(Tv,{children:`Conversation`})]}):(0,I.jsxs)(I.Fragment,{children:[(0,I.jsx)(Tv,{children:`Model`}),(0,I.jsx)(Tv,{children:`Max Tokens`}),(0,I.jsx)(Tv,{children:`Temperature`})]}),(0,I.jsx)(Tv,{className:`text-right`,children:`Actions`})]})}),(0,I.jsx)(Sv,{children:v.map(e=>(0,I.jsxs)(wv,{className:`cursor-pointer hover:bg-muted/50`,onClick:()=>a(`/libraries/agents/${encodeURIComponent(e.id)}`),children:[(0,I.jsx)(J,{className:`font-medium`,children:(0,I.jsxs)(`span`,{className:`inline-flex items-center gap-2`,title:e.type===`browser`?`Browser agent`:`LLM agent`,children:[e.type===`browser`?(0,I.jsx)(bn,{className:`h-4 w-4 text-sky-600`,"aria-hidden":`true`}):(0,I.jsx)(en,{className:`h-4 w-4 text-muted-foreground`,"aria-hidden":`true`}),e.name]})}),(0,I.jsx)(J,{children:(0,I.jsx)(AX,{provider:e.provider})}),e.type===`browser`?(0,I.jsxs)(I.Fragment,{children:[(0,I.jsx)(J,{children:(0,I.jsx)(`span`,{className:`max-w-xs truncate font-mono text-xs`,title:e.url,children:e.url||`Not configured`})}),(0,I.jsx)(J,{className:`text-xs`,children:e.newConversationBetweenScenarios===!1?`Continue same conversation`:`New conversation per scenario`})]}):(0,I.jsxs)(I.Fragment,{children:[(0,I.jsx)(J,{children:(0,I.jsx)(`span`,{className:`font-mono text-xs`,children:e.model})}),(0,I.jsx)(J,{className:`font-mono text-xs`,children:e.maxTokens}),(0,I.jsx)(J,{className:`font-mono text-xs`,children:D6(e.temperature).toFixed(2)})]}),(0,I.jsx)(J,{className:`text-right`,onClick:e=>e.stopPropagation(),children:(0,I.jsxs)(`div`,{className:`flex items-center justify-end gap-2`,children:[(0,I.jsxs)(W,{type:`button`,size:`sm`,variant:`outline`,className:`text-destructive hover:text-destructive`,onClick:()=>c(e),children:[(0,I.jsx)(lr,{className:`mr-1.5 h-3.5 w-3.5`}),`Delete`]}),(0,I.jsxs)(W,{type:`button`,size:`sm`,variant:`outline`,onClick:()=>void y(e),children:[(0,I.jsx)(vn,{className:`mr-1.5 h-3.5 w-3.5`}),`Duplicate`]}),(0,I.jsxs)(W,{type:`button`,size:`sm`,variant:`outline`,onClick:()=>a(`/libraries/agents/${encodeURIComponent(e.id)}`),children:[(0,I.jsx)(Jn,{className:`mr-1.5 h-3.5 w-3.5`}),`Edit`]})]})})]},e.id))})]})})})]}),(0,I.jsx)(X6,{open:!!s,onOpenChange:e=>!e&&c(null),children:(0,I.jsxs)(Q6,{children:[(0,I.jsxs)($6,{children:[(0,I.jsx)(t8,{children:`Delete agent?`}),(0,I.jsxs)(n8,{children:[`This will permanently remove `,(0,I.jsx)(`span`,{className:`font-mono`,children:s?.name}),` `,`from the library. This action cannot be undone.`]})]}),(0,I.jsxs)(e8,{children:[(0,I.jsx)(i8,{children:`Cancel`}),(0,I.jsx)(r8,{className:`bg-destructive text-destructive-foreground hover:bg-destructive/90`,onClick:()=>{s&&b(s)},children:`Delete Agent`})]})]})})]})},c8=[`PageUp`,`PageDown`],l8=[`ArrowUp`,`ArrowDown`,`ArrowLeft`,`ArrowRight`],u8={"from-left":[`Home`,`PageDown`,`ArrowDown`,`ArrowLeft`],"from-right":[`Home`,`PageDown`,`ArrowDown`,`ArrowRight`],"from-bottom":[`Home`,`PageDown`,`ArrowDown`,`ArrowLeft`],"from-top":[`Home`,`PageDown`,`ArrowUp`,`ArrowLeft`]},d8=`Slider`,[f8,hue,gue]=oe(d8),[p8,_ue]=R(d8,[gue]),[vue,m8]=p8(d8),h8=_.forwardRef((e,t)=>{let{name:n,min:r=0,max:i=100,step:a=1,orientation:o=`horizontal`,disabled:s=!1,minStepsBetweenThumbs:c=0,defaultValue:l=[r],value:u,onValueChange:d=()=>{},onValueCommit:f=()=>{},inverted:p=!1,form:m,...h}=e,g=_.useRef(new Set),v=_.useRef(0),y=o===`horizontal`?yue:bue,[b=[],x]=ze({prop:u,defaultProp:l,onChange:e=>{[...g.current][v.current]?.focus(),d(e)}}),S=_.useRef(b);function C(e){E(e,Tue(b,e))}function w(e){E(e,v.current)}function T(){let e=S.current[v.current];b[v.current]!==e&&f(b)}function E(e,t,{commit:n}={commit:!1}){let o=kue(a),s=Jq(Aue(Math.round((e-r)/a)*a+r,o),[r,i]);x((e=[])=>{let r=Cue(e,s,t);if(Oue(r,c*a)){v.current=r.indexOf(s);let t=String(r)!==String(e);return t&&n&&f(r),t?r:e}return e})}return(0,I.jsx)(vue,{scope:e.__scopeSlider,name:n,disabled:s,min:r,max:i,valueIndexToChangeRef:v,thumbs:g.current,values:b,orientation:o,form:m,children:(0,I.jsx)(f8.Provider,{scope:e.__scopeSlider,children:(0,I.jsx)(f8.Slot,{scope:e.__scopeSlider,children:(0,I.jsx)(y,{"aria-disabled":s,"data-disabled":s?``:void 0,...h,ref:t,onPointerDown:j(h.onPointerDown,()=>{s||(S.current=b)}),min:r,max:i,inverted:p,onSlideStart:s?void 0:C,onSlideMove:s?void 0:w,onSlideEnd:s?void 0:T,onHomeKeyDown:()=>!s&&E(r,0,{commit:!0}),onEndKeyDown:()=>!s&&E(i,b.length-1,{commit:!0}),onStepKeyDown:({event:e,direction:t})=>{if(!s){let n=c8.includes(e.key)||e.shiftKey&&l8.includes(e.key)?10:1,r=v.current,i=b[r];E(i+a*n*t,r,{commit:!0})}}})})})})});h8.displayName=d8;var[g8,_8]=p8(d8,{startEdge:`left`,endEdge:`right`,size:`width`,direction:1}),yue=_.forwardRef((e,t)=>{let{min:n,max:r,dir:i,inverted:a,onSlideStart:o,onSlideMove:s,onSlideEnd:c,onStepKeyDown:l,...u}=e,[d,f]=_.useState(null),p=P(t,e=>f(e)),m=_.useRef(void 0),h=BW(i),g=h===`ltr`,v=g&&!a||!g&&a;function y(e){let t=m.current||d.getBoundingClientRect(),i=D8([0,t.width],v?[n,r]:[r,n]);return m.current=t,i(e-t.left)}return(0,I.jsx)(g8,{scope:e.__scopeSlider,startEdge:v?`left`:`right`,endEdge:v?`right`:`left`,direction:v?1:-1,size:`width`,children:(0,I.jsx)(v8,{dir:h,"data-orientation":`horizontal`,...u,ref:p,style:{...u.style,"--radix-slider-thumb-transform":`translateX(-50%)`},onSlideStart:e=>{let t=y(e.clientX);o?.(t)},onSlideMove:e=>{let t=y(e.clientX);s?.(t)},onSlideEnd:()=>{m.current=void 0,c?.()},onStepKeyDown:e=>{let t=u8[v?`from-left`:`from-right`].includes(e.key);l?.({event:e,direction:t?-1:1})}})})}),bue=_.forwardRef((e,t)=>{let{min:n,max:r,inverted:i,onSlideStart:a,onSlideMove:o,onSlideEnd:s,onStepKeyDown:c,...l}=e,u=_.useRef(null),d=P(t,u),f=_.useRef(void 0),p=!i;function m(e){let t=f.current||u.current.getBoundingClientRect(),i=D8([0,t.height],p?[r,n]:[n,r]);return f.current=t,i(e-t.top)}return(0,I.jsx)(g8,{scope:e.__scopeSlider,startEdge:p?`bottom`:`top`,endEdge:p?`top`:`bottom`,size:`height`,direction:p?1:-1,children:(0,I.jsx)(v8,{"data-orientation":`vertical`,...l,ref:d,style:{...l.style,"--radix-slider-thumb-transform":`translateY(50%)`},onSlideStart:e=>{let t=m(e.clientY);a?.(t)},onSlideMove:e=>{let t=m(e.clientY);o?.(t)},onSlideEnd:()=>{f.current=void 0,s?.()},onStepKeyDown:e=>{let t=u8[p?`from-bottom`:`from-top`].includes(e.key);c?.({event:e,direction:t?-1:1})}})})}),v8=_.forwardRef((e,t)=>{let{__scopeSlider:n,onSlideStart:r,onSlideMove:i,onSlideEnd:a,onHomeKeyDown:o,onEndKeyDown:s,onStepKeyDown:c,...l}=e,u=m8(d8,n);return(0,I.jsx)(V.span,{...l,ref:t,onKeyDown:j(e.onKeyDown,e=>{e.key===`Home`?(o(e),e.preventDefault()):e.key===`End`?(s(e),e.preventDefault()):c8.concat(l8).includes(e.key)&&(c(e),e.preventDefault())}),onPointerDown:j(e.onPointerDown,e=>{let t=e.target;t.setPointerCapture(e.pointerId),e.preventDefault(),u.thumbs.has(t)?t.focus():r(e)}),onPointerMove:j(e.onPointerMove,e=>{e.target.hasPointerCapture(e.pointerId)&&i(e)}),onPointerUp:j(e.onPointerUp,e=>{let t=e.target;t.hasPointerCapture(e.pointerId)&&(t.releasePointerCapture(e.pointerId),a(e))})})}),y8=`SliderTrack`,b8=_.forwardRef((e,t)=>{let{__scopeSlider:n,...r}=e,i=m8(y8,n);return(0,I.jsx)(V.span,{"data-disabled":i.disabled?``:void 0,"data-orientation":i.orientation,...r,ref:t})});b8.displayName=y8;var x8=`SliderRange`,S8=_.forwardRef((e,t)=>{let{__scopeSlider:n,...r}=e,i=m8(x8,n),a=_8(x8,n),o=P(t,_.useRef(null)),s=i.values.length,c=i.values.map(e=>E8(e,i.min,i.max)),l=s>1?Math.min(...c):0,u=100-Math.max(...c);return(0,I.jsx)(V.span,{"data-orientation":i.orientation,"data-disabled":i.disabled?``:void 0,...r,ref:o,style:{...e.style,[a.startEdge]:l+`%`,[a.endEdge]:u+`%`}})});S8.displayName=x8;var C8=`SliderThumb`,w8=_.forwardRef((e,t)=>{let n=hue(e.__scopeSlider),[r,i]=_.useState(null),a=P(t,e=>i(e)),o=_.useMemo(()=>r?n().findIndex(e=>e.ref.current===r):-1,[n,r]);return(0,I.jsx)(xue,{...e,ref:a,index:o})}),xue=_.forwardRef((e,t)=>{let{__scopeSlider:n,index:r,name:i,...a}=e,o=m8(C8,n),s=_8(C8,n),[c,l]=_.useState(null),u=P(t,e=>l(e)),d=!c||o.form||!!c.closest(`form`),f=oc(c),p=o.values[r],m=p===void 0?0:E8(p,o.min,o.max),h=wue(r,o.values.length),g=f?.[s.size],v=g?Eue(g,m,s.direction):0;return _.useEffect(()=>{if(c)return o.thumbs.add(c),()=>{o.thumbs.delete(c)}},[c,o.thumbs]),(0,I.jsxs)(`span`,{style:{transform:`var(--radix-slider-thumb-transform)`,position:`absolute`,[s.startEdge]:`calc(${m}% + ${v}px)`},children:[(0,I.jsx)(f8.ItemSlot,{scope:e.__scopeSlider,children:(0,I.jsx)(V.span,{role:`slider`,"aria-label":e[`aria-label`]||h,"aria-valuemin":o.min,"aria-valuenow":p,"aria-valuemax":o.max,"aria-orientation":o.orientation,"data-orientation":o.orientation,"data-disabled":o.disabled?``:void 0,tabIndex:o.disabled?void 0:0,...a,ref:u,style:p===void 0?{display:`none`}:e.style,onFocus:j(e.onFocus,()=>{o.valueIndexToChangeRef.current=r})})}),d&&(0,I.jsx)(T8,{name:i??(o.name?o.name+(o.values.length>1?`[]`:``):void 0),form:o.form,value:p},r)]})});w8.displayName=C8;var Sue=`RadioBubbleInput`,T8=_.forwardRef(({__scopeSlider:e,value:t,...n},r)=>{let i=_.useRef(null),a=P(i,r),o=tJ(t);return _.useEffect(()=>{let e=i.current;if(!e)return;let n=window.HTMLInputElement.prototype,r=Object.getOwnPropertyDescriptor(n,`value`).set;if(o!==t&&r){let n=new Event(`input`,{bubbles:!0});r.call(e,t),e.dispatchEvent(n)}},[o,t]),(0,I.jsx)(V.input,{style:{display:`none`},...n,ref:a,defaultValue:t})});T8.displayName=Sue;function Cue(e=[],t,n){let r=[...e];return r[n]=t,r.sort((e,t)=>e-t)}function E8(e,t,n){return Jq(100/(n-t)*(e-t),[0,100])}function wue(e,t){if(t>2)return`Value ${e+1} of ${t}`;if(t===2)return[`Minimum`,`Maximum`][e]}function Tue(e,t){if(e.length===1)return 0;let n=e.map(e=>Math.abs(e-t)),r=Math.min(...n);return n.indexOf(r)}function Eue(e,t,n){let r=e/2;return(r-D8([0,50],[0,r])(t)*n)*n}function Due(e){return e.slice(0,-1).map((t,n)=>e[n+1]-t)}function Oue(e,t){if(t>0){let n=Due(e);return Math.min(...n)>=t}return!0}function D8(e,t){return n=>{if(e[0]===e[1]||t[0]===t[1])return t[0];let r=(t[1]-t[0])/(e[1]-e[0]);return t[0]+r*(n-e[0])}}function kue(e){return(String(e).split(`.`)[1]||``).length}function Aue(e,t){let n=10**t;return Math.round(e*n)/n}var O8=h8,jue=b8,Mue=S8,Nue=w8,k8=_.forwardRef(({className:e,...t},n)=>(0,I.jsxs)(O8,{ref:n,className:U(`relative flex w-full touch-none select-none items-center`,e),...t,children:[(0,I.jsx)(jue,{className:`relative h-2 w-full grow overflow-hidden rounded-full bg-secondary`,children:(0,I.jsx)(Mue,{className:`absolute h-full bg-primary`})}),(0,I.jsx)(Nue,{className:`block h-5 w-5 rounded-full border-2 border-primary bg-background ring-offset-background transition-colors focus-visible:outline-hidden focus-visible:ring-2 focus-visible:ring-ring focus-visible:ring-offset-2 disabled:pointer-events-none disabled:opacity-50`})]}));k8.displayName=O8.displayName;function Pue(e){let t=Fue(e),n=_.forwardRef((e,n)=>{let{children:r,...i}=e,a=_.Children.toArray(r),o=a.find(Lue);if(o){let e=o.props.children,r=a.map(t=>t===o?_.Children.count(e)>1?_.Children.only(null):_.isValidElement(e)?e.props.children:null:t);return(0,I.jsx)(t,{...i,ref:n,children:_.isValidElement(e)?_.cloneElement(e,void 0,r):null})}return(0,I.jsx)(t,{...i,ref:n,children:r})});return n.displayName=`${e}.Slot`,n}function Fue(e){let t=_.forwardRef((e,t)=>{let{children:n,...r}=e;if(_.isValidElement(n)){let e=zue(n),i=Rue(r,n.props);return n.type!==_.Fragment&&(i.ref=t?N(t,e):e),_.cloneElement(n,i)}return _.Children.count(n)>1?_.Children.only(null):null});return t.displayName=`${e}.SlotClone`,t}var Iue=Symbol(`radix.slottable`);function Lue(e){return _.isValidElement(e)&&typeof e.type==`function`&&`__radixId`in e.type&&e.type.__radixId===Iue}function Rue(e,t){let n={...t};for(let r in t){let i=e[r],a=t[r];/^on[A-Z]/.test(r)?i&&a?n[r]=(...e)=>{let t=a(...e);return i(...e),t}:i&&(n[r]=i):r===`style`?n[r]={...i,...a}:r===`className`&&(n[r]=[i,a].filter(Boolean).join(` `))}return{...e,...n}}function zue(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 A8=`Popover`,[j8,Bue]=R(A8,[lc]),M8=lc(),[Vue,N8]=j8(A8),P8=e=>{let{__scopePopover:t,children:n,open:r,defaultOpen:i,onOpenChange:a,modal:o=!1}=e,s=M8(t),c=_.useRef(null),[l,u]=_.useState(!1),[d,f]=ze({prop:r,defaultProp:i??!1,onChange:a,caller:A8});return(0,I.jsx)(Tc,{...s,children:(0,I.jsx)(Vue,{scope:t,contentId:Ra(),triggerRef:c,open:d,onOpenChange:f,onOpenToggle:_.useCallback(()=>f(e=>!e),[f]),hasCustomAnchor:l,onCustomAnchorAdd:_.useCallback(()=>u(!0),[]),onCustomAnchorRemove:_.useCallback(()=>u(!1),[]),modal:o,children:n})})};P8.displayName=A8;var F8=`PopoverAnchor`,Hue=_.forwardRef((e,t)=>{let{__scopePopover:n,...r}=e,i=N8(F8,n),a=M8(n),{onCustomAnchorAdd:o,onCustomAnchorRemove:s}=i;return _.useEffect(()=>(o(),()=>s()),[o,s]),(0,I.jsx)(Ec,{...a,...r,ref:t})});Hue.displayName=F8;var I8=`PopoverTrigger`,L8=_.forwardRef((e,t)=>{let{__scopePopover:n,...r}=e,i=N8(I8,n),a=M8(n),o=P(t,i.triggerRef),s=(0,I.jsx)(V.button,{type:`button`,"aria-haspopup":`dialog`,"aria-expanded":i.open,"aria-controls":i.contentId,"data-state":W8(i.open),...r,ref:o,onClick:j(e.onClick,i.onOpenToggle)});return i.hasCustomAnchor?s:(0,I.jsx)(Ec,{asChild:!0,...a,children:s})});L8.displayName=I8;var R8=`PopoverPortal`,[Uue,Wue]=j8(R8,{forceMount:void 0}),z8=e=>{let{__scopePopover:t,forceMount:n,children:r,container:i}=e,a=N8(R8,t);return(0,I.jsx)(Uue,{scope:t,forceMount:n,children:(0,I.jsx)(Pe,{present:n||a.open,children:(0,I.jsx)(Me,{asChild:!0,container:i,children:r})})})};z8.displayName=R8;var B8=`PopoverContent`,V8=_.forwardRef((e,t)=>{let n=Wue(B8,e.__scopePopover),{forceMount:r=n.forceMount,...i}=e,a=N8(B8,e.__scopePopover);return(0,I.jsx)(Pe,{present:r||a.open,children:a.modal?(0,I.jsx)(Kue,{...i,ref:t}):(0,I.jsx)(que,{...i,ref:t})})});V8.displayName=B8;var Gue=Pue(`PopoverContent.RemoveScroll`),Kue=_.forwardRef((e,t)=>{let n=N8(B8,e.__scopePopover),r=_.useRef(null),i=P(t,r),a=_.useRef(!1);return _.useEffect(()=>{let e=r.current;if(e)return ah(e)},[]),(0,I.jsx)(Xm,{as:Gue,allowPinchZoom:!0,children:(0,I.jsx)(H8,{...e,ref:i,trapFocus:n.open,disableOutsidePointerEvents:!0,onCloseAutoFocus:j(e.onCloseAutoFocus,e=>{e.preventDefault(),a.current||n.triggerRef.current?.focus()}),onPointerDownOutside:j(e.onPointerDownOutside,e=>{let t=e.detail.originalEvent,n=t.button===0&&t.ctrlKey===!0,r=t.button===2||n;a.current=r},{checkForDefaultPrevented:!1}),onFocusOutside:j(e.onFocusOutside,e=>e.preventDefault(),{checkForDefaultPrevented:!1})})})}),que=_.forwardRef((e,t)=>{let n=N8(B8,e.__scopePopover),r=_.useRef(!1),i=_.useRef(!1);return(0,I.jsx)(H8,{...e,ref:t,trapFocus:!1,disableOutsidePointerEvents:!1,onCloseAutoFocus:t=>{e.onCloseAutoFocus?.(t),t.defaultPrevented||(r.current||n.triggerRef.current?.focus(),t.preventDefault()),r.current=!1,i.current=!1},onInteractOutside:t=>{e.onInteractOutside?.(t),t.defaultPrevented||(r.current=!0,t.detail.originalEvent.type===`pointerdown`&&(i.current=!0));let a=t.target;n.triggerRef.current?.contains(a)&&t.preventDefault(),t.detail.originalEvent.type===`focusin`&&i.current&&t.preventDefault()}})}),H8=_.forwardRef((e,t)=>{let{__scopePopover:n,trapFocus:r,onOpenAutoFocus:i,onCloseAutoFocus:a,disableOutsidePointerEvents:o,onEscapeKeyDown:s,onPointerDownOutside:c,onFocusOutside:l,onInteractOutside:u,...d}=e,f=N8(B8,n),p=M8(n);return Xp(),(0,I.jsx)(Vp,{asChild:!0,loop:!0,trapped:r,onMountAutoFocus:i,onUnmountAutoFocus:a,children:(0,I.jsx)(xe,{asChild:!0,disableOutsidePointerEvents:o,onInteractOutside:u,onEscapeKeyDown:s,onPointerDownOutside:c,onFocusOutside:l,onDismiss:()=>f.onOpenChange(!1),children:(0,I.jsx)(Dc,{"data-state":W8(f.open),role:`dialog`,id:f.contentId,...p,...d,ref:t,style:{...d.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)`}})})})}),U8=`PopoverClose`,Jue=_.forwardRef((e,t)=>{let{__scopePopover:n,...r}=e,i=N8(U8,n);return(0,I.jsx)(V.button,{type:`button`,...r,ref:t,onClick:j(e.onClick,()=>i.onOpenChange(!1))})});Jue.displayName=U8;var Yue=`PopoverArrow`,Xue=_.forwardRef((e,t)=>{let{__scopePopover:n,...r}=e,i=M8(n);return(0,I.jsx)(Oc,{...i,...r,ref:t})});Xue.displayName=Yue;function W8(e){return e?`open`:`closed`}var Zue=P8,Que=L8,$ue=z8,G8=V8,K8=Zue,q8=Que,J8=_.forwardRef(({className:e,align:t=`center`,sideOffset:n=4,...r},i)=>(0,I.jsx)($ue,{children:(0,I.jsx)(G8,{ref:i,align:t,sideOffset:n,className:U(`z-50 w-72 rounded-md border bg-popover p-4 text-popover-foreground shadow-md outline-hidden 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})}));J8.displayName=G8.displayName;var Y8=1,ede=.9,tde=.8,nde=.17,X8=.1,Z8=.999,rde=.9999,ide=.99,ade=/[\\\/_+.#"@\[\(\{&]/,ode=/[\\\/_+.#"@\[\(\{&]/g,sde=/[\s-]/,Q8=/[\s-]/g;function $8(e,t,n,r,i,a,o){if(a===t.length)return i===e.length?Y8:ide;var s=`${i},${a}`;if(o[s]!==void 0)return o[s];for(var c=r.charAt(a),l=n.indexOf(c,i),u=0,d,f,p,m;l>=0;)d=$8(e,t,n,r,l+1,a+1,o),d>u&&(l===i?d*=Y8:ade.test(e.charAt(l-1))?(d*=tde,p=e.slice(i,l-1).match(ode),p&&i>0&&(d*=Z8**+p.length)):sde.test(e.charAt(l-1))?(d*=ede,m=e.slice(i,l-1).match(Q8),m&&i>0&&(d*=Z8**+m.length)):(d*=nde,i>0&&(d*=Z8**+(l-i))),e.charAt(l)!==t.charAt(a)&&(d*=rde)),(d<X8&&n.charAt(l-1)===r.charAt(a+1)||r.charAt(a+1)===r.charAt(a)&&n.charAt(l-1)!==r.charAt(a))&&(f=$8(e,t,n,r,l+1,a+2,o),f*X8>d&&(d=f*X8)),d>u&&(u=d),l=n.indexOf(c,l+1);return o[s]=u,u}function e5(e){return e.toLowerCase().replace(Q8,` `)}function cde(e,t,n){return e=n&&n.length>0?`${e+` `+n.join(` `)}`:e,$8(e,t,e5(e),e5(t),0,0,{})}var t5=`[cmdk-group=""]`,n5=`[cmdk-group-items=""]`,lde=`[cmdk-group-heading=""]`,r5=`[cmdk-item=""]`,i5=`${r5}:not([aria-disabled="true"])`,a5=`cmdk-item-select`,o5=`data-value`,ude=(e,t,n)=>cde(e,t,n),s5=_.createContext(void 0),c5=()=>_.useContext(s5),l5=_.createContext(void 0),u5=()=>_.useContext(l5),d5=_.createContext(void 0),f5=_.forwardRef((e,t)=>{let n=g5(()=>({search:``,value:e.value??e.defaultValue??``,selectedItemId:void 0,filtered:{count:0,items:new Map,groups:new Set}})),r=g5(()=>new Set),i=g5(()=>new Map),a=g5(()=>new Map),o=g5(()=>new Set),s=m5(e),{label:c,children:l,value:u,onValueChange:d,filter:f,shouldFilter:p,loop:m,disablePointerSelection:h=!1,vimBindings:g=!0,...v}=e,y=Ra(),b=Ra(),x=Ra(),S=_.useRef(null),C=xde();h5(()=>{if(u!==void 0){let e=u.trim();n.current.value=e,w.emit()}},[u]),h5(()=>{C(6,A)},[]);let w=_.useMemo(()=>({subscribe:e=>(o.current.add(e),()=>o.current.delete(e)),snapshot:()=>n.current,setState:(e,t,r)=>{var i,a,o;if(!Object.is(n.current[e],t)){if(n.current[e]=t,e===`search`)k(),D(),C(1,O);else if(e===`value`){if(document.activeElement.hasAttribute(`cmdk-input`)||document.activeElement.hasAttribute(`cmdk-root`)){let e=document.getElementById(x);e?e.focus():(i=document.getElementById(y))==null||i.focus()}if(C(7,()=>{n.current.selectedItemId=j()?.id,w.emit()}),r||C(5,A),s.current?.value!==void 0){let e=t??``;(o=(a=s.current).onValueChange)==null||o.call(a,e);return}}w.emit()}},emit:()=>{o.current.forEach(e=>e())}}),[]),T=_.useMemo(()=>({value:(e,t,r)=>{t!==a.current.get(e)?.value&&(a.current.set(e,{value:t,keywords:r}),n.current.filtered.items.set(e,E(t,r)),C(2,()=>{D(),w.emit()}))},item:(e,t)=>(r.current.add(e),t&&(i.current.has(t)?i.current.get(t).add(e):i.current.set(t,new Set([e]))),C(3,()=>{k(),D(),n.current.value||O(),w.emit()}),()=>{a.current.delete(e),r.current.delete(e),n.current.filtered.items.delete(e);let t=j();C(4,()=>{k(),t?.getAttribute(`id`)===e&&O(),w.emit()})}),group:e=>(i.current.has(e)||i.current.set(e,new Set),()=>{a.current.delete(e),i.current.delete(e)}),filter:()=>s.current.shouldFilter,label:c||e[`aria-label`],getDisablePointerSelection:()=>s.current.disablePointerSelection,listId:y,inputId:x,labelId:b,listInnerRef:S}),[]);function E(e,t){let r=s.current?.filter??ude;return e?r(e,n.current.search,t):0}function D(){if(!n.current.search||s.current.shouldFilter===!1)return;let e=n.current.filtered.items,t=[];n.current.filtered.groups.forEach(n=>{let r=i.current.get(n),a=0;r.forEach(t=>{let n=e.get(t);a=Math.max(n,a)}),t.push([n,a])});let r=S.current;M().sort((t,n)=>{let r=t.getAttribute(`id`),i=n.getAttribute(`id`);return(e.get(i)??0)-(e.get(r)??0)}).forEach(e=>{let t=e.closest(n5);t?t.appendChild(e.parentElement===t?e:e.closest(`${n5} > *`)):r.appendChild(e.parentElement===r?e:e.closest(`${n5} > *`))}),t.sort((e,t)=>t[1]-e[1]).forEach(e=>{let t=S.current?.querySelector(`${t5}[${o5}="${encodeURIComponent(e[0])}"]`);t?.parentElement.appendChild(t)})}function O(){let e=M().find(e=>e.getAttribute(`aria-disabled`)!==`true`)?.getAttribute(o5);w.setState(`value`,e||void 0)}function k(){if(!n.current.search||s.current.shouldFilter===!1){n.current.filtered.count=r.current.size;return}n.current.filtered.groups=new Set;let e=0;for(let t of r.current){let r=E(a.current.get(t)?.value??``,a.current.get(t)?.keywords??[]);n.current.filtered.items.set(t,r),r>0&&e++}for(let[e,t]of i.current)for(let r of t)if(n.current.filtered.items.get(r)>0){n.current.filtered.groups.add(e);break}n.current.filtered.count=e}function A(){var e;let t=j();t&&(t.parentElement?.firstChild===t&&((e=t.closest(t5)?.querySelector(lde))==null||e.scrollIntoView({block:`nearest`})),t.scrollIntoView({block:`nearest`}))}function j(){return S.current?.querySelector(`${r5}[aria-selected="true"]`)}function M(){return Array.from(S.current?.querySelectorAll(i5)||[])}function N(e){let t=M()[e];t&&w.setState(`value`,t.getAttribute(o5))}function P(e){var t;let n=j(),r=M(),i=r.findIndex(e=>e===n),a=r[i+e];(t=s.current)!=null&&t.loop&&(a=i+e<0?r[r.length-1]:i+e===r.length?r[0]:r[i+e]),a&&w.setState(`value`,a.getAttribute(o5))}function F(e){let t=j()?.closest(t5),n;for(;t&&!n;)t=e>0?yde(t,t5):bde(t,t5),n=t?.querySelector(i5);n?w.setState(`value`,n.getAttribute(o5)):P(e)}let I=()=>N(M().length-1),L=e=>{e.preventDefault(),e.metaKey?I():e.altKey?F(1):P(1)},R=e=>{e.preventDefault(),e.metaKey?N(0):e.altKey?F(-1):P(-1)};return _.createElement(V.div,{ref:t,tabIndex:-1,...v,"cmdk-root":``,onKeyDown:e=>{var t;(t=v.onKeyDown)==null||t.call(v,e);let n=e.nativeEvent.isComposing||e.keyCode===229;if(!(e.defaultPrevented||n))switch(e.key){case`n`:case`j`:g&&e.ctrlKey&&L(e);break;case`ArrowDown`:L(e);break;case`p`:case`k`:g&&e.ctrlKey&&R(e);break;case`ArrowUp`:R(e);break;case`Home`:e.preventDefault(),N(0);break;case`End`:e.preventDefault(),I();break;case`Enter`:{e.preventDefault();let t=j();if(t){let e=new Event(a5);t.dispatchEvent(e)}}}}},_.createElement(`label`,{"cmdk-label":``,htmlFor:T.inputId,id:T.labelId,style:Cde},c),y5(e,e=>_.createElement(l5.Provider,{value:w},_.createElement(s5.Provider,{value:T},e))))}),dde=_.forwardRef((e,t)=>{let n=Ra(),r=_.useRef(null),i=_.useContext(d5),a=c5(),o=m5(e),s=o.current?.forceMount??i?.forceMount;h5(()=>{if(!s)return a.item(n,i?.id)},[s]);let c=v5(n,r,[e.value,e.children,r],e.keywords),l=u5(),u=_5(e=>e.value&&e.value===c.current),d=_5(e=>s||a.filter()===!1?!0:!e.search||e.filtered.items.get(n)>0);_.useEffect(()=>{let t=r.current;if(t&&!e.disabled)return t.addEventListener(a5,f),()=>t.removeEventListener(a5,f)},[d,e.onSelect,e.disabled]);function f(){var e,t;p(),(t=(e=o.current).onSelect)==null||t.call(e,c.current)}function p(){l.setState(`value`,c.current,!0)}if(!d)return null;let{disabled:m,value:h,onSelect:g,forceMount:v,keywords:y,...b}=e;return _.createElement(V.div,{ref:N(r,t),...b,id:n,"cmdk-item":``,role:`option`,"aria-disabled":!!m,"aria-selected":!!u,"data-disabled":!!m,"data-selected":!!u,onPointerMove:m||a.getDisablePointerSelection()?void 0:p,onClick:m?void 0:f},e.children)}),fde=_.forwardRef((e,t)=>{let{heading:n,children:r,forceMount:i,...a}=e,o=Ra(),s=_.useRef(null),c=_.useRef(null),l=Ra(),u=c5(),d=_5(e=>i||u.filter()===!1?!0:!e.search||e.filtered.groups.has(o));h5(()=>u.group(o),[]),v5(o,s,[e.value,e.heading,c]);let f=_.useMemo(()=>({id:o,forceMount:i}),[i]);return _.createElement(V.div,{ref:N(s,t),...a,"cmdk-group":``,role:`presentation`,hidden:!d||void 0},n&&_.createElement(`div`,{ref:c,"cmdk-group-heading":``,"aria-hidden":!0,id:l},n),y5(e,e=>_.createElement(`div`,{"cmdk-group-items":``,role:`group`,"aria-labelledby":n?l:void 0},_.createElement(d5.Provider,{value:f},e))))}),pde=_.forwardRef((e,t)=>{let{alwaysRender:n,...r}=e,i=_.useRef(null),a=_5(e=>!e.search);return!n&&!a?null:_.createElement(V.div,{ref:N(i,t),...r,"cmdk-separator":``,role:`separator`})}),mde=_.forwardRef((e,t)=>{let{onValueChange:n,...r}=e,i=e.value!=null,a=u5(),o=_5(e=>e.search),s=_5(e=>e.selectedItemId),c=c5();return _.useEffect(()=>{e.value!=null&&a.setState(`search`,e.value)},[e.value]),_.createElement(V.input,{ref:t,...r,"cmdk-input":``,autoComplete:`off`,autoCorrect:`off`,spellCheck:!1,"aria-autocomplete":`list`,role:`combobox`,"aria-expanded":!0,"aria-controls":c.listId,"aria-labelledby":c.labelId,"aria-activedescendant":s,id:c.inputId,type:`text`,value:i?e.value:o,onChange:e=>{i||a.setState(`search`,e.target.value),n?.(e.target.value)}})}),hde=_.forwardRef((e,t)=>{let{children:n,label:r=`Suggestions`,...i}=e,a=_.useRef(null),o=_.useRef(null),s=_5(e=>e.selectedItemId),c=c5();return _.useEffect(()=>{if(o.current&&a.current){let e=o.current,t=a.current,n,r=new ResizeObserver(()=>{n=requestAnimationFrame(()=>{let n=e.offsetHeight;t.style.setProperty(`--cmdk-list-height`,n.toFixed(1)+`px`)})});return r.observe(e),()=>{cancelAnimationFrame(n),r.unobserve(e)}}},[]),_.createElement(V.div,{ref:N(a,t),...i,"cmdk-list":``,role:`listbox`,tabIndex:-1,"aria-activedescendant":s,"aria-label":r,id:c.listId},y5(e,e=>_.createElement(`div`,{ref:N(o,c.listInnerRef),"cmdk-list-sizer":``},e)))}),gde=_.forwardRef((e,t)=>{let{open:n,onOpenChange:r,overlayClassName:i,contentClassName:a,container:o,...s}=e;return _.createElement(Kh,{open:n,onOpenChange:r},_.createElement(Jh,{container:o},_.createElement(Yh,{"cmdk-overlay":``,className:i}),_.createElement(Xh,{"aria-label":e.label,"cmdk-dialog":``,className:a},_.createElement(f5,{ref:t,...s}))))}),_de=_.forwardRef((e,t)=>_5(e=>e.filtered.count===0)?_.createElement(V.div,{ref:t,...e,"cmdk-empty":``,role:`presentation`}):null),vde=_.forwardRef((e,t)=>{let{progress:n,children:r,label:i=`Loading...`,...a}=e;return _.createElement(V.div,{ref:t,...a,"cmdk-loading":``,role:`progressbar`,"aria-valuenow":n,"aria-valuemin":0,"aria-valuemax":100,"aria-label":i},y5(e,e=>_.createElement(`div`,{"aria-hidden":!0},e)))}),p5=Object.assign(f5,{List:hde,Item:dde,Input:mde,Group:fde,Separator:pde,Dialog:gde,Empty:_de,Loading:vde});function yde(e,t){let n=e.nextElementSibling;for(;n;){if(n.matches(t))return n;n=n.nextElementSibling}}function bde(e,t){let n=e.previousElementSibling;for(;n;){if(n.matches(t))return n;n=n.previousElementSibling}}function m5(e){let t=_.useRef(e);return h5(()=>{t.current=e}),t}var h5=typeof window>`u`?_.useEffect:_.useLayoutEffect;function g5(e){let t=_.useRef();return t.current===void 0&&(t.current=e()),t}function _5(e){let t=u5(),n=()=>e(t.snapshot());return _.useSyncExternalStore(t.subscribe,n,n)}function v5(e,t,n,r=[]){let i=_.useRef(),a=c5();return h5(()=>{var o;let s=(()=>{for(let e of n){if(typeof e==`string`)return e.trim();if(typeof e==`object`&&`current`in e)return e.current?e.current.textContent?.trim():i.current}})(),c=r.map(e=>e.trim());a.value(e,s,c),(o=t.current)==null||o.setAttribute(o5,s),i.current=s}),i}var xde=()=>{let[e,t]=_.useState(),n=g5(()=>new Map);return h5(()=>{n.current.forEach(e=>e()),n.current=new Map},[e]),(e,r)=>{n.current.set(e,r),t({})}};function Sde(e){let t=e.type;return typeof t==`function`?t(e.props):`render`in t?t.render(e.props):e}function y5({asChild:e,children:t},n){return e&&_.isValidElement(t)?_.cloneElement(Sde(t),{ref:t.ref},n(t.props.children)):n(t)}var Cde={position:`absolute`,width:`1px`,height:`1px`,padding:`0`,margin:`-1px`,overflow:`hidden`,clip:`rect(0, 0, 0, 0)`,whiteSpace:`nowrap`,borderWidth:`0`},b5=_.forwardRef(({className:e,...t},n)=>(0,I.jsx)(p5,{ref:n,className:U(`flex h-full w-full flex-col overflow-hidden rounded-md bg-popover text-popover-foreground`,e),...t}));b5.displayName=p5.displayName;var x5=_.forwardRef(({className:e,...t},n)=>(0,I.jsxs)(`div`,{className:`flex items-center border-b px-3`,"data-cmdk-input-wrapper":``,children:[(0,I.jsx)(er,{className:`mr-2 h-4 w-4 shrink-0 opacity-50`}),(0,I.jsx)(p5.Input,{ref:n,className:U(`flex h-11 w-full rounded-md bg-transparent py-3 text-sm outline-hidden placeholder:text-muted-foreground disabled:cursor-not-allowed disabled:opacity-50`,e),...t})]}));x5.displayName=p5.Input.displayName;var S5=_.forwardRef(({className:e,...t},n)=>(0,I.jsx)(p5.List,{ref:n,className:U(`max-h-[300px] overflow-y-auto overflow-x-hidden`,e),...t}));S5.displayName=p5.List.displayName;var C5=_.forwardRef((e,t)=>(0,I.jsx)(p5.Empty,{ref:t,className:`py-6 text-center text-sm`,...e}));C5.displayName=p5.Empty.displayName;var w5=_.forwardRef(({className:e,...t},n)=>(0,I.jsx)(p5.Group,{ref:n,className:U(`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}));w5.displayName=p5.Group.displayName;var wde=_.forwardRef(({className:e,...t},n)=>(0,I.jsx)(p5.Separator,{ref:n,className:U(`-mx-1 h-px bg-border`,e),...t}));wde.displayName=p5.Separator.displayName;var T5=_.forwardRef(({className:e,...t},n)=>(0,I.jsx)(p5.Item,{ref:n,className:U(`relative flex cursor-default select-none items-center rounded-sm px-2 py-1.5 text-sm outline-hidden data-[disabled=true]:pointer-events-none data-[selected='true']:bg-accent data-[selected=true]:text-accent-foreground data-[disabled=true]:opacity-50`,e),...t}));T5.displayName=p5.Item.displayName;function Tde(){let{source:e}=nv(),[t,n]=(0,_.useState)({connected:!1});return(0,_.useEffect)(()=>{let t=!1,r=0,i=()=>{if(typeof e.getRoverStatus!=`function`)return;let i=++r;e.getRoverStatus().then(e=>{!t&&i===r&&n({connected:e.connected,provider:e.provider,pageUrl:e.pageUrl,activeJobId:e.activeJobId})}).catch(()=>{!t&&i===r&&n({connected:!1})})};i();let a=window.setInterval(i,3e3);return()=>{t=!0,window.clearInterval(a)}},[e]),t}var E5={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`],azure_foundry:[],google:[`gemini-2.0-flash`,`gemini-1.5-pro`],custom:[]},D5={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`,azure_foundry:`Set AZURE_FOUNDRY_ENDPOINT and AZURE_FOUNDRY_API_KEY, or reuse AZURE_OPENAI_API_KEY for the same resource.`},Ede=()=>{let{agentName:e}=Zd(),[t]=cp(),n=qd(),{agents:r,setAgents:i,browserProviders:a}=hv(),{source:o}=nv(),s=Tde(),c=e===`new`,l=e?decodeURIComponent(e):``,u=c?null:r.find(e=>e.id===l)??r.find(e=>e.name===l),d=t.get(`type`)===`browser`?`browser`:`llm`,[f,p]=(0,_.useState)(()=>u??O6(d)),[m,h]=(0,_.useState)(!1),[g,v]=(0,_.useState)(!1),[y,b]=(0,_.useState)({status:`idle`}),[x,S]=(0,_.useState)(!1),[C,w]=(0,_.useState)(null),[T,E]=(0,_.useState)(!1),[D,k]=(0,_.useState)(!1),[A,j]=(0,_.useState)(!1),M=(0,_.useRef)(null),N=(0,_.useRef)({revision:0}),P=(0,_.useRef)(null),F=Object.values(a).map(e=>({id:e.id,name:e.name}));(0,_.useEffect)(()=>{let e=c?`new:${d}:${l||`new`}`:`agt:${l}`;P.current!==e&&(c?(p(O6(d)),P.current=e):u&&(p(u),P.current=e))},[c,l,u,d]),(0,_.useEffect)(()=>(M.current?.abort(),M.current=null,b({status:`idle`}),S(!1),()=>M.current?.abort()),[f]),(0,_.useEffect)(()=>{let e=N.current;return e.revision++,w(null),E(!1),()=>{e.revision++}},[f.provider]);let L=f.provider===`azure`||f.provider===`azure_foundry`,R=f.provider===`anthropic`||f.provider===`openai`||L,z=Array.from(new Set([...E5[f.provider]||[],...C??[]])),ee=z.includes(f.model),te=L||A||!!f.model&&!ee,ne=async()=>{if(S(!0),f.type===`browser`){b({status:`unsupported`}),O({title:`Browser Agent connection is handled by Rover`,description:`Open Rover and connect the configured browser provider.`});return}if(f.provider===`google`||f.provider===`custom`){b({status:`unsupported`});return}let e=new AbortController;M.current?.abort(),M.current=e,b({status:`loading`});try{let t=await o.testAgentConnection(f,e.signal);if(e.signal.aborted)return;b(t.ok?{status:`success`,result:t,testedAt:new Date().toISOString()}:{status:`error`,message:t.message,testedAt:new Date().toISOString()})}catch(t){e.signal.aborted||b({status:`error`,message:t instanceof Error?t.message:String(t),testedAt:new Date().toISOString()})}finally{M.current===e&&(M.current=null)}},re=async()=>{if(!R){O({title:`Provider discovery not supported`,description:`Model lists are available for Anthropic and OpenAI. Azure deployments use configured suggestions.`});return}let e=N.current,t=++e.revision;E(!0);try{let n=await o.listProviderModels(f.provider);if(t!==e.revision)return;w(n.items),O({title:n.kind===`deployments`?`Deployments loaded`:`Models loaded`,description:`${n.items.length} ${n.kind} from ${n.source}`})}catch(n){if(t!==e.revision)return;O({title:`Could not load provider models`,description:String(n instanceof Error?n.message:n),variant:`destructive`})}finally{t===e.revision&&E(!1)}},ie=async()=>{if(!f.name.trim())O({title:`Name is required`,variant:`destructive`});else if(f.type!==`browser`&&!f.model.trim())O({title:L?`Deployment name is required`:`Model is required`,variant:`destructive`});else if(f.type===`browser`&&!f.url?.trim())O({title:`Browser agent URL is required`,variant:`destructive`});else{v(!0);try{if(c)await i([...r,f]),O({title:`Agent created`}),n(`/libraries/agents/${encodeURIComponent(f.id)}`);else{let e=r.map(e=>e.id===u?.id?f:e);await i(e),O({title:`Agent saved`}),f.id!==l&&n(`/libraries/agents/${encodeURIComponent(f.id)}`,{replace:!0})}}finally{v(!1)}}},ae=async()=>{let e=r.filter(e=>e.id!==u?.id);await i(e),O({title:`Agent deleted`}),n(`/libraries/agents`)};if(!c&&!u)return(0,I.jsxs)(`div`,{className:`space-y-4`,children:[(0,I.jsxs)(np,{to:`/libraries/agents`,className:`inline-flex items-center gap-1.5 text-sm text-muted-foreground hover:text-foreground`,children:[(0,I.jsx)(Qt,{className:`h-4 w-4`}),` Agents`]}),(0,I.jsxs)(`p`,{className:`text-sm text-muted-foreground`,children:[`Agent "`,l,`" not found.`]})]});let oe=s.connected&&s.provider===f.provider;return(0,I.jsxs)(`div`,{className:`space-y-6`,children:[(0,I.jsxs)(`div`,{className:`flex items-start justify-between gap-2`,children:[(0,I.jsxs)(`div`,{className:`space-y-1`,children:[(0,I.jsxs)(np,{to:`/libraries/agents`,className:`inline-flex items-center gap-1.5 text-sm text-muted-foreground hover:text-foreground`,children:[(0,I.jsx)(Qt,{className:`h-4 w-4`}),` Agents`]}),(0,I.jsxs)(`h1`,{className:`flex items-center gap-2 text-2xl font-bold`,children:[f.type===`browser`?(0,I.jsx)(bn,{className:`h-6 w-6 text-sky-600`,"aria-hidden":`true`}):(0,I.jsx)(en,{className:`h-6 w-6 text-muted-foreground`,"aria-hidden":`true`}),c?`New Agent`:f.name]})]}),f.type===`browser`?(0,I.jsxs)(`div`,{className:`flex items-center gap-2`,children:[oe&&s.pageUrl?(0,I.jsx)(`a`,{href:s.pageUrl,target:`_blank`,rel:`noreferrer`,className:`max-w-xs rounded-md border px-3 py-2 text-xs text-muted-foreground hover:bg-accent hover:text-foreground`,title:`Open ${s.pageUrl}`,children:(0,I.jsx)(`span`,{className:`block truncate`,children:s.pageUrl})}):null,(0,I.jsxs)(`div`,{className:`flex items-center gap-2 rounded-md border px-3 py-2 text-sm`,children:[(0,I.jsx)(`span`,{className:`h-2.5 w-2.5 rounded-full ${oe?`bg-emerald-500`:`bg-muted-foreground/40`}`}),(0,I.jsx)(`span`,{children:oe?`Rover connected`:`Rover not connected`})]})]}):(0,I.jsxs)(W,{type:`button`,onClick:()=>void ne(),disabled:y.status===`loading`,children:[(0,I.jsx)(pr,{className:`mr-2 h-4 w-4`}),`Test Connection`]})]}),f.type!==`browser`&&(0,I.jsx)(`p`,{className:`text-xs text-muted-foreground`,children:`Test Connection sends a small inference request to the configured model or deployment using backend credentials. It does not save the agent.`}),x&&(0,I.jsxs)(K,{children:[(0,I.jsxs)(gv,{className:`flex-row items-center justify-between space-y-0`,children:[(0,I.jsx)(_v,{className:`text-base`,children:`Connection Test`}),(0,I.jsx)(`button`,{type:`button`,onClick:()=>{M.current?.abort(),b({status:`idle`}),S(!1)},"aria-label":`Close connection test`,className:`rounded-sm opacity-70 hover:opacity-100`,children:(0,I.jsx)(hr,{className:`h-4 w-4`})})]}),(0,I.jsxs)(q,{className:`space-y-3`,children:[(0,I.jsxs)(`div`,{className:`flex flex-wrap items-center gap-x-2 gap-y-1 text-sm text-muted-foreground`,children:[(0,I.jsx)(`span`,{children:`Provider:`}),(0,I.jsx)(`span`,{className:`font-medium text-foreground`,children:OX(f.provider)}),(0,I.jsx)(`span`,{children:`·`}),(0,I.jsxs)(`span`,{children:[L?`Deployment`:`Model`,`:`]}),(0,I.jsx)(`code`,{className:`font-mono text-xs`,children:f.model})]}),y.status===`loading`&&(0,I.jsxs)(`div`,{className:`flex items-center gap-2 text-sm text-muted-foreground`,children:[(0,I.jsx)(zn,{className:`h-4 w-4 animate-spin`}),`Testing connection...`]}),y.status===`success`&&(0,I.jsxs)(`div`,{className:`space-y-2`,children:[(0,I.jsxs)(`p`,{role:`status`,className:`flex items-center gap-2 text-sm text-emerald-700`,children:[(0,I.jsx)(an,{className:`h-4 w-4 shrink-0`}),y.result.message]}),(0,I.jsxs)(`p`,{className:`text-xs text-muted-foreground`,children:[y.result.model&&(0,I.jsxs)(I.Fragment,{children:[`Returned model: `,y.result.model,` · `]}),y.result.durationMs,` ms · Tested at`,` `,new Date(y.testedAt).toLocaleString()]})]}),y.status===`error`&&(0,I.jsxs)(`div`,{className:`space-y-2`,children:[(0,I.jsxs)(`p`,{role:`alert`,className:`text-sm text-destructive`,children:[(0,I.jsx)(`span`,{className:`font-medium`,children:`✗ Connection failed`}),`. `,y.message]}),D5[f.provider]&&(0,I.jsxs)(`p`,{className:`rounded-md bg-muted px-3 py-2 text-xs text-muted-foreground`,children:[`Hint: `,D5[f.provider]]}),(0,I.jsxs)(`p`,{className:`text-xs text-muted-foreground`,children:[`Tested at `,new Date(y.testedAt).toLocaleString()]})]}),y.status===`unsupported`&&(0,I.jsxs)(`p`,{className:`rounded-md bg-muted px-3 py-2 text-sm text-muted-foreground`,children:[`Connection testing is not supported for the`,` `,(0,I.jsx)(`span`,{className:`font-medium`,children:f.provider}),` provider. Supported providers: Anthropic, OpenAI, Azure OpenAI, Azure Foundry.`]})]})]}),(0,I.jsxs)(K,{children:[(0,I.jsx)(gv,{children:(0,I.jsx)(_v,{className:`text-base`,children:`Configuration`})}),(0,I.jsxs)(q,{className:`space-y-4`,children:[(0,I.jsxs)(`div`,{className:`grid gap-4 sm:grid-cols-2`,children:[(0,I.jsxs)(`div`,{className:`space-y-1.5`,children:[(0,I.jsx)(Q,{children:`Name`}),(0,I.jsx)(Op,{value:f.name,onChange:e=>p(t=>({...t,name:e.target.value})),placeholder:`e.g. GPT-4o`})]}),(0,I.jsxs)(`div`,{className:`space-y-1.5`,children:[(0,I.jsx)(Q,{children:`Agent type`}),(0,I.jsxs)(OY,{value:f.type??`llm`,onValueChange:e=>p(t=>e===`browser`?{id:t.id,name:t.name,type:`browser`,provider:`claude`,model:``,maxTokens:0,url:t.type===`browser`?t.url:``,newConversationBetweenScenarios:t.type!==`browser`||t.newConversationBetweenScenarios}:{id:t.id,name:t.name,type:`llm`,provider:`openai`,model:t.model||`gpt-4o`,maxTokens:t.maxTokens||4096,temperature:t.type===`llm`?t.temperature:0,maxTurns:t.type===`llm`?t.maxTurns:void 0,systemPrompt:t.type===`llm`?t.systemPrompt:void 0}),children:[(0,I.jsx)(AY,{children:(0,I.jsx)(kY,{})}),(0,I.jsxs)(NY,{children:[(0,I.jsx)(Z,{value:`llm`,children:`LLM Agent`}),(0,I.jsx)(Z,{value:`browser`,children:`Browser Agent`})]})]})]}),(0,I.jsxs)(`div`,{className:`space-y-1.5`,children:[(0,I.jsx)(Q,{htmlFor:`agent-provider`,children:`Provider`}),(0,I.jsxs)(OY,{value:f.provider,onValueChange:e=>p(t=>t.type===`browser`?{...t,provider:e}:{...t,provider:e,model:E5[e]?.[0]||``}),children:[(0,I.jsx)(AY,{id:`agent-provider`,children:(0,I.jsx)(kY,{})}),(0,I.jsx)(NY,{children:f.type===`browser`?F.map(e=>(0,I.jsx)(Z,{value:e.id,children:e.name},e.id)):(0,I.jsxs)(I.Fragment,{children:[(0,I.jsx)(Z,{value:`openai`,children:`OpenAI`}),(0,I.jsx)(Z,{value:`anthropic`,children:`Anthropic`}),(0,I.jsx)(Z,{value:`azure`,children:`Azure OpenAI`}),(0,I.jsx)(Z,{value:`azure_foundry`,children:`Azure Foundry`}),(0,I.jsx)(Z,{value:`google`,children:`Google`}),(0,I.jsx)(Z,{value:`custom`,children:`Custom`})]})})]})]}),f.type===`browser`&&(0,I.jsxs)(`div`,{className:`space-y-1.5`,children:[(0,I.jsx)(Q,{htmlFor:`agent-conversation-behavior`,children:`Conversation behavior`}),(0,I.jsxs)(OY,{value:f.newConversationBetweenScenarios===!1?`same`:`new`,onValueChange:e=>p(t=>t.type===`browser`?{...t,newConversationBetweenScenarios:e!==`same`}:t),children:[(0,I.jsx)(AY,{id:`agent-conversation-behavior`,children:(0,I.jsx)(kY,{})}),(0,I.jsxs)(NY,{children:[(0,I.jsx)(Z,{value:`new`,children:`Start a new conversation between scenarios`}),(0,I.jsx)(Z,{value:`same`,children:`Continue the same conversation`})]})]}),(0,I.jsx)(`p`,{className:`text-[11px] text-muted-foreground`,children:`Default for queue runs. It can be overridden when starting an evaluation.`})]})]}),f.type===`browser`&&(0,I.jsxs)(`div`,{className:`space-y-1.5`,children:[(0,I.jsx)(Q,{children:`Browser agent URL`}),(0,I.jsx)(Op,{value:f.url??``,onChange:e=>p(t=>({...t,url:e.target.value})),placeholder:`https://provider.example`}),(0,I.jsx)(`p`,{className:`text-[11px] text-muted-foreground`,children:`Rover opens this URL when the queued Browser Agent needs attention.`})]}),f.type!==`browser`&&(0,I.jsxs)(`div`,{className:`grid gap-4 sm:grid-cols-2`,children:[(0,I.jsxs)(`div`,{className:`space-y-1.5`,children:[(0,I.jsx)(Q,{htmlFor:`agent-model`,children:L?`Deployment name`:`Model`}),(0,I.jsxs)(`div`,{className:`flex items-center gap-2`,children:[L?(0,I.jsxs)(I.Fragment,{children:[(0,I.jsx)(Op,{id:`agent-model`,value:f.model,onChange:e=>p(t=>({...t,model:e.target.value})),placeholder:`Type deployment name manually`,list:`agent-deployment-suggestions`,className:`h-9 min-w-0 flex-1 font-mono text-xs`}),(0,I.jsx)(`datalist`,{id:`agent-deployment-suggestions`,children:z.map(e=>(0,I.jsx)(`option`,{value:e},e))})]}):(0,I.jsxs)(K8,{open:D,onOpenChange:k,children:[(0,I.jsx)(q8,{asChild:!0,children:(0,I.jsxs)(W,{type:`button`,variant:`outline`,role:`combobox`,id:te?void 0:`agent-model`,"aria-expanded":D,"aria-controls":`agent-model-command-list`,className:`h-9 flex-1 justify-between font-mono text-xs`,children:[(0,I.jsx)(`span`,{className:`truncate text-left`,children:f.model||(L?`Select deployment...`:`Select model...`)}),(0,I.jsx)(on,{className:`ml-2 h-4 w-4 shrink-0 opacity-50`})]})}),(0,I.jsx)(J8,{className:`w-[420px] p-0`,align:`start`,children:(0,I.jsxs)(b5,{children:[(0,I.jsx)(x5,{placeholder:`Search ${L?`deployments`:`models`}...`}),(0,I.jsxs)(S5,{id:`agent-model-command-list`,children:[(0,I.jsxs)(C5,{children:[`No `,L?`deployments`:`models`,` found.`]}),(0,I.jsxs)(w5,{heading:L?`Deployments`:`Models`,children:[z.map(e=>(0,I.jsxs)(T5,{value:e,onSelect:e=>{p(t=>({...t,model:e})),j(!1),k(!1)},children:[(0,I.jsx)(an,{className:U(`mr-2 h-4 w-4`,f.model===e?`opacity-100`:`opacity-0`)}),(0,I.jsx)(`span`,{className:`font-mono text-xs`,children:e})]},e)),(0,I.jsx)(T5,{value:`__custom_model_id__`,onSelect:()=>{j(!0),k(!1)},children:(0,I.jsx)(`span`,{className:`font-medium`,children:L?`Custom deployment ID...`:`Custom model ID...`})})]})]})]})})]}),R&&(0,I.jsxs)(W,{type:`button`,variant:`outline`,size:`sm`,className:`h-9 shrink-0 text-xs`,onClick:()=>void re(),disabled:T,title:L?`Load deployment suggestions from backend environment variables`:`Fetch ${f.provider} models`,children:[T?(0,I.jsx)(zn,{className:`mr-1 h-3 w-3 animate-spin`}):(0,I.jsx)(Qn,{className:`mr-1 h-3 w-3`}),L?`Load configured deployments`:`Fetch Models`]})]}),te&&!L&&(0,I.jsx)(Op,{id:`agent-model`,value:f.model,onChange:e=>p(t=>({...t,model:e.target.value})),placeholder:L?`Type deployment name manually`:`Type model name manually`,className:`font-mono text-xs`}),f.provider===`azure_foundry`&&(0,I.jsx)(`p`,{className:`text-xs text-muted-foreground`,children:`Set AZURE_FOUNDRY_ENDPOINT on the backend and AZURE_FOUNDRY_API_KEY, or reuse AZURE_OPENAI_API_KEY for the same resource. Enter the exact deployment name. Suggestions come from AZURE_FOUNDRY_DEPLOYMENTS; they do not query Azure.`}),f.provider===`azure`&&(0,I.jsx)(`p`,{className:`text-xs text-muted-foreground`,children:`Uses the selected deployment when it matches configured deployment suggestions; otherwise falls back to AZURE_OPENAI_DEPLOYMENT. Azure Foundry uses the deployment selected for each agent.`}),C!==null&&(C.length>0?(0,I.jsxs)(`p`,{className:`text-[11px] text-muted-foreground`,children:[`Loaded `,C.length,` `,L?`deployment names from configuration`:`models from provider discovery`,`.`]}):f.provider===`azure`?(0,I.jsx)(`p`,{className:`text-xs text-muted-foreground`,children:`Set AZURE_OPENAI_DEPLOYMENT on the MCPLab backend as the fallback. AZURE_OPENAI_DEPLOYMENTS and AZURE_OPENAI_DEPLOYMENT_NAME add selectable deployment suggestions.`}):null)]}),(0,I.jsxs)(`div`,{className:`space-y-1.5`,children:[(0,I.jsx)(Q,{children:`Max Tokens`}),(0,I.jsx)(Op,{type:`number`,min:1,max:128e3,value:f.maxTokens,onChange:e=>p(t=>({...t,maxTokens:parseInt(e.target.value)||0})),className:`font-mono text-xs`})]})]}),f.type!==`browser`&&(0,I.jsx)(`div`,{className:`grid gap-4 sm:grid-cols-2`,children:(0,I.jsxs)(`div`,{className:`space-y-1.5`,children:[(0,I.jsx)(Q,{children:`Max Turns`}),(0,I.jsx)(Op,{type:`number`,min:1,max:50,value:f.maxTurns??``,onChange:e=>{let t=e.target.value.trim();p(e=>({...e,maxTurns:t&&parseInt(t)||void 0}))},placeholder:`30 (default)`,className:`font-mono text-xs`}),(0,I.jsx)(`p`,{className:`text-[11px] text-muted-foreground`,children:`Maximum number of LLM round-trips (tool calls + final answer) per eval run.`})]})}),f.type!==`browser`&&(0,I.jsxs)(`div`,{className:`space-y-1.5`,children:[(0,I.jsxs)(`div`,{className:`flex items-center justify-between`,children:[(0,I.jsx)(Q,{children:`Temperature`}),(0,I.jsx)(`span`,{className:`font-mono text-xs text-muted-foreground`,children:D6(f.temperature).toFixed(2)})]}),(0,I.jsx)(k8,{value:[D6(f.temperature)],onValueChange:([e])=>p(t=>({...t,temperature:e})),min:0,max:2,step:.01})]}),f.type!==`browser`&&(0,I.jsxs)(`div`,{className:`space-y-1.5`,children:[(0,I.jsx)(Q,{children:`System Prompt`}),(0,I.jsx)(iX,{value:f.systemPrompt||``,onChange:e=>p(t=>({...t,systemPrompt:e.target.value})),placeholder:`Optional system prompt...`,rows:3,className:`text-xs`})]}),(0,I.jsxs)(`div`,{className:`flex items-center justify-between pt-2`,children:[(0,I.jsx)(`div`,{children:!c&&(0,I.jsx)(W,{type:`button`,variant:`destructive`,size:`sm`,onClick:()=>h(!0),children:`Delete`})}),(0,I.jsxs)(`div`,{className:`flex items-center gap-2`,children:[(0,I.jsx)(W,{type:`button`,variant:`outline`,size:`sm`,onClick:()=>n(`/libraries/agents`),children:`Cancel`}),(0,I.jsxs)(W,{type:`button`,size:`sm`,onClick:()=>void ie(),disabled:g,children:[g&&(0,I.jsx)(zn,{className:`mr-2 h-4 w-4 animate-spin`}),c?`Create Agent`:`Save`]})]})]})]})]}),(0,I.jsx)(X6,{open:m,onOpenChange:h,children:(0,I.jsxs)(Q6,{children:[(0,I.jsxs)($6,{children:[(0,I.jsx)(t8,{children:`Delete agent?`}),(0,I.jsxs)(n8,{children:[`This will permanently remove the agent `,(0,I.jsx)(`span`,{className:`font-mono`,children:f.name}),`. This action cannot be undone.`]})]}),(0,I.jsxs)(e8,{children:[(0,I.jsx)(i8,{children:`Cancel`}),(0,I.jsx)(r8,{onClick:()=>void ae(),className:`bg-destructive text-destructive-foreground hover:bg-destructive/90`,children:`Delete`})]})]})})]})},O5=`mcplab.resultAssistantScenarioHandoff`,k5=()=>{let{testCaseId:e}=Zd(),[t,n]=cp(),r=qd(),{source:i}=nv(),{scenarios:a,setScenarios:o,agents:s,servers:c,reload:l,loading:u}=hv(),[d,f]=(0,_.useState)(``),[p,m]=(0,_.useState)(`all`),[h,g]=(0,_.useState)(`name`),[v,y]=(0,_.useState)(`asc`),[b,x]=(0,_.useState)(``),[S,C]=(0,_.useState)(null),[w,T]=(0,_.useState)(`idle`),[E,D]=(0,_.useState)(``),[k,A]=(0,_.useState)(``),[j,M]=(0,_.useState)(0),[N,P]=(0,_.useState)(null),F=(0,_.useRef)(null),L=(0,_.useRef)(!1),R=(0,_.useRef)(!1),z=(0,_.useRef)(null),ee=(0,_.useRef)(0),te=(0,_.useRef)(a);te.current=a;let ne=(0,_.useRef)(o);ne.current=o;let re=e?decodeURIComponent(e):void 0,ie=t.get(`returnTo`)?.trim()||``,ae=ie.startsWith(`/`)?ie:``,oe=re?a.findIndex(e=>e.id===re):-1,se=oe>=0?a[oe]:void 0,ce=async e=>{if(!se||oe<0||!e)return;let t=[...a];t[oe]=e,await o(t)},B=async()=>{let e=z.current;if(!e||!se)return;if(L.current){R.current=!0;return}L.current=!0,R.current=!1;let t=++ee.current;T(`saving`),D(``);try{await ce(e),t===ee.current&&T(`saved`)}catch(e){let n=e instanceof Error?e.message:String(e);t===ee.current&&(T(`error`),D(n)),O({title:`Could not save scenario`,description:n,variant:`destructive`})}finally{L.current=!1,R.current&&(R.current=!1,B())}},le=e=>{z.current=e,T(`dirty`),D(``),F.current&&window.clearTimeout(F.current),F.current=window.setTimeout(()=>{F.current=null,B()},700)},ue=async()=>{let e=`scn-${Date.now()}`,t=e,n=1;for(;a.some(e=>e.id===t);)t=`${e}-${n}`,n+=1;let i={id:t,name:``,serverIds:[],prompt:``,evalRules:[],extractRules:[]};await o([...a,i]),r(`/libraries/test-cases/${encodeURIComponent(t)}`),O({title:`Test case created`,description:`Opened ${t} for editing.`})},de=e=>{let t=(e||`scn-${Date.now()}`).trim().replace(/\s+/g,`-`).replace(/[^a-zA-Z0-9_-]/g,``).replace(/-+/g,`-`).replace(/^-|-$/g,``)||`scn-${Date.now()}`,n=t,r=1;for(;a.some(e=>e.id===n);)n=`${t}-${r}`,r+=1;return n},V=async(e,t=!1)=>{let n=de(`${e.id}-copy`),i={...structuredClone(e),id:n,name:e.name?`${e.name} (Copy)`:``};await o([...a,i]),O({title:`Test case duplicated`,description:`Created ${i.id}.`}),t&&r(`/libraries/test-cases/${encodeURIComponent(i.id)}`)},fe=async e=>{F.current&&=(window.clearTimeout(F.current),null);let t=a.filter(t=>t.id!==e.id);await o(t),O({title:`Test case deleted`,description:`${e.id} was removed.`}),se?.id===e.id&&(C(null),z.current=null,T(`idle`),D(``),r(`/libraries/test-cases`))},pe=e=>e.map(e=>c.find(t=>t.id===e)).filter(Boolean).map(e=>e?.name||e?.id).filter(Boolean),me=(0,_.useMemo)(()=>{let e=new Set;for(let t of a)for(let n of pe(t.serverIds))e.add(n);return Array.from(e).sort((e,t)=>e.localeCompare(t))},[a,c]),he=(0,_.useMemo)(()=>{let e=d.trim().toLowerCase(),t=a.filter(t=>{let n=(t.name||``).toLowerCase(),r=t.id.toLowerCase(),i=(t.prompt||``).toLowerCase(),a=pe(t.serverIds);return p!==`all`&&!a.includes(p)?!1:!e||n.includes(e)||r.includes(e)||i.includes(e)||a.some(t=>t.toLowerCase().includes(e))});return t.sort((e,t)=>{let n=pe(e.serverIds),r=pe(t.serverIds),i=0;switch(h){case`id`:i=e.id.localeCompare(t.id);break;case`servers`:i=n.length-r.length;break;case`evalRules`:i=e.evalRules.length-t.evalRules.length;break;case`extractRules`:i=e.extractRules.length-t.extractRules.length;break;default:i=(e.name||e.id).localeCompare(t.name||t.id)}return i===0&&(i=e.id.localeCompare(t.id)),v===`asc`?i:-i}),t},[a,d,p,h,v,c]);(0,_.useEffect)(()=>{let e=!0;return i.getWorkspaceSettings().then(t=>{e&&t&&x(t.assistantAgentName??``)}).catch(()=>{e&&x(``)}),()=>{e=!1}},[i]),(0,_.useEffect)(()=>{if(re&&t.get(`assistantHandoff`)===`1`)try{let e=window.sessionStorage.getItem(O5);if(!e)return;let r=JSON.parse(e);if(!r||r.scenarioId!==re||!r.prompt)return;A(String(r.prompt)),M(Date.now()),window.sessionStorage.removeItem(O5);let i=new URLSearchParams(t);i.delete(`assistantHandoff`),n(i,{replace:!0}),O({title:`Suggestion sent to Scenario Assistant`,description:`Review the suggestion and apply changes in the scenario editor.`})}catch{}},[re,t,n]),(0,_.useEffect)(()=>{let e=F.current!==null||L.current,t=z.current;if(!(se&&t?.id===se.id&&e)){if(t&&t.id!==se?.id&&(F.current!==null||R.current)){F.current!==null&&(window.clearTimeout(F.current),F.current=null),R.current=!1;let e=te.current,n=e.findIndex(e=>e.id===t.id);if(n>=0){let r=[...e];r[n]=t,ne.current(r)}}F.current&&=(window.clearTimeout(F.current),null),L.current=!1,R.current=!1,se?(C(structuredClone(se)),z.current=structuredClone(se),T(`idle`),D(``)):(C(null),z.current=null,T(`idle`),D(``))}},[se]),(0,_.useEffect)(()=>()=>{F.current&&window.clearTimeout(F.current)},[]);let ge=b||s[0]?.name||``;return(0,I.jsxs)(`div`,{className:`space-y-6`,children:[(0,I.jsxs)(`div`,{className:`flex items-start justify-between gap-2`,children:[(0,I.jsxs)(`div`,{children:[(0,I.jsxs)(`h1`,{className:`inline-flex items-center gap-2 text-2xl font-bold`,children:[(0,I.jsx)(Tn,{className:`h-6 w-6`}),`Manage Test Cases`]}),(0,I.jsx)(`p`,{className:`text-sm text-muted-foreground`,children:`Reusable test case templates shared across configurations.`})]}),(0,I.jsxs)(`div`,{className:`flex items-center gap-2`,children:[se&&(0,I.jsxs)(W,{type:`button`,size:`sm`,variant:`outline`,onClick:()=>r(`/libraries/test-cases`),children:[(0,I.jsx)(Qt,{className:`mr-2 h-4 w-4`}),`Back to Overview`]}),se&&ae&&(0,I.jsx)(W,{type:`button`,size:`sm`,variant:`outline`,asChild:!0,children:(0,I.jsxs)(np,{to:ae,children:[(0,I.jsx)(Qt,{className:`mr-2 h-4 w-4`}),`Back to evaluation`]})}),(0,I.jsxs)(W,{type:`button`,size:`sm`,variant:`outline`,onClick:()=>void l(),disabled:u,children:[(0,I.jsx)(Qn,{className:`mr-2 h-4 w-4`}),`Refresh`]}),!se&&(0,I.jsxs)(W,{type:`button`,size:`sm`,onClick:()=>void ue(),children:[(0,I.jsx)(Xn,{className:`mr-1.5 h-3.5 w-3.5`}),`Add Test Case`]})]})]}),!se&&(0,I.jsxs)(I.Fragment,{children:[(0,I.jsxs)(`div`,{className:`grid gap-3 rounded-md border bg-muted/30 p-3 md:grid-cols-[1.6fr_1fr_1fr_auto]`,children:[(0,I.jsxs)(`div`,{className:`space-y-1.5`,children:[(0,I.jsx)(Q,{className:`text-xs`,children:`Search`}),(0,I.jsxs)(`div`,{className:`relative`,children:[(0,I.jsx)(er,{className:`pointer-events-none absolute left-2.5 top-1/2 h-3.5 w-3.5 -translate-y-1/2 text-muted-foreground`}),(0,I.jsx)(Op,{value:d,onChange:e=>f(e.target.value),placeholder:`Search by name, id, prompt, server...`,className:`h-8 pl-8 text-xs`})]})]}),(0,I.jsxs)(`div`,{className:`space-y-1.5`,children:[(0,I.jsx)(Q,{className:`text-xs`,children:`Server Filter`}),(0,I.jsxs)(OY,{value:p,onValueChange:m,children:[(0,I.jsx)(AY,{className:`h-8 text-xs`,children:(0,I.jsx)(kY,{})}),(0,I.jsxs)(NY,{children:[(0,I.jsx)(Z,{value:`all`,children:`All servers`}),me.map(e=>(0,I.jsx)(Z,{value:e,children:e},e))]})]})]}),(0,I.jsxs)(`div`,{className:`space-y-1.5`,children:[(0,I.jsx)(Q,{className:`text-xs`,children:`Sort By`}),(0,I.jsxs)(OY,{value:h,onValueChange:e=>g(e),children:[(0,I.jsx)(AY,{className:`h-8 text-xs`,children:(0,I.jsx)(kY,{})}),(0,I.jsxs)(NY,{children:[(0,I.jsx)(Z,{value:`name`,children:`Name`}),(0,I.jsx)(Z,{value:`id`,children:`ID`}),(0,I.jsx)(Z,{value:`servers`,children:`# Servers`}),(0,I.jsx)(Z,{value:`evalRules`,children:`# Eval Rules`}),(0,I.jsx)(Z,{value:`extractRules`,children:`# Extract Rules`})]})]})]}),(0,I.jsxs)(`div`,{className:`space-y-1.5`,children:[(0,I.jsx)(Q,{className:`text-xs`,children:`Direction`}),(0,I.jsxs)(OY,{value:v,onValueChange:e=>y(e),children:[(0,I.jsx)(AY,{className:`h-8 w-28 text-xs`,children:(0,I.jsx)(kY,{})}),(0,I.jsxs)(NY,{children:[(0,I.jsx)(Z,{value:`asc`,children:`Ascending`}),(0,I.jsx)(Z,{value:`desc`,children:`Descending`})]})]})]})]}),(0,I.jsx)(K,{children:(0,I.jsxs)(q,{className:`space-y-3 pt-6`,children:[(0,I.jsxs)(`div`,{className:`text-xs text-muted-foreground`,children:[`Showing `,he.length,` of `,a.length,` test case`,a.length===1?``:`s`,`.`]}),re&&!se&&(0,I.jsxs)(`div`,{className:`rounded-md border border-amber-300 bg-amber-50 px-3 py-2 text-sm text-amber-900`,children:[`Test case `,(0,I.jsx)(`code`,{className:`font-mono`,children:re}),` was not found.`]}),a.length===0?(0,I.jsx)(`p`,{className:`text-sm text-muted-foreground`,children:`No library test cases yet.`}):he.length===0?(0,I.jsx)(`p`,{className:`text-sm text-muted-foreground`,children:`No test cases match the current filters.`}):(0,I.jsx)(`div`,{className:`grid gap-3`,children:he.map(e=>{let t=re===e.id,n=`/libraries/test-cases/${encodeURIComponent(e.id)}`,r=pe(e.serverIds);return(0,I.jsx)(`div`,{className:`rounded-lg border p-3 ${t?`border-primary bg-primary/5`:``}`,children:(0,I.jsxs)(`div`,{className:`flex items-start justify-between gap-3`,children:[(0,I.jsxs)(`div`,{className:`space-y-1 min-w-0`,children:[(0,I.jsxs)(`div`,{className:`flex items-center gap-2 flex-wrap`,children:[(0,I.jsx)(np,{to:n,className:`font-medium truncate hover:underline`,children:e.name||e.id}),(0,I.jsx)(Y,{variant:`outline`,className:`font-mono text-[10px]`,children:e.id}),t&&(0,I.jsx)(Y,{children:`Selected`})]}),(0,I.jsxs)(`div`,{className:`text-xs text-muted-foreground flex flex-wrap gap-x-3 gap-y-1`,children:[(0,I.jsxs)(`span`,{children:[r.length,` server`,r.length===1?``:`s`]}),(0,I.jsxs)(`span`,{children:[e.evalRules.length,` eval rule`,e.evalRules.length===1?``:`s`]}),(0,I.jsxs)(`span`,{children:[e.extractRules.length,` extract rule`,e.extractRules.length===1?``:`s`]})]}),r.length>0&&(0,I.jsx)(`div`,{className:`flex flex-wrap gap-1`,children:r.map(t=>(0,I.jsx)(Y,{variant:`secondary`,className:`text-[10px]`,children:t},`${e.id}-${t}`))})]}),(0,I.jsxs)(`div`,{className:`flex items-center gap-2 shrink-0`,children:[(0,I.jsxs)(W,{type:`button`,size:`sm`,variant:`outline`,className:`text-destructive hover:text-destructive`,onClick:()=>P(e),children:[(0,I.jsx)(lr,{className:`mr-1.5 h-3.5 w-3.5`}),`Delete`]}),(0,I.jsxs)(W,{type:`button`,size:`sm`,variant:`outline`,onClick:()=>void V(e),children:[(0,I.jsx)(vn,{className:`mr-1.5 h-3.5 w-3.5`}),`Duplicate`]}),(0,I.jsx)(W,{type:`button`,size:`sm`,variant:t?`default`:`outline-solid`,asChild:!0,children:(0,I.jsxs)(np,{to:n,children:[(0,I.jsx)(Jn,{className:`mr-1.5 h-3.5 w-3.5`}),`Edit`]})})]})]})},e.id)})})]})})]}),se&&S?(0,I.jsxs)(K,{children:[(0,I.jsx)(gv,{className:`pb-3`,children:(0,I.jsxs)(`div`,{className:`flex items-start justify-between gap-2`,children:[(0,I.jsxs)(`div`,{className:`space-y-1`,children:[(0,I.jsxs)(`div`,{className:`flex flex-wrap items-center gap-2`,children:[(0,I.jsxs)(_v,{className:`text-base`,children:[`Edit Test Case ·`,` `,(0,I.jsx)(`code`,{className:`font-mono text-muted-foreground`,children:se.id})]}),(0,I.jsx)(Y,{variant:`outline`,className:`text-[10px] ${w===`saving`?`border-amber-300 text-amber-700`:w===`saved`?`border-emerald-300 text-emerald-700`:w===`error`?`border-destructive/40 text-destructive`:w===`dirty`?`border-sky-300 text-sky-700`:``}`,children:w===`saving`?`Saving...`:w===`saved`?`Saved`:w===`error`?`Save failed`:w===`dirty`?`Unsaved changes`:`Ready`})]}),w===`error`&&E&&(0,I.jsx)(`div`,{className:`text-[11px] text-destructive`,children:E})]}),(0,I.jsxs)(`div`,{className:`flex items-center gap-2`,children:[(0,I.jsxs)(W,{type:`button`,size:`sm`,variant:`outline`,onClick:()=>void V(S,!0),children:[(0,I.jsx)(vn,{className:`mr-1.5 h-3.5 w-3.5`}),`Duplicate`]}),(0,I.jsxs)(W,{type:`button`,size:`sm`,variant:`outline`,className:`text-destructive hover:text-destructive`,onClick:()=>P(S),children:[(0,I.jsx)(lr,{className:`mr-1.5 h-3.5 w-3.5`}),`Delete`]})]})]})}),(0,I.jsx)(q,{className:`pt-3`,children:(0,I.jsx)(C6,{scenarios:[S],agents:s,servers:c,defaultAssistantAgentName:ge,assistantInitialPromptByScenarioId:k&&S?.id?{[S.id]:k}:void 0,assistantAutoOpenNonceByScenarioId:S?.id&&j?{[S.id]:j}:void 0,onChange:e=>{let t=e[0];t&&(C(t),le(t))},allowAdd:!1})})]}):null,(0,I.jsx)(X6,{open:!!N,onOpenChange:e=>!e&&P(null),children:(0,I.jsxs)(Q6,{children:[(0,I.jsxs)($6,{children:[(0,I.jsx)(t8,{children:`Delete test case?`}),(0,I.jsxs)(n8,{children:[`This will permanently remove`,` `,(0,I.jsx)(`span`,{className:`font-medium`,children:N?.name||N?.id}),` `,`from the library. This action cannot be undone.`]})]}),(0,I.jsxs)(e8,{children:[(0,I.jsx)(i8,{children:`Cancel`}),(0,I.jsx)(r8,{className:`bg-destructive text-destructive-foreground hover:bg-destructive/90`,onClick:()=>{N&&(fe(N),P(null))},children:`Delete Test Case`})]})]})})]})},A5=`Switch`,[Dde,Ode]=R(A5),[kde,Ade]=Dde(A5),j5=_.forwardRef((e,t)=>{let{__scopeSwitch:n,name:r,checked:i,defaultChecked:a,required:o,disabled:s,value:c=`on`,onCheckedChange:l,form:u,...d}=e,[f,p]=_.useState(null),m=P(t,e=>p(e)),h=_.useRef(!1),g=!f||u||!!f.closest(`form`),[v,y]=ze({prop:i,defaultProp:a??!1,onChange:l,caller:A5});return(0,I.jsxs)(kde,{scope:n,checked:v,disabled:s,children:[(0,I.jsx)(V.button,{type:`button`,role:`switch`,"aria-checked":v,"aria-required":o,"data-state":F5(v),"data-disabled":s?``:void 0,disabled:s,value:c,...d,ref:m,onClick:j(e.onClick,e=>{y(e=>!e),g&&(h.current=e.isPropagationStopped(),h.current||e.stopPropagation())})}),g&&(0,I.jsx)(P5,{control:f,bubbles:!h.current,name:r,value:c,checked:v,required:o,disabled:s,form:u,style:{transform:`translateX(-100%)`}})]})});j5.displayName=A5;var M5=`SwitchThumb`,N5=_.forwardRef((e,t)=>{let{__scopeSwitch:n,...r}=e,i=Ade(M5,n);return(0,I.jsx)(V.span,{"data-state":F5(i.checked),"data-disabled":i.disabled?``:void 0,...r,ref:t})});N5.displayName=M5;var jde=`SwitchBubbleInput`,P5=_.forwardRef(({__scopeSwitch:e,control:t,checked:n,bubbles:r=!0,...i},a)=>{let o=_.useRef(null),s=P(o,a),c=tJ(n),l=oc(t);return _.useEffect(()=>{let e=o.current;if(!e)return;let t=window.HTMLInputElement.prototype,i=Object.getOwnPropertyDescriptor(t,`checked`).set;if(c!==n&&i){let t=new Event(`click`,{bubbles:r});i.call(e,n),e.dispatchEvent(t)}},[c,n,r]),(0,I.jsx)(`input`,{type:`checkbox`,"aria-hidden":!0,defaultChecked:n,...i,tabIndex:-1,ref:s,style:{...i.style,...l,position:`absolute`,pointerEvents:`none`,opacity:0,margin:0}})});P5.displayName=jde;function F5(e){return e?`checked`:`unchecked`}var I5=j5,Mde=N5,L5=_.forwardRef(({className:e,...t},n)=>(0,I.jsx)(I5,{className:U(`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-hidden 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:(0,I.jsx)(Mde,{className:U(`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`)})}));L5.displayName=I5.displayName;var Nde=({evaluationJudgeAgentName:e,llmAgents:t,savedDecision:n,decisionError:r,loadingSettings:i,savingSettings:a,librariesLoading:o,onDecisionSaved:s,onDecisionError:c,onSavingChange:l,onTestingChange:u})=>{let{source:d}=nv(),[f,p]=(0,_.useState)(``),[m,h]=(0,_.useState)(``),[g,v]=(0,_.useState)(!1),[y,b]=(0,_.useState)(a_.baseUrl),[x,S]=(0,_.useState)(String(a_.passThreshold)),[C,w]=(0,_.useState)(String(a_.failThreshold)),[T,E]=(0,_.useState)(``),[D,k]=(0,_.useState)(!1),[A,j]=(0,_.useState)(),M=(0,_.useRef)(null);(0,_.useEffect)(()=>{let e,t=``;try{e=n?s_(n):void 0}catch{t=`Saved Decision Engine configuration is invalid. Select a provider to replace it, or save None to clear it. Semantic checks fall back to the Evaluation Judge.`}p(e?.provider??``),v(o_(e)),h(e?.model??``),b(e?.baseUrl??a_.baseUrl),S(String(e?.passThreshold??a_.passThreshold)),w(String(e?.failThreshold??a_.failThreshold)),E(t)},[n]),(0,_.useEffect)(()=>(k(!1),u(!1),j(void 0),()=>{M.current?.abort(),M.current=null}),[f,m,y,d,u]);let N=()=>{if(!f)return null;if(!x.trim()||!C.trim())throw Error(`Enter both pass and fail probability thresholds.`);return s_({provider:f,model:m,passThreshold:Number(x),failThreshold:Number(C),...g?{}:{enabled:!1},...f===`ollama`?{baseUrl:y}:{}})},P=async()=>{let e;try{if(e=N(),!e)throw Error(`Select a Decision Engine before testing the connection.`)}catch(e){c(e instanceof Error?e.message:String(e));return}let t=new AbortController;M.current=t,k(!0),u(!0),c(``),j(void 0);try{let n=await d.testDecisionConnection(e,t.signal);t.signal.aborted||j(n)}catch(e){t.signal.aborted||c(e instanceof Error?e.message:String(e))}finally{M.current===t&&(M.current=null,k(!1),u(!1))}},F=async()=>{let n=null;try{if(n=N(),o_(n)&&!t.some(t=>t.id===e||t.name===e))throw Error(`Select an LLM evaluation judge as backup before enabling the Decision Engine.`)}catch(e){c(e instanceof Error?e.message:String(e));return}l(!0),c(``);try{await d.updateWorkspaceSettings({evaluationDecision:n}),s(n??void 0),E(``),O({title:`Settings updated`,description:n?`Decision Engine configuration saved.`:`Decision Engine cleared. Semantic checks use the Evaluation Judge.`})}catch(e){c(e instanceof Error?e.message:String(e))}finally{l(!1)}};return(0,I.jsxs)(K,{children:[(0,I.jsxs)(gv,{className:`pb-3`,children:[(0,I.jsxs)(`div`,{className:`flex items-center justify-between gap-4`,children:[(0,I.jsx)(_v,{className:`text-base`,children:`Decision Engine`}),(0,I.jsx)(L5,{id:`decision-enabled`,className:`shrink-0`,checked:g,onCheckedChange:v,disabled:!f||a||i,"aria-label":`Use Decision Engine`,"aria-describedby":`decision-enabled-help`})]}),(0,I.jsx)(vv,{children:`Optionally evaluate semantic checks with a decision model. The Evaluation Judge handles uncertain decisions and unavailable engines.`})]}),(0,I.jsxs)(q,{className:`space-y-4`,children:[(0,I.jsxs)(`p`,{id:`decision-enabled-help`,className:`text-xs text-muted-foreground`,children:[g?`On: semantic checks use the Decision Engine with judge fallback.`:`Off: semantic checks use the Evaluation Judge. Your decision configuration is kept.`,` `,`Click Save Decision Engine to apply changes.`]}),(0,I.jsxs)(`div`,{className:`space-y-1.5`,children:[(0,I.jsxs)(`div`,{className:`grid gap-4 md:grid-cols-2`,children:[(0,I.jsxs)(`div`,{className:`space-y-1.5`,children:[(0,I.jsx)(Q,{htmlFor:`decision-provider`,className:`text-xs`,children:`Decision provider`}),(0,I.jsxs)(OY,{value:f||`__none__`,disabled:a||i,onValueChange:e=>{let t=e===`__none__`?``:e;p(t),t?f||v(!0):v(!1),h(t?i_[t].defaultModel:``),c(``)},children:[(0,I.jsx)(AY,{id:`decision-provider`,className:`h-9 text-sm`,children:(0,I.jsx)(kY,{})}),(0,I.jsxs)(NY,{children:[(0,I.jsx)(Z,{value:`__none__`,children:`None`}),Object.entries(i_).map(([e,{label:t}])=>(0,I.jsx)(Z,{value:e,children:t},e))]})]})]}),f&&(0,I.jsxs)(`div`,{className:`space-y-1.5`,children:[(0,I.jsx)(Q,{htmlFor:`decision-model`,className:`text-xs`,children:i_[f].modelLabel}),!i_[f].editableModel&&i_[f].models.length>1?(0,I.jsxs)(OY,{value:m,onValueChange:h,disabled:a||i,children:[(0,I.jsx)(AY,{id:`decision-model`,className:`h-9 text-sm`,children:(0,I.jsx)(kY,{})}),(0,I.jsx)(NY,{children:i_[f].models.map(e=>(0,I.jsx)(Z,{value:e,children:e},e))})]}):(0,I.jsx)(Op,{id:`decision-model`,className:`h-9 text-sm`,value:m,onChange:e=>h(e.target.value),disabled:a||i,readOnly:!i_[f].editableModel,list:`decision-model-suggestions`,"aria-describedby":[f===`ollama`?`ollama-model-help`:void 0,r?`decision-error`:void 0,T?`decision-config-error`:void 0].filter(Boolean).join(` `)||void 0}),(0,I.jsx)(`datalist`,{id:`decision-model-suggestions`,children:i_[f].models.map(e=>(0,I.jsx)(`option`,{value:e},e))})]})]}),f===`ollama`&&(0,I.jsxs)(`p`,{id:`ollama-model-help`,className:`text-xs text-muted-foreground`,children:[`Enter the exact model name from `,(0,I.jsx)(`code`,{children:`ollama list`}),`, including its tag (for example `,(0,I.jsx)(`code`,{children:`tev1:4b`}),` or `,(0,I.jsx)(`code`,{children:`tev1:0.8b`}),`). Suggestions do not show which models are installed.`]})]}),f&&(0,I.jsxs)(I.Fragment,{children:[(0,I.jsx)(`p`,{className:`text-xs text-muted-foreground`,children:i_[f].credentials}),f===`ollama`&&(0,I.jsxs)(`div`,{className:`space-y-1.5`,children:[(0,I.jsx)(Q,{htmlFor:`decision-url`,className:`text-xs`,children:`Ollama server URL`}),(0,I.jsx)(Op,{id:`decision-url`,type:`url`,value:y,onChange:e=>b(e.target.value),disabled:a||i,"aria-describedby":[r?`decision-error`:void 0,T?`decision-config-error`:void 0].filter(Boolean).join(` `)||void 0}),(0,I.jsx)(`p`,{className:`text-xs text-muted-foreground`,children:`Use a URL reachable from the MCPLab backend. Ollama fallback uses the configured judge, which may be hosted.`})]}),(0,I.jsxs)(`div`,{className:`grid gap-4 md:grid-cols-2`,children:[(0,I.jsxs)(`div`,{className:`space-y-1.5`,children:[(0,I.jsx)(Q,{htmlFor:`decision-pass`,className:`text-xs`,children:`Pass probability threshold`}),(0,I.jsx)(Op,{id:`decision-pass`,type:`number`,min:`0`,max:`1`,step:`0.01`,value:x,onChange:e=>S(e.target.value),disabled:a||i,"aria-invalid":!!r,"aria-describedby":`decision-threshold-help${r?` decision-error`:``}${T?` decision-config-error`:``}`})]}),(0,I.jsxs)(`div`,{className:`space-y-1.5`,children:[(0,I.jsx)(Q,{htmlFor:`decision-fail`,className:`text-xs`,children:`Fail probability threshold`}),(0,I.jsx)(Op,{id:`decision-fail`,type:`number`,min:`0`,max:`1`,step:`0.01`,value:C,onChange:e=>w(e.target.value),disabled:a||i,"aria-invalid":!!r,"aria-describedby":`decision-threshold-help${r?` decision-error`:``}${T?` decision-config-error`:``}`})]})]}),(0,I.jsx)(`p`,{id:`decision-threshold-help`,className:`text-xs text-muted-foreground`,children:`Both thresholds describe the probability that the assertion is satisfied. Pass at or above the pass threshold; fail at or below the fail threshold. Between them, the Evaluation Judge decides. Use 0 ≤ fail threshold < pass threshold ≤ 1.`})]}),T&&(0,I.jsx)(`p`,{id:`decision-config-error`,role:`alert`,className:`text-sm text-destructive`,children:T}),r&&(0,I.jsx)(`p`,{id:`decision-error`,role:`alert`,className:`text-sm text-destructive`,children:r}),A&&(0,I.jsx)(`p`,{role:A.ok?`status`:`alert`,className:`text-sm ${A.ok?`text-success`:`text-destructive`}`,children:A.message}),f&&(0,I.jsx)(`p`,{className:`text-xs text-muted-foreground`,children:`Test connection sends one small decision request using the current values without saving them.`}),(0,I.jsxs)(`div`,{className:`flex flex-wrap gap-2`,children:[(0,I.jsx)(W,{type:`button`,onClick:()=>void F(),disabled:a||i||o||D,children:a?`Saving...`:`Save Decision Engine`}),(0,I.jsx)(W,{type:`button`,variant:`outline`,onClick:()=>void P(),disabled:!f||a||i||D,children:D?`Testing...`:`Test connection`})]})]})]})},Pde=()=>{let{source:e}=nv(),{agents:t,reload:n,loading:r}=hv(),[i,a]=(0,_.useState)(!1),[o,s]=(0,_.useState)(!1),[c,l]=(0,_.useState)(``),[u,d]=(0,_.useState)(``),[f,p]=(0,_.useState)(`1`),[m,h]=(0,_.useState)(),[g,v]=(0,_.useState)(``),[y,b]=(0,_.useState)(!1),x=t.filter(e=>e.type!==`browser`),S=(0,_.useMemo)(()=>c||t[0]?.name||``,[c,t]),C=(0,_.useCallback)(async()=>{a(!0);try{let t=await e.getWorkspaceSettings();l(t?.assistantAgentName??``),d(t?.evaluationJudgeAgentName??``),p(String(t?.defaultQueueWorkers??1)),h(t?.evaluationDecision)}catch(e){l(``),d(``),p(`1`),h(void 0),O({title:`Could not load settings`,description:e instanceof Error?e.message:String(e),variant:`destructive`})}finally{a(!1)}},[e]);(0,_.useEffect)(()=>{C()},[C]);let w=async t=>{let n=c;l(t),s(!0);try{await e.updateWorkspaceSettings({assistantAgentName:t||void 0}),O({title:`Settings updated`,description:t?`Default assistant agent set to ${t}.`:`Default assistant agent cleared (will use first available agent by default).`})}catch(e){l(n),O({title:`Could not save settings`,description:e instanceof Error?e.message:String(e),variant:`destructive`})}finally{s(!1)}},T=async t=>{let n=f;p(t),s(!0);try{await e.updateWorkspaceSettings({defaultQueueWorkers:Number(t)}),O({title:`Settings updated`,description:`Evaluation workers set to ${t}.`})}catch(e){p(n),O({title:`Could not save settings`,description:e instanceof Error?e.message:String(e),variant:`destructive`})}finally{s(!1)}},E=async t=>{if(!t&&o_(m)){v(`Turn off and save, or clear, the Decision Engine before removing its backup LLM evaluation judge.`);return}let n=u;d(t),s(!0);try{await e.updateWorkspaceSettings({evaluationJudgeAgentName:t||null}),O({title:`Settings updated`,description:t?`Default evaluation judge set to ${t}.`:`Default evaluation judge cleared.`})}catch(e){d(n),O({title:`Could not save settings`,description:e instanceof Error?e.message:String(e),variant:`destructive`})}finally{s(!1)}},D=async()=>{await Promise.all([n(),C()])};return(0,I.jsxs)(`div`,{className:`space-y-6`,children:[(0,I.jsxs)(`div`,{className:`flex items-start justify-between gap-2`,children:[(0,I.jsxs)(`div`,{children:[(0,I.jsxs)(`h1`,{className:`inline-flex items-center gap-2 text-2xl font-bold`,children:[(0,I.jsx)(nr,{className:`h-6 w-6`}),`Settings`]}),(0,I.jsx)(`p`,{className:`text-sm text-muted-foreground`,children:`Workspace-level MCP Lab settings and defaults.`})]}),(0,I.jsxs)(W,{type:`button`,size:`sm`,variant:`outline`,onClick:()=>void D(),disabled:r||i||o||y,children:[(0,I.jsx)(Qn,{className:`mr-2 h-4 w-4`}),`Refresh`]})]}),(0,I.jsxs)(K,{children:[(0,I.jsxs)(gv,{className:`pb-3`,children:[(0,I.jsx)(_v,{className:`text-base`,children:`Assistant Defaults`}),(0,I.jsx)(vv,{children:`Default assistant agent used across assistant flows. If unset, MCP Lab uses the first available agent automatically.`})]}),(0,I.jsxs)(q,{className:`grid gap-3 md:grid-cols-[1.3fr_auto] md:items-end`,children:[(0,I.jsxs)(`div`,{className:`space-y-1.5`,children:[(0,I.jsx)(Q,{className:`text-xs`,children:`Default Assistant Agent`}),(0,I.jsxs)(OY,{value:S||`__none__`,onValueChange:e=>void w(e===`__none__`?``:e),disabled:o,children:[(0,I.jsx)(AY,{className:`h-9 text-sm`,children:(0,I.jsx)(kY,{placeholder:`Select assistant agent`})}),(0,I.jsxs)(NY,{children:[(0,I.jsx)(Z,{value:`__none__`,children:`None (use first agent)`}),t.map(e=>(0,I.jsxs)(Z,{value:e.id,children:[e.name||e.id,` · `,e.model]},e.id))]})]}),(0,I.jsx)(`p`,{className:`text-xs text-muted-foreground`,children:`Applies to the assistant flows that use the workspace default. MCP Evaluation editors can still override the assistant agent from their evaluation context.`})]}),(0,I.jsx)(`div`,{className:`text-xs text-muted-foreground`,children:`Saved in workspace settings`})]})]}),(0,I.jsxs)(K,{children:[(0,I.jsxs)(gv,{className:`pb-3`,children:[(0,I.jsx)(_v,{className:`text-base`,children:`Evaluation Judge`}),(0,I.jsx)(vv,{children:`Default judge agent used by semantic agent checks during scenario evaluation runs.`})]}),(0,I.jsxs)(q,{className:`grid gap-3 md:grid-cols-[1.3fr_auto] md:items-end`,children:[(0,I.jsxs)(`div`,{className:`space-y-1.5`,children:[(0,I.jsx)(Q,{className:`text-xs`,htmlFor:`evaluation-judge`,children:`Default Evaluation Judge`}),(0,I.jsxs)(OY,{value:u||`__none__`,onValueChange:e=>void E(e===`__none__`?``:e),disabled:o,children:[(0,I.jsx)(AY,{id:`evaluation-judge`,className:`h-9 text-sm`,children:(0,I.jsx)(kY,{placeholder:`Select evaluation judge`})}),(0,I.jsxs)(NY,{children:[(0,I.jsx)(Z,{value:`__none__`,children:`None`}),x.map(e=>(0,I.jsxs)(Z,{value:e.id,children:[e.name||e.id,` · `,e.model]},e.id))]})]}),(0,I.jsx)(`p`,{className:`text-xs text-muted-foreground`,children:`Used by agent checks that semantically evaluate the final answer. If unset, runs with agent checks will fail before execution.`})]}),(0,I.jsx)(`div`,{className:`text-xs text-muted-foreground`,children:`Saved in workspace settings`})]})]}),(0,I.jsx)(Nde,{evaluationJudgeAgentName:u,llmAgents:x,savedDecision:m,decisionError:g,loadingSettings:i,savingSettings:o,librariesLoading:r,onDecisionSaved:h,onDecisionError:v,onSavingChange:s,onTestingChange:b}),(0,I.jsxs)(K,{children:[(0,I.jsxs)(gv,{className:`pb-3`,children:[(0,I.jsx)(_v,{className:`text-base`,children:`Evaluation Queue`}),(0,I.jsx)(vv,{children:`Control how many queued evaluation runs may execute in parallel.`})]}),(0,I.jsxs)(q,{className:`grid gap-3 md:grid-cols-[1.3fr_auto] md:items-end`,children:[(0,I.jsxs)(`div`,{className:`space-y-1.5`,children:[(0,I.jsx)(Q,{htmlFor:`evaluation-workers`,className:`text-xs`,children:`Evaluation workers`}),(0,I.jsxs)(OY,{value:f,onValueChange:e=>void T(e),disabled:o,children:[(0,I.jsx)(AY,{id:`evaluation-workers`,className:`h-9 text-sm`,children:(0,I.jsx)(kY,{placeholder:`Select worker count`})}),(0,I.jsx)(NY,{children:Array.from({length:8},(e,t)=>String(t+1)).map(e=>(0,I.jsx)(Z,{value:e,children:e},e))})]}),(0,I.jsx)(`p`,{className:`text-xs text-muted-foreground`,children:`Number of queued evaluation runs that may execute in parallel.`})]}),(0,I.jsx)(`div`,{className:`text-xs text-muted-foreground`,children:`Saved in workspace settings`})]})]})]})},Fde=Gt(`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`}}),R5=_.forwardRef(({className:e,variant:t,...n},r)=>(0,I.jsx)(`div`,{ref:r,role:`alert`,className:U(Fde({variant:t}),e),...n}));R5.displayName=`Alert`;var z5=_.forwardRef(({className:e,...t},n)=>(0,I.jsx)(`h5`,{ref:n,className:U(`mb-1 font-medium leading-none tracking-tight`,e),...t}));z5.displayName=`AlertTitle`;var B5=_.forwardRef(({className:e,...t},n)=>(0,I.jsx)(`div`,{ref:n,className:U(`text-sm [&_p]:leading-relaxed`,e),...t}));B5.displayName=`AlertDescription`;var Ide=`http://127.0.0.1:3011/mcp`;function Lde(e){return navigator.clipboard.writeText(e)}function V5({text:e,label:t}){let[n,r]=(0,_.useState)(!1),i=async()=>{try{await Lde(e),r(!0),O({title:`Copied`,description:`${t} copied to clipboard.`}),window.setTimeout(()=>r(!1),1500)}catch(e){O({title:`Copy failed`,description:e instanceof Error?e.message:String(e),variant:`destructive`})}};return(0,I.jsxs)(W,{type:`button`,size:`sm`,variant:`outline`,onClick:()=>void i(),children:[(0,I.jsx)(vn,{className:`mr-2 h-3.5 w-3.5`}),n?`Copied`:`Copy`]})}function H5({label:e,value:t,copyText:n,valueClassName:r=``}){return(0,I.jsx)(`div`,{className:`rounded-lg border bg-muted/20 p-3`,children:(0,I.jsxs)(`div`,{className:`flex items-start justify-between gap-3`,children:[(0,I.jsxs)(`div`,{className:`min-w-0`,children:[(0,I.jsx)(`div`,{className:`text-[11px] font-semibold uppercase tracking-[0.08em] text-muted-foreground`,children:e}),(0,I.jsx)(`div`,{className:`mt-1 break-all text-sm font-medium ${r}`,children:t})]}),n&&(0,I.jsx)(V5,{text:n,label:e})]})})}function U5({title:e,description:t,code:n,iconSrc:r}){return(0,I.jsxs)(K,{children:[(0,I.jsxs)(gv,{className:`pb-3`,children:[(0,I.jsxs)(_v,{className:`flex items-center gap-2 text-base`,children:[(0,I.jsx)(`img`,{src:r,alt:``,"aria-hidden":`true`,className:`h-4 w-4`}),e]}),(0,I.jsx)(vv,{children:t})]}),(0,I.jsxs)(q,{className:`space-y-3`,children:[(0,I.jsx)(`pre`,{className:`max-h-80 overflow-auto rounded-lg border bg-muted/30 p-3 text-xs whitespace-pre-wrap break-all`,children:n}),(0,I.jsx)(`div`,{className:`flex justify-end`,children:(0,I.jsx)(V5,{text:n,label:e})})]})]})}var Rde=()=>{let{source:e}=nv(),[t,n]=(0,_.useState)(!0),[r,i]=(0,_.useState)(null),a=(0,_.useCallback)(async()=>{n(!0);try{let t=await e.health();i(t)}catch(e){i(null),O({title:`Could not load MCP connection info`,description:e instanceof Error?e.message:String(e),variant:`destructive`})}finally{n(!1)}},[e]);(0,_.useEffect)(()=>{a()},[a]);let o=r?.mcp?.enabled?r.mcp:null,s=o?.directUrl??Ide,c=o?.transport??`streamable-http`,l=(0,_.useMemo)(()=>JSON.stringify({mcpServers:{mcplab:{command:`npx`,args:[`mcp-remote`,s]}}},null,2),[s]),u=(0,_.useMemo)(()=>JSON.stringify({name:`mcplab`,transport:c,url:s},null,2),[s,c]);return(0,I.jsxs)(`div`,{className:`space-y-6`,children:[(0,I.jsxs)(`div`,{className:`flex items-start justify-between gap-3`,children:[(0,I.jsxs)(`div`,{children:[(0,I.jsxs)(`h1`,{className:`inline-flex items-center gap-2 text-2xl font-bold`,children:[(0,I.jsx)(Ln,{className:`h-6 w-6`}),`MCP Connection Info`]}),(0,I.jsx)(`p`,{className:`text-sm text-muted-foreground`,children:`Copy the local MCPLab MCP server details into Claude Desktop or any MCP-capable client.`})]}),(0,I.jsxs)(W,{type:`button`,size:`sm`,variant:`outline`,onClick:()=>void a(),disabled:t,children:[(0,I.jsx)(Qn,{className:`mr-2 h-4 w-4`}),`Refresh`]})]}),!o&&(0,I.jsxs)(R5,{children:[(0,I.jsx)(Ln,{className:`h-4 w-4`}),(0,I.jsx)(z5,{children:`MCP server not reported`}),(0,I.jsx)(B5,{children:`The page is showing the default local connection details. Start MCP Lab in dev mode to see the live runtime endpoint and package version.`})]}),(0,I.jsxs)(`div`,{className:`grid gap-6 xl:grid-cols-[1.1fr_0.9fr]`,children:[(0,I.jsxs)(K,{children:[(0,I.jsxs)(gv,{className:`pb-3`,children:[(0,I.jsx)(_v,{className:`text-base`,children:`Connection Details`}),(0,I.jsx)(vv,{children:`The local server is exposed over streamable HTTP.`})]}),(0,I.jsx)(q,{className:`space-y-3`,children:(0,I.jsxs)(`div`,{className:`grid gap-3`,children:[(0,I.jsx)(H5,{label:`Direct MCP URL`,value:s,copyText:s}),(0,I.jsx)(H5,{label:`Transport`,value:c}),(0,I.jsx)(H5,{label:`Authentication`,value:`none`})]})})]}),(0,I.jsxs)(`div`,{className:`space-y-6`,children:[(0,I.jsx)(U5,{title:`Claude Desktop`,description:`Use mcp-remote to bridge Claude Desktop to the local streamable HTTP MCP server.`,code:l,iconSrc:`/icons/claude-color.svg`}),(0,I.jsx)(U5,{title:`OpenAI / MCP-capable client`,description:`Use this endpoint block in any client or adapter that accepts a single MCP-over-HTTP server.`,code:u,iconSrc:`/icons/openai.svg`})]})]})]})};function zde(e,t=[]){let n=[];function r(t,r){let i=_.createContext(r);i.displayName=t+`Context`;let a=n.length;n=[...n,r];let o=t=>{let{scope:n,children:r,...o}=t,s=n?.[e]?.[a]||i,c=_.useMemo(()=>o,Object.values(o));return(0,I.jsx)(s.Provider,{value:c,children:r})};o.displayName=t+`Provider`;function s(n,o){let s=o?.[e]?.[a]||i,c=_.useContext(s);if(c)return c;if(r!==void 0)return r;throw Error(`\`${n}\` must be used within \`${t}\``)}return[o,s]}let i=()=>{let t=n.map(e=>_.createContext(e));return function(n){let r=n?.[e]||t;return _.useMemo(()=>({[`__scope${e}`]:{...n,[e]:r}}),[n,r])}};return i.scopeName=e,[r,Bde(i,...t)]}function Bde(...e){let t=e[0];if(e.length===1)return t;let n=()=>{let n=e.map(e=>({useScope:e(),scopeName:e.scopeName}));return function(e){let r=n.reduce((t,{useScope:n,scopeName:r})=>{let i=n(e)[`__scope${r}`];return{...t,...i}},{});return _.useMemo(()=>({[`__scope${t.scopeName}`]:r}),[r])}};return n.scopeName=t.scopeName,n}var W5=[`a`,`button`,`div`,`form`,`h2`,`h3`,`img`,`input`,`label`,`li`,`nav`,`ol`,`p`,`select`,`span`,`svg`,`ul`].reduce((e,t)=>{let n=vp(`Primitive.${t}`),r=_.forwardRef((e,r)=>{let{asChild:i,...a}=e,o=i?n:t;return typeof window<`u`&&(window[Symbol.for(`radix-ui`)]=!0),(0,I.jsx)(o,{...a,ref:r})});return r.displayName=`Primitive.${t}`,{...e,[t]:r}},{}),G5=`Progress`,K5=100,[Vde,Hde]=zde(G5),[Ude,Wde]=Vde(G5),q5=_.forwardRef((e,t)=>{let{__scopeProgress:n,value:r=null,max:i,getValueLabel:a=Gde,...o}=e;(i||i===0)&&!Q5(i)&&console.error(Kde(`${i}`,`Progress`));let s=Q5(i)?i:K5;r!==null&&!$5(r,s)&&console.error(qde(`${r}`,`Progress`));let c=$5(r,s)?r:null,l=Z5(c)?a(c,s):void 0;return(0,I.jsx)(Ude,{scope:n,value:c,max:s,children:(0,I.jsx)(W5.div,{"aria-valuemax":s,"aria-valuemin":0,"aria-valuenow":Z5(c)?c:void 0,"aria-valuetext":l,role:`progressbar`,"data-state":X5(c,s),"data-value":c??void 0,"data-max":s,...o,ref:t})})});q5.displayName=G5;var J5=`ProgressIndicator`,Y5=_.forwardRef((e,t)=>{let{__scopeProgress:n,...r}=e,i=Wde(J5,n);return(0,I.jsx)(W5.div,{"data-state":X5(i.value,i.max),"data-value":i.value??void 0,"data-max":i.max,...r,ref:t})});Y5.displayName=J5;function Gde(e,t){return`${Math.round(e/t*100)}%`}function X5(e,t){return e==null?`indeterminate`:e===t?`complete`:`loading`}function Z5(e){return typeof e==`number`}function Q5(e){return Z5(e)&&!isNaN(e)&&e>0}function $5(e,t){return Z5(e)&&!isNaN(e)&&e<=t&&e>=0}function Kde(e,t){return`Invalid prop \`max\` of value \`${e}\` supplied to \`${t}\`. Only numbers greater than 0 are valid max values. Defaulting to \`${K5}\`.`}function qde(e,t){return`Invalid prop \`value\` of value \`${e}\` supplied to \`${t}\`. The \`value\` prop must be:
|
|
158
|
-
- a positive number
|
|
159
|
-
- less than the value passed to \`max\` (or ${K5} if no \`max\` prop is set)
|
|
160
|
-
- \`null\` or \`undefined\` if the progress is indeterminate.
|
|
161
|
-
|
|
162
|
-
Defaulting to \`null\`.`}var e7=q5,Jde=Y5,t7=_.forwardRef(({className:e,value:t,...n},r)=>(0,I.jsx)(e7,{ref:r,className:U(`relative h-4 w-full overflow-hidden rounded-full bg-secondary`,e),...n,children:(0,I.jsx)(Jde,{className:`h-full w-full flex-1 bg-primary transition-all`,style:{transform:`translateX(-${100-(t||0)}%)`}})}));t7.displayName=e7.displayName;function n7(e){let t=e.toLowerCase();return t.includes(`side-effectful prefix`)||t.includes(`destructive behavior`)||t.includes(`destructivehint`)||t.includes(`non-read-only behavior`)||t.includes(`readonlyhint: false`)||t.includes(`additive behavior`)}function r7(e){try{return JSON.stringify(e,null,2)}catch{return`[schema not serializable]`}}function Yde(e){return typeof e.type==`string`?e.type:Array.isArray(e.type)?e.type.join(` | `):e.properties&&typeof e.properties==`object`?`object`:e.items&&typeof e.items==`object`?`array`:`any`}function i7(e,t=new Set){if(!e||typeof e!=`object`||Array.isArray(e))return 0;let n=e;if(t.has(n))return 0;let r=new Set(t);r.add(n);let i=n.properties&&typeof n.properties==`object`&&!Array.isArray(n.properties)?n.properties:void 0,a=i?Object.values(i).reduce((e,t)=>e+i7(t,r),0):0,o=i7(n.items,r),s=[...Array.isArray(n.oneOf)?n.oneOf:[],...Array.isArray(n.anyOf)?n.anyOf:[]].reduce((e,t)=>e+i7(t,r),0);return(i?Object.keys(i).length:0)+a+o+s}function a7({name:e,schema:t,required:n=!1,depth:r=0,seen:i=new Set,expandAll:a=null}){let[o,s]=(0,_.useState)(r===0);if((0,_.useEffect)(()=>{a!==null&&s(a)},[a]),!t||typeof t!=`object`||Array.isArray(t))return(0,I.jsx)(`div`,{className:`text-xs`,children:e});let c=t;if(i.has(c))return(0,I.jsxs)(`div`,{className:`text-xs text-muted-foreground`,children:[e,` (circular)`]});let l=new Set(i);l.add(c);let u=c.properties&&typeof c.properties==`object`&&!Array.isArray(c.properties)?c.properties:void 0,d=new Set(Array.isArray(c.required)?c.required.filter(e=>typeof e==`string`):[]),f=c.items&&typeof c.items==`object`?c.items:void 0,p=[...Array.isArray(c.oneOf)?c.oneOf:[],...Array.isArray(c.anyOf)?c.anyOf:[]],m=u&&Object.keys(u).length>0||!!f||p.length>0;return(0,I.jsxs)(`div`,{className:`min-w-0 space-y-1`,style:{marginLeft:r*12},children:[(0,I.jsxs)(`div`,{className:`flex min-w-0 flex-wrap items-center gap-1.5 text-xs`,children:[m?(0,I.jsxs)(`button`,{type:`button`,className:`inline-flex min-w-0 max-w-full items-center gap-1 text-left font-medium hover:underline`,"aria-label":`${o?`Collapse`:`Expand`} ${e}`,"aria-expanded":o,onClick:()=>s(e=>!e),children:[o?(0,I.jsx)(on,{className:`h-3 w-3 shrink-0`}):(0,I.jsx)(sn,{className:`h-3 w-3 shrink-0`}),(0,I.jsx)(`span`,{className:`wrap-break-word`,children:e})]}):(0,I.jsx)(`span`,{className:`wrap-break-word font-medium`,children:e}),(0,I.jsx)(Y,{variant:`outline`,className:`text-[10px]`,children:Yde(c)}),n&&(0,I.jsx)(`span`,{className:`text-[10px] text-rose-600`,children:`required`})]}),typeof c.description==`string`&&(0,I.jsx)(`div`,{className:`max-w-full wrap-break-word text-[11px] text-muted-foreground`,children:c.description}),Array.isArray(c.enum)&&(0,I.jsxs)(`div`,{className:`max-w-full wrap-break-word text-[11px] text-muted-foreground`,children:[`Enum: `,c.enum.map(e=>String(e)).join(`, `)]}),c.default!==void 0&&(0,I.jsxs)(`div`,{className:`max-w-full wrap-break-word text-[11px] text-muted-foreground`,children:[`Default: `,r7(c.default)]}),o&&m&&(0,I.jsxs)(`div`,{className:`min-w-0 space-y-2 border-l pl-2`,children:[u&&Object.keys(u).length>0&&(0,I.jsxs)(`div`,{className:`space-y-2`,children:[(0,I.jsx)(`div`,{className:`text-[11px] font-medium text-muted-foreground`,children:`Properties`}),Object.entries(u).map(([e,t])=>(0,I.jsx)(a7,{name:e,schema:t,required:d.has(e),depth:r+1,seen:l,expandAll:a},e))]}),f&&(0,I.jsxs)(`div`,{className:`space-y-1`,children:[(0,I.jsx)(`div`,{className:`text-[11px] font-medium text-muted-foreground`,children:`Items`}),(0,I.jsx)(a7,{name:`item`,schema:f,depth:r+1,seen:l,expandAll:a})]}),p.length>0&&(0,I.jsxs)(`div`,{className:`space-y-2`,children:[(0,I.jsx)(`div`,{className:`text-[11px] font-medium text-muted-foreground`,children:`Variants`}),p.map((e,t)=>(0,I.jsx)(a7,{name:`variant ${t+1}`,schema:e,depth:r+1,seen:l,expandAll:a},t))]})]})]})}function o7({propertyCount:e,onExpandAll:t,onCollapseAll:n}){return(0,I.jsxs)(`span`,{className:`flex flex-wrap items-center gap-1`,children:[(0,I.jsxs)(`span`,{className:`text-[10px] text-muted-foreground`,children:[e,` Properties`]}),(0,I.jsx)(`button`,{type:`button`,className:`rounded border px-1.5 py-0.5 text-[10px] text-muted-foreground hover:bg-muted hover:text-foreground`,onClick:t,children:`Expand All`}),(0,I.jsx)(`button`,{type:`button`,className:`rounded border px-1.5 py-0.5 text-[10px] text-muted-foreground hover:bg-muted hover:text-foreground`,onClick:n,children:`Collapse All`})]})}function s7({title:e,schema:t,explorerControls:n}){let r=e.toLowerCase(),i=async()=>{try{await navigator.clipboard.writeText(r7(t)),O({title:`${e} copied`})}catch(t){O({title:`Could not copy ${e.toLowerCase()}`,description:t instanceof Error?t.message:String(t),variant:`destructive`})}};return(0,I.jsxs)(`div`,{className:`flex min-w-0 flex-wrap items-center justify-between gap-2`,children:[(0,I.jsx)(`div`,{className:`text-[11px] font-medium text-muted-foreground`,children:e}),(0,I.jsxs)(`div`,{className:`flex min-w-0 flex-wrap items-center justify-end gap-1.5`,children:[n,(0,I.jsxs)(`button`,{type:`button`,className:`inline-flex shrink-0 items-center gap-1 rounded border px-1.5 py-0.5 text-[10px] text-muted-foreground hover:bg-muted hover:text-foreground`,"aria-label":`Copy ${r} JSON`,title:`Copy ${r} JSON`,onClick:()=>void i(),children:[(0,I.jsx)(vn,{className:`h-3 w-3`}),`Copy JSON`]})]})]})}function c7({inputSchema:e,outputSchema:t,mode:n,onModeChange:r}){let[i,a]=(0,_.useState)(`explorer`),[o,s]=(0,_.useState)(null),[c,l]=(0,_.useState)(null),u=n??i,d=e=>{r?.(e),n||a(e)};return e===void 0&&t===void 0?null:(0,I.jsxs)(`details`,{className:`group/schema min-w-0 max-w-full overflow-hidden rounded border bg-muted/10 p-2`,onClick:e=>e.stopPropagation(),children:[(0,I.jsxs)(`summary`,{className:`flex cursor-pointer list-none items-center justify-between gap-2 text-xs font-medium`,children:[(0,I.jsxs)(`span`,{className:`flex items-center gap-1.5`,children:[`Schemas`,e!==void 0&&(0,I.jsx)(Y,{variant:`outline`,className:`border-border text-[10px] text-muted-foreground`,children:`input`}),t!==void 0&&(0,I.jsx)(Y,{variant:`outline`,className:`border-border text-[10px] text-muted-foreground`,children:`output`})]}),(0,I.jsxs)(`span`,{className:`flex shrink-0 items-center gap-2`,children:[(0,I.jsx)(`span`,{className:`inline-flex rounded-md border bg-muted p-0.5`,role:`tablist`,"aria-label":`Schema view mode`,children:[`json`,`explorer`].map(e=>(0,I.jsx)(`button`,{type:`button`,role:`tab`,"aria-selected":u===e,className:`rounded px-2 py-0.5 text-[11px] font-medium capitalize data-[active=true]:bg-background data-[active=true]:shadow-xs`,"data-active":u===e,onClick:t=>{t.preventDefault(),t.stopPropagation(),d(e)},children:e.toUpperCase()},e))}),(0,I.jsx)(on,{className:`h-4 w-4 text-muted-foreground transition-transform group-open/schema:rotate-180`})]})]}),(0,I.jsxs)(`div`,{className:`mt-2`,children:[u===`json`&&(0,I.jsxs)(`div`,{className:`mt-2 space-y-2`,children:[e!==void 0&&(0,I.jsxs)(`div`,{className:`space-y-1`,children:[(0,I.jsx)(s7,{title:`Input schema`,schema:e}),(0,I.jsx)(`pre`,{className:`max-h-52 max-w-full overflow-auto whitespace-pre-wrap wrap-break-word rounded border bg-muted/20 p-2 text-[11px]`,children:r7(e)})]}),t!==void 0&&(0,I.jsxs)(`div`,{className:`space-y-1`,children:[(0,I.jsx)(s7,{title:`Output schema`,schema:t}),(0,I.jsx)(`pre`,{className:`max-h-52 max-w-full overflow-auto whitespace-pre-wrap wrap-break-word rounded border bg-muted/20 p-2 text-[11px]`,children:r7(t)})]})]}),u===`explorer`&&(0,I.jsxs)(`div`,{className:`mt-2 min-w-0 space-y-2`,children:[e!==void 0&&(0,I.jsxs)(`div`,{className:`min-w-0 space-y-2 rounded border bg-muted/10 p-2`,children:[(0,I.jsx)(s7,{title:`Input schema`,schema:e,explorerControls:(0,I.jsx)(o7,{propertyCount:i7(e),onExpandAll:()=>s(!0),onCollapseAll:()=>s(!1)})}),(0,I.jsx)(a7,{name:`root`,schema:e,expandAll:o})]}),t!==void 0&&(0,I.jsxs)(`div`,{className:`min-w-0 space-y-2 rounded border bg-muted/10 p-2`,children:[(0,I.jsx)(s7,{title:`Output schema`,schema:t,explorerControls:(0,I.jsx)(o7,{propertyCount:i7(t),onExpandAll:()=>l(!0),onCollapseAll:()=>l(!1)})}),(0,I.jsx)(a7,{name:`root`,schema:t,expandAll:c})]})]})]})]})}function l7(e,t){let n=t??(typeof navigator<`u`?navigator.language:void 0);return e.toLocaleString(n)}function Xde(e,t){let n=0,r=!1;for(let i of e){let e=i.tokenEstimate;if(!e)continue;r=!0;let a=new Set(t[i.serverName]??[]);n+=e.tools.filter(e=>a.has(e.name)).reduce((e,t)=>e+t.total,0)}return r?n:void 0}function u7({total:e,title:t=`Estimated tokens for this tool definition and its schemas`,className:n}){return typeof e==`number`?(0,I.jsxs)(Y,{variant:`outline`,className:U(`bg-background font-mono text-xs font-normal`,n),title:t,children:[`~`,l7(e),`tok`]}):null}var d7=[`critical`,`high`,`medium`,`low`,`info`];function f7(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 Zde(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 p7(e){return e.toLowerCase().replace(/[^a-z0-9]+/g,`-`).replace(/^-+|-+$/g,``)||`tool`}async function m7(e,t){let n=typeof t==`string`?t:JSON.stringify(t,null,2);try{await navigator.clipboard.writeText(n),O({title:`${e} copied`})}catch(t){O({title:`Could not copy ${e.toLowerCase()}`,description:t instanceof Error?t.message:String(t),variant:`destructive`})}}function h7({text:e}){return(0,I.jsxs)(`div`,{className:`mt-2 rounded-md border px-2.5 py-2 text-[11px] text-slate-800`,children:[(0,I.jsxs)(`div`,{className:`mb-1 inline-flex items-center gap-1 font-medium text-slate-700`,children:[(0,I.jsx)(In,{className:`h-3.5 w-3.5`}),`Suggested improvement`]}),(0,I.jsx)(`p`,{children:e})]})}function Qde({label:e,reason:t,variantClassName:n}){return(0,I.jsx)(gl,{delayDuration:0,children:(0,I.jsxs)(_l,{children:[(0,I.jsx)(vl,{asChild:!0,children:(0,I.jsx)(Y,{variant:`outline`,className:n,children:e})}),(0,I.jsx)(yl,{className:`max-w-sm text-xs`,children:(0,I.jsx)(`p`,{children:t})})]})})}function g7(e){let t=[],n=(e,n)=>{t.push(`#### ${e}`),t.push("```json");try{t.push(JSON.stringify(n,null,2))}catch{t.push(`"[schema not serializable]"`)}t.push("```")};if(t.push(`# MCP Tool Analysis Report`,``),t.push(`- Created: ${e.createdAt}`),t.push(`- Assistant Agent: ${e.assistantAgentName}`),t.push(`- Assistant Model: ${e.assistantAgentModel}`),e.mcpServerVersions&&Object.keys(e.mcpServerVersions).length>0){let n=Object.entries(e.mcpServerVersions).map(([e,t])=>`${e}: ${t??`unknown`}`).join(`, `);t.push(`- MCP Server Versions: ${n}`)}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(let r of e.servers){t.push(`## Server: ${r.serverName}`),r.warnings.length>0&&t.push(...r.warnings.map(e=>`- Warning: ${e}`),``);for(let e of r.tools){if(t.push(`### ${e.publicToolName}`),e.title&&t.push(`- Title: ${e.title}`),t.push(`- Safety: ${e.safetyClassification} (${e.classificationReason})`),e.inputSchema!==void 0&&n(`Input schema`,e.inputSchema),e.outputSchema!==void 0&&n(`Output schema`,e.outputSchema),e.metadataReview?.issues.length){t.push(`#### Metadata issues`);for(let n of e.metadataReview.issues)t.push(` - [${n.severity}] ${n.title}: ${n.detail}`)}if(e.deeperAnalysis){if(!e.deeperAnalysis.attempted)t.push(`- Deeper analysis: skipped (${e.deeperAnalysis.skippedReason??`unknown`})`);else{t.push(`- Deeper analysis sample calls: ${e.deeperAnalysis.sampleCalls.length}`);for(let n of e.deeperAnalysis.sampleCalls){t.push(` - Call ${n.callIndex}: ${n.ok?`ok`:`error`}${n.durationMs?` (${n.durationMs}ms)`:``}`),n.error&&t.push(` - Error: ${n.error}`);for(let e of n.observations)t.push(` - ${e}`)}}}if(e.overallRecommendations.length>0){t.push(`#### Recommendations`);for(let n of e.overallRecommendations)t.push(` - ${n}`)}if(e.metadataReview?.evalReadinessNotes.length){t.push(`#### Agent/Eval readiness notes`);for(let n of e.metadataReview.evalReadinessNotes)t.push(` - ${n}`)}t.push(``)}}return`${t.join(`
|
|
163
|
-
`)}\n`}function _7({report:e,schemaMode:t,onSchemaModeChange:n}){let[r,i]=cp(),[a,o]=(0,_.useState)([...d7]),[s,c]=(0,_.useState)(new Set),[l,u]=(0,_.useState)(``),[d,f]=(0,_.useState)(!1),[p,m]=(0,_.useState)(`explorer`),h=t??p,g=e=>{n?.(e),t||m(e)},v=r.get(`groupBy`)===`severity`?`severity`:`tool`,y=(0,_.useRef)(null),b=l.trim().toLowerCase(),x=(0,_.useMemo)(()=>new Set(a),[a]),S=e=>{o(t=>{let n=t.includes(e)?t.filter(t=>t!==e):[...t,e];return n.length===0?[...d7]:n})},C=e=>{let t=new URLSearchParams(r);e===`severity`?t.set(`groupBy`,`severity`):t.delete(`groupBy`),i(t,{replace:!0})},w=(0,_.useMemo)(()=>{let t={critical:[],high:[],medium:[],low:[],info:[]};for(let n of e.servers)for(let e of n.tools){let r=`tool-${p7(`${n.serverName}-${e.publicToolName}`)}`,i=`${n.serverName}::${e.publicToolName}`,a=e.publicToolName.split(`::`).pop()??e.publicToolName;for(let n of e.metadataReview?.issues??[]){let e=n.severity;t[e].push({key:`${i}-metadata-${n.id}`,toolAnchorId:r,toolLabel:i,toolDisplayName:a,sourceLabel:`Metadata review`,issue:{id:n.id,title:n.title,detail:n.detail,severity:e,suggestion:n.suggestion}})}for(let n of e.deeperAnalysis?.sampleCalls??[])for(let e of n.issues){let o=e.severity;t[o].push({key:`${i}-call-${n.callIndex}-${e.id}`,toolAnchorId:r,toolLabel:i,toolDisplayName:a,sourceLabel:`Sample call ${n.callIndex}`,issue:{id:e.id,title:e.title,detail:e.detail,severity:o,suggestion:e.suggestion}})}}return t},[e.servers]),T=(0,_.useMemo)(()=>Array.from(new Set(e.servers.flatMap(e=>e.tools.map(e=>e.publicToolName)).map(e=>e.split(`::`).pop()??e))).sort((e,t)=>e.localeCompare(t)),[e.servers]),E=e=>b.length===0||(e.toLowerCase().split(`::`).pop()??e.toLowerCase()).includes(b),D=e=>{y.current&&y.current.querySelectorAll(`details`).forEach(t=>{t.open=e})},O=()=>c(new Set(d7)),k=()=>c(new Set),A=e=>{c(t=>{let n=new Set(t);return n.has(e)?n.delete(e):n.add(e),n})};return(0,I.jsxs)(`div`,{className:`space-y-4`,children:[(0,I.jsxs)(`div`,{className:`grid gap-3 md:grid-cols-3`,children:[(0,I.jsx)(K,{children:(0,I.jsxs)(q,{className:`pt-6`,children:[(0,I.jsx)(`div`,{className:`text-xs text-muted-foreground`,children:`Tools analyzed`}),(0,I.jsx)(`div`,{className:`text-2xl font-semibold`,children:e.summary.toolsAnalyzed})]})}),(0,I.jsx)(K,{children:(0,I.jsxs)(q,{className:`pt-6`,children:[(0,I.jsx)(`div`,{className:`text-xs text-muted-foreground`,children:`Tools skipped`}),(0,I.jsx)(`div`,{className:`text-2xl font-semibold`,children:e.summary.toolsSkipped})]})}),(0,I.jsx)(K,{children:(0,I.jsxs)(q,{className:`pt-6`,children:[(0,I.jsx)(`div`,{className:`text-xs text-muted-foreground`,children:`Findings`}),(0,I.jsx)(`div`,{className:`text-2xl font-semibold`,children:e.findings.length})]})})]}),(0,I.jsxs)(K,{children:[(0,I.jsxs)(gv,{className:`pb-3`,children:[(0,I.jsx)(_v,{className:`text-base`,children:`Analysis Overview`}),(0,I.jsx)(vv,{children:`Visual breakdown of findings by severity. Click badges to filter the report.`})]}),(0,I.jsx)(q,{children:(0,I.jsxs)(`div`,{className:`flex flex-wrap gap-2`,children:[d7.filter(t=>e.summary.issueCounts[t]>0).map(t=>{let n=x.has(t);return(0,I.jsx)(`button`,{type:`button`,onClick:()=>S(t),className:`rounded-full`,"aria-pressed":n,children:(0,I.jsxs)(Y,{variant:`outline`,className:`capitalize font-normal ${n?f7(t):Zde(t)} ${n?`ring-1 ring-current`:`opacity-70`}`,children:[t,`: `,e.summary.issueCounts[t]]})},t)}),(0,I.jsx)(W,{type:`button`,size:`sm`,variant:`ghost`,onClick:()=>o([...d7]),className:`h-7 px-2 text-xs`,children:`Reset`})]})})]}),(0,I.jsxs)(`div`,{className:`space-y-0`,children:[(0,I.jsx)(CX,{value:v,onValueChange:e=>{(e===`tool`||e===`severity`)&&C(e)},className:`min-w-0 px-3 pt-1`,children:(0,I.jsxs)(`div`,{className:`flex flex-wrap items-end justify-between gap-2 border-b`,children:[(0,I.jsxs)(wX,{className:`h-auto justify-start rounded-none bg-transparent p-0`,children:[(0,I.jsx)(TX,{value:`tool`,className:`-mb-px h-10 rounded-none rounded-t border border-border border-b-border bg-muted/20 px-6 text-sm font-semibold text-muted-foreground data-[state=active]:z-10 data-[state=active]:bg-card data-[state=active]:text-foreground data-[state=active]:border-border data-[state=active]:border-b-card data-[state=active]:shadow-none`,children:`Report by Tool`}),(0,I.jsx)(TX,{value:`severity`,className:`-mb-px h-10 rounded-none rounded-t border border-border border-b-border bg-muted/20 px-6 text-sm font-semibold text-muted-foreground data-[state=active]:z-10 data-[state=active]:bg-card data-[state=active]:text-foreground data-[state=active]:border-border data-[state=active]:border-b-card data-[state=active]:shadow-none`,children:`By Severity`})]}),(0,I.jsxs)(`div`,{className:`mb-2 flex min-w-0 items-center gap-2`,children:[(0,I.jsx)(`span`,{className:`whitespace-nowrap text-xs text-muted-foreground`,children:`Filter tools`}),(0,I.jsxs)(K8,{open:d,onOpenChange:f,children:[(0,I.jsx)(q8,{asChild:!0,children:(0,I.jsxs)(W,{type:`button`,variant:`outline`,role:`combobox`,"aria-expanded":d,"aria-controls":`tool-filter-command-list`,className:`h-8 w-[320px] max-w-full justify-between text-xs font-normal`,children:[(0,I.jsx)(`span`,{className:`truncate text-left`,children:l||`All tools`}),(0,I.jsx)(on,{className:`ml-2 h-4 w-4 shrink-0 opacity-50`})]})}),(0,I.jsx)(J8,{className:`w-[320px] p-0`,align:`end`,children:(0,I.jsxs)(b5,{children:[(0,I.jsx)(x5,{placeholder:`Search tools...`}),(0,I.jsxs)(S5,{id:`tool-filter-command-list`,children:[(0,I.jsx)(C5,{children:`No tools found.`}),(0,I.jsxs)(w5,{children:[(0,I.jsx)(T5,{value:`all tools`,onSelect:()=>{u(``),f(!1)},children:`All tools`}),T.map(e=>(0,I.jsx)(T5,{value:e,onSelect:()=>{u(e),f(!1)},children:e},e))]})]})]})})]}),v===`severity`&&(0,I.jsxs)(I.Fragment,{children:[(0,I.jsx)(W,{type:`button`,variant:`outline`,size:`sm`,className:`h-8 text-xs`,onClick:k,children:`Expand all`}),(0,I.jsx)(W,{type:`button`,variant:`outline`,size:`sm`,className:`h-8 text-xs`,onClick:O,children:`Collapse all`})]}),v===`tool`&&(0,I.jsxs)(I.Fragment,{children:[(0,I.jsx)(W,{type:`button`,variant:`outline`,size:`sm`,className:`h-8 text-xs`,onClick:()=>D(!0),children:`Expand all`}),(0,I.jsx)(W,{type:`button`,variant:`outline`,size:`sm`,className:`h-8 text-xs`,onClick:()=>D(!1),children:`Collapse all`})]})]})]})}),v===`severity`?(0,I.jsx)(`div`,{className:`space-y-4`,children:d7.filter(e=>x.has(e)).map(e=>{let t=w[e].filter(e=>E(e.toolLabel));if(t.length===0)return null;let n=s.has(e);return(0,I.jsxs)(K,{children:[(0,I.jsx)(gv,{className:`pb-3`,children:(0,I.jsxs)(`div`,{className:`flex flex-wrap items-start justify-between gap-3`,children:[(0,I.jsxs)(`div`,{children:[(0,I.jsx)(_v,{className:`text-base capitalize`,children:e}),(0,I.jsxs)(vv,{children:[t.length,` finding(s)`]})]}),(0,I.jsx)(`div`,{className:`flex gap-2`,children:(0,I.jsx)(W,{type:`button`,variant:`outline`,size:`sm`,className:`h-8 text-xs`,onClick:()=>A(e),children:n?`Expand`:`Collapse`})})]})}),!n&&(0,I.jsx)(q,{className:`space-y-2`,children:t.map((e,t)=>(0,I.jsxs)(`div`,{className:`rounded border p-2 text-xs`,children:[(0,I.jsxs)(`div`,{className:`mb-1 flex items-center justify-between gap-2`,children:[(0,I.jsxs)(`div`,{className:`flex min-w-0 items-center gap-2`,children:[(0,I.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:t+1}),(0,I.jsx)(`span`,{className:`min-w-0 font-bold leading-tight`,children:e.issue.title})]}),(0,I.jsx)(Y,{variant:`outline`,className:`shrink-0 text-[10px] ${f7(e.issue.severity)}`,children:e.issue.severity})]}),(0,I.jsxs)(`p`,{children:[(0,I.jsx)(`span`,{className:`font-bold`,children:`Finding:`}),` `,e.issue.detail]}),(0,I.jsxs)(`div`,{className:`mt-2 flex flex-wrap items-center gap-2 text-[11px]`,children:[(0,I.jsx)(Y,{variant:`secondary`,className:`font-normal`,children:e.sourceLabel}),(0,I.jsx)(W,{type:`button`,variant:`ghost`,size:`sm`,className:`h-6 px-2 font-mono text-[11px]`,title:e.toolLabel,onClick:()=>{C(`tool`),requestAnimationFrame(()=>{document.getElementById(e.toolAnchorId)?.scrollIntoView({behavior:`smooth`,block:`start`})})},children:e.toolDisplayName})]}),e.issue.suggestion&&(0,I.jsx)(h7,{text:e.issue.suggestion})]},e.key))})]},e)})}):(0,I.jsx)(`div`,{ref:y,className:`space-y-4`,children:e.servers.map(e=>{let t=e.tokenEstimate,n=e.tools.filter(t=>{let n=`${e.serverName}::${t.publicToolName}`;if(!E(n))return!1;let r=[...t.metadataReview?.issues??[],...t.deeperAnalysis?.sampleCalls.flatMap(e=>e.issues)??[]];return r.length===0?a.length===d7.length:r.some(e=>x.has(e.severity))});return n.length===0?null:(0,I.jsxs)(K,{children:[(0,I.jsxs)(gv,{className:`pb-3`,children:[(0,I.jsxs)(_v,{className:`flex items-center gap-2 text-base`,children:[e.serverName,(0,I.jsx)(u7,{total:t?.total,title:`Estimated tokens for the analyzed tool definitions and their schemas`})]}),(0,I.jsxs)(vv,{children:[`Discovered `,e.toolCountDiscovered,` · Showing `,n.length,` of`,` `,e.toolCountAnalyzed,` analyzed · Skipped `,e.toolCountSkipped]})]}),(0,I.jsxs)(q,{className:`space-y-3`,children:[e.warnings.length>0&&(0,I.jsxs)(R5,{children:[(0,I.jsx)(z5,{children:`Warnings`}),(0,I.jsx)(B5,{children:(0,I.jsx)(`ul`,{className:`ml-4 list-disc space-y-1`,children:e.warnings.map(t=>(0,I.jsx)(`li`,{children:t},`${e.serverName}-${t}`))})})]}),n.map(n=>{let r=t?.tools.find(e=>e.name===n.toolName),i=n.publicToolName.split(`::`).pop()??n.publicToolName,a=n7(n.classificationReason),o=n.safetyClassification===`read_only`?`read-only`:a?`write/delete`:`unsafe/unknown`,s=n.safetyClassification===`read_only`?`border-emerald-200 bg-emerald-50 text-emerald-700`:a?`border-amber-300 bg-amber-50 text-amber-800`:`border-slate-300 bg-slate-100 text-slate-700`;return(0,I.jsxs)(`details`,{id:`tool-${p7(`${e.serverName}-${n.publicToolName}`)}`,className:`group rounded-md border p-3`,children:[(0,I.jsx)(`summary`,{className:`cursor-pointer list-none`,children:(0,I.jsxs)(`div`,{className:`space-y-1`,children:[(0,I.jsxs)(`div`,{className:`flex items-start justify-between gap-2`,children:[(0,I.jsxs)(`div`,{className:`flex min-w-0 items-center gap-2`,children:[(0,I.jsx)(`div`,{className:`min-w-0 truncate font-mono text-sm`,title:n.publicToolName,children:i}),(0,I.jsx)(Qde,{label:o,reason:n.classificationReason,variantClassName:s}),(0,I.jsx)(u7,{total:r?.total,className:`text-[10px]`})]}),(0,I.jsx)(on,{className:`h-4 w-4 shrink-0 text-muted-foreground transition-transform group-open:rotate-180`})]}),n.title&&(0,I.jsx)(`p`,{className:`text-sm text-foreground/85`,children:n.title}),n.description&&(0,I.jsx)(`p`,{className:`text-xs text-muted-foreground`,children:n.description})]})}),(0,I.jsxs)(`div`,{className:`mt-3 space-y-2`,children:[(0,I.jsxs)(`div`,{className:`flex flex-wrap gap-1.5`,children:[(0,I.jsxs)(W,{type:`button`,size:`sm`,variant:`outline`,className:`h-7 px-2 text-[11px]`,onClick:()=>void m7(`Tool info`,{server:e.serverName,name:n.publicToolName,title:n.title,description:n.description}),children:[(0,I.jsx)(vn,{className:`mr-1.5 h-3.5 w-3.5`}),`Copy Tool Info`]}),(0,I.jsxs)(W,{type:`button`,size:`sm`,variant:`outline`,className:`h-7 px-2 text-[11px]`,onClick:()=>void m7(`Schemas`,{server:e.serverName,name:n.publicToolName,inputSchema:n.inputSchema,outputSchema:n.outputSchema}),disabled:n.inputSchema===void 0&&n.outputSchema===void 0,children:[(0,I.jsx)(vn,{className:`mr-1.5 h-3.5 w-3.5`}),`Copy Schemas`]}),(0,I.jsxs)(W,{type:`button`,size:`sm`,variant:`outline`,className:`h-7 px-2 text-[11px]`,onClick:()=>void m7(`Metadata review`,{server:e.serverName,name:n.publicToolName,metadataReview:n.metadataReview}),disabled:!n.metadataReview,children:[(0,I.jsx)(vn,{className:`mr-1.5 h-3.5 w-3.5`}),`Copy Metadata Review`]})]}),(0,I.jsx)(c7,{inputSchema:n.inputSchema,outputSchema:n.outputSchema,mode:h,onModeChange:g}),n.metadataReview&&(0,I.jsxs)(`div`,{className:`space-y-1`,children:[(0,I.jsx)(`div`,{className:`text-xs font-medium`,children:`Metadata review`}),n.metadataReview.issues.filter(e=>x.has(e.severity)).length===0?(0,I.jsx)(`p`,{className:`text-xs text-muted-foreground`,children:`No metadata issues reported.`}):(0,I.jsx)(`div`,{className:`space-y-1`,children:n.metadataReview.issues.filter(e=>x.has(e.severity)).map((e,t)=>(0,I.jsxs)(`div`,{className:`rounded border p-2 text-xs`,children:[(0,I.jsxs)(`div`,{className:`mb-1 flex items-center justify-between gap-2`,children:[(0,I.jsxs)(`div`,{className:`flex min-w-0 items-center gap-2`,children:[(0,I.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:t+1}),(0,I.jsx)(`span`,{className:`min-w-0 font-bold leading-tight`,children:e.title})]}),(0,I.jsx)(Y,{variant:`outline`,className:`shrink-0 text-[10px] ${f7(e.severity)}`,children:e.severity})]}),(0,I.jsxs)(`p`,{children:[(0,I.jsx)(`span`,{className:`font-bold`,children:`Finding:`}),` `,e.detail]}),e.suggestion&&(0,I.jsx)(h7,{text:e.suggestion})]},e.id))})]}),n.deeperAnalysis&&(0,I.jsxs)(`div`,{className:`space-y-1`,children:[(0,I.jsx)(`div`,{className:`text-xs font-medium`,children:`Deeper analysis`}),n.deeperAnalysis.attempted?(0,I.jsx)(`div`,{className:`space-y-2`,children:n.deeperAnalysis.sampleCalls.map(e=>(0,I.jsxs)(`div`,{className:`rounded border p-2 text-xs`,children:[(0,I.jsxs)(`div`,{className:`mb-1 flex items-center gap-2`,children:[(0,I.jsx)(Y,{variant:e.ok?`secondary`:`destructive`,className:`text-[10px]`,children:e.ok?`ok`:`error`}),(0,I.jsxs)(`span`,{children:[`Call `,e.callIndex]}),e.durationMs!==void 0&&(0,I.jsxs)(`span`,{className:`text-muted-foreground`,children:[e.durationMs,`ms`]})]}),e.error&&(0,I.jsx)(`p`,{className:`text-destructive`,children:e.error}),e.observations.length>0&&(0,I.jsxs)(`div`,{className:`mt-2`,children:[(0,I.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`}),(0,I.jsx)(`ul`,{className:`ml-4 list-disc space-y-1`,children:e.observations.map((t,r)=>(0,I.jsx)(`li`,{children:t},`${n.publicToolName}-obs-${e.callIndex}-${r}`))})]}),e.issues.filter(e=>x.has(e.severity)).length>0&&(0,I.jsx)(`div`,{className:`mt-2 space-y-1`,children:e.issues.filter(e=>x.has(e.severity)).map((t,n)=>(0,I.jsxs)(`div`,{className:`rounded border p-2`,children:[(0,I.jsxs)(`div`,{className:`mb-1 flex items-center justify-between gap-2`,children:[(0,I.jsxs)(`div`,{className:`flex min-w-0 items-center gap-2`,children:[(0,I.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:n+1}),(0,I.jsx)(`span`,{className:`min-w-0 font-bold leading-tight`,children:t.title})]}),(0,I.jsx)(Y,{variant:`outline`,className:`shrink-0 text-[10px] ${f7(t.severity)}`,children:t.severity})]}),(0,I.jsxs)(`p`,{children:[(0,I.jsx)(`span`,{className:`font-bold`,children:`Finding:`}),` `,t.detail]}),t.suggestion&&(0,I.jsx)(h7,{text:t.suggestion})]},`${e.callIndex}-${t.id}`))})]},`${n.publicToolName}-call-${e.callIndex}`))}):(0,I.jsx)(`p`,{className:`text-xs text-muted-foreground`,children:n.deeperAnalysis.skippedReason??`Skipped`})]})]})]},n.publicToolName)})]})]},e.serverName)})})]})]})}function v7(e){return{reportId:e.reportId,createdAt:e.createdAt,tools:e.report.servers.flatMap(e=>e.tools.map(t=>({server:e.serverName,name:t.publicToolName,title:t.title,description:t.description,inputSchema:t.inputSchema,outputSchema:t.outputSchema})))}}function $de(e){let t=e.selectedToolNames?.length?new Set(e.selectedToolNames):null;return{serverName:e.serverName,tools:e.tools.filter(e=>!t||t.has(e.name)).map(e=>({name:e.name,title:e.title,description:e.description,inputSchema:e.inputSchema,outputSchema:e.outputSchema}))}}function y7(e){return e.trim().toLowerCase().replace(/[^a-z0-9._-]+/g,`-`).replace(/-+/g,`-`).replace(/^-+|-+$/g,``)}function efe(e,t){let n=[`tool-info`,y7(e)],r=t?.trim();return r&&n.push(`v${y7(r)}`),`${n.filter(Boolean).join(`-`)}.json`}function tfe(e){let t=0,n=new Set,r=new Set;for(let i of e){let e=typeof i.payload?.message==`string`?i.payload.message:``;if(!e)continue;let a=e.match(/\((\d+)\s+selected\s+of\s+\d+\s+discovered\)/i);a&&(t=Math.max(t,Number(a[1])||0));let o=e.match(/^Started\s+(.+)$/);o&&n.add(o[1]);let s=e.match(/^Finished\s+(.+)$/);s&&r.add(s[1])}let i=t>0?Math.max(0,Math.min(100,Math.round(r.size/t*100))):0;return{totalTools:t,startedTools:n.size,finishedTools:r.size,percent:i}}var b7=`mcplab.toolAnalysis.activeJobId`;function x7(e,t,n){let r=new Blob([t],{type:n}),i=URL.createObjectURL(r),a=document.createElement(`a`);a.href=i,a.download=e,a.click(),URL.revokeObjectURL(i)}async function nfe(e,t){try{await navigator.clipboard.writeText(t),O({title:`${e} copied`})}catch(t){O({title:`Could not copy ${e.toLowerCase()}`,description:t instanceof Error?t.message:String(t),variant:`destructive`})}}function S7({text:e}){return(0,I.jsxs)(_l,{children:[(0,I.jsx)(vl,{asChild:!0,children:(0,I.jsx)(`button`,{type:`button`,className:`inline-flex h-4 w-4 items-center justify-center rounded text-muted-foreground hover:text-foreground`,onClick:e=>e.preventDefault(),"aria-label":e,children:(0,I.jsx)(fn,{className:`h-3.5 w-3.5`})})}),(0,I.jsx)(yl,{className:`max-w-xs text-xs`,children:(0,I.jsx)(`p`,{children:e})})]})}function rfe(e,t){let n=t.toLowerCase();return n.includes(`failed to load tools`)||n.includes(`failed to connect to mcp server`)?`Could not load tools from '${e}'. Check that the MCP server is running and reachable, then try Refresh Servers / Discover Tools again.`:t}function ife({label:e,reason:t,variantClassName:n}){return(0,I.jsx)(gl,{delayDuration:0,children:(0,I.jsxs)(_l,{children:[(0,I.jsx)(vl,{asChild:!0,children:(0,I.jsx)(Y,{variant:`outline`,className:n,children:e})}),(0,I.jsx)(yl,{className:`max-w-sm text-xs`,children:(0,I.jsx)(`p`,{children:t})})]})})}var afe=()=>{let e=e=>`tool-analysis-${Date.now()}.${e}`,{source:t}=nv(),{servers:n,agents:r,loading:i,reload:a}=hv(),[o,s]=(0,_.useState)(``),[c,l]=(0,_.useState)([]),[u,d]=(0,_.useState)(!1),[f,p]=(0,_.useState)([]),[m,h]=(0,_.useState)({}),[g,v]=(0,_.useState)(``),[y,b]=(0,_.useState)(!0),[x,S]=(0,_.useState)(!1),[C,w]=(0,_.useState)(2),[T,E]=(0,_.useState)(1),[D,k]=(0,_.useState)(1e4),[A,j]=(0,_.useState)(null),[M,N]=(0,_.useState)([]),[P,F]=(0,_.useState)(null),[L,R]=(0,_.useState)(null),[z,ee]=(0,_.useState)(!1),[te,ne]=(0,_.useState)(`configure`),[re,ie]=(0,_.useState)(`explorer`),[ae,oe]=(0,_.useState)(`idle`),[se,ce]=(0,_.useState)(!1),B=(0,_.useRef)(null),le=(0,_.useRef)(null),ue=o||r[0]?.name||``,de=(0,_.useMemo)(()=>tfe(M),[M]);(0,_.useEffect)(()=>{let e=!0;return t.getWorkspaceSettings().then(t=>{e&&t&&s(t.assistantAgentName??``)}).catch(()=>{e&&s(``)}),()=>{e=!1}},[t]),(0,_.useEffect)(()=>()=>{B.current?.()},[]),(0,_.useEffect)(()=>{let e=le.current;e&&requestAnimationFrame(()=>{e.scrollTop=e.scrollHeight})},[M.length]);let V=()=>{try{sessionStorage.removeItem(b7)}catch{}},fe=e=>{try{sessionStorage.setItem(b7,e)}catch{}},pe=e=>{B.current?.(),B.current=t.subscribeToolAnalysisJob(e,n=>{if(N(e=>[...e,n]),n.type===`completed`)t.getToolAnalysisResult(e).then(e=>{F(e.report),R(e.savedReportId??null)}).catch(e=>O({title:`Could not load analysis report`,description:e instanceof Error?e.message:String(e),variant:`destructive`})).finally(()=>{V(),j(null),ee(!1),oe(`idle`),ne(`run`)});else if(n.type===`error`){let e=String(n.payload?.message??``);V(),oe(e.toLowerCase().includes(`abort`)?`stopped`:`error`),j(null),ee(!1)}})};(0,_.useEffect)(()=>{if(A||P)return;let e=``;try{e=sessionStorage.getItem(b7)??``}catch{e=``}if(e)return ne(`run`),oe(`running`),ee(!0),j(e),N([]),pe(e),()=>{}},[t,A,P]);let me=async()=>{if(c.length===0){p([]),h({});return}let e=c.filter(e=>n.find(t=>t.id===e)?.authType===`oauth2`);try{e.length>0&&(ce(!0),await e6({serverNames:e,source:t,onServerAuthStart:e=>{O({title:`OAuth login required for ${e}`,description:`Complete login in the opened browser tab. Discovery will continue automatically.`})}}))}catch(e){O({title:`OAuth login failed`,description:e instanceof Error?e.message:String(e),variant:`destructive`}),ce(!1);return}finally{ce(!1)}d(!0);try{let e=await t.discoverToolsForAnalysis({serverNames:c});p(e.servers),h(t=>{let n={};for(let r of e.servers){let e=t[r.serverName]??[],i=r.tools.map(e=>e.name),a=e.filter(e=>i.includes(e));n[r.serverName]=a.length>0?a:i}return n})}catch(e){O({title:`Could not discover MCP tools`,description:e instanceof Error?e.message:String(e),variant:`destructive`})}finally{d(!1)}};(0,_.useEffect)(()=>{me()},[c.join(`|`)]);let he=(0,_.useMemo)(()=>{let e=g.trim().toLowerCase();return e?f.map(t=>({...t,tools:t.tools.filter(t=>t.name.toLowerCase().includes(e)||(t.description||``).toLowerCase().includes(e))})).filter(e=>e.tools.length>0):f},[f,g]),ge=(0,_.useMemo)(()=>Object.values(m).reduce((e,t)=>e+t.length,0),[m]),_e=(0,_.useMemo)(()=>Xde(f,m),[f,m]),ve=c[0]??``,ye=async()=>{if(!y&&!x)O({title:`Select at least one mode`,variant:`destructive`});else if(c.length!==1)O({title:`Select exactly one server`,variant:`destructive`});else if(ge===0)O({title:`Select at least one tool`,variant:`destructive`});else{ee(!0),N([]),F(null),R(null),ne(`run`),oe(`running`);try{let e=c[0];n.find(t=>t.id===e)?.authType===`oauth2`&&(ce(!0),await e6({serverNames:[e],source:t,onServerAuthStart:e=>{O({title:`OAuth login required for ${e}`,description:`Complete login in the opened browser tab. Analysis will continue automatically.`})}}));let{jobId:r}=await t.startToolAnalysis({serverNames:c,selectedToolsByServer:m,maxParallelTools:C,modes:{metadataReview:y,deeperAnalysis:x},deeperAnalysisOptions:{autoRunPolicy:`read_only_allowlist`,sampleCallsPerTool:T,toolCallTimeoutMs:D}});j(r),fe(r),pe(r)}catch(e){ee(!1),oe(`error`),ne(`run`),O({title:`Could not start tool analysis`,description:e instanceof Error?e.message:String(e),variant:`destructive`})}finally{ce(!1)}}},be=()=>{let e=c[0],t=f.find(t=>t.serverName===e);if(!e||!t){O({title:`No discovered tool info available`,description:`Select a server and discover tools before downloading tool info.`,variant:`destructive`});return}let n=$de({serverName:t.serverName,tools:t.tools,selectedToolNames:m[t.serverName]});x7(efe(t.serverName,t.mcpServerVersion),`${JSON.stringify(n,null,2)}\n`,`application/json`)},xe=async()=>{if(!A)return;let e=A;try{let n=await t.stopToolAnalysis(e);if(n.status===`completed`){B.current?.(),B.current=null;let n=await t.getToolAnalysisResult(e);F(n.report),R(n.savedReportId??null),V(),j(null),ee(!1),oe(`idle`),ne(`run`),O({title:`Analysis already finished`,description:`Showing the result overview.`});return}if(n.status===`stopped`){B.current?.(),B.current=null,V(),j(null),ee(!1),oe(`stopped`),O({title:`Analysis stopped`});return}if(n.status===`error`){B.current?.(),B.current=null,V(),j(null),ee(!1),oe(`error`),O({title:`Analysis already ended with an error`,description:`Review the progress log and return to Configure Analysis.`});return}O({title:`Stopping analysis...`})}catch(e){O({title:`Could not stop analysis`,description:e instanceof Error?e.message:String(e),variant:`destructive`})}},Se=()=>{ne(`configure`),oe(`idle`),j(null)},Ce=(e,t)=>{l(n=>t?[e]:n.filter(t=>t!==e))},we=(e,t,n)=>{h(r=>{let i=new Set(r[e]??[]);return n?i.add(t):i.delete(t),{...r,[e]:Array.from(i)}})},Te=(e,t)=>{h(n=>({...n,[e]:t}))},Ee=A!==null||M.length>0||ae===`stopped`||ae===`error`,De=!!P,Oe=e=>{e===`configure`?ne(`configure`):e===`run`&&Ee?ne(`run`):e===`report`&&De&&ne(`report`)};return(0,I.jsxs)(`div`,{className:`space-y-6`,children:[(0,I.jsxs)(`div`,{className:`flex items-start justify-between gap-2`,children:[(0,I.jsxs)(`div`,{children:[(0,I.jsxs)(`h1`,{className:`inline-flex items-center gap-2 text-2xl font-bold`,children:[(0,I.jsx)(Bn,{className:`h-6 w-6`}),`Analyze MCP Tools`]}),(0,I.jsx)(`p`,{className:`text-sm text-muted-foreground`,children:`Review MCP tools for schema quality, ergonomics, and agent/eval readiness.`})]}),(0,I.jsxs)(`div`,{className:`hidden flex-wrap items-center gap-2 md:flex`,children:[(0,I.jsx)(`button`,{type:`button`,onClick:()=>Oe(`configure`),className:`rounded-full`,"aria-label":`Open Configure Analysis`,children:(0,I.jsx)(Y,{variant:te===`configure`?`default`:`outline-solid`,className:`cursor-pointer`,children:`Configure Analysis`})}),(0,I.jsx)(`button`,{type:`button`,onClick:()=>Oe(`run`),disabled:!Ee,className:`rounded-full disabled:cursor-not-allowed disabled:opacity-60`,"aria-label":`Open Run Analysis`,children:(0,I.jsx)(Y,{variant:te===`run`?`default`:`outline-solid`,className:Ee?`cursor-pointer`:`cursor-not-allowed`,children:`Run Analysis`})}),(0,I.jsx)(`button`,{type:`button`,onClick:()=>Oe(`report`),disabled:!De,className:`rounded-full disabled:cursor-not-allowed disabled:opacity-60`,"aria-label":`Open Report`,children:(0,I.jsx)(Y,{variant:te===`report`?`default`:`outline-solid`,className:De?`cursor-pointer`:`cursor-not-allowed`,children:`Report`})})]})]}),te===`configure`&&(0,I.jsxs)(K,{children:[(0,I.jsxs)(gv,{children:[(0,I.jsx)(_v,{className:`text-base`,children:`Run MCP analysis`}),(0,I.jsx)(vv,{children:`Select servers and tools, choose metadata review and/or deeper sample-call analysis, then run the report.`})]}),(0,I.jsxs)(q,{className:`space-y-5`,children:[!ue&&(0,I.jsxs)(R5,{children:[(0,I.jsx)(z5,{children:`No assistant agent available`}),(0,I.jsxs)(B5,{children:[`Add a library agent in`,` `,(0,I.jsx)(np,{to:`/libraries/agents`,className:`underline`,children:`Agents`}),` `,`and optionally set the default Assistant Agent in`,` `,(0,I.jsx)(np,{to:`/settings`,className:`underline`,children:`Settings`}),`.`]})]}),(0,I.jsxs)(`div`,{className:`space-y-2`,children:[(0,I.jsxs)(`div`,{className:`flex items-center justify-between gap-2`,children:[(0,I.jsx)(Q,{className:`text-xs`,children:`Servers`}),(0,I.jsxs)(W,{type:`button`,size:`sm`,variant:`outline`,onClick:()=>void a(),disabled:i||se,children:[(0,I.jsx)(Qn,{className:`mr-2 h-4 w-4`}),`Refresh Servers`]})]}),(0,I.jsx)(`div`,{className:`grid gap-2 rounded-md border p-3 md:grid-cols-2`,children:n.length===0?(0,I.jsx)(`p`,{className:`text-sm text-muted-foreground`,children:`No library servers configured.`}):n.map(e=>{let t=c.includes(e.id);return(0,I.jsxs)(`label`,{className:`flex items-start gap-2 rounded-md border p-2 text-sm`,children:[(0,I.jsx)(KX,{checked:t,onCheckedChange:t=>Ce(e.id,!!t)}),(0,I.jsxs)(`div`,{className:`min-w-0`,children:[(0,I.jsx)(`div`,{className:`font-medium`,children:e.name||e.id}),e.url&&(0,I.jsx)(`div`,{className:`truncate text-xs text-muted-foreground`,children:e.url})]})]},e.id)})}),(0,I.jsx)(`p`,{className:`text-xs text-muted-foreground`,children:`Select exactly one MCP server for analysis.`})]}),(0,I.jsxs)(`div`,{className:`space-y-2`,children:[(0,I.jsx)(Q,{className:`text-xs`,children:`Filter visible tools`}),(0,I.jsxs)(`div`,{className:`relative`,children:[(0,I.jsx)(er,{className:`pointer-events-none absolute left-2.5 top-1/2 h-3.5 w-3.5 -translate-y-1/2 text-muted-foreground`}),(0,I.jsx)(Op,{className:`h-9 pl-8`,placeholder:`Filter tools by name or description...`,value:g,onChange:e=>v(e.target.value)})]}),(0,I.jsx)(`p`,{className:`text-xs text-muted-foreground`,children:`Filtering only changes what is shown; selected tools remain selected.`})]}),(0,I.jsxs)(`div`,{className:`space-y-2`,children:[(0,I.jsxs)(`div`,{className:`flex items-center justify-between gap-2`,children:[(0,I.jsx)(Q,{className:`text-xs`,children:ve?`Tools for ${ve}`:`Tools`}),(0,I.jsxs)(`div`,{className:`ml-auto flex flex-wrap items-center gap-2`,children:[(0,I.jsxs)(W,{type:`button`,size:`sm`,variant:`outline`,onClick:be,disabled:u||se||c.length===0||f.length===0,children:[(0,I.jsx)(yn,{className:`mr-2 h-4 w-4`}),`Download Tool Info`]}),(0,I.jsxs)(W,{type:`button`,size:`sm`,variant:`outline`,onClick:()=>void me(),disabled:u||se||c.length===0,children:[u&&(0,I.jsx)(zn,{className:`mr-2 h-4 w-4 animate-spin`}),`Discover Tools`]})]})]}),(0,I.jsx)(`div`,{className:`space-y-3 rounded-md border p-3`,children:c.length===0?(0,I.jsx)(`p`,{className:`text-sm text-muted-foreground`,children:`Select a server to discover tools.`}):u&&f.length===0?(0,I.jsx)(`p`,{className:`text-sm text-muted-foreground`,children:`Loading tools...`}):he.length===0&&!u?(0,I.jsx)(`p`,{className:`text-sm text-muted-foreground`,children:`No discovered tools match the current filters.`}):he.map(e=>{let t=new Set(m[e.serverName]??[]);return(0,I.jsxs)(`div`,{className:`rounded-md border p-3`,children:[(0,I.jsxs)(`div`,{className:`mb-2 flex items-center justify-between gap-2`,children:[(0,I.jsxs)(`div`,{className:`flex min-w-0 items-center gap-2`,children:[(0,I.jsx)(`div`,{className:`font-medium`,children:e.serverName}),(0,I.jsx)(u7,{total:e.tokenEstimate?.total,title:`Estimated tokens for all discovered tool definitions and their schemas`})]}),(0,I.jsxs)(`div`,{className:`flex items-center gap-2`,children:[(0,I.jsxs)(W,{type:`button`,size:`sm`,variant:`ghost`,onClick:()=>void nfe(`Tool list`,`${JSON.stringify({server:e.serverName,tools:e.tools.map(e=>({name:e.name,title:e.title,description:e.description}))},null,2)}\n`),children:[(0,I.jsx)(vn,{className:`mr-1.5 h-3.5 w-3.5`}),`Copy`]}),(0,I.jsx)(W,{type:`button`,size:`sm`,variant:`ghost`,onClick:()=>Te(e.serverName,e.tools.map(e=>e.name)),children:`Select all`}),(0,I.jsx)(W,{type:`button`,size:`sm`,variant:`ghost`,onClick:()=>Te(e.serverName,[]),children:`Clear`})]})]}),e.warnings.length>0&&(0,I.jsx)(`div`,{className:`mb-2 space-y-1`,children:e.warnings.map(t=>(0,I.jsx)(`div`,{className:`text-xs text-amber-700`,children:rfe(e.serverName,t)},`${e.serverName}-${t}`))}),(0,I.jsx)(`div`,{className:`grid gap-2`,children:e.tools.map(n=>{let r=e.tokenEstimate?.tools.find(e=>e.name===n.name),i=n7(n.classificationReason),a=n.safetyClassification===`read_only`?`read-only`:i?`write/delete`:`unsafe/unknown`,o=n.safetyClassification===`read_only`?`border-emerald-200 bg-emerald-50 text-emerald-700`:i?`border-amber-300 bg-amber-50 text-amber-800`:`border-slate-300 bg-slate-100 text-slate-700`;return(0,I.jsxs)(`label`,{className:`flex items-start gap-2 rounded border p-2`,children:[(0,I.jsx)(KX,{checked:t.has(n.name),onCheckedChange:t=>we(e.serverName,n.name,!!t)}),(0,I.jsxs)(`div`,{className:`min-w-0 flex-1 space-y-1`,children:[(0,I.jsxs)(`div`,{className:`flex items-center gap-2 flex-wrap`,children:[(0,I.jsx)(`span`,{className:`font-mono text-xs`,children:n.name}),n.title&&(0,I.jsx)(`span`,{className:`text-xs text-muted-foreground`,children:n.title}),(0,I.jsx)(ife,{label:a,reason:n.classificationReason,variantClassName:o}),n.inputSchema&&(0,I.jsx)(Y,{variant:`outline`,className:`border-border text-[10px] text-muted-foreground`,children:`schema: input`}),n.outputSchema&&(0,I.jsx)(Y,{variant:`outline`,className:`border-border text-[10px] text-muted-foreground`,children:`schema: output`}),(0,I.jsx)(u7,{total:r?.total,className:`text-[10px]`})]}),n.description&&(0,I.jsx)(`p`,{className:`text-xs text-muted-foreground line-clamp-2`,children:n.description}),(0,I.jsx)(c7,{inputSchema:n.inputSchema,outputSchema:n.outputSchema,mode:re,onModeChange:ie})]})]},`${e.serverName}-${n.name}`)})})]},e.serverName)})}),(0,I.jsxs)(`p`,{className:`text-xs text-muted-foreground`,children:[`Selected tools: `,ge,_e!==void 0&&` · estimated context: ~${l7(_e)} tokens`]})]}),(0,I.jsxs)(`div`,{className:`space-y-3 rounded-md border p-3`,children:[(0,I.jsx)(`div`,{className:`text-sm font-medium`,children:`Analysis Modes`}),(0,I.jsxs)(`label`,{className:`flex items-center gap-2 text-sm`,children:[(0,I.jsx)(KX,{checked:y,onCheckedChange:e=>b(!!e)}),(0,I.jsxs)(`span`,{className:`inline-flex items-center gap-1.5`,children:[`Metadata / schema review`,(0,I.jsx)(S7,{text:`No tool execution. Reviews tool names, descriptions, and schemas only.`})]})]}),(0,I.jsxs)(`label`,{className:`flex items-center gap-2 text-sm`,children:[(0,I.jsx)(KX,{checked:x,onCheckedChange:e=>S(!!e)}),(0,I.jsxs)(`span`,{className:`inline-flex items-center gap-1.5`,children:[`Deeper analysis`,(0,I.jsx)(S7,{text:`Runs sample MCP tool calls automatically for read-only tools only (based on the safety allowlist).`})]})]}),(0,I.jsxs)(`div`,{className:`grid gap-3 rounded-md border bg-muted/20 p-3 md:grid-cols-3`,children:[(0,I.jsxs)(`div`,{className:`space-y-1`,children:[(0,I.jsx)(Q,{className:`text-xs`,children:`Max parallel tools`}),(0,I.jsx)(Op,{type:`number`,min:1,max:8,value:C,onChange:e=>w(Math.max(1,Math.min(8,Number(e.target.value)||2))),className:`h-8`})]}),x?(0,I.jsxs)(I.Fragment,{children:[(0,I.jsxs)(`div`,{className:`space-y-1`,children:[(0,I.jsx)(Q,{className:`text-xs`,children:`Safety profile`}),(0,I.jsx)(`div`,{className:`text-sm`,children:`Read-only allowlist only`})]}),(0,I.jsxs)(`div`,{className:`space-y-1`,children:[(0,I.jsx)(Q,{className:`text-xs`,children:`Sample calls per tool`}),(0,I.jsx)(Op,{type:`number`,min:1,max:5,value:T,onChange:e=>E(Math.max(1,Math.min(5,Number(e.target.value)||1))),className:`h-8`})]}),(0,I.jsxs)(`div`,{className:`space-y-1`,children:[(0,I.jsx)(Q,{className:`text-xs`,children:`Tool call timeout (ms)`}),(0,I.jsx)(Op,{type:`number`,min:1e3,max:6e4,step:500,value:D,onChange:e=>k(Math.max(1e3,Math.min(6e4,Number(e.target.value)||1e4))),className:`h-8`})]}),(0,I.jsx)(`div`,{className:`md:col-span-3 text-xs text-amber-700`,children:`Deeper analysis may execute read-only MCP tools automatically.`})]}):null]})]}),(0,I.jsx)(`div`,{className:`flex flex-wrap items-center gap-2`,children:(0,I.jsxs)(W,{type:`button`,onClick:()=>void ye(),disabled:z||se||!!A,children:[(z||!!A)&&(0,I.jsx)(zn,{className:`mr-2 h-4 w-4 animate-spin`}),`Analyze Tools`]})})]})]}),te===`run`&&(0,I.jsxs)(K,{children:[(0,I.jsx)(gv,{className:`pb-3`,children:(0,I.jsxs)(`div`,{className:`flex items-start justify-between gap-2`,children:[(0,I.jsxs)(`div`,{children:[(0,I.jsx)(_v,{className:`flex items-center gap-2 text-base`,children:(0,I.jsx)(`span`,{children:`Progress`})}),(0,I.jsx)(vv,{children:A?`Live tool-analysis job events:`:P?`Analysis finished. Review the summary below or open the saved report details.`:ae===`stopped`?`Analysis was stopped. You can return to Configure Analysis.`:ae===`error`?`Analysis ended with an error. Review the log and go back to Configure Analysis.`:`Analysis finished.`})]}),A?(0,I.jsx)(W,{type:`button`,size:`sm`,variant:`outline`,onClick:()=>void xe(),children:`Stop Analysis`}):(0,I.jsx)(W,{type:`button`,size:`sm`,variant:`outline`,onClick:Se,children:`Back to Configure Analysis`})]})}),(0,I.jsxs)(q,{className:`space-y-2`,children:[A&&(0,I.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:[(0,I.jsx)(zn,{className:`h-3.5 w-3.5 animate-spin`}),`Analysis is still running...`]}),(de.totalTools>0||A)&&(0,I.jsxs)(`div`,{className:`space-y-1.5`,children:[(0,I.jsxs)(`div`,{className:`flex items-center justify-between text-xs text-muted-foreground`,children:[(0,I.jsx)(`span`,{children:de.totalTools>0?`${de.finishedTools}/${de.totalTools} tools finished`:`Preparing analysis...`}),(0,I.jsx)(`span`,{children:de.totalTools>0?`${de.percent}%`:`0%`})]}),(0,I.jsx)(t7,{value:de.totalTools>0?de.percent:0,className:`h-2`})]}),M.length===0?(0,I.jsx)(`p`,{className:`text-sm text-muted-foreground`,children:A?`Starting analysis...`:`No progress events captured.`}):(0,I.jsx)(`div`,{ref:le,className:`max-h-64 space-y-1 overflow-auto rounded border bg-muted/20 p-2`,children:M.map((e,t)=>(0,I.jsxs)(`div`,{className:`text-xs`,children:[(0,I.jsx)(`span`,{className:`mr-2 font-mono text-muted-foreground`,children:new Date(e.ts).toLocaleTimeString()}),(0,I.jsx)(Y,{variant:`outline`,className:`mr-2 text-[10px]`,children:e.type}),(0,I.jsx)(`span`,{className:`break-all`,children:typeof e.payload.message==`string`?e.payload.message:JSON.stringify(e.payload)})]},`${e.ts}-${t}`))}),!A&&P&&(0,I.jsx)(K,{className:`mt-2 border-green-200 bg-green-50/40 dark:border-green-900/40 dark:bg-green-950/10`,children:(0,I.jsxs)(q,{className:`pt-4 space-y-3`,children:[(0,I.jsxs)(`div`,{className:`flex flex-wrap items-start justify-between gap-3`,children:[(0,I.jsxs)(`div`,{children:[(0,I.jsx)(`div`,{className:`text-sm font-semibold`,children:`Result overview`}),(0,I.jsxs)(`p`,{className:`text-xs text-muted-foreground`,children:[P.summary.toolsAnalyzed,` tools analyzed, `,P.summary.toolsSkipped,` `,`skipped, across `,P.summary.serversAnalyzed,` server`,P.summary.serversAnalyzed===1?``:`s`,`.`]})]}),(0,I.jsxs)(`div`,{className:`flex flex-wrap items-center gap-2`,children:[L&&(0,I.jsx)(W,{asChild:!0,size:`sm`,children:(0,I.jsx)(np,{to:`/tool-analysis-results/${L}`,children:`Open result details`})}),(0,I.jsx)(W,{asChild:!0,size:`sm`,variant:`outline`,children:(0,I.jsx)(np,{to:`/tool-analysis-results`,children:`View all results`})}),(0,I.jsx)(W,{type:`button`,size:`sm`,variant:`outline`,onClick:()=>Oe(`report`),children:`View inline report`})]})]}),(0,I.jsxs)(`div`,{className:`flex flex-wrap gap-2`,children:[P.summary.issueCounts.critical>0&&(0,I.jsxs)(Y,{className:`bg-red-600 text-white hover:bg-red-600`,children:[`Critical: `,P.summary.issueCounts.critical]}),P.summary.issueCounts.high>0&&(0,I.jsxs)(Y,{className:`bg-orange-500 text-white hover:bg-orange-500`,children:[`High: `,P.summary.issueCounts.high]}),P.summary.issueCounts.medium>0&&(0,I.jsxs)(Y,{className:`bg-amber-500 text-white hover:bg-amber-500`,children:[`Medium: `,P.summary.issueCounts.medium]}),P.summary.issueCounts.low>0&&(0,I.jsxs)(Y,{className:`bg-blue-500 text-white hover:bg-blue-500`,children:[`Low: `,P.summary.issueCounts.low]}),P.summary.issueCounts.info>0&&(0,I.jsxs)(Y,{variant:`outline`,children:[`Info: `,P.summary.issueCounts.info]}),Object.values(P.summary.issueCounts).every(e=>e===0)&&(0,I.jsx)(Y,{className:`bg-green-600 text-white hover:bg-green-600`,children:`No findings`})]})]})})]})]}),te===`report`&&P&&(0,I.jsxs)(`div`,{className:`space-y-4`,children:[(0,I.jsxs)(`div`,{className:`flex flex-wrap items-center justify-between gap-2`,children:[(0,I.jsxs)(`div`,{children:[(0,I.jsx)(`h2`,{className:`text-xl font-semibold`,children:`Report`}),(0,I.jsxs)(`p`,{className:`text-sm text-muted-foreground`,children:[P.summary.toolsAnalyzed,` tools analyzed across`,` `,P.summary.serversAnalyzed,` server`,P.summary.serversAnalyzed===1?``:`s`,`.`]})]}),(0,I.jsxs)(`div`,{className:`flex items-center gap-2`,children:[(0,I.jsx)(W,{type:`button`,size:`sm`,variant:`outline`,onClick:Se,children:`Back to Configure Analysis`}),L&&(0,I.jsxs)(I.Fragment,{children:[(0,I.jsx)(W,{asChild:!0,type:`button`,size:`sm`,variant:`outline`,children:(0,I.jsx)(np,{to:`/tool-analysis-results/${L}`,children:`Open saved report`})}),(0,I.jsx)(W,{asChild:!0,type:`button`,size:`sm`,variant:`outline`,children:(0,I.jsx)(np,{to:`/tool-analysis-results`,children:`View all reports`})})]}),(0,I.jsxs)(W,{type:`button`,size:`sm`,variant:`outline`,onClick:()=>x7(e(`json`),`${JSON.stringify(P,null,2)}\n`,`application/json`),children:[(0,I.jsx)(yn,{className:`mr-2 h-4 w-4`}),`Export JSON`]}),(0,I.jsxs)(W,{type:`button`,size:`sm`,variant:`outline`,onClick:()=>x7(e(`md`),g7(P),`text/markdown`),children:[(0,I.jsx)(yn,{className:`mr-2 h-4 w-4`}),`Export Markdown`]})]})]}),(0,I.jsx)(_7,{report:P,schemaMode:re,onSchemaModeChange:ie})]})]})};function C7({versions:e,showPrefix:t=!0,className:n}){let r=Object.entries(e??{}).sort((e,t)=>e[0].localeCompare(t[0])).map(([e,t])=>`${e}@${t??`unknown`}`).join(`, `);return r?(0,I.jsx)(gl,{delayDuration:0,children:(0,I.jsxs)(_l,{children:[(0,I.jsx)(vl,{asChild:!0,children:(0,I.jsxs)(`span`,{tabIndex:0,className:U(`inline-flex max-w-[18rem] min-w-0 items-center rounded-sm border border-border/60 bg-muted/30 px-1.5 py-1 text-[11px] leading-none text-muted-foreground`,n),children:[t?(0,I.jsx)(`span`,{className:`font-medium`,children:`MCP:`}):null,(0,I.jsx)(`span`,{className:U(t?`ml-1`:``,`min-w-0 truncate font-mono`),children:r})]})}),(0,I.jsx)(yl,{className:`max-w-md wrap-break-word text-xs`,children:(0,I.jsx)(`span`,{className:`font-mono`,children:r})})]})}):null}function w7(e){let[t,n]=(0,_.useState)(0),[r,i]=(0,_.useState)(!1),[a,o]=(0,_.useState)(0),s=(0,_.useCallback)(()=>{n(t=>Math.max(0,t-e))},[e]),c=(0,_.useCallback)(()=>{n(t=>t+e)},[e]),l=(0,_.useCallback)(()=>n(0),[]),u=(0,_.useCallback)(e=>{i(e.has_more),o(e.total_count)},[]),d=(0,_.useCallback)(e=>a<=0||e<=0?`Showing 0 of 0`:`Showing ${t+1}-${Math.min(t+e,a)} of ${a}`,[t,a]);return(0,_.useMemo)(()=>({limit:e,offset:t,hasMore:r,totalCount:a,setOffset:n,setHasMore:i,setTotalCount:o,prev:s,next:c,reset:l,updateMeta:u,rangeLabel:d}),[r,e,c,t,s,d,l,a,u])}function T7(e,t,n){let r=new Blob([t],{type:n}),i=URL.createObjectURL(r),a=document.createElement(`a`);a.href=i,a.download=e,a.click(),URL.revokeObjectURL(i)}function ofe(){let{source:e}=nv(),[t,n]=(0,_.useState)([]),[r,i]=(0,_.useState)(!0),[a,o]=(0,_.useState)(null),[s,c]=(0,_.useState)(!1),[l,u]=(0,_.useState)(`all`),[d,f]=(0,_.useState)(!1),[p,m]=(0,_.useState)([]),h=w7(100),{offset:g,hasMore:v}=h,y=async()=>{i(!0);try{if(e.listToolAnalysisResultsPage){let t=await e.listToolAnalysisResultsPage({limit:100,offset:g,server:l===`all`?void 0:l});n(t.data),h.updateMeta(t)}else n(await e.listToolAnalysisResults({limit:100,offset:g,server:l===`all`?void 0:l}))}catch(e){O({title:`Could not load tool analysis results`,description:e instanceof Error?e.message:String(e),variant:`destructive`})}finally{i(!1)}};(0,_.useEffect)(()=>{y()},[g,l]),(0,_.useEffect)(()=>{e.listToolAnalysisServers&&e.listToolAnalysisServers().then(e=>m(e)).catch(()=>{m([])})},[e]),(0,_.useEffect)(()=>{e.listToolAnalysisServers||m(Array.from(new Set(t.flatMap(e=>e.serverNames))).sort((e,t)=>e.localeCompare(t)))},[t,e]),(0,_.useEffect)(()=>{h.reset()},[h.reset,l]);let b=(0,_.useMemo)(()=>t.find(e=>e.reportId===a)??null,[t,a]),x=async()=>{if(a){c(!0);try{await e.deleteToolAnalysisSavedResult(a),n(e=>e.filter(e=>e.reportId!==a)),O({title:`Tool analysis report deleted`}),o(null)}catch(e){O({title:`Could not delete report`,description:e instanceof Error?e.message:String(e),variant:`destructive`})}finally{c(!1)}}},S=async(t,n)=>{try{let r=await e.getToolAnalysisSavedResult(t);n===`json`?T7(`${t}.json`,`${JSON.stringify(r,null,2)}\n`,`application/json`):n===`tool_schemas`?T7(`${t}-tool-schemas.json`,`${JSON.stringify(v7(r),null,2)}\n`,`application/json`):T7(`${t}.md`,g7(r.report),`text/markdown`)}catch(e){O({title:`Could not export saved report`,description:e instanceof Error?e.message:String(e),variant:`destructive`})}};return(0,I.jsxs)(`div`,{className:`space-y-6`,children:[(0,I.jsxs)(`div`,{className:`flex items-start justify-between gap-3`,children:[(0,I.jsxs)(`div`,{children:[(0,I.jsxs)(`h1`,{className:`inline-flex items-center gap-2 text-2xl font-bold`,children:[(0,I.jsx)(Hn,{className:`h-6 w-6`}),`Tool Analysis Results`]}),(0,I.jsx)(`p`,{className:`text-sm text-muted-foreground`,children:`Browse persisted Analyze MCP Tools reports.`})]}),(0,I.jsxs)(`div`,{className:`flex items-center gap-2`,children:[(0,I.jsxs)(`div`,{className:`flex items-center gap-2`,children:[(0,I.jsx)(`span`,{className:`text-xs text-muted-foreground`,children:`MCP server`}),(0,I.jsxs)(K8,{open:d,onOpenChange:f,children:[(0,I.jsx)(q8,{asChild:!0,children:(0,I.jsxs)(W,{type:`button`,variant:`outline`,role:`combobox`,"aria-expanded":d,"aria-controls":`tool-analysis-server-command-list`,className:`h-9 w-[240px] justify-between font-normal ${l===`all`?``:`border-primary/40`}`,children:[(0,I.jsx)(`span`,{className:`truncate text-left`,children:l===`all`?`All servers`:l}),(0,I.jsx)(on,{className:`ml-2 h-4 w-4 shrink-0 opacity-50`})]})}),(0,I.jsx)(J8,{className:`w-[240px] p-0`,align:`start`,children:(0,I.jsxs)(b5,{children:[(0,I.jsx)(x5,{placeholder:`Search MCP servers...`}),(0,I.jsxs)(S5,{id:`tool-analysis-server-command-list`,children:[(0,I.jsx)(C5,{children:`No servers found.`}),(0,I.jsxs)(w5,{children:[(0,I.jsx)(T5,{value:`all servers`,onSelect:()=>{u(`all`),f(!1)},children:`All servers`}),p.map(e=>(0,I.jsx)(T5,{value:e,onSelect:()=>{u(e),f(!1)},children:e},e))]})]})]})})]})]}),(0,I.jsx)(W,{variant:`outline`,onClick:()=>void y(),disabled:r,children:r?`Refreshing...`:`Refresh`}),(0,I.jsx)(W,{variant:`outline`,onClick:h.prev,disabled:r||g===0,children:`Prev`}),(0,I.jsx)(W,{variant:`outline`,onClick:h.next,disabled:r||!v,children:`Next`}),(0,I.jsx)(W,{asChild:!0,variant:`outline`,children:(0,I.jsx)(np,{to:`/tool-analysis`,children:`Analyze MCP Tools`})})]})]}),(0,I.jsx)(`p`,{className:`text-xs text-muted-foreground`,children:h.rangeLabel(t.length)}),(0,I.jsx)(K,{children:(0,I.jsx)(q,{className:`p-0`,children:r?(0,I.jsx)(`p`,{className:`p-6 text-sm text-muted-foreground`,children:`Loading tool analysis results...`}):t.length===0?(0,I.jsx)(`p`,{className:`p-6 text-sm text-muted-foreground`,children:`No saved tool analysis reports yet.`}):(0,I.jsxs)(I.Fragment,{children:[(0,I.jsx)(`div`,{className:`border-b px-4 py-3`,children:(0,I.jsxs)(`p`,{className:`text-xs text-muted-foreground`,children:[`Showing `,(0,I.jsx)(`span`,{className:`font-medium text-foreground`,children:t.length}),` `,`reports`]})}),t.length===0?(0,I.jsx)(`p`,{className:`p-6 text-sm text-muted-foreground`,children:`No reports for the selected MCP server.`}):(0,I.jsxs)(bv,{children:[(0,I.jsx)(xv,{children:(0,I.jsxs)(wv,{children:[(0,I.jsx)(Tv,{children:`Report ID`}),(0,I.jsx)(Tv,{children:`Evaluated`}),(0,I.jsx)(Tv,{children:`Timestamp`}),(0,I.jsx)(Tv,{children:`Issues`}),(0,I.jsx)(Tv,{children:`Modes`}),(0,I.jsx)(Tv,{className:`w-10`})]})}),(0,I.jsx)(Sv,{children:t.map(e=>(0,I.jsxs)(wv,{children:[(0,I.jsx)(J,{children:(0,I.jsxs)(`div`,{className:`space-y-1`,children:[(0,I.jsx)(np,{to:`/tool-analysis-results/${e.reportId}`,className:`font-mono text-xs text-primary hover:underline`,children:e.reportId}),(0,I.jsx)(`div`,{className:`text-[11px] text-muted-foreground`,children:e.assistantAgentName})]})}),(0,I.jsx)(J,{className:`text-[11px] text-muted-foreground`,children:(0,I.jsxs)(`div`,{className:`space-y-0.5`,children:[(0,I.jsxs)(`div`,{children:[`Servers:`,` `,(0,I.jsx)(`span`,{className:`font-medium text-foreground`,children:e.serverNames.length}),` `,`· Tools:`,` `,(0,I.jsx)(`span`,{className:`font-medium text-foreground`,children:e.summary.toolsAnalyzed}),` · `,`Skipped:`,` `,(0,I.jsx)(`span`,{className:`font-medium text-foreground`,children:e.summary.toolsSkipped})]}),Object.keys(e.mcpServerVersions??{}).length>0?(0,I.jsx)(C7,{versions:e.mcpServerVersions,showPrefix:!1}):(0,I.jsxs)(`div`,{className:`font-mono text-xs text-foreground/80`,children:[e.serverNames.slice(0,2).join(`, `),e.serverNames.length>2?` +${e.serverNames.length-2}`:``]})]})}),(0,I.jsx)(J,{className:`text-xs text-muted-foreground`,children:(0,I.jsxs)(`div`,{className:`flex items-center gap-1`,children:[(0,I.jsx)(_n,{className:`h-3 w-3`}),new Date(e.createdAt).toLocaleString()]})}),(0,I.jsx)(J,{children:(0,I.jsxs)(`div`,{className:`flex flex-wrap gap-1`,children:[[`critical`,`high`,`medium`,`low`,`info`].map(t=>e.summary.issueCounts[t]>0?(0,I.jsxs)(Y,{variant:`outline`,className:`capitalize`,children:[t,`: `,e.summary.issueCounts[t]]},`${e.reportId}-${t}`):null),Object.values(e.summary.issueCounts).every(e=>e===0)&&(0,I.jsx)(Y,{variant:`outline`,children:`No issues`})]})}),(0,I.jsx)(J,{children:(0,I.jsxs)(`div`,{className:`flex flex-wrap gap-1`,children:[e.modes.metadataReview&&(0,I.jsx)(Y,{variant:`outline`,children:`metadata`}),e.modes.deeperAnalysis&&(0,I.jsx)(Y,{variant:`outline`,children:`deeper`})]})}),(0,I.jsx)(J,{children:(0,I.jsxs)(Rq,{children:[(0,I.jsx)(zq,{asChild:!0,children:(0,I.jsx)(W,{variant:`ghost`,size:`icon`,className:`h-8 w-8`,children:(0,I.jsx)(xn,{className:`h-4 w-4`})})}),(0,I.jsxs)(Hq,{align:`end`,children:[(0,I.jsx)(Uq,{asChild:!0,children:(0,I.jsx)(np,{to:`/tool-analysis-results/${e.reportId}`,children:`View`})}),(0,I.jsxs)(Uq,{onSelect:()=>void S(e.reportId,`json`),children:[(0,I.jsx)(yn,{className:`mr-2 h-3.5 w-3.5`}),` Export JSON`]}),(0,I.jsxs)(Uq,{onSelect:()=>void S(e.reportId,`markdown`),children:[(0,I.jsx)(yn,{className:`mr-2 h-3.5 w-3.5`}),` Export Markdown`]}),(0,I.jsxs)(Uq,{className:`text-destructive`,onSelect:t=>{t.preventDefault(),o(e.reportId)},children:[(0,I.jsx)(lr,{className:`mr-2 h-3.5 w-3.5`}),` Delete`]}),(0,I.jsxs)(Uq,{onSelect:()=>void S(e.reportId,`tool_schemas`),children:[(0,I.jsx)(yn,{className:`mr-2 h-3.5 w-3.5`}),` Export MCP Info`]})]})]})})]},e.reportId))})]})]})})}),(0,I.jsx)(X6,{open:!!a,onOpenChange:e=>!e&&o(null),children:(0,I.jsxs)(Q6,{children:[(0,I.jsxs)($6,{children:[(0,I.jsx)(t8,{children:`Delete tool analysis report?`}),(0,I.jsx)(n8,{children:b?`Delete saved report '${b.reportId}' from disk? This cannot be undone.`:`Delete this saved report from disk? This cannot be undone.`})]}),(0,I.jsxs)(e8,{children:[(0,I.jsx)(i8,{disabled:s,children:`Cancel`}),(0,I.jsx)(r8,{onClick:e=>{e.preventDefault(),x()},disabled:s,children:s?`Deleting...`:`Delete`})]})]})})]})}function E7(e,t,n){let r=new Blob([t],{type:n}),i=URL.createObjectURL(r),a=document.createElement(`a`);a.href=i,a.download=e,a.click(),URL.revokeObjectURL(i)}function sfe(){let{id:e=``}=Zd(),t=qd(),{source:n}=nv(),[r,i]=(0,_.useState)(null),[a,o]=(0,_.useState)(!0),[s,c]=(0,_.useState)(!1),[l,u]=(0,_.useState)(!1),[d,f]=(0,_.useState)(!1);(0,_.useEffect)(()=>{let t=!0;return o(!0),c(!1),n.getToolAnalysisSavedResult(e).then(e=>{t&&i(e)}).catch(e=>{if(!t)return;let n=e instanceof Error?e.message:String(e);n.includes(`(404)`)?(c(!0),i(null)):O({title:`Could not load saved tool analysis report`,description:n,variant:`destructive`})}).finally(()=>{t&&o(!1)}),()=>{t=!1}},[e,n]);let p=async()=>{f(!0);try{await n.deleteToolAnalysisSavedResult(e),O({title:`Tool analysis report deleted`}),t(`/tool-analysis-results`)}catch(e){O({title:`Could not delete report`,description:e instanceof Error?e.message:String(e),variant:`destructive`})}finally{f(!1),u(!1)}};return a?(0,I.jsx)(`p`,{className:`text-sm text-muted-foreground`,children:`Loading saved tool analysis report...`}):s||!r?(0,I.jsxs)(`div`,{className:`space-y-4`,children:[(0,I.jsx)(`h1`,{className:`text-2xl font-bold`,children:`Tool Analysis Result`}),(0,I.jsx)(`p`,{className:`text-sm text-muted-foreground`,children:`Saved report not found.`}),(0,I.jsx)(W,{asChild:!0,variant:`outline`,children:(0,I.jsx)(np,{to:`/tool-analysis-results`,children:`Back to Tool Analysis Results`})})]}):(0,I.jsxs)(`div`,{className:`space-y-4`,children:[(0,I.jsxs)(`div`,{className:`flex flex-wrap items-center justify-between gap-2`,children:[(0,I.jsxs)(`div`,{children:[(0,I.jsx)(`h1`,{className:`font-mono text-xl font-semibold`,children:r.reportId}),(0,I.jsxs)(`p`,{className:`text-xs text-muted-foreground`,children:[(0,I.jsxs)(`span`,{className:`inline-flex items-center gap-1 align-middle`,children:[(0,I.jsx)(_n,{className:`h-3 w-3 shrink-0`}),new Date(r.createdAt).toLocaleString()]}),` `,`·`,` `,[r.report.assistantAgentProvider?OX(r.report.assistantAgentProvider):null,r.report.assistantAgentModel].filter(Boolean).join(` · `)||r.serverNames.join(`, `)||`—`]})]}),(0,I.jsxs)(`div`,{className:`flex flex-wrap items-center gap-2`,children:[(0,I.jsx)(C7,{versions:r.report.mcpServerVersions}),(0,I.jsx)(W,{asChild:!0,size:`sm`,variant:`outline`,children:(0,I.jsx)(np,{to:`/tool-analysis-results`,children:`Back to results`})}),(0,I.jsxs)(W,{type:`button`,size:`sm`,variant:`outline`,onClick:()=>E7(`${r.reportId}.json`,`${JSON.stringify(r,null,2)}\n`,`application/json`),children:[(0,I.jsx)(yn,{className:`mr-2 h-4 w-4`}),`Export JSON`]}),(0,I.jsxs)(W,{type:`button`,size:`sm`,variant:`outline`,onClick:()=>E7(`${r.reportId}.md`,g7(r.report),`text/markdown`),children:[(0,I.jsx)(yn,{className:`mr-2 h-4 w-4`}),`Export Markdown`]}),(0,I.jsxs)(W,{type:`button`,size:`sm`,variant:`outline`,onClick:()=>E7(`${r.reportId}-tool-schemas.json`,`${JSON.stringify(v7(r),null,2)}\n`,`application/json`),children:[(0,I.jsx)(yn,{className:`mr-2 h-4 w-4`}),`Export MCP info`]}),(0,I.jsxs)(W,{type:`button`,size:`sm`,variant:`outline`,onClick:()=>u(!0),children:[(0,I.jsx)(lr,{className:`mr-2 h-4 w-4`}),`Delete`]})]})]}),(0,I.jsx)(_7,{report:r.report}),(0,I.jsx)(X6,{open:l,onOpenChange:u,children:(0,I.jsxs)(Q6,{children:[(0,I.jsxs)($6,{children:[(0,I.jsx)(t8,{children:`Delete tool analysis report?`}),(0,I.jsxs)(n8,{children:[`Delete saved report '`,r.reportId,`' from disk? This cannot be undone.`]})]}),(0,I.jsxs)(e8,{children:[(0,I.jsx)(i8,{disabled:d,children:`Cancel`}),(0,I.jsx)(r8,{onClick:e=>{e.preventDefault(),p()},disabled:d,children:d?`Deleting...`:`Delete`})]})]})})]})}var cfe=[{id:`configure`,label:`Configure Debug Session`},{id:`run`,label:`Run / Inspect Flow`},{id:`report`,label:`Report / Export`}],lfe=`resolve_target_metadata`,ufe=`token_exchange`,dfe=`resource_probe`;function D7({text:e}){return(0,I.jsx)(gl,{delayDuration:200,children:(0,I.jsxs)(_l,{children:[(0,I.jsx)(vl,{type:`button`,className:`inline-flex shrink-0 items-center`,onClick:e=>e.preventDefault(),children:(0,I.jsx)(Nn,{className:`h-3.5 w-3.5 text-muted-foreground/50 hover:text-muted-foreground`})}),(0,I.jsx)(yl,{className:`max-w-xs text-xs leading-relaxed`,children:e})]})})}function O7(e){return navigator.clipboard.writeText(e)}function k7(){return typeof window>`u`?``:window.location.port===`8685`?`http://127.0.0.1:8787`:``}function A7(e){if(!e)return`No metadata payload captured.`;try{return JSON.stringify(JSON.parse(e),null,2)}catch{return`Non-JSON response body:\n${e}`}}function ffe(e,t){let 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(let t of e.stepStates)n.push(`- ${t.title}: ${t.status}${t.outcomeSummary?` — ${t.outcomeSummary}`:``}`);if(n.push(``),n.push(`## Validation Findings`),e.validations.length===0)n.push(`- None`);else for(let t of e.validations)n.push(`- [${t.severity}] ${t.title} (${t.stepId})`),n.push(` - ${t.detail}`),t.recommendation&&n.push(` - Recommendation: ${t.recommendation}`);n.push(``),n.push(`## Event Log`);for(let e of t){let t=typeof e.payload.message==`string`?e.payload.message:JSON.stringify(e.payload);n.push(`- ${new Date(e.ts).toLocaleTimeString()} [${e.type}] ${t}`)}return`${n.join(`
|
|
164
|
-
`)}\n`}function pfe(){let{source:e}=nv(),{servers:t,reload:n,loading:r}=hv(),[i,a]=(0,_.useState)(`configure`),[o,s]=(0,_.useState)(``),[c,l]=(0,_.useState)(`pre_registered`),[u,d]=(0,_.useState)(`local_callback`),[f,p]=(0,_.useState)(!0),[m,h]=(0,_.useState)(!0),[g,v]=(0,_.useState)(!0),[y,b]=(0,_.useState)(``),[x,S]=(0,_.useState)(``),[C,w]=(0,_.useState)(``),[T,E]=(0,_.useState)(``),[D,k]=(0,_.useState)(`__default__`),[A,j]=(0,_.useState)(`{}`),[M,N]=(0,_.useState)(``),[P,F]=(0,_.useState)(``),[L,R]=(0,_.useState)(``),[z,ee]=(0,_.useState)(``),[te,ne]=(0,_.useState)(``),[re,ie]=(0,_.useState)(``),[ae,oe]=(0,_.useState)(``),[se,ce]=(0,_.useState)(``),[B,le]=(0,_.useState)(null),[ue,de]=(0,_.useState)(null),[V,fe]=(0,_.useState)([]),[pe,me]=(0,_.useState)(!1),[he,ge]=(0,_.useState)(!1),[_e,ve]=(0,_.useState)(!1),[ye,be]=(0,_.useState)(`all`),[xe,Se]=(0,_.useState)(`all`),[Ce,we]=(0,_.useState)(`inspector`),Te=(0,_.useRef)(null),Ee=(0,_.useRef)(null),De=(0,_.useRef)(!1),Oe=(0,_.useRef)(m);(0,_.useEffect)(()=>{Oe.current=m},[m]),(0,_.useEffect)(()=>()=>{Te.current?.(),Te.current=null},[]),(0,_.useEffect)(()=>{Ee.current?.scrollIntoView({behavior:`smooth`,block:`end`})},[V.length]);let ke=(0,_.useMemo)(()=>t.filter(e=>e.authType===`oauth2`).slice().sort((e,t)=>(e.name||e.id).localeCompare(t.name||t.id,void 0,{sensitivity:`base`})),[t]),Ae=ke.find(e=>e.id===o);(0,_.useEffect)(()=>{o&&(ke.some(e=>e.id===o)||s(``))},[ke,o]),(0,_.useEffect)(()=>{Ae&&(Ae.oauthMode===`dcr`?(l(`dcr`),w(``),E(``)):(l(`pre_registered`),w(Ae.oauthClientId??``),E(Ae.oauthClientSecret??``)),b(Ae.oauthScope??``),ee(Ae.oauthAuthorizationUrl??``),ne(Ae.oauthTokenEndpoint??``))},[Ae?.id]);let je=(0,_.useMemo)(()=>{let e=B?.stepStates.length??0,t=B?.stepStates.filter(e=>e.status===`completed`||e.status===`skipped`).length??0,n=B?.stepStates.filter(e=>e.status===`failed`).length??0;return{total:e,completed:t,failed:n,percent:e>0?Math.round((t+n)/e*100):0}},[B]),Me=(0,_.useMemo)(()=>{let e=B?.network??[],t=new Map,n=[],r=e=>`${e.stepId}::${e.label}::${e.url}`;for(let i of e){if(i.phase===`request`){let e=n.length;n.push({key:i.id,stepId:i.stepId,label:i.label,method:i.method,url:i.url,request:i});let a=r(i),o=t.get(a)??[];o.push(e),t.set(a,o);continue}let e=r(i),a=t.get(e),o=a?.shift();typeof o==`number`?(n[o]={...n[o],response:i},a&&a.length>0?t.set(e,a):t.delete(e)):n.push({key:i.id,stepId:i.stepId,label:i.label,method:i.method,url:i.url,response:i})}return n.filter(e=>ye!==`all`&&e.stepId!==ye?!1:xe===`error`?typeof e.response?.status==`number`&&e.response.status>=400:xe!==`ok`||typeof e.response?.status==`number`&&e.response.status<400)},[B?.network,ye,xe]),Ne=!!ue,Pe=!(!B||B.status!==`completed`&&B.status!==`error`&&B.status!==`stopped`),Fe=(0,_.useMemo)(()=>{let e=new Map;return(B?.stepStates??[]).forEach((t,n)=>{e.set(t.id,n+1)}),e},[B?.stepStates]),Ie=(0,_.useMemo)(()=>{let e=(B?.network??[]).filter(e=>e.phase===`response`),t=t=>{let n=e.filter(e=>e.label===t);return[...n].reverse().find(e=>typeof e.status==`number`&&e.status<400)??[...n].reverse()[0]};return{resourceMetadata:t(`Protected Resource Metadata`),authorizationServerMetadata:t(`Authorization Server Metadata`)}},[B?.network]),Le=(0,_.useMemo)(()=>{let e=new Map;for(let t of B?.network??[]){let n=e.get(t.stepId)??{requests:[],responses:[]};t.phase===`request`&&n.requests.push(t),t.phase===`response`&&n.responses.push(t),e.set(t.stepId,n)}return e},[B?.network]),Re=e=>{if(e===`configure`||e===`run`&&Ne||e===`report`&&Pe)return a(e)},ze=()=>{let e;if(c===`dcr`&&A.trim())try{e=JSON.parse(A)}catch{throw Error(`DCR metadata JSON is invalid`)}if(!Ae)throw Error(`Select an MCP server`);return{profile:`latest`,target:{serverName:Ae.id,overrides:{authorizationServerMetadataUrl:L||void 0,authorizationEndpoint:z||void 0,tokenEndpoint:te||void 0,registrationEndpoint:re||void 0,cimdUrl:M||void 0,resourceBaseUrl:ae||void 0}},registrationMethod:c,clientConfig:{preRegistered:c===`pre_registered`?{clientId:C.trim(),clientSecret:T.trim()||void 0,tokenEndpointAuthMethod:D===`__default__`?void 0:D||void 0}:void 0,dcr:c===`dcr`?{metadata:e,tokenEndpointAuthMethod:D===`__default__`?void 0:D||void 0}:void 0,cimd:c===`cimd`?{cimdUrl:M||void 0,expectedClientId:P||void 0}:void 0},runtime:{redirectMode:u,scopes:y.split(/[,\s]+/).map(e=>e.trim()).filter(Boolean),resource:x.trim()||void 0,usePkce:g,codeChallengeMethod:`S256`},display:{showSensitiveValues:f}}},Be=t=>{Te.current?.(),Te.current=e.subscribeOAuthDebuggerSession(t,n=>{fe(e=>[...e,n]),(n.type===`completed`||n.type===`error`||n.type===`stopped`)&&me(!1),e.getOAuthDebuggerSession(t).then(e=>{le(e.session),e.session.uiHints.authorizationUrl&&Ve(`${k7()}/api/oauth-debugger/sessions/${t}/authorize`),e.session.status===`completed`&&a(`report`)}).catch(()=>{})})},Ve=e=>{Oe.current&&!De.current&&e&&(De.current=!0,window.open(e,`_blank`,`noopener,noreferrer`))},He=async()=>{ge(!0),De.current=!1;try{let t=ze(),n=await e.createOAuthDebuggerSession(t);de(n.sessionId),le(n.session),fe([]),a(`run`),Be(n.sessionId);let r=await e.startOAuthDebuggerSession(n.sessionId);le(r.session),me(!0),(r.session.status===`waiting_for_user`||r.session.status===`waiting_for_browser_callback`)&&(me(!1),r.session.uiHints.authorizationUrl&&Ve(`${k7()}/api/oauth-debugger/sessions/${n.sessionId}/authorize`))}catch(e){O({title:`Could not start OAuth Debugger session`,description:e instanceof Error?e.message:String(e),variant:`destructive`})}finally{ge(!1)}},Ue=async()=>{if(ue)try{ge(!0);let t=await e.submitOAuthDebuggerManualCallback(ue,{redirectUrl:se.trim()||void 0});le(t.session),ce(``),me(!0)}catch(e){O({title:`Could not submit callback`,description:e instanceof Error?e.message:String(e),variant:`destructive`})}finally{ge(!1)}},We=async()=>{if(ue){ve(!0);try{let t=await e.stopOAuthDebuggerSession(ue);if(me(!1),t.status!==`running`){let t=await e.getOAuthDebuggerSession(ue);le(t.session),t.session.status===`completed`?a(`report`):a(`run`)}}catch(e){O({title:`Could not stop session`,description:e instanceof Error?e.message:String(e),variant:`destructive`})}finally{ve(!1)}}},Ge=async()=>{Te.current?.(),Te.current=null,le(null),de(null),fe([]),me(!1),ve(!1),ge(!1),ce(``),be(`all`),Se(`all`),we(`inspector`),a(`run`),await He()},Ke=async t=>{if(ue&&B)try{let n=await e.exportOAuthDebuggerSession(ue,t),r=``,i=t===`json`?`json`:t===`raw`?`txt`:`md`;r=typeof n==`string`?n:`${JSON.stringify(n,null,2)}\n`;let a=new Blob([r],{type:`text/plain;charset=utf-8`}),o=URL.createObjectURL(a),s=document.createElement(`a`);s.href=o,s.download=`oauth-debugger-${ue}.${i}`,s.click(),URL.revokeObjectURL(o)}catch(e){if(t===`markdown`){let e=ffe(B,V),t=new Blob([e],{type:`text/markdown;charset=utf-8`}),n=URL.createObjectURL(t),r=document.createElement(`a`);r.href=n,r.download=`oauth-debugger-${B.id}.md`,r.click(),URL.revokeObjectURL(n);return}O({title:`Export failed`,description:e instanceof Error?e.message:String(e),variant:`destructive`})}},qe=ue?`${k7()}/api/oauth-debugger/sessions/${ue}/authorize`:void 0,Je=e=>e===`error`?`destructive`:e===`warning`?`outline-solid`:`secondary`;return(0,I.jsxs)(`div`,{className:`space-y-6`,children:[(0,I.jsxs)(`div`,{className:`flex items-start justify-between gap-3`,children:[(0,I.jsxs)(`div`,{children:[(0,I.jsx)(`h1`,{className:`text-2xl font-bold`,children:`OAuth Debugger`}),(0,I.jsx)(`p`,{className:`text-sm text-muted-foreground`,children:`Step-by-step OAuth flow debugging for MCP servers (latest MCP authorization draft profile).`})]}),(0,I.jsx)(`div`,{className:`flex flex-wrap items-center gap-2`,children:cfe.map(e=>{let t=i===e.id,n=e.id===`configure`||e.id===`run`&&Ne||e.id===`report`&&Pe;return(0,I.jsx)(`button`,{type:`button`,onClick:()=>n&&Re(e.id),disabled:!n,className:`rounded-full`,children:(0,I.jsx)(Y,{variant:t?`default`:`outline-solid`,className:n?``:`opacity-50`,children:e.label})},e.id)})})]}),i===`configure`&&(0,I.jsxs)(`div`,{className:`space-y-4`,children:[(0,I.jsxs)(K,{children:[(0,I.jsx)(gv,{className:`pb-3`,children:(0,I.jsxs)(`div`,{className:`flex items-center justify-between gap-2`,children:[(0,I.jsxs)(`div`,{children:[(0,I.jsx)(_v,{className:`text-base`,children:`Target MCP Server`}),(0,I.jsx)(vv,{children:`Select one MCP server from Libraries and optionally override endpoints.`})]}),(0,I.jsxs)(W,{type:`button`,variant:`outline`,size:`sm`,onClick:()=>void n(),disabled:r,children:[(0,I.jsx)(Qn,{className:`mr-2 h-4 w-4 ${r?`animate-spin`:``}`}),`Refresh Servers`]})]})}),(0,I.jsx)(q,{className:`space-y-3`,children:(0,I.jsxs)(`div`,{className:`max-w-xl space-y-2`,children:[(0,I.jsx)(Q,{children:`MCP Server`}),(0,I.jsxs)(OY,{value:o,onValueChange:s,children:[(0,I.jsx)(AY,{children:(0,I.jsx)(kY,{placeholder:`Select an MCP server`})}),(0,I.jsx)(NY,{children:ke.map(e=>(0,I.jsx)(Z,{value:e.id,children:e.name||e.id},e.id))})]}),ke.length===0&&(0,I.jsxs)(`p`,{className:`text-xs text-muted-foreground`,children:[`No MCP servers with OAuth configured found. Add OAuth 2.0 auth in`,` `,(0,I.jsx)(`a`,{href:`/libraries/servers`,className:`underline text-primary`,children:`Manage Servers`}),`.`]}),Ae&&(0,I.jsxs)(`p`,{className:`text-xs text-muted-foreground`,children:[Ae.transport,` ·`,` `,Ae.url||Ae.command||`No URL/command`,` · `,(0,I.jsxs)(`span`,{className:`text-primary`,children:[Ae.oauthMode===`dcr`?`DCR`:`pre-registered`,` fields pre-filled`]})]})]})})]}),(0,I.jsxs)(K,{children:[(0,I.jsxs)(gv,{className:`pb-3`,children:[(0,I.jsx)(_v,{className:`text-base`,children:`Client Registration Method`}),(0,I.jsx)(vv,{children:`How your OAuth client is identified with the authorization server.`})]}),(0,I.jsxs)(q,{className:`space-y-3`,children:[(0,I.jsx)(`div`,{className:`grid gap-2 md:grid-cols-3`,children:[{id:`pre_registered`,label:`Pre-registered client`,hint:`You already have a client_id issued by the authorization server.`},{id:`dcr`,label:`Dynamic Client Registration`,hint:`The server issues a client_id automatically at the start of the flow (RFC 7591).`},{id:`cimd`,label:`Client ID Metadata Document`,hint:`The client identifies itself via a hosted JSON metadata document at a public URL (RFC 9728).`}].map(e=>(0,I.jsxs)(`button`,{type:`button`,onClick:()=>l(e.id),className:`rounded-md border p-3 text-left`,children:[(0,I.jsxs)(`div`,{className:`flex items-center gap-2`,children:[(0,I.jsx)(`div`,{className:`h-2.5 w-2.5 shrink-0 rounded-full ${c===e.id?`bg-primary`:`bg-muted-foreground/30`}`}),(0,I.jsx)(`span`,{className:`text-sm font-medium`,children:e.label})]}),(0,I.jsx)(`p`,{className:`mt-1 pl-5 text-xs text-muted-foreground`,children:e.hint})]},e.id))}),(0,I.jsx)(`div`,{className:`grid gap-3 md:grid-cols-1`,children:(0,I.jsxs)(`div`,{className:`max-w-md space-y-1`,children:[(0,I.jsxs)(Q,{className:`text-xs flex items-center gap-1`,children:[`Redirect mode`,(0,I.jsx)(D7,{text:`Local callback (recommended): MCP Lab automatically captures the redirect after you log in — no copy-pasting needed. Manual: you complete the browser login and then paste the final redirect URL back here.`})]}),(0,I.jsxs)(OY,{value:u,onValueChange:e=>d(e),children:[(0,I.jsx)(AY,{children:(0,I.jsx)(kY,{})}),(0,I.jsxs)(NY,{children:[(0,I.jsx)(Z,{value:`local_callback`,children:`Local callback (recommended)`}),(0,I.jsx)(Z,{value:`manual`,children:`Manual paste redirect URL`})]})]})]})}),c===`pre_registered`&&(0,I.jsxs)(`div`,{className:`grid gap-3 md:grid-cols-2`,children:[(0,I.jsxs)(`div`,{className:`space-y-1`,children:[(0,I.jsxs)(Q,{className:`text-xs flex items-center gap-1`,children:[`client_id`,(0,I.jsx)(D7,{text:`The unique identifier for your application, issued by the authorization server when you registered the client.`})]}),(0,I.jsx)(Op,{value:C,onChange:e=>w(e.target.value)})]}),(0,I.jsxs)(`div`,{className:`space-y-1`,children:[(0,I.jsxs)(Q,{className:`text-xs flex items-center gap-1`,children:[`client_secret`,(0,I.jsx)(D7,{text:`Leave empty for public clients (e.g. SPAs or mobile apps). Required for confidential clients that authenticate with the token endpoint.`})]}),(0,I.jsx)(a8,{value:T,onChange:e=>E(e.target.value),placeholder:`optional`})]})]}),c===`cimd`&&(0,I.jsxs)(`div`,{className:`space-y-1`,children:[(0,I.jsxs)(Q,{className:`text-xs flex items-center gap-1`,children:[`CIMD URL`,(0,I.jsx)(D7,{text:`A publicly reachable URL hosting a JSON document that describes this client. The authorization server fetches it to identify the client.`})]}),(0,I.jsx)(Op,{value:M,onChange:e=>N(e.target.value),placeholder:`https://.../client-metadata.json`})]})]})]}),(0,I.jsxs)(K,{children:[(0,I.jsxs)(gv,{className:`pb-3`,children:[(0,I.jsx)(_v,{className:`text-base`,children:`Runtime OAuth Inputs`}),(0,I.jsx)(vv,{children:`Parameters sent in the authorization request.`})]}),(0,I.jsxs)(q,{className:`grid gap-3 md:grid-cols-2`,children:[(0,I.jsxs)(`div`,{className:`space-y-1`,children:[(0,I.jsx)(Q,{className:`text-xs`,children:`Scopes`}),(0,I.jsx)(Op,{value:y,onChange:e=>b(e.target.value),placeholder:`openid profile email`}),(0,I.jsx)(`p`,{className:`text-xs text-muted-foreground`,children:`Space or comma separated. Leave empty to use scopes auto-discovered from the server metadata.`})]}),(0,I.jsxs)(`div`,{className:`flex items-center gap-2 md:col-span-2`,children:[(0,I.jsx)(KX,{checked:g,onCheckedChange:e=>v(!!e)}),(0,I.jsxs)(Q,{className:`flex items-center gap-1`,children:[`Use PKCE (S256)`,(0,I.jsx)(D7,{text:`Proof Key for Code Exchange — generates a one-time code verifier so the authorization code can't be hijacked. Recommended for all clients; required for public clients.`})]})]}),(0,I.jsxs)(`div`,{className:`flex items-center gap-2 md:col-span-2`,children:[(0,I.jsx)(KX,{checked:m,onCheckedChange:e=>h(!!e)}),(0,I.jsx)(Q,{children:`Auto-open browser when authorization URL is ready`})]})]})]}),(0,I.jsxs)(`details`,{className:`rounded-md border bg-card p-3 shadow-xs`,children:[(0,I.jsx)(`summary`,{className:`cursor-pointer text-sm font-medium`,children:`Advanced`}),(0,I.jsxs)(`div`,{className:`mt-3 space-y-4`,children:[(0,I.jsxs)(`div`,{className:`grid gap-3 md:grid-cols-2`,children:[(0,I.jsxs)(`div`,{className:`space-y-1`,children:[(0,I.jsxs)(Q,{className:`text-xs flex items-center gap-1`,children:[`Token endpoint auth method`,(0,I.jsx)(D7,{text:`How your client authenticates when exchanging the authorization code for a token. Choose 'none' for public clients (no secret). Leave as server default if unsure.`})]}),(0,I.jsxs)(OY,{value:D,onValueChange:k,children:[(0,I.jsx)(AY,{children:(0,I.jsx)(kY,{placeholder:`Server default (recommended)`})}),(0,I.jsxs)(NY,{children:[(0,I.jsx)(Z,{value:`__default__`,children:`Server default (let the server decide)`}),(0,I.jsx)(Z,{value:`client_secret_basic`,children:`client_secret_basic — credentials in Authorization header`}),(0,I.jsx)(Z,{value:`client_secret_post`,children:`client_secret_post — credentials in request body`}),(0,I.jsx)(Z,{value:`none`,children:`none — public client, no secret`}),(0,I.jsx)(Z,{value:`private_key_jwt`,children:`private_key_jwt — signed JWT assertion`})]})]}),(0,I.jsx)(`p`,{className:`text-xs text-muted-foreground`,children:`Use "server default" unless the server requires a specific method.`})]}),(0,I.jsxs)(`div`,{className:`space-y-1`,children:[(0,I.jsxs)(Q,{className:`text-xs flex items-center gap-1`,children:[`Resource / audience`,(0,I.jsx)(D7,{text:`Some servers (RFC 8707) require the target API's URI in the token request to scope the token. Only set this if your server explicitly requires it.`})]}),(0,I.jsx)(Op,{value:x,onChange:e=>S(e.target.value),placeholder:`https://api.example.com`}),(0,I.jsx)(`p`,{className:`text-xs text-muted-foreground`,children:`Optional. Only needed for servers that use resource indicators.`})]})]}),c===`dcr`&&(0,I.jsxs)(`div`,{className:`space-y-1`,children:[(0,I.jsxs)(Q,{className:`text-xs flex items-center gap-1`,children:[`DCR metadata JSON`,(0,I.jsx)(D7,{text:`Extra fields for the dynamic client registration request (RFC 7591), e.g. {"client_name": "My App"}. redirect_uris and grant_types are always added automatically.`})]}),(0,I.jsx)(iX,{value:A,onChange:e=>j(e.target.value),className:`min-h-32 font-mono text-xs`}),(0,I.jsx)(`p`,{className:`text-xs text-muted-foreground`,children:`Optional extra fields for the registration request body.`})]}),c===`cimd`&&(0,I.jsxs)(`div`,{className:`space-y-1`,children:[(0,I.jsxs)(Q,{className:`text-xs flex items-center gap-1`,children:[`Expected client_id`,(0,I.jsx)(D7,{text:`If you know what client_id the server should assign from the metadata document, enter it here for verification. Leave blank to accept whatever the server returns.`})]}),(0,I.jsx)(Op,{value:P,onChange:e=>F(e.target.value),placeholder:`optional`})]}),(0,I.jsxs)(`div`,{className:`rounded-md border bg-background p-3`,children:[(0,I.jsx)(`div`,{className:`mb-1 text-sm font-medium`,children:`Endpoint overrides`}),(0,I.jsx)(`p`,{className:`mb-3 text-xs text-muted-foreground`,children:`Override specific endpoints if auto-discovery fails or you want to test against a specific URL. Leave blank to use what the server advertises.`}),(0,I.jsxs)(`div`,{className:`grid gap-3 md:grid-cols-2`,children:[(0,I.jsxs)(`div`,{className:`space-y-1`,children:[(0,I.jsxs)(Q,{className:`text-xs flex items-center gap-1`,children:[`Authorization server metadata URL`,(0,I.jsx)(D7,{text:`The /.well-known/oauth-authorization-server URL. Override if the server uses a non-standard path.`})]}),(0,I.jsx)(Op,{value:L,onChange:e=>R(e.target.value),placeholder:`https://.../.well-known/oauth-authorization-server`})]}),(0,I.jsxs)(`div`,{className:`space-y-1`,children:[(0,I.jsxs)(Q,{className:`text-xs flex items-center gap-1`,children:[`Resource server base URL`,(0,I.jsx)(D7,{text:`The MCP server's base URL used to look up its /.well-known/oauth-protected-resource metadata. Override if the server uses a different base path.`})]}),(0,I.jsx)(Op,{value:ae,onChange:e=>oe(e.target.value),placeholder:`https://resource.example.com`})]}),(0,I.jsxs)(`div`,{className:`space-y-1`,children:[(0,I.jsxs)(Q,{className:`text-xs flex items-center gap-1`,children:[`Authorization endpoint`,(0,I.jsx)(D7,{text:`The URL where users are redirected to log in and grant consent. Normally discovered automatically from the server metadata.`})]}),(0,I.jsx)(Op,{value:z,onChange:e=>ee(e.target.value),placeholder:`https://.../authorize`})]}),(0,I.jsxs)(`div`,{className:`space-y-1`,children:[(0,I.jsxs)(Q,{className:`text-xs flex items-center gap-1`,children:[`Token endpoint`,(0,I.jsx)(D7,{text:`The URL your app calls to exchange the authorization code for an access token. Normally discovered automatically.`})]}),(0,I.jsx)(Op,{value:te,onChange:e=>ne(e.target.value),placeholder:`https://.../token`})]}),(0,I.jsxs)(`div`,{className:`space-y-1`,children:[(0,I.jsxs)(Q,{className:`text-xs flex items-center gap-1`,children:[`Registration endpoint (DCR)`,(0,I.jsx)(D7,{text:`The URL used to dynamically register a new client (RFC 7591). Only relevant when using DCR. Override if the server doesn't advertise it in its metadata.`})]}),(0,I.jsx)(Op,{value:re,onChange:e=>ie(e.target.value),placeholder:`https://.../register`})]}),(0,I.jsxs)(`div`,{className:`space-y-1`,children:[(0,I.jsxs)(Q,{className:`text-xs flex items-center gap-1`,children:[`CIMD URL override`,(0,I.jsx)(D7,{text:`Override the Client ID Metadata Document URL. Use this if the server doesn't discover it automatically or you want to test with a specific metadata document.`})]}),(0,I.jsx)(Op,{value:M,onChange:e=>N(e.target.value),placeholder:`https://.../client-metadata.json`})]})]})]}),(0,I.jsxs)(R5,{children:[(0,I.jsx)(un,{className:`h-4 w-4`}),(0,I.jsx)(z5,{children:`Secrets display`}),(0,I.jsxs)(B5,{className:`space-y-2`,children:[(0,I.jsx)(`p`,{children:`By default, full tokens and secrets are visible in the network inspector and exports — useful for debugging but not for sharing.`}),(0,I.jsxs)(`div`,{className:`flex items-center gap-2`,children:[(0,I.jsx)(KX,{checked:!f,onCheckedChange:e=>p(e===!1)}),(0,I.jsx)(Q,{children:`Hide sensitive values in inspector`})]})]})]})]})]}),(0,I.jsx)(`div`,{className:`flex justify-end`,children:(0,I.jsxs)(W,{type:`button`,onClick:()=>void He(),disabled:he,children:[he&&(0,I.jsx)(zn,{className:`mr-2 h-4 w-4 animate-spin`}),`Start OAuth Debug Session`]})})]}),i===`run`&&(0,I.jsx)(`div`,{className:`space-y-4`,children:(0,I.jsxs)(`div`,{className:`grid gap-4 xl:grid-cols-[1.2fr_1fr]`,children:[(0,I.jsxs)(K,{className:`xl:col-span-1 min-w-0`,children:[(0,I.jsx)(gv,{className:`pb-3`,children:(0,I.jsxs)(`div`,{className:`flex items-start justify-between gap-2`,children:[(0,I.jsxs)(`div`,{children:[(0,I.jsx)(_v,{className:`text-base`,children:`Progress`}),(0,I.jsx)(vv,{children:`Visual OAuth flow guide with live session events and next-step actions.`})]}),(0,I.jsxs)(`div`,{className:`flex items-center gap-2`,children:[B?.uiHints.authorizationUrl&&qe&&(0,I.jsx)(W,{asChild:!0,type:`button`,size:`sm`,variant:`outline`,children:(0,I.jsxs)(`a`,{href:qe,target:`_blank`,rel:`noopener noreferrer`,children:[(0,I.jsx)(Sn,{className:`mr-2 h-4 w-4`}),`Open Authorization URL`]})}),(0,I.jsxs)(W,{type:`button`,size:`sm`,variant:`outline`,onClick:()=>void Ge(),disabled:he,children:[(0,I.jsx)(Qn,{className:`mr-2 h-4 w-4`}),`Restart`]}),ue&&(0,I.jsxs)(W,{type:`button`,size:`sm`,variant:`outline`,onClick:()=>void We(),disabled:_e||!ue,children:[(_e||pe)&&_e&&(0,I.jsx)(zn,{className:`mr-2 h-4 w-4 animate-spin`}),(0,I.jsx)(sr,{className:`mr-2 h-4 w-4`}),`Stop Debug Session`]})]})]})}),(0,I.jsxs)(q,{className:`space-y-3`,children:[(0,I.jsxs)(`div`,{className:`space-y-1.5`,children:[(0,I.jsxs)(`div`,{className:`flex items-center justify-between text-xs text-muted-foreground`,children:[(0,I.jsxs)(`span`,{children:[je.completed+je.failed,`/`,je.total,` steps`]}),(0,I.jsxs)(`span`,{children:[je.percent,`%`]})]}),(0,I.jsx)(t7,{value:je.percent,className:`h-2`})]}),B?.status===`waiting_for_user`&&(0,I.jsx)(K,{children:(0,I.jsxs)(q,{className:`pt-4 space-y-2`,children:[(0,I.jsx)(`div`,{className:`text-sm font-medium`,children:`Manual callback required`}),(0,I.jsx)(`p`,{className:`text-xs text-muted-foreground`,children:`Open the authorization URL, complete authentication, then paste the final redirect URL here.`}),(0,I.jsx)(iX,{value:se,onChange:e=>ce(e.target.value),placeholder:`Paste the final redirect URL (with code and state)`,className:`min-h-24 text-xs font-mono`}),(0,I.jsxs)(`div`,{className:`flex gap-2`,children:[(0,I.jsxs)(W,{type:`button`,size:`sm`,onClick:()=>void Ue(),disabled:he||!se.trim(),children:[he&&(0,I.jsx)(zn,{className:`mr-2 h-4 w-4 animate-spin`}),`Continue`]}),B.uiHints.authorizationUrl&&qe&&(0,I.jsx)(W,{asChild:!0,type:`button`,size:`sm`,variant:`outline`,children:(0,I.jsx)(`a`,{href:qe,target:`_blank`,rel:`noopener noreferrer`,children:`Open Authorization URL`})})]})]})}),B?.status===`waiting_for_browser_callback`&&(0,I.jsxs)(R5,{children:[(0,I.jsx)(un,{className:`h-4 w-4`}),(0,I.jsx)(z5,{children:`Waiting for browser callback`}),(0,I.jsxs)(B5,{className:`space-y-1`,children:[(0,I.jsx)(`p`,{className:`text-xs`,children:`Complete the authorization flow in your browser. MCP Lab is listening for the callback at:`}),(0,I.jsx)(`p`,{className:`text-xs font-mono break-all`,children:B.uiHints.callbackUrl}),B.uiHints.authorizationUrl&&qe&&(0,I.jsx)(`div`,{className:`pt-2`,children:(0,I.jsx)(W,{asChild:!0,type:`button`,size:`sm`,variant:`outline`,children:(0,I.jsxs)(`a`,{href:qe,target:`_blank`,rel:`noopener noreferrer`,children:[(0,I.jsx)(Sn,{className:`mr-2 h-4 w-4`}),`Open Authorization URL`]})})})]})]}),(0,I.jsx)(`div`,{className:`space-y-2`,children:B?.stepStates.map(e=>{let t=Fe.get(e.id),n=Le.get(e.id),r=e.id===ufe||e.id===dfe,i=!!(n&&(n.requests.length>0||n.responses.length>0)),a=r&&e.status!==`pending`&&i;return(0,I.jsxs)(`div`,{className:`rounded-md border p-3`,children:[(0,I.jsxs)(`div`,{className:`flex items-center justify-between gap-2`,children:[(0,I.jsxs)(`div`,{className:`min-w-0 flex items-start gap-2`,children:[(0,I.jsx)(`div`,{className:`mt-0.5 inline-flex h-6 w-6 shrink-0 items-center justify-center rounded-full border bg-muted text-xs font-semibold`,children:t}),(0,I.jsxs)(`div`,{className:`min-w-0`,children:[(0,I.jsxs)(`div`,{className:`inline-flex items-center gap-1 text-sm font-medium`,children:[(0,I.jsx)(`span`,{children:e.title}),e.status===`completed`&&(0,I.jsx)(dn,{className:`h-4 w-4 shrink-0 text-emerald-600`,"aria-hidden":`true`})]}),(0,I.jsx)(`div`,{className:`text-xs text-muted-foreground`,children:e.description})]})]}),(0,I.jsx)(Y,{variant:e.status===`failed`?`destructive`:e.status===`completed`?`outline-solid`:e.status===`active`?`secondary`:`outline-solid`,className:e.status===`completed`?`border-emerald-300 bg-emerald-50 text-emerald-700`:void 0,children:e.status})]}),e.outcomeSummary&&(0,I.jsx)(`p`,{className:`mt-2 text-xs text-muted-foreground break-all whitespace-pre-line`,children:e.outcomeSummary}),e.id===lfe&&(0,I.jsxs)(`details`,{className:`mt-3 rounded-md border bg-muted/20 p-3`,children:[(0,I.jsx)(`summary`,{className:`cursor-pointer text-xs font-semibold text-muted-foreground`,children:`OAuth Metadata Sources`}),(0,I.jsxs)(`div`,{className:`mt-3 space-y-3`,children:[(0,I.jsxs)(`div`,{className:`space-y-1`,children:[(0,I.jsx)(`div`,{className:`text-xs font-medium`,children:`Resource Metadata`}),(0,I.jsxs)(`p`,{className:`text-xs text-muted-foreground break-all`,children:[`From `,Ie.resourceMetadata?.url??`not captured`]}),(0,I.jsx)(`pre`,{className:`max-h-56 overflow-x-auto rounded-md bg-muted p-2 text-xs`,children:A7(Ie.resourceMetadata?.bodyText)})]}),(0,I.jsxs)(`div`,{className:`space-y-1`,children:[(0,I.jsx)(`div`,{className:`text-xs font-medium`,children:`Authorization Server Metadata`}),(0,I.jsxs)(`p`,{className:`text-xs text-muted-foreground break-all`,children:[`From`,` `,Ie.authorizationServerMetadata?.url??`not captured`]}),(0,I.jsx)(`pre`,{className:`max-h-56 overflow-x-auto rounded-md bg-muted p-2 text-xs`,children:A7(Ie.authorizationServerMetadata?.bodyText)})]})]})]}),a&&n&&(0,I.jsxs)(`details`,{className:`mt-3 rounded-md border bg-muted/20 p-3`,children:[(0,I.jsx)(`summary`,{className:`cursor-pointer text-xs font-semibold text-muted-foreground`,children:`Captured exchange details`}),(0,I.jsx)(`div`,{className:`mt-3 space-y-3`,children:Array.from({length:Math.max(n.requests.length,n.responses.length)}).map((t,r)=>{let i=n.requests[r],a=n.responses[r];return(0,I.jsxs)(`div`,{className:`rounded-md border bg-background p-2`,children:[(0,I.jsx)(`div`,{className:`text-xs font-medium`,children:i?.label??a?.label??`Exchange ${r+1}`}),(0,I.jsxs)(`p`,{className:`mt-1 text-xs text-muted-foreground break-all`,children:[i?.method?`${i.method} `:``,i?.url??a?.url??`-`]}),typeof a?.status==`number`&&(0,I.jsxs)(`p`,{className:`mt-1 text-xs text-muted-foreground`,children:[`HTTP `,a.status]}),i?.bodyText&&(0,I.jsx)(`pre`,{className:`mt-2 max-h-40 overflow-auto rounded bg-muted p-2 text-xs`,children:i.bodyText}),a?.bodyText&&(0,I.jsx)(`pre`,{className:`mt-2 max-h-48 overflow-auto rounded bg-muted p-2 text-xs`,children:A7(a.bodyText)})]},`${e.id}-exchange-${r}`)})})]})]},e.id)})||(0,I.jsx)(`p`,{className:`text-sm text-muted-foreground`,children:`No steps yet.`})})]})]}),(0,I.jsx)(`div`,{className:`space-y-4 xl:col-span-1 min-w-0`,children:(0,I.jsxs)(K,{children:[(0,I.jsx)(gv,{className:`pb-3`,children:(0,I.jsxs)(`div`,{className:`flex items-start justify-between gap-2`,children:[(0,I.jsxs)(`div`,{children:[(0,I.jsx)(_v,{className:`text-base`,children:`Inspect`}),(0,I.jsx)(vv,{children:`Live events and network requests/responses for the OAuth flow.`})]}),(0,I.jsxs)(W,{type:`button`,size:`sm`,variant:`outline`,onClick:()=>void Ke(`raw`),disabled:!ue||!B,children:[(0,I.jsx)(yn,{className:`mr-2 h-4 w-4`}),`Copy/Export Raw Trace`]})]})}),(0,I.jsx)(q,{className:`space-y-3`,children:(0,I.jsxs)(CX,{value:Ce,onValueChange:e=>we(e),className:`min-w-0`,children:[(0,I.jsxs)(wX,{className:`grid grid-cols-2`,children:[(0,I.jsx)(TX,{value:`inspector`,children:`Network Inspector`}),(0,I.jsx)(TX,{value:`events`,children:`Live Debug`})]}),(0,I.jsx)(EX,{value:`events`,className:`mt-3`,children:(0,I.jsxs)(`div`,{className:`max-h-64 space-y-1 overflow-auto rounded-md border bg-muted/10 p-3 text-xs`,children:[V.length===0?(0,I.jsx)(`p`,{className:`text-muted-foreground`,children:`No events yet.`}):V.map((e,t)=>(0,I.jsxs)(`div`,{className:`break-all`,children:[(0,I.jsx)(`span`,{className:`mr-2 font-mono text-muted-foreground`,children:new Date(e.ts).toLocaleTimeString()}),(0,I.jsx)(Y,{variant:`outline`,className:`mr-2 text-[10px]`,children:e.type}),typeof e.payload.message==`string`?e.payload.message:JSON.stringify(e.payload)]},`${e.ts}-${t}`)),(0,I.jsx)(`div`,{ref:Ee})]})}),(0,I.jsxs)(EX,{value:`inspector`,className:`space-y-3 mt-3`,children:[(0,I.jsxs)(`div`,{className:`grid gap-2 md:grid-cols-2`,children:[(0,I.jsxs)(`div`,{className:`space-y-1`,children:[(0,I.jsx)(Q,{className:`text-xs`,children:`Filter by step`}),(0,I.jsxs)(OY,{value:ye,onValueChange:be,children:[(0,I.jsx)(AY,{className:`h-8`,children:(0,I.jsx)(kY,{})}),(0,I.jsxs)(NY,{children:[(0,I.jsx)(Z,{value:`all`,children:`All steps`}),(B?.stepStates??[]).map(e=>(0,I.jsxs)(Z,{value:e.id,children:[Fe.get(e.id),`. `,e.title]},e.id))]})]})]}),(0,I.jsxs)(`div`,{className:`space-y-1`,children:[(0,I.jsx)(Q,{className:`text-xs`,children:`Filter by status`}),(0,I.jsxs)(OY,{value:xe,onValueChange:Se,children:[(0,I.jsx)(AY,{className:`h-8`,children:(0,I.jsx)(kY,{})}),(0,I.jsxs)(NY,{children:[(0,I.jsx)(Z,{value:`all`,children:`All`}),(0,I.jsx)(Z,{value:`ok`,children:`Successful responses`}),(0,I.jsx)(Z,{value:`error`,children:`Error responses`})]})]})]})]}),(0,I.jsx)(`div`,{className:`max-h-136 min-w-0 space-y-2 overflow-auto`,children:Me.length===0?(0,I.jsx)(`p`,{className:`text-sm text-muted-foreground`,children:`No network exchanges captured yet.`}):Me.map(e=>(0,I.jsxs)(`details`,{className:`rounded-md border p-3`,children:[(0,I.jsx)(`summary`,{className:`cursor-pointer list-none`,children:(0,I.jsxs)(`div`,{className:`flex items-center justify-between gap-2`,children:[(0,I.jsxs)(`div`,{className:`min-w-0 flex items-start gap-2`,children:[(0,I.jsx)(`div`,{className:`mt-0.5 inline-flex h-6 w-6 shrink-0 items-center justify-center rounded-full border bg-muted text-xs font-semibold`,children:Fe.get(e.stepId)}),(0,I.jsxs)(`div`,{className:`min-w-0`,children:[(0,I.jsx)(`div`,{className:`text-sm font-medium`,children:e.label}),(0,I.jsxs)(`div`,{className:`text-xs text-muted-foreground break-all`,children:[e.method?`${e.method} `:``,e.url]})]})]}),(0,I.jsxs)(`div`,{className:`flex items-center gap-2`,children:[(0,I.jsx)(Y,{variant:`outline`,children:`request`}),(0,I.jsx)(Y,{variant:`outline`,children:`response`}),typeof e.response?.status==`number`&&(0,I.jsx)(Y,{variant:e.response.status>=400?`destructive`:`secondary`,children:e.response.status})]})]})}),(0,I.jsxs)(`div`,{className:`mt-3 space-y-3`,children:[(0,I.jsxs)(`div`,{children:[(0,I.jsx)(`div`,{className:`mb-1 text-xs font-medium`,children:`Request Headers`}),(0,I.jsx)(`pre`,{className:`max-h-40 max-w-full overflow-auto whitespace-pre-wrap break-all rounded bg-muted p-2 text-xs`,children:JSON.stringify(e.request?.headers??{},null,2)})]}),e.request?.bodyText&&(0,I.jsxs)(`div`,{children:[(0,I.jsx)(`div`,{className:`mb-1 text-xs font-medium`,children:`Request Body`}),(0,I.jsx)(`pre`,{className:`max-h-64 max-w-full overflow-auto whitespace-pre-wrap break-all rounded bg-muted p-2 text-xs`,children:e.request.bodyText})]}),(0,I.jsxs)(`div`,{children:[(0,I.jsx)(`div`,{className:`mb-1 text-xs font-medium`,children:`Response Headers`}),(0,I.jsx)(`pre`,{className:`max-h-40 max-w-full overflow-auto whitespace-pre-wrap break-all rounded bg-muted p-2 text-xs`,children:JSON.stringify(e.response?.headers??{},null,2)})]}),e.response?.bodyText&&(0,I.jsxs)(`div`,{children:[(0,I.jsx)(`div`,{className:`mb-1 text-xs font-medium`,children:`Response Body`}),(0,I.jsx)(`pre`,{className:`max-h-64 max-w-full overflow-auto whitespace-pre-wrap break-all rounded bg-muted p-2 text-xs`,children:e.response.bodyText})]}),(0,I.jsx)(`div`,{className:`flex gap-2`,children:(0,I.jsxs)(W,{type:`button`,size:`sm`,variant:`outline`,onClick:()=>void O7(JSON.stringify(e,null,2)),children:[(0,I.jsx)(vn,{className:`mr-2 h-4 w-4`}),`Copy JSON`]})})]})]},e.key))})]})]})})]})})]})}),i===`report`&&B&&(0,I.jsxs)(`div`,{className:`space-y-4`,children:[(0,I.jsxs)(`div`,{className:`flex items-center justify-between gap-2`,children:[(0,I.jsxs)(`div`,{children:[(0,I.jsx)(`h2`,{className:`text-xl font-semibold`,children:`Report / Export`}),(0,I.jsx)(`p`,{className:`text-sm text-muted-foreground`,children:`OAuth debug session summary, validations, and trace exports.`})]}),(0,I.jsxs)(`div`,{className:`flex gap-2`,children:[(0,I.jsx)(W,{type:`button`,size:`sm`,variant:`outline`,onClick:()=>a(`configure`),children:`Back to Configure`}),(0,I.jsxs)(W,{type:`button`,size:`sm`,variant:`outline`,onClick:()=>void Ke(`json`),children:[(0,I.jsx)(yn,{className:`mr-2 h-4 w-4`}),`Export JSON`]}),(0,I.jsxs)(W,{type:`button`,size:`sm`,variant:`outline`,onClick:()=>void Ke(`markdown`),children:[(0,I.jsx)(yn,{className:`mr-2 h-4 w-4`}),`Export Markdown`]}),(0,I.jsxs)(W,{type:`button`,size:`sm`,variant:`outline`,onClick:()=>void Ke(`raw`),children:[(0,I.jsx)(yn,{className:`mr-2 h-4 w-4`}),`Copy/Export Raw Trace`]})]})]}),(0,I.jsxs)(R5,{children:[(0,I.jsx)(un,{className:`h-4 w-4`}),(0,I.jsx)(z5,{children:`Secrets display mode`}),(0,I.jsx)(B5,{children:B.summary?.showSensitiveValues?`This session is configured to show full tokens and secrets in network logs/exports.`:`Sensitive values are hidden in the inspector for this session.`})]}),(0,I.jsxs)(`div`,{className:`grid gap-4 md:grid-cols-2 xl:grid-cols-4`,children:[(0,I.jsx)(K,{children:(0,I.jsxs)(q,{className:`pt-4`,children:[(0,I.jsx)(`div`,{className:`text-xs text-muted-foreground`,children:`Status`}),(0,I.jsx)(`div`,{className:`text-lg font-semibold`,children:B.status})]})}),(0,I.jsx)(K,{children:(0,I.jsxs)(q,{className:`pt-4`,children:[(0,I.jsx)(`div`,{className:`text-xs text-muted-foreground`,children:`Requests`}),(0,I.jsx)(`div`,{className:`text-lg font-semibold`,children:B.networkSummary.requestCount})]})}),(0,I.jsx)(K,{children:(0,I.jsxs)(q,{className:`pt-4`,children:[(0,I.jsx)(`div`,{className:`text-xs text-muted-foreground`,children:`Network errors`}),(0,I.jsx)(`div`,{className:`text-lg font-semibold`,children:B.networkSummary.errorCount})]})}),(0,I.jsx)(K,{children:(0,I.jsxs)(q,{className:`pt-4`,children:[(0,I.jsx)(`div`,{className:`text-xs text-muted-foreground`,children:`Validation findings`}),(0,I.jsx)(`div`,{className:`text-lg font-semibold`,children:B.validations.length})]})})]}),(0,I.jsxs)(K,{children:[(0,I.jsx)(gv,{className:`pb-3`,children:(0,I.jsx)(_v,{className:`text-base`,children:`Key values`})}),(0,I.jsxs)(q,{className:`grid gap-3 md:grid-cols-2`,children:[(0,I.jsxs)(`div`,{children:[(0,I.jsx)(Q,{className:`text-xs`,children:`Issuer`}),(0,I.jsx)(`p`,{className:`text-sm break-all`,children:B.summary?.issuer||`-`})]}),(0,I.jsxs)(`div`,{children:[(0,I.jsx)(Q,{className:`text-xs`,children:`Client ID`}),(0,I.jsx)(`p`,{className:`text-sm break-all`,children:B.summary?.clientId||`-`})]}),(0,I.jsxs)(`div`,{children:[(0,I.jsx)(Q,{className:`text-xs`,children:`Redirect URI`}),(0,I.jsx)(`p`,{className:`text-sm break-all`,children:B.summary?.redirectUri||`-`})]}),(0,I.jsxs)(`div`,{children:[(0,I.jsx)(Q,{className:`text-xs`,children:`Token endpoint status`}),(0,I.jsx)(`p`,{className:`text-sm`,children:B.summary?.tokenEndpointStatus??`-`})]}),(0,I.jsxs)(`div`,{children:[(0,I.jsx)(Q,{className:`text-xs`,children:`Token type`}),(0,I.jsx)(`p`,{className:`text-sm`,children:B.summary?.tokenType||`-`})]}),(0,I.jsxs)(`div`,{children:[(0,I.jsx)(Q,{className:`text-xs`,children:`Scopes granted`}),(0,I.jsx)(`p`,{className:`text-sm break-all`,children:(B.summary?.grantedScopes??[]).join(`, `)||`-`})]}),(0,I.jsxs)(`div`,{children:[(0,I.jsx)(Q,{className:`text-xs`,children:`Token validity`}),(0,I.jsxs)(`p`,{className:`text-sm`,children:[typeof B.summary?.accessTokenValidForSeconds==`number`?`${f6(B.summary.accessTokenValidForSeconds)} remaining`:typeof B.summary?.accessTokenExpiresInSeconds==`number`?`${f6(B.summary.accessTokenExpiresInSeconds)} from issuance`:`No expiry advertised by token endpoint`,B.summary?.accessTokenExpiresAt?(0,I.jsxs)(I.Fragment,{children:[` (until `,(0,I.jsx)(`span`,{children:new Date(B.summary.accessTokenExpiresAt).toLocaleTimeString()}),`)`]}):``]}),(0,I.jsxs)(`p`,{className:`text-xs text-muted-foreground`,children:[`Source:`,` `,B.summary?.accessTokenExpirySource===`expires_in`?`token endpoint expires_in`:B.summary?.accessTokenExpirySource===`jwt_exp`?`JWT exp claim`:`not available`]})]}),(0,I.jsxs)(`div`,{children:[(0,I.jsx)(Q,{className:`text-xs`,children:`Refresh option`}),(0,I.jsx)(`p`,{className:`text-sm`,children:B.summary?.refreshTokenAvailable?`Refresh token available (silent refresh possible)`:`No refresh token in response (full login likely required after expiry)`})]}),B.summary?.accessToken&&(0,I.jsxs)(`div`,{className:`md:col-span-2 space-y-1`,children:[(0,I.jsx)(Q,{className:`text-xs`,children:`Access token`}),(0,I.jsxs)(`div`,{className:`flex items-center gap-2`,children:[(0,I.jsxs)(`code`,{className:`flex-1 truncate rounded bg-muted px-2 py-1 text-xs font-mono text-muted-foreground`,children:[B.summary.accessToken.slice(0,48),`…`]}),(0,I.jsxs)(W,{type:`button`,size:`sm`,variant:`outline`,className:`shrink-0 h-7 px-2 text-xs`,onClick:()=>void O7(B.summary.accessToken),children:[(0,I.jsx)(vn,{className:`mr-1 h-3 w-3`}),`Copy token`]})]}),(0,I.jsxs)(`p`,{className:`text-xs text-muted-foreground`,children:[`Visible because "Hide sensitive values" is off. Use this token with the CLI via`,` `,(0,I.jsx)(`code`,{className:`font-mono`,children:`--oauth-token`}),`.`]})]})]})]}),(0,I.jsxs)(K,{children:[(0,I.jsx)(gv,{className:`pb-3`,children:(0,I.jsx)(_v,{className:`text-base`,children:`Validation findings`})}),(0,I.jsx)(q,{className:`space-y-2`,children:B.validations.length===0?(0,I.jsx)(`p`,{className:`text-sm text-muted-foreground`,children:`No validation findings recorded.`}):B.validations.map((e,t)=>(0,I.jsxs)(`div`,{className:`rounded-md border p-3`,children:[(0,I.jsxs)(`div`,{className:`mb-1 flex items-center justify-between gap-2`,children:[(0,I.jsxs)(`div`,{className:`flex items-center gap-2`,children:[(0,I.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:t+1}),(0,I.jsx)(`span`,{className:`font-bold`,children:e.title})]}),(0,I.jsx)(Y,{variant:Je(e.severity),children:e.severity})]}),(0,I.jsxs)(`p`,{className:`text-sm`,children:[(0,I.jsx)(`span`,{className:`font-bold`,children:`Finding:`}),` `,e.detail]}),e.recommendation&&(0,I.jsxs)(`div`,{className:`mt-2 rounded-md border px-2.5 py-2 text-xs`,children:[(0,I.jsx)(`div`,{className:`mb-1 font-medium text-muted-foreground`,children:`Suggested improvement`}),(0,I.jsx)(`p`,{children:e.recommendation})]}),(0,I.jsxs)(`div`,{className:`mt-2 text-xs text-muted-foreground`,children:[`Step: `,e.stepId,e.specReference&&(0,I.jsxs)(I.Fragment,{children:[` · `,(0,I.jsx)(`a`,{href:e.specReference,target:`_blank`,rel:`noreferrer`,className:`text-primary underline`,children:`Spec reference`})]})]})]},e.id))})]})]})]})}function mfe(e){let t=e.filter(e=>typeof e.sourcePath==`string`&&e.sourcePath.trim().length>0&&typeof e.relativePath==`string`&&e.relativePath.trim().length>0).map(e=>[e.sourcePath,e.relativePath]);return new Map(t)}function hfe(e){let t=e.filter(e=>typeof e.sourcePath==`string`&&e.sourcePath.trim().length>0).map(e=>[e.sourcePath,e.configName?.trim()||e.name]);return new Map(t)}function gfe(e,t){let n=new Map;for(let r of e){if(!r.sourcePath)continue;let e=new Map,i=r.scenarioEntries&&r.scenarioEntries.length>0?r.scenarioEntries:r.scenarios.map(e=>({kind:`inline`,scenario:e}));for(let n of i){if(n.kind===`inline`){e.set(n.scenario.id,n.scenario.name?.trim()||n.scenario.id);continue}let r=t.find(e=>e.id===n.ref);e.set(n.ref,r?.name?.trim()||n.ref)}n.set(r.sourcePath,e)}return n}function j7(e,t){let n=t.get(e);if(n)return n;let r=e.replace(/\\/g,`/`),i=r.lastIndexOf(`/evals/`);if(i>=0)return r.slice(i+7);let a=r.split(`/`).filter(Boolean);return a.length<=1?r:a.slice(-3).join(`/`)}function M7(e,t,n){let r=t.get(n);if(!e||e.length===0){if(r&&r.size===1){let e=r.values().next().value;if(e)return e}return`All scenarios`}if(!r)return e.length===1?e[0]:`${e[0]} +${e.length-1}`;let i=e.map(e=>r.get(e)??e);return i.length===1?i[0]:`${i[0]} +${i.length-1}`}var N7=`mcplab.runEvaluation.activeJobId`;function _fe(e){return e.configName?.trim()||e.name}function vfe(e){if(e.suitePath?.trim())return e.suitePath.trim();if(e.relativePath?.includes(`/`)){let t=e.relativePath.lastIndexOf(`/`);return e.relativePath.slice(0,t)}return null}function P7(){return new Date().toLocaleTimeString()}function F7(e){return e.executionType===`rover`&&[`queued`,`waiting_for_rover`,`running`,`paused_rover`].includes(e.status)}function yfe(e){return e.jobs.flatMap(e=>e.childProgress?.length?e.childProgress.map(t=>({job:e,child:t})):[{job:e}])}var bfe=()=>{let[e]=cp(),[t,n]=(0,_.useState)(``),[r,i]=(0,_.useState)(`1`),[a,o]=(0,_.useState)(!1),[s,c]=(0,_.useState)(0),[l,u]=(0,_.useState)([]),[d,f]=(0,_.useState)(!1),[p,m]=(0,_.useState)(!1),[h,g]=(0,_.useState)(null),[v,y]=(0,_.useState)(!1),[b,x]=(0,_.useState)(``),[S,C]=(0,_.useState)(null),[w,T]=(0,_.useState)([]),[E,D]=(0,_.useState)(`agent_default`),[k,A]=(0,_.useState)([]),[j,M]=(0,_.useState)(!1),[N,P]=(0,_.useState)([]),[F,L]=(0,_.useState)({}),[R,z]=(0,_.useState)({}),[ee,te]=(0,_.useState)(``),[ne,re]=(0,_.useState)([]),[ie,ae]=(0,_.useState)([]),[oe,se]=(0,_.useState)([]),[ce,B]=(0,_.useState)([]),[le,ue]=(0,_.useState)(null),[de,V]=(0,_.useState)(null),[fe,pe]=(0,_.useState)(!1),[me,he]=(0,_.useState)(null),ge=(0,_.useRef)(null),_e=(0,_.useRef)(null),ve=(0,_.useRef)(null),ye=(0,_.useRef)(new Map),be=(0,_.useRef)(!1),{configs:xe,reload:Se}=fv(),{source:Ce}=nv(),{agents:we,scenarios:Te,servers:Ee,reload:De}=hv(),Oe=b.trim(),ke=Oe?`/results/${encodeURIComponent(Oe)}${t?`?configId=${encodeURIComponent(t)}`:``}`:`/results`,Ae=xe.find(e=>e.id===t),je=(0,_.useMemo)(()=>mfe(xe),[xe]),Me=(0,_.useMemo)(()=>hfe(xe),[xe]),Ne=(0,_.useMemo)(()=>gfe(xe,Te),[xe,Te]),Pe=ie[0]??null,Fe=(0,_.useMemo)(()=>ce.find(e=>e.jobs.some(e=>e.jobId===S))??null,[ce,S]),Ie=Fe?Math.max(s,Fe.totalJobs>0?Math.round(Fe.completedJobs/Fe.totalJobs*100):0):s,Le=e.get(`configId`),Re=(0,_.useMemo)(()=>{if(!Ae)return[];let e=new Map,t=Ae.agentEntries&&Ae.agentEntries.length>0?Ae.agentEntries:Ae.agents.map(e=>({kind:`inline`,agent:e}));for(let n of t){if(n.kind===`inline`){let t=n.agent.id;e.has(t)||e.set(t,n.agent);continue}let t=we.find(e=>e.id===n.ref);t&&!e.has(t.id)&&e.set(t.id,t)}for(let t of we)e.has(t.id)||e.set(t.id,t);return Array.from(e.values())},[Ae,we]),ze=(0,_.useMemo)(()=>{if(!Ae)return[];let e=new Map,t=Ae.scenarioEntries&&Ae.scenarioEntries.length>0?Ae.scenarioEntries:Ae.scenarios.map(e=>({kind:`inline`,scenario:e}));for(let n of t){if(n.kind===`inline`){e.has(n.scenario.id)||e.set(n.scenario.id,n.scenario);continue}let t=Te.find(e=>e.id===n.ref);t&&!e.has(t.id)&&e.set(t.id,t)}return Array.from(e.values())},[Ae,Te]),Be=(0,_.useMemo)(()=>Re.filter(e=>e.type===`browser`&&w.includes(e.id)),[Re,w]),Ve=Be.length>0?1:Number(r),He=(0,_.useMemo)(()=>[{label:`LLM Agents`,agents:Re.filter(e=>e.type!==`browser`)},{label:`Browser Agents`,agents:Re.filter(e=>e.type===`browser`)}],[Re]),Ue=(0,_.useMemo)(()=>{let e=new Map;for(let t of Ee)e.has(t.id)||e.set(t.id,{id:t.id,name:t.name});for(let t of Ae?.servers??[])e.set(t.id,{id:t.id,name:t.name});return Array.from(e.values()).sort((e,t)=>e.id.localeCompare(t.id))},[Ae?.servers,Ee]);(0,_.useEffect)(()=>{Le&&xe.some(e=>e.id===Le)&&n(Le)},[Le,xe]);let We=(0,_.useRef)(``);(0,_.useEffect)(()=>{let e=Ae?`${Ae.id}::${Ae.sourcePath??``}`:``;if(e===We.current)return;if(We.current=e,!Ae){T([]),D(`agent_default`),A([]),M(!1),P([]),L({}),z({});return}let t=IY(Ae);T(t.length>0?t:Re.map(e=>e.id)),D(`agent_default`),A(ze.map(e=>e.id)),M(!1),P([]),L({}),z({})},[Ae?.id,Ae?.sourcePath,Re,ze]);let Ge=async()=>{if(!Ae?.sourcePath){u(e=>[...e,`[${P7()}] Missing source path for selected config.`]);return}let e=Re.filter(e=>w.includes(e.id));if(e.length===0){u(e=>[...e,`[${P7()}] Select at least one agent.`]);return}let t=ze.filter(e=>k.includes(e.id)),n=new Set(t.map(e=>e.id)),r=j||Object.values(F).some(Boolean),i=Object.fromEntries(Object.entries(R).filter(([e])=>n.has(e)&&F[e])),a=t.map(e=>{let t=i[e.id]??(j?N:e.serverIds||[]);return`${e.id}=[${t.join(`, `)}]`}).join(`; `);if(t.length===0){u(e=>[...e,`[${P7()}] Select at least one test.`]);return}if(j&&N.length===0){u(e=>[...e,`[${P7()}] Select at least one server for "Override MCP Servers for Selected Tests", or turn that override off.`]);return}let s=Object.entries(i).filter(([,e])=>!Array.isArray(e)||e.length===0).map(([e])=>e);if(s.length>0){u(e=>[...e,`[${P7()}] Select at least one server for per-scenario overrides on: ${s.join(`, `)}, or turn those overrides off.`]);return}let l=Array.from(new Set(t.flatMap(e=>r?i[e.id]?i[e.id]??[]:j?N:e.serverIds||[]:e.serverIds||[]).filter(e=>{let t=(Ae.servers??[]).find(t=>t.id===e),n=Ee.find(t=>t.id===e);return(t||n)?.authType===`oauth2`})));try{l.length>0&&(pe(!0),await e6({serverNames:l,source:Ce,onServerAuthStart:e=>{u(t=>[...t,`[${P7()}] OAuth login required for '${e}'. Complete the browser sign-in flow...`])}}),u(e=>[...e,`[${P7()}] OAuth login completed for required server(s): ${l.join(`, `)}.`]))}catch(e){let t=e instanceof Error?e.message:String(e);u(e=>[...e,`[${P7()}] OAuth error: ${t}`]),pe(!1);return}finally{pe(!1)}o(!0),f(!1),y(!1),x(``);let d=(Ae.serverEntries??[]).some(e=>e.kind===`referenced`)||(Ae.agentEntries??[]).some(e=>e.kind===`referenced`)||(Ae.scenarioEntries??[]).some(e=>e.kind===`referenced`)?`refs-composed`:`single-file/inline`,p={...Be.length>0&&E!==`agent_default`?{newConversationBeforeStart:E===`new`,newConversationBetweenScenarios:E===`new`}:{}};u([`[${P7()}] Starting evaluation run...`,`[${P7()}] Config=${Ae.name} mode=${d} agents=${e.map(e=>e.name||e.id).join(`, `)} tests=${t.map(e=>e.id).join(`, `)} runs=${Ve}${Be.length>0?` newConversationBeforeStart=${p.newConversationBeforeStart??`agent_default`} newConversationBetweenScenarios=${p.newConversationBetweenScenarios??`agent_default`}`:``}${ee.trim()?` note=${ee.trim()}`:``}`,`[${P7()}] Effective MCP servers per selected test: ${a||`(none)`}`]),c(10);try{let{jobId:n}=await Ce.startRun({configPath:Ae.sourcePath,runsPerScenario:Ve,agents:e.map(e=>e.id),scenarioIds:t.map(e=>e.id),...p,...r&&j?{serverOverrideAll:N}:{},...r&&Object.keys(i).length>0?{scenarioServerOverrides:i}:{},runNote:ee.trim()?ee.trim():void 0});C(n),Ye(n),rt(n),Xe()}catch(e){let t=e instanceof Error?e.message:String(e),n=t.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.`:``;u(e=>[...e,`[${P7()}] Error: ${t}${n}`]),o(!1),c(0),C(null),pe(!1)}},Ke=()=>{Ge()},qe=()=>{ve.current=null,S&&Ce.stopRun(S),_e.current?.(),_e.current=null,Je(),C(null),o(!1),f(!1),y(!0),u(e=>[...e,`[${P7()}] Run aborted by user.`]),Xe()};(0,_.useEffect)(()=>{ge.current&&(ge.current.scrollTop=ge.current.scrollHeight)},[l]),(0,_.useEffect)(()=>()=>{ve.current=null,_e.current?.()},[]),(0,_.useEffect)(()=>{if(S||d)return;let e=``;try{e=sessionStorage.getItem(N7)??``}catch{e=``}if(e)return C(e),o(!0),f(!1),y(!1),u(e=>e.length>0?e:[`[${P7()}] Reattached to in-progress evaluation run...`]),rt(e),()=>{}},[S,d]);let Je=()=>{try{sessionStorage.removeItem(N7)}catch{}},Ye=e=>{try{sessionStorage.setItem(N7,e)}catch{}},Xe=async(e=!1)=>{try{let t=await Ce.getRunQueue(),n=t.evaluations??[],r=new Set(n.map(e=>e.evaluationRunId)),i=ye.current;if(e&&!ve.current){let e=Array.from(i.values()).find(e=>[`queued`,`running`].includes(e.status)&&!r.has(e.evaluationRunId));e&&Ce.getResult(e.evaluationRunId).then(t=>{if(!t||ve.current)return;let n=(t.outcomes?.stopped??0)>0||(t.outcomes?.incomplete??0)>0;o(!1),c(100),x(e.evaluationRunId),g(null),m((t.outcomes?.error??0)>0),y(n),f(!n)}).catch(()=>{})}ye.current=new Map(n.map(e=>[e.evaluationRunId,e])),re(t.queued),ae(t.active_jobs??(t.active?[t.active]:[])),se(t.admitting_jobs??[]),B((t.evaluations??[]).filter(e=>![`completed`,`partial`,`failed`].includes(e.status)));let a=S==null?void 0:t.queued.find(e=>e.jobId===S&&e.status===`blocked_auth`&&e.blockedReason===`oauth_required`);a&&(a.requiredServers??[]).length>0?he(e=>e?.jobId===a.jobId?e:{jobId:a.jobId,servers:a.requiredServers}):(me?.jobId&&me.jobId!==S||S!=null&&!t.queued.some(e=>e.jobId===S&&e.status===`blocked_auth`&&e.blockedReason===`oauth_required`))&&he(null)}catch{}},Ze=()=>{Se(),De()};(0,_.useEffect)(()=>{Ze(),Xe();let e=Ce.subscribeRunQueue(e=>{e.type===`queue_event`&&Xe(!0)}),t=()=>{Ze(),Xe()},n=()=>{Xe()};return window.addEventListener(`focus`,t),window.addEventListener(`mcplab:run-queue-changed`,n),()=>{window.removeEventListener(`focus`,t),window.removeEventListener(`mcplab:run-queue-changed`,n),e()}},[Se,De,Ce]);let Qe=async e=>{try{await Ce.removeQueuedRun(e),re(t=>t.filter(t=>t.jobId!==e))}catch(t){let n=t instanceof Error?t.message:String(t);if(n.includes(`Use the /stop endpoint`))try{await Ce.stopRun(e)}catch{}else O({title:`Could not remove queued run`,description:n,variant:`destructive`})}Xe()},$e=async e=>{let t=Array.from(new Set(e.jobs.flatMap(e=>e.requiredServers??[])));if(!(t.length===0||be.current)){be.current=!0,pe(!0);try{await e6({serverNames:t,source:Ce}),await Ce.resumeQueue()}catch(e){O({title:`Could not connect OAuth`,description:e instanceof Error?e.message:String(e),variant:`destructive`})}finally{be.current=!1,pe(!1),Xe()}}},et=async e=>{if(de!==e){V(e);try{await Ce.stopEvaluationRun(e),await Xe()}catch(e){O({title:`Could not stop run`,description:e instanceof Error?e.message:String(e),variant:`destructive`})}finally{V(null)}}},tt=async e=>{try{await Ce.removeEvaluationRun(e),await Xe()}catch(e){O({title:`Could not remove run`,description:e instanceof Error?e.message:String(e),variant:`destructive`})}},nt=async e=>{try{await Ce.openRover(e),await Xe()}catch(e){O({title:`Could not open browser agent`,description:e instanceof Error?e.message:String(e),variant:`destructive`})}},rt=e=>{S===e&&_e.current||(_e.current?.(),ve.current=e,_e.current=Ce.subscribeRunJob(e,t=>{let n=new Date(t.ts).toLocaleTimeString();if(t.type===`queued`)u(e=>{let r=t.payload.position?` (position ${t.payload.position})`:``,i=`[${n}] Run queued${r}. Waiting for active run to finish...`;return e.includes(i)?e:[...e,i]}),c(5);else if(t.type===`oauth_required`){let e=Array.isArray(t.payload.servers)?t.payload.servers:[],r=String(t.payload.jobId??``);he({jobId:r,servers:e}),u(t=>{let r=`[${n}] OAuth required for server(s): ${e.join(`, `)}. Click "Connect & Resume" to authenticate.`;return t.includes(r)?t:[...t,r]})}else{if(t.type===`started`&&(he(null),be.current=!1,o(!0),f(!1),y(!1),u(e=>{let t=`[${n}] Run started.`;return e.includes(t)?e:[...e,t]}),c(e=>Math.max(e,30)),Xe()),t.type===`log`){let e=String(t.payload.message??``).trim();e&&(u(t=>{let r=`[${n}] ${e}`;return t.includes(r)?t:[...t,r]}),c(t=>{let n=e.toLowerCase();if(n.startsWith(`loading mcp evaluation config`))return Math.max(t,15);if(n.startsWith(`loaded config`))return Math.max(t,20);if(n.startsWith(`selected `))return Math.max(t,30);if(n.startsWith(`using requested agents`)||n.startsWith(`using run default agents`)||n.startsWith(`using config-declared agents`))return Math.max(t,35);if(n.startsWith(`expanded to `))return Math.max(t,45);if(n.startsWith(`running evaluation`))return Math.max(t,50);let r=n.match(/^scenario (\d+)\/(\d+) finished:/);if(r){let e=Number(r[1]),n=Number(r[2]);return Math.max(t,50+Math.round(e/n*25))}return n.startsWith(`evaluation execution finished`)?Math.max(t,78):n.startsWith(`writing results to `)?Math.max(t,94):n.startsWith(`run finished:`)?Math.max(t,98):t}))}if(t.type===`completed`||t.type===`error`){let r=t.type===`error`,i=String(t.payload.runId??``).trim(),a=n=>t.payload.status===`stopped`||[`Run stopped by user`,`Run aborted by user`].includes(String(t.payload.message))||n?.status===`stopped`||n?.jobs.find(t=>t.jobId===e)?.status===`stopped`,s=e=>{if(!r||a(e))return;let i=String(t.payload.message??`Unknown error`),o=i.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.`:``;u(e=>[...e,`[${n}] Error: ${i}${o}`])},l=e=>{s(e);let t=r&&!a(e)||(e?.failedJobs??0)-(e?.stoppedJobs??0)>0,l=a(e)&&!t&&!e?.completedJobs&&!i;he(null),be.current=!1,u(r=>{let i=`[${n}] ${t?`Run completed with errors.`:a(e)?`Run stopped.`:`Run completed.`}`;return r.includes(i)?r:[...r,i]}),c(100),o(!1),f(!l),m(t),g(e??null),y(l),x(e?.completedJobs?e.evaluationRunId:r&&!a(e)?``:i),Je(),C(null),ve.current=null,_e.current?.(),_e.current=null,Xe()};Ce.getRunQueue().then(t=>{if(ve.current!==e)return;let r=t.evaluations?.find(t=>t.jobs.some(t=>t.jobId===e))??t.evaluations?.find(e=>e.evaluationRunId===i),a=r?.jobs.find(t=>t.jobId!==e&&[`queued`,`waiting_for_rover`,`paused_rover`,`running`].includes(t.status))??r?.jobs.find(t=>t.jobId!==e&&t.status===`blocked_auth`);if(a&&r){s(r);let e=r.completedJobs+r.failedJobs,t=`[${n}] Subtask finished. ${e}/${r.totalJobs} finished. Continuing with the remaining run tasks...`;u(e=>e.includes(t)?e:[...e,t]),c(t=>Math.max(t,r.totalJobs>0?Math.round(e/r.totalJobs*100):t)),he(a.status===`blocked_auth`?{jobId:a.jobId,servers:a.requiredServers??[]}:null),be.current=!1,o(!0),f(!1),y(!1),C(a.jobId),Ye(a.jobId),Xe(),rt(a.jobId)}else l(r)}).catch(()=>{ve.current===e&&l()})}}}))},it=e=>{S===e&&_e.current||(C(e),Ye(e),o(!0),f(!1),y(!1),u([`[${P7()}] Attached to running job ${e}...`]),c(10),rt(e))};return(0,I.jsxs)(`div`,{className:`space-y-6`,children:[(0,I.jsxs)(`div`,{children:[(0,I.jsxs)(`h1`,{className:`inline-flex items-center gap-2 text-2xl font-bold`,children:[(0,I.jsx)(Yn,{className:`h-6 w-6`}),`Run Evaluation`]}),(0,I.jsx)(`p`,{className:`text-sm text-muted-foreground`,children:`Execute evaluation scenarios against MCP servers`})]}),(0,I.jsx)(K,{children:(0,I.jsxs)(q,{className:`pt-6 space-y-4`,children:[(0,I.jsxs)(`div`,{className:`grid gap-4 sm:grid-cols-2`,children:[(0,I.jsxs)(`div`,{className:`space-y-2`,children:[(0,I.jsx)(Q,{children:`MCP Evaluation`}),(0,I.jsxs)(`div`,{className:`flex items-center gap-2`,children:[(0,I.jsxs)(OY,{value:t,onValueChange:n,children:[(0,I.jsx)(AY,{children:(0,I.jsx)(kY,{placeholder:`Select a config`})}),(0,I.jsx)(NY,{children:xe.map(e=>{let t=vfe(e);return(0,I.jsxs)(Z,{value:e.id,children:[(0,I.jsx)(`span`,{children:_fe(e)}),t&&(0,I.jsxs)(`span`,{className:`ml-2 text-muted-foreground`,children:[`(`,t,`)`]})]},e.id)})})]}),(0,I.jsx)(W,{type:`button`,variant:`outline`,size:`icon`,className:`h-10 w-10 shrink-0`,onClick:Ze,"aria-label":`Refresh configs`,title:`Refresh configs`,children:(0,I.jsx)(Qn,{className:`h-4 w-4`})})]})]}),(0,I.jsxs)(`div`,{className:`space-y-2`,children:[(0,I.jsx)(Q,{htmlFor:`variance-runs`,children:`Variance Runs`}),(0,I.jsx)(Op,{id:`variance-runs`,type:`number`,min:`1`,max:`10`,value:Be.length>0?`1`:r,onChange:e=>i(e.target.value),disabled:Be.length>0}),Be.length>0&&(0,I.jsx)(`p`,{className:`text-xs text-muted-foreground`,children:`Browser agents support one run per scenario.`})]})]}),(0,I.jsxs)(`div`,{className:`space-y-2`,children:[(0,I.jsxs)(`div`,{className:`flex items-center justify-between`,children:[(0,I.jsx)(Q,{htmlFor:`run-note`,children:`Run Note`}),(0,I.jsxs)(`span`,{className:`text-xs text-muted-foreground`,children:[ee.length,`/500`]})]}),(0,I.jsx)(iX,{id:`run-note`,value:ee,onChange:e=>te(e.target.value.slice(0,500)),placeholder:`Optional context for this run (for example: mcp-server v1.8.2 #staging)`,rows:2})]}),Ae&&(0,I.jsxs)(`div`,{className:`space-y-2`,children:[(0,I.jsxs)(`div`,{className:`flex items-center justify-between`,children:[(0,I.jsx)(Q,{children:`Agents`}),(0,I.jsxs)(`div`,{className:`flex items-center gap-3 text-xs`,children:[(0,I.jsx)(`button`,{type:`button`,className:`text-primary hover:underline`,onClick:()=>T(Re.map(e=>e.id)),children:`Select all`}),(0,I.jsx)(`button`,{type:`button`,className:`text-primary hover:underline`,onClick:()=>T([]),children:`Clear`})]})]}),(0,I.jsx)(`div`,{className:`space-y-3`,children:He.map(e=>e.agents.length>0?(0,I.jsxs)(`div`,{className:`space-y-2`,children:[(0,I.jsxs)(`div`,{className:`flex items-center gap-3`,children:[(0,I.jsx)(`p`,{className:`text-xs font-medium text-muted-foreground`,children:e.label}),(0,I.jsxs)(`div`,{className:`flex items-center gap-3 text-xs`,children:[(0,I.jsx)(`button`,{type:`button`,className:`text-primary hover:underline`,"aria-label":`Select all ${e.label}`,onClick:()=>{let t=new Set(e.agents.map(e=>e.id));T(e=>[...e.filter(e=>!t.has(e)),...t])},children:`Select all`}),(0,I.jsx)(`button`,{type:`button`,className:`text-primary hover:underline`,"aria-label":`Clear ${e.label}`,onClick:()=>{let t=new Set(e.agents.map(e=>e.id));T(e=>e.filter(e=>!t.has(e)))},children:`Clear`})]})]}),(0,I.jsx)(`div`,{className:`grid gap-2 sm:grid-cols-2`,children:e.agents.map(e=>{let t=w.includes(e.id);return(0,I.jsxs)(`label`,{className:`flex items-center gap-2 rounded-md border p-2 text-sm`,children:[(0,I.jsx)(KX,{checked:t,onCheckedChange:t=>{let n=t===!0;T(t=>n?[...t,e.id]:t.filter(t=>t!==e.id))}}),(0,I.jsx)(`span`,{children:e.name||e.id})]},e.id)})})]},e.label):null)}),Be.length>0&&(0,I.jsxs)(`div`,{className:`space-y-1.5 rounded-md border bg-muted/20 p-3`,children:[(0,I.jsx)(Q,{htmlFor:`conversation-behavior`,children:`Conversation behavior`}),(0,I.jsxs)(OY,{value:E,onValueChange:e=>D(e),children:[(0,I.jsx)(AY,{id:`conversation-behavior`,children:(0,I.jsx)(kY,{})}),(0,I.jsxs)(NY,{children:[(0,I.jsx)(Z,{value:`agent_default`,children:`Use agent default`}),(0,I.jsx)(Z,{value:`new`,children:`Start a new conversation`}),(0,I.jsx)(Z,{value:`same`,children:`Continue the same conversation`})]})]}),(0,I.jsx)(`p`,{className:`text-xs text-muted-foreground`,children:`This setting is frozen into the Rover job. Rover cannot change it locally.`})]}),Re.length===0&&(0,I.jsx)(`p`,{className:`text-xs text-muted-foreground`,children:`No agents available. Add agents to your workspace library, or define inline agents in this config.`})]}),Ae&&(0,I.jsxs)(`div`,{className:`space-y-2`,children:[(0,I.jsxs)(`div`,{className:`flex items-center justify-between`,children:[(0,I.jsx)(Q,{children:`Tests`}),(0,I.jsxs)(`div`,{className:`flex items-center gap-3 text-xs`,children:[(0,I.jsx)(`button`,{type:`button`,className:`text-primary hover:underline`,onClick:()=>A(ze.map(e=>e.id)),children:`Select all`}),(0,I.jsx)(`button`,{type:`button`,className:`text-primary hover:underline`,onClick:()=>A([]),children:`Clear`})]})]}),(0,I.jsxs)(`p`,{className:`text-xs text-muted-foreground`,children:[k.length,` of `,ze.length,` selected`]}),(0,I.jsx)(`div`,{className:`grid gap-2 sm:grid-cols-2`,children:ze.map(e=>{let t=k.includes(e.id),n=R[e.id],r=!!F[e.id],i=r&&Array.isArray(n),a=new Set(e.serverIds||[]);return(0,I.jsxs)(`div`,{className:`flex flex-col gap-2 text-sm rounded-md border p-2 cursor-pointer`,onClick:n=>{let r=n.target;r&&(r.closest(`button, a, input, select, textarea, [role='button']`)||A(n=>t?n.filter(t=>t!==e.id):[...n,e.id]))},children:[(0,I.jsxs)(`div`,{className:`flex items-start gap-2`,children:[(0,I.jsx)(KX,{checked:t,onCheckedChange:t=>{let n=t===!0;A(t=>n?[...t,e.id]:t.filter(t=>t!==e.id))}}),(0,I.jsxs)(`span`,{className:`min-w-0`,children:[(0,I.jsxs)(`span`,{className:`block font-medium`,children:[e.name||e.id,` `,i&&(0,I.jsx)(`span`,{className:`rounded bg-primary/10 px-1.5 py-0.5 text-[10px] text-primary`,children:`Override`})]}),(0,I.jsx)(`span`,{className:`block font-mono text-xs text-muted-foreground truncate`,children:e.id})]})]}),t&&(0,I.jsxs)(`div`,{className:`pl-6`,children:[(0,I.jsxs)(`div`,{className:`flex items-center justify-between`,children:[(0,I.jsx)(Q,{className:`text-[11px] text-muted-foreground`,children:`Per-scenario: "Override MCP Servers"`}),(0,I.jsx)(L5,{checked:r,onCheckedChange:t=>{if(L(n=>({...n,[e.id]:t})),!t)z(t=>{let n={...t};return delete n[e.id],n});else if(!R[e.id]){let t=j&&N.length>0?[...N]:[...e.serverIds||[]];z(n=>({...n,[e.id]:t}))}}})]}),r&&(0,I.jsx)(`div`,{className:`mt-1 flex flex-wrap gap-1.5`,children:Ue.map(t=>{let r=t.id,i=(n??[]).includes(r),o=a.has(r);return(0,I.jsx)(Y,{variant:i?`default`:`outline-solid`,className:`cursor-pointer text-xs ${i?``:`opacity-60 hover:opacity-100`}`,style:!i&&o?{borderColor:`hsl(var(--primary))`}:void 0,onClick:t=>{t.stopPropagation(),z(t=>{let n=t[e.id]??[],i=n.includes(r)?n.filter(e=>e!==r):[...n,r];return{...t,[e.id]:i}})},children:t.name?.trim()?t.name:r},r)})})]})]},e.id)})}),(0,I.jsxs)(`div`,{className:`space-y-1 rounded-md border p-2`,children:[(0,I.jsxs)(`div`,{className:`flex items-center justify-between`,children:[(0,I.jsxs)(`div`,{className:`text-xs`,children:[(0,I.jsx)(`span`,{children:`Override MCP Servers for selected Tests `}),(0,I.jsx)(`span`,{className:`text-muted-foreground`,children:`Selected tests run against the servers you choose here. Applies only to this run.`})]}),(0,I.jsx)(L5,{checked:j,onCheckedChange:M})]}),j&&(0,I.jsx)(`div`,{className:`flex flex-wrap gap-1.5`,children:Ue.map(e=>{let t=e.id,n=N.includes(t);return(0,I.jsx)(Y,{variant:n?`default`:`outline-solid`,className:`cursor-pointer text-xs ${n?``:`opacity-60 hover:opacity-100`}`,onClick:()=>P(e=>e.includes(t)?e.filter(e=>e!==t):[...e,t]),children:e.name?.trim()?e.name:t},t)})})]})]}),(0,I.jsxs)(`div`,{className:`flex gap-2`,children:[(0,I.jsxs)(W,{onClick:Ke,disabled:!t||fe||Re.length>0&&w.length===0||ze.length>0&&k.length===0,children:[(0,I.jsx)(Yn,{className:`mr-2 h-4 w-4`}),Pe?`Queue Run`:`Run`]}),a&&(0,I.jsxs)(W,{variant:`destructive`,onClick:qe,children:[(0,I.jsx)(sr,{className:`mr-2 h-4 w-4`}),`Stop`]})]})]})}),(a||l.length>0)&&(0,I.jsxs)(K,{children:[(0,I.jsx)(gv,{className:`pb-3`,children:(0,I.jsxs)(`div`,{className:`flex items-center justify-between`,children:[(0,I.jsx)(_v,{className:`text-base`,children:`Progress`}),(0,I.jsxs)(`span`,{className:`text-xs text-muted-foreground font-mono`,children:[Math.round(Ie),`%`]})]})}),(0,I.jsxs)(q,{className:`space-y-4`,children:[(0,I.jsx)(t7,{value:Ie,className:`h-2`}),(Fe||Pe)&&(0,I.jsx)(`div`,{className:`flex flex-wrap items-center gap-x-3 gap-y-1 text-xs text-muted-foreground`,children:Fe?(0,I.jsxs)(I.Fragment,{children:[(0,I.jsxs)(`span`,{children:[Fe.completedJobs,`/`,Fe.totalJobs,` subtasks complete`]}),Fe.failedJobs-Fe.stoppedJobs>0&&(0,I.jsxs)(`span`,{className:`font-medium text-destructive`,children:[Fe.failedJobs-Fe.stoppedJobs,` failed`]}),Fe.stoppedJobs>0&&(0,I.jsxs)(`span`,{className:`font-medium text-muted-foreground`,children:[Fe.stoppedJobs,` stopped`]}),Fe.pausedJobs>0&&(0,I.jsxs)(`span`,{className:`font-medium text-yellow-700 dark:text-yellow-400`,children:[Fe.pausedJobs,` paused`]}),(0,I.jsx)(Y,{variant:`outline`,className:`capitalize`,children:Fe.status})]}):(0,I.jsx)(`span`,{children:Pe?.roverProgress?`${Pe.roverProgress.completed}/${Pe.roverProgress.total} scenarios complete`:`Attached to active run`})}),me&&(0,I.jsxs)(`div`,{className:`flex items-center justify-between rounded-md border border-yellow-500/40 bg-yellow-500/10 px-3 py-2 text-sm`,children:[(0,I.jsxs)(`span`,{className:`text-yellow-700 dark:text-yellow-400`,children:[`OAuth required for: `,(0,I.jsx)(`strong`,{children:me.servers.join(`, `)})]}),(0,I.jsx)(W,{size:`sm`,variant:`outline`,disabled:fe,onClick:()=>{be.current||(be.current=!0,pe(!0),e6({serverNames:me.servers,source:Ce,onServerAuthStart:e=>{u(t=>[...t,`[${P7()}] OAuth sign-in opened for '${e}'...`])}}).then(()=>Ce.resumeQueue()).then(()=>{let e=me?.jobId;u(e=>[...e,`[${P7()}] OAuth complete. Resuming run...`]),e&&(C(e),Ye(e),o(!0),f(!1),rt(e))}).catch(e=>{let t=e instanceof Error?e.message:String(e);u(e=>[...e,`[${P7()}] OAuth error: ${t}`]),be.current=!1}).finally(()=>{pe(!1)}))},children:fe?`Connecting...`:`Connect & Resume`})]}),(0,I.jsx)(`div`,{ref:ge,className:`h-64 overflow-auto rounded-md border bg-muted/30 p-3 font-mono text-xs space-y-0.5`,children:l.map((e,t)=>(0,I.jsx)(`div`,{className:e.includes(`✓`)?`text-success`:e.includes(`aborted`)?`text-destructive`:`text-foreground`,children:e},t))})]})]}),(0,I.jsxs)(K,{children:[(0,I.jsx)(gv,{className:`pb-3`,children:(0,I.jsxs)(`div`,{className:`flex items-center justify-between`,children:[(0,I.jsxs)(_v,{className:`inline-flex items-center gap-2 text-base`,children:[(0,I.jsx)(_n,{className:`h-4 w-4`}),`Run Queue`]}),(0,I.jsx)(W,{variant:`ghost`,size:`sm`,onClick:()=>void Xe(),children:(0,I.jsx)(Qn,{className:`h-3 w-3`})})]})}),(0,I.jsx)(q,{children:!Pe&&oe.length===0&&ne.length===0&&ce.length===0?(0,I.jsx)(`p`,{className:`text-sm text-muted-foreground`,children:`No active or queued runs. Start a run above.`}):(0,I.jsxs)(`div`,{className:`space-y-2`,children:[ce.map(e=>(0,I.jsxs)(`div`,{onClick:()=>{let t=e.jobs.find(e=>e.status===`running`||e.status===`waiting_for_rover`||e.status===`paused_rover`);t&&it(t.jobId)},className:`rounded-md border p-3 text-sm ${e.status===`failed`?`border-destructive/40 bg-destructive/5`:e.status===`stopped`?`border-muted-foreground/30 bg-muted/40`:e.status===`partial`?`border-yellow-500/40 bg-yellow-500/5`:e.status===`running`?`border-primary/20 bg-primary/5`:`border-border bg-background`}`,children:[(0,I.jsxs)(`div`,{className:`flex items-center justify-between gap-2`,children:[(0,I.jsxs)(`div`,{className:`flex items-center gap-2`,children:[(0,I.jsx)(`span`,{className:`font-semibold`,children:e.evaluationName||`Evaluation`}),(0,I.jsx)(Y,{variant:`outline`,className:`capitalize ${e.status===`running`?`border-emerald-500/40 bg-emerald-500/15 text-emerald-700 dark:text-emerald-400`:``}`,children:e.status}),(0,I.jsxs)(`span`,{className:`text-xs text-muted-foreground`,children:[e.completedJobs,`/`,e.totalJobs,` scenario-agent runs complete`]})]}),(0,I.jsxs)(`div`,{className:`flex items-center gap-1`,onClick:e=>e.stopPropagation(),children:[e.jobs.some(e=>e.status===`blocked_auth`)&&(0,I.jsx)(W,{size:`sm`,variant:`outline`,className:`h-7 text-xs border-yellow-500/50 text-yellow-700 dark:text-yellow-400`,disabled:fe,onClick:()=>void $e(e),children:fe?`Connecting...`:`Connect OAuth`}),e.jobs.some(F7)&&(0,I.jsx)(W,{size:`sm`,variant:`outline`,className:`h-7 text-xs`,onClick:()=>{let t=e.jobs.find(F7);t&&nt(t.jobId)},title:`Open the browser-agent URL, then activate the Rover extension`,children:`Open browser agent`}),(0,I.jsx)(W,{variant:`ghost`,size:`sm`,className:`h-7 px-2 text-xs`,onClick:()=>ue(t=>t===e.evaluationRunId?null:e.evaluationRunId),"aria-label":`${le===e.evaluationRunId?`Collapse`:`Expand`} evaluation details`,children:le===e.evaluationRunId?`Hide`:`Details`}),e.jobs.length>0&&(e.jobs.every(e=>[`queued`,`blocked_auth`,`waiting_for_rover`,`stopped`].includes(e.status))||e.status===`stopped`&&e.jobs.every(e=>[`completed`,`error`,`stopped`].includes(e.status)))&&(0,I.jsxs)(W,{variant:`ghost`,size:`sm`,className:`h-7 px-2 text-xs text-muted-foreground hover:text-destructive`,onClick:()=>void tt(e.evaluationRunId),title:e.status===`stopped`?`Remove stopped run from the queue`:`Remove evaluation from queue`,"aria-label":e.status===`stopped`?`Remove stopped run from queue`:`Remove evaluation from queue`,children:[(0,I.jsx)(hr,{className:`mr-1 h-3 w-3`}),e.status===`stopped`?`Remove run`:`Remove`]}),e.jobs.some(e=>[`blocked_auth`,`waiting_for_rover`,`paused_rover`,`running`].includes(e.status))&&(0,I.jsxs)(W,{variant:`ghost`,size:`sm`,className:`h-7 px-2 text-xs text-destructive hover:text-destructive hover:bg-destructive/10`,disabled:de===e.evaluationRunId,onClick:()=>void et(e.evaluationRunId),title:`Stop this evaluation run and its queued or running tasks`,children:[(0,I.jsx)(sr,{className:`mr-1 h-3 w-3`}),de===e.evaluationRunId?`Stopping run...`:`Stop run`]})]})]}),le===e.evaluationRunId&&(0,I.jsx)(`div`,{className:`mt-2 space-y-1 text-xs text-muted-foreground`,children:yfe(e).map(({job:e,child:t},n)=>(0,I.jsxs)(`div`,{className:`flex items-center justify-between gap-2 rounded px-2 py-1 ${t?.status===`completed`?`border border-emerald-500/30 bg-emerald-500/10 text-emerald-800 dark:text-emerald-300`:t?.status===`error`||t?.status===`stopped`?`border border-destructive/30 bg-destructive/5`:`bg-background`}`,onClick:()=>it(e.jobId),children:[(0,I.jsxs)(`span`,{className:`flex min-w-0 items-center gap-1.5 truncate`,children:[(0,I.jsxs)(`span`,{className:`shrink-0 tabular-nums`,children:[n+1,`.`]}),(t?t.status===`running`:e.status===`running`)&&(0,I.jsx)(Kg,{label:`Subjob running`}),t?.status===`completed`&&(0,I.jsx)(dn,{className:`h-3.5 w-3.5 shrink-0 text-emerald-600 dark:text-emerald-400`}),(t?.status===`error`||t?.status===`stopped`)&&(0,I.jsx)(hr,{className:`h-3.5 w-3.5 shrink-0 text-destructive`}),t?`${t.scenarioId} · ${t.agentName}: `:`${e.roverAgent?.name??e.runParams.agents?.join(`, `)??`Agent`}: `,t?.status===`queued`?`queued`:t?.status===`running`?`running`:t?.status===`completed`?`completed`:t?.status===`error`?`error`:t?.status===`stopped`?`stopped`:e.status===`waiting_for_rover`?`waiting for Rover`:e.status===`paused_rover`?`paused`:e.status.replaceAll(`_`,` `),t?` (${t.completed}/${t.total} attempts)`:e.roverProgress&&` (${e.roverProgress.completed}/${e.roverProgress.total} scenarios)`,!t&&e.roverProgress?.lastDurationMs!=null&&` · ${Math.round(e.roverProgress.lastDurationMs/1e3)}s`,t?.error&&` · ${t.error}`,!t&&e.roverProgress?.error&&` · ${e.roverProgress.error}`]}),(0,I.jsxs)(`span`,{className:`flex shrink-0 items-center gap-1`,onClick:e=>e.stopPropagation(),children:[F7(e)&&(!t||e.childProgress?.[0]?.scenarioId===t.scenarioId)&&(0,I.jsx)(W,{size:`sm`,variant:`outline`,className:`h-6 px-1.5 text-[11px]`,onClick:()=>void nt(e.jobId),children:`Open browser agent`}),!t&&e.executionType===`rover`&&e.status===`paused_rover`&&(0,I.jsx)(W,{size:`sm`,variant:`outline`,className:`h-6 px-1.5 text-[11px]`,onClick:()=>{Ce.resumeRover(e.jobId).then(()=>void Xe())},children:`Resume`}),(t&&(t.status===`running`||t.status===`queued`)||!t&&e.status===`queued`||!t&&e.executionType===`rover`&&(e.status===`waiting_for_rover`||e.status===`paused_rover`||e.status===`running`))&&(0,I.jsx)(W,{size:`sm`,variant:`ghost`,className:`h-6 px-1.5 text-[11px] text-destructive`,onClick:()=>{(t?Ce.stopScenario(e.jobId,t.scenarioId,t.agentName):Ce.stopRun(e.jobId)).then(()=>void Xe())},children:t?.status===`queued`||e.status===`queued`?`Remove`:`Stop`})]})]},`${e.jobId}:${t?.scenarioId??`job`}:${t?.agentName??`job`}`))})]},e.evaluationRunId)),ie.filter(e=>!e.evaluationRunId).map(e=>(0,I.jsxs)(`div`,{role:`button`,tabIndex:0,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===e.jobId?`ring-2 ring-primary/40`:``}`,onClick:()=>{S!==e.jobId&&(C(e.jobId),Ye(e.jobId),o(!0),f(!1),y(!1),u([`[${P7()}] Attached to running job ${e.jobId}...`]),c(10),rt(e.jobId))},onKeyDown:t=>{(t.key===`Enter`||t.key===` `)&&S!==e.jobId&&(t.preventDefault(),C(e.jobId),Ye(e.jobId),o(!0),f(!1),y(!1),u([`[${P7()}] Attached to running job ${e.jobId}...`]),c(10),rt(e.jobId))},title:`Click to view progress`,children:[(0,I.jsxs)(`div`,{className:`min-w-0 flex items-center gap-2`,children:[(0,I.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`}),(0,I.jsx)(`span`,{className:`text-xs font-bold`,children:Me.get(e.runParams.configPath)||M7(e.runParams.scenarioIds,Ne,e.runParams.configPath)}),(0,I.jsx)(`span`,{className:`font-mono text-xs`,children:j7(e.runParams.configPath,je)}),e.runParams.agents&&(0,I.jsxs)(`span`,{className:`text-xs text-muted-foreground`,children:[`agents: `,e.runParams.agents.join(`, `)]}),e.runParams.runNote&&(0,I.jsxs)(`span`,{className:`text-xs text-muted-foreground truncate`,children:[`note: `,e.runParams.runNote]})]}),(0,I.jsxs)(W,{variant:`ghost`,size:`sm`,className:`h-7 px-2 text-xs text-destructive hover:text-destructive hover:bg-destructive/10`,onClick:t=>{t.stopPropagation(),Ce.stopRun(e.jobId),Xe()},title:`Stop running job`,children:[(0,I.jsx)(sr,{className:`mr-1 h-3 w-3`}),`Stop`]})]},e.jobId)),oe.filter(e=>!e.evaluationRunId).map(e=>{let t=j7(e.runParams.configPath,je),n=M7(e.runParams.scenarioIds,Ne,e.runParams.configPath),r=Me.get(e.runParams.configPath)||n,i=e.status===`blocked_auth`;return(0,I.jsx)(`div`,{className:`flex items-center justify-between rounded-md border p-2 text-sm ${i?`border-yellow-500/40 bg-yellow-500/5`:`border-border bg-background`}`,children:(0,I.jsxs)(`div`,{className:`min-w-0 flex items-center gap-2 flex-wrap`,children:[(0,I.jsx)(`span`,{className:`inline-flex items-center rounded-full px-2 py-0.5 text-xs font-medium ${i?`bg-yellow-500/15 text-yellow-700 dark:text-yellow-400`:`bg-primary/10 text-primary`}`,children:i?`Retrying OAuth`:`Starting`}),(0,I.jsx)(`span`,{className:`text-xs font-bold`,children:r}),(0,I.jsx)(`span`,{className:`font-mono text-xs`,children:t}),i&&(e.requiredServers??[]).length>0&&(0,I.jsxs)(`span`,{className:`text-xs text-yellow-700 dark:text-yellow-400`,children:[`OAuth: `,e.requiredServers.join(`, `)]})]})},e.jobId)}),ne.filter(e=>!e.evaluationRunId).map((e,t)=>{let n=j7(e.runParams.configPath,je),r=M7(e.runParams.scenarioIds,Ne,e.runParams.configPath),i=Me.get(e.runParams.configPath)||r,a=e.status===`blocked_auth`;return(0,I.jsxs)(`div`,{className:`flex items-center justify-between rounded-md border p-2 text-sm ${a?`border-yellow-500/40 bg-yellow-500/5`:``}`,children:[(0,I.jsxs)(`div`,{className:`min-w-0 flex items-center gap-2 flex-wrap`,children:[a?(0,I.jsxs)(`span`,{className:`inline-flex items-center rounded-full bg-yellow-500/15 px-2 py-0.5 text-xs font-medium text-yellow-700 dark:text-yellow-400`,children:[`#`,t+1,` Blocked`]}):(0,I.jsxs)(`span`,{className:`inline-flex items-center rounded-full bg-muted px-2 py-0.5 text-xs font-medium text-muted-foreground`,children:[`#`,t+1,` Queued`]}),(0,I.jsx)(`span`,{className:`text-xs font-bold`,children:i}),(0,I.jsx)(`span`,{className:`font-mono text-xs`,children:n}),a&&(e.requiredServers??[]).length>0&&(0,I.jsxs)(`span`,{className:`text-xs text-yellow-700 dark:text-yellow-400`,children:[`OAuth: `,e.requiredServers.join(`, `)]}),!a&&e.runParams.agents&&(0,I.jsxs)(`span`,{className:`text-xs text-muted-foreground`,children:[`agents: `,e.runParams.agents.join(`, `)]}),e.runParams.runNote&&(0,I.jsxs)(`span`,{className:`text-xs text-muted-foreground truncate`,children:[`note: `,e.runParams.runNote]})]}),(0,I.jsxs)(`div`,{className:`flex items-center gap-1 shrink-0`,children:[a&&(0,I.jsx)(W,{size:`sm`,variant:`outline`,className:`h-7 text-xs border-yellow-500/50 text-yellow-700 dark:text-yellow-400 hover:bg-yellow-500/10`,disabled:fe,onClick:()=>{if(be.current)return;let t=e.requiredServers??[];t.length!==0&&(be.current=!0,he({jobId:e.jobId,servers:t}),pe(!0),e6({serverNames:t,source:Ce,onServerAuthStart:e=>{u(t=>[...t,`[${P7()}] OAuth sign-in opened for '${e}'...`])}}).then(()=>Ce.resumeQueue()).then(()=>{u(e=>[...e,`[${P7()}] OAuth complete. Resuming run...`]),C(e.jobId),Ye(e.jobId),o(!0),f(!1),rt(e.jobId)}).catch(e=>{let t=e instanceof Error?e.message:String(e);u(e=>[...e,`[${P7()}] OAuth error: ${t}`]),be.current=!1}).finally(()=>{pe(!1)}))},children:fe&&me?.jobId===e.jobId?`Connecting...`:`Connect & Resume`}),(0,I.jsx)(W,{variant:`ghost`,size:`sm`,className:`h-7 w-7 p-0 text-muted-foreground hover:text-destructive`,onClick:()=>void Qe(e.jobId),title:`Remove from queue`,children:(0,I.jsx)(hr,{className:`h-4 w-4`})})]})]},e.jobId)})]})})]}),v&&!a&&!d&&(0,I.jsx)(K,{className:`border-amber-300/60 bg-amber-50/40`,children:(0,I.jsx)(q,{className:`pt-6`,children:(0,I.jsxs)(`div`,{className:`flex flex-wrap items-center gap-3`,children:[(0,I.jsx)(sr,{className:`h-5 w-5 text-amber-700`}),(0,I.jsxs)(`div`,{className:`min-w-0`,children:[(0,I.jsx)(`p`,{className:`font-medium`,children:`Run stopped`}),(0,I.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.`})]}),(0,I.jsxs)(`div`,{className:`ml-auto flex items-center gap-2`,children:[(0,I.jsx)(W,{type:`button`,variant:`outline`,onClick:()=>{u([]),c(0),y(!1)},children:`Clear Progress`}),(0,I.jsxs)(W,{type:`button`,onClick:Ke,disabled:!t,children:[(0,I.jsx)(Yn,{className:`mr-2 h-4 w-4`}),`Run Again`]})]})]})})}),d&&(0,I.jsx)(K,{className:p?`border-amber-500/50`:h?.stoppedJobs?`border-border`:`border-success/50`,children:(0,I.jsx)(q,{className:`pt-6`,children:(0,I.jsxs)(`div`,{className:`flex items-center gap-3`,children:[p?(0,I.jsx)(hr,{className:`h-6 w-6 text-destructive`}):h?.stoppedJobs?(0,I.jsx)(_n,{className:`h-6 w-6 text-muted-foreground`}):(0,I.jsx)(dn,{className:`h-6 w-6 text-success`}),(0,I.jsxs)(`div`,{children:[(0,I.jsx)(`p`,{className:`font-medium`,children:p?`Completed with errors`:h?.stoppedJobs?h.completedJobs?`Completed with stopped scenarios`:`Run stopped`:`Evaluation Complete`}),(0,I.jsx)(`p`,{className:`text-sm text-muted-foreground`,children:h?`${h.totalJobs}/${h.totalJobs} finished, ${h.completedJobs} completed, ${Math.max(0,h.failedJobs-h.stoppedJobs)} error(s), ${h.stoppedJobs} stopped.`:p?`The evaluation ended with errors. Review the log for details.`:`All scenarios have finished. Review the results for their outcomes.`})]}),(0,I.jsx)(W,{asChild:!0,className:`ml-auto`,children:(0,I.jsx)(np,{to:ke,children:Oe?`View Results`:`View Runs`})})]})})})]})};function I7({title:e,description:t,expanded:n,onToggleExpanded:r,onHide:i,messages:a,pendingToolCalls:o,loading:s,expired:c=!1,input:l,onInputChange:u,onSend:d,onCancel:f,inputPlaceholder:p,snippets:m,snippetsLabel:h=`Result Assistant Snippets`,onSnippetSelect:g,onApproveToolCall:_,onDenyToolCall:v,inputRef:y,renderMessageFooter:b,className:x=`min-w-0 overflow-hidden xl:flex xl:h-full xl:min-h-0 xl:flex-col`,contentClassName:S=`flex h-[70vh] min-h-[520px] flex-col p-0 xl:h-auto xl:min-h-0 xl:flex-1`}){return(0,I.jsxs)(K,{className:x,children:[(0,I.jsx)(gv,{className:`border-b px-4 py-3`,children:(0,I.jsxs)(`div`,{className:`space-y-1`,children:[(0,I.jsxs)(`div`,{className:`flex items-center justify-between gap-2`,children:[(0,I.jsxs)(_v,{className:`flex items-center gap-2 text-base`,children:[(0,I.jsx)(ar,{className:`h-4 w-4 text-amber-500`}),e]}),(0,I.jsxs)(`div`,{className:`flex shrink-0 items-center gap-2`,children:[(0,I.jsxs)(W,{type:`button`,variant:`outline`,size:`sm`,className:`h-7 gap-1 px-2 text-xs`,onClick:r,children:[n?(0,I.jsx)(Gn,{className:`h-3.5 w-3.5`}):(0,I.jsx)(Kn,{className:`h-3.5 w-3.5`}),n?`Compact`:`Expand`]}),(0,I.jsx)(W,{type:`button`,variant:`outline`,size:`sm`,className:`h-7 px-2 text-xs`,onClick:i,children:`Hide`})]})]}),(0,I.jsx)(`p`,{className:`text-xs text-muted-foreground`,children:t})]})}),(0,I.jsx)(q,{className:S,children:(0,I.jsx)(q3,{messages:a,toolCalls:o,busy:s,expired:c,onApprove:_,onDeny:v,renderMessageFooter:b,scrollClassName:`bg-muted/15 px-4 py-4`,composer:{input:l,onInputChange:u,onSend:d,onCancel:f,inputPlaceholder:p,snippets:m,snippetsLabel:h,onSnippetSelect:g,loading:s,inputRef:y},composerClassName:`border-t bg-background px-4 py-3`})})]})}function L7(e,t){if(!Number.isFinite(e)||e<=0)return`0ms`;if(e<1e3)return`${Math.round(e)}ms`;if(t?.preciseUnderTenSeconds&&e<1e4){let t=e/1e3,n=Math.round(t*10)/10;return`${Number.isInteger(n)?n.toFixed(0):n.toFixed(1)}s`}let n=Math.floor(e/1e3),r=Math.floor(n/3600),i=Math.floor(n%3600/60),a=n%60;return r>0?`${r}h ${i}m ${a}s`:i>0?`${i}m ${a}s`:`${a}s`}function R7(e){return e.runs.length>0?e.runs.reduce((e,t)=>e+t.duration,0):e.avgDuration}function z7(e){return e.scenarios.some(e=>e.runs.length>0)?e.scenarios.reduce((e,t)=>e+R7(t),0):typeof e.totalDurationMs==`number`&&e.totalDurationMs>=0?e.totalDurationMs:null}function B7(e){return e.runs.length>0?e.runs.reduce((e,t)=>e+t.toolCalls.reduce((e,t)=>e+t.duration,0),0):0}function V7(e){return e.scenarios.some(e=>e.runs.length>0)?e.scenarios.reduce((e,t)=>e+B7(t),0):typeof e.totalToolDurationMs==`number`&&e.totalToolDurationMs>=0?e.totalToolDurationMs:null}var H7=`hsl(152, 69%, 40%)`,U7=`hsl(0, 72%, 51%)`,W7=`hsl(215, 16%, 47%)`,G7=`hsl(38, 92%, 50%)`,K7=`hsl(38, 92%, 50%)`,q7=`hsl(270, 55%, 50%)`,J7=`hsl(215, 16%, 47%)`;function Y7(e,t=0){return e.toLocaleString(void 0,{maximumFractionDigits:t,minimumFractionDigits:t})}function X7({title:e,passed:t,failed:n,incomplete:r=0,error:i=0,stopped:a=0,notEvaluated:o=0,notExecuted:s=0}){let c=[{name:`Passed`,value:t,color:H7},{name:`Failed`,value:n,color:U7},...r>0?[{name:`Incomplete`,value:r,color:K7}]:[],...i>0?[{name:`Error`,value:i,color:q7}]:[],...a>0?[{name:`Stopped`,value:a,color:J7}]:[],...o>0?[{name:`Not evaluated`,value:o,color:W7}]:[],...s>0?[{name:`Not executed`,value:s,color:G7}]:[]];return(0,I.jsxs)(K,{children:[(0,I.jsx)(gv,{className:`p-2.5 pb-0`,children:(0,I.jsx)(_v,{className:`text-xs font-medium uppercase tracking-wider text-muted-foreground`,children:e})}),(0,I.jsxs)(q,{className:`flex h-[92px] items-center justify-center gap-2 p-0`,children:[(0,I.jsx)(`div`,{className:`h-[82px] w-[82px] shrink-0`,children:(0,I.jsx)(sT,{width:`100%`,height:`100%`,children:(0,I.jsxs)(AW,{children:[(0,I.jsx)(JL,{data:c,dataKey:`value`,nameKey:`name`,innerRadius:`55%`,outerRadius:`78%`,paddingAngle:3,children:c.map(e=>(0,I.jsx)(cT,{fill:e.color},e.name))}),(0,I.jsx)(Hw,{})]})})}),(0,I.jsxs)(`div`,{className:`space-y-0.5 text-xs`,children:[(0,I.jsxs)(`div`,{className:`flex items-center gap-1.5`,children:[(0,I.jsx)(`div`,{className:`h-2.5 w-2.5 rounded-full`,style:{backgroundColor:H7}}),Y7(t),` passed`]}),(0,I.jsxs)(`div`,{className:`flex items-center gap-1.5`,children:[(0,I.jsx)(`div`,{className:`h-2.5 w-2.5 rounded-full`,style:{backgroundColor:U7}}),Y7(n),` failed`]}),r>0&&(0,I.jsxs)(`div`,{className:`flex items-center gap-1.5`,children:[(0,I.jsx)(`div`,{className:`h-2.5 w-2.5 rounded-full`,style:{backgroundColor:K7}}),Y7(r),` incomplete`]}),i>0&&(0,I.jsxs)(`div`,{className:`flex items-center gap-1.5`,children:[(0,I.jsx)(`div`,{className:`h-2.5 w-2.5 rounded-full`,style:{backgroundColor:q7}}),Y7(i),` error`]}),a>0&&(0,I.jsxs)(`div`,{className:`flex items-center gap-1.5`,children:[(0,I.jsx)(`div`,{className:`h-2.5 w-2.5 rounded-full`,style:{backgroundColor:J7}}),Y7(a),` stopped`]}),o>0&&(0,I.jsxs)(`div`,{className:`flex items-center gap-1.5`,children:[(0,I.jsx)(`div`,{className:`h-2.5 w-2.5 rounded-full`,style:{backgroundColor:W7}}),Y7(o),` not evaluated`]}),s>0&&(0,I.jsxs)(`div`,{className:`flex items-center gap-1.5`,children:[(0,I.jsx)(`div`,{className:`h-2.5 w-2.5 rounded-full`,style:{backgroundColor:G7}}),Y7(s),` not executed`]})]})]})]})}function xfe({runs:e,loading:t}){let n=(0,_.useMemo)(()=>{let t=e.reduce((e,t)=>e+Math.max(0,t.totalRuns),0),n=e.reduce((e,t)=>e+(t.outcomes?.passed??Math.round(Math.max(0,t.totalRuns)*(t.overallPassRate??0))),0),r=e.reduce((e,t)=>e+(t.outcomes?.incomplete??0),0),i=e.reduce((e,t)=>e+(t.outcomes?.error??0),0),a=e.reduce((e,t)=>e+(t.outcomes?.stopped??0),0),o=e.reduce((e,t)=>e+(t.outcomes?.failed??Math.max(0,t.totalRuns-Math.round(Math.max(0,t.totalRuns)*(t.overallPassRate??0))-(t.outcomes?.incomplete??0)-(t.outcomes?.error??0)-(t.outcomes?.stopped??0))),0),s=e.reduce((e,t)=>e+Math.max(0,t.totalScenarios),0),c=e.reduce((e,t)=>(e.passed+=t.checkCounts?.passed??0,e.failed+=t.checkCounts?.failed??0,e.not_evaluated+=t.checkCounts?.not_evaluated??0,e.not_executed+=t.checkCounts?.not_executed??0,e.total+=t.checkCounts?.total??0,e),{passed:0,failed:0,not_evaluated:0,not_executed:0,total:0}),l=n=>t===0?0:e.reduce((e,t)=>e+n(t)*Math.max(0,t.totalRuns),0)/t,u=e.reduce((e,t)=>e+(t.toolTokenUsage?.totalTokens??0),0),d=e.reduce((e,t)=>e+(t.totalDurationMs??0),0),f=e.reduce((e,t)=>e+(t.totalToolDurationMs??0),0);return{totalRuns:t,passedRuns:n,failedRuns:o,incompleteRuns:r,errorRuns:i,stoppedRuns:a,checkCounts:c,totalScenarios:s,passRate:b_(n,t,a),avgToolCalls:l(e=>e.avgToolCalls),avgLatency:l(e=>e.avgLatency),totalTokens:u,totalDurationMs:d,totalToolDurationMs:f}},[e]);return t?(0,I.jsx)(K,{children:(0,I.jsx)(q,{className:`p-6 text-sm text-muted-foreground`,children:`Calculating dashboard…`})}):e.length===0?(0,I.jsx)(K,{children:(0,I.jsx)(q,{className:`p-6 text-sm text-muted-foreground`,children:`No results in the selected range.`})}):(0,I.jsx)(`div`,{className:`space-y-2`,"data-testid":`results-dashboard`,children:(0,I.jsxs)(`div`,{className:`grid gap-3 lg:grid-cols-4`,children:[(0,I.jsx)(X7,{title:`Runs Pass / Fail / Incomplete / Error / Stopped`,passed:n.passedRuns,failed:n.failedRuns,incomplete:n.incompleteRuns,error:n.errorRuns,stopped:n.stoppedRuns}),(0,I.jsx)(X7,{title:`Checks Pass / Fail / Not evaluated / Not executed`,passed:n.checkCounts.passed,failed:n.checkCounts.failed,notEvaluated:n.checkCounts.not_evaluated,notExecuted:n.checkCounts.not_executed}),(0,I.jsxs)(`div`,{className:`grid self-start content-start gap-3 sm:grid-cols-2 lg:col-span-2 lg:grid-cols-4`,children:[(0,I.jsx)(Dv,{compact:!0,title:`Scenarios`,value:Y7(n.totalScenarios),icon:Pn}),(0,I.jsx)(Dv,{compact:!0,title:`Total Runs`,value:Y7(n.totalRuns),icon:Xt}),(0,I.jsx)(Dv,{compact:!0,title:`Pass Rate`,value:n.passRate===null?`–`:`${Y7(n.passRate*100,1)}%`,icon:rn}),(0,I.jsx)(Dv,{compact:!0,title:`Avg Tool Calls`,value:Y7(n.avgToolCalls,1),icon:dn}),(0,I.jsx)(Dv,{compact:!0,title:`Avg Latency`,value:`${Y7(n.avgLatency)}ms`,icon:cr}),(0,I.jsx)(Dv,{compact:!0,title:`Tool Tokens`,value:Y7(n.totalTokens),icon:mr}),n.totalDurationMs>0?(0,I.jsx)(Dv,{compact:!0,title:`Total Time`,value:L7(n.totalDurationMs),icon:_n}):null,n.totalToolDurationMs>0?(0,I.jsx)(Dv,{compact:!0,title:`Tool Duration`,value:L7(n.totalToolDurationMs),icon:_n}):null]})]})})}function Sfe(e){let t=[];for(let n of e.scenarios)for(let e of n.runs)e.error&&t.push(e.error),t.push(...e.failureReasons);return t.map(e=>String(e??``).trim()).filter(Boolean)}function Cfe(e){let t=e.toLowerCase();return t.includes(`invalid_token`)||t.includes(`authentication failed`)||t.includes(`bearer token`)||t.includes(`oauth`)?`auth`:t.includes(`429`)||t.includes(`too many requests`)||t.includes(`rate limit`)?`rate_limit`:t.includes(`scenario error:`)||t.includes(`failed to list tools`)||t.includes(`failed to connect to mcp server`)||t.includes(`tool call failed`)||t.includes(`fetch failed`)||t.includes(`streamable http error`)?`infra`:null}function wfe(e){return e===`auth`?`Auth error`:e===`rate_limit`?`Rate limited`:`Infra error`}function Tfe(e){let t=Sfe(e);for(let e of[`auth`,`rate_limit`,`infra`]){let n=t.find(t=>Cfe(t)===e);if(n)return{kind:e,label:wfe(e),detail:n}}return null}function Efe(e){return e===`auth`?`border-amber-500/30 bg-amber-500/10 text-amber-700`:e===`rate_limit`?`border-orange-500/30 bg-orange-500/10 text-orange-700`:`border-slate-500/30 bg-slate-500/10 text-slate-700`}function Dfe({run:e}){let t=Tfe(e);return t?(0,I.jsx)(gl,{delayDuration:0,children:(0,I.jsxs)(_l,{children:[(0,I.jsx)(vl,{asChild:!0,children:(0,I.jsx)(Y,{variant:`outline`,className:`h-5 text-[10px] ${Efe(t.kind)}`,children:t.label})}),(0,I.jsx)(yl,{className:`max-w-sm text-xs`,children:(0,I.jsx)(`p`,{children:t.detail})})]})}):null}function Z7(e){let{source:t,open:n,scope:r,runId:i,onSessionSync:a}=e,o=a6({api:(0,_.useMemo)(()=>ble(t,r===`run`&&i?{scope:`run`,runId:i}:{scope:`all_runs`}),[t,r,i]),open:n,label:`MCP Lab Assistant`,recreateExpiredOnSend:!0,onSession:a}),[s,c]=(0,_.useState)(``),[l,u]=(0,_.useState)(),d=(0,_.useRef)(null),f=(0,_.useCallback)(async()=>{let e=s.trim();e&&(r!==`run`||i)&&(c(``),await o.send(e))},[o,s,r,i]),p=(0,_.useCallback)(()=>{let e=o.cancel();e!==void 0&&c(e)},[o]),m=(0,_.useCallback)(()=>{o.reset(),c(``),u(void 0)},[o]),h=(0,_.useCallback)(e=>{u(t=>t??{id:`result-assistant-intro`,role:`assistant`,text:e,createdAt:new Date().toISOString()})},[]),g=(0,_.useCallback)(e=>{c(e),requestAnimationFrame(()=>d.current?.focus())},[]);(0,_.useEffect)(()=>{let e=d.current;if(!e)return;e.style.height=`0px`;let t=Math.min(e.scrollHeight,160);e.style.height=`${Math.max(40,t)}px`},[s,n]);let v=(0,_.useMemo)(()=>o.messages.length===0&&l?[l]:o.messages,[o.messages,l]);return{assistantSessionId:o.sessionId,assistantMessages:v,assistantPendingToolCalls:o.pendingToolCalls,assistantInput:s,assistantLoading:o.busy,assistantTurnCancelable:o.cancelable,assistantExpired:o.expired,cancelAssistantTurn:p,assistantInputRef:d,setAssistantInput:c,askAssistant:f,approveResultAssistantToolCall:o.approve,denyResultAssistantToolCall:o.deny,applyResultAssistantSnippet:g,ensureIntroMessage:h,resetAssistantSession:m}}var Ofe=24,kfe=448;function Afe(e,{active:t,observe:n,query:r=`(min-width: 1280px)`}){let[i,a]=(0,_.useState)();return(0,_.useLayoutEffect)(()=>{if(!t){a(void 0);return}let i=window.matchMedia?.(r),o=()=>{let t=e.current;if(!t||i&&!i.matches)return a(void 0);a(Math.max(kfe,Math.round(window.innerHeight-jfe(t)-Ofe)))};o(),window.addEventListener(`resize`,o),i?.addEventListener?.(`change`,o);let s=n?.current&&typeof ResizeObserver<`u`?new ResizeObserver(o):void 0;return n?.current&&s?.observe(n.current),()=>{window.removeEventListener(`resize`,o),i?.removeEventListener?.(`change`,o),s?.disconnect()}},[t,n,r,e]),i}function jfe(e){let t=e.getBoundingClientRect().top;for(let n=e.parentElement;n;n=n.parentElement)t+=n.scrollTop;return t}async function Q7(e,t){let n=t.configPath?.trim();if(!n)throw Error(`This run has no config path in metadata.`);let r=await e.getResult(t.id)??t,i=r.rerunAgents&&r.rerunAgents.length>0?r.rerunAgents:Array.from(new Set(r.scenarios.map(e=>e.agentId).filter(Boolean)));await e.startRun({configPath:n,runsPerScenario:1,scenarioIds:r.rerunScenarioIds,agents:i.length>0?i:void 0,runNote:r.runNote,serverOverrideAll:r.rerunServerOverrideAll,scenarioServerOverrides:r.rerunScenarioServerOverrides,newConversationBeforeStart:r.rerunNewConversationBeforeStart,newConversationBetweenScenarios:r.rerunNewConversationBetweenScenarios})}var $7=[{value:`15min`,label:`Last 15min`,durationMs:9e5},{value:`30min`,label:`Last 30min`,durationMs:18e5},{value:`1h`,label:`Last hour`,durationMs:36e5},{value:`2h`,label:`Last 2 hours`,durationMs:72e5},{value:`4h`,label:`Last 4 hours`,durationMs:144e5},{value:`8h`,label:`Last 8 hours`,durationMs:288e5},{value:`24h`,label:`Last 24 hours`,durationMs:864e5},{value:`7d`,label:`Last 7 days`,durationMs:6048e5},{value:`14d`,label:`Last 14 days`,durationMs:12096e5},{value:`30d`,label:`Last 30 days`,durationMs:2592e6}];function e9(e){return e===`all`||e===`last`||e===`custom`}function t9(e){return e===`15min`||e===`30min`||e===`1h`||e===`2h`||e===`4h`||e===`8h`||e===`24h`||e===`7d`||e===`14d`||e===`30d`}function n9(e){let t=e.get(`time_filter`),n=e.get(`time_preset`);return{mode:e9(t)?t:`all`,preset:t9(n)?n:`15min`,start:e.get(`time_start`)??``,end:e.get(`time_end`)??``}}var r9=8,i9=`mcplab:results:time-filter`,a9=`mcplab:results:dashboard-visible`;function o9(e){if(!e.trim())return null;let t=new Date(e);return Number.isNaN(t.getTime())?null:t}function s9(e,t,n,r){if(e===`all`)return{};if(e===`last`){let e=$7.find(e=>e.value===t)??$7[0],n=new Date(Date.now());return{since:new Date(n.getTime()-e.durationMs).toISOString(),until:n.toISOString()}}let i=o9(n),a=o9(r);return i&&a?i.getTime()<=a.getTime()?{since:i.toISOString(),until:a.toISOString()}:{since:a.toISOString(),until:i.toISOString()}:i?{since:i.toISOString()}:a?{until:a.toISOString()}:{}}function c9(e){let t=o9(e);return t?t.toLocaleString():``}function Mfe(e){let t=o9(e);return t?`${t.getUTCFullYear()}-${String(t.getUTCMonth()+1).padStart(2,`0`)}-${String(t.getUTCDate()).padStart(2,`0`)}`:e}function Nfe(e){let t=o9(e);return t?t.toLocaleDateString(void 0,{weekday:`long`,month:`short`,day:`numeric`,year:`numeric`,timeZone:`UTC`}):`Unknown day`}function Pfe(e){return e.has(`time_filter`)||e.has(`time_preset`)||e.has(`time_start`)||e.has(`time_end`)}function Ffe(){try{let e=localStorage.getItem(i9);if(!e)return null;let t=JSON.parse(e);return{mode:e9(typeof t.mode==`string`?t.mode:null)?t.mode:`all`,preset:t9(typeof t.preset==`string`?t.preset:null)?t.preset:`15min`,start:typeof t.start==`string`?t.start:``,end:typeof t.end==`string`?t.end:``}}catch{return null}}function Ife(){try{let e=localStorage.getItem(a9);return e===null||e===`true`}catch{return!0}}var Lfe=[{label:`Summarize Run Trends`,description:`Highlight the main changes across the selected runs.`,prompt:`Summarize the main trends across these runs. Call out pass-rate changes, latency, and tool usage shifts.`},{label:`Explain Failures`,description:`Identify the most important failures and likely root causes.`,prompt:`Identify the most important failures across these runs and explain likely root causes from the traces.`},{label:`Compare Agents`,description:`Compare agent behavior, tool use, and answer quality across runs.`,prompt:`Compare agent behavior across these runs. Highlight differences in tool use, answer quality, and consistency.`},{label:`Spot Anomalies`,description:`Find outliers in latency, tool calls, or pass rate.`,prompt:`Find unusual runs or outliers in latency, tool calls, or pass rate, and explain why they stand out.`}],l9=100,Rfe=()=>{let[e,t]=cp(),{source:n}=nv(),[r]=(0,_.useState)(()=>Pfe(e)?n9(e):Ffe()??n9(e)),[i,a]=(0,_.useState)([]),[o,s]=(0,_.useState)([]),c=(0,_.useRef)(0),l=(0,_.useRef)(null),u=(0,_.useRef)(null),[d,f]=(0,_.useState)(!0),[p,m]=(0,_.useState)(Ife),[h,g]=(0,_.useState)(!1),[v,y]=(0,_.useState)(null),[b,x]=(0,_.useState)(!1),[S,C]=(0,_.useState)(`timestamp`),[w,T]=(0,_.useState)(`desc`),[E,D]=(0,_.useState)(`all`),[k,A]=(0,_.useState)(!1),[j,M]=(0,_.useState)(r.mode),[N,P]=(0,_.useState)(r.preset),[F,L]=(0,_.useState)(r.start),[R,z]=(0,_.useState)(r.end),[ee,te]=(0,_.useState)(!1),[ne,re]=(0,_.useState)(!1),[ie,ae]=(0,_.useState)(!1),oe=Afe(u,{active:ne,observe:l}),se=oe!==void 0,{completionVersion:ce}=sv(),B=w7(l9),{offset:le,totalCount:ue,hasMore:de}=B,[V,fe]=(0,_.useState)(null),pe=E===`all`?void 0:E,me=e=>{S===e?T(e=>e===`asc`?`desc`:`asc`):(C(e),T(e===`timestamp`?`desc`:`asc`))},he=(0,_.useCallback)(async()=>{if(!p||!n.listRunSummaries)return;let e=++c.current;f(!0);try{let t=await n.listRunSummaries({...s9(j,N,F,R),scenario:pe});c.current===e&&s(t.map(NW))}catch{c.current===e&&s([])}finally{c.current===e&&f(!1)}},[pe,p,n,R,j,N,F]),ge=async()=>{g(!0);try{let e=s9(j,N,F,R);if(n.listRunSummariesPage){let t=await n.listRunSummariesPage({...e,scenario:pe,limit:l9,offset:le});B.updateMeta(t),a(t.data.map(NW))}else if(n.listRunSummaries){let t=await n.listRunSummaries({...e,scenario:pe,limit:l9,offset:le});B.setTotalCount(t.length),B.setHasMore(!1),a(t.map(NW))}else B.setTotalCount(0),B.setHasMore(!1),a(await n.listResults());he()}catch(e){O({title:`Could not load results`,description:e instanceof Error?e.message:String(e),variant:`destructive`})}finally{g(!1)}};(0,_.useEffect)(()=>{let e=!0;g(!0);let t=s9(j,N,F,R);return(n.listRunSummariesPage?n.listRunSummariesPage({...t,scenario:pe,limit:l9,offset:le}).then(t=>(e&&B.updateMeta(t),t.data.map(NW))):n.listRunSummaries?n.listRunSummaries({...t,scenario:pe,limit:l9,offset:le}).then(t=>(e&&(B.setTotalCount(t.length),B.setHasMore(!1)),t.map(NW))):n.listResults()).then(t=>{e&&a(t)}).catch(t=>{e&&O({title:`Could not load results`,description:t instanceof Error?t.message:String(t),variant:`destructive`})}).finally(()=>{e&&g(!1)}),()=>{e=!1}},[pe,ce,le,n,R,j,N,F]),(0,_.useEffect)(()=>{try{localStorage.setItem(a9,String(p))}catch{}},[p]),(0,_.useEffect)(()=>{he()},[ce,he]),(0,_.useEffect)(()=>{p&&n.listRunSummaries||(p&&s(i),f(!1))},[p,i,n]);let{assistantMessages:_e,assistantPendingToolCalls:ve,assistantInput:ye,assistantLoading:be,assistantTurnCancelable:xe,assistantExpired:Se,cancelAssistantTurn:Ce,assistantInputRef:we,setAssistantInput:Te,askAssistant:Ee,approveResultAssistantToolCall:De,denyResultAssistantToolCall:Oe,applyResultAssistantSnippet:ke,ensureIntroMessage:Ae}=Z7({source:n,open:ne,scope:`all_runs`}),je=(0,_.useMemo)(()=>{let e=new Map;return i.forEach(t=>{t.scenarios.forEach(t=>{let n=String(t.scenarioName??``).trim(),r=String(t.scenarioId??``).trim();r?e.set(r,n||r):n&&e.set(n,n)})}),Array.from(e.entries()).map(([e,t])=>({value:e,label:t})).sort((e,t)=>e.label.localeCompare(t.label))},[i]);(0,_.useEffect)(()=>{let t=(e.get(`scenario`)??``).trim();t&&(je.some(e=>e.value===t||e.label===t)?D(t):i.length>0&&D(`all`))},[e,je,i.length]),(0,_.useEffect)(()=>{let n=new URLSearchParams(e);j===`all`?(n.delete(`time_filter`),n.delete(`time_preset`),n.delete(`time_start`),n.delete(`time_end`)):j===`last`?(n.set(`time_filter`,`last`),n.set(`time_preset`,N),n.delete(`time_start`),n.delete(`time_end`)):(n.set(`time_filter`,`custom`),n.delete(`time_preset`),F.trim()?n.set(`time_start`,F.trim()):n.delete(`time_start`),R.trim()?n.set(`time_end`,R.trim()):n.delete(`time_end`)),n.toString()!==e.toString()&&t(n,{replace:!0})},[e,t,R,j,N,F]),(0,_.useEffect)(()=>{try{if(j===`all`){localStorage.removeItem(i9);return}let e={mode:j,preset:N,start:F,end:R};localStorage.setItem(i9,JSON.stringify(e))}catch{}},[R,j,N,F]);let Me=(0,_.useMemo)(()=>{if(n.listRunSummariesPage)return i;let e=E===`all`?i:i.filter(e=>e.scenarios.some(e=>{let t=String(e.scenarioName??``).trim(),n=String(e.scenarioId??``).trim();return t===E||n===E}));if(j===`all`)return e;let t=Date.now();if(j===`last`){let n=t-($7.find(e=>e.value===N)??$7[0]).durationMs;return e.filter(e=>{let r=new Date(e.timestamp).getTime();return r>=n&&r<=t})}let r=o9(F)?.getTime()??null,a=o9(R)?.getTime()??null,o=r!==null&&a!==null?Math.min(r,a):r??null,s=r!==null&&a!==null?Math.max(r,a):a??null;return e.filter(e=>{let t=new Date(e.timestamp).getTime();return!(Number.isNaN(t)||o!==null&&t<o||s!==null&&t>s)})},[i,E,n.listRunSummariesPage,R,j,N,F]);(0,_.useEffect)(()=>{B.reset()},[pe,B.reset,R,j,N,F]);let Ne=(0,_.useMemo)(()=>E===`all`?`All scenarios`:je.find(e=>e.value===E||e.label===E)?.label??E,[E,je]),Pe=(0,_.useMemo)(()=>{if(j===`all`)return`All time`;if(j===`last`)return $7.find(e=>e.value===N)?.label??`Last range`;let e=!!F.trim(),t=!!R.trim();return!e&&!t?`Custom range`:e&&t?`${c9(F)} - ${c9(R)}`:e?`From ${c9(F)}`:`Until ${c9(R)}`},[R,j,N,F]),Fe=(0,_.useMemo)(()=>{let e=(e,t)=>e===null&&t===null?0:e===null?1:t===null?-1:w===`asc`?e-t:t-e;return[...Me].sort((t,n)=>{if(S===`toolTokens`)return e(t.toolTokenUsage?.totalTokens??null,n.toolTokenUsage?.totalTokens??null);let r=0;return S===`id`&&(r=t.id.localeCompare(n.id)),S===`timestamp`&&(r=new Date(t.timestamp).getTime()-new Date(n.timestamp).getTime()),S===`passRate`&&(r=(t.overallPassRate??-1)-(n.overallPassRate??-1)),S===`scenarios`&&(r=t.totalScenarios-n.totalScenarios),S===`avgToolCalls`&&(r=t.avgToolCalls-n.avgToolCalls),w===`asc`?r:-r})},[Me,S,w]),Ie=(0,_.useMemo)(()=>{let e=[],t=null;for(let n of Fe){let r=Mfe(n.timestamp);r!==t&&(e.push({type:`day-separator`,dayKey:r,dayLabel:Nfe(n.timestamp)}),t=r),e.push({type:`run`,run:n})}return e},[Fe]),Le=e=>S===e?w===`asc`?(0,I.jsx)(cn,{className:`h-3.5 w-3.5`}):(0,I.jsx)(on,{className:`h-3.5 w-3.5`}):(0,I.jsx)(ln,{className:`h-3.5 w-3.5 text-muted-foreground`}),Re=e=>{let t=e.toolTokenUsage?.totalTokens;return typeof t==`number`?t.toLocaleString():`n/a`},ze=()=>{M(`all`),P(`15min`),L(``),z(``)},Be=(0,_.useMemo)(()=>{let e=new Map;for(let t of Fe){if(t.scenarios.length>0){e.set(t.id,MW(t));continue}let n=t.configName?.trim()||``,r=t.configPath?.trim()||``,i=n||r;e.set(t.id,{scenarioCount:t.totalScenarios,agentCount:0,scopePreview:i||`n/a`,modelSummary:``})}return e},[Fe]),Ve=()=>{ne?re(!1):(re(!0),Ae(`Ask me to compare runs, explain regressions over time, or summarize historical drift patterns.`))},He=async e=>{x(!0);try{await n.deleteResult(e),a(t=>t.filter(t=>t.id!==e)),s(t=>t.filter(t=>t.id!==e)),B.setTotalCount(e=>Math.max(0,e-1)),O({title:`Run deleted`,description:e}),y(null)}catch(e){O({title:`Could not delete run`,description:e instanceof Error?e.message:String(e),variant:`destructive`})}finally{x(!1)}},Ue=async e=>{if(!e.configPath?.trim())O({title:`Cannot rerun`,description:`This run has no config path in metadata.`,variant:`destructive`});else{fe(e.id);try{await Q7(n,e),O({title:`Rerun queued`,description:`${e.id} queued with previous run settings.`})}catch(e){O({title:`Could not rerun`,description:e instanceof Error?e.message:String(e),variant:`destructive`})}finally{fe(t=>t===e.id?null:t)}}};return(0,I.jsxs)(`div`,{ref:l,className:`flex flex-col`,children:[(0,I.jsx)(X6,{open:v!==null,onOpenChange:e=>{!e&&!b&&y(null)},children:(0,I.jsxs)(Q6,{children:[(0,I.jsxs)($6,{children:[(0,I.jsx)(t8,{children:`Delete run?`}),(0,I.jsxs)(n8,{children:[`This will permanently remove the run artifacts from disk for`,` `,(0,I.jsx)(`span`,{className:`font-mono`,children:v??``}),`.`]})]}),(0,I.jsxs)(e8,{children:[(0,I.jsx)(i8,{disabled:b,children:`Cancel`}),(0,I.jsx)(r8,{disabled:b||!v,onClick:e=>{e.preventDefault(),v&&He(v)},className:`bg-destructive text-destructive-foreground hover:bg-destructive/90`,children:b?`Deleting...`:`Delete run`})]})]})}),(0,I.jsxs)(`div`,{className:`flex items-start justify-between gap-3`,children:[(0,I.jsxs)(`div`,{children:[(0,I.jsxs)(`h1`,{className:`inline-flex items-center gap-2 text-2xl font-bold`,children:[(0,I.jsx)(rn,{className:`h-6 w-6`}),`Results`]}),(0,I.jsx)(`p`,{className:`text-sm text-muted-foreground`,children:`Browse evaluation runs and open detailed results`})]}),(0,I.jsxs)(`div`,{className:`flex flex-wrap items-center gap-2`,children:[(0,I.jsxs)(K8,{open:k,onOpenChange:A,children:[(0,I.jsx)(q8,{asChild:!0,children:(0,I.jsxs)(W,{type:`button`,variant:`outline`,role:`combobox`,"aria-expanded":k,"aria-controls":`results-scenario-command-list`,className:`w-[260px] justify-between font-normal ${E===`all`?``:`border-primary/40`}`,children:[(0,I.jsx)(`span`,{className:`truncate text-left`,children:Ne}),(0,I.jsx)(on,{className:`ml-2 h-4 w-4 shrink-0 opacity-50`})]})}),(0,I.jsx)(J8,{className:`w-[260px] p-0`,align:`start`,children:(0,I.jsxs)(b5,{children:[(0,I.jsx)(x5,{placeholder:`Search scenarios...`}),(0,I.jsxs)(S5,{id:`results-scenario-command-list`,children:[(0,I.jsx)(C5,{children:`No scenarios found.`}),(0,I.jsxs)(w5,{children:[(0,I.jsx)(T5,{value:`all scenarios`,onSelect:()=>{D(`all`),A(!1)},children:`All scenarios`}),je.map(e=>(0,I.jsx)(T5,{value:`${e.label} ${e.value}`,onSelect:()=>{D(e.value),A(!1)},children:e.label},e.value))]})]})]})})]}),(0,I.jsxs)(K8,{open:ee,onOpenChange:te,children:[(0,I.jsx)(q8,{asChild:!0,children:(0,I.jsxs)(W,{type:`button`,variant:`outline`,role:`combobox`,"aria-expanded":ee,"aria-controls":`results-time-command-list`,className:`w-[320px] justify-between font-normal ${j===`all`?``:`border-primary/40`}`,children:[(0,I.jsxs)(`span`,{className:`flex min-w-0 items-center gap-2 truncate text-left`,children:[(0,I.jsx)(nn,{className:`h-4 w-4 shrink-0 text-muted-foreground`}),(0,I.jsx)(`span`,{className:`truncate`,children:Pe})]}),(0,I.jsx)(on,{className:`ml-2 h-4 w-4 shrink-0 opacity-50`})]})}),(0,I.jsxs)(J8,{className:`w-[360px] p-0`,align:`start`,children:[(0,I.jsxs)(`div`,{className:`border-b px-3 py-2`,children:[(0,I.jsx)(`p`,{className:`text-sm font-medium`,children:`Date and time filter`}),(0,I.jsx)(`p`,{className:`text-xs text-muted-foreground`,children:`Filter runs by timestamp.`})]}),(0,I.jsxs)(`div`,{id:`results-time-command-list`,className:`grid gap-1 p-2`,children:[(0,I.jsx)(W,{type:`button`,variant:j===`all`?`secondary`:`ghost`,className:`justify-start`,onClick:()=>{ze(),te(!1)},children:`All time`}),$7.map(e=>(0,I.jsx)(W,{type:`button`,variant:j===`last`&&N===e.value?`secondary`:`ghost`,className:`justify-start`,onClick:()=>{M(`last`),P(e.value),te(!1)},children:e.label},e.value)),(0,I.jsx)(W,{type:`button`,variant:j===`custom`?`secondary`:`ghost`,className:`justify-start`,onClick:()=>M(`custom`),children:`Custom date time range`})]}),j===`custom`&&(0,I.jsxs)(`div`,{className:`space-y-3 border-t p-3`,children:[(0,I.jsxs)(`div`,{className:`space-y-2`,children:[(0,I.jsx)(Q,{htmlFor:`results-time-filter-start`,children:`Start`}),(0,I.jsx)(Op,{id:`results-time-filter-start`,type:`datetime-local`,value:F,onChange:e=>L(e.target.value)})]}),(0,I.jsxs)(`div`,{className:`space-y-2`,children:[(0,I.jsx)(Q,{htmlFor:`results-time-filter-end`,children:`End`}),(0,I.jsx)(Op,{id:`results-time-filter-end`,type:`datetime-local`,value:R,onChange:e=>z(e.target.value)})]}),(0,I.jsxs)(`div`,{className:`flex items-center justify-between gap-2`,children:[(0,I.jsxs)(W,{type:`button`,variant:`ghost`,size:`sm`,className:`px-2`,onClick:ze,children:[(0,I.jsx)(hr,{className:`mr-1.5 h-3.5 w-3.5`}),`Clear`]}),(0,I.jsx)(W,{type:`button`,size:`sm`,onClick:()=>te(!1),children:`Done`})]})]})]})]}),(0,I.jsx)(W,{variant:`outline`,onClick:()=>void ge(),disabled:h,children:h?`Refreshing...`:`Refresh`}),(0,I.jsx)(W,{variant:`outline`,onClick:B.prev,disabled:h||le===0,children:`Prev`}),(0,I.jsx)(W,{variant:`outline`,onClick:B.next,disabled:h||!de,children:`Next`}),(0,I.jsxs)(W,{type:`button`,variant:`outline`,className:`gap-1.5`,"aria-pressed":ne,onClick:Ve,children:[(0,I.jsx)(ar,{className:`h-4 w-4 text-amber-500`}),`MCP Lab Assistant`]})]})]}),(0,I.jsxs)(`div`,{className:`mt-2 flex items-center justify-between gap-3`,children:[(0,I.jsx)(`p`,{className:`text-xs text-muted-foreground`,children:B.rangeLabel(i.length)}),(0,I.jsxs)(W,{variant:`ghost`,size:`sm`,className:`h-7 gap-1.5 px-2 text-xs text-muted-foreground`,onClick:()=>m(e=>!e),"aria-pressed":p,children:[(0,I.jsx)(Fn,{className:`h-3 w-3`}),p?`Hide dashboard`:`Show dashboard`]})]}),p?(0,I.jsx)(`div`,{className:`mt-2`,children:(0,I.jsx)(xfe,{runs:o,loading:d})}):null,(0,I.jsxs)(`div`,{ref:u,style:se?{height:oe}:void 0,className:U(`mt-4 grid gap-6`,se?`grid-rows-[minmax(0,1fr)]`:`items-start`,ne?ie?`xl:grid-cols-[minmax(0,1fr)_52rem]`:`xl:grid-cols-[minmax(0,1fr)_30rem]`:`grid-cols-1`),children:[(0,I.jsx)(K,{"data-testid":`results-table`,className:U(`results-table-container`,se&&`flex min-h-0 flex-col overflow-hidden`),children:(0,I.jsx)(q,{className:U(`p-0`,se&&`min-h-0 flex-1`),children:(0,I.jsxs)(bv,{className:`table-auto`,containerClassName:se?`h-full`:void 0,children:[(0,I.jsx)(xv,{className:se?`sticky top-0 z-10 bg-card shadow-[0_1px_0_var(--color-border)]`:void 0,children:(0,I.jsxs)(wv,{children:[(0,I.jsx)(Tv,{className:`results-table-column-run-id w-120 max-w-120`,children:(0,I.jsxs)(`button`,{type:`button`,className:`inline-flex items-center gap-1 hover:text-foreground`,onClick:()=>me(`id`),children:[`Run ID`,Le(`id`)]})}),(0,I.jsx)(Tv,{className:`results-table-column-evaluation w-[20rem] max-w-[20rem] min-w-0`,children:`Evaluation`}),(0,I.jsx)(Tv,{className:`results-table-column-timestamp w-44 min-w-44 max-w-44`,children:(0,I.jsxs)(`button`,{type:`button`,className:`inline-flex items-center gap-1 hover:text-foreground`,onClick:()=>me(`timestamp`),children:[`Timestamp`,Le(`timestamp`)]})}),(0,I.jsx)(Tv,{className:`results-table-column-pass-rate w-30 min-w-30 max-w-30 text-center`,children:(0,I.jsxs)(`button`,{type:`button`,className:`inline-flex w-full items-center justify-end gap-1 hover:text-foreground`,onClick:()=>me(`passRate`),children:[`Pass Rate`,Le(`passRate`)]})}),(0,I.jsx)(Tv,{className:`results-table-column-scenarios w-22 min-w-22 max-w-22 text-right`,children:(0,I.jsxs)(`button`,{type:`button`,className:`inline-flex items-center gap-1 hover:text-foreground`,onClick:()=>me(`scenarios`),children:[`Scenarios`,Le(`scenarios`)]})}),(0,I.jsx)(Tv,{className:`results-table-column-avg-tools w-30 min-w-30 max-w-30 text-right`,children:(0,I.jsxs)(`button`,{type:`button`,className:`inline-flex items-center gap-1 hover:text-foreground`,onClick:()=>me(`avgToolCalls`),children:[`Avg Tools`,Le(`avgToolCalls`)]})}),(0,I.jsx)(Tv,{className:`results-table-column-tool-tokens w-36 min-w-36 max-w-36 text-right`,children:(0,I.jsxs)(`button`,{type:`button`,className:`inline-flex items-center gap-1 hover:text-foreground`,onClick:()=>me(`toolTokens`),children:[`Tool Tokens`,Le(`toolTokens`)]})}),(0,I.jsx)(Tv,{className:`results-table-column-actions w-36 min-w-36 max-w-36`})]})}),(0,I.jsx)(Sv,{children:Ie.length===0?(0,I.jsx)(wv,{children:(0,I.jsx)(J,{colSpan:r9,className:`px-4 py-10 text-center text-sm text-muted-foreground`,children:j===`all`&&E===`all`?`No runs yet.`:`No runs match current filters.`})}):Ie.map((e,t)=>e.type===`day-separator`?(0,I.jsx)(wv,{className:`bg-muted/30 hover:bg-muted/30`,children:(0,I.jsx)(J,{colSpan:r9,className:`px-4 py-3`,children:(0,I.jsxs)(`div`,{className:`flex items-center gap-3`,children:[(0,I.jsx)(`div`,{className:`h-px flex-1 bg-border/70`}),(0,I.jsx)(`span`,{className:`shrink-0 rounded-full border border-border bg-background px-2.5 py-0.5 text-[11px] font-medium uppercase tracking-wide text-muted-foreground`,children:e.dayLabel}),(0,I.jsx)(`div`,{className:`h-px flex-1 bg-border/70`})]})})},`day-${e.dayKey}-${t}`):(0,I.jsxs)(wv,{children:[(0,I.jsx)(J,{className:`results-table-column-run-id w-120 max-w-120`,children:(0,I.jsxs)(`div`,{className:`space-y-1`,children:[(0,I.jsx)(np,{to:`/results/${e.run.id}`,className:`font-mono text-xs text-primary hover:underline`,children:e.run.id}),(0,I.jsx)(`div`,{className:`min-w-0 truncate font-mono text-xs text-foreground/80`,title:Be.get(e.run.id)?.scopePreview??`n/a`,children:Be.get(e.run.id)?.scopePreview??`n/a`}),e.run.runNote?(0,I.jsxs)(`div`,{className:`text-[11px] text-muted-foreground wrap-break-word`,children:[`Note: `,e.run.runNote]}):null]})}),(0,I.jsx)(J,{className:`results-table-column-evaluation w-[20rem] max-w-[20rem] min-w-0 text-[11px] text-muted-foreground`,children:(()=>{let t=Be.get(e.run.id)??{scenarioCount:0,agentCount:0,scopePreview:`n/a`,modelSummary:``};return(0,I.jsxs)(`div`,{className:`space-y-1`,children:[(0,I.jsxs)(`div`,{className:`flex min-w-0 items-baseline gap-1.5`,children:[(0,I.jsxs)(`span`,{className:`shrink-0 whitespace-nowrap`,children:[t.scenarioCount,` scenario`,t.scenarioCount===1?``:`s`,` · `,t.agentCount,` `,`agent`,t.agentCount===1?``:`s`]}),t.modelSummary?(0,I.jsxs)(`span`,{className:`min-w-0 truncate`,title:t.modelSummary,children:[`· `,t.modelSummary]}):null]}),(0,I.jsx)(C7,{versions:e.run.mcpServerVersions,showPrefix:!1,className:`max-w-[18rem]`})]})})()}),(0,I.jsx)(J,{className:`results-table-column-timestamp w-44 min-w-44 max-w-44 text-xs text-muted-foreground`,children:(0,I.jsxs)(`div`,{className:`space-y-0.5`,children:[(0,I.jsxs)(`div`,{className:`flex items-center gap-1`,children:[(0,I.jsx)(_n,{className:`h-3 w-3`}),new Date(e.run.timestamp).toLocaleString()]}),(()=>{let t=z7(e.run);return t===null?null:(0,I.jsxs)(`div`,{className:`font-mono text-[11px] text-muted-foreground/90`,children:[`Total time: `,L7(t)]})})()]})}),(0,I.jsx)(J,{className:`results-table-column-pass-rate w-30 min-w-30 max-w-30 text-right`,children:(0,I.jsxs)(`div`,{className:`flex flex-col items-center gap-1`,children:[(0,I.jsx)(kv,{rate:e.run.overallPassRate}),e.run.checkCounts&&e.run.checkCounts.total>0?(0,I.jsxs)(`span`,{className:`font-mono text-[11px] leading-none`,"aria-label":`${e.run.checkCounts.passed} checks passed, ${e.run.checkCounts.failed} checks failed${e.run.checkCounts.not_evaluated>0?`, ${e.run.checkCounts.not_evaluated} not evaluated`:``}${(e.run.checkCounts.not_executed??0)>0?`, ${e.run.checkCounts.not_executed} not executed`:``}`,title:`${e.run.checkCounts.passed} passed · ${e.run.checkCounts.failed} failed${e.run.checkCounts.not_evaluated>0?` · ${e.run.checkCounts.not_evaluated} not evaluated`:``}${(e.run.checkCounts.not_executed??0)>0?` · ${e.run.checkCounts.not_executed} not executed`:``}`,children:[(0,I.jsxs)(`span`,{className:`text-success`,children:[e.run.checkCounts.passed,` ✓`]}),(0,I.jsx)(`span`,{className:`text-muted-foreground`,children:` · `}),(0,I.jsxs)(`span`,{className:`text-destructive`,children:[e.run.checkCounts.failed,` ✕`]})]}):null,(0,I.jsx)(Dfe,{run:e.run})]})}),(0,I.jsx)(J,{className:`results-table-column-scenarios w-22 min-w-22 max-w-22 text-right font-mono text-sm`,children:e.run.totalScenarios}),(0,I.jsx)(J,{className:`results-table-column-avg-tools w-30 min-w-30 max-w-30 text-center font-mono text-sm`,children:e.run.avgToolCalls.toFixed(0)}),(0,I.jsx)(J,{className:`results-table-column-tool-tokens w-36 min-w-36 max-w-36 text-right`,children:(0,I.jsxs)(`div`,{className:`space-y-0.5`,children:[(0,I.jsx)(`div`,{className:`font-mono text-sm`,children:Re(e.run)}),(()=>{let t=V7(e.run);return t===null?null:(0,I.jsxs)(`div`,{className:`font-mono text-[11px] text-muted-foreground/90`,children:[`Tool time: `,L7(t)]})})()]})}),(0,I.jsx)(J,{className:`results-table-column-actions w-36 min-w-36 max-w-36`,children:(0,I.jsxs)(`div`,{className:`flex items-center justify-end gap-2`,children:[(0,I.jsxs)(W,{size:`sm`,variant:`outline`,disabled:V===e.run.id,onClick:()=>void Ue(e.run),children:[(0,I.jsx)(Yn,{className:`mr-1.5 h-3.5 w-3.5`}),V===e.run.id?`Queueing...`:`Rerun`]}),(0,I.jsxs)(Rq,{children:[(0,I.jsx)(zq,{asChild:!0,children:(0,I.jsx)(W,{variant:`ghost`,size:`icon`,className:`h-8 w-8`,"aria-label":`More actions`,children:(0,I.jsx)(xn,{className:`h-4 w-4`})})}),(0,I.jsxs)(Hq,{align:`end`,children:[(0,I.jsx)(Uq,{asChild:!0,children:(0,I.jsxs)(np,{to:`/results/${e.run.id}`,children:[(0,I.jsx)(wn,{className:`mr-2 h-3.5 w-3.5`}),`View`]})}),Object.entries(e.run.langsmithTraceUrls??{}).map(([e,t])=>(0,I.jsx)(Uq,{asChild:!0,children:(0,I.jsxs)(`a`,{href:t,target:`_blank`,rel:`noreferrer`,children:[(0,I.jsx)(Sn,{className:`mr-2 h-3.5 w-3.5`}),`LangSmith trace`]})},e)),(0,I.jsxs)(Uq,{children:[(0,I.jsx)(yn,{className:`mr-2 h-3.5 w-3.5`}),`Export JSON`]}),(0,I.jsxs)(Uq,{className:`text-destructive`,onSelect:t=>{t.preventDefault();let n=document.activeElement;n instanceof HTMLElement&&n.blur(),y(e.run.id)},children:[(0,I.jsx)(lr,{className:`mr-2 h-3.5 w-3.5`}),`Delete`]})]})]})]})})]},e.run.id))})]})})}),ne&&(0,I.jsx)(`div`,{className:`min-h-0 min-w-0`,children:(0,I.jsx)(I7,{title:`MCP Lab Assistant`,description:`Analyze historical differences and trends across all result runs.`,expanded:ie,onToggleExpanded:()=>ae(e=>!e),onHide:()=>re(!1),messages:_e,pendingToolCalls:ve,loading:be,onCancel:xe?Ce:void 0,input:ye,onInputChange:Te,onSend:()=>void Ee(),inputPlaceholder:`Ask about historical run differences...`,snippets:Lfe,onSnippetSelect:e=>{re(!0),ke(e)},onApproveToolCall:De,onDenyToolCall:Oe,expired:Se,inputRef:we,className:`min-w-0 overflow-hidden xl:flex xl:h-full xl:min-h-0 xl:flex-col`})})]})]})};function zfe(e,t){return _.useReducer((e,n)=>t[e][n]??e,e)}var u9=`ScrollArea`,[d9,Bfe]=R(u9),[Vfe,f9]=d9(u9),p9=_.forwardRef((e,t)=>{let{__scopeScrollArea:n,type:r=`hover`,dir:i,scrollHideDelay:a=600,...o}=e,[s,c]=_.useState(null),[l,u]=_.useState(null),[d,f]=_.useState(null),[p,m]=_.useState(null),[h,g]=_.useState(null),[v,y]=_.useState(0),[b,x]=_.useState(0),[S,C]=_.useState(!1),[w,T]=_.useState(!1),E=P(t,e=>c(e)),D=BW(i);return(0,I.jsx)(Vfe,{scope:n,type:r,dir:D,scrollHideDelay:a,scrollArea:s,viewport:l,onViewportChange:u,content:d,onContentChange:f,scrollbarX:p,onScrollbarXChange:m,scrollbarXEnabled:S,onScrollbarXEnabledChange:C,scrollbarY:h,onScrollbarYChange:g,scrollbarYEnabled:w,onScrollbarYEnabledChange:T,onCornerWidthChange:y,onCornerHeightChange:x,children:(0,I.jsx)(V.div,{dir:D,...o,ref:E,style:{position:`relative`,"--radix-scroll-area-corner-width":v+`px`,"--radix-scroll-area-corner-height":b+`px`,...e.style}})})});p9.displayName=u9;var m9=`ScrollAreaViewport`,h9=_.forwardRef((e,t)=>{let{__scopeScrollArea:n,children:r,nonce:i,...a}=e,o=f9(m9,n),s=P(t,_.useRef(null),o.onViewportChange);return(0,I.jsxs)(I.Fragment,{children:[(0,I.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:i}),(0,I.jsx)(V.div,{"data-radix-scroll-area-viewport":``,...a,ref:s,style:{overflowX:o.scrollbarXEnabled?`scroll`:`hidden`,overflowY:o.scrollbarYEnabled?`scroll`:`hidden`,...e.style},children:(0,I.jsx)(`div`,{ref:o.onContentChange,style:{minWidth:`100%`,display:`table`},children:r})})]})});h9.displayName=m9;var g9=`ScrollAreaScrollbar`,_9=_.forwardRef((e,t)=>{let{forceMount:n,...r}=e,i=f9(g9,e.__scopeScrollArea),{onScrollbarXEnabledChange:a,onScrollbarYEnabledChange:o}=i,s=e.orientation===`horizontal`;return _.useEffect(()=>(s?a(!0):o(!0),()=>{s?a(!1):o(!1)}),[s,a,o]),i.type===`hover`?(0,I.jsx)(Hfe,{...r,ref:t,forceMount:n}):i.type===`scroll`?(0,I.jsx)(Ufe,{...r,ref:t,forceMount:n}):i.type===`auto`?(0,I.jsx)(v9,{...r,ref:t,forceMount:n}):i.type===`always`?(0,I.jsx)(y9,{...r,ref:t}):null});_9.displayName=g9;var Hfe=_.forwardRef((e,t)=>{let{forceMount:n,...r}=e,i=f9(g9,e.__scopeScrollArea),[a,o]=_.useState(!1);return _.useEffect(()=>{let e=i.scrollArea,t=0;if(e){let n=()=>{window.clearTimeout(t),o(!0)},r=()=>{t=window.setTimeout(()=>o(!1),i.scrollHideDelay)};return e.addEventListener(`pointerenter`,n),e.addEventListener(`pointerleave`,r),()=>{window.clearTimeout(t),e.removeEventListener(`pointerenter`,n),e.removeEventListener(`pointerleave`,r)}}},[i.scrollArea,i.scrollHideDelay]),(0,I.jsx)(Pe,{present:n||a,children:(0,I.jsx)(v9,{"data-state":a?`visible`:`hidden`,...r,ref:t})})}),Ufe=_.forwardRef((e,t)=>{let{forceMount:n,...r}=e,i=f9(g9,e.__scopeScrollArea),a=e.orientation===`horizontal`,o=M9(()=>c(`SCROLL_END`),100),[s,c]=zfe(`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 _.useEffect(()=>{if(s===`idle`){let e=window.setTimeout(()=>c(`HIDE`),i.scrollHideDelay);return()=>window.clearTimeout(e)}},[s,i.scrollHideDelay,c]),_.useEffect(()=>{let e=i.viewport,t=a?`scrollLeft`:`scrollTop`;if(e){let n=e[t],r=()=>{let r=e[t];n!==r&&(c(`SCROLL`),o()),n=r};return e.addEventListener(`scroll`,r),()=>e.removeEventListener(`scroll`,r)}},[i.viewport,a,c,o]),(0,I.jsx)(Pe,{present:n||s!==`hidden`,children:(0,I.jsx)(y9,{"data-state":s===`hidden`?`hidden`:`visible`,...r,ref:t,onPointerEnter:j(e.onPointerEnter,()=>c(`POINTER_ENTER`)),onPointerLeave:j(e.onPointerLeave,()=>c(`POINTER_LEAVE`))})})}),v9=_.forwardRef((e,t)=>{let n=f9(g9,e.__scopeScrollArea),{forceMount:r,...i}=e,[a,o]=_.useState(!1),s=e.orientation===`horizontal`,c=M9(()=>{if(n.viewport){let e=n.viewport.offsetWidth<n.viewport.scrollWidth,t=n.viewport.offsetHeight<n.viewport.scrollHeight;o(s?e:t)}},10);return N9(n.viewport,c),N9(n.content,c),(0,I.jsx)(Pe,{present:r||a,children:(0,I.jsx)(y9,{"data-state":a?`visible`:`hidden`,...i,ref:t})})}),y9=_.forwardRef((e,t)=>{let{orientation:n=`vertical`,...r}=e,i=f9(g9,e.__scopeScrollArea),a=_.useRef(null),o=_.useRef(0),[s,c]=_.useState({content:0,viewport:0,scrollbar:{size:0,paddingStart:0,paddingEnd:0}}),l=D9(s.viewport,s.content),u={...r,sizes:s,onSizesChange:c,hasThumb:l>0&&l<1,onThumbChange:e=>a.current=e,onThumbPointerUp:()=>o.current=0,onThumbPointerDown:e=>o.current=e};function d(e,t){return Yfe(e,o.current,s,t)}return n===`horizontal`?(0,I.jsx)(Wfe,{...u,ref:t,onThumbPositionChange:()=>{if(i.viewport&&a.current){let e=i.viewport.scrollLeft,t=k9(e,s,i.dir);a.current.style.transform=`translate3d(${t}px, 0, 0)`}},onWheelScroll:e=>{i.viewport&&(i.viewport.scrollLeft=e)},onDragScroll:e=>{i.viewport&&(i.viewport.scrollLeft=d(e,i.dir))}}):n===`vertical`?(0,I.jsx)(Gfe,{...u,ref:t,onThumbPositionChange:()=>{if(i.viewport&&a.current){let e=i.viewport.scrollTop,t=k9(e,s);a.current.style.transform=`translate3d(0, ${t}px, 0)`}},onWheelScroll:e=>{i.viewport&&(i.viewport.scrollTop=e)},onDragScroll:e=>{i.viewport&&(i.viewport.scrollTop=d(e))}}):null}),Wfe=_.forwardRef((e,t)=>{let{sizes:n,onSizesChange:r,...i}=e,a=f9(g9,e.__scopeScrollArea),[o,s]=_.useState(),c=_.useRef(null),l=P(t,c,a.onScrollbarXChange);return _.useEffect(()=>{c.current&&s(getComputedStyle(c.current))},[c]),(0,I.jsx)(x9,{"data-orientation":`horizontal`,...i,ref:l,sizes:n,style:{bottom:0,left:a.dir===`rtl`?`var(--radix-scroll-area-corner-width)`:0,right:a.dir===`ltr`?`var(--radix-scroll-area-corner-width)`:0,"--radix-scroll-area-thumb-width":O9(n)+`px`,...e.style},onThumbPointerDown:t=>e.onThumbPointerDown(t.x),onDragScroll:t=>e.onDragScroll(t.x),onWheelScroll:(t,n)=>{if(a.viewport){let r=a.viewport.scrollLeft+t.deltaX;e.onWheelScroll(r),j9(r,n)&&t.preventDefault()}},onResize:()=>{c.current&&a.viewport&&o&&r({content:a.viewport.scrollWidth,viewport:a.viewport.offsetWidth,scrollbar:{size:c.current.clientWidth,paddingStart:E9(o.paddingLeft),paddingEnd:E9(o.paddingRight)}})}})}),Gfe=_.forwardRef((e,t)=>{let{sizes:n,onSizesChange:r,...i}=e,a=f9(g9,e.__scopeScrollArea),[o,s]=_.useState(),c=_.useRef(null),l=P(t,c,a.onScrollbarYChange);return _.useEffect(()=>{c.current&&s(getComputedStyle(c.current))},[c]),(0,I.jsx)(x9,{"data-orientation":`vertical`,...i,ref:l,sizes:n,style:{top:0,right:a.dir===`ltr`?0:void 0,left:a.dir===`rtl`?0:void 0,bottom:`var(--radix-scroll-area-corner-height)`,"--radix-scroll-area-thumb-height":O9(n)+`px`,...e.style},onThumbPointerDown:t=>e.onThumbPointerDown(t.y),onDragScroll:t=>e.onDragScroll(t.y),onWheelScroll:(t,n)=>{if(a.viewport){let r=a.viewport.scrollTop+t.deltaY;e.onWheelScroll(r),j9(r,n)&&t.preventDefault()}},onResize:()=>{c.current&&a.viewport&&o&&r({content:a.viewport.scrollHeight,viewport:a.viewport.offsetHeight,scrollbar:{size:c.current.clientHeight,paddingStart:E9(o.paddingTop),paddingEnd:E9(o.paddingBottom)}})}})}),[Kfe,b9]=d9(g9),x9=_.forwardRef((e,t)=>{let{__scopeScrollArea:n,sizes:r,hasThumb:i,onThumbChange:a,onThumbPointerUp:o,onThumbPointerDown:s,onThumbPositionChange:c,onDragScroll:l,onWheelScroll:u,onResize:d,...f}=e,p=f9(g9,n),[m,h]=_.useState(null),g=P(t,e=>h(e)),v=_.useRef(null),y=_.useRef(``),b=p.viewport,x=r.content-r.viewport,S=pe(u),C=pe(c),w=M9(d,10);function T(e){if(v.current){let t=e.clientX-v.current.left,n=e.clientY-v.current.top;l({x:t,y:n})}}return _.useEffect(()=>{let e=e=>{let t=e.target;m?.contains(t)&&S(e,x)};return document.addEventListener(`wheel`,e,{passive:!1}),()=>document.removeEventListener(`wheel`,e,{passive:!1})},[b,m,x,S]),_.useEffect(C,[r,C]),N9(m,w),N9(p.content,w),(0,I.jsx)(Kfe,{scope:n,scrollbar:m,hasThumb:i,onThumbChange:pe(a),onThumbPointerUp:pe(o),onThumbPositionChange:C,onThumbPointerDown:pe(s),children:(0,I.jsx)(V.div,{...f,ref:g,style:{position:`absolute`,...f.style},onPointerDown:j(e.onPointerDown,e=>{e.button===0&&(e.target.setPointerCapture(e.pointerId),v.current=m.getBoundingClientRect(),y.current=document.body.style.webkitUserSelect,document.body.style.webkitUserSelect=`none`,p.viewport&&(p.viewport.style.scrollBehavior=`auto`),T(e))}),onPointerMove:j(e.onPointerMove,T),onPointerUp:j(e.onPointerUp,e=>{let t=e.target;t.hasPointerCapture(e.pointerId)&&t.releasePointerCapture(e.pointerId),document.body.style.webkitUserSelect=y.current,p.viewport&&(p.viewport.style.scrollBehavior=``),v.current=null})})})}),S9=`ScrollAreaThumb`,C9=_.forwardRef((e,t)=>{let{forceMount:n,...r}=e,i=b9(S9,e.__scopeScrollArea);return(0,I.jsx)(Pe,{present:n||i.hasThumb,children:(0,I.jsx)(qfe,{ref:t,...r})})}),qfe=_.forwardRef((e,t)=>{let{__scopeScrollArea:n,style:r,...i}=e,a=f9(S9,n),o=b9(S9,n),{onThumbPositionChange:s}=o,c=P(t,e=>o.onThumbChange(e)),l=_.useRef(void 0),u=M9(()=>{l.current&&=(l.current(),void 0)},100);return _.useEffect(()=>{let e=a.viewport;if(e){let t=()=>{if(u(),!l.current){let t=Xfe(e,s);l.current=t,s()}};return s(),e.addEventListener(`scroll`,t),()=>e.removeEventListener(`scroll`,t)}},[a.viewport,u,s]),(0,I.jsx)(V.div,{"data-state":o.hasThumb?`visible`:`hidden`,...i,ref:c,style:{width:`var(--radix-scroll-area-thumb-width)`,height:`var(--radix-scroll-area-thumb-height)`,...r},onPointerDownCapture:j(e.onPointerDownCapture,e=>{let t=e.target.getBoundingClientRect(),n=e.clientX-t.left,r=e.clientY-t.top;o.onThumbPointerDown({x:n,y:r})}),onPointerUp:j(e.onPointerUp,o.onThumbPointerUp)})});C9.displayName=S9;var w9=`ScrollAreaCorner`,T9=_.forwardRef((e,t)=>{let n=f9(w9,e.__scopeScrollArea),r=!!(n.scrollbarX&&n.scrollbarY);return n.type!==`scroll`&&r?(0,I.jsx)(Jfe,{...e,ref:t}):null});T9.displayName=w9;var Jfe=_.forwardRef((e,t)=>{let{__scopeScrollArea:n,...r}=e,i=f9(w9,n),[a,o]=_.useState(0),[s,c]=_.useState(0),l=!!(a&&s);return N9(i.scrollbarX,()=>{let e=i.scrollbarX?.offsetHeight||0;i.onCornerHeightChange(e),c(e)}),N9(i.scrollbarY,()=>{let e=i.scrollbarY?.offsetWidth||0;i.onCornerWidthChange(e),o(e)}),l?(0,I.jsx)(V.div,{...r,ref:t,style:{width:a,height:s,position:`absolute`,right:i.dir===`ltr`?0:void 0,left:i.dir===`rtl`?0:void 0,bottom:0,...e.style}}):null});function E9(e){return e?parseInt(e,10):0}function D9(e,t){let n=e/t;return isNaN(n)?0:n}function O9(e){let t=D9(e.viewport,e.content),n=e.scrollbar.paddingStart+e.scrollbar.paddingEnd,r=(e.scrollbar.size-n)*t;return Math.max(r,18)}function Yfe(e,t,n,r=`ltr`){let i=O9(n),a=i/2,o=t||a,s=i-o,c=n.scrollbar.paddingStart+o,l=n.scrollbar.size-n.scrollbar.paddingEnd-s,u=n.content-n.viewport,d=r===`ltr`?[0,u]:[u*-1,0];return A9([c,l],d)(e)}function k9(e,t,n=`ltr`){let r=O9(t),i=t.scrollbar.paddingStart+t.scrollbar.paddingEnd,a=t.scrollbar.size-i,o=t.content-t.viewport,s=a-r,c=Jq(e,n===`ltr`?[0,o]:[o*-1,0]);return A9([0,o],[0,s])(c)}function A9(e,t){return n=>{if(e[0]===e[1]||t[0]===t[1])return t[0];let r=(t[1]-t[0])/(e[1]-e[0]);return t[0]+r*(n-e[0])}}function j9(e,t){return e>0&&e<t}var Xfe=(e,t=()=>{})=>{let n={left:e.scrollLeft,top:e.scrollTop},r=0;return(function i(){let a={left:e.scrollLeft,top:e.scrollTop},o=n.left!==a.left,s=n.top!==a.top;(o||s)&&t(),n=a,r=window.requestAnimationFrame(i)})(),()=>window.cancelAnimationFrame(r)};function M9(e,t){let n=pe(e),r=_.useRef(0);return _.useEffect(()=>()=>window.clearTimeout(r.current),[]),_.useCallback(()=>{window.clearTimeout(r.current),r.current=window.setTimeout(n,t)},[n,t])}function N9(e,t){let n=pe(t);Ae(()=>{let t=0;if(e){let r=new ResizeObserver(()=>{cancelAnimationFrame(t),t=window.requestAnimationFrame(n)});return r.observe(e),()=>{window.cancelAnimationFrame(t),r.unobserve(e)}}},[e,n])}var P9=p9,Zfe=h9,Qfe=T9,F9=_.forwardRef(({className:e,children:t,...n},r)=>(0,I.jsxs)(P9,{ref:r,className:U(`relative overflow-hidden`,e),...n,children:[(0,I.jsx)(Zfe,{className:`h-full w-full rounded-[inherit]`,children:t}),(0,I.jsx)(I9,{}),(0,I.jsx)(Qfe,{})]}));F9.displayName=P9.displayName;var I9=_.forwardRef(({className:e,orientation:t=`vertical`,...n},r)=>(0,I.jsx)(_9,{ref:r,orientation:t,className:U(`flex touch-none select-none transition-colors`,t===`vertical`&&`h-full w-2.5 border-l border-l-transparent p-px`,t===`horizontal`&&`h-2.5 flex-col border-t border-t-transparent p-px`,e),...n,children:(0,I.jsx)(C9,{className:`relative flex-1 rounded-full bg-border`})}));I9.displayName=_9.displayName;function $fe(e){let t=e.scenarios.reduce((e,t)=>e+t.runs.filter(e=>e.passed).length,0),n=e.outcomes?.stopped??e.scenarios.reduce((e,t)=>e+t.runs.filter(e=>e.outcome===`stopped`).length,0),r=Math.max(0,e.totalRuns-t-n),i=b_(t,e.totalRuns,n),a={};e.scenarios.forEach(e=>e.runs.forEach(e=>e.toolCalls.forEach(e=>{a[e.name]=(a[e.name]||0)+1})));let o=Object.keys(a),s=Object.values(a),c=e.scenarios.map(e=>{let t=b_(e.runs.filter(e=>e.passed).length,e.runs.length,e.runs.filter(e=>e.outcome===`stopped`).length);return`
|
|
165
|
-
<div class="scenario-card">
|
|
166
|
-
<div class="scenario-header" onclick="this.parentElement.classList.toggle('open')">
|
|
167
|
-
<span class="chevron">▶</span>
|
|
168
|
-
<span class="scenario-name">${L9(e.scenarioName)}</span>
|
|
169
|
-
<span class="scenario-agent">${L9(e.agentName)}</span>
|
|
170
|
-
<span class="mono">${e.runs.length} runs</span>
|
|
171
|
-
<span class="badge ${t===null?`badge-neutral`:t>=.8?`badge-pass`:t>=.5?`badge-warn`:`badge-fail`}">${Wi(t)}</span>
|
|
172
|
-
<span class="mono">${e.avgToolCalls.toFixed(1)} avg tools</span>
|
|
173
|
-
</div>
|
|
174
|
-
<div class="scenario-detail">
|
|
175
|
-
${e.runs.map(e=>`
|
|
176
|
-
<div class="run-row">
|
|
177
|
-
<span class="run-status ${e.outcome===`stopped`?`stopped`:e.passed?`pass`:`fail`}" title="${e.outcome===`stopped`?`Stopped`:e.passed?`Passed`:`Failed`}">${e.outcome===`stopped`?`◷`:e.passed?`✓`:`✗`}</span>
|
|
178
|
-
<span class="mono run-label">Run #${e.runIndex+1}</span>
|
|
179
|
-
<span class="mono run-duration">${e.duration}ms</span>
|
|
180
|
-
<div class="tool-pills">
|
|
181
|
-
${e.toolCalls.map(e=>`<span class="pill">${L9(e.name)} <small>${e.duration}ms</small></span>`).join(``)}
|
|
182
|
-
</div>
|
|
183
|
-
${e.failureReasons.length?`<div class="failure-reasons">${e.failureReasons.map(e=>L9(e)).join(`, `)}</div>`:``}
|
|
184
|
-
</div>`).join(``)}
|
|
185
|
-
</div>
|
|
186
|
-
</div>`}).join(``);return`<!DOCTYPE html>
|
|
187
|
-
<html lang="en">
|
|
188
|
-
<head>
|
|
189
|
-
<meta charset="UTF-8">
|
|
190
|
-
<meta name="viewport" content="width=device-width, initial-scale=1.0">
|
|
191
|
-
<title>MCPLab Report — ${L9(e.id)}</title>
|
|
192
|
-
<script src="https://cdn.jsdelivr.net/npm/chart.js@4"><\/script>
|
|
193
|
-
<style>
|
|
194
|
-
*{box-sizing:border-box;margin:0;padding:0}
|
|
195
|
-
body{font-family:-apple-system,BlinkMacSystemFont,'Segoe UI',Roboto,sans-serif;background:#f9fafb;color:#1f2937;padding:2rem;max-width:1100px;margin:0 auto}
|
|
196
|
-
h1{font-size:1.5rem;font-weight:700}
|
|
197
|
-
.mono{font-family:'JetBrains Mono',ui-monospace,monospace;font-size:.8rem}
|
|
198
|
-
.header{display:flex;align-items:center;gap:1rem;margin-bottom:.25rem}
|
|
199
|
-
.sub{font-size:.75rem;color:#6b7280;margin-bottom:1.5rem}
|
|
200
|
-
.stats{display:grid;grid-template-columns:repeat(auto-fit,minmax(160px,1fr));gap:1rem;margin-bottom:2rem}
|
|
201
|
-
.stat{background:#fff;border:1px solid #e5e7eb;border-radius:.75rem;padding:1rem}
|
|
202
|
-
.stat-label{font-size:.7rem;color:#6b7280;text-transform:uppercase;letter-spacing:.05em}
|
|
203
|
-
.stat-value{font-size:1.5rem;font-weight:700;margin-top:.25rem}
|
|
204
|
-
.charts{display:grid;grid-template-columns:1fr 1fr;gap:1.5rem;margin-bottom:2rem}
|
|
205
|
-
.chart-card{background:#fff;border:1px solid #e5e7eb;border-radius:.75rem;padding:1rem}
|
|
206
|
-
.chart-card h3{font-size:.85rem;font-weight:600;margin-bottom:.75rem}
|
|
207
|
-
canvas{max-height:220px}
|
|
208
|
-
.scenario-card{background:#fff;border:1px solid #e5e7eb;border-radius:.75rem;margin-bottom:.75rem;overflow:hidden}
|
|
209
|
-
.scenario-header{display:flex;align-items:center;gap:.75rem;padding:.75rem 1rem;cursor:pointer;font-size:.85rem}
|
|
210
|
-
.scenario-header:hover{background:#f9fafb}
|
|
211
|
-
.chevron{font-size:.6rem;transition:transform .15s;color:#9ca3af}
|
|
212
|
-
.scenario-card.open .chevron{transform:rotate(90deg)}
|
|
213
|
-
.scenario-name{font-weight:600;flex:1}
|
|
214
|
-
.scenario-agent{color:#6b7280;font-size:.8rem}
|
|
215
|
-
.scenario-detail{display:none;border-top:1px solid #e5e7eb;padding:.75rem 1rem;background:#fafafa}
|
|
216
|
-
.scenario-card.open .scenario-detail{display:block}
|
|
217
|
-
.run-row{display:flex;flex-wrap:wrap;align-items:center;gap:.5rem;padding:.5rem 0;border-bottom:1px solid #f3f4f6;font-size:.8rem}
|
|
218
|
-
.run-row:last-child{border-bottom:none}
|
|
219
|
-
.run-status{font-weight:700;font-size:1rem}
|
|
220
|
-
.run-status.pass{color:#059669}
|
|
221
|
-
.run-status.fail{color:#dc2626}
|
|
222
|
-
.run-status.stopped{color:#6b7280}
|
|
223
|
-
.run-duration{color:#6b7280}
|
|
224
|
-
.tool-pills{display:flex;flex-wrap:wrap;gap:.25rem}
|
|
225
|
-
.pill{background:#fef3c7;color:#92400e;padding:2px 8px;border-radius:9999px;font-size:.7rem;font-family:'JetBrains Mono',monospace}
|
|
226
|
-
.pill small{color:#b45309;margin-left:2px}
|
|
227
|
-
.failure-reasons{width:100%;color:#dc2626;font-size:.75rem;margin-top:.25rem}
|
|
228
|
-
.badge{padding:2px 10px;border-radius:9999px;font-size:.75rem;font-weight:600}
|
|
229
|
-
.badge-pass{background:#d1fae5;color:#065f46}
|
|
230
|
-
.badge-warn{background:#fef3c7;color:#92400e}
|
|
231
|
-
.badge-fail{background:#fee2e2;color:#991b1b}
|
|
232
|
-
.badge-neutral{background:#f3f4f6;color:#6b7280}
|
|
233
|
-
.footer{text-align:center;color:#9ca3af;font-size:.7rem;margin-top:2rem;padding-top:1rem;border-top:1px solid #e5e7eb}
|
|
234
|
-
</style>
|
|
235
|
-
</head>
|
|
236
|
-
<body>
|
|
237
|
-
<div class="header">
|
|
238
|
-
<h1 class="mono">${L9(e.id)}</h1>
|
|
239
|
-
<span class="badge ${i===null?`badge-neutral`:i>=.8?`badge-pass`:i>=.5?`badge-warn`:`badge-fail`}">${Wi(i)}${i===null?``:` pass`}</span>
|
|
240
|
-
</div>
|
|
241
|
-
<p class="sub">${new Date(e.timestamp).toLocaleString()} · Config hash: <span class="mono">${L9(e.configHash)}</span></p>
|
|
242
|
-
|
|
243
|
-
<div class="stats">
|
|
244
|
-
<div class="stat"><div class="stat-label">Scenarios</div><div class="stat-value">${e.totalScenarios}</div></div>
|
|
245
|
-
<div class="stat"><div class="stat-label">Total Runs</div><div class="stat-value">${e.totalRuns}</div></div>
|
|
246
|
-
<div class="stat"><div class="stat-label">Pass Rate</div><div class="stat-value">${Wi(i)}</div></div>
|
|
247
|
-
<div class="stat"><div class="stat-label">Avg Tool Calls</div><div class="stat-value">${e.avgToolCalls.toFixed(1)}</div></div>
|
|
248
|
-
<div class="stat"><div class="stat-label">Avg Latency</div><div class="stat-value">${e.avgLatency}ms</div></div>
|
|
249
|
-
</div>
|
|
250
|
-
|
|
251
|
-
<div class="charts">
|
|
252
|
-
<div class="chart-card"><h3>Run outcomes</h3><canvas id="pieChart"></canvas></div>
|
|
253
|
-
<div class="chart-card"><h3>Tool Usage</h3><canvas id="barChart"></canvas></div>
|
|
254
|
-
</div>
|
|
255
|
-
|
|
256
|
-
<h2 style="font-size:1rem;font-weight:600;margin-bottom:.75rem">Scenarios</h2>
|
|
257
|
-
${c}
|
|
258
|
-
|
|
259
|
-
<div class="footer">Generated by MCPLab · ${new Date().toISOString()}</div>
|
|
260
|
-
|
|
261
|
-
<script>
|
|
262
|
-
new Chart(document.getElementById('pieChart'),{type:'doughnut',data:{labels:['Pass','Fail','Stopped'],datasets:[{data:[${t},${r},${n}],backgroundColor:['#059669','#dc2626','#6b7280'],borderWidth:0}]},options:{cutout:'60%',plugins:{legend:{position:'bottom',labels:{font:{size:11}}}}}});
|
|
263
|
-
new Chart(document.getElementById('barChart'),{type:'bar',data:{labels:${JSON.stringify(o)},datasets:[{data:${JSON.stringify(s)},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}}}}}});
|
|
264
|
-
<\/script>
|
|
265
|
-
</body>
|
|
266
|
-
</html>`}function L9(e){return e.replace(/&/g,`&`).replace(/</g,`<`).replace(/>/g,`>`).replace(/"/g,`"`)}var epe=`mcplab.resultAssistantScenarioHandoff`,tpe=[{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 R9(e){return`mcplab/reports/result-assistant/${e}-${new Date().toISOString().replace(/[:]/g,`-`).replace(/\..+/,``)}.md`}function z9(e){let t=e.toFixed(1);return t.endsWith(`.0`)?t.slice(0,-2):t}var npe=()=>{let{id:e}=Zd(),t=qd(),[n]=cp(),{source:r}=nv(),i=n.get(`embed`)===`1`,{configs:a}=fv(),{scenarios:o}=hv(),[s,c]=(0,_.useState)(void 0),[l,u]=(0,_.useState)(!0),[d,f]=(0,_.useState)(!1),[p,m]=(0,_.useState)(``),[h,g]=(0,_.useState)(!1),[v,y]=(0,_.useState)(new Set),[b,x]=(0,_.useState)(new Set),[S,C]=(0,_.useState)(``),[w,T]=(0,_.useState)(!1),[E,D]=(0,_.useState)(!1),[k,A]=(0,_.useState)(`assistant`),[j,M]=(0,_.useState)(null),[N,P]=(0,_.useState)(!1),[F,L]=(0,_.useState)(``),[R,z]=(0,_.useState)(``),[ee,te]=(0,_.useState)(!1),[ne,re]=(0,_.useState)(!1),[ie,ae]=(0,_.useState)(!1),[oe,se]=(0,_.useState)([]),[ce,B]=(0,_.useState)(!1),[le,ue]=(0,_.useState)(``),[de,V]=(0,_.useState)(null),[fe,pe]=(0,_.useState)(!1),[me,he]=(0,_.useState)(null),[ge,_e]=(0,_.useState)(!1),[ve,ye]=(0,_.useState)(!1),[be,xe]=(0,_.useState)(!1),Se=(0,_.useRef)(null),[Ce,we]=(0,_.useState)(!1),{assistantMessages:Te,assistantPendingToolCalls:Ee,assistantInput:De,assistantLoading:Oe,assistantTurnCancelable:ke,assistantExpired:Ae,cancelAssistantTurn:je,assistantInputRef:Me,setAssistantInput:Ne,askAssistant:Pe,approveResultAssistantToolCall:Fe,denyResultAssistantToolCall:Ie,applyResultAssistantSnippet:Le,ensureIntroMessage:Re,resetAssistantSession:ze}=Z7({source:r,open:w,scope:`run`,runId:e,onSessionSync:void 0}),Be=(0,_.useCallback)(async(e,t)=>{B(!0);try{let n=(await r.listMarkdownReports()).filter(t=>{let n=String(t.relativePath??``),r=String(t.name??``);return n.includes(e)||r.includes(e)});if(se(n),t&&n.length>0){let e=n.find(e=>e.relativePath===t||e.path===t||e.relativePath.endsWith(t)||e.path.endsWith(t));e&&ue(e.relativePath)}return n}catch{return se([]),[]}finally{B(!1)}},[r]);(0,_.useEffect)(()=>{if(!e)return;let t=!0;return ze(),u(!0),r.getResult(e).then(e=>{t&&(c(e),m(e?.runNote??``),f(!1),u(!1))}),()=>{t=!1}},[e,r,ze]),(0,_.useEffect)(()=>{let e=Se.current;if(!e)return;let t=()=>{we(e.clientWidth<800)};if(t(),typeof ResizeObserver<`u`){let n=new ResizeObserver(()=>t());return n.observe(e),()=>n.disconnect()}return window.addEventListener(`resize`,t),()=>window.removeEventListener(`resize`,t)},[l]),(0,_.useEffect)(()=>{if(!s?.id)se([]);else return(async()=>{await Be(s.id)})(),()=>{}},[s?.id,Be]),(0,_.useEffect)(()=>{oe.length===0?(ue(``),V(null),he(null)):(!le||!oe.some(e=>e.relativePath===le))&&ue(oe[0].relativePath)},[oe,le]),(0,_.useEffect)(()=>{if(!w||k!==`reports`)return;if(!le){V(null),he(null);return}let e=!0;return pe(!0),he(null),r.getMarkdownReport(le).then(t=>{e&&V(t)}).catch(t=>{e&&(V(null),he(t instanceof Error?t.message:String(t)))}).finally(()=>{e&&pe(!1)}),()=>{e=!1}},[w,k,le,r]);let Ve=n.get(`configId`)??``,He=(n.get(`agent`)??``).trim(),Ue=(0,_.useMemo)(()=>{let e=Ve?a.find(e=>e.id===Ve):void 0;if(e)return e;if(!s)return;let t=s.configPath?.trim(),n=s.configName?.trim(),r=a.find(e=>e.id===s.configId);if(r)return r;let i=e=>[e.relativePath,e.sourcePath,e.suitePath];return(t?a.find(e=>i(e).some(e=>e?.trim()===t)):void 0)||(t?a.find(e=>i(e).some(e=>e?.endsWith(`/${t}`)===!0)):void 0)||a.find(e=>n?e.name===n||e.configName===n:!1)},[a,Ve,s]),We=(0,_.useMemo)(()=>s?.configName?.trim()||s?.configPath?.trim()||Ue?.relativePath?.trim()||Ue?.name?.trim()||s?.configId?.trim()||``,[s,Ue]),Ge=(0,_.useMemo)(()=>s?.configName?.trim()||Ue?.name?.trim()||``,[s,Ue]),Ke=(0,_.useMemo)(()=>s?.configPath?.trim()||Ue?.relativePath?.trim()||``,[s,Ue]),qe=(0,_.useMemo)(()=>{let e=new Map;if(Ue){for(let t of Ue.scenarios)e.set(t.id,t),t.name&&!e.has(t.name)&&e.set(t.name,t);for(let t of Ue.scenarioEntries??[]){if(t.kind!==`referenced`)continue;let n=o.find(e=>e.id===t.ref);n&&(e.set(n.id,n),n.name&&e.set(n.name,n),e.has(t.ref)||e.set(t.ref,n))}}for(let t of o)e.has(t.id)||e.set(t.id,t),t.name&&!e.has(t.name)&&e.set(t.name,t);return e},[Ue,o]),Je=(0,_.useMemo)(()=>``,[]);(0,_.useEffect)(()=>{Ve&&a.some(e=>e.id===Ve)?C(Ve):Je&&C(e=>e||Je)},[Ve,a,Je]);let{filteredScenarios:Ye,filteredTotalRuns:Xe,filteredPassCount:Ze,displayPassRate:Qe,displayAvgToolCalls:$e,displayAvgLatency:et,displayDurationMs:tt,displayToolTimeMs:nt,displayToolTokenUsage:rt,filteredStoppedRuns:it}=(0,_.useMemo)(()=>{if(!s)return{filteredScenarios:[],filteredTotalRuns:0,filteredPassCount:0,displayPassRate:0,displayAvgToolCalls:0,displayAvgLatency:0,displayDurationMs:null,displayToolTimeMs:null,displayToolTokenUsage:null,filteredStoppedRuns:0};let e=He?s.scenarios.filter(e=>e.agentId===He||e.agentName===He):s.scenarios,t=e.reduce((e,t)=>e+t.runs.length,0),n=e.reduce((e,t)=>e+t.runs.filter(e=>e.passed).length,0),r=e.reduce((e,t)=>e+t.runs.filter(e=>e.outcome===`stopped`).length,0),i=!He&&s.outcomes?s.totalRuns:t,a=!He&&s.outcomes?.passed!==void 0?s.outcomes.passed:n,o=!He&&s.outcomes?.stopped!==void 0?s.outcomes.stopped:r,c=e.reduce((e,t)=>e+t.runs.reduce((e,t)=>e+t.toolCalls.length,0),0),l=z7({...s,scenarios:e}),u=V7({...s,scenarios:e});return{filteredScenarios:e,filteredTotalRuns:i,filteredPassCount:a,displayPassRate:b_(a,i,o),displayAvgToolCalls:i===0?0:c/i,displayAvgLatency:i===0||l===null?0:Math.round(l/i),displayDurationMs:l,displayToolTimeMs:u,displayToolTokenUsage:n_(e.map(e=>e.toolTokenUsage)),filteredStoppedRuns:o}},[s,He]),at=(0,_.useMemo)(()=>{let e={};return Ye.forEach(t=>t.runs.forEach(t=>t.toolCalls.forEach(t=>{e[t.name]=(e[t.name]||0)+1}))),Object.entries(e).map(([e,t])=>({name:e,count:t})).sort((e,t)=>t.count-e.count)},[Ye]);if(l)return(0,I.jsx)(`div`,{className:`p-8 text-center text-muted-foreground`,children:`Loading result...`});if(!s)return(0,I.jsx)(`div`,{className:`p-8 text-center text-muted-foreground`,children:`Result not found`});let ot=r_(Ye.flatMap(e=>e.runs.flatMap(e=>e.checkResults??[]))),st=Ye.flatMap(e=>e.runs),ct=!He&&s.outcomes?.incomplete!==void 0?s.outcomes.incomplete:st.filter(e=>e.outcome===`incomplete`).length,lt=!He&&s.outcomes?.error!==void 0?s.outcomes.error:st.filter(e=>e.outcome===`error`).length,ut=it,dt=e=>{y(t=>{let n=new Set(t);return n.has(e)?n.delete(e):n.add(e),n})},ft=(e,t,n,r)=>`${e}:${t}:${n}:${r}`,pt=(e,t)=>`${e}::${t}`,mt=e=>{x(t=>{let n=new Set(t);return n.has(e)?n.delete(e):n.add(e),n})},ht=(e,t=!e.endsWith(`:conversation`))=>b.has(e)?!t:t,gt=(e,t)=>{A(`assistant`),T(!0),M(t?.scenarioId??null),Re(`Ask me to explain failures, tool usage, or suggest what to inspect next in this result.`),e&&Ne(e)},_t=e=>{e&&ue(e),A(`reports`),T(!0)},vt=()=>{A(`note`),T(!0)},yt=e=>{if(!s)return;if(!j){O({title:`No scenario context`,description:`Ask about a specific scenario or run first, then send the suggestion.`,variant:`destructive`});return}let n=o.find(e=>e.id===j)??o.find(e=>e.name===j);if(!n){O({title:`Scenario not found in library`,description:`Could not find library scenario '${j}' to open in Scenario Assistant.`,variant:`destructive`});return}let r=[`I am sending a suggestion from the Result Assistant for scenario '${j}' based on run '${s.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:`,e].join(`
|
|
267
|
-
`);try{window.sessionStorage.setItem(epe,JSON.stringify({type:`result-assistant-handoff-v1`,runId:s.id,configId:Ve||s.configId||``,scenarioId:n.id,prompt:r,sourceReply:e})),t(`/libraries/test-cases/${encodeURIComponent(n.id)}?assistantHandoff=1`)}catch(e){O({title:`Could not create handoff`,description:e instanceof Error?e.message:String(e),variant:`destructive`})}},bt=e=>{s&&(ae(!1),L(e),z(R9(s.id)),te(!1),P(!0))},xt=()=>{s&&(ae(!0),L(``),z(R9(s.id)),te(!1),P(!0))},St=async()=>{if(s){if(!F.trim())O({title:`No markdown to write`,description:`The selected assistant response is empty.`,variant:`destructive`});else{re(!0);try{let e=await r.applyResultAssistantReport({runId:s.id,markdown:F,outputPath:R.trim()||void 0,overwrite:ee});O({title:`Markdown report written`,description:typeof e.path==`string`&&e.path?e.path:e.outputPath}),await Be(s.id,typeof e.path==`string`&&e.path||e.outputPath||void 0),w&&A(`reports`),P(!1)}catch(e){O({title:`Could not write markdown report`,description:e instanceof Error?e.message:String(e),variant:`destructive`})}finally{re(!1)}}}},Ct=async()=>{if(s){g(!0);try{let e=p.trim();await r.updateRunNote(s.id,e||void 0),c(t=>t&&{...t,runNote:e||void 0}),m(e),f(!1),O({title:`Run note saved`})}catch(e){O({title:`Could not save run note`,description:e instanceof Error?e.message:String(e),variant:`destructive`})}finally{g(!1)}}},wt=async()=>{if(s?.id){ye(!0);try{await r.deleteResult(s.id),O({title:`Run deleted`,description:s.id}),t(`/results`)}catch(e){O({title:`Could not delete run`,description:e instanceof Error?e.message:String(e),variant:`destructive`})}finally{ye(!1),_e(!1)}}},Tt=async()=>{if(!s?.id)return;let e=Ke.trim();if(!e)O({title:`Cannot rerun`,description:`This run has no config path in metadata.`,variant:`destructive`});else{xe(!0);try{await Q7(r,{...s,configPath:e}),O({title:`Rerun queued`,description:`${s.id} queued with previous run settings.`})}catch(e){O({title:`Could not rerun`,description:e instanceof Error?e.message:String(e),variant:`destructive`})}finally{xe(!1)}}};return(0,I.jsxs)(`div`,{className:`${w?`xl:flex xl:h-[calc(100vh-2rem-48px)] xl:min-h-0 xl:flex-col xl:overflow-hidden`:``}`,children:[(0,I.jsx)(`div`,{className:`${w?`xl:shrink-0 xl:pb-6`:`mb-6`}`,children:(0,I.jsxs)(`div`,{ref:Se,className:`flex flex-wrap items-start justify-between gap-3`,children:[(0,I.jsxs)(`div`,{className:`flex min-w-0 items-start gap-3`,children:[!i&&(0,I.jsx)(W,{variant:`ghost`,size:`icon`,asChild:!0,children:(0,I.jsx)(np,{to:`/results`,children:(0,I.jsx)(Qt,{className:`h-4 w-4`})})}),(0,I.jsxs)(`div`,{className:`min-w-0`,children:[(0,I.jsxs)(`div`,{className:`flex flex-wrap items-center gap-2`,children:[(0,I.jsx)(`h1`,{className:`text-2xl font-bold font-mono`,children:s.id}),(0,I.jsx)(kv,{rate:Qe})]}),(0,I.jsxs)(`p`,{className:`text-xs text-muted-foreground`,children:[(0,I.jsxs)(`span`,{className:`inline-flex items-center gap-1 align-middle`,children:[(0,I.jsx)(gn,{className:`h-3 w-3 shrink-0`}),new Date(s.timestamp).toLocaleString()]}),(0,I.jsx)(`span`,{className:`mx-1`,children:`·`}),He?(0,I.jsxs)(I.Fragment,{children:[(0,I.jsxs)(`span`,{className:`inline-flex items-center align-middle`,children:[`Agent: `,He]}),(0,I.jsx)(`span`,{className:`mx-1`,children:`·`})]}):null,Ge?(0,I.jsxs)(`span`,{className:`inline-flex items-center align-middle`,children:[`Eval: `,(0,I.jsx)(`span`,{className:`ml-1 font-medium`,children:Ge})]}):null,Ge&&Ke?(0,I.jsx)(`span`,{className:`mx-1`,children:`·`}):null,Ke?(0,I.jsxs)(`span`,{className:`inline-flex items-center align-middle`,children:[`Path: `,(0,I.jsx)(`span`,{className:`ml-1 font-mono`,children:Ke})]}):null,!Ge&&!Ke&&We?(0,I.jsxs)(`span`,{className:`inline-flex items-center align-middle`,children:[`Config: `,(0,I.jsx)(`span`,{className:`ml-1 font-mono`,children:We})]}):null,s.executionSource?(0,I.jsxs)(I.Fragment,{children:[(Ge||Ke||We)&&(0,I.jsx)(`span`,{className:`mx-1`,children:`·`}),(0,I.jsxs)(`span`,{className:`inline-flex items-center align-middle`,children:[`Source: `,(0,I.jsx)(`span`,{className:`ml-1 font-medium`,children:s.executionSource}),s.executionClient?(0,I.jsxs)(`span`,{className:`ml-1`,children:[`(`,s.executionClient,`)`]}):null]})]}):null]})]})]}),(0,I.jsxs)(`div`,{className:`flex w-full min-w-0 items-center justify-between gap-2 sm:ml-auto sm:w-auto`,children:[(0,I.jsx)(C7,{versions:s.mcpServerVersions}),(0,I.jsxs)(`div`,{className:`flex min-w-0 flex-wrap items-center justify-end gap-2`,children:[Object.entries(s.langsmithTraceUrls??{}).map(([e,t])=>(0,I.jsxs)(`a`,{href:t,target:`_blank`,rel:`noreferrer`,className:`inline-flex max-w-full items-center gap-1.5 rounded-md border border-input bg-background px-3 py-2 text-sm font-medium hover:bg-accent hover:text-accent-foreground`,"aria-label":`LangSmith trace`,title:`Open LangSmith trace`,children:[(0,I.jsx)(Sn,{className:`h-3.5 w-3.5`}),!i&&`LangSmith trace`]},e)),(0,I.jsxs)(W,{variant:`outline`,size:`sm`,className:`max-w-full gap-1.5 ${i?`px-2`:``}`,onClick:()=>{let e=$fe(s),t=new Blob([e],{type:`text/html`}),n=URL.createObjectURL(t),r=document.createElement(`a`);r.href=n,r.download=`mcplab-report-${s.id}.html`,r.click(),URL.revokeObjectURL(n)},"aria-label":`Download Report`,title:`Download Report`,children:[(0,I.jsx)(yn,{className:`h-3.5 w-3.5`}),!i&&`Download Report`]}),(0,I.jsxs)(W,{type:`button`,variant:`outline`,size:`sm`,className:`max-w-full gap-1.5`,onClick:()=>_t(),disabled:ce,children:[(0,I.jsx)(Un,{className:`h-3.5 w-3.5`}),ce?`Reports...`:`Reports${oe.length?` (${oe.length})`:``}`]}),(0,I.jsxs)(W,{type:`button`,variant:`outline`,size:`sm`,className:`max-w-full gap-1.5`,"aria-label":`Run Note`,onClick:()=>vt(),children:[(0,I.jsx)(Un,{className:`h-3.5 w-3.5`}),Ce?`Note`:`Run Note`]}),(0,I.jsxs)(W,{type:`button`,variant:`outline`,size:`sm`,className:`max-w-full gap-1.5`,"aria-label":`MCP Lab Assistant`,onClick:()=>gt(),children:[(0,I.jsx)(ar,{className:`h-4 w-4 text-amber-500`}),Ce?`Assistant`:`MCP Lab Assistant`]}),(0,I.jsxs)(W,{type:`button`,variant:`outline`,size:`sm`,className:`max-w-full gap-1.5`,onClick:()=>void Tt(),disabled:be||!Ke.trim(),children:[(0,I.jsx)(Yn,{className:`h-3.5 w-3.5`}),be?`Queueing...`:`Rerun`]}),(0,I.jsxs)(W,{type:`button`,variant:`outline`,size:`sm`,className:`max-w-full gap-1.5 text-destructive`,onClick:()=>_e(!0),disabled:ve,"aria-label":ve?`Deleting run`:`Delete run`,children:[ve?(0,I.jsx)(zn,{className:`h-4 w-4 animate-spin`}):(0,I.jsx)(mn,{className:`h-4 w-4`}),Ce?null:ve?`Deleting...`:`Delete`]})]})]})]})}),(0,I.jsxs)(`div`,{className:`grid gap-6 items-start ${w?E?`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:[(0,I.jsxs)(`div`,{className:`min-w-0 space-y-6 ${w?`xl:h-full xl:min-h-0 xl:overflow-y-auto xl:pr-2`:``}`,children:[(0,I.jsxs)(`div`,{className:`grid gap-4 ${w?`grid-cols-3`:`sm:grid-cols-2 lg:grid-cols-8`}`,children:[(0,I.jsx)(Dv,{title:`Scenarios`,value:Ye.length,icon:Pn}),(0,I.jsx)(Dv,{title:`Total Runs`,value:Xe,icon:Xt}),(0,I.jsx)(Dv,{title:`Pass Rate`,value:Wi(Qe),icon:rn}),(0,I.jsx)(Dv,{title:`Avg Tool Calls`,value:z9($e),icon:dn}),(0,I.jsx)(Dv,{title:`Avg Latency`,value:`${et}ms`,icon:cr}),tt===null?null:(0,I.jsx)(Dv,{title:`Total Time`,value:L7(tt),icon:_n}),nt===null?null:(0,I.jsx)(Dv,{title:`Tool Duration`,value:L7(nt),icon:_n}),(0,I.jsx)(Dv,{title:`Tool Tokens`,value:d6(rt?.totalTokens),icon:mr})]}),(0,I.jsxs)(`div`,{className:`grid gap-4 lg:grid-cols-4`,children:[(0,I.jsx)(X7,{title:`Runs Pass / Fail`,passed:Ze,failed:Math.max(0,Xe-Ze-ct-lt-ut),incomplete:ct,error:lt,stopped:ut}),(0,I.jsx)(X7,{title:`Checks Pass / Fail`,passed:ot.passed,failed:ot.failed,notEvaluated:ot.not_evaluated,notExecuted:ot.not_executed}),(0,I.jsxs)(K,{className:`lg:col-span-2`,children:[(0,I.jsx)(gv,{className:`p-2.5 pb-0`,children:(0,I.jsx)(_v,{className:`text-xs font-medium uppercase tracking-wider text-muted-foreground`,children:`Tool Usage`})}),(0,I.jsx)(q,{children:(0,I.jsx)(sT,{width:`100%`,height:120,children:(0,I.jsxs)(kW,{data:at,layout:`vertical`,children:[(0,I.jsx)(BH,{type:`number`,tick:{fontSize:11}}),(0,I.jsx)(rU,{type:`category`,dataKey:`name`,tick:{fontSize:11},width:120}),(0,I.jsx)(Hw,{}),(0,I.jsx)(gz,{dataKey:`count`,fill:`hsl(38, 92%, 50%)`,radius:[0,4,4,0]})]})})})]})]}),(0,I.jsxs)(K,{children:[(0,I.jsx)(gv,{className:`pb-3`,children:(0,I.jsxs)(`div`,{className:`flex items-center justify-between gap-2`,children:[(0,I.jsx)(_v,{className:`text-base`,children:`Scenarios`}),(0,I.jsxs)(W,{type:`button`,variant:`outline`,size:`sm`,className:`h-8 gap-1.5 px-2 text-xs`,onClick:()=>gt(`Summarize the scenario results in this run. Highlight failed scenarios/checks first, then mention notable tool usage and extracted values.`),children:[(0,I.jsx)(ar,{className:`h-4 w-4 text-amber-500`}),`Ask Assistant`]})]})}),(0,I.jsx)(q,{className:`p-0`,children:(0,I.jsxs)(bv,{children:[(0,I.jsx)(xv,{children:(0,I.jsxs)(wv,{children:[(0,I.jsx)(Tv,{className:`w-8`}),(0,I.jsx)(Tv,{children:`Scenario`}),(0,I.jsx)(Tv,{children:`Agent`}),(0,I.jsx)(Tv,{children:`Runs`}),(0,I.jsx)(Tv,{children:`Pass Rate`}),(0,I.jsx)(Tv,{children:`Checks`}),(0,I.jsx)(Tv,{className:`text-right`,children:`Total Time`}),(0,I.jsx)(Tv,{className:`text-right`,children:`Tool Calls`}),(0,I.jsx)(Tv,{className:`text-right`,children:`Tool Tokens`}),(0,I.jsx)(Tv,{className:`text-right`,children:`Tool Duration`})]})}),(0,I.jsx)(Sv,{children:Ye.map(t=>{let n=pt(t.scenarioId,t.agentName),r=t.scenarioName||t.scenarioId,i=r_(t.runs.flatMap(e=>e.checkResults??[])),a=t.runs.some(e=>(e.checkResults?.length??0)>0),c=Ue?.id||s?.configId?.trim(),l=c?`/mcp-evaluations/${encodeURIComponent(c)}/scenarios`:null,u=o.find(e=>e.id===t.scenarioId),d=u?`/libraries/test-cases/${encodeURIComponent(u.id)}?returnTo=${encodeURIComponent(`/results/${s?.id??e}`)}`:null;return(0,I.jsx)(iZ,{open:v.has(n),onOpenChange:()=>dt(n),asChild:!0,children:(0,I.jsxs)(I.Fragment,{children:[(0,I.jsx)(aZ,{asChild:!0,children:(0,I.jsxs)(wv,{className:`cursor-pointer hover:bg-muted/50`,children:[(0,I.jsx)(J,{children:(0,I.jsx)(on,{className:`h-4 w-4 transition-transform ${v.has(n)?`rotate-180`:``}`})}),(0,I.jsx)(J,{className:`font-medium text-sm`,children:(0,I.jsxs)(`div`,{className:`flex items-center gap-1.5`,children:[(0,I.jsx)(`span`,{children:t.scenarioName}),l?(0,I.jsx)(np,{to:l,"aria-label":`Edit scenario`,title:`Edit scenario`,className:`inline-flex h-6 w-6 items-center justify-center rounded text-muted-foreground hover:bg-muted hover:text-foreground`,onClick:e=>e.stopPropagation(),children:(0,I.jsx)(Jn,{className:`h-3.5 w-3.5`})}):null]})}),(0,I.jsxs)(J,{className:`text-sm`,children:[(0,I.jsx)(`div`,{children:t.agentName}),t.provider||t.model?(0,I.jsx)(`div`,{className:`text-xs text-muted-foreground`,children:[t.provider?OX(t.provider):null,t.model].filter(Boolean).join(` · `)}):null]}),(0,I.jsx)(J,{className:`font-mono text-sm`,children:t.runs.length}),(0,I.jsx)(J,{children:(0,I.jsx)(kv,{rate:t.passRate})}),(0,I.jsx)(J,{className:`font-mono text-sm`,children:a?(0,I.jsxs)(`span`,{title:`${i.passed} passed · ${i.failed} failed${i.not_evaluated?` · ${i.not_evaluated} not evaluated`:``}${i.not_executed?` · ${i.not_executed} not executed`:``}`,"aria-label":`${i.passed} checks passed, ${i.failed} checks failed${i.not_evaluated?`, ${i.not_evaluated} not evaluated`:``}${i.not_executed?`, ${i.not_executed} not executed`:``}`,children:[(0,I.jsxs)(`span`,{className:`text-success`,children:[i.passed,` ✓`]}),(0,I.jsx)(`span`,{className:`text-muted-foreground`,children:` `}),(0,I.jsxs)(`span`,{className:`text-destructive`,children:[i.failed,` ✕`]}),i.not_evaluated>0&&(0,I.jsxs)(I.Fragment,{children:[(0,I.jsx)(`span`,{className:`text-muted-foreground`,children:` `}),(0,I.jsxs)(`span`,{children:[i.not_evaluated,` ○`]})]}),i.not_executed>0&&(0,I.jsxs)(I.Fragment,{children:[(0,I.jsx)(`span`,{className:`text-muted-foreground`,children:` `}),(0,I.jsxs)(`span`,{children:[i.not_executed,` ⊘`]})]})]}):`—`}),(0,I.jsx)(J,{className:`text-right font-mono text-sm`,children:L7(R7(t),{preciseUnderTenSeconds:!0})}),(0,I.jsx)(J,{className:`text-right font-mono text-sm`,children:z9(t.avgToolCalls)}),(0,I.jsx)(J,{className:`text-right font-mono text-sm`,children:d6(t.toolTokenUsage?.totalTokens)}),(0,I.jsx)(J,{className:`text-right font-mono text-sm`,children:L7(B7(t),{preciseUnderTenSeconds:!0})})]})}),(0,I.jsx)(oZ,{asChild:!0,children:(0,I.jsx)(`tr`,{children:(0,I.jsx)(`td`,{colSpan:10,className:`p-0`,children:(0,I.jsxs)(`div`,{className:`bg-muted/30 p-4 space-y-2`,children:[(0,I.jsxs)(`div`,{className:`flex items-center justify-between gap-2 rounded-md border bg-card px-3 py-2`,children:[(0,I.jsxs)(`div`,{className:`min-w-0`,children:[(0,I.jsx)(`p`,{className:`text-xs font-semibold`,children:`Scenario details`}),(0,I.jsxs)(`p`,{className:`text-[11px] text-muted-foreground`,children:[r,` · `,t.agentName,` ·`,` `,Wi(t.passRate),` pass rate ·`,` `,a?`Checks ${i.passed} ✓ · ${i.failed} ✕${i.not_evaluated?` · ${i.not_evaluated} ○`:``}${i.not_executed?` · ${i.not_executed} ⊘`:``} · `:``,d6(t.toolTokenUsage?.totalTokens),` tool tokens ·`,` `,L7(R7(t),{preciseUnderTenSeconds:!0}),` `,`total time ·`,` `,L7(B7(t),{preciseUnderTenSeconds:!0}),` `,`tool time`]})]}),(0,I.jsxs)(`div`,{className:`flex shrink-0 items-center gap-1`,children:[d?(0,I.jsx)(W,{asChild:!0,type:`button`,variant:`ghost`,size:`sm`,className:`h-7 gap-1 px-2 text-xs text-muted-foreground`,children:(0,I.jsxs)(np,{to:d,"aria-label":`Edit test case`,children:[(0,I.jsx)(Tn,{className:`h-3.5 w-3.5`}),`Edit test case`]})}):null,(0,I.jsxs)(W,{type:`button`,variant:`outline`,size:`sm`,className:`h-7 gap-1.5 px-2 text-xs`,onClick:()=>gt(`Explain why scenario '${r}' failed (agent: ${t.agentName}). Summarize the likely cause from the result details and suggest what to inspect next.`,{scenarioId:t.scenarioId}),children:[(0,I.jsx)(ar,{className:`h-4 w-4 text-amber-500`}),`Ask Assistant`]})]})]}),t.runs.map(e=>(0,I.jsxs)(`div`,{className:`flex items-start gap-3 rounded-md border bg-card p-3 text-sm`,children:[(0,I.jsx)(`div`,{className:`mt-0.5`,children:e.outcome===`incomplete`||e.outcome===`stopped`?(0,I.jsx)(gn,{className:`h-4 w-4 text-amber-500`}):e.passed?(0,I.jsx)(dn,{className:`h-4 w-4 text-success`}):(0,I.jsx)(mn,{className:`h-4 w-4 text-destructive`})}),(0,I.jsxs)(`div`,{className:`flex-1 space-y-1`,children:[(()=>{let n=qe.get(t.scenarioId),r=n?ipe(n.evalRules,e.failureReasons,e.error,e.checkResults):[],i=r.filter(e=>e.status===`failed`),a=r.filter(e=>e.status===`passed`),o=r.filter(e=>e.status===`not_evaluated`),s=r.filter(e=>e.status===`not_executed`);return(0,I.jsxs)(I.Fragment,{children:[(0,I.jsxs)(`div`,{className:`flex items-center gap-2 flex-wrap`,children:[(0,I.jsxs)(`span`,{className:`font-mono text-xs text-muted-foreground`,children:[`Run #`,e.runIndex+1]}),(0,I.jsx)(`span`,{className:`text-xs text-muted-foreground`,children:`·`}),(0,I.jsxs)(`span`,{className:`text-xs text-muted-foreground`,children:[e.duration,`ms`]}),(0,I.jsx)(`span`,{className:`text-xs text-muted-foreground`,children:`·`}),(0,I.jsxs)(`span`,{className:`text-xs text-muted-foreground`,children:[d6(e.toolTokenUsage?.totalTokens),` `,`tool tokens`]}),e.outcome===`incomplete`?(0,I.jsx)(Y,{variant:`outline`,className:`h-5 border-amber-500/30 bg-amber-500/10 text-amber-600 text-[10px]`,children:`Incomplete`}):e.outcome===`stopped`?(0,I.jsx)(Y,{variant:`outline`,className:`h-5 border-muted-foreground/30 bg-muted text-muted-foreground text-[10px]`,children:`Stopped`}):e.passed?null:(0,I.jsx)(Y,{variant:`outline`,className:`h-5 border-destructive/30 bg-destructive/10 text-destructive text-[10px]`,children:`Failed`})]}),e.failureReasons.length>0&&(0,I.jsxs)(`div`,{className:`rounded-md border border-destructive/30 bg-destructive/5 p-2`,children:[(0,I.jsxs)(`p`,{className:`mb-1 flex items-center gap-1 text-[11px] font-semibold uppercase tracking-wide text-destructive`,children:[(0,I.jsx)(mn,{className:`h-3.5 w-3.5`}),`Failure reasons`]}),(0,I.jsx)(`ul`,{className:`space-y-1 text-xs text-destructive`,children:e.failureReasons.map((e,t)=>(0,I.jsxs)(`li`,{children:[`• `,G9(e)]},t))})]}),e.outcome===`stopped`&&e.stopReason?(0,I.jsxs)(`div`,{className:`rounded-md border border-muted-foreground/20 bg-muted/40 p-2`,children:[(0,I.jsx)(`p`,{className:`mb-1 text-[11px] font-semibold uppercase tracking-wide text-muted-foreground`,children:`Stop reason`}),(0,I.jsx)(`p`,{className:`text-xs text-muted-foreground`,children:e.stopReason})]}):null,r.length>0&&(0,I.jsx)(iZ,{open:ht(ft(t.scenarioId,t.agentName,e.runIndex,`checks`)),onOpenChange:()=>mt(ft(t.scenarioId,t.agentName,e.runIndex,`checks`)),children:(0,I.jsxs)(`div`,{className:`rounded-md border bg-muted/20 p-2`,children:[(0,I.jsx)(aZ,{asChild:!0,children:(0,I.jsxs)(`button`,{type:`button`,className:`mb-2 flex w-full flex-wrap items-center gap-2 text-left`,children:[(0,I.jsx)(on,{className:`h-3.5 w-3.5 transition-transform ${ht(ft(t.scenarioId,t.agentName,e.runIndex,`checks`))?`rotate-180`:``}`}),(0,I.jsx)(`p`,{className:`text-[11px] font-semibold uppercase tracking-wide text-muted-foreground`,children:`Checks`}),(0,I.jsxs)(Y,{variant:`outline`,className:`h-5 border-success/30 bg-success/10 text-success text-[10px]`,children:[a.length,` passed`]}),(0,I.jsxs)(Y,{variant:`outline`,className:`h-5 text-[10px] ${i.length>0?`border-destructive/30 bg-destructive/10 text-destructive`:``}`,children:[i.length,` failed`]}),o.length>0&&(0,I.jsxs)(Y,{variant:`outline`,className:`h-5 border-muted-foreground/30 bg-muted text-[10px] text-muted-foreground`,children:[o.length,` not evaluated`]}),s.length>0&&(0,I.jsxs)(Y,{variant:`outline`,className:`h-5 border-amber-500/30 bg-amber-500/10 text-[10px] text-amber-600`,children:[s.length,` not executed`]})]})}),(0,I.jsxs)(oZ,{children:[s.length>0&&(0,I.jsx)(`p`,{className:`mb-2 text-[11px] text-muted-foreground`,children:`Checks were not executed because this run ended before evaluation.`}),(0,I.jsx)(`div`,{className:`space-y-1`,children:r.map((e,t)=>(0,I.jsxs)(`div`,{className:`flex items-start justify-between gap-2 rounded-md border px-2 py-1.5 text-xs ${e.status===`failed`?`border-destructive/20 bg-destructive/5`:e.status===`not_executed`?`border-amber-500/20 bg-amber-500/5`:e.status===`not_evaluated`?`border-muted-foreground/20 bg-muted/40`:`border-success/20 bg-success/5`}`,children:[(0,I.jsxs)(`div`,{className:`min-w-0`,children:[(0,I.jsxs)(`div`,{className:`flex items-center gap-2`,children:[e.status===`failed`?(0,I.jsx)(mn,{className:`h-3.5 w-3.5 shrink-0 text-destructive`}):e.status===`not_executed`?(0,I.jsx)(gn,{className:`h-3.5 w-3.5 shrink-0 text-amber-600`}):e.status===`not_evaluated`?(0,I.jsx)(gn,{className:`h-3.5 w-3.5 shrink-0 text-muted-foreground`}):(0,I.jsx)(dn,{className:`h-3.5 w-3.5 shrink-0 text-success`}),(0,I.jsx)(`span`,{className:`font-medium`,children:l6(e.rule)})]}),e.decisionInput&&(0,I.jsxs)(`p`,{className:`mt-1 pl-5 text-[11px] text-muted-foreground whitespace-pre-wrap break-words`,children:[`Assertion prompt:`,` `,e.decisionInput]}),!e.decisionInput&&e.failureReason&&(0,I.jsx)(`p`,{className:`mt-1 pl-5 text-[11px] text-muted-foreground`,children:G9(e.failureReason)}),e.decisionDetails&&(0,I.jsx)(`p`,{className:`mt-1 pl-5 text-[9px] text-muted-foreground`,children:e.decisionDetails})]}),(0,I.jsx)(Y,{variant:`outline`,className:`shrink-0 text-[10px] ${e.status===`failed`?`border-destructive/30 text-destructive`:e.status===`not_executed`?`border-amber-500/30 text-amber-600`:e.status===`not_evaluated`?`border-muted-foreground/30 text-muted-foreground`:`border-success/30 text-success`}`,children:s6(e.status)})]},`${e.rule.type}-${e.rule.value??e.rule.path??``}-${t}`))})]})]})})]})})(),(0,I.jsx)(iZ,{open:ht(ft(t.scenarioId,t.agentName,e.runIndex,`extracts`),Object.keys(e.extractedValues??{}).length>0),onOpenChange:()=>mt(ft(t.scenarioId,t.agentName,e.runIndex,`extracts`)),children:(0,I.jsxs)(`div`,{className:`rounded-md border border-violet-500/20 bg-violet-500/5 p-2`,children:[(0,I.jsx)(aZ,{asChild:!0,children:(0,I.jsxs)(`button`,{type:`button`,className:`mb-2 flex w-full flex-wrap items-center justify-between gap-2 text-left`,children:[(0,I.jsxs)(`div`,{className:`flex min-w-0 flex-wrap items-center gap-2`,children:[(0,I.jsx)(on,{className:`h-3.5 w-3.5 shrink-0 transition-transform ${ht(ft(t.scenarioId,t.agentName,e.runIndex,`extracts`),Object.keys(e.extractedValues??{}).length>0)?`rotate-180`:``}`}),(0,I.jsxs)(`p`,{className:`flex items-center gap-1 text-[11px] font-semibold uppercase tracking-wide text-muted-foreground`,children:[(0,I.jsx)(Pn,{className:`h-3.5 w-3.5 text-violet-600`}),`Extracted values`]})]}),(0,I.jsxs)(Y,{variant:`outline`,className:`h-5 text-[10px]`,children:[Object.keys(e.extractedValues??{}).length,` `,`total`]})]})}),(0,I.jsx)(oZ,{children:Object.keys(e.extractedValues??{}).length===0?(0,I.jsx)(`p`,{className:`text-xs text-muted-foreground`,children:`No extracted values captured for this run.`}):(0,I.jsx)(`div`,{className:`grid gap-1.5 sm:grid-cols-2`,children:Object.entries(e.extractedValues??{}).map(([e,t])=>(0,I.jsxs)(`div`,{className:`rounded-md border bg-background px-2 py-1.5 text-xs`,children:[(0,I.jsx)(`div`,{className:`mb-0.5 text-[10px] font-semibold uppercase tracking-wide text-muted-foreground`,children:e}),(0,I.jsx)(`div`,{className:`font-mono break-all text-foreground`,children:t===null?`null`:String(t)})]},e))})})]})}),(0,I.jsx)(iZ,{open:ht(ft(t.scenarioId,t.agentName,e.runIndex,`tools`),e.toolCalls.length>0),onOpenChange:()=>mt(ft(t.scenarioId,t.agentName,e.runIndex,`tools`)),children:(0,I.jsxs)(`div`,{className:`rounded-md border border-sky-500/20 bg-sky-500/5 p-2`,children:[(0,I.jsx)(aZ,{asChild:!0,children:(0,I.jsxs)(`button`,{type:`button`,className:`mb-2 flex w-full flex-wrap items-center justify-between gap-2 text-left`,children:[(0,I.jsxs)(`div`,{className:`flex min-w-0 flex-wrap items-center gap-2`,children:[(0,I.jsx)(on,{className:`h-3.5 w-3.5 shrink-0 transition-transform ${ht(ft(t.scenarioId,t.agentName,e.runIndex,`tools`),e.toolCalls.length>0)?`rotate-180`:``}`}),(0,I.jsxs)(`p`,{className:`flex items-center gap-1 text-[11px] font-semibold uppercase tracking-wide text-muted-foreground`,children:[(0,I.jsx)(mr,{className:`h-3.5 w-3.5 text-sky-600`}),`Tool call sequence`]})]}),(0,I.jsxs)(Y,{variant:`outline`,className:`h-5 text-[10px]`,children:[e.toolCalls.length,` total`]})]})}),(0,I.jsx)(oZ,{children:e.toolCalls.length===0?(0,I.jsx)(`p`,{className:`text-xs text-muted-foreground`,children:`No tool calls captured for this run.`}):(0,I.jsxs)(`div`,{className:`space-y-2`,children:[(0,I.jsx)(`div`,{className:`flex flex-wrap gap-1`,children:(0,I.jsx)(gl,{delayDuration:0,children:e.toolCalls.map((t,n)=>{let r=e.conversation.filter(e=>e.kind===`tool_call`)[n]?.estimatedTokens,i=typeof r?.totalTokens==`number`;return(0,I.jsxs)(_l,{children:[(0,I.jsx)(vl,{asChild:!0,children:(0,I.jsxs)(Y,{variant:`outline`,className:`font-mono text-xs bg-background`,children:[(0,I.jsxs)(`span`,{className:`mr-1 text-muted-foreground`,children:[`#`,n+1]}),t.name,(0,I.jsxs)(`span`,{className:`ml-1 text-muted-foreground`,children:[t.duration,`ms`]}),i&&(0,I.jsxs)(`span`,{className:`ml-1 text-muted-foreground`,children:[`·`,` `,d6(r?.totalTokens),`tok`]})]})}),i&&(0,I.jsx)(yl,{className:`text-xs`,children:`${t.name} · tokens total: ${d6(r?.totalTokens)} · in: ${d6(r?.inputTokens)} · out: ${d6(r?.outputTokens)}`})]},n)})})}),(0,I.jsxs)(`div`,{className:`rounded-md border bg-background p-2`,children:[(0,I.jsxs)(`div`,{className:`mb-1.5 flex items-center justify-between gap-2`,children:[(0,I.jsx)(`p`,{className:`text-[11px] font-semibold uppercase tracking-wide text-muted-foreground`,children:`Tool token estimate`}),(0,I.jsx)(Y,{variant:`outline`,className:`h-5 text-[10px]`,children:`estimated`})]}),Object.keys(e.toolTokenUsageByTool??{}).length===0?(0,I.jsx)(`p`,{className:`text-xs text-muted-foreground`,children:`n/a`}):(0,I.jsx)(`div`,{className:`grid gap-1.5 sm:grid-cols-2`,children:Object.entries(e.toolTokenUsageByTool??{}).map(([e,t])=>(0,I.jsxs)(`div`,{className:`rounded border bg-muted/30 px-2 py-1.5 text-xs`,children:[(0,I.jsx)(`div`,{className:`font-mono text-[11px]`,children:e}),(0,I.jsxs)(`div`,{className:`text-muted-foreground`,children:[`total:`,` `,d6(t.totalTokens),` `,`· in:`,` `,d6(t.inputTokens),` `,`· out:`,` `,d6(t.outputTokens)]})]},e))})]})]})})]})}),(0,I.jsx)(iZ,{open:ht(ft(t.scenarioId,t.agentName,e.runIndex,`final`)),onOpenChange:()=>mt(ft(t.scenarioId,t.agentName,e.runIndex,`final`)),children:(0,I.jsxs)(`div`,{className:`rounded-md border border-muted-foreground/20 bg-card p-2`,children:[(0,I.jsx)(aZ,{asChild:!0,children:(0,I.jsxs)(`button`,{type:`button`,className:`mb-2 flex w-full items-center gap-2 text-left`,children:[(0,I.jsx)(on,{className:`h-3.5 w-3.5 transition-transform ${ht(ft(t.scenarioId,t.agentName,e.runIndex,`final`))?`rotate-180`:``}`}),(0,I.jsxs)(`p`,{className:`flex items-center gap-1 text-[11px] font-semibold uppercase tracking-wide text-muted-foreground`,children:[(0,I.jsx)(en,{className:`h-3.5 w-3.5`}),`Final answer`]})]})}),(0,I.jsx)(oZ,{children:(0,I.jsx)(W9,{text:e.finalAnswer||`No final answer captured.`,maxLength:1200,className:`text-xs text-foreground`})})]})}),(0,I.jsx)(iZ,{open:ht(ft(t.scenarioId,t.agentName,e.runIndex,`conversation`)),onOpenChange:()=>mt(ft(t.scenarioId,t.agentName,e.runIndex,`conversation`)),children:(0,I.jsxs)(`div`,{className:`rounded-md border bg-muted/10 p-2`,children:[(0,I.jsxs)(`div`,{className:`mb-2 flex flex-wrap items-center justify-between gap-2`,children:[(0,I.jsx)(aZ,{asChild:!0,children:(0,I.jsxs)(`button`,{type:`button`,className:`flex min-w-0 items-center gap-2 text-left`,children:[(0,I.jsx)(on,{className:`h-3.5 w-3.5 shrink-0 transition-transform ${ht(ft(t.scenarioId,t.agentName,e.runIndex,`conversation`))?`rotate-180`:``}`}),(0,I.jsx)(`p`,{className:`text-[11px] font-semibold uppercase tracking-wide text-muted-foreground`,children:`Conversation trace`})]})}),(0,I.jsx)(`div`,{className:`flex flex-wrap gap-2`,children:(0,I.jsxs)(W,{type:`button`,variant:`outline`,size:`sm`,className:`h-7 gap-1.5 px-2 text-xs`,onClick:()=>gt(`Explain Run #${e.runIndex+1} for scenario '${r}'. Its outcome was ${e.outcome??(e.passed?`passed`:`failed`)} in ${e.duration}ms. Focus on the tool sequence and evaluated checks.`,{scenarioId:t.scenarioId}),children:[(0,I.jsx)(ar,{className:`h-4 w-4 text-amber-500`}),`Ask Assistant`]})})]}),(0,I.jsx)(oZ,{children:(0,I.jsx)(`div`,{className:`space-y-2 rounded-md border bg-muted/20 p-2`,children:e.conversation.length===0?(0,I.jsx)(`p`,{className:`text-xs text-muted-foreground`,children:`No conversation trace captured.`}):e.conversation.map(e=>(0,I.jsx)(rpe,{item:e,fallbackUserPrompt:qe.get(t.scenarioId)?.prompt},e.id))})}),!ht(ft(t.scenarioId,t.agentName,e.runIndex,`conversation`))&&(0,I.jsx)(`button`,{type:`button`,className:`text-xs text-muted-foreground underline decoration-dotted underline-offset-2 hover:text-foreground`,onClick:()=>mt(ft(t.scenarioId,t.agentName,e.runIndex,`conversation`)),children:`Expand to inspect user/assistant/tool messages for this run.`})]})})]})]},e.runIndex))]})})})})]})},n)})})]})})]})]}),w&&(0,I.jsxs)(`div`,{className:`min-w-0 space-y-0 xl:flex xl:h-full xl:min-h-0 xl:flex-col`,children:[(0,I.jsx)(CX,{value:k,onValueChange:e=>A(e),className:`min-w-0 -mb-px px-3 pt-1`,children:(0,I.jsxs)(wX,{className:`h-auto w-full justify-start rounded-none border-b bg-transparent p-0`,children:[(0,I.jsx)(TX,{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`}),(0,I.jsx)(TX,{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`}),(0,I.jsx)(TX,{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`})]})}),k===`assistant`?(0,I.jsx)(I7,{title:`MCP Lab Assistant`,description:`Ask questions about this run result, failures, and tool usage.`,expanded:E,onToggleExpanded:()=>D(e=>!e),onHide:()=>T(!1),messages:Te,pendingToolCalls:Ee,loading:Oe,onCancel:ke?je:void 0,input:De,onInputChange:Ne,onSend:()=>void Pe(),inputPlaceholder:`Ask about this result...`,snippets:tpe,onSnippetSelect:Le,onApproveToolCall:Fe,onDenyToolCall:Ie,expired:Ae,inputRef:Me,className:`min-w-0 overflow-hidden rounded-t-none xl:flex xl:h-full xl:min-h-0 xl:flex-col`,renderMessageFooter:e=>{if(e.role!==`assistant`)return null;let t=H9(e.text,!!j);return(0,I.jsxs)(`div`,{className:`mt-3 flex max-w-full flex-wrap justify-end gap-2 overflow-x-auto pb-1`,children:[t&&(0,I.jsxs)(W,{type:`button`,variant:`outline`,size:`sm`,className:`h-7 gap-1.5 px-2 text-xs`,onClick:()=>yt(e.text),children:[(0,I.jsx)(ar,{className:`h-4 w-4 text-amber-500`}),`Send to Scenario Assistant`]}),(0,I.jsxs)(W,{type:`button`,variant:`outline`,size:`sm`,className:`h-7 gap-1.5 px-2 text-xs`,onClick:()=>bt(e.text),children:[(0,I.jsx)(mr,{className:`h-3.5 w-3.5`}),`Apply: Write Markdown Report`]})]})}}):k===`reports`?(0,I.jsxs)(K,{className:`min-w-0 overflow-hidden rounded-t-none xl:flex xl:h-full xl:min-h-0 xl:flex-col`,children:[(0,I.jsx)(gv,{className:`border-b px-4 py-3`,children:(0,I.jsxs)(`div`,{className:`space-y-1`,children:[(0,I.jsxs)(`div`,{className:`flex items-center justify-between gap-2`,children:[(0,I.jsxs)(_v,{className:`flex items-center gap-2 text-base`,children:[(0,I.jsx)(Un,{className:`h-4 w-4 text-muted-foreground`}),`Reports`]}),(0,I.jsxs)(`div`,{className:`flex items-center gap-2 shrink-0`,children:[(0,I.jsxs)(W,{type:`button`,variant:`outline`,size:`sm`,className:`h-7 gap-1 px-2 text-xs`,onClick:()=>D(e=>!e),children:[E?(0,I.jsx)(Gn,{className:`h-3.5 w-3.5`}):(0,I.jsx)(Kn,{className:`h-3.5 w-3.5`}),E?`Compact`:`Expand`]}),(0,I.jsx)(W,{type:`button`,variant:`outline`,size:`sm`,className:`h-7 px-2 text-xs`,onClick:()=>T(!1),children:`Hide`})]})]}),(0,I.jsx)(`p`,{className:`text-xs text-muted-foreground`,children:`Review markdown reports for this run while keeping the result visible.`})]})}),(0,I.jsxs)(q,{className:`flex h-[70vh] min-h-[520px] flex-col p-0 xl:h-auto xl:min-h-0 xl:flex-1`,children:[(ce||oe.length===0||oe.length>1)&&(0,I.jsx)(`div`,{className:`border-b px-4 py-3`,children:ce?(0,I.jsx)(`p`,{className:`text-xs text-muted-foreground`,children:`Loading reference reports...`}):oe.length===0?(0,I.jsxs)(`div`,{className:`flex items-center justify-between gap-2`,children:[(0,I.jsx)(`p`,{className:`text-sm text-muted-foreground`,children:`No reference reports for this run yet.`}),(0,I.jsxs)(W,{type:`button`,size:`sm`,variant:`outline`,className:`shrink-0 gap-1.5`,onClick:()=>xt(),children:[(0,I.jsx)(Xn,{className:`h-3.5 w-3.5`}),`New Report`]})]}):(0,I.jsx)(`div`,{className:`space-y-2`,children:oe.length>1?(0,I.jsxs)(`div`,{className:`space-y-1`,children:[(0,I.jsx)(`p`,{className:`text-xs font-medium text-muted-foreground`,children:`Selected report`}),(0,I.jsxs)(OY,{value:le,onValueChange:ue,children:[(0,I.jsx)(AY,{className:`h-8`,children:(0,I.jsx)(kY,{placeholder:`Select a report`})}),(0,I.jsx)(NY,{children:oe.map(e=>(0,I.jsx)(Z,{value:e.relativePath,children:e.name},e.path))})]})]}):null})}),(0,I.jsx)(F9,{className:`min-h-0 flex-1 bg-muted/15 px-4 py-4`,children:oe.length===0?(0,I.jsx)(`div`,{className:`text-sm text-muted-foreground`,children:`No report selected.`}):fe?(0,I.jsxs)(`div`,{className:`flex items-center gap-2 text-sm text-muted-foreground`,children:[(0,I.jsx)(zn,{className:`h-4 w-4 animate-spin`}),`Loading report...`]}):me?(0,I.jsxs)(`div`,{className:`rounded-md border border-destructive/30 bg-destructive/5 p-3 text-sm text-destructive`,children:[`Could not load report: `,me]}):de?(0,I.jsxs)(`div`,{className:`space-y-3`,children:[(0,I.jsxs)(`div`,{className:`rounded-md border bg-background p-3`,children:[(0,I.jsx)(`p`,{className:`font-mono text-xs font-semibold`,children:de.name}),(0,I.jsx)(`p`,{className:`mt-1 text-[11px] text-muted-foreground`,children:de.relativePath}),(0,I.jsx)(`p`,{className:`mt-1 text-[11px] text-muted-foreground`,children:new Date(de.mtime).toLocaleString()})]}),(0,I.jsx)(`div`,{className:`rounded-md border bg-background p-3`,children:(0,I.jsx)(A3,{text:de.content,className:`text-sm`})})]}):(0,I.jsx)(`div`,{className:`text-sm text-muted-foreground`,children:`Select a report to preview.`})})]})]}):(0,I.jsxs)(K,{className:`min-w-0 overflow-hidden rounded-t-none xl:flex xl:h-full xl:min-h-0 xl:flex-col`,children:[(0,I.jsx)(gv,{className:`border-b px-4 py-3`,children:(0,I.jsxs)(`div`,{className:`space-y-1`,children:[(0,I.jsxs)(`div`,{className:`flex items-center justify-between gap-2`,children:[(0,I.jsxs)(_v,{className:`flex items-center gap-2 text-base`,children:[(0,I.jsx)(Un,{className:`h-4 w-4 text-muted-foreground`}),`Run Note`]}),(0,I.jsxs)(`div`,{className:`flex items-center gap-2 shrink-0`,children:[(0,I.jsxs)(W,{type:`button`,variant:`outline`,size:`sm`,className:`h-7 gap-1 px-2 text-xs`,onClick:()=>D(e=>!e),children:[E?(0,I.jsx)(Gn,{className:`h-3.5 w-3.5`}):(0,I.jsx)(Kn,{className:`h-3.5 w-3.5`}),E?`Compact`:`Expand`]}),(0,I.jsx)(W,{type:`button`,variant:`outline`,size:`sm`,className:`h-7 px-2 text-xs`,onClick:()=>T(!1),children:`Hide`})]})]}),(0,I.jsx)(`p`,{className:`text-xs text-muted-foreground`,children:`Add context for this run, such as server version or environment details.`})]})}),(0,I.jsx)(q,{className:`flex h-[70vh] min-h-[520px] flex-col p-4 xl:h-auto xl:min-h-0 xl:flex-1`,children:d?(0,I.jsxs)(`div`,{className:`w-full max-w-xl space-y-2`,children:[(0,I.jsxs)(`div`,{className:`flex items-center justify-between`,children:[(0,I.jsx)(`p`,{className:`text-xs font-medium`,children:`Run note`}),(0,I.jsxs)(`span`,{className:`text-xs text-muted-foreground`,children:[p.length,`/500`]})]}),(0,I.jsx)(iX,{value:p,onChange:e=>m(e.target.value.slice(0,500)),placeholder:`Optional context for this run`,rows:3,className:`min-h-20 resize`}),(0,I.jsxs)(`div`,{className:`flex items-center gap-2`,children:[(0,I.jsx)(W,{size:`sm`,onClick:()=>void Ct(),disabled:h,children:h?`Saving...`:`Save note`}),(0,I.jsx)(W,{size:`sm`,variant:`outline`,onClick:()=>{m(s.runNote??``),f(!1)},disabled:h,children:`Cancel`})]})]}):(0,I.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:[(0,I.jsxs)(`div`,{className:`min-w-0 flex items-center gap-2`,children:[(0,I.jsx)(`span`,{className:`text-muted-foreground`,children:`Run note:`}),(0,I.jsx)(`span`,{className:`wrap-break-word ${s.runNote?`text-foreground`:`text-muted-foreground`}`,children:s.runNote||`none`})]}),(0,I.jsx)(W,{size:`sm`,variant:`ghost`,className:`ml-auto h-6 px-2 text-xs`,onClick:()=>f(!0),children:s.runNote?`Edit`:`Add note`})]})})]})]}),(0,I.jsx)(X6,{open:N,onOpenChange:e=>!ne&&P(e),children:(0,I.jsxs)(Q6,{className:`max-w-2xl`,children:[(0,I.jsxs)($6,{children:[(0,I.jsx)(t8,{children:ie?`Create markdown report`:`Approve MCP action: write markdown report`}),(0,I.jsx)(n8,{children:ie?`Write a custom markdown report and save it to the workspace.`:(0,I.jsxs)(I.Fragment,{children:[`This will call `,(0,I.jsx)(`code`,{children:`mcplab_write_markdown_report`}),` via the local MCPLab MCP server.`]})})]}),(0,I.jsxs)(`div`,{className:`space-y-3`,children:[!ie&&(0,I.jsxs)(`div`,{className:`space-y-1`,children:[(0,I.jsx)(`p`,{className:`text-xs font-medium text-muted-foreground`,children:`Output path`}),(0,I.jsx)(Op,{value:R,onChange:e=>z(e.target.value),placeholder:`mcplab/reports/result-assistant/my-report.md`,disabled:ne})]}),(0,I.jsxs)(`label`,{className:`flex items-center gap-2 text-sm`,children:[(0,I.jsx)(KX,{checked:ee,onCheckedChange:e=>te(e===!0),disabled:ne}),(0,I.jsx)(`span`,{children:`Overwrite if file exists`})]}),(0,I.jsxs)(`div`,{className:`space-y-1`,children:[(0,I.jsx)(`p`,{className:`text-xs font-medium text-muted-foreground`,children:ie?`Markdown content`:`Markdown preview (to be written)`}),(0,I.jsx)(iX,{value:F,onChange:e=>L(e.target.value),rows:10,className:`font-mono text-xs`,disabled:ne})]})]}),(0,I.jsxs)(e8,{children:[(0,I.jsx)(i8,{disabled:ne,children:`Cancel`}),(0,I.jsx)(r8,{onClick:e=>{e.preventDefault(),St()},disabled:ne,children:ne?`Writing...`:ie?`Save Report`:`Approve & Write`})]})]})}),(0,I.jsx)(X6,{open:ge,onOpenChange:_e,children:(0,I.jsxs)(Q6,{children:[(0,I.jsxs)($6,{children:[(0,I.jsx)(t8,{children:`Delete run?`}),(0,I.jsxs)(n8,{children:[`This will permanently remove run `,(0,I.jsx)(`span`,{className:`font-mono`,children:s?.id}),`. This action cannot be undone.`]})]}),(0,I.jsxs)(e8,{children:[(0,I.jsx)(i8,{disabled:ve,children:`Cancel`}),(0,I.jsx)(r8,{disabled:ve||!s?.id,onClick:e=>{e.preventDefault(),wt()},className:`bg-destructive text-destructive-foreground hover:bg-destructive/90`,children:ve?`Deleting...`:`Delete`})]})]})})]})]})};function rpe({item:e,fallbackUserPrompt:t}){if(e.kind===`tool_call`){let t=B9(e,`input`);return(0,I.jsx)(U9,{variant:`call`,title:`Tool call · ${e.toolName||`unknown`}${t}`,text:e.text})}if(e.kind===`tool_result`){let t=B9(e,`output`),n=e.ok?(0,I.jsx)(dn,{className:`h-3.5 w-3.5 text-emerald-700 dark:text-emerald-300`}):(0,I.jsx)(mn,{className:`h-3.5 w-3.5 text-rose-700 dark:text-rose-300`});return(0,I.jsx)(U9,{variant:e.ok?`result_ok`:`result_error`,title:`Tool result · ${e.toolName||`unknown`} · ${e.ok?`ok`:`error`}${typeof e.durationMs==`number`?` · ${e.durationMs}ms`:``}${t}`,text:e.text,icon:n})}let n=e.kind===`user_prompt`,r=V9(e.text,e.kind),i=t?V9(t,`user_prompt`):``,a=n&&!r&&i?i:r,o=n?`User prompt`:e.kind===`assistant_final`?`Agent final`:`Agent`,s=n?fr:en;return(0,I.jsxs)(`div`,{className:`flex items-start gap-2 text-xs ${n?`justify-end`:`justify-start`}`,children:[!n&&(0,I.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:(0,I.jsx)(s,{className:`h-3 w-3`})}),(0,I.jsxs)(`div`,{className:`max-w-[90%] rounded-md p-2 ${n?`bg-primary/10`:`bg-muted/50`}`,children:[(0,I.jsx)(`p`,{className:`mb-1 text-[11px] font-semibold text-muted-foreground ${n?`text-right`:``}`,children:o}),n?(0,I.jsx)(W9,{text:a,maxLength:280,className:`text-xs`}):(0,I.jsx)(W9,{text:a,maxLength:500,className:`text-xs`})]}),n&&(0,I.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:(0,I.jsx)(s,{className:`h-3 w-3`})})]})}function B9(e,t){let n=t===`input`?e.estimatedTokens?.inputTokens:e.estimatedTokens?.outputTokens;return typeof n==`number`?` · ${d6(n)} tokens`:``}function V9(e,t){let n=String(e??``).replace(/^\s+/,``);return t===`user_prompt`?n.replace(/^user:\s*/i,``):t===`assistant_final`||t===`assistant_thought`?n.replace(/^assistant:\s*/i,``):n}function H9(e,t){if(!t)return!1;let n=String(e??``).toLowerCase();if(!n.trim())return!1;let r=[`check`,`checks`,`rule`,`rules`,`regex`,`pattern`,`value capture`,`extract rule`,`update`,`change`,`replace`,`modify`,`adjust`,`use `,`set `],i=[`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(e=>n.includes(e))&&!i.some(e=>n.includes(e)))return!1;let a=r.some(e=>n.includes(e)),o=i.some(e=>n.includes(e)),s=/(^|\n)\s*[-*]\s+/.test(e)||/(^|\n)\s*\d+\.\s+/.test(e),c=/["'`][^"'`\n]{2,}["'`]/.test(e);return a&&(o||s||c)}function U9({variant:e,title:t,text:n,icon:r}){let[i,a]=(0,_.useState)(!1);return(0,I.jsx)(iZ,{open:i,onOpenChange:a,children:(0,I.jsxs)(`div`,{className:`rounded-md border p-2 text-xs ${{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`}[e]}`,children:[(0,I.jsx)(aZ,{asChild:!0,children:(0,I.jsxs)(`button`,{type:`button`,className:`flex w-full items-center justify-between gap-2 text-left`,children:[(0,I.jsxs)(`div`,{className:`flex items-center gap-1.5 font-mono text-[11px]`,children:[r??(0,I.jsx)(mr,{className:`h-3.5 w-3.5`}),(0,I.jsx)(`span`,{children:t})]}),(0,I.jsx)(`span`,{className:`text-[11px] font-semibold`,children:i?`Hide content`:`Show content`})]})}),(0,I.jsx)(oZ,{children:(0,I.jsx)(`p`,{className:`mt-2 font-mono whitespace-pre-wrap text-foreground`,children:n})})]})})}function W9({text:e,maxLength:t,className:n}){let[r,i]=(0,_.useState)(!1),a=e.length>t,o=r||!a?e:`${e.slice(0,t)}...`;return(0,I.jsxs)(`div`,{children:[(0,I.jsx)(A3,{text:o,className:n}),a&&(0,I.jsx)(`button`,{type:`button`,className:`mt-1 text-[11px] font-medium text-primary hover:underline`,onClick:()=>i(e=>!e),children:r?`Show less`:`Show all`})]})}function ipe(e,t,n,r){return c6({evalRules:e,failureReasons:t,runError:n,checkResults:r})}function G9(e){let t=String(e??``).trim(),n=t.match(/^Regex assertion failed:\s*(.+)$/i);return n?`Text match failed: ${n[1]}`:t}var K9=[`hsl(38, 92%, 50%)`,`hsl(200, 80%, 50%)`,`hsl(152, 69%, 40%)`,`hsl(280, 60%, 50%)`,`hsl(0, 72%, 51%)`],ape=9,q9=`mcplab.compare.showDaySeparators`;function J9(e){if(!e.trim())return null;let t=new Date(e);return Number.isNaN(t.getTime())?null:t}function Y9(e){let t=J9(e);return t?t.toLocaleString():``}function ope(e){let t=J9(e);return t?`${t.getUTCFullYear()}-${String(t.getUTCMonth()+1).padStart(2,`0`)}-${String(t.getUTCDate()).padStart(2,`0`)}`:e}function spe(e){let t=J9(e);return t?t.toLocaleDateString(void 0,{weekday:`long`,month:`short`,day:`numeric`,year:`numeric`,timeZone:`UTC`}):`Unknown day`}function X9({counts:e}){return!e||e.total===0?(0,I.jsx)(I.Fragment,{children:`—`}):(0,I.jsxs)(I.Fragment,{children:[(0,I.jsxs)(`span`,{className:`text-success`,children:[e.passed,` ✓`]}),(0,I.jsx)(`span`,{className:`text-muted-foreground`,children:` · `}),(0,I.jsxs)(`span`,{className:`text-destructive`,children:[e.failed,` ✕`]}),e.not_evaluated>0&&(0,I.jsxs)(I.Fragment,{children:[(0,I.jsx)(`span`,{className:`text-muted-foreground`,children:` `}),(0,I.jsxs)(`span`,{children:[e.not_evaluated,` ○`]})]}),e.not_executed>0&&(0,I.jsxs)(I.Fragment,{children:[(0,I.jsx)(`span`,{className:`text-muted-foreground`,children:` `}),(0,I.jsxs)(`span`,{children:[e.not_executed,` ⊘`]})]})]})}function cpe(e){return e.configName?.trim()||jW(e).slice(0,2).join(`, `)||`n/a`}function lpe(e){return e.configPath?.trim()||void 0}function Z9({run:e,className:t}){let n=cpe(e),r=lpe(e);return(0,I.jsx)(`div`,{className:t,title:r,children:n})}function upe(e){let t=e.checkCounts;if(!t||t.total===0)return`—`;let n=t.passed+t.failed;return n===0?`—`:(0,I.jsxs)(I.Fragment,{children:[(0,I.jsx)(X9,{counts:t}),(0,I.jsx)(`span`,{className:`text-muted-foreground`,children:` · `}),(0,I.jsxs)(`span`,{children:[Math.round(t.passed/n*100),`%`]})]})}function dpe(e,t){return e.length===t.length&&e.every((e,n)=>e===t[n])}function fpe(e){let t=e.find(e=>e.provider&&e.model)??e.find(e=>e.provider||e.model);return{provider:t?.provider,model:t?.model}}var ppe=()=>{let{source:e}=nv(),[t,n]=cp(),r=n9(t),i=t.get(`mode`)===`within-run`?`within-run`:`runs`,[a,o]=(0,_.useState)([]),[s,c]=(0,_.useState)({}),[l,u]=(0,_.useState)(!1),[d,f]=(0,_.useState)(new Set),[p,m]=(0,_.useState)(`timestamp`),[h,g]=(0,_.useState)(`desc`),[v,y]=(0,_.useState)(`all`),[b,x]=(0,_.useState)(!1),[S,C]=(0,_.useState)(()=>{if(typeof window>`u`)return!1;try{return window.localStorage.getItem(q9)===`1`}catch{return!1}}),[w,T]=(0,_.useState)(r.mode),[E,D]=(0,_.useState)(r.preset),[k,A]=(0,_.useState)(r.start),[j,M]=(0,_.useState)(r.end),[N,P]=(0,_.useState)(!1),F=w7(100),{offset:L,hasMore:R,totalCount:z}=F,ee=t.get(`runId`)??``,te=(t.get(`agents`)??``).split(`,`).map(e=>e.trim()).filter(Boolean),ne=t.get(`scenario`)??`all`,[re,ie]=(0,_.useState)(ee),[ae,oe]=(0,_.useState)(te),[se,ce]=(0,_.useState)(ne),[B,le]=(0,_.useState)(!1),ue=(0,_.useRef)(0),de=(0,_.useMemo)(()=>{if(w===`all`)return{};if(w===`last`){let e=$7.find(e=>e.value===E)??$7[0],t=new Date;return{since:new Date(t.getTime()-e.durationMs).toISOString(),until:t.toISOString()}}return{since:J9(k)?.toISOString(),until:J9(j)?.toISOString()}},[j,w,E,k]),V=async()=>{let t=ue.current+1;ue.current=t,u(!0);try{if(e.listRunSummariesPage){let n={limit:100,offset:L};v!==`all`&&(n.scenario=v),de.since&&(n.since=de.since),de.until&&(n.until=de.until);let r=await e.listRunSummariesPage(n);if(ue.current!==t)return;F.updateMeta(r),o(r.data.map(NW))}else{let n=await e.listResults();if(ue.current!==t)return;o(n)}}catch(e){O({title:`Could not load results`,description:e instanceof Error?e.message:String(e),variant:`destructive`})}finally{ue.current===t&&u(!1)}};(0,_.useEffect)(()=>{let t=!0;return ue.current+=1,u(!0),(e.listRunSummariesPage?e.listRunSummariesPage({limit:100,offset:L,scenario:v===`all`?void 0:v,since:de.since,until:de.until}).then(e=>(t&&F.updateMeta(e),e.data.map(NW))):e.listResults()).then(e=>{t&&o(e)}).catch(e=>{t&&O({title:`Could not load results`,description:e instanceof Error?e.message:String(e),variant:`destructive`})}).finally(()=>{t&&u(!1)}),()=>{t=!1}},[L,v,e,de]);let fe=e=>{p===e?g(e=>e===`asc`?`desc`:`asc`):(m(e),g(e===`timestamp`?`desc`:`asc`))},pe=e=>{f(t=>{let n=new Set(t);return n.has(e)?n.delete(e):n.add(e),n})},me=(0,_.useMemo)(()=>{let e=new Set;return a.forEach(t=>{t.scenarios.forEach(t=>{let n=String(t.scenarioName??``).trim(),r=String(t.scenarioId??``).trim(),i=n||r;i&&e.add(i)})}),Array.from(e).sort((e,t)=>e.localeCompare(t))},[a]),he=(0,_.useMemo)(()=>{let e=v===`all`?a:a.filter(e=>e.scenarios.some(e=>{let t=String(e.scenarioName??``).trim(),n=String(e.scenarioId??``).trim();return(t||n)===v}));if(i!==`runs`||w===`all`)return e;let t=Date.now();if(w===`last`){let n=t-($7.find(e=>e.value===E)??$7[0]).durationMs;return e.filter(e=>{let r=new Date(e.timestamp).getTime();return r>=n&&r<=t})}let n=J9(k)?.getTime()??null,r=J9(j)?.getTime()??null,o=n!==null&&r!==null?Math.min(n,r):n??null,s=n!==null&&r!==null?Math.max(n,r):r??null;return e.filter(e=>{let t=new Date(e.timestamp).getTime();return!(Number.isNaN(t)||o!==null&&t<o||s!==null&&t>s)})},[i,a,v,j,w,E,k]),ge=(0,_.useMemo)(()=>[...he].sort((e,t)=>{let n=0;return p===`id`&&(n=e.id.localeCompare(t.id)),p===`timestamp`&&(n=new Date(e.timestamp).getTime()-new Date(t.timestamp).getTime()),p===`passRate`&&(n=(e.overallPassRate??-1)-(t.overallPassRate??-1)),p===`scenarios`&&(n=e.totalScenarios-t.totalScenarios),h===`asc`?n:-n}),[he,p,h]),_e=(0,_.useMemo)(()=>ge.filter(e=>d.has(e.id)).map(e=>s[e.id]??e),[s,ge,d]),ve=(0,_.useMemo)(()=>{if(!S)return ge.map(e=>({type:`run`,run:e}));let e=[],t=null;for(let n of ge){let r=ope(n.timestamp);r!==t&&(e.push({type:`day-separator`,dayKey:r,dayLabel:spe(n.timestamp)}),t=r),e.push({type:`run`,run:n})}return e},[S,ge]);(0,_.useEffect)(()=>{if(typeof window<`u`)try{window.localStorage.setItem(q9,S?`1`:`0`)}catch{}},[S]);let ye=e=>p===e?h===`asc`?(0,I.jsx)(cn,{className:`h-3.5 w-3.5`}):(0,I.jsx)(on,{className:`h-3.5 w-3.5`}):(0,I.jsx)(ln,{className:`h-3.5 w-3.5 text-muted-foreground`}),be=(0,_.useMemo)(()=>{let e=new Map;for(let t of ge)e.set(t.id,MW(t));return e},[ge]),xe=e=>{let t=Array.from(new Set(e.scenarios.map(e=>e.agentId).filter(Boolean)));return t.slice(0,Math.min(2,t.length))},Se=e=>{let r=xe(e);ie(e.id),oe(r),ce(`all`);let i=new URLSearchParams(t);i.set(`mode`,`within-run`),i.set(`runId`,e.id),r.length>0?i.set(`agents`,r.join(`,`)):i.delete(`agents`),i.delete(`scenario`),n(i,{replace:!0})},Ce=(0,_.useMemo)(()=>[...new Set(_e.flatMap(e=>e.scenarios.map(e=>e.scenarioId)))],[_e]),we=(0,_.useMemo)(()=>{let e=new Map;for(let t of _e)for(let n of t.scenarios){let t=String(n.scenarioId??``).trim();if(!t)continue;let r=String(n.scenarioName??``).trim();e.set(t,r||t)}return e},[_e]),Te=(0,_.useMemo)(()=>s[re]??a.find(e=>e.id===re),[s,a,re]);(0,_.useEffect)(()=>{if(typeof e.getResult!=`function`||d.size===0&&!re)return;let t=new Set([...d]);re&&t.add(re);for(let n of t)s[n]||e.getResult(n).then(e=>{e&&c(t=>t[n]?t:{...t,[n]:e})})},[s,d,e,re]),(0,_.useEffect)(()=>{F.reset()},[F.reset,v,w,E,k,j]);let Ee=(0,_.useMemo)(()=>{if(!Te)return[];let e=new Map;for(let t of Te.scenarios)e.set(t.agentId,t.agentName||t.agentId);return Array.from(e.entries()).map(([e,t])=>({id:e,name:t})).sort((e,t)=>e.name.localeCompare(t.name))},[Te]),De=(0,_.useMemo)(()=>{if(!Te)return[];let e=new Set;for(let t of Te.scenarios){let n=String(t.scenarioName??``).trim(),r=String(t.scenarioId??``).trim(),i=n||r;i&&e.add(i)}return Array.from(e).sort((e,t)=>e.localeCompare(t))},[Te]),Oe=(0,_.useMemo)(()=>ae.join(`,`),[ae]);(0,_.useEffect)(()=>{if(i===`within-run`){let e=t.get(`runId`)??``,n=(t.get(`agents`)??``).split(`,`).map(e=>e.trim()).filter(Boolean),r=t.get(`scenario`)??`all`;ie(t=>t===e?t:e),oe(e=>dpe(e,n)?e:n),ce(e=>e===r?e:r)}},[i,t]),(0,_.useEffect)(()=>{if(i!==`within-run`||a.length===0)return;let e=re;(!e||!a.some(t=>t.id===e))&&(e=a[0].id);let t=a.find(t=>t.id===e),n=(()=>{if(!t)return[];let e=new Map;for(let n of t.scenarios)e.set(n.agentId,n.agentName||n.agentId);return Array.from(e.keys())})(),r=new Set(n),o=Oe.split(`,`).map(e=>e.trim()).filter(e=>!!e).filter(e=>r.has(e));o.length===0&&n.length>0&&(o=n.slice(0,Math.min(2,n.length)));let s=(()=>{if(!t)return new Set;let e=new Set;for(let n of t.scenarios){let t=String(n.scenarioName??``).trim(),r=String(n.scenarioId??``).trim(),i=t||r;i&&e.add(i)}return new Set(e)})(),c=se!==`all`&&!s.has(se)?`all`:se;e!==re&&ie(e),o.join(`,`)!==Oe&&oe(o),c!==se&&ce(c)},[i,a,re,Oe,se]),(0,_.useEffect)(()=>{let e=new URLSearchParams(t);i===`within-run`?(e.set(`mode`,`within-run`),re?e.set(`runId`,re):e.delete(`runId`),ae.length>0?e.set(`agents`,ae.join(`,`)):e.delete(`agents`),se===`all`?e.delete(`scenario`):e.set(`scenario`,se),e.delete(`time_filter`),e.delete(`time_preset`),e.delete(`time_start`),e.delete(`time_end`)):(e.delete(`mode`),e.delete(`runId`),e.delete(`agents`),e.delete(`scenario`),w===`all`?(e.delete(`time_filter`),e.delete(`time_preset`),e.delete(`time_start`),e.delete(`time_end`)):w===`last`?(e.set(`time_filter`,`last`),e.set(`time_preset`,E),e.delete(`time_start`),e.delete(`time_end`)):(e.set(`time_filter`,`custom`),e.delete(`time_preset`),k.trim()?e.set(`time_start`,k.trim()):e.delete(`time_start`),j.trim()?e.set(`time_end`,j.trim()):e.delete(`time_end`))),t.toString()!==e.toString()&&n(e,{replace:!0})},[i,j,w,E,k,re,ae,se,t,n]);let ke=(0,_.useMemo)(()=>{if(w===`all`)return`All time`;if(w===`last`)return $7.find(e=>e.value===E)?.label??`Last range`;let e=!!k.trim(),t=!!j.trim();return!e&&!t?`Custom range`:e&&t?`${Y9(k)} - ${Y9(j)}`:e?`From ${Y9(k)}`:`Until ${Y9(j)}`},[j,w,E,k]),Ae=()=>{T(`all`),D(`15min`),A(``),M(``)},je=(0,_.useMemo)(()=>{if(!Te)return[];let e=new Map;for(let t of Te.scenarios){let n=String(t.scenarioId??``).trim(),r=String(t.scenarioName??``).trim(),i=r||n;if(!n&&!i)continue;let a=n||i,o=e.get(a);o?o.byAgent[t.agentId]=t:e.set(a,{scenarioId:n||i,scenarioName:r,displayLabel:i||n,byAgent:{[t.agentId]:t}})}let t=Array.from(e.values()).sort((e,t)=>{let n=(e.displayLabel||e.scenarioId).toLowerCase(),r=(t.displayLabel||t.scenarioId).toLowerCase();return n.localeCompare(r)});return se===`all`?t:t.filter(e=>e.displayLabel===se)},[Te,se]),Me=(0,_.useMemo)(()=>{let e=new Map(Ee.map(e=>[e.id,e]));return ae.map(t=>e.get(t)).filter(e=>!!e)},[ae,Ee]),Ne=(0,_.useMemo)(()=>{if(!Te||Me.length!==2)return null;let[e,t]=Me;return{left:e,right:t,link:`/compare/results?left=${encodeURIComponent(Te.id)}&right=${encodeURIComponent(Te.id)}&leftConfig=${encodeURIComponent(Te.configId)}&rightConfig=${encodeURIComponent(Te.configId)}&leftAgent=${encodeURIComponent(e.id)}&rightAgent=${encodeURIComponent(t.id)}`}},[Te,Me]),Pe=(0,_.useMemo)(()=>!Te||Me.length===0?[]:Me.map(e=>{let t=je.map(t=>t.byAgent[e.id]).filter(e=>!!e),n=t.flatMap(e=>e.runs),r=n.length,i=n.filter(e=>e.passed).length,a=n.reduce((e,t)=>e+t.toolCalls.length,0),o=n.reduce((e,t)=>e+t.duration,0),{provider:s,model:c}=fpe(t);return{agentId:e.id,agentName:e.name,provider:s,model:c,passRate:b_(i,r,n.filter(e=>e.outcome===`stopped`).length),totalRuns:r,avgToolCalls:r===0?0:a/r,avgLatency:r===0?0:o/r}}),[Te,Me,je]),Fe=e=>{oe(t=>t.includes(e)?t.filter(t=>t!==e):[...t,e])},Ie=e=>(0,I.jsxs)(`div`,{className:`min-w-0 rounded border bg-muted/20 px-2 py-1.5`,children:[(0,I.jsxs)(`div`,{className:`text-xs`,children:[(0,I.jsxs)(`span`,{className:`font-mono`,children:[`#`,e.runIndex+1]}),` `,(0,I.jsx)(`span`,{className:e.passed?`text-emerald-700`:`text-destructive`,children:e.passed?`PASS`:`FAIL`}),` `,`· tools: `,e.toolCalls.length,` · `,e.duration,`ms`]}),!e.passed&&e.failureReasons.length>0&&(0,I.jsx)(`div`,{className:`mt-1 max-h-16 overflow-y-auto whitespace-pre-wrap break-all pr-1 text-[11px] text-muted-foreground`,children:e.failureReasons.join(`; `)})]},e.runIndex);return(0,I.jsxs)(`div`,{className:`space-y-6`,children:[(0,I.jsxs)(`div`,{className:`flex items-start justify-between gap-3`,children:[(0,I.jsxs)(`div`,{children:[(0,I.jsxs)(`h1`,{className:`inline-flex items-center gap-2 text-2xl font-bold`,children:[(0,I.jsx)(An,{className:`h-6 w-6`}),`Compare Runs`]}),(0,I.jsx)(`p`,{className:`text-sm text-muted-foreground`,children:i===`runs`?`Select 2–5 runs to compare`:`Compare agents side-by-side within one run`})]}),(0,I.jsxs)(`div`,{className:`flex items-center gap-2`,children:[i===`within-run`&&(0,I.jsxs)(W,{variant:`outline`,size:`sm`,onClick:()=>{let e=new URLSearchParams(t);e.delete(`mode`),e.delete(`runId`),e.delete(`agents`),e.delete(`scenario`),n(e,{replace:!0})},children:[(0,I.jsx)(Zt,{className:`mr-1.5 h-4 w-4`}),`Back to Compare`]}),i===`runs`&&(0,I.jsxs)(I.Fragment,{children:[(0,I.jsxs)(K8,{open:b,onOpenChange:x,children:[(0,I.jsx)(q8,{asChild:!0,children:(0,I.jsxs)(W,{type:`button`,variant:`outline`,role:`combobox`,"aria-expanded":b,"aria-controls":`compare-scenario-command-list`,className:`w-[260px] justify-between font-normal ${v===`all`?``:`border-primary/40`}`,children:[(0,I.jsx)(`span`,{className:`truncate text-left`,children:v===`all`?`All scenarios`:v}),(0,I.jsx)(on,{className:`ml-2 h-4 w-4 shrink-0 opacity-50`})]})}),(0,I.jsx)(J8,{className:`w-[260px] p-0`,align:`start`,children:(0,I.jsxs)(b5,{children:[(0,I.jsx)(x5,{placeholder:`Search scenarios...`}),(0,I.jsxs)(S5,{id:`compare-scenario-command-list`,children:[(0,I.jsx)(C5,{children:`No scenarios found.`}),(0,I.jsxs)(w5,{children:[(0,I.jsx)(T5,{value:`all scenarios`,onSelect:()=>{y(`all`),x(!1)},children:`All scenarios`}),me.map(e=>(0,I.jsx)(T5,{value:e,onSelect:()=>{y(e),x(!1)},children:e},e))]})]})]})})]}),(0,I.jsxs)(K8,{open:N,onOpenChange:P,children:[(0,I.jsx)(q8,{asChild:!0,children:(0,I.jsxs)(W,{type:`button`,variant:`outline`,role:`combobox`,"aria-expanded":N,"aria-controls":`compare-time-command-list`,className:`w-[320px] justify-between font-normal ${w===`all`?``:`border-primary/40`}`,children:[(0,I.jsxs)(`span`,{className:`flex min-w-0 items-center gap-2 truncate text-left`,children:[(0,I.jsx)(nn,{className:`h-4 w-4 shrink-0 text-muted-foreground`}),(0,I.jsx)(`span`,{className:`truncate`,children:ke})]}),(0,I.jsx)(on,{className:`ml-2 h-4 w-4 shrink-0 opacity-50`})]})}),(0,I.jsxs)(J8,{className:`w-[360px] p-0`,align:`start`,children:[(0,I.jsxs)(`div`,{className:`border-b px-3 py-2`,children:[(0,I.jsx)(`p`,{className:`text-sm font-medium`,children:`Date and time filter`}),(0,I.jsx)(`p`,{className:`text-xs text-muted-foreground`,children:`Filter runs by timestamp.`})]}),(0,I.jsxs)(`div`,{id:`compare-time-command-list`,className:`grid gap-1 p-2`,children:[(0,I.jsx)(W,{type:`button`,variant:w===`all`?`secondary`:`ghost`,className:`justify-start`,onClick:()=>{Ae(),P(!1)},children:`All time`}),$7.map(e=>(0,I.jsx)(W,{type:`button`,variant:w===`last`&&E===e.value?`secondary`:`ghost`,className:`justify-start`,onClick:()=>{T(`last`),D(e.value),P(!1)},children:e.label},e.value)),(0,I.jsx)(W,{type:`button`,variant:w===`custom`?`secondary`:`ghost`,className:`justify-start`,onClick:()=>T(`custom`),children:`Custom date time range`})]}),w===`custom`&&(0,I.jsxs)(`div`,{className:`space-y-3 border-t p-3`,children:[(0,I.jsxs)(`div`,{className:`space-y-2`,children:[(0,I.jsx)(Q,{htmlFor:`compare-time-filter-start`,children:`Start`}),(0,I.jsx)(Op,{id:`compare-time-filter-start`,type:`datetime-local`,value:k,onChange:e=>A(e.target.value)})]}),(0,I.jsxs)(`div`,{className:`space-y-2`,children:[(0,I.jsx)(Q,{htmlFor:`compare-time-filter-end`,children:`End`}),(0,I.jsx)(Op,{id:`compare-time-filter-end`,type:`datetime-local`,value:j,onChange:e=>M(e.target.value)})]}),(0,I.jsxs)(`div`,{className:`flex items-center justify-between gap-2`,children:[(0,I.jsxs)(W,{type:`button`,variant:`ghost`,size:`sm`,className:`px-2`,onClick:Ae,children:[(0,I.jsx)(hr,{className:`mr-1.5 h-3.5 w-3.5`}),`Clear`]}),(0,I.jsx)(W,{type:`button`,size:`sm`,onClick:()=>P(!1),children:`Done`})]})]})]})]})]}),(0,I.jsxs)(`div`,{className:`inline-flex items-center gap-2 rounded-md border px-3 py-2`,children:[(0,I.jsx)(Q,{htmlFor:`compare-day-separators-switch`,className:`text-sm font-medium`,children:`Group by day`}),(0,I.jsx)(L5,{id:`compare-day-separators-switch`,checked:S,onCheckedChange:C,"aria-label":`Group by day`})]}),(0,I.jsx)(W,{variant:`outline`,onClick:()=>void V(),disabled:l,children:l?`Refreshing...`:`Refresh`}),(0,I.jsx)(W,{variant:`outline`,onClick:F.prev,disabled:l||L===0,children:`Prev`}),(0,I.jsx)(W,{variant:`outline`,onClick:F.next,disabled:l||!R,children:`Next`})]})]}),(0,I.jsx)(`p`,{className:`text-xs text-muted-foreground`,children:F.rangeLabel(a.length)}),i===`within-run`&&(0,I.jsxs)(K,{children:[(0,I.jsx)(gv,{className:`pb-3`,children:(0,I.jsx)(_v,{className:`text-base`,children:`Within One Run Controls`})}),(0,I.jsxs)(q,{className:`space-y-4`,children:[(0,I.jsxs)(`div`,{className:`grid gap-3 sm:grid-cols-2`,children:[(0,I.jsxs)(`div`,{className:`space-y-1`,children:[(0,I.jsx)(`p`,{className:`text-xs font-medium text-muted-foreground`,children:`Run`}),(0,I.jsxs)(OY,{value:re,onValueChange:ie,children:[(0,I.jsx)(AY,{children:(0,I.jsx)(kY,{placeholder:`Select run`})}),(0,I.jsx)(NY,{children:a.map(e=>(0,I.jsx)(Z,{value:e.id,children:e.id},e.id))})]})]}),(0,I.jsxs)(`div`,{className:`space-y-1`,children:[(0,I.jsx)(`p`,{className:`text-xs font-medium text-muted-foreground`,children:`Scenario filter`}),(0,I.jsxs)(K8,{open:B,onOpenChange:le,children:[(0,I.jsx)(q8,{asChild:!0,children:(0,I.jsxs)(W,{type:`button`,variant:`outline`,role:`combobox`,"aria-expanded":B,"aria-controls":`compare-within-run-scenario-command-list`,className:`w-full justify-between font-normal`,children:[(0,I.jsx)(`span`,{className:`truncate text-left`,children:se===`all`?`All scenarios`:se}),(0,I.jsx)(on,{className:`ml-2 h-4 w-4 shrink-0 opacity-50`})]})}),(0,I.jsx)(J8,{className:`w-(--radix-popover-trigger-width) p-0`,align:`start`,children:(0,I.jsxs)(b5,{children:[(0,I.jsx)(x5,{placeholder:`Search scenarios...`}),(0,I.jsxs)(S5,{id:`compare-within-run-scenario-command-list`,children:[(0,I.jsx)(C5,{children:`No scenarios found.`}),(0,I.jsxs)(w5,{children:[(0,I.jsx)(T5,{value:`all scenarios`,onSelect:()=>{ce(`all`),le(!1)},children:`All scenarios`}),De.map(e=>(0,I.jsx)(T5,{value:e,onSelect:()=>{ce(e),le(!1)},children:e},e))]})]})]})})]})]})]}),(0,I.jsxs)(`div`,{className:`space-y-2`,children:[(0,I.jsx)(`p`,{className:`text-xs font-medium text-muted-foreground`,children:`Agents (select 2+)`}),(0,I.jsxs)(`div`,{className:`flex flex-wrap gap-3 rounded-md border p-3`,children:[Ee.length===0&&(0,I.jsx)(`p`,{className:`text-xs text-muted-foreground`,children:`No agents available for selected run.`}),Ee.map(e=>(0,I.jsxs)(`label`,{className:`inline-flex items-center gap-2 text-sm`,children:[(0,I.jsx)(KX,{checked:ae.includes(e.id),onCheckedChange:()=>Fe(e.id)}),(0,I.jsx)(`span`,{children:e.name})]},e.id))]})]})]})]}),i===`runs`&&(0,I.jsx)(K,{children:(0,I.jsx)(q,{className:`p-0`,children:(0,I.jsxs)(bv,{containerClassName:`max-h-144 overflow-auto`,children:[(0,I.jsx)(xv,{className:`[&_th]:sticky [&_th]:top-0 [&_th]:z-10 [&_th]:bg-background`,children:(0,I.jsxs)(wv,{children:[(0,I.jsx)(Tv,{className:`w-10`}),(0,I.jsx)(Tv,{children:(0,I.jsxs)(`button`,{type:`button`,className:`inline-flex items-center gap-1 hover:text-foreground`,onClick:()=>fe(`id`),children:[`Run ID`,ye(`id`)]})}),(0,I.jsx)(Tv,{children:`Evaluated`}),(0,I.jsx)(Tv,{children:(0,I.jsxs)(`button`,{type:`button`,className:`inline-flex items-center gap-1 hover:text-foreground`,onClick:()=>fe(`timestamp`),children:[`Timestamp`,ye(`timestamp`)]})}),(0,I.jsx)(Tv,{className:`text-right`,children:(0,I.jsxs)(`button`,{type:`button`,className:`inline-flex w-full items-center justify-end gap-1 hover:text-foreground`,onClick:()=>fe(`passRate`),children:[`Pass Rate`,ye(`passRate`)]})}),(0,I.jsx)(Tv,{className:`text-right`,children:(0,I.jsxs)(`button`,{type:`button`,className:`inline-flex items-center gap-1 hover:text-foreground`,onClick:()=>fe(`scenarios`),children:[`Scenarios`,ye(`scenarios`)]})}),(0,I.jsx)(Tv,{className:`text-right`,children:`Tool Tokens`}),(0,I.jsx)(Tv,{className:`text-right`,children:`Agents`}),(0,I.jsx)(Tv,{className:`w-[140px] text-right`,children:`Action`})]})}),(0,I.jsx)(Sv,{children:ve.map((e,t)=>e.type===`day-separator`?(0,I.jsx)(wv,{className:`bg-muted/30 hover:bg-muted/30`,children:(0,I.jsx)(J,{colSpan:ape,className:`px-4 py-3`,children:(0,I.jsxs)(`div`,{className:`flex items-center gap-3`,children:[(0,I.jsx)(`div`,{className:`h-px flex-1 bg-border/70`}),(0,I.jsx)(`span`,{className:`shrink-0 rounded-full border border-border bg-background px-2.5 py-0.5 text-[11px] font-medium uppercase tracking-wide text-muted-foreground`,children:e.dayLabel}),(0,I.jsx)(`div`,{className:`h-px flex-1 bg-border/70`})]})})},`day-${e.dayKey}-${t}`):(0,I.jsxs)(wv,{children:[(0,I.jsx)(J,{children:(0,I.jsx)(KX,{checked:d.has(e.run.id),onCheckedChange:()=>pe(e.run.id),disabled:!d.has(e.run.id)&&d.size>=5})}),(0,I.jsx)(J,{className:`font-mono text-xs`,children:(0,I.jsxs)(`div`,{className:`space-y-0.5`,children:[(0,I.jsx)(`div`,{children:e.run.id}),(0,I.jsx)(Z9,{run:e.run,className:`truncate font-sans text-xs text-foreground/80`})]})}),(0,I.jsx)(J,{className:`text-[11px] text-muted-foreground`,children:(()=>{let t=be.get(e.run.id)??{scenarioCount:0,agentCount:0,scopePreview:`n/a`,modelSummary:``};return(0,I.jsxs)(`div`,{className:`space-y-0.5`,children:[(0,I.jsxs)(`div`,{children:[`Evaluated: `,t.scenarioCount,` scenario`,t.scenarioCount===1?``:`s`,` · `,t.agentCount,` agent`,t.agentCount===1?``:`s`,t.modelSummary?` · ${t.modelSummary}`:``]}),(0,I.jsx)(C7,{versions:e.run.mcpServerVersions,showPrefix:!1})]})})()}),(0,I.jsx)(J,{className:`text-xs text-muted-foreground`,children:(0,I.jsxs)(`div`,{className:`space-y-0.5`,children:[(0,I.jsxs)(`div`,{className:`flex items-center gap-1`,children:[(0,I.jsx)(_n,{className:`h-3 w-3`}),new Date(e.run.timestamp).toLocaleString()]}),(()=>{let t=z7(e.run);return t===null?null:(0,I.jsxs)(`div`,{className:`font-mono text-[11px] text-muted-foreground/90`,children:[`Total time: `,L7(t)]})})()]})}),(0,I.jsx)(J,{className:`text-right`,children:(0,I.jsxs)(`div`,{className:`flex flex-col items-center gap-1`,children:[(0,I.jsx)(kv,{rate:e.run.overallPassRate}),e.run.checkCounts&&e.run.checkCounts.total>0?(0,I.jsx)(`span`,{className:`font-mono text-[11px] leading-none`,"aria-label":`${e.run.checkCounts.passed} checks passed, ${e.run.checkCounts.failed} checks failed`,title:`${e.run.checkCounts.passed} passed · ${e.run.checkCounts.failed} failed`,children:(0,I.jsx)(X9,{counts:e.run.checkCounts})}):null]})}),(0,I.jsx)(J,{className:`text-right font-mono text-sm`,children:e.run.totalScenarios}),(0,I.jsx)(J,{className:`text-right`,children:(0,I.jsxs)(`div`,{className:`space-y-0.5`,children:[(0,I.jsx)(`div`,{className:`font-mono text-sm`,children:d6(e.run.toolTokenUsage?.totalTokens)}),(()=>{let t=V7(e.run);return t===null?null:(0,I.jsxs)(`div`,{className:`font-mono text-[11px] text-muted-foreground/90`,children:[`Tool time: `,L7(t)]})})()]})}),(0,I.jsx)(J,{className:`text-right font-mono text-sm`,children:be.get(e.run.id)?.agentCount??0}),(0,I.jsx)(J,{className:`text-right`,children:(be.get(e.run.id)?.agentCount??0)>1?(0,I.jsx)(W,{type:`button`,size:`sm`,variant:`outline`,onClick:()=>Se(e.run),children:`Compare agents`}):(0,I.jsx)(`span`,{className:`text-xs text-muted-foreground`,children:`—`})})]},e.run.id))})]})})}),i===`runs`&&_e.length<2&&(0,I.jsx)(K,{children:(0,I.jsxs)(q,{className:`py-12 text-center`,children:[(0,I.jsx)(`p`,{className:`text-sm font-medium`,children:`No runs selected`}),(0,I.jsx)(`p`,{className:`mt-1 text-xs text-muted-foreground`,children:`Select 2–5 runs from the table above to start a comparison.`})]})}),i===`runs`&&_e.length>=2&&(0,I.jsxs)(I.Fragment,{children:[_e.length===2&&(0,I.jsx)(K,{children:(0,I.jsx)(q,{className:`pt-6`,children:(0,I.jsxs)(`div`,{className:`flex flex-wrap items-center justify-between gap-3`,children:[(0,I.jsxs)(`div`,{children:[(0,I.jsx)(`p`,{className:`text-sm font-medium`,children:`Need a deeper comparison?`}),(0,I.jsx)(`p`,{className:`text-xs text-muted-foreground`,children:`Open the two selected runs in a dedicated side-by-side full result compare view.`})]}),(0,I.jsx)(W,{asChild:!0,size:`sm`,children:(0,I.jsx)(np,{to:`/compare/results?left=${encodeURIComponent(_e[0].id)}&right=${encodeURIComponent(_e[1].id)}&leftConfig=${encodeURIComponent(_e[0].configId)}&rightConfig=${encodeURIComponent(_e[1].configId)}`,children:`Compare full results`})})]})})}),(0,I.jsxs)(K,{children:[(0,I.jsx)(gv,{className:`pb-3`,children:(0,I.jsx)(_v,{className:`text-base`,children:`Summary Comparison`})}),(0,I.jsx)(q,{className:`max-h-96 overflow-auto p-0`,children:(0,I.jsxs)(bv,{className:`table-fixed`,children:[(0,I.jsx)(xv,{className:`[&_th]:sticky [&_th]:top-0 [&_th]:z-10 [&_th]:bg-background`,children:(0,I.jsxs)(wv,{children:[(0,I.jsx)(Tv,{className:`w-[220px]`,children:`Metric`}),_e.map((e,t)=>(0,I.jsxs)(Tv,{style:{color:K9[t]},className:`font-mono text-xs`,children:[(0,I.jsx)(`div`,{children:e.id}),(0,I.jsx)(Z9,{run:e,className:`mt-0.5 truncate text-[10px] font-normal text-muted-foreground`})]},e.id))]})}),(0,I.jsxs)(Sv,{children:[(0,I.jsxs)(wv,{children:[(0,I.jsx)(J,{className:`font-medium`,children:`Pass Rate`}),_e.map(e=>(0,I.jsx)(J,{children:(0,I.jsx)(kv,{rate:e.overallPassRate})},e.id))]}),(0,I.jsxs)(wv,{children:[(0,I.jsx)(J,{className:`font-medium`,children:`Checks Pass Rate`}),_e.map(e=>(0,I.jsx)(J,{className:`font-mono`,children:upe(e)},e.id))]}),(0,I.jsxs)(wv,{children:[(0,I.jsx)(J,{className:`font-medium`,children:`Total Runs`}),_e.map(e=>(0,I.jsx)(J,{className:`font-mono`,children:e.totalRuns},e.id))]}),(0,I.jsxs)(wv,{children:[(0,I.jsx)(J,{className:`font-medium`,children:`Tool Calls`}),_e.map(e=>(0,I.jsx)(J,{className:`font-mono`,children:e.avgToolCalls.toFixed(1)},e.id))]}),(0,I.jsxs)(wv,{children:[(0,I.jsx)(J,{className:`font-medium`,children:`Avg Latency`}),_e.map(e=>(0,I.jsxs)(J,{className:`font-mono`,children:[e.avgLatency,`ms`]},e.id))]}),(0,I.jsxs)(wv,{children:[(0,I.jsx)(J,{className:`font-medium`,children:`Total Time`}),_e.map(e=>(0,I.jsx)(J,{className:`font-mono`,children:(()=>{let t=z7(e);return t===null?`—`:L7(t)})()},e.id))]}),(0,I.jsxs)(wv,{children:[(0,I.jsx)(J,{className:`font-medium`,children:`Tool Time`}),_e.map(e=>(0,I.jsx)(J,{className:`font-mono`,children:(()=>{let t=V7(e);return t===null?`—`:L7(t)})()},e.id))]})]})]})})]}),(0,I.jsxs)(K,{children:[(0,I.jsx)(gv,{className:`pb-3`,children:(0,I.jsx)(_v,{className:`text-base`,children:`Scenario Breakdown`})}),(0,I.jsx)(q,{className:`max-h-104 overflow-auto p-0`,children:(0,I.jsxs)(bv,{className:`table-fixed`,children:[(0,I.jsx)(xv,{className:`[&_th]:sticky [&_th]:top-0 [&_th]:z-10 [&_th]:bg-background`,children:(0,I.jsxs)(wv,{children:[(0,I.jsx)(Tv,{className:`w-[220px]`,children:`Scenario`}),_e.map((e,t)=>(0,I.jsxs)(Tv,{style:{color:K9[t]},className:`font-mono text-xs`,children:[(0,I.jsx)(`div`,{children:e.id}),(0,I.jsx)(Z9,{run:e,className:`mt-0.5 truncate text-[10px] font-normal text-muted-foreground`}),(0,I.jsx)(C7,{versions:e.mcpServerVersions,className:`mt-0.5 max-w-full border-0 bg-transparent p-0 text-[10px] font-normal`})]},e.id))]})}),(0,I.jsx)(Sv,{children:Ce.map(e=>(0,I.jsxs)(wv,{children:[(0,I.jsx)(J,{className:`font-medium text-sm`,children:we.get(e)??e}),_e.map(t=>{let n=t.scenarios.find(t=>t.scenarioId===e);return(0,I.jsx)(J,{children:n?(0,I.jsxs)(`div`,{className:`flex items-center justify-start gap-2`,children:[(0,I.jsx)(kv,{rate:n.passRate}),n.checkCounts?.total?(0,I.jsx)(`span`,{className:`font-mono text-[11px] leading-none`,children:(0,I.jsx)(X9,{counts:n.checkCounts})}):null]}):(0,I.jsx)(`span`,{className:`text-xs text-muted-foreground`,children:`—`})},t.id)})]},e))})]})})]})]}),i===`runs`&&_e.length>=2&&(0,I.jsxs)(K,{children:[(0,I.jsx)(gv,{className:`pb-3`,children:(0,I.jsx)(_v,{className:`text-base`,children:`Pass Rate Trend`})}),(0,I.jsx)(q,{className:`h-72`,children:(0,I.jsx)(sT,{width:`100%`,height:`100%`,children:(0,I.jsxs)(OW,{data:_e.map((e,t)=>({idx:t+1,runId:e.id,passRate:e.overallPassRate===null?null:Number((e.overallPassRate*100).toFixed(1))})),children:[(0,I.jsx)(BH,{dataKey:`idx`,tickFormatter:e=>String(e)}),(0,I.jsx)(rU,{unit:`%`,domain:[0,100]}),(0,I.jsx)(Hw,{formatter:e=>[`${e}%`,`Pass Rate`],labelFormatter:e=>`Run ${e}`}),(0,I.jsx)(jC,{}),(0,I.jsx)(CH,{type:`monotone`,dataKey:`passRate`,stroke:K9[0],strokeWidth:2.5,dot:!0})]})})})]}),i===`within-run`&&Te&&Me.length<2&&(0,I.jsx)(K,{children:(0,I.jsx)(q,{className:`pt-6 text-sm text-muted-foreground`,children:`Select at least 2 agents to compare side-by-side within this run.`})}),i===`within-run`&&Te&&Me.length>=2&&(0,I.jsxs)(I.Fragment,{children:[(0,I.jsx)(K,{children:(0,I.jsx)(q,{className:`pt-6`,children:(0,I.jsxs)(`div`,{className:`flex flex-wrap items-center justify-between gap-3`,children:[(0,I.jsxs)(`div`,{children:[(0,I.jsx)(`p`,{className:`text-sm font-medium`,children:`Need full result details?`}),(0,I.jsx)(`p`,{className:`text-xs text-muted-foreground`,children:Ne?`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.`})]}),(0,I.jsx)(W,{asChild:!0,size:`sm`,children:Ne?(0,I.jsx)(np,{to:Ne.link,children:`Compare full results`}):(0,I.jsx)(np,{to:`/results/${encodeURIComponent(Te.id)}${Te.configId?`?configId=${encodeURIComponent(Te.configId)}`:``}`,children:`Open full result`})})]})})}),(0,I.jsxs)(K,{children:[(0,I.jsx)(gv,{className:`pb-3`,children:(0,I.jsx)(_v,{className:`text-base`,children:`Agent Summary`})}),(0,I.jsx)(q,{className:`max-h-96 overflow-auto p-0`,children:(0,I.jsxs)(bv,{children:[(0,I.jsx)(xv,{className:`[&_th]:sticky [&_th]:top-0 [&_th]:z-10 [&_th]:bg-background`,children:(0,I.jsxs)(wv,{children:[(0,I.jsx)(Tv,{children:`Metric`}),Pe.map(e=>(0,I.jsxs)(Tv,{children:[(0,I.jsx)(`div`,{className:`font-medium text-sm`,children:e.agentName}),(e.provider||e.model)&&(0,I.jsx)(`div`,{className:`font-mono text-xs font-normal text-muted-foreground`,children:[e.provider?OX(e.provider):null,e.model].filter(Boolean).join(` · `)})]},e.agentId))]})}),(0,I.jsxs)(Sv,{children:[(0,I.jsxs)(wv,{children:[(0,I.jsx)(J,{className:`font-medium`,children:`Pass Rate`}),Pe.map(e=>(0,I.jsx)(J,{children:(0,I.jsx)(kv,{rate:e.passRate})},e.agentId))]}),(0,I.jsxs)(wv,{children:[(0,I.jsx)(J,{className:`font-medium`,children:`Total Runs`}),Pe.map(e=>(0,I.jsx)(J,{className:`font-mono`,children:e.totalRuns},e.agentId))]}),(0,I.jsxs)(wv,{children:[(0,I.jsx)(J,{className:`font-medium`,children:`Avg Tool Calls`}),Pe.map(e=>(0,I.jsx)(J,{className:`font-mono`,children:e.avgToolCalls.toFixed(1)},e.agentId))]}),(0,I.jsxs)(wv,{children:[(0,I.jsx)(J,{className:`font-medium`,children:`Avg Latency`}),Pe.map(e=>(0,I.jsxs)(J,{className:`font-mono`,children:[Math.round(e.avgLatency),`ms`]},e.agentId))]})]})]})})]}),(0,I.jsxs)(K,{children:[(0,I.jsx)(gv,{className:`pb-3`,children:(0,I.jsx)(_v,{className:`text-base`,children:`Scenario × Agent Matrix`})}),(0,I.jsx)(q,{className:`max-h-136 overflow-auto p-0`,children:(0,I.jsxs)(bv,{className:`table-fixed`,children:[(0,I.jsx)(xv,{className:`[&_th]:sticky [&_th]:top-0 [&_th]:z-10 [&_th]:bg-background`,children:(0,I.jsxs)(wv,{children:[(0,I.jsx)(Tv,{className:`w-[260px]`,children:`Scenario`}),Me.map(e=>{let t=Pe.find(t=>t.agentId===e.id);return(0,I.jsxs)(Tv,{children:[(0,I.jsx)(`div`,{className:`font-medium text-sm`,children:e.name}),(t?.provider||t?.model)&&(0,I.jsx)(`div`,{className:`font-mono text-xs font-normal text-muted-foreground`,children:[t.provider?OX(t.provider):null,t.model].filter(Boolean).join(` · `)})]},e.id)})]})}),(0,I.jsx)(Sv,{children:je.map(e=>(0,I.jsxs)(wv,{children:[(0,I.jsx)(J,{className:`font-medium text-sm`,children:e.displayLabel}),Me.map(t=>{let n=e.byAgent[t.id];return n?(0,I.jsx)(J,{className:`min-w-0 align-top`,children:(0,I.jsxs)(`div`,{className:`space-y-2`,children:[(0,I.jsxs)(`div`,{className:`text-xs text-muted-foreground`,children:[(0,I.jsx)(kv,{rate:n.passRate}),` `,(0,I.jsxs)(`span`,{className:`ml-2`,children:[`runs: `,n.runs.length]}),` · calls:`,` `,n.avgToolCalls.toFixed(1),` · latency:`,` `,Math.round(n.avgDuration),`ms`]}),n.runs.length>0?(0,I.jsx)(`div`,{className:`space-y-1.5`,children:n.runs.map(e=>Ie(e))}):(0,I.jsx)(`div`,{className:`text-xs text-muted-foreground`,children:`No runs captured.`})]})},t.id):(0,I.jsx)(J,{children:(0,I.jsx)(`span`,{className:`text-xs text-muted-foreground`,children:`—`})},t.id)})]},e.scenarioId))})]})})]})]})]})},Q9=(e,t,n)=>{let r=new URLSearchParams;return t&&r.set(`configId`,t),n&&r.set(`agent`,n),r.set(`embed`,`1`),`/results/${encodeURIComponent(e)}?${r.toString()}`},$9=(e,t,n)=>{let r=new URLSearchParams;t&&r.set(`configId`,t),n&&r.set(`agent`,n);let i=r.toString();return`/results/${encodeURIComponent(e)}${i?`?${i}`:``}`},mpe=()=>{let{source:e}=nv(),[t]=cp(),n=t.get(`left`)??``,r=t.get(`right`)??``,i=t.get(`leftConfig`),a=t.get(`rightConfig`),o=t.get(`leftAgent`),s=t.get(`rightAgent`),c=o?`${n} · ${o}`:n,l=s?`${r} · ${s}`:r,[u,d]=(0,_.useState)(null),[f,p]=(0,_.useState)(null);return(0,_.useEffect)(()=>{if(!n||typeof e.getResult!=`function`){d(null);return}let t=!0;return e.getResult(n).then(e=>{t&&d(e??null)}),()=>{t=!1}},[n,e]),(0,_.useEffect)(()=>{if(!r||typeof e.getResult!=`function`){p(null);return}let t=!0;return e.getResult(r).then(e=>{t&&p(e??null)}),()=>{t=!1}},[r,e]),!n||!r?(0,I.jsxs)(K,{children:[(0,I.jsx)(gv,{children:(0,I.jsx)(_v,{className:`text-base`,children:`Full Result Compare`})}),(0,I.jsxs)(q,{className:`space-y-3`,children:[(0,I.jsx)(`p`,{className:`text-sm text-muted-foreground`,children:`Select exactly two runs in Compare and use the “Compare full results” action.`}),(0,I.jsx)(W,{asChild:!0,variant:`outline`,children:(0,I.jsx)(np,{to:`/compare`,children:`Back to Compare`})})]})]}):(0,I.jsxs)(`div`,{className:`space-y-4`,children:[(0,I.jsxs)(`div`,{className:`flex flex-wrap items-center justify-between gap-2`,children:[(0,I.jsxs)(`div`,{children:[(0,I.jsx)(`h1`,{className:`text-2xl font-bold`,children:`Full Result Compare`}),(0,I.jsx)(`p`,{className:`text-sm text-muted-foreground`,children:o||s?`Side-by-side Result Detail views for deep inspection, filtered by selected agents.`:`Side-by-side Result Detail views for deep inspection.`})]}),(0,I.jsxs)(`div`,{className:`flex flex-wrap items-center gap-2`,children:[(0,I.jsx)(W,{variant:`outline`,size:`sm`,asChild:!0,children:(0,I.jsxs)(np,{to:`/compare`,children:[(0,I.jsx)(Zt,{className:`mr-1.5 h-4 w-4`}),`Back to Compare`]})}),(0,I.jsx)(W,{variant:`outline`,size:`sm`,asChild:!0,children:(0,I.jsxs)(`a`,{href:$9(n,i,o),target:`_blank`,rel:`noreferrer`,children:[`Open Left`,(0,I.jsx)(Sn,{className:`ml-1.5 h-3.5 w-3.5`})]})}),(0,I.jsx)(W,{variant:`outline`,size:`sm`,asChild:!0,children:(0,I.jsxs)(`a`,{href:$9(r,a,s),target:`_blank`,rel:`noreferrer`,children:[`Open Right`,(0,I.jsx)(Sn,{className:`ml-1.5 h-3.5 w-3.5`})]})})]})]}),(0,I.jsxs)(`div`,{className:`grid gap-4 xl:grid-cols-2`,children:[(0,I.jsxs)(K,{className:`overflow-hidden`,children:[(0,I.jsx)(gv,{className:`py-3`,children:(0,I.jsx)(_v,{className:`text-sm font-mono`,children:c})}),(0,I.jsx)(q,{className:`p-0`,children:(0,I.jsx)(`iframe`,{title:`Result ${c}`,src:Q9(n,i,o),className:`h-[calc(100vh-12rem)] w-full border-0`})})]}),(0,I.jsxs)(K,{className:`overflow-hidden`,children:[(0,I.jsx)(gv,{className:`py-3`,children:(0,I.jsx)(_v,{className:`text-sm font-mono`,children:l})}),(0,I.jsx)(q,{className:`p-0`,children:(0,I.jsx)(`iframe`,{title:`Result ${l}`,src:Q9(r,a,s),className:`h-[calc(100vh-12rem)] w-full border-0`})})]})]})]})};function hpe(e){return e.match(/(?:^|\/)(?:result-assistant|results?)\/([0-9]{8}-[0-9]{6})(?:-|\/)/i)?.[1]??null}function gpe(){let{source:e}=nv(),[t,n]=(0,_.useState)([]),[r,i]=(0,_.useState)(!0),[a,o]=(0,_.useState)(null),[s,c]=(0,_.useState)(!1),l=w7(100),{offset:u,hasMore:d}=l,f=async()=>{i(!0);try{if(e.listMarkdownReportsPage){let t=await e.listMarkdownReportsPage({limit:100,offset:u});n(t.data),l.updateMeta(t)}else n(await e.listMarkdownReports({limit:100,offset:u}))}catch(e){O({title:`Could not load markdown reports`,description:e instanceof Error?e.message:String(e),variant:`destructive`})}finally{i(!1)}};(0,_.useEffect)(()=>{f()},[u]);let p=(0,_.useMemo)(()=>t[0],[t]),m=(0,_.useMemo)(()=>t.find(e=>e.relativePath===a)??null,[t,a]),h=async()=>{if(a){c(!0);try{await e.deleteMarkdownReport(a),n(e=>e.filter(e=>e.relativePath!==a)),O({title:`Markdown report deleted`}),o(null)}catch(e){O({title:`Could not delete markdown report`,description:e instanceof Error?e.message:String(e),variant:`destructive`})}finally{c(!1)}}};return(0,I.jsxs)(`div`,{className:`space-y-6`,children:[(0,I.jsxs)(`div`,{className:`flex items-start justify-between gap-3`,children:[(0,I.jsxs)(`div`,{children:[(0,I.jsxs)(`h1`,{className:`inline-flex items-center gap-2 text-2xl font-bold`,children:[(0,I.jsx)(Un,{className:`h-6 w-6`}),`Markdown Reports`]}),(0,I.jsxs)(`p`,{className:`text-sm text-muted-foreground`,children:[`Browse Markdown files under `,(0,I.jsx)(`code`,{children:`mcplab/reports`}),`.`]})]}),(0,I.jsxs)(`div`,{className:`flex items-center gap-2`,children:[(0,I.jsx)(W,{variant:`outline`,onClick:()=>void f(),children:`Refresh`}),p?(0,I.jsx)(W,{asChild:!0,variant:`outline`,children:(0,I.jsx)(np,{to:`/markdown-reports/view?id=${encodeURIComponent(p.reportId)}`,children:`Open latest`})}):null,(0,I.jsx)(W,{variant:`outline`,onClick:l.prev,disabled:r||u===0,children:`Prev`}),(0,I.jsx)(W,{variant:`outline`,onClick:l.next,disabled:r||!d,children:`Next`})]})]}),(0,I.jsx)(`p`,{className:`text-xs text-muted-foreground`,children:l.rangeLabel(t.length)}),(0,I.jsx)(K,{children:(0,I.jsx)(q,{className:`p-0`,children:r?(0,I.jsx)(`p`,{className:`p-6 text-sm text-muted-foreground`,children:`Loading markdown reports...`}):t.length===0?(0,I.jsx)(`p`,{className:`p-6 text-sm text-muted-foreground`,children:`No markdown reports found yet.`}):(0,I.jsxs)(bv,{children:[(0,I.jsx)(xv,{children:(0,I.jsxs)(wv,{children:[(0,I.jsx)(Tv,{children:`Report`}),(0,I.jsx)(Tv,{children:`Result`}),(0,I.jsx)(Tv,{children:`Folder`}),(0,I.jsx)(Tv,{children:`Timestamp`}),(0,I.jsx)(Tv,{className:`w-10`})]})}),(0,I.jsx)(Sv,{children:t.map(e=>(0,I.jsxs)(wv,{children:[(0,I.jsx)(J,{children:(0,I.jsxs)(`div`,{className:`space-y-1`,children:[(0,I.jsx)(np,{to:`/markdown-reports/view?id=${encodeURIComponent(e.reportId)}`,className:`font-mono text-xs text-primary hover:underline`,children:e.name}),(0,I.jsx)(`div`,{className:`font-mono text-[11px] text-muted-foreground`,children:e.relativePath})]})}),(0,I.jsx)(J,{className:`text-xs text-muted-foreground font-mono`,children:(()=>{let t=hpe(e.relativePath);return t?(0,I.jsx)(np,{to:`/results/${encodeURIComponent(t)}`,className:`text-primary hover:underline`,children:t}):(0,I.jsx)(`span`,{className:`text-muted-foreground`,children:`—`})})()}),(0,I.jsx)(J,{className:`text-xs text-muted-foreground font-mono`,children:e.relativePath.includes(`/`)?e.relativePath.slice(0,e.relativePath.lastIndexOf(`/`)):`.`}),(0,I.jsx)(J,{className:`text-xs text-muted-foreground`,children:(0,I.jsxs)(`div`,{className:`flex items-center gap-1`,children:[(0,I.jsx)(_n,{className:`h-3 w-3`}),new Date(e.mtime).toLocaleString()]})}),(0,I.jsx)(J,{children:(0,I.jsxs)(Rq,{children:[(0,I.jsx)(zq,{asChild:!0,children:(0,I.jsx)(W,{variant:`ghost`,size:`icon`,className:`h-8 w-8`,children:(0,I.jsx)(xn,{className:`h-4 w-4`})})}),(0,I.jsxs)(Hq,{align:`end`,children:[(0,I.jsx)(Uq,{asChild:!0,children:(0,I.jsx)(np,{to:`/markdown-reports/view?id=${encodeURIComponent(e.reportId)}`,children:`View`})}),(0,I.jsxs)(Uq,{className:`text-destructive`,onSelect:t=>{t.preventDefault(),o(e.relativePath)},children:[(0,I.jsx)(lr,{className:`mr-2 h-3.5 w-3.5`}),` Delete`]})]})]})})]},e.path))})]})})}),(0,I.jsx)(X6,{open:!!a,onOpenChange:e=>!e&&o(null),children:(0,I.jsxs)(Q6,{children:[(0,I.jsxs)($6,{children:[(0,I.jsx)(t8,{children:`Delete markdown report?`}),(0,I.jsx)(n8,{children:m?`Delete '${m.name}' from disk? This cannot be undone.`:`Delete this report from disk? This cannot be undone.`})]}),(0,I.jsxs)(e8,{children:[(0,I.jsx)(i8,{disabled:s,children:`Cancel`}),(0,I.jsx)(r8,{onClick:e=>{e.preventDefault(),h()},disabled:s,children:s?`Deleting...`:`Delete`})]})]})})]})}function _pe(e){return e<1024?`${e} B`:e<1048576?`${(e/1024).toFixed(1)} KB`:`${(e/1048576).toFixed(1)} MB`}function vpe(e){let 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 ype(){let{source:e}=nv(),[t]=cp(),n=(t.get(`id`)??``).trim(),r=(t.get(`path`)??``).trim(),[i,a]=(0,_.useState)(null),[o,s]=(0,_.useState)(!0),[c,l]=(0,_.useState)(!1),[u,d]=(0,_.useState)(!1);if((0,_.useEffect)(()=>{let t=!0;if(a(null),l(!1),!n&&!r)s(!1);else return s(!0),(n&&e.getMarkdownReportById?e.getMarkdownReportById(n):e.getMarkdownReport(r)).then(e=>{t&&a(e)}).catch(e=>{if(!t)return;let n=e instanceof Error?e.message:String(e);n.includes(`(404)`)?l(!0):O({title:`Could not load markdown report`,description:n,variant:`destructive`})}).finally(()=>{t&&s(!1)}),()=>{t=!1}},[r,n,e]),!n&&!r)return(0,I.jsxs)(`div`,{className:`space-y-4`,children:[(0,I.jsx)(`h1`,{className:`text-2xl font-bold`,children:`Markdown Report`}),(0,I.jsx)(`p`,{className:`text-sm text-muted-foreground`,children:`Missing report identifier.`}),(0,I.jsx)(W,{asChild:!0,variant:`outline`,children:(0,I.jsx)(np,{to:`/markdown-reports`,children:`Back to Markdown Reports`})})]});if(o)return(0,I.jsx)(`p`,{className:`text-sm text-muted-foreground`,children:`Loading markdown report...`});if(c||!i)return(0,I.jsxs)(`div`,{className:`space-y-4`,children:[(0,I.jsx)(`h1`,{className:`text-2xl font-bold`,children:`Markdown Report`}),(0,I.jsx)(`p`,{className:`text-sm text-muted-foreground`,children:`Report not found.`}),(0,I.jsx)(W,{asChild:!0,variant:`outline`,children:(0,I.jsx)(np,{to:`/markdown-reports`,children:`Back to Markdown Reports`})})]});let f=vpe(i);return(0,I.jsxs)(`div`,{className:`space-y-4`,children:[(0,I.jsxs)(`div`,{className:`flex flex-wrap items-center justify-between gap-2`,children:[(0,I.jsxs)(`div`,{className:`min-w-0`,children:[(0,I.jsx)(`h1`,{className:`font-mono text-xl font-semibold`,children:i.name}),(0,I.jsxs)(`div`,{className:`mt-0.5 flex flex-wrap items-center gap-2 text-xs text-muted-foreground`,children:[(0,I.jsx)(`span`,{className:`font-mono`,children:i.relativePath}),(0,I.jsx)(`span`,{"aria-hidden":!0,children:`·`}),(0,I.jsxs)(`span`,{className:`inline-flex items-center gap-1 align-middle`,children:[(0,I.jsx)(_n,{className:`h-3 w-3 shrink-0`}),new Date(i.mtime).toLocaleString()]}),(0,I.jsx)(`span`,{"aria-hidden":!0,children:`·`}),(0,I.jsx)(`span`,{children:_pe(i.sizeBytes)})]})]}),(0,I.jsxs)(`div`,{className:`flex items-center gap-2`,children:[f?(0,I.jsxs)(I.Fragment,{children:[(0,I.jsx)(W,{variant:`outline`,size:`sm`,onClick:()=>d(!0),children:`Open Result Panel`}),(0,I.jsx)(W,{asChild:!0,variant:`outline`,size:`sm`,children:(0,I.jsx)(np,{to:`/results/${encodeURIComponent(f)}`,children:`Open Result`})})]}):null,(0,I.jsx)(W,{asChild:!0,variant:`outline`,size:`sm`,children:(0,I.jsx)(np,{to:`/markdown-reports`,children:`Back to reports`})})]})]}),(0,I.jsx)(K,{children:(0,I.jsx)(q,{className:`pt-6`,children:(0,I.jsx)(A3,{text:i.content,variant:`assistant`})})}),f?(0,I.jsx)(eg,{open:u,onOpenChange:d,children:(0,I.jsxs)(ig,{side:`right`,className:`w-[96vw] max-w-none p-0 sm:max-w-5xl`,children:[(0,I.jsx)(ag,{className:`border-b px-4 py-3 pr-12`,children:(0,I.jsxs)(`div`,{className:`flex items-center justify-between gap-2`,children:[(0,I.jsxs)(og,{className:`text-base`,children:[`Result `,f]}),(0,I.jsx)(W,{asChild:!0,variant:`outline`,size:`sm`,children:(0,I.jsx)(np,{to:`/results/${encodeURIComponent(f)}`,target:`_blank`,rel:`noreferrer`,children:`Open full page`})})]})}),(0,I.jsx)(`div`,{className:`h-[calc(100vh-64px)]`,children:(0,I.jsx)(`iframe`,{title:`Result ${f}`,src:`/results/${encodeURIComponent(f)}?embed=1`,className:`h-full w-full border-0`})})]})}):null]})}var bpe=()=>{let e=Wd();return(0,_.useEffect)(()=>{console.error(`404 Error: User attempted to access non-existent route:`,e.pathname)},[e.pathname]),(0,I.jsx)(`div`,{className:`flex min-h-screen items-center justify-center bg-muted`,children:(0,I.jsxs)(`div`,{className:`text-center`,children:[(0,I.jsx)(`h1`,{className:`mb-4 text-4xl font-bold`,children:`404`}),(0,I.jsx)(`p`,{className:`mb-4 text-xl text-muted-foreground`,children:`Oops! Page not found`}),(0,I.jsx)(`a`,{href:`/`,className:`text-primary underline hover:text-primary/90`,children:`Return to Home`})]})})},xpe=new vu;function Spe(){let{scenarioId:e}=Zd();return(0,I.jsx)(df,{to:e?`/libraries/test-cases/${encodeURIComponent(e)}`:`/libraries/test-cases`,replace:!0})}function Cpe(){return(0,I.jsxs)(hf,{children:[(0,I.jsxs)(pf,{element:(0,I.jsx)(lv,{}),children:[(0,I.jsx)(pf,{path:`/`,element:(0,I.jsx)(LW,{})}),(0,I.jsx)(pf,{path:`/mcp-evaluations`,element:(0,I.jsx)(QY,{})}),(0,I.jsx)(pf,{path:`/mcp-evaluations/:id`,element:(0,I.jsx)(k6,{})}),(0,I.jsx)(pf,{path:`/mcp-evaluations/:id/:tab`,element:(0,I.jsx)(k6,{})}),(0,I.jsx)(pf,{path:`/tool-analysis`,element:(0,I.jsx)(afe,{})}),(0,I.jsx)(pf,{path:`/tool-analysis-results`,element:(0,I.jsx)(ofe,{})}),(0,I.jsx)(pf,{path:`/tool-analysis-results/:id`,element:(0,I.jsx)(sfe,{})}),(0,I.jsx)(pf,{path:`/oauth-debugger`,element:(0,I.jsx)(pfe,{})}),(0,I.jsx)(pf,{path:`/libraries/servers`,element:(0,I.jsx)(fue,{})}),(0,I.jsx)(pf,{path:`/libraries/servers/:serverId`,element:(0,I.jsx)(pue,{})}),(0,I.jsx)(pf,{path:`/libraries/agents`,element:(0,I.jsx)(mue,{defaultType:`llm`})}),(0,I.jsx)(pf,{path:`/libraries/agents/:agentName`,element:(0,I.jsx)(Ede,{})}),(0,I.jsx)(pf,{path:`/libraries/test-cases`,element:(0,I.jsx)(k5,{})}),(0,I.jsx)(pf,{path:`/libraries/test-cases/:testCaseId`,element:(0,I.jsx)(k5,{})}),(0,I.jsx)(pf,{path:`/libraries/scenarios`,element:(0,I.jsx)(df,{to:`/libraries/test-cases`,replace:!0})}),(0,I.jsx)(pf,{path:`/libraries/scenarios/:scenarioId`,element:(0,I.jsx)(Spe,{})}),(0,I.jsx)(pf,{path:`/settings`,element:(0,I.jsx)(Pde,{})}),(0,I.jsx)(pf,{path:`/settings/mcp`,element:(0,I.jsx)(Rde,{})}),(0,I.jsx)(pf,{path:`/run`,element:(0,I.jsx)(bfe,{})}),(0,I.jsx)(pf,{path:`/results`,element:(0,I.jsx)(Rfe,{})}),(0,I.jsx)(pf,{path:`/results/:id`,element:(0,I.jsx)(npe,{})}),(0,I.jsx)(pf,{path:`/markdown-reports`,element:(0,I.jsx)(gpe,{})}),(0,I.jsx)(pf,{path:`/markdown-reports/view`,element:(0,I.jsx)(ype,{})}),(0,I.jsx)(pf,{path:`/compare`,element:(0,I.jsx)(ppe,{})}),(0,I.jsx)(pf,{path:`/compare/results`,element:(0,I.jsx)(mpe,{})})]}),(0,I.jsx)(pf,{path:`*`,element:(0,I.jsx)(bpe,{})})]})}(0,g.createRoot)(document.getElementById(`root`)).render((0,I.jsx)(()=>(0,I.jsx)(bu,{client:xpe,children:(0,I.jsx)(gl,{children:(0,I.jsx)(tv,{children:(0,I.jsx)(mv,{children:(0,I.jsxs)(dv,{children:[(0,I.jsx)(ea,{}),(0,I.jsx)(Fa,{}),(0,I.jsx)(tp,{children:(0,I.jsx)(Cpe,{})})]})})})})}),{}));
|