@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.
Files changed (32) hide show
  1. package/dist/app/assets/index-CBxKXA35.js +267 -0
  2. package/dist/app/index.html +1 -1
  3. package/dist/app-server/evaluation-result-projection.d.ts.map +1 -1
  4. package/dist/app-server/evaluation-result-projection.js +5 -0
  5. package/dist/app-server/evaluation-result-projection.js.map +1 -1
  6. package/dist/app-server/inspectr-routes.d.ts +14 -0
  7. package/dist/app-server/inspectr-routes.d.ts.map +1 -0
  8. package/dist/app-server/inspectr-routes.js +35 -0
  9. package/dist/app-server/inspectr-routes.js.map +1 -0
  10. package/dist/app-server/inspectr-session-manager.d.ts +33 -34
  11. package/dist/app-server/inspectr-session-manager.d.ts.map +1 -1
  12. package/dist/app-server/inspectr-session-manager.js +70 -23
  13. package/dist/app-server/inspectr-session-manager.js.map +1 -1
  14. package/dist/app-server/router.d.ts.map +1 -1
  15. package/dist/app-server/router.js +32 -0
  16. package/dist/app-server/router.js.map +1 -1
  17. package/dist/app-server/run-queue-domain.d.ts +2 -0
  18. package/dist/app-server/run-queue-domain.d.ts.map +1 -1
  19. package/dist/app-server/run-queue-domain.js +2 -1
  20. package/dist/app-server/run-queue-domain.js.map +1 -1
  21. package/dist/app-server/run-queue-executor.d.ts +2 -0
  22. package/dist/app-server/run-queue-executor.d.ts.map +1 -1
  23. package/dist/app-server/run-queue-executor.js +67 -0
  24. package/dist/app-server/run-queue-executor.js.map +1 -1
  25. package/dist/app-server/runs-routes.d.ts +1 -0
  26. package/dist/app-server/runs-routes.d.ts.map +1 -1
  27. package/dist/app-server/runs-routes.js +1 -1
  28. package/dist/app-server/runs-routes.js.map +1 -1
  29. package/dist/cli.js +5 -0
  30. package/dist/cli.js.map +1 -1
  31. package/package.json +7 -4
  32. package/dist/app/assets/index-Cwogc_kk.js +0 -267
@@ -0,0 +1,267 @@
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 Lu(``,{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:Ru(t)}return Bu(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 Fu(){return Math.random().toString(36).substring(2,10)}function Iu(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 Lu(e,t,n=null,r,i){return{pathname:typeof e==`string`?e:e.pathname,search:``,hash:``,...typeof t==`string`?zu(t):t,state:n,key:t&&t.key||r||Fu(),mask:i}}function Ru({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 zu(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 Bu(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:Lu(h.location,e,t);n&&n(r,e),l=u()+1;let d=Iu(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:Lu(h.location,e,t);n&&n(r,e),l=u();let i=Iu(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 Vu(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 Vu(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:Ru(t);return i=i.replace(/ $/,`%20`),!n&&Ou.test(i)&&(i=r+i),new URL(i,r)}function Hu(e,t,n=`/`){return Uu(e,t,n,!1)}function Uu(e,t,n,r,i){let a=nd((typeof t==`string`?zu(t):t).pathname||`/`,n);if(a==null)return null;let o=i??Wu(e),s=null,c=td(a);for(let e=0;s==null&&e<o.length;++e)s=aee(o[e],c,r);return s}function Wu(e){let t=Gu(e);return qu(t),t}function Gu(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=ud([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}".`),Gu(e.children,t,u,l,o)),(e.path!=null||e.index)&&t.push({path:l,score:ree(l,e.index),routesMeta:u.map((e,t)=>{let[n,r]=ed(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 Ku(e.path))a(e,t,!0,n)}),t}function Ku(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=Ku(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 qu(e){e.sort((e,t)=>e.score===t.score?iee(e.routesMeta.map(e=>e.childrenIndex),t.routesMeta.map(e=>e.childrenIndex)):t.score-e.score)}var Ju=/^:[\w-]+$/,Yu=3,Xu=2,eee=1,tee=10,nee=-2,Zu=e=>e===`*`;function ree(e,t){let n=e.split(`/`),r=n.length;return n.some(Zu)&&(r+=nee),t&&(r+=Xu),n.filter(e=>!Zu(e)).reduce((e,t)=>e+(Ju.test(t)?Yu:t===``?eee:tee),r)}function iee(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 aee(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?$u(u,l,s.matcher,s.compiledParams):Qu(u,l),f=s.route;if(!d&&c&&n&&!r[r.length-1].route.index&&(d=Qu({path:s.relativePath,caseSensitive:s.caseSensitive,end:!1},l)),!d)return null;Object.assign(i,d.params),o.push({params:i,pathname:ud([a,d.pathname]),pathnameBase:fd(ud([a,d.pathnameBase])),route:f}),d.pathnameBase!==`/`&&(a=ud([a,d.pathnameBase]))}return o}function Qu(e,t){typeof e==`string`&&(e={path:e,caseSensitive:!1,end:!0});let[n,r]=ed(e.path,e.caseSensitive,e.end);return $u(e,t,n,r)}function $u(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 ed(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 td(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 nd(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 rd(e,t=`/`){let{pathname:n,search:r=``,hash:i=``}=typeof e==`string`?zu(e):e,a;return n?(n=ld(n),a=n.startsWith(`/`)?id(n.substring(1),`/`):id(n,t)):a=t,{pathname:a,search:pd(r),hash:md(i)}}function id(e,t){let n=dd(t).split(`/`);return e.split(`/`).forEach(e=>{e===`..`?n.length>1&&n.pop():e!==`.`&&n.push(e)}),n.length>1?n.join(`/`):`/`}function ad(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 od(e){return e.filter((e,t)=>t===0||e.route.path&&e.route.path.length>0)}function sd(e){let t=od(e);return t.map((e,n)=>n===t.length-1?e.pathname:e.pathnameBase)}function cd(e,t,n,r=!1){let i;typeof e==`string`?i=zu(e):(i={...e},Nu(!i.pathname||!i.pathname.includes(`?`),ad(`?`,`pathname`,`search`,i)),Nu(!i.pathname||!i.pathname.includes(`#`),ad(`#`,`pathname`,`hash`,i)),Nu(!i.search||!i.search.includes(`#`),ad(`#`,`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=rd(i,s),l=o&&o!==`/`&&o.endsWith(`/`),u=(a||o===`.`)&&n.endsWith(`/`);return!c.pathname.endsWith(`/`)&&(l||u)&&(c.pathname+=`/`),c}var ld=e=>e.replace(/[\\/]{2,}/g,`/`),ud=e=>ld(e.join(`/`)),dd=e=>e.replace(/\/+$/,``),fd=e=>dd(e).replace(/^\/*/,`/`),pd=e=>!e||e===`?`?``:e.startsWith(`?`)?e:`?`+e,md=e=>!e||e===`#`?``:e.startsWith(`#`)?e:`#`+e,hd=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 oee(e){return e!=null&&typeof e.status==`number`&&typeof e.statusText==`string`&&typeof e.internal==`boolean`&&`data`in e}function see(e){return ud(e.map(e=>e.route.path).filter(Boolean))||`/`}var gd=typeof window<`u`&&window.document!==void 0&&window.document.createElement!==void 0;function _d(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(gd)try{let e=new URL(window.location.href),r=Ou.test(n)?new URL(ku(n,e.protocol)):new URL(n),a=nd(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 vd=[`POST`,`PUT`,`PATCH`,`DELETE`];new Set(vd);var yd=[`GET`,...vd];new Set(yd);var bd=[`about:`,`blob:`,`chrome:`,`chrome-untrusted:`,`content:`,`data:`,`devtools:`,`file:`,`filesystem:`,`javascript:`];function xd(e){try{return bd.includes(new URL(e).protocol)}catch{return!1}}var Sd=_.createContext(null);Sd.displayName=`DataRouter`;var Cd=_.createContext(null);Cd.displayName=`DataRouterState`;var wd=_.createContext(!1);function Td(){return _.useContext(wd)}var Ed=_.createContext({isTransitioning:!1});Ed.displayName=`ViewTransition`;var Dd=_.createContext(new Map);Dd.displayName=`Fetchers`;var Od=_.createContext(null);Od.displayName=`Await`;var kd=_.createContext(null);kd.displayName=`Navigation`;var Ad=_.createContext(null);Ad.displayName=`Location`;var jd=_.createContext({outlet:null,matches:[],isDataRoute:!1});jd.displayName=`Route`;var Md=_.createContext(null);Md.displayName=`RouteError`;var Nd=`REACT_ROUTER_ERROR`,Pd=`REDIRECT`,Fd=`ROUTE_ERROR_RESPONSE`;function Id(e){if(e.startsWith(`${Nd}:${Pd}:{`))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 Ld(e){if(e.startsWith(`${Nd}:${Fd}:{`))try{let t=JSON.parse(e.slice(40));if(typeof t==`object`&&t&&typeof t.status==`number`&&typeof t.statusText==`string`)return new hd(t.status,t.statusText,t.data)}catch{}}function Rd(e,{relative:t}={}){Nu(zd(),`useHref() may be used only in the context of a <Router> component.`);let{basename:n,navigator:r}=_.useContext(kd),{hash:i,pathname:a,search:o}=Gd(e,{relative:t}),s=a;return n!==`/`&&(s=a===`/`?n:ud([n,a])),r.createHref({pathname:s,search:o,hash:i})}function zd(){return _.useContext(Ad)!=null}function Bd(){return Nu(zd(),`useLocation() may be used only in the context of a <Router> component.`),_.useContext(Ad).location}var Vd=`You should call navigate() in a React.useEffect(), not when your component is first rendered.`;function Hd(e){_.useContext(kd).static||_.useLayoutEffect(e)}function Ud(){let{isDataRoute:e}=_.useContext(jd);return e?rf():cee()}function cee(){Nu(zd(),`useNavigate() may be used only in the context of a <Router> component.`);let e=_.useContext(Sd),{basename:t,navigator:n}=_.useContext(kd),{matches:r}=_.useContext(jd),{pathname:i}=Bd(),a=JSON.stringify(sd(r)),o=_.useRef(!1);return Hd(()=>{o.current=!0}),_.useCallback((r,s={})=>{if(Pu(o.current,Vd),!o.current)return;if(typeof r==`number`){n.go(r);return}let c=cd(r,JSON.parse(a),i,s.relative===`path`);e==null&&t!==`/`&&(c.pathname=c.pathname===`/`?t:ud([t,c.pathname])),(s.replace?n.replace:n.push)(c,s.state,s)},[t,n,a,i,e])}var lee=_.createContext(null);function uee(e){let t=_.useContext(jd).outlet;return _.useMemo(()=>t&&_.createElement(lee.Provider,{value:e},t),[t,e])}function Wd(){let{matches:e}=_.useContext(jd);return e[e.length-1]?.params??{}}function Gd(e,{relative:t}={}){let{matches:n}=_.useContext(jd),{pathname:r}=Bd(),i=JSON.stringify(sd(n));return _.useMemo(()=>cd(e,JSON.parse(i),r,t===`path`),[e,i,r,t])}function dee(e,t){return Kd(e,t)}function Kd(e,t,n){Nu(zd(),`useRoutes() may be used only in the context of a <Router> component.`);let{navigator:r}=_.useContext(kd),{matches:i}=_.useContext(jd),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||``;of(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=Bd(),d;if(t){let e=typeof t==`string`?zu(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})):Hu(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=Yd(m&&m.map(e=>Object.assign({},e,{params:Object.assign({},o,e.params),pathname:ud([c,r.encodeLocation?r.encodeLocation(e.pathname.replace(/%/g,`%25`).replace(/\?/g,`%3F`).replace(/#/g,`%23`)).pathname:e.pathname]),pathnameBase:e.pathnameBase===`/`?c:ud([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(Ad.Provider,{value:{location:{pathname:`/`,search:``,hash:``,state:null,key:`default`,mask:void 0,...d},navigationType:`POP`}},h):h}function fee(){let e=nf(),t=oee(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 pee=_.createElement(fee,null),qd=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=Ld(e.digest);t&&(e=t)}let t=e===void 0?this.props.children:_.createElement(jd.Provider,{value:this.props.routeContext},_.createElement(Md.Provider,{value:e,children:this.props.component}));return this.context?_.createElement(mee,{error:e},t):t}};qd.contextType=wd;var Jd=new WeakMap;function mee({children:e,error:t}){let{basename:n}=_.useContext(kd);if(typeof t==`object`&&t&&`digest`in t&&typeof t.digest==`string`){let e=Id(t.digest);if(e){let r=Jd.get(t);if(r)throw r;let i=_d(e.location,n),a=i.absoluteURL||i.to;if(xd(a))throw Error(`Invalid redirect location`);if(gd&&!Jd.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 Jd.set(t,n),n}}return _.createElement(`meta`,{httpEquiv:`refresh`,content:`0;url=${a}`})}}return e}function hee({routeContext:e,match:t,children:n}){let r=_.useContext(Sd);return r&&r.static&&r.staticContext&&(t.route.errorElement||t.route.ErrorBoundary)&&(r.staticContext._deepestRenderedBoundaryId=t.route.id),_.createElement(jd.Provider,{value:e},n)}function Yd(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:see(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||pee,o&&(s<0&&c===0?(of(`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(hee,{match:n,routeContext:{outlet:e,matches:m,isDataRoute:r!=null},children:t})};return r&&(n.route.ErrorBoundary||n.route.errorElement||c===0)?_.createElement(qd,{location:r.location,revalidation:r.revalidation,component:f,error:u,children:h(),routeContext:{outlet:null,matches:m,isDataRoute:!0},onError:l}):h()},null)}function Xd(e){return`${e} must be used within a data router. See https://reactrouter.com/en/main/routers/picking-a-router.`}function Zd(e){let t=_.useContext(Sd);return Nu(t,Xd(e)),t}function Qd(e){let t=_.useContext(Cd);return Nu(t,Xd(e)),t}function $d(e){let t=_.useContext(jd);return Nu(t,Xd(e)),t}function ef(e){let t=$d(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 tf(){return ef(`useRouteId`)}function nf(){let e=_.useContext(Md),t=Qd(`useRouteError`),n=ef(`useRouteError`);return e===void 0?t.errors?.[n]:e}function rf(){let{router:e}=Zd(`useNavigate`),t=ef(`useNavigate`),n=_.useRef(!1);return Hd(()=>{n.current=!0}),_.useCallback(async(r,i={})=>{Pu(n.current,Vd),n.current&&(typeof r==`number`?await e.navigate(r):await e.navigate(r,{fromRouteId:t,...i}))},[e,t])}var af={};function of(e,t,n){!t&&!af[e]&&(af[e]=!0,Pu(!1,n))}_.memo(sf);function sf({routes:e,manifest:t,future:n,state:r,isStatic:i,onError:a}){return Kd(e,void 0,{manifest:t,state:r,isStatic:i,onError:a,future:n})}function cf({to:e,replace:t,state:n,relative:r}){Nu(zd(),`<Navigate> may be used only in the context of a <Router> component.`);let{static:i}=_.useContext(kd);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(jd),{pathname:o}=Bd(),s=Ud(),c=cd(e,sd(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 lf(e){return uee(e.context)}function uf(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 df({basename:e=`/`,children:t=null,location:n,navigationType:r=`POP`,navigator:i,static:a=!1,useTransitions:o}){Nu(!zd(),`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=zu(n));let{pathname:l=`/`,search:u=``,hash:d=``,state:f=null,key:p=`default`,mask:m}=n,h=_.useMemo(()=>{let e=nd(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(kd.Provider,{value:c},_.createElement(Ad.Provider,{children:t,value:h}))}function ff({children:e,location:t}){return dee(pf(e),t)}_.Component;function pf(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,pf(e.props.children,i));return}Nu(e.type===uf,`[${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=pf(e.props.children,i)),n.push(a)}),n}var mf=`get`,hf=`application/x-www-form-urlencoded`;function gf(e){return typeof HTMLElement<`u`&&e instanceof HTMLElement}function _f(e){return gf(e)&&e.tagName.toLowerCase()===`button`}function vf(e){return gf(e)&&e.tagName.toLowerCase()===`form`}function yf(e){return gf(e)&&e.tagName.toLowerCase()===`input`}function bf(e){return!!(e.metaKey||e.altKey||e.ctrlKey||e.shiftKey)}function xf(e,t){return e.button===0&&(!t||t===`_self`)&&!bf(e)}function Sf(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 Cf(e,t){let n=Sf(e);return t&&t.forEach((e,r)=>{n.has(r)||t.getAll(r).forEach(e=>{n.append(r,e)})}),n}var wf=null;function Tf(){if(wf===null)try{new FormData(document.createElement(`form`),0),wf=!1}catch{wf=!0}return wf}var Ef=new Set([`application/x-www-form-urlencoded`,`multipart/form-data`,`text/plain`]);function Df(e){return e!=null&&!Ef.has(e)?(Pu(!1,`"${e}" is not a valid \`encType\` for \`<Form>\`/\`<fetcher.Form>\` and will default to "${hf}"`),null):e}function Of(e,t){let n,r,i,a,o;if(vf(e)){let o=e.getAttribute(`action`);r=o?nd(o,t):null,n=e.getAttribute(`method`)||mf,i=Df(e.getAttribute(`enctype`))||hf,a=new FormData(e)}else if(_f(e)||yf(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?nd(s,t):null,n=e.getAttribute(`formmethod`)||o.getAttribute(`method`)||mf,i=Df(e.getAttribute(`formenctype`))||Df(o.getAttribute(`enctype`))||hf,a=new FormData(o,e),!Tf()){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(gf(e))throw Error(`Cannot submit element that is not <form>, <button>, or <input type="submit|image">`);else n=mf,r=null,i=hf,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 kf(e,t){if(e===!1||e==null)throw Error(t)}function Af(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&&nd(i.pathname,t)===`/`?`${dd(t)}/_root.${r}`:`${dd(i.pathname)}.${r}`,i}async function jf(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 Mf(e){return e!=null&&typeof e.page==`string`}function Nf(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 Pf(e,t,n){return zf((await Promise.all(e.map(async e=>{let r=t.routes[e.route.id];if(r){let e=await jf(r,n);return e.links?e.links():[]}return[]}))).flat(1).filter(Nf).filter(e=>e.rel===`stylesheet`||e.rel===`preload`).map(e=>e.rel===`stylesheet`?{...e,rel:`prefetch`,as:`style`}:{...e,rel:`prefetch`}))}function Ff(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 If(e,t,{includeHydrateFallback:n}={}){return Lf(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 Lf(e){return[...new Set(e)]}function Rf(e){let t={},n=Object.keys(e).sort();for(let r of n)t[r]=e[r];return t}function zf(e,t){let n=new Set,r=new Set(t);return e.reduce((e,i)=>{if(t&&!Mf(i)&&i.as===`script`&&i.href&&r.has(i.href))return e;let a=JSON.stringify(Rf(i));return n.has(a)||(n.add(a),e.push({key:a,link:i})),e},[])}function Bf(){let e=_.useContext(Sd);return kf(e,`You must render this element inside a <DataRouterContext.Provider> element`),e}function Vf(){let e=_.useContext(Cd);return kf(e,`You must render this element inside a <DataRouterStateContext.Provider> element`),e}var Hf=_.createContext(void 0);Hf.displayName=`FrameworkContext`;function Uf(){let e=_.useContext(Hf);return kf(e,`You must render this element inside a <HydratedRouter> element`),e}function Wf(e,t){let n=_.useContext(Hf),[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:Gf(s,p),onBlur:Gf(c,m),onMouseEnter:Gf(l,p),onMouseLeave:Gf(u,m),onTouchStart:Gf(d,p)}]:[a,f,{}]:[!1,f,{}]}function Gf(e,t){return n=>{e&&e(n),n.defaultPrevented||t(n)}}function Kf({page:e,...t}){let n=Td(),{nonce:r}=Uf(),{router:i}=Bf(),a=_.useMemo(()=>Hu(i.routes,e,i.basename),[i.routes,e,i.basename]);return a?(t.nonce==null&&r&&(t={...t,nonce:r}),n?_.createElement(Jf,{page:e,matches:a,...t}):_.createElement(Yf,{page:e,matches:a,...t})):null}function qf(e){let{manifest:t,routeModules:n}=Uf(),[r,i]=_.useState([]);return _.useEffect(()=>{let r=!1;return Pf(e,t,n).then(e=>{r||i(e)}),()=>{r=!0}},[e,t,n]),r}function Jf({page:e,matches:t,...n}){let r=Bd(),{future:i}=Uf(),{basename:a}=Bf(),o=_.useMemo(()=>{if(e===r.pathname+r.search+r.hash)return[];let n=Af(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 Yf({page:e,matches:t,...n}){let r=Bd(),{future:i,manifest:a,routeModules:o}=Uf(),{basename:s}=Bf(),{loaderData:c,matches:l}=Vf(),u=_.useMemo(()=>Ff(e,t,l,a,r,`data`),[e,t,l,a,r]),d=_.useMemo(()=>Ff(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=Af(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(()=>If(d,a),[d,a]),m=qf(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 Xf(...e){return t=>{e.forEach(e=>{typeof e==`function`?e(t):e!=null&&(e.current=t)})}}_.Component;var Zf=typeof window<`u`&&window.document!==void 0&&window.document.createElement!==void 0;try{Zf&&(window.__reactRouterVersion=`7.18.2`)}catch{}function Qf({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(df,{basename:e,children:t,location:o.location,navigationType:o.action,navigator:a,useTransitions:n})}var $f=_.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(kd),y=typeof l==`string`&&Du.test(l),b=_d(l,h);l=b.to;let x=Rd(l,{relative:r}),S=Bd(),C=null;if(o){let e=cd(o,[],S.mask?S.mask.pathname:`/`,!0);h!==`/`&&(e.pathname=e.pathname===`/`?h:ud([h,e.pathname])),C=g.createHref(e)}let[w,T,E]=Wf(n,p),D=ip(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:Xf(m,T),target:c,"data-discover":!y&&t===`render`?`true`:void 0});return w&&!y?_.createElement(_.Fragment,null,A,_.createElement(Kf,{page:x})):A});$f.displayName=`Link`;var ep=_.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=Gd(a,{relative:c.relative}),d=Bd(),f=_.useContext(Cd),{navigator:p,basename:m}=_.useContext(kd),h=f!=null&&up(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=nd(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($f,{...c,"aria-current":w,className:T,ref:l,style:E,to:a,viewTransition:o},typeof s==`function`?s(C):s)});ep.displayName=`NavLink`;var tp=_.forwardRef(({discover:e=`render`,fetcherKey:t,navigate:n,reloadDocument:r,replace:i,state:a,method:o=mf,action:s,onSubmit:c,relative:l,preventScrollReset:u,viewTransition:d,defaultShouldRevalidate:f,...p},m)=>{let{useTransitions:h}=_.useContext(kd),g=cp(),v=lp(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})});tp.displayName=`Form`;function np(e){return`${e} must be used within a data router. See https://reactrouter.com/en/main/routers/picking-a-router.`}function rp(e){let t=_.useContext(Sd);return Nu(t,np(e)),t}function ip(e,{target:t,replace:n,mask:r,state:i,preventScrollReset:a,relative:o,viewTransition:s,defaultShouldRevalidate:c,useTransitions:l}={}){let u=Ud(),d=Bd(),f=Gd(e,{relative:o});return _.useCallback(p=>{if(xf(p,t)){p.preventDefault();let t=n===void 0?Ru(d)===Ru(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 ap(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(Sf(e)),n=_.useRef(!1),r=Bd(),i=_.useMemo(()=>Cf(r.search,n.current?null:t.current),[r.search]),a=Ud();return[i,_.useCallback((e,t)=>{let r=Sf(typeof e==`function`?e(new URLSearchParams(i)):e);n.current=!0,a(`?`+r,t)},[a,i])]}var op=0,sp=()=>`__${String(++op)}__`;function cp(){let{router:e}=rp(`useSubmit`),{basename:t}=_.useContext(kd),n=tf(),r=e.fetch,i=e.navigate;return _.useCallback(async(e,a={})=>{let{action:o,method:s,encType:c,formData:l,body:u}=Of(e,t);if(a.navigate===!1){let e=a.fetcherKey||sp();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 lp(e,{relative:t}={}){let{basename:n}=_.useContext(kd),r=_.useContext(jd);Nu(r,`useFormAction must be used inside a RouteContext`);let[i]=r.matches.slice(-1),a={...Gd(e||`.`,{relative:t})},o=Bd();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:ud([n,a.pathname])),Ru(a)}function up(e,{relative:t}={}){let n=_.useContext(Ed);Nu(n!=null,"`useViewTransitionState` must be used within `react-router-dom`'s `RouterProvider`. Did you accidentally import `RouterProvider` from `react-router`?");let{basename:r}=rp(`useViewTransitionState`),i=Gd(e,{relative:t});if(!n.isTransitioning)return!1;let a=nd(n.currentLocation.pathname,r)||n.currentLocation.pathname,o=nd(n.nextLocation.pathname,r)||n.nextLocation.pathname;return Qu(i.pathname,o)!=null||Qu(i.pathname,a)!=null}var dp=Symbol.for(`react.lazy`),fp=_.use;function pp(e){return typeof e==`object`&&!!e&&`then`in e}function mp(e){return typeof e==`object`&&!!e&&`$$typeof`in e&&e.$$typeof===dp&&`_payload`in e&&pp(e._payload)}function hp(e){let t=_p(e),n=_.forwardRef((e,n)=>{let{children:r,...i}=e;mp(r)&&typeof fp==`function`&&(r=fp(r._payload));let a=_.Children.toArray(r),o=a.find(yp);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 gp=hp(`Slot`);function _p(e){let t=_.forwardRef((e,t)=>{let{children:n,...r}=e;if(mp(n)&&typeof fp==`function`&&(n=fp(n._payload)),_.isValidElement(n)){let e=xp(n),i=bp(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 vp=Symbol(`radix.slottable`);function yp(e){return _.isValidElement(e)&&typeof e.type==`function`&&`__radixId`in e.type&&e.type.__radixId===vp}function bp(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 xp(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 Sp=768;function Cp(){let[e,t]=_.useState(void 0);return _.useEffect(()=>{let e=window.matchMedia(`(max-width: 767px)`),n=()=>{t(window.innerWidth<Sp)};return e.addEventListener(`change`,n),t(window.innerWidth<Sp),()=>e.removeEventListener(`change`,n)},[]),!!e}var wp=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?gp:`button`,{className:U(wp({variant:t,size:n,className:e})),ref:a,...i}));W.displayName=`Button`;var Tp=_.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}));Tp.displayName=`Input`;var Ep=[`a`,`button`,`div`,`form`,`h2`,`h3`,`img`,`input`,`label`,`li`,`nav`,`ol`,`p`,`select`,`span`,`svg`,`ul`].reduce((e,t)=>{let n=hp(`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}},{}),Dp=`Separator`,Op=`horizontal`,kp=[`horizontal`,`vertical`],Ap=_.forwardRef((e,t)=>{let{decorative:n,orientation:r=Op,...i}=e,a=jp(r)?r:Op,o=n?{role:`none`}:{"aria-orientation":a===`vertical`?a:void 0,role:`separator`};return(0,I.jsx)(Ep.div,{"data-orientation":a,...o,...i,ref:t})});Ap.displayName=Dp;function jp(e){return kp.includes(e)}var Mp=Ap,Np=_.forwardRef(({className:e,orientation:t=`horizontal`,decorative:n=!0,...r},i)=>(0,I.jsx)(Mp,{ref:i,decorative:n,orientation:t,className:U(`shrink-0 bg-border`,t===`horizontal`?`h-px w-full`:`h-full w-px`,e),...r}));Np.displayName=Mp.displayName;var Pp=`focusScope.autoFocusOnMount`,Fp=`focusScope.autoFocusOnUnmount`,Ip={bubbles:!1,cancelable:!0},Lp=`FocusScope`,Rp=_.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:Up(d.current,{select:!0})},t=function(e){if(p.paused||!s)return;let t=e.relatedTarget;t!==null&&(s.contains(t)||Up(d.current,{select:!0}))},n=function(e){if(document.activeElement===document.body)for(let t of e)t.removedNodes.length>0&&Up(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){Wp.add(p);let e=document.activeElement;if(!s.contains(e)){let t=new CustomEvent(Pp,Ip);s.addEventListener(Pp,l),s.dispatchEvent(t),t.defaultPrevented||(zp(yee(Vp(s)),{select:!0}),document.activeElement===e&&Up(s))}return()=>{s.removeEventListener(Pp,l),setTimeout(()=>{let t=new CustomEvent(Fp,Ip);s.addEventListener(Fp,u),s.dispatchEvent(t),t.defaultPrevented||Up(e??document.body,{select:!0}),s.removeEventListener(Fp,u),Wp.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]=Bp(t);r&&a?!e.shiftKey&&i===a?(e.preventDefault(),n&&Up(r,{select:!0})):e.shiftKey&&i===r&&(e.preventDefault(),n&&Up(a,{select:!0})):i===t&&e.preventDefault()}},[n,r,p.paused]);return(0,I.jsx)(V.div,{tabIndex:-1,...o,ref:f,onKeyDown:m})});Rp.displayName=Lp;function zp(e,{select:t=!1}={}){let n=document.activeElement;for(let r of e)if(Up(r,{select:t}),document.activeElement!==n)return}function Bp(e){let t=Vp(e);return[Hp(t,e),Hp(t.reverse(),e)]}function Vp(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 Hp(e,t){for(let n of e)if(!gee(n,{upTo:t}))return n}function gee(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 _ee(e){return e instanceof HTMLInputElement&&`select`in e}function Up(e,{select:t=!1}={}){if(e&&e.focus){let n=document.activeElement;e.focus({preventScroll:!0}),e!==n&&_ee(e)&&t&&e.select()}}var Wp=vee();function vee(){let e=[];return{add(t){let n=e[0];t!==n&&n?.pause(),e=Gp(e,t),e.unshift(t)},remove(t){e=Gp(e,t),e[0]?.resume()}}}function Gp(e,t){let n=[...e],r=n.indexOf(t);return r!==-1&&n.splice(r,1),n}function yee(e){return e.filter(e=>e.tagName!==`A`)}var Kp=0;function qp(){_.useEffect(()=>{let e=document.querySelectorAll(`[data-radix-focus-guard]`);return document.body.insertAdjacentElement(`afterbegin`,e[0]??Jp()),document.body.insertAdjacentElement(`beforeend`,e[1]??Jp()),Kp++,()=>{Kp===1&&document.querySelectorAll(`[data-radix-focus-guard]`).forEach(e=>e.remove()),Kp--}},[])}function Jp(){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 Yp=function(){return Yp=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},Yp.apply(this,arguments)};function Xp(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 bee(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 Zp=`right-scroll-bar-position`,Qp=`width-before-scroll-bar`,xee=`with-scroll-bars-hidden`,See=`--removed-body-scroll-bar-size`;function $p(e,t){return typeof e==`function`?e(t):e&&(e.current=t),e}function Cee(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 wee=typeof window<`u`?_.useLayoutEffect:_.useEffect,em=new WeakMap;function Tee(e,t){var n=Cee(t||null,function(t){return e.forEach(function(e){return $p(e,t)})});return wee(function(){var t=em.get(n);if(t){var r=new Set(t),i=new Set(e),a=n.current;r.forEach(function(e){i.has(e)||$p(e,null)}),i.forEach(function(e){r.has(e)||$p(e,a)})}em.set(n,e)},[e]),n}function Eee(e){return e}function Dee(e,t){t===void 0&&(t=Eee);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 Oee(e){e===void 0&&(e={});var t=Dee(null);return t.options=Yp({async:!0,ssr:!1},e),t}var tm=function(e){var t=e.sideCar,n=Xp(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,Yp({},n))};tm.isSideCarExport=!0;function kee(e,t){return e.useMedium(t),tm}var nm=Oee(),rm=function(){},im=_.forwardRef(function(e,t){var n=_.useRef(null),r=_.useState({onScrollCapture:rm,onWheelCapture:rm,onTouchMoveCapture:rm}),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=Xp(e,[`forwardProps`,`children`,`className`,`removeScrollBar`,`enabled`,`shards`,`sideCar`,`noRelative`,`noIsolation`,`inert`,`allowPinchZoom`,`as`,`gapMode`]),S=f,C=Tee([n,t]),w=Yp(Yp({},x),i);return _.createElement(_.Fragment,null,u&&_.createElement(S,{sideCar:nm,removeScrollBar:l,shards:d,noRelative:p,noIsolation:m,inert:h,setCallbacks:a,allowPinchZoom:!!g,lockRef:n,gapMode:b}),o?_.cloneElement(_.Children.only(s),Yp(Yp({},w),{ref:C})):_.createElement(y,Yp({},w,{className:c,ref:C}),s))});im.defaultProps={enabled:!0,removeScrollBar:!0,inert:!1},im.classNames={fullWidth:Qp,zeroRight:Zp};var am=function(){if(typeof __webpack_nonce__<`u`)return __webpack_nonce__};function om(){if(!document)return null;var e=document.createElement(`style`);e.type=`text/css`;var t=am();return t&&e.setAttribute(`nonce`,t),e}function sm(e,t){e.styleSheet?e.styleSheet.cssText=t:e.appendChild(document.createTextNode(t))}function Aee(e){(document.head||document.getElementsByTagName(`head`)[0]).appendChild(e)}var jee=function(){var e=0,t=null;return{add:function(n){e==0&&(t=om())&&(sm(t,n),Aee(t)),e++},remove:function(){e--,!e&&t&&(t.parentNode&&t.parentNode.removeChild(t),t=null)}}},cm=function(){var e=jee();return function(t,n){_.useEffect(function(){return e.add(t),function(){e.remove()}},[t&&n])}},lm=function(){var e=cm();return function(t){var n=t.styles,r=t.dynamic;return e(n,r),null}},um={left:0,top:0,right:0,gap:0},dm=function(e){return parseInt(e||``,10)||0},fm=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[dm(n),dm(r),dm(i)]},pm=function(e){if(e===void 0&&(e=`margin`),typeof window>`u`)return um;var t=fm(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])}},mm=lm(),hm=`data-scroll-locked`,gm=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
+ .${xee} {
13
+ overflow: hidden ${r};
14
+ padding-right: ${s}px ${r};
15
+ }
16
+ body[${hm}] {
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
+ .${Zp} {
30
+ right: ${s}px ${r};
31
+ }
32
+
33
+ .${Qp} {
34
+ margin-right: ${s}px ${r};
35
+ }
36
+
37
+ .${Zp} .${Zp} {
38
+ right: 0 ${r};
39
+ }
40
+
41
+ .${Qp} .${Qp} {
42
+ margin-right: 0 ${r};
43
+ }
44
+
45
+ body[${hm}] {
46
+ ${See}: ${s}px;
47
+ }
48
+ `},_m=function(){var e=parseInt(document.body.getAttribute(`data-scroll-locked`)||`0`,10);return isFinite(e)?e:0},vm=function(){_.useEffect(function(){return document.body.setAttribute(hm,(_m()+1).toString()),function(){var e=_m()-1;e<=0?document.body.removeAttribute(hm):document.body.setAttribute(hm,e.toString())}},[])},ym=function(e){var t=e.noRelative,n=e.noImportant,r=e.gapMode,i=r===void 0?`margin`:r;vm();var a=_.useMemo(function(){return pm(i)},[i]);return _.createElement(mm,{styles:gm(a,!t,i,n?``:`!important`)})},bm=!1;if(typeof window<`u`)try{var xm=Object.defineProperty({},"passive",{get:function(){return bm=!0,!0}});window.addEventListener(`test`,xm,xm),window.removeEventListener(`test`,xm,xm)}catch{bm=!1}var Sm=bm?{passive:!1}:!1,Mee=function(e){return e.tagName===`TEXTAREA`},Cm=function(e,t){if(!(e instanceof Element))return!1;var n=window.getComputedStyle(e);return n[t]!==`hidden`&&!(n.overflowY===n.overflowX&&!Mee(e)&&n[t]===`visible`)},Nee=function(e){return Cm(e,`overflowY`)},wm=function(e){return Cm(e,`overflowX`)},Tm=function(e,t){var n=t.ownerDocument,r=t;do{if(typeof ShadowRoot<`u`&&r instanceof ShadowRoot&&(r=r.host),Om(e,r)){var i=km(e,r);if(i[1]>i[2])return!0}r=r.parentNode}while(r&&r!==n.body);return!1},Em=function(e){return[e.scrollTop,e.scrollHeight,e.clientHeight]},Dm=function(e){return[e.scrollLeft,e.scrollWidth,e.clientWidth]},Om=function(e,t){return e===`v`?Nee(t):wm(t)},km=function(e,t){return e===`v`?Em(t):Dm(t)},Am=function(e,t){return e===`h`&&t===`rtl`?-1:1},jm=function(e,t,n,r,i){var a=Am(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=km(e,s),m=p[0],h=p[1]-p[2]-a*m;(m||h)&&Om(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},Mm=function(e){return`changedTouches`in e?[e.changedTouches[0].clientX,e.changedTouches[0].clientY]:[0,0]},Nm=function(e){return[e.deltaX,e.deltaY]},Pm=function(e){return e&&`current`in e?e.current:e},Fm=function(e,t){return e[0]===t[0]&&e[1]===t[1]},Im=function(e){return`
49
+ .block-interactivity-${e} {pointer-events: none;}
50
+ .allow-interactivity-${e} {pointer-events: all;}
51
+ `},Lm=0,Rm=[];function zm(e){var t=_.useRef([]),n=_.useRef([0,0]),r=_.useRef(),i=_.useState(Lm++)[0],a=_.useState(lm)[0],o=_.useRef(e);_.useEffect(function(){o.current=e},[e]),_.useEffect(function(){if(e.inert){document.body.classList.add(`block-interactivity-${i}`);var t=bee([e.lockRef.current],(e.shards||[]).map(Pm),!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=Mm(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=Tm(d,u);if(!m)return!0;if(m?l=d:(l=d===`v`?`h`:`v`,m=Tm(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 jm(h,t,e,h===`h`?s:c,!0)},[]),c=_.useCallback(function(e){var n=e;if(Rm.length&&Rm[Rm.length-1]===a){var r=`deltaY`in n?Nm(n):Mm(n),i=t.current.filter(function(e){return e.name===n.type&&(e.target===n.target||n.target===e.shadowParent)&&Fm(e.delta,r)})[0];if(i&&i.should)n.cancelable&&n.preventDefault();else if(!i){var c=(o.current.shards||[]).map(Pm).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:Bm(r)};t.current.push(a),setTimeout(function(){t.current=t.current.filter(function(e){return e!==a})},1)},[]),u=_.useCallback(function(e){n.current=Mm(e),r.current=void 0},[]),d=_.useCallback(function(t){l(t.type,Nm(t),t.target,s(t,e.lockRef.current))},[]),f=_.useCallback(function(t){l(t.type,Mm(t),t.target,s(t,e.lockRef.current))},[]);_.useEffect(function(){return Rm.push(a),e.setCallbacks({onScrollCapture:d,onWheelCapture:d,onTouchMoveCapture:f}),document.addEventListener(`wheel`,c,Sm),document.addEventListener(`touchmove`,c,Sm),document.addEventListener(`touchstart`,u,Sm),function(){Rm=Rm.filter(function(e){return e!==a}),document.removeEventListener(`wheel`,c,Sm),document.removeEventListener(`touchmove`,c,Sm),document.removeEventListener(`touchstart`,u,Sm)}},[]);var p=e.removeScrollBar,m=e.inert;return _.createElement(_.Fragment,null,m?_.createElement(a,{styles:Im(i)}):null,p?_.createElement(ym,{noRelative:e.noRelative,gapMode:e.gapMode}):null)}function Bm(e){for(var t=null;e!==null;)e instanceof ShadowRoot&&(t=e.host,e=e.host),e=e.parentNode;return t}var Vm=kee(nm,zm),Hm=_.forwardRef(function(e,t){return _.createElement(im,Yp({},e,{ref:t,sideCar:Vm}))});Hm.classNames=im.classNames;var Um=function(e){return typeof document>`u`?null:(Array.isArray(e)?e[0]:e).ownerDocument.body},Wm=new WeakMap,Gm=new WeakMap,Km={},qm=0,Jm=function(e){return e&&(e.host||Jm(e.parentNode))},Ym=function(e,t){return t.map(function(t){if(e.contains(t))return t;var n=Jm(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})},Xm=function(e,t,n,r){var i=Ym(t,Array.isArray(e)?e:[e]);Km[n]||(Km[n]=new WeakMap);var a=Km[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=(Wm.get(e)||0)+1,l=(a.get(e)||0)+1;Wm.set(e,c),a.set(e,l),o.push(e),c===1&&i&&Gm.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(),qm++,function(){o.forEach(function(e){var t=Wm.get(e)-1,i=a.get(e)-1;Wm.set(e,t),a.set(e,i),t||(Gm.has(e)||e.removeAttribute(r),Gm.delete(e)),i||e.removeAttribute(n)}),qm--,qm||(Wm=new WeakMap,Wm=new WeakMap,Gm=new WeakMap,Km={})}},Zm=function(e,t,n){n===void 0&&(n=`data-aria-hidden`);var r=Array.from(Array.isArray(e)?e:[e]),i=t||Um(e);return i?(r.push.apply(r,Array.from(i.querySelectorAll(`[aria-live], script`))),Xm(r,i,n,`aria-hidden`)):function(){return null}};function Qm(e){let t=$m(e),n=_.forwardRef((e,n)=>{let{children:r,...i}=e,a=_.Children.toArray(r),o=a.find(th);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 $m(e){let t=_.forwardRef((e,t)=>{let{children:n,...r}=e;if(_.isValidElement(n)){let e=rh(n),i=nh(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 eh=Symbol(`radix.slottable`);function th(e){return _.isValidElement(e)&&typeof e.type==`function`&&`__radixId`in e.type&&e.type.__radixId===eh}function nh(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 rh(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 ih=`Dialog`,[ah,oh]=R(ih),[sh,ch]=ah(ih),lh=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:ih});return(0,I.jsx)(sh,{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})};lh.displayName=ih;var uh=`DialogTrigger`,dh=_.forwardRef((e,t)=>{let{__scopeDialog:n,...r}=e,i=ch(uh,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":Dh(i.open),...r,ref:a,onClick:j(e.onClick,i.onOpenToggle)})});dh.displayName=uh;var fh=`DialogPortal`,[ph,mh]=ah(fh,{forceMount:void 0}),hh=e=>{let{__scopeDialog:t,forceMount:n,children:r,container:i}=e,a=ch(fh,t);return(0,I.jsx)(ph,{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})}))})};hh.displayName=fh;var gh=`DialogOverlay`,_h=_.forwardRef((e,t)=>{let n=mh(gh,e.__scopeDialog),{forceMount:r=n.forceMount,...i}=e,a=ch(gh,e.__scopeDialog);return a.modal?(0,I.jsx)(Pe,{present:r||a.open,children:(0,I.jsx)(Fee,{...i,ref:t})}):null});_h.displayName=gh;var Pee=Qm(`DialogOverlay.RemoveScroll`),Fee=_.forwardRef((e,t)=>{let{__scopeDialog:n,...r}=e,i=ch(gh,n);return(0,I.jsx)(Hm,{as:Pee,allowPinchZoom:!0,shards:[i.contentRef],children:(0,I.jsx)(V.div,{"data-state":Dh(i.open),...r,ref:t,style:{pointerEvents:`auto`,...r.style}})})}),vh=`DialogContent`,yh=_.forwardRef((e,t)=>{let n=mh(vh,e.__scopeDialog),{forceMount:r=n.forceMount,...i}=e,a=ch(vh,e.__scopeDialog);return(0,I.jsx)(Pe,{present:r||a.open,children:a.modal?(0,I.jsx)(Iee,{...i,ref:t}):(0,I.jsx)(Lee,{...i,ref:t})})});yh.displayName=vh;var Iee=_.forwardRef((e,t)=>{let n=ch(vh,e.__scopeDialog),r=_.useRef(null),i=P(t,n.contentRef,r);return _.useEffect(()=>{let e=r.current;if(e)return Zm(e)},[]),(0,I.jsx)(bh,{...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())})}),Lee=_.forwardRef((e,t)=>{let n=ch(vh,e.__scopeDialog),r=_.useRef(!1),i=_.useRef(!1);return(0,I.jsx)(bh,{...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()}})}),bh=_.forwardRef((e,t)=>{let{__scopeDialog:n,trapFocus:r,onOpenAutoFocus:i,onCloseAutoFocus:a,...o}=e,s=ch(vh,n),c=_.useRef(null),l=P(t,c);return qp(),(0,I.jsxs)(I.Fragment,{children:[(0,I.jsx)(Rp,{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":Dh(s.open),...o,ref:l,onDismiss:()=>s.onOpenChange(!1)})}),(0,I.jsxs)(I.Fragment,{children:[(0,I.jsx)(zee,{titleId:s.titleId}),(0,I.jsx)(Vee,{contentRef:c,descriptionId:s.descriptionId})]})]})}),xh=`DialogTitle`,Sh=_.forwardRef((e,t)=>{let{__scopeDialog:n,...r}=e,i=ch(xh,n);return(0,I.jsx)(V.h2,{id:i.titleId,...r,ref:t})});Sh.displayName=xh;var Ch=`DialogDescription`,wh=_.forwardRef((e,t)=>{let{__scopeDialog:n,...r}=e,i=ch(Ch,n);return(0,I.jsx)(V.p,{id:i.descriptionId,...r,ref:t})});wh.displayName=Ch;var Th=`DialogClose`,Eh=_.forwardRef((e,t)=>{let{__scopeDialog:n,...r}=e,i=ch(Th,n);return(0,I.jsx)(V.button,{type:`button`,...r,ref:t,onClick:j(e.onClick,()=>i.onOpenChange(!1))})});Eh.displayName=Th;function Dh(e){return e?`open`:`closed`}var Oh=`DialogTitleWarning`,[Ree,kh]=L(Oh,{contentName:vh,titleName:xh,docsSlug:`dialog`}),zee=({titleId:e})=>{let t=kh(Oh),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},Bee=`DialogDescriptionWarning`,Vee=({contentRef:e,descriptionId:t})=>{let n=`Warning: Missing \`Description\` or \`aria-describedby={undefined}\` for {${kh(Bee).contentName}}.`;return _.useEffect(()=>{let r=e.current?.getAttribute(`aria-describedby`);t&&r&&(document.getElementById(t)||console.warn(n))},[n,e,t]),null},Ah=lh,jh=dh,Mh=hh,Nh=_h,Ph=yh,Fh=Sh,Ih=wh,Lh=Eh,Rh=Ah,zh=Mh,Bh=_.forwardRef(({className:e,...t},n)=>(0,I.jsx)(Nh,{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}));Bh.displayName=Nh.displayName;var Vh=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`}}),Hh=_.forwardRef(({side:e=`right`,className:t,children:n,...r},i)=>(0,I.jsxs)(zh,{children:[(0,I.jsx)(Bh,{}),(0,I.jsxs)(Ph,{ref:i,className:U(Vh({side:e}),t),...r,children:[n,(0,I.jsxs)(Lh,{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`})]})]})]}));Hh.displayName=Ph.displayName;var Uh=({className:e,...t})=>(0,I.jsx)(`div`,{className:U(`flex flex-col space-y-2 text-center sm:text-left`,e),...t});Uh.displayName=`SheetHeader`;var Wh=_.forwardRef(({className:e,...t},n)=>(0,I.jsx)(Fh,{ref:n,className:U(`text-lg font-semibold text-foreground`,e),...t}));Wh.displayName=Fh.displayName;var Gh=_.forwardRef(({className:e,...t},n)=>(0,I.jsx)(Ih,{ref:n,className:U(`text-sm text-muted-foreground`,e),...t}));Gh.displayName=Ih.displayName;function Kh({className:e,...t}){return(0,I.jsx)(`div`,{className:U(`animate-pulse rounded-md bg-muted`,e),...t})}var qh=`sidebar:state`,Jh=604800,Yh=`16rem`,Xh=`18rem`,Zh=`3rem`,Qh=`b`,$h=_.createContext(null);function eg(){let e=_.useContext($h);if(!e)throw Error(`useSidebar must be used within a SidebarProvider.`);return e}var tg=_.forwardRef(({defaultOpen:e=!0,open:t,onOpenChange:n,className:r,style:i,children:a,...o},s)=>{let c=Cp(),[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=`${qh}=${t}; path=/; max-age=${Jh}`},[n,p]),h=_.useCallback(()=>c?u(e=>!e):m(e=>!e),[c,m,u]);_.useEffect(()=>{let e=e=>{e.key===Qh&&(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)($h.Provider,{value:v,children:(0,I.jsx)(gl,{delayDuration:0,children:(0,I.jsx)(`div`,{style:{"--sidebar-width":Yh,"--sidebar-width-icon":Zh,...i},className:U(`group/sidebar-wrapper flex min-h-svh w-full has-data-[variant=inset]:bg-sidebar`,r),ref:s,...o,children:a})})})});tg.displayName=`SidebarProvider`;var ng=_.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}=eg();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)(Rh,{open:l,onOpenChange:u,...a,children:(0,I.jsx)(Hh,{"data-sidebar":`sidebar`,"data-mobile":`true`,className:`w-(--sidebar-width) bg-sidebar p-0 text-sidebar-foreground [&>button]:hidden`,style:{"--sidebar-width":Xh},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})})]})});ng.displayName=`Sidebar`;var rg=_.forwardRef(({className:e,onClick:t,...n},r)=>{let{toggleSidebar:i}=eg();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`})]})});rg.displayName=`SidebarTrigger`;var ig=_.forwardRef(({className:e,...t},n)=>{let{toggleSidebar:r}=eg();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})});ig.displayName=`SidebarRail`;var ag=_.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}));ag.displayName=`SidebarInset`;var og=_.forwardRef(({className:e,...t},n)=>(0,I.jsx)(Tp,{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}));og.displayName=`SidebarInput`;var sg=_.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}));sg.displayName=`SidebarHeader`;var cg=_.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}));cg.displayName=`SidebarFooter`;var lg=_.forwardRef(({className:e,...t},n)=>(0,I.jsx)(Np,{ref:n,"data-sidebar":`separator`,className:U(`mx-2 w-auto bg-sidebar-border`,e),...t}));lg.displayName=`SidebarSeparator`;var ug=_.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}));ug.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 fg=_.forwardRef(({className:e,asChild:t=!1,...n},r)=>(0,I.jsx)(t?gp:`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}));fg.displayName=`SidebarGroupLabel`;var pg=_.forwardRef(({className:e,asChild:t=!1,...n},r)=>(0,I.jsx)(t?gp:`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}));pg.displayName=`SidebarGroupAction`;var mg=_.forwardRef(({className:e,...t},n)=>(0,I.jsx)(`div`,{ref:n,"data-sidebar":`group-content`,className:U(`w-full text-sm`,e),...t}));mg.displayName=`SidebarGroupContent`;var hg=_.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}));hg.displayName=`SidebarMenu`;var gg=_.forwardRef(({className:e,...t},n)=>(0,I.jsx)(`li`,{ref:n,"data-sidebar":`menu-item`,className:U(`group/menu-item relative`,e),...t}));gg.displayName=`SidebarMenuItem`;var _g=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`}}),vg=_.forwardRef(({asChild:e=!1,isActive:t=!1,variant:n=`default`,size:r=`default`,tooltip:i,className:a,...o},s)=>{let c=e?gp:`button`,{isMobile:l,state:u}=eg(),d=(0,I.jsx)(c,{ref:s,"data-sidebar":`menu-button`,"data-size":r,"data-active":t,className:U(_g({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});vg.displayName=`SidebarMenuButton`;var yg=_.forwardRef(({className:e,asChild:t=!1,showOnHover:n=!1,...r},i)=>(0,I.jsx)(t?gp:`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}));yg.displayName=`SidebarMenuAction`;var bg=_.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}));bg.displayName=`SidebarMenuBadge`;var xg=_.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)(Kh,{className:`size-4 rounded-md`,"data-sidebar":`menu-skeleton-icon`}),(0,I.jsx)(Kh,{className:`h-4 max-w-(--skeleton-width) flex-1`,"data-sidebar":`menu-skeleton-text`,style:{"--skeleton-width":i}})]})});xg.displayName=`SidebarMenuSkeleton`;var Sg=_.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}));Sg.displayName=`SidebarMenuSub`;var Cg=_.forwardRef(({...e},t)=>(0,I.jsx)(`li`,{ref:t,...e}));Cg.displayName=`SidebarMenuSubItem`;var wg=_.forwardRef(({asChild:e=!1,size:t=`md`,isActive:n,className:r,...i},a)=>(0,I.jsx)(e?gp:`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}));wg.displayName=`SidebarMenuSubButton`;var Tg=(0,_.forwardRef)(({className:e,activeClassName:t,pendingClassName:n,to:r,...i},a)=>(0,I.jsx)(ep,{ref:a,to:r,className:({isActive:r,isPending:i})=>U(e,r&&t,i&&n),...i}));Tg.displayName=`NavLink`;function Eg({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 Dg(e){return(0,I.jsxs)(`svg`,{width:24,height:24,viewBox:`0 0 24 24`,fill:`currentColor`,fillRule:`evenodd`,"aria-hidden":`true`,focusable:`false`,xmlns:`http://www.w3.org/2000/svg`,...e,children:[(0,I.jsx)(`path`,{d:`M15.688 2.343a2.588 2.588 0 00-3.61 0l-9.626 9.44a.863.863 0 01-1.203 0 .823.823 0 010-1.18l9.626-9.44a4.313 4.313 0 016.016 0 4.116 4.116 0 011.204 3.54 4.3 4.3 0 013.609 1.18l.05.05a4.115 4.115 0 010 5.9l-8.706 8.537a.274.274 0 000 .393l1.788 1.754a.823.823 0 010 1.18.863.863 0 01-1.203 0l-1.788-1.753a1.92 1.92 0 010-2.754l8.706-8.538a2.47 2.47 0 000-3.54l-.05-.049a2.588 2.588 0 00-3.607-.003l-7.172 7.034-.002.002-.098.097a.863.863 0 01-1.204 0 .823.823 0 010-1.18l7.273-7.133a2.47 2.47 0 00-.003-3.537z`}),(0,I.jsx)(`path`,{d:`M14.485 4.703a.823.823 0 000-1.18.863.863 0 00-1.204 0l-7.119 6.982a4.115 4.115 0 000 5.9 4.314 4.314 0 006.016 0l7.12-6.982a.823.823 0 000-1.18.863.863 0 00-1.204 0l-7.119 6.982a2.588 2.588 0 01-3.61 0 2.47 2.47 0 010-3.54l7.12-6.982z`})]})}var Og=[{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:Dg},{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 kg(e={version:null}){let t=e.version??null,{state:n}=eg(),r=n===`collapsed`,i=Bd(),a=(0,_.useMemo)(()=>Og,[]);return(0,I.jsxs)(ng,{collapsible:`icon`,children:[(0,I.jsx)(sg,{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)(Eg,{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)(ug,{children:a.map((e,t)=>(0,I.jsxs)(`div`,{children:[t>0&&!r&&(0,I.jsx)(lg,{className:`my-1.5`}),(0,I.jsxs)(dg,{className:r?`px-2`:`px-3 py-2`,children:[!r&&(0,I.jsx)(fg,{className:`px-1 pb-1.5 text-[10px] font-semibold uppercase tracking-[0.08em] text-muted-foreground/90`,children:e.title}),(0,I.jsx)(mg,{children:(0,I.jsx)(hg,{children:e.items.map(e=>(0,I.jsx)(gg,{children:(0,I.jsx)(vg,{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)(Tg,{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)(cg,{className:r?`px-2 py-2`:`px-3 py-3`,children:[(0,I.jsx)(lg,{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 Ag({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 jg=_.forwardRef(({...e},t)=>(0,I.jsx)(`nav`,{ref:t,"aria-label":`breadcrumb`,...e}));jg.displayName=`Breadcrumb`;var Mg=_.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}));Mg.displayName=`BreadcrumbList`;var Ng=_.forwardRef(({className:e,...t},n)=>(0,I.jsx)(`li`,{ref:n,className:U(`inline-flex items-center gap-1.5`,e),...t}));Ng.displayName=`BreadcrumbItem`;var Pg=_.forwardRef(({asChild:e,className:t,...n},r)=>(0,I.jsx)(e?gp:`a`,{ref:r,className:U(`transition-colors hover:text-foreground`,t),...n}));Pg.displayName=`BreadcrumbLink`;var Fg=_.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}));Fg.displayName=`BreadcrumbPage`;var Ig=({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,{})});Ig.displayName=`BreadcrumbSeparator`;function Lg(){return{input:0,output:0,total:0,hasInput:!1,hasOutput:!1,hasTotal:!1}}function Rg(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 zg(e){return!e.hasInput&&!e.hasOutput&&!e.hasTotal?null:{inputTokens:e.hasInput?e.input:null,outputTokens:e.hasOutput?e.output:null,totalTokens:e.hasTotal?e.total:null}}function Bg(e){let t=Lg();for(let n of e)Rg(t,n);return zg(t)}var Vg={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 Hg(e){return e.startsWith(`image/`)?`image`:`document`}function Ug(e){return e?.split(`.`).pop()?.toLowerCase()??``}function Wg(e){if(e.media_type)return e.media_type;if(e.path)return Vg[Ug(e.path)]}function Gg(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 Kg={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.`}},qg={passThreshold:.9,failThreshold:.1,baseUrl:`http://localhost:11434`};function Jg(e){return e!=null&&e.enabled!==!1}function Yg(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(Kg,r))throw Error(`Choose a supported decision engine provider.`);let i=r,a=Kg[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?qg.passThreshold:t.passThreshold,c=t.failThreshold===void 0?qg.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()||qg.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 Xg=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)})}},Zg=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)})}},Qg=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)}}},$g=new Xg;Object.assign(Qg,{hooks:$g,plugins:new Zg(Qg),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`}),Qg.max_unop_len=Qg.getMaxKeyLen(Qg.unary_ops),Qg.max_binop_len=Qg.getMaxKeyLen(Qg.binary_ops);var e_=e=>new Qg(e).parse(),t_=Object.getOwnPropertyNames(class{});Object.getOwnPropertyNames(Qg).filter(e=>!t_.includes(e)&&e_[e]===void 0).forEach(e=>{e_[e]=Qg[e]}),e_.Jsep=Qg;var n_=`ConditionalExpression`;e_.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:n_,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 r_=47,i_=92,a_={name:`regex`,init(e){e.hooks.add(`gobble-token`,function(t){if(this.code===r_){let n=++this.index,r=!1;for(;this.index<this.expr.length;){if(this.code===r_&&!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===i_?2:1}this.throwError(`Unclosed Regex`)}})}},o_=43,s_={name:`assignment`,assignmentOperators:new Set([`=`,`*=`,`**=`,`/=`,`%=`,`+=`,`-=`,`<<=`,`>>=`,`>>>=`,`&=`,`^=`,`|=`,`||=`,`&&=`,`??=`]),updateOperators:[o_,45],assignmentPrecedence:.9,init(e){let t=[e.IDENTIFIER,e.MEMBER_EXP];s_.assignmentOperators.forEach(t=>e.addBinaryOp(t,s_.assignmentPrecedence,!0)),e.hooks.add(`gobble-token`,function(e){let n=this.code;s_.updateOperators.some(e=>e===n&&e===this.expr.charCodeAt(this.index+1))&&(this.index+=2,e.node={type:`UpdateExpression`,operator:n===o_?`++`:`--`,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;s_.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===o_?`++`:`--`,argument:e.node,prefix:!1})}}),e.hooks.add(`after-expression`,function(e){e.node&&n(e.node)});function n(e){s_.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)})}}};e_.plugins.register(a_,s_),e_.addUnaryOp(`typeof`),e_.addUnaryOp(`void`),e_.addLiteral(`null`,null),e_.addLiteral(`undefined`,void 0);var c_=new Set([`constructor`,`__proto__`,`__defineGetter__`,`__defineSetter__`,`__lookupGetter__`,`__lookupSetter__`]),l_={evalAst(e,t){switch(e.type){case`BinaryExpression`:case`LogicalExpression`:return l_.evalBinaryExpression(e,t);case`Compound`:return l_.evalCompound(e,t);case`ConditionalExpression`:return l_.evalConditionalExpression(e,t);case`Identifier`:return l_.evalIdentifier(e,t);case`Literal`:return l_.evalLiteral(e,t);case`MemberExpression`:return l_.evalMemberExpression(e,t);case`UnaryExpression`:return l_.evalUnaryExpression(e,t);case`ArrayExpression`:return l_.evalArrayExpression(e,t);case`CallExpression`:return l_.evalCallExpression(e,t);case`AssignmentExpression`:return l_.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](l_.evalAst(e.left,t),()=>l_.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=l_.evalAst(i,t)}return n},evalConditionalExpression(e,t){return l_.evalAst(e.test,t)?l_.evalAst(e.consequent,t):l_.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?l_.evalAst(e.property):e.property.name),r=l_.evalAst(e.object,t);if(r==null||!Object.hasOwn(r,n)&&c_.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=>-l_.evalAst(e,t),"!":e=>!l_.evalAst(e,t),"~":e=>~l_.evalAst(e,t),"+":e=>+l_.evalAst(e,t),typeof:e=>typeof l_.evalAst(e,t),void:e=>void l_.evalAst(e,t)}[e.operator](e.argument)},evalArrayExpression(e,t){return e.elements.map(e=>l_.evalAst(e,t))},evalCallExpression(e,t){let n=e.arguments.map(e=>l_.evalAst(e,t)),r=l_.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]=l_.evalAst(e.right,t),t[n]}},Hee=class{constructor(e){this.code=e,this.ast=e_(this.code)}runInNewContext(e){let t=Object.assign(Object.create(null),e);return l_.evalAst(this.ast,t)}};function u_(e,t){return e=e.slice(),e.push(t),e}function d_(e,t){return t=t.slice(),t.unshift(e),t}var Uee=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 f_(e,t,n,r,i){if(!(this instanceof f_))try{return new f_(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 Uee(i);return i}}f_.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=f_.toPathString(e)),!e&&e!==``||!t)return;let c=f_.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},f_.prototype._getPreferredOutput=function(e){let t=this.currResultType;switch(t){case`all`:{let t=Array.isArray(e.path)?e.path:f_.toPathArray(e.path);return e.pointer=f_.toPointer(t),e.path=typeof e.path==`string`?e.path:f_.toPathString(e.path),e}case`value`:case`parent`:case`parentProperty`:return e[t];case`path`:return f_.toPathString(e[t]);case`pointer`:return f_.toPointer(e.path);default:throw TypeError(`Unknown result type`)}},f_.prototype._handleCallback=function(e,t,n){if(t){let r=this._getPreferredOutput(e);e.path=typeof e.path==`string`?e.path:f_.toPathString(e.path),t(r,n,e)}},f_.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],u_(n,l),t,l,a,o));else if(l===`*`)this._walk(t,e=>{f(this._trace(u,t[e],u_(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],u_(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:u_(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],u_(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],u_(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(d_(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],u_(n,e),t,e,a,o,!0))}else if(l.includes(`,`)){let e=l.split(`,`);for(let o of e)f(this._trace(d_(o,u),t,n,r,i,a,!0))}else!s&&t&&Object.hasOwn(t,l)&&f(this._trace(u,t[l],u_(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},f_.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)})},f_.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(d_(e,t),n,r,i,a,o,!0).forEach(e=>{f.push(e)});return f},f_.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=f_.toPathString(r.concat([n])));let s=this.currEval+`Script:`+e;if(!f_.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)f_.cache[s]=new this.safeVm.Script(t);else if(this.currEval===`native`)f_.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;f_.cache[s]=new e(t)}else if(typeof this.currEval==`function`)f_.cache[s]={runInNewContext:e=>this.currEval(t,e)};else throw TypeError(`Unknown "eval" property "${this.currEval}"`)}try{return f_.cache[s].runInNewContext(this.currSandbox)}catch(t){if(this.ignoreEvalErrors)return!1;throw Error(`jsonPath: `+t.message+`: `+e)}},f_.cache={},f_.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},f_.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},f_.toPathArray=function(e){let{cache:t}=f_;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()},f_.prototype.safeVm={Script:Hee};var Wee=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])}},Gee=class{constructor(e){this.code=e}runInNewContext(e){let t=this.code,n=Object.keys(e),r=[];Wee(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)}};f_.prototype.vm={Script:Gee};function p_(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 Kee(e){return e.type===`contains`||e.type===`regex`}function m_(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`&&Kee(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 h_(e){return e.length>0?`Tool sequence · ${e.join(` -> `)}`:`Tool sequence`}function g_(e,t,n=0){let r=t-n;return r<=0?null:e/r}function __(e){return e==null?void 0:String(e)}var qee={openai:`openai`,anthropic:`anthropic`,azure:`azure_openai`,azure_foundry:`azure_foundry`,google:`openai`,custom:`openai`};function Jee(e,t){return`${e}-${t+1}`}function Yee(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,...b_(t.temperature),maxTokens:t.max_tokens??2048,maxTurns:t.max_turns,systemPrompt:t.system}}function v_(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:qee[e.provider],model:e.model,...b_(e.temperature),max_tokens:e.maxTokens,max_turns:e.maxTurns,system:e.systemPrompt}}function y_(e){return Gi(e)||void 0}function b_(e){return e===void 0?{}:{temperature:e}}function Xee(e){let t=e.media_type??Wg(e)??`application/octet-stream`;return{type:Hg(t),media_type:t,data:e.data??``,...e.url?{url:e.url}:{},...e.name?{name:e.name}:{}}}function Zee(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 Qee(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 $ee(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=__(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 ete(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=>$ee(e)).filter(e=>!!e),o=e.filter(e=>e.type.startsWith(`tool_input_`)).flatMap(e=>{if(!e.tool)return[];let t=__(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 tte(e){if(e.length!==0)return e.map(e=>({name:e.name,from:`final_text`,regex:e.pattern}))}function x_(e,t){let n=ete(e.evalRules,e.agentContext),r=tte(e.extractRules);return{id:e.id,name:y_(e.name),mcp_servers:t,prompt:e.prompt,attachments:e.attachments,eval:n,extract:r}}function S_(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,inspectrEnabled:e.inspectr?.enabled===!0||void 0}}}function C_(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=S_({...e,id:n}).server;a.push(r),o.push({kind:`inline`,server:r})}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=Yee(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=S_(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(Zee(t));for(let t of e.eval?.tool_input_assertions??[])n.push(Qee(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||Jee(`scn`,t),name:y_(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=S_(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(Xee),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 nte(e){let t=C_({id:`library`,name:`library`,path:`library`,mtime:new Date(0).toISOString(),hash:``,config:{servers:Object.entries(e.servers).map(([e,t])=>({id:e,name:y_(t.name)||e,transport:t.transport,url:t.url,auth:t.auth,...t.inspectr?{inspectr:t.inspectr}:{}})),agents:Object.entries(e.agents).map(([e,t])=>({id:e,...t})),scenarios:e.scenarios.map((e,t)=>({...e,name:y_(e.name)||e.id||`Scenario ${t+1}`}))}});return{servers:t.servers,agents:t.agents,scenarios:t.scenarios,browserProviders:e.browserProviders??{}}}function w_(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{...e.name&&e.name!==t?{name:e.name}:{},transport:`http`,url:e.url||`http://localhost:3000/mcp`,...i===void 0?{}:{auth:i},...e.inspectrEnabled?{inspectr:{enabled:!0}}:{}}}function T_(e){let t=new Map,n=e=>({id:e.id,...w_(e)}),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=>v_(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=>x_(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 rte(e){return{servers:Object.fromEntries((e.servers??[]).map(e=>[e.id,w_(e)])),agents:Object.fromEntries(e.agents.map(e=>{let{id:t,...n}=v_(e);return[e.id,n]})),scenarios:e.scenarios.map(e=>x_(e,e.serverIds.length>0?e.serverIds.map(e=>({ref:e})):void 0)),browserProviders:e.browserProviders}}function ite(e,t){if(e)return`${e}::${t??``}`}function E_(e){return e.type===`text`}function D_(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 O_(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:k_(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(E_).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(E_).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:k_(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(E_).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 k_(e){try{return JSON.stringify(e)}catch{return String(e)}}function A_(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 j_(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 M_(e){let t=Lg(),n=Lg(),r=new Map;if(!e)return{assistant:null,tool:null,perTool:{}};for(let i of e.messages??[]){if(i.role!==`assistant`)continue;A_(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)??Lg();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}A_(n,i.usage);let a=j_(i.usage?.input_tokens,e.length),o=j_(i.usage?.output_tokens,e.length),s=j_(i.usage?.total_tokens,e.length);for(let t=0;t<e.length;t+=1){let n=e[t].name,i=r.get(n)??Lg(),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=zg(t);n&&(i[e]=n)}return{assistant:zg(t),tool:zg(n),perTool:i}}function N_(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 ate(e){return Gg(e.flatMap(e=>e.checkResults??[]))}function P_(e){return e?.map(e=>({...e,status:e.status===`not_applicable`?`not_evaluated`:e.status}))}function F_(e,t=[],n){let r=new Map;for(let e of t){let t=ite(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=M_(i);return{runIndex:e.run_index,requestId:e.request_id,passed:e.pass,outcome:e.outcome,error:e.error,stopReason:e.stop_reason,toolCalls:D_(e,i),assistantTokenUsage:a.assistant,toolTokenUsage:a.tool,toolTokenUsageByTool:a.perTool,finalAnswer:e.final_text,conversation:O_(i),duration:N_(e,i),extractedValues:Object.fromEntries(Object.entries(e.extracted).map(([e,t])=>[e,String(t??``)])),failureReasons:e.failures,checkResults:P_(e.check_results)}}),a=Lg(),o=Lg(),s=new Map;for(let e of i){Rg(a,e.assistantTokenUsage),Rg(o,e.toolTokenUsage);for(let[t,n]of Object.entries(e.toolTokenUsageByTool??{})){let e=s.get(t)??Lg();Rg(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=zg(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,inspectrOrigins:e.inspectr_origins,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:ate(i),assistantTokenUsage:zg(a),toolTokenUsage:zg(o),toolTokenUsageByTool:c}}),a=Lg(),o=Lg();for(let e of i)Rg(a,e.assistantTokenUsage),Rg(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:zg(a),toolTokenUsage:zg(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 ote(e,t){let n=M_(t??void 0);return{runIndex:e.run_index,requestId:e.request_id,passed:e.pass,outcome:e.outcome,error:e.error,stopReason:e.stop_reason,toolCalls:D_(e,t??void 0),assistantTokenUsage:n.assistant,toolTokenUsage:n.tool,toolTokenUsageByTool:n.perTool,finalAnswer:e.final_text,conversation:O_(t??void 0),duration:N_(e,t??void 0),extractedValues:Object.fromEntries(Object.entries(e.extracted).map(([e,t])=>[e,String(t??``)])),failureReasons:e.failures,checkResults:P_(e.check_results)}}function ste(){return typeof window>`u`?``:window.location.port===`8685`?`http://127.0.0.1:8787`:``}var I_=ste(),L_=class extends Error{status;constructor(e,t){super(t),this.status=e,this.name=`ApiError`}};async function R_(e,t){let n=await fetch(`${I_}${e}`,{...t,headers:{"content-type":`application/json`,...t?.headers||{}}});if(!n.ok){let e=await n.text();throw new L_(n.status,`Request failed (${n.status}): ${e}`)}return await n.json()}async function cte(e,t){let n=await fetch(`${I_}${e}`,{...t,headers:{...t?.body?{"content-type":`application/json`}:{},...t?.headers||{}}});if(!n.ok){let e=await n.text();throw new L_(n.status,`Request failed (${n.status}): ${e}`)}return n.text()}var lte={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 z_(e,t){let n=new EventSource(`${I_}${e}`),r=e.replace(/\/events$/,``),i=Object.keys(lte),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(`${I_}${r}`,{method:`GET`,cache:`no-store`,headers:{accept:`application/json`}}).then(e=>{(e.status===404||e.status===410)&&o()}).catch(()=>{}))},()=>o()}function B_(e,t,n){if(typeof n!=`number`||!Number.isFinite(n))return;let r=Math.floor(n);r<=0||e.set(t,String(r))}function V_(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:()=>R_(`/api/health`),getSettings:()=>R_(`/api/settings`),testAgentConnection:(e,t)=>R_(`/api/agents/test`,{method:`POST`,body:JSON.stringify(e),signal:t}),testDecisionConnection:(e,t)=>R_(`/api/settings/decision/test`,{method:`POST`,body:JSON.stringify(e),signal:t}),updateSettings:e=>R_(`/api/settings`,{method:`PUT`,body:JSON.stringify(e)}),listConfigs:()=>R_(`/api/evals`),createConfig:(e,t)=>R_(`/api/evals`,{method:`POST`,body:JSON.stringify({fileName:e,config:t})}),updateConfig:(e,t,n)=>R_(`/api/evals/${e}`,{method:`PUT`,body:JSON.stringify({config:t,fileName:n})}),deleteConfig:e=>R_(`/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()),B_(t,`limit`,e?.limit),V_(t,`offset`,e?.offset),R_(`/api/runs${t.size>0?`?${t.toString()}`:``}`)},getLatestPassRatesByConfigIds:e=>R_(`/api/runs/latest-pass-rates`,{method:`POST`,body:JSON.stringify(e)}).then(e=>e.byConfigId),listMarkdownReports:e=>{let t=new URLSearchParams;return B_(t,`limit`,e?.limit),V_(t,`offset`,e?.offset),R_(`/api/markdown-reports${t.size>0?`?${t.toString()}`:``}`)},listToolAnalysisServers:()=>R_(`/api/tool-analysis-results/servers`).then(e=>e.data),getMarkdownReport:e=>R_(`/api/markdown-reports/content?path=${encodeURIComponent(e)}`),getMarkdownReportById:e=>R_(`/api/markdown-reports/${encodeURIComponent(e)}`),deleteMarkdownReport:e=>R_(`/api/markdown-reports?path=${encodeURIComponent(e)}`,{method:`DELETE`}).then(()=>void 0),getRun:e=>R_(`/api/runs/${e}`),deleteRun:e=>R_(`/api/runs/${e}`,{method:`DELETE`}),updateRunNote:(e,t)=>R_(`/api/runs/${encodeURIComponent(e)}/note`,{method:`PATCH`,body:JSON.stringify({runNote:t??``})}).then(()=>void 0),getRunTrace:e=>R_(`/api/runs/${e}/trace`),applyResultAssistantReport:e=>R_(`/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)=>R_(`/api/result-assistant/sessions`,{method:`POST`,body:JSON.stringify(e),signal:t}),getResultAssistantSession:e=>R_(`/api/result-assistant/sessions/${e}`),sendResultAssistantMessage:(e,t,n,r)=>R_(`/api/result-assistant/sessions/${e}/messages`,{method:`POST`,body:JSON.stringify({message:t,...r?{turnId:r}:{}}),signal:n}),cancelResultAssistantTurn:(e,t)=>R_(`/api/result-assistant/sessions/${e}/turns/${encodeURIComponent(t)}/cancel`,{method:`POST`,body:JSON.stringify({})}),approveResultAssistantToolCall:(e,t,n)=>R_(`/api/result-assistant/sessions/${e}/tool-calls/${t}/approve`,{method:`POST`,body:JSON.stringify(n===void 0?{}:{argumentsOverride:n})}),denyResultAssistantToolCall:(e,t,n)=>R_(`/api/result-assistant/sessions/${e}/tool-calls/${t}/deny`,{method:`POST`,body:JSON.stringify(n?{message:n}:{})}),closeResultAssistantSession:e=>R_(`/api/result-assistant/sessions/${e}`,{method:`DELETE`}).then(()=>void 0),subscribeResultAssistantSessionEvents:(e,t)=>z_(`/api/result-assistant/sessions/${e}/events`,t),getLibraries:()=>R_(`/api/libraries`),saveLibraries:e=>R_(`/api/libraries`,{method:`PUT`,body:JSON.stringify(e)}),startRun:e=>R_(`/api/runs`,{method:`POST`,body:JSON.stringify(e)}),runScenarioPreview:e=>R_(`/api/runs/preview`,{method:`POST`,body:JSON.stringify(e)}),listProviderModels:e=>R_(`/api/providers/models?provider=${encodeURIComponent(e)}`),createScenarioAssistantSession:(e,t)=>R_(`/api/scenario-assistant/sessions`,{method:`POST`,body:JSON.stringify(e),signal:t}),getScenarioAssistantSession:e=>R_(`/api/scenario-assistant/sessions/${e}`),sendScenarioAssistantMessage:(e,t,n,r)=>R_(`/api/scenario-assistant/sessions/${e}/messages`,{method:`POST`,body:JSON.stringify({message:t,...r?{turnId:r}:{}}),signal:n}),cancelScenarioAssistantTurn:(e,t)=>R_(`/api/scenario-assistant/sessions/${e}/turns/${encodeURIComponent(t)}/cancel`,{method:`POST`,body:JSON.stringify({})}),approveScenarioAssistantToolCall:(e,t,n)=>R_(`/api/scenario-assistant/sessions/${e}/tool-calls/${t}/approve`,{method:`POST`,body:JSON.stringify(n===void 0?{}:{argumentsOverride:n})}),denyScenarioAssistantToolCall:(e,t,n)=>R_(`/api/scenario-assistant/sessions/${e}/tool-calls/${t}/deny`,{method:`POST`,body:JSON.stringify(n?{message:n}:{})}),approveAllScenarioAssistantToolCalls:e=>R_(`/api/scenario-assistant/sessions/${e}/tool-calls/approve-all`,{method:`POST`,body:JSON.stringify({})}),closeScenarioAssistantSession:e=>R_(`/api/scenario-assistant/sessions/${e}`,{method:`DELETE`}),subscribeScenarioAssistantSessionEvents:(e,t)=>z_(`/api/scenario-assistant/sessions/${e}/events`,t),discoverToolsForAnalysis:e=>R_(`/api/tool-analysis/discover-tools`,{method:`POST`,body:JSON.stringify(e)}),startToolAnalysis:e=>R_(`/api/tool-analysis/jobs`,{method:`POST`,body:JSON.stringify(e)}),getToolAnalysisResult:e=>R_(`/api/tool-analysis/jobs/${e}/result`),stopToolAnalysis:e=>R_(`/api/tool-analysis/jobs/${e}/stop`,{method:`POST`}),subscribeToolAnalysisJob:(e,t)=>{let n=new EventSource(`${I_}/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 B_(t,`limit`,e?.limit),V_(t,`offset`,e?.offset),e?.server?.trim()&&t.set(`server`,e.server.trim()),R_(`/api/tool-analysis-results${t.size>0?`?${t.toString()}`:``}`)},getToolAnalysisSavedResult:e=>R_(`/api/tool-analysis-results/${e}`),deleteToolAnalysisSavedResult:e=>R_(`/api/tool-analysis-results/${e}`,{method:`DELETE`}).then(()=>void 0),createOAuthDebuggerSession:e=>R_(`/api/oauth-debugger/sessions`,{method:`POST`,body:JSON.stringify(e)}),getOAuthDebuggerSession:e=>R_(`/api/oauth-debugger/sessions/${e}`),startOAuthDebuggerSession:e=>R_(`/api/oauth-debugger/sessions/${e}/start`,{method:`POST`,body:JSON.stringify({})}),subscribeOAuthDebuggerSession:(e,t)=>{let n=new EventSource(`${I_}/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)=>R_(`/api/oauth-debugger/sessions/${e}/manual-callback`,{method:`POST`,body:JSON.stringify(t)}),stopOAuthDebuggerSession:e=>R_(`/api/oauth-debugger/sessions/${e}/stop`,{method:`POST`,body:JSON.stringify({})}),exportOAuthDebuggerSession:(e,t)=>t===`json`?R_(`/api/oauth-debugger/sessions/${e}/export?format=json`):cte(`/api/oauth-debugger/sessions/${e}/export?format=${t}`),createOAuthRuntimeSession:e=>R_(`/api/oauth-runtime/sessions`,{method:`POST`,body:JSON.stringify(e)}),getOAuthRuntimeSession:e=>R_(`/api/oauth-runtime/sessions/${e}`),getOAuthRuntimeSessionToken:e=>R_(`/api/oauth-runtime/sessions/${e}/token`),submitOAuthRuntimeCallback:(e,t)=>R_(`/api/oauth-runtime/sessions/${e}/callback`,{method:`POST`,body:JSON.stringify(t)}),cancelOAuthRuntimeSession:e=>R_(`/api/oauth-runtime/sessions/${e}/cancel`,{method:`POST`,body:JSON.stringify({})}),ensureOAuthServers:e=>R_(`/api/oauth-runtime/servers/ensure`,{method:`POST`,body:JSON.stringify(e)}),stopRun:e=>R_(`/api/runs/jobs/${e}/stop`,{method:`POST`}),stopEvaluationRun:e=>R_(`/api/runs/evaluations/${encodeURIComponent(e)}/stop`,{method:`POST`}),stopScenario:(e,t,n)=>R_(`/api/runs/jobs/${encodeURIComponent(e)}/scenarios/${encodeURIComponent(t)}/agents/${encodeURIComponent(n)}/stop`,{method:`POST`}),removeEvaluationRun:e=>R_(`/api/runs/queue/evaluations/${encodeURIComponent(e)}`,{method:`DELETE`}),openRover:e=>R_(`/api/rover/open`,{method:`POST`,body:JSON.stringify({jobId:e})}),resumeRover:e=>R_(`/api/rover/jobs/${encodeURIComponent(e)}/resume`,{method:`POST`}),getRoverStatus:()=>R_(`/api/rover/status`),openRunInspectrSession:(e,t)=>R_(`/api/runs/${encodeURIComponent(e)}/inspectr`,{method:`POST`,body:JSON.stringify({origin:t})}).then(e=>e.session),getRunQueue:()=>R_(`/api/runs/queue`),subscribeRunQueue:e=>{if(typeof SharedWorker>`u`){let t=new EventSource(`${I_}/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:I_}),()=>{n||(n=!0,t.port.postMessage({type:`close`}),t.port.onmessage=null,t.port.close())}},removeQueuedRun:e=>R_(`/api/runs/queue/${e}`,{method:`DELETE`}).then(()=>void 0),resumeQueue:()=>R_(`/api/runs/queue/resume`,{method:`POST`}),subscribeRunJob:(e,t)=>{let n=new EventSource(`${I_}/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.addEventListener(`inspection_ready`,a),n.onerror=()=>{r||(t({type:`error`,ts:new Date().toISOString(),payload:{message:`SSE connection error`}}),i())},()=>{i()}}};function H_(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 U_(e){return e||`config-${Date.now()}`}var W_={async health(){return G.health()},async listConfigs(){return(await G.listConfigs()).map(C_)},async createConfig(e){return C_(await G.createConfig(H_(e),T_(e)))},async updateConfig(e){return C_(await G.updateConfig(e.id,T_(e),U_(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 F_(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 F_(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:ote(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 openRunInspectrSession(e,t){return G.openRunInspectrSession(e,t)},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 nte(await G.getLibraries())},async saveLibraries(e){await G.saveLibraries(rte(e))},async listProviderModels(e){return G.listProviderModels(e)},async testAgentConnection(e,t){return G.testAgentConnection(v_(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)}},G_=(0,_.createContext)(null);function K_({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)(()=>W_,[]);return(0,I.jsx)(G_.Provider,{value:{mode:t,connection:n,version:i,source:o},children:e})}function q_(){let e=(0,_.useContext)(G_);if(!e)throw Error(`useDataSource must be used within DataSourceProvider`);return e}var J_=5,Y_=2e3;function X_(e){return e.filter(e=>e.status===`blocked_auth`&&e.blockedReason===`oauth_required`).length}function Z_(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 Q_(){let{source:e}=q_(),[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=Z_(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=Z_(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>=J_){i(`disconnected`),l.current=`disconnected`;return}r+=1,i(`connecting`),l.current=`connecting`;let e=Y_*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=X_(t.queued);return{isRunning:e,runningCount:n,completionVersion:a,queuedCount:i,oauthBlockedCount:o,streamStatus:r,reconnectStream:()=>{c(e=>e+1)}}},[t,r])}var $_=(e,t)=>{if(e===`/`)return[{label:`Dashboard`}];let n=[{label:`Dashboard`,to:`/`}];if(Qu(`/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(Qu(`/mcp-evaluations/:id`,e))return n.push({label:`MCP Evaluations`,to:`/mcp-evaluations`},{label:`MCP Evaluation`}),n;if(Qu(`/mcp-evaluations`,e))return n.push({label:`MCP Evaluations`}),n;if(Qu(`/settings/mcp`,e))return n.push({label:`Settings`,to:`/settings`},{label:`MCP Connection`}),n;if(Qu(`/settings`,e))return n.push({label:`Settings`}),n;if(Qu(`/tool-analysis`,e))return n.push({label:`Analyze MCP Tools`}),n;if(Qu(`/tool-analysis-results/:id`,e)){let t=Qu(`/tool-analysis-results/:id`,e);return n.push({label:`Tool Analysis Results`,to:`/tool-analysis-results`},{label:t?.params.id??`Report`}),n}if(Qu(`/tool-analysis-results`,e))return n.push({label:`Tool Analysis Results`}),n;if(Qu(`/markdown-reports/view`,e))return n.push({label:`Markdown Reports`,to:`/markdown-reports`},{label:`View Report`}),n;if(Qu(`/markdown-reports`,e))return n.push({label:`Markdown Reports`}),n;if(Qu(`/oauth-debugger`,e))return n.push({label:`OAuth Debugger`}),n;if(Qu(`/results/:id`,e))return n.push({label:`Evaluation Results`,to:`/results`},{label:`Result`}),n;if(Qu(`/results`,e))return n.push({label:`Evaluation Results`}),n;if(Qu(`/run`,e))return n.push({label:`Run Evaluation`}),n;if(Qu(`/libraries/servers/:serverId`,e)){let t=Qu(`/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(Qu(`/libraries/servers`,e))return n.push({label:`Libraries`,to:`/libraries/servers`},{label:`MCP servers`}),n;if(Qu(`/libraries/agents/:agentName`,e)){let t=Qu(`/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(Qu(`/libraries/agents`,e))return n.push({label:`Libraries`,to:`/libraries/agents`},{label:`Agents`}),n;if(Qu(`/libraries/test-cases/:testCaseId`,e)){let t=Qu(`/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(Qu(`/libraries/test-cases`,e))return n.push({label:`Libraries`,to:`/libraries/test-cases`},{label:`Test Cases`}),n;if(Qu(`/compare/results`,e))return n.push({label:`Compare Evaluations`,to:`/compare`},{label:`Full Result Compare`}),n;if(Qu(`/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 ev(){let e=Bd(),t=new URLSearchParams(e.search).get(`embed`)===`1`,n=$_(e.pathname,e.search),{version:r}=q_(),{isRunning:i,runningCount:a,queuedCount:o,oauthBlockedCount:s,streamStatus:c,reconnectStream:l}=Q_(),u=o+a;return t?(0,I.jsx)(`main`,{className:`min-h-screen overflow-auto bg-background p-4`,children:(0,I.jsx)(lf,{})}):(0,I.jsx)(tg,{children:(0,I.jsxs)(`div`,{className:`flex min-h-screen w-full`,children:[(0,I.jsx)(kg,{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)(rg,{}),(0,I.jsx)(jg,{children:(0,I.jsx)(Mg,{children:n.map((e,t)=>{let r=t===n.length-1;return(0,I.jsxs)(_.Fragment,{children:[(0,I.jsx)(Ng,{children:e.to&&!r?(0,I.jsx)(Pg,{asChild:!0,children:(0,I.jsx)($f,{to:e.to,children:e.label})}):(0,I.jsx)(Fg,{children:e.label})}),!r&&(0,I.jsx)(Ig,{})]},`${e.label}-${t}`)})})}),(0,I.jsxs)(`div`,{className:`ml-auto flex items-center gap-2`,children:[(i||o>0||s>0)&&(0,I.jsxs)($f,{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)(Ag,{}),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)(lf,{})})]})]})})}var tv=(0,_.createContext)(null);function nv({children:e}){let{source:t}=q_(),[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)(tv.Provider,{value:{configs:n,loading:i,getConfig:s,addConfig:c,updateConfig:l,deleteConfig:u,cloneConfig:d,reload:o},children:e})}function rv(){let e=(0,_.useContext)(tv);if(!e)throw Error(`useConfigs must be used within ConfigProvider`);return e}var iv=(0,_.createContext)(null);function av({children:e}){let{source:t}=q_(),[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)(iv.Provider,{value:c,children:e})}function ov(){let e=(0,_.useContext)(iv);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 sv=_.forwardRef(({className:e,...t},n)=>(0,I.jsx)(`div`,{ref:n,className:U(`flex flex-col space-y-1.5 p-6`,e),...t}));sv.displayName=`CardHeader`;var cv=_.forwardRef(({className:e,...t},n)=>(0,I.jsx)(`h3`,{ref:n,className:U(`text-2xl font-semibold leading-none tracking-tight`,e),...t}));cv.displayName=`CardTitle`;var lv=_.forwardRef(({className:e,...t},n)=>(0,I.jsx)(`p`,{ref:n,className:U(`text-sm text-muted-foreground`,e),...t}));lv.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 uv=_.forwardRef(({className:e,...t},n)=>(0,I.jsx)(`div`,{ref:n,className:U(`flex items-center p-6 pt-0`,e),...t}));uv.displayName=`CardFooter`;var dv=_.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})}));dv.displayName=`Table`;var fv=_.forwardRef(({className:e,...t},n)=>(0,I.jsx)(`thead`,{ref:n,className:U(`[&_tr]:border-b`,e),...t}));fv.displayName=`TableHeader`;var pv=_.forwardRef(({className:e,...t},n)=>(0,I.jsx)(`tbody`,{ref:n,className:U(`[&_tr:last-child]:border-0`,e),...t}));pv.displayName=`TableBody`;var mv=_.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}));mv.displayName=`TableFooter`;var hv=_.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}));hv.displayName=`TableRow`;var gv=_.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}));gv.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 _v=_.forwardRef(({className:e,...t},n)=>(0,I.jsx)(`caption`,{ref:n,className:U(`mt-4 text-sm text-muted-foreground`,e),...t}));_v.displayName=`TableCaption`;function vv({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 yv=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?gp:`div`,{ref:i,className:U(yv({variant:t}),e),...r}));Y.displayName=`Badge`;function bv({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 xv=o(((e,t)=>{t.exports=Array.isArray})),Sv=o(((e,t)=>{t.exports=typeof global==`object`&&global&&global.Object===Object&&global})),Cv=o(((e,t)=>{var n=Sv(),r=typeof self==`object`&&self&&self.Object===Object&&self;t.exports=n||r||Function(`return this`)()})),wv=o(((e,t)=>{t.exports=Cv().Symbol})),Tv=o(((e,t)=>{var n=wv(),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})),Ev=o(((e,t)=>{var n=Object.prototype.toString;function r(e){return n.call(e)}t.exports=r})),Dv=o(((e,t)=>{var n=wv(),r=Tv(),i=Ev(),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})),Ov=o(((e,t)=>{function n(e){return typeof e==`object`&&!!e}t.exports=n})),kv=o(((e,t)=>{var n=Dv(),r=Ov(),i=`[object Symbol]`;function a(e){return typeof e==`symbol`||r(e)&&n(e)==i}t.exports=a})),Av=o(((e,t)=>{var n=xv(),r=kv(),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})),jv=o(((e,t)=>{function n(e){var t=typeof e;return e!=null&&(t==`object`||t==`function`)}t.exports=n})),Mv=o(((e,t)=>{var n=Dv(),r=jv(),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})),Nv=o(((e,t)=>{t.exports=Cv()[`__core-js_shared__`]})),Pv=o(((e,t)=>{var n=Nv(),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})),Fv=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})),Iv=o(((e,t)=>{var n=Mv(),r=Pv(),i=jv(),a=Fv(),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})),Lv=o(((e,t)=>{function n(e,t){return e?.[t]}t.exports=n})),Rv=o(((e,t)=>{var n=Iv(),r=Lv();function i(e,t){var i=r(e,t);return n(i)?i:void 0}t.exports=i})),zv=o(((e,t)=>{t.exports=Rv()(Object,`create`)})),Bv=o(((e,t)=>{var n=zv();function r(){this.__data__=n?n(null):{},this.size=0}t.exports=r})),Vv=o(((e,t)=>{function n(e){var t=this.has(e)&&delete this.__data__[e];return this.size-=+!!t,t}t.exports=n})),Hv=o(((e,t)=>{var n=zv(),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})),Uv=o(((e,t)=>{var n=zv(),r=Object.prototype.hasOwnProperty;function i(e){var t=this.__data__;return n?t[e]!==void 0:r.call(t,e)}t.exports=i})),Wv=o(((e,t)=>{var n=zv(),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})),Gv=o(((e,t)=>{var n=Bv(),r=Vv(),i=Hv(),a=Uv(),o=Wv();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})),Kv=o(((e,t)=>{function n(){this.__data__=[],this.size=0}t.exports=n})),qv=o(((e,t)=>{function n(e,t){return e===t||e!==e&&t!==t}t.exports=n})),Jv=o(((e,t)=>{var n=qv();function r(e,t){for(var r=e.length;r--;)if(n(e[r][0],t))return r;return-1}t.exports=r})),Yv=o(((e,t)=>{var n=Jv(),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})),Xv=o(((e,t)=>{var n=Jv();function r(e){var t=this.__data__,r=n(t,e);return r<0?void 0:t[r][1]}t.exports=r})),Zv=o(((e,t)=>{var n=Jv();function r(e){return n(this.__data__,e)>-1}t.exports=r})),Qv=o(((e,t)=>{var n=Jv();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})),$v=o(((e,t)=>{var n=Kv(),r=Yv(),i=Xv(),a=Zv(),o=Qv();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})),ey=o(((e,t)=>{t.exports=Rv()(Cv(),`Map`)})),ty=o(((e,t)=>{var n=Gv(),r=$v(),i=ey();function a(){this.size=0,this.__data__={hash:new n,map:new(i||r),string:new n}}t.exports=a})),ny=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})),ry=o(((e,t)=>{var n=ny();function r(e,t){var r=e.__data__;return n(t)?r[typeof t==`string`?`string`:`hash`]:r.map}t.exports=r})),iy=o(((e,t)=>{var n=ry();function r(e){var t=n(this,e).delete(e);return this.size-=+!!t,t}t.exports=r})),ay=o(((e,t)=>{var n=ry();function r(e){return n(this,e).get(e)}t.exports=r})),oy=o(((e,t)=>{var n=ry();function r(e){return n(this,e).has(e)}t.exports=r})),sy=o(((e,t)=>{var n=ry();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})),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)=>{var n=cy(),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})),uy=o(((e,t)=>{var n=ly(),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})),dy=o(((e,t)=>{var n=uy(),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})})),fy=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})),py=o(((e,t)=>{var n=wv(),r=fy(),i=xv(),a=kv(),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})),my=o(((e,t)=>{var n=py();function r(e){return e==null?``:n(e)}t.exports=r})),hy=o(((e,t)=>{var n=xv(),r=Av(),i=dy(),a=my();function o(e,t){return n(e)?e:r(e,t)?[e]:i(a(e))}t.exports=o})),gy=o(((e,t)=>{var n=kv(),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})),_y=o(((e,t)=>{var n=hy(),r=gy();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})),vy=o(((e,t)=>{var n=_y();function r(e,t,r){var i=e==null?void 0:n(e,t);return i===void 0?r:i}t.exports=r})),yy=o(((e,t)=>{function n(e){return e==null}t.exports=n})),by=o(((e,t)=>{var n=Dv(),r=xv(),i=Ov(),a=`[object String]`;function o(e){return typeof e==`string`||!r(e)&&i(e)&&n(e)==a}t.exports=o})),xy=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}})),Sy=o(((e,t)=>{t.exports=xy()})),Cy=o(((e,t)=>{var n=Dv(),r=Ov(),i=`[object Number]`;function a(e){return typeof e==`number`||r(e)&&n(e)==i}t.exports=a})),wy=o(((e,t)=>{var n=Cy();function r(e){return n(e)&&e!=+e}t.exports=r})),Ty=l(by()),Ey=l(wy()),Dy=l(vy()),Oy=l(Cy()),ky=l(yy()),Ay=function(e){return e===0?0:e>0?1:-1},jy=function(e){return(0,Ty.default)(e)&&e.indexOf(`%`)===e.length-1},My=function(e){return(0,Oy.default)(e)&&!(0,Ey.default)(e)},Ny=function(e){return(0,ky.default)(e)},Py=function(e){return My(e)||(0,Ty.default)(e)},Fy=0,Iy=function(e){var t=++Fy;return`${e||``}${t}`},Ly=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(!My(e)&&!(0,Ty.default)(e))return n;var i;if(jy(e)){var a=e.indexOf(`%`);i=t*parseFloat(e.slice(0,a))/100}else i=+e;return(0,Ey.default)(i)&&(i=n),r&&i>t&&(i=t),i},Ry=function(e){if(!e)return null;var t=Object.keys(e);return t&&t.length?e[t[0]]:null},zy=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},By=function(e,t){return My(e)&&My(t)?function(n){return e+n*(t-e)}:function(){return t}};function Vy(e,t,n){return!e||!e.length?null:e.find(function(e){return e&&(typeof t==`function`?t(e):(0,Dy.default)(e,t))===n})}var Hy=function(e,t){return My(e)&&My(t)?e-t:(0,Ty.default)(e)&&(0,Ty.default)(t)?e.localeCompare(t):e instanceof Date&&t instanceof Date?e.getTime()-t.getTime():String(e).localeCompare(String(t))};function Uy(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 Wy=l(jv());function Gy(e){"@babel/helpers - typeof";return Gy=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},Gy(e)}var Ky=[`viewBox`,`children`],qy=`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(`.`),Jy=[`points`,`pathLength`],Yy={svg:Ky,polygon:Jy,polyline:Jy},Xy=`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(`.`),Zy=function(e,t){if(!e||typeof e==`function`||typeof e==`boolean`)return null;var n=e;if((0,_.isValidElement)(e)&&(n=e.props),!(0,Wy.default)(n))return null;var r={};return Object.keys(n).forEach(function(e){Xy.includes(e)&&(r[e]=t||function(t){return n[e](n,t)})}),r},Qy=function(e,t,n){return function(r){return e(t,n,r),null}},$y=function(e,t,n){if(!(0,Wy.default)(e)||Gy(e)!==`object`)return null;var r=null;return Object.keys(e).forEach(function(i){var a=e[i];Xy.includes(i)&&typeof a==`function`&&(r||={},r[i]=Qy(a,t,n))}),r},eb=l(Mv()),tb=Sy(),nb=[`children`],rb=[`children`];function ib(e,t){if(e==null)return{};var n=ab(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 ab(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 ob(e){"@babel/helpers - typeof";return ob=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},ob(e)}var sb={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`},cb=function(e){return typeof e==`string`?e:e?e.displayName||e.name||`Component`:``},lb=null,ub=null,db=function e(t){if(t===lb&&Array.isArray(ub))return ub;var n=[];return _.Children.forEach(t,function(t){(0,ky.default)(t)||((0,tb.isFragment)(t)?n=n.concat(e(t.props.children)):n.push(t))}),ub=n,lb=t,n};function fb(e,t){var n=[],r=[];return r=Array.isArray(t)?t.map(function(e){return cb(e)}):[cb(t)],db(e).forEach(function(e){var t=(0,Dy.default)(e,`type.displayName`)||(0,Dy.default)(e,`type.name`);r.indexOf(t)!==-1&&n.push(e)}),n}function pb(e,t){var n=fb(e,t);return n&&n[0]}var mb=function(e){if(!e||!e.props)return!1;var t=e.props,n=t.width,r=t.height;return!(!My(n)||n<=0||!My(r)||r<=0)},hb=`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(`.`),gb=function(e){return e&&e.type&&(0,Ty.default)(e.type)&&hb.indexOf(e.type)>=0},_b=function(e){return e&&ob(e)===`object`&&`clipDot`in e},vb=function(e,t,n,r){var i=Yy?.[r]??[];return t.startsWith(`data-`)||!(0,eb.default)(e)&&(r&&i.includes(t)||qy.includes(t))||n&&Xy.includes(t)},yb=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,Wy.default)(r))return null;var i={};return Object.keys(r).forEach(function(e){vb(r?.[e],e,t,n)&&(i[e]=r[e])}),i},bb=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 xb(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(!xb(a,o))return!1}return!0},xb=function(e,t){if((0,ky.default)(e)&&(0,ky.default)(t))return!0;if(!(0,ky.default)(e)&&!(0,ky.default)(t)){var n=e.props||{},r=n.children,i=ib(n,nb),a=t.props||{},o=a.children,s=ib(a,rb);return r&&o?Uy(i,s)&&bb(r,o):!r&&!o&&Uy(i,s)}return!1},Sb=function(e,t){var n=[],r={};return db(e).forEach(function(e,i){if(gb(e))n.push(e);else if(e){var a=cb(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},Cb=function(e){var t=e&&e.type;return t&&sb[t]?sb[t]:null},wb=function(e,t){return db(t).indexOf(e)},Tb=[`children`,`width`,`height`,`viewBox`,`className`,`style`,`title`,`desc`];function Eb(){return Eb=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},Eb.apply(this,arguments)}function Db(e,t){if(e==null)return{};var n=Ob(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 Ob(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 kb(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=Db(e,Tb),u=i||{width:n,height:r,x:0,y:0},d=Ht(`recharts-surface`,a);return _.createElement(`svg`,Eb({},yb(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 Ab=[`children`,`className`];function jb(){return jb=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},jb.apply(this,arguments)}function Mb(e,t){if(e==null)return{};var n=Nb(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 Nb(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 Pb=_.forwardRef(function(e,t){var n=e.children,r=e.className,i=Mb(e,Ab),a=Ht(`recharts-layer`,r);return _.createElement(`g`,jb({className:a},yb(i,!0),{ref:t}),n)}),Fb=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})),Ib=o(((e,t)=>{var n=Fb();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})),Lb=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})),Rb=o(((e,t)=>{function n(e){return e.split(``)}t.exports=n})),zb=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})),Bb=o(((e,t)=>{var n=Rb(),r=Lb(),i=zb();function a(e){return r(e)?i(e):n(e)}t.exports=a})),Vb=o(((e,t)=>{var n=Ib(),r=Lb(),i=Bb(),a=my();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})),Hb=o(((e,t)=>{t.exports=Vb()(`toUpperCase`)}));function Ub(e){return function(){return e}}var Wb=Math.cos,Gb=Math.sin,Kb=Math.sqrt,qb=Math.PI;qb/2;var Jb=2*qb,Yb=Math.PI,Xb=2*Yb,Zb=1e-6,Qb=Xb-Zb;function $b(e){this._+=e[0];for(let t=1,n=e.length;t<n;++t)this._+=arguments[t]+e[t]}function ex(e){let t=Math.floor(e);if(!(t>=0))throw Error(`invalid digits: ${e}`);if(t>15)return $b;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 tx=class{constructor(e){this._x0=this._y0=this._x1=this._y1=null,this._=``,this._append=e==null?$b:ex(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>Zb){if(!(Math.abs(u*s-c*l)>Zb)||!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((Yb-Math.acos((m+d-h)/(2*g*_)))/2),y=v/_,b=v/g;Math.abs(y-1)>Zb&&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)>Zb||Math.abs(this._y1-l)>Zb)&&this._append`L${c},${l}`,n&&(d<0&&(d=d%Xb+Xb),d>Qb?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>Zb&&this._append`A${n},${n},0,${+(d>=Yb)},${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._}};tx.prototype;function nx(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 tx(t)}Array.prototype.slice;function rx(e){return typeof e==`object`&&`length`in e?e:Array.from(e)}function ix(e){this._context=e}ix.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 ax(e){return new ix(e)}function ox(e){return e[0]}function sx(e){return e[1]}function cx(e,t){var n=Ub(!0),r=null,i=ax,a=null,o=nx(s);e=typeof e==`function`?e:e===void 0?ox:Ub(e),t=typeof t==`function`?t:t===void 0?sx:Ub(t);function s(s){var c,l=(s=rx(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:Ub(+t),s):e},s.y=function(e){return arguments.length?(t=typeof e==`function`?e:Ub(+e),s):t},s.defined=function(e){return arguments.length?(n=typeof e==`function`?e:Ub(!!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 lx(e,t,n){var r=null,i=Ub(!0),a=null,o=ax,s=null,c=nx(l);e=typeof e==`function`?e:e===void 0?ox:Ub(+e),t=typeof t==`function`?t:Ub(t===void 0?0:+t),n=typeof n==`function`?n:n===void 0?sx:Ub(+n);function l(l){var u,d,f,p=(l=rx(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 cx().defined(i).curve(o).context(a)}return l.x=function(t){return arguments.length?(e=typeof t==`function`?t:Ub(+t),r=null,l):e},l.x0=function(t){return arguments.length?(e=typeof t==`function`?t:Ub(+t),l):e},l.x1=function(e){return arguments.length?(r=e==null?null:typeof e==`function`?e:Ub(+e),l):r},l.y=function(e){return arguments.length?(t=typeof e==`function`?e:Ub(+e),n=null,l):t},l.y0=function(e){return arguments.length?(t=typeof e==`function`?e:Ub(+e),l):t},l.y1=function(e){return arguments.length?(n=e==null?null:typeof e==`function`?e:Ub(+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:Ub(!!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 ux=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 dx(e){return new ux(e,!0)}function fx(e){return new ux(e,!1)}var px={draw(e,t){let n=Kb(t/qb);e.moveTo(n,0),e.arc(0,0,n,0,Jb)}},mx={draw(e,t){let n=Kb(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()}},hx=Kb(1/3),gx=hx*2,_x={draw(e,t){let n=Kb(t/gx),r=n*hx;e.moveTo(0,-n),e.lineTo(r,0),e.lineTo(0,n),e.lineTo(-r,0),e.closePath()}},vx={draw(e,t){let n=Kb(t),r=-n/2;e.rect(r,r,n,n)}},yx=.8908130915292852,bx=Gb(qb/10)/Gb(7*qb/10),xx=Gb(Jb/10)*bx,Sx=-Wb(Jb/10)*bx,Cx={draw(e,t){let n=Kb(t*yx),r=xx*n,i=Sx*n;e.moveTo(0,-n),e.lineTo(r,i);for(let t=1;t<5;++t){let a=Jb*t/5,o=Wb(a),s=Gb(a);e.lineTo(s*n,-o*n),e.lineTo(o*r-s*i,s*r+o*i)}e.closePath()}},wx=Kb(3),Tx={draw(e,t){let n=-Kb(t/(wx*3));e.moveTo(0,n*2),e.lineTo(-wx*n,-n),e.lineTo(wx*n,-n),e.closePath()}},Ex=-.5,Dx=Kb(3)/2,Ox=1/Kb(12),kx=(Ox/2+1)*3,Ax={draw(e,t){let n=Kb(t/kx),r=n/2,i=n*Ox,a=r,o=n*Ox+n,s=-a,c=o;e.moveTo(r,i),e.lineTo(a,o),e.lineTo(s,c),e.lineTo(Ex*r-Dx*i,Dx*r+Ex*i),e.lineTo(Ex*a-Dx*o,Dx*a+Ex*o),e.lineTo(Ex*s-Dx*c,Dx*s+Ex*c),e.lineTo(Ex*r+Dx*i,Ex*i-Dx*r),e.lineTo(Ex*a+Dx*o,Ex*o-Dx*a),e.lineTo(Ex*s+Dx*c,Ex*c-Dx*s),e.closePath()}};function jx(e,t){let n=null,r=nx(i);e=typeof e==`function`?e:Ub(e||px),t=typeof t==`function`?t:Ub(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:Ub(t),i):e},i.size=function(e){return arguments.length?(t=typeof e==`function`?e:Ub(+e),i):t},i.context=function(e){return arguments.length?(n=e??null,i):n},i}function Mx(){}function Nx(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 Px(e){this._context=e}Px.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:Nx(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:Nx(this,e,t)}this._x0=this._x1,this._x1=e,this._y0=this._y1,this._y1=t}};function Fx(e){return new Px(e)}function Ix(e){this._context=e}Ix.prototype={areaStart:Mx,areaEnd:Mx,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:Nx(this,e,t)}this._x0=this._x1,this._x1=e,this._y0=this._y1,this._y1=t}};function Lx(e){return new Ix(e)}function Rx(e){this._context=e}Rx.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:Nx(this,e,t)}this._x0=this._x1,this._x1=e,this._y0=this._y1,this._y1=t}};function zx(e){return new Rx(e)}function Bx(e){this._context=e}Bx.prototype={areaStart:Mx,areaEnd:Mx,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 Vx(e){return new Bx(e)}function Hx(e){return e<0?-1:1}function Ux(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(Hx(a)+Hx(o))*Math.min(Math.abs(a),Math.abs(o),.5*Math.abs(s))||0}function Wx(e,t){var n=e._x1-e._x0;return n?(3*(e._y1-e._y0)/n-t)/2:t}function Gx(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 Kx(e){this._context=e}Kx.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:Gx(this,this._t0,Wx(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,Gx(this,Wx(this,n=Ux(this,e,t)),n);break;default:Gx(this,this._t0,n=Ux(this,e,t))}this._x0=this._x1,this._x1=e,this._y0=this._y1,this._y1=t,this._t0=n}}};function qx(e){this._context=new Jx(e)}(qx.prototype=Object.create(Kx.prototype)).point=function(e,t){Kx.prototype.point.call(this,t,e)};function Jx(e){this._context=e}Jx.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 Yx(e){return new Kx(e)}function Xx(e){return new qx(e)}function Zx(e){this._context=e}Zx.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=Qx(e),i=Qx(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 Qx(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 $x(e){return new Zx(e)}function eS(e,t){this._context=e,this._t=t}eS.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 tS(e){return new eS(e,.5)}function nS(e){return new eS(e,0)}function rS(e){return new eS(e,1)}function iS(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 aS(e){for(var t=e.length,n=Array(t);--t>=0;)n[t]=t;return n}function oS(e,t){return e[t]}function sS(e){let t=[];return t.key=e,t}function cS(){var e=Ub([]),t=aS,n=iS,r=oS;function i(i){var a=Array.from(e.apply(this,arguments),sS),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=rx(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:Ub(Array.from(t)),i):e},i.value=function(e){return arguments.length?(r=typeof e==`function`?e:Ub(+e),i):r},i.order=function(e){return arguments.length?(t=e==null?aS:typeof e==`function`?e:Ub(Array.from(e)),i):t},i.offset=function(e){return arguments.length?(n=e??iS,i):n},i}function lS(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}iS(e,t)}}function uS(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}iS(e,t)}}function dS(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,iS(e,t)}}var fS=l(Hb());function pS(e){"@babel/helpers - typeof";return pS=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},pS(e)}var mS=[`type`,`size`,`sizeType`];function hS(){return hS=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},hS.apply(this,arguments)}function gS(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 _S(e){for(var t=1;t<arguments.length;t++){var n=arguments[t]==null?{}:arguments[t];t%2?gS(Object(n),!0).forEach(function(t){vS(e,t,n[t])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):gS(Object(n)).forEach(function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(n,t))})}return e}function vS(e,t,n){return t=yS(t),t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function yS(e){var t=bS(e,`string`);return pS(t)==`symbol`?t:t+``}function bS(e,t){if(pS(e)!=`object`||!e)return e;var n=e[Symbol.toPrimitive];if(n!==void 0){var r=n.call(e,t||`default`);if(pS(r)!=`object`)return r;throw TypeError(`@@toPrimitive must return a primitive value.`)}return(t===`string`?String:Number)(e)}function xS(e,t){if(e==null)return{};var n=SS(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 SS(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 CS={symbolCircle:px,symbolCross:mx,symbolDiamond:_x,symbolSquare:vx,symbolStar:Cx,symbolTriangle:Tx,symbolWye:Ax},wS=Math.PI/180,TS=function(e){return CS[`symbol${(0,fS.default)(e)}`]||px},ES=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*wS;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}},DS=function(e,t){CS[`symbol${(0,fS.default)(e)}`]=t},OS=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=_S(_S({},xS(e,mS)),{},{type:n,size:i,sizeType:o}),c=function(){var e=TS(n);return jx().type(e).size(ES(i,o,n))()},l=s.className,u=s.cx,d=s.cy,f=yb(s,!0);return u===+u&&d===+d&&i===+i?_.createElement(`path`,hS({},f,{className:Ht(`recharts-symbols`,l),transform:`translate(${u}, ${d})`,d:c()})):null};OS.registerSymbol=DS;function kS(e){"@babel/helpers - typeof";return kS=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},kS(e)}function AS(){return AS=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},AS.apply(this,arguments)}function jS(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 MS(e){for(var t=1;t<arguments.length;t++){var n=arguments[t]==null?{}:arguments[t];t%2?jS(Object(n),!0).forEach(function(t){LS(e,t,n[t])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):jS(Object(n)).forEach(function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(n,t))})}return e}function ute(e,t){if(!(e instanceof t))throw TypeError(`Cannot call a class as a function`)}function NS(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,RS(r.key),r)}}function dte(e,t,n){return t&&NS(e.prototype,t),n&&NS(e,n),Object.defineProperty(e,"prototype",{writable:!1}),e}function fte(e,t,n){return t=FS(t),pte(e,PS()?Reflect.construct(t,n||[],FS(e).constructor):t.apply(e,n))}function pte(e,t){if(t&&(kS(t)===`object`||typeof t==`function`))return t;if(t!==void 0)throw TypeError(`Derived constructors may only return object or undefined`);return mte(e)}function mte(e){if(e===void 0)throw ReferenceError(`this hasn't been initialised - super() hasn't been called`);return e}function PS(){try{var e=!Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],function(){}))}catch{}return(PS=function(){return!!e})()}function FS(e){return FS=Object.setPrototypeOf?Object.getPrototypeOf.bind():function(e){return e.__proto__||Object.getPrototypeOf(e)},FS(e)}function hte(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&&IS(e,t)}function IS(e,t){return IS=Object.setPrototypeOf?Object.setPrototypeOf.bind():function(e,t){return e.__proto__=t,e},IS(e,t)}function LS(e,t,n){return t=RS(t),t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function RS(e){var t=gte(e,`string`);return kS(t)==`symbol`?t:t+``}function gte(e,t){if(kS(e)!=`object`||!e)return e;var n=e[Symbol.toPrimitive];if(n!==void 0){var r=n.call(e,t||`default`);if(kS(r)!=`object`)return r;throw TypeError(`@@toPrimitive must return a primitive value.`)}return(t===`string`?String:Number)(e)}var zS=32,BS=function(e){function t(){return ute(this,t),fte(this,t,arguments)}return hte(t,e),dte(t,[{key:`renderIcon`,value:function(e){var t=this.props.inactiveColor,n=zS/2,r=zS/6,i=zS/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:zS,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${zS}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,${zS/8}h${zS}v${zS*3/4}h${-zS}z`,className:`recharts-legend-icon`});if(_.isValidElement(e.legendIcon)){var o=MS({},e);return delete o.legendIcon,_.cloneElement(e.legendIcon,o)}return _.createElement(OS,{fill:a,cx:n,cy:n,size:zS,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:zS,height:zS},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(LS(LS({"recharts-legend-item":!0},`legend-item-${n}`,!0),`inactive`,t.inactive));if(t.type===`none`)return null;var d=(0,eb.default)(t.value)?null:t.value;(0,eb.default)(t.value);var f=t.inactive?o:t.color;return _.createElement(`li`,AS({className:u,style:c,key:`legend-item-${n}`},$y(e.props,t,n)),_.createElement(kb,{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);LS(BS,`displayName`,`Legend`),LS(BS,`defaultProps`,{iconSize:14,layout:`horizontal`,align:`center`,verticalAlign:`middle`,inactiveColor:`#ccc`});var _te=o(((e,t)=>{var n=$v();function r(){this.__data__=new n,this.size=0}t.exports=r})),vte=o(((e,t)=>{function n(e){var t=this.__data__,n=t.delete(e);return this.size=t.size,n}t.exports=n})),yte=o(((e,t)=>{function n(e){return this.__data__.get(e)}t.exports=n})),bte=o(((e,t)=>{function n(e){return this.__data__.has(e)}t.exports=n})),xte=o(((e,t)=>{var n=$v(),r=ey(),i=cy(),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})),VS=o(((e,t)=>{var n=$v(),r=_te(),i=vte(),a=yte(),o=bte(),s=xte();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})),Ste=o(((e,t)=>{function n(e){return this.__data__.set(e,`__lodash_hash_undefined__`),this}t.exports=n})),Cte=o(((e,t)=>{function n(e){return this.__data__.has(e)}t.exports=n})),HS=o(((e,t)=>{var n=cy(),r=Ste(),i=Cte();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})),US=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})),WS=o(((e,t)=>{function n(e,t){return e.has(t)}t.exports=n})),GS=o(((e,t)=>{var n=HS(),r=US(),i=WS(),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})),wte=o(((e,t)=>{t.exports=Cv().Uint8Array})),Tte=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})),KS=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})),Ete=o(((e,t)=>{var n=wv(),r=wte(),i=qv(),a=GS(),o=Tte(),s=KS(),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})),qS=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})),Dte=o(((e,t)=>{var n=qS(),r=xv();function i(e,t,i){var a=t(e);return r(e)?a:n(a,i(e))}t.exports=i})),Ote=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})),kte=o(((e,t)=>{function n(){return[]}t.exports=n})),Ate=o(((e,t)=>{var n=Ote(),r=kte(),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})),jte=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})),Mte=o(((e,t)=>{var n=Dv(),r=Ov(),i=`[object Arguments]`;function a(e){return r(e)&&n(e)==i}t.exports=a})),JS=o(((e,t)=>{var n=Mte(),r=Ov(),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`)}})),Nte=o(((e,t)=>{function n(){return!1}t.exports=n})),YS=o(((e,t)=>{var n=Cv(),r=Nte(),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})),XS=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})),ZS=o(((e,t)=>{function n(e){return typeof e==`number`&&e>-1&&e%1==0&&e<=9007199254740991}t.exports=n})),Pte=o(((e,t)=>{var n=Dv(),r=ZS(),i=Ov(),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})),QS=o(((e,t)=>{function n(e){return function(t){return e(t)}}t.exports=n})),Fte=o(((e,t)=>{var n=Sv(),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{}}()})),$S=o(((e,t)=>{var n=Pte(),r=QS(),i=Fte(),a=i&&i.isTypedArray;t.exports=a?r(a):n})),Ite=o(((e,t)=>{var n=jte(),r=JS(),i=xv(),a=YS(),o=XS(),s=$S(),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})),Lte=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})),eC=o(((e,t)=>{function n(e,t){return function(n){return e(t(n))}}t.exports=n})),Rte=o(((e,t)=>{t.exports=eC()(Object.keys,Object)})),zte=o(((e,t)=>{var n=Lte(),r=Rte(),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})),tC=o(((e,t)=>{var n=Mv(),r=ZS();function i(e){return e!=null&&r(e.length)&&!n(e)}t.exports=i})),nC=o(((e,t)=>{var n=Ite(),r=zte(),i=tC();function a(e){return i(e)?n(e):r(e)}t.exports=a})),Bte=o(((e,t)=>{var n=Dte(),r=Ate(),i=nC();function a(e){return n(e,i,r)}t.exports=a})),Vte=o(((e,t)=>{var n=Bte(),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})),Hte=o(((e,t)=>{t.exports=Rv()(Cv(),`DataView`)})),Ute=o(((e,t)=>{t.exports=Rv()(Cv(),`Promise`)})),rC=o(((e,t)=>{t.exports=Rv()(Cv(),`Set`)})),Wte=o(((e,t)=>{t.exports=Rv()(Cv(),`WeakMap`)})),Gte=o(((e,t)=>{var n=Hte(),r=ey(),i=Ute(),a=rC(),o=Wte(),s=Dv(),c=Fv(),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})),Kte=o(((e,t)=>{var n=VS(),r=GS(),i=Ete(),a=Vte(),o=Gte(),s=xv(),c=YS(),l=$S(),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})),iC=o(((e,t)=>{var n=Kte(),r=Ov();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})),qte=o(((e,t)=>{var n=VS(),r=iC(),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})),aC=o(((e,t)=>{var n=jv();function r(e){return e===e&&!n(e)}t.exports=r})),Jte=o(((e,t)=>{var n=aC(),r=nC();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})),oC=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})),Yte=o(((e,t)=>{var n=qte(),r=Jte(),i=oC();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})),Xte=o(((e,t)=>{function n(e,t){return e!=null&&t in Object(e)}t.exports=n})),Zte=o(((e,t)=>{var n=hy(),r=JS(),i=xv(),a=XS(),o=ZS(),s=gy();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})),Qte=o(((e,t)=>{var n=Xte(),r=Zte();function i(e,t){return e!=null&&r(e,t,n)}t.exports=i})),$te=o(((e,t)=>{var n=iC(),r=vy(),i=Qte(),a=Av(),o=aC(),s=oC(),c=gy(),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})),sC=o(((e,t)=>{function n(e){return e}t.exports=n})),ene=o(((e,t)=>{function n(e){return function(t){return t?.[e]}}t.exports=n})),tne=o(((e,t)=>{var n=_y();function r(e){return function(t){return n(t,e)}}t.exports=r})),nne=o(((e,t)=>{var n=ene(),r=tne(),i=Av(),a=gy();function o(e){return i(e)?n(a(e)):r(e)}t.exports=o})),cC=o(((e,t)=>{var n=Yte(),r=$te(),i=sC(),a=xv(),o=nne();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})),lC=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})),rne=o(((e,t)=>{function n(e){return e!==e}t.exports=n})),ine=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})),ane=o(((e,t)=>{var n=lC(),r=rne(),i=ine();function a(e,t,a){return t===t?i(e,t,a):n(e,r,a)}t.exports=a})),one=o(((e,t)=>{var n=ane();function r(e,t){return!!(e!=null&&e.length)&&n(e,t,0)>-1}t.exports=r})),sne=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})),cne=o(((e,t)=>{function n(){}t.exports=n})),lne=o(((e,t)=>{var n=rC(),r=cne(),i=KS();t.exports=n&&1/i(new n([,-0]))[1]==1/0?function(e){return new n(e)}:r})),une=o(((e,t)=>{var n=HS(),r=one(),i=sne(),a=WS(),o=lne(),s=KS(),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})),uC=l(o(((e,t)=>{var n=cC(),r=une();function i(e,t){return e&&e.length?r(e,n(t,2)):[]}t.exports=i}))());function dC(e,t,n){return t===!0?(0,uC.default)(e,n):(0,eb.default)(t)?(0,uC.default)(e,t):e}function fC(e){"@babel/helpers - typeof";return fC=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},fC(e)}var dne=[`ref`];function pC(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 mC(e){for(var t=1;t<arguments.length;t++){var n=arguments[t]==null?{}:arguments[t];t%2?pC(Object(n),!0).forEach(function(t){yC(e,t,n[t])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):pC(Object(n)).forEach(function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(n,t))})}return e}function fne(e,t){if(!(e instanceof t))throw TypeError(`Cannot call a class as a function`)}function hC(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,bC(r.key),r)}}function pne(e,t,n){return t&&hC(e.prototype,t),n&&hC(e,n),Object.defineProperty(e,"prototype",{writable:!1}),e}function mne(e,t,n){return t=_C(t),hne(e,gC()?Reflect.construct(t,n||[],_C(e).constructor):t.apply(e,n))}function hne(e,t){if(t&&(fC(t)===`object`||typeof t==`function`))return t;if(t!==void 0)throw TypeError(`Derived constructors may only return object or undefined`);return gne(e)}function gne(e){if(e===void 0)throw ReferenceError(`this hasn't been initialised - super() hasn't been called`);return e}function gC(){try{var e=!Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],function(){}))}catch{}return(gC=function(){return!!e})()}function _C(e){return _C=Object.setPrototypeOf?Object.getPrototypeOf.bind():function(e){return e.__proto__||Object.getPrototypeOf(e)},_C(e)}function _ne(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&&vC(e,t)}function vC(e,t){return vC=Object.setPrototypeOf?Object.setPrototypeOf.bind():function(e,t){return e.__proto__=t,e},vC(e,t)}function yC(e,t,n){return t=bC(t),t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function bC(e){var t=vne(e,`string`);return fC(t)==`symbol`?t:t+``}function vne(e,t){if(fC(e)!=`object`||!e)return e;var n=e[Symbol.toPrimitive];if(n!==void 0){var r=n.call(e,t||`default`);if(fC(r)!=`object`)return r;throw TypeError(`@@toPrimitive must return a primitive value.`)}return(t===`string`?String:Number)(e)}function yne(e,t){if(e==null)return{};var n=bne(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 bne(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 xne(e){return e.value}function Sne(e,t){if(_.isValidElement(e))return _.cloneElement(e,t);if(typeof e==`function`)return _.createElement(e,t);t.ref;var n=yne(t,dne);return _.createElement(BS,n)}var xC=1,SC=function(e){function t(){var e;fne(this,t);var n=[...arguments];return e=mne(this,t,[].concat(n)),yC(e,`lastBoundingBox`,{width:-1,height:-1}),e}return _ne(t,e),pne(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)>xC||Math.abs(t.height-this.lastBoundingBox.height)>xC)&&(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?mC({},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 mC(mC({},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=mC(mC({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}},Sne(n,mC(mC({},this.props),{},{payload:dC(s,o,xne)})))}}],[{key:`getWithHeight`,value:function(e,t){var n=mC(mC({},this.defaultProps),e.props).layout;return n===`vertical`&&My(e.props.height)?{height:e.props.height}:n===`horizontal`?{width:e.props.width||t}:null}}])}(_.PureComponent);yC(SC,`displayName`,`Legend`),yC(SC,`defaultProps`,{iconSize:14,layout:`horizontal`,align:`center`,verticalAlign:`bottom`});var Cne=o(((e,t)=>{var n=wv(),r=JS(),i=xv(),a=n?n.isConcatSpreadable:void 0;function o(e){return i(e)||r(e)||!!(a&&e&&e[a])}t.exports=o})),CC=o(((e,t)=>{var n=qS(),r=Cne();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})),wne=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})),Tne=o(((e,t)=>{t.exports=wne()()})),wC=o(((e,t)=>{var n=Tne(),r=nC();function i(e,t){return e&&n(e,t,r)}t.exports=i})),Ene=o(((e,t)=>{var n=tC();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})),TC=o(((e,t)=>{var n=wC();t.exports=Ene()(n)})),EC=o(((e,t)=>{var n=TC(),r=tC();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})),Dne=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})),One=o(((e,t)=>{var n=kv();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})),kne=o(((e,t)=>{var n=One();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})),Ane=o(((e,t)=>{var n=fy(),r=_y(),i=cC(),a=EC(),o=Dne(),s=QS(),c=kne(),l=sC(),u=xv();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})),jne=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})),Mne=o(((e,t)=>{var n=jne(),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})),Nne=o(((e,t)=>{function n(e){return function(){return e}}t.exports=n})),DC=o(((e,t)=>{var n=Rv();t.exports=function(){try{var e=n(Object,`defineProperty`);return e({},``,{}),e}catch{}}()})),Pne=o(((e,t)=>{var n=Nne(),r=DC(),i=sC();t.exports=r?function(e,t){return r(e,`toString`,{configurable:!0,enumerable:!1,value:n(t),writable:!0})}:i})),Fne=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})),Ine=o(((e,t)=>{var n=Pne();t.exports=Fne()(n)})),Lne=o(((e,t)=>{var n=sC(),r=Mne(),i=Ine();function a(e,t){return i(r(e,t,n),e+``)}t.exports=a})),OC=o(((e,t)=>{var n=qv(),r=tC(),i=XS(),a=jv();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})),kC=l(o(((e,t)=>{var n=CC(),r=Ane(),i=Lne(),a=OC();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 AC(e){"@babel/helpers - typeof";return AC=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},AC(e)}function jC(){return jC=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},jC.apply(this,arguments)}function Rne(e,t){return Hne(e)||Vne(e,t)||Bne(e,t)||zne()}function zne(){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 Bne(e,t){if(e){if(typeof e==`string`)return MC(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 MC(e,t)}}function MC(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 Vne(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 Hne(e){if(Array.isArray(e))return e}function NC(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 PC(e){for(var t=1;t<arguments.length;t++){var n=arguments[t]==null?{}:arguments[t];t%2?NC(Object(n),!0).forEach(function(t){Une(e,t,n[t])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):NC(Object(n)).forEach(function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(n,t))})}return e}function Une(e,t,n){return t=Wne(t),t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function Wne(e){var t=Gne(e,`string`);return AC(t)==`symbol`?t:t+``}function Gne(e,t){if(AC(e)!=`object`||!e)return e;var n=e[Symbol.toPrimitive];if(n!==void 0){var r=n.call(e,t||`default`);if(AC(r)!=`object`)return r;throw TypeError(`@@toPrimitive must return a primitive value.`)}return(t===`string`?String:Number)(e)}function Kne(e){return Array.isArray(e)&&Py(e[0])&&Py(e[1])?e.join(` ~ `):e}var qne=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,kC.default)(l,d):l).map(function(e,t){if(e.type===`none`)return null;var r=PC({display:`block`,paddingTop:4,paddingBottom:4,color:e.color||`#000`},o),i=e.formatter||u||Kne,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=Rne(f,2);c=p[0],d=p[1]}else c=f}return _.createElement(`li`,{className:`recharts-tooltip-item`,key:`tooltip-item-${t}`,style:r},Py(d)?_.createElement(`span`,{className:`recharts-tooltip-item-name`},d):null,Py(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=PC({margin:0,padding:10,backgroundColor:`#fff`,border:`1px solid #ccc`,whiteSpace:`nowrap`},i),x=PC({margin:0},c),S=!(0,ky.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`,jC({className:w,style:b},E),_.createElement(`p`,{className:T,style:x},_.isValidElement(C)?C:`${C}`),y())};function FC(e){"@babel/helpers - typeof";return FC=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},FC(e)}function IC(e,t,n){return t=LC(t),t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function LC(e){var t=Jne(e,`string`);return FC(t)==`symbol`?t:t+``}function Jne(e,t){if(FC(e)!=`object`||!e)return e;var n=e[Symbol.toPrimitive];if(n!==void 0){var r=n.call(e,t||`default`);if(FC(r)!=`object`)return r;throw TypeError(`@@toPrimitive must return a primitive value.`)}return(t===`string`?String:Number)(e)}var RC=`recharts-tooltip-wrapper`,zC={visibility:`hidden`};function BC(e){var t=e.coordinate,n=e.translateX,r=e.translateY;return Ht(RC,IC(IC(IC(IC({},`${RC}-right`,My(n)&&t&&My(t.x)&&n>=t.x),`${RC}-left`,My(n)&&t&&My(t.x)&&n<t.x),`${RC}-bottom`,My(r)&&t&&My(t.y)&&r>=t.y),`${RC}-top`,My(r)&&t&&My(t.y)&&r<t.y))}function VC(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&&My(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 Yne(e){var t=e.translateX,n=e.translateY;return{transform:e.useTranslate3d?`translate3d(${t}px, ${n}px, 0)`:`translate(${t}px, ${n}px)`}}function HC(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=VC({allowEscapeViewBox:t,coordinate:n,key:`x`,offsetTopLeft:r,position:i,reverseDirection:a,tooltipDimension:o.width,viewBox:c,viewBoxDimension:c.width}),d=VC({allowEscapeViewBox:t,coordinate:n,key:`y`,offsetTopLeft:r,position:i,reverseDirection:a,tooltipDimension:o.height,viewBox:c,viewBoxDimension:c.height}),l=Yne({translateX:u,translateY:d,useTranslate3d:s})):l=zC,{cssProperties:l,cssClasses:BC({translateX:u,translateY:d,coordinate:n})}}function UC(e){"@babel/helpers - typeof";return UC=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},UC(e)}function WC(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 GC(e){for(var t=1;t<arguments.length;t++){var n=arguments[t]==null?{}:arguments[t];t%2?WC(Object(n),!0).forEach(function(t){ew(e,t,n[t])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):WC(Object(n)).forEach(function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(n,t))})}return e}function Xne(e,t){if(!(e instanceof t))throw TypeError(`Cannot call a class as a function`)}function KC(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,tw(r.key),r)}}function Zne(e,t,n){return t&&KC(e.prototype,t),n&&KC(e,n),Object.defineProperty(e,"prototype",{writable:!1}),e}function qC(e,t,n){return t=ZC(t),JC(e,XC()?Reflect.construct(t,n||[],ZC(e).constructor):t.apply(e,n))}function JC(e,t){if(t&&(UC(t)===`object`||typeof t==`function`))return t;if(t!==void 0)throw TypeError(`Derived constructors may only return object or undefined`);return YC(e)}function YC(e){if(e===void 0)throw ReferenceError(`this hasn't been initialised - super() hasn't been called`);return e}function XC(){try{var e=!Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],function(){}))}catch{}return(XC=function(){return!!e})()}function ZC(e){return ZC=Object.setPrototypeOf?Object.getPrototypeOf.bind():function(e){return e.__proto__||Object.getPrototypeOf(e)},ZC(e)}function QC(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&&$C(e,t)}function $C(e,t){return $C=Object.setPrototypeOf?Object.setPrototypeOf.bind():function(e,t){return e.__proto__=t,e},$C(e,t)}function ew(e,t,n){return t=tw(t),t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function tw(e){var t=nw(e,`string`);return UC(t)==`symbol`?t:t+``}function nw(e,t){if(UC(e)!=`object`||!e)return e;var n=e[Symbol.toPrimitive];if(n!==void 0){var r=n.call(e,t||`default`);if(UC(r)!=`object`)return r;throw TypeError(`@@toPrimitive must return a primitive value.`)}return(t===`string`?String:Number)(e)}var rw=1,Qne=function(e){function t(){var e;Xne(this,t);var n=[...arguments];return e=qC(this,t,[].concat(n)),ew(e,`state`,{dismissed:!1,dismissedAtCoordinate:{x:0,y:0},lastBoundingBox:{width:-1,height:-1}}),ew(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 QC(t,e),Zne(t,[{key:`updateBBox`,value:function(){if(this.wrapperNode&&this.wrapperNode.getBoundingClientRect){var e=this.wrapperNode.getBoundingClientRect();(Math.abs(e.width-this.state.lastBoundingBox.width)>rw||Math.abs(e.height-this.state.lastBoundingBox.height)>rw)&&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=HC({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=GC(GC({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),iw={isSsr:function(){return!(typeof window<`u`&&window.document&&window.document.createElement&&window.setTimeout)}(),get:function(e){return iw[e]},set:function(e,t){if(typeof e==`string`)iw[e]=t;else{var n=Object.keys(e);n&&n.length&&n.forEach(function(t){iw[t]=e[t]})}}};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){pw(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 $ne(e,t){if(!(e instanceof t))throw TypeError(`Cannot call a class as a function`)}function cw(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,mw(r.key),r)}}function ere(e,t,n){return t&&cw(e.prototype,t),n&&cw(e,n),Object.defineProperty(e,"prototype",{writable:!1}),e}function tre(e,t,n){return t=uw(t),nre(e,lw()?Reflect.construct(t,n||[],uw(e).constructor):t.apply(e,n))}function nre(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 rre(e)}function rre(e){if(e===void 0)throw ReferenceError(`this hasn't been initialised - super() hasn't been called`);return e}function lw(){try{var e=!Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],function(){}))}catch{}return(lw=function(){return!!e})()}function uw(e){return uw=Object.setPrototypeOf?Object.getPrototypeOf.bind():function(e){return e.__proto__||Object.getPrototypeOf(e)},uw(e)}function dw(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&&fw(e,t)}function fw(e,t){return fw=Object.setPrototypeOf?Object.setPrototypeOf.bind():function(e,t){return e.__proto__=t,e},fw(e,t)}function pw(e,t,n){return t=mw(t),t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function mw(e){var t=hw(e,`string`);return aw(t)==`symbol`?t:t+``}function hw(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)}function gw(e){return e.dataKey}function _w(e,t){return _.isValidElement(e)?_.cloneElement(e,t):typeof e==`function`?_.createElement(e,t):_.createElement(qne,t)}var vw=function(e){function t(){return $ne(this,t),tre(this,t,arguments)}return dw(t,e),ere(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=dC(d.filter(function(t){return t.value!=null&&(t.hide!==!0||e.props.includeHidden)}),f,gw));var b=y.length>0;return _.createElement(Qne,{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},_w(o,sw(sw({},this.props),{},{payload:y})))}}])}(_.PureComponent);pw(vw,`displayName`,`Tooltip`),pw(vw,`defaultProps`,{accessibilityLayer:!1,allowEscapeViewBox:{x:!1,y:!1},animationDuration:400,animationEasing:`ease`,contentStyle:{},coordinate:{x:0,y:0},cursor:!0,cursorStyle:{},filterNull:!0,isAnimationActive:!iw.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 yw=o(((e,t)=>{var n=Cv();t.exports=function(){return n.Date.now()}})),bw=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})),xw=o(((e,t)=>{var n=bw(),r=/^\s+/;function i(e){return e&&e.slice(0,n(e)+1).replace(r,``)}t.exports=i})),Sw=o(((e,t)=>{var n=xw(),r=jv(),i=kv(),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})),Cw=o(((e,t)=>{var n=jv(),r=yw(),i=Sw(),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})),ww=l(o(((e,t)=>{var n=Cw(),r=jv(),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 Tw(e){"@babel/helpers - typeof";return Tw=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},Tw(e)}function Ew(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 Dw(e){for(var t=1;t<arguments.length;t++){var n=arguments[t]==null?{}:arguments[t];t%2?Ew(Object(n),!0).forEach(function(t){Ow(e,t,n[t])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):Ew(Object(n)).forEach(function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(n,t))})}return e}function Ow(e,t,n){return t=kw(t),t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function kw(e){var t=Aw(e,`string`);return Tw(t)==`symbol`?t:t+``}function Aw(e,t){if(Tw(e)!=`object`||!e)return e;var n=e[Symbol.toPrimitive];if(n!==void 0){var r=n.call(e,t||`default`);if(Tw(r)!=`object`)return r;throw TypeError(`@@toPrimitive must return a primitive value.`)}return(t===`string`?String:Number)(e)}function jw(e,t){return Iw(e)||Fw(e,t)||Nw(e,t)||Mw()}function Mw(){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 Nw(e,t){if(e){if(typeof e==`string`)return Pw(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 Pw(e,t)}}function Pw(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 Fw(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 Iw(e){if(Array.isArray(e))return e}var Lw=(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=jw((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,ww.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;jy(o)||jy(c);var r=jy(o)?e:o,i=jy(c)?t:c;n&&n>0&&(r?i=r/n:i&&(r=i*n),f&&i>f&&(i=f));var a=!Array.isArray(p)&&cb(p.type).endsWith(`Chart`);return _.Children.map(p,function(e){return _.isValidElement(e)?(0,_.cloneElement)(e,Dw({width:r,height:i},a?{style:Dw({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:Dw(Dw({},x),{},{width:o,height:c,minWidth:u,minHeight:d,maxHeight:f}),ref:S},O)}),Rw=function(e){return null};Rw.displayName=`Cell`;function zw(e){"@babel/helpers - typeof";return zw=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},zw(e)}function Bw(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 Vw(e){for(var t=1;t<arguments.length;t++){var n=arguments[t]==null?{}:arguments[t];t%2?Bw(Object(n),!0).forEach(function(t){Hw(e,t,n[t])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):Bw(Object(n)).forEach(function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(n,t))})}return e}function Hw(e,t,n){return t=Uw(t),t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function Uw(e){var t=Ww(e,`string`);return zw(t)==`symbol`?t:t+``}function Ww(e,t){if(zw(e)!=`object`||!e)return e;var n=e[Symbol.toPrimitive];if(n!==void 0){var r=n.call(e,t||`default`);if(zw(r)!=`object`)return r;throw TypeError(`@@toPrimitive must return a primitive value.`)}return(t===`string`?String:Number)(e)}var Gw={widthCache:{},cacheCount:0},Kw=2e3,qw={position:`absolute`,top:`-20000px`,left:0,padding:0,margin:0,border:`none`,whiteSpace:`pre`},Jw=`recharts_measurement_span`;function Yw(e){var t=Vw({},e);return Object.keys(t).forEach(function(e){t[e]||delete t[e]}),t}var Xw=function(e){var t=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{};if(e==null||iw.isSsr)return{width:0,height:0};var n=Yw(t),r=JSON.stringify({text:e,copyStyle:n});if(Gw.widthCache[r])return Gw.widthCache[r];try{var i=document.getElementById(Jw);i||(i=document.createElement(`span`),i.setAttribute(`id`,Jw),i.setAttribute(`aria-hidden`,`true`),document.body.appendChild(i));var a=Vw(Vw({},qw),n);Object.assign(i.style,a),i.textContent=`${e}`;var o=i.getBoundingClientRect(),s={width:o.width,height:o.height};return Gw.widthCache[r]=s,++Gw.cacheCount>Kw&&(Gw.cacheCount=0,Gw.widthCache={}),s}catch{return{width:0,height:0}}},Zw=function(e){return{top:e.top+window.scrollY-document.documentElement.clientTop,left:e.left+window.scrollX-document.documentElement.clientLeft}};function Qw(e){"@babel/helpers - typeof";return Qw=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},Qw(e)}function $w(e,t){return ore(e)||are(e,t)||ire(e,t)||eT()}function eT(){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 ire(e,t){if(e){if(typeof e==`string`)return tT(e,t);var n=Object.prototype.toString.call(e).slice(8,-1);if(n===`Object`&&e.constructor&&(n=e.constructor.name),n===`Map`||n===`Set`)return Array.from(e);if(n===`Arguments`||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n))return tT(e,t)}}function tT(e,t){(t==null||t>e.length)&&(t=e.length);for(var n=0,r=Array(t);n<t;n++)r[n]=e[n];return r}function are(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 ore(e){if(Array.isArray(e))return e}function sre(e,t){if(!(e instanceof t))throw TypeError(`Cannot call a class as a function`)}function nT(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,lre(r.key),r)}}function cre(e,t,n){return t&&nT(e.prototype,t),n&&nT(e,n),Object.defineProperty(e,"prototype",{writable:!1}),e}function lre(e){var t=ure(e,`string`);return Qw(t)==`symbol`?t:t+``}function ure(e,t){if(Qw(e)!=`object`||!e)return e;var n=e[Symbol.toPrimitive];if(n!==void 0){var r=n.call(e,t||`default`);if(Qw(r)!=`object`)return r;throw TypeError(`@@toPrimitive must return a primitive value.`)}return(t===`string`?String:Number)(e)}var rT=/(-?\d+(?:\.\d+)?[a-zA-Z%]*)([*/])(-?\d+(?:\.\d+)?[a-zA-Z%]*)/,iT=/(-?\d+(?:\.\d+)?[a-zA-Z%]*)([+-])(-?\d+(?:\.\d+)?[a-zA-Z%]*)/,dre=/^px|cm|vh|vw|em|rem|%|mm|in|pt|pc|ex|ch|vmin|vmax|Q$/,fre=/(-?\d+(?:\.\d+)?)([a-zA-Z%]+)?/,aT={cm:96/2.54,mm:96/25.4,pt:96/72,pc:16,in:96,Q:96/101.6,px:1},pre=Object.keys(aT),oT=`NaN`;function mre(e,t){return e*aT[t]}var sT=function(){function e(t,n){sre(this,e),this.num=t,this.unit=n,this.num=t,this.unit=n,Number.isNaN(t)&&(this.unit=``),n!==``&&!dre.test(n)&&(this.num=NaN,this.unit=``),pre.includes(n)&&(this.num=mre(t,n),this.unit=`px`)}return cre(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=$w(fre.exec(t)??[],3),r=n[1],i=n[2];return new e(parseFloat(r),i??``)}}])}();function cT(e){if(e.includes(oT))return oT;for(var t=e;t.includes(`*`)||t.includes(`/`);){var n=$w(rT.exec(t)??[],4),r=n[1],i=n[2],a=n[3],o=sT.parse(r??``),s=sT.parse(a??``),c=i===`*`?o.multiply(s):o.divide(s);if(c.isNaN())return oT;t=t.replace(rT,c.toString())}for(;t.includes(`+`)||/.-\d+(?:\.\d+)?/.test(t);){var l=$w(iT.exec(t)??[],4),u=l[1],d=l[2],f=l[3],p=sT.parse(u??``),m=sT.parse(f??``),h=d===`+`?p.add(m):p.subtract(m);if(h.isNaN())return oT;t=t.replace(iT,h.toString())}return t}var lT=/\(([^()]*)\)/;function hre(e){for(var t=e;t.includes(`(`);){var n=$w(lT.exec(t),2)[1];t=t.replace(lT,cT(n))}return t}function gre(e){var t=e.replace(/\s+/g,``);return t=hre(t),t=cT(t),t}function _re(e){try{return gre(e)}catch{return oT}}function uT(e){var t=_re(e.slice(5,-1));return t===oT?``:t}var vre=[`x`,`y`,`lineHeight`,`capHeight`,`scaleToFit`,`textAnchor`,`verticalAnchor`,`fill`],yre=[`dx`,`dy`,`angle`,`className`,`breakAll`];function dT(){return dT=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},dT.apply(this,arguments)}function fT(e,t){if(e==null)return{};var n=bre(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 bre(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 pT(e,t){return wre(e)||Cre(e,t)||Sre(e,t)||xre()}function xre(){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 Sre(e,t){if(e){if(typeof e==`string`)return mT(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 mT(e,t)}}function mT(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 Cre(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 wre(e){if(Array.isArray(e))return e}var hT=/[ \f\n\r\t\v\u2028\u2029]+/,gT=function(e){var t=e.children,n=e.breakAll,r=e.style;try{var i=[];return(0,ky.default)(t)||(i=n?t.toString().split(``):t.toString().split(hT)),{wordsWithComputedWidth:i.map(function(e){return{word:e,width:Xw(e,r).width}}),spaceWidth:n?0:Xw(`\xA0`,r).width}}catch{return null}},_T=function(e,t,n,r,i){var a=e.maxLines,o=e.children,s=e.style,c=e.breakAll,l=My(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=gT({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=pT(h(b-1),2),S=x[0],C=x[1],w=pT(h(b),1)[0];if(!S&&!w&&(g=b+1),S&&w&&(_=b-1),!S&&w){y=C;break}v++}return y||f},vT=function(e){return[{words:(0,ky.default)(e)?[]:e.toString().split(hT)}]},yT=function(e){var t=e.width,n=e.scaleToFit,r=e.children,i=e.style,a=e.breakAll,o=e.maxLines;if((t||n)&&!iw.isSsr){var s,c,l=gT({breakAll:a,children:r,style:i});if(l){var u=l.wordsWithComputedWidth,d=l.spaceWidth;s=u,c=d}else return vT(r);return _T({breakAll:a,children:r,maxLines:o,style:i},s,c,t,n)}return vT(r)},bT=`#808080`,xT=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?bT:h,v=fT(e,vre),y=(0,_.useMemo)(function(){return yT({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=fT(v,yre);if(!Py(n)||!Py(i))return null;var E=n+(My(b)?b:0),D=i+(My(x)?x:0),O;switch(m){case`start`:O=uT(`calc(${c})`);break;case`middle`:O=uT(`calc(${(y.length-1)/2} * -${o} + (${c} / 2))`);break;default:O=uT(`calc(${y.length-1} * -${o})`)}var k=[];if(u){var A=y[0].width,j=v.width;k.push(`scale(${(My(j)?j/A:1)/A})`)}return S&&k.push(`rotate(${S}, ${E}, ${D})`),k.length&&(T.transform=k.join(` `)),_.createElement(`text`,dT({},yb(T,!0),{x:E,y:D,className:Ht(`recharts-text`,C),textAnchor:f,fill:g.includes(`url`)?bT: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 ST(e,t){return e==null||t==null?NaN:e<t?-1:e>t?1:e>=t?0:NaN}function CT(e,t){return e==null||t==null?NaN:t<e?-1:t>e?1:t>=e?0:NaN}function wT(e){let t,n,r;e.length===2?(t=e===ST||e===CT?e:TT,n=e,r=e):(t=ST,n=(t,n)=>ST(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 TT(){return 0}function ET(e){return e===null?NaN:+e}function*DT(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 OT=wT(ST),kT=OT.right;OT.left,wT(ET).center;var AT=class extends Map{constructor(e,t=PT){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(jT(this,e))}has(e){return super.has(jT(this,e))}set(e,t){return super.set(MT(this,e),t)}delete(e){return super.delete(NT(this,e))}};function jT({_intern:e,_key:t},n){let r=t(n);return e.has(r)?e.get(r):n}function MT({_intern:e,_key:t},n){let r=t(n);return e.has(r)?e.get(r):(e.set(r,n),n)}function NT({_intern:e,_key:t},n){let r=t(n);return e.has(r)&&(n=e.get(r),e.delete(r)),n}function PT(e){return typeof e==`object`&&e?e.valueOf():e}function FT(e=ST){if(e===ST)return IT;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 IT(e,t){return(e==null||!(e>=e))-(t==null||!(t>=t))||(e<t?-1:+(e>t))}var LT=Math.sqrt(50),RT=Math.sqrt(10),zT=Math.sqrt(2);function BT(e,t,n){let r=(t-e)/Math.max(0,n),i=Math.floor(Math.log10(r)),a=r/10**i,o=a>=LT?10:a>=RT?5:a>=zT?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?BT(e,t,n*2):[s,c,l]}function VT(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?BT(t,e,n):BT(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 HT(e,t,n){return t=+t,e=+e,n=+n,BT(e,t,n)[2]}function UT(e,t,n){t=+t,e=+e,n=+n;let r=t<e,i=r?HT(t,e,n):HT(e,t,n);return(r?-1:1)*(i<0?1/-i:i)}function WT(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 GT(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 KT(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?IT:FT(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));KT(e,t,u,d,i)}let a=e[t],o=n,s=r;for(qT(e,n,t),i(e[r],a)>0&&qT(e,n,r);o<s;){for(qT(e,o,s),++o,--s;i(e[o],a)<0;)++o;for(;i(e[s],a)>0;)--s}i(e[n],a)===0?qT(e,n,s):(++s,qT(e,s,r)),s<=t&&(n=s+1),t<=s&&(r=s-1)}return e}function qT(e,t,n){let r=e[t];e[t]=e[n],e[n]=r}function JT(e,t,n){if(e=Float64Array.from(DT(e,n)),(r=e.length)&&!isNaN(t=+t)){if(t<=0||r<2)return GT(e);if(t>=1)return WT(e);var r,i=(r-1)*t,a=Math.floor(i),o=WT(KT(e,a).subarray(0,a+1));return o+(GT(e.subarray(a+1))-o)*(i-a)}}function YT(e,t,n=ET){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 XT(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 ZT(e,t){switch(arguments.length){case 0:break;case 1:this.range(e);break;default:this.range(t).domain(e)}return this}function QT(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 $T=Symbol(`implicit`);function eE(){var e=new AT,t=[],n=[],r=$T;function i(i){let a=e.get(i);if(a===void 0){if(r!==$T)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 AT;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 eE(t,n).unknown(r)},ZT.apply(i,arguments),i}function tE(){var e=eE().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=XT(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 tE(t(),[r,i]).round(s).paddingInner(c).paddingOuter(l).align(u)},ZT.apply(d(),arguments)}function nE(e){var t=e.copy;return e.padding=e.paddingOuter,delete e.paddingInner,delete e.paddingOuter,e.copy=function(){return nE(t())},e}function rE(){return nE(tE.apply(null,arguments).paddingInner(1))}function iE(e,t,n){e.prototype=t.prototype=n,n.constructor=e}function aE(e,t){var n=Object.create(e.prototype);for(var r in t)n[r]=t[r];return n}function oE(){}var sE=.7,cE=1/sE,lE=`\\s*([+-]?\\d+)\\s*`,uE=`\\s*([+-]?(?:\\d*\\.)?\\d+(?:[eE][+-]?\\d+)?)\\s*`,dE=`\\s*([+-]?(?:\\d*\\.)?\\d+(?:[eE][+-]?\\d+)?)%\\s*`,fE=/^#([0-9a-f]{3,8})$/,pE=RegExp(`^rgb\\(${lE},${lE},${lE}\\)$`),mE=RegExp(`^rgb\\(${dE},${dE},${dE}\\)$`),hE=RegExp(`^rgba\\(${lE},${lE},${lE},${uE}\\)$`),gE=RegExp(`^rgba\\(${dE},${dE},${dE},${uE}\\)$`),_E=RegExp(`^hsl\\(${uE},${dE},${dE}\\)$`),vE=RegExp(`^hsla\\(${uE},${dE},${dE},${uE}\\)$`),yE={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};iE(oE,wE,{copy(e){return Object.assign(new this.constructor,this,e)},displayable(){return this.rgb().displayable()},hex:bE,formatHex:bE,formatHex8:xE,formatHsl:SE,formatRgb:CE,toString:CE});function bE(){return this.rgb().formatHex()}function xE(){return this.rgb().formatHex8()}function SE(){return LE(this).formatHsl()}function CE(){return this.rgb().formatRgb()}function wE(e){var t,n;return e=(e+``).trim().toLowerCase(),(t=fE.exec(e))?(n=t[1].length,t=parseInt(t[1],16),n===6?TE(t):n===3?new kE(t>>8&15|t>>4&240,t>>4&15|t&240,(t&15)<<4|t&15,1):n===8?EE(t>>24&255,t>>16&255,t>>8&255,(t&255)/255):n===4?EE(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=pE.exec(e))?new kE(t[1],t[2],t[3],1):(t=mE.exec(e))?new kE(t[1]*255/100,t[2]*255/100,t[3]*255/100,1):(t=hE.exec(e))?EE(t[1],t[2],t[3],t[4]):(t=gE.exec(e))?EE(t[1]*255/100,t[2]*255/100,t[3]*255/100,t[4]):(t=_E.exec(e))?IE(t[1],t[2]/100,t[3]/100,1):(t=vE.exec(e))?IE(t[1],t[2]/100,t[3]/100,t[4]):yE.hasOwnProperty(e)?TE(yE[e]):e===`transparent`?new kE(NaN,NaN,NaN,0):null}function TE(e){return new kE(e>>16&255,e>>8&255,e&255,1)}function EE(e,t,n,r){return r<=0&&(e=t=n=NaN),new kE(e,t,n,r)}function DE(e){return e instanceof oE||(e=wE(e)),e?(e=e.rgb(),new kE(e.r,e.g,e.b,e.opacity)):new kE}function OE(e,t,n,r){return arguments.length===1?DE(e):new kE(e,t,n,r??1)}function kE(e,t,n,r){this.r=+e,this.g=+t,this.b=+n,this.opacity=+r}iE(kE,OE,aE(oE,{brighter(e){return e=e==null?cE:cE**+e,new kE(this.r*e,this.g*e,this.b*e,this.opacity)},darker(e){return e=e==null?sE:sE**+e,new kE(this.r*e,this.g*e,this.b*e,this.opacity)},rgb(){return this},clamp(){return new kE(PE(this.r),PE(this.g),PE(this.b),NE(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:AE,formatHex:AE,formatHex8:jE,formatRgb:ME,toString:ME}));function AE(){return`#${FE(this.r)}${FE(this.g)}${FE(this.b)}`}function jE(){return`#${FE(this.r)}${FE(this.g)}${FE(this.b)}${FE((isNaN(this.opacity)?1:this.opacity)*255)}`}function ME(){let e=NE(this.opacity);return`${e===1?`rgb(`:`rgba(`}${PE(this.r)}, ${PE(this.g)}, ${PE(this.b)}${e===1?`)`:`, ${e})`}`}function NE(e){return isNaN(e)?1:Math.max(0,Math.min(1,e))}function PE(e){return Math.max(0,Math.min(255,Math.round(e)||0))}function FE(e){return e=PE(e),(e<16?`0`:``)+e.toString(16)}function IE(e,t,n,r){return r<=0?e=t=n=NaN:n<=0||n>=1?e=t=NaN:t<=0&&(e=NaN),new zE(e,t,n,r)}function LE(e){if(e instanceof zE)return new zE(e.h,e.s,e.l,e.opacity);if(e instanceof oE||(e=wE(e)),!e)return new zE;if(e instanceof zE)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 zE(o,s,c,e.opacity)}function RE(e,t,n,r){return arguments.length===1?LE(e):new zE(e,t,n,r??1)}function zE(e,t,n,r){this.h=+e,this.s=+t,this.l=+n,this.opacity=+r}iE(zE,RE,aE(oE,{brighter(e){return e=e==null?cE:cE**+e,new zE(this.h,this.s,this.l*e,this.opacity)},darker(e){return e=e==null?sE:sE**+e,new zE(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 kE(HE(e>=240?e-240:e+120,i,r),HE(e,i,r),HE(e<120?e+240:e-120,i,r),this.opacity)},clamp(){return new zE(BE(this.h),VE(this.s),VE(this.l),NE(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=NE(this.opacity);return`${e===1?`hsl(`:`hsla(`}${BE(this.h)}, ${VE(this.s)*100}%, ${VE(this.l)*100}%${e===1?`)`:`, ${e})`}`}}));function BE(e){return e=(e||0)%360,e<0?e+360:e}function VE(e){return Math.max(0,Math.min(1,e||0))}function HE(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 UE=e=>()=>e;function WE(e,t){return function(n){return e+n*t}}function GE(e,t,n){return e**=+n,t=t**+n-e,n=1/n,function(r){return(e+r*t)**+n}}function KE(e){return(e=+e)==1?qE:function(t,n){return n-t?GE(t,n,e):UE(isNaN(t)?n:t)}}function qE(e,t){var n=t-e;return n?WE(e,n):UE(isNaN(e)?t:e)}var JE=(function e(t){var n=KE(t);function r(e,t){var r=n((e=OE(e)).r,(t=OE(t)).r),i=n(e.g,t.g),a=n(e.b,t.b),o=qE(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 YE(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 XE(e){return ArrayBuffer.isView(e)&&!(e instanceof DataView)}function ZE(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]=oD(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 QE(e,t){var n=new Date;return e=+e,t=+t,function(r){return n.setTime(e*(1-r)+t*r),n}}function $E(e,t){return e=+e,t=+t,function(n){return e*(1-n)+t*n}}function eD(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]=oD(e[i],t[i]):r[i]=t[i];return function(e){for(i in n)r[i]=n[i](e);return r}}var tD=/[-+]?(?:\d+\.?\d*|\.?\d+)(?:[eE][-+]?\d+)?/g,nD=new RegExp(tD.source,`g`);function rD(e){return function(){return e}}function iD(e){return function(t){return e(t)+``}}function aD(e,t){var n=tD.lastIndex=nD.lastIndex=0,r,i,a,o=-1,s=[],c=[];for(e+=``,t+=``;(r=tD.exec(e))&&(i=nD.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:$E(r,i)})),n=nD.lastIndex;return n<t.length&&(a=t.slice(n),s[o]?s[o]+=a:s[++o]=a),s.length<2?c[0]?iD(c[0].x):rD(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 oD(e,t){var n=typeof t,r;return t==null||n===`boolean`?UE(t):(n===`number`?$E:n===`string`?(r=wE(t))?(t=r,JE):aD:t instanceof wE?JE:t instanceof Date?QE:XE(t)?YE:Array.isArray(t)?ZE:typeof t.valueOf!=`function`&&typeof t.toString!=`function`||isNaN(t)?eD:$E)(e,t)}function sD(e,t){return e=+e,t=+t,function(n){return Math.round(e*(1-n)+t*n)}}function cD(e,t){t===void 0&&(t=e,e=oD);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 lD(e){return function(){return e}}function uD(e){return+e}var dD=[0,1];function fD(e){return e}function pD(e,t){return(t-=e=+e)?function(n){return(n-e)/t}:lD(isNaN(t)?NaN:.5)}function mD(e,t){var n;return e>t&&(n=e,e=t,t=n),function(n){return Math.max(e,Math.min(t,n))}}function hD(e,t,n){var r=e[0],i=e[1],a=t[0],o=t[1];return i<r?(r=pD(i,r),a=n(o,a)):(r=pD(r,i),a=n(a,o)),function(e){return a(r(e))}}function gD(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]=pD(e[o],e[o+1]),a[o]=n(t[o],t[o+1]);return function(t){var n=kT(e,t,1,r)-1;return a[n](i[n](t))}}function _D(e,t){return t.domain(e.domain()).range(e.range()).interpolate(e.interpolate()).clamp(e.clamp()).unknown(e.unknown())}function vD(){var e=dD,t=dD,n=oD,r,i,a,o=fD,s,c,l;function u(){var n=Math.min(e.length,t.length);return o!==fD&&(o=mD(e[0],e[n-1])),s=n>2?gD:hD,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),$E))(n)))},d.domain=function(t){return arguments.length?(e=Array.from(t,uD),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=sD,u()},d.clamp=function(e){return arguments.length?(o=e?!0:fD,u()):o!==fD},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 yD(){return vD()(fD,fD)}function bD(e){return Math.abs(e=Math.round(e))>=1e21?e.toLocaleString(`en`).replace(/,/g,``):e.toString(10)}function xD(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 SD(e){return e=xD(Math.abs(e)),e?e[1]:NaN}function CD(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 Tre(e){return function(t){return t.replace(/[0-9]/g,function(t){return e[+t]})}}var Ere=/^(?:(.)?([<>=^]))?([+\-( ])?([$#])?(0)?(\d+)?(,)?(\.\d+)?(~)?([a-z%])?$/i;function wD(e){if(!(t=Ere.exec(e)))throw Error(`invalid format: `+e);var t;return new TD({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]})}wD.prototype=TD.prototype;function TD(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+``}TD.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 Dre(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 ED;function Ore(e,t){var n=xD(e,t);if(!n)return ED=void 0,e.toPrecision(t);var r=n[0],i=n[1],a=i-(ED=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`)+xD(e,Math.max(0,t+a-1))[0]}function DD(e,t){var n=xD(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 OD={"%":(e,t)=>(e*100).toFixed(t),b:e=>Math.round(e).toString(2),c:e=>e+``,d:bD,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)=>DD(e*100,t),r:DD,s:Ore,X:e=>Math.round(e).toString(16).toUpperCase(),x:e=>Math.round(e).toString(16)};function kD(e){return e}var AD=Array.prototype.map,jD=[`y`,`z`,`a`,`f`,`p`,`n`,`µ`,`m`,``,`k`,`M`,`G`,`T`,`P`,`E`,`Z`,`Y`];function kre(e){var t=e.grouping===void 0||e.thousands===void 0?kD:CD(AD.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?kD:Tre(AD.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=wD(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`):OD[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=OD[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=Dre(e)),w&&+e==0&&f!==`+`&&(w=!1),n=(w?f===`(`?f:s:f===`-`||f===`(`?``:f)+n,r=(y===`s`&&!isNaN(e)&&ED!==void 0?jD[8+ED/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(SD(t)/3)))*3,r=10**-n,i=l((e=wD(e),e.type=`f`,e),{suffix:jD[8+n/3]});return function(e){return i(r*e)}}return{format:l,formatPrefix:u}}var MD,ND,PD;Are({thousands:`,`,grouping:[3],currency:[`$`,``]});function Are(e){return MD=kre(e),ND=MD.format,PD=MD.formatPrefix,MD}function jre(e){return Math.max(0,-SD(Math.abs(e)))}function Mre(e,t){return Math.max(0,Math.max(-8,Math.min(8,Math.floor(SD(t)/3)))*3-SD(Math.abs(e)))}function Nre(e,t){return e=Math.abs(e),t=Math.abs(t)-e,Math.max(0,SD(t)-SD(e))+1}function FD(e,t,n,r){var i=UT(e,t,n),a;switch(r=wD(r??`,f`),r.type){case`s`:var o=Math.max(Math.abs(e),Math.abs(t));return r.precision==null&&!isNaN(a=Mre(i,o))&&(r.precision=a),PD(r,o);case``:case`e`:case`g`:case`p`:case`r`:r.precision==null&&!isNaN(a=Nre(i,Math.max(Math.abs(e),Math.abs(t))))&&(r.precision=a-(r.type===`e`));break;case`f`:case`%`:r.precision==null&&!isNaN(a=jre(i))&&(r.precision=a-(r.type===`%`)*2)}return ND(r)}function ID(e){var t=e.domain;return e.ticks=function(e){var n=t();return VT(n[0],n[n.length-1],e??10)},e.tickFormat=function(e,n){var r=t();return FD(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=HT(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 LD(){var e=yD();return e.copy=function(){return _D(e,LD())},ZT.apply(e,arguments),ID(e)}function RD(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,uD),n):e.slice()},n.unknown=function(e){return arguments.length?(t=e,n):t},n.copy=function(){return RD(e).unknown(t)},e=arguments.length?Array.from(e,uD):[0,1],ID(n)}function zD(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 BD(e){return Math.log(e)}function VD(e){return Math.exp(e)}function Pre(e){return-Math.log(-e)}function Fre(e){return-Math.exp(-e)}function Ire(e){return isFinite(e)?+(`1e`+e):e<0?0:e}function Lre(e){return e===10?Ire:e===Math.E?Math.exp:t=>e**+t}function Rre(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 HD(e){return(t,n)=>-e(-t,n)}function UD(e){let t=e(BD,VD),n=t.domain,r=10,i,a;function o(){return i=Rre(r),a=Lre(r),n()[0]<0?(i=HD(i),a=HD(a),e(Pre,Fre)):e(BD,VD),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=VT(o,s,p))}else m=VT(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=wD(n)).precision==null&&(n.trim=!0),n=ND(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(zD(n(),{floor:e=>a(Math.floor(i(e))),ceil:e=>a(Math.ceil(i(e)))})),t}function WD(){let e=UD(vD()).domain([1,10]);return e.copy=()=>_D(e,WD()).base(e.base()),ZT.apply(e,arguments),e}function GD(e){return function(t){return Math.sign(t)*Math.log1p(Math.abs(t/e))}}function KD(e){return function(t){return Math.sign(t)*Math.expm1(Math.abs(t))*e}}function qD(e){var t=1,n=e(GD(t),KD(t));return n.constant=function(n){return arguments.length?e(GD(t=+n),KD(t)):t},ID(n)}function JD(){var e=qD(vD());return e.copy=function(){return _D(e,JD()).constant(e.constant())},ZT.apply(e,arguments)}function YD(e){return function(t){return t<0?-((-t)**+e):t**+e}}function zre(e){return e<0?-Math.sqrt(-e):Math.sqrt(e)}function Bre(e){return e<0?-e*e:e*e}function XD(e){var t=e(fD,fD),n=1;function r(){return n===1?e(fD,fD):n===.5?e(zre,Bre):e(YD(n),YD(1/n))}return t.exponent=function(e){return arguments.length?(n=+e,r()):n},ID(t)}function ZD(){var e=XD(vD());return e.copy=function(){return _D(e,ZD()).exponent(e.exponent())},ZT.apply(e,arguments),e}function Vre(){return ZD.apply(null,arguments).exponent(.5)}function QD(e){return Math.sign(e)*e*e}function Hre(e){return Math.sign(e)*Math.sqrt(Math.abs(e))}function $D(){var e=yD(),t=[0,1],n=!1,r;function i(t){var i=Hre(e(t));return isNaN(i)?r:n?Math.round(i):i}return i.invert=function(t){return e.invert(QD(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,uD)).map(QD)),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 $D(e.domain(),t).round(n).clamp(e.clamp()).unknown(r)},ZT.apply(i,arguments),ID(i)}function eO(){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]=YT(e,r/i);return a}function a(e){return e==null||isNaN(e=+e)?r:t[kT(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(ST),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 eO().domain(e).range(t).unknown(r)},ZT.apply(a,arguments)}function tO(){var e=0,t=1,n=1,r=[.5],i=[0,1],a;function o(e){return e!=null&&e<=e?i[kT(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 tO().domain([e,t]).range(i).unknown(a)},ZT.apply(ID(o),arguments)}function nO(){var e=[.5],t=[0,1],n,r=1;function i(i){return i!=null&&i<=i?t[kT(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 nO().domain(e).range(t).unknown(n)},ZT.apply(i,arguments)}var rO=new Date,iO=new Date;function aO(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=>aO(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)=>(rO.setTime(+t),iO.setTime(+r),e(rO),e(iO),Math.floor(n(rO,iO))),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 oO=aO(()=>{},(e,t)=>{e.setTime(+e+t)},(e,t)=>t-e);oO.every=e=>(e=Math.floor(e),!isFinite(e)||!(e>0)?null:e>1?aO(t=>{t.setTime(Math.floor(t/e)*e)},(t,n)=>{t.setTime(+t+n*e)},(t,n)=>(n-t)/e):oO),oO.range;var sO=1e3,cO=sO*60,lO=cO*60,uO=lO*24,dO=uO*7,fO=uO*30,pO=uO*365,mO=aO(e=>{e.setTime(e-e.getMilliseconds())},(e,t)=>{e.setTime(+e+t*sO)},(e,t)=>(t-e)/sO,e=>e.getUTCSeconds());mO.range;var hO=aO(e=>{e.setTime(e-e.getMilliseconds()-e.getSeconds()*sO)},(e,t)=>{e.setTime(+e+t*cO)},(e,t)=>(t-e)/cO,e=>e.getMinutes());hO.range;var gO=aO(e=>{e.setUTCSeconds(0,0)},(e,t)=>{e.setTime(+e+t*cO)},(e,t)=>(t-e)/cO,e=>e.getUTCMinutes());gO.range;var _O=aO(e=>{e.setTime(e-e.getMilliseconds()-e.getSeconds()*sO-e.getMinutes()*cO)},(e,t)=>{e.setTime(+e+t*lO)},(e,t)=>(t-e)/lO,e=>e.getHours());_O.range;var vO=aO(e=>{e.setUTCMinutes(0,0,0)},(e,t)=>{e.setTime(+e+t*lO)},(e,t)=>(t-e)/lO,e=>e.getUTCHours());vO.range;var yO=aO(e=>e.setHours(0,0,0,0),(e,t)=>e.setDate(e.getDate()+t),(e,t)=>(t-e-(t.getTimezoneOffset()-e.getTimezoneOffset())*cO)/uO,e=>e.getDate()-1);yO.range;var bO=aO(e=>{e.setUTCHours(0,0,0,0)},(e,t)=>{e.setUTCDate(e.getUTCDate()+t)},(e,t)=>(t-e)/uO,e=>e.getUTCDate()-1);bO.range;var xO=aO(e=>{e.setUTCHours(0,0,0,0)},(e,t)=>{e.setUTCDate(e.getUTCDate()+t)},(e,t)=>(t-e)/uO,e=>Math.floor(e/uO));xO.range;function SO(e){return aO(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())*cO)/dO)}var CO=SO(0),wO=SO(1),TO=SO(2),EO=SO(3),DO=SO(4),OO=SO(5),kO=SO(6);CO.range,wO.range,TO.range,EO.range,DO.range,OO.range,kO.range;function AO(e){return aO(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)/dO)}var jO=AO(0),MO=AO(1),NO=AO(2),PO=AO(3),FO=AO(4),IO=AO(5),LO=AO(6);jO.range,MO.range,NO.range,PO.range,FO.range,IO.range,LO.range;var RO=aO(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());RO.range;var zO=aO(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());zO.range;var BO=aO(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());BO.every=e=>!isFinite(e=Math.floor(e))||!(e>0)?null:aO(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)}),BO.range;var VO=aO(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());VO.every=e=>!isFinite(e=Math.floor(e))||!(e>0)?null:aO(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)}),VO.range;function HO(e,t,n,r,i,a){let o=[[mO,1,sO],[mO,5,5*sO],[mO,15,15*sO],[mO,30,30*sO],[a,1,cO],[a,5,5*cO],[a,15,15*cO],[a,30,30*cO],[i,1,lO],[i,3,3*lO],[i,6,6*lO],[i,12,12*lO],[r,1,uO],[r,2,2*uO],[n,1,dO],[t,1,fO],[t,3,3*fO],[e,1,pO]];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=wT(([,,e])=>e).right(o,i);if(a===o.length)return e.every(UT(t/pO,n/pO,r));if(a===0)return oO.every(Math.max(UT(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[UO,WO]=HO(VO,zO,jO,xO,vO,gO),[GO,KO]=HO(BO,RO,CO,yO,_O,hO);function qO(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 JO(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 YO(e,t,n){return{y:e,m:t,d:n,H:0,M:0,S:0,L:0}}function XO(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=rk(i),u=ik(i),d=rk(a),f=ik(a),p=rk(o),m=ik(o),h=rk(s),g=ik(s),_=rk(c),v=ik(c),y={a:N,A:P,b:F,B:I,c:null,d:Tk,e:Tk,f:Ak,g:Vk,G:Uk,H:Ek,I:Dk,j:Ok,L:kk,m:jk,M:Mk,p:L,q:R,Q:fA,s:pA,S:Nk,u:Pk,U:Fk,V:Lk,w:Rk,W:zk,x:null,X:null,y:Bk,Y:Hk,Z:Wk,"%":dA},b={a:z,A:ee,b:te,B:ne,c:null,d:Gk,e:Gk,f:Xk,g:sA,G:lA,H:Kk,I:qk,j:Jk,L:Yk,m:Zk,M:Qk,p:re,q:ie,Q:fA,s:pA,S:$k,u:eA,U:tA,V:rA,w:iA,W:aA,x:null,X:null,y:oA,Y:cA,Z:uA,"%":dA},x={a:E,A:D,b:O,B:k,c:A,d:hk,e:hk,f:xk,g:dk,G:uk,H:_k,I:_k,j:gk,L:bk,m:mk,M:vk,p:T,q:pk,Q:Ck,s:wk,S:yk,u:ok,U:sk,V:ck,w:ak,W:lk,x:j,X:M,y:dk,Y:uk,Z:fk,"%":Sk};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=ZO[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=YO(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=JO(YO(r.y,0,1)),o=a.getUTCDay(),a=o>4||o===0?MO.ceil(a):MO(a),a=bO.offset(a,(r.V-1)*7),r.y=a.getUTCFullYear(),r.m=a.getUTCMonth(),r.d=a.getUTCDate()+(r.w+6)%7):(a=qO(YO(r.y,0,1)),o=a.getDay(),a=o>4||o===0?wO.ceil(a):wO(a),a=yO.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?JO(YO(r.y,0,1)).getUTCDay():qO(YO(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,JO(r)):qO(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 ZO?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 ZO={"-":``,_:` `,0:`0`},QO=/^\s*\d+/,$O=/^%/,ek=/[\\^$*+?|[\]().{}]/g;function tk(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 nk(e){return e.replace(ek,`\\$&`)}function rk(e){return RegExp(`^(?:`+e.map(nk).join(`|`)+`)`,`i`)}function ik(e){return new Map(e.map((e,t)=>[e.toLowerCase(),t]))}function ak(e,t,n){var r=QO.exec(t.slice(n,n+1));return r?(e.w=+r[0],n+r[0].length):-1}function ok(e,t,n){var r=QO.exec(t.slice(n,n+1));return r?(e.u=+r[0],n+r[0].length):-1}function sk(e,t,n){var r=QO.exec(t.slice(n,n+2));return r?(e.U=+r[0],n+r[0].length):-1}function ck(e,t,n){var r=QO.exec(t.slice(n,n+2));return r?(e.V=+r[0],n+r[0].length):-1}function lk(e,t,n){var r=QO.exec(t.slice(n,n+2));return r?(e.W=+r[0],n+r[0].length):-1}function uk(e,t,n){var r=QO.exec(t.slice(n,n+4));return r?(e.y=+r[0],n+r[0].length):-1}function dk(e,t,n){var r=QO.exec(t.slice(n,n+2));return r?(e.y=+r[0]+(+r[0]>68?1900:2e3),n+r[0].length):-1}function fk(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 pk(e,t,n){var r=QO.exec(t.slice(n,n+1));return r?(e.q=r[0]*3-3,n+r[0].length):-1}function mk(e,t,n){var r=QO.exec(t.slice(n,n+2));return r?(e.m=r[0]-1,n+r[0].length):-1}function hk(e,t,n){var r=QO.exec(t.slice(n,n+2));return r?(e.d=+r[0],n+r[0].length):-1}function gk(e,t,n){var r=QO.exec(t.slice(n,n+3));return r?(e.m=0,e.d=+r[0],n+r[0].length):-1}function _k(e,t,n){var r=QO.exec(t.slice(n,n+2));return r?(e.H=+r[0],n+r[0].length):-1}function vk(e,t,n){var r=QO.exec(t.slice(n,n+2));return r?(e.M=+r[0],n+r[0].length):-1}function yk(e,t,n){var r=QO.exec(t.slice(n,n+2));return r?(e.S=+r[0],n+r[0].length):-1}function bk(e,t,n){var r=QO.exec(t.slice(n,n+3));return r?(e.L=+r[0],n+r[0].length):-1}function xk(e,t,n){var r=QO.exec(t.slice(n,n+6));return r?(e.L=Math.floor(r[0]/1e3),n+r[0].length):-1}function Sk(e,t,n){var r=$O.exec(t.slice(n,n+1));return r?n+r[0].length:-1}function Ck(e,t,n){var r=QO.exec(t.slice(n));return r?(e.Q=+r[0],n+r[0].length):-1}function wk(e,t,n){var r=QO.exec(t.slice(n));return r?(e.s=+r[0],n+r[0].length):-1}function Tk(e,t){return tk(e.getDate(),t,2)}function Ek(e,t){return tk(e.getHours(),t,2)}function Dk(e,t){return tk(e.getHours()%12||12,t,2)}function Ok(e,t){return tk(1+yO.count(BO(e),e),t,3)}function kk(e,t){return tk(e.getMilliseconds(),t,3)}function Ak(e,t){return kk(e,t)+`000`}function jk(e,t){return tk(e.getMonth()+1,t,2)}function Mk(e,t){return tk(e.getMinutes(),t,2)}function Nk(e,t){return tk(e.getSeconds(),t,2)}function Pk(e){var t=e.getDay();return t===0?7:t}function Fk(e,t){return tk(CO.count(BO(e)-1,e),t,2)}function Ik(e){var t=e.getDay();return t>=4||t===0?DO(e):DO.ceil(e)}function Lk(e,t){return e=Ik(e),tk(DO.count(BO(e),e)+(BO(e).getDay()===4),t,2)}function Rk(e){return e.getDay()}function zk(e,t){return tk(wO.count(BO(e)-1,e),t,2)}function Bk(e,t){return tk(e.getFullYear()%100,t,2)}function Vk(e,t){return e=Ik(e),tk(e.getFullYear()%100,t,2)}function Hk(e,t){return tk(e.getFullYear()%1e4,t,4)}function Uk(e,t){var n=e.getDay();return e=n>=4||n===0?DO(e):DO.ceil(e),tk(e.getFullYear()%1e4,t,4)}function Wk(e){var t=e.getTimezoneOffset();return(t>0?`-`:(t*=-1,`+`))+tk(t/60|0,`0`,2)+tk(t%60,`0`,2)}function Gk(e,t){return tk(e.getUTCDate(),t,2)}function Kk(e,t){return tk(e.getUTCHours(),t,2)}function qk(e,t){return tk(e.getUTCHours()%12||12,t,2)}function Jk(e,t){return tk(1+bO.count(VO(e),e),t,3)}function Yk(e,t){return tk(e.getUTCMilliseconds(),t,3)}function Xk(e,t){return Yk(e,t)+`000`}function Zk(e,t){return tk(e.getUTCMonth()+1,t,2)}function Qk(e,t){return tk(e.getUTCMinutes(),t,2)}function $k(e,t){return tk(e.getUTCSeconds(),t,2)}function eA(e){var t=e.getUTCDay();return t===0?7:t}function tA(e,t){return tk(jO.count(VO(e)-1,e),t,2)}function nA(e){var t=e.getUTCDay();return t>=4||t===0?FO(e):FO.ceil(e)}function rA(e,t){return e=nA(e),tk(FO.count(VO(e),e)+(VO(e).getUTCDay()===4),t,2)}function iA(e){return e.getUTCDay()}function aA(e,t){return tk(MO.count(VO(e)-1,e),t,2)}function oA(e,t){return tk(e.getUTCFullYear()%100,t,2)}function sA(e,t){return e=nA(e),tk(e.getUTCFullYear()%100,t,2)}function cA(e,t){return tk(e.getUTCFullYear()%1e4,t,4)}function lA(e,t){var n=e.getUTCDay();return e=n>=4||n===0?FO(e):FO.ceil(e),tk(e.getUTCFullYear()%1e4,t,4)}function uA(){return`+0000`}function dA(){return`%`}function fA(e){return+e}function pA(e){return Math.floor(e/1e3)}var mA,hA,gA;_A({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 _A(e){return mA=XO(e),hA=mA.format,mA.parse,gA=mA.utcFormat,mA.utcParse,mA}function vA(e){return new Date(e)}function yA(e){return e instanceof Date?+e:+new Date(+e)}function bA(e,t,n,r,i,a,o,s,c,l){var u=yD(),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,yA)):f().map(vA)},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(zD(n,e)):u},u.copy=function(){return _D(u,bA(e,t,n,r,i,a,o,s,c,l))},u}function xA(){return ZT.apply(bA(GO,KO,BO,RO,CO,yO,_O,hO,mO,hA).domain([new Date(2e3,0,1),new Date(2e3,0,2)]),arguments)}function SA(){return ZT.apply(bA(UO,WO,VO,zO,jO,bO,vO,gO,mO,gA).domain([Date.UTC(2e3,0,1),Date.UTC(2e3,0,2)]),arguments)}function CA(){var e=0,t=1,n,r,i,a,o=fD,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(oD),l.rangeRound=u(sD),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 wA(e,t){return t.domain(e.domain()).interpolator(e.interpolator()).clamp(e.clamp()).unknown(e.unknown())}function TA(){var e=ID(CA()(fD));return e.copy=function(){return wA(e,TA())},QT.apply(e,arguments)}function EA(){var e=UD(CA()).domain([1,10]);return e.copy=function(){return wA(e,EA()).base(e.base())},QT.apply(e,arguments)}function DA(){var e=qD(CA());return e.copy=function(){return wA(e,DA()).constant(e.constant())},QT.apply(e,arguments)}function OA(){var e=XD(CA());return e.copy=function(){return wA(e,OA()).exponent(e.exponent())},QT.apply(e,arguments)}function kA(){return OA.apply(null,arguments).exponent(.5)}function AA(){var e=[],t=fD;function n(n){if(n!=null&&!isNaN(n=+n))return t((kT(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(ST),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)=>JT(e,r/t))},n.copy=function(){return AA(t).domain(e)},QT.apply(n,arguments)}function jA(){var e=0,t=.5,n=1,r=1,i,a,o,s,c,l=fD,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=cD(e,[n,r,i]),p):[l(0),l(.5),l(1)]}}return p.range=m(oD),p.rangeRound=m(sD),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 MA(){var e=ID(jA()(fD));return e.copy=function(){return wA(e,MA())},QT.apply(e,arguments)}function NA(){var e=UD(jA()).domain([.1,1,10]);return e.copy=function(){return wA(e,NA()).base(e.base())},QT.apply(e,arguments)}function PA(){var e=qD(jA());return e.copy=function(){return wA(e,PA()).constant(e.constant())},QT.apply(e,arguments)}function FA(){var e=XD(jA());return e.copy=function(){return wA(e,FA()).exponent(e.exponent())},QT.apply(e,arguments)}function IA(){return FA.apply(null,arguments).exponent(.5)}var LA=s({scaleBand:()=>tE,scaleDiverging:()=>MA,scaleDivergingLog:()=>NA,scaleDivergingPow:()=>FA,scaleDivergingSqrt:()=>IA,scaleDivergingSymlog:()=>PA,scaleIdentity:()=>RD,scaleImplicit:()=>$T,scaleLinear:()=>LD,scaleLog:()=>WD,scaleOrdinal:()=>eE,scalePoint:()=>rE,scalePow:()=>ZD,scaleQuantile:()=>eO,scaleQuantize:()=>tO,scaleRadial:()=>$D,scaleSequential:()=>TA,scaleSequentialLog:()=>EA,scaleSequentialPow:()=>OA,scaleSequentialQuantile:()=>AA,scaleSequentialSqrt:()=>kA,scaleSequentialSymlog:()=>DA,scaleSqrt:()=>Vre,scaleSymlog:()=>JD,scaleThreshold:()=>nO,scaleTime:()=>xA,scaleUtc:()=>SA,tickFormat:()=>FD}),RA=o(((e,t)=>{var n=kv();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})),zA=o(((e,t)=>{function n(e,t){return e>t}t.exports=n})),BA=o(((e,t)=>{var n=RA(),r=zA(),i=sC();function a(e){return e&&e.length?n(e,i,r):void 0}t.exports=a})),VA=o(((e,t)=>{function n(e,t){return e<t}t.exports=n})),HA=o(((e,t)=>{var n=RA(),r=VA(),i=sC();function a(e){return e&&e.length?n(e,i,r):void 0}t.exports=a})),UA=o(((e,t)=>{var n=fy(),r=cC(),i=EC(),a=xv();function o(e,t){return(a(e)?n:i)(e,r(t,3))}t.exports=o})),WA=o(((e,t)=>{var n=CC(),r=UA();function i(e,t){return n(r(e,t),1)}t.exports=i})),GA=o(((e,t)=>{var n=iC();function r(e,t){return n(e,t)}t.exports=r})),KA=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 qA(e){return ZA(e)||XA(e)||YA(e)||JA()}function JA(){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 YA(e,t){if(e){if(typeof e==`string`)return QA(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 QA(e,t)}}function XA(e){if(typeof Symbol<`u`&&Symbol.iterator in Object(e))return Array.from(e)}function ZA(e){if(Array.isArray(e))return QA(e)}function QA(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 $A=function(e){return e},ej={"@@functional/placeholder":!0},tj=function(e){return e===ej},nj=function(e){return function t(){return arguments.length===0||arguments.length===1&&tj(arguments.length<=0?void 0:arguments[0])?t:e.apply(void 0,arguments)}},rj=function e(t,n){return t===1?n:nj(function(){var r=[...arguments],i=r.filter(function(e){return e!==ej}).length;return i>=t?n.apply(void 0,r):e(t-i,nj(function(){var e=[...arguments],t=r.map(function(t){return tj(t)?e.shift():t});return n.apply(void 0,qA(t).concat(e))}))})},ij=function(e){return rj(e.length,e)},aj=function(e,t){for(var n=[],r=e;r<t;++r)n[r-e]=r;return n},oj=ij(function(e,t){return Array.isArray(t)?t.map(e):Object.keys(t).map(function(e){return t[e]}).map(e)}),sj=function(){var e=[...arguments];if(!e.length)return $A;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))}},cj=function(e){return Array.isArray(e)?e.reverse():e.split(``).reverse.join(``)},lj=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}},uj=l(KA());function dj(e){return e===0?1:Math.floor(new uj.default(e).abs().log(10).toNumber())+1}function fj(e,t,n){for(var r=new uj.default(e),i=0,a=[];r.lt(t)&&i<1e5;)a.push(r.toNumber()),r=r.add(n),i++;return a}var pj={rangeStep:fj,getDigitCount:dj,interpolateNumber:ij(function(e,t,n){var r=+e;return r+n*(+t-r)}),uninterpolateNumber:ij(function(e,t,n){var r=t-+e;return r||=1/0,(n-e)/r}),uninterpolateTruncation:ij(function(e,t,n){var r=t-+e;return r||=1/0,Math.max(0,Math.min(1,(n-e)/r))})};function mj(e){return _j(e)||gj(e)||bj(e)||hj()}function hj(){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 gj(e){if(typeof Symbol<`u`&&Symbol.iterator in Object(e))return Array.from(e)}function _j(e){if(Array.isArray(e))return xj(e)}function vj(e,t){return Cj(e)||Sj(e,t)||bj(e,t)||yj()}function yj(){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 bj(e,t){if(e){if(typeof e==`string`)return xj(e,t);var n=Object.prototype.toString.call(e).slice(8,-1);if(n===`Object`&&e.constructor&&(n=e.constructor.name),n===`Map`||n===`Set`)return Array.from(e);if(n===`Arguments`||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n))return xj(e,t)}}function xj(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 Sj(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 Cj(e){if(Array.isArray(e))return e}function wj(e){var t=vj(e,2),n=t[0],r=t[1],i=n,a=r;return n>r&&(i=r,a=n),[i,a]}function Tj(e,t,n){if(e.lte(0))return new uj.default(0);var r=pj.getDigitCount(e.toNumber()),i=new uj.default(10).pow(r),a=e.div(i),o=r===1?.1:.05,s=new uj.default(Math.ceil(a.div(o).toNumber())).add(n).mul(o).mul(i);return t?s:new uj.default(Math.ceil(s))}function Ej(e,t,n){var r=1,i=new uj.default(e);if(!i.isint()&&n){var a=Math.abs(e);a<1?(r=new uj.default(10).pow(pj.getDigitCount(e)-1),i=new uj.default(Math.floor(i.div(r).toNumber())).mul(r)):a>1&&(i=new uj.default(Math.floor(e)))}else e===0?i=new uj.default(Math.floor((t-1)/2)):n||(i=new uj.default(Math.floor(e)));var o=Math.floor((t-1)/2);return sj(oj(function(e){return i.add(new uj.default(e-o).mul(r)).toNumber()}),aj)(0,t)}function Dj(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 uj.default(0),tickMin:new uj.default(0),tickMax:new uj.default(0)};var a=Tj(new uj.default(t).sub(e).div(n-1),r,i),o;e<=0&&t>=0?o=new uj.default(0):(o=new uj.default(e).add(t).div(2),o=o.sub(new uj.default(o).mod(a)));var s=Math.ceil(o.sub(e).div(a).toNumber()),c=Math.ceil(new uj.default(t).sub(o).div(a).toNumber()),l=s+c+1;return l>n?Dj(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 uj.default(s).mul(a)),tickMax:o.add(new uj.default(c).mul(a))})}function Oj(e){var t=vj(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=vj(wj([n,r]),2),c=s[0],l=s[1];if(c===-1/0||l===1/0){var u=l===1/0?[c].concat(mj(aj(0,i-1).map(function(){return 1/0}))):[].concat(mj(aj(0,i-1).map(function(){return-1/0})),[l]);return n>r?cj(u):u}if(c===l)return Ej(c,i,a);var d=Dj(c,l,o,a),f=d.step,p=d.tickMin,m=d.tickMax,h=pj.rangeStep(p,m.add(new uj.default(.1).mul(f)),f);return n>r?cj(h):h}function kj(e,t){var n=vj(e,2),r=n[0],i=n[1],a=arguments.length>2&&arguments[2]!==void 0?arguments[2]:!0,o=vj(wj([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=Tj(new uj.default(c).sub(s).div(l-1),a,0),d=[].concat(mj(pj.rangeStep(new uj.default(s),new uj.default(c).sub(new uj.default(.99).mul(u)),u)),[c]);return r>i?cj(d):d}var Aj=lj(Oj),jj=lj(kj),Mj=`Invariant failed`;function Nj(e,t){if(!e)throw Error(Mj)}var Pj=[`offset`,`layout`,`width`,`dataKey`,`data`,`dataPointFormatter`,`xAxis`,`yAxis`];function Fj(e){"@babel/helpers - typeof";return Fj=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},Fj(e)}function Ij(){return Ij=Object.assign?Object.assign.bind():function(e){for(var t=1;t<arguments.length;t++){var n=arguments[t];for(var r in n)Object.prototype.hasOwnProperty.call(n,r)&&(e[r]=n[r])}return e},Ij.apply(this,arguments)}function Lj(e,t){return Hj(e)||Vj(e,t)||zj(e,t)||Rj()}function Rj(){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 zj(e,t){if(e){if(typeof e==`string`)return Bj(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 Bj(e,t)}}function Bj(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 Vj(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 Hj(e){if(Array.isArray(e))return e}function Uj(e,t){if(e==null)return{};var n=Wj(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 Wj(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 Gj(e,t){if(!(e instanceof t))throw TypeError(`Cannot call a class as a function`)}function Kj(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,nM(r.key),r)}}function qj(e,t,n){return t&&Kj(e.prototype,t),n&&Kj(e,n),Object.defineProperty(e,"prototype",{writable:!1}),e}function Jj(e,t,n){return t=Qj(t),Yj(e,Zj()?Reflect.construct(t,n||[],Qj(e).constructor):t.apply(e,n))}function Yj(e,t){if(t&&(Fj(t)===`object`||typeof t==`function`))return t;if(t!==void 0)throw TypeError(`Derived constructors may only return object or undefined`);return Xj(e)}function Xj(e){if(e===void 0)throw ReferenceError(`this hasn't been initialised - super() hasn't been called`);return e}function Zj(){try{var e=!Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],function(){}))}catch{}return(Zj=function(){return!!e})()}function Qj(e){return Qj=Object.setPrototypeOf?Object.getPrototypeOf.bind():function(e){return e.__proto__||Object.getPrototypeOf(e)},Qj(e)}function $j(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&&eM(e,t)}function eM(e,t){return eM=Object.setPrototypeOf?Object.setPrototypeOf.bind():function(e,t){return e.__proto__=t,e},eM(e,t)}function tM(e,t,n){return t=nM(t),t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function nM(e){var t=rM(e,`string`);return Fj(t)==`symbol`?t:t+``}function rM(e,t){if(Fj(e)!=`object`||!e)return e;var n=e[Symbol.toPrimitive];if(n!==void 0){var r=n.call(e,t||`default`);if(Fj(r)!=`object`)return r;throw TypeError(`@@toPrimitive must return a primitive value.`)}return(t===`string`?String:Number)(e)}var iM=function(e){function t(){return Gj(this,t),Jj(this,t,arguments)}return $j(t,e),qj(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=yb(Uj(e,Pj),!1);this.props.direction===`x`&&s.type!==`number`&&Nj(!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=Lj(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(Pb,Ij({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`,Ij({},e,{key:`line-${e.x1}-${e.x2}-${e.y1}-${e.y2}`}))}))});return _.createElement(Pb,{className:`recharts-errorBars`},u)}}])}(_.Component);tM(iM,`defaultProps`,{stroke:`black`,strokeWidth:1.5,width:5,offset:0,layout:`horizontal`}),tM(iM,`displayName`,`ErrorBar`);function aM(e){"@babel/helpers - typeof";return aM=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},aM(e)}function oM(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 sM(e){for(var t=1;t<arguments.length;t++){var n=arguments[t]==null?{}:arguments[t];t%2?oM(Object(n),!0).forEach(function(t){cM(e,t,n[t])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):oM(Object(n)).forEach(function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(n,t))})}return e}function cM(e,t,n){return t=lM(t),t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function lM(e){var t=uM(e,`string`);return aM(t)==`symbol`?t:t+``}function uM(e,t){if(aM(e)!=`object`||!e)return e;var n=e[Symbol.toPrimitive];if(n!==void 0){var r=n.call(e,t||`default`);if(aM(r)!=`object`)return r;throw TypeError(`@@toPrimitive must return a primitive value.`)}return(t===`string`?String:Number)(e)}var dM=function(e){var t=e.children,n=e.formattedGraphicalItems,r=e.legendWidth,i=e.legendContent,a=pb(t,SC);if(!a)return null;var o=SC.defaultProps,s=o===void 0?{}:sM(sM({},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?{}:sM(sM({},n),t.props),i=r.dataKey,a=r.name,o=r.legendType;return{inactive:r.hide,dataKey:i,type:s.iconType||o||`square`,color:jM(t),value:a||i,payload:r}});return sM(sM(sM({},s),SC.getWithHeight(a,r)),{},{payload:c,item:a})},fM=l(BA()),pM=l(HA()),mM=l(WA()),hM=l(GA());function gM(e){"@babel/helpers - typeof";return gM=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},gM(e)}function _M(e){return xM(e)||bM(e)||yM(e)||vM()}function vM(){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 yM(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 bM(e){if(typeof Symbol<`u`&&e[Symbol.iterator]!=null||e[`@@iterator`]!=null)return Array.from(e)}function xM(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}function CM(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 wM(e){for(var t=1;t<arguments.length;t++){var n=arguments[t]==null?{}:arguments[t];t%2?CM(Object(n),!0).forEach(function(t){TM(e,t,n[t])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):CM(Object(n)).forEach(function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(n,t))})}return e}function TM(e,t,n){return t=EM(t),t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function EM(e){var t=DM(e,`string`);return gM(t)==`symbol`?t:t+``}function DM(e,t){if(gM(e)!=`object`||!e)return e;var n=e[Symbol.toPrimitive];if(n!==void 0){var r=n.call(e,t||`default`);if(gM(r)!=`object`)return r;throw TypeError(`@@toPrimitive must return a primitive value.`)}return(t===`string`?String:Number)(e)}function OM(e,t,n){return(0,ky.default)(e)||(0,ky.default)(t)?n:Py(t)?(0,Dy.default)(e,t,n):(0,eb.default)(t)?t(e):n}function kM(e,t,n,r){var i=(0,mM.default)(e,function(e){return OM(e,t)});if(n===`number`){var a=i.filter(function(e){return My(e)||parseFloat(e)});return a.length?[(0,pM.default)(a),(0,fM.default)(a)]:[1/0,-1/0]}return(r?i.filter(function(e){return!(0,ky.default)(e)}):i).map(function(e){return Py(e)||e instanceof Date?e:``})}var AM=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(Ay(l-c)!==Ay(u-l)){var f=[];if(Ay(u-l)===Ay(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},jM=function(e){var t,n=e.type.displayName,r=(t=e.type)!=null&&t.defaultProps?wM(wM({},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},MM=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 cb(e.type).indexOf(`Bar`)>=0});if(g&&g.length){var _=g[0].type.defaultProps,v=_===void 0?g[0].props:wM(wM({},_),g[0].props),y=v.barSize,b=v[h];a[b]||(a[b]=[]);var x=(0,ky.default)(y)?t:y;a[b].push({item:g[0],stackList:g.slice(1),barSize:(0,ky.default)(x)?void 0:Ly(x,n,0)})}}return a},NM=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=Ly(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(_M(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=Ly(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(_M(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},PM=function(e,t,n,r){var i=n.children,a=n.width,o=n.margin,s=dM({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`&&My(e[d]))return wM(wM({},e),{},TM({},d,e[d]+(l||0)));if((p===`horizontal`||p===`vertical`&&d===`center`)&&f!==`middle`&&My(e[f]))return wM(wM({},e),{},TM({},f,e[f]+(u||0)))}return e},FM=function(e,t,n){return(0,ky.default)(t)?!0:e===`horizontal`?t===`yAxis`:e===`vertical`||n===`x`?t===`xAxis`:n!==`y`||t===`yAxis`},IM=function(e,t,n,r,i){var a=t.props.children,o=fb(a,iM).filter(function(e){return FM(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=OM(t,n);if((0,ky.default)(r))return e;var i=Array.isArray(r)?[(0,pM.default)(r),(0,fM.default)(r)]:[r,r],a=s.reduce(function(e,n){var r=OM(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},LM=function(e,t,n,r,i){var a=t.map(function(t){return IM(e,t,n,i,r)}).filter(function(e){return!(0,ky.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},RM=function(e,t,n,r,i){var a=t.map(function(t){var a=t.props.dataKey;return n===`number`&&a&&IM(e,t,a,r)||kM(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},[])},zM=function(e,t){return e===`horizontal`&&t===`xAxis`||e===`vertical`&&t===`yAxis`||e===`centric`&&t===`angleAxis`||e===`radial`&&t===`radiusAxis`},BM=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?Ay(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,Ey.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}})},VM=new WeakMap,HM=function(e,t){if(typeof t!=`function`)return e;VM.has(e)||VM.set(e,new WeakMap);var n=VM.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},UM=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:tE(),realScaleType:`band`}:a===`radial`&&o===`angleAxis`?{scale:LD(),realScaleType:`linear`}:i===`category`&&t&&(t.indexOf(`LineChart`)>=0||t.indexOf(`AreaChart`)>=0||t.indexOf(`ComposedChart`)>=0&&!n)?{scale:rE(),realScaleType:`point`}:i===`category`?{scale:tE(),realScaleType:`band`}:{scale:LD(),realScaleType:`linear`};if((0,Ty.default)(r)){var s=`scale${(0,fS.default)(r)}`;return{scale:(LA[s]||rE)(),realScaleType:LA[s]?s:`point`}}return(0,eb.default)(r)?{scale:r}:{scale:rE(),realScaleType:`point`}},WM=1e-4,GM=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])-WM,a=Math.max(r[0],r[1])+WM,o=e(t[0]),s=e(t[n-1]);(o<i||o>a||s<i||s>a)&&e.domain([t[0],t[n-1]])}},KM=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},qM=function(e,t){if(!t||t.length!==2||!My(t[0])||!My(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(!My(e[0])||e[0]<n)&&(i[0]=n),(!My(e[1])||e[1]>r)&&(i[1]=r),i[0]>r&&(i[0]=r),i[1]<n&&(i[1]=n),i},JM={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,Ey.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:lS,none:iS,silhouette:uS,wiggle:dS,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,Ey.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)}}},YM=function(e,t,n){var r=t.map(function(e){return e.props.dataKey}),i=JM[n];return cS().keys(r).value(function(e,t){return+OM(e,t,0)}).order(aS).offset(i)(e)},XM=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?wM(wM({},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(Py(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[Iy(`_stackId_`)]={numericAxisId:n,cateAxisId:r,items:[t]};return wM(wM({},e),{},TM({},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 wM(wM({},t),{},TM({},a,{numericAxisId:n,cateAxisId:r,items:o.items,stackedData:YM(e,o.items,i)}))},{})),wM(wM({},t),{},TM({},a,s))},{})},ZM=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=Aj(c,i,o);return e.domain([(0,pM.default)(l),(0,fM.default)(l)]),{niceTicks:l}}return i&&r===`number`?{niceTicks:jj(e.domain(),i,o)}:null};function QM(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,ky.default)(i[t.dataKey])){var s=Vy(n,`value`,i[t.dataKey]);if(s)return s.coordinate+r/2}return n[a]?n[a].coordinate+r/2:null}var c=OM(i,(0,ky.default)(o)?t.dataKey:o);return(0,ky.default)(c)?null:t.scale(c)}var $M=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=OM(a,t.dataKey,t.domain[o]);return(0,ky.default)(s)?null:t.scale(s)-i/2+r},eN=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]},tN=function(e,t){var n,r=((n=e.type)!=null&&n.defaultProps?wM(wM({},e.type.defaultProps),e.props):e.props).stackId;if(Py(r)){var i=t[r];if(i){var a=i.items.indexOf(e);return a>=0?i.stackedData[a]:null}}return null},nN=function(e){return e.reduce(function(e,t){return[(0,pM.default)(t.concat([e[0]]).filter(My)),(0,fM.default)(t.concat([e[1]]).filter(My))]},[1/0,-1/0])},rN=function(e,t,n){return Object.keys(e).reduce(function(r,i){var a=e[i].stackedData.reduce(function(e,r){var i=nN(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})},iN=/^dataMin[\s]*-[\s]*([0-9]+([.]{1}[0-9]+){0,1})$/,aN=/^dataMax[\s]*\+[\s]*([0-9]+([.]{1}[0-9]+){0,1})$/,oN=function(e,t,n){if((0,eb.default)(e))return e(t,n);if(!Array.isArray(e))return t;var r=[];if(My(e[0]))r[0]=n?e[0]:Math.min(e[0],t[0]);else if(iN.test(e[0])){var i=+iN.exec(e[0])[1];r[0]=t[0]-i}else r[0]=(0,eb.default)(e[0])?e[0](t[0]):t[0];if(My(e[1]))r[1]=n?e[1]:Math.max(e[1],t[1]);else if(aN.test(e[1])){var a=+aN.exec(e[1])[1];r[1]=t[1]+a}else r[1]=(0,eb.default)(e[1])?e[1](t[1]):t[1];return r},sN=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,kC.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},cN=function(e,t,n){return!e||!e.length||(0,hM.default)(e,(0,Dy.default)(n,`type.defaultProps.domain`))?t:e},lN=function(e,t){var n=e.type.defaultProps?wM(wM({},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 wM(wM({},yb(e,!1)),{},{dataKey:r,unit:a,formatter:o,name:i||r,color:jM(e),value:OM(t,r),type:s,payload:t,chartType:c,hide:l})};function uN(e){"@babel/helpers - typeof";return uN=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},uN(e)}function dN(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 fN(e){for(var t=1;t<arguments.length;t++){var n=arguments[t]==null?{}:arguments[t];t%2?dN(Object(n),!0).forEach(function(t){pN(e,t,n[t])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):dN(Object(n)).forEach(function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(n,t))})}return e}function pN(e,t,n){return t=mN(t),t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function mN(e){var t=hN(e,`string`);return uN(t)==`symbol`?t:t+``}function hN(e,t){if(uN(e)!=`object`||!e)return e;var n=e[Symbol.toPrimitive];if(n!==void 0){var r=n.call(e,t||`default`);if(uN(r)!=`object`)return r;throw TypeError(`@@toPrimitive must return a primitive value.`)}return(t===`string`?String:Number)(e)}function gN(e,t){return xN(e)||bN(e,t)||vN(e,t)||_N()}function _N(){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 vN(e,t){if(e){if(typeof e==`string`)return yN(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 yN(e,t)}}function yN(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 bN(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 xN(e){if(Array.isArray(e))return e}var SN=Math.PI/180,CN=function(e){return e*180/Math.PI},wN=function(e,t,n,r){return{x:e+Math.cos(-SN*r)*n,y:t+Math.sin(-SN*r)*n}},TN=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},EN=function(e,t,n,r,i){var a=e.width,o=e.height,s=e.startAngle,c=e.endAngle,l=Ly(e.cx,a,a/2),u=Ly(e.cy,o,o/2),d=TN(a,o,n),f=Ly(e.innerRadius,d,0),p=Ly(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,ky.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=gN(m,2);s=h[0],c=h[1]}var g=UM(a,i),_=g.realScaleType,v=g.scale;v.domain(o).range(m),GM(v);var y=ZM(v,fN(fN({},a),{},{realScaleType:_})),b=fN(fN(fN({},a),y),{},{range:m,radius:p,realScaleType:_,scale:v,cx:l,cy:u,innerRadius:f,outerRadius:p,startAngle:s,endAngle:c});return fN(fN({},e),{},pN({},n,b))},{})},DN=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)},ON=function(e,t){var n=e.x,r=e.y,i=t.cx,a=t.cy,o=DN({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:CN(c),angleInRadian:c}},kN=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}},AN=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},jN=function(e,t){var n=e.x,r=e.y,i=ON({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=kN(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?fN(fN({},t),{},{radius:a,angle:AN(f,t)}):null},MN=function(e){return!(0,_.isValidElement)(e)&&!(0,eb.default)(e)&&typeof e!=`boolean`?e.className:``};function NN(e){"@babel/helpers - typeof";return NN=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},NN(e)}var PN=[`offset`];function FN(e){return zN(e)||RN(e)||LN(e)||IN()}function IN(){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 LN(e,t){if(e){if(typeof e==`string`)return BN(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 BN(e,t)}}function RN(e){if(typeof Symbol<`u`&&e[Symbol.iterator]!=null||e[`@@iterator`]!=null)return Array.from(e)}function zN(e){if(Array.isArray(e))return BN(e)}function BN(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 VN(e,t){if(e==null)return{};var n=HN(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 HN(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 UN(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 WN(e){for(var t=1;t<arguments.length;t++){var n=arguments[t]==null?{}:arguments[t];t%2?UN(Object(n),!0).forEach(function(t){GN(e,t,n[t])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):UN(Object(n)).forEach(function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(n,t))})}return e}function GN(e,t,n){return t=KN(t),t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function KN(e){var t=qN(e,`string`);return NN(t)==`symbol`?t:t+``}function qN(e,t){if(NN(e)!=`object`||!e)return e;var n=e[Symbol.toPrimitive];if(n!==void 0){var r=n.call(e,t||`default`);if(NN(r)!=`object`)return r;throw TypeError(`@@toPrimitive must return a primitive value.`)}return(t===`string`?String:Number)(e)}function JN(){return JN=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},JN.apply(this,arguments)}var YN=function(e){var t=e.value,n=e.formatter,r=(0,ky.default)(e.children)?t:e.children;return(0,eb.default)(n)?n(r):r},XN=function(e,t){return Ay(t-e)*Math.min(Math.abs(t-e),360)},ZN=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=XN(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=wN(c,l,h,y),S=wN(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,ky.default)(e.id)?Iy(`recharts-radial-line-`):e.id;return _.createElement(`text`,JN({},n,{dominantBaseline:`central`,className:Ht(`recharts-radial-bar-label`,o)}),_.createElement(`defs`,null,_.createElement(`path`,{id:w,d:C})),_.createElement(`textPath`,{xlinkHref:`#${w}`},t))},QN=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=wN(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=wN(a,o,(s+c)/2,l);return{x:f.x,y:f.y,textAnchor:`middle`,verticalAnchor:`middle`}},$N=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 WN(WN({},{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 WN(WN({},{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 WN(WN({},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 WN(WN({},y),n?{width:Math.max(n.x+n.width-y.x,0),height:l}:{})}var b=n?{width:c,height:l}:{};return i===`insideLeft`?WN({x:o+h,y:s+l/2,textAnchor:_,verticalAnchor:`middle`},b):i===`insideRight`?WN({x:o+c-h,y:s+l/2,textAnchor:g,verticalAnchor:`middle`},b):i===`insideTop`?WN({x:o+c/2,y:s+d,textAnchor:`middle`,verticalAnchor:p},b):i===`insideBottom`?WN({x:o+c/2,y:s+l-d,textAnchor:`middle`,verticalAnchor:f},b):i===`insideTopLeft`?WN({x:o+h,y:s+d,textAnchor:_,verticalAnchor:p},b):i===`insideTopRight`?WN({x:o+c-h,y:s+d,textAnchor:g,verticalAnchor:p},b):i===`insideBottomLeft`?WN({x:o+h,y:s+l-d,textAnchor:_,verticalAnchor:f},b):i===`insideBottomRight`?WN({x:o+c-h,y:s+l-d,textAnchor:g,verticalAnchor:f},b):(0,Wy.default)(i)&&(My(i.x)||jy(i.x))&&(My(i.y)||jy(i.y))?WN({x:o+Ly(i.x,c),y:s+Ly(i.y,l),textAnchor:`end`,verticalAnchor:`end`},b):WN({x:o+c/2,y:s+l/2,textAnchor:`middle`,verticalAnchor:`middle`},b)},eP=function(e){return`cx`in e&&My(e.cx)};function tP(e){var t=e.offset,n=t===void 0?5:t,r=VN(e,PN),i=WN({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,ky.default)(s)&&(0,ky.default)(c)&&!(0,_.isValidElement)(l)&&!(0,eb.default)(l))return null;if((0,_.isValidElement)(l))return(0,_.cloneElement)(l,i);var p;if((0,eb.default)(l)){if(p=(0,_.createElement)(l,i),(0,_.isValidElement)(p))return p}else p=YN(i);var m=eP(a),h=yb(i,!0);if(m&&(o===`insideStart`||o===`insideEnd`||o===`end`))return ZN(i,p,h);var g=m?QN(i):$N(i);return _.createElement(xT,JN({className:Ht(`recharts-label`,d)},h,g,{breakAll:f}),p)}tP.displayName=`Label`;var nP=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(My(m)&&My(h)){if(My(u)&&My(d))return{x:u,y:d,width:m,height:h};if(My(f)&&My(p))return{x:f,y:p,width:m,height:h}}return My(u)&&My(d)?{x:u,y:d,width:0,height:0}:My(t)&&My(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:{}},rP=function(e,t){return e?e===!0?_.createElement(tP,{key:`label-implicit`,viewBox:t}):Py(e)?_.createElement(tP,{key:`label-implicit`,viewBox:t,value:e}):(0,_.isValidElement)(e)?e.type===tP?(0,_.cloneElement)(e,{key:`label-implicit`,viewBox:t}):_.createElement(tP,{key:`label-implicit`,content:e,viewBox:t}):(0,eb.default)(e)?_.createElement(tP,{key:`label-implicit`,content:e,viewBox:t}):(0,Wy.default)(e)?_.createElement(tP,JN({viewBox:t},e,{key:`label-implicit`})):null:null};tP.parseViewBox=nP,tP.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=nP(e),a=fb(r,tP).map(function(e,n){return(0,_.cloneElement)(e,{viewBox:t||i,key:`label-${n}`})});return n?[rP(e.label,t||i)].concat(FN(a)):a};var iP=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 aP(e){"@babel/helpers - typeof";return aP=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},aP(e)}var oP=[`valueAccessor`],sP=[`data`,`dataKey`,`clockWise`,`id`,`textBreakAll`];function cP(e){return fP(e)||dP(e)||uP(e)||lP()}function lP(){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 uP(e,t){if(e){if(typeof e==`string`)return pP(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 pP(e,t)}}function dP(e){if(typeof Symbol<`u`&&e[Symbol.iterator]!=null||e[`@@iterator`]!=null)return Array.from(e)}function fP(e){if(Array.isArray(e))return pP(e)}function pP(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 mP(){return mP=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},mP.apply(this,arguments)}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=vP(t),t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function vP(e){var t=yP(e,`string`);return aP(t)==`symbol`?t:t+``}function yP(e,t){if(aP(e)!=`object`||!e)return e;var n=e[Symbol.toPrimitive];if(n!==void 0){var r=n.call(e,t||`default`);if(aP(r)!=`object`)return r;throw TypeError(`@@toPrimitive must return a primitive value.`)}return(t===`string`?String:Number)(e)}function bP(e,t){if(e==null)return{};var n=xP(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 xP(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 SP=function(e){return Array.isArray(e.value)?(0,iP.default)(e.value):e.value};function CP(e){var t=e.valueAccessor,n=t===void 0?SP:t,r=bP(e,oP),i=r.data,a=r.dataKey,o=r.clockWise,s=r.id,c=r.textBreakAll,l=bP(r,sP);return!i||!i.length?null:_.createElement(Pb,{className:`recharts-label-list`},i.map(function(e,t){var r=(0,ky.default)(a)?n(e,t):OM(e&&e.payload,a),i=(0,ky.default)(s)?{}:{id:`${s}-${t}`};return _.createElement(tP,mP({},yb(e,!0),l,i,{parentViewBox:e.parentViewBox,value:r,textBreakAll:c,viewBox:tP.parseViewBox((0,ky.default)(o)?e:gP(gP({},e),{},{clockWise:o})),key:`label-${t}`,index:t}))}))}CP.displayName=`LabelList`;function wP(e,t){return e?e===!0?_.createElement(CP,{key:`labelList-implicit`,data:t}):_.isValidElement(e)||(0,eb.default)(e)?_.createElement(CP,{key:`labelList-implicit`,data:t,content:e}):(0,Wy.default)(e)?_.createElement(CP,mP({data:t},e,{key:`labelList-implicit`})):null:null}function TP(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=fb(r,CP).map(function(e,n){return(0,_.cloneElement)(e,{data:t,key:`labelList-${n}`})});return n?[wP(e.label,t)].concat(cP(i)):i}CP.renderCallByParent=TP;function EP(e){"@babel/helpers - typeof";return EP=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},EP(e)}function DP(){return DP=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},DP.apply(this,arguments)}function OP(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 kP(e){for(var t=1;t<arguments.length;t++){var n=arguments[t]==null?{}:arguments[t];t%2?OP(Object(n),!0).forEach(function(t){AP(e,t,n[t])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):OP(Object(n)).forEach(function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(n,t))})}return e}function AP(e,t,n){return t=jP(t),t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function jP(e){var t=MP(e,`string`);return EP(t)==`symbol`?t:t+``}function MP(e,t){if(EP(e)!=`object`||!e)return e;var n=e[Symbol.toPrimitive];if(n!==void 0){var r=n.call(e,t||`default`);if(EP(r)!=`object`)return r;throw TypeError(`@@toPrimitive must return a primitive value.`)}return(t===`string`?String:Number)(e)}var NP=function(e,t){return Ay(t-e)*Math.min(Math.abs(t-e),359.999)},PP=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)/SN,d=c?i:i+a*u,f=wN(t,n,l,d),p=wN(t,n,r,d),m=c?i-a*u:i;return{center:f,circleTangency:p,lineTangency:wN(t,n,l*Math.cos(u*SN),m),theta:u}},FP=function(e){var t=e.cx,n=e.cy,r=e.innerRadius,i=e.outerRadius,a=e.startAngle,o=e.endAngle,s=NP(a,o),c=a+s,l=wN(t,n,i,a),u=wN(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=wN(t,n,r,a),p=wN(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},IP=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=Ay(l-c),d=PP({cx:t,cy:n,radius:i,angle:c,sign:u,cornerRadius:a,cornerIsExternal:s}),f=d.circleTangency,p=d.lineTangency,m=d.theta,h=PP({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
+ `:FP({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=PP({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=PP({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},LP={cx:0,cy:0,innerRadius:0,outerRadius:0,startAngle:0,endAngle:0,cornerRadius:0,forceCornerRadius:!1,cornerIsExternal:!1},RP=function(e){var t=kP(kP({},LP),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=Ly(o,p,0,!0),h=m>0&&Math.abs(l-u)<360?IP({cx:n,cy:r,innerRadius:i,outerRadius:a,cornerRadius:Math.min(m,p/2),forceCornerRadius:s,cornerIsExternal:c,startAngle:l,endAngle:u}):FP({cx:n,cy:r,innerRadius:i,outerRadius:a,startAngle:l,endAngle:u});return _.createElement(`path`,DP({},yb(t,!0),{className:f,d:h,role:`img`}))};function zP(e){"@babel/helpers - typeof";return zP=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},zP(e)}function BP(){return BP=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},BP.apply(this,arguments)}function VP(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 HP(e){for(var t=1;t<arguments.length;t++){var n=arguments[t]==null?{}:arguments[t];t%2?VP(Object(n),!0).forEach(function(t){UP(e,t,n[t])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):VP(Object(n)).forEach(function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(n,t))})}return e}function UP(e,t,n){return t=WP(t),t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function WP(e){var t=GP(e,`string`);return zP(t)==`symbol`?t:t+``}function GP(e,t){if(zP(e)!=`object`||!e)return e;var n=e[Symbol.toPrimitive];if(n!==void 0){var r=n.call(e,t||`default`);if(zP(r)!=`object`)return r;throw TypeError(`@@toPrimitive must return a primitive value.`)}return(t===`string`?String:Number)(e)}var KP={curveBasisClosed:Lx,curveBasisOpen:zx,curveBasis:Fx,curveBumpX:dx,curveBumpY:fx,curveLinearClosed:Vx,curveLinear:ax,curveMonotoneX:Yx,curveMonotoneY:Xx,curveNatural:$x,curveStep:tS,curveStepAfter:rS,curveStepBefore:nS},qP=function(e){return e.x===+e.x&&e.y===+e.y},JP=function(e){return e.x},YP=function(e){return e.y},XP=function(e,t){if((0,eb.default)(e))return e;var n=`curve${(0,fS.default)(e)}`;return(n===`curveMonotone`||n===`curveBump`)&&t?KP[`${n}${t===`vertical`?`Y`:`X`}`]:KP[n]||ax},ZP=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=XP(n,o),u=c?i.filter(function(e){return qP(e)}):i,d;if(Array.isArray(a)){var f=c?a.filter(function(e){return qP(e)}):a,p=u.map(function(e,t){return HP(HP({},e),{},{base:f[t]})});return d=o===`vertical`?lx().y(YP).x1(JP).x0(function(e){return e.base.x}):lx().x(JP).y1(YP).y0(function(e){return e.base.y}),d.defined(qP).curve(l),d(p)}return d=o===`vertical`&&My(a)?lx().y(YP).x1(JP).x0(a):My(a)?lx().x(JP).y1(YP).y0(a):cx().x(JP).y(YP),d.defined(qP).curve(l),d(u)},QP=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?ZP(e):r;return _.createElement(`path`,BP({},yb(e,!1),Zy(e),{className:Ht(`recharts-curve`,t),d:a,ref:i}))},$P=o(((e,t)=>{t.exports=`SECRET_DO_NOT_PASS_THIS_OR_YOU_WILL_BE_FIRED`})),eF=o(((e,t)=>{var n=$P();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}})),tF=o(((e,t)=>{t.exports=eF()()})),{getOwnPropertyNames:Ure,getOwnPropertySymbols:Wre}=Object,{hasOwnProperty:Gre}=Object.prototype;function nF(e,t){return function(n,r,i){return e(n,r,i)&&t(n,r,i)}}function rF(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 Kre(e){return e?.[Symbol.toStringTag]}function iF(e){return Ure(e).concat(Wre(e))}var qre=Object.hasOwn||((e,t)=>Gre.call(e,t));function aF(e,t){return e===t||!e&&!t&&e!==e&&t!==t}var Jre=`__v`,Yre=`__o`,Xre=`_owner`,{getOwnPropertyDescriptor:oF,keys:sF}=Object;function Zre(e,t){return e.byteLength===t.byteLength&&dF(new Uint8Array(e),new Uint8Array(t))}function Qre(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 $re(e,t){return e.byteLength===t.byteLength&&dF(new Uint8Array(e.buffer,e.byteOffset,e.byteLength),new Uint8Array(t.buffer,t.byteOffset,t.byteLength))}function eie(e,t){return aF(e.getTime(),t.getTime())}function tie(e,t){return e.name===t.name&&e.message===t.message&&e.cause===t.cause&&e.stack===t.stack}function nie(e,t){return e===t}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.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 rie=aF;function iie(e,t,n){let r=sF(e),i=r.length;if(sF(t).length!==i)return!1;for(;i-->0;)if(!fF(e,t,n,r[i]))return!1;return!0}function lF(e,t,n){let r=iF(e),i=r.length;if(iF(t).length!==i)return!1;let a,o,s;for(;i-->0;)if(a=r[i],!fF(e,t,n,a)||(o=oF(e,a),s=oF(t,a),(o||s)&&(!o||!s||o.configurable!==s.configurable||o.enumerable!==s.enumerable||o.writable!==s.writable)))return!1;return!0}function aie(e,t){return aF(e.valueOf(),t.valueOf())}function oie(e,t){return e.source===t.source&&e.flags===t.flags}function uF(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 dF(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 sie(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 fF(e,t,n,r){return(r===Xre||r===Yre||r===Jre)&&(e.$$typeof||t.$$typeof)?!0:qre(t,r)&&n.equals(e[r],t[r],r,r,e,t,n)}var cie=`[object ArrayBuffer]`,lie=`[object Arguments]`,uie=`[object Boolean]`,die=`[object DataView]`,fie=`[object Date]`,pie=`[object Error]`,mie=`[object Map]`,hie=`[object Number]`,gie=`[object Object]`,_ie=`[object RegExp]`,vie=`[object Set]`,yie=`[object String]`,bie={"[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},xie=`[object URL]`,Sie=Object.prototype.toString;function Cie({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=Sie.call(h);if(b===fie)return r(h,g,_);if(b===_ie)return u(h,g,_);if(b===mie)return o(h,g,_);if(b===vie)return d(h,g,_);if(b===gie)return typeof h.then!=`function`&&typeof g.then!=`function`&&c(h,g,_);if(b===xie)return p(h,g,_);if(b===pie)return i(h,g,_);if(b===lie)return c(h,g,_);if(bie[b])return f(h,g,_);if(b===cie)return e(h,g,_);if(b===die)return n(h,g,_);if(b===uie||b===hie||b===yie)return l(h,g,_);if(m){let e=m[b];if(!e){let t=Kre(h);t&&(e=m[t])}if(e)return e(h,g,_)}return!1}}function wie({circular:e,createCustomConfig:t,strict:n}){let r={areArrayBuffersEqual:Zre,areArraysEqual:n?lF:Qre,areDataViewsEqual:$re,areDatesEqual:eie,areErrorsEqual:tie,areFunctionsEqual:nie,areMapsEqual:n?nF(cF,lF):cF,areNumbersEqual:rie,areObjectsEqual:n?lF:iie,arePrimitiveWrappersEqual:aie,areRegExpsEqual:oie,areSetsEqual:n?nF(uF,lF):uF,areTypedArraysEqual:n?nF(dF,lF):dF,areUrlsEqual:sie,unknownTagComparators:void 0};if(t&&(r=Object.assign({},r,t(r))),e){let e=rF(r.areArraysEqual),t=rF(r.areMapsEqual),n=rF(r.areObjectsEqual),i=rF(r.areSetsEqual);r=Object.assign({},r,{areArraysEqual:e,areMapsEqual:t,areObjectsEqual:n,areSetsEqual:i})}return r}function Tie(e){return function(t,n,r,i,a,o,s){return e(t,n,s)}}function Eie({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 Die=pF();pF({strict:!0}),pF({circular:!0}),pF({circular:!0,strict:!0}),pF({createInternalComparator:()=>aF}),pF({strict:!0,createInternalComparator:()=>aF}),pF({circular:!0,createInternalComparator:()=>aF}),pF({circular:!0,createInternalComparator:()=>aF,strict:!0});function pF(e={}){let{circular:t=!1,createInternalComparator:n,createState:r,strict:i=!1}=e,a=Cie(wie(e));return Eie({circular:t,comparator:a,createState:r,equals:n?n(a):Tie(a),strict:i})}function Oie(e){typeof requestAnimationFrame<`u`&&requestAnimationFrame(e)}function mF(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):Oie(r)})}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 kie(e){return Nie(e)||Mie(e)||jie(e)||Aie()}function Aie(){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 jie(e,t){if(e){if(typeof e==`string`)return gF(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 gF(e,t)}}function gF(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 Mie(e){if(typeof Symbol<`u`&&e[Symbol.iterator]!=null||e[`@@iterator`]!=null)return Array.from(e)}function Nie(e){if(Array.isArray(e))return e}function Pie(){var e={},t=function(){return null},n=!1,r=function r(i){if(!n){if(Array.isArray(i)){if(!i.length)return;var a=kie(i),o=a[0],s=a.slice(1);if(typeof o==`number`){mF(r.bind(null,s),o);return}r(o),mF(r.bind(null,s))}else hF(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 _F(e){"@babel/helpers - typeof";return _F=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},_F(e)}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 yF(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){bF(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 bF(e,t,n){return t=Fie(t),t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function Fie(e){var t=Iie(e,`string`);return _F(t)===`symbol`?t:String(t)}function Iie(e,t){if(_F(e)!==`object`||e===null)return e;var n=e[Symbol.toPrimitive];if(n!==void 0){var r=n.call(e,t||`default`);if(_F(r)!==`object`)return r;throw TypeError(`@@toPrimitive must return a primitive value.`)}return(t===`string`?String:Number)(e)}var Lie=function(e,t){return[Object.keys(e),Object.keys(t)].reduce(function(e,t){return e.filter(function(e){return t.includes(e)})})},Rie=function(e){return e},zie=function(e){return e.replace(/([A-Z])/g,function(e){return`-${e.toLowerCase()}`})},xF=function(e,t){return Object.keys(t).reduce(function(n,r){return yF(yF({},n),{},bF({},r,e(r,t[r])))},{})},SF=function(e,t,n){return e.map(function(e){return`${zie(e)} ${t}ms ${n}`}).join(`,`)};function Bie(e,t){return Uie(e)||Hie(e,t)||CF(e,t)||Vie()}function Vie(){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 Hie(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 Uie(e){if(Array.isArray(e))return e}function Wie(e){return qie(e)||Kie(e)||CF(e)||Gie()}function Gie(){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 CF(e,t){if(e){if(typeof e==`string`)return wF(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 wF(e,t)}}function Kie(e){if(typeof Symbol<`u`&&e[Symbol.iterator]!=null||e[`@@iterator`]!=null)return Array.from(e)}function qie(e){if(Array.isArray(e))return wF(e)}function wF(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 TF=1e-4,EF=function(e,t){return[0,3*e,3*t-6*e,3*e-3*t+1]},DF=function(e,t){return e.map(function(e,n){return e*t**+n}).reduce(function(e,t){return e+t})},OF=function(e,t){return function(n){return DF(EF(e,t),n)}},Jie=function(e,t){return function(n){var r=EF(e,t);return DF([].concat(Wie(r.map(function(e,t){return e*t}).slice(1)),[0]),n)}},kF=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=Bie(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=OF(t,r),c=OF(n,i),l=Jie(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)<TF||a<TF)return c(n);n=u(n-i/a)}return c(n)};return d.isStepper=!1,d},Yie=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)<TF&&Math.abs(a)<TF?[t,0]:[s,a]};return s.isStepper=!0,s.dt=o,s},Xie=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 kF(e);case`spring`:return Yie();default:if(e.split(`(`)[0]===`cubic-bezier`)return kF(e)}return typeof e==`function`?e:null};function AF(e){"@babel/helpers - typeof";return AF=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},AF(e)}function jF(e){return $ie(e)||Qie(e)||FF(e)||Zie()}function Zie(){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 Qie(e){if(typeof Symbol<`u`&&e[Symbol.iterator]!=null||e[`@@iterator`]!=null)return Array.from(e)}function $ie(e){if(Array.isArray(e))return IF(e)}function MF(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 NF(e){for(var t=1;t<arguments.length;t++){var n=arguments[t]==null?{}:arguments[t];t%2?MF(Object(n),!0).forEach(function(t){PF(e,t,n[t])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):MF(Object(n)).forEach(function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(n,t))})}return e}function PF(e,t,n){return t=eae(t),t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function eae(e){var t=tae(e,`string`);return AF(t)===`symbol`?t:String(t)}function tae(e,t){if(AF(e)!==`object`||e===null)return e;var n=e[Symbol.toPrimitive];if(n!==void 0){var r=n.call(e,t||`default`);if(AF(r)!==`object`)return r;throw TypeError(`@@toPrimitive must return a primitive value.`)}return(t===`string`?String:Number)(e)}function nae(e,t){return aae(e)||iae(e,t)||FF(e,t)||rae()}function rae(){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 FF(e,t){if(e){if(typeof e==`string`)return IF(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 IF(e,t)}}function IF(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 iae(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 aae(e){if(Array.isArray(e))return e}var LF=function(e,t,n){return e+(t-e)*n},RF=function(e){return e.from!==e.to},oae=function e(t,n,r){var i=xF(function(e,n){if(RF(n)){var r=nae(t(n.from,n.to,n.velocity),2),i=r[0],a=r[1];return NF(NF({},n),{},{from:i,velocity:a})}return n},n);return r<1?xF(function(e,t){return RF(t)?NF(NF({},t),{},{velocity:LF(t.velocity,i[e].velocity,r),from:LF(t.from,i[e].from,r)}):t},n):e(t,i,r-1)},sae=(function(e,t,n,r,i){var a=Lie(e,t),o=a.reduce(function(n,r){return NF(NF({},n),{},PF({},r,[e[r],t[r]]))},{}),s=a.reduce(function(n,r){return NF(NF({},n),{},PF({},r,{from:e[r],velocity:0,to:t[r]}))},{}),c=-1,l,u,d=function(){return null},f=function(){return xF(function(e,t){return t.from},s)},p=function(){return!Object.values(s).filter(RF).length};return d=n.isStepper?function(r){l||=r;var a=(r-l)/n.dt;s=oae(n,s,a),i(NF(NF(NF({},e),t),f(s))),l=r,p()||(c=requestAnimationFrame(d))}:function(a){u||=a;var s=(a-u)/r,l=xF(function(e,t){return LF.apply(void 0,jF(t).concat([n(s)]))},o);if(i(NF(NF(NF({},e),t),l)),s<1)c=requestAnimationFrame(d);else{var f=xF(function(e,t){return LF.apply(void 0,jF(t).concat([n(1)]))},o);i(NF(NF(NF({},e),t),f))}},function(){return requestAnimationFrame(d),function(){cancelAnimationFrame(c)}}}),zF=l(tF());function BF(e){"@babel/helpers - typeof";return BF=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},BF(e)}var cae=[`children`,`begin`,`duration`,`attributeName`,`easing`,`isActive`,`steps`,`from`,`to`,`canBegin`,`onAnimationEnd`,`shouldReAnimate`,`onAnimationReStart`];function lae(e,t){if(e==null)return{};var n=uae(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 uae(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 VF(e){return mae(e)||pae(e)||fae(e)||dae()}function dae(){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 fae(e,t){if(e){if(typeof e==`string`)return HF(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 HF(e,t)}}function pae(e){if(typeof Symbol<`u`&&e[Symbol.iterator]!=null||e[`@@iterator`]!=null)return Array.from(e)}function mae(e){if(Array.isArray(e))return HF(e)}function HF(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 UF(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 WF(e){for(var t=1;t<arguments.length;t++){var n=arguments[t]==null?{}:arguments[t];t%2?UF(Object(n),!0).forEach(function(t){GF(e,t,n[t])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):UF(Object(n)).forEach(function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(n,t))})}return e}function GF(e,t,n){return t=qF(t),t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function hae(e,t){if(!(e instanceof t))throw TypeError(`Cannot call a class as a function`)}function KF(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,qF(r.key),r)}}function gae(e,t,n){return t&&KF(e.prototype,t),n&&KF(e,n),Object.defineProperty(e,"prototype",{writable:!1}),e}function qF(e){var t=_ae(e,`string`);return BF(t)===`symbol`?t:String(t)}function _ae(e,t){if(BF(e)!==`object`||e===null)return e;var n=e[Symbol.toPrimitive];if(n!==void 0){var r=n.call(e,t||`default`);if(BF(r)!==`object`)return r;throw TypeError(`@@toPrimitive must return a primitive value.`)}return(t===`string`?String:Number)(e)}function vae(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&&JF(e,t)}function JF(e,t){return JF=Object.setPrototypeOf?Object.setPrototypeOf.bind():function(e,t){return e.__proto__=t,e},JF(e,t)}function yae(e){var t=bae();return function(){var n=ZF(e),r;if(t){var i=ZF(this).constructor;r=Reflect.construct(n,arguments,i)}else r=n.apply(this,arguments);return YF(this,r)}}function YF(e,t){if(t&&(BF(t)===`object`||typeof t==`function`))return t;if(t!==void 0)throw TypeError(`Derived constructors may only return object or undefined`);return XF(e)}function XF(e){if(e===void 0)throw ReferenceError(`this hasn't been initialised - super() hasn't been called`);return e}function bae(){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 ZF(e){return ZF=Object.setPrototypeOf?Object.getPrototypeOf.bind():function(e){return e.__proto__||Object.getPrototypeOf(e)},ZF(e)}var QF=function(e){vae(n,e);var t=yae(n);function n(e,r){var i;hae(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(XF(i)),i.changeStyle=i.changeStyle.bind(XF(i)),!o||f<=0)return i.state={style:{}},typeof d==`function`&&(i.state={style:l}),YF(i);if(u&&u.length)i.state={style:u[0].style};else if(c){if(typeof d==`function`)return i.state={style:c},YF(i);i.state={style:s?GF({},s,c):c}}else i.state={style:{}};return i}return gae(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?GF({},i,o):o};this.state&&c&&(i&&c[i]!==o||!i&&c!==o)&&this.setState(l)}else if(!(Die(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?GF({},i,d):d};(i&&c[i]!==d||!i&&c!==d)&&this.setState(f)}this.runAnimation(WF(WF({},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=sae(n,r,Xie(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(VF(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(VF(e),[t.runJSAnimation.bind(t,{from:d.style,to:c,duration:a,easing:s}),a]);var p=SF(f,a,s),m=WF(WF(WF({},d.style),c),{},{transition:p});return[].concat(VF(e),[m,a,u]).filter(Rie)},[o,Math.max(c,r)])),[e.onAnimationEnd]))}},{key:`runAnimation`,value:function(e){this.manager||=Pie();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?GF({},r,i):i,f=SF(Object.keys(d),n,a);u.start([o,t,WF(WF({},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=lae(e,cae),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,WF(WF({},i),{},{style:WF(WF({},r),o),className:a}))};return a===1?s(_.Children.only(t)):_.createElement(`div`,null,_.Children.map(t,function(e){return s(e)}))}}]),n}(_.PureComponent);QF.displayName=`Animate`,QF.defaultProps={begin:0,duration:1e3,from:``,to:``,attributeName:``,easing:`ease`,isActive:!0,canBegin:!0,steps:[],onAnimationEnd:function(){},onAnimationStart:function(){}},QF.propTypes={from:zF.default.oneOfType([zF.default.object,zF.default.string]),to:zF.default.oneOfType([zF.default.object,zF.default.string]),attributeName:zF.default.string,duration:zF.default.number,begin:zF.default.number,easing:zF.default.oneOfType([zF.default.string,zF.default.func]),steps:zF.default.arrayOf(zF.default.shape({duration:zF.default.number.isRequired,style:zF.default.object.isRequired,easing:zF.default.oneOfType([zF.default.oneOf([`ease`,`ease-in`,`ease-out`,`ease-in-out`,`linear`]),zF.default.func]),properties:zF.default.arrayOf(`string`),onAnimationEnd:zF.default.func})),children:zF.default.oneOfType([zF.default.node,zF.default.func]),isActive:zF.default.bool,canBegin:zF.default.bool,onAnimationEnd:zF.default.func,shouldReAnimate:zF.default.bool,onAnimationStart:zF.default.func,onAnimationReStart:zF.default.func};var $F=QF;function eI(e){"@babel/helpers - typeof";return eI=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},eI(e)}function tI(){return tI=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},tI.apply(this,arguments)}function xae(e,t){return Tae(e)||wae(e,t)||Cae(e,t)||Sae()}function Sae(){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 Cae(e,t){if(e){if(typeof e==`string`)return nI(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 nI(e,t)}}function nI(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 wae(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 Tae(e){if(Array.isArray(e))return e}function rI(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 iI(e){for(var t=1;t<arguments.length;t++){var n=arguments[t]==null?{}:arguments[t];t%2?rI(Object(n),!0).forEach(function(t){Eae(e,t,n[t])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):rI(Object(n)).forEach(function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(n,t))})}return e}function Eae(e,t,n){return t=Dae(t),t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function Dae(e){var t=Oae(e,`string`);return eI(t)==`symbol`?t:t+``}function Oae(e,t){if(eI(e)!=`object`||!e)return e;var n=e[Symbol.toPrimitive];if(n!==void 0){var r=n.call(e,t||`default`);if(eI(r)!=`object`)return r;throw TypeError(`@@toPrimitive must return a primitive value.`)}return(t===`string`?String:Number)(e)}var aI=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},kae=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},Aae={x:0,y:0,width:0,height:0,radius:0,isAnimationActive:!1,isUpdateAnimationActive:!1,animationBegin:0,animationDuration:1500,animationEasing:`ease`},oI=function(e){var t=iI(iI({},Aae),e),n=(0,_.useRef)(),r=xae((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($F,{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($F,{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`,tI({},yb(t,!0),{className:v,d:aI(o,s,r,a,u),ref:n})))}):_.createElement(`path`,tI({},yb(t,!0),{className:v,d:aI(o,s,c,l,u)}))},jae=[`points`,`className`,`baseLinePoints`,`connectNulls`];function sI(){return sI=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},sI.apply(this,arguments)}function Mae(e,t){if(e==null)return{};var n=Nae(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 Nae(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 cI(e){return Lae(e)||Iae(e)||Fae(e)||Pae()}function Pae(){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 Fae(e,t){if(e){if(typeof e==`string`)return lI(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 lI(e,t)}}function Iae(e){if(typeof Symbol<`u`&&e[Symbol.iterator]!=null||e[`@@iterator`]!=null)return Array.from(e)}function Lae(e){if(Array.isArray(e))return lI(e)}function lI(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 uI=function(e){return e&&e.x===+e.x&&e.y===+e.y},Rae=function(){var e=arguments.length>0&&arguments[0]!==void 0?arguments[0]:[],t=[[]];return e.forEach(function(e){uI(e)?t[t.length-1].push(e):t[t.length-1].length>0&&t.push([])}),uI(e[0])&&t[t.length-1].push(e[0]),t[t.length-1].length<=0&&(t=t.slice(0,-1)),t},dI=function(e,t){var n=Rae(e);t&&(n=[n.reduce(function(e,t){return[].concat(cI(e),cI(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},zae=function(e,t,n){var r=dI(e,n);return`${r.slice(-1)===`Z`?r.slice(0,-1):r}L${dI(t.reverse(),n).slice(1)}`},Bae=function(e){var t=e.points,n=e.className,r=e.baseLinePoints,i=e.connectNulls,a=Mae(e,jae);if(!t||!t.length)return null;var o=Ht(`recharts-polygon`,n);if(r&&r.length){var s=a.stroke&&a.stroke!==`none`,c=zae(t,r,i);return _.createElement(`g`,{className:o},_.createElement(`path`,sI({},yb(a,!0),{fill:c.slice(-1)===`Z`?a.fill:`none`,stroke:`none`,d:c})),s?_.createElement(`path`,sI({},yb(a,!0),{fill:`none`,d:dI(t,i)})):null,s?_.createElement(`path`,sI({},yb(a,!0),{fill:`none`,d:dI(r,i)})):null)}var l=dI(t,i);return _.createElement(`path`,sI({},yb(a,!0),{fill:l.slice(-1)===`Z`?a.fill:`none`,className:o,d:l}))};function fI(){return fI=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},fI.apply(this,arguments)}var pI=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`,fI({},yb(e,!1),Zy(e),{className:a,cx:t,cy:n,r})):null};function mI(e){"@babel/helpers - typeof";return mI=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},mI(e)}var Vae=[`x`,`y`,`top`,`left`,`width`,`height`,`className`];function hI(){return hI=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},hI.apply(this,arguments)}function gI(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter(function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable})),n.push.apply(n,r)}return n}function Hae(e){for(var t=1;t<arguments.length;t++){var n=arguments[t]==null?{}:arguments[t];t%2?gI(Object(n),!0).forEach(function(t){Uae(e,t,n[t])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):gI(Object(n)).forEach(function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(n,t))})}return e}function Uae(e,t,n){return t=Wae(t),t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function Wae(e){var t=Gae(e,`string`);return mI(t)==`symbol`?t:t+``}function Gae(e,t){if(mI(e)!=`object`||!e)return e;var n=e[Symbol.toPrimitive];if(n!==void 0){var r=n.call(e,t||`default`);if(mI(r)!=`object`)return r;throw TypeError(`@@toPrimitive must return a primitive value.`)}return(t===`string`?String:Number)(e)}function Kae(e,t){if(e==null)return{};var n=qae(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 qae(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 Jae=function(e,t,n,r,i,a){return`M${e},${i}v${r}M${a},${t}h${n}`},Yae=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=Kae(e,Vae),h=Hae({x:n,y:i,top:o,left:c,width:u,height:f},m);return!My(n)||!My(i)||!My(u)||!My(f)||!My(o)||!My(c)?null:_.createElement(`path`,hI({},yb(h,!0),{className:Ht(`recharts-cross`,p),d:Jae(n,i,u,f,o,c)}))},Xae=o(((e,t)=>{var n=RA(),r=zA(),i=cC();function a(e,t){return e&&e.length?n(e,i(t,2),r):void 0}t.exports=a})),Zae=o(((e,t)=>{var n=RA(),r=cC(),i=VA();function a(e,t){return e&&e.length?n(e,r(t,2),i):void 0}t.exports=a})),Qae=l(Xae()),$ae=l(Zae()),eoe=[`cx`,`cy`,`angle`,`ticks`,`axisLine`],toe=[`ticks`,`tick`,`angle`,`tickFormatter`,`stroke`];function _I(e){"@babel/helpers - typeof";return _I=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},_I(e)}function vI(){return vI=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},vI.apply(this,arguments)}function yI(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter(function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable})),n.push.apply(n,r)}return n}function bI(e){for(var t=1;t<arguments.length;t++){var n=arguments[t]==null?{}:arguments[t];t%2?yI(Object(n),!0).forEach(function(t){EI(e,t,n[t])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):yI(Object(n)).forEach(function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(n,t))})}return e}function xI(e,t){if(e==null)return{};var n=noe(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 noe(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 roe(e,t){if(!(e instanceof t))throw TypeError(`Cannot call a class as a function`)}function SI(e,t){for(var n=0;n<t.length;n++){var r=t[n];r.enumerable=r.enumerable||!1,r.configurable=!0,`value`in r&&(r.writable=!0),Object.defineProperty(e,DI(r.key),r)}}function ioe(e,t,n){return t&&SI(e.prototype,t),n&&SI(e,n),Object.defineProperty(e,"prototype",{writable:!1}),e}function aoe(e,t,n){return t=wI(t),ooe(e,CI()?Reflect.construct(t,n||[],wI(e).constructor):t.apply(e,n))}function ooe(e,t){if(t&&(_I(t)===`object`||typeof t==`function`))return t;if(t!==void 0)throw TypeError(`Derived constructors may only return object or undefined`);return soe(e)}function soe(e){if(e===void 0)throw ReferenceError(`this hasn't been initialised - super() hasn't been called`);return e}function CI(){try{var e=!Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],function(){}))}catch{}return(CI=function(){return!!e})()}function wI(e){return wI=Object.setPrototypeOf?Object.getPrototypeOf.bind():function(e){return e.__proto__||Object.getPrototypeOf(e)},wI(e)}function coe(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&&TI(e,t)}function TI(e,t){return TI=Object.setPrototypeOf?Object.setPrototypeOf.bind():function(e,t){return e.__proto__=t,e},TI(e,t)}function EI(e,t,n){return t=DI(t),t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function DI(e){var t=loe(e,`string`);return _I(t)==`symbol`?t:t+``}function loe(e,t){if(_I(e)!=`object`||!e)return e;var n=e[Symbol.toPrimitive];if(n!==void 0){var r=n.call(e,t||`default`);if(_I(r)!=`object`)return r;throw TypeError(`@@toPrimitive must return a primitive value.`)}return(t===`string`?String:Number)(e)}var OI=function(e){function t(){return roe(this,t),aoe(this,t,arguments)}return coe(t,e),ioe(t,[{key:`getTickValueCoord`,value:function(e){var t=e.coordinate,n=this.props,r=n.angle,i=n.cx,a=n.cy;return wN(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,Qae.default)(i,function(e){return e.coordinate||0});return{cx:t,cy:n,startAngle:r,endAngle:r,innerRadius:(0,$ae.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=xI(e,eoe),s=i.reduce(function(e,t){return[Math.min(e[0],t.coordinate),Math.max(e[1],t.coordinate)]},[1/0,-1/0]),c=wN(t,n,s[0],r),l=wN(t,n,s[1],r),u=bI(bI(bI({},yb(o,!1)),{},{fill:`none`},yb(a,!1)),{},{x1:c.x,y1:c.y,x2:l.x,y2:l.y});return _.createElement(`line`,vI({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=xI(n,toe),l=this.getTickTextAnchor(),u=yb(c,!1),d=yb(i,!1),f=r.map(function(n,r){var c=e.getTickValueCoord(n),f=bI(bI(bI(bI({textAnchor:l,transform:`rotate(${90-a}, ${c.x}, ${c.y})`},u),{},{stroke:`none`,fill:s},d),{},{index:r},c),{},{payload:n});return _.createElement(Pb,vI({className:Ht(`recharts-polar-radius-axis-tick`,MN(i)),key:`tick-${n.coordinate}`},$y(e.props,n,r)),t.renderTickItem(i,f,o?o(n.value,r):n.value))});return _.createElement(Pb,{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(Pb,{className:Ht(`recharts-polar-radius-axis`,this.props.className)},n&&this.renderAxisLine(),r&&this.renderTicks(),tP.renderCallByParent(this.props,this.getViewBox()))}}],[{key:`renderTickItem`,value:function(e,t,n){return _.isValidElement(e)?_.cloneElement(e,t):(0,eb.default)(e)?e(t):_.createElement(xT,vI({},t,{className:`recharts-polar-radius-axis-tick-value`}),n)}}])}(_.PureComponent);EI(OI,`displayName`,`PolarRadiusAxis`),EI(OI,`axisType`,`radiusAxis`),EI(OI,`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 kI(e){"@babel/helpers - typeof";return kI=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},kI(e)}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 jI(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 MI(e){for(var t=1;t<arguments.length;t++){var n=arguments[t]==null?{}:arguments[t];t%2?jI(Object(n),!0).forEach(function(t){LI(e,t,n[t])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):jI(Object(n)).forEach(function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(n,t))})}return e}function uoe(e,t){if(!(e instanceof t))throw TypeError(`Cannot call a class as a function`)}function NI(e,t){for(var n=0;n<t.length;n++){var r=t[n];r.enumerable=r.enumerable||!1,r.configurable=!0,`value`in r&&(r.writable=!0),Object.defineProperty(e,RI(r.key),r)}}function doe(e,t,n){return t&&NI(e.prototype,t),n&&NI(e,n),Object.defineProperty(e,"prototype",{writable:!1}),e}function foe(e,t,n){return t=FI(t),poe(e,PI()?Reflect.construct(t,n||[],FI(e).constructor):t.apply(e,n))}function poe(e,t){if(t&&(kI(t)===`object`||typeof t==`function`))return t;if(t!==void 0)throw TypeError(`Derived constructors may only return object or undefined`);return moe(e)}function moe(e){if(e===void 0)throw ReferenceError(`this hasn't been initialised - super() hasn't been called`);return e}function PI(){try{var e=!Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],function(){}))}catch{}return(PI=function(){return!!e})()}function FI(e){return FI=Object.setPrototypeOf?Object.getPrototypeOf.bind():function(e){return e.__proto__||Object.getPrototypeOf(e)},FI(e)}function hoe(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&&II(e,t)}function II(e,t){return II=Object.setPrototypeOf?Object.setPrototypeOf.bind():function(e,t){return e.__proto__=t,e},II(e,t)}function LI(e,t,n){return t=RI(t),t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function RI(e){var t=goe(e,`string`);return kI(t)==`symbol`?t:t+``}function goe(e,t){if(kI(e)!=`object`||!e)return e;var n=e[Symbol.toPrimitive];if(n!==void 0){var r=n.call(e,t||`default`);if(kI(r)!=`object`)return r;throw TypeError(`@@toPrimitive must return a primitive value.`)}return(t===`string`?String:Number)(e)}var _oe=Math.PI/180,zI=1e-5,BI=function(e){function t(){return uoe(this,t),foe(this,t,arguments)}return hoe(t,e),doe(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=wN(n,r,i,e.coordinate),c=wN(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*_oe);return n>zI?t===`outer`?`start`:`end`:n<-zI?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=MI(MI({},yb(this.props,!1)),{},{fill:`none`},yb(i,!1));if(a===`circle`)return _.createElement(pI,AI({className:`recharts-polar-angle-axis-line`},o,{cx:t,cy:n,r}));var s=this.props.ticks.map(function(e){return wN(t,n,r,e.coordinate)});return _.createElement(Bae,AI({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=yb(this.props,!1),l=yb(i,!1),u=MI(MI({},c),{},{fill:`none`},yb(a,!1)),d=r.map(function(n,r){var d=e.getTickLineCoord(n),f=MI(MI(MI({textAnchor:e.getTickTextAnchor(n)},c),{},{stroke:`none`,fill:s},l),{},{index:r,payload:n,x:d.x2,y:d.y2});return _.createElement(Pb,AI({className:Ht(`recharts-polar-angle-axis-tick`,MN(i)),key:`tick-${n.coordinate}`},$y(e.props,n,r)),a&&_.createElement(`line`,AI({className:`recharts-polar-angle-axis-tick-line`},u,d)),i&&t.renderTickItem(i,f,o?o(n.value,r):n.value))});return _.createElement(Pb,{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(Pb,{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,eb.default)(e)?e(t):_.createElement(xT,AI({},t,{className:`recharts-polar-angle-axis-tick-value`}),n)}}])}(_.PureComponent);LI(BI,`displayName`,`PolarAngleAxis`),LI(BI,`axisType`,`angleAxis`),LI(BI,`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 voe=o(((e,t)=>{t.exports=eC()(Object.getPrototypeOf,Object)})),yoe=o(((e,t)=>{var n=Dv(),r=voe(),i=Ov(),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})),boe=o(((e,t)=>{var n=Dv(),r=Ov(),i=`[object Boolean]`;function a(e){return e===!0||e===!1||r(e)&&n(e)==i}t.exports=a}));function VI(e){"@babel/helpers - typeof";return VI=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},VI(e)}function HI(){return HI=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},HI.apply(this,arguments)}function UI(e,t){return JI(e)||qI(e,t)||GI(e,t)||WI()}function WI(){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 GI(e,t){if(e){if(typeof e==`string`)return KI(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 KI(e,t)}}function KI(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 qI(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 JI(e){if(Array.isArray(e))return e}function YI(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 XI(e){for(var t=1;t<arguments.length;t++){var n=arguments[t]==null?{}:arguments[t];t%2?YI(Object(n),!0).forEach(function(t){ZI(e,t,n[t])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):YI(Object(n)).forEach(function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(n,t))})}return e}function ZI(e,t,n){return t=QI(t),t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function QI(e){var t=$I(e,`string`);return VI(t)==`symbol`?t:t+``}function $I(e,t){if(VI(e)!=`object`||!e)return e;var n=e[Symbol.toPrimitive];if(n!==void 0){var r=n.call(e,t||`default`);if(VI(r)!=`object`)return r;throw TypeError(`@@toPrimitive must return a primitive value.`)}return(t===`string`?String:Number)(e)}var eL=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},tL={x:0,y:0,upperWidth:0,lowerWidth:0,height:0,isUpdateAnimationActive:!1,animationBegin:0,animationDuration:1500,animationEasing:`ease`},nL=function(e){var t=XI(XI({},tL),e),n=(0,_.useRef)(),r=UI((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($F,{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($F,{canBegin:i>0,from:`0px ${i===-1?1:i}px`,to:`${i}px 0px`,attributeName:`strokeDasharray`,begin:m,duration:p,easing:f},_.createElement(`path`,HI({},yb(t,!0),{className:g,d:eL(s,c,r,a,o),ref:n})))}):_.createElement(`g`,null,_.createElement(`path`,HI({},yb(t,!0),{className:g,d:eL(o,s,c,l,u)})))},rL=l(yoe()),iL=l(boe()),aL=[`option`,`shapeType`,`propTransformer`,`activeClassName`,`isActive`];function oL(e){"@babel/helpers - typeof";return oL=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},oL(e)}function sL(e,t){if(e==null)return{};var n=cL(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 cL(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 lL(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 uL(e){for(var t=1;t<arguments.length;t++){var n=arguments[t]==null?{}:arguments[t];t%2?lL(Object(n),!0).forEach(function(t){dL(e,t,n[t])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):lL(Object(n)).forEach(function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(n,t))})}return e}function dL(e,t,n){return t=fL(t),t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function fL(e){var t=pL(e,`string`);return oL(t)==`symbol`?t:t+``}function pL(e,t){if(oL(e)!=`object`||!e)return e;var n=e[Symbol.toPrimitive];if(n!==void 0){var r=n.call(e,t||`default`);if(oL(r)!=`object`)return r;throw TypeError(`@@toPrimitive must return a primitive value.`)}return(t===`string`?String:Number)(e)}function mL(e,t){return uL(uL({},t),e)}function hL(e,t){return e===`symbols`}function gL(e){var t=e.shapeType,n=e.elementProps;switch(t){case`rectangle`:return _.createElement(oI,n);case`trapezoid`:return _.createElement(nL,n);case`sector`:return _.createElement(RP,n);case`symbols`:if(hL(t,n))return _.createElement(OS,n);break;default:return null}}function _L(e){return(0,_.isValidElement)(e)?e.props:e}function vL(e){var t=e.option,n=e.shapeType,r=e.propTransformer,i=r===void 0?mL:r,a=e.activeClassName,o=a===void 0?`recharts-active-shape`:a,s=e.isActive,c=sL(e,aL),l;if((0,_.isValidElement)(t))l=(0,_.cloneElement)(t,uL(uL({},c),_L(t)));else if((0,eb.default)(t))l=t(c);else if((0,rL.default)(t)&&!(0,iL.default)(t)){var u=i(t,c);l=_.createElement(gL,{shapeType:n,elementProps:u})}else{var d=c;l=_.createElement(gL,{shapeType:n,elementProps:d})}return s?_.createElement(Pb,{className:o},l):l}function yL(e,t){return t!=null&&`trapezoids`in e.props}function bL(e,t){return t!=null&&`sectors`in e.props}function xL(e,t){return t!=null&&`points`in e.props}function SL(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 CL(e,t){var n=e.endAngle===t.endAngle,r=e.startAngle===t.startAngle;return n&&r}function wL(e,t){var n=e.x===t.x,r=e.y===t.y,i=e.z===t.z;return n&&r&&i}function TL(e,t){var n;return yL(e,t)?n=SL:bL(e,t)?n=CL:xL(e,t)&&(n=wL),n}function EL(e,t){var n;return yL(e,t)?n=`trapezoids`:bL(e,t)?n=`sectors`:xL(e,t)&&(n=`points`),n}function DL(e,t){if(yL(e,t)){var n;return(n=t.tooltipPayload)==null||(n=n[0])==null||(n=n.payload)==null?void 0:n.payload}if(bL(e,t)){var r;return(r=t.tooltipPayload)==null||(r=r[0])==null||(r=r.payload)==null?void 0:r.payload}return xL(e,t)?t.payload:{}}function OL(e){var t=e.activeTooltipItem,n=e.graphicalItem,r=e.itemData,i=EL(n,t),a=DL(n,t),o=r.filter(function(e,r){var o=(0,hM.default)(a,e),s=n.props[i].filter(function(e){return TL(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 kL;function AL(e){"@babel/helpers - typeof";return AL=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},AL(e)}function jL(){return jL=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},jL.apply(this,arguments)}function ML(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 NL(e){for(var t=1;t<arguments.length;t++){var n=arguments[t]==null?{}:arguments[t];t%2?ML(Object(n),!0).forEach(function(t){WL(e,t,n[t])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):ML(Object(n)).forEach(function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(n,t))})}return e}function PL(e,t){if(!(e instanceof t))throw TypeError(`Cannot call a class as a function`)}function FL(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,GL(r.key),r)}}function IL(e,t,n){return t&&FL(e.prototype,t),n&&FL(e,n),Object.defineProperty(e,"prototype",{writable:!1}),e}function LL(e,t,n){return t=VL(t),RL(e,BL()?Reflect.construct(t,n||[],VL(e).constructor):t.apply(e,n))}function RL(e,t){if(t&&(AL(t)===`object`||typeof t==`function`))return t;if(t!==void 0)throw TypeError(`Derived constructors may only return object or undefined`);return zL(e)}function zL(e){if(e===void 0)throw ReferenceError(`this hasn't been initialised - super() hasn't been called`);return e}function BL(){try{var e=!Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],function(){}))}catch{}return(BL=function(){return!!e})()}function VL(e){return VL=Object.setPrototypeOf?Object.getPrototypeOf.bind():function(e){return e.__proto__||Object.getPrototypeOf(e)},VL(e)}function HL(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&&UL(e,t)}function UL(e,t){return UL=Object.setPrototypeOf?Object.setPrototypeOf.bind():function(e,t){return e.__proto__=t,e},UL(e,t)}function WL(e,t,n){return t=GL(t),t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function GL(e){var t=KL(e,`string`);return AL(t)==`symbol`?t:t+``}function KL(e,t){if(AL(e)!=`object`||!e)return e;var n=e[Symbol.toPrimitive];if(n!==void 0){var r=n.call(e,t||`default`);if(AL(r)!=`object`)return r;throw TypeError(`@@toPrimitive must return a primitive value.`)}return(t===`string`?String:Number)(e)}var qL=function(e){function t(e){var n;return PL(this,t),n=LL(this,t,[e]),WL(n,`pieRef`,null),WL(n,`sectorRefs`,[]),WL(n,`id`,Iy(`recharts-pie-`)),WL(n,`handleAnimationEnd`,function(){var e=n.props.onAnimationEnd;n.setState({isAnimationFinished:!0}),(0,eb.default)(e)&&e()}),WL(n,`handleAnimationStart`,function(){var e=n.props.onAnimationStart;n.setState({isAnimationFinished:!1}),(0,eb.default)(e)&&e()}),n.state={isAnimationFinished:!e.isAnimationActive,prevIsAnimationActive:e.isAnimationActive,prevAnimationId:e.animationId,sectorToFocus:0},n}return HL(t,e),IL(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=yb(this.props,!1),c=yb(r,!1),l=yb(i,!1),u=r&&r.offsetRadius||20,d=e.map(function(e,n){var d=(e.startAngle+e.endAngle)/2,f=wN(e.cx,e.cy,e.outerRadius+u,d),p=NL(NL(NL(NL({},s),e),{},{stroke:`none`},c),{},{index:n,textAnchor:t.getTextAnchor(f.x,e.cx)},f),m=NL(NL(NL(NL({},s),e),{},{fill:`none`,stroke:e.fill},l),{},{index:n,points:[wN(e.cx,e.cy,e.outerRadius,d),f]}),h=a;return(0,ky.default)(a)&&(0,ky.default)(o)?h=`value`:(0,ky.default)(a)&&(h=o),_.createElement(Pb,{key:`label-${e.startAngle}-${e.endAngle}-${e.midAngle}-${n}`},i&&t.renderLabelLineItem(i,m,`line`),t.renderLabelItem(r,p,OM(e,h)))});return _.createElement(Pb,{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=NL(NL({},n),{},{stroke:i?n.fill:n.stroke,tabIndex:-1});return _.createElement(Pb,jL({ref:function(e){e&&!t.sectorRefs.includes(e)&&t.sectorRefs.push(e)},tabIndex:-1,className:`recharts-pie-sector`},$y(t.props,n,o),{key:`sector-${n?.startAngle}-${n?.endAngle}-${n.midAngle}-${o}`}),_.createElement(vL,jL({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($F,{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,Dy.default)(e,`paddingAngle`,0):0;if(n){var s=By(n.endAngle-n.startAngle,e.endAngle-e.startAngle),c=NL(NL({},e),{},{startAngle:a+o,endAngle:a+s(r)+o});i.push(c),a=c.endAngle}else{var u=e.endAngle,d=e.startAngle,f=By(0,u-d)(r),p=NL(NL({},e),{},{startAngle:a+o,endAngle:a+f+o});i.push(p),a=p.endAngle}}),_.createElement(Pb,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,hM.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||!My(o)||!My(s)||!My(c)||!My(l))return null;var f=Ht(`recharts-pie`,i);return _.createElement(Pb,{tabIndex:this.props.rootTabIndex,className:f,ref:function(t){e.pieRef=t}},this.renderSectors(),a&&this.renderLabels(r),tP.renderCallByParent(this.props,null,!1),(!u||d)&&CP.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,eb.default)(e))return e(t);var r=Ht(`recharts-pie-label-line`,typeof e==`boolean`?``:e.className);return _.createElement(QP,jL({},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,eb.default)(e)&&(r=e(t),_.isValidElement(r)))return r;var i=Ht(`recharts-pie-label-text`,typeof e!=`boolean`&&!(0,eb.default)(e)?e.className:``);return _.createElement(xT,jL({},t,{alignmentBaseline:`middle`,className:i}),r)}}])}(_.PureComponent);kL=qL,WL(qL,`displayName`,`Pie`),WL(qL,`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:!iw.isSsr,animationBegin:400,animationDuration:1500,animationEasing:`ease`,nameKey:`name`,blendStroke:!1,rootTabIndex:0}),WL(qL,`parseDeltaAngle`,function(e,t){return Ay(t-e)*Math.min(Math.abs(t-e),360)}),WL(qL,`getRealPieData`,function(e){var t=e.data,n=e.children,r=yb(e,!1),i=fb(n,Rw);return t&&t.length?t.map(function(e,t){return NL(NL(NL({payload:e},r),e),i&&i[t]&&i[t].props)}):i&&i.length?i.map(function(e){return NL(NL({},r),e.props)}):[]}),WL(qL,`parseCoordinateOfPie`,function(e,t){var n=t.top,r=t.left,i=t.width,a=t.height,o=TN(i,a);return{cx:r+Ly(e.cx,i,i/2),cy:n+Ly(e.cy,a,a/2),innerRadius:Ly(e.innerRadius,o,0),outerRadius:Ly(e.outerRadius,o,o*.8),maxRadius:e.maxRadius||Math.sqrt(i*i+a*a)/2}}),WL(qL,`getComposedData`,function(e){var t=e.item,n=e.offset,r=t.type.defaultProps===void 0?t.props:NL(NL({},t.type.defaultProps),t.props),i=kL.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=kL.parseCoordinateOfPie(r,n),h=kL.parseDeltaAngle(o,s),g=Math.abs(h),_=l;(0,ky.default)(l)&&(0,ky.default)(d)?_=`value`:(0,ky.default)(l)&&(_=d);var v=i.filter(function(e){return OM(e,_,0)!==0}).length,y=(g>=360?v:v-1)*c,b=g-v*p-y,x=i.reduce(function(e,t){var n=OM(t,_,0);return e+(My(n)?n:0)},0),S;if(x>0){var C;S=i.map(function(e,t){var n=OM(e,_,0),r=OM(e,u,t),i=(My(n)?n:0)/x,s=t?C.endAngle+Ay(h)*c*(n===0?0:1):o,l=s+Ay(h)*((n===0?0:p)+i*b),d=(s+l)/2,g=(m.innerRadius+m.outerRadius)/2;return C=NL(NL(NL({percent:i,cornerRadius:a,name:r,tooltipPayload:[{name:r,value:n,payload:e,dataKey:_,type:f}],midAngle:d,middleRadius:g,tooltipPosition:wN(m.cx,m.cy,g,d)},e),m),{},{value:OM(e,_),startAngle:s,endAngle:l,payload:e,paddingAngle:Ay(h)*c}),C})}return NL(NL({},m),{},{sectors:S,data:i})});var JL=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})),YL=o(((e,t)=>{var n=Sw(),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})),XL=o(((e,t)=>{var n=JL(),r=OC(),i=YL();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})),ZL=o(((e,t)=>{t.exports=XL()()}));function QL(e){"@babel/helpers - typeof";return QL=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},QL(e)}function $L(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 eR(e){for(var t=1;t<arguments.length;t++){var n=arguments[t]==null?{}:arguments[t];t%2?$L(Object(n),!0).forEach(function(t){tR(e,t,n[t])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):$L(Object(n)).forEach(function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(n,t))})}return e}function tR(e,t,n){return t=nR(t),t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function nR(e){var t=rR(e,`string`);return QL(t)==`symbol`?t:t+``}function rR(e,t){if(QL(e)!=`object`||!e)return e;var n=e[Symbol.toPrimitive];if(n!==void 0){var r=n.call(e,t||`default`);if(QL(r)!=`object`)return r;throw TypeError(`@@toPrimitive must return a primitive value.`)}return(t===`string`?String:Number)(e)}var iR=[`Webkit`,`Moz`,`O`,`ms`],aR=function(e,t){if(!e)return null;var n=e.replace(/(\w)/,function(e){return e.toUpperCase()}),r=iR.reduce(function(e,r){return eR(eR({},e),{},tR({},r+n,t))},{});return r[e]=t,r},oR=l(ZL());function sR(e){"@babel/helpers - typeof";return sR=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},sR(e)}function cR(){return cR=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},cR.apply(this,arguments)}function lR(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 uR(e){for(var t=1;t<arguments.length;t++){var n=arguments[t]==null?{}:arguments[t];t%2?lR(Object(n),!0).forEach(function(t){xR(e,t,n[t])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):lR(Object(n)).forEach(function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(n,t))})}return e}function dR(e,t){if(!(e instanceof t))throw TypeError(`Cannot call a class as a function`)}function fR(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,SR(r.key),r)}}function pR(e,t,n){return t&&fR(e.prototype,t),n&&fR(e,n),Object.defineProperty(e,"prototype",{writable:!1}),e}function mR(e,t,n){return t=vR(t),hR(e,_R()?Reflect.construct(t,n||[],vR(e).constructor):t.apply(e,n))}function hR(e,t){if(t&&(sR(t)===`object`||typeof t==`function`))return t;if(t!==void 0)throw TypeError(`Derived constructors may only return object or undefined`);return gR(e)}function gR(e){if(e===void 0)throw ReferenceError(`this hasn't been initialised - super() hasn't been called`);return e}function _R(){try{var e=!Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],function(){}))}catch{}return(_R=function(){return!!e})()}function vR(e){return vR=Object.setPrototypeOf?Object.getPrototypeOf.bind():function(e){return e.__proto__||Object.getPrototypeOf(e)},vR(e)}function yR(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&&bR(e,t)}function bR(e,t){return bR=Object.setPrototypeOf?Object.setPrototypeOf.bind():function(e,t){return e.__proto__=t,e},bR(e,t)}function xR(e,t,n){return t=SR(t),t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function SR(e){var t=CR(e,`string`);return sR(t)==`symbol`?t:t+``}function CR(e,t){if(sR(e)!=`object`||!e)return e;var n=e[Symbol.toPrimitive];if(n!==void 0){var r=n.call(e,t||`default`);if(sR(r)!=`object`)return r;throw TypeError(`@@toPrimitive must return a primitive value.`)}return(t===`string`?String:Number)(e)}var wR=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=rE().domain((0,oR.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}},TR=function(e){return e.changedTouches&&!!e.changedTouches.length},ER=function(e){function t(e){var n;return dR(this,t),n=mR(this,t,[e]),xR(n,`handleDrag`,function(e){n.leaveTimer&&(clearTimeout(n.leaveTimer),n.leaveTimer=null),n.state.isTravellerMoving?n.handleTravellerMove(e):n.state.isSlideMoving&&n.handleSlideDrag(e)}),xR(n,`handleTouchMove`,function(e){e.changedTouches!=null&&e.changedTouches.length>0&&n.handleDrag(e.changedTouches[0])}),xR(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()}),xR(n,`handleLeaveWrapper`,function(){(n.state.isTravellerMoving||n.state.isSlideMoving)&&(n.leaveTimer=window.setTimeout(n.handleDragEnd,n.props.leaveTimeOut))}),xR(n,`handleEnterSlideOrTraveller`,function(){n.setState({isTextActive:!0})}),xR(n,`handleLeaveSlideOrTraveller`,function(){n.setState({isTextActive:!1})}),xR(n,`handleSlideDragStart`,function(e){var t=TR(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 yR(t,e),pR(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=OM(n[e],i,e);return(0,eb.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=TR(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(xR(xR({},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(xR({},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=uR(uR({},yb(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(Pb,{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(Pb,{className:`recharts-brush-texts`},_.createElement(xT,cR({textAnchor:`end`,verticalAnchor:`middle`,x:Math.min(c,l)-u,y:r+i/2},d),this.getTextOfTick(t)),_.createElement(xT,cR({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||!My(i)||!My(a)||!My(o)||!My(s)||o<=0||s<=0)return null;var g=Ht(`recharts-brush`,n),v=_.Children.count(r)===1,y=aR(`userSelect`,`none`);return _.createElement(Pb,{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,eb.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 uR({prevData:n,prevTravellerWidth:a,prevUpdateId:o,prevX:i,prevWidth:r},n&&n.length?wR({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);xR(ER,`displayName`,`Brush`),xR(ER,`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 DR=o(((e,t)=>{var n=TC();function r(e,t){var r;return n(e,function(e,n,i){return r=t(e,n,i),!r}),!!r}t.exports=r})),OR=o(((e,t)=>{var n=US(),r=cC(),i=DR(),a=xv(),o=OC();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})),kR=function(e,t){var n=e.alwaysShow,r=e.ifOverflow;return n&&(r=`extendDomain`),r===t},AR=o(((e,t)=>{var n=DC();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})),jR=o(((e,t)=>{var n=AR(),r=wC(),i=cC();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})),MR=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})),NR=o(((e,t)=>{var n=TC();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})),PR=o(((e,t)=>{var n=MR(),r=NR(),i=cC(),a=xv(),o=OC();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})),FR=[`x`,`y`];function IR(e){"@babel/helpers - typeof";return IR=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},IR(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 RR(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 zR(e){for(var t=1;t<arguments.length;t++){var n=arguments[t]==null?{}:arguments[t];t%2?RR(Object(n),!0).forEach(function(t){BR(e,t,n[t])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):RR(Object(n)).forEach(function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(n,t))})}return e}function BR(e,t,n){return t=VR(t),t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function VR(e){var t=HR(e,`string`);return IR(t)==`symbol`?t:t+``}function HR(e,t){if(IR(e)!=`object`||!e)return e;var n=e[Symbol.toPrimitive];if(n!==void 0){var r=n.call(e,t||`default`);if(IR(r)!=`object`)return r;throw TypeError(`@@toPrimitive must return a primitive value.`)}return(t===`string`?String:Number)(e)}function UR(e,t){if(e==null)return{};var n=WR(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 WR(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 GR(e,t){var n=e.x,r=e.y,i=UR(e,FR),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 zR(zR(zR(zR(zR({},t),i),o?{x:o}:{}),c?{y:c}:{}),{},{height:u,width:f,name:t.name,radius:t.radius})}function KR(e){return _.createElement(vL,LR({shapeType:`rectangle`,propTransformer:GR,activeClassName:`recharts-active-bar`},e))}var qR=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=My(n)||Ny(n);return i?e(n,r):(!i&&Nj(!1),t)}},JR=[`value`,`background`],YR;function XR(e){"@babel/helpers - typeof";return XR=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},XR(e)}function ZR(e,t){if(e==null)return{};var n=QR(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 QR(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 $R(){return $R=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},$R.apply(this,arguments)}function ez(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 tz(e){for(var t=1;t<arguments.length;t++){var n=arguments[t]==null?{}:arguments[t];t%2?ez(Object(n),!0).forEach(function(t){fz(e,t,n[t])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):ez(Object(n)).forEach(function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(n,t))})}return e}function nz(e,t){if(!(e instanceof t))throw TypeError(`Cannot call a class as a function`)}function rz(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,pz(r.key),r)}}function iz(e,t,n){return t&&rz(e.prototype,t),n&&rz(e,n),Object.defineProperty(e,"prototype",{writable:!1}),e}function az(e,t,n){return t=lz(t),oz(e,cz()?Reflect.construct(t,n||[],lz(e).constructor):t.apply(e,n))}function oz(e,t){if(t&&(XR(t)===`object`||typeof t==`function`))return t;if(t!==void 0)throw TypeError(`Derived constructors may only return object or undefined`);return sz(e)}function sz(e){if(e===void 0)throw ReferenceError(`this hasn't been initialised - super() hasn't been called`);return e}function cz(){try{var e=!Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],function(){}))}catch{}return(cz=function(){return!!e})()}function lz(e){return lz=Object.setPrototypeOf?Object.getPrototypeOf.bind():function(e){return e.__proto__||Object.getPrototypeOf(e)},lz(e)}function uz(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&&dz(e,t)}function dz(e,t){return dz=Object.setPrototypeOf?Object.setPrototypeOf.bind():function(e,t){return e.__proto__=t,e},dz(e,t)}function fz(e,t,n){return t=pz(t),t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function pz(e){var t=mz(e,`string`);return XR(t)==`symbol`?t:t+``}function mz(e,t){if(XR(e)!=`object`||!e)return e;var n=e[Symbol.toPrimitive];if(n!==void 0){var r=n.call(e,t||`default`);if(XR(r)!=`object`)return r;throw TypeError(`@@toPrimitive must return a primitive value.`)}return(t===`string`?String:Number)(e)}var hz=function(e){function t(){var e;nz(this,t);var n=[...arguments];return e=az(this,t,[].concat(n)),fz(e,`state`,{isAnimationFinished:!1}),fz(e,`id`,Iy(`recharts-bar-`)),fz(e,`handleAnimationEnd`,function(){var t=e.props.onAnimationEnd;e.setState({isAnimationFinished:!0}),t&&t()}),fz(e,`handleAnimationStart`,function(){var t=e.props.onAnimationStart;e.setState({isAnimationFinished:!1}),t&&t()}),e}return uz(t,e),iz(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=yb(this.props,!1);return e&&e.map(function(e,n){var c=n===a,l=c?o:r,u=tz(tz(tz({},s),e),{},{isActive:c,option:l,index:n,dataKey:i,onAnimationStart:t.handleAnimationStart,onAnimationEnd:t.handleAnimationEnd});return _.createElement(Pb,$R({className:`recharts-bar-rectangle`},$y(t.props,e,n),{key:`rectangle-${e?.x}-${e?.y}-${e?.value}-${n}`}),_.createElement(KR,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($F,{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=By(n.x,e.x),o=By(n.y,e.y),s=By(n.width,e.width),c=By(n.height,e.height);return tz(tz({},e),{},{x:a(i),y:o(i),width:s(i),height:c(i)})}if(r===`horizontal`){var u=By(0,e.height)(i);return tz(tz({},e),{},{y:e.y+e.height-u,height:u})}var d=By(0,e.width)(i);return tz(tz({},e),{},{width:d})});return _.createElement(Pb,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,hM.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=yb(this.props.background,!1);return n.map(function(t,n){t.value;var o=t.background,s=ZR(t,JR);if(!o)return null;var c=tz(tz(tz(tz(tz({},s),{},{fill:`#eee`},o),a),$y(e.props,t,n)),{},{onAnimationStart:e.handleAnimationStart,onAnimationEnd:e.handleAnimationEnd,dataKey:r,index:n,className:`recharts-bar-background-rectangle`});return _.createElement(KR,$R({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=fb(s,iM);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:OM(e,t)}},d={clipPath:e?`url(#clipPath-${t})`:null};return _.createElement(Pb,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,ky.default)(f)?this.id:f;return _.createElement(Pb,{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(Pb,{className:`recharts-bar-rectangles`,clipPath:v?`url(#clipPath-${y})`:null},d?this.renderBackground():null,this.renderRectangles()),this.renderErrorBar(v,y),(!u||p)&&CP.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);YR=hz,fz(hz,`displayName`,`Bar`),fz(hz,`defaultProps`,{xAxisId:0,yAxisId:0,legendType:`rect`,minPointSize:0,hide:!1,data:[],layout:`vertical`,activeBar:!1,isAnimationActive:!iw.isSsr,animationBegin:0,animationDuration:400,animationEasing:`ease`}),fz(hz,`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=KM(r,n);if(!p)return null;var m=t.layout,h=n.type.defaultProps,g=h===void 0?n.props:tz(tz({},h),n.props),_=g.dataKey,v=g.children,y=g.minPointSize,b=m===`horizontal`?o:a,x=l?b.scale.domain():null,S=eN({numericAxis:b}),C=fb(v,Rw);return tz({data:d.map(function(e,t){var r,d,f,h,g,v;l?r=qM(l[u+t],x):(r=OM(e,_),Array.isArray(r)||(r=[S,r]));var b=qR(y,YR.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=$M({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=Ay(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=$M({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=Ay(h||b)*(Math.abs(b)-Math.abs(h));h+=M}}return tz(tz(tz({},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:[lN(n,e)],tooltipPosition:{x:d+h/2,y:f+g/2}})}),layout:m},f)});var gz=l(jR()),_z=l(PR());function vz(e){"@babel/helpers - typeof";return vz=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},vz(e)}function yz(e,t){if(!(e instanceof t))throw TypeError(`Cannot call a class as a function`)}function bz(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,Tz(r.key),r)}}function xz(e,t,n){return t&&bz(e.prototype,t),n&&bz(e,n),Object.defineProperty(e,"prototype",{writable:!1}),e}function Sz(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 Cz(e){for(var t=1;t<arguments.length;t++){var n=arguments[t]==null?{}:arguments[t];t%2?Sz(Object(n),!0).forEach(function(t){wz(e,t,n[t])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):Sz(Object(n)).forEach(function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(n,t))})}return e}function wz(e,t,n){return t=Tz(t),t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function Tz(e){var t=Ez(e,`string`);return vz(t)==`symbol`?t:t+``}function Ez(e,t){if(vz(e)!=`object`||!e)return e;var n=e[Symbol.toPrimitive];if(n!==void 0){var r=n.call(e,t||`default`);if(vz(r)!=`object`)return r;throw TypeError(`@@toPrimitive must return a primitive value.`)}return(t===`string`?String:Number)(e)}var Dz=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=!!pb(c,hz);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(Hy);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=Ly(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=UM(c,i,d),j=A.scale,M=A.realScaleType;j.domain(f).range(y),GM(j);var N=ZM(j,Cz(Cz({},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=Cz(Cz(Cz({},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=sN(P,N),!c.hide&&r===`xAxis`?u[_]+=(S?-1:1)*P.height:c.hide||(u[_]+=(S?-1:1)*P.width),Cz(Cz({},a),{},wz({},o,P))},{})},Oz=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)}},kz=function(e){var t=e.x1,n=e.y1,r=e.x2,i=e.y2;return Oz({x:t,y:n},{x:r,y:i})},Az=function(){function e(t){yz(this,e),this.scale=t}return xz(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)}}])}();wz(Az,`EPS`,1e-4);var jz=function(e){var t=Object.keys(e).reduce(function(t,n){return Cz(Cz({},t),{},wz({},n,Az.create(e[n])))},{});return Cz(Cz({},t),{},{apply:function(e){var n=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{},r=n.bandAware,i=n.position;return(0,gz.default)(e,function(e,n){return t[n].apply(e,{bandAware:r,position:i})})},isInRange:function(e){return(0,_z.default)(e,function(e,n){return t[n].isInRange(e)})}})};function Mz(e){return(e%180+180)%180}var Nz=function(e){var t=e.width,n=e.height,r=Mz(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)},Pz=o(((e,t)=>{var n=cC(),r=tC(),i=nC();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})),Fz=o(((e,t)=>{var n=YL();function r(e){var t=n(e),r=t%1;return t===t?r?t-r:t:0}t.exports=r})),Iz=o(((e,t)=>{var n=lC(),r=cC(),i=Fz(),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})),Lz=o(((e,t)=>{t.exports=Pz()(Iz())})),Rz=(0,l(ly()).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(``)});Lz();var zz=(0,_.createContext)(void 0),Bz=(0,_.createContext)(void 0),Vz=(0,_.createContext)(void 0),Hz=(0,_.createContext)({}),Uz=(0,_.createContext)(void 0),Wz=(0,_.createContext)(0),Gz=(0,_.createContext)(0),Kz=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=Rz(i);return _.createElement(zz.Provider,{value:n},_.createElement(Bz.Provider,{value:r},_.createElement(Hz.Provider,{value:i},_.createElement(Vz.Provider,{value:l},_.createElement(Uz.Provider,{value:a},_.createElement(Wz.Provider,{value:c},_.createElement(Gz.Provider,{value:s},o)))))))},qz=function(){return(0,_.useContext)(Uz)},Jz=function(e){var t=(0,_.useContext)(zz);t??Nj(!1);var n=t[e];return n??Nj(!1),n},Yz=function(e){var t=(0,_.useContext)(Bz);t??Nj(!1);var n=t[e];return n??Nj(!1),n},Xz=function(){return(0,_.useContext)(Vz)},Zz=function(){return(0,_.useContext)(Gz)},Qz=function(){return(0,_.useContext)(Wz)},$z=l(OR());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)}function tB(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,mB(r.key),r)}}function rB(e,t,n){return t&&nB(e.prototype,t),n&&nB(e,n),Object.defineProperty(e,"prototype",{writable:!1}),e}function iB(e,t,n){return t=cB(t),aB(e,sB()?Reflect.construct(t,n||[],cB(e).constructor):t.apply(e,n))}function aB(e,t){if(t&&(eB(t)===`object`||typeof t==`function`))return t;if(t!==void 0)throw TypeError(`Derived constructors may only return object or undefined`);return oB(e)}function oB(e){if(e===void 0)throw ReferenceError(`this hasn't been initialised - super() hasn't been called`);return e}function sB(){try{var e=!Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],function(){}))}catch{}return(sB=function(){return!!e})()}function cB(e){return cB=Object.setPrototypeOf?Object.getPrototypeOf.bind():function(e){return e.__proto__||Object.getPrototypeOf(e)},cB(e)}function lB(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&&uB(e,t)}function uB(e,t){return uB=Object.setPrototypeOf?Object.setPrototypeOf.bind():function(e,t){return e.__proto__=t,e},uB(e,t)}function dB(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 fB(e){for(var t=1;t<arguments.length;t++){var n=arguments[t]==null?{}:arguments[t];t%2?dB(Object(n),!0).forEach(function(t){pB(e,t,n[t])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):dB(Object(n)).forEach(function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(n,t))})}return e}function pB(e,t,n){return t=mB(t),t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function mB(e){var t=hB(e,`string`);return eB(t)==`symbol`?t:t+``}function hB(e,t){if(eB(e)!=`object`||!e)return e;var n=e[Symbol.toPrimitive];if(n!==void 0){var r=n.call(e,t||`default`);if(eB(r)!=`object`)return r;throw TypeError(`@@toPrimitive must return a primitive value.`)}return(t===`string`?String:Number)(e)}function gB(e,t){return xB(e)||bB(e,t)||vB(e,t)||_B()}function _B(){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 vB(e,t){if(e){if(typeof e==`string`)return yB(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 yB(e,t)}}function yB(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 bB(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 xB(e){if(Array.isArray(e))return e}function SB(){return SB=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},SB.apply(this,arguments)}var CB=function(e,t){return _.isValidElement(e)?_.cloneElement(e,t):(0,eb.default)(e)?e(t):_.createElement(`line`,SB({},t,{className:`recharts-reference-line-line`}))},wB=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(kR(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(kR(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 kR(c,`discard`)&&(0,$z.default)(y,function(t){return!e.isInRange(t)})?null:y}return null};function TB(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=qz(),l=Jz(i),u=Yz(a),d=Xz();if(!c||!d)return null;var f=wB(jz({x:l.scale,y:u.scale}),Py(t),Py(n),r&&r.length===2,d,e.position,l.orientation,u.orientation,e);if(!f)return null;var p=gB(f,2),m=p[0],h=m.x,g=m.y,v=p[1],y=v.x,b=v.y,x=fB(fB({clipPath:kR(e,`hidden`)?`url(#${c})`:void 0},yb(e,!0)),{},{x1:h,y1:g,x2:y,y2:b});return _.createElement(Pb,{className:Ht(`recharts-reference-line`,s)},CB(o,x),tP.renderCallByParent(e,kz({x1:h,y1:g,x2:y,y2:b})))}var EB=function(e){function t(){return tB(this,t),iB(this,t,arguments)}return lB(t,e),rB(t,[{key:`render`,value:function(){return _.createElement(TB,this.props)}}])}(_.Component);pB(EB,`displayName`,`ReferenceLine`),pB(EB,`defaultProps`,{isFront:!1,ifOverflow:`discard`,xAxisId:0,yAxisId:0,fill:`none`,stroke:`#ccc`,fillOpacity:1,strokeWidth:1,position:`middle`});function DB(){return DB=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},DB.apply(this,arguments)}function OB(e){"@babel/helpers - typeof";return OB=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},OB(e)}function kB(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 AB(e){for(var t=1;t<arguments.length;t++){var n=arguments[t]==null?{}:arguments[t];t%2?kB(Object(n),!0).forEach(function(t){VB(e,t,n[t])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):kB(Object(n)).forEach(function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(n,t))})}return e}function jB(e,t){if(!(e instanceof t))throw TypeError(`Cannot call a class as a function`)}function MB(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 NB(e,t,n){return t&&MB(e.prototype,t),n&&MB(e,n),Object.defineProperty(e,"prototype",{writable:!1}),e}function PB(e,t,n){return t=RB(t),FB(e,LB()?Reflect.construct(t,n||[],RB(e).constructor):t.apply(e,n))}function FB(e,t){if(t&&(OB(t)===`object`||typeof t==`function`))return t;if(t!==void 0)throw TypeError(`Derived constructors may only return object or undefined`);return IB(e)}function IB(e){if(e===void 0)throw ReferenceError(`this hasn't been initialised - super() hasn't been called`);return e}function LB(){try{var e=!Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],function(){}))}catch{}return(LB=function(){return!!e})()}function RB(e){return RB=Object.setPrototypeOf?Object.getPrototypeOf.bind():function(e){return e.__proto__||Object.getPrototypeOf(e)},RB(e)}function zB(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&&BB(e,t)}function BB(e,t){return BB=Object.setPrototypeOf?Object.setPrototypeOf.bind():function(e,t){return e.__proto__=t,e},BB(e,t)}function VB(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=UB(e,`string`);return OB(t)==`symbol`?t:t+``}function UB(e,t){if(OB(e)!=`object`||!e)return e;var n=e[Symbol.toPrimitive];if(n!==void 0){var r=n.call(e,t||`default`);if(OB(r)!=`object`)return r;throw TypeError(`@@toPrimitive must return a primitive value.`)}return(t===`string`?String:Number)(e)}var WB=function(e){var t=e.x,n=e.y,r=e.xAxis,i=e.yAxis,a=jz({x:r.scale,y:i.scale}),o=a.apply({x:t,y:n},{bandAware:!0});return kR(e,`discard`)&&!a.isInRange(o)?null:o},GB=function(e){function t(){return jB(this,t),PB(this,t,arguments)}return zB(t,e),NB(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=Py(n),s=Py(r);if(!o||!s)return null;var c=WB(this.props);if(!c)return null;var l=c.x,u=c.y,d=this.props,f=d.shape,p=d.className,m=AB(AB({clipPath:kR(this.props,`hidden`)?`url(#${a})`:void 0},yb(this.props,!0)),{},{cx:l,cy:u});return _.createElement(Pb,{className:Ht(`recharts-reference-dot`,p)},t.renderDot(f,m),tP.renderCallByParent(this.props,{x:l-i,y:u-i,width:2*i,height:2*i}))}}])}(_.Component);VB(GB,`displayName`,`ReferenceDot`),VB(GB,`defaultProps`,{isFront:!1,ifOverflow:`discard`,xAxisId:0,yAxisId:0,r:10,fill:`#fff`,stroke:`#ccc`,fillOpacity:1,strokeWidth:1}),VB(GB,`renderDot`,function(e,t){return _.isValidElement(e)?_.cloneElement(e,t):(0,eb.default)(e)?e(t):_.createElement(pI,DB({},t,{cx:t.cx,cy:t.cy,className:`recharts-reference-dot-dot`}))});function KB(){return KB=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},KB.apply(this,arguments)}function qB(e){"@babel/helpers - typeof";return qB=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},qB(e)}function JB(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 YB(e){for(var t=1;t<arguments.length;t++){var n=arguments[t]==null?{}:arguments[t];t%2?JB(Object(n),!0).forEach(function(t){oV(e,t,n[t])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):JB(Object(n)).forEach(function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(n,t))})}return e}function XB(e,t){if(!(e instanceof t))throw TypeError(`Cannot call a class as a function`)}function ZB(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,sV(r.key),r)}}function QB(e,t,n){return t&&ZB(e.prototype,t),n&&ZB(e,n),Object.defineProperty(e,"prototype",{writable:!1}),e}function $B(e,t,n){return t=rV(t),eV(e,nV()?Reflect.construct(t,n||[],rV(e).constructor):t.apply(e,n))}function eV(e,t){if(t&&(qB(t)===`object`||typeof t==`function`))return t;if(t!==void 0)throw TypeError(`Derived constructors may only return object or undefined`);return tV(e)}function tV(e){if(e===void 0)throw ReferenceError(`this hasn't been initialised - super() hasn't been called`);return e}function nV(){try{var e=!Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],function(){}))}catch{}return(nV=function(){return!!e})()}function rV(e){return rV=Object.setPrototypeOf?Object.getPrototypeOf.bind():function(e){return e.__proto__||Object.getPrototypeOf(e)},rV(e)}function iV(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&&aV(e,t)}function aV(e,t){return aV=Object.setPrototypeOf?Object.setPrototypeOf.bind():function(e,t){return e.__proto__=t,e},aV(e,t)}function oV(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 qB(t)==`symbol`?t:t+``}function cV(e,t){if(qB(e)!=`object`||!e)return e;var n=e[Symbol.toPrimitive];if(n!==void 0){var r=n.call(e,t||`default`);if(qB(r)!=`object`)return r;throw TypeError(`@@toPrimitive must return a primitive value.`)}return(t===`string`?String:Number)(e)}var lV=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=jz({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 kR(i,`discard`)&&(!d.isInRange(f)||!d.isInRange(p))?null:Oz(f,p)},uV=function(e){function t(){return XB(this,t),$B(this,t,arguments)}return iV(t,e),QB(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=Py(n),l=Py(r),u=Py(i),d=Py(a),f=this.props.shape;if(!c&&!l&&!u&&!d&&!f)return null;var p=lV(c,l,u,d,this.props);if(!p&&!f)return null;var m=kR(this.props,`hidden`)?`url(#${s})`:void 0;return _.createElement(Pb,{className:Ht(`recharts-reference-area`,o)},t.renderRect(f,YB(YB({clipPath:m},yb(this.props,!0)),p)),tP.renderCallByParent(this.props,p))}}])}(_.Component);oV(uV,`displayName`,`ReferenceArea`),oV(uV,`defaultProps`,{isFront:!1,ifOverflow:`discard`,xAxisId:0,yAxisId:0,r:10,fill:`#ccc`,fillOpacity:.5,stroke:`none`,strokeWidth:1}),oV(uV,`renderRect`,function(e,t){return _.isValidElement(e)?_.cloneElement(e,t):(0,eb.default)(e)?e(t):_.createElement(oI,KB({},t,{className:`recharts-reference-area-rect`}))});function dV(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 fV(e,t,n){return Nz({width:e.width+t.width,height:e.height+t.height},n)}function pV(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 mV(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 hV(e,t){return dV(e,t+1)}function gV(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:dV(r,l)};var a=c,d,f=function(){return d===void 0&&(d=n(t,a)),d},p=t.coordinate,m=c===0||mV(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 _V(e){"@babel/helpers - typeof";return _V=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},_V(e)}function vV(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 yV(e){for(var t=1;t<arguments.length;t++){var n=arguments[t]==null?{}:arguments[t];t%2?vV(Object(n),!0).forEach(function(t){bV(e,t,n[t])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):vV(Object(n)).forEach(function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(n,t))})}return e}function bV(e,t,n){return t=xV(t),t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function xV(e){var t=SV(e,`string`);return _V(t)==`symbol`?t:t+``}function SV(e,t){if(_V(e)!=`object`||!e)return e;var n=e[Symbol.toPrimitive];if(n!==void 0){var r=n.call(e,t||`default`);if(_V(r)!=`object`)return r;throw TypeError(`@@toPrimitive must return a primitive value.`)}return(t===`string`?String:Number)(e)}function CV(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=yV(yV({},r),{},{tickCoord:d>0?r.coordinate-d*e:r.coordinate})}else a[t]=r=yV(yV({},r),{},{tickCoord:r.coordinate});mV(e,r.tickCoord,u,s,c)&&(c=r.tickCoord-e*(u()/2+i),a[t]=yV(yV({},r),{},{isShow:!0}))},u=o-1;u>=0;u--)l(u);return a}function wV(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=yV(yV({},u),{},{tickCoord:f>0?u.coordinate-f*e:u.coordinate}),mV(e,u.tickCoord,function(){return d},c,l)&&(l=u.tickCoord-e*(d/2+i),o[s-1]=yV(yV({},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=yV(yV({},r),{},{tickCoord:u<0?r.coordinate-u*e:r.coordinate})}else o[t]=r=yV(yV({},r),{},{tickCoord:r.coordinate});mV(e,r.tickCoord,s,c,l)&&(c=r.tickCoord+e*(s()/2+i),o[t]=yV(yV({},r),{},{isShow:!0}))},h=0;h<p;h++)m(h);return o}function TV(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(My(c)||iw.isSsr)return hV(i,typeof c==`number`&&My(c)?c:0);var f=[],p=s===`top`||s===`bottom`?`width`:`height`,m=u&&p===`width`?Xw(u,{fontSize:t,letterSpacing:n}):{width:0,height:0},h=function(e,r){var i=(0,eb.default)(l)?l(e.value,r):e.value;return p===`width`?fV(Xw(i,{fontSize:t,letterSpacing:n}),m,d):Xw(i,{fontSize:t,letterSpacing:n})[p]},g=i.length>=2?Ay(i[1].coordinate-i[0].coordinate):1,_=pV(a,g,p);return c===`equidistantPreserveStart`?gV(g,_,h,i,o):(f=c===`preserveStart`||c===`preserveStartEnd`?wV(g,_,h,i,o,c===`preserveStartEnd`):CV(g,_,h,i,o),f.filter(function(e){return e.isShow}))}var EV=[`viewBox`],DV=[`viewBox`],OV=[`ticks`];function kV(e){"@babel/helpers - typeof";return kV=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},kV(e)}function AV(){return AV=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},AV.apply(this,arguments)}function jV(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 MV(e){for(var t=1;t<arguments.length;t++){var n=arguments[t]==null?{}:arguments[t];t%2?jV(Object(n),!0).forEach(function(t){GV(e,t,n[t])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):jV(Object(n)).forEach(function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(n,t))})}return e}function NV(e,t){if(e==null)return{};var n=PV(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 PV(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 FV(e,t){if(!(e instanceof t))throw TypeError(`Cannot call a class as a function`)}function IV(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,KV(r.key),r)}}function LV(e,t,n){return t&&IV(e.prototype,t),n&&IV(e,n),Object.defineProperty(e,"prototype",{writable:!1}),e}function RV(e,t,n){return t=HV(t),zV(e,VV()?Reflect.construct(t,n||[],HV(e).constructor):t.apply(e,n))}function zV(e,t){if(t&&(kV(t)===`object`||typeof t==`function`))return t;if(t!==void 0)throw TypeError(`Derived constructors may only return object or undefined`);return BV(e)}function BV(e){if(e===void 0)throw ReferenceError(`this hasn't been initialised - super() hasn't been called`);return e}function VV(){try{var e=!Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],function(){}))}catch{}return(VV=function(){return!!e})()}function HV(e){return HV=Object.setPrototypeOf?Object.getPrototypeOf.bind():function(e){return e.__proto__||Object.getPrototypeOf(e)},HV(e)}function UV(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&&WV(e,t)}function WV(e,t){return WV=Object.setPrototypeOf?Object.setPrototypeOf.bind():function(e,t){return e.__proto__=t,e},WV(e,t)}function GV(e,t,n){return t=KV(t),t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function KV(e){var t=qV(e,`string`);return kV(t)==`symbol`?t:t+``}function qV(e,t){if(kV(e)!=`object`||!e)return e;var n=e[Symbol.toPrimitive];if(n!==void 0){var r=n.call(e,t||`default`);if(kV(r)!=`object`)return r;throw TypeError(`@@toPrimitive must return a primitive value.`)}return(t===`string`?String:Number)(e)}var JV=function(e){function t(e){var n;return FV(this,t),n=RV(this,t,[e]),n.state={fontSize:``,letterSpacing:``},n}return UV(t,e),LV(t,[{key:`shouldComponentUpdate`,value:function(e,t){var n=e.viewBox,r=NV(e,EV),i=this.props,a=i.viewBox,o=NV(i,DV);return!Uy(n,a)||!Uy(r,o)||!Uy(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=My(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=MV(MV(MV({},yb(this.props,!1)),yb(s,!1)),{},{fill:`none`});if(a===`top`||a===`bottom`){var l=+(a===`top`&&!o||a===`bottom`&&o);c=MV(MV({},c),{},{x1:t,y1:n+l*i,x2:t+r,y2:n+l*i})}else{var u=+(a===`left`&&!o||a===`right`&&o);c=MV(MV({},c),{},{x1:t+u*r,y1:n,x2:t+u*r,y2:n+i})}return _.createElement(`line`,AV({},c,{className:Ht(`recharts-cartesian-axis-line`,(0,Dy.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=TV(MV(MV({},this.props),{},{ticks:e}),n,r),f=this.getTickTextAnchor(),p=this.getTickVerticalAnchor(),m=yb(this.props,!1),h=yb(c,!1),g=MV(MV({},m),{},{fill:`none`},yb(o,!1)),v=d.map(function(e,n){var r=i.getTickLineCoord(e),a=r.line,v=r.tick,y=MV(MV(MV(MV({textAnchor:f,verticalAnchor:p},m),{},{stroke:`none`,fill:s},h),v),{},{index:n,payload:e,visibleTicksCount:d.length,tickFormatter:l});return _.createElement(Pb,AV({className:`recharts-cartesian-axis-tick`,key:`tick-${e.value}-${e.coordinate}-${e.tickCoord}`},$y(i.props,e,n)),o&&_.createElement(`line`,AV({},g,a,{className:Ht(`recharts-cartesian-axis-tick-line`,(0,Dy.default)(o,`className`))})),c&&t.renderTickItem(c,y,`${(0,eb.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=NV(s,OV),u=c;return(0,eb.default)(a)&&(u=c&&c.length>0?a(this.props):a(l)),r<=0||i<=0||!u||!u.length?null:_.createElement(Pb,{className:Ht(`recharts-cartesian-axis`,o),ref:function(t){e.layerReference=t}},n&&this.renderAxisLine(),this.renderTicks(u,this.state.fontSize,this.state.letterSpacing),tP.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,MV(MV({},t),{},{className:i})):(0,eb.default)(e)?e(MV(MV({},t),{},{className:i})):_.createElement(xT,AV({},t,{className:`recharts-cartesian-axis-tick-value`}),n),r}}])}(_.Component);GV(JV,`displayName`,`CartesianAxis`),GV(JV,`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 YV=[`type`,`layout`,`connectNulls`,`ref`],XV=[`key`];function ZV(e){"@babel/helpers - typeof";return ZV=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},ZV(e)}function QV(e,t){if(e==null)return{};var n=$V(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 $V(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 eH(){return eH=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},eH.apply(this,arguments)}function tH(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 nH(e){for(var t=1;t<arguments.length;t++){var n=arguments[t]==null?{}:arguments[t];t%2?tH(Object(n),!0).forEach(function(t){yH(e,t,n[t])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):tH(Object(n)).forEach(function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(n,t))})}return e}function rH(e){return sH(e)||oH(e)||aH(e)||iH()}function iH(){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 aH(e,t){if(e){if(typeof e==`string`)return cH(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 cH(e,t)}}function oH(e){if(typeof Symbol<`u`&&e[Symbol.iterator]!=null||e[`@@iterator`]!=null)return Array.from(e)}function sH(e){if(Array.isArray(e))return cH(e)}function cH(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 lH(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,bH(r.key),r)}}function dH(e,t,n){return t&&uH(e.prototype,t),n&&uH(e,n),Object.defineProperty(e,"prototype",{writable:!1}),e}function fH(e,t,n){return t=gH(t),pH(e,hH()?Reflect.construct(t,n||[],gH(e).constructor):t.apply(e,n))}function pH(e,t){if(t&&(ZV(t)===`object`||typeof t==`function`))return t;if(t!==void 0)throw TypeError(`Derived constructors may only return object or undefined`);return mH(e)}function mH(e){if(e===void 0)throw ReferenceError(`this hasn't been initialised - super() hasn't been called`);return e}function hH(){try{var e=!Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],function(){}))}catch{}return(hH=function(){return!!e})()}function gH(e){return gH=Object.setPrototypeOf?Object.getPrototypeOf.bind():function(e){return e.__proto__||Object.getPrototypeOf(e)},gH(e)}function _H(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&&vH(e,t)}function vH(e,t){return vH=Object.setPrototypeOf?Object.setPrototypeOf.bind():function(e,t){return e.__proto__=t,e},vH(e,t)}function yH(e,t,n){return t=bH(t),t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function bH(e){var t=xH(e,`string`);return ZV(t)==`symbol`?t:t+``}function xH(e,t){if(ZV(e)!=`object`||!e)return e;var n=e[Symbol.toPrimitive];if(n!==void 0){var r=n.call(e,t||`default`);if(ZV(r)!=`object`)return r;throw TypeError(`@@toPrimitive must return a primitive value.`)}return(t===`string`?String:Number)(e)}var SH=function(e){function t(){var e;lH(this,t);var n=[...arguments];return e=fH(this,t,[].concat(n)),yH(e,`state`,{isAnimationFinished:!0,totalLength:0}),yH(e,`generateSimpleStrokeDasharray`,function(e,t){return`${t}px ${e-t}px`}),yH(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(rH(i.slice(0,u)),[s-d]);break}var f=l.length%2==0?[0,c]:[c];return[].concat(rH(t.repeat(i,o)),rH(l),f).map(function(e){return`${e}px`}).join(`, `)}),yH(e,`id`,Iy(`recharts-line-`)),yH(e,`pathRef`,function(t){e.mainCurve=t}),yH(e,`handleAnimationEnd`,function(){e.setState({isAnimationFinished:!0}),e.props.onAnimationEnd&&e.props.onAnimationEnd()}),yH(e,`handleAnimationStart`,function(){e.setState({isAnimationFinished:!1}),e.props.onAnimationStart&&e.props.onAnimationStart()}),e}return _H(t,e),dH(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=fb(s,iM);if(!c)return null;var l=function(e,t){return{x:e.x,y:e.y,value:e.value,errorVal:OM(e.payload,t)}},u={clipPath:e?`url(#clipPath-${t})`:null};return _.createElement(Pb,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=yb(this.props,!1),l=yb(a,!0),u=o.map(function(e,n){var r=nH(nH(nH({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(Pb,eH({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=nH(nH(nH({},yb(QV(i,YV),!0)),{},{fill:`none`,className:`recharts-line-curve`,clipPath:t?`url(#clipPath-${n})`:null,points:e},r),{},{type:a,layout:o,connectNulls:s});return _.createElement(QP,eH({},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($F,{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=By(r.x,e.x),a=By(r.y,e.y);return nH(nH({},e),{},{x:i(o),y:a(o)})}if(d){var c=By(f*2,e.x),l=By(p/2,e.y);return nH(nH({},e),{},{x:c(o),y:l(o)})}return nH(nH({},e),{},{x:e.x,y:e.y})});return n.renderCurveStatically(c,e,t)}var l=By(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,hM.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,ky.default)(f)?this.id:f,x=yb(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=(_b(n)?n:{}).clipDot,D=E===void 0||E,O=C*2+T;return _.createElement(Pb,{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)&&CP.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(rH(e),[0]),r=[],i=0;i<t;++i)r=[].concat(rH(r),rH(n));return r}},{key:`renderDotItem`,value:function(e,t){var n;if(_.isValidElement(e))n=_.cloneElement(e,t);else if((0,eb.default)(e))n=e(t);else{var r=t.key,i=QV(t,XV),a=Ht(`recharts-line-dot`,typeof e==`boolean`?``:e.className);n=_.createElement(pI,eH({key:r},i,{className:a}))}return n}}])}(_.PureComponent);yH(SH,`displayName`,`Line`),yH(SH,`defaultProps`,{xAxisId:0,yAxisId:0,connectNulls:!1,activeDot:!0,dot:!0,legendType:`line`,stroke:`#3182bd`,strokeWidth:1,fill:`#fff`,points:[],isAnimationActive:!iw.isSsr,animateNewValues:!0,animationBegin:0,animationDuration:1500,animationEasing:`ease`,hide:!1,label:!1}),yH(SH,`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 nH({points:c.map(function(e,t){var c=OM(e,o);return u===`horizontal`?{x:QM({axis:n,ticks:i,bandSize:s,entry:e,index:t}),y:(0,ky.default)(c)?null:r.scale(c),value:c,payload:e}:{x:(0,ky.default)(c)?null:n.scale(c),y:QM({axis:r,ticks:a,bandSize:s,entry:e,index:t}),value:c,payload:e}}),layout:u},l)});function CH(e){"@babel/helpers - typeof";return CH=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},CH(e)}function wH(e,t){if(!(e instanceof t))throw TypeError(`Cannot call a class as a function`)}function TH(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,FH(r.key),r)}}function EH(e,t,n){return t&&TH(e.prototype,t),n&&TH(e,n),Object.defineProperty(e,"prototype",{writable:!1}),e}function DH(e,t,n){return t=jH(t),OH(e,AH()?Reflect.construct(t,n||[],jH(e).constructor):t.apply(e,n))}function OH(e,t){if(t&&(CH(t)===`object`||typeof t==`function`))return t;if(t!==void 0)throw TypeError(`Derived constructors may only return object or undefined`);return kH(e)}function kH(e){if(e===void 0)throw ReferenceError(`this hasn't been initialised - super() hasn't been called`);return e}function AH(){try{var e=!Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],function(){}))}catch{}return(AH=function(){return!!e})()}function jH(e){return jH=Object.setPrototypeOf?Object.getPrototypeOf.bind():function(e){return e.__proto__||Object.getPrototypeOf(e)},jH(e)}function MH(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&&NH(e,t)}function NH(e,t){return NH=Object.setPrototypeOf?Object.setPrototypeOf.bind():function(e,t){return e.__proto__=t,e},NH(e,t)}function PH(e,t,n){return t=FH(t),t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function FH(e){var t=IH(e,`string`);return CH(t)==`symbol`?t:t+``}function IH(e,t){if(CH(e)!=`object`||!e)return e;var n=e[Symbol.toPrimitive];if(n!==void 0){var r=n.call(e,t||`default`);if(CH(r)!=`object`)return r;throw TypeError(`@@toPrimitive must return a primitive value.`)}return(t===`string`?String:Number)(e)}function LH(){return LH=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},LH.apply(this,arguments)}function RH(e){var t=e.xAxisId,n=Zz(),r=Qz(),i=Jz(t);return i==null?null:_.createElement(JV,LH({},i,{className:Ht(`recharts-${i.axisType} ${i.axisType}`,i.className),viewBox:{x:0,y:0,width:n,height:r},ticksGenerator:function(e){return BM(e,!0)}}))}var zH=function(e){function t(){return wH(this,t),DH(this,t,arguments)}return MH(t,e),EH(t,[{key:`render`,value:function(){return _.createElement(RH,this.props)}}])}(_.Component);PH(zH,`displayName`,`XAxis`),PH(zH,`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 BH(e){"@babel/helpers - typeof";return BH=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},BH(e)}function VH(e,t){if(!(e instanceof t))throw TypeError(`Cannot call a class as a function`)}function HH(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,QH(r.key),r)}}function UH(e,t,n){return t&&HH(e.prototype,t),n&&HH(e,n),Object.defineProperty(e,"prototype",{writable:!1}),e}function WH(e,t,n){return t=JH(t),GH(e,qH()?Reflect.construct(t,n||[],JH(e).constructor):t.apply(e,n))}function GH(e,t){if(t&&(BH(t)===`object`||typeof t==`function`))return t;if(t!==void 0)throw TypeError(`Derived constructors may only return object or undefined`);return KH(e)}function KH(e){if(e===void 0)throw ReferenceError(`this hasn't been initialised - super() hasn't been called`);return e}function qH(){try{var e=!Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],function(){}))}catch{}return(qH=function(){return!!e})()}function JH(e){return JH=Object.setPrototypeOf?Object.getPrototypeOf.bind():function(e){return e.__proto__||Object.getPrototypeOf(e)},JH(e)}function YH(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&&XH(e,t)}function XH(e,t){return XH=Object.setPrototypeOf?Object.setPrototypeOf.bind():function(e,t){return e.__proto__=t,e},XH(e,t)}function ZH(e,t,n){return t=QH(t),t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function QH(e){var t=$H(e,`string`);return BH(t)==`symbol`?t:t+``}function $H(e,t){if(BH(e)!=`object`||!e)return e;var n=e[Symbol.toPrimitive];if(n!==void 0){var r=n.call(e,t||`default`);if(BH(r)!=`object`)return r;throw TypeError(`@@toPrimitive must return a primitive value.`)}return(t===`string`?String:Number)(e)}function eU(){return eU=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},eU.apply(this,arguments)}var tU=function(e){var t=e.yAxisId,n=Zz(),r=Qz(),i=Yz(t);return i==null?null:_.createElement(JV,eU({},i,{className:Ht(`recharts-${i.axisType} ${i.axisType}`,i.className),viewBox:{x:0,y:0,width:n,height:r},ticksGenerator:function(e){return BM(e,!0)}}))},nU=function(e){function t(){return VH(this,t),WH(this,t,arguments)}return YH(t,e),UH(t,[{key:`render`,value:function(){return _.createElement(tU,this.props)}}])}(_.Component);ZH(nU,`displayName`,`YAxis`),ZH(nU,`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 rU(e){return sU(e)||oU(e)||aU(e)||iU()}function iU(){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 aU(e,t){if(e){if(typeof e==`string`)return cU(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 cU(e,t)}}function oU(e){if(typeof Symbol<`u`&&e[Symbol.iterator]!=null||e[`@@iterator`]!=null)return Array.from(e)}function sU(e){if(Array.isArray(e))return cU(e)}function cU(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 lU=function(e,t,n,r,i){var a=fb(e,EB),o=fb(e,GB),s=[].concat(rU(a),rU(o)),c=fb(e,uV),l=`${r}Id`,u=r[0],d=t;if(s.length&&(d=s.reduce(function(e,t){if(t.props[l]===n&&kR(t.props,`extendDomain`)&&My(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&&kR(t.props,`extendDomain`)&&My(t.props[f])&&My(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 My(t)?[Math.min(e[0],t),Math.max(e[1],t)]:e},d)),d},uU=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,dU=`recharts.syncMouseEvents`;function fU(e){"@babel/helpers - typeof";return fU=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},fU(e)}function pU(e,t){if(!(e instanceof t))throw TypeError(`Cannot call a class as a function`)}function mU(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,_U(r.key),r)}}function hU(e,t,n){return t&&mU(e.prototype,t),n&&mU(e,n),Object.defineProperty(e,"prototype",{writable:!1}),e}function gU(e,t,n){return t=_U(t),t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function _U(e){var t=vU(e,`string`);return fU(t)==`symbol`?t:t+``}function vU(e,t){if(fU(e)!=`object`||!e)return e;var n=e[Symbol.toPrimitive];if(n!==void 0){var r=n.call(e,t||`default`);if(fU(r)!=`object`)return r;throw TypeError(`@@toPrimitive must return a primitive value.`)}return(t===`string`?String:Number)(e)}var yU=function(){function e(){pU(this,e),gU(this,`activeIndex`,0),gU(this,`coordinateList`,[]),gU(this,`layout`,`horizontal`)}return hU(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 bU(e,t,n){if(n===`number`&&t===!0&&Array.isArray(e)){var r=e?.[0],i=e?.[1];if(r&&i&&My(r)&&My(i))return!0}return!1}function xU(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 SU(e){var t=e.cx,n=e.cy,r=e.radius,i=e.startAngle,a=e.endAngle;return{points:[wN(t,n,r,i),wN(t,n,r,a)],cx:t,cy:n,radius:r,startAngle:i,endAngle:a}}function CU(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=wN(s,c,l,d),p=wN(s,c,u,d);r=f.x,i=f.y,a=p.x,o=p.y}else return SU(t)}return[{x:r,y:i},{x:a,y:o}]}function wU(e){"@babel/helpers - typeof";return wU=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},wU(e)}function TU(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 EU(e){for(var t=1;t<arguments.length;t++){var n=arguments[t]==null?{}:arguments[t];t%2?TU(Object(n),!0).forEach(function(t){DU(e,t,n[t])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):TU(Object(n)).forEach(function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(n,t))})}return e}function DU(e,t,n){return t=OU(t),t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function OU(e){var t=kU(e,`string`);return wU(t)==`symbol`?t:t+``}function kU(e,t){if(wU(e)!=`object`||!e)return e;var n=e[Symbol.toPrimitive];if(n!==void 0){var r=n.call(e,t||`default`);if(wU(r)!=`object`)return r;throw TypeError(`@@toPrimitive must return a primitive value.`)}return(t===`string`?String:Number)(e)}function AU(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=QP;if(u===`ScatterChart`)f=i,p=Yae;else if(u===`BarChart`)f=xU(l,i,o,c),p=oI;else if(l===`radial`){var m=SU(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=RP}else f={points:CU(l,i,o)},p=QP;var y=EU(EU(EU(EU({stroke:`#ccc`,pointerEvents:`none`},o),f),yb(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 jU=[`item`],MU=[`children`,`className`,`width`,`height`,`style`,`compact`,`title`,`desc`];function NU(e){"@babel/helpers - typeof";return NU=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},NU(e)}function PU(){return PU=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},PU.apply(this,arguments)}function FU(e,t){return RU(e)||LU(e,t)||$U(e,t)||IU()}function IU(){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 LU(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 RU(e){if(Array.isArray(e))return e}function zU(e,t){if(e==null)return{};var n=BU(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 BU(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 VU(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,aW(r.key),r)}}function UU(e,t,n){return t&&HU(e.prototype,t),n&&HU(e,n),Object.defineProperty(e,"prototype",{writable:!1}),e}function WU(e,t,n){return t=JU(t),GU(e,qU()?Reflect.construct(t,n||[],JU(e).constructor):t.apply(e,n))}function GU(e,t){if(t&&(NU(t)===`object`||typeof t==`function`))return t;if(t!==void 0)throw TypeError(`Derived constructors may only return object or undefined`);return KU(e)}function KU(e){if(e===void 0)throw ReferenceError(`this hasn't been initialised - super() hasn't been called`);return e}function qU(){try{var e=!Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],function(){}))}catch{}return(qU=function(){return!!e})()}function JU(e){return JU=Object.setPrototypeOf?Object.getPrototypeOf.bind():function(e){return e.__proto__||Object.getPrototypeOf(e)},JU(e)}function YU(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&&XU(e,t)}function XU(e,t){return XU=Object.setPrototypeOf?Object.setPrototypeOf.bind():function(e,t){return e.__proto__=t,e},XU(e,t)}function ZU(e){return tW(e)||eW(e)||$U(e)||QU()}function QU(){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 $U(e,t){if(e){if(typeof e==`string`)return nW(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 nW(e,t)}}function eW(e){if(typeof Symbol<`u`&&e[Symbol.iterator]!=null||e[`@@iterator`]!=null)return Array.from(e)}function tW(e){if(Array.isArray(e))return nW(e)}function nW(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 rW(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?rW(Object(n),!0).forEach(function(t){iW(e,t,n[t])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):rW(Object(n)).forEach(function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(n,t))})}return e}function iW(e,t,n){return t=aW(t),t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function aW(e){var t=oW(e,`string`);return NU(t)==`symbol`?t:t+``}function oW(e,t){if(NU(e)!=`object`||!e)return e;var n=e[Symbol.toPrimitive];if(n!==void 0){var r=n.call(e,t||`default`);if(NU(r)!=`object`)return r;throw TypeError(`@@toPrimitive must return a primitive value.`)}return(t===`string`?String:Number)(e)}var sW={xAxis:[`bottom`,`top`],yAxis:[`left`,`right`]},cW={width:`100%`,height:`100%`},lW={x:0,y:0};function uW(e){return e}var dW=function(e,t){return t===`horizontal`?e.x:t===`vertical`?e.y:t===`centric`?e.angle:e.radius},fW=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),wN(r.cx,r.cy,o,a)),{},{angle:a,radius:o})}var s=i.coordinate,c=r.angle;return X(X(X({},r),wN(r.cx,r.cy,s,c)),{},{angle:c,radius:s})}return lW},pW=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(ZU(e),ZU(n)):e},[]);return a.length>0?a:e&&e.length&&My(r)&&My(i)?e.slice(r,i+1):[]};function mW(e){return e===`number`?[0,`auto`]:void 0}var hW=function(e,t,n,r){var i=e.graphicalItems,a=e.tooltipAxis,o=pW(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?Vy(c===void 0?o:c,a.dataKey,r):c&&c[n]||o[n];return l?[].concat(ZU(i),[lN(s,l)]):i},[])},gW=function(e,t,n,r){var i=r||{x:e.chartX,y:e.chartY},a=dW(i,n),o=e.orderedTooltipTicks,s=e.tooltipAxis,c=e.tooltipTicks,l=AM(a,o,c,s);if(l>=0&&c){var u=c[l]&&c[l].value;return{activeTooltipIndex:l,activeLabel:u,activePayload:hW(e,t,l,u),activeCoordinate:fW(n,o,l,i)}}return null},_W=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=zM(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=pW(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;bU(p.domain,g,m)&&(w=oN(p.domain,null,g),f&&(m===`number`||v!==`auto`)&&(E=kM(S,h,`category`)));var D=mW(m);if(!w||w.length===0){var O=p.domain??D;if(h){if(w=kM(S,h,m),m===`category`&&f){var k=zy(w);_&&k?(T=w,w=(0,oR.default)(0,C)):_||(w=cN(O,w,n).reduce(function(e,t){return e.indexOf(t)>=0?e:[].concat(ZU(e),[t])},[]))}else if(m===`category`)w=_?w.filter(function(e){return e!==``&&!(0,ky.default)(e)}):cN(O,w,n).reduce(function(e,t){return e.indexOf(t)>=0||t===``||(0,ky.default)(t)?e:[].concat(ZU(e),[t])},[]);else if(m===`number`){var A=LM(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=kM(S,h,`category`))}else w=f?(0,oR.default)(0,C):o&&o[x]&&o[x].hasStack&&m===`number`?d===`expand`?[0,1]:rN(o[x].stackGroups,s,c):RM(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=lU(u,w,x,i,y),O&&(w=oN(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),{},iW({},x,X(X({},p),{},{axisType:i,domain:w,categoricalDomain:E,duplicateDomain:T,originalDomain:p.domain??D,isCategorical:f,layout:l})))},{})},vW=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=pW(e.data,{graphicalItems:n,dataStartIndex:s,dataEndIndex:c}),f=d.length,p=zM(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=mW(`number`);if(!e[h]){m++;var _;return p?_=(0,oR.default)(0,f):o&&o[h]&&o[h].hasStack?(_=rN(o[h].stackGroups,s,c),_=lU(u,_,h,i)):(_=oN(g,RM(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),_=lU(u,_,h,i)),X(X({},e),{},iW({},h,X(X({axisType:i},r.defaultProps),{},{hide:!0,orientation:(0,Dy.default)(sW,`${i}.${m%2}`,null),domain:_,originalDomain:g,isCategorical:p,layout:l})))}return e},{})},yW=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=fb(l,i),f={};return d&&d.length?f=_W(e,{axes:d,graphicalItems:a,axisType:r,axisIdKey:u,stackGroups:o,dataStartIndex:s,dataEndIndex:c}):a&&a.length&&(f=vW(e,{Axis:i,graphicalItems:a,axisType:r,axisIdKey:u,stackGroups:o,dataStartIndex:s,dataEndIndex:c})),f},bW=function(e){var t=Ry(e),n=BM(t,!1,!0);return{tooltipTicks:n,orderedTooltipTicks:(0,kC.default)(n,function(e){return e.coordinate}),tooltipAxis:t,tooltipAxisBandSize:sN(t,n)}},xW=function(e){var t=e.children,n=e.defaultShowTooltip,r=pb(t,ER),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}},SW=function(e){return!e||!e.length?!1:e.some(function(e){var t=cb(e&&e.type);return t&&t.indexOf(`Bar`)>=0})},CW=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`}},wW=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=pb(u,ER),p=pb(u,SC),m=Object.keys(s).reduce(function(e,t){var n=s[t],r=n.orientation;return!n.mirror&&!n.hide?X(X({},e),{},iW({},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),{},iW({},r,(0,Dy.default)(e,`${r}`)+n.height)):e},{top:d.top||0,bottom:d.bottom||0})),m),g=h.bottom;f&&(h.bottom+=f.props.height||ER.defaultProps.height),p&&t&&(h=PM(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)})},TW=function(e,t){if(t===`xAxis`)return e[t].width;if(t===`yAxis`)return e[t].height},EW=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=CW(u),h=m.numericAxisName,g=m.cateAxisName,_=SW(n),v=[];return n.forEach(function(n,m){var y=pW(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`)&&Nj(!1);var a=r[i];return X(X({},e),{},iW(iW({},n.axisType,a),`${n.axisType}Ticks`,BM(a)))},{}),E=T[g],D=T[`${g}Ticks`],O=r&&r[C]&&r[C].hasStack&&tN(n,r[C].stackGroups),k=cb(n.type).indexOf(`Bar`)>=0,A=sN(E,D),j=[],M=_&&MM({barSize:l,stackGroups:r,totalSize:TW(T,g)});if(k){var N=(0,ky.default)(S)?p:S,P=sN(E,D,!0)??N??0;j=NM({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}))),{},iW(iW(iW({key:n.key||`item-${m}`},h,T[h]),g,T[g]),`animationId`,a)),childIndex:wb(n,e.children),item:n})}),v},f=function(e,r){var i=e.props,a=e.dataStartIndex,o=e.dataEndIndex,c=e.updateId;if(!mb({props:i}))return null;var u=i.children,f=i.layout,p=i.stackOffset,m=i.data,h=i.reverseStackOrder,g=CW(f),_=g.numericAxisName,v=g.cateAxisName,y=fb(u,n),b=XM(m,y,`${_}Id`,`${v}Id`,p,h),x=s.reduce(function(e,t){var n=`${t.axisType}Map`;return X(X({},e),{},iW({},n,yW(i,X(X({},t),{},{graphicalItems:y,stackGroups:t.axisType===_&&b,dataStartIndex:a,dataEndIndex:o}))))},{}),S=wW(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=bW(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 VU(this,n),r=WU(this,n,[e]),iW(r,`eventEmitterSymbol`,Symbol(`rechartsEventEmitter`)),iW(r,`accessibilityManager`,new yU),iW(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}))))}}),iW(r,`handleReceiveSyncEvent`,function(e,t,n){if(r.props.syncId===e){if(n===r.eventEmitterSymbol&&typeof r.props.syncMethod!=`function`)return;r.applySyncEvent(t)}}),iW(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})}}),iW(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,eb.default)(i)&&i(n,e)}}),iW(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,eb.default)(i)&&i(n,e)}),iW(r,`handleItemMouseEnter`,function(e){r.setState(function(){return{isTooltipActive:!0,activeItem:e,activePayload:e.tooltipPayload,activeCoordinate:e.tooltipPosition||{x:e.cx,y:e.cy}}})}),iW(r,`handleItemMouseLeave`,function(){r.setState(function(){return{isTooltipActive:!1}})}),iW(r,`handleMouseMove`,function(e){e.persist(),r.throttleTriggeredAfterMouseMove(e)}),iW(r,`handleMouseLeave`,function(e){r.throttleTriggeredAfterMouseMove.cancel();var t={isTooltipActive:!1};r.setState(t),r.triggerSyncEvent(t);var n=r.props.onMouseLeave;(0,eb.default)(n)&&n(t,e)}),iW(r,`handleOuterEvent`,function(e){var t=Cb(e),n=(0,Dy.default)(r.props,`${t}`);t&&(0,eb.default)(n)&&n((/.*touch.*/i.test(t)?r.getMouseInfo(e.changedTouches[0]):r.getMouseInfo(e))??{},e)}),iW(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,eb.default)(i)&&i(n,e)}}),iW(r,`handleMouseDown`,function(e){var t=r.props.onMouseDown;(0,eb.default)(t)&&t(r.getMouseInfo(e),e)}),iW(r,`handleMouseUp`,function(e){var t=r.props.onMouseUp;(0,eb.default)(t)&&t(r.getMouseInfo(e),e)}),iW(r,`handleTouchMove`,function(e){e.changedTouches!=null&&e.changedTouches.length>0&&r.throttleTriggeredAfterMouseMove(e.changedTouches[0])}),iW(r,`handleTouchStart`,function(e){e.changedTouches!=null&&e.changedTouches.length>0&&r.handleMouseDown(e.changedTouches[0])}),iW(r,`handleTouchEnd`,function(e){e.changedTouches!=null&&e.changedTouches.length>0&&r.handleMouseUp(e.changedTouches[0])}),iW(r,`handleDoubleClick`,function(e){var t=r.props.onDoubleClick;(0,eb.default)(t)&&t(r.getMouseInfo(e),e)}),iW(r,`handleContextMenu`,function(e){var t=r.props.onContextMenu;(0,eb.default)(t)&&t(r.getMouseInfo(e),e)}),iW(r,`triggerSyncEvent`,function(e){r.props.syncId!==void 0&&uU.emit(dU,r.props.syncId,e,r.eventEmitterSymbol)}),iW(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=hW(r.state,r.props.data,u),x=m[u]?{x:n===`horizontal`?m[u].coordinate:_,y:n===`horizontal`?v:m[u].coordinate}:lW;r.setState(X(X({},e),{},{activeLabel:y,activeCoordinate:x,activePayload:b,activeTooltipIndex:u}))}else r.setState(e)}),iW(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(AU,{key:p,activeCoordinate:a,activePayload:o,activeTooltipIndex:c,chartName:t,element:e,isActive:d,layout:f,offset:s,tooltipAxisBandSize:l,tooltipEventType:u})}),iW(r,`renderPolarAxis`,function(e,t,n){var i=(0,Dy.default)(e,`type.axisType`),a=(0,Dy.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:BM(c,!0)}))}),iW(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=Ry(s),u=Ry(c),d=u.cx,f=u.cy,p=u.innerRadius,m=u.outerRadius;return(0,_.cloneElement)(e,{polarAngles:Array.isArray(i)?i:BM(u,!0).map(function(e){return e.coordinate}),polarRadius:Array.isArray(a)?a:BM(l,!0).map(function(e){return e.coordinate}),cx:d,cy:f,innerRadius:p,outerRadius:m,key:e.key||`polar-grid`,radialLines:n})}),iW(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=dM({children:n,formattedGraphicalItems:e,legendWidth:i-(o.left||0)-(o.right||0),legendContent:c});if(!s)return null;var l=s.item,u=zU(s,jU);return(0,_.cloneElement)(l,X(X({},u),{},{chartWidth:i,chartHeight:a,margin:o,onBBoxUpdate:r.handleLegendBBoxUpdate}))}),iW(r,`renderTooltip`,function(){var e=r.props,t=e.children,n=e.accessibilityLayer,i=pb(t,vw);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})}),iW(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:HM(r.handleBrushChange,e.props.onChange),data:i,x:My(e.props.x)?e.props.x:o.left,y:My(e.props.y)?e.props.y:o.top+o.height+o.brushBottom-(n.bottom||0),width:My(e.props.width)?e.props.width:o.width,startIndex:s,endIndex:c,updateId:`brush-${l}`})}),iW(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})}),iW(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:jM(t.item),strokeWidth:2,stroke:`#fff`,payload:r.payload,value:r.value},yb(u,!1)),Zy(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}),iW(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=pb(d,vw),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:HM(r.handleItemMouseEnter,e.props.onClick)}:a!==`axis`&&(w={onMouseLeave:HM(r.handleItemMouseLeave,e.props.onMouseLeave),onMouseEnter:HM(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=Vy(m,k,u),O=h&&g&&Vy(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,ky.default)(D))return[T].concat(ZU(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]}),iW(r,`renderCustomized`,function(e,t,n){return(0,_.cloneElement)(e,X(X({key:`recharts-customized-${n}`},r.props),r.state))}),iW(r,`renderMap`,{CartesianGrid:{handler:uW,once:!0},ReferenceArea:{handler:r.renderReferenceElement},ReferenceLine:{handler:uW},ReferenceDot:{handler:r.renderReferenceElement},XAxis:{handler:uW},YAxis:{handler:uW},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??Iy(`recharts`)}-clip`,r.throttleTriggeredAfterMouseMove=(0,ww.default)(r.triggeredAfterMouseMove,e.throttleDelay??1e3/60),r.state={},r}return YU(n,e),UU(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=pb(t,vw);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=hW(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){bb([pb(e.children,vw)],[pb(this.props.children,vw)])||this.displayDefaultTooltip()}},{key:`componentWillUnmount`,value:function(){this.removeListener(),this.throttleTriggeredAfterMouseMove.cancel()}},{key:`getTooltipEventType`,value:function(){var e=pb(this.props.children,vw);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=Zw(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=gW(this.state,this.props.data,this.props.layout,o);if(u!==`axis`&&c&&l){var f=Ry(c).scale,p=Ry(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=Ry(c);return jN({x:i,y:a},u)}return null}},{key:`parseEventsOfWrapper`,value:function(){var e=this.props.children,t=this.getTooltipEventType(),n=pb(e,vw),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({},Zy(this.props,this.handleOuterEvent)),r)}},{key:`addListener`,value:function(){uU.on(dU,this.handleReceiveSyncEvent)}},{key:`removeListener`,value:function(){uU.removeListener(dU,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===cb(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=FU(t,2),r=n[0],i=n[1];return X(X({},e),{},iW({},r,i.scale))},{}):null}},{key:`getYScales`,value:function(){var e=this.state.yAxisMap;return e?Object.entries(e).reduce(function(e,t){var n=FU(t,2),r=n[0],i=n[1];return X(X({},e),{},iW({},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=cb(c.type);if(u===`Bar`){var d=(s.data||[]).find(function(t){return kae(e,t)});if(d)return{graphicalItem:o,payload:d}}else if(u===`RadialBar`){var f=(s.data||[]).find(function(t){return jN(e,t)});if(f)return{graphicalItem:o,payload:f}}else if(yL(o,r)||bL(o,r)||xL(o,r)){var p=OL({graphicalItem:o,activeTooltipItem:r,itemData:l.data}),m=l.activeIndex===void 0?p:l.activeIndex;return{graphicalItem:X(X({},o),{},{childIndex:m}),payload:xL(o,r)?l.data[p]:o.props.data[p]}}}return null}},{key:`render`,value:function(){var e=this;if(!mb(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=yb(zU(t,MU),!1);if(s)return _.createElement(Kz,{state:this.state,width:this.props.width,height:this.props.height,clipPathId:this.clipPathId},_.createElement(kb,PU({},u,{width:i,height:a,title:c,desc:l}),this.renderClipPath(),Sb(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(Kz,{state:this.state,width:this.props.width,height:this.props.height,clipPathId:this.clipPathId},_.createElement(`div`,PU({className:Ht(`recharts-wrapper`,r),style:X({position:`relative`,cursor:`default`,width:i,height:a},o)},d,{ref:function(t){e.container=t}}),_.createElement(kb,PU({},u,{width:i,height:a,title:c,desc:l,style:cW}),this.renderClipPath(),Sb(n,this.renderMap)),this.renderLegend(),this.renderTooltip()))}}])}(_.Component);iW(p,`displayName`,t),iW(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)),iW(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=xW(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||!Uy(l,t.prevMargin)){var m=xW(e),h={chartX:t.chartX,chartY:t.chartY,isTooltipActive:t.isTooltipActive},g=X(X({},gW(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(!bb(i,t.prevChildren)){var v=pb(i,ER),y=v?v.props?.startIndex??u:u,b=v?v.props?.endIndex??d:d,x=y!==u||b!==d,S=!(0,ky.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}),iW(p,`renderActiveDot`,function(e,t,n){var r=(0,_.isValidElement)(e)?(0,_.cloneElement)(e,t):(0,eb.default)(e)?e(t):_.createElement(pI,t);return _.createElement(Pb,{className:`recharts-active-dot`,key:n},r)});var m=(0,_.forwardRef)(function(e,t){return _.createElement(p,PU({},e,{ref:t}))});return m.displayName=p.displayName,m},DW=EW({chartName:`LineChart`,GraphicalChild:SH,axisComponents:[{axisType:`xAxis`,AxisComp:zH},{axisType:`yAxis`,AxisComp:nU}],formatAxisMap:Dz}),OW=EW({chartName:`BarChart`,GraphicalChild:hz,defaultTooltipEventType:`axis`,validateTooltipEventTypes:[`axis`,`item`],axisComponents:[{axisType:`xAxis`,AxisComp:zH},{axisType:`yAxis`,AxisComp:nU}],formatAxisMap:Dz}),kW=EW({chartName:`PieChart`,GraphicalChild:qL,validateTooltipEventTypes:[`item`],defaultTooltipEventType:`item`,legendContent:`children`,axisComponents:[{axisType:`angleAxis`,AxisComp:BI},{axisType:`radiusAxis`,AxisComp:OI}],formatAxisMap:EN,defaultProps:{layout:`centric`,startAngle:0,endAngle:360,cx:`50%`,cy:`50%`,innerRadius:0,outerRadius:`80%`}});function AW(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 jW(e){let t=AW(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 MW(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 NW=6048e5;function PW(e){return e.length===0?0:e.reduce((e,t)=>e+t,0)/e.length}function FW(e,t=0){let n=Number(e.toFixed(t));return`${n>0?`+`:``}${n.toFixed(t)}`}var IW=()=>{let{configs:e}=rv(),{source:t}=q_(),[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-NW,c=o-NW,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(MW):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?PW(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?PW(x):null,C=PW(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`:`${FW(w,1)}% from last week`,O=E?`${FW(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)($f,{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)($f,{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)($f,{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)(vv,{title:`MCP Evaluations`,value:h,icon:Pn,subtitle:`${h} active`}),(0,I.jsx)(vv,{title:`Total Runs`,value:g,icon:Xt,subtitle:`Last 30 days`}),(0,I.jsx)(vv,{title:`Pass Rate`,value:n?`–`:Wi(y),icon:rn,subtitle:n?`Loading...`:D,trend:n?`neutral`:k}),(0,I.jsx)(vv,{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)(sv,{className:`pb-3`,children:(0,I.jsx)(cv,{className:`text-base`,children:`Pass Rate Trend`})}),(0,I.jsx)(q,{children:(0,I.jsx)(Lw,{width:`100%`,height:200,children:(0,I.jsxs)(DW,{data:P,children:[(0,I.jsx)(zH,{dataKey:`date`,tick:{fontSize:11},tickLine:!1,axisLine:!1}),(0,I.jsx)(nU,{domain:[0,100],tick:{fontSize:11},tickLine:!1,axisLine:!1,tickFormatter:e=>`${e}%`}),(0,I.jsx)(vw,{formatter:e=>[`${e}%`,`Pass Rate`]}),(0,I.jsx)(SH,{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)(sv,{className:`pb-3`,children:(0,I.jsx)(cv,{className:`text-base`,children:`Recent Tool Latency (ms)`})}),(0,I.jsx)(q,{children:(0,I.jsx)(Lw,{width:`100%`,height:200,children:(0,I.jsxs)(DW,{data:P,children:[(0,I.jsx)(zH,{dataKey:`date`,tick:{fontSize:11},tickLine:!1,axisLine:!1}),(0,I.jsx)(nU,{tick:{fontSize:11},tickLine:!1,axisLine:!1}),(0,I.jsx)(vw,{formatter:e=>[`${e}ms`,`Latency`]}),(0,I.jsx)(SH,{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)(sv,{className:`pb-3`,children:(0,I.jsx)(cv,{className:`text-base`,children:`Recent Runs`})}),(0,I.jsxs)(q,{className:`p-0`,children:[(0,I.jsxs)(dv,{children:[(0,I.jsx)(fv,{children:(0,I.jsxs)(hv,{children:[(0,I.jsx)(gv,{children:`Run ID`}),(0,I.jsx)(gv,{children:`Evaluated`}),(0,I.jsx)(gv,{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)(gv,{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)(gv,{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)(gv,{className:`text-right`,children:`Avg Tools`}),(0,I.jsx)(gv,{className:`text-right`,children:`Tool Tokens`})]})}),(0,I.jsxs)(pv,{children:[M.length===0&&(0,I.jsx)(hv,{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)(hv,{className:`cursor-pointer`,children:[(0,I.jsx)(J,{children:(0,I.jsx)($f,{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=jW(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)(bv,{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)($f,{to:`/results`,children:`Show more`})})})]})]})})]})};function LW({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)(Tp,{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 RW=_.createContext(void 0);function zW(e){let t=_.useContext(RW);return e||t||`ltr`}var BW=`rovingFocusGroup.onEntryFocus`,VW={bubbles:!1,cancelable:!0},HW=`RovingFocusGroup`,[UW,WW,GW]=oe(HW),[KW,qW]=R(HW,[GW]),[JW,YW]=KW(HW),XW=_.forwardRef((e,t)=>(0,I.jsx)(UW.Provider,{scope:e.__scopeRovingFocusGroup,children:(0,I.jsx)(UW.Slot,{scope:e.__scopeRovingFocusGroup,children:(0,I.jsx)(ZW,{...e,ref:t})})}));XW.displayName=HW;var ZW=_.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=zW(a),[h,g]=ze({prop:o,defaultProp:s??null,onChange:c,caller:HW}),[v,y]=_.useState(!1),b=pe(l),x=WW(n),S=_.useRef(!1),[C,w]=_.useState(0);return _.useEffect(()=>{let e=f.current;if(e)return e.addEventListener(BW,b),()=>e.removeEventListener(BW,b)},[b]),(0,I.jsx)(JW,{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(BW,VW);if(e.currentTarget.dispatchEvent(t),!t.defaultPrevented){let e=x().filter(e=>e.focusable);rG([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))})})}),QW=`RovingFocusGroupItem`,$W=_.forwardRef((e,t)=>{let{__scopeRovingFocusGroup:n,focusable:r=!0,active:i=!1,tabStopId:a,children:o,...s}=e,c=Ra(),l=a||c,u=YW(QW,n),d=u.currentTabStopId===l,f=WW(n),{onFocusableItemAdd:p,onFocusableItemRemove:m,currentTabStopId:h}=u;return _.useEffect(()=>{if(r)return p(),()=>m()},[r,p,m]),(0,I.jsx)(UW.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=nG(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?iG(n,r+1):n.slice(r+1)}setTimeout(()=>rG(n))}}),children:typeof o==`function`?o({isCurrentTabStop:d,hasTabStop:h!=null}):o})})});$W.displayName=QW;var eG={ArrowLeft:`prev`,ArrowUp:`prev`,ArrowRight:`next`,ArrowDown:`next`,PageUp:`first`,Home:`first`,PageDown:`last`,End:`last`};function tG(e,t){return t===`rtl`?e===`ArrowLeft`?`ArrowRight`:e===`ArrowRight`?`ArrowLeft`:e:e}function nG(e,t,n){let r=tG(e.key,n);if(!(t===`vertical`&&[`ArrowLeft`,`ArrowRight`].includes(r))&&!(t===`horizontal`&&[`ArrowUp`,`ArrowDown`].includes(r)))return eG[r]}function rG(e,t=!1){let n=document.activeElement;for(let r of e)if(r===n||(r.focus({preventScroll:t}),document.activeElement!==n))return}function iG(e,t){return e.map((n,r)=>e[(t+r)%e.length])}var aG=XW,oG=$W;function sG(e){let t=cG(e),n=_.forwardRef((e,n)=>{let{children:r,...i}=e,a=_.Children.toArray(r),o=a.find(uG);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 cG(e){let t=_.forwardRef((e,t)=>{let{children:n,...r}=e;if(_.isValidElement(n)){let e=fG(n),i=dG(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 lG=Symbol(`radix.slottable`);function uG(e){return _.isValidElement(e)&&typeof e.type==`function`&&`__radixId`in e.type&&e.type.__radixId===lG}function dG(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 fG(e){let t=Object.getOwnPropertyDescriptor(e.props,`ref`)?.get,n=t&&`isReactWarning`in t&&t.isReactWarning;return n?e.ref:(t=Object.getOwnPropertyDescriptor(e,`ref`)?.get,n=t&&`isReactWarning`in t&&t.isReactWarning,n?e.props.ref:e.props.ref||e.ref)}var pG=[`Enter`,` `],mG=[`ArrowDown`,`PageUp`,`Home`],hG=[`ArrowUp`,`PageDown`,`End`],gG=[...mG,...hG],_G={ltr:[...pG,`ArrowRight`],rtl:[...pG,`ArrowLeft`]},vG={ltr:[`ArrowLeft`],rtl:[`ArrowRight`]},yG=`Menu`,[bG,xG,SG]=oe(yG),[CG,wG]=R(yG,[SG,lc,qW]),TG=lc(),EG=qW(),[DG,OG]=CG(yG),[kG,AG]=CG(yG),jG=e=>{let{__scopeMenu:t,open:n=!1,children:r,dir:i,onOpenChange:a,modal:o=!0}=e,s=TG(t),[c,l]=_.useState(null),u=_.useRef(!1),d=pe(a),f=zW(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)(DG,{scope:t,open:n,onOpenChange:d,content:c,onContentChange:l,children:(0,I.jsx)(kG,{scope:t,onClose:_.useCallback(()=>d(!1),[d]),isUsingKeyboardRef:u,dir:f,modal:o,children:r})})})};jG.displayName=yG;var MG=`MenuAnchor`,NG=_.forwardRef((e,t)=>{let{__scopeMenu:n,...r}=e,i=TG(n);return(0,I.jsx)(Ec,{...i,...r,ref:t})});NG.displayName=MG;var PG=`MenuPortal`,[FG,IG]=CG(PG,{forceMount:void 0}),LG=e=>{let{__scopeMenu:t,forceMount:n,children:r,container:i}=e,a=OG(PG,t);return(0,I.jsx)(FG,{scope:t,forceMount:n,children:(0,I.jsx)(Pe,{present:n||a.open,children:(0,I.jsx)(Me,{asChild:!0,container:i,children:r})})})};LG.displayName=PG;var RG=`MenuContent`,[zG,BG]=CG(RG),VG=_.forwardRef((e,t)=>{let n=IG(RG,e.__scopeMenu),{forceMount:r=n.forceMount,...i}=e,a=OG(RG,e.__scopeMenu),o=AG(RG,e.__scopeMenu);return(0,I.jsx)(bG.Provider,{scope:e.__scopeMenu,children:(0,I.jsx)(Pe,{present:r||a.open,children:(0,I.jsx)(bG.Slot,{scope:e.__scopeMenu,children:o.modal?(0,I.jsx)(HG,{...i,ref:t}):(0,I.jsx)(UG,{...i,ref:t})})})})}),HG=_.forwardRef((e,t)=>{let n=OG(RG,e.__scopeMenu),r=_.useRef(null),i=P(t,r);return _.useEffect(()=>{let e=r.current;if(e)return Zm(e)},[]),(0,I.jsx)(GG,{...e,ref:i,trapFocus:n.open,disableOutsidePointerEvents:n.open,disableOutsideScroll:!0,onFocusOutside:j(e.onFocusOutside,e=>e.preventDefault(),{checkForDefaultPrevented:!1}),onDismiss:()=>n.onOpenChange(!1)})}),UG=_.forwardRef((e,t)=>{let n=OG(RG,e.__scopeMenu);return(0,I.jsx)(GG,{...e,ref:t,trapFocus:!1,disableOutsidePointerEvents:!1,disableOutsideScroll:!1,onDismiss:()=>n.onOpenChange(!1)})}),WG=sG(`MenuContent.ScrollLock`),GG=_.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=OG(RG,n),v=AG(RG,n),y=TG(n),b=EG(n),x=xG(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?Hm:_.Fragment,F=m?{as:WG,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=EK(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),[]),qp();let R=_.useCallback(e=>A.current===k.current?.side&&OK(e,k.current?.area),[]);return(0,I.jsx)(zG,{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)(Rp,{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)(aG,{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":xK(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||!gG.includes(e.key))return;e.preventDefault();let a=x().filter(e=>!e.disabled).map(e=>e.ref.current);hG.includes(e.key)&&a.reverse(),wK(a)}),onBlur:j(e.onBlur,e=>{e.currentTarget.contains(e.target)||(window.clearTimeout(E.current),D.current=``)}),onPointerMove:j(e.onPointerMove,kK(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}}))})})})})})})});VG.displayName=RG;var KG=`MenuGroup`,qG=_.forwardRef((e,t)=>{let{__scopeMenu:n,...r}=e;return(0,I.jsx)(V.div,{role:`group`,...r,ref:t})});qG.displayName=KG;var JG=`MenuLabel`,YG=_.forwardRef((e,t)=>{let{__scopeMenu:n,...r}=e;return(0,I.jsx)(V.div,{...r,ref:t})});YG.displayName=JG;var XG=`MenuItem`,ZG=`menu.itemSelect`,QG=_.forwardRef((e,t)=>{let{disabled:n=!1,onSelect:r,...i}=e,a=_.useRef(null),o=AG(XG,e.__scopeMenu),s=BG(XG,e.__scopeMenu),c=P(t,a),l=_.useRef(!1),u=()=>{let e=a.current;if(!n&&e){let t=new CustomEvent(ZG,{bubbles:!0,cancelable:!0});e.addEventListener(ZG,e=>r?.(e),{once:!0}),fe(e,t),t.defaultPrevented?l.current=!1:o.onClose()}};return(0,I.jsx)($G,{...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===` `||pG.includes(e.key)&&(e.currentTarget.click(),e.preventDefault())})})});QG.displayName=XG;var $G=_.forwardRef((e,t)=>{let{__scopeMenu:n,disabled:r=!1,textValue:i,...a}=e,o=BG(XG,n),s=EG(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)(bG.ItemSlot,{scope:n,disabled:r,textValue:i??f,children:(0,I.jsx)(oG,{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,kK(e=>{r?o.onItemLeave(e):(o.onItemEnter(e),e.defaultPrevented||e.currentTarget.focus({preventScroll:!0}))})),onPointerLeave:j(e.onPointerLeave,kK(e=>o.onItemLeave(e))),onFocus:j(e.onFocus,()=>d(!0)),onBlur:j(e.onBlur,()=>d(!1))})})})}),eK=`MenuCheckboxItem`,tK=_.forwardRef((e,t)=>{let{checked:n=!1,onCheckedChange:r,...i}=e;return(0,I.jsx)(lK,{scope:e.__scopeMenu,checked:n,children:(0,I.jsx)(QG,{role:`menuitemcheckbox`,"aria-checked":SK(n)?`mixed`:n,...i,ref:t,"data-state":CK(n),onSelect:j(i.onSelect,()=>r?.(SK(n)?!0:!n),{checkForDefaultPrevented:!1})})})});tK.displayName=eK;var nK=`MenuRadioGroup`,[rK,iK]=CG(nK,{value:void 0,onValueChange:()=>{}}),aK=_.forwardRef((e,t)=>{let{value:n,onValueChange:r,...i}=e,a=pe(r);return(0,I.jsx)(rK,{scope:e.__scopeMenu,value:n,onValueChange:a,children:(0,I.jsx)(qG,{...i,ref:t})})});aK.displayName=nK;var oK=`MenuRadioItem`,sK=_.forwardRef((e,t)=>{let{value:n,...r}=e,i=iK(oK,e.__scopeMenu),a=n===i.value;return(0,I.jsx)(lK,{scope:e.__scopeMenu,checked:a,children:(0,I.jsx)(QG,{role:`menuitemradio`,"aria-checked":a,...r,ref:t,"data-state":CK(a),onSelect:j(r.onSelect,()=>i.onValueChange?.(n),{checkForDefaultPrevented:!1})})})});sK.displayName=oK;var cK=`MenuItemIndicator`,[lK,uK]=CG(cK,{checked:!1}),dK=_.forwardRef((e,t)=>{let{__scopeMenu:n,forceMount:r,...i}=e,a=uK(cK,n);return(0,I.jsx)(Pe,{present:r||SK(a.checked)||a.checked===!0,children:(0,I.jsx)(V.span,{...i,ref:t,"data-state":CK(a.checked)})})});dK.displayName=cK;var fK=`MenuSeparator`,pK=_.forwardRef((e,t)=>{let{__scopeMenu:n,...r}=e;return(0,I.jsx)(V.div,{role:`separator`,"aria-orientation":`horizontal`,...r,ref:t})});pK.displayName=fK;var mK=`MenuArrow`,hK=_.forwardRef((e,t)=>{let{__scopeMenu:n,...r}=e,i=TG(n);return(0,I.jsx)(Oc,{...i,...r,ref:t})});hK.displayName=mK;var[xoe,gK]=CG(`MenuSub`),_K=`MenuSubTrigger`,vK=_.forwardRef((e,t)=>{let n=OG(_K,e.__scopeMenu),r=AG(_K,e.__scopeMenu),i=gK(_K,e.__scopeMenu),a=BG(_K,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)(NG,{asChild:!0,...l,children:(0,I.jsx)($G,{id:i.triggerId,"aria-haspopup":`menu`,"aria-expanded":n.open,"aria-controls":i.contentId,"data-state":xK(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,kK(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,kK(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===` `||_G[r.dir].includes(t.key)&&(n.onOpenChange(!0),n.content?.focus(),t.preventDefault())})})})});vK.displayName=_K;var yK=`MenuSubContent`,bK=_.forwardRef((e,t)=>{let n=IG(RG,e.__scopeMenu),{forceMount:r=n.forceMount,...i}=e,a=OG(RG,e.__scopeMenu),o=AG(RG,e.__scopeMenu),s=gK(yK,e.__scopeMenu),c=_.useRef(null),l=P(t,c);return(0,I.jsx)(bG.Provider,{scope:e.__scopeMenu,children:(0,I.jsx)(Pe,{present:r||a.open,children:(0,I.jsx)(bG.Slot,{scope:e.__scopeMenu,children:(0,I.jsx)(GG,{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=vG[o.dir].includes(e.key);t&&n&&(a.onOpenChange(!1),s.trigger?.focus(),e.preventDefault())})})})})})});bK.displayName=yK;function xK(e){return e?`open`:`closed`}function SK(e){return e===`indeterminate`}function CK(e){return SK(e)?`indeterminate`:e?`checked`:`unchecked`}function wK(e){let t=document.activeElement;for(let n of e)if(n===t||(n.focus(),document.activeElement!==t))return}function TK(e,t){return e.map((n,r)=>e[(t+r)%e.length])}function EK(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=TK(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 DK(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 OK(e,t){return t?DK({x:e.clientX,y:e.clientY},t):!1}function kK(e){return t=>t.pointerType===`mouse`?e(t):void 0}var AK=jG,jK=NG,MK=LG,NK=VG,PK=qG,FK=YG,IK=QG,LK=tK,RK=aK,zK=sK,BK=dK,VK=pK,HK=hK,UK=vK,WK=bK,GK=`DropdownMenu`,[KK,Soe]=R(GK,[wG]),qK=wG(),[JK,YK]=KK(GK),XK=e=>{let{__scopeDropdownMenu:t,children:n,dir:r,open:i,defaultOpen:a,onOpenChange:o,modal:s=!0}=e,c=qK(t),l=_.useRef(null),[u,d]=ze({prop:i,defaultProp:a??!1,onChange:o,caller:GK});return(0,I.jsx)(JK,{scope:t,triggerId:Ra(),triggerRef:l,contentId:Ra(),open:u,onOpenChange:d,onOpenToggle:_.useCallback(()=>d(e=>!e),[d]),modal:s,children:(0,I.jsx)(AK,{...c,open:u,onOpenChange:d,dir:r,modal:s,children:n})})};XK.displayName=GK;var ZK=`DropdownMenuTrigger`,QK=_.forwardRef((e,t)=>{let{__scopeDropdownMenu:n,disabled:r=!1,...i}=e,a=YK(ZK,n),o=qK(n);return(0,I.jsx)(jK,{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())})})})});QK.displayName=ZK;var $K=`DropdownMenuPortal`,eq=e=>{let{__scopeDropdownMenu:t,...n}=e,r=qK(t);return(0,I.jsx)(MK,{...r,...n})};eq.displayName=$K;var tq=`DropdownMenuContent`,nq=_.forwardRef((e,t)=>{let{__scopeDropdownMenu:n,...r}=e,i=YK(tq,n),a=qK(n),o=_.useRef(!1);return(0,I.jsx)(NK,{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)`}})});nq.displayName=tq;var rq=`DropdownMenuGroup`,iq=_.forwardRef((e,t)=>{let{__scopeDropdownMenu:n,...r}=e,i=qK(n);return(0,I.jsx)(PK,{...i,...r,ref:t})});iq.displayName=rq;var aq=`DropdownMenuLabel`,oq=_.forwardRef((e,t)=>{let{__scopeDropdownMenu:n,...r}=e,i=qK(n);return(0,I.jsx)(FK,{...i,...r,ref:t})});oq.displayName=aq;var sq=`DropdownMenuItem`,cq=_.forwardRef((e,t)=>{let{__scopeDropdownMenu:n,...r}=e,i=qK(n);return(0,I.jsx)(IK,{...i,...r,ref:t})});cq.displayName=sq;var lq=`DropdownMenuCheckboxItem`,uq=_.forwardRef((e,t)=>{let{__scopeDropdownMenu:n,...r}=e,i=qK(n);return(0,I.jsx)(LK,{...i,...r,ref:t})});uq.displayName=lq;var dq=`DropdownMenuRadioGroup`,fq=_.forwardRef((e,t)=>{let{__scopeDropdownMenu:n,...r}=e,i=qK(n);return(0,I.jsx)(RK,{...i,...r,ref:t})});fq.displayName=dq;var pq=`DropdownMenuRadioItem`,mq=_.forwardRef((e,t)=>{let{__scopeDropdownMenu:n,...r}=e,i=qK(n);return(0,I.jsx)(zK,{...i,...r,ref:t})});mq.displayName=pq;var hq=`DropdownMenuItemIndicator`,gq=_.forwardRef((e,t)=>{let{__scopeDropdownMenu:n,...r}=e,i=qK(n);return(0,I.jsx)(BK,{...i,...r,ref:t})});gq.displayName=hq;var _q=`DropdownMenuSeparator`,vq=_.forwardRef((e,t)=>{let{__scopeDropdownMenu:n,...r}=e,i=qK(n);return(0,I.jsx)(VK,{...i,...r,ref:t})});vq.displayName=_q;var yq=`DropdownMenuArrow`,bq=_.forwardRef((e,t)=>{let{__scopeDropdownMenu:n,...r}=e,i=qK(n);return(0,I.jsx)(HK,{...i,...r,ref:t})});bq.displayName=yq;var xq=`DropdownMenuSubTrigger`,Sq=_.forwardRef((e,t)=>{let{__scopeDropdownMenu:n,...r}=e,i=qK(n);return(0,I.jsx)(UK,{...i,...r,ref:t})});Sq.displayName=xq;var Cq=`DropdownMenuSubContent`,wq=_.forwardRef((e,t)=>{let{__scopeDropdownMenu:n,...r}=e,i=qK(n);return(0,I.jsx)(WK,{...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)`}})});wq.displayName=Cq;var Tq=XK,Eq=QK,Dq=eq,Oq=nq,kq=oq,Aq=cq,jq=uq,Mq=mq,Nq=gq,Pq=vq,Fq=Sq,Iq=wq,Lq=Tq,Rq=Eq,zq=_.forwardRef(({className:e,inset:t,children:n,...r},i)=>(0,I.jsxs)(Fq,{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`})]}));zq.displayName=Fq.displayName;var Bq=_.forwardRef(({className:e,...t},n)=>(0,I.jsx)(Iq,{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}));Bq.displayName=Iq.displayName;var Vq=_.forwardRef(({className:e,sideOffset:t=4,...n},r)=>(0,I.jsx)(Dq,{children:(0,I.jsx)(Oq,{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})}));Vq.displayName=Oq.displayName;var Hq=_.forwardRef(({className:e,inset:t,...n},r)=>(0,I.jsx)(Aq,{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}));Hq.displayName=Aq.displayName;var Uq=_.forwardRef(({className:e,children:t,checked:n,...r},i)=>(0,I.jsxs)(jq,{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)(Nq,{children:(0,I.jsx)(an,{className:`h-4 w-4`})})}),t]}));Uq.displayName=jq.displayName;var Wq=_.forwardRef(({className:e,children:t,...n},r)=>(0,I.jsxs)(Mq,{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)(Nq,{children:(0,I.jsx)(hn,{className:`h-2 w-2 fill-current`})})}),t]}));Wq.displayName=Mq.displayName;var Gq=_.forwardRef(({className:e,inset:t,...n},r)=>(0,I.jsx)(kq,{ref:r,className:U(`px-2 py-1.5 text-sm font-semibold`,t&&`pl-8`,e),...n}));Gq.displayName=kq.displayName;var Kq=_.forwardRef(({className:e,...t},n)=>(0,I.jsx)(Pq,{ref:n,className:U(`-mx-1 my-1 h-px bg-muted`,e),...t}));Kq.displayName=Pq.displayName;function qq(e,[t,n]){return Math.min(n,Math.max(t,e))}function Jq(e){let t=Yq(e),n=_.forwardRef((e,n)=>{let{children:r,...i}=e,a=_.Children.toArray(r),o=a.find(Zq);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 Yq(e){let t=_.forwardRef((e,t)=>{let{children:n,...r}=e;if(_.isValidElement(n)){let e=$q(n),i=Qq(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 Xq=Symbol(`radix.slottable`);function Zq(e){return _.isValidElement(e)&&typeof e.type==`function`&&`__radixId`in e.type&&e.type.__radixId===Xq}function Qq(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 $q(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 eJ(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 tJ=[` `,`Enter`,`ArrowUp`,`ArrowDown`],nJ=[` `,`Enter`],rJ=`Select`,[iJ,aJ,oJ]=oe(rJ),[sJ,Coe]=R(rJ,[oJ,lc]),cJ=lc(),[lJ,uJ]=sJ(rJ),[dJ,fJ]=sJ(rJ),pJ=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=cJ(t),[g,v]=_.useState(null),[y,b]=_.useState(null),[x,S]=_.useState(!1),C=zW(l),[w,T]=ze({prop:r,defaultProp:i??!1,onChange:a,caller:rJ}),[E,D]=ze({prop:o,defaultProp:s,onChange:c,caller:rJ}),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)(lJ,{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)(iJ.Provider,{scope:t,children:(0,I.jsx)(dJ,{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)(cY,{"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]})})};pJ.displayName=rJ;var mJ=`SelectTrigger`,hJ=_.forwardRef((e,t)=>{let{__scopeSelect:n,disabled:r=!1,...i}=e,a=cJ(n),o=uJ(mJ,n),s=o.disabled||r,c=P(t,o.onTriggerChange),l=aJ(n),u=_.useRef(`touch`),[d,f,p]=uY(e=>{let t=l().filter(e=>!e.disabled),n=dY(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":lY(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===` `)&&tJ.includes(e.key)&&(m(),e.preventDefault())})})})});hJ.displayName=mJ;var gJ=`SelectValue`,_J=_.forwardRef((e,t)=>{let{__scopeSelect:n,className:r,style:i,children:a,placeholder:o=``,...s}=e,c=uJ(gJ,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:lY(c.value)?(0,I.jsx)(I.Fragment,{children:o}):a})});_J.displayName=gJ;var vJ=`SelectIcon`,yJ=_.forwardRef((e,t)=>{let{__scopeSelect:n,children:r,...i}=e;return(0,I.jsx)(V.span,{"aria-hidden":!0,...i,ref:t,children:r||`▼`})});yJ.displayName=vJ;var bJ=`SelectPortal`,xJ=e=>(0,I.jsx)(Me,{asChild:!0,...e});xJ.displayName=bJ;var SJ=`SelectContent`,CJ=_.forwardRef((e,t)=>{let n=uJ(SJ,e.__scopeSelect),[r,i]=_.useState();if(Ae(()=>{i(new DocumentFragment)},[]),!n.open){let t=r;return t?A.createPortal((0,I.jsx)(TJ,{scope:e.__scopeSelect,children:(0,I.jsx)(iJ.Slot,{scope:e.__scopeSelect,children:(0,I.jsx)(`div`,{children:e.children})})}),t):null}return(0,I.jsx)(kJ,{...e,ref:t})});CJ.displayName=SJ;var wJ=10,[TJ,EJ]=sJ(SJ),DJ=`SelectContentImpl`,OJ=Jq(`SelectContent.RemoveScroll`),kJ=_.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=uJ(SJ,n),[b,x]=_.useState(null),[S,C]=_.useState(null),w=P(t,e=>x(e)),[T,E]=_.useState(null),[D,O]=_.useState(null),k=aJ(n),[A,M]=_.useState(!1),N=_.useRef(!1);_.useEffect(()=>{if(b)return Zm(b)},[b]),qp();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]=uY(e=>{let t=k().filter(e=>!e.disabled),n=dY(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`?NJ:jJ,oe=ae===NJ?{side:s,sideOffset:c,align:l,alignOffset:u,arrowPadding:d,collisionBoundary:f,collisionPadding:p,sticky:m,hideWhenDetached:h,avoidCollisions:g}:{};return(0,I.jsx)(TJ,{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)(Hm,{as:OJ,allowPinchZoom:!0,children:(0,I.jsx)(Rp,{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()}})})})})})})});kJ.displayName=DJ;var AJ=`SelectItemAlignedPosition`,jJ=_.forwardRef((e,t)=>{let{__scopeSelect:n,onPlaced:r,...i}=e,a=uJ(SJ,n),o=EJ(SJ,n),[s,c]=_.useState(null),[l,u]=_.useState(null),d=P(t,e=>u(e)),f=aJ(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-wJ,d=qq(a,[wJ,Math.max(wJ,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-wJ,d=qq(a,[wJ,Math.max(wJ,u-l)]);s.style.minWidth=c+`px`,s.style.right=d+`px`}let o=f(),c=window.innerHeight-wJ*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-wJ,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=`${wJ}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)(PJ,{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}})})})});jJ.displayName=AJ;var MJ=`SelectPopperPosition`,NJ=_.forwardRef((e,t)=>{let{__scopeSelect:n,align:r=`start`,collisionPadding:i=wJ,...a}=e,o=cJ(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)`}})});NJ.displayName=MJ;var[PJ,FJ]=sJ(SJ,{}),IJ=`SelectViewport`,LJ=_.forwardRef((e,t)=>{let{__scopeSelect:n,nonce:r,...i}=e,a=EJ(IJ,n),o=FJ(IJ,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)(iJ.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-wJ*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})})})]})});LJ.displayName=IJ;var RJ=`SelectGroup`,[zJ,BJ]=sJ(RJ),VJ=_.forwardRef((e,t)=>{let{__scopeSelect:n,...r}=e,i=Ra();return(0,I.jsx)(zJ,{scope:n,id:i,children:(0,I.jsx)(V.div,{role:`group`,"aria-labelledby":i,...r,ref:t})})});VJ.displayName=RJ;var HJ=`SelectLabel`,UJ=_.forwardRef((e,t)=>{let{__scopeSelect:n,...r}=e,i=BJ(HJ,n);return(0,I.jsx)(V.div,{id:i.id,...r,ref:t})});UJ.displayName=HJ;var WJ=`SelectItem`,[GJ,KJ]=sJ(WJ),qJ=_.forwardRef((e,t)=>{let{__scopeSelect:n,value:r,disabled:i=!1,textValue:a,...o}=e,s=uJ(WJ,n),c=EJ(WJ,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)(GJ,{scope:n,value:r,disabled:i,textId:h,isSelected:l,onItemTextChange:_.useCallback(e=>{d(t=>t||(e?.textContent??``).trim())},[]),children:(0,I.jsx)(iJ.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!==` `)&&(nJ.includes(e.key)&&v(),e.key===` `&&e.preventDefault())})})})})});qJ.displayName=WJ;var JJ=`SelectItemText`,YJ=_.forwardRef((e,t)=>{let{__scopeSelect:n,className:r,style:i,...a}=e,o=uJ(JJ,n),s=EJ(JJ,n),c=KJ(JJ,n),l=fJ(JJ,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]})});YJ.displayName=JJ;var XJ=`SelectItemIndicator`,ZJ=_.forwardRef((e,t)=>{let{__scopeSelect:n,...r}=e;return KJ(XJ,n).isSelected?(0,I.jsx)(V.span,{"aria-hidden":!0,...r,ref:t}):null});ZJ.displayName=XJ;var QJ=`SelectScrollUpButton`,$J=_.forwardRef((e,t)=>{let n=EJ(QJ,e.__scopeSelect),r=FJ(QJ,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)(nY,{...e,ref:o,onAutoScroll:()=>{let{viewport:e,selectedItem:t}=n;e&&t&&(e.scrollTop-=t.offsetHeight)}}):null});$J.displayName=QJ;var eY=`SelectScrollDownButton`,tY=_.forwardRef((e,t)=>{let n=EJ(eY,e.__scopeSelect),r=FJ(eY,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)(nY,{...e,ref:o,onAutoScroll:()=>{let{viewport:e,selectedItem:t}=n;e&&t&&(e.scrollTop+=t.offsetHeight)}}):null});tY.displayName=eY;var nY=_.forwardRef((e,t)=>{let{__scopeSelect:n,onAutoScroll:r,...i}=e,a=EJ(`SelectScrollButton`,n),o=_.useRef(null),s=aJ(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()})})}),rY=`SelectSeparator`,iY=_.forwardRef((e,t)=>{let{__scopeSelect:n,...r}=e;return(0,I.jsx)(V.div,{"aria-hidden":!0,...r,ref:t})});iY.displayName=rY;var aY=`SelectArrow`,oY=_.forwardRef((e,t)=>{let{__scopeSelect:n,...r}=e,i=cJ(n),a=uJ(aY,n),o=EJ(aY,n);return a.open&&o.position===`popper`?(0,I.jsx)(Oc,{...i,...r,ref:t}):null});oY.displayName=aY;var sY=`SelectBubbleInput`,cY=_.forwardRef(({__scopeSelect:e,value:t,...n},r)=>{let i=_.useRef(null),a=P(r,i),o=eJ(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})});cY.displayName=sY;function lY(e){return e===``||e===void 0}function uY(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 dY(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=fY(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 fY(e,t){return e.map((n,r)=>e[(t+r)%e.length])}var pY=pJ,mY=hJ,hY=_J,gY=yJ,_Y=xJ,vY=CJ,yY=LJ,bY=UJ,xY=qJ,SY=YJ,CY=ZJ,wY=$J,TY=tY,EY=iY,DY=pY,OY=hY,kY=_.forwardRef(({className:e,children:t,...n},r)=>(0,I.jsxs)(mY,{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)(gY,{asChild:!0,children:(0,I.jsx)(on,{className:`h-4 w-4 opacity-50`})})]}));kY.displayName=mY.displayName;var AY=_.forwardRef(({className:e,...t},n)=>(0,I.jsx)(wY,{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`})}));AY.displayName=wY.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)(on,{className:`h-4 w-4`})}));jY.displayName=TY.displayName;var MY=_.forwardRef(({className:e,children:t,position:n=`popper`,...r},i)=>(0,I.jsx)(_Y,{children:(0,I.jsxs)(vY,{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)(AY,{}),(0,I.jsx)(yY,{className:U(`p-1`,n===`popper`&&`h-(--radix-select-trigger-height) w-full min-w-(--radix-select-trigger-width)`),children:t}),(0,I.jsx)(jY,{})]})}));MY.displayName=vY.displayName;var NY=_.forwardRef(({className:e,...t},n)=>(0,I.jsx)(bY,{ref:n,className:U(`py-1.5 pl-8 pr-2 text-sm font-semibold`,e),...t}));NY.displayName=bY.displayName;var Z=_.forwardRef(({className:e,children:t,...n},r)=>(0,I.jsxs)(xY,{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)(CY,{children:(0,I.jsx)(an,{className:`h-4 w-4`})})}),(0,I.jsx)(SY,{children:t})]}));Z.displayName=xY.displayName;var PY=_.forwardRef(({className:e,...t},n)=>(0,I.jsx)(EY,{ref:n,className:U(`-mx-1 my-1 h-px bg-muted`,e),...t}));PY.displayName=EY.displayName;function FY(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 IY(e){return e.relativePath?.trim()||e.sourcePath?.trim()||void 0}var LY=e=>e.configName?.trim()||e.name,RY=`(root)`,zY=`__ROOT__`,BY=`mcplab.configurations.collapsedSuites`,VY=e=>e.suitePath&&e.suitePath.trim().length>0?e.suitePath.trim():null,HY=e=>e??RY,UY=e=>e===null?zY:`suite:${e}`,WY=e=>e===zY?null:e.startsWith(`suite:`)?e.slice(6):null,GY=(e,t)=>t===null?e===null:e===null?!1:e===t||e.startsWith(`${t}/`),KY=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},qY=e=>KY([e]),JY=e=>{let t=qY(e);return t?{href:`/results?scenario=${encodeURIComponent(t)}`,tooltipLabel:`Open results filtered by scenario ${t}`}:{href:`/results`,tooltipLabel:`Open results`}},YY=`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 XY(e){return e===null?`bg-slate-400`:YY[e.split(``).reduce((e,t)=>(e+t.charCodeAt(0))%YY.length,0)]??`bg-slate-400`}var ZY=()=>{let{configs:e,deleteConfig:t,cloneConfig:n,loading:r,reload:i}=rv(),{source:a}=q_(),o=Ud(),[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(BY);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 "${LY(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=VY(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)=>HY(e).localeCompare(HY(t)))},[e]),P=(0,_.useMemo)(()=>e.filter(e=>{let t=VY(e),n=p===`all`?void 0:WY(p),r=HY(t);return n!==void 0&&!GY(t,n)?!1:E.length===0||[LY(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=LY(e).localeCompare(LY(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?FY(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(BY,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=FY(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=VY(t),r=e.get(n);r?r.push(t):e.set(n,[t])}return Array.from(e.entries()).sort((e,t)=>HY(e[0]).localeCompare(HY(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)(LW,{value:d,onValueChange:f,placeholder:`Search evaluations...`}),(0,I.jsxs)(DY,{value:p,onValueChange:m,children:[(0,I.jsx)(kY,{className:`h-9 w-[200px]`,children:(0,I.jsx)(OY,{placeholder:`All suites`})}),(0,I.jsxs)(MY,{children:[(0,I.jsx)(Z,{value:`all`,children:`All suites`}),N.map(e=>(0,I.jsx)(Z,{value:UY(e),children:HY(e)},UY(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)($f,{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)(dv,{children:[(0,I.jsx)(fv,{children:(0,I.jsxs)(hv,{children:[(0,I.jsx)(gv,{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)(gv,{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)(gv,{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)(gv,{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)(gv,{className:`text-right`,children:`Last Run`}),(0,I.jsx)(gv,{className:`w-[220px] text-right`})]})}),(0,I.jsxs)(pv,{children:[te.map(([e,t])=>{let n=HY(e),r=UY(e),i=h.has(r),a=S.has(r);return(0,I.jsxs)(_.Fragment,{children:[(0,I.jsx)(hv,{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 ${XY(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=JY(e),n=IY(e);return(0,I.jsxs)(hv,{children:[(0,I.jsx)(J,{children:(0,I.jsxs)(`div`,{children:[(0,I.jsx)($f,{to:`/mcp-evaluations/${e.id}`,className:`font-medium text-sm hover:text-primary`,children:LY(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)(bv,{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)(Lq,{children:[(0,I.jsx)(Rq,{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)(Vq,{align:`end`,children:[(0,I.jsxs)(Hq,{onClick:()=>o(`/mcp-evaluations/${e.id}`),children:[(0,I.jsx)(Jn,{className:`mr-2 h-3.5 w-3.5`}),`Edit`]}),(0,I.jsxs)(Hq,{onClick:()=>void A(e.id),children:[(0,I.jsx)(vn,{className:`mr-2 h-3.5 w-3.5`}),`Clone`]}),(0,I.jsxs)(Hq,{className:`text-destructive`,onClick:()=>void k(e.id,LY(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)($f,{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,LY(e)),"aria-label":`Queue ${LY(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)($f,{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)(hv,{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)(hv,{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)(hv,{children:(0,I.jsx)(J,{colSpan:6,className:`text-center py-12 text-muted-foreground`,children:`Loading MCP evaluations...`})})]})]})})})]})},QY=[`a`,`button`,`div`,`form`,`h2`,`h3`,`img`,`input`,`label`,`li`,`nav`,`ol`,`p`,`select`,`span`,`svg`,`ul`].reduce((e,t)=>{let n=hp(`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}},{}),$Y=`Label`,eX=_.forwardRef((e,t)=>(0,I.jsx)(QY.label,{...e,ref:t,onMouseDown:t=>{t.target.closest(`button, input, select, textarea`)||(e.onMouseDown?.(t),!t.defaultPrevented&&t.detail>1&&t.preventDefault())}}));eX.displayName=$Y;var tX=eX,nX=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)(tX,{ref:n,className:U(nX(),e),...t}));Q.displayName=tX.displayName;var rX=_.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}));rX.displayName=`Textarea`;var iX=`Tabs`,[aX,woe]=R(iX,[qW]),oX=qW(),[sX,cX]=aX(iX),lX=_.forwardRef((e,t)=>{let{__scopeTabs:n,value:r,onValueChange:i,defaultValue:a,orientation:o=`horizontal`,dir:s,activationMode:c=`automatic`,...l}=e,u=zW(s),[d,f]=ze({prop:r,onChange:i,defaultProp:a??``,caller:iX});return(0,I.jsx)(sX,{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})})});lX.displayName=iX;var uX=`TabsList`,dX=_.forwardRef((e,t)=>{let{__scopeTabs:n,loop:r=!0,...i}=e,a=cX(uX,n),o=oX(n);return(0,I.jsx)(aG,{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})})});dX.displayName=uX;var fX=`TabsTrigger`,pX=_.forwardRef((e,t)=>{let{__scopeTabs:n,value:r,disabled:i=!1,...a}=e,o=cX(fX,n),s=oX(n),c=gX(o.baseId,r),l=_X(o.baseId,r),u=r===o.value;return(0,I.jsx)(oG,{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)})})})});pX.displayName=fX;var mX=`TabsContent`,hX=_.forwardRef((e,t)=>{let{__scopeTabs:n,value:r,forceMount:i,children:a,...o}=e,s=cX(mX,n),c=gX(s.baseId,r),l=_X(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})})});hX.displayName=mX;function gX(e,t){return`${e}-trigger-${t}`}function _X(e,t){return`${e}-content-${t}`}var vX=lX,yX=dX,bX=pX,xX=hX,SX=vX,CX=_.forwardRef(({className:e,...t},n)=>(0,I.jsx)(yX,{ref:n,className:U(`inline-flex h-10 items-center justify-center rounded-md bg-muted p-1 text-muted-foreground`,e),...t}));CX.displayName=yX.displayName;var wX=_.forwardRef(({className:e,...t},n)=>(0,I.jsx)(bX,{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}));wX.displayName=bX.displayName;var TX=_.forwardRef(({className:e,...t},n)=>(0,I.jsx)(xX,{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}));TX.displayName=xX.displayName;var EX={openai:`OpenAI`,anthropic:`Anthropic`,azure:`Azure OpenAI`,azure_openai:`Azure OpenAI`,azure_foundry:`Azure Foundry`,google:`Google`};function DX(e){return EX[e]??e}var OX={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 kX({provider:e}){return(0,I.jsx)(`span`,{className:`inline-flex items-center rounded-full px-2 py-0.5 text-xs font-medium ${OX[e]??OX.custom}`,children:DX(e)})}var AX=`Checkbox`,[jX,Toe]=R(AX),[MX,NX]=jX(AX);function PX(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:AX}),[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:!UX(i)&&i,isFormControl:b,bubbleInput:g,setBubbleInput:v};return(0,I.jsx)(MX,{scope:t,...x,children:HX(d)?d(x):r})}var FX=`CheckboxTrigger`,IX=_.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}=NX(FX,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":UX(c)?`mixed`:c,"aria-required":l,"data-state":WX(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=>UX(e)?!0:!e),m&&p&&(f.current=e.isPropagationStopped(),f.current||e.stopPropagation())})})});IX.displayName=FX;var LX=_.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)(PX,{__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)(IX,{...d,ref:t,__scopeCheckbox:n}),e&&(0,I.jsx)(VX,{__scopeCheckbox:n})]})})});LX.displayName=AX;var RX=`CheckboxIndicator`,zX=_.forwardRef((e,t)=>{let{__scopeCheckbox:n,forceMount:r,...i}=e,a=NX(RX,n);return(0,I.jsx)(Pe,{present:r||UX(a.checked)||a.checked===!0,children:(0,I.jsx)(V.span,{"data-state":WX(a.checked),"data-disabled":a.disabled?``:void 0,...i,ref:t,style:{pointerEvents:`none`,...e.style}})})});zX.displayName=RX;var BX=`CheckboxBubbleInput`,VX=_.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}=NX(BX,e),m=P(n,p),h=eJ(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=UX(a),n.call(e,!UX(a)&&a),e.dispatchEvent(t)}},[f,h,a,i]);let v=_.useRef(!UX(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%)`}})});VX.displayName=BX;function HX(e){return typeof e==`function`}function UX(e){return e===`indeterminate`}function WX(e){return UX(e)?`indeterminate`:e?`checked`:`unchecked`}var GX=_.forwardRef(({className:e,...t},n)=>(0,I.jsx)(LX,{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)(zX,{className:U(`flex items-center justify-center text-current`),children:(0,I.jsx)(an,{className:`h-4 w-4`})})}));GX.displayName=LX.displayName;var KX=`Collapsible`,[qX,Eoe]=R(KX),[JX,YX]=qX(KX),XX=_.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:KX});return(0,I.jsx)(JX,{scope:n,disabled:a,contentId:Ra(),open:c,onOpenToggle:_.useCallback(()=>l(e=>!e),[l]),children:(0,I.jsx)(V.div,{"data-state":nZ(c),"data-disabled":a?``:void 0,...s,ref:t})})});XX.displayName=KX;var ZX=`CollapsibleTrigger`,QX=_.forwardRef((e,t)=>{let{__scopeCollapsible:n,...r}=e,i=YX(ZX,n);return(0,I.jsx)(V.button,{type:`button`,"aria-controls":i.contentId,"aria-expanded":i.open||!1,"data-state":nZ(i.open),"data-disabled":i.disabled?``:void 0,disabled:i.disabled,...r,ref:t,onClick:j(e.onClick,i.onOpenToggle)})});QX.displayName=ZX;var $X=`CollapsibleContent`,eZ=_.forwardRef((e,t)=>{let{forceMount:n,...r}=e,i=YX($X,e.__scopeCollapsible);return(0,I.jsx)(Pe,{present:n||i.open,children:({present:e})=>(0,I.jsx)(tZ,{...r,ref:t,present:e})})});eZ.displayName=$X;var tZ=_.forwardRef((e,t)=>{let{__scopeCollapsible:n,present:r,children:i,...a}=e,o=YX($X,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":nZ(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 nZ(e){return e?`open`:`closed`}var rZ=XX,iZ=QX,aZ=eZ;function oZ(e){return e.length>0?`Tool sequence · ${e.join(` -> `)}`:`Tool sequence`}function sZ(e,t){let n=t||{};return(e[e.length-1]===``?[...e,``]:e).join((n.padRight?` `:``)+`,`+(n.padLeft===!1?``:` `)).trim()}var cZ=/^[$_\p{ID_Start}][$_\u{200C}\u{200D}\p{ID_Continue}]*$/u,lZ=/^[$_\p{ID_Start}][-$_\u{200C}\u{200D}\p{ID_Continue}]*$/u,uZ={};function dZ(e,t){return((t||uZ).jsx?lZ:cZ).test(e)}var fZ=/[ \t\n\f\r]/g;function pZ(e){return typeof e==`object`?e.type===`text`&&mZ(e.value):mZ(e)}function mZ(e){return e.replace(fZ,``)===``}var hZ=class{constructor(e,t,n){this.normal=t,this.property=e,n&&(this.space=n)}};hZ.prototype.normal={},hZ.prototype.property={},hZ.prototype.space=void 0;function gZ(e,t){let n={},r={};for(let t of e)Object.assign(n,t.property),Object.assign(r,t.normal);return new hZ(n,r,t)}function _Z(e){return e.toLowerCase()}var vZ=class{constructor(e,t){this.attribute=t,this.property=e}};vZ.prototype.attribute=``,vZ.prototype.booleanish=!1,vZ.prototype.boolean=!1,vZ.prototype.commaOrSpaceSeparated=!1,vZ.prototype.commaSeparated=!1,vZ.prototype.defined=!1,vZ.prototype.mustUseProperty=!1,vZ.prototype.number=!1,vZ.prototype.overloadedBoolean=!1,vZ.prototype.property=``,vZ.prototype.spaceSeparated=!1,vZ.prototype.space=void 0;var yZ=s({boolean:()=>xZ,booleanish:()=>SZ,commaOrSpaceSeparated:()=>EZ,commaSeparated:()=>TZ,number:()=>$,overloadedBoolean:()=>CZ,spaceSeparated:()=>wZ}),bZ=0,xZ=DZ(),SZ=DZ(),CZ=DZ(),$=DZ(),wZ=DZ(),TZ=DZ(),EZ=DZ();function DZ(){return 2**++bZ}var OZ=Object.keys(yZ),kZ=class extends vZ{constructor(e,t,n,r){let i=-1;if(super(e,t),AZ(this,`space`,r),typeof n==`number`)for(;++i<OZ.length;){let e=OZ[i];AZ(this,OZ[i],(n&yZ[e])===yZ[e])}}};kZ.prototype.defined=!0;function AZ(e,t,n){n&&(e[t]=n)}function jZ(e){let t={},n={};for(let[r,i]of Object.entries(e.properties)){let a=new kZ(r,e.transform(e.attributes||{},r),i,e.space);e.mustUseProperty&&e.mustUseProperty.includes(r)&&(a.mustUseProperty=!0),t[r]=a,n[_Z(r)]=r,n[_Z(a.attribute)]=r}return new hZ(t,n,e.space)}var MZ=jZ({properties:{ariaActiveDescendant:null,ariaAtomic:SZ,ariaAutoComplete:null,ariaBusy:SZ,ariaChecked:SZ,ariaColCount:$,ariaColIndex:$,ariaColSpan:$,ariaControls:wZ,ariaCurrent:null,ariaDescribedBy:wZ,ariaDetails:null,ariaDisabled:SZ,ariaDropEffect:wZ,ariaErrorMessage:null,ariaExpanded:SZ,ariaFlowTo:wZ,ariaGrabbed:SZ,ariaHasPopup:null,ariaHidden:SZ,ariaInvalid:null,ariaKeyShortcuts:null,ariaLabel:null,ariaLabelledBy:wZ,ariaLevel:$,ariaLive:null,ariaModal:SZ,ariaMultiLine:SZ,ariaMultiSelectable:SZ,ariaOrientation:null,ariaOwns:wZ,ariaPlaceholder:null,ariaPosInSet:$,ariaPressed:SZ,ariaReadOnly:SZ,ariaRelevant:null,ariaRequired:SZ,ariaRoleDescription:wZ,ariaRowCount:$,ariaRowIndex:$,ariaRowSpan:$,ariaSelected:SZ,ariaSetSize:$,ariaSort:null,ariaValueMax:$,ariaValueMin:$,ariaValueNow:$,ariaValueText:null,role:null},transform(e,t){return t===`role`?t:`aria-`+t.slice(4).toLowerCase()}});function NZ(e,t){return t in e?e[t]:t}function PZ(e,t){return NZ(e,t.toLowerCase())}var FZ=jZ({attributes:{acceptcharset:`accept-charset`,classname:`class`,htmlfor:`for`,httpequiv:`http-equiv`},mustUseProperty:[`checked`,`multiple`,`muted`,`selected`],properties:{abbr:null,accept:TZ,acceptCharset:wZ,accessKey:wZ,action:null,allow:null,allowFullScreen:xZ,allowPaymentRequest:xZ,allowUserMedia:xZ,alpha:xZ,alt:null,as:null,async:xZ,autoCapitalize:null,autoComplete:wZ,autoFocus:xZ,autoPlay:xZ,blocking:wZ,capture:null,charSet:null,checked:xZ,cite:null,className:wZ,closedBy:null,colorSpace:null,cols:$,colSpan:$,command:null,commandFor:null,content:null,contentEditable:SZ,controls:xZ,controlsList:wZ,coords:$|TZ,crossOrigin:null,data:null,dateTime:null,decoding:null,default:xZ,defer:xZ,dir:null,dirName:null,disabled:xZ,download:CZ,draggable:SZ,encType:null,enterKeyHint:null,fetchPriority:null,form:null,formAction:null,formEncType:null,formMethod:null,formNoValidate:xZ,formTarget:null,headers:wZ,height:$,hidden:CZ,high:$,href:null,hrefLang:null,htmlFor:wZ,httpEquiv:wZ,id:null,imageSizes:null,imageSrcSet:null,inert:xZ,inputMode:null,integrity:null,is:null,isMap:xZ,itemId:null,itemProp:wZ,itemRef:wZ,itemScope:xZ,itemType:wZ,kind:null,label:null,lang:null,language:null,list:null,loading:null,loop:xZ,low:$,manifest:null,max:null,maxLength:$,media:null,method:null,min:null,minLength:$,multiple:xZ,muted:xZ,name:null,nonce:null,noModule:xZ,noValidate:xZ,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:xZ,optimum:$,pattern:null,ping:wZ,placeholder:null,playsInline:xZ,popover:null,popoverTarget:null,popoverTargetAction:null,poster:null,preload:null,readOnly:xZ,referrerPolicy:null,rel:wZ,required:xZ,reversed:xZ,rows:$,rowSpan:$,sandbox:wZ,scope:null,scoped:xZ,seamless:xZ,selected:xZ,shadowRootClonable:xZ,shadowRootCustomElementRegistry:xZ,shadowRootDelegatesFocus:xZ,shadowRootMode:null,shadowRootSerializable:xZ,shape:null,size:$,sizes:null,slot:null,span:$,spellCheck:SZ,src:null,srcDoc:null,srcLang:null,srcSet:null,start:$,step:null,style:null,tabIndex:$,target:null,title:null,translate:null,type:null,typeMustMatch:xZ,useMap:null,value:SZ,width:$,wrap:null,writingSuggestions:null,align:null,aLink:null,archive:wZ,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:xZ,declare:xZ,event:null,face:null,frame:null,frameBorder:null,hSpace:$,leftMargin:$,link:null,longDesc:null,lowSrc:null,marginHeight:$,marginWidth:$,noResize:xZ,noHref:xZ,noShade:xZ,noWrap:xZ,object:null,profile:null,prompt:null,rev:null,rightMargin:$,rules:null,scheme:null,scrolling:SZ,standby:null,summary:null,text:null,topMargin:$,valueType:null,version:null,vAlign:null,vLink:null,vSpace:$,allowTransparency:null,autoCorrect:null,autoSave:null,credentialless:xZ,disablePictureInPicture:xZ,disableRemotePlayback:xZ,exportParts:TZ,part:wZ,prefix:null,property:null,results:$,security:null,unselectable:null},space:`html`,transform:PZ}),IZ=jZ({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:EZ,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:wZ,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:xZ,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:TZ,g2:TZ,glyphName:TZ,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:EZ,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:wZ,pitch:null,playbackOrder:null,pointerEvents:null,points:null,pointsAtX:$,pointsAtY:$,pointsAtZ:$,preserveAlpha:null,preserveAspectRatio:null,primitiveUnits:null,propagate:null,property:EZ,r:null,radius:null,referrerPolicy:null,refX:null,refY:null,rel:EZ,rev:EZ,renderingIntent:null,repeatCount:null,repeatDur:null,requiredExtensions:EZ,requiredFeatures:EZ,requiredFonts:EZ,requiredFormats:EZ,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:EZ,strokeDashOffset:null,strokeLineCap:null,strokeLineJoin:null,strokeMiterLimit:$,strokeOpacity:$,strokeWidth:null,style:null,surfaceScale:$,syncBehavior:null,syncBehaviorDefault:null,syncMaster:null,syncTolerance:null,syncToleranceDefault:null,systemLanguage:EZ,tabIndex:$,tableValues:null,target:null,targetX:$,targetY:$,textAnchor:null,textDecoration:null,textRendering:null,textLength:null,timelineBegin:null,title:null,transformBehavior:null,type:null,typeOf:EZ,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:NZ}),LZ=jZ({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()}}),RZ=jZ({attributes:{xmlnsxlink:`xmlns:xlink`},properties:{xmlnsXLink:null,xmlns:null},space:`xmlns`,transform:PZ}),zZ=jZ({properties:{xmlBase:null,xmlLang:null,xmlSpace:null},space:`xml`,transform(e,t){return`xml:`+t.slice(3).toLowerCase()}}),BZ={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`},VZ=/[A-Z]/g,HZ=/-[a-z]/g,UZ=/^data[-\w.:]+$/i;function WZ(e,t){let n=_Z(t),r=t,i=vZ;if(n in e.normal)return e.property[e.normal[n]];if(n.length>4&&n.slice(0,4)===`data`&&UZ.test(t)){if(t.charAt(4)===`-`){let e=t.slice(5).replace(HZ,KZ);r=`data`+e.charAt(0).toUpperCase()+e.slice(1)}else{let e=t.slice(4);if(!HZ.test(e)){let n=e.replace(VZ,GZ);n.charAt(0)!==`-`&&(n=`-`+n),t=`data`+n}}i=kZ}return new i(r,t)}function GZ(e){return`-`+e.toLowerCase()}function KZ(e){return e.charAt(1).toUpperCase()}var qZ=gZ([MZ,FZ,LZ,RZ,zZ],`html`),JZ=gZ([MZ,IZ,LZ,RZ,zZ],`svg`);function YZ(e){return e.join(` `).trim()}var XZ=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})),ZZ=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(XZ());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}})),QZ=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))}})),$Z=o(((e,t)=>{var n=(e&&e.__importDefault||function(e){return e&&e.__esModule?e:{default:e}})(ZZ()),r=QZ();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})),eQ=nQ(`end`),tQ=nQ(`start`);function nQ(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 rQ(e){let t=tQ(e),n=eQ(e);if(t&&n)return{start:t,end:n}}function iQ(e){return!e||typeof e!=`object`?``:`position`in e||`type`in e?oQ(e.position):`start`in e||`end`in e?oQ(e):`line`in e||`column`in e?aQ(e):``}function aQ(e){return sQ(e&&e.line)+`:`+sQ(e&&e.column)}function oQ(e){return aQ(e&&e.start)+`-`+aQ(e&&e.end)}function sQ(e){return e&&typeof e==`number`?e:1}var cQ=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=iQ(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}};cQ.prototype.file=``,cQ.prototype.name=``,cQ.prototype.reason=``,cQ.prototype.message=``,cQ.prototype.stack=``,cQ.prototype.column=void 0,cQ.prototype.line=void 0,cQ.prototype.ancestors=void 0,cQ.prototype.cause=void 0,cQ.prototype.fatal=void 0,cQ.prototype.place=void 0,cQ.prototype.ruleId=void 0,cQ.prototype.source=void 0;var lQ=l($Z(),1),uQ={}.hasOwnProperty,dQ=new Map,fQ=/[A-Z]/g,pQ=new Set([`table`,`tbody`,`thead`,`tfoot`,`tr`]),mQ=new Set([`td`,`th`]),hQ=`https://github.com/syntax-tree/hast-util-to-jsx-runtime`;function gQ(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=DQ(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=EQ(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`?JZ:qZ,stylePropertyNameCase:t.stylePropertyNameCase||`dom`,tableCellAlignToStyle:t.tableCellAlignToStyle!==!1},a=_Q(i,e,void 0);return a&&typeof a!=`string`?a:i.create(e,i.Fragment,{children:a||void 0},void 0)}function _Q(e,t,n){if(t.type===`element`)return vQ(e,t,n);if(t.type===`mdxFlowExpression`||t.type===`mdxTextExpression`)return yQ(e,t);if(t.type===`mdxJsxFlowElement`||t.type===`mdxJsxTextElement`)return xQ(e,t,n);if(t.type===`mdxjsEsm`)return bQ(e,t);if(t.type===`root`)return SQ(e,t,n);if(t.type===`text`)return CQ(e,t)}function vQ(e,t,n){let r=e.schema,i=r;t.tagName.toLowerCase()===`svg`&&r.space===`html`&&(i=JZ,e.schema=i),e.ancestors.push(t);let a=NQ(e,t.tagName,!1),o=OQ(e,t),s=AQ(e,t);return pQ.has(t.tagName)&&(s=s.filter(function(e){return typeof e!=`string`||!pZ(e)})),wQ(e,o,a,t),TQ(o,s),e.ancestors.pop(),e.schema=r,e.create(t,a,o,n)}function yQ(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)}PQ(e,t.position)}function bQ(e,t){if(t.data&&t.data.estree&&e.evaluater)return e.evaluater.evaluateProgram(t.data.estree);PQ(e,t.position)}function xQ(e,t,n){let r=e.schema,i=r;t.name===`svg`&&r.space===`html`&&(i=JZ,e.schema=i),e.ancestors.push(t);let a=t.name===null?e.Fragment:NQ(e,t.name,!0),o=kQ(e,t),s=AQ(e,t);return wQ(e,o,a,t),TQ(o,s),e.ancestors.pop(),e.schema=r,e.create(t,a,o,n)}function SQ(e,t,n){let r={};return TQ(r,AQ(e,t)),e.create(t,e.Fragment,r,n)}function CQ(e,t){return t.value}function wQ(e,t,n,r){typeof n!=`string`&&n!==e.Fragment&&e.passNode&&(t.node=r)}function TQ(e,t){if(t.length>0){let n=t.length>1?t:t[0];n&&(e.children=n)}}function EQ(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 DQ(e,t){return n;function n(n,r,i,a){let o=Array.isArray(i.children),s=tQ(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 OQ(e,t){let n={},r,i;for(i in t.properties)if(i!==`children`&&uQ.call(t.properties,i)){let a=jQ(e,i,t.properties[i]);if(a){let[i,o]=a;e.tableCellAlignToStyle&&i===`align`&&typeof o==`string`&&mQ.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 kQ(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 PQ(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 PQ(e,t.position)}else a=r.value===null||r.value;n[i]=a}return n}function AQ(e,t){let n=[],r=-1,i=e.passKeys?new Map:dQ;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=_Q(e,a,o);s!==void 0&&n.push(s)}return n}function jQ(e,t,n){let r=WZ(e.schema,t);if(!(n==null||typeof n==`number`&&Number.isNaN(n))){if(Array.isArray(n)&&(n=r.commaSeparated?sZ(n):YZ(n)),r.property===`style`){let t=typeof n==`object`?n:MQ(e,String(n));return e.stylePropertyNameCase===`css`&&(t=FQ(t)),[`style`,t]}return[e.elementAttributeNameCase===`react`&&r.space?BZ[r.property]||r.property:r.attribute,n]}}function MQ(e,t){try{return(0,lQ.default)(t,{reactCompat:!0})}catch(t){if(e.ignoreInvalidStyle)return{};let n=t,r=new cQ("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=hQ+`#cannot-parse-style-attribute`,r}}function NQ(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=dZ(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=dZ(t)&&!/^[a-z]/.test(t)?{type:`Identifier`,name:t}:{type:`Literal`,value:t};if(r.type===`Literal`){let t=r.value;return uQ.call(e.components,t)?e.components[t]:t}if(e.evaluater)return e.evaluater.evaluateExpression(r);PQ(e)}function PQ(e,t){let n=new cQ("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=hQ+`#cannot-handle-mdx-estrees-without-createevaluater`,n}function FQ(e){let t={},n;for(n in e)uQ.call(e,n)&&(t[IQ(n)]=e[n]);return t}function IQ(e){let t=e.replace(fQ,LQ);return t.slice(0,3)===`ms-`&&(t=`-`+t),t}function LQ(e){return`-`+e.toLowerCase()}var RQ={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`]},zQ={};function BQ(e,t){let n=t||zQ;return VQ(e,typeof n.includeImageAlt!=`boolean`||n.includeImageAlt,typeof n.includeHtml!=`boolean`||n.includeHtml)}function VQ(e,t,n){if(UQ(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 HQ(e.children,t,n)}return Array.isArray(e)?HQ(e,t,n):``}function HQ(e,t,n){let r=[],i=-1;for(;++i<e.length;)r[i]=VQ(e[i],t,n);return r.join(``)}function UQ(e){return!!(e&&typeof e==`object`)}var WQ=document.createElement(`i`);function GQ(e){let t=`&`+e+`;`;WQ.innerHTML=t;let n=WQ.textContent;return n.charCodeAt(n.length-1)===59&&e!==`semi`?!1:n!==t&&n}function KQ(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 qQ(e,t){return e.length>0?(KQ(e,e.length,0,t),e):t}var JQ={}.hasOwnProperty;function YQ(e){let t={},n=-1;for(;++n<e.length;)XQ(t,e[n]);return t}function XQ(e,t){let n;for(n in t){let r=(JQ.call(e,n)?e[n]:void 0)||(e[n]={}),i=t[n],a;if(i)for(a in i){JQ.call(r,a)||(r[a]=[]);let e=i[a];ZQ(r[a],Array.isArray(e)?e:e?[e]:[])}}}function ZQ(e,t){let n=-1,r=[];for(;++n<t.length;)(t[n].add===`after`?e:r).push(t[n]);KQ(e,0,0,r)}function QQ(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 $Q(e){return e.replace(/[\t\n\r ]+/g,` `).replace(/^ | $/g,``).toLowerCase().toUpperCase()}var e$=f$(/[A-Za-z]/),t$=f$(/[\dA-Za-z]/),n$=f$(/[#-'*+\--9=?A-Z^-~]/);function r$(e){return e!==null&&(e<32||e===127)}var i$=f$(/\d/),a$=f$(/[\dA-Fa-f]/),o$=f$(/[!-/:-@[-`{-~]/);function s$(e){return e!==null&&e<-2}function c$(e){return e!==null&&(e<0||e===32)}function l$(e){return e===-2||e===-1||e===32}var u$=f$(/\p{P}|\p{S}/u),d$=f$(/\s/);function f$(e){return t;function t(t){return t!==null&&t>-1&&e.test(String.fromCharCode(t))}}function p$(e){let t=[],n=-1,r=0,i=0;for(;++n<e.length;){let a=e.charCodeAt(n),o=``;if(a===37&&t$(e.charCodeAt(n+1))&&t$(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 m$(e,t,n,r){let i=r?r-1:1/0,a=0;return o;function o(r){return l$(r)?(e.enter(n),s(r)):t(r)}function s(r){return l$(r)&&a++<i?(e.consume(r),s):(e.exit(n),t(r))}}function h$(e,t,n,r,i,a){let o=0;return s;function s(t){return a>0&&l$(t)?(e.enter(r),c(t)):l(t)}function c(t){return l$(t)&&o<a?(e.consume(t),o++,c):(e.exit(r),l(t))}function l(e){return o>=i?t(e):n(e)}}var g$={tokenize:_$};function _$(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`),m$(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 s$(t)?(e.consume(t),e.exit(`chunkText`),a):(e.consume(t),o)}}var v$=class{constructor(){this.index=new Map,this.map=[]}add(e,t,n){y$(this,e,t,n,!1)}addBefore(e,t,n){y$(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 y$(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 b$={tokenize:S$},x$={tokenize:C$};function S$(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 v$;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(x$,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(x$,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 s$(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 v$;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 C$(e,t,n){return m$(e,e.attempt(this.parser.constructs.document,t,n),`linePrefix`,this.parser.constructs.disable.null.includes(`codeIndented`)?void 0:4)}function w$(e){if(e===null||c$(e)||d$(e))return 1;if(u$(e))return 2}function T$(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 E$={name:`attention`,resolveAll:D$,tokenize:O$};function D$(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};k$(o,-a),k$(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=qQ(r,[[`enter`,e[i][1],t],[`exit`,e[i][1],t]])),r=qQ(r,[[`enter`,d,t],[`enter`,c,t],[`exit`,c,t],[`enter`,u,t]]),r=qQ(r,T$(t.parser.constructs.insideSpan.null,e.slice(i+1,n),t)),r=qQ(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=qQ(r,[[`enter`,e[n][1],t],[`exit`,e[n][1],t]])),KQ(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 O$(e,t){let n=this.parser.constructs.attentionMarkers.null,r=this.previous,i=w$(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=w$(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 k$(e,t){e.column+=t,e.offset+=t,e._bufferIndex+=t}var A$={name:`autolink`,tokenize:j$};function j$(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 e$(t)?(e.consume(t),o):t===64?n(t):l(t)}function o(e){return e===43||e===45||e===46||t$(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||t$(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||r$(r)?n(r):(e.consume(r),c)}function l(t){return t===64?(e.consume(t),u):n$(t)?(e.consume(t),l):n(t)}function u(e){return t$(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||t$(t))&&r++<63){let n=t===45?f:d;return e.consume(t),n}return n(t)}}var M$={partial:!0,tokenize:N$};function N$(e,t,n){return r;function r(t){return l$(t)?m$(e,i,`linePrefix`)(t):i(t)}function i(e){return e===null||s$(e)?t(e):n(e)}}var P$={continuation:{tokenize:I$},exit:L$,name:`blockQuote`,tokenize:F$};function F$(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 l$(n)?(e.enter(`blockQuotePrefixWhitespace`),e.consume(n),e.exit(`blockQuotePrefixWhitespace`),e.exit(`blockQuotePrefix`),t):(e.exit(`blockQuotePrefix`),t(n))}}function I$(e,t,n){let r=this;return i;function i(t){return l$(t)?m$(e,a,`linePrefix`,r.parser.constructs.disable.null.includes(`codeIndented`)?void 0:4)(t):a(t)}function a(r){return e.attempt(P$,t,n)(r)}}function L$(e){e.exit(`blockQuote`)}var R$={name:`characterEscape`,tokenize:z$};function z$(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 o$(r)?(e.enter(`characterEscapeValue`),e.consume(r),e.exit(`characterEscapeValue`),e.exit(`characterEscape`),t):n(r)}}var B$={name:`characterReference`,tokenize:V$};function V$(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=t$,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=a$,u):(e.enter(`characterReferenceValue`),a=7,o=i$,u(t))}function u(s){if(s===59&&i){let i=e.exit(`characterReferenceValue`);return o===t$&&!GQ(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 H$={partial:!0,tokenize:U$};function U$(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 W$={concrete:!0,name:`codeFenced`,tokenize:G$};function G$(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`),l$(t)?m$(e,d,`whitespace`)(t):d(t))}function d(n){return n===null||s$(n)?(e.exit(`codeFencedFence`),r.interrupt?t(n):e.check(H$,h,b)(n)):(e.enter(`codeFencedFenceInfo`),e.enter(`chunkString`,{contentType:`string`}),f(n))}function f(t){return t===null||s$(t)?(e.exit(`chunkString`),e.exit(`codeFencedFenceInfo`),d(t)):l$(t)?(e.exit(`chunkString`),e.exit(`codeFencedFenceInfo`),m$(e,p,`whitespace`)(t)):t===96&&t===s?n(t):(e.consume(t),f)}function p(t){return t===null||s$(t)?d(t):(e.enter(`codeFencedFenceMeta`),e.enter(`chunkString`,{contentType:`string`}),m(t))}function m(t){return t===null||s$(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&&l$(t)?m$(e,v,`linePrefix`,a+1)(t):v(t)}function v(t){return t===null||s$(t)?e.check(H$,h,b)(t):(e.enter(`codeFlowValue`),y(t))}function y(t){return t===null||s$(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`),l$(t)?m$(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`),l$(t)?m$(e,d,`whitespace`)(t):d(t)):n(t)}function d(r){return r===null||s$(r)?(e.exit(`codeFencedFence`),t(r)):n(r)}}}var K$={name:`codeIndented`,tokenize:J$},q$={partial:!0,tokenize:Y$};function J$(e,t,n){return r;function r(t){return e.enter(`codeIndented`),h$(e,i,n,`linePrefix`,4,4)(t)}function i(t){return t===null?o(t):s$(t)?e.attempt(q$,i,o)(t):(e.enter(`codeFlowValue`),a(t))}function a(t){return t===null||s$(t)?(e.exit(`codeFlowValue`),i(t)):(e.consume(t),a)}function o(n){return e.exit(`codeIndented`),t(n)}}function Y$(e,t,n){let r=this;return i;function i(o){return r.parser.lazy[r.now().line]?n(o):s$(o)?(e.enter(`lineEnding`),e.consume(o),e.exit(`lineEnding`),i):h$(e,t,a,`linePrefix`,4,4)(o)}function a(e){return s$(e)?i(e):n(e)}}var X$={name:`codeText`,previous:Q$,resolve:Z$,tokenize:$$};function Z$(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 Q$(e){return e!==96||this.events[this.events.length-1][1].type===`characterEscape`}function $$(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)):s$(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||s$(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 e1=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&&t1(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),t1(this.left,e)}unshift(e){this.setCursor(0),this.right.push(e)}unshiftMany(e){this.setCursor(0),t1(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);t1(this.right,t.reverse())}else{let t=this.right.splice(this.left.length+this.right.length-e,1/0);t1(this.left,t.reverse())}}}};function t1(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 n1(e){let t={},n=-1,r,i,a,o,s,c,l,u=new e1(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,r1(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 KQ(e,0,1/0,u.slice(0)),!l}function r1(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 i1={resolve:o1,tokenize:s1},a1={partial:!0,tokenize:c1};function o1(e){return n1(e),e}function s1(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):s$(t)?e.check(a1,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 c1(e,t,n){let r=this;return i;function i(t){return e.exit(`chunkContent`),e.enter(`lineEnding`),e.consume(t),e.exit(`lineEnding`),m$(e,a,`linePrefix`)}function a(i){if(i===null||s$(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 l1(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||r$(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||s$(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||c$(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||r$(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 u1(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):s$(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||s$(t)||s++>999?(e.exit(`chunkString`),u(t)):(e.consume(t),c||=!l$(t),t===92?f:d)}function f(t){return t===91||t===92||t===93?(e.consume(t),s++,d):d(t)}}function d1(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):s$(t)?(e.enter(`lineEnding`),e.consume(t),e.exit(`lineEnding`),m$(e,l,`linePrefix`)):(e.enter(`chunkString`,{contentType:`string`}),u(t))}function u(t){return t===o||t===null||s$(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 f1(e,t){let n;return r;function r(i){return s$(i)?(e.enter(`lineEnding`),e.consume(i),e.exit(`lineEnding`),n=!0,r):l$(i)?m$(e,r,n?`linePrefix`:`lineSuffix`)(i):t(i)}}var p1={name:`definition`,tokenize:h1},m1={partial:!0,tokenize:g1};function h1(e,t,n){let r=this,i;return a;function a(t){return e.enter(`definition`),o(t)}function o(t){return u1.call(r,e,s,n,`definitionLabel`,`definitionLabelMarker`,`definitionLabelString`)(t)}function s(t){return i=$Q(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 c$(t)?f1(e,l)(t):l(t)}function l(t){return l1(e,u,n,`definitionDestination`,`definitionDestinationLiteral`,`definitionDestinationLiteralMarker`,`definitionDestinationRaw`,`definitionDestinationString`)(t)}function u(t){return e.attempt(m1,d,d)(t)}function d(t){return l$(t)?m$(e,f,`whitespace`)(t):f(t)}function f(a){return a===null||s$(a)?(e.exit(`definition`),r.parser.defined.push(i),t(a)):n(a)}}function g1(e,t,n){return r;function r(t){return c$(t)?f1(e,i)(t):n(t)}function i(t){return d1(e,a,n,`definitionTitle`,`definitionTitleMarker`,`definitionTitleString`)(t)}function a(t){return l$(t)?m$(e,o,`whitespace`)(t):o(t)}function o(e){return e===null||s$(e)?t(e):n(e)}}var _1={name:`hardBreakEscape`,tokenize:v1};function v1(e,t,n){return r;function r(t){return e.enter(`hardBreakEscape`),e.consume(t),i}function i(r){return s$(r)?(e.exit(`hardBreakEscape`),t(r)):n(r)}}var y1={name:`headingAtx`,resolve:b1,tokenize:x1};function b1(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`};KQ(e,r,n-r+1,[[`enter`,i,t],[`enter`,a,t],[`exit`,a,t],[`exit`,i,t]])}return e}function x1(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||c$(t)?(e.exit(`atxHeadingSequence`),s(t)):n(t)}function s(n){return n===35?(e.enter(`atxHeadingSequence`),c(n)):n===null||s$(n)?(e.exit(`atxHeading`),t(n)):l$(n)?m$(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||c$(t)?(e.exit(`atxHeadingText`),s(t)):(e.consume(t),l)}}var S1=`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(`.`),C1=[`pre`,`script`,`style`,`textarea`],w1={concrete:!0,name:`htmlFlow`,resolveTo:E1,tokenize:D1},T1={partial:!0,tokenize:O1};function E1(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 D1(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):e$(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):e$(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 e$(t)?(e.consume(t),o=String.fromCharCode(t),g):n(t)}function g(s){if(s===null||s===47||s===62||c$(s)){let c=s===47,l=o.toLowerCase();return!c&&!a&&C1.includes(l)?(i=1,r.interrupt?t(s):O(s)):S1.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||t$(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 l$(t)?(e.consume(t),v):E(t)}function y(t){return t===47?(e.consume(t),E):t===58||t===95||e$(t)?(e.consume(t),b):l$(t)?(e.consume(t),y):E(t)}function b(t){return t===45||t===46||t===58||t===95||t$(t)?(e.consume(t),b):x(t)}function x(t){return t===61?(e.consume(t),S):l$(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):l$(t)?(e.consume(t),S):w(t)}function C(t){return t===c?(e.consume(t),c=null,T):t===null||s$(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||c$(t)?x(t):(e.consume(t),w)}function T(e){return e===47||e===62||l$(e)?y(e):n(e)}function E(t){return t===62?(e.consume(t),D):n(t)}function D(t){return t===null||s$(t)?O(t):l$(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):s$(t)&&(i===6||i===7)?(e.exit(`htmlFlowData`),e.check(T1,R,k)(t)):t===null||s$(t)?(e.exit(`htmlFlowData`),k(t)):(e.consume(t),O)}function k(t){return e.check(H$,A,R)(t)}function A(t){return e.enter(`lineEnding`),e.consume(t),e.exit(`lineEnding`),j}function j(t){return t===null||s$(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 C1.includes(n)?(e.consume(t),L):O(t)}return e$(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||s$(t)?(e.exit(`htmlFlowData`),R(t)):(e.consume(t),L)}function R(n){return e.exit(`htmlFlow`),t(n)}}function O1(e,t,n){return r;function r(r){return e.enter(`lineEnding`),e.consume(r),e.exit(`lineEnding`),e.attempt(M$,t,n)}}var k1={name:`htmlText`,tokenize:A1};function A1(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):e$(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):e$(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):s$(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):s$(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):s$(t)?(o=v,N(t)):(e.consume(t),v)}function y(t){return t===null?n(t):t===63?(e.consume(t),b):s$(t)?(o=y,N(t)):(e.consume(t),y)}function b(e){return e===62?M(e):y(e)}function x(t){return e$(t)?(e.consume(t),S):n(t)}function S(t){return t===45||t$(t)?(e.consume(t),S):C(t)}function C(t){return s$(t)?(o=C,N(t)):l$(t)?(e.consume(t),C):M(t)}function w(t){return t===45||t$(t)?(e.consume(t),w):t===47||t===62||c$(t)?T(t):n(t)}function T(t){return t===47?(e.consume(t),M):t===58||t===95||e$(t)?(e.consume(t),E):s$(t)?(o=T,N(t)):l$(t)?(e.consume(t),T):M(t)}function E(t){return t===45||t===46||t===58||t===95||t$(t)?(e.consume(t),E):D(t)}function D(t){return t===61?(e.consume(t),O):s$(t)?(o=D,N(t)):l$(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):s$(t)?(o=O,N(t)):l$(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):s$(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||c$(t)?T(t):(e.consume(t),A)}function j(e){return e===47||e===62||c$(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 l$(t)?m$(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 j1={name:`labelEnd`,resolveAll:F1,resolveTo:I1,tokenize:L1},M1={tokenize:R1},N1={tokenize:z1},P1={tokenize:B1};function F1(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&&KQ(e,0,e.length,n),e}function I1(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=qQ(o,e.slice(i+1,i+r+3)),o=qQ(o,[[`enter`,l,t]]),o=qQ(o,T$(t.parser.constructs.insideSpan.null,e.slice(i+r+4,a-3),t)),o=qQ(o,[[`exit`,l,t],e[a-2],e[a-1],[`exit`,c,t]]),o=qQ(o,e.slice(a+1)),o=qQ(o,[[`exit`,s,t]]),KQ(e,i,e.length,o),e}function L1(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($Q(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(M1,u,o?u:d)(t):t===91?e.attempt(N1,u,o?l:d)(t):o?u(t):d(t)}function l(t){return e.attempt(P1,u,d)(t)}function u(e){return i.pop(),t(e)}function d(e){return a._balanced=!0,n(e)}}function R1(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 c$(t)?f1(e,a)(t):a(t)}function a(t){return t===41?u(t):l1(e,o,s,`resourceDestination`,`resourceDestinationLiteral`,`resourceDestinationLiteralMarker`,`resourceDestinationRaw`,`resourceDestinationString`,32)(t)}function o(t){return c$(t)?f1(e,c)(t):u(t)}function s(e){return n(e)}function c(t){return t===34||t===39||t===40?d1(e,l,n,`resourceTitle`,`resourceTitleMarker`,`resourceTitleString`)(t):u(t)}function l(t){return c$(t)?f1(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 z1(e,t,n){let r=this;return i;function i(t){return u1.call(r,e,a,o,`reference`,`referenceMarker`,`referenceString`)(t)}function a(e){return r.parser.defined.includes($Q(r.sliceSerialize(r.events[r.events.length-1][1]).slice(1,-1)))?t(e):n(e)}function o(e){return n(e)}}function B1(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 V1={name:`labelStartImage`,resolveAll:j1.resolveAll,tokenize:H1};function H1(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 U1={name:`labelStartLink`,resolveAll:j1.resolveAll,tokenize:W1};function W1(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 G1={name:`lineEnding`,tokenize:K1};function K1(e,t){return n;function n(n){return e.enter(`lineEnding`),e.consume(n),e.exit(`lineEnding`),m$(e,t,`linePrefix`)}}var q1={name:`thematicBreak`,tokenize:J1};function J1(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||s$(a))?(e.exit(`thematicBreak`),t(a)):n(a)}function c(t){return t===i?(e.consume(t),r++,c):(e.exit(`thematicBreakSequence`),l$(t)?m$(e,s,`whitespace`)(t):s(t))}}var Y1={continuation:{tokenize:$1},exit:t0,name:`list`,tokenize:Q1},X1={partial:!0,tokenize:n0},Z1={partial:!0,tokenize:e0};function Q1(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:i$(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(q1,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 i$(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(M$,r.interrupt?n:u,e.attempt(X1,f,d))}function u(e){return r.containerState.initialBlankLine=!0,a++,f(e)}function d(t){return l$(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 $1(e,t,n){let r=this;return r.containerState._closeFlow=void 0,e.check(M$,i,a);function i(n){return r.containerState.furtherBlankLines=r.containerState.furtherBlankLines||r.containerState.initialBlankLine,m$(e,t,`listItemIndent`,r.containerState.size+1)(n)}function a(n){return r.containerState.furtherBlankLines||!l$(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(Z1,t,o)(n))}function o(i){return r.containerState._closeFlow=!0,r.interrupt=void 0,m$(e,e.attempt(Y1,t,n),`linePrefix`,r.parser.constructs.disable.null.includes(`codeIndented`)?void 0:4)(i)}}function e0(e,t,n){let r=this;return m$(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 t0(e){e.exit(this.containerState.type)}function n0(e,t,n){let r=this;return m$(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!l$(e)&&i&&i[1].type===`listItemPrefixWhitespace`?t(e):n(e)}}var r0={name:`setextUnderline`,resolveTo:i0,tokenize:a0};function i0(e,t){let n=new v$,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 a0(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`),l$(t)?m$(e,c,`lineSuffix`)(t):c(t))}function c(r){return r===null||s$(r)?(e.exit(`setextHeadingLine`),t(r)):n(r)}}var o0={tokenize:s0};function s0(e){let t=this,n=e.attempt(M$,r,e.attempt(this.parser.constructs.flowInitial,i,m$(e,e.attempt(this.parser.constructs.flow,i,e.attempt(i1,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 c0={resolveAll:f0()},l0=d0(`string`),u0=d0(`text`);function d0(e){return{resolveAll:f0(e===`text`?p0: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 f0(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 p0(e,t){let n=new v$,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 m0=s({attentionMarkers:()=>S0,contentInitial:()=>g0,disable:()=>C0,document:()=>h0,flow:()=>v0,flowInitial:()=>_0,insideSpan:()=>x0,string:()=>y0,text:()=>b0}),h0={42:Y1,43:Y1,45:Y1,48:Y1,49:Y1,50:Y1,51:Y1,52:Y1,53:Y1,54:Y1,55:Y1,56:Y1,57:Y1,62:P$},g0={91:p1},_0={[-2]:K$,[-1]:K$,32:K$},v0={35:y1,42:q1,45:[r0,q1],60:w1,61:r0,95:q1,96:W$,126:W$},y0={38:B$,92:R$},b0={[-5]:G1,[-4]:G1,[-3]:G1,33:V1,38:B$,42:E$,60:[A$,k1],91:U1,92:[_1,R$],93:j1,95:E$,96:X$},x0={null:[E$,c0]},S0={null:[42,95]},C0={null:[]};function w0(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=qQ(o,e),g(),o[o.length-1]===null?(w(t,0),l.events=T$(a,l.events,l),l.events):[]}function f(e,t){return E0(p(e),t)}function p(e){return T0(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){s$(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&&KQ(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 T0(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 E0(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 D0(e){let t={constructs:YQ([m0,...(e||{}).extensions||[]]),content:n(g$),defined:[],document:n(b$),flow:n(o0),lazy:{},string:n(l0),text:n(u0)};return t;function n(e){return n;function n(n){return w0(t,e,n)}}}function O0(e){for(;!n1(e););return e}var k0=/[\0\t\n\r]/g;function A0(){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;){k0.lastIndex=c;let n=k0.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 j0=/\\([!-/:-@[-`{-~])|&(#(?:\d{1,7}|x[\da-f]{1,6})|[\da-z]{1,31});/gi;function M0(e){return e.replace(j0,N0)}function N0(e,t,n){if(t)return t;if(n.charCodeAt(0)===35){let e=n.charCodeAt(1),t=e===120||e===88;return QQ(n.slice(t?2:1),t?16:10)}return GQ(n)||e}var P0={}.hasOwnProperty;function F0(e,t,n){return t&&typeof t==`object`&&(n=t,t=void 0),I0(n)(O0(D0(n).document().write(A0()(e,t,!0))))}function I0(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()}};R0(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]),P0.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]||B0).call(o,void 0,e[0])}for(r.position={start:L0(e.length>0?e[0][1].start:{line:1,column:1,offset:0}),end:L0(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:L0(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+"` ("+iQ({start:e.start,end:e.end})+`): it’s not open`);r[0].type!==e.type&&(t?t.call(this,e,r[0]):(r[1]||B0).call(this,e,r[0])),n.position.end=L0(e.end)}function d(){return BQ(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=$Q(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:L0(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=L0(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=L0(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=M0(t),n.identifier=$Q(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=$Q(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=QQ(t,n===`characterReferenceMarkerNumeric`?10:16),this.data.characterReferenceType=void 0):r=GQ(t);let i=this.stack[this.stack.length-1];i.value+=r}function ie(e){let t=this.stack.pop();t.position.end=L0(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 L0(e){return{line:e.line,column:e.column,offset:e.offset}}function R0(e,t){let n=-1;for(;++n<t.length;){let r=t[n];Array.isArray(r)?R0(e,r):z0(e,r)}}function z0(e,t){let n;for(n in t)if(P0.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 B0(e,t){throw Error(e?"Cannot close `"+e.type+"` ("+iQ({start:e.start,end:e.end})+"): a different token (`"+t.type+"`, "+iQ({start:t.start,end:t.end})+`) is open`:"Cannot close document, a token (`"+t.type+"`, "+iQ({start:t.start,end:t.end})+`) is still open`)}function V0(e){let t=this;t.parser=n;function n(n){return F0(n,{...t.data(`settings`),...e,extensions:t.data(`micromarkExtensions`)||[],mdastExtensions:t.data(`fromMarkdownExtensions`)||[]})}}function H0(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 U0(e,t){let n={type:`element`,tagName:`br`,properties:{},children:[]};return e.patch(t,n),[e.applyData(t,n),{type:`text`,value:`
121
+ `}]}function W0(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 G0(e,t){let n={type:`element`,tagName:`del`,properties:{},children:e.all(t)};return e.patch(t,n),e.applyData(t,n)}function K0(e,t){let n={type:`element`,tagName:`em`,properties:{},children:e.all(t)};return e.patch(t,n),e.applyData(t,n)}function q0(e,t){let n=typeof e.options.clobberPrefix==`string`?e.options.clobberPrefix:`user-content-`,r=String(t.identifier).toUpperCase(),i=p$(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 J0(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 Y0(e,t){if(e.options.allowDangerousHtml){let n={type:`raw`,value:t.value};return e.patch(t,n),e.applyData(t,n)}}function X0(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 Z0(e,t){let n=String(t.identifier).toUpperCase(),r=e.definitionById.get(n);if(!r)return X0(e,t);let i={src:p$(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 Q0(e,t){let n={src:p$(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 $0(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 e2(e,t){let n=String(t.identifier).toUpperCase(),r=e.definitionById.get(n);if(!r)return X0(e,t);let i={href:p$(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 t2(e,t){let n={href:p$(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 n2(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 Doe(e,t){let n={type:`element`,tagName:`p`,properties:{},children:e.all(t)};return e.patch(t,n),e.applyData(t,n)}function o2(e,t){let n={type:`root`,children:e.wrap(e.all(t))};return e.patch(t,n),e.applyData(t,n)}function s2(e,t){let n={type:`element`,tagName:`strong`,properties:{},children:e.all(t)};return e.patch(t,n),e.applyData(t,n)}function c2(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=tQ(t.children[1]),o=eQ(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 l2(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 u2(e,t){let n={type:`element`,tagName:`td`,properties:{},children:e.all(t)};return e.patch(t,n),e.applyData(t,n)}var d2=9,f2=32;function p2(e){let t=String(e),n=/\r?\n|\r/g,r=n.exec(t),i=0,a=[];for(;r;)a.push(m2(t.slice(i,r.index),i>0,!0),r[0]),i=r.index+r[0].length,r=n.exec(t);return a.push(m2(t.slice(i),i>0,!1)),a.join(``)}function m2(e,t,n){let r=0,i=e.length;if(t){let t=e.codePointAt(r);for(;t===d2||t===f2;)r++,t=e.codePointAt(r)}if(n){let t=e.codePointAt(i-1);for(;t===d2||t===f2;)i--,t=e.codePointAt(i-1)}return i>r?e.slice(r,i):``}function h2(e,t){let n={type:`text`,value:p2(String(t.value))};return e.patch(t,n),e.applyData(t,n)}function g2(e,t){let n={type:`element`,tagName:`hr`,properties:{},children:[]};return e.patch(t,n),e.applyData(t,n)}var _2={blockquote:H0,break:U0,code:W0,delete:G0,emphasis:K0,footnoteReference:q0,heading:J0,html:Y0,imageReference:Z0,image:Q0,inlineCode:$0,linkReference:e2,link:t2,listItem:n2,list:a2,paragraph:Doe,root:o2,strong:s2,table:c2,tableCell:u2,tableRow:l2,text:h2,thematicBreak:g2,toml:v2,yaml:v2,definition:v2,footnoteDefinition:v2};function v2(){}var{defineProperty:y2}=Object,b2=typeof self==`object`?self:globalThis,x2=(e,t)=>{switch(e){case`Function`:case`SharedWorker`:case`Worker`:case`eval`:case`setInterval`:case`setTimeout`:throw TypeError(`unable to deserialize `+e)}return new b2[e](t)},S2=(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__`?y2(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 b2[e]==`function`?x2(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(x2(a,o),i)};return r},C2=e=>S2(new Map,e)(0),w2=``,{toString:T2}={},{keys:E2,is:D2}=Object,O2=e=>{let t=typeof e;if(t!==`object`||!e)return[0,t];let n=T2.call(e).slice(8,-1);switch(n){case`Array`:return[1,w2];case`Object`:return[2,w2];case`Date`:return[3,w2];case`RegExp`:return[4,w2];case`Map`:return[5,w2];case`Set`:return[6,w2];case`DataView`:return[1,n]}return n.includes(`Array`)?[1,n]:e instanceof Error?[7,e.name||`Error`]:[2,n]},k2=([e,t])=>e===0&&(t===`function`||t===`symbol`),A2=(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]=O2(o);switch(s){case 0:{let t=o;switch(c){case`bigint`:s=8,t=o.toString();break;case`number`:if(!o&&D2(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 E2(o))(e||!k2(O2(o[t])))&&n.push([a(t),a(o[t])]);return r}case 3:return i([s,isNaN(o.getTime())?w2: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||!(k2(O2(n))||k2(O2(r))))&&t.push([a(n),a(r)]);return n}case 6:{let t=[],n=i([s,t],o);for(let n of o)(e||!k2(O2(n)))&&t.push(a(n));return n}}let{message:l}=o;return i([s,{name:c,message:l}],o)};return a},j2=(e,{json:t,lossy:n}={})=>{let r=[];return A2(!(t||n),!!t,new Map,r)(e),r},M2=typeof structuredClone==`function`?(e,t)=>t&&(`json`in t||`lossy`in t)?C2(j2(e,t)):structuredClone(e):(e,t)=>C2(j2(e,t));function N2(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 P2(e,t){return`Back to reference `+(e+1)+(t>1?`-`+t:``)}function F2(e){let t=typeof e.options.clobberPrefix==`string`?e.options.clobberPrefix:`user-content-`,n=e.options.footnoteBackContent||N2,r=e.options.footnoteBackLabel||P2,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=p$(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:{...M2(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 I2=(function(e){if(e==null)return V2;if(typeof e==`function`)return B2(e);if(typeof e==`object`)return Array.isArray(e)?L2(e):R2(e);if(typeof e==`string`)return z2(e);throw Error(`Expected function, string, or object as test`)});function L2(e){let t=[],n=-1;for(;++n<e.length;)t[n]=I2(e[n]);return B2(r);function r(...e){let n=-1;for(;++n<t.length;)if(t[n].apply(this,e))return!0;return!1}}function R2(e){let t=e;return B2(n);function n(n){let r=n,i;for(i in e)if(r[i]!==t[i])return!1;return!0}}function z2(e){return B2(t);function t(t){return t&&t.type===e}}function B2(e){return t;function t(t,n,r){return!!(H2(t)&&e.call(this,t,typeof n==`number`?n:void 0,r||void 0))}}function V2(){return!0}function H2(e){return typeof e==`object`&&!!e&&`type`in e}function U2(e){return e}var W2=[];function G2(e,t,n,r){let i;typeof t==`function`&&typeof n!=`function`?(r=n,n=t):i=t;let a=I2(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 (`+U2(e.type+(t?`<`+t+`>`:``))+`)`})}return u;function u(){let l=W2,u,d,f;if((!t||a(e,i,c[c.length-1]||void 0))&&(l=K2(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 K2(e){return Array.isArray(e)?e:typeof e==`number`?[!0,e]:e==null?W2:[e]}function q2(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),G2(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 J2={}.hasOwnProperty,Y2={};function X2(e,t){let n=t||Y2,r=new Map,i=new Map,a={all:s,applyData:Q2,definitionById:r,footnoteById:i,footnoteCounts:new Map,footnoteOrder:[],handlers:{..._2,...n.handlers},one:o,options:n,patch:Z2,wrap:e4};return q2(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(J2.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=M2(n);return r.children=a.all(e),r}return M2(e)}return(a.options.unknownHandler||$2)(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=t4(i.value)),!Array.isArray(i)&&i.type===`element`)){let e=i.children[0];e&&e.type===`text`&&(e.value=t4(e.value))}Array.isArray(i)?t.push(...i):t.push(i)}}}return t}}function Z2(e,t){e.position&&(t.position=rQ(e))}function Q2(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,M2(i)),`children`in n&&n.children&&r!=null&&(n.children=r)}return n}function $2(e,t){let n=t.data||{},r=`value`in t&&!(J2.call(n,`hProperties`)||J2.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 e4(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 t4(e){let t=0,n=e.charCodeAt(t);for(;n===9||n===32;)t++,n=e.charCodeAt(t);return e.slice(t)}function n4(e,t){let n=X2(e,t),r=n.one(e,void 0),i=F2(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 r4(e,t){return e&&`run`in e?async function(n,r){let i=n4(n,{file:r,...t});await e.run(i,r)}:function(n,r){return n4(n,{file:r,...e||t})}}function i4(e){if(e)throw e}var a4=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 o4(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 s4(){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?c4(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 c4(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 l4={basename:u4,dirname:d4,extname:f4,join:p4,sep:`/`};function u4(e,t){if(t!==void 0&&typeof t!=`string`)throw TypeError(`"ext" argument must be a string`);g4(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 d4(e){if(g4(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 f4(e){g4(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 p4(...e){let t=-1,n;for(;++t<e.length;)g4(e[t]),e[t]&&(n=n===void 0?e[t]:n+`/`+e[t]);return n===void 0?`.`:m4(n)}function m4(e){g4(e);let t=e.codePointAt(0)===47,n=h4(e,!t);return n.length===0&&!t&&(n=`.`),n.length>0&&e.codePointAt(e.length-1)===47&&(n+=`/`),t?`/`+n:n}function h4(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 g4(e){if(typeof e!=`string`)throw TypeError(`Path must be a string. Received `+JSON.stringify(e))}var _4={cwd:v4};function v4(){return`/`}function y4(e){return!!(typeof e==`object`&&e&&`href`in e&&e.href&&`protocol`in e&&e.protocol&&e.auth===void 0)}function b4(e){if(typeof e==`string`)e=new URL(e);else if(!y4(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 x4(e)}function x4(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 S4=[`history`,`path`,`basename`,`stem`,`extname`,`dirname`],C4=class{constructor(e){let t;t=e?y4(e)?{path:e}:typeof e==`string`||D4(e)?{value:e}:e:{},this.cwd=`cwd`in t?``:_4.cwd(),this.data={},this.history=[],this.messages=[],this.value,this.map,this.result,this.stored;let n=-1;for(;++n<S4.length;){let e=S4[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)S4.includes(r)||(this[r]=t[r])}get basename(){return typeof this.path==`string`?l4.basename(this.path):void 0}set basename(e){T4(e,`basename`),w4(e,`basename`),this.path=l4.join(this.dirname||``,e)}get dirname(){return typeof this.path==`string`?l4.dirname(this.path):void 0}set dirname(e){E4(this.basename,`dirname`),this.path=l4.join(e||``,this.basename)}get extname(){return typeof this.path==`string`?l4.extname(this.path):void 0}set extname(e){if(w4(e,`extname`),E4(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=l4.join(this.dirname,this.stem+(e||``))}get path(){return this.history[this.history.length-1]}set path(e){y4(e)&&(e=b4(e)),T4(e,`path`),this.path!==e&&this.history.push(e)}get stem(){return typeof this.path==`string`?l4.basename(this.path,this.extname):void 0}set stem(e){T4(e,`stem`),w4(e,`stem`),this.path=l4.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 cQ(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 w4(e,t){if(e&&e.includes(l4.sep))throw Error("`"+t+"` cannot be a path: did not expect `"+l4.sep+"`")}function T4(e,t){if(!e)throw Error("`"+t+"` cannot be empty")}function E4(e,t){if(!e)throw Error("Setting `"+t+"` requires `path` to be set too")}function D4(e){return!!(e&&typeof e==`object`&&`byteLength`in e&&`byteOffset`in e)}var O4=(function(e){let t=this.constructor.prototype,n=t[e],r=function(){return n.apply(r,arguments)};return Object.setPrototypeOf(r,t),r}),k4=l(a4(),1),A4={}.hasOwnProperty,j4=new class e extends O4{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=s4()}copy(){let t=new e,n=-1;for(;++n<this.attachers.length;){let e=this.attachers[n];t.use(...e)}return t.data((0,k4.default)(!0,{},this.namespace)),t}data(e,t){return typeof e==`string`?arguments.length===2?(P4(`data`,this.frozen),this.namespace[e]=t,this):A4.call(this.namespace,e)&&this.namespace[e]||void 0:e?(P4(`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=L4(e),n=this.parser||this.Parser;return M4(`parse`,n),n(String(t),t)}process(e,t){let n=this;return this.freeze(),M4(`process`,this.parser||this.Parser),N4(`process`,this.compiler||this.Compiler),t?r(void 0,t):new Promise(r);function r(r,i){let a=L4(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);koe(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(),M4(`processSync`,this.parser||this.Parser),N4(`processSync`,this.compiler||this.Compiler),this.process(e,r),I4(`processSync`,`process`,t),n;function r(e,r){t=!0,i4(e),n=r}}run(e,t,n){F4(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=L4(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),I4(`runSync`,`run`,n),r;function i(e,t){i4(e),r=t,n=!0}}stringify(e,t){this.freeze();let n=L4(t),r=this.compiler||this.Compiler;return N4(`stringify`,r),F4(e),r(e,n)}use(e,...t){let n=this.attachers,r=this.namespace;if(P4(`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,k4.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];o4(o)&&o4(r)&&(r=(0,k4.default)(!0,o,r)),n[i]=[e,r,...a]}}}}().freeze();function M4(e,t){if(typeof t!=`function`)throw TypeError("Cannot `"+e+"` without `parser`")}function N4(e,t){if(typeof t!=`function`)throw TypeError("Cannot `"+e+"` without `compiler`")}function P4(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 F4(e){if(!o4(e)||typeof e.type!=`string`)throw TypeError("Expected node, got `"+e+"`")}function I4(e,t,n){if(!n)throw Error("`"+e+"` finished async. Use `"+t+"` instead")}function L4(e){return Ooe(e)?e:new C4(e)}function Ooe(e){return!!(e&&typeof e==`object`&&`message`in e&&`messages`in e)}function koe(e){return typeof e==`string`||Aoe(e)}function Aoe(e){return!!(e&&typeof e==`object`&&`byteLength`in e&&`byteOffset`in e)}var R4=[],z4={allowDangerousHtml:!0},joe=/^(https?|ircs?|mailto|xmpp)$/i,Moe=[{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 Noe(e){let t=Poe(e),n=Foe(e);return Ioe(t.runSync(t.parse(n),n),e)}function Poe(e){let t=e.rehypePlugins||R4,n=e.remarkPlugins||R4,r=e.remarkRehypeOptions?{...e.remarkRehypeOptions,...z4}:z4;return j4().use(V0).use(n).use(r4,r).use(t)}function Foe(e){let t=e.children||``,n=new C4;return typeof t==`string`?n.value=t:``+t,n}function Ioe(e,t){let n=t.allowedElements,r=t.allowElement,i=t.components,a=t.disallowedElements,o=t.skipHtml,s=t.unwrapDisallowed,c=t.urlTransform||Loe;for(let e of Moe)Object.hasOwn(t,e.from)&&``+e.from+(e.to?"use `"+e.to+"` instead":`remove it`)+e.id;return q2(e,l),gQ(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 RQ)if(Object.hasOwn(RQ,t)&&Object.hasOwn(e.properties,t)){let n=e.properties[t],r=RQ[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 Loe(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||joe.test(e.slice(0,t))?e:``}function B4(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 Roe(e){if(typeof e!=`string`)throw TypeError(`Expected a string`);return e.replace(/[|\\{}()[\]^$+*?.]/g,`\\$&`).replace(/-/g,`\\x2d`)}function zoe(e,t,n){let r=I2((n||{}).ignore||[]),i=Boe(t),a=-1;for(;++a<i.length;)G2(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 Boe(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([Voe(e[0]),Hoe(e[1])])}return t}function Voe(e){return typeof e==`string`?new RegExp(Roe(e),`g`):e}function Hoe(e){return typeof e==`function`?e:function(){return e}}var V4=`phrasing`,H4=[`autolink`,`link`,`image`,`label`];function Uoe(){return{transforms:[Xoe],enter:{literalAutolink:Goe,literalAutolinkEmail:U4,literalAutolinkHttp:U4,literalAutolinkWww:U4},exit:{literalAutolink:Yoe,literalAutolinkEmail:Joe,literalAutolinkHttp:Koe,literalAutolinkWww:qoe}}}function Woe(){return{unsafe:[{character:`@`,before:`[+\\-.\\w]`,after:`[\\-.\\w]`,inConstruct:V4,notInConstruct:H4},{character:`.`,before:`[Ww]`,after:`[\\-.\\w]`,inConstruct:V4,notInConstruct:H4},{character:`:`,before:`[ps]`,after:`\\/`,inConstruct:V4,notInConstruct:H4}]}}function Goe(e){this.enter({type:`link`,title:null,url:``,children:[]},e)}function U4(e){this.config.enter.autolinkProtocol.call(this,e)}function Koe(e){this.config.exit.autolinkProtocol.call(this,e)}function qoe(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 Joe(e){this.config.exit.autolinkEmail.call(this,e)}function Yoe(e){this.exit(e)}function Xoe(e){zoe(e,[[/(https?:\/\/|www(?=\.))([-.\w]+)([^ \t\r\n]*)/gi,Zoe],[/(?<=^|\s|\p{P}|\p{S})([-.\w+]+)@([-\w]+(?:\.[-\w]+)+)/gu,Qoe]],{ignore:[`link`,`linkReference`]})}function Zoe(e,t,n,r,i){let a=``;if(!W4(i)||(/^w/i.test(t)&&(n=t+n,t=``,a=`http://`),!$oe(n)))return!1;let o=ese(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 Qoe(e,t,n,r){return!W4(r,!0)||/[-\d_]$/.test(n)?!1:{type:`link`,title:null,url:`mailto:`+t+`@`+n,children:[{type:`text`,value:t+`@`+n}]}}function $oe(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 ese(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=B4(e,`(`),a=B4(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 W4(e,t){let n=e.input.charCodeAt(e.index-1);return(e.index===0||d$(n)||u$(n))&&(!t||n!==47)}G4.peek=lse;function tse(){this.buffer()}function nse(e){this.enter({type:`footnoteReference`,identifier:``,label:``},e)}function rse(){this.buffer()}function ise(e){this.enter({type:`footnoteDefinition`,identifier:``,label:``,children:[]},e)}function ase(e){let t=this.resume(),n=this.stack[this.stack.length-1];n.type,n.identifier=$Q(this.sliceSerialize(e)).toLowerCase(),n.label=t}function ose(e){this.exit(e)}function sse(e){let t=this.resume(),n=this.stack[this.stack.length-1];n.type,n.identifier=$Q(this.sliceSerialize(e)).toLowerCase(),n.label=t}function cse(e){this.exit(e)}function lse(){return`[`}function G4(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 use(){return{enter:{gfmFootnoteCallString:tse,gfmFootnoteCall:nse,gfmFootnoteDefinitionLabelString:rse,gfmFootnoteDefinition:ise},exit:{gfmFootnoteCallString:ase,gfmFootnoteCall:ose,gfmFootnoteDefinitionLabelString:sse,gfmFootnoteDefinition:cse}}}function dse(e){let t=!1;return e&&e.firstLineBlank&&(t=!0),{handlers:{footnoteDefinition:n,footnoteReference:G4},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?K4:fse))),s(),o}}function fse(e,t,n){return t===0?e:K4(e,t,n)}function K4(e,t,n){return(n?``:` `)+e}var pse=[`autolink`,`destinationLiteral`,`destinationRaw`,`reference`,`titleQuote`,`titleApostrophe`];q4.attention=vse,q4.peek=yse;function mse(){return{canContainEols:[`delete`],enter:{strikethrough:gse},exit:{strikethrough:_se}}}function hse(){return{handlers:{delete:q4},unsafe:[{character:`~`,inConstruct:`phrasing`,notInConstruct:pse}]}}function gse(e){this.enter({type:`delete`,children:[],position:void 0},e)}function _se(e){this.exit(e)}function q4(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 vse(){return{construct:`strikethrough`,markers:[`~`],sizes:[2,1]}}function yse(){return`~`}function bse(e){return e.length}function xse(e,t){let n=t||{},r=(n.align||[]).concat(),i=n.stringLength||bse,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=Sse(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]=J4(r[d]);else{let e=J4(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 Sse(e){return e==null?``:String(e)}function J4(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 Cse=I2([`break`,`delete`,`emphasis`,`footnote`,`footnoteReference`,`image`,`imageReference`,`inlineCode`,`inlineMath`,`link`,`linkReference`,`mdxJsxTextElement`,`mdxTextExpression`,`strong`,`text`,`textDirective`]);function wse(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()),Tse);return i(),o}function Tse(e,t,n){return`>`+(n?``:` `)+e}function Ese(e,t){return Y4(e,t.inConstruct,!0)&&!Y4(e,t.notInConstruct,!1)}function Y4(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 X4(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&&Ese(n.stack,e))return/[\t ]/.test(r.before)?``:` `}return`\\
134
+ `}function Dse(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 Ose(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 kse(e){let t=e.options.fence||"`";if(t!=="`"&&t!==`~`)throw Error("Cannot serialize code with `"+t+"` for `options.fence`, expected `` ` `` or `~`");return t}function Ase(e,t,n,r){let i=kse(n),a=e.value||``;if(Ose(e,n)){let e=n.enter(`codeIndented`),t=n.indentLines(a,jse);return e(),t}let o=n.createTracker(r),s=i.repeat(Math.max(Dse(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 jse(e,t,n){return(n?``:` `)+e}function Z4(e){let t=e.options.quote||`"`;if(t!==`"`&&t!==`'`)throw Error("Cannot serialize title with `"+t+"` for `options.quote`, expected `\"`, or `'`");return t}function Mse(e,t,n,r){let i=Z4(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 Nse(e){let t=e.options.emphasis||`*`;if(t!==`*`&&t!==`_`)throw Error("Cannot serialize emphasis with `"+t+"` for `options.emphasis`, expected `*`, or `_`");return t}Q4.attention=Pse,Q4.peek=Fse;function Q4(e,t,n,r){let i=n.enter(`phrasing`),a=n.containerPhrasing({type:`root`,children:[e]},r);return i(),a}function Pse(e,t){return{construct:`emphasis`,markers:Nse(t)===`*`?[`*`,`_`]:[`_`,`*`],sizes:[1]}}function Fse(e,t,n){return n.options.emphasis||`*`}function Ise(e){return`&#x`+e.toString(16).toUpperCase()+`;`}function Lse(e,t){let n=!1;return q2(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)&&BQ(e)&&(t.options.setext||n))}function Rse(e,t,n,r){let i=Math.max(Math.min(6,e.depth||1),1),a=n.createTracker(r);if(Lse(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=Ise(u)+l.slice(1)),l=l?o+` `+l:o,n.options.closeAtx&&(l+=` `+o),c(),s(),l}$4.peek=zse;function $4(e){return e.value||``}function zse(){return`<`}e3.peek=Bse;function e3(e,t,n,r){let i=Z4(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 Bse(){return`!`}t3.peek=Vse;function t3(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 Vse(){return`!`}n3.peek=Hse;function n3(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 Hse(){return"`"}function r3(e,t){let n=BQ(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))}i3.peek=Use;function i3(e,t,n,r){let i=Z4(n),a=i===`"`?`Quote`:`Apostrophe`,o=n.createTracker(r);if(r3(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 Use(e,t,n){return r3(e,n)?`<`:`[`}a3.peek=Wse;function a3(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 Wse(){return`[`}function o3(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 Gse(e){let t=o3(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 Kse(e){let t=e.options.bulletOrdered||`.`;if(t!==`.`&&t!==`)`)throw Error("Cannot serialize items with `"+t+"` for `options.bulletOrdered`, expected `.` or `)`");return t}function s3(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 qse(e,t,n,r){let i=n.enter(`list`),a=n.bulletCurrent,o=e.ordered?Kse(n):o3(n),s=e.ordered?o===`.`?`)`:`.`:Gse(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),s3(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 Jse(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 Yse(e,t,n,r){let i=Jse(n),a=n.bulletCurrent||o3(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 Xse(e,t,n,r){let i=n.enter(`paragraph`),a=n.enter(`phrasing`),o=n.containerPhrasing(e,r);return a(),i(),o}function Zse(e,t,n,r){if(!e.children.some(function(e){return Cse(e)}))return n.containerFlow(e,r);let i=n.enter(`phrasing`),a=n.containerPhrasing(e,r);return i(),a}function Qse(e){let t=e.options.strong||`*`;if(t!==`*`&&t!==`_`)throw Error("Cannot serialize strong with `"+t+"` for `options.strong`, expected `*`, or `_`");return t}c3.attention=$se,c3.peek=ece;function c3(e,t,n,r){let i=n.enter(`phrasing`),a=n.containerPhrasing({type:`root`,children:[e]},r);return i(),a}function $se(e,t){return{construct:`strong`,markers:Qse(t)===`*`?[`*`,`_`]:[`_`,`*`],sizes:[2]}}function ece(e,t,n){return n.options.strong||`*`}function tce(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 nce(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 rce(e,t,n){let r=(s3(n)+(n.options.ruleSpaces?` `:``)).repeat(nce(n));return n.options.ruleSpaces?r.slice(0,-1):r}var l3={blockquote:wse,break:X4,code:Ase,definition:Mse,emphasis:Q4,hardBreak:X4,heading:Rse,html:$4,image:e3,imageReference:t3,inlineCode:n3,link:i3,linkReference:a3,list:qse,listItem:Yse,paragraph:Xse,root:Zse,strong:c3,text:tce,thematicBreak:rce};function ice(){return{enter:{table:ace,tableData:d3,tableHeader:d3,tableRow:sce},exit:{codeText:cce,table:oce,tableData:u3,tableHeader:u3,tableRow:u3}}}function ace(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 oce(e){this.exit(e),this.data.inTable=void 0}function sce(e){this.enter({type:`tableRow`,children:[]},e)}function u3(e){this.exit(e)}function d3(e){this.enter({type:`tableCell`,children:[]},e)}function cce(e){let t=this.resume();this.data.inTable&&(t=t.replace(/\\([\\|])/g,lce));let n=this.stack[this.stack.length-1];n.type,n.value=t,this.exit(e)}function lce(e,t){return t===`|`?t:e}function uce(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 xse(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=l3.inlineCode(e,t,n);return n.stack.includes(`tableCell`)&&(r=r.replace(/\|/g,`\\$&`)),r}}function dce(){return{exit:{taskListCheckValueChecked:f3,taskListCheckValueUnchecked:f3,paragraph:pce}}}function fce(){return{unsafe:[{atBreak:!0,character:`-`,after:`[:|-]`}],handlers:{listItem:mce}}}function f3(e){let t=this.stack[this.stack.length-2];t.type,t.checked=e.type===`taskListCheckValueChecked`}function pce(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 mce(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=l3.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 hce(){return[Uoe(),use(),mse(),ice(),dce()]}function gce(e){return{extensions:[Woe(),dse(e),hse(),uce(e),fce()]}}var _ce={tokenize:Cce,partial:!0},p3={tokenize:wce,partial:!0},m3={tokenize:Tce,partial:!0},h3={tokenize:Ece,partial:!0},vce={tokenize:Dce,partial:!0},g3={name:`wwwAutolink`,tokenize:xce,previous:x3},_3={name:`protocolAutolink`,tokenize:Sce,previous:S3},v3={name:`emailAutolink`,tokenize:bce,previous:C3},y3={};function yce(){return{text:y3}}for(var b3=48;b3<123;)y3[b3]=v3,b3++,b3===58?b3=65:b3===91&&(b3=97);y3[43]=v3,y3[45]=v3,y3[46]=v3,y3[95]=v3,y3[72]=[v3,_3],y3[104]=[v3,_3],y3[87]=[v3,g3],y3[119]=[v3,g3];function bce(e,t,n){let r=this,i,a;return o;function o(t){return!w3(t)||!C3.call(r,r.previous)||T3(r.events)?n(t):(e.enter(`literalAutolink`),e.enter(`literalAutolinkEmail`),s(t))}function s(t){return w3(t)?(e.consume(t),s):t===64?(e.consume(t),c):n(t)}function c(t){return t===46?e.check(vce,u,l)(t):t===45||t===95||t$(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&&e$(r.previous)?(e.exit(`literalAutolinkEmail`),e.exit(`literalAutolink`),t(o)):n(o)}}function xce(e,t,n){let r=this;return i;function i(t){return t!==87&&t!==119||!x3.call(r,r.previous)||T3(r.events)?n(t):(e.enter(`literalAutolink`),e.enter(`literalAutolinkWww`),e.check(_ce,e.attempt(p3,e.attempt(m3,a),n),n)(t))}function a(n){return e.exit(`literalAutolinkWww`),e.exit(`literalAutolink`),t(n)}}function Sce(e,t,n){let r=this,i=``,a=!1;return o;function o(t){return(t===72||t===104)&&S3.call(r,r.previous)&&!T3(r.events)?(e.enter(`literalAutolink`),e.enter(`literalAutolinkHttp`),i+=String.fromCodePoint(t),e.consume(t),s):n(t)}function s(t){if(e$(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||r$(t)||c$(t)||d$(t)||u$(t)?n(t):e.attempt(p3,e.attempt(m3,u),n)(t)}function u(n){return e.exit(`literalAutolinkHttp`),e.exit(`literalAutolink`),t(n)}}function Cce(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 wce(e,t,n){let r,i,a;return o;function o(t){return t===46||t===95?e.check(h3,c,s)(t):t===null||c$(t)||d$(t)||t!==45&&u$(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 Tce(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(h3,t,a)(o):o===null||c$(o)||d$(o)?t(o):(e.consume(o),i)}function a(t){return t===41&&r++,e.consume(t),i}}function Ece(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||c$(o)||d$(o)?t(o):n(o)}function i(e){return e===null||e===40||e===91||c$(e)||d$(e)?t(e):r(e)}function a(e){return e$(e)?o(e):n(e)}function o(t){return t===59?(e.consume(t),r):e$(t)?(e.consume(t),o):n(t)}}function Dce(e,t,n){return r;function r(t){return e.consume(t),i}function i(e){return t$(e)?n(e):t(e)}}function x3(e){return e===null||e===40||e===42||e===95||e===91||e===93||e===126||c$(e)}function S3(e){return!e$(e)}function C3(e){return!(e===47||w3(e))}function w3(e){return e===43||e===45||e===46||e===95||t$(e)}function T3(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 Oce={tokenize:Ice,partial:!0};function kce(){return{document:{91:{name:`gfmFootnoteDefinition`,tokenize:Nce,continuation:{tokenize:Pce},exit:Fce}},text:{91:{name:`gfmFootnoteCall`,tokenize:Mce},93:{name:`gfmPotentialFootnoteCall`,add:`after`,tokenize:Ace,resolveTo:jce}}}}function Ace(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=$Q(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 jce(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 Mce(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||c$(s))return n(s);if(s===93){e.exit(`chunkString`);let a=e.exit(`gfmFootnoteCallString`);return i.includes($Q(r.sliceSerialize(a)))?(e.enter(`gfmFootnoteCallLabelMarker`),e.consume(s),e.exit(`gfmFootnoteCallLabelMarker`),e.exit(`gfmFootnoteCall`),t):n(s)}return c$(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 Nce(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||c$(t))return n(t);if(t===93){e.exit(`chunkString`);let n=e.exit(`gfmFootnoteDefinitionLabelString`);return a=$Q(r.sliceSerialize(n)),e.enter(`gfmFootnoteDefinitionLabelMarker`),e.consume(t),e.exit(`gfmFootnoteDefinitionLabelMarker`),e.exit(`gfmFootnoteDefinitionLabel`),f}return c$(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),m$(e,p,`gfmFootnoteDefinitionWhitespace`)):n(t)}function p(e){return t(e)}}function Pce(e,t,n){return e.check(M$,t,e.attempt(Oce,t,n))}function Fce(e){e.exit(`gfmFootnoteDefinition`)}function Ice(e,t,n){let r=this;return m$(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 Lce(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&&KQ(o,o.length,0,T$(s,e.slice(r+1,n),t)),KQ(o,o.length,0,[[`exit`,a,t],[`enter`,e[n][1],t],[`exit`,e[n][1],t],[`exit`,i,t]]),KQ(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=w$(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=w$(a);return l._open=!u||u===2&&!!s,l._close=!s||s===2&&!!u,n(a)}}}var Rce=class{constructor(){this.map=[],this.index=new Map}add(e,t,n){zce(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 zce(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 Bce(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 Vce(){return{flow:{null:{name:`table`,tokenize:Hce,resolveAll:Uce}}}}function Hce(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):s$(t)?a>1?(a=0,r.interrupt=!0,e.exit(`tableRow`),e.enter(`lineEnding`),e.consume(t),e.exit(`lineEnding`),p):n(t):l$(t)?m$(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||c$(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,l$(t)?m$(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 l$(t)?m$(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||s$(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 l$(t)?m$(e,b,`whitespace`)(t):b(t)}function b(n){return n===124?m(n):n===null||s$(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||s$(n)?(e.exit(`tableRow`),t(n)):l$(n)?m$(e,C,`whitespace`)(n):(e.enter(`data`),w(n))}function w(t){return t===null||t===124||c$(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 Uce(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 Rce;for(;++n<e.length;){let p=e[n],m=p[1];p[0]===`enter`?m.type===`tableHead`?(s=!1,c!==0&&(D3(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=E3(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=E3(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=E3(f,t,o,i,n,d)):(o[0]=o[1],d=E3(f,t,a,i,n,d)),i=0):i&&(m.type===`data`||m.type===`tableDelimiterMarker`||m.type===`tableDelimiterFiller`)&&(o[3]=n)}for(c!==0&&D3(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=Bce(t.events,n))}return e}function E3(e,t,n,r,i,a){let o=r===1?`tableHeader`:r===2?`tableDelimiter`:`tableData`;n[0]!==0&&(a.end=Object.assign({},O3(t.events,n[0])),e.add(n[0],0,[[`exit`,a,t]]));let s=O3(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=O3(t.events,n[2]),a=O3(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({},O3(t.events,i)),e.add(i,0,[[`exit`,a,t]]),a=void 0),a}function D3(e,t,n,r,i){let a=[],o=O3(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 O3(e,t){let n=e[t],r=n[0]===`enter`?`start`:`end`;return n[1][r]}var Wce={name:`tasklistCheck`,tokenize:Kce};function Gce(){return{text:{91:Wce}}}function Kce(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 c$(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 s$(r)?t(r):l$(r)?e.check({tokenize:qce},t,n)(r):n(r)}}function qce(e,t,n){return m$(e,r,`whitespace`);function r(e){return e===null?n(e):t(e)}}function Jce(e){return YQ([yce(),kce(),Lce(e),Vce(),Gce()])}var Yce={};function Xce(e){let t=this,n=e||Yce,r=t.data(),i=r.micromarkExtensions||=[],a=r.fromMarkdownExtensions||=[],o=r.toMarkdownExtensions||=[];i.push(Jce(n)),a.push(hce()),o.push(gce(n))}function k3({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)(Noe,{remarkPlugins:[Xce],components:t===`system`?Zce:j3,children:e})})}var A3=e=>function({node:t,...n}){return(0,I.jsx)(`h4`,{className:e,...n})},j3={h1:A3(`text-base font-semibold`),h2:A3(`text-sm font-semibold`),h3:A3(`text-sm font-medium`),h4:A3(`text-sm font-medium`),h5:A3(`text-sm font-medium`),h6:A3(`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=Qce(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})},Zce={...j3,p:({node:e,...t})=>(0,I.jsx)(`p`,{className:`whitespace-pre-wrap leading-normal`,...t})};function Qce(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 $ce({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)(k3,{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)(k3,{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 ele(){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 tle({snippets:e,snippetsLabel:t,onSnippetSelect:n,disabled:r=!1,contentClassName:i=`w-[360px]`}){return(0,I.jsxs)(Lq,{children:[(0,I.jsx)(Rq,{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)(Vq,{align:`start`,className:i,children:[(0,I.jsx)(Gq,{children:t}),(0,I.jsx)(Kq,{}),e.map(e=>(0,I.jsx)(Hq,{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 nle({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)(rX,{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)(tle,{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 M3({reasoning:e}){let t=e.durationMs===void 0,[n,r]=(0,_.useState)(void 0),i=n??t,a=t?`Thinking…`:`Thought for ${rle(e.durationMs)}`,o=e.text.trim();return o?(0,I.jsxs)(rZ,{open:i,onOpenChange:r,children:[(0,I.jsxs)(iZ,{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)(aZ,{className:`mt-1.5 border-l-2 border-border/70 pl-3 text-muted-foreground`,children:(0,I.jsx)(k3,{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 rle(e){let t=Math.max(1,Math.round(e/1e3));return`${t} second${t===1?``:`s`}`}function N3(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 ile(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 P3(e){return e.title?.trim()||I3(ile(e.tool))}function ale(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 ole(e){let t=e.arguments;if(L3(t))return Object.entries(t).map(([t,n])=>({key:t,label:e.argumentLabels?.[t]??I3(t),value:lle(n)}))}function F3(e){if(!e.startedAt||!e.completedAt)return;let t=Date.parse(e.completedAt)-Date.parse(e.startedAt);return Number.isFinite(t)&&t>=0?sle(t):void 0}function sle(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 cle(e){if(e.status===`error`&&e.error)return e.error;let t=L3(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 lle(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 I3(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 L3(e){return typeof e==`object`&&!!e&&!Array.isArray(e)}var R3=5,ule=140,dle={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`},fle={awaiting_approval:rr,running:zn,completed:an,denied:$t,skipped:pn,cancelled:pn,not_run:pn,outcome_unknown:fn,failed:un};function z3({display:e}){let t=fle[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`,dle[e.tone]),children:(0,I.jsx)(t,{className:U(`h-3 w-3`,e.state===`running`&&`animate-spin`)})})}function B3({call:e,disabled:t=!1,allowEdit:n=!1,onApprove:r,onDeny:i}){let a=N3(e),o=P3(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?G3(f).error:void 0,b=()=>{if(t)return;if(!u)return r?.(e.id);let n=G3(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=F3(e);if(!s)return(0,I.jsxs)(rZ,{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)(iZ,{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)(z3,{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)(aZ,{className:`space-y-2 pt-2`,children:[(0,I.jsx)(H3,{call:e}),(0,I.jsx)(U3,{call:e})]}),(0,I.jsx)(`output`,{"aria-live":`polite`,className:`sr-only`,children:`${o}: ${a.label}`})]});let T=ale(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)(z3,{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)(rX,{"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)(H3,{call:e})}),m&&(0,I.jsx)(rX,{"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 ple({calls:e}){let[t,n]=(0,_.useState)(!1);if(e.length===1)return(0,I.jsx)(V3,{call:e[0]});let r=e.map(e=>N3(e)),i=e.find((e,t)=>!r[t].settled),a=r.filter(e=>e.tone===`danger`).length,o=i?N3(i):a?{state:`failed`,label:``,tone:`danger`,settled:!0}:{state:`completed`,label:``,tone:`success`,settled:!0};return(0,I.jsxs)(rZ,{open:t,onOpenChange:n,className:`rounded-md border border-border/60 bg-background px-2.5 py-1.5`,children:[(0,I.jsxs)(iZ,{className:`flex w-full items-center gap-2 text-left`,children:[(0,I.jsx)(z3,{display:o}),(0,I.jsx)(`span`,{className:`min-w-0 flex-1 truncate text-sm`,children:i?`Running ${P3(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)(aZ,{className:`mt-1.5 space-y-0.5 border-t border-border/50 pt-1.5`,children:e.map(e=>(0,I.jsx)(V3,{call:e,bare:!0},e.id))})]})}function V3({call:e,bare:t=!1}){let[n,r]=(0,_.useState)(!1),i=N3(e),a=cle(e),o=F3(e);return(0,I.jsxs)(rZ,{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)(iZ,{className:`flex w-full items-center gap-2 rounded text-left hover:bg-muted/40`,"aria-label":`${P3(e)}, ${i.label.toLowerCase()}`,children:[(0,I.jsx)(z3,{display:i}),(0,I.jsx)(`span`,{className:`max-w-[45%] shrink-0 truncate text-xs font-medium`,title:e.publicToolName,children:P3(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)(aZ,{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)(H3,{call:e}),(0,I.jsx)(U3,{call:e})]})]})}function H3({call:e}){let t=ole(e);return t?t.length?(0,I.jsx)(mle,{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 mle({fields:e}){let[t,n]=(0,_.useState)(!1),r=e.length-R3,i=e.some(e=>W3(e.value)),a=t||r<=0?e:e.slice(0,R3);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&&W3(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 U3({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 W3(e){return e.length>ule||e.split(`
146
+ `).length>3}function G3(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 hle=48;function K3({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<hle)},S=e.filter(e=>e.role!==`tool`),C=new Set(e.flatMap(e=>q3(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=q3(e),d=e.role===`assistant`&&i.length>0?(0,I.jsx)(gle,{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)($ce,{message:e,assistantLabel:e.role===`assistant`?`Assistant`:void 0,header:e.role===`assistant`&&e.reasoning?(0,I.jsx)(M3,{reasoning:e.reasoning}):void 0,footer:l?.(e),renderActions:e.role===`user`||e.role===`assistant`?(0,I.jsx)(_le,{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)(B3,{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)(ele,{}),(0,I.jsx)(`div`,{ref:v})]})}),(0,I.jsx)(`div`,{className:U(`pt-3`,h),children:(0,I.jsx)(nle,{...f})})]})}function gle({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)(M3,{reasoning:e.reasoning}),e.text&&(0,I.jsx)(k3,{text:e.text,className:`text-sm`}),s.length>0&&(0,I.jsx)(ple,{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)(B3,{call:e,disabled:n,allowEdit:r,onApprove:i,onDeny:a},e.id))]})]})}function _le({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 q3(e){return e.pendingToolCallIds??(e.pendingToolCallId?[e.pendingToolCallId]:[])}var vle=Ah,yle=Mh,J3=_.forwardRef(({className:e,...t},n)=>(0,I.jsx)(Nh,{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}));J3.displayName=Nh.displayName;var Y3=_.forwardRef(({className:e,children:t,...n},r)=>(0,I.jsxs)(yle,{children:[(0,I.jsx)(J3,{}),(0,I.jsxs)(Ph,{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)(Lh,{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`})]})]})]}));Y3.displayName=Ph.displayName;var X3=({className:e,...t})=>(0,I.jsx)(`div`,{className:U(`flex flex-col space-y-1.5 text-center sm:text-left`,e),...t});X3.displayName=`DialogHeader`;var Z3=_.forwardRef(({className:e,...t},n)=>(0,I.jsx)(Fh,{ref:n,className:U(`text-lg font-semibold leading-none tracking-tight`,e),...t}));Z3.displayName=Fh.displayName;var Q3=_.forwardRef(({className:e,...t},n)=>(0,I.jsx)(Ih,{ref:n,className:U(`text-sm text-muted-foreground`,e),...t}));Q3.displayName=Ih.displayName;async function ble(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 xle=250;async function $3(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 ble({sessionId:t,source:n,serverName:e.serverName,onLaunchUrl:i,timeoutMs:Math.max(1e4,s-Date.now())})}await new Promise(e=>{window.setTimeout(e,xle)})}throw Error(`OAuth login timed out before all required servers were authorized.`)}function Sle(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 Cle(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 wle(e=`Request aborted`){let t=Error(e);return t.name=`AbortError`,t}function e6(e){return e instanceof Error&&e.name===`AbortError`||typeof e==`object`&&!!e&&`name`in e&&e.name===`AbortError`}function Tle(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 Ele(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 Dle(e,t){return!e||e.id!==t.id||t.revision>e.revision}function Ole(e){return e.type===`assistant_message_delta`||e.type===`assistant_reasoning_delta`}function kle(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 Dle(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(Ole(t)){let e=t.payload;if(e.sessionId!==n||e.revision<=r.current.revision)return;let i=r.current;if(!i)return;let o=Tle({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 t6=e=>e instanceof L_&&e.status===404,n6=e=>e instanceof Error?e.message:String(e),r6=`Assistant session expired. Send a new message to start a fresh session.`;function i6(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}=kle({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),wle(`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=>{e6(e)||O({title:`Could not start ${n}`,description:n6(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()||e6(s))return`cancelled`;if(!i||!t6(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()||e6(e)?`cancelled`:(f(e=>e.filter(e=>e.id!==s.id)),t6(e)&&x(!0),O({title:`${n} error`,description:t6(e)?r6:n6(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;t6(t)&&(N(),x(!0)),O({title:`Could not ${e} ${e===`approve all`?`tool calls`:`tool call`}`,description:t6(t)?r6:n6(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 Ele([...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 Ale(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`?__(e.value)!==void 0&&__(t.metadata?.value)===__(e.value):e.type===`tool_input_regex`?__(e.value)!==void 0&&__(t.metadata?.pattern)===__(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 a6={openai:`OpenAI`,anthropic:`Anthropic`,azure_openai:`Azure OpenAI`,azure_foundry:`Azure Foundry`};function jle(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(a6[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`,a6[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 o6(e){return e===`not_evaluated`?`Not evaluated`:e===`not_executed`?`Not executed`:e===`passed`?`Passed`:`Failed`}function s6({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=Ale(e,r,c6),n=e.type===`agent_check`?jle(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=Nle(e,t);return{rule:e,status:n?`failed`:`passed`,failureReason:n}})}function c6(e){return e.type===`required_tool`?`Required tool · ${e.value}`:e.type===`forbidden_tool`?`Forbidden tool · ${e.value}`:e.type===`tool_sequence`?h_(e.sequence??[]):e.type===`tool_input_contains`?p_({type:`contains`,tool:String(e.tool??``),value:String(e.value??``)}):e.type===`tool_input_regex`?p_({type:`regex`,tool:String(e.tool??``),pattern:String(e.value??``)}):e.type===`tool_input_jsonpath`?p_({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 Mle(e){return h_(e).replace(/^Tool sequence · /,``)}function Nle(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=[m_(n,`tool_not_used`),m_(n,`input_mismatch`),m_(n,`invalid_regex`),m_(n,`invalid_jsonpath`),m_(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=__(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: ${Mle(e.sequence??[])}`)||t.startsWith(`Required tool in sequence not used:`)):t.find(e=>e.startsWith(r))}function l6(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 Ple(e){let t=[],n=0;for(let r of e)if(r.type===`tool_sequence`){let e=l6(r);e.length>0?t.push({type:`tool_sequence`,sequence:e}):n+=1}else t.push(r);return{rules:t,skippedToolSequences:n}}function Fle(e){if(e.type===`tool_sequence`){let t=l6(e);return t.length>0?`Tool sequence · ${t.join(` -> `)}`:`Tool sequence · No tool steps`}return c6(e)}var Ile={prompt:`Prompt`,evalRules:`Checks`,extractRules:`Value Capture Rules`};function Lle({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 ${Ile[t]}`})},c=()=>{t.prompt&&(r({prompt:t.prompt.replacement}),s(`prompt`))},l=(e,t)=>{let i=Ple(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)(Rle,{title:`Prompt`,rationale:t.prompt.rationale,preview:t.prompt.replacement,applied:o(`prompt`),onApply:c}),t.evalRules&&(0,I.jsx)(zle,{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)(Ble,{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 Rle({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 zle({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=Fle(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)(GX,{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 Ble({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)(GX,{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 Vle=[{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 Hle({open:e,onOpenChange:t,configId:n,configPath:r,scenario:i,agents:a,servers:o,defaultAssistantAgentName:s,initialUserMessage:c,onApplyPatch:l}){let{source:u}=q_(),[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 $3({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=i6({api:(0,_.useMemo)(()=>Cle(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)(vle,{open:e,onOpenChange:R,children:(0,I.jsxs)(Y3,{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)(X3,{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)(Z3,{className:`flex items-center gap-2`,children:[(0,I.jsx)(ar,{className:`h-4 w-4`}),`Scenario Assistant`]}),(0,I.jsx)(Q3,{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)(K3,{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)(Lle,{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:Vle,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 u6(e){return typeof e==`number`?e.toLocaleString():`n/a`}function d6(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 Ule({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)(rZ,{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)(iZ,{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)(aZ,{children:(0,I.jsx)(h6,{text:e.finalAnswer||`No final answer captured.`,maxLength:1200,className:`text-xs text-foreground`})})]})}),(0,I.jsx)(rZ,{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)(iZ,{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)(aZ,{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)(Wle,{item:e,fallbackUserPrompt:t},e.id))})})]})})]})}function Wle({item:e,fallbackUserPrompt:t}){if(e.kind===`tool_call`){let t=f6(e,`input`);return(0,I.jsx)(m6,{variant:`call`,title:`Tool call · ${e.toolName||`unknown`}${t}`,text:e.text})}if(e.kind===`tool_result`){let t=f6(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)(m6,{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=p6(e.text,e.kind),i=t?p6(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)(h6,{text:a,maxLength:280,className:`text-xs`}):(0,I.jsx)(h6,{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 f6(e,t){let n=t===`input`?e.estimatedTokens?.inputTokens:e.estimatedTokens?.outputTokens;return typeof n==`number`?` · estimated ${u6(n)} tokens`:``}function p6(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 m6({variant:e,title:t,text:n,icon:r}){let[i,a]=(0,_.useState)(!1);return(0,I.jsx)(rZ,{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)(iZ,{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)(aZ,{children:(0,I.jsx)(`p`,{className:`mt-2 font-mono whitespace-pre-wrap text-foreground`,children:n})})]})})}function h6({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)(k3,{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 g6=[`image/jpeg`,`image/png`,`image/gif`,`image/webp`],_6=[`application/pdf`,`text/plain`,`text/markdown`,`text/csv`];function Gle(e){return g6.includes(e)||_6.includes(e)}function v6({value:e,onValueChange:t,className:n,hideToolSequence:r=!1}){return(0,I.jsxs)(DY,{value:e,onValueChange:e=>t(e),children:[(0,I.jsx)(kY,{className:n,children:(0,I.jsx)(OY,{})}),(0,I.jsxs)(MY,{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 Kle=()=>({id:`scn-${Date.now()}`,name:``,serverIds:[],prompt:``,evalRules:[],extractRules:[]});function y6(e){return oZ(e).replace(/^Tool sequence · /,``)}function b6(e){return e.startsWith(`tool_input_`)}function x6(e){let t=e.trim();if(t)return t===`true`?!0:t===`false`?!1:Number.isNaN(Number(t))?t:Number(t)}function S6({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,Kle()]),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)(qle,{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 qle({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}=q_(),[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/`);Gle(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(b6(x)){let t=T.trim();if(!t)return;let n;if(x===`tool_input_jsonpath`){let e=D.trim();if(!e)return;let r=x6(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=x6(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=b6(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 $3({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=C6(e.evalRules,Pe.run.failureReasons,Pe.run.checkResults),n=t.length?t.map(e=>`${e.status.toUpperCase()} - ${Jle(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 $3({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)(rZ,{open:Ie,onOpenChange:Le,children:(0,I.jsxs)(K,{className:v?`rounded-md border shadow-none`:`border-dashed`,children:[(0,I.jsxs)(sv,{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)(iZ,{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)(cv,{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)($f,{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)(iZ,{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)(aZ,{children:(0,I.jsxs)(q,{className:`space-y-3`,children:[(0,I.jsx)(Hle,{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)(Tp,{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)(sv,{className:`pb-2`,children:[(0,I.jsx)(cv,{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)(rX,{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:[...g6,..._6,`.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)(sv,{className:`pb-2`,children:[(0,I.jsx)(cv,{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)(DY,{value:Ce,onValueChange:we,children:[(0,I.jsx)(kY,{className:`h-8 text-xs`,children:(0,I.jsx)(OY,{placeholder:`Select agent`})}),(0,I.jsx)(MY,{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=C6(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:Yle(t.rule)})]}),t.failureReason&&(0,I.jsx)(`p`,{className:`mt-1 pl-5 text-[11px] text-muted-foreground`,children:Xle(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:o6(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)(Ule,{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)(sv,{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)(cv,{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:y6(e.sequence??[])}):b6(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)(v6,{value:x,onValueChange:S,className:`h-8 w-58 shrink-0 text-xs`}),(0,I.jsx)(Tp,{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)(rX,{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)(v6,{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)(Tp,{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)(Tp,{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)(DY,{value:T,onValueChange:E,children:[(0,I.jsx)(kY,{className:`h-8 text-xs font-mono`,children:(0,I.jsx)(OY,{placeholder:`Select tool`})}),(0,I.jsx)(MY,{children:V.map(e=>(0,I.jsx)(Z,{value:e,children:e},e))})]}):(0,I.jsx)(Tp,{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)(Tp,{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)(Tp,{value:A,onChange:e=>j(e.target.value),placeholder:`Equals (optional)`,className:`h-8 w-40 text-xs font-mono`}):(0,I.jsx)(Tp,{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)(Tp,{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)(Tp,{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)(DY,{value:ue,onValueChange:e=>{de(e),w(e)},disabled:pe||!V||V.length===0,children:[(0,I.jsx)(kY,{className:`h-8 text-xs`,children:(0,I.jsx)(OY,{placeholder:pe?`Loading tools...`:V&&V.length>0?`Select tool to insert in value field`:`Load tools first`})}),(0,I.jsx)(MY,{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)(sv,{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)(cv,{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)(Tp,{value:_e,onChange:e=>ve(e.target.value),placeholder:`Field name`,className:`h-8 text-xs w-36`}),(0,I.jsx)(Tp,{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)(sv,{className:`pb-2`,children:(0,I.jsxs)(`div`,{className:`min-w-0`,children:[(0,I.jsx)(cv,{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)(GX,{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)(GX,{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)(GX,{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 C6(e,t,n){return s6({evalRules:e,failureReasons:t,checkResults:n})}function Jle(e){return e.type===`agent_check`?`${e.type}: ${e.label??``} — ${e.prompt??``}`:e.type===`tool_sequence`?`${e.type}: ${y6(e.sequence??[])}`:b6(e.type)?`${e.type}: ${e.tool??``}: ${w6(e)}`:e.path?`${e.type}: ${w6(e)}`:`${e.type}: ${e.value??``}`}function w6(e){return e.path?e.equals===void 0?e.path:`${e.path} == ${String(e.equals)}`:String(e.value??``)}var Yle=c6;function Xle(e){let t=String(e??``).trim(),n=t.match(/^Regex assertion failed:\s*(.+)$/i);return n?`Text match failed: ${n[1]}`:t}function T6(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 E6(e){return e??0}function D6(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 Zle=()=>({id:`cfg-${Date.now()}`,name:``,configName:``,description:``,servers:[],serverEntries:[],agents:[],agentEntries:[],scenarios:[],scenarioEntries:[],createdAt:new Date().toISOString(),updatedAt:new Date().toISOString()}),O6=()=>{let{id:e,tab:t}=Wd(),n=Bd(),r=Ud(),[i,a]=ap(),{getConfig:o,addConfig:s,updateConfig:c,loading:l}=rv(),{source:u}=q_(),{servers:d,agents:f,scenarios:p}=ov(),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):Zle()),[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===`edit`?i.get(`tab`):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:T6(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=D6(`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)($f,{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&&IY(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:IY(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?tab=${N}`)},children:`Edit`}),h&&!v&&g&&!ce&&(0,I.jsx)(W,{size:`sm`,variant:`outline`,asChild:!0,children:(0,I.jsxs)($f,{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&&IY(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)($f,{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)($f,{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)(Tp,{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)(Tp,{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)(Tp,{value:b.description||``,onChange:e=>F({description:e.target.value}),disabled:ne,placeholder:`Brief description...`})]})]})})}),(0,I.jsxs)(SX,{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)(CX,{children:[(0,I.jsxs)(wX,{value:`scenarios`,className:`gap-1.5`,children:[(0,I.jsx)(Dn,{className:`h-3.5 w-3.5`}),`Scenarios`]}),(0,I.jsxs)(wX,{value:`agents`,className:`gap-1.5`,children:[(0,I.jsx)(en,{className:`h-3.5 w-3.5`}),`Agents`]})]}),(0,I.jsxs)(TX,{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)(DY,{value:w,onValueChange:T,children:[(0,I.jsx)(kY,{className:`h-8`,children:(0,I.jsx)(OY,{placeholder:`Select agent from library`})}),(0,I.jsx)(MY,{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)(Tp,{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)(DY,{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)(kY,{children:(0,I.jsx)(OY,{})}),(0,I.jsxs)(MY,{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)(Tp,{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)(Tp,{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)(Tp,{type:`number`,min:0,max:2,step:.01,value:E6(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)(rX,{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)(kX,{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: `,E6(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)(TX,{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)(DY,{value:S,onValueChange:C,children:[(0,I.jsx)(kY,{className:`h-8`,children:(0,I.jsx)(OY,{placeholder:`Select scenario from library`})}),(0,I.jsx)(MY,{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)(S6,{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)(S6,{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]})]})]})},Qle=Symbol(`radix.slottable`);function $le(e){let t=({children:e})=>(0,I.jsx)(I.Fragment,{children:e});return t.displayName=`${e}.Slottable`,t.__radixId=Qle,t}var k6=`AlertDialog`,[eue,tue]=R(k6,[oh]),A6=oh(),j6=e=>{let{__scopeAlertDialog:t,...n}=e,r=A6(t);return(0,I.jsx)(Ah,{...r,...n,modal:!0})};j6.displayName=k6;var nue=`AlertDialogTrigger`,rue=_.forwardRef((e,t)=>{let{__scopeAlertDialog:n,...r}=e,i=A6(n);return(0,I.jsx)(jh,{...i,...r,ref:t})});rue.displayName=nue;var iue=`AlertDialogPortal`,M6=e=>{let{__scopeAlertDialog:t,...n}=e,r=A6(t);return(0,I.jsx)(Mh,{...r,...n})};M6.displayName=iue;var aue=`AlertDialogOverlay`,N6=_.forwardRef((e,t)=>{let{__scopeAlertDialog:n,...r}=e,i=A6(n);return(0,I.jsx)(Nh,{...i,...r,ref:t})});N6.displayName=aue;var P6=`AlertDialogContent`,[oue,sue]=eue(P6),cue=$le(`AlertDialogContent`),F6=_.forwardRef((e,t)=>{let{__scopeAlertDialog:n,children:r,...i}=e,a=A6(n),o=_.useRef(null),s=P(t,o),c=_.useRef(null);return(0,I.jsx)(Ree,{contentName:P6,titleName:I6,docsSlug:`alert-dialog`,children:(0,I.jsx)(oue,{scope:n,cancelRef:c,children:(0,I.jsxs)(Ph,{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)(cue,{children:r}),(0,I.jsx)(uue,{contentRef:o})]})})})});F6.displayName=P6;var I6=`AlertDialogTitle`,L6=_.forwardRef((e,t)=>{let{__scopeAlertDialog:n,...r}=e,i=A6(n);return(0,I.jsx)(Fh,{...i,...r,ref:t})});L6.displayName=I6;var R6=`AlertDialogDescription`,z6=_.forwardRef((e,t)=>{let{__scopeAlertDialog:n,...r}=e,i=A6(n);return(0,I.jsx)(Ih,{...i,...r,ref:t})});z6.displayName=R6;var lue=`AlertDialogAction`,B6=_.forwardRef((e,t)=>{let{__scopeAlertDialog:n,...r}=e,i=A6(n);return(0,I.jsx)(Lh,{...i,...r,ref:t})});B6.displayName=lue;var V6=`AlertDialogCancel`,H6=_.forwardRef((e,t)=>{let{__scopeAlertDialog:n,...r}=e,{cancelRef:i}=sue(V6,n),a=A6(n),o=P(t,i);return(0,I.jsx)(Lh,{...a,...r,ref:o})});H6.displayName=V6;var uue=({contentRef:e})=>{let t=`\`${P6}\` requires a description for the component to be accessible for screen reader users.
152
+
153
+ You can add a description to the \`${P6}\` by passing a \`${R6}\` 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 \`${P6}\`. 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},due=j6,fue=M6,U6=N6,W6=F6,G6=B6,K6=H6,q6=L6,J6=z6,Y6=due,pue=fue,X6=_.forwardRef(({className:e,...t},n)=>(0,I.jsx)(U6,{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}));X6.displayName=U6.displayName;var Z6=_.forwardRef(({className:e,...t},n)=>(0,I.jsxs)(pue,{children:[(0,I.jsx)(X6,{}),(0,I.jsx)(W6,{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})]}));Z6.displayName=W6.displayName;var Q6=({className:e,...t})=>(0,I.jsx)(`div`,{className:U(`flex flex-col space-y-2 text-center sm:text-left`,e),...t});Q6.displayName=`AlertDialogHeader`;var $6=({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});$6.displayName=`AlertDialogFooter`;var e8=_.forwardRef(({className:e,...t},n)=>(0,I.jsx)(q6,{ref:n,className:U(`text-lg font-semibold`,e),...t}));e8.displayName=q6.displayName;var t8=_.forwardRef(({className:e,...t},n)=>(0,I.jsx)(J6,{ref:n,className:U(`text-sm text-muted-foreground`,e),...t}));t8.displayName=J6.displayName;var n8=_.forwardRef(({className:e,...t},n)=>(0,I.jsx)(G6,{ref:n,className:U(wp(),e),...t}));n8.displayName=G6.displayName;var r8=_.forwardRef(({className:e,...t},n)=>(0,I.jsx)(K6,{ref:n,className:U(wp({variant:`outline`}),`mt-2 sm:mt-0`,e),...t}));r8.displayName=K6.displayName;var mue=()=>{let{servers:e,setServers:t,reload:n,loading:r}=ov(),i=Ud(),[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)(Dg,{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)(LW,{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)(dv,{children:[(0,I.jsx)(fv,{children:(0,I.jsxs)(hv,{children:[(0,I.jsx)(gv,{children:`Name`}),(0,I.jsx)(gv,{children:`Transport`}),(0,I.jsx)(gv,{children:`Endpoint`}),(0,I.jsx)(gv,{children:`Auth`}),(0,I.jsx)(gv,{className:`text-right`,children:`Actions`})]})}),(0,I.jsx)(pv,{children:m.map(e=>(0,I.jsxs)(hv,{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)(Dg,{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)(Y6,{open:!!a,onOpenChange:e=>!e&&o(null),children:(0,I.jsxs)(Z6,{children:[(0,I.jsxs)(Q6,{children:[(0,I.jsx)(e8,{children:`Delete server?`}),(0,I.jsxs)(t8,{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)($6,{children:[(0,I.jsx)(r8,{children:`Cancel`}),(0,I.jsx)(n8,{className:`bg-destructive text-destructive-foreground hover:bg-destructive/90`,onClick:()=>{a&&f(a)},children:`Delete Server`})]})]})})]})};function i8({className:e,disabled:t,...n}){let[r,i]=(0,_.useState)(!1);return(0,I.jsxs)(`div`,{className:`relative`,children:[(0,I.jsx)(Tp,{...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 a8=`Switch`,[hue,gue]=R(a8),[_ue,vue]=hue(a8),o8=_.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:a8});return(0,I.jsxs)(_ue,{scope:n,checked:v,disabled:s,children:[(0,I.jsx)(V.button,{type:`button`,role:`switch`,"aria-checked":v,"aria-required":o,"data-state":u8(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)(l8,{control:f,bubbles:!h.current,name:r,value:c,checked:v,required:o,disabled:s,form:u,style:{transform:`translateX(-100%)`}})]})});o8.displayName=a8;var s8=`SwitchThumb`,c8=_.forwardRef((e,t)=>{let{__scopeSwitch:n,...r}=e,i=vue(s8,n);return(0,I.jsx)(V.span,{"data-state":u8(i.checked),"data-disabled":i.disabled?``:void 0,...r,ref:t})});c8.displayName=s8;var yue=`SwitchBubbleInput`,l8=_.forwardRef(({__scopeSwitch:e,control:t,checked:n,bubbles:r=!0,...i},a)=>{let o=_.useRef(null),s=P(o,a),c=eJ(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}})});l8.displayName=yue;function u8(e){return e?`checked`:`unchecked`}var d8=o8,bue=c8,f8=_.forwardRef(({className:e,...t},n)=>(0,I.jsx)(d8,{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)(bue,{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`)})}));f8.displayName=d8.displayName;var p8={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`},m8=()=>({id:`srv-${Date.now()}`,name:``,transport:`stdio`,authType:`none`}),xue=()=>{let{serverId:e}=Wd(),t=Ud(),{servers:n,setServers:r}=ov(),{source:i}=q_(),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??m8()),[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(m8()),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 $3({serverNames:[l.id],source:i,onServerStatus:e=>{let t=new Date().toLocaleTimeString(),n=typeof e.tokenExpiresInSeconds==`number`?` (valid ${d6(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=T6(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)($f,{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)($f,{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)(Dg,{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)(sv,{className:`flex-row items-center justify-between space-y-0`,children:[(0,I.jsx)(cv,{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]}),p8[l.transport]&&(0,I.jsxs)(`p`,{className:`rounded-md bg-muted px-3 py-2 text-xs text-muted-foreground`,children:[`Hint: `,p8[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)(sv,{children:(0,I.jsx)(cv,{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)(Tp,{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)(DY,{value:l.transport,onValueChange:e=>u(t=>({...t,transport:e})),children:[(0,I.jsx)(kY,{children:(0,I.jsx)(OY,{})}),(0,I.jsxs)(MY,{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)(Tp,{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)(Tp,{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)(Tp,{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)(DY,{value:l.authType||`none`,onValueChange:e=>D(e),children:[(0,I.jsx)(kY,{children:(0,I.jsx)(OY,{})}),(0,I.jsxs)(MY,{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.transport!==`stdio`&&(0,I.jsxs)(`div`,{className:`space-y-1.5`,children:[(0,I.jsx)(Q,{htmlFor:`server-inspectr-enabled`,children:`Inspect MCP requests with Inspectr`}),(0,I.jsxs)(`div`,{className:`flex items-center gap-3 rounded-md border px-3 py-2`,children:[(0,I.jsx)(`a`,{href:`https://inspectr.dev`,target:`_blank`,rel:`noreferrer`,"aria-label":`Inspectr`,className:`shrink-0`,children:(0,I.jsx)(Eg,{width:24,height:24,"aria-hidden":`true`})}),(0,I.jsxs)(`p`,{className:`min-w-0 flex-1 text-xs text-muted-foreground`,children:[`Route MCP traffic through a local Inspectr proxy for request tracing.`,` `,(0,I.jsxs)(`a`,{href:`https://inspectr.dev`,target:`_blank`,rel:`noreferrer`,"aria-label":`Learn more about Inspectr`,className:`underline-offset-4 hover:text-foreground hover:underline`,children:[`Learn more `,(0,I.jsx)(`span`,{"aria-hidden":`true`,children:`↗`})]})]}),(0,I.jsx)(f8,{id:`server-inspectr-enabled`,checked:!!l.inspectrEnabled,onCheckedChange:e=>u(t=>({...t,inspectrEnabled:e||void 0})),className:`shrink-0`})]})]})]}),l.authType===`bearer`&&(0,I.jsxs)(`div`,{className:`space-y-1.5`,children:[(0,I.jsx)(Q,{children:`Token`}),(0,I.jsx)(Tp,{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)(Tp,{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)(i8,{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)(Tp,{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)(i8,{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)(Tp,{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)(Tp,{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)(Tp,{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)(Y6,{open:d,onOpenChange:f,children:(0,I.jsxs)(Z6,{children:[(0,I.jsxs)(Q6,{children:[(0,I.jsx)(e8,{children:`Delete server?`}),(0,I.jsxs)(t8,{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)($6,{children:[(0,I.jsx)(r8,{children:`Cancel`}),(0,I.jsx)(n8,{onClick:()=>void j(),className:`bg-destructive text-destructive-foreground hover:bg-destructive/90`,children:`Delete`})]})]})})]})},Sue=({defaultType:e=`llm`})=>{let{agents:t,setAgents:n,reload:r,loading:i}=ov(),a=Ud(),[o]=ap(),[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)(LW,{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)(SX,{value:f,onValueChange:h,className:`space-y-4`,children:[(0,I.jsxs)(CX,{className:`grid w-full max-w-md grid-cols-2`,"aria-label":`Agent type`,children:[(0,I.jsxs)(wX,{value:`llm`,children:[`LLM (`,g.llm,`)`]}),(0,I.jsxs)(wX,{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)(dv,{children:[(0,I.jsx)(fv,{children:(0,I.jsxs)(hv,{children:[(0,I.jsx)(gv,{children:`Name`}),(0,I.jsx)(gv,{children:`Provider`}),f===`browser`?(0,I.jsxs)(I.Fragment,{children:[(0,I.jsx)(gv,{children:`URL`}),(0,I.jsx)(gv,{children:`Conversation`})]}):(0,I.jsxs)(I.Fragment,{children:[(0,I.jsx)(gv,{children:`Model`}),(0,I.jsx)(gv,{children:`Max Tokens`}),(0,I.jsx)(gv,{children:`Temperature`})]}),(0,I.jsx)(gv,{className:`text-right`,children:`Actions`})]})}),(0,I.jsx)(pv,{children:v.map(e=>(0,I.jsxs)(hv,{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)(kX,{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:E6(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)(Y6,{open:!!s,onOpenChange:e=>!e&&c(null),children:(0,I.jsxs)(Z6,{children:[(0,I.jsxs)(Q6,{children:[(0,I.jsx)(e8,{children:`Delete agent?`}),(0,I.jsxs)(t8,{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)($6,{children:[(0,I.jsx)(r8,{children:`Cancel`}),(0,I.jsx)(n8,{className:`bg-destructive text-destructive-foreground hover:bg-destructive/90`,onClick:()=>{s&&b(s)},children:`Delete Agent`})]})]})})]})},h8=[`PageUp`,`PageDown`],g8=[`ArrowUp`,`ArrowDown`,`ArrowLeft`,`ArrowRight`],_8={"from-left":[`Home`,`PageDown`,`ArrowDown`,`ArrowLeft`],"from-right":[`Home`,`PageDown`,`ArrowDown`,`ArrowRight`],"from-bottom":[`Home`,`PageDown`,`ArrowDown`,`ArrowLeft`],"from-top":[`Home`,`PageDown`,`ArrowUp`,`ArrowLeft`]},v8=`Slider`,[y8,Cue,wue]=oe(v8),[b8,Tue]=R(v8,[wue]),[Eue,x8]=b8(v8),S8=_.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`?Due:Oue,[b=[],x]=ze({prop:u,defaultProp:l,onChange:e=>{[...g.current][v.current]?.focus(),d(e)}}),S=_.useRef(b);function C(e){E(e,Nue(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=Lue(a),s=qq(Rue(Math.round((e-r)/a)*a+r,o),[r,i]);x((e=[])=>{let r=jue(e,s,t);if(Iue(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)(Eue,{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)(y8.Provider,{scope:e.__scopeSlider,children:(0,I.jsx)(y8.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=h8.includes(e.key)||e.shiftKey&&g8.includes(e.key)?10:1,r=v.current,i=b[r];E(i+a*n*t,r,{commit:!0})}}})})})})});S8.displayName=v8;var[C8,w8]=b8(v8,{startEdge:`left`,endEdge:`right`,size:`width`,direction:1}),Due=_.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=zW(i),g=h===`ltr`,v=g&&!a||!g&&a;function y(e){let t=m.current||d.getBoundingClientRect(),i=P8([0,t.width],v?[n,r]:[r,n]);return m.current=t,i(e-t.left)}return(0,I.jsx)(C8,{scope:e.__scopeSlider,startEdge:v?`left`:`right`,endEdge:v?`right`:`left`,direction:v?1:-1,size:`width`,children:(0,I.jsx)(T8,{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=_8[v?`from-left`:`from-right`].includes(e.key);l?.({event:e,direction:t?-1:1})}})})}),Oue=_.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=P8([0,t.height],p?[r,n]:[n,r]);return f.current=t,i(e-t.top)}return(0,I.jsx)(C8,{scope:e.__scopeSlider,startEdge:p?`bottom`:`top`,endEdge:p?`top`:`bottom`,size:`height`,direction:p?1:-1,children:(0,I.jsx)(T8,{"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=_8[p?`from-bottom`:`from-top`].includes(e.key);c?.({event:e,direction:t?-1:1})}})})}),T8=_.forwardRef((e,t)=>{let{__scopeSlider:n,onSlideStart:r,onSlideMove:i,onSlideEnd:a,onHomeKeyDown:o,onEndKeyDown:s,onStepKeyDown:c,...l}=e,u=x8(v8,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()):h8.concat(g8).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))})})}),E8=`SliderTrack`,D8=_.forwardRef((e,t)=>{let{__scopeSlider:n,...r}=e,i=x8(E8,n);return(0,I.jsx)(V.span,{"data-disabled":i.disabled?``:void 0,"data-orientation":i.orientation,...r,ref:t})});D8.displayName=E8;var O8=`SliderRange`,k8=_.forwardRef((e,t)=>{let{__scopeSlider:n,...r}=e,i=x8(O8,n),a=w8(O8,n),o=P(t,_.useRef(null)),s=i.values.length,c=i.values.map(e=>N8(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+`%`}})});k8.displayName=O8;var A8=`SliderThumb`,j8=_.forwardRef((e,t)=>{let n=Cue(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)(kue,{...e,ref:a,index:o})}),kue=_.forwardRef((e,t)=>{let{__scopeSlider:n,index:r,name:i,...a}=e,o=x8(A8,n),s=w8(A8,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:N8(p,o.min,o.max),h=Mue(r,o.values.length),g=f?.[s.size],v=g?Pue(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)(y8.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)(M8,{name:i??(o.name?o.name+(o.values.length>1?`[]`:``):void 0),form:o.form,value:p},r)]})});j8.displayName=A8;var Aue=`RadioBubbleInput`,M8=_.forwardRef(({__scopeSlider:e,value:t,...n},r)=>{let i=_.useRef(null),a=P(i,r),o=eJ(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})});M8.displayName=Aue;function jue(e=[],t,n){let r=[...e];return r[n]=t,r.sort((e,t)=>e-t)}function N8(e,t,n){return qq(100/(n-t)*(e-t),[0,100])}function Mue(e,t){if(t>2)return`Value ${e+1} of ${t}`;if(t===2)return[`Minimum`,`Maximum`][e]}function Nue(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 Pue(e,t,n){let r=e/2;return(r-P8([0,50],[0,r])(t)*n)*n}function Fue(e){return e.slice(0,-1).map((t,n)=>e[n+1]-t)}function Iue(e,t){if(t>0){let n=Fue(e);return Math.min(...n)>=t}return!0}function P8(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 Lue(e){return(String(e).split(`.`)[1]||``).length}function Rue(e,t){let n=10**t;return Math.round(e*n)/n}var F8=S8,zue=D8,Bue=k8,Vue=j8,I8=_.forwardRef(({className:e,...t},n)=>(0,I.jsxs)(F8,{ref:n,className:U(`relative flex w-full touch-none select-none items-center`,e),...t,children:[(0,I.jsx)(zue,{className:`relative h-2 w-full grow overflow-hidden rounded-full bg-secondary`,children:(0,I.jsx)(Bue,{className:`absolute h-full bg-primary`})}),(0,I.jsx)(Vue,{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`})]}));I8.displayName=F8.displayName;function Hue(e){let t=Uue(e),n=_.forwardRef((e,n)=>{let{children:r,...i}=e,a=_.Children.toArray(r),o=a.find(Gue);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 Uue(e){let t=_.forwardRef((e,t)=>{let{children:n,...r}=e;if(_.isValidElement(n)){let e=que(n),i=Kue(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 Wue=Symbol(`radix.slottable`);function Gue(e){return _.isValidElement(e)&&typeof e.type==`function`&&`__radixId`in e.type&&e.type.__radixId===Wue}function Kue(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 que(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 L8=`Popover`,[R8,Jue]=R(L8,[lc]),z8=lc(),[Yue,B8]=R8(L8),V8=e=>{let{__scopePopover:t,children:n,open:r,defaultOpen:i,onOpenChange:a,modal:o=!1}=e,s=z8(t),c=_.useRef(null),[l,u]=_.useState(!1),[d,f]=ze({prop:r,defaultProp:i??!1,onChange:a,caller:L8});return(0,I.jsx)(Tc,{...s,children:(0,I.jsx)(Yue,{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})})};V8.displayName=L8;var H8=`PopoverAnchor`,Xue=_.forwardRef((e,t)=>{let{__scopePopover:n,...r}=e,i=B8(H8,n),a=z8(n),{onCustomAnchorAdd:o,onCustomAnchorRemove:s}=i;return _.useEffect(()=>(o(),()=>s()),[o,s]),(0,I.jsx)(Ec,{...a,...r,ref:t})});Xue.displayName=H8;var U8=`PopoverTrigger`,W8=_.forwardRef((e,t)=>{let{__scopePopover:n,...r}=e,i=B8(U8,n),a=z8(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":Z8(i.open),...r,ref:o,onClick:j(e.onClick,i.onOpenToggle)});return i.hasCustomAnchor?s:(0,I.jsx)(Ec,{asChild:!0,...a,children:s})});W8.displayName=U8;var G8=`PopoverPortal`,[Zue,Que]=R8(G8,{forceMount:void 0}),K8=e=>{let{__scopePopover:t,forceMount:n,children:r,container:i}=e,a=B8(G8,t);return(0,I.jsx)(Zue,{scope:t,forceMount:n,children:(0,I.jsx)(Pe,{present:n||a.open,children:(0,I.jsx)(Me,{asChild:!0,container:i,children:r})})})};K8.displayName=G8;var q8=`PopoverContent`,J8=_.forwardRef((e,t)=>{let n=Que(q8,e.__scopePopover),{forceMount:r=n.forceMount,...i}=e,a=B8(q8,e.__scopePopover);return(0,I.jsx)(Pe,{present:r||a.open,children:a.modal?(0,I.jsx)(ede,{...i,ref:t}):(0,I.jsx)(tde,{...i,ref:t})})});J8.displayName=q8;var $ue=Hue(`PopoverContent.RemoveScroll`),ede=_.forwardRef((e,t)=>{let n=B8(q8,e.__scopePopover),r=_.useRef(null),i=P(t,r),a=_.useRef(!1);return _.useEffect(()=>{let e=r.current;if(e)return Zm(e)},[]),(0,I.jsx)(Hm,{as:$ue,allowPinchZoom:!0,children:(0,I.jsx)(Y8,{...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})})})}),tde=_.forwardRef((e,t)=>{let n=B8(q8,e.__scopePopover),r=_.useRef(!1),i=_.useRef(!1);return(0,I.jsx)(Y8,{...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()}})}),Y8=_.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=B8(q8,n),p=z8(n);return qp(),(0,I.jsx)(Rp,{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":Z8(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)`}})})})}),X8=`PopoverClose`,nde=_.forwardRef((e,t)=>{let{__scopePopover:n,...r}=e,i=B8(X8,n);return(0,I.jsx)(V.button,{type:`button`,...r,ref:t,onClick:j(e.onClick,()=>i.onOpenChange(!1))})});nde.displayName=X8;var rde=`PopoverArrow`,ide=_.forwardRef((e,t)=>{let{__scopePopover:n,...r}=e,i=z8(n);return(0,I.jsx)(Oc,{...i,...r,ref:t})});ide.displayName=rde;function Z8(e){return e?`open`:`closed`}var ade=V8,ode=W8,sde=K8,Q8=J8,$8=ade,e5=ode,t5=_.forwardRef(({className:e,align:t=`center`,sideOffset:n=4,...r},i)=>(0,I.jsx)(sde,{children:(0,I.jsx)(Q8,{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})}));t5.displayName=Q8.displayName;var n5=1,cde=.9,lde=.8,ude=.17,r5=.1,i5=.999,dde=.9999,fde=.99,pde=/[\\\/_+.#"@\[\(\{&]/,mde=/[\\\/_+.#"@\[\(\{&]/g,hde=/[\s-]/,a5=/[\s-]/g;function o5(e,t,n,r,i,a,o){if(a===t.length)return i===e.length?n5:fde;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=o5(e,t,n,r,l+1,a+1,o),d>u&&(l===i?d*=n5:pde.test(e.charAt(l-1))?(d*=lde,p=e.slice(i,l-1).match(mde),p&&i>0&&(d*=i5**+p.length)):hde.test(e.charAt(l-1))?(d*=cde,m=e.slice(i,l-1).match(a5),m&&i>0&&(d*=i5**+m.length)):(d*=ude,i>0&&(d*=i5**+(l-i))),e.charAt(l)!==t.charAt(a)&&(d*=dde)),(d<r5&&n.charAt(l-1)===r.charAt(a+1)||r.charAt(a+1)===r.charAt(a)&&n.charAt(l-1)!==r.charAt(a))&&(f=o5(e,t,n,r,l+1,a+2,o),f*r5>d&&(d=f*r5)),d>u&&(u=d),l=n.indexOf(c,l+1);return o[s]=u,u}function s5(e){return e.toLowerCase().replace(a5,` `)}function gde(e,t,n){return e=n&&n.length>0?`${e+` `+n.join(` `)}`:e,o5(e,t,s5(e),s5(t),0,0,{})}var c5=`[cmdk-group=""]`,l5=`[cmdk-group-items=""]`,_de=`[cmdk-group-heading=""]`,u5=`[cmdk-item=""]`,d5=`${u5}:not([aria-disabled="true"])`,f5=`cmdk-item-select`,p5=`data-value`,vde=(e,t,n)=>gde(e,t,n),m5=_.createContext(void 0),h5=()=>_.useContext(m5),g5=_.createContext(void 0),_5=()=>_.useContext(g5),v5=_.createContext(void 0),y5=_.forwardRef((e,t)=>{let n=C5(()=>({search:``,value:e.value??e.defaultValue??``,selectedItemId:void 0,filtered:{count:0,items:new Map,groups:new Set}})),r=C5(()=>new Set),i=C5(()=>new Map),a=C5(()=>new Map),o=C5(()=>new Set),s=x5(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=kde();S5(()=>{if(u!==void 0){let e=u.trim();n.current.value=e,w.emit()}},[u]),S5(()=>{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??vde;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(l5);t?t.appendChild(e.parentElement===t?e:e.closest(`${l5} > *`)):r.appendChild(e.parentElement===r?e:e.closest(`${l5} > *`))}),t.sort((e,t)=>t[1]-e[1]).forEach(e=>{let t=S.current?.querySelector(`${c5}[${p5}="${encodeURIComponent(e[0])}"]`);t?.parentElement.appendChild(t)})}function O(){let e=M().find(e=>e.getAttribute(`aria-disabled`)!==`true`)?.getAttribute(p5);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(c5)?.querySelector(_de))==null||e.scrollIntoView({block:`nearest`})),t.scrollIntoView({block:`nearest`}))}function j(){return S.current?.querySelector(`${u5}[aria-selected="true"]`)}function M(){return Array.from(S.current?.querySelectorAll(d5)||[])}function N(e){let t=M()[e];t&&w.setState(`value`,t.getAttribute(p5))}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(p5))}function F(e){let t=j()?.closest(c5),n;for(;t&&!n;)t=e>0?Dde(t,c5):Ode(t,c5),n=t?.querySelector(d5);n?w.setState(`value`,n.getAttribute(p5)):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(f5);t.dispatchEvent(e)}}}}},_.createElement(`label`,{"cmdk-label":``,htmlFor:T.inputId,id:T.labelId,style:jde},c),E5(e,e=>_.createElement(g5.Provider,{value:w},_.createElement(m5.Provider,{value:T},e))))}),yde=_.forwardRef((e,t)=>{let n=Ra(),r=_.useRef(null),i=_.useContext(v5),a=h5(),o=x5(e),s=o.current?.forceMount??i?.forceMount;S5(()=>{if(!s)return a.item(n,i?.id)},[s]);let c=T5(n,r,[e.value,e.children,r],e.keywords),l=_5(),u=w5(e=>e.value&&e.value===c.current),d=w5(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(f5,f),()=>t.removeEventListener(f5,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)}),bde=_.forwardRef((e,t)=>{let{heading:n,children:r,forceMount:i,...a}=e,o=Ra(),s=_.useRef(null),c=_.useRef(null),l=Ra(),u=h5(),d=w5(e=>i||u.filter()===!1?!0:!e.search||e.filtered.groups.has(o));S5(()=>u.group(o),[]),T5(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),E5(e,e=>_.createElement(`div`,{"cmdk-group-items":``,role:`group`,"aria-labelledby":n?l:void 0},_.createElement(v5.Provider,{value:f},e))))}),xde=_.forwardRef((e,t)=>{let{alwaysRender:n,...r}=e,i=_.useRef(null),a=w5(e=>!e.search);return!n&&!a?null:_.createElement(V.div,{ref:N(i,t),...r,"cmdk-separator":``,role:`separator`})}),Sde=_.forwardRef((e,t)=>{let{onValueChange:n,...r}=e,i=e.value!=null,a=_5(),o=w5(e=>e.search),s=w5(e=>e.selectedItemId),c=h5();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)}})}),Cde=_.forwardRef((e,t)=>{let{children:n,label:r=`Suggestions`,...i}=e,a=_.useRef(null),o=_.useRef(null),s=w5(e=>e.selectedItemId),c=h5();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},E5(e,e=>_.createElement(`div`,{ref:N(o,c.listInnerRef),"cmdk-list-sizer":``},e)))}),wde=_.forwardRef((e,t)=>{let{open:n,onOpenChange:r,overlayClassName:i,contentClassName:a,container:o,...s}=e;return _.createElement(Ah,{open:n,onOpenChange:r},_.createElement(Mh,{container:o},_.createElement(Nh,{"cmdk-overlay":``,className:i}),_.createElement(Ph,{"aria-label":e.label,"cmdk-dialog":``,className:a},_.createElement(y5,{ref:t,...s}))))}),Tde=_.forwardRef((e,t)=>w5(e=>e.filtered.count===0)?_.createElement(V.div,{ref:t,...e,"cmdk-empty":``,role:`presentation`}):null),Ede=_.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},E5(e,e=>_.createElement(`div`,{"aria-hidden":!0},e)))}),b5=Object.assign(y5,{List:Cde,Item:yde,Input:Sde,Group:bde,Separator:xde,Dialog:wde,Empty:Tde,Loading:Ede});function Dde(e,t){let n=e.nextElementSibling;for(;n;){if(n.matches(t))return n;n=n.nextElementSibling}}function Ode(e,t){let n=e.previousElementSibling;for(;n;){if(n.matches(t))return n;n=n.previousElementSibling}}function x5(e){let t=_.useRef(e);return S5(()=>{t.current=e}),t}var S5=typeof window>`u`?_.useEffect:_.useLayoutEffect;function C5(e){let t=_.useRef();return t.current===void 0&&(t.current=e()),t}function w5(e){let t=_5(),n=()=>e(t.snapshot());return _.useSyncExternalStore(t.subscribe,n,n)}function T5(e,t,n,r=[]){let i=_.useRef(),a=h5();return S5(()=>{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(p5,s),i.current=s}),i}var kde=()=>{let[e,t]=_.useState(),n=C5(()=>new Map);return S5(()=>{n.current.forEach(e=>e()),n.current=new Map},[e]),(e,r)=>{n.current.set(e,r),t({})}};function Ade(e){let t=e.type;return typeof t==`function`?t(e.props):`render`in t?t.render(e.props):e}function E5({asChild:e,children:t},n){return e&&_.isValidElement(t)?_.cloneElement(Ade(t),{ref:t.ref},n(t.props.children)):n(t)}var jde={position:`absolute`,width:`1px`,height:`1px`,padding:`0`,margin:`-1px`,overflow:`hidden`,clip:`rect(0, 0, 0, 0)`,whiteSpace:`nowrap`,borderWidth:`0`},D5=_.forwardRef(({className:e,...t},n)=>(0,I.jsx)(b5,{ref:n,className:U(`flex h-full w-full flex-col overflow-hidden rounded-md bg-popover text-popover-foreground`,e),...t}));D5.displayName=b5.displayName;var O5=_.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)(b5.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})]}));O5.displayName=b5.Input.displayName;var k5=_.forwardRef(({className:e,...t},n)=>(0,I.jsx)(b5.List,{ref:n,className:U(`max-h-[300px] overflow-y-auto overflow-x-hidden`,e),...t}));k5.displayName=b5.List.displayName;var A5=_.forwardRef((e,t)=>(0,I.jsx)(b5.Empty,{ref:t,className:`py-6 text-center text-sm`,...e}));A5.displayName=b5.Empty.displayName;var j5=_.forwardRef(({className:e,...t},n)=>(0,I.jsx)(b5.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}));j5.displayName=b5.Group.displayName;var Mde=_.forwardRef(({className:e,...t},n)=>(0,I.jsx)(b5.Separator,{ref:n,className:U(`-mx-1 h-px bg-border`,e),...t}));Mde.displayName=b5.Separator.displayName;var M5=_.forwardRef(({className:e,...t},n)=>(0,I.jsx)(b5.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}));M5.displayName=b5.Item.displayName;function Nde(){let{source:e}=q_(),[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 N5={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:[]},P5={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.`},Pde=()=>{let{agentName:e}=Wd(),[t]=ap(),n=Ud(),{agents:r,setAgents:i,browserProviders:a}=ov(),{source:o}=q_(),s=Nde(),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??D6(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(D6(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([...N5[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)($f,{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)($f,{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)(sv,{className:`flex-row items-center justify-between space-y-0`,children:[(0,I.jsx)(cv,{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:DX(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]}),P5[f.provider]&&(0,I.jsxs)(`p`,{className:`rounded-md bg-muted px-3 py-2 text-xs text-muted-foreground`,children:[`Hint: `,P5[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)(sv,{children:(0,I.jsx)(cv,{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)(Tp,{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)(DY,{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)(kY,{children:(0,I.jsx)(OY,{})}),(0,I.jsxs)(MY,{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)(DY,{value:f.provider,onValueChange:e=>p(t=>t.type===`browser`?{...t,provider:e}:{...t,provider:e,model:N5[e]?.[0]||``}),children:[(0,I.jsx)(kY,{id:`agent-provider`,children:(0,I.jsx)(OY,{})}),(0,I.jsx)(MY,{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)(DY,{value:f.newConversationBetweenScenarios===!1?`same`:`new`,onValueChange:e=>p(t=>t.type===`browser`?{...t,newConversationBetweenScenarios:e!==`same`}:t),children:[(0,I.jsx)(kY,{id:`agent-conversation-behavior`,children:(0,I.jsx)(OY,{})}),(0,I.jsxs)(MY,{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)(Tp,{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)(Tp,{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)($8,{open:D,onOpenChange:k,children:[(0,I.jsx)(e5,{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)(t5,{className:`w-[420px] p-0`,align:`start`,children:(0,I.jsxs)(D5,{children:[(0,I.jsx)(O5,{placeholder:`Search ${L?`deployments`:`models`}...`}),(0,I.jsxs)(k5,{id:`agent-model-command-list`,children:[(0,I.jsxs)(A5,{children:[`No `,L?`deployments`:`models`,` found.`]}),(0,I.jsxs)(j5,{heading:L?`Deployments`:`Models`,children:[z.map(e=>(0,I.jsxs)(M5,{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)(M5,{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)(Tp,{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)(Tp,{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)(Tp,{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:E6(f.temperature).toFixed(2)})]}),(0,I.jsx)(I8,{value:[E6(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)(rX,{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)(Y6,{open:m,onOpenChange:h,children:(0,I.jsxs)(Z6,{children:[(0,I.jsxs)(Q6,{children:[(0,I.jsx)(e8,{children:`Delete agent?`}),(0,I.jsxs)(t8,{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)($6,{children:[(0,I.jsx)(r8,{children:`Cancel`}),(0,I.jsx)(n8,{onClick:()=>void ae(),className:`bg-destructive text-destructive-foreground hover:bg-destructive/90`,children:`Delete`})]})]})})]})},F5=`mcplab.resultAssistantScenarioHandoff`,I5=()=>{let{testCaseId:e}=Wd(),[t,n]=ap(),r=Ud(),{source:i}=q_(),{scenarios:a,setScenarios:o,agents:s,servers:c,reload:l,loading:u}=ov(),[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(F5);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(F5);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)($f,{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)(Tp,{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)(DY,{value:p,onValueChange:m,children:[(0,I.jsx)(kY,{className:`h-8 text-xs`,children:(0,I.jsx)(OY,{})}),(0,I.jsxs)(MY,{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)(DY,{value:h,onValueChange:e=>g(e),children:[(0,I.jsx)(kY,{className:`h-8 text-xs`,children:(0,I.jsx)(OY,{})}),(0,I.jsxs)(MY,{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)(DY,{value:v,onValueChange:e=>y(e),children:[(0,I.jsx)(kY,{className:`h-8 w-28 text-xs`,children:(0,I.jsx)(OY,{})}),(0,I.jsxs)(MY,{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)($f,{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)($f,{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)(sv,{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)(cv,{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)(S6,{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)(Y6,{open:!!N,onOpenChange:e=>!e&&P(null),children:(0,I.jsxs)(Z6,{children:[(0,I.jsxs)(Q6,{children:[(0,I.jsx)(e8,{children:`Delete test case?`}),(0,I.jsxs)(t8,{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)($6,{children:[(0,I.jsx)(r8,{children:`Cancel`}),(0,I.jsx)(n8,{className:`bg-destructive text-destructive-foreground hover:bg-destructive/90`,onClick:()=>{N&&(fe(N),P(null))},children:`Delete Test Case`})]})]})})]})},Fde=({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}=q_(),[f,p]=(0,_.useState)(``),[m,h]=(0,_.useState)(``),[g,v]=(0,_.useState)(!1),[y,b]=(0,_.useState)(qg.baseUrl),[x,S]=(0,_.useState)(String(qg.passThreshold)),[C,w]=(0,_.useState)(String(qg.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?Yg(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(Jg(e)),h(e?.model??``),b(e?.baseUrl??qg.baseUrl),S(String(e?.passThreshold??qg.passThreshold)),w(String(e?.failThreshold??qg.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 Yg({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(),Jg(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)(sv,{className:`pb-3`,children:[(0,I.jsxs)(`div`,{className:`flex items-center justify-between gap-4`,children:[(0,I.jsx)(cv,{className:`text-base`,children:`Decision Engine`}),(0,I.jsx)(f8,{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)(lv,{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)(DY,{value:f||`__none__`,disabled:a||i,onValueChange:e=>{let t=e===`__none__`?``:e;p(t),t?f||v(!0):v(!1),h(t?Kg[t].defaultModel:``),c(``)},children:[(0,I.jsx)(kY,{id:`decision-provider`,className:`h-9 text-sm`,children:(0,I.jsx)(OY,{})}),(0,I.jsxs)(MY,{children:[(0,I.jsx)(Z,{value:`__none__`,children:`None`}),Object.entries(Kg).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:Kg[f].modelLabel}),!Kg[f].editableModel&&Kg[f].models.length>1?(0,I.jsxs)(DY,{value:m,onValueChange:h,disabled:a||i,children:[(0,I.jsx)(kY,{id:`decision-model`,className:`h-9 text-sm`,children:(0,I.jsx)(OY,{})}),(0,I.jsx)(MY,{children:Kg[f].models.map(e=>(0,I.jsx)(Z,{value:e,children:e},e))})]}):(0,I.jsx)(Tp,{id:`decision-model`,className:`h-9 text-sm`,value:m,onChange:e=>h(e.target.value),disabled:a||i,readOnly:!Kg[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:Kg[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:Kg[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)(Tp,{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)(Tp,{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)(Tp,{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`})]})]})]})},Ide=()=>{let{source:e}=q_(),{agents:t,reload:n,loading:r}=ov(),[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&&Jg(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)(sv,{className:`pb-3`,children:[(0,I.jsx)(cv,{className:`text-base`,children:`Assistant Defaults`}),(0,I.jsx)(lv,{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)(DY,{value:S||`__none__`,onValueChange:e=>void w(e===`__none__`?``:e),disabled:o,children:[(0,I.jsx)(kY,{className:`h-9 text-sm`,children:(0,I.jsx)(OY,{placeholder:`Select assistant agent`})}),(0,I.jsxs)(MY,{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)(sv,{className:`pb-3`,children:[(0,I.jsx)(cv,{className:`text-base`,children:`Evaluation Judge`}),(0,I.jsx)(lv,{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)(DY,{value:u||`__none__`,onValueChange:e=>void E(e===`__none__`?``:e),disabled:o,children:[(0,I.jsx)(kY,{id:`evaluation-judge`,className:`h-9 text-sm`,children:(0,I.jsx)(OY,{placeholder:`Select evaluation judge`})}),(0,I.jsxs)(MY,{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)(Fde,{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)(sv,{className:`pb-3`,children:[(0,I.jsx)(cv,{className:`text-base`,children:`Evaluation Queue`}),(0,I.jsx)(lv,{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)(DY,{value:f,onValueChange:e=>void T(e),disabled:o,children:[(0,I.jsx)(kY,{id:`evaluation-workers`,className:`h-9 text-sm`,children:(0,I.jsx)(OY,{placeholder:`Select worker count`})}),(0,I.jsx)(MY,{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`})]})]})]})},Lde=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`}}),L5=_.forwardRef(({className:e,variant:t,...n},r)=>(0,I.jsx)(`div`,{ref:r,role:`alert`,className:U(Lde({variant:t}),e),...n}));L5.displayName=`Alert`;var R5=_.forwardRef(({className:e,...t},n)=>(0,I.jsx)(`h5`,{ref:n,className:U(`mb-1 font-medium leading-none tracking-tight`,e),...t}));R5.displayName=`AlertTitle`;var z5=_.forwardRef(({className:e,...t},n)=>(0,I.jsx)(`div`,{ref:n,className:U(`text-sm [&_p]:leading-relaxed`,e),...t}));z5.displayName=`AlertDescription`;var Rde=`http://127.0.0.1:3011/mcp`;function zde(e){return navigator.clipboard.writeText(e)}function B5({text:e,label:t}){let[n,r]=(0,_.useState)(!1),i=async()=>{try{await zde(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 V5({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)(B5,{text:n,label:e})]})})}function H5({title:e,description:t,code:n,iconSrc:r}){return(0,I.jsxs)(K,{children:[(0,I.jsxs)(sv,{className:`pb-3`,children:[(0,I.jsxs)(cv,{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)(lv,{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)(B5,{text:n,label:e})})]})]})}var Bde=()=>{let{source:e}=q_(),[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??Rde,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)(L5,{children:[(0,I.jsx)(Ln,{className:`h-4 w-4`}),(0,I.jsx)(R5,{children:`MCP server not reported`}),(0,I.jsx)(z5,{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)(sv,{className:`pb-3`,children:[(0,I.jsx)(cv,{className:`text-base`,children:`Connection Details`}),(0,I.jsx)(lv,{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)(V5,{label:`Direct MCP URL`,value:s,copyText:s}),(0,I.jsx)(V5,{label:`Transport`,value:c}),(0,I.jsx)(V5,{label:`Authentication`,value:`none`})]})})]}),(0,I.jsxs)(`div`,{className:`space-y-6`,children:[(0,I.jsx)(H5,{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)(H5,{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 Vde(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,Hde(i,...t)]}function Hde(...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 U5=[`a`,`button`,`div`,`form`,`h2`,`h3`,`img`,`input`,`label`,`li`,`nav`,`ol`,`p`,`select`,`span`,`svg`,`ul`].reduce((e,t)=>{let n=hp(`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}},{}),W5=`Progress`,G5=100,[Ude,Wde]=Vde(W5),[Gde,Kde]=Ude(W5),K5=_.forwardRef((e,t)=>{let{__scopeProgress:n,value:r=null,max:i,getValueLabel:a=qde,...o}=e;(i||i===0)&&!Z5(i)&&console.error(Jde(`${i}`,`Progress`));let s=Z5(i)?i:G5;r!==null&&!Q5(r,s)&&console.error(Yde(`${r}`,`Progress`));let c=Q5(r,s)?r:null,l=X5(c)?a(c,s):void 0;return(0,I.jsx)(Gde,{scope:n,value:c,max:s,children:(0,I.jsx)(U5.div,{"aria-valuemax":s,"aria-valuemin":0,"aria-valuenow":X5(c)?c:void 0,"aria-valuetext":l,role:`progressbar`,"data-state":Y5(c,s),"data-value":c??void 0,"data-max":s,...o,ref:t})})});K5.displayName=W5;var q5=`ProgressIndicator`,J5=_.forwardRef((e,t)=>{let{__scopeProgress:n,...r}=e,i=Kde(q5,n);return(0,I.jsx)(U5.div,{"data-state":Y5(i.value,i.max),"data-value":i.value??void 0,"data-max":i.max,...r,ref:t})});J5.displayName=q5;function qde(e,t){return`${Math.round(e/t*100)}%`}function Y5(e,t){return e==null?`indeterminate`:e===t?`complete`:`loading`}function X5(e){return typeof e==`number`}function Z5(e){return X5(e)&&!isNaN(e)&&e>0}function Q5(e,t){return X5(e)&&!isNaN(e)&&e<=t&&e>=0}function Jde(e,t){return`Invalid prop \`max\` of value \`${e}\` supplied to \`${t}\`. Only numbers greater than 0 are valid max values. Defaulting to \`${G5}\`.`}function Yde(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 ${G5} if no \`max\` prop is set)
160
+ - \`null\` or \`undefined\` if the progress is indeterminate.
161
+
162
+ Defaulting to \`null\`.`}var $5=K5,Xde=J5,e7=_.forwardRef(({className:e,value:t,...n},r)=>(0,I.jsx)($5,{ref:r,className:U(`relative h-4 w-full overflow-hidden rounded-full bg-secondary`,e),...n,children:(0,I.jsx)(Xde,{className:`h-full w-full flex-1 bg-primary transition-all`,style:{transform:`translateX(-${100-(t||0)}%)`}})}));e7.displayName=$5.displayName;function t7(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 n7(e){try{return JSON.stringify(e,null,2)}catch{return`[schema not serializable]`}}function Zde(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 r7(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+r7(t,r),0):0,o=r7(n.items,r),s=[...Array.isArray(n.oneOf)?n.oneOf:[],...Array.isArray(n.anyOf)?n.anyOf:[]].reduce((e,t)=>e+r7(t,r),0);return(i?Object.keys(i).length:0)+a+o+s}function i7({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:Zde(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: `,n7(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)(i7,{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)(i7,{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)(i7,{name:`variant ${t+1}`,schema:e,depth:r+1,seen:l,expandAll:a},t))]})]})]})}function a7({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 o7({title:e,schema:t,explorerControls:n}){let r=e.toLowerCase(),i=async()=>{try{await navigator.clipboard.writeText(n7(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 s7({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)(o7,{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:n7(e)})]}),t!==void 0&&(0,I.jsxs)(`div`,{className:`space-y-1`,children:[(0,I.jsx)(o7,{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:n7(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)(o7,{title:`Input schema`,schema:e,explorerControls:(0,I.jsx)(a7,{propertyCount:r7(e),onExpandAll:()=>s(!0),onCollapseAll:()=>s(!1)})}),(0,I.jsx)(i7,{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)(o7,{title:`Output schema`,schema:t,explorerControls:(0,I.jsx)(a7,{propertyCount:r7(t),onExpandAll:()=>l(!0),onCollapseAll:()=>l(!1)})}),(0,I.jsx)(i7,{name:`root`,schema:t,expandAll:c})]})]})]})]})}function c7(e,t){let n=t??(typeof navigator<`u`?navigator.language:void 0);return e.toLocaleString(n)}function Qde(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 l7({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:[`~`,c7(e),`tok`]}):null}var u7=[`critical`,`high`,`medium`,`low`,`info`];function d7(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 $de(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 f7(e){return e.toLowerCase().replace(/[^a-z0-9]+/g,`-`).replace(/^-+|-+$/g,``)||`tool`}async function p7(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 m7({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 efe({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 h7(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 g7({report:e,schemaMode:t,onSchemaModeChange:n}){let[r,i]=ap(),[a,o]=(0,_.useState)([...u7]),[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?[...u7]: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-${f7(`${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(u7)),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)(sv,{className:`pb-3`,children:[(0,I.jsx)(cv,{className:`text-base`,children:`Analysis Overview`}),(0,I.jsx)(lv,{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:[u7.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?d7(t):$de(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([...u7]),className:`h-7 px-2 text-xs`,children:`Reset`})]})})]}),(0,I.jsxs)(`div`,{className:`space-y-0`,children:[(0,I.jsx)(SX,{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)(CX,{className:`h-auto justify-start rounded-none bg-transparent p-0`,children:[(0,I.jsx)(wX,{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)(wX,{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)($8,{open:d,onOpenChange:f,children:[(0,I.jsx)(e5,{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)(t5,{className:`w-[320px] p-0`,align:`end`,children:(0,I.jsxs)(D5,{children:[(0,I.jsx)(O5,{placeholder:`Search tools...`}),(0,I.jsxs)(k5,{id:`tool-filter-command-list`,children:[(0,I.jsx)(A5,{children:`No tools found.`}),(0,I.jsxs)(j5,{children:[(0,I.jsx)(M5,{value:`all tools`,onSelect:()=>{u(``),f(!1)},children:`All tools`}),T.map(e=>(0,I.jsx)(M5,{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:u7.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)(sv,{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)(cv,{className:`text-base capitalize`,children:e}),(0,I.jsxs)(lv,{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] ${d7(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)(m7,{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===u7.length:r.some(e=>x.has(e.severity))});return n.length===0?null:(0,I.jsxs)(K,{children:[(0,I.jsxs)(sv,{className:`pb-3`,children:[(0,I.jsxs)(cv,{className:`flex items-center gap-2 text-base`,children:[e.serverName,(0,I.jsx)(l7,{total:t?.total,title:`Estimated tokens for the analyzed tool definitions and their schemas`})]}),(0,I.jsxs)(lv,{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)(L5,{children:[(0,I.jsx)(R5,{children:`Warnings`}),(0,I.jsx)(z5,{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=t7(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-${f7(`${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)(efe,{label:o,reason:n.classificationReason,variantClassName:s}),(0,I.jsx)(l7,{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 p7(`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 p7(`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 p7(`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)(s7,{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] ${d7(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)(m7,{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] ${d7(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)(m7,{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 _7(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 tfe(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 v7(e){return e.trim().toLowerCase().replace(/[^a-z0-9._-]+/g,`-`).replace(/-+/g,`-`).replace(/^-+|-+$/g,``)}function nfe(e,t){let n=[`tool-info`,v7(e)],r=t?.trim();return r&&n.push(`v${v7(r)}`),`${n.filter(Boolean).join(`-`)}.json`}function rfe(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 y7=`mcplab.toolAnalysis.activeJobId`;function b7(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 ife(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 x7({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 afe(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 ofe({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 sfe=()=>{let e=e=>`tool-analysis-${Date.now()}.${e}`,{source:t}=q_(),{servers:n,agents:r,loading:i,reload:a}=ov(),[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)(()=>rfe(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(y7)}catch{}},fe=e=>{try{sessionStorage.setItem(y7,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(y7)??``}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 $3({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)(()=>Qde(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 $3({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=tfe({serverName:t.serverName,tools:t.tools,selectedToolNames:m[t.serverName]});b7(nfe(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)(sv,{children:[(0,I.jsx)(cv,{className:`text-base`,children:`Run MCP analysis`}),(0,I.jsx)(lv,{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)(L5,{children:[(0,I.jsx)(R5,{children:`No assistant agent available`}),(0,I.jsxs)(z5,{children:[`Add a library agent in`,` `,(0,I.jsx)($f,{to:`/libraries/agents`,className:`underline`,children:`Agents`}),` `,`and optionally set the default Assistant Agent in`,` `,(0,I.jsx)($f,{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)(GX,{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)(Tp,{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)(l7,{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 ife(`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:afe(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=t7(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)(GX,{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)(ofe,{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)(l7,{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)(s7,{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: ~${c7(_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)(GX,{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)(x7,{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)(GX,{checked:x,onCheckedChange:e=>S(!!e)}),(0,I.jsxs)(`span`,{className:`inline-flex items-center gap-1.5`,children:[`Deeper analysis`,(0,I.jsx)(x7,{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)(Tp,{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)(Tp,{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)(Tp,{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)(sv,{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)(cv,{className:`flex items-center gap-2 text-base`,children:(0,I.jsx)(`span`,{children:`Progress`})}),(0,I.jsx)(lv,{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)(e7,{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)($f,{to:`/tool-analysis-results/${L}`,children:`Open result details`})}),(0,I.jsx)(W,{asChild:!0,size:`sm`,variant:`outline`,children:(0,I.jsx)($f,{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)($f,{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)($f,{to:`/tool-analysis-results`,children:`View all reports`})})]}),(0,I.jsxs)(W,{type:`button`,size:`sm`,variant:`outline`,onClick:()=>b7(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:()=>b7(e(`md`),h7(P),`text/markdown`),children:[(0,I.jsx)(yn,{className:`mr-2 h-4 w-4`}),`Export Markdown`]})]})]}),(0,I.jsx)(g7,{report:P,schemaMode:re,onSchemaModeChange:ie})]})]})};function S7({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 C7(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 w7(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 cfe(){let{source:e}=q_(),[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=C7(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`?w7(`${t}.json`,`${JSON.stringify(r,null,2)}\n`,`application/json`):n===`tool_schemas`?w7(`${t}-tool-schemas.json`,`${JSON.stringify(_7(r),null,2)}\n`,`application/json`):w7(`${t}.md`,h7(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)($8,{open:d,onOpenChange:f,children:[(0,I.jsx)(e5,{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)(t5,{className:`w-[240px] p-0`,align:`start`,children:(0,I.jsxs)(D5,{children:[(0,I.jsx)(O5,{placeholder:`Search MCP servers...`}),(0,I.jsxs)(k5,{id:`tool-analysis-server-command-list`,children:[(0,I.jsx)(A5,{children:`No servers found.`}),(0,I.jsxs)(j5,{children:[(0,I.jsx)(M5,{value:`all servers`,onSelect:()=>{u(`all`),f(!1)},children:`All servers`}),p.map(e=>(0,I.jsx)(M5,{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)($f,{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)(dv,{children:[(0,I.jsx)(fv,{children:(0,I.jsxs)(hv,{children:[(0,I.jsx)(gv,{children:`Report ID`}),(0,I.jsx)(gv,{children:`Evaluated`}),(0,I.jsx)(gv,{children:`Timestamp`}),(0,I.jsx)(gv,{children:`Issues`}),(0,I.jsx)(gv,{children:`Modes`}),(0,I.jsx)(gv,{className:`w-10`})]})}),(0,I.jsx)(pv,{children:t.map(e=>(0,I.jsxs)(hv,{children:[(0,I.jsx)(J,{children:(0,I.jsxs)(`div`,{className:`space-y-1`,children:[(0,I.jsx)($f,{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)(S7,{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)(Lq,{children:[(0,I.jsx)(Rq,{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)(Vq,{align:`end`,children:[(0,I.jsx)(Hq,{asChild:!0,children:(0,I.jsx)($f,{to:`/tool-analysis-results/${e.reportId}`,children:`View`})}),(0,I.jsxs)(Hq,{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)(Hq,{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)(Hq,{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)(Hq,{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)(Y6,{open:!!a,onOpenChange:e=>!e&&o(null),children:(0,I.jsxs)(Z6,{children:[(0,I.jsxs)(Q6,{children:[(0,I.jsx)(e8,{children:`Delete tool analysis report?`}),(0,I.jsx)(t8,{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)($6,{children:[(0,I.jsx)(r8,{disabled:s,children:`Cancel`}),(0,I.jsx)(n8,{onClick:e=>{e.preventDefault(),x()},disabled:s,children:s?`Deleting...`:`Delete`})]})]})})]})}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 lfe(){let{id:e=``}=Wd(),t=Ud(),{source:n}=q_(),[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)($f,{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?DX(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)(S7,{versions:r.report.mcpServerVersions}),(0,I.jsx)(W,{asChild:!0,size:`sm`,variant:`outline`,children:(0,I.jsx)($f,{to:`/tool-analysis-results`,children:`Back to results`})}),(0,I.jsxs)(W,{type:`button`,size:`sm`,variant:`outline`,onClick:()=>T7(`${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:()=>T7(`${r.reportId}.md`,h7(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:()=>T7(`${r.reportId}-tool-schemas.json`,`${JSON.stringify(_7(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)(g7,{report:r.report}),(0,I.jsx)(Y6,{open:l,onOpenChange:u,children:(0,I.jsxs)(Z6,{children:[(0,I.jsxs)(Q6,{children:[(0,I.jsx)(e8,{children:`Delete tool analysis report?`}),(0,I.jsxs)(t8,{children:[`Delete saved report '`,r.reportId,`' from disk? This cannot be undone.`]})]}),(0,I.jsxs)($6,{children:[(0,I.jsx)(r8,{disabled:d,children:`Cancel`}),(0,I.jsx)(n8,{onClick:e=>{e.preventDefault(),p()},disabled:d,children:d?`Deleting...`:`Delete`})]})]})})]})}var ufe=[{id:`configure`,label:`Configure Debug Session`},{id:`run`,label:`Run / Inspect Flow`},{id:`report`,label:`Report / Export`}],dfe=`resolve_target_metadata`,ffe=`token_exchange`,pfe=`resource_probe`;function E7({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 D7(e){return navigator.clipboard.writeText(e)}function O7(){return typeof window>`u`?``:window.location.port===`8685`?`http://127.0.0.1:8787`:``}function k7(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 mfe(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 hfe(){let{source:e}=q_(),{servers:t,reload:n,loading:r}=ov(),[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(`${O7()}/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(`${O7()}/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=mfe(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?`${O7()}/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:ufe.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)(sv,{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)(cv,{className:`text-base`,children:`Target MCP Server`}),(0,I.jsx)(lv,{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)(DY,{value:o,onValueChange:s,children:[(0,I.jsx)(kY,{children:(0,I.jsx)(OY,{placeholder:`Select an MCP server`})}),(0,I.jsx)(MY,{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)(sv,{className:`pb-3`,children:[(0,I.jsx)(cv,{className:`text-base`,children:`Client Registration Method`}),(0,I.jsx)(lv,{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)(E7,{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)(DY,{value:u,onValueChange:e=>d(e),children:[(0,I.jsx)(kY,{children:(0,I.jsx)(OY,{})}),(0,I.jsxs)(MY,{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)(E7,{text:`The unique identifier for your application, issued by the authorization server when you registered the client.`})]}),(0,I.jsx)(Tp,{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)(E7,{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)(i8,{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)(E7,{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)(Tp,{value:M,onChange:e=>N(e.target.value),placeholder:`https://.../client-metadata.json`})]})]})]}),(0,I.jsxs)(K,{children:[(0,I.jsxs)(sv,{className:`pb-3`,children:[(0,I.jsx)(cv,{className:`text-base`,children:`Runtime OAuth Inputs`}),(0,I.jsx)(lv,{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)(Tp,{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)(GX,{checked:g,onCheckedChange:e=>v(!!e)}),(0,I.jsxs)(Q,{className:`flex items-center gap-1`,children:[`Use PKCE (S256)`,(0,I.jsx)(E7,{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)(GX,{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)(E7,{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)(DY,{value:D,onValueChange:k,children:[(0,I.jsx)(kY,{children:(0,I.jsx)(OY,{placeholder:`Server default (recommended)`})}),(0,I.jsxs)(MY,{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)(E7,{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)(Tp,{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)(E7,{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)(rX,{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)(E7,{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)(Tp,{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)(E7,{text:`The /.well-known/oauth-authorization-server URL. Override if the server uses a non-standard path.`})]}),(0,I.jsx)(Tp,{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)(E7,{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)(Tp,{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)(E7,{text:`The URL where users are redirected to log in and grant consent. Normally discovered automatically from the server metadata.`})]}),(0,I.jsx)(Tp,{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)(E7,{text:`The URL your app calls to exchange the authorization code for an access token. Normally discovered automatically.`})]}),(0,I.jsx)(Tp,{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)(E7,{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)(Tp,{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)(E7,{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)(Tp,{value:M,onChange:e=>N(e.target.value),placeholder:`https://.../client-metadata.json`})]})]})]}),(0,I.jsxs)(L5,{children:[(0,I.jsx)(un,{className:`h-4 w-4`}),(0,I.jsx)(R5,{children:`Secrets display`}),(0,I.jsxs)(z5,{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)(GX,{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)(sv,{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)(cv,{className:`text-base`,children:`Progress`}),(0,I.jsx)(lv,{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)(e7,{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)(rX,{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)(L5,{children:[(0,I.jsx)(un,{className:`h-4 w-4`}),(0,I.jsx)(R5,{children:`Waiting for browser callback`}),(0,I.jsxs)(z5,{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===ffe||e.id===pfe,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===dfe&&(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:k7(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:k7(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:k7(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)(sv,{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)(cv,{className:`text-base`,children:`Inspect`}),(0,I.jsx)(lv,{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)(SX,{value:Ce,onValueChange:e=>we(e),className:`min-w-0`,children:[(0,I.jsxs)(CX,{className:`grid grid-cols-2`,children:[(0,I.jsx)(wX,{value:`inspector`,children:`Network Inspector`}),(0,I.jsx)(wX,{value:`events`,children:`Live Debug`})]}),(0,I.jsx)(TX,{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)(TX,{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)(DY,{value:ye,onValueChange:be,children:[(0,I.jsx)(kY,{className:`h-8`,children:(0,I.jsx)(OY,{})}),(0,I.jsxs)(MY,{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)(DY,{value:xe,onValueChange:Se,children:[(0,I.jsx)(kY,{className:`h-8`,children:(0,I.jsx)(OY,{})}),(0,I.jsxs)(MY,{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 D7(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)(L5,{children:[(0,I.jsx)(un,{className:`h-4 w-4`}),(0,I.jsx)(R5,{children:`Secrets display mode`}),(0,I.jsx)(z5,{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)(sv,{className:`pb-3`,children:(0,I.jsx)(cv,{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`?`${d6(B.summary.accessTokenValidForSeconds)} remaining`:typeof B.summary?.accessTokenExpiresInSeconds==`number`?`${d6(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 D7(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)(sv,{className:`pb-3`,children:(0,I.jsx)(cv,{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 gfe(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 _fe(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 vfe(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 A7(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 j7(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 M7=`mcplab.runEvaluation.activeJobId`;function yfe(e){return e.configName?.trim()||e.name}function bfe(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 N7(){return new Date().toLocaleTimeString()}function P7(e){return e.executionType===`rover`&&[`queued`,`waiting_for_rover`,`running`,`paused_rover`].includes(e.status)}function xfe(e){return e.jobs.flatMap(e=>e.childProgress?.length?e.childProgress.map(t=>({job:e,child:t})):[{job:e}])}var Sfe=()=>{let[e]=ap(),[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)([]),[de,V]=(0,_.useState)(null),[fe,pe]=(0,_.useState)(null),[me,he]=(0,_.useState)(!1),[ge,_e]=(0,_.useState)(null),ve=(0,_.useRef)(null),ye=(0,_.useRef)(null),be=(0,_.useRef)(null),xe=(0,_.useRef)(new Map),Se=(0,_.useRef)(!1),{configs:Ce,reload:we}=rv(),{source:Te}=q_(),{agents:Ee,scenarios:De,servers:Oe,reload:ke}=ov(),Ae=b.trim(),je=Ae?`/results/${encodeURIComponent(Ae)}${t?`?configId=${encodeURIComponent(t)}`:``}`:`/results`,Me=Ce.find(e=>e.id===t),Ne=(0,_.useMemo)(()=>gfe(Ce),[Ce]),Pe=(0,_.useMemo)(()=>_fe(Ce),[Ce]),Fe=(0,_.useMemo)(()=>vfe(Ce,De),[Ce,De]),Ie=oe[0]??null,Le=(0,_.useMemo)(()=>le.find(e=>e.jobs.some(e=>e.jobId===S))??null,[le,S]),Re=Le?Math.max(s,Le.totalJobs>0?Math.round(Le.completedJobs/Le.totalJobs*100):0):s,ze=e.get(`configId`),Be=(0,_.useMemo)(()=>{if(!Me)return[];let e=new Map,t=Me.agentEntries&&Me.agentEntries.length>0?Me.agentEntries:Me.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=Ee.find(e=>e.id===n.ref);t&&!e.has(t.id)&&e.set(t.id,t)}for(let t of Ee)e.has(t.id)||e.set(t.id,t);return Array.from(e.values())},[Me,Ee]),Ve=(0,_.useMemo)(()=>{if(!Me)return[];let e=new Map,t=Me.scenarioEntries&&Me.scenarioEntries.length>0?Me.scenarioEntries:Me.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=De.find(e=>e.id===n.ref);t&&!e.has(t.id)&&e.set(t.id,t)}return Array.from(e.values())},[Me,De]),He=(0,_.useMemo)(()=>Be.filter(e=>e.type===`browser`&&w.includes(e.id)),[Be,w]),Ue=He.length>0?1:Number(r),We=(0,_.useMemo)(()=>[{label:`LLM Agents`,agents:Be.filter(e=>e.type!==`browser`)},{label:`Browser Agents`,agents:Be.filter(e=>e.type===`browser`)}],[Be]),Ge=(0,_.useMemo)(()=>{let e=new Map;for(let t of Oe)e.has(t.id)||e.set(t.id,{id:t.id,name:t.name});for(let t of Me?.servers??[])e.set(t.id,{id:t.id,name:t.name});return Array.from(e.values()).sort((e,t)=>e.id.localeCompare(t.id))},[Me?.servers,Oe]);(0,_.useEffect)(()=>{ze&&Ce.some(e=>e.id===ze)&&n(ze)},[ze,Ce]);let Ke=(0,_.useRef)(``);(0,_.useEffect)(()=>{let e=Me?`${Me.id}::${Me.sourcePath??``}`:``;if(e===Ke.current)return;if(Ke.current=e,!Me){T([]),D(`agent_default`),A([]),M(!1),P([]),L({}),z({});return}let t=FY(Me);T(t.length>0?t:Be.map(e=>e.id)),D(`agent_default`),A(Ve.map(e=>e.id)),M(!1),P([]),L({}),z({})},[Me?.id,Me?.sourcePath,Be,Ve]);let qe=async()=>{if(!Me?.sourcePath){u(e=>[...e,`[${N7()}] Missing source path for selected config.`]);return}let e=Be.filter(e=>w.includes(e.id));if(e.length===0){u(e=>[...e,`[${N7()}] Select at least one agent.`]);return}let t=Ve.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,`[${N7()}] Select at least one test.`]);return}if(j&&N.length===0){u(e=>[...e,`[${N7()}] 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,`[${N7()}] 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=(Me.servers??[]).find(t=>t.id===e),n=Oe.find(t=>t.id===e);return(t||n)?.authType===`oauth2`})));try{l.length>0&&(he(!0),await $3({serverNames:l,source:Te,onServerAuthStart:e=>{u(t=>[...t,`[${N7()}] OAuth login required for '${e}'. Complete the browser sign-in flow...`])}}),u(e=>[...e,`[${N7()}] OAuth login completed for required server(s): ${l.join(`, `)}.`]))}catch(e){let t=e instanceof Error?e.message:String(e);u(e=>[...e,`[${N7()}] OAuth error: ${t}`]),he(!1);return}finally{he(!1)}o(!0),f(!1),y(!1),x(``),re([]);let d=(Me.serverEntries??[]).some(e=>e.kind===`referenced`)||(Me.agentEntries??[]).some(e=>e.kind===`referenced`)||(Me.scenarioEntries??[]).some(e=>e.kind===`referenced`)?`refs-composed`:`single-file/inline`,p={...He.length>0&&E!==`agent_default`?{newConversationBeforeStart:E===`new`,newConversationBetweenScenarios:E===`new`}:{}};u([`[${N7()}] Starting evaluation run...`,`[${N7()}] Config=${Me.name} mode=${d} agents=${e.map(e=>e.name||e.id).join(`, `)} tests=${t.map(e=>e.id).join(`, `)} runs=${Ue}${He.length>0?` newConversationBeforeStart=${p.newConversationBeforeStart??`agent_default`} newConversationBetweenScenarios=${p.newConversationBetweenScenarios??`agent_default`}`:``}${ee.trim()?` note=${ee.trim()}`:``}`,`[${N7()}] Effective MCP servers per selected test: ${a||`(none)`}`]),c(10);try{let{jobId:n}=await Te.startRun({configPath:Me.sourcePath,runsPerScenario:Ue,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),Ze(n),at(n),Qe()}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,`[${N7()}] Error: ${t}${n}`]),o(!1),c(0),C(null),he(!1)}},Je=()=>{qe()},Ye=()=>{be.current=null,S&&Te.stopRun(S),ye.current?.(),ye.current=null,Xe(),C(null),o(!1),f(!1),y(!0),u(e=>[...e,`[${N7()}] Run aborted by user.`]),Qe()};(0,_.useEffect)(()=>{ve.current&&(ve.current.scrollTop=ve.current.scrollHeight)},[l]),(0,_.useEffect)(()=>()=>{be.current=null,ye.current?.()},[]),(0,_.useEffect)(()=>{if(S||d)return;let e=``;try{e=sessionStorage.getItem(M7)??``}catch{e=``}if(e)return C(e),o(!0),f(!1),y(!1),u(e=>e.length>0?e:[`[${N7()}] Reattached to in-progress evaluation run...`]),at(e),()=>{}},[S,d]);let Xe=()=>{try{sessionStorage.removeItem(M7)}catch{}},Ze=e=>{try{sessionStorage.setItem(M7,e)}catch{}},Qe=async(e=!1)=>{try{let t=await Te.getRunQueue(),n=t.evaluations??[],r=new Set(n.map(e=>e.evaluationRunId)),i=xe.current;if(e&&!be.current){let e=Array.from(i.values()).find(e=>[`queued`,`running`].includes(e.status)&&!r.has(e.evaluationRunId));e&&Te.getResult(e.evaluationRunId).then(t=>{if(!t||be.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(()=>{})}xe.current=new Map(n.map(e=>[e.evaluationRunId,e])),ae(t.queued),se(t.active_jobs??(t.active?[t.active]:[])),B(t.admitting_jobs??[]),ue((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?_e(e=>e?.jobId===a.jobId?e:{jobId:a.jobId,servers:a.requiredServers}):(ge?.jobId&&ge.jobId!==S||S!=null&&!t.queued.some(e=>e.jobId===S&&e.status===`blocked_auth`&&e.blockedReason===`oauth_required`))&&_e(null)}catch{}},$e=()=>{we(),ke()};(0,_.useEffect)(()=>{$e(),Qe();let e=Te.subscribeRunQueue(e=>{e.type===`queue_event`&&Qe(!0)}),t=()=>{$e(),Qe()},n=()=>{Qe()};return window.addEventListener(`focus`,t),window.addEventListener(`mcplab:run-queue-changed`,n),()=>{window.removeEventListener(`focus`,t),window.removeEventListener(`mcplab:run-queue-changed`,n),e()}},[we,ke,Te]);let et=async e=>{try{await Te.removeQueuedRun(e),ae(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 Te.stopRun(e)}catch{}else O({title:`Could not remove queued run`,description:n,variant:`destructive`})}Qe()},tt=async e=>{let t=Array.from(new Set(e.jobs.flatMap(e=>e.requiredServers??[])));if(!(t.length===0||Se.current)){Se.current=!0,he(!0);try{await $3({serverNames:t,source:Te}),await Te.resumeQueue()}catch(e){O({title:`Could not connect OAuth`,description:e instanceof Error?e.message:String(e),variant:`destructive`})}finally{Se.current=!1,he(!1),Qe()}}},nt=async e=>{if(fe!==e){pe(e);try{await Te.stopEvaluationRun(e),await Qe()}catch(e){O({title:`Could not stop run`,description:e instanceof Error?e.message:String(e),variant:`destructive`})}finally{pe(null)}}},rt=async e=>{try{await Te.removeEvaluationRun(e),await Qe()}catch(e){O({title:`Could not remove run`,description:e instanceof Error?e.message:String(e),variant:`destructive`})}},it=async e=>{try{await Te.openRover(e),await Qe()}catch(e){O({title:`Could not open browser agent`,description:e instanceof Error?e.message:String(e),variant:`destructive`})}},at=e=>{S===e&&ye.current||(ye.current?.(),be.current!==e&&re([]),be.current=e,ye.current=Te.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??``);_e({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===`inspection_ready`){let e=String(t.payload.upstreamOrigin??``).trim(),n=String(t.payload.dashboardUrl??``).trim();e&&n&&re(t=>t.some(e=>e.dashboardUrl===n)?t:[...t,{upstreamOrigin:e,dashboardUrl:n}])}else{if(t.type===`started`&&(_e(null),Se.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)),Qe()),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;_e(null),Se.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),Xe(),C(null),be.current=null,ye.current?.(),ye.current=null,Qe()};Te.getRunQueue().then(t=>{if(be.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)),_e(a.status===`blocked_auth`?{jobId:a.jobId,servers:a.requiredServers??[]}:null),Se.current=!1,o(!0),f(!1),y(!1),C(a.jobId),Ze(a.jobId),Qe(),at(a.jobId)}else l(r)}).catch(()=>{be.current===e&&l()})}}}))},ot=e=>{S===e&&ye.current||(C(e),Ze(e),o(!0),f(!1),y(!1),u([`[${N7()}] Attached to running job ${e}...`]),c(10),at(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)(DY,{value:t,onValueChange:n,children:[(0,I.jsx)(kY,{children:(0,I.jsx)(OY,{placeholder:`Select a config`})}),(0,I.jsx)(MY,{children:Ce.map(e=>{let t=bfe(e);return(0,I.jsxs)(Z,{value:e.id,children:[(0,I.jsx)(`span`,{children:yfe(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:$e,"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)(Tp,{id:`variance-runs`,type:`number`,min:`1`,max:`10`,value:He.length>0?`1`:r,onChange:e=>i(e.target.value),disabled:He.length>0}),He.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)(rX,{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})]}),Me&&(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(Be.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:We.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)(GX,{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)}),He.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)(DY,{value:E,onValueChange:e=>D(e),children:[(0,I.jsx)(kY,{id:`conversation-behavior`,children:(0,I.jsx)(OY,{})}),(0,I.jsxs)(MY,{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.`})]}),Be.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.`})]}),Me&&(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(Ve.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 `,Ve.length,` selected`]}),(0,I.jsx)(`div`,{className:`grid gap-2 sm:grid-cols-2`,children:Ve.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)(GX,{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)(f8,{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:Ge.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)(f8,{checked:j,onCheckedChange:M})]}),j&&(0,I.jsx)(`div`,{className:`flex flex-wrap gap-1.5`,children:Ge.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:Je,disabled:!t||me||Be.length>0&&w.length===0||Ve.length>0&&k.length===0,children:[(0,I.jsx)(Yn,{className:`mr-2 h-4 w-4`}),Ie?`Queue Run`:`Run`]}),a&&(0,I.jsxs)(W,{variant:`destructive`,onClick:Ye,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)(sv,{className:`pb-3`,children:(0,I.jsxs)(`div`,{className:`flex items-center justify-between`,children:[(0,I.jsx)(cv,{className:`text-base`,children:`Progress`}),(0,I.jsxs)(`span`,{className:`text-xs text-muted-foreground font-mono`,children:[Math.round(Re),`%`]})]})}),(0,I.jsxs)(q,{className:`space-y-4`,children:[(0,I.jsx)(e7,{value:Re,className:`h-2`}),(Le||Ie)&&(0,I.jsx)(`div`,{className:`flex flex-wrap items-center gap-x-3 gap-y-1 text-xs text-muted-foreground`,children:Le?(0,I.jsxs)(I.Fragment,{children:[(0,I.jsxs)(`span`,{children:[Le.completedJobs,`/`,Le.totalJobs,` subtasks complete`]}),Le.failedJobs-Le.stoppedJobs>0&&(0,I.jsxs)(`span`,{className:`font-medium text-destructive`,children:[Le.failedJobs-Le.stoppedJobs,` failed`]}),Le.stoppedJobs>0&&(0,I.jsxs)(`span`,{className:`font-medium text-muted-foreground`,children:[Le.stoppedJobs,` stopped`]}),Le.pausedJobs>0&&(0,I.jsxs)(`span`,{className:`font-medium text-yellow-700 dark:text-yellow-400`,children:[Le.pausedJobs,` paused`]}),(0,I.jsx)(Y,{variant:`outline`,className:`capitalize`,children:Le.status})]}):(0,I.jsx)(`span`,{children:Ie?.roverProgress?`${Ie.roverProgress.completed}/${Ie.roverProgress.total} scenarios complete`:`Attached to active run`})}),ge&&(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:ge.servers.join(`, `)})]}),(0,I.jsx)(W,{size:`sm`,variant:`outline`,disabled:me,onClick:()=>{Se.current||(Se.current=!0,he(!0),$3({serverNames:ge.servers,source:Te,onServerAuthStart:e=>{u(t=>[...t,`[${N7()}] OAuth sign-in opened for '${e}'...`])}}).then(()=>Te.resumeQueue()).then(()=>{let e=ge?.jobId;u(e=>[...e,`[${N7()}] OAuth complete. Resuming run...`]),e&&(C(e),Ze(e),o(!0),f(!1),at(e))}).catch(e=>{let t=e instanceof Error?e.message:String(e);u(e=>[...e,`[${N7()}] OAuth error: ${t}`]),Se.current=!1}).finally(()=>{he(!1)}))},children:me?`Connecting...`:`Connect & Resume`})]}),(0,I.jsx)(`div`,{ref:ve,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))}),ne.length>0&&(0,I.jsxs)(`div`,{className:`flex flex-wrap items-center gap-2 text-sm`,children:[(0,I.jsx)(`span`,{className:`text-muted-foreground`,children:`Inspectr:`}),ne.map(e=>(0,I.jsxs)(`a`,{href:e.dashboardUrl,target:`_blank`,rel:`noreferrer`,className:`text-primary hover:underline`,children:[`Open `,e.upstreamOrigin]},e.dashboardUrl))]})]})]}),(0,I.jsxs)(K,{children:[(0,I.jsx)(sv,{className:`pb-3`,children:(0,I.jsxs)(`div`,{className:`flex items-center justify-between`,children:[(0,I.jsxs)(cv,{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 Qe(),children:(0,I.jsx)(Qn,{className:`h-3 w-3`})})]})}),(0,I.jsx)(q,{children:!Ie&&ce.length===0&&ie.length===0&&le.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:[le.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&&ot(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:me,onClick:()=>void tt(e),children:me?`Connecting...`:`Connect OAuth`}),e.jobs.some(P7)&&(0,I.jsx)(W,{size:`sm`,variant:`outline`,className:`h-7 text-xs`,onClick:()=>{let t=e.jobs.find(P7);t&&it(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:()=>V(t=>t===e.evaluationRunId?null:e.evaluationRunId),"aria-label":`${de===e.evaluationRunId?`Collapse`:`Expand`} evaluation details`,children:de===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 rt(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:fe===e.evaluationRunId,onClick:()=>void nt(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`}),fe===e.evaluationRunId?`Stopping run...`:`Stop run`]})]})]}),de===e.evaluationRunId&&(0,I.jsx)(`div`,{className:`mt-2 space-y-1 text-xs text-muted-foreground`,children:xfe(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:()=>ot(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)(Ag,{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:[P7(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 it(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:()=>{Te.resumeRover(e.jobId).then(()=>void Qe())},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?Te.stopScenario(e.jobId,t.scenarioId,t.agentName):Te.stopRun(e.jobId)).then(()=>void Qe())},children:t?.status===`queued`||e.status===`queued`?`Remove`:`Stop`})]})]},`${e.jobId}:${t?.scenarioId??`job`}:${t?.agentName??`job`}`))})]},e.evaluationRunId)),oe.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),Ze(e.jobId),o(!0),f(!1),y(!1),u([`[${N7()}] Attached to running job ${e.jobId}...`]),c(10),at(e.jobId))},onKeyDown:t=>{(t.key===`Enter`||t.key===` `)&&S!==e.jobId&&(t.preventDefault(),C(e.jobId),Ze(e.jobId),o(!0),f(!1),y(!1),u([`[${N7()}] Attached to running job ${e.jobId}...`]),c(10),at(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:Pe.get(e.runParams.configPath)||j7(e.runParams.scenarioIds,Fe,e.runParams.configPath)}),(0,I.jsx)(`span`,{className:`font-mono text-xs`,children:A7(e.runParams.configPath,Ne)}),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(),Te.stopRun(e.jobId),Qe()},title:`Stop running job`,children:[(0,I.jsx)(sr,{className:`mr-1 h-3 w-3`}),`Stop`]})]},e.jobId)),ce.filter(e=>!e.evaluationRunId).map(e=>{let t=A7(e.runParams.configPath,Ne),n=j7(e.runParams.scenarioIds,Fe,e.runParams.configPath),r=Pe.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)}),ie.filter(e=>!e.evaluationRunId).map((e,t)=>{let n=A7(e.runParams.configPath,Ne),r=j7(e.runParams.scenarioIds,Fe,e.runParams.configPath),i=Pe.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:me,onClick:()=>{if(Se.current)return;let t=e.requiredServers??[];t.length!==0&&(Se.current=!0,_e({jobId:e.jobId,servers:t}),he(!0),$3({serverNames:t,source:Te,onServerAuthStart:e=>{u(t=>[...t,`[${N7()}] OAuth sign-in opened for '${e}'...`])}}).then(()=>Te.resumeQueue()).then(()=>{u(e=>[...e,`[${N7()}] OAuth complete. Resuming run...`]),C(e.jobId),Ze(e.jobId),o(!0),f(!1),at(e.jobId)}).catch(e=>{let t=e instanceof Error?e.message:String(e);u(e=>[...e,`[${N7()}] OAuth error: ${t}`]),Se.current=!1}).finally(()=>{he(!1)}))},children:me&&ge?.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 et(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:Je,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)($f,{to:je,children:Ae?`View Results`:`View Runs`})})]})})})]})};function F7({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)(sv,{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)(cv,{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)(K3,{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 I7(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 L7(e){return e.runs.length>0?e.runs.reduce((e,t)=>e+t.duration,0):e.avgDuration}function R7(e){return e.scenarios.some(e=>e.runs.length>0)?e.scenarios.reduce((e,t)=>e+L7(t),0):typeof e.totalDurationMs==`number`&&e.totalDurationMs>=0?e.totalDurationMs:null}function z7(e){return e.runs.length>0?e.runs.reduce((e,t)=>e+t.toolCalls.reduce((e,t)=>e+t.duration,0),0):0}function B7(e){return e.scenarios.some(e=>e.runs.length>0)?e.scenarios.reduce((e,t)=>e+z7(t),0):typeof e.totalToolDurationMs==`number`&&e.totalToolDurationMs>=0?e.totalToolDurationMs:null}var V7=`hsl(152, 69%, 40%)`,H7=`hsl(0, 72%, 51%)`,U7=`hsl(215, 16%, 47%)`,W7=`hsl(38, 92%, 50%)`,G7=`hsl(38, 92%, 50%)`,K7=`hsl(270, 55%, 50%)`,q7=`hsl(215, 16%, 47%)`;function J7(e,t=0){return e.toLocaleString(void 0,{maximumFractionDigits:t,minimumFractionDigits:t})}function Y7({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:V7},{name:`Failed`,value:n,color:H7},...r>0?[{name:`Incomplete`,value:r,color:G7}]:[],...i>0?[{name:`Error`,value:i,color:K7}]:[],...a>0?[{name:`Stopped`,value:a,color:q7}]:[],...o>0?[{name:`Not evaluated`,value:o,color:U7}]:[],...s>0?[{name:`Not executed`,value:s,color:W7}]:[]];return(0,I.jsxs)(K,{children:[(0,I.jsx)(sv,{className:`p-2.5 pb-0`,children:(0,I.jsx)(cv,{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)(Lw,{width:`100%`,height:`100%`,children:(0,I.jsxs)(kW,{children:[(0,I.jsx)(qL,{data:c,dataKey:`value`,nameKey:`name`,innerRadius:`55%`,outerRadius:`78%`,paddingAngle:3,children:c.map(e=>(0,I.jsx)(Rw,{fill:e.color},e.name))}),(0,I.jsx)(vw,{})]})})}),(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:V7}}),J7(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:H7}}),J7(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:G7}}),J7(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:K7}}),J7(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:q7}}),J7(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:U7}}),J7(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:W7}}),J7(s),` not executed`]})]})]})]})}function Cfe({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:g_(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)(Y7,{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)(Y7,{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)(vv,{compact:!0,title:`Scenarios`,value:J7(n.totalScenarios),icon:Pn}),(0,I.jsx)(vv,{compact:!0,title:`Total Runs`,value:J7(n.totalRuns),icon:Xt}),(0,I.jsx)(vv,{compact:!0,title:`Pass Rate`,value:n.passRate===null?`–`:`${J7(n.passRate*100,1)}%`,icon:rn}),(0,I.jsx)(vv,{compact:!0,title:`Avg Tool Calls`,value:J7(n.avgToolCalls,1),icon:dn}),(0,I.jsx)(vv,{compact:!0,title:`Avg Latency`,value:`${J7(n.avgLatency)}ms`,icon:cr}),(0,I.jsx)(vv,{compact:!0,title:`Tool Tokens`,value:J7(n.totalTokens),icon:mr}),n.totalDurationMs>0?(0,I.jsx)(vv,{compact:!0,title:`Total Time`,value:I7(n.totalDurationMs),icon:_n}):null,n.totalToolDurationMs>0?(0,I.jsx)(vv,{compact:!0,title:`Tool Duration`,value:I7(n.totalToolDurationMs),icon:_n}):null]})]})})}function wfe(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 Tfe(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 Efe(e){return e===`auth`?`Auth error`:e===`rate_limit`?`Rate limited`:`Infra error`}function Dfe(e){let t=wfe(e);for(let e of[`auth`,`rate_limit`,`infra`]){let n=t.find(t=>Tfe(t)===e);if(n)return{kind:e,label:Efe(e),detail:n}}return null}function Ofe(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 kfe({run:e}){let t=Dfe(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] ${Ofe(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 X7(e){let{source:t,open:n,scope:r,runId:i,onSessionSync:a}=e,o=i6({api:(0,_.useMemo)(()=>Sle(t,r===`run`&&i?{scope:`run`,runId:i}:{scope:`all_runs`}),[t,r,i]),open:n,label:`MCP Lab Assistant`,recreateExpiredOnSend:!0,onSession:a}),{send:s,cancel:c,reset:l}=o,[u,d]=(0,_.useState)(``),[f,p]=(0,_.useState)(),m=(0,_.useRef)(null),h=(0,_.useCallback)(async()=>{let e=u.trim();e&&(r!==`run`||i)&&(d(``),await s(e))},[s,u,r,i]),g=(0,_.useCallback)(()=>{let e=c();e!==void 0&&d(e)},[c]),v=(0,_.useCallback)(()=>{l(),d(``),p(void 0)},[l]),y=(0,_.useCallback)(e=>{p(t=>t??{id:`result-assistant-intro`,role:`assistant`,text:e,createdAt:new Date().toISOString()})},[]),b=(0,_.useCallback)(e=>{d(e),requestAnimationFrame(()=>m.current?.focus())},[]);(0,_.useEffect)(()=>{let e=m.current;if(!e)return;e.style.height=`0px`;let t=Math.min(e.scrollHeight,160);e.style.height=`${Math.max(40,t)}px`},[u,n]);let x=(0,_.useMemo)(()=>o.messages.length===0&&f?[f]:o.messages,[o.messages,f]);return{assistantSessionId:o.sessionId,assistantMessages:x,assistantPendingToolCalls:o.pendingToolCalls,assistantInput:u,assistantLoading:o.busy,assistantTurnCancelable:o.cancelable,assistantExpired:o.expired,cancelAssistantTurn:g,assistantInputRef:m,setAssistantInput:d,askAssistant:h,approveResultAssistantToolCall:o.approve,denyResultAssistantToolCall:o.deny,applyResultAssistantSnippet:b,ensureIntroMessage:y,resetAssistantSession:v}}var Afe=24,jfe=448;function Mfe(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(jfe,Math.round(window.innerHeight-Nfe(t)-Afe)))};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 Nfe(e){let t=e.getBoundingClientRect().top;for(let n=e.parentElement;n;n=n.parentElement)t+=n.scrollTop;return t}async function Z7(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 Q7=[{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 $7(e){return e===`all`||e===`last`||e===`custom`}function e9(e){return e===`15min`||e===`30min`||e===`1h`||e===`2h`||e===`4h`||e===`8h`||e===`24h`||e===`7d`||e===`14d`||e===`30d`}function t9(e){let t=e.get(`time_filter`),n=e.get(`time_preset`);return{mode:$7(t)?t:`all`,preset:e9(n)?n:`15min`,start:e.get(`time_start`)??``,end:e.get(`time_end`)??``}}var n9=8,r9=`mcplab:results:time-filter`,i9=`mcplab:results:dashboard-visible`;function a9(e){if(!e.trim())return null;let t=new Date(e);return Number.isNaN(t.getTime())?null:t}function o9(e,t,n,r){if(e===`all`)return{};if(e===`last`){let e=Q7.find(e=>e.value===t)??Q7[0],n=new Date(Date.now());return{since:new Date(n.getTime()-e.durationMs).toISOString(),until:n.toISOString()}}let i=a9(n),a=a9(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 s9(e){let t=a9(e);return t?t.toLocaleString():``}function Pfe(e){let t=a9(e);return t?`${t.getUTCFullYear()}-${String(t.getUTCMonth()+1).padStart(2,`0`)}-${String(t.getUTCDate()).padStart(2,`0`)}`:e}function Ffe(e){let t=a9(e);return t?t.toLocaleDateString(void 0,{weekday:`long`,month:`short`,day:`numeric`,year:`numeric`,timeZone:`UTC`}):`Unknown day`}function Ife(e){return e.has(`time_filter`)||e.has(`time_preset`)||e.has(`time_start`)||e.has(`time_end`)}function Lfe(){try{let e=localStorage.getItem(r9);if(!e)return null;let t=JSON.parse(e);return{mode:$7(typeof t.mode==`string`?t.mode:null)?t.mode:`all`,preset:e9(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 Rfe(){try{let e=localStorage.getItem(i9);return e===null||e===`true`}catch{return!0}}var zfe=[{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.`}],c9=100,Bfe=()=>{let[e,t]=ap(),{source:n}=q_(),[r]=(0,_.useState)(()=>Ife(e)?t9(e):Lfe()??t9(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)(Rfe),[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=Mfe(u,{active:ne,observe:l}),se=oe!==void 0,{completionVersion:ce}=Q_(),B=C7(c9),{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({...o9(j,N,F,R),scenario:pe});c.current===e&&s(t.map(MW))}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=o9(j,N,F,R);if(n.listRunSummariesPage){let t=await n.listRunSummariesPage({...e,scenario:pe,limit:c9,offset:le});B.updateMeta(t),a(t.data.map(MW))}else if(n.listRunSummaries){let t=await n.listRunSummaries({...e,scenario:pe,limit:c9,offset:le});B.setTotalCount(t.length),B.setHasMore(!1),a(t.map(MW))}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=o9(j,N,F,R);return(n.listRunSummariesPage?n.listRunSummariesPage({...t,scenario:pe,limit:c9,offset:le}).then(t=>(e&&B.updateMeta(t),t.data.map(MW))):n.listRunSummaries?n.listRunSummaries({...t,scenario:pe,limit:c9,offset:le}).then(t=>(e&&(B.setTotalCount(t.length),B.setHasMore(!1)),t.map(MW))):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(i9,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}=X7({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(r9);return}let e={mode:j,preset:N,start:F,end:R};localStorage.setItem(r9,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-(Q7.find(e=>e.value===N)??Q7[0]).durationMs;return e.filter(e=>{let r=new Date(e.timestamp).getTime();return r>=n&&r<=t})}let r=a9(F)?.getTime()??null,a=a9(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 Q7.find(e=>e.value===N)?.label??`Last range`;let e=!!F.trim(),t=!!R.trim();return!e&&!t?`Custom range`:e&&t?`${s9(F)} - ${s9(R)}`:e?`From ${s9(F)}`:`Until ${s9(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=Pfe(n.timestamp);r!==t&&(e.push({type:`day-separator`,dayKey:r,dayLabel:Ffe(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,jW(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 Z7(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)(Y6,{open:v!==null,onOpenChange:e=>{!e&&!b&&y(null)},children:(0,I.jsxs)(Z6,{children:[(0,I.jsxs)(Q6,{children:[(0,I.jsx)(e8,{children:`Delete run?`}),(0,I.jsxs)(t8,{children:[`This will permanently remove the run artifacts from disk for`,` `,(0,I.jsx)(`span`,{className:`font-mono`,children:v??``}),`.`]})]}),(0,I.jsxs)($6,{children:[(0,I.jsx)(r8,{disabled:b,children:`Cancel`}),(0,I.jsx)(n8,{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)($8,{open:k,onOpenChange:A,children:[(0,I.jsx)(e5,{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)(t5,{className:`w-[260px] p-0`,align:`start`,children:(0,I.jsxs)(D5,{children:[(0,I.jsx)(O5,{placeholder:`Search scenarios...`}),(0,I.jsxs)(k5,{id:`results-scenario-command-list`,children:[(0,I.jsx)(A5,{children:`No scenarios found.`}),(0,I.jsxs)(j5,{children:[(0,I.jsx)(M5,{value:`all scenarios`,onSelect:()=>{D(`all`),A(!1)},children:`All scenarios`}),je.map(e=>(0,I.jsx)(M5,{value:`${e.label} ${e.value}`,onSelect:()=>{D(e.value),A(!1)},children:e.label},e.value))]})]})]})})]}),(0,I.jsxs)($8,{open:ee,onOpenChange:te,children:[(0,I.jsx)(e5,{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)(t5,{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`}),Q7.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)(Tp,{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)(Tp,{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)(Cfe,{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)(dv,{className:`table-auto`,containerClassName:se?`h-full`:void 0,children:[(0,I.jsx)(fv,{className:se?`sticky top-0 z-10 bg-card shadow-[0_1px_0_var(--color-border)]`:void 0,children:(0,I.jsxs)(hv,{children:[(0,I.jsx)(gv,{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)(gv,{className:`results-table-column-evaluation w-[20rem] max-w-[20rem] min-w-0`,children:`Evaluation`}),(0,I.jsx)(gv,{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)(gv,{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)(gv,{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)(gv,{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)(gv,{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)(gv,{className:`results-table-column-actions w-36 min-w-36 max-w-36`})]})}),(0,I.jsx)(pv,{children:Ie.length===0?(0,I.jsx)(hv,{children:(0,I.jsx)(J,{colSpan:n9,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)(hv,{className:`bg-muted/30 hover:bg-muted/30`,children:(0,I.jsx)(J,{colSpan:n9,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)(hv,{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)($f,{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)(S7,{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=R7(e.run);return t===null?null:(0,I.jsxs)(`div`,{className:`font-mono text-[11px] text-muted-foreground/90`,children:[`Total time: `,I7(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)(bv,{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)(kfe,{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=B7(e.run);return t===null?null:(0,I.jsxs)(`div`,{className:`font-mono text-[11px] text-muted-foreground/90`,children:[`Tool time: `,I7(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)(Lq,{children:[(0,I.jsx)(Rq,{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)(Vq,{align:`end`,children:[(0,I.jsx)(Hq,{asChild:!0,children:(0,I.jsxs)($f,{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)(Hq,{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)(Hq,{children:[(0,I.jsx)(yn,{className:`mr-2 h-3.5 w-3.5`}),`Export JSON`]}),(0,I.jsxs)(Hq,{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)(F7,{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:zfe,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 l9(e,t){return`${e}|${t}`}function Vfe(e){let{source:t}=q_(),[n,r]=(0,_.useState)(null);return{openingTrace:n,openTrace:(0,_.useCallback)(async(n,i)=>{if(!e)return;let a=window.open(``,`_blank`);a&&(a.opener=null),r(l9(n,i));try{let r=`${(await t.openRunInspectrSession(e,n)).dashboardUrl}#traces/${encodeURIComponent(i)}`;a?a.location.href=r:window.open(r,`_blank`,`noopener`)}catch(e){a?.close(),O({title:`Could not open Inspectr`,description:e instanceof Error?e.message:String(e),variant:`destructive`})}finally{r(null)}},[e,t])}}function u9({name:e,title:t,items:n,busy:r=!1,disabled:i=!1}){if(n.length===0)return null;let a={type:`button`,variant:`ghost`,size:`sm`,className:`h-7 gap-1 px-2 text-xs text-muted-foreground`,disabled:i,title:t},o=r?(0,I.jsx)(zn,{className:`h-3.5 w-3.5 animate-spin`}):(0,I.jsx)(Sn,{className:`h-3.5 w-3.5`});return n.length===1?(0,I.jsxs)(W,{...a,onClick:n[0].open,children:[o,e]}):(0,I.jsxs)(Lq,{children:[(0,I.jsx)(Rq,{asChild:!0,children:(0,I.jsxs)(W,{...a,children:[o,e,(0,I.jsx)(on,{className:`h-3 w-3`})]})}),(0,I.jsx)(Vq,{align:`end`,children:n.map(e=>(0,I.jsx)(Hq,{onSelect:e.open,children:e.label},e.key))})]})}function Hfe({runId:e,scenario:t,langsmithTraceUrls:n}){let{openingTrace:r,openTrace:i}=Vfe(e),a=e=>`Run #${e+1}`,o=t.runs.flatMap(e=>{let t=e.requestId?n?.[e.requestId]:void 0;return t?[{key:t,label:a(e.runIndex),open:()=>void window.open(t,`_blank`,`noopener,noreferrer`)}]:[]}),s=t.inspectrOrigins??[],c=s.flatMap(e=>t.runs.flatMap(t=>{let n=t.requestId;if(!n)return[];let r=s.length>1?` (${new URL(e).host})`:``;return[{key:l9(e,n),label:`${a(t.runIndex)}${r}`,open:()=>void i(e,n)}]}));return(0,I.jsxs)(I.Fragment,{children:[(0,I.jsx)(u9,{name:`LangSmith trace`,title:`Open the LangSmith trace`,items:o}),(0,I.jsx)(u9,{name:`Inspectr trace`,title:`Open the MCP requests in Inspectr (starts Inspectr if needed)`,items:c,disabled:r!==null,busy:c.some(e=>e.key===r)})]})}function Ufe(e,t){return _.useReducer((e,n)=>t[e][n]??e,e)}var d9=`ScrollArea`,[f9,Wfe]=R(d9),[Gfe,p9]=f9(d9),m9=_.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=zW(i);return(0,I.jsx)(Gfe,{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}})})});m9.displayName=d9;var h9=`ScrollAreaViewport`,g9=_.forwardRef((e,t)=>{let{__scopeScrollArea:n,children:r,nonce:i,...a}=e,o=p9(h9,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})})]})});g9.displayName=h9;var _9=`ScrollAreaScrollbar`,v9=_.forwardRef((e,t)=>{let{forceMount:n,...r}=e,i=p9(_9,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)(Kfe,{...r,ref:t,forceMount:n}):i.type===`scroll`?(0,I.jsx)(qfe,{...r,ref:t,forceMount:n}):i.type===`auto`?(0,I.jsx)(y9,{...r,ref:t,forceMount:n}):i.type===`always`?(0,I.jsx)(b9,{...r,ref:t}):null});v9.displayName=_9;var Kfe=_.forwardRef((e,t)=>{let{forceMount:n,...r}=e,i=p9(_9,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)(y9,{"data-state":a?`visible`:`hidden`,...r,ref:t})})}),qfe=_.forwardRef((e,t)=>{let{forceMount:n,...r}=e,i=p9(_9,e.__scopeScrollArea),a=e.orientation===`horizontal`,o=N9(()=>c(`SCROLL_END`),100),[s,c]=Ufe(`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)(b9,{"data-state":s===`hidden`?`hidden`:`visible`,...r,ref:t,onPointerEnter:j(e.onPointerEnter,()=>c(`POINTER_ENTER`)),onPointerLeave:j(e.onPointerLeave,()=>c(`POINTER_LEAVE`))})})}),y9=_.forwardRef((e,t)=>{let n=p9(_9,e.__scopeScrollArea),{forceMount:r,...i}=e,[a,o]=_.useState(!1),s=e.orientation===`horizontal`,c=N9(()=>{if(n.viewport){let e=n.viewport.offsetWidth<n.viewport.scrollWidth,t=n.viewport.offsetHeight<n.viewport.scrollHeight;o(s?e:t)}},10);return P9(n.viewport,c),P9(n.content,c),(0,I.jsx)(Pe,{present:r||a,children:(0,I.jsx)(b9,{"data-state":a?`visible`:`hidden`,...i,ref:t})})}),b9=_.forwardRef((e,t)=>{let{orientation:n=`vertical`,...r}=e,i=p9(_9,e.__scopeScrollArea),a=_.useRef(null),o=_.useRef(0),[s,c]=_.useState({content:0,viewport:0,scrollbar:{size:0,paddingStart:0,paddingEnd:0}}),l=O9(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 $fe(e,o.current,s,t)}return n===`horizontal`?(0,I.jsx)(Jfe,{...u,ref:t,onThumbPositionChange:()=>{if(i.viewport&&a.current){let e=i.viewport.scrollLeft,t=A9(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)(Yfe,{...u,ref:t,onThumbPositionChange:()=>{if(i.viewport&&a.current){let e=i.viewport.scrollTop,t=A9(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}),Jfe=_.forwardRef((e,t)=>{let{sizes:n,onSizesChange:r,...i}=e,a=p9(_9,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)(S9,{"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":k9(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),M9(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:D9(o.paddingLeft),paddingEnd:D9(o.paddingRight)}})}})}),Yfe=_.forwardRef((e,t)=>{let{sizes:n,onSizesChange:r,...i}=e,a=p9(_9,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)(S9,{"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":k9(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),M9(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:D9(o.paddingTop),paddingEnd:D9(o.paddingBottom)}})}})}),[Xfe,x9]=f9(_9),S9=_.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=p9(_9,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=N9(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]),P9(m,w),P9(p.content,w),(0,I.jsx)(Xfe,{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})})})}),C9=`ScrollAreaThumb`,w9=_.forwardRef((e,t)=>{let{forceMount:n,...r}=e,i=x9(C9,e.__scopeScrollArea);return(0,I.jsx)(Pe,{present:n||i.hasThumb,children:(0,I.jsx)(Zfe,{ref:t,...r})})}),Zfe=_.forwardRef((e,t)=>{let{__scopeScrollArea:n,style:r,...i}=e,a=p9(C9,n),o=x9(C9,n),{onThumbPositionChange:s}=o,c=P(t,e=>o.onThumbChange(e)),l=_.useRef(void 0),u=N9(()=>{l.current&&=(l.current(),void 0)},100);return _.useEffect(()=>{let e=a.viewport;if(e){let t=()=>{if(u(),!l.current){let t=epe(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)})});w9.displayName=C9;var T9=`ScrollAreaCorner`,E9=_.forwardRef((e,t)=>{let n=p9(T9,e.__scopeScrollArea),r=!!(n.scrollbarX&&n.scrollbarY);return n.type!==`scroll`&&r?(0,I.jsx)(Qfe,{...e,ref:t}):null});E9.displayName=T9;var Qfe=_.forwardRef((e,t)=>{let{__scopeScrollArea:n,...r}=e,i=p9(T9,n),[a,o]=_.useState(0),[s,c]=_.useState(0),l=!!(a&&s);return P9(i.scrollbarX,()=>{let e=i.scrollbarX?.offsetHeight||0;i.onCornerHeightChange(e),c(e)}),P9(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 D9(e){return e?parseInt(e,10):0}function O9(e,t){let n=e/t;return isNaN(n)?0:n}function k9(e){let t=O9(e.viewport,e.content),n=e.scrollbar.paddingStart+e.scrollbar.paddingEnd,r=(e.scrollbar.size-n)*t;return Math.max(r,18)}function $fe(e,t,n,r=`ltr`){let i=k9(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 j9([c,l],d)(e)}function A9(e,t,n=`ltr`){let r=k9(t),i=t.scrollbar.paddingStart+t.scrollbar.paddingEnd,a=t.scrollbar.size-i,o=t.content-t.viewport,s=a-r,c=qq(e,n===`ltr`?[0,o]:[o*-1,0]);return j9([0,o],[0,s])(c)}function j9(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 M9(e,t){return e>0&&e<t}var epe=(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 N9(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 P9(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 F9=m9,tpe=g9,npe=E9,I9=_.forwardRef(({className:e,children:t,...n},r)=>(0,I.jsxs)(F9,{ref:r,className:U(`relative overflow-hidden`,e),...n,children:[(0,I.jsx)(tpe,{className:`h-full w-full rounded-[inherit]`,children:t}),(0,I.jsx)(L9,{}),(0,I.jsx)(npe,{})]}));I9.displayName=F9.displayName;var L9=_.forwardRef(({className:e,orientation:t=`vertical`,...n},r)=>(0,I.jsx)(v9,{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)(w9,{className:`relative flex-1 rounded-full bg-border`})}));L9.displayName=v9.displayName;function rpe(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=g_(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=g_(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">${R9(e.scenarioName)}</span>
169
+ <span class="scenario-agent">${R9(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">${R9(e.name)} <small>${e.duration}ms</small></span>`).join(``)}
182
+ </div>
183
+ ${e.failureReasons.length?`<div class="failure-reasons">${e.failureReasons.map(e=>R9(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 — ${R9(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">${R9(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">${R9(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 R9(e){return e.replace(/&/g,`&amp;`).replace(/</g,`&lt;`).replace(/>/g,`&gt;`).replace(/"/g,`&quot;`)}var ipe=`mcplab.resultAssistantScenarioHandoff`,ape=[{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 z9(e){return`mcplab/reports/result-assistant/${e}-${new Date().toISOString().replace(/[:]/g,`-`).replace(/\..+/,``)}.md`}function B9(e){let t=e.toFixed(1);return t.endsWith(`.0`)?t.slice(0,-2):t}var ope=()=>{let{id:e}=Wd(),t=Ud(),[n]=ap(),{source:r}=q_(),i=n.get(`embed`)===`1`,{configs:a}=rv(),{scenarios:o}=ov(),[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}=X7({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=R7({...s,scenarios:e}),u=B7({...s,scenarios:e});return{filteredScenarios:e,filteredTotalRuns:i,filteredPassCount:a,displayPassRate:g_(a,i,o),displayAvgToolCalls:i===0?0:c/i,displayAvgLatency:i===0||l===null?0:Math.round(l/i),displayDurationMs:l,displayToolTimeMs:u,displayToolTokenUsage:Bg(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=Gg(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(ipe,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(z9(s.id)),te(!1),P(!0))},xt=()=>{s&&(ae(!0),L(``),z(z9(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 Z7(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)($f,{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)(bv,{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)(S7,{versions:s.mcpServerVersions}),(0,I.jsxs)(`div`,{className:`flex min-w-0 flex-wrap items-center justify-end gap-2`,children:[(0,I.jsx)(W,{variant:`outline`,size:`sm`,className:`max-w-full px-2`,onClick:()=>{let e=rpe(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`})}),(0,I.jsxs)(W,{type:`button`,variant:`outline`,size:`sm`,className:`max-w-full gap-1.5`,onClick:()=>_t(),disabled:ce,title:`Show reports for this run`,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`,title:`View or edit the 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`,title:`Ask the MCP Lab Assistant about this result`,onClick:()=>gt(),children:[(0,I.jsx)(ar,{className:`h-4 w-4 text-amber-500`}),`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(),title:`Queue this evaluation again with the same settings`,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`,title:`Delete this run`,children:[ve?(0,I.jsx)(zn,{className:`h-4 w-4 animate-spin`}):(0,I.jsx)(lr,{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)(vv,{title:`Scenarios`,value:Ye.length,icon:Pn}),(0,I.jsx)(vv,{title:`Total Runs`,value:Xe,icon:Xt}),(0,I.jsx)(vv,{title:`Pass Rate`,value:Wi(Qe),icon:rn}),(0,I.jsx)(vv,{title:`Avg Tool Calls`,value:B9($e),icon:dn}),(0,I.jsx)(vv,{title:`Avg Latency`,value:`${et}ms`,icon:cr}),tt===null?null:(0,I.jsx)(vv,{title:`Total Time`,value:I7(tt),icon:_n}),nt===null?null:(0,I.jsx)(vv,{title:`Tool Duration`,value:I7(nt),icon:_n}),(0,I.jsx)(vv,{title:`Tool Tokens`,value:u6(rt?.totalTokens),icon:mr})]}),(0,I.jsxs)(`div`,{className:`grid gap-4 lg:grid-cols-4`,children:[(0,I.jsx)(Y7,{title:`Runs Pass / Fail`,passed:Ze,failed:Math.max(0,Xe-Ze-ct-lt-ut),incomplete:ct,error:lt,stopped:ut}),(0,I.jsx)(Y7,{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)(sv,{className:`p-2.5 pb-0`,children:(0,I.jsx)(cv,{className:`text-xs font-medium uppercase tracking-wider text-muted-foreground`,children:`Tool Usage`})}),(0,I.jsx)(q,{children:(0,I.jsx)(Lw,{width:`100%`,height:120,children:(0,I.jsxs)(OW,{data:at,layout:`vertical`,children:[(0,I.jsx)(zH,{type:`number`,tick:{fontSize:11}}),(0,I.jsx)(nU,{type:`category`,dataKey:`name`,tick:{fontSize:11},width:120}),(0,I.jsx)(vw,{}),(0,I.jsx)(hz,{dataKey:`count`,fill:`hsl(38, 92%, 50%)`,radius:[0,4,4,0]})]})})})]})]}),(0,I.jsxs)(K,{children:[(0,I.jsx)(sv,{className:`pb-3`,children:(0,I.jsxs)(`div`,{className:`flex items-center justify-between gap-2`,children:[(0,I.jsx)(cv,{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)(dv,{children:[(0,I.jsx)(fv,{children:(0,I.jsxs)(hv,{children:[(0,I.jsx)(gv,{className:`w-8`}),(0,I.jsx)(gv,{children:`Scenario`}),(0,I.jsx)(gv,{children:`Agent`}),(0,I.jsx)(gv,{children:`Runs`}),(0,I.jsx)(gv,{children:`Pass Rate`}),(0,I.jsx)(gv,{children:`Checks`}),(0,I.jsx)(gv,{className:`text-right`,children:`Total Time`}),(0,I.jsx)(gv,{className:`text-right`,children:`Tool Calls`}),(0,I.jsx)(gv,{className:`text-right`,children:`Tool Tokens`}),(0,I.jsx)(gv,{className:`text-right`,children:`Tool Duration`})]})}),(0,I.jsx)(pv,{children:Ye.map(t=>{let n=pt(t.scenarioId,t.agentName),r=t.scenarioName||t.scenarioId,i=Gg(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)(rZ,{open:v.has(n),onOpenChange:()=>dt(n),asChild:!0,children:(0,I.jsxs)(I.Fragment,{children:[(0,I.jsx)(iZ,{asChild:!0,children:(0,I.jsxs)(hv,{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)($f,{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?DX(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)(bv,{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:I7(L7(t),{preciseUnderTenSeconds:!0})}),(0,I.jsx)(J,{className:`text-right font-mono text-sm`,children:B9(t.avgToolCalls)}),(0,I.jsx)(J,{className:`text-right font-mono text-sm`,children:u6(t.toolTokenUsage?.totalTokens)}),(0,I.jsx)(J,{className:`text-right font-mono text-sm`,children:I7(z7(t),{preciseUnderTenSeconds:!0})})]})}),(0,I.jsx)(aZ,{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} ⊘`:``} · `:``,u6(t.toolTokenUsage?.totalTokens),` tool tokens ·`,` `,I7(L7(t),{preciseUnderTenSeconds:!0}),` `,`total time ·`,` `,I7(z7(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)($f,{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.jsx)(Hfe,{runId:e,scenario:t,langsmithTraceUrls:s.langsmithTraceUrls}),(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?lpe(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:[u6(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)(rZ,{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)(iZ,{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)(aZ,{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:c6(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:o6(e.status)})]},`${e.rule.type}-${e.rule.value??e.rule.path??``}-${t}`))})]})]})})]})})(),(0,I.jsx)(rZ,{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)(iZ,{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)(aZ,{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)(rZ,{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)(iZ,{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)(aZ,{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:[`·`,` `,u6(r?.totalTokens),`tok`]})]})}),i&&(0,I.jsx)(yl,{className:`text-xs`,children:`${t.name} · tokens total: ${u6(r?.totalTokens)} · in: ${u6(r?.inputTokens)} · out: ${u6(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:`,` `,u6(t.totalTokens),` `,`· in:`,` `,u6(t.inputTokens),` `,`· out:`,` `,u6(t.outputTokens)]})]},e))})]})]})})]})}),(0,I.jsx)(rZ,{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)(iZ,{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)(aZ,{children:(0,I.jsx)(W9,{text:e.finalAnswer||`No final answer captured.`,maxLength:1200,className:`text-xs text-foreground`})})]})}),(0,I.jsx)(rZ,{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)(iZ,{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)(aZ,{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)(spe,{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)(SX,{value:k,onValueChange:e=>A(e),className:`min-w-0 -mb-px px-3 pt-1`,children:(0,I.jsxs)(CX,{className:`h-auto w-full justify-start rounded-none border-b bg-transparent p-0`,children:[(0,I.jsx)(wX,{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)(wX,{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)(wX,{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)(F7,{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:ape,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=cpe(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)(sv,{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)(cv,{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)(DY,{value:le,onValueChange:ue,children:[(0,I.jsx)(kY,{className:`h-8`,children:(0,I.jsx)(OY,{placeholder:`Select a report`})}),(0,I.jsx)(MY,{children:oe.map(e=>(0,I.jsx)(Z,{value:e.relativePath,children:e.name},e.path))})]})]}):null})}),(0,I.jsx)(I9,{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)(k3,{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)(sv,{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)(cv,{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)(rX,{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)(Y6,{open:N,onOpenChange:e=>!ne&&P(e),children:(0,I.jsxs)(Z6,{className:`max-w-2xl`,children:[(0,I.jsxs)(Q6,{children:[(0,I.jsx)(e8,{children:ie?`Create markdown report`:`Approve MCP action: write markdown report`}),(0,I.jsx)(t8,{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)(Tp,{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)(GX,{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)(rX,{value:F,onChange:e=>L(e.target.value),rows:10,className:`font-mono text-xs`,disabled:ne})]})]}),(0,I.jsxs)($6,{children:[(0,I.jsx)(r8,{disabled:ne,children:`Cancel`}),(0,I.jsx)(n8,{onClick:e=>{e.preventDefault(),St()},disabled:ne,children:ne?`Writing...`:ie?`Save Report`:`Approve & Write`})]})]})}),(0,I.jsx)(Y6,{open:ge,onOpenChange:_e,children:(0,I.jsxs)(Z6,{children:[(0,I.jsxs)(Q6,{children:[(0,I.jsx)(e8,{children:`Delete run?`}),(0,I.jsxs)(t8,{children:[`This will permanently remove run `,(0,I.jsx)(`span`,{className:`font-mono`,children:s?.id}),`. This action cannot be undone.`]})]}),(0,I.jsxs)($6,{children:[(0,I.jsx)(r8,{disabled:ve,children:`Cancel`}),(0,I.jsx)(n8,{disabled:ve||!s?.id,onClick:e=>{e.preventDefault(),wt()},className:`bg-destructive text-destructive-foreground hover:bg-destructive/90`,children:ve?`Deleting...`:`Delete`})]})]})})]})]})};function spe({item:e,fallbackUserPrompt:t}){if(e.kind===`tool_call`){let t=V9(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=V9(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=H9(e.text,e.kind),i=t?H9(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 V9(e,t){let n=t===`input`?e.estimatedTokens?.inputTokens:e.estimatedTokens?.outputTokens;return typeof n==`number`?` · ${u6(n)} tokens`:``}function H9(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 cpe(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)(rZ,{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)(iZ,{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)(aZ,{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)(k3,{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 lpe(e,t,n,r){return s6({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%)`],upe=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 dpe(e){let t=J9(e);return t?`${t.getUTCFullYear()}-${String(t.getUTCMonth()+1).padStart(2,`0`)}-${String(t.getUTCDate()).padStart(2,`0`)}`:e}function fpe(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 ppe(e){return e.configName?.trim()||AW(e).slice(0,2).join(`, `)||`n/a`}function mpe(e){return e.configPath?.trim()||void 0}function Z9({run:e,className:t}){let n=ppe(e),r=mpe(e);return(0,I.jsx)(`div`,{className:t,title:r,children:n})}function hpe(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 gpe(e,t){return e.length===t.length&&e.every((e,n)=>e===t[n])}function _pe(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 vpe=()=>{let{source:e}=q_(),[t,n]=ap(),r=t9(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=C7(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=Q7.find(e=>e.value===E)??Q7[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(MW))}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(MW))):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-(Q7.find(e=>e.value===E)??Q7[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=dpe(n.timestamp);r!==t&&(e.push({type:`day-separator`,dayKey:r,dayLabel:fpe(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,jW(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=>gpe(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 Q7.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}=_pe(t);return{agentId:e.id,agentName:e.name,provider:s,model:c,passRate:g_(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)($8,{open:b,onOpenChange:x,children:[(0,I.jsx)(e5,{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)(t5,{className:`w-[260px] p-0`,align:`start`,children:(0,I.jsxs)(D5,{children:[(0,I.jsx)(O5,{placeholder:`Search scenarios...`}),(0,I.jsxs)(k5,{id:`compare-scenario-command-list`,children:[(0,I.jsx)(A5,{children:`No scenarios found.`}),(0,I.jsxs)(j5,{children:[(0,I.jsx)(M5,{value:`all scenarios`,onSelect:()=>{y(`all`),x(!1)},children:`All scenarios`}),me.map(e=>(0,I.jsx)(M5,{value:e,onSelect:()=>{y(e),x(!1)},children:e},e))]})]})]})})]}),(0,I.jsxs)($8,{open:N,onOpenChange:P,children:[(0,I.jsx)(e5,{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)(t5,{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`}),Q7.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)(Tp,{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)(Tp,{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)(f8,{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)(sv,{className:`pb-3`,children:(0,I.jsx)(cv,{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)(DY,{value:re,onValueChange:ie,children:[(0,I.jsx)(kY,{children:(0,I.jsx)(OY,{placeholder:`Select run`})}),(0,I.jsx)(MY,{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)($8,{open:B,onOpenChange:le,children:[(0,I.jsx)(e5,{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)(t5,{className:`w-(--radix-popover-trigger-width) p-0`,align:`start`,children:(0,I.jsxs)(D5,{children:[(0,I.jsx)(O5,{placeholder:`Search scenarios...`}),(0,I.jsxs)(k5,{id:`compare-within-run-scenario-command-list`,children:[(0,I.jsx)(A5,{children:`No scenarios found.`}),(0,I.jsxs)(j5,{children:[(0,I.jsx)(M5,{value:`all scenarios`,onSelect:()=>{ce(`all`),le(!1)},children:`All scenarios`}),De.map(e=>(0,I.jsx)(M5,{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)(GX,{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)(dv,{containerClassName:`max-h-144 overflow-auto`,children:[(0,I.jsx)(fv,{className:`[&_th]:sticky [&_th]:top-0 [&_th]:z-10 [&_th]:bg-background`,children:(0,I.jsxs)(hv,{children:[(0,I.jsx)(gv,{className:`w-10`}),(0,I.jsx)(gv,{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)(gv,{children:`Evaluated`}),(0,I.jsx)(gv,{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)(gv,{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)(gv,{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)(gv,{className:`text-right`,children:`Tool Tokens`}),(0,I.jsx)(gv,{className:`text-right`,children:`Agents`}),(0,I.jsx)(gv,{className:`w-[140px] text-right`,children:`Action`})]})}),(0,I.jsx)(pv,{children:ve.map((e,t)=>e.type===`day-separator`?(0,I.jsx)(hv,{className:`bg-muted/30 hover:bg-muted/30`,children:(0,I.jsx)(J,{colSpan:upe,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)(hv,{children:[(0,I.jsx)(J,{children:(0,I.jsx)(GX,{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)(S7,{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=R7(e.run);return t===null?null:(0,I.jsxs)(`div`,{className:`font-mono text-[11px] text-muted-foreground/90`,children:[`Total time: `,I7(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)(bv,{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:u6(e.run.toolTokenUsage?.totalTokens)}),(()=>{let t=B7(e.run);return t===null?null:(0,I.jsxs)(`div`,{className:`font-mono text-[11px] text-muted-foreground/90`,children:[`Tool time: `,I7(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)($f,{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)(sv,{className:`pb-3`,children:(0,I.jsx)(cv,{className:`text-base`,children:`Summary Comparison`})}),(0,I.jsx)(q,{className:`max-h-96 overflow-auto p-0`,children:(0,I.jsxs)(dv,{className:`table-fixed`,children:[(0,I.jsx)(fv,{className:`[&_th]:sticky [&_th]:top-0 [&_th]:z-10 [&_th]:bg-background`,children:(0,I.jsxs)(hv,{children:[(0,I.jsx)(gv,{className:`w-[220px]`,children:`Metric`}),_e.map((e,t)=>(0,I.jsxs)(gv,{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)(pv,{children:[(0,I.jsxs)(hv,{children:[(0,I.jsx)(J,{className:`font-medium`,children:`Pass Rate`}),_e.map(e=>(0,I.jsx)(J,{children:(0,I.jsx)(bv,{rate:e.overallPassRate})},e.id))]}),(0,I.jsxs)(hv,{children:[(0,I.jsx)(J,{className:`font-medium`,children:`Checks Pass Rate`}),_e.map(e=>(0,I.jsx)(J,{className:`font-mono`,children:hpe(e)},e.id))]}),(0,I.jsxs)(hv,{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)(hv,{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)(hv,{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)(hv,{children:[(0,I.jsx)(J,{className:`font-medium`,children:`Total Time`}),_e.map(e=>(0,I.jsx)(J,{className:`font-mono`,children:(()=>{let t=R7(e);return t===null?`—`:I7(t)})()},e.id))]}),(0,I.jsxs)(hv,{children:[(0,I.jsx)(J,{className:`font-medium`,children:`Tool Time`}),_e.map(e=>(0,I.jsx)(J,{className:`font-mono`,children:(()=>{let t=B7(e);return t===null?`—`:I7(t)})()},e.id))]})]})]})})]}),(0,I.jsxs)(K,{children:[(0,I.jsx)(sv,{className:`pb-3`,children:(0,I.jsx)(cv,{className:`text-base`,children:`Scenario Breakdown`})}),(0,I.jsx)(q,{className:`max-h-104 overflow-auto p-0`,children:(0,I.jsxs)(dv,{className:`table-fixed`,children:[(0,I.jsx)(fv,{className:`[&_th]:sticky [&_th]:top-0 [&_th]:z-10 [&_th]:bg-background`,children:(0,I.jsxs)(hv,{children:[(0,I.jsx)(gv,{className:`w-[220px]`,children:`Scenario`}),_e.map((e,t)=>(0,I.jsxs)(gv,{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)(S7,{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)(pv,{children:Ce.map(e=>(0,I.jsxs)(hv,{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)(bv,{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)(sv,{className:`pb-3`,children:(0,I.jsx)(cv,{className:`text-base`,children:`Pass Rate Trend`})}),(0,I.jsx)(q,{className:`h-72`,children:(0,I.jsx)(Lw,{width:`100%`,height:`100%`,children:(0,I.jsxs)(DW,{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)(zH,{dataKey:`idx`,tickFormatter:e=>String(e)}),(0,I.jsx)(nU,{unit:`%`,domain:[0,100]}),(0,I.jsx)(vw,{formatter:e=>[`${e}%`,`Pass Rate`],labelFormatter:e=>`Run ${e}`}),(0,I.jsx)(SC,{}),(0,I.jsx)(SH,{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)($f,{to:Ne.link,children:`Compare full results`}):(0,I.jsx)($f,{to:`/results/${encodeURIComponent(Te.id)}${Te.configId?`?configId=${encodeURIComponent(Te.configId)}`:``}`,children:`Open full result`})})]})})}),(0,I.jsxs)(K,{children:[(0,I.jsx)(sv,{className:`pb-3`,children:(0,I.jsx)(cv,{className:`text-base`,children:`Agent Summary`})}),(0,I.jsx)(q,{className:`max-h-96 overflow-auto p-0`,children:(0,I.jsxs)(dv,{children:[(0,I.jsx)(fv,{className:`[&_th]:sticky [&_th]:top-0 [&_th]:z-10 [&_th]:bg-background`,children:(0,I.jsxs)(hv,{children:[(0,I.jsx)(gv,{children:`Metric`}),Pe.map(e=>(0,I.jsxs)(gv,{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?DX(e.provider):null,e.model].filter(Boolean).join(` · `)})]},e.agentId))]})}),(0,I.jsxs)(pv,{children:[(0,I.jsxs)(hv,{children:[(0,I.jsx)(J,{className:`font-medium`,children:`Pass Rate`}),Pe.map(e=>(0,I.jsx)(J,{children:(0,I.jsx)(bv,{rate:e.passRate})},e.agentId))]}),(0,I.jsxs)(hv,{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)(hv,{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)(hv,{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)(sv,{className:`pb-3`,children:(0,I.jsx)(cv,{className:`text-base`,children:`Scenario × Agent Matrix`})}),(0,I.jsx)(q,{className:`max-h-136 overflow-auto p-0`,children:(0,I.jsxs)(dv,{className:`table-fixed`,children:[(0,I.jsx)(fv,{className:`[&_th]:sticky [&_th]:top-0 [&_th]:z-10 [&_th]:bg-background`,children:(0,I.jsxs)(hv,{children:[(0,I.jsx)(gv,{className:`w-[260px]`,children:`Scenario`}),Me.map(e=>{let t=Pe.find(t=>t.agentId===e.id);return(0,I.jsxs)(gv,{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?DX(t.provider):null,t.model].filter(Boolean).join(` · `)})]},e.id)})]})}),(0,I.jsx)(pv,{children:je.map(e=>(0,I.jsxs)(hv,{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)(bv,{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}`:``}`},ype=()=>{let{source:e}=q_(),[t]=ap(),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)(sv,{children:(0,I.jsx)(cv,{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)($f,{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)($f,{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)(sv,{className:`py-3`,children:(0,I.jsx)(cv,{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)(sv,{className:`py-3`,children:(0,I.jsx)(cv,{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 bpe(e){return e.match(/(?:^|\/)(?:result-assistant|results?)\/([0-9]{8}-[0-9]{6})(?:-|\/)/i)?.[1]??null}function xpe(){let{source:e}=q_(),[t,n]=(0,_.useState)([]),[r,i]=(0,_.useState)(!0),[a,o]=(0,_.useState)(null),[s,c]=(0,_.useState)(!1),l=C7(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)($f,{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)(dv,{children:[(0,I.jsx)(fv,{children:(0,I.jsxs)(hv,{children:[(0,I.jsx)(gv,{children:`Report`}),(0,I.jsx)(gv,{children:`Result`}),(0,I.jsx)(gv,{children:`Folder`}),(0,I.jsx)(gv,{children:`Timestamp`}),(0,I.jsx)(gv,{className:`w-10`})]})}),(0,I.jsx)(pv,{children:t.map(e=>(0,I.jsxs)(hv,{children:[(0,I.jsx)(J,{children:(0,I.jsxs)(`div`,{className:`space-y-1`,children:[(0,I.jsx)($f,{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=bpe(e.relativePath);return t?(0,I.jsx)($f,{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)(Lq,{children:[(0,I.jsx)(Rq,{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)(Vq,{align:`end`,children:[(0,I.jsx)(Hq,{asChild:!0,children:(0,I.jsx)($f,{to:`/markdown-reports/view?id=${encodeURIComponent(e.reportId)}`,children:`View`})}),(0,I.jsxs)(Hq,{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)(Y6,{open:!!a,onOpenChange:e=>!e&&o(null),children:(0,I.jsxs)(Z6,{children:[(0,I.jsxs)(Q6,{children:[(0,I.jsx)(e8,{children:`Delete markdown report?`}),(0,I.jsx)(t8,{children:m?`Delete '${m.name}' from disk? This cannot be undone.`:`Delete this report from disk? This cannot be undone.`})]}),(0,I.jsxs)($6,{children:[(0,I.jsx)(r8,{disabled:s,children:`Cancel`}),(0,I.jsx)(n8,{onClick:e=>{e.preventDefault(),h()},disabled:s,children:s?`Deleting...`:`Delete`})]})]})})]})}function Spe(e){return e<1024?`${e} B`:e<1048576?`${(e/1024).toFixed(1)} KB`:`${(e/1048576).toFixed(1)} MB`}function Cpe(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 wpe(){let{source:e}=q_(),[t]=ap(),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)($f,{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)($f,{to:`/markdown-reports`,children:`Back to Markdown Reports`})})]});let f=Cpe(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:Spe(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)($f,{to:`/results/${encodeURIComponent(f)}`,children:`Open Result`})})]}):null,(0,I.jsx)(W,{asChild:!0,variant:`outline`,size:`sm`,children:(0,I.jsx)($f,{to:`/markdown-reports`,children:`Back to reports`})})]})]}),(0,I.jsx)(K,{children:(0,I.jsx)(q,{className:`pt-6`,children:(0,I.jsx)(k3,{text:i.content,variant:`assistant`})})}),f?(0,I.jsx)(Rh,{open:u,onOpenChange:d,children:(0,I.jsxs)(Hh,{side:`right`,className:`w-[96vw] max-w-none p-0 sm:max-w-5xl`,children:[(0,I.jsx)(Uh,{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)(Wh,{className:`text-base`,children:[`Result `,f]}),(0,I.jsx)(W,{asChild:!0,variant:`outline`,size:`sm`,children:(0,I.jsx)($f,{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 Tpe=()=>{let e=Bd();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`})]})})},Epe=new vu;function Dpe(){let{scenarioId:e}=Wd();return(0,I.jsx)(cf,{to:e?`/libraries/test-cases/${encodeURIComponent(e)}`:`/libraries/test-cases`,replace:!0})}function Ope(){return(0,I.jsxs)(ff,{children:[(0,I.jsxs)(uf,{element:(0,I.jsx)(ev,{}),children:[(0,I.jsx)(uf,{path:`/`,element:(0,I.jsx)(IW,{})}),(0,I.jsx)(uf,{path:`/mcp-evaluations`,element:(0,I.jsx)(ZY,{})}),(0,I.jsx)(uf,{path:`/mcp-evaluations/:id`,element:(0,I.jsx)(O6,{})}),(0,I.jsx)(uf,{path:`/mcp-evaluations/:id/:tab`,element:(0,I.jsx)(O6,{})}),(0,I.jsx)(uf,{path:`/tool-analysis`,element:(0,I.jsx)(sfe,{})}),(0,I.jsx)(uf,{path:`/tool-analysis-results`,element:(0,I.jsx)(cfe,{})}),(0,I.jsx)(uf,{path:`/tool-analysis-results/:id`,element:(0,I.jsx)(lfe,{})}),(0,I.jsx)(uf,{path:`/oauth-debugger`,element:(0,I.jsx)(hfe,{})}),(0,I.jsx)(uf,{path:`/libraries/servers`,element:(0,I.jsx)(mue,{})}),(0,I.jsx)(uf,{path:`/libraries/servers/:serverId`,element:(0,I.jsx)(xue,{})}),(0,I.jsx)(uf,{path:`/libraries/agents`,element:(0,I.jsx)(Sue,{defaultType:`llm`})}),(0,I.jsx)(uf,{path:`/libraries/agents/:agentName`,element:(0,I.jsx)(Pde,{})}),(0,I.jsx)(uf,{path:`/libraries/test-cases`,element:(0,I.jsx)(I5,{})}),(0,I.jsx)(uf,{path:`/libraries/test-cases/:testCaseId`,element:(0,I.jsx)(I5,{})}),(0,I.jsx)(uf,{path:`/libraries/scenarios`,element:(0,I.jsx)(cf,{to:`/libraries/test-cases`,replace:!0})}),(0,I.jsx)(uf,{path:`/libraries/scenarios/:scenarioId`,element:(0,I.jsx)(Dpe,{})}),(0,I.jsx)(uf,{path:`/settings`,element:(0,I.jsx)(Ide,{})}),(0,I.jsx)(uf,{path:`/settings/mcp`,element:(0,I.jsx)(Bde,{})}),(0,I.jsx)(uf,{path:`/run`,element:(0,I.jsx)(Sfe,{})}),(0,I.jsx)(uf,{path:`/results`,element:(0,I.jsx)(Bfe,{})}),(0,I.jsx)(uf,{path:`/results/:id`,element:(0,I.jsx)(ope,{})}),(0,I.jsx)(uf,{path:`/markdown-reports`,element:(0,I.jsx)(xpe,{})}),(0,I.jsx)(uf,{path:`/markdown-reports/view`,element:(0,I.jsx)(wpe,{})}),(0,I.jsx)(uf,{path:`/compare`,element:(0,I.jsx)(vpe,{})}),(0,I.jsx)(uf,{path:`/compare/results`,element:(0,I.jsx)(ype,{})})]}),(0,I.jsx)(uf,{path:`*`,element:(0,I.jsx)(Tpe,{})})]})}(0,g.createRoot)(document.getElementById(`root`)).render((0,I.jsx)(()=>(0,I.jsx)(bu,{client:Epe,children:(0,I.jsx)(gl,{children:(0,I.jsx)(K_,{children:(0,I.jsx)(av,{children:(0,I.jsxs)(nv,{children:[(0,I.jsx)(ea,{}),(0,I.jsx)(Fa,{}),(0,I.jsx)(Qf,{children:(0,I.jsx)(Ope,{})})]})})})})}),{}));