@modelcontextprotocol/inspector 2.2.0 → 2.4.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -1,242 +0,0 @@
1
- const __vite__mapDeps=(i,m=__vite__mapDeps,d=(m.f||(m.f=["assets/markup-CWGodlA2.js","assets/markup-D5BvAyPW.js","assets/markdown-CZCm46w1.js"])))=>i.map(i=>d[i]);
2
- 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)),u=(e=>typeof require<`u`?require:typeof Proxy<`u`?new Proxy(e,{get:(e,t)=>(typeof require<`u`?require:e)[t]}):e)(function(e){if(typeof require<`u`)return require.apply(this,arguments);throw Error('Calling `require` for "'+e+"\" in an environment that doesn't expose the `require` function. See https://rolldown.rs/in-depth/bundling-cjs#require-external-modules for more details.")});(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 d=o((e=>{var t=Symbol.for(`react.transitional.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.consumer`),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.for(`react.activity`),p=Symbol.iterator;function m(e){return typeof e!=`object`||!e?null:(e=p&&e[p]||e[`@@iterator`],typeof e==`function`?e:null)}var h={isMounted:function(){return!1},enqueueForceUpdate:function(){},enqueueReplaceState:function(){},enqueueSetState:function(){}},g=Object.assign,_={};function v(e,t,n){this.props=e,this.context=t,this.refs=_,this.updater=n||h}v.prototype.isReactComponent={},v.prototype.setState=function(e,t){if(typeof e!=`object`&&typeof e!=`function`&&e!=null)throw Error(`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`)},v.prototype.forceUpdate=function(e){this.updater.enqueueForceUpdate(this,e,`forceUpdate`)};function y(){}y.prototype=v.prototype;function b(e,t,n){this.props=e,this.context=t,this.refs=_,this.updater=n||h}var x=b.prototype=new y;x.constructor=b,g(x,v.prototype),x.isPureReactComponent=!0;var S=Array.isArray;function C(){}var w={H:null,A:null,T:null,S:null},T=Object.prototype.hasOwnProperty;function E(e,n,r){var i=r.ref;return{$$typeof:t,type:e,key:n,ref:i===void 0?null:i,props:r}}function D(e,t){return E(e.type,t,e.props)}function O(e){return typeof e==`object`&&!!e&&e.$$typeof===t}function k(e){var t={"=":`=0`,":":`=2`};return`$`+e.replace(/[=:]/g,function(e){return t[e]})}var A=/\/+/g;function j(e,t){return typeof e==`object`&&e&&e.key!=null?k(``+e.key):t.toString(36)}function M(e){switch(e.status){case`fulfilled`:return e.value;case`rejected`:throw e.reason;default:switch(typeof e.status==`string`?e.then(C,C):(e.status=`pending`,e.then(function(t){e.status===`pending`&&(e.status=`fulfilled`,e.value=t)},function(t){e.status===`pending`&&(e.status=`rejected`,e.reason=t)})),e.status){case`fulfilled`:return e.value;case`rejected`:throw e.reason}}throw e}function N(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`bigint`:case`string`:case`number`:c=!0;break;case`object`:switch(e.$$typeof){case t:case n:c=!0;break;case d:return c=e._init,N(c(e._payload),r,i,a,o)}}if(c)return o=o(e),c=a===``?`.`+j(e,0):a,S(o)?(i=``,c!=null&&(i=c.replace(A,`$&/`)+`/`),N(o,r,i,``,function(e){return e})):o!=null&&(O(o)&&(o=D(o,i+(o.key==null||e&&e.key===o.key?``:(``+o.key).replace(A,`$&/`)+`/`)+c)),r.push(o)),1;c=0;var l=a===``?`.`:a+`:`;if(S(e))for(var u=0;u<e.length;u++)a=e[u],s=l+j(a,u),c+=N(a,r,i,s,o);else if(u=m(e),typeof u==`function`)for(e=u.call(e),u=0;!(a=e.next()).done;)a=a.value,s=l+j(a,u++),c+=N(a,r,i,s,o);else if(s===`object`){if(typeof e.then==`function`)return N(M(e),r,i,a,o);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 ee(e,t,n){if(e==null)return e;var r=[],i=0;return N(e,r,``,``,function(e){return t.call(n,e,i++)}),r}function te(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=typeof reportError==`function`?reportError:function(e){if(typeof window==`object`&&typeof window.ErrorEvent==`function`){var t=new window.ErrorEvent(`error`,{bubbles:!0,cancelable:!0,message:typeof e==`object`&&e&&typeof e.message==`string`?String(e.message):String(e),error:e});if(!window.dispatchEvent(t))return}else if(typeof process==`object`&&typeof process.emit==`function`){process.emit(`uncaughtException`,e);return}console.error(e)},F={map:ee,forEach:function(e,t,n){ee(e,function(){t.apply(this,arguments)},n)},count:function(e){var t=0;return ee(e,function(){t++}),t},toArray:function(e){return ee(e,function(e){return e})||[]},only:function(e){if(!O(e))throw Error(`React.Children.only expected to receive a single React element child.`);return e}};e.Activity=f,e.Children=F,e.Component=v,e.Fragment=r,e.Profiler=a,e.PureComponent=b,e.StrictMode=i,e.Suspense=l,e.__CLIENT_INTERNALS_DO_NOT_USE_OR_WARN_USERS_THEY_CANNOT_UPGRADE=w,e.__COMPILER_RUNTIME={__proto__:null,c:function(e){return w.H.useMemoCache(e)}},e.cache=function(e){return function(){return e.apply(null,arguments)}},e.cacheSignal=function(){return null},e.cloneElement=function(e,t,n){if(e==null)throw Error(`The argument must be a React element, but you passed `+e+`.`);var r=g({},e.props),i=e.key;if(t!=null)for(a in t.key!==void 0&&(i=``+t.key),t)!T.call(t,a)||a===`key`||a===`__self`||a===`__source`||a===`ref`&&t.ref===void 0||(r[a]=t[a]);var a=arguments.length-2;if(a===1)r.children=n;else if(1<a){for(var o=Array(a),s=0;s<a;s++)o[s]=arguments[s+2];r.children=o}return E(e.type,i,r)},e.createContext=function(e){return e={$$typeof:s,_currentValue:e,_currentValue2:e,_threadCount:0,Provider:null,Consumer:null},e.Provider=e,e.Consumer={$$typeof:o,_context:e},e},e.createElement=function(e,t,n){var r,i={},a=null;if(t!=null)for(r in t.key!==void 0&&(a=``+t.key),t)T.call(t,r)&&r!==`key`&&r!==`__self`&&r!==`__source`&&(i[r]=t[r]);var o=arguments.length-2;if(o===1)i.children=n;else if(1<o){for(var s=Array(o),c=0;c<o;c++)s[c]=arguments[c+2];i.children=s}if(e&&e.defaultProps)for(r in o=e.defaultProps,o)i[r]===void 0&&(i[r]=o[r]);return E(e,a,i)},e.createRef=function(){return{current:null}},e.forwardRef=function(e){return{$$typeof:c,render:e}},e.isValidElement=O,e.lazy=function(e){return{$$typeof:d,_payload:{_status:-1,_result:e},_init:te}},e.memo=function(e,t){return{$$typeof:u,type:e,compare:t===void 0?null:t}},e.startTransition=function(e){var t=w.T,n={};w.T=n;try{var r=e(),i=w.S;i!==null&&i(n,r),typeof r==`object`&&r&&typeof r.then==`function`&&r.then(C,P)}catch(e){P(e)}finally{t!==null&&n.types!==null&&(t.types=n.types),w.T=t}},e.unstable_useCacheRefresh=function(){return w.H.useCacheRefresh()},e.use=function(e){return w.H.use(e)},e.useActionState=function(e,t,n){return w.H.useActionState(e,t,n)},e.useCallback=function(e,t){return w.H.useCallback(e,t)},e.useContext=function(e){return w.H.useContext(e)},e.useDebugValue=function(){},e.useDeferredValue=function(e,t){return w.H.useDeferredValue(e,t)},e.useEffect=function(e,t){return w.H.useEffect(e,t)},e.useEffectEvent=function(e){return w.H.useEffectEvent(e)},e.useId=function(){return w.H.useId()},e.useImperativeHandle=function(e,t,n){return w.H.useImperativeHandle(e,t,n)},e.useInsertionEffect=function(e,t){return w.H.useInsertionEffect(e,t)},e.useLayoutEffect=function(e,t){return w.H.useLayoutEffect(e,t)},e.useMemo=function(e,t){return w.H.useMemo(e,t)},e.useOptimistic=function(e,t){return w.H.useOptimistic(e,t)},e.useReducer=function(e,t,n){return w.H.useReducer(e,t,n)},e.useRef=function(e){return w.H.useRef(e)},e.useState=function(e){return w.H.useState(e)},e.useSyncExternalStore=function(e,t,n){return w.H.useSyncExternalStore(e,t,n)},e.useTransition=function(){return w.H.useTransition()},e.version=`19.2.8`})),f=o(((e,t)=>{t.exports=d()})),p=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(e.unstable_now=void 0,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=!1,_=typeof setTimeout==`function`?setTimeout:null,v=typeof clearTimeout==`function`?clearTimeout:null,y=typeof setImmediate<`u`?setImmediate:null;function b(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 x(e){if(h=!1,b(e),!m)if(n(c)!==null)m=!0,S||(S=!0,O());else{var t=n(l);t!==null&&j(x,t.startTime-e)}}var S=!1,C=-1,w=5,T=-1;function E(){return g?!0:!(e.unstable_now()-T<w)}function D(){if(g=!1,S){var t=e.unstable_now();T=t;var i=!0;try{a:{m=!1,h&&(h=!1,v(C),C=-1),p=!0;var a=f;try{b:{for(b(t),d=n(c);d!==null&&!(d.expirationTime>t&&E());){var o=d.callback;if(typeof o==`function`){d.callback=null,f=d.priorityLevel;var s=o(d.expirationTime<=t);if(t=e.unstable_now(),typeof s==`function`){d.callback=s,b(t),i=!0;break b}d===n(c)&&r(c),b(t)}else r(c);d=n(c)}if(d!==null)i=!0;else{var u=n(l);u!==null&&j(x,u.startTime-t),i=!1}}break a}finally{d=null,f=a,p=!1}}}finally{i?O():S=!1}}}var O;if(typeof y==`function`)O=function(){y(D)};else if(typeof MessageChannel<`u`){var k=new MessageChannel,A=k.port2;k.port1.onmessage=D,O=function(){A.postMessage(null)}}else O=function(){_(D,0)};function j(t,n){C=_(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_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`):w=0<e?Math.floor(1e3/e):5},e.unstable_getCurrentPriorityLevel=function(){return f},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_requestPaint=function(){g=!0},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?(v(C),C=-1):h=!0,j(x,a-o))):(r.sortIndex=s,t(c,r),m||p||(m=!0,S||(S=!0,O()))),r},e.unstable_shouldYield=E,e.unstable_wrapCallback=function(e){var t=f;return function(){var n=f;f=t;try{return e.apply(this,arguments)}finally{f=n}}}})),m=o(((e,t)=>{t.exports=p()})),h=o((e=>{var t=f();function n(e){var t=`https://react.dev/errors/`+e;if(1<arguments.length){t+=`?args[]=`+encodeURIComponent(arguments[1]);for(var n=2;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.`}function r(){}var i={d:{f:r,r:function(){throw Error(n(522))},D:r,C:r,L:r,m:r,X:r,S:r,M:r},p:0,findDOMNode:null},a=Symbol.for(`react.portal`);function o(e,t,n){var r=3<arguments.length&&arguments[3]!==void 0?arguments[3]:null;return{$$typeof:a,key:r==null?null:``+r,children:e,containerInfo:t,implementation:n}}var s=t.__CLIENT_INTERNALS_DO_NOT_USE_OR_WARN_USERS_THEY_CANNOT_UPGRADE;function c(e,t){if(e===`font`)return``;if(typeof t==`string`)return t===`use-credentials`?t:``}e.__DOM_INTERNALS_DO_NOT_USE_OR_WARN_USERS_THEY_CANNOT_UPGRADE=i,e.createPortal=function(e,t){var r=2<arguments.length&&arguments[2]!==void 0?arguments[2]:null;if(!t||t.nodeType!==1&&t.nodeType!==9&&t.nodeType!==11)throw Error(n(299));return o(e,t,null,r)},e.flushSync=function(e){var t=s.T,n=i.p;try{if(s.T=null,i.p=2,e)return e()}finally{s.T=t,i.p=n,i.d.f()}},e.preconnect=function(e,t){typeof e==`string`&&(t?(t=t.crossOrigin,t=typeof t==`string`?t===`use-credentials`?t:``:void 0):t=null,i.d.C(e,t))},e.prefetchDNS=function(e){typeof e==`string`&&i.d.D(e)},e.preinit=function(e,t){if(typeof e==`string`&&t&&typeof t.as==`string`){var n=t.as,r=c(n,t.crossOrigin),a=typeof t.integrity==`string`?t.integrity:void 0,o=typeof t.fetchPriority==`string`?t.fetchPriority:void 0;n===`style`?i.d.S(e,typeof t.precedence==`string`?t.precedence:void 0,{crossOrigin:r,integrity:a,fetchPriority:o}):n===`script`&&i.d.X(e,{crossOrigin:r,integrity:a,fetchPriority:o,nonce:typeof t.nonce==`string`?t.nonce:void 0})}},e.preinitModule=function(e,t){if(typeof e==`string`)if(typeof t==`object`&&t){if(t.as==null||t.as===`script`){var n=c(t.as,t.crossOrigin);i.d.M(e,{crossOrigin:n,integrity:typeof t.integrity==`string`?t.integrity:void 0,nonce:typeof t.nonce==`string`?t.nonce:void 0})}}else t??i.d.M(e)},e.preload=function(e,t){if(typeof e==`string`&&typeof t==`object`&&t&&typeof t.as==`string`){var n=t.as,r=c(n,t.crossOrigin);i.d.L(e,n,{crossOrigin:r,integrity:typeof t.integrity==`string`?t.integrity:void 0,nonce:typeof t.nonce==`string`?t.nonce:void 0,type:typeof t.type==`string`?t.type:void 0,fetchPriority:typeof t.fetchPriority==`string`?t.fetchPriority:void 0,referrerPolicy:typeof t.referrerPolicy==`string`?t.referrerPolicy:void 0,imageSrcSet:typeof t.imageSrcSet==`string`?t.imageSrcSet:void 0,imageSizes:typeof t.imageSizes==`string`?t.imageSizes:void 0,media:typeof t.media==`string`?t.media:void 0})}},e.preloadModule=function(e,t){if(typeof e==`string`)if(t){var n=c(t.as,t.crossOrigin);i.d.m(e,{as:typeof t.as==`string`&&t.as!==`script`?t.as:void 0,crossOrigin:n,integrity:typeof t.integrity==`string`?t.integrity:void 0})}else i.d.m(e)},e.requestFormReset=function(e){i.d.r(e)},e.unstable_batchedUpdates=function(e,t){return e(t)},e.useFormState=function(e,t,n){return s.H.useFormState(e,t,n)},e.useFormStatus=function(){return s.H.useHostTransitionStatus()},e.version=`19.2.8`})),g=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=h()})),_=o((e=>{var t=m(),n=f(),r=g();function i(e){var t=`https://react.dev/errors/`+e;if(1<arguments.length){t+=`?args[]=`+encodeURIComponent(arguments[1]);for(var n=2;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.`}function a(e){return!(!e||e.nodeType!==1&&e.nodeType!==9&&e.nodeType!==11)}function o(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 s(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 c(e){if(e.tag===31){var t=e.memoizedState;if(t===null&&(e=e.alternate,e!==null&&(t=e.memoizedState)),t!==null)return t.dehydrated}return null}function l(e){if(o(e)!==e)throw Error(i(188))}function u(e){var t=e.alternate;if(!t){if(t=o(e),t===null)throw Error(i(188));return t===e?e:null}for(var n=e,r=t;;){var a=n.return;if(a===null)break;var s=a.alternate;if(s===null){if(r=a.return,r!==null){n=r;continue}break}if(a.child===s.child){for(s=a.child;s;){if(s===n)return l(a),e;if(s===r)return l(a),t;s=s.sibling}throw Error(i(188))}if(n.return!==r.return)n=a,r=s;else{for(var c=!1,u=a.child;u;){if(u===n){c=!0,n=a,r=s;break}if(u===r){c=!0,r=a,n=s;break}u=u.sibling}if(!c){for(u=s.child;u;){if(u===n){c=!0,n=s,r=a;break}if(u===r){c=!0,r=s,n=a;break}u=u.sibling}if(!c)throw Error(i(189))}}if(n.alternate!==r)throw Error(i(190))}if(n.tag!==3)throw Error(i(188));return n.stateNode.current===n?e:t}function d(e){var t=e.tag;if(t===5||t===26||t===27||t===6)return e;for(e=e.child;e!==null;){if(t=d(e),t!==null)return t;e=e.sibling}return null}var p=Object.assign,h=Symbol.for(`react.element`),_=Symbol.for(`react.transitional.element`),v=Symbol.for(`react.portal`),y=Symbol.for(`react.fragment`),b=Symbol.for(`react.strict_mode`),x=Symbol.for(`react.profiler`),S=Symbol.for(`react.consumer`),C=Symbol.for(`react.context`),w=Symbol.for(`react.forward_ref`),T=Symbol.for(`react.suspense`),E=Symbol.for(`react.suspense_list`),D=Symbol.for(`react.memo`),O=Symbol.for(`react.lazy`),k=Symbol.for(`react.activity`),A=Symbol.for(`react.memo_cache_sentinel`),j=Symbol.iterator;function M(e){return typeof e!=`object`||!e?null:(e=j&&e[j]||e[`@@iterator`],typeof e==`function`?e:null)}var N=Symbol.for(`react.client.reference`);function ee(e){if(e==null)return null;if(typeof e==`function`)return e.$$typeof===N?null:e.displayName||e.name||null;if(typeof e==`string`)return e;switch(e){case y:return`Fragment`;case x:return`Profiler`;case b:return`StrictMode`;case T:return`Suspense`;case E:return`SuspenseList`;case k:return`Activity`}if(typeof e==`object`)switch(e.$$typeof){case v:return`Portal`;case C:return e.displayName||`Context`;case S:return(e._context.displayName||`Context`)+`.Consumer`;case w:var t=e.render;return e=e.displayName,e||=(e=t.displayName||t.name||``,e===``?`ForwardRef`:`ForwardRef(`+e+`)`),e;case D:return t=e.displayName||null,t===null?ee(e.type)||`Memo`:t;case O:t=e._payload,e=e._init;try{return ee(e(t))}catch{}}return null}var te=Array.isArray,P=n.__CLIENT_INTERNALS_DO_NOT_USE_OR_WARN_USERS_THEY_CANNOT_UPGRADE,F=r.__DOM_INTERNALS_DO_NOT_USE_OR_WARN_USERS_THEY_CANNOT_UPGRADE,I={pending:!1,data:null,method:null,action:null},ne=[],re=-1;function ie(e){return{current:e}}function ae(e){0>re||(e.current=ne[re],ne[re]=null,re--)}function oe(e,t){re++,ne[re]=e.current,e.current=t}var se=ie(null),ce=ie(null),le=ie(null),ue=ie(null);function de(e,t){switch(oe(le,t),oe(ce,e),oe(se,null),t.nodeType){case 9:case 11:e=(e=t.documentElement)&&(e=e.namespaceURI)?Zd(e):0;break;default:if(e=t.tagName,t=t.namespaceURI)t=Zd(t),e=Qd(t,e);else switch(e){case`svg`:e=1;break;case`math`:e=2;break;default:e=0}}ae(se),oe(se,e)}function fe(){ae(se),ae(ce),ae(le)}function pe(e){e.memoizedState!==null&&oe(ue,e);var t=se.current,n=Qd(t,e.type);t!==n&&(oe(ce,e),oe(se,n))}function me(e){ce.current===e&&(ae(se),ae(ce)),ue.current===e&&(ae(ue),cp._currentValue=I)}var he,ge;function _e(e){if(he===void 0)try{throw Error()}catch(e){var t=e.stack.trim().match(/\n( *(at )?)/);he=t&&t[1]||``,ge=-1<e.stack.indexOf(`
3
- at`)?` (<anonymous>)`:-1<e.stack.indexOf(`@`)?`@unknown:0:0`:``}return`
4
- `+he+e+ge}var ve=!1;function ye(e,t){if(!e||ve)return``;ve=!0;var n=Error.prepareStackTrace;Error.prepareStackTrace=void 0;try{var r={DetermineComponentFrameRoot:function(){try{if(t){var n=function(){throw Error()};if(Object.defineProperty(n.prototype,"props",{set:function(){throw Error()}}),typeof Reflect==`object`&&Reflect.construct){try{Reflect.construct(n,[])}catch(e){var r=e}Reflect.construct(e,[],n)}else{try{n.call()}catch(e){r=e}e.call(n.prototype)}}else{try{throw Error()}catch(e){r=e}(n=e())&&typeof n.catch==`function`&&n.catch(function(){})}}catch(e){if(e&&r&&typeof e.stack==`string`)return[e.stack,r.stack]}return[null,null]}};r.DetermineComponentFrameRoot.displayName=`DetermineComponentFrameRoot`;var i=Object.getOwnPropertyDescriptor(r.DetermineComponentFrameRoot,`name`);i&&i.configurable&&Object.defineProperty(r.DetermineComponentFrameRoot,"name",{value:`DetermineComponentFrameRoot`});var a=r.DetermineComponentFrameRoot(),o=a[0],s=a[1];if(o&&s){var c=o.split(`
5
- `),l=s.split(`
6
- `);for(i=r=0;r<c.length&&!c[r].includes(`DetermineComponentFrameRoot`);)r++;for(;i<l.length&&!l[i].includes(`DetermineComponentFrameRoot`);)i++;if(r===c.length||i===l.length)for(r=c.length-1,i=l.length-1;1<=r&&0<=i&&c[r]!==l[i];)i--;for(;1<=r&&0<=i;r--,i--)if(c[r]!==l[i]){if(r!==1||i!==1)do if(r--,i--,0>i||c[r]!==l[i]){var u=`
7
- `+c[r].replace(` at new `,` at `);return e.displayName&&u.includes(`<anonymous>`)&&(u=u.replace(`<anonymous>`,e.displayName)),u}while(1<=r&&0<=i);break}}}finally{ve=!1,Error.prepareStackTrace=n}return(n=e?e.displayName||e.name:``)?_e(n):``}function be(e,t){switch(e.tag){case 26:case 27:case 5:return _e(e.type);case 16:return _e(`Lazy`);case 13:return e.child!==t&&t!==null?_e(`Suspense Fallback`):_e(`Suspense`);case 19:return _e(`SuspenseList`);case 0:case 15:return ye(e.type,!1);case 11:return ye(e.type.render,!1);case 1:return ye(e.type,!0);case 31:return _e(`Activity`);default:return``}}function xe(e){try{var t=``,n=null;do t+=be(e,n),n=e,e=e.return;while(e);return t}catch(e){return`
8
- Error generating stack: `+e.message+`
9
- `+e.stack}}var Se=Object.prototype.hasOwnProperty,Ce=t.unstable_scheduleCallback,we=t.unstable_cancelCallback,Te=t.unstable_shouldYield,Ee=t.unstable_requestPaint,De=t.unstable_now,Oe=t.unstable_getCurrentPriorityLevel,ke=t.unstable_ImmediatePriority,Ae=t.unstable_UserBlockingPriority,je=t.unstable_NormalPriority,Me=t.unstable_LowPriority,Ne=t.unstable_IdlePriority,Pe=t.log,Fe=t.unstable_setDisableYieldValue,Ie=null,Le=null;function Re(e){if(typeof Pe==`function`&&Fe(e),Le&&typeof Le.setStrictMode==`function`)try{Le.setStrictMode(Ie,e)}catch{}}var ze=Math.clz32?Math.clz32:He,Be=Math.log,Ve=Math.LN2;function He(e){return e>>>=0,e===0?32:31-(Be(e)/Ve|0)|0}var Ue=256,We=262144,Ge=4194304;function Ke(e){var t=e&42;if(t!==0)return t;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:return 64;case 128:return 128;case 256:case 512:case 1024:case 2048:case 4096:case 8192:case 16384:case 32768:case 65536:case 131072:return e&261888;case 262144:case 524288:case 1048576:case 2097152:return e&3932160;case 4194304:case 8388608:case 16777216:case 33554432:return e&62914560;case 67108864:return 67108864;case 134217728:return 134217728;case 268435456:return 268435456;case 536870912:return 536870912;case 1073741824:return 0;default:return e}}function qe(e,t,n){var r=e.pendingLanes;if(r===0)return 0;var i=0,a=e.suspendedLanes,o=e.pingedLanes;e=e.warmLanes;var s=r&134217727;return s===0?(s=r&~a,s===0?o===0?n||(n=r&~e,n!==0&&(i=Ke(n))):i=Ke(o):i=Ke(s)):(r=s&~a,r===0?(o&=s,o===0?n||(n=s&~e,n!==0&&(i=Ke(n))):i=Ke(o)):i=Ke(r)),i===0?0:t!==0&&t!==i&&(t&a)===0&&(a=i&-i,n=t&-t,a>=n||a===32&&n&4194048)?t:i}function Je(e,t){return(e.pendingLanes&~(e.suspendedLanes&~e.pingedLanes)&t)===0}function Ye(e,t){switch(e){case 1:case 2:case 4:case 8:case 64:return t+250;case 16:case 32: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:return-1;case 67108864:case 134217728:case 268435456:case 536870912:case 1073741824:return-1;default:return-1}}function Xe(){var e=Ge;return Ge<<=1,!(Ge&62914560)&&(Ge=4194304),e}function Ze(e){for(var t=[],n=0;31>n;n++)t.push(e);return t}function Qe(e,t){e.pendingLanes|=t,t!==268435456&&(e.suspendedLanes=0,e.pingedLanes=0,e.warmLanes=0)}function $e(e,t,n,r,i,a){var o=e.pendingLanes;e.pendingLanes=n,e.suspendedLanes=0,e.pingedLanes=0,e.warmLanes=0,e.expiredLanes&=n,e.entangledLanes&=n,e.errorRecoveryDisabledLanes&=n,e.shellSuspendCounter=0;var s=e.entanglements,c=e.expirationTimes,l=e.hiddenUpdates;for(n=o&~n;0<n;){var u=31-ze(n),d=1<<u;s[u]=0,c[u]=-1;var f=l[u];if(f!==null)for(l[u]=null,u=0;u<f.length;u++){var p=f[u];p!==null&&(p.lane&=-536870913)}n&=~d}r!==0&&L(e,r,0),a!==0&&i===0&&e.tag!==0&&(e.suspendedLanes|=a&~(o&~t))}function L(e,t,n){e.pendingLanes|=t,e.suspendedLanes&=~t;var r=31-ze(t);e.entangledLanes|=t,e.entanglements[r]=e.entanglements[r]|1073741824|n&261930}function et(e,t){var n=e.entangledLanes|=t;for(e=e.entanglements;n;){var r=31-ze(n),i=1<<r;i&t|e[r]&t&&(e[r]|=t),n&=~i}}function tt(e,t){var n=t&-t;return n=n&42?1:nt(n),(n&(e.suspendedLanes|t))===0?n:0}function nt(e){switch(e){case 2:e=1;break;case 8:e=4;break;case 32:e=16;break;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:e=128;break;case 268435456:e=134217728;break;default:e=0}return e}function rt(e){return e&=-e,2<e?8<e?e&134217727?32:268435456:8:2}function it(){var e=F.p;return e===0?(e=window.event,e===void 0?32:wp(e.type)):e}function R(e,t){var n=F.p;try{return F.p=e,t()}finally{F.p=n}}var at=Math.random().toString(36).slice(2),ot=`__reactFiber$`+at,st=`__reactProps$`+at,ct=`__reactContainer$`+at,lt=`__reactEvents$`+at,ut=`__reactListeners$`+at,dt=`__reactHandles$`+at,ft=`__reactResources$`+at,pt=`__reactMarker$`+at;function mt(e){delete e[ot],delete e[st],delete e[lt],delete e[ut],delete e[dt]}function ht(e){var t=e[ot];if(t)return t;for(var n=e.parentNode;n;){if(t=n[ct]||n[ot]){if(n=t.alternate,t.child!==null||n!==null&&n.child!==null)for(e=xf(e);e!==null;){if(n=e[ot])return n;e=xf(e)}return t}e=n,n=e.parentNode}return null}function gt(e){if(e=e[ot]||e[ct]){var t=e.tag;if(t===5||t===6||t===13||t===31||t===26||t===27||t===3)return e}return null}function _t(e){var t=e.tag;if(t===5||t===26||t===27||t===6)return e.stateNode;throw Error(i(33))}function vt(e){var t=e[ft];return t||=e[ft]={hoistableStyles:new Map,hoistableScripts:new Map},t}function yt(e){e[pt]=!0}var bt=new Set,xt={};function St(e,t){Ct(e,t),Ct(e+`Capture`,t)}function Ct(e,t){for(xt[e]=t,e=0;e<t.length;e++)bt.add(t[e])}var wt=RegExp(`^[: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]*$`),Tt={},Et={};function Dt(e){return Se.call(Et,e)?!0:Se.call(Tt,e)?!1:wt.test(e)?Et[e]=!0:(Tt[e]=!0,!1)}function Ot(e,t,n){if(Dt(t))if(n===null)e.removeAttribute(t);else{switch(typeof n){case`undefined`:case`function`:case`symbol`:e.removeAttribute(t);return;case`boolean`:var r=t.toLowerCase().slice(0,5);if(r!==`data-`&&r!==`aria-`){e.removeAttribute(t);return}}e.setAttribute(t,``+n)}}function kt(e,t,n){if(n===null)e.removeAttribute(t);else{switch(typeof n){case`undefined`:case`function`:case`symbol`:case`boolean`:e.removeAttribute(t);return}e.setAttribute(t,``+n)}}function At(e,t,n,r){if(r===null)e.removeAttribute(n);else{switch(typeof r){case`undefined`:case`function`:case`symbol`:case`boolean`:e.removeAttribute(n);return}e.setAttributeNS(t,n,``+r)}}function jt(e){switch(typeof e){case`bigint`:case`boolean`:case`number`:case`string`:case`undefined`:return e;case`object`:return e;default:return``}}function Mt(e){var t=e.type;return(e=e.nodeName)&&e.toLowerCase()===`input`&&(t===`checkbox`||t===`radio`)}function Nt(e,t,n){var r=Object.getOwnPropertyDescriptor(e.constructor.prototype,t);if(!e.hasOwnProperty(t)&&r!==void 0&&typeof r.get==`function`&&typeof r.set==`function`){var i=r.get,a=r.set;return Object.defineProperty(e,t,{configurable:!0,get:function(){return i.call(this)},set:function(e){n=``+e,a.call(this,e)}}),Object.defineProperty(e,t,{enumerable:r.enumerable}),{getValue:function(){return n},setValue:function(e){n=``+e},stopTracking:function(){e._valueTracker=null,delete e[t]}}}}function Pt(e){if(!e._valueTracker){var t=Mt(e)?`checked`:`value`;e._valueTracker=Nt(e,t,``+e[t])}}function Ft(e){if(!e)return!1;var t=e._valueTracker;if(!t)return!0;var n=t.getValue(),r=``;return e&&(r=Mt(e)?e.checked?`true`:`false`:e.value),e=r,e!==n&&(t.setValue(e),!0)}function It(e){if(e||=typeof document<`u`?document:void 0,e===void 0)return null;try{return e.activeElement||e.body}catch{return e.body}}var Lt=/[\n"\\]/g;function Rt(e){return e.replace(Lt,function(e){return`\\`+e.charCodeAt(0).toString(16)+` `})}function zt(e,t,n,r,i,a,o,s){e.name=``,o!=null&&typeof o!=`function`&&typeof o!=`symbol`&&typeof o!=`boolean`?e.type=o:e.removeAttribute(`type`),t==null?o!==`submit`&&o!==`reset`||e.removeAttribute(`value`):o===`number`?(t===0&&e.value===``||e.value!=t)&&(e.value=``+jt(t)):e.value!==``+jt(t)&&(e.value=``+jt(t)),t==null?n==null?r!=null&&e.removeAttribute(`value`):Vt(e,o,jt(n)):Vt(e,o,jt(t)),i==null&&a!=null&&(e.defaultChecked=!!a),i!=null&&(e.checked=i&&typeof i!=`function`&&typeof i!=`symbol`),s!=null&&typeof s!=`function`&&typeof s!=`symbol`&&typeof s!=`boolean`?e.name=``+jt(s):e.removeAttribute(`name`)}function Bt(e,t,n,r,i,a,o,s){if(a!=null&&typeof a!=`function`&&typeof a!=`symbol`&&typeof a!=`boolean`&&(e.type=a),t!=null||n!=null){if(!(a!==`submit`&&a!==`reset`||t!=null)){Pt(e);return}n=n==null?``:``+jt(n),t=t==null?n:``+jt(t),s||t===e.value||(e.value=t),e.defaultValue=t}r??=i,r=typeof r!=`function`&&typeof r!=`symbol`&&!!r,e.checked=s?e.checked:!!r,e.defaultChecked=!!r,o!=null&&typeof o!=`function`&&typeof o!=`symbol`&&typeof o!=`boolean`&&(e.name=o),Pt(e)}function Vt(e,t,n){t===`number`&&It(e.ownerDocument)===e||e.defaultValue===``+n||(e.defaultValue=``+n)}function Ht(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=``+jt(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 Ut(e,t,n){if(t!=null&&(t=``+jt(t),t!==e.value&&(e.value=t),n==null)){e.defaultValue!==t&&(e.defaultValue=t);return}e.defaultValue=n==null?``:``+jt(n)}function Wt(e,t,n,r){if(t==null){if(r!=null){if(n!=null)throw Error(i(92));if(te(r)){if(1<r.length)throw Error(i(93));r=r[0]}n=r}n??=``,t=n}n=jt(t),e.defaultValue=n,r=e.textContent,r===n&&r!==``&&r!==null&&(e.value=r),Pt(e)}function Gt(e,t){if(t){var n=e.firstChild;if(n&&n===e.lastChild&&n.nodeType===3){n.nodeValue=t;return}}e.textContent=t}var Kt=new Set(`animationIterationCount aspectRatio borderImageOutset borderImageSlice borderImageWidth boxFlex boxFlexGroup boxOrdinalGroup columnCount columns flex flexGrow flexPositive flexShrink flexNegative flexOrder gridArea gridRow gridRowEnd gridRowSpan gridRowStart gridColumn gridColumnEnd gridColumnSpan gridColumnStart fontWeight lineClamp lineHeight opacity order orphans scale tabSize widows zIndex zoom fillOpacity floodOpacity stopOpacity strokeDasharray strokeDashoffset strokeMiterlimit strokeOpacity strokeWidth MozAnimationIterationCount MozBoxFlex MozBoxFlexGroup MozLineClamp msAnimationIterationCount msFlex msZoom msFlexGrow msFlexNegative msFlexOrder msFlexPositive msFlexShrink msGridColumn msGridColumnSpan msGridRow msGridRowSpan WebkitAnimationIterationCount WebkitBoxFlex WebKitBoxFlexGroup WebkitBoxOrdinalGroup WebkitColumnCount WebkitColumns WebkitFlex WebkitFlexGrow WebkitFlexPositive WebkitFlexShrink WebkitLineClamp`.split(` `));function qt(e,t,n){var r=t.indexOf(`--`)===0;n==null||typeof n==`boolean`||n===``?r?e.setProperty(t,``):t===`float`?e.cssFloat=``:e[t]=``:r?e.setProperty(t,n):typeof n!=`number`||n===0||Kt.has(t)?t===`float`?e.cssFloat=n:e[t]=(``+n).trim():e[t]=n+`px`}function Jt(e,t,n){if(t!=null&&typeof t!=`object`)throw Error(i(62));if(e=e.style,n!=null){for(var r in n)!n.hasOwnProperty(r)||t!=null&&t.hasOwnProperty(r)||(r.indexOf(`--`)===0?e.setProperty(r,``):r===`float`?e.cssFloat=``:e[r]=``);for(var a in t)r=t[a],t.hasOwnProperty(a)&&n[a]!==r&&qt(e,a,r)}else for(var o in t)t.hasOwnProperty(o)&&qt(e,o,t[o])}function Yt(e){if(e.indexOf(`-`)===-1)return!1;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 Xt=new Map([[`acceptCharset`,`accept-charset`],[`htmlFor`,`for`],[`httpEquiv`,`http-equiv`],[`crossOrigin`,`crossorigin`],[`accentHeight`,`accent-height`],[`alignmentBaseline`,`alignment-baseline`],[`arabicForm`,`arabic-form`],[`baselineShift`,`baseline-shift`],[`capHeight`,`cap-height`],[`clipPath`,`clip-path`],[`clipRule`,`clip-rule`],[`colorInterpolation`,`color-interpolation`],[`colorInterpolationFilters`,`color-interpolation-filters`],[`colorProfile`,`color-profile`],[`colorRendering`,`color-rendering`],[`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`],[`horizAdvX`,`horiz-adv-x`],[`horizOriginX`,`horiz-origin-x`],[`imageRendering`,`image-rendering`],[`letterSpacing`,`letter-spacing`],[`lightingColor`,`lighting-color`],[`markerEnd`,`marker-end`],[`markerMid`,`marker-mid`],[`markerStart`,`marker-start`],[`overlinePosition`,`overline-position`],[`overlineThickness`,`overline-thickness`],[`paintOrder`,`paint-order`],[`panose-1`,`panose-1`],[`pointerEvents`,`pointer-events`],[`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`],[`textAnchor`,`text-anchor`],[`textDecoration`,`text-decoration`],[`textRendering`,`text-rendering`],[`transformOrigin`,`transform-origin`],[`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`],[`xmlnsXlink`,`xmlns:xlink`],[`xHeight`,`x-height`]]),Zt=/^[\u0000-\u001F ]*j[\r\n\t]*a[\r\n\t]*v[\r\n\t]*a[\r\n\t]*s[\r\n\t]*c[\r\n\t]*r[\r\n\t]*i[\r\n\t]*p[\r\n\t]*t[\r\n\t]*:/i;function Qt(e){return Zt.test(``+e)?`javascript:throw new Error('React has blocked a javascript: URL as a security precaution.')`:e}function $t(){}var en=null;function tn(e){return e=e.target||e.srcElement||window,e.correspondingUseElement&&(e=e.correspondingUseElement),e.nodeType===3?e.parentNode:e}var nn=null,rn=null;function an(e){var t=gt(e);if(t&&(e=t.stateNode)){var n=e[st]||null;a:switch(e=t.stateNode,t.type){case`input`:if(zt(e,n.value,n.defaultValue,n.defaultValue,n.checked,n.defaultChecked,n.type,n.name),t=n.name,n.type===`radio`&&t!=null){for(n=e;n.parentNode;)n=n.parentNode;for(n=n.querySelectorAll(`input[name="`+Rt(``+t)+`"][type="radio"]`),t=0;t<n.length;t++){var r=n[t];if(r!==e&&r.form===e.form){var a=r[st]||null;if(!a)throw Error(i(90));zt(r,a.value,a.defaultValue,a.defaultValue,a.checked,a.defaultChecked,a.type,a.name)}}for(t=0;t<n.length;t++)r=n[t],r.form===e.form&&Ft(r)}break a;case`textarea`:Ut(e,n.value,n.defaultValue);break a;case`select`:t=n.value,t!=null&&Ht(e,!!n.multiple,t,!1)}}}var on=!1;function sn(e,t,n){if(on)return e(t,n);on=!0;try{return e(t)}finally{if(on=!1,(nn!==null||rn!==null)&&(ku(),nn&&(t=nn,e=rn,rn=nn=null,an(t),e)))for(t=0;t<e.length;t++)an(e[t])}}function cn(e,t){var n=e.stateNode;if(n===null)return null;var r=n[st]||null;if(r===null)return null;n=r[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`:(r=!r.disabled)||(e=e.type,r=e!==`button`&&e!==`input`&&e!==`select`&&e!==`textarea`),e=!r;break a;default:e=!1}if(e)return null;if(n&&typeof n!=`function`)throw Error(i(231,t,typeof n));return n}var ln=!(typeof window>`u`||window.document===void 0||window.document.createElement===void 0),un=!1;if(ln)try{var dn={};Object.defineProperty(dn,"passive",{get:function(){un=!0}}),window.addEventListener(`test`,dn,dn),window.removeEventListener(`test`,dn,dn)}catch{un=!1}var fn=null,pn=null,mn=null;function hn(){if(mn)return mn;var e,t=pn,n=t.length,r,i=`value`in fn?fn.value:fn.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 mn=i.slice(e,1<r?1-r:void 0)}function gn(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 _n(){return!0}function vn(){return!1}function yn(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)?_n:vn,this.isPropagationStopped=vn,this}return p(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=_n)},stopPropagation:function(){var e=this.nativeEvent;e&&(e.stopPropagation?e.stopPropagation():typeof e.cancelBubble!=`unknown`&&(e.cancelBubble=!0),this.isPropagationStopped=_n)},persist:function(){},isPersistent:_n}),t}var bn={eventPhase:0,bubbles:0,cancelable:0,timeStamp:function(e){return e.timeStamp||Date.now()},defaultPrevented:0,isTrusted:0},xn=yn(bn),Sn=p({},bn,{view:0,detail:0}),Cn=yn(Sn),wn,Tn,En,Dn=p({},Sn,{screenX:0,screenY:0,clientX:0,clientY:0,pageX:0,pageY:0,ctrlKey:0,shiftKey:0,altKey:0,metaKey:0,getModifierState:Rn,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!==En&&(En&&e.type===`mousemove`?(wn=e.screenX-En.screenX,Tn=e.screenY-En.screenY):Tn=wn=0,En=e),wn)},movementY:function(e){return`movementY`in e?e.movementY:Tn}}),On=yn(Dn),kn=yn(p({},Dn,{dataTransfer:0})),An=yn(p({},Sn,{relatedTarget:0})),jn=yn(p({},bn,{animationName:0,elapsedTime:0,pseudoElement:0})),Mn=yn(p({},bn,{clipboardData:function(e){return`clipboardData`in e?e.clipboardData:window.clipboardData}})),Nn=yn(p({},bn,{data:0})),Pn={Esc:`Escape`,Spacebar:` `,Left:`ArrowLeft`,Up:`ArrowUp`,Right:`ArrowRight`,Down:`ArrowDown`,Del:`Delete`,Win:`OS`,Menu:`ContextMenu`,Apps:`ContextMenu`,Scroll:`ScrollLock`,MozPrintableKey:`Unidentified`},Fn={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`},In={Alt:`altKey`,Control:`ctrlKey`,Meta:`metaKey`,Shift:`shiftKey`};function Ln(e){var t=this.nativeEvent;return t.getModifierState?t.getModifierState(e):(e=In[e])?!!t[e]:!1}function Rn(){return Ln}var zn=yn(p({},Sn,{key:function(e){if(e.key){var t=Pn[e.key]||e.key;if(t!==`Unidentified`)return t}return e.type===`keypress`?(e=gn(e),e===13?`Enter`:String.fromCharCode(e)):e.type===`keydown`||e.type===`keyup`?Fn[e.keyCode]||`Unidentified`:``},code:0,location:0,ctrlKey:0,shiftKey:0,altKey:0,metaKey:0,repeat:0,locale:0,getModifierState:Rn,charCode:function(e){return e.type===`keypress`?gn(e):0},keyCode:function(e){return e.type===`keydown`||e.type===`keyup`?e.keyCode:0},which:function(e){return e.type===`keypress`?gn(e):e.type===`keydown`||e.type===`keyup`?e.keyCode:0}})),Bn=yn(p({},Dn,{pointerId:0,width:0,height:0,pressure:0,tangentialPressure:0,tiltX:0,tiltY:0,twist:0,pointerType:0,isPrimary:0})),Vn=yn(p({},Sn,{touches:0,targetTouches:0,changedTouches:0,altKey:0,metaKey:0,ctrlKey:0,shiftKey:0,getModifierState:Rn})),Hn=yn(p({},bn,{propertyName:0,elapsedTime:0,pseudoElement:0})),Un=yn(p({},Dn,{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})),Wn=yn(p({},bn,{newState:0,oldState:0})),Gn=[9,13,27,32],Kn=ln&&`CompositionEvent`in window,qn=null;ln&&`documentMode`in document&&(qn=document.documentMode);var Jn=ln&&`TextEvent`in window&&!qn,Yn=ln&&(!Kn||qn&&8<qn&&11>=qn),Xn=` `,Zn=!1;function Qn(e,t){switch(e){case`keyup`:return Gn.indexOf(t.keyCode)!==-1;case`keydown`:return t.keyCode!==229;case`keypress`:case`mousedown`:case`focusout`:return!0;default:return!1}}function $n(e){return e=e.detail,typeof e==`object`&&`data`in e?e.data:null}var er=!1;function tr(e,t){switch(e){case`compositionend`:return $n(t);case`keypress`:return t.which===32?(Zn=!0,Xn):null;case`textInput`:return e=t.data,e===Xn&&Zn?null:e;default:return null}}function nr(e,t){if(er)return e===`compositionend`||!Kn&&Qn(e,t)?(e=hn(),mn=pn=fn=null,er=!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 Yn&&t.locale!==`ko`?null:t.data;default:return null}}var rr={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 ir(e){var t=e&&e.nodeName&&e.nodeName.toLowerCase();return t===`input`?!!rr[e.type]:t===`textarea`}function ar(e,t,n,r){nn?rn?rn.push(r):rn=[r]:nn=r,t=Id(t,`onChange`),0<t.length&&(n=new xn(`onChange`,`change`,null,n,r),e.push({event:n,listeners:t}))}var or=null,sr=null;function cr(e){Od(e,0)}function lr(e){if(Ft(_t(e)))return e}function ur(e,t){if(e===`change`)return t}var dr=!1;if(ln){var fr;if(ln){var pr=`oninput`in document;if(!pr){var mr=document.createElement(`div`);mr.setAttribute(`oninput`,`return;`),pr=typeof mr.oninput==`function`}fr=pr}else fr=!1;dr=fr&&(!document.documentMode||9<document.documentMode)}function hr(){or&&(or.detachEvent(`onpropertychange`,gr),sr=or=null)}function gr(e){if(e.propertyName===`value`&&lr(sr)){var t=[];ar(t,sr,e,tn(e)),sn(cr,t)}}function _r(e,t,n){e===`focusin`?(hr(),or=t,sr=n,or.attachEvent(`onpropertychange`,gr)):e===`focusout`&&hr()}function vr(e){if(e===`selectionchange`||e===`keyup`||e===`keydown`)return lr(sr)}function yr(e,t){if(e===`click`)return lr(t)}function br(e,t){if(e===`input`||e===`change`)return lr(t)}function xr(e,t){return e===t&&(e!==0||1/e==1/t)||e!==e&&t!==t}var Sr=typeof Object.is==`function`?Object.is:xr;function Cr(e,t){if(Sr(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(!Se.call(t,i)||!Sr(e[i],t[i]))return!1}return!0}function wr(e){for(;e&&e.firstChild;)e=e.firstChild;return e}function Tr(e,t){var n=wr(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=wr(n)}}function Er(e,t){return e&&t?e===t?!0:e&&e.nodeType===3?!1:t&&t.nodeType===3?Er(e,t.parentNode):`contains`in e?e.contains(t):e.compareDocumentPosition?!!(e.compareDocumentPosition(t)&16):!1:!1}function Dr(e){e=e!=null&&e.ownerDocument!=null&&e.ownerDocument.defaultView!=null?e.ownerDocument.defaultView:window;for(var t=It(e.document);t instanceof e.HTMLIFrameElement;){try{var n=typeof t.contentWindow.location.href==`string`}catch{n=!1}if(n)e=t.contentWindow;else break;t=It(e.document)}return t}function Or(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`)}var kr=ln&&`documentMode`in document&&11>=document.documentMode,Ar=null,jr=null,Mr=null,Nr=!1;function Pr(e,t,n){var r=n.window===n?n.document:n.nodeType===9?n:n.ownerDocument;Nr||Ar==null||Ar!==It(r)||(r=Ar,`selectionStart`in r&&Or(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}),Mr&&Cr(Mr,r)||(Mr=r,r=Id(jr,`onSelect`),0<r.length&&(t=new xn(`onSelect`,`select`,null,t,n),e.push({event:t,listeners:r}),t.target=Ar)))}function Fr(e,t){var n={};return n[e.toLowerCase()]=t.toLowerCase(),n[`Webkit`+e]=`webkit`+t,n[`Moz`+e]=`moz`+t,n}var Ir={animationend:Fr(`Animation`,`AnimationEnd`),animationiteration:Fr(`Animation`,`AnimationIteration`),animationstart:Fr(`Animation`,`AnimationStart`),transitionrun:Fr(`Transition`,`TransitionRun`),transitionstart:Fr(`Transition`,`TransitionStart`),transitioncancel:Fr(`Transition`,`TransitionCancel`),transitionend:Fr(`Transition`,`TransitionEnd`)},Lr={},Rr={};ln&&(Rr=document.createElement(`div`).style,`AnimationEvent`in window||(delete Ir.animationend.animation,delete Ir.animationiteration.animation,delete Ir.animationstart.animation),`TransitionEvent`in window||delete Ir.transitionend.transition);function zr(e){if(Lr[e])return Lr[e];if(!Ir[e])return e;var t=Ir[e],n;for(n in t)if(t.hasOwnProperty(n)&&n in Rr)return Lr[e]=t[n];return e}var Br=zr(`animationend`),Vr=zr(`animationiteration`),Hr=zr(`animationstart`),Ur=zr(`transitionrun`),Wr=zr(`transitionstart`),Gr=zr(`transitioncancel`),Kr=zr(`transitionend`),qr=new Map,Jr=`abort auxClick beforeToggle 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(` `);Jr.push(`scrollEnd`);function Yr(e,t){qr.set(e,t),St(t,[e])}var Xr=typeof reportError==`function`?reportError:function(e){if(typeof window==`object`&&typeof window.ErrorEvent==`function`){var t=new window.ErrorEvent(`error`,{bubbles:!0,cancelable:!0,message:typeof e==`object`&&e&&typeof e.message==`string`?String(e.message):String(e),error:e});if(!window.dispatchEvent(t))return}else if(typeof process==`object`&&typeof process.emit==`function`){process.emit(`uncaughtException`,e);return}console.error(e)},Zr=[],Qr=0,$r=0;function ei(){for(var e=Qr,t=$r=Qr=0;t<e;){var n=Zr[t];Zr[t++]=null;var r=Zr[t];Zr[t++]=null;var i=Zr[t];Zr[t++]=null;var a=Zr[t];if(Zr[t++]=null,r!==null&&i!==null){var o=r.pending;o===null?i.next=i:(i.next=o.next,o.next=i),r.pending=i}a!==0&&ii(n,i,a)}}function ti(e,t,n,r){Zr[Qr++]=e,Zr[Qr++]=t,Zr[Qr++]=n,Zr[Qr++]=r,$r|=r,e.lanes|=r,e=e.alternate,e!==null&&(e.lanes|=r)}function ni(e,t,n,r){return ti(e,t,n,r),ai(e)}function ri(e,t){return ti(e,null,null,t),ai(e)}function ii(e,t,n){e.lanes|=n;var r=e.alternate;r!==null&&(r.lanes|=n);for(var i=!1,a=e.return;a!==null;)a.childLanes|=n,r=a.alternate,r!==null&&(r.childLanes|=n),a.tag===22&&(e=a.stateNode,e===null||e._visibility&1||(i=!0)),e=a,a=a.return;return e.tag===3?(a=e.stateNode,i&&t!==null&&(i=31-ze(n),e=a.hiddenUpdates,r=e[i],r===null?e[i]=[t]:r.push(t),t.lane=n|536870912),a):null}function ai(e){if(50<bu)throw bu=0,xu=null,Error(i(185));for(var t=e.return;t!==null;)e=t,t=e.return;return e.tag===3?e.stateNode:null}var oi={};function si(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.refCleanup=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 ci(e,t,n,r){return new si(e,t,n,r)}function li(e){return e=e.prototype,!(!e||!e.isReactComponent)}function ui(e,t){var n=e.alternate;return n===null?(n=ci(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&65011712,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.refCleanup=e.refCleanup,n}function z(e,t){e.flags&=65011714;var n=e.alternate;return n===null?(e.childLanes=0,e.lanes=t,e.child=null,e.subtreeFlags=0,e.memoizedProps=null,e.memoizedState=null,e.updateQueue=null,e.dependencies=null,e.stateNode=null):(e.childLanes=n.childLanes,e.lanes=n.lanes,e.child=n.child,e.subtreeFlags=0,e.deletions=null,e.memoizedProps=n.memoizedProps,e.memoizedState=n.memoizedState,e.updateQueue=n.updateQueue,e.type=n.type,t=n.dependencies,e.dependencies=t===null?null:{lanes:t.lanes,firstContext:t.firstContext}),e}function di(e,t,n,r,a,o){var s=0;if(r=e,typeof e==`function`)li(e)&&(s=1);else if(typeof e==`string`)s=$f(e,n,se.current)?26:e===`html`||e===`head`||e===`body`?27:5;else a:switch(e){case k:return e=ci(31,n,t,a),e.elementType=k,e.lanes=o,e;case y:return fi(n.children,a,o,t);case b:s=8,a|=24;break;case x:return e=ci(12,n,t,a|2),e.elementType=x,e.lanes=o,e;case T:return e=ci(13,n,t,a),e.elementType=T,e.lanes=o,e;case E:return e=ci(19,n,t,a),e.elementType=E,e.lanes=o,e;default:if(typeof e==`object`&&e)switch(e.$$typeof){case C:s=10;break a;case S:s=9;break a;case w:s=11;break a;case D:s=14;break a;case O:s=16,r=null;break a}s=29,n=Error(i(130,e===null?`null`:typeof e,``)),r=null}return t=ci(s,n,t,a),t.elementType=e,t.type=r,t.lanes=o,t}function fi(e,t,n,r){return e=ci(7,e,r,t),e.lanes=n,e}function pi(e,t,n){return e=ci(6,e,null,t),e.lanes=n,e}function mi(e){var t=ci(18,null,null,0);return t.stateNode=e,t}function hi(e,t,n){return t=ci(4,e.children===null?[]:e.children,e.key,t),t.lanes=n,t.stateNode={containerInfo:e.containerInfo,pendingChildren:null,implementation:e.implementation},t}var gi=new WeakMap;function _i(e,t){if(typeof e==`object`&&e){var n=gi.get(e);return n===void 0?(t={value:e,source:t,stack:xe(t)},gi.set(e,t),t):n}return{value:e,source:t,stack:xe(t)}}var vi=[],yi=0,bi=null,xi=0,Si=[],Ci=0,wi=null,Ti=1,Ei=``;function Di(e,t){vi[yi++]=xi,vi[yi++]=bi,bi=e,xi=t}function Oi(e,t,n){Si[Ci++]=Ti,Si[Ci++]=Ei,Si[Ci++]=wi,wi=e;var r=Ti;e=Ei;var i=32-ze(r)-1;r&=~(1<<i),n+=1;var a=32-ze(t)+i;if(30<a){var o=i-i%5;a=(r&(1<<o)-1).toString(32),r>>=o,i-=o,Ti=1<<32-ze(t)+i|n<<i|r,Ei=a+e}else Ti=1<<a|n<<i|r,Ei=e}function ki(e){e.return!==null&&(Di(e,1),Oi(e,1,0))}function Ai(e){for(;e===bi;)bi=vi[--yi],vi[yi]=null,xi=vi[--yi],vi[yi]=null;for(;e===wi;)wi=Si[--Ci],Si[Ci]=null,Ei=Si[--Ci],Si[Ci]=null,Ti=Si[--Ci],Si[Ci]=null}function ji(e,t){Si[Ci++]=Ti,Si[Ci++]=Ei,Si[Ci++]=wi,Ti=t.id,Ei=t.overflow,wi=e}var Mi=null,Ni=null,Pi=!1,Fi=null,Ii=!1,Li=Error(i(519));function Ri(e){throw Wi(_i(Error(i(418,1<arguments.length&&arguments[1]!==void 0&&arguments[1]?`text`:`HTML`,``)),e)),Li}function zi(e){var t=e.stateNode,n=e.type,r=e.memoizedProps;switch(t[ot]=e,t[st]=r,n){case`dialog`:kd(`cancel`,t),kd(`close`,t);break;case`iframe`:case`object`:case`embed`:kd(`load`,t);break;case`video`:case`audio`:for(n=0;n<Ed.length;n++)kd(Ed[n],t);break;case`source`:kd(`error`,t);break;case`img`:case`image`:case`link`:kd(`error`,t),kd(`load`,t);break;case`details`:kd(`toggle`,t);break;case`input`:kd(`invalid`,t),Bt(t,r.value,r.defaultValue,r.checked,r.defaultChecked,r.type,r.name,!0);break;case`select`:kd(`invalid`,t);break;case`textarea`:kd(`invalid`,t),Wt(t,r.value,r.defaultValue,r.children)}n=r.children,typeof n!=`string`&&typeof n!=`number`&&typeof n!=`bigint`||t.textContent===``+n||!0===r.suppressHydrationWarning||Hd(t.textContent,n)?(r.popover!=null&&(kd(`beforetoggle`,t),kd(`toggle`,t)),r.onScroll!=null&&kd(`scroll`,t),r.onScrollEnd!=null&&kd(`scrollend`,t),r.onClick!=null&&(t.onclick=$t),t=!0):t=!1,t||Ri(e,!0)}function Bi(e){for(Mi=e.return;Mi;)switch(Mi.tag){case 5:case 31:case 13:Ii=!1;return;case 27:case 3:Ii=!0;return;default:Mi=Mi.return}}function Vi(e){if(e!==Mi)return!1;if(!Pi)return Bi(e),Pi=!0,!1;var t=e.tag,n;if((n=t!==3&&t!==27)&&((n=t===5)&&(n=e.type,n=n===`form`||n===`button`||$d(e.type,e.memoizedProps)),n=!n),n&&Ni&&Ri(e),Bi(e),t===13){if(e=e.memoizedState,e=e===null?null:e.dehydrated,!e)throw Error(i(317));Ni=bf(e)}else if(t===31){if(e=e.memoizedState,e=e===null?null:e.dehydrated,!e)throw Error(i(317));Ni=bf(e)}else t===27?(t=Ni,cf(e.type)?(e=yf,yf=null,Ni=e):Ni=t):Ni=Mi?vf(e.stateNode.nextSibling):null;return!0}function Hi(){Ni=Mi=null,Pi=!1}function Ui(){var e=Fi;return e!==null&&(ou===null?ou=e:ou.push.apply(ou,e),Fi=null),e}function Wi(e){Fi===null?Fi=[e]:Fi.push(e)}var Gi=ie(null),Ki=null,B=null;function qi(e,t,n){oe(Gi,t._currentValue),t._currentValue=n}function Ji(e){e._currentValue=Gi.current,ae(Gi)}function V(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 Yi(e,t,n,r){var a=e.child;for(a!==null&&(a.return=e);a!==null;){var o=a.dependencies;if(o!==null){var s=a.child;o=o.firstContext;a:for(;o!==null;){var c=o;o=a;for(var l=0;l<t.length;l++)if(c.context===t[l]){o.lanes|=n,c=o.alternate,c!==null&&(c.lanes|=n),V(o.return,n,e),r||(s=null);break a}o=c.next}}else if(a.tag===18){if(s=a.return,s===null)throw Error(i(341));s.lanes|=n,o=s.alternate,o!==null&&(o.lanes|=n),V(s,n,e),s=null}else s=a.child;if(s!==null)s.return=a;else for(s=a;s!==null;){if(s===e){s=null;break}if(a=s.sibling,a!==null){a.return=s.return,s=a;break}s=s.return}a=s}}function Xi(e,t,n,r){e=null;for(var a=t,o=!1;a!==null;){if(!o){if(a.flags&524288)o=!0;else if(a.flags&262144)break}if(a.tag===10){var s=a.alternate;if(s===null)throw Error(i(387));if(s=s.memoizedProps,s!==null){var c=a.type;Sr(a.pendingProps.value,s.value)||(e===null?e=[c]:e.push(c))}}else if(a===ue.current){if(s=a.alternate,s===null)throw Error(i(387));s.memoizedState.memoizedState!==a.memoizedState.memoizedState&&(e===null?e=[cp]:e.push(cp))}a=a.return}e!==null&&Yi(t,e,n,r),t.flags|=262144}function Zi(e){for(e=e.firstContext;e!==null;){if(!Sr(e.context._currentValue,e.memoizedValue))return!0;e=e.next}return!1}function Qi(e){Ki=e,B=null,e=e.dependencies,e!==null&&(e.firstContext=null)}function $i(e){return ta(Ki,e)}function ea(e,t){return Ki===null&&Qi(e),ta(e,t)}function ta(e,t){var n=t._currentValue;if(t={context:t,memoizedValue:n,next:null},B===null){if(e===null)throw Error(i(308));B=t,e.dependencies={lanes:0,firstContext:t},e.flags|=524288}else B=B.next=t;return n}var na=typeof AbortController<`u`?AbortController:function(){var e=[],t=this.signal={aborted:!1,addEventListener:function(t,n){e.push(n)}};this.abort=function(){t.aborted=!0,e.forEach(function(e){return e()})}},ra=t.unstable_scheduleCallback,ia=t.unstable_NormalPriority,aa={$$typeof:C,Consumer:null,Provider:null,_currentValue:null,_currentValue2:null,_threadCount:0};function oa(){return{controller:new na,data:new Map,refCount:0}}function sa(e){e.refCount--,e.refCount===0&&ra(ia,function(){e.controller.abort()})}var ca=null,la=0,ua=0,da=null;function fa(e,t){if(ca===null){var n=ca=[];la=0,ua=bd(),da={status:`pending`,value:void 0,then:function(e){n.push(e)}}}return la++,t.then(pa,pa),t}function pa(){if(--la===0&&ca!==null){da!==null&&(da.status=`fulfilled`);var e=ca;ca=null,ua=0,da=null;for(var t=0;t<e.length;t++)(0,e[t])()}}function ma(e,t){var n=[],r={status:`pending`,value:null,reason:null,then:function(e){n.push(e)}};return e.then(function(){r.status=`fulfilled`,r.value=t;for(var e=0;e<n.length;e++)(0,n[e])(t)},function(e){for(r.status=`rejected`,r.reason=e,e=0;e<n.length;e++)(0,n[e])(void 0)}),r}var ha=P.S;P.S=function(e,t){lu=De(),typeof t==`object`&&t&&typeof t.then==`function`&&fa(e,t),ha!==null&&ha(e,t)};var ga=ie(null);function _a(){var e=ga.current;return e===null?Wl.pooledCache:e}function va(e,t){t===null?oe(ga,ga.current):oe(ga,t.pool)}function ya(){var e=_a();return e===null?null:{parent:aa._currentValue,pool:e}}var ba=Error(i(460)),xa=Error(i(474)),Sa=Error(i(542)),Ca={then:function(){}};function wa(e){return e=e.status,e===`fulfilled`||e===`rejected`}function Ta(e,t,n){switch(n=e[n],n===void 0?e.push(t):n!==t&&(t.then($t,$t),t=n),t.status){case`fulfilled`:return t.value;case`rejected`:throw e=t.reason,ka(e),e;default:if(typeof t.status==`string`)t.then($t,$t);else{if(e=Wl,e!==null&&100<e.shellSuspendCounter)throw Error(i(482));e=t,e.status=`pending`,e.then(function(e){if(t.status===`pending`){var n=t;n.status=`fulfilled`,n.value=e}},function(e){if(t.status===`pending`){var n=t;n.status=`rejected`,n.reason=e}})}switch(t.status){case`fulfilled`:return t.value;case`rejected`:throw e=t.reason,ka(e),e}throw Da=t,ba}}function Ea(e){try{var t=e._init;return t(e._payload)}catch(e){throw typeof e==`object`&&e&&typeof e.then==`function`?(Da=e,ba):e}}var Da=null;function Oa(){if(Da===null)throw Error(i(459));var e=Da;return Da=null,e}function ka(e){if(e===ba||e===Sa)throw Error(i(483))}var Aa=null,ja=0;function Ma(e){var t=ja;return ja+=1,Aa===null&&(Aa=[]),Ta(Aa,e,t)}function Na(e,t){t=t.props.ref,e.ref=t===void 0?null:t}function Pa(e,t){throw t.$$typeof===h?Error(i(525)):(e=Object.prototype.toString.call(t),Error(i(31,e===`[object Object]`?`object with keys {`+Object.keys(t).join(`, `)+`}`:e)))}function Fa(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 r(e){for(var t=new Map;e!==null;)e.key===null?t.set(e.index,e):t.set(e.key,e),e=e.sibling;return t}function a(e,t){return e=ui(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|=67108866,n):(r=r.index,r<n?(t.flags|=67108866,n):r)):(t.flags|=1048576,n)}function s(t){return e&&t.alternate===null&&(t.flags|=67108866),t}function c(e,t,n,r){return t===null||t.tag!==6?(t=pi(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===y?d(e,t,n.props.children,r,n.key):t!==null&&(t.elementType===i||typeof i==`object`&&i&&i.$$typeof===O&&Ea(i)===t.type)?(t=a(t,n.props),Na(t,n),t.return=e,t):(t=di(n.type,n.key,n.props,null,e.mode,r),Na(t,n),t.return=e,t)}function u(e,t,n,r){return t===null||t.tag!==4||t.stateNode.containerInfo!==n.containerInfo||t.stateNode.implementation!==n.implementation?(t=hi(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=fi(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`||typeof t==`bigint`)return t=pi(``+t,e.mode,n),t.return=e,t;if(typeof t==`object`&&t){switch(t.$$typeof){case _:return n=di(t.type,t.key,t.props,null,e.mode,n),Na(n,t),n.return=e,n;case v:return t=hi(t,e.mode,n),t.return=e,t;case O:return t=Ea(t),f(e,t,n)}if(te(t)||M(t))return t=fi(t,e.mode,n,null),t.return=e,t;if(typeof t.then==`function`)return f(e,Ma(t),n);if(t.$$typeof===C)return f(e,ea(e,t),n);Pa(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`||typeof n==`bigint`)return i===null?c(e,t,``+n,r):null;if(typeof n==`object`&&n){switch(n.$$typeof){case _:return n.key===i?l(e,t,n,r):null;case v:return n.key===i?u(e,t,n,r):null;case O:return n=Ea(n),p(e,t,n,r)}if(te(n)||M(n))return i===null?d(e,t,n,r,null):null;if(typeof n.then==`function`)return p(e,t,Ma(n),r);if(n.$$typeof===C)return p(e,t,ea(e,n),r);Pa(e,n)}return null}function m(e,t,n,r,i){if(typeof r==`string`&&r!==``||typeof r==`number`||typeof r==`bigint`)return e=e.get(n)||null,c(t,e,``+r,i);if(typeof r==`object`&&r){switch(r.$$typeof){case _:return e=e.get(r.key===null?n:r.key)||null,l(t,e,r,i);case v:return e=e.get(r.key===null?n:r.key)||null,u(t,e,r,i);case O:return r=Ea(r),m(e,t,n,r,i)}if(te(r)||M(r))return e=e.get(n)||null,d(t,e,r,i,null);if(typeof r.then==`function`)return m(e,t,n,Ma(r),i);if(r.$$typeof===C)return m(e,t,n,ea(t,r),i);Pa(t,r)}return null}function h(i,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(i,d,s[h],c);if(_===null){d===null&&(d=g);break}e&&d&&_.alternate===null&&t(i,d),a=o(_,a,h),u===null?l=_:u.sibling=_,u=_,d=g}if(h===s.length)return n(i,d),Pi&&Di(i,h),l;if(d===null){for(;h<s.length;h++)d=f(i,s[h],c),d!==null&&(a=o(d,a,h),u===null?l=d:u.sibling=d,u=d);return Pi&&Di(i,h),l}for(d=r(d);h<s.length;h++)g=m(d,i,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(i,e)}),Pi&&Di(i,h),l}function g(a,s,c,l){if(c==null)throw Error(i(151));for(var u=null,d=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),Pi&&Di(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 Pi&&Di(a,g),u}for(h=r(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)}),Pi&&Di(a,g),u}function b(e,r,o,c){if(typeof o==`object`&&o&&o.type===y&&o.key===null&&(o=o.props.children),typeof o==`object`&&o){switch(o.$$typeof){case _:a:{for(var l=o.key;r!==null;){if(r.key===l){if(l=o.type,l===y){if(r.tag===7){n(e,r.sibling),c=a(r,o.props.children),c.return=e,e=c;break a}}else if(r.elementType===l||typeof l==`object`&&l&&l.$$typeof===O&&Ea(l)===r.type){n(e,r.sibling),c=a(r,o.props),Na(c,o),c.return=e,e=c;break a}n(e,r);break}t(e,r),r=r.sibling}o.type===y?(c=fi(o.props.children,e.mode,c,o.key),c.return=e,e=c):(c=di(o.type,o.key,o.props,null,e.mode,c),Na(c,o),c.return=e,e=c)}return s(e);case v:a:{for(l=o.key;r!==null;){if(r.key===l)if(r.tag===4&&r.stateNode.containerInfo===o.containerInfo&&r.stateNode.implementation===o.implementation){n(e,r.sibling),c=a(r,o.children||[]),c.return=e,e=c;break a}else{n(e,r);break}t(e,r),r=r.sibling}c=hi(o,e.mode,c),c.return=e,e=c}return s(e);case O:return o=Ea(o),b(e,r,o,c)}if(te(o))return h(e,r,o,c);if(M(o)){if(l=M(o),typeof l!=`function`)throw Error(i(150));return o=l.call(o),g(e,r,o,c)}if(typeof o.then==`function`)return b(e,r,Ma(o),c);if(o.$$typeof===C)return b(e,r,ea(e,o),c);Pa(e,o)}return typeof o==`string`&&o!==``||typeof o==`number`||typeof o==`bigint`?(o=``+o,r!==null&&r.tag===6?(n(e,r.sibling),c=a(r,o),c.return=e,e=c):(n(e,r),c=pi(o,e.mode,c),c.return=e,e=c),s(e)):n(e,r)}return function(e,t,n,r){try{ja=0;var i=b(e,t,n,r);return Aa=null,i}catch(t){if(t===ba||t===Sa)throw t;var a=ci(29,t,null,e.mode);return a.lanes=r,a.return=e,a}}}var Ia=Fa(!0),La=Fa(!1),Ra=!1;function za(e){e.updateQueue={baseState:e.memoizedState,firstBaseUpdate:null,lastBaseUpdate:null,shared:{pending:null,lanes:0,hiddenCallbacks:null},callbacks:null}}function Ba(e,t){e=e.updateQueue,t.updateQueue===e&&(t.updateQueue={baseState:e.baseState,firstBaseUpdate:e.firstBaseUpdate,lastBaseUpdate:e.lastBaseUpdate,shared:e.shared,callbacks:null})}function Va(e){return{lane:e,tag:0,payload:null,callback:null,next:null}}function Ha(e,t,n){var r=e.updateQueue;if(r===null)return null;if(r=r.shared,Ul&2){var i=r.pending;return i===null?t.next=t:(t.next=i.next,i.next=t),r.pending=t,t=ai(e),ii(e,null,n),t}return ti(e,r,t,n),ai(e)}function Ua(e,t,n){if(t=t.updateQueue,t!==null&&(t=t.shared,n&4194048)){var r=t.lanes;r&=e.pendingLanes,n|=r,t.lanes=n,et(e,n)}}function Wa(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={lane:n.lane,tag:n.tag,payload:n.payload,callback:null,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,callbacks:r.callbacks},e.updateQueue=n;return}e=n.lastBaseUpdate,e===null?n.firstBaseUpdate=t:e.next=t,n.lastBaseUpdate=t}var Ga=!1;function Ka(){if(Ga){var e=da;if(e!==null)throw e}}function qa(e,t,n,r){Ga=!1;var i=e.updateQueue;Ra=!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&-536870913,m=f!==s.lane;if(m?(Kl&f)===f:(r&f)===f){f!==0&&f===ua&&(Ga=!0),u!==null&&(u=u.next={lane:0,tag:s.tag,payload:s.payload,callback:null,next:null});a:{var h=e,g=s;f=t;var _=n;switch(g.tag){case 1:if(h=g.payload,typeof h==`function`){d=h.call(_,d,f);break a}d=h;break a;case 3:h.flags=h.flags&-65537|128;case 0:if(h=g.payload,f=typeof h==`function`?h.call(_,d,f):h,f==null)break a;d=p({},d,f);break a;case 2:Ra=!0}}f=s.callback,f!==null&&(e.flags|=64,m&&(e.flags|=8192),m=i.callbacks,m===null?i.callbacks=[f]:m.push(f))}else m={lane:f,tag:s.tag,payload:s.payload,callback:s.callback,next:null},u===null?(l=u=m,c=d):u=u.next=m,o|=f;if(s=s.next,s===null){if(s=i.shared.pending,s===null)break;m=s,s=m.next,m.next=null,i.lastBaseUpdate=m,i.shared.pending=null}}while(1);u===null&&(c=d),i.baseState=c,i.firstBaseUpdate=l,i.lastBaseUpdate=u,a===null&&(i.shared.lanes=0),eu|=o,e.lanes=o,e.memoizedState=d}}function Ja(e,t){if(typeof e!=`function`)throw Error(i(191,e));e.call(t)}function Ya(e,t){var n=e.callbacks;if(n!==null)for(e.callbacks=null,e=0;e<n.length;e++)Ja(n[e],t)}var Xa=ie(null),Za=ie(0);function Qa(e,t){e=Ql,oe(Za,e),oe(Xa,t),Ql=e|t.baseLanes}function $a(){oe(Za,Ql),oe(Xa,Xa.current)}function eo(){Ql=Za.current,ae(Xa),ae(Za)}var to=ie(null),no=null;function ro(e){var t=e.alternate;oe(co,co.current&1),oe(to,e),no===null&&(t===null||Xa.current!==null||t.memoizedState!==null)&&(no=e)}function io(e){oe(co,co.current),oe(to,e),no===null&&(no=e)}function ao(e){e.tag===22?(oe(co,co.current),oe(to,e),no===null&&(no=e)):oo(e)}function oo(){oe(co,co.current),oe(to,to.current)}function so(e){ae(to),no===e&&(no=null),ae(co)}var co=ie(0);function lo(e){for(var t=e;t!==null;){if(t.tag===13){var n=t.memoizedState;if(n!==null&&(n=n.dehydrated,n===null||hf(n)||gf(n)))return t}else if(t.tag===19&&(t.memoizedProps.revealOrder===`forwards`||t.memoizedProps.revealOrder===`backwards`||t.memoizedProps.revealOrder===`unstable_legacy-backwards`||t.memoizedProps.revealOrder===`together`)){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 uo=0,fo=null,po=null,mo=null,ho=!1,go=!1,_o=!1,vo=0,yo=0,bo=null,xo=0;function So(){throw Error(i(321))}function Co(e,t){if(t===null)return!1;for(var n=0;n<t.length&&n<e.length;n++)if(!Sr(e[n],t[n]))return!1;return!0}function wo(e,t,n,r,i,a){return uo=a,fo=t,t.memoizedState=null,t.updateQueue=null,t.lanes=0,P.H=e===null||e.memoizedState===null?Vs:Hs,_o=!1,a=n(r,i),_o=!1,go&&(a=Eo(t,n,r,i)),To(e),a}function To(e){P.H=Bs;var t=po!==null&&po.next!==null;if(uo=0,mo=po=fo=null,ho=!1,yo=0,bo=null,t)throw Error(i(300));e===null||ac||(e=e.dependencies,e!==null&&Zi(e)&&(ac=!0))}function Eo(e,t,n,r){fo=e;var a=0;do{if(go&&(bo=null),yo=0,go=!1,25<=a)throw Error(i(301));if(a+=1,mo=po=null,e.updateQueue!=null){var o=e.updateQueue;o.lastEffect=null,o.events=null,o.stores=null,o.memoCache!=null&&(o.memoCache.index=0)}P.H=Us,o=t(n,r)}while(go);return o}function Do(){var e=P.H,t=e.useState()[0];return t=typeof t.then==`function`?Po(t):t,e=e.useState()[0],(po===null?null:po.memoizedState)!==e&&(fo.flags|=1024),t}function Oo(){var e=vo!==0;return vo=0,e}function ko(e,t,n){t.updateQueue=e.updateQueue,t.flags&=-2053,e.lanes&=~n}function Ao(e){if(ho){for(e=e.memoizedState;e!==null;){var t=e.queue;t!==null&&(t.pending=null),e=e.next}ho=!1}uo=0,mo=po=fo=null,go=!1,yo=vo=0,bo=null}function jo(){var e={memoizedState:null,baseState:null,baseQueue:null,queue:null,next:null};return mo===null?fo.memoizedState=mo=e:mo=mo.next=e,mo}function Mo(){if(po===null){var e=fo.alternate;e=e===null?null:e.memoizedState}else e=po.next;var t=mo===null?fo.memoizedState:mo.next;if(t!==null)mo=t,po=e;else{if(e===null)throw fo.alternate===null?Error(i(467)):Error(i(310));po=e,e={memoizedState:po.memoizedState,baseState:po.baseState,baseQueue:po.baseQueue,queue:po.queue,next:null},mo===null?fo.memoizedState=mo=e:mo=mo.next=e}return mo}function No(){return{lastEffect:null,events:null,stores:null,memoCache:null}}function Po(e){var t=yo;return yo+=1,bo===null&&(bo=[]),e=Ta(bo,e,t),t=fo,(mo===null?t.memoizedState:mo.next)===null&&(t=t.alternate,P.H=t===null||t.memoizedState===null?Vs:Hs),e}function Fo(e){if(typeof e==`object`&&e){if(typeof e.then==`function`)return Po(e);if(e.$$typeof===C)return $i(e)}throw Error(i(438,String(e)))}function Io(e){var t=null,n=fo.updateQueue;if(n!==null&&(t=n.memoCache),t==null){var r=fo.alternate;r!==null&&(r=r.updateQueue,r!==null&&(r=r.memoCache,r!=null&&(t={data:r.data.map(function(e){return e.slice()}),index:0})))}if(t??={data:[],index:0},n===null&&(n=No(),fo.updateQueue=n),n.memoCache=t,n=t.data[t.index],n===void 0)for(n=t.data[t.index]=Array(e),r=0;r<e;r++)n[r]=A;return t.index++,n}function Lo(e,t){return typeof t==`function`?t(e):t}function Ro(e){return zo(Mo(),po,e)}function zo(e,t,n){var r=e.queue;if(r===null)throw Error(i(311));r.lastRenderedReducer=n;var a=e.baseQueue,o=r.pending;if(o!==null){if(a!==null){var s=a.next;a.next=o.next,o.next=s}t.baseQueue=a=o,r.pending=null}if(o=e.baseState,a===null)e.memoizedState=o;else{t=a.next;var c=s=null,l=null,u=t,d=!1;do{var f=u.lane&-536870913;if(f===u.lane?(uo&f)===f:(Kl&f)===f){var p=u.revertLane;if(p===0)l!==null&&(l=l.next={lane:0,revertLane:0,gesture:null,action:u.action,hasEagerState:u.hasEagerState,eagerState:u.eagerState,next:null}),f===ua&&(d=!0);else if((uo&p)===p){u=u.next,p===ua&&(d=!0);continue}else f={lane:0,revertLane:u.revertLane,gesture:null,action:u.action,hasEagerState:u.hasEagerState,eagerState:u.eagerState,next:null},l===null?(c=l=f,s=o):l=l.next=f,fo.lanes|=p,eu|=p;f=u.action,_o&&n(o,f),o=u.hasEagerState?u.eagerState:n(o,f)}else p={lane:f,revertLane:u.revertLane,gesture:u.gesture,action:u.action,hasEagerState:u.hasEagerState,eagerState:u.eagerState,next:null},l===null?(c=l=p,s=o):l=l.next=p,fo.lanes|=f,eu|=f;u=u.next}while(u!==null&&u!==t);if(l===null?s=o:l.next=c,!Sr(o,e.memoizedState)&&(ac=!0,d&&(n=da,n!==null)))throw n;e.memoizedState=o,e.baseState=s,e.baseQueue=l,r.lastRenderedState=o}return a===null&&(r.lanes=0),[e.memoizedState,r.dispatch]}function Bo(e){var t=Mo(),n=t.queue;if(n===null)throw Error(i(311));n.lastRenderedReducer=e;var r=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);Sr(o,t.memoizedState)||(ac=!0),t.memoizedState=o,t.baseQueue===null&&(t.baseState=o),n.lastRenderedState=o}return[o,r]}function Vo(e,t,n){var r=fo,a=Mo(),o=Pi;if(o){if(n===void 0)throw Error(i(407));n=n()}else n=t();var s=!Sr((po||a).memoizedState,n);if(s&&(a.memoizedState=n,ac=!0),a=a.queue,fs(Wo.bind(null,r,a,e),[e]),a.getSnapshot!==t||s||mo!==null&&mo.memoizedState.tag&1){if(r.flags|=2048,ss(9,{destroy:void 0},Uo.bind(null,r,a,n,t),null),Wl===null)throw Error(i(349));o||uo&127||Ho(r,t,n)}return n}function Ho(e,t,n){e.flags|=16384,e={getSnapshot:t,value:n},t=fo.updateQueue,t===null?(t=No(),fo.updateQueue=t,t.stores=[e]):(n=t.stores,n===null?t.stores=[e]:n.push(e))}function Uo(e,t,n,r){t.value=n,t.getSnapshot=r,Go(t)&&Ko(e)}function Wo(e,t,n){return n(function(){Go(t)&&Ko(e)})}function Go(e){var t=e.getSnapshot;e=e.value;try{var n=t();return!Sr(e,n)}catch{return!0}}function Ko(e){var t=ri(e,2);t!==null&&wu(t,e,2)}function qo(e){var t=jo();if(typeof e==`function`){var n=e;if(e=n(),_o){Re(!0);try{n()}finally{Re(!1)}}}return t.memoizedState=t.baseState=e,t.queue={pending:null,lanes:0,dispatch:null,lastRenderedReducer:Lo,lastRenderedState:e},t}function Jo(e,t,n,r){return e.baseState=n,zo(e,po,typeof r==`function`?r:Lo)}function Yo(e,t,n,r,a){if(Ls(e))throw Error(i(485));if(e=t.action,e!==null){var o={payload:a,action:e,next:null,isTransition:!0,status:`pending`,value:null,reason:null,listeners:[],then:function(e){o.listeners.push(e)}};P.T===null?o.isTransition=!1:n(!0),r(o),n=t.pending,n===null?(o.next=t.pending=o,Xo(t,o)):(o.next=n.next,t.pending=n.next=o)}}function Xo(e,t){var n=t.action,r=t.payload,i=e.state;if(t.isTransition){var a=P.T,o={};P.T=o;try{var s=n(i,r),c=P.S;c!==null&&c(o,s),Zo(e,t,s)}catch(n){$o(e,t,n)}finally{a!==null&&o.types!==null&&(a.types=o.types),P.T=a}}else try{a=n(i,r),Zo(e,t,a)}catch(n){$o(e,t,n)}}function Zo(e,t,n){typeof n==`object`&&n&&typeof n.then==`function`?n.then(function(n){Qo(e,t,n)},function(n){return $o(e,t,n)}):Qo(e,t,n)}function Qo(e,t,n){t.status=`fulfilled`,t.value=n,es(t),e.state=n,t=e.pending,t!==null&&(n=t.next,n===t?e.pending=null:(n=n.next,t.next=n,Xo(e,n)))}function $o(e,t,n){var r=e.pending;if(e.pending=null,r!==null){r=r.next;do t.status=`rejected`,t.reason=n,es(t),t=t.next;while(t!==r)}e.action=null}function es(e){e=e.listeners;for(var t=0;t<e.length;t++)(0,e[t])()}function ts(e,t){return t}function ns(e,t){if(Pi){var n=Wl.formState;if(n!==null){a:{var r=fo;if(Pi){if(Ni){b:{for(var i=Ni,a=Ii;i.nodeType!==8;){if(!a){i=null;break b}if(i=vf(i.nextSibling),i===null){i=null;break b}}a=i.data,i=a===`F!`||a===`F`?i:null}if(i){Ni=vf(i.nextSibling),r=i.data===`F!`;break a}}Ri(r)}r=!1}r&&(t=n[0])}}return n=jo(),n.memoizedState=n.baseState=t,r={pending:null,lanes:0,dispatch:null,lastRenderedReducer:ts,lastRenderedState:t},n.queue=r,n=Ps.bind(null,fo,r),r.dispatch=n,r=qo(!1),a=Is.bind(null,fo,!1,r.queue),r=jo(),i={state:t,dispatch:null,action:e,pending:null},r.queue=i,n=Yo.bind(null,fo,i,a,n),i.dispatch=n,r.memoizedState=e,[t,n,!1]}function rs(e){return is(Mo(),po,e)}function is(e,t,n){if(t=zo(e,t,ts)[0],e=Ro(Lo)[0],typeof t==`object`&&t&&typeof t.then==`function`)try{var r=Po(t)}catch(e){throw e===ba?Sa:e}else r=t;t=Mo();var i=t.queue,a=i.dispatch;return n!==t.memoizedState&&(fo.flags|=2048,ss(9,{destroy:void 0},as.bind(null,i,n),null)),[r,a,e]}function as(e,t){e.action=t}function os(e){var t=Mo(),n=po;if(n!==null)return is(t,n,e);Mo(),t=t.memoizedState,n=Mo();var r=n.queue.dispatch;return n.memoizedState=e,[t,r,!1]}function ss(e,t,n,r){return e={tag:e,create:n,deps:r,inst:t,next:null},t=fo.updateQueue,t===null&&(t=No(),fo.updateQueue=t),n=t.lastEffect,n===null?t.lastEffect=e.next=e:(r=n.next,n.next=e,e.next=r,t.lastEffect=e),e}function cs(){return Mo().memoizedState}function ls(e,t,n,r){var i=jo();fo.flags|=e,i.memoizedState=ss(1|t,{destroy:void 0},n,r===void 0?null:r)}function us(e,t,n,r){var i=Mo();r=r===void 0?null:r;var a=i.memoizedState.inst;po!==null&&r!==null&&Co(r,po.memoizedState.deps)?i.memoizedState=ss(t,a,n,r):(fo.flags|=e,i.memoizedState=ss(1|t,a,n,r))}function ds(e,t){ls(8390656,8,e,t)}function fs(e,t){us(2048,8,e,t)}function ps(e){fo.flags|=4;var t=fo.updateQueue;if(t===null)t=No(),fo.updateQueue=t,t.events=[e];else{var n=t.events;n===null?t.events=[e]:n.push(e)}}function ms(e){var t=Mo().memoizedState;return ps({ref:t,nextImpl:e}),function(){if(Ul&2)throw Error(i(440));return t.impl.apply(void 0,arguments)}}function hs(e,t){return us(4,2,e,t)}function gs(e,t){return us(4,4,e,t)}function _s(e,t){if(typeof t==`function`){e=e();var n=t(e);return function(){typeof n==`function`?n():t(null)}}if(t!=null)return e=e(),t.current=e,function(){t.current=null}}function vs(e,t,n){n=n==null?null:n.concat([e]),us(4,4,_s.bind(null,t,e),n)}function ys(){}function bs(e,t){var n=Mo();t=t===void 0?null:t;var r=n.memoizedState;return t!==null&&Co(t,r[1])?r[0]:(n.memoizedState=[e,t],e)}function xs(e,t){var n=Mo();t=t===void 0?null:t;var r=n.memoizedState;if(t!==null&&Co(t,r[1]))return r[0];if(r=e(),_o){Re(!0);try{e()}finally{Re(!1)}}return n.memoizedState=[r,t],r}function Ss(e,t,n){return n===void 0||uo&1073741824&&!(Kl&261930)?e.memoizedState=t:(e.memoizedState=n,e=Cu(),fo.lanes|=e,eu|=e,n)}function Cs(e,t,n,r){return Sr(n,t)?n:Xa.current===null?!(uo&42)||uo&1073741824&&!(Kl&261930)?(ac=!0,e.memoizedState=n):(e=Cu(),fo.lanes|=e,eu|=e,t):(e=Ss(e,n,r),Sr(e,t)||(ac=!0),e)}function ws(e,t,n,r,i){var a=F.p;F.p=a!==0&&8>a?a:8;var o=P.T,s={};P.T=s,Is(e,!1,t,n);try{var c=i(),l=P.S;l!==null&&l(s,c),typeof c==`object`&&c&&typeof c.then==`function`?Fs(e,t,ma(c,r),Su(e)):Fs(e,t,r,Su(e))}catch(n){Fs(e,t,{then:function(){},status:`rejected`,reason:n},Su())}finally{F.p=a,o!==null&&s.types!==null&&(o.types=s.types),P.T=o}}function Ts(){}function Es(e,t,n,r){if(e.tag!==5)throw Error(i(476));var a=Ds(e).queue;ws(e,a,t,I,n===null?Ts:function(){return Os(e),n(r)})}function Ds(e){var t=e.memoizedState;if(t!==null)return t;t={memoizedState:I,baseState:I,baseQueue:null,queue:{pending:null,lanes:0,dispatch:null,lastRenderedReducer:Lo,lastRenderedState:I},next:null};var n={};return t.next={memoizedState:n,baseState:n,baseQueue:null,queue:{pending:null,lanes:0,dispatch:null,lastRenderedReducer:Lo,lastRenderedState:n},next:null},e.memoizedState=t,e=e.alternate,e!==null&&(e.memoizedState=t),t}function Os(e){var t=Ds(e);t.next===null&&(t=e.alternate.memoizedState),Fs(e,t.next.queue,{},Su())}function ks(){return $i(cp)}function As(){return Mo().memoizedState}function js(){return Mo().memoizedState}function Ms(e){for(var t=e.return;t!==null;){switch(t.tag){case 24:case 3:var n=Su();e=Va(n);var r=Ha(t,e,n);r!==null&&(wu(r,t,n),Ua(r,t,n)),t={cache:oa()},e.payload=t;return}t=t.return}}function Ns(e,t,n){var r=Su();n={lane:r,revertLane:0,gesture:null,action:n,hasEagerState:!1,eagerState:null,next:null},Ls(e)?Rs(t,n):(n=ni(e,t,n,r),n!==null&&(wu(n,e,r),zs(n,t,r)))}function Ps(e,t,n){Fs(e,t,n,Su())}function Fs(e,t,n,r){var i={lane:r,revertLane:0,gesture:null,action:n,hasEagerState:!1,eagerState:null,next:null};if(Ls(e))Rs(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,Sr(s,o))return ti(e,t,i,0),Wl===null&&ei(),!1}catch{}if(n=ni(e,t,i,r),n!==null)return wu(n,e,r),zs(n,t,r),!0}return!1}function Is(e,t,n,r){if(r={lane:2,revertLane:bd(),gesture:null,action:r,hasEagerState:!1,eagerState:null,next:null},Ls(e)){if(t)throw Error(i(479))}else t=ni(e,n,r,2),t!==null&&wu(t,e,2)}function Ls(e){var t=e.alternate;return e===fo||t!==null&&t===fo}function Rs(e,t){go=ho=!0;var n=e.pending;n===null?t.next=t:(t.next=n.next,n.next=t),e.pending=t}function zs(e,t,n){if(n&4194048){var r=t.lanes;r&=e.pendingLanes,n|=r,t.lanes=n,et(e,n)}}var Bs={readContext:$i,use:Fo,useCallback:So,useContext:So,useEffect:So,useImperativeHandle:So,useLayoutEffect:So,useInsertionEffect:So,useMemo:So,useReducer:So,useRef:So,useState:So,useDebugValue:So,useDeferredValue:So,useTransition:So,useSyncExternalStore:So,useId:So,useHostTransitionStatus:So,useFormState:So,useActionState:So,useOptimistic:So,useMemoCache:So,useCacheRefresh:So};Bs.useEffectEvent=So;var Vs={readContext:$i,use:Fo,useCallback:function(e,t){return jo().memoizedState=[e,t===void 0?null:t],e},useContext:$i,useEffect:ds,useImperativeHandle:function(e,t,n){n=n==null?null:n.concat([e]),ls(4194308,4,_s.bind(null,t,e),n)},useLayoutEffect:function(e,t){return ls(4194308,4,e,t)},useInsertionEffect:function(e,t){ls(4,2,e,t)},useMemo:function(e,t){var n=jo();t=t===void 0?null:t;var r=e();if(_o){Re(!0);try{e()}finally{Re(!1)}}return n.memoizedState=[r,t],r},useReducer:function(e,t,n){var r=jo();if(n!==void 0){var i=n(t);if(_o){Re(!0);try{n(t)}finally{Re(!1)}}}else i=t;return r.memoizedState=r.baseState=i,e={pending:null,lanes:0,dispatch:null,lastRenderedReducer:e,lastRenderedState:i},r.queue=e,e=e.dispatch=Ns.bind(null,fo,e),[r.memoizedState,e]},useRef:function(e){var t=jo();return e={current:e},t.memoizedState=e},useState:function(e){e=qo(e);var t=e.queue,n=Ps.bind(null,fo,t);return t.dispatch=n,[e.memoizedState,n]},useDebugValue:ys,useDeferredValue:function(e,t){return Ss(jo(),e,t)},useTransition:function(){var e=qo(!1);return e=ws.bind(null,fo,e.queue,!0,!1),jo().memoizedState=e,[!1,e]},useSyncExternalStore:function(e,t,n){var r=fo,a=jo();if(Pi){if(n===void 0)throw Error(i(407));n=n()}else{if(n=t(),Wl===null)throw Error(i(349));Kl&127||Ho(r,t,n)}a.memoizedState=n;var o={value:n,getSnapshot:t};return a.queue=o,ds(Wo.bind(null,r,o,e),[e]),r.flags|=2048,ss(9,{destroy:void 0},Uo.bind(null,r,o,n,t),null),n},useId:function(){var e=jo(),t=Wl.identifierPrefix;if(Pi){var n=Ei,r=Ti;n=(r&~(1<<32-ze(r)-1)).toString(32)+n,t=`_`+t+`R_`+n,n=vo++,0<n&&(t+=`H`+n.toString(32)),t+=`_`}else n=xo++,t=`_`+t+`r_`+n.toString(32)+`_`;return e.memoizedState=t},useHostTransitionStatus:ks,useFormState:ns,useActionState:ns,useOptimistic:function(e){var t=jo();t.memoizedState=t.baseState=e;var n={pending:null,lanes:0,dispatch:null,lastRenderedReducer:null,lastRenderedState:null};return t.queue=n,t=Is.bind(null,fo,!0,n),n.dispatch=t,[e,t]},useMemoCache:Io,useCacheRefresh:function(){return jo().memoizedState=Ms.bind(null,fo)},useEffectEvent:function(e){var t=jo(),n={impl:e};return t.memoizedState=n,function(){if(Ul&2)throw Error(i(440));return n.impl.apply(void 0,arguments)}}},Hs={readContext:$i,use:Fo,useCallback:bs,useContext:$i,useEffect:fs,useImperativeHandle:vs,useInsertionEffect:hs,useLayoutEffect:gs,useMemo:xs,useReducer:Ro,useRef:cs,useState:function(){return Ro(Lo)},useDebugValue:ys,useDeferredValue:function(e,t){return Cs(Mo(),po.memoizedState,e,t)},useTransition:function(){var e=Ro(Lo)[0],t=Mo().memoizedState;return[typeof e==`boolean`?e:Po(e),t]},useSyncExternalStore:Vo,useId:As,useHostTransitionStatus:ks,useFormState:rs,useActionState:rs,useOptimistic:function(e,t){return Jo(Mo(),po,e,t)},useMemoCache:Io,useCacheRefresh:js};Hs.useEffectEvent=ms;var Us={readContext:$i,use:Fo,useCallback:bs,useContext:$i,useEffect:fs,useImperativeHandle:vs,useInsertionEffect:hs,useLayoutEffect:gs,useMemo:xs,useReducer:Bo,useRef:cs,useState:function(){return Bo(Lo)},useDebugValue:ys,useDeferredValue:function(e,t){var n=Mo();return po===null?Ss(n,e,t):Cs(n,po.memoizedState,e,t)},useTransition:function(){var e=Bo(Lo)[0],t=Mo().memoizedState;return[typeof e==`boolean`?e:Po(e),t]},useSyncExternalStore:Vo,useId:As,useHostTransitionStatus:ks,useFormState:os,useActionState:os,useOptimistic:function(e,t){var n=Mo();return po===null?(n.baseState=e,[e,n.queue.dispatch]):Jo(n,po,e,t)},useMemoCache:Io,useCacheRefresh:js};Us.useEffectEvent=ms;function Ws(e,t,n,r){t=e.memoizedState,n=n(r,t),n=n==null?t:p({},t,n),e.memoizedState=n,e.lanes===0&&(e.updateQueue.baseState=n)}var Gs={enqueueSetState:function(e,t,n){e=e._reactInternals;var r=Su(),i=Va(r);i.payload=t,n!=null&&(i.callback=n),t=Ha(e,i,r),t!==null&&(wu(t,e,r),Ua(t,e,r))},enqueueReplaceState:function(e,t,n){e=e._reactInternals;var r=Su(),i=Va(r);i.tag=1,i.payload=t,n!=null&&(i.callback=n),t=Ha(e,i,r),t!==null&&(wu(t,e,r),Ua(t,e,r))},enqueueForceUpdate:function(e,t){e=e._reactInternals;var n=Su(),r=Va(n);r.tag=2,t!=null&&(r.callback=t),t=Ha(e,r,n),t!==null&&(wu(t,e,n),Ua(t,e,n))}};function Ks(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?!Cr(n,r)||!Cr(i,a):!0}function qs(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&&Gs.enqueueReplaceState(t,t.state,null)}function Js(e,t){var n=t;if(`ref`in t)for(var r in n={},t)r!==`ref`&&(n[r]=t[r]);if(e=e.defaultProps)for(var i in n===t&&(n=p({},n)),e)n[i]===void 0&&(n[i]=e[i]);return n}function Ys(e){Xr(e)}function Xs(e){console.error(e)}function Zs(e){Xr(e)}function Qs(e,t){try{var n=e.onUncaughtError;n(t.value,{componentStack:t.stack})}catch(e){setTimeout(function(){throw e})}}function $s(e,t,n){try{var r=e.onCaughtError;r(n.value,{componentStack:n.stack,errorBoundary:t.tag===1?t.stateNode:null})}catch(e){setTimeout(function(){throw e})}}function ec(e,t,n){return n=Va(n),n.tag=3,n.payload={element:null},n.callback=function(){Qs(e,t)},n}function tc(e){return e=Va(e),e.tag=3,e}function nc(e,t,n,r){var i=n.type.getDerivedStateFromError;if(typeof i==`function`){var a=r.value;e.payload=function(){return i(a)},e.callback=function(){$s(t,n,r)}}var o=n.stateNode;o!==null&&typeof o.componentDidCatch==`function`&&(e.callback=function(){$s(t,n,r),typeof i!=`function`&&(fu===null?fu=new Set([this]):fu.add(this));var e=r.stack;this.componentDidCatch(r.value,{componentStack:e===null?``:e})})}function rc(e,t,n,r,a){if(n.flags|=32768,typeof r==`object`&&r&&typeof r.then==`function`){if(t=n.alternate,t!==null&&Xi(t,n,a,!0),n=to.current,n!==null){switch(n.tag){case 31:case 13:return no===null?Fu():n.alternate===null&&$l===0&&($l=3),n.flags&=-257,n.flags|=65536,n.lanes=a,r===Ca?n.flags|=16384:(t=n.updateQueue,t===null?n.updateQueue=new Set([r]):t.add(r),ed(e,r,a)),!1;case 22:return n.flags|=65536,r===Ca?n.flags|=16384:(t=n.updateQueue,t===null?(t={transitions:null,markerInstances:null,retryQueue:new Set([r])},n.updateQueue=t):(n=t.retryQueue,n===null?t.retryQueue=new Set([r]):n.add(r)),ed(e,r,a)),!1}throw Error(i(435,n.tag))}return ed(e,r,a),Fu(),!1}if(Pi)return t=to.current,t===null?(r!==Li&&(t=Error(i(423),{cause:r}),Wi(_i(t,n))),e=e.current.alternate,e.flags|=65536,a&=-a,e.lanes|=a,r=_i(r,n),a=ec(e.stateNode,r,a),Wa(e,a),$l!==4&&($l=2)):(!(t.flags&65536)&&(t.flags|=256),t.flags|=65536,t.lanes=a,r!==Li&&(e=Error(i(422),{cause:r}),Wi(_i(e,n)))),!1;var o=Error(i(520),{cause:r});if(o=_i(o,n),au===null?au=[o]:au.push(o),$l!==4&&($l=2),t===null)return!0;r=_i(r,n),n=t;do{switch(n.tag){case 3:return n.flags|=65536,e=a&-a,n.lanes|=e,e=ec(n.stateNode,r,e),Wa(n,e),!1;case 1:if(t=n.type,o=n.stateNode,!(n.flags&128)&&(typeof t.getDerivedStateFromError==`function`||o!==null&&typeof o.componentDidCatch==`function`&&(fu===null||!fu.has(o))))return n.flags|=65536,a&=-a,n.lanes|=a,a=tc(a),nc(a,e,n,r),Wa(n,a),!1}n=n.return}while(n!==null);return!1}var ic=Error(i(461)),ac=!1;function oc(e,t,n,r){t.child=e===null?La(t,null,n,r):Ia(t,e.child,n,r)}function sc(e,t,n,r,i){n=n.render;var a=t.ref;if(`ref`in r){var o={};for(var s in r)s!==`ref`&&(o[s]=r[s])}else o=r;return Qi(t),r=wo(e,t,n,o,a,i),s=Oo(),e!==null&&!ac?(ko(e,t,i),jc(e,t,i)):(Pi&&s&&ki(t),t.flags|=1,oc(e,t,r,i),t.child)}function cc(e,t,n,r,i){if(e===null){var a=n.type;return typeof a==`function`&&!li(a)&&a.defaultProps===void 0&&n.compare===null?(t.tag=15,t.type=a,lc(e,t,a,r,i)):(e=di(n.type,null,r,t,t.mode,i),e.ref=t.ref,e.return=t,t.child=e)}if(a=e.child,!Mc(e,i)){var o=a.memoizedProps;if(n=n.compare,n=n===null?Cr:n,n(o,r)&&e.ref===t.ref)return jc(e,t,i)}return t.flags|=1,e=ui(a,r),e.ref=t.ref,e.return=t,t.child=e}function lc(e,t,n,r,i){if(e!==null){var a=e.memoizedProps;if(Cr(a,r)&&e.ref===t.ref)if(ac=!1,t.pendingProps=r=a,Mc(e,i))e.flags&131072&&(ac=!0);else return t.lanes=e.lanes,jc(e,t,i)}return _c(e,t,n,r,i)}function uc(e,t,n,r){var i=r.children,a=e===null?null:e.memoizedState;if(e===null&&t.stateNode===null&&(t.stateNode={_visibility:1,_pendingMarkers:null,_retryCache:null,_transitions:null}),r.mode===`hidden`){if(t.flags&128){if(a=a===null?n:a.baseLanes|n,e!==null){for(r=t.child=e.child,i=0;r!==null;)i=i|r.lanes|r.childLanes,r=r.sibling;r=i&~a}else r=0,t.child=null;return fc(e,t,a,n,r)}if(n&536870912)t.memoizedState={baseLanes:0,cachePool:null},e!==null&&va(t,a===null?null:a.cachePool),a===null?$a():Qa(t,a),ao(t);else return r=t.lanes=536870912,fc(e,t,a===null?n:a.baseLanes|n,n,r)}else a===null?(e!==null&&va(t,null),$a(),oo(t)):(va(t,a.cachePool),Qa(t,a),oo(t),t.memoizedState=null);return oc(e,t,i,n),t.child}function dc(e,t){return e!==null&&e.tag===22||t.stateNode!==null||(t.stateNode={_visibility:1,_pendingMarkers:null,_retryCache:null,_transitions:null}),t.sibling}function fc(e,t,n,r,i){var a=_a();return a=a===null?null:{parent:aa._currentValue,pool:a},t.memoizedState={baseLanes:n,cachePool:a},e!==null&&va(t,null),$a(),ao(t),e!==null&&Xi(e,t,r,!0),t.childLanes=i,null}function pc(e,t){return t=Ec({mode:t.mode,children:t.children},e.mode),t.ref=e.ref,e.child=t,t.return=e,t}function mc(e,t,n){return Ia(t,e.child,null,n),e=pc(t,t.pendingProps),e.flags|=2,so(t),t.memoizedState=null,e}function hc(e,t,n){var r=t.pendingProps,a=!!(t.flags&128);if(t.flags&=-129,e===null){if(Pi){if(r.mode===`hidden`)return e=pc(t,r),t.lanes=536870912,dc(null,e);if(io(t),(e=Ni)?(e=mf(e,Ii),e=e!==null&&e.data===`&`?e:null,e!==null&&(t.memoizedState={dehydrated:e,treeContext:wi===null?null:{id:Ti,overflow:Ei},retryLane:536870912,hydrationErrors:null},n=mi(e),n.return=t,t.child=n,Mi=t,Ni=null)):e=null,e===null)throw Ri(t);return t.lanes=536870912,null}return pc(t,r)}var o=e.memoizedState;if(o!==null){var s=o.dehydrated;if(io(t),a)if(t.flags&256)t.flags&=-257,t=mc(e,t,n);else if(t.memoizedState!==null)t.child=e.child,t.flags|=128,t=null;else throw Error(i(558));else if(ac||Xi(e,t,n,!1),a=(n&e.childLanes)!==0,ac||a){if(r=Wl,r!==null&&(s=tt(r,n),s!==0&&s!==o.retryLane))throw o.retryLane=s,ri(e,s),wu(r,e,s),ic;Fu(),t=mc(e,t,n)}else e=o.treeContext,Ni=vf(s.nextSibling),Mi=t,Pi=!0,Fi=null,Ii=!1,e!==null&&ji(t,e),t=pc(t,r),t.flags|=4096;return t}return e=ui(e.child,{mode:r.mode,children:r.children}),e.ref=t.ref,t.child=e,e.return=t,e}function gc(e,t){var n=t.ref;if(n===null)e!==null&&e.ref!==null&&(t.flags|=4194816);else{if(typeof n!=`function`&&typeof n!=`object`)throw Error(i(284));(e===null||e.ref!==n)&&(t.flags|=4194816)}}function _c(e,t,n,r,i){return Qi(t),n=wo(e,t,n,r,void 0,i),r=Oo(),e!==null&&!ac?(ko(e,t,i),jc(e,t,i)):(Pi&&r&&ki(t),t.flags|=1,oc(e,t,n,i),t.child)}function vc(e,t,n,r,i,a){return Qi(t),t.updateQueue=null,n=Eo(t,r,n,i),To(e),r=Oo(),e!==null&&!ac?(ko(e,t,a),jc(e,t,a)):(Pi&&r&&ki(t),t.flags|=1,oc(e,t,n,a),t.child)}function yc(e,t,n,r,i){if(Qi(t),t.stateNode===null){var a=oi,o=n.contextType;typeof o==`object`&&o&&(a=$i(o)),a=new n(r,a),t.memoizedState=a.state!==null&&a.state!==void 0?a.state:null,a.updater=Gs,t.stateNode=a,a._reactInternals=t,a=t.stateNode,a.props=r,a.state=t.memoizedState,a.refs={},za(t),o=n.contextType,a.context=typeof o==`object`&&o?$i(o):oi,a.state=t.memoizedState,o=n.getDerivedStateFromProps,typeof o==`function`&&(Ws(t,n,o,r),a.state=t.memoizedState),typeof n.getDerivedStateFromProps==`function`||typeof a.getSnapshotBeforeUpdate==`function`||typeof a.UNSAFE_componentWillMount!=`function`&&typeof a.componentWillMount!=`function`||(o=a.state,typeof a.componentWillMount==`function`&&a.componentWillMount(),typeof a.UNSAFE_componentWillMount==`function`&&a.UNSAFE_componentWillMount(),o!==a.state&&Gs.enqueueReplaceState(a,a.state,null),qa(t,r,a,i),Ka(),a.state=t.memoizedState),typeof a.componentDidMount==`function`&&(t.flags|=4194308),r=!0}else if(e===null){a=t.stateNode;var s=t.memoizedProps,c=Js(n,s);a.props=c;var l=a.context,u=n.contextType;o=oi,typeof u==`object`&&u&&(o=$i(u));var d=n.getDerivedStateFromProps;u=typeof d==`function`||typeof a.getSnapshotBeforeUpdate==`function`,s=t.pendingProps!==s,u||typeof a.UNSAFE_componentWillReceiveProps!=`function`&&typeof a.componentWillReceiveProps!=`function`||(s||l!==o)&&qs(t,a,r,o),Ra=!1;var f=t.memoizedState;a.state=f,qa(t,r,a,i),Ka(),l=t.memoizedState,s||f!==l||Ra?(typeof d==`function`&&(Ws(t,n,d,r),l=t.memoizedState),(c=Ra||Ks(t,n,c,r,f,l,o))?(u||typeof a.UNSAFE_componentWillMount!=`function`&&typeof a.componentWillMount!=`function`||(typeof a.componentWillMount==`function`&&a.componentWillMount(),typeof a.UNSAFE_componentWillMount==`function`&&a.UNSAFE_componentWillMount()),typeof a.componentDidMount==`function`&&(t.flags|=4194308)):(typeof a.componentDidMount==`function`&&(t.flags|=4194308),t.memoizedProps=r,t.memoizedState=l),a.props=r,a.state=l,a.context=o,r=c):(typeof a.componentDidMount==`function`&&(t.flags|=4194308),r=!1)}else{a=t.stateNode,Ba(e,t),o=t.memoizedProps,u=Js(n,o),a.props=u,d=t.pendingProps,f=a.context,l=n.contextType,c=oi,typeof l==`object`&&l&&(c=$i(l)),s=n.getDerivedStateFromProps,(l=typeof s==`function`||typeof a.getSnapshotBeforeUpdate==`function`)||typeof a.UNSAFE_componentWillReceiveProps!=`function`&&typeof a.componentWillReceiveProps!=`function`||(o!==d||f!==c)&&qs(t,a,r,c),Ra=!1,f=t.memoizedState,a.state=f,qa(t,r,a,i),Ka();var p=t.memoizedState;o!==d||f!==p||Ra||e!==null&&e.dependencies!==null&&Zi(e.dependencies)?(typeof s==`function`&&(Ws(t,n,s,r),p=t.memoizedState),(u=Ra||Ks(t,n,u,r,f,p,c)||e!==null&&e.dependencies!==null&&Zi(e.dependencies))?(l||typeof a.UNSAFE_componentWillUpdate!=`function`&&typeof a.componentWillUpdate!=`function`||(typeof a.componentWillUpdate==`function`&&a.componentWillUpdate(r,p,c),typeof a.UNSAFE_componentWillUpdate==`function`&&a.UNSAFE_componentWillUpdate(r,p,c)),typeof a.componentDidUpdate==`function`&&(t.flags|=4),typeof a.getSnapshotBeforeUpdate==`function`&&(t.flags|=1024)):(typeof a.componentDidUpdate!=`function`||o===e.memoizedProps&&f===e.memoizedState||(t.flags|=4),typeof a.getSnapshotBeforeUpdate!=`function`||o===e.memoizedProps&&f===e.memoizedState||(t.flags|=1024),t.memoizedProps=r,t.memoizedState=p),a.props=r,a.state=p,a.context=c,r=u):(typeof a.componentDidUpdate!=`function`||o===e.memoizedProps&&f===e.memoizedState||(t.flags|=4),typeof a.getSnapshotBeforeUpdate!=`function`||o===e.memoizedProps&&f===e.memoizedState||(t.flags|=1024),r=!1)}return a=r,gc(e,t),r=!!(t.flags&128),a||r?(a=t.stateNode,n=r&&typeof n.getDerivedStateFromError!=`function`?null:a.render(),t.flags|=1,e!==null&&r?(t.child=Ia(t,e.child,null,i),t.child=Ia(t,null,n,i)):oc(e,t,n,i),t.memoizedState=a.state,e=t.child):e=jc(e,t,i),e}function bc(e,t,n,r){return Hi(),t.flags|=256,oc(e,t,n,r),t.child}var xc={dehydrated:null,treeContext:null,retryLane:0,hydrationErrors:null};function Sc(e){return{baseLanes:e,cachePool:ya()}}function Cc(e,t,n){return e=e===null?0:e.childLanes&~n,t&&(e|=ru),e}function wc(e,t,n){var r=t.pendingProps,a=!1,o=!!(t.flags&128),s;if((s=o)||(s=e!==null&&e.memoizedState===null?!1:!!(co.current&2)),s&&(a=!0,t.flags&=-129),s=!!(t.flags&32),t.flags&=-33,e===null){if(Pi){if(a?ro(t):oo(t),(e=Ni)?(e=mf(e,Ii),e=e!==null&&e.data!==`&`?e:null,e!==null&&(t.memoizedState={dehydrated:e,treeContext:wi===null?null:{id:Ti,overflow:Ei},retryLane:536870912,hydrationErrors:null},n=mi(e),n.return=t,t.child=n,Mi=t,Ni=null)):e=null,e===null)throw Ri(t);return gf(e)?t.lanes=32:t.lanes=536870912,null}var c=r.children;return r=r.fallback,a?(oo(t),a=t.mode,c=Ec({mode:`hidden`,children:c},a),r=fi(r,a,n,null),c.return=t,r.return=t,c.sibling=r,t.child=c,r=t.child,r.memoizedState=Sc(n),r.childLanes=Cc(e,s,n),t.memoizedState=xc,dc(null,r)):(ro(t),Tc(t,c))}var l=e.memoizedState;if(l!==null&&(c=l.dehydrated,c!==null)){if(o)t.flags&256?(ro(t),t.flags&=-257,t=Dc(e,t,n)):t.memoizedState===null?(oo(t),c=r.fallback,a=t.mode,r=Ec({mode:`visible`,children:r.children},a),c=fi(c,a,n,null),c.flags|=2,r.return=t,c.return=t,r.sibling=c,t.child=r,Ia(t,e.child,null,n),r=t.child,r.memoizedState=Sc(n),r.childLanes=Cc(e,s,n),t.memoizedState=xc,t=dc(null,r)):(oo(t),t.child=e.child,t.flags|=128,t=null);else if(ro(t),gf(c)){if(s=c.nextSibling&&c.nextSibling.dataset,s)var u=s.dgst;s=u,r=Error(i(419)),r.stack=``,r.digest=s,Wi({value:r,source:null,stack:null}),t=Dc(e,t,n)}else if(ac||Xi(e,t,n,!1),s=(n&e.childLanes)!==0,ac||s){if(s=Wl,s!==null&&(r=tt(s,n),r!==0&&r!==l.retryLane))throw l.retryLane=r,ri(e,r),wu(s,e,r),ic;hf(c)||Fu(),t=Dc(e,t,n)}else hf(c)?(t.flags|=192,t.child=e.child,t=null):(e=l.treeContext,Ni=vf(c.nextSibling),Mi=t,Pi=!0,Fi=null,Ii=!1,e!==null&&ji(t,e),t=Tc(t,r.children),t.flags|=4096);return t}return a?(oo(t),c=r.fallback,a=t.mode,l=e.child,u=l.sibling,r=ui(l,{mode:`hidden`,children:r.children}),r.subtreeFlags=l.subtreeFlags&65011712,u===null?(c=fi(c,a,n,null),c.flags|=2):c=ui(u,c),c.return=t,r.return=t,r.sibling=c,t.child=r,dc(null,r),r=t.child,c=e.child.memoizedState,c===null?c=Sc(n):(a=c.cachePool,a===null?a=ya():(l=aa._currentValue,a=a.parent===l?a:{parent:l,pool:l}),c={baseLanes:c.baseLanes|n,cachePool:a}),r.memoizedState=c,r.childLanes=Cc(e,s,n),t.memoizedState=xc,dc(e.child,r)):(ro(t),n=e.child,e=n.sibling,n=ui(n,{mode:`visible`,children:r.children}),n.return=t,n.sibling=null,e!==null&&(s=t.deletions,s===null?(t.deletions=[e],t.flags|=16):s.push(e)),t.child=n,t.memoizedState=null,n)}function Tc(e,t){return t=Ec({mode:`visible`,children:t},e.mode),t.return=e,e.child=t}function Ec(e,t){return e=ci(22,e,null,t),e.lanes=0,e}function Dc(e,t,n){return Ia(t,e.child,null,n),e=Tc(t,t.pendingProps.children),e.flags|=2,t.memoizedState=null,e}function Oc(e,t,n){e.lanes|=t;var r=e.alternate;r!==null&&(r.lanes|=t),V(e.return,t,n)}function kc(e,t,n,r,i,a){var o=e.memoizedState;o===null?e.memoizedState={isBackwards:t,rendering:null,renderingStartTime:0,last:r,tail:n,tailMode:i,treeForkCount:a}:(o.isBackwards=t,o.rendering=null,o.renderingStartTime=0,o.last=r,o.tail=n,o.tailMode=i,o.treeForkCount=a)}function Ac(e,t,n){var r=t.pendingProps,i=r.revealOrder,a=r.tail;r=r.children;var o=co.current,s=!!(o&2);if(s?(o=o&1|2,t.flags|=128):o&=1,oe(co,o),oc(e,t,r,n),r=Pi?xi:0,!s&&e!==null&&e.flags&128)a:for(e=t.child;e!==null;){if(e.tag===13)e.memoizedState!==null&&Oc(e,n,t);else if(e.tag===19)Oc(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}switch(i){case`forwards`:for(n=t.child,i=null;n!==null;)e=n.alternate,e!==null&&lo(e)===null&&(i=n),n=n.sibling;n=i,n===null?(i=t.child,t.child=null):(i=n.sibling,n.sibling=null),kc(t,!1,i,n,a,r);break;case`backwards`:case`unstable_legacy-backwards`:for(n=null,i=t.child,t.child=null;i!==null;){if(e=i.alternate,e!==null&&lo(e)===null){t.child=i;break}e=i.sibling,i.sibling=n,n=i,i=e}kc(t,!0,n,null,a,r);break;case`together`:kc(t,!1,null,null,void 0,r);break;default:t.memoizedState=null}return t.child}function jc(e,t,n){if(e!==null&&(t.dependencies=e.dependencies),eu|=t.lanes,(n&t.childLanes)===0)if(e!==null){if(Xi(e,t,n,!1),(n&t.childLanes)===0)return null}else return null;if(e!==null&&t.child!==e.child)throw Error(i(153));if(t.child!==null){for(e=t.child,n=ui(e,e.pendingProps),t.child=n,n.return=t;e.sibling!==null;)e=e.sibling,n=n.sibling=ui(e,e.pendingProps),n.return=t;n.sibling=null}return t.child}function Mc(e,t){return(e.lanes&t)!==0||(e=e.dependencies,!!(e!==null&&Zi(e)))}function Nc(e,t,n){switch(t.tag){case 3:de(t,t.stateNode.containerInfo),qi(t,aa,e.memoizedState.cache),Hi();break;case 27:case 5:pe(t);break;case 4:de(t,t.stateNode.containerInfo);break;case 10:qi(t,t.type,t.memoizedProps.value);break;case 31:if(t.memoizedState!==null)return t.flags|=128,io(t),null;break;case 13:var r=t.memoizedState;if(r!==null)return r.dehydrated===null?(n&t.child.childLanes)===0?(ro(t),e=jc(e,t,n),e===null?null:e.sibling):wc(e,t,n):(ro(t),t.flags|=128,null);ro(t);break;case 19:var i=!!(e.flags&128);if(r=(n&t.childLanes)!==0,r||=(Xi(e,t,n,!1),(n&t.childLanes)!==0),i){if(r)return Ac(e,t,n);t.flags|=128}if(i=t.memoizedState,i!==null&&(i.rendering=null,i.tail=null,i.lastEffect=null),oe(co,co.current),r)break;return null;case 22:return t.lanes=0,uc(e,t,n,t.pendingProps);case 24:qi(t,aa,e.memoizedState.cache)}return jc(e,t,n)}function Pc(e,t,n){if(e!==null)if(e.memoizedProps!==t.pendingProps)ac=!0;else{if(!Mc(e,n)&&!(t.flags&128))return ac=!1,Nc(e,t,n);ac=!!(e.flags&131072)}else ac=!1,Pi&&t.flags&1048576&&Oi(t,xi,t.index);switch(t.lanes=0,t.tag){case 16:a:{var r=t.pendingProps;if(e=Ea(t.elementType),t.type=e,typeof e==`function`)li(e)?(r=Js(e,r),t.tag=1,t=yc(null,t,e,r,n)):(t.tag=0,t=_c(null,t,e,r,n));else{if(e!=null){var a=e.$$typeof;if(a===w){t.tag=11,t=sc(null,t,e,r,n);break a}if(a===D){t.tag=14,t=cc(null,t,e,r,n);break a}}throw t=ee(e)||e,Error(i(306,t,``))}}return t;case 0:return _c(e,t,t.type,t.pendingProps,n);case 1:return r=t.type,a=Js(r,t.pendingProps),yc(e,t,r,a,n);case 3:a:{if(de(t,t.stateNode.containerInfo),e===null)throw Error(i(387));r=t.pendingProps;var o=t.memoizedState;a=o.element,Ba(e,t),qa(t,r,null,n);var s=t.memoizedState;if(r=s.cache,qi(t,aa,r),r!==o.cache&&Yi(t,[aa],n,!0),Ka(),r=s.element,o.isDehydrated)if(o={element:r,isDehydrated:!1,cache:s.cache},t.updateQueue.baseState=o,t.memoizedState=o,t.flags&256){t=bc(e,t,r,n);break a}else if(r!==a){a=_i(Error(i(424)),t),Wi(a),t=bc(e,t,r,n);break a}else{switch(e=t.stateNode.containerInfo,e.nodeType){case 9:e=e.body;break;default:e=e.nodeName===`HTML`?e.ownerDocument.body:e}for(Ni=vf(e.firstChild),Mi=t,Pi=!0,Fi=null,Ii=!0,n=La(t,null,r,n),t.child=n;n;)n.flags=n.flags&-3|4096,n=n.sibling}else{if(Hi(),r===a){t=jc(e,t,n);break a}oc(e,t,r,n)}t=t.child}return t;case 26:return gc(e,t),e===null?(n=zf(t.type,null,t.pendingProps,null))?t.memoizedState=n:Pi||(n=t.type,e=t.pendingProps,r=Xd(le.current).createElement(n),r[ot]=t,r[st]=e,Gd(r,n,e),yt(r),t.stateNode=r):t.memoizedState=zf(t.type,e.memoizedProps,t.pendingProps,e.memoizedState),null;case 27:return pe(t),e===null&&Pi&&(r=t.stateNode=Sf(t.type,t.pendingProps,le.current),Mi=t,Ii=!0,a=Ni,cf(t.type)?(yf=a,Ni=vf(r.firstChild)):Ni=a),oc(e,t,t.pendingProps.children,n),gc(e,t),e===null&&(t.flags|=4194304),t.child;case 5:return e===null&&Pi&&((a=r=Ni)&&(r=ff(r,t.type,t.pendingProps,Ii),r===null?a=!1:(t.stateNode=r,Mi=t,Ni=vf(r.firstChild),Ii=!1,a=!0)),a||Ri(t)),pe(t),a=t.type,o=t.pendingProps,s=e===null?null:e.memoizedProps,r=o.children,$d(a,o)?r=null:s!==null&&$d(a,s)&&(t.flags|=32),t.memoizedState!==null&&(a=wo(e,t,Do,null,null,n),cp._currentValue=a),gc(e,t),oc(e,t,r,n),t.child;case 6:return e===null&&Pi&&((e=n=Ni)&&(n=pf(n,t.pendingProps,Ii),n===null?e=!1:(t.stateNode=n,Mi=t,Ni=null,e=!0)),e||Ri(t)),null;case 13:return wc(e,t,n);case 4:return de(t,t.stateNode.containerInfo),r=t.pendingProps,e===null?t.child=Ia(t,null,r,n):oc(e,t,r,n),t.child;case 11:return sc(e,t,t.type,t.pendingProps,n);case 7:return oc(e,t,t.pendingProps,n),t.child;case 8:return oc(e,t,t.pendingProps.children,n),t.child;case 12:return oc(e,t,t.pendingProps.children,n),t.child;case 10:return r=t.pendingProps,qi(t,t.type,r.value),oc(e,t,r.children,n),t.child;case 9:return a=t.type._context,r=t.pendingProps.children,Qi(t),a=$i(a),r=r(a),t.flags|=1,oc(e,t,r,n),t.child;case 14:return cc(e,t,t.type,t.pendingProps,n);case 15:return lc(e,t,t.type,t.pendingProps,n);case 19:return Ac(e,t,n);case 31:return hc(e,t,n);case 22:return uc(e,t,n,t.pendingProps);case 24:return Qi(t),r=$i(aa),e===null?(a=_a(),a===null&&(a=Wl,o=oa(),a.pooledCache=o,o.refCount++,o!==null&&(a.pooledCacheLanes|=n),a=o),t.memoizedState={parent:r,cache:a},za(t),qi(t,aa,a)):((e.lanes&n)!==0&&(Ba(e,t),qa(t,null,null,n),Ka()),a=e.memoizedState,o=t.memoizedState,a.parent===r?(r=o.cache,qi(t,aa,r),r!==a.cache&&Yi(t,[aa],n,!0)):(a={parent:r,cache:r},t.memoizedState=a,t.lanes===0&&(t.memoizedState=t.updateQueue.baseState=a),qi(t,aa,r))),oc(e,t,t.pendingProps.children,n),t.child;case 29:throw t.pendingProps}throw Error(i(156,t.tag))}function Fc(e){e.flags|=4}function Ic(e,t,n,r,i){if((t=!!(e.mode&32))&&(t=!1),t){if(e.flags|=16777216,(i&335544128)===i)if(e.stateNode.complete)e.flags|=8192;else if(H())e.flags|=8192;else throw Da=Ca,xa}else e.flags&=-16777217}function Lc(e,t){if(t.type!==`stylesheet`||t.state.loading&4)e.flags&=-16777217;else if(e.flags|=16777216,!ep(t))if(H())e.flags|=8192;else throw Da=Ca,xa}function Rc(e,t){t!==null&&(e.flags|=4),e.flags&16384&&(t=e.tag===22?536870912:Xe(),e.lanes|=t,iu|=t)}function zc(e,t){if(!Pi)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 Bc(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&65011712,r|=i.flags&65011712,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 Vc(e,t,n){var r=t.pendingProps;switch(Ai(t),t.tag){case 16:case 15:case 0:case 11:case 7:case 8:case 12:case 9:case 14:return Bc(t),null;case 1:return Bc(t),null;case 3:return n=t.stateNode,r=null,e!==null&&(r=e.memoizedState.cache),t.memoizedState.cache!==r&&(t.flags|=2048),Ji(aa),fe(),n.pendingContext&&(n.context=n.pendingContext,n.pendingContext=null),(e===null||e.child===null)&&(Vi(t)?Fc(t):e===null||e.memoizedState.isDehydrated&&!(t.flags&256)||(t.flags|=1024,Ui())),Bc(t),null;case 26:var a=t.type,o=t.memoizedState;return e===null?(Fc(t),o===null?(Bc(t),Ic(t,a,null,r,n)):(Bc(t),Lc(t,o))):o?o===e.memoizedState?(Bc(t),t.flags&=-16777217):(Fc(t),Bc(t),Lc(t,o)):(e=e.memoizedProps,e!==r&&Fc(t),Bc(t),Ic(t,a,e,r,n)),null;case 27:if(me(t),n=le.current,a=t.type,e!==null&&t.stateNode!=null)e.memoizedProps!==r&&Fc(t);else{if(!r){if(t.stateNode===null)throw Error(i(166));return Bc(t),null}e=se.current,Vi(t)?zi(t,e):(e=Sf(a,r,n),t.stateNode=e,Fc(t))}return Bc(t),null;case 5:if(me(t),a=t.type,e!==null&&t.stateNode!=null)e.memoizedProps!==r&&Fc(t);else{if(!r){if(t.stateNode===null)throw Error(i(166));return Bc(t),null}if(o=se.current,Vi(t))zi(t,o);else{var s=Xd(le.current);switch(o){case 1:o=s.createElementNS(`http://www.w3.org/2000/svg`,a);break;case 2:o=s.createElementNS(`http://www.w3.org/1998/Math/MathML`,a);break;default:switch(a){case`svg`:o=s.createElementNS(`http://www.w3.org/2000/svg`,a);break;case`math`:o=s.createElementNS(`http://www.w3.org/1998/Math/MathML`,a);break;case`script`:o=s.createElement(`div`),o.innerHTML=`<script><\/script>`,o=o.removeChild(o.firstChild);break;case`select`:o=typeof r.is==`string`?s.createElement(`select`,{is:r.is}):s.createElement(`select`),r.multiple?o.multiple=!0:r.size&&(o.size=r.size);break;default:o=typeof r.is==`string`?s.createElement(a,{is:r.is}):s.createElement(a)}}o[ot]=t,o[st]=r;a:for(s=t.child;s!==null;){if(s.tag===5||s.tag===6)o.appendChild(s.stateNode);else if(s.tag!==4&&s.tag!==27&&s.child!==null){s.child.return=s,s=s.child;continue}if(s===t)break a;for(;s.sibling===null;){if(s.return===null||s.return===t)break a;s=s.return}s.sibling.return=s.return,s=s.sibling}t.stateNode=o;a:switch(Gd(o,a,r),a){case`button`:case`input`:case`select`:case`textarea`:r=!!r.autoFocus;break a;case`img`:r=!0;break a;default:r=!1}r&&Fc(t)}}return Bc(t),Ic(t,t.type,e===null?null:e.memoizedProps,t.pendingProps,n),null;case 6:if(e&&t.stateNode!=null)e.memoizedProps!==r&&Fc(t);else{if(typeof r!=`string`&&t.stateNode===null)throw Error(i(166));if(e=le.current,Vi(t)){if(e=t.stateNode,n=t.memoizedProps,r=null,a=Mi,a!==null)switch(a.tag){case 27:case 5:r=a.memoizedProps}e[ot]=t,e=!!(e.nodeValue===n||r!==null&&!0===r.suppressHydrationWarning||Hd(e.nodeValue,n)),e||Ri(t,!0)}else e=Xd(e).createTextNode(r),e[ot]=t,t.stateNode=e}return Bc(t),null;case 31:if(n=t.memoizedState,e===null||e.memoizedState!==null){if(r=Vi(t),n!==null){if(e===null){if(!r)throw Error(i(318));if(e=t.memoizedState,e=e===null?null:e.dehydrated,!e)throw Error(i(557));e[ot]=t}else Hi(),!(t.flags&128)&&(t.memoizedState=null),t.flags|=4;Bc(t),e=!1}else n=Ui(),e!==null&&e.memoizedState!==null&&(e.memoizedState.hydrationErrors=n),e=!0;if(!e)return t.flags&256?(so(t),t):(so(t),null);if(t.flags&128)throw Error(i(558))}return Bc(t),null;case 13:if(r=t.memoizedState,e===null||e.memoizedState!==null&&e.memoizedState.dehydrated!==null){if(a=Vi(t),r!==null&&r.dehydrated!==null){if(e===null){if(!a)throw Error(i(318));if(a=t.memoizedState,a=a===null?null:a.dehydrated,!a)throw Error(i(317));a[ot]=t}else Hi(),!(t.flags&128)&&(t.memoizedState=null),t.flags|=4;Bc(t),a=!1}else a=Ui(),e!==null&&e.memoizedState!==null&&(e.memoizedState.hydrationErrors=a),a=!0;if(!a)return t.flags&256?(so(t),t):(so(t),null)}return so(t),t.flags&128?(t.lanes=n,t):(n=r!==null,e=e!==null&&e.memoizedState!==null,n&&(r=t.child,a=null,r.alternate!==null&&r.alternate.memoizedState!==null&&r.alternate.memoizedState.cachePool!==null&&(a=r.alternate.memoizedState.cachePool.pool),o=null,r.memoizedState!==null&&r.memoizedState.cachePool!==null&&(o=r.memoizedState.cachePool.pool),o!==a&&(r.flags|=2048)),n!==e&&n&&(t.child.flags|=8192),Rc(t,t.updateQueue),Bc(t),null);case 4:return fe(),e===null&&Md(t.stateNode.containerInfo),Bc(t),null;case 10:return Ji(t.type),Bc(t),null;case 19:if(ae(co),r=t.memoizedState,r===null)return Bc(t),null;if(a=!!(t.flags&128),o=r.rendering,o===null)if(a)zc(r,!1);else{if($l!==0||e!==null&&e.flags&128)for(e=t.child;e!==null;){if(o=lo(e),o!==null){for(t.flags|=128,zc(r,!1),e=o.updateQueue,t.updateQueue=e,Rc(t,e),t.subtreeFlags=0,e=n,n=t.child;n!==null;)z(n,e),n=n.sibling;return oe(co,co.current&1|2),Pi&&Di(t,r.treeForkCount),t.child}e=e.sibling}r.tail!==null&&De()>uu&&(t.flags|=128,a=!0,zc(r,!1),t.lanes=4194304)}else{if(!a)if(e=lo(o),e!==null){if(t.flags|=128,a=!0,e=e.updateQueue,t.updateQueue=e,Rc(t,e),zc(r,!0),r.tail===null&&r.tailMode===`hidden`&&!o.alternate&&!Pi)return Bc(t),null}else 2*De()-r.renderingStartTime>uu&&n!==536870912&&(t.flags|=128,a=!0,zc(r,!1),t.lanes=4194304);r.isBackwards?(o.sibling=t.child,t.child=o):(e=r.last,e===null?t.child=o:e.sibling=o,r.last=o)}return r.tail===null?(Bc(t),null):(e=r.tail,r.rendering=e,r.tail=e.sibling,r.renderingStartTime=De(),e.sibling=null,n=co.current,oe(co,a?n&1|2:n&1),Pi&&Di(t,r.treeForkCount),e);case 22:case 23:return so(t),eo(),r=t.memoizedState!==null,e===null?r&&(t.flags|=8192):e.memoizedState!==null!==r&&(t.flags|=8192),r?n&536870912&&!(t.flags&128)&&(Bc(t),t.subtreeFlags&6&&(t.flags|=8192)):Bc(t),n=t.updateQueue,n!==null&&Rc(t,n.retryQueue),n=null,e!==null&&e.memoizedState!==null&&e.memoizedState.cachePool!==null&&(n=e.memoizedState.cachePool.pool),r=null,t.memoizedState!==null&&t.memoizedState.cachePool!==null&&(r=t.memoizedState.cachePool.pool),r!==n&&(t.flags|=2048),e!==null&&ae(ga),null;case 24:return n=null,e!==null&&(n=e.memoizedState.cache),t.memoizedState.cache!==n&&(t.flags|=2048),Ji(aa),Bc(t),null;case 25:return null;case 30:return null}throw Error(i(156,t.tag))}function Hc(e,t){switch(Ai(t),t.tag){case 1:return e=t.flags,e&65536?(t.flags=e&-65537|128,t):null;case 3:return Ji(aa),fe(),e=t.flags,e&65536&&!(e&128)?(t.flags=e&-65537|128,t):null;case 26:case 27:case 5:return me(t),null;case 31:if(t.memoizedState!==null){if(so(t),t.alternate===null)throw Error(i(340));Hi()}return e=t.flags,e&65536?(t.flags=e&-65537|128,t):null;case 13:if(so(t),e=t.memoizedState,e!==null&&e.dehydrated!==null){if(t.alternate===null)throw Error(i(340));Hi()}return e=t.flags,e&65536?(t.flags=e&-65537|128,t):null;case 19:return ae(co),null;case 4:return fe(),null;case 10:return Ji(t.type),null;case 22:case 23:return so(t),eo(),e!==null&&ae(ga),e=t.flags,e&65536?(t.flags=e&-65537|128,t):null;case 24:return Ji(aa),null;case 25:return null;default:return null}}function Uc(e,t){switch(Ai(t),t.tag){case 3:Ji(aa),fe();break;case 26:case 27:case 5:me(t);break;case 4:fe();break;case 31:t.memoizedState!==null&&so(t);break;case 13:so(t);break;case 19:ae(co);break;case 10:Ji(t.type);break;case 22:case 23:so(t),eo(),e!==null&&ae(ga);break;case 24:Ji(aa)}}function Wc(e,t){try{var n=t.updateQueue,r=n===null?null:n.lastEffect;if(r!==null){var i=r.next;n=i;do{if((n.tag&e)===e){r=void 0;var a=n.create,o=n.inst;r=a(),o.destroy=r}n=n.next}while(n!==i)}}catch(e){$u(t,t.return,e)}}function Gc(e,t,n){try{var r=t.updateQueue,i=r===null?null:r.lastEffect;if(i!==null){var a=i.next;r=a;do{if((r.tag&e)===e){var o=r.inst,s=o.destroy;if(s!==void 0){o.destroy=void 0,i=t;var c=n,l=s;try{l()}catch(e){$u(i,c,e)}}}r=r.next}while(r!==a)}}catch(e){$u(t,t.return,e)}}function Kc(e){var t=e.updateQueue;if(t!==null){var n=e.stateNode;try{Ya(t,n)}catch(t){$u(e,e.return,t)}}}function qc(e,t,n){n.props=Js(e.type,e.memoizedProps),n.state=e.memoizedState;try{n.componentWillUnmount()}catch(n){$u(e,t,n)}}function Jc(e,t){try{var n=e.ref;if(n!==null){switch(e.tag){case 26:case 27:case 5:var r=e.stateNode;break;case 30:r=e.stateNode;break;default:r=e.stateNode}typeof n==`function`?e.refCleanup=n(r):n.current=r}}catch(n){$u(e,t,n)}}function Yc(e,t){var n=e.ref,r=e.refCleanup;if(n!==null)if(typeof r==`function`)try{r()}catch(n){$u(e,t,n)}finally{e.refCleanup=null,e=e.alternate,e!=null&&(e.refCleanup=null)}else if(typeof n==`function`)try{n(null)}catch(n){$u(e,t,n)}else n.current=null}function Xc(e){var t=e.type,n=e.memoizedProps,r=e.stateNode;try{a:switch(t){case`button`:case`input`:case`select`:case`textarea`:n.autoFocus&&r.focus();break a;case`img`:n.src?r.src=n.src:n.srcSet&&(r.srcset=n.srcSet)}}catch(t){$u(e,e.return,t)}}function Zc(e,t,n){try{var r=e.stateNode;Kd(r,e.type,n,t),r[st]=t}catch(t){$u(e,e.return,t)}}function Qc(e){return e.tag===5||e.tag===3||e.tag===26||e.tag===27&&cf(e.type)||e.tag===4}function $c(e){a:for(;;){for(;e.sibling===null;){if(e.return===null||Qc(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.tag===27&&cf(e.type)||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 el(e,t,n){var r=e.tag;if(r===5||r===6)e=e.stateNode,t?(n.nodeType===9?n.body:n.nodeName===`HTML`?n.ownerDocument.body:n).insertBefore(e,t):(t=n.nodeType===9?n.body:n.nodeName===`HTML`?n.ownerDocument.body:n,t.appendChild(e),n=n._reactRootContainer,n!=null||t.onclick!==null||(t.onclick=$t));else if(r!==4&&(r===27&&cf(e.type)&&(n=e.stateNode,t=null),e=e.child,e!==null))for(el(e,t,n),e=e.sibling;e!==null;)el(e,t,n),e=e.sibling}function tl(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&&(r===27&&cf(e.type)&&(n=e.stateNode),e=e.child,e!==null))for(tl(e,t,n),e=e.sibling;e!==null;)tl(e,t,n),e=e.sibling}function nl(e){var t=e.stateNode,n=e.memoizedProps;try{for(var r=e.type,i=t.attributes;i.length;)t.removeAttributeNode(i[0]);Gd(t,r,n),t[ot]=e,t[st]=n}catch(t){$u(e,e.return,t)}}var rl=!1,il=!1,al=!1,ol=typeof WeakSet==`function`?WeakSet:Set,sl=null;function cl(e,t){if(e=e.containerInfo,Yd=_p,e=Dr(e),Or(e)){if(`selectionStart`in e)var n={start:e.selectionStart,end:e.selectionEnd};else a:{n=(n=e.ownerDocument)&&n.defaultView||window;var r=n.getSelection&&n.getSelection();if(r&&r.rangeCount!==0){n=r.anchorNode;var a=r.anchorOffset,o=r.focusNode;r=r.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||r!==0&&f.nodeType!==3||(l=s+r),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===r&&(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(U={focusedElem:e,selectionRange:n},_p=!1,sl=t;sl!==null;)if(t=sl,e=t.child,t.subtreeFlags&1028&&e!==null)e.return=t,sl=e;else for(;sl!==null;){switch(t=sl,o=t.alternate,e=t.flags,t.tag){case 0:if(e&4&&(e=t.updateQueue,e=e===null?null:e.events,e!==null))for(n=0;n<e.length;n++)a=e[n],a.ref.impl=a.nextImpl;break;case 11:case 15:break;case 1:if(e&1024&&o!==null){e=void 0,n=t,a=o.memoizedProps,o=o.memoizedState,r=n.stateNode;try{var h=Js(n.type,a);e=r.getSnapshotBeforeUpdate(h,o),r.__reactInternalSnapshotBeforeUpdate=e}catch(e){$u(n,n.return,e)}}break;case 3:if(e&1024){if(e=t.stateNode.containerInfo,n=e.nodeType,n===9)df(e);else if(n===1)switch(e.nodeName){case`HEAD`:case`HTML`:case`BODY`:df(e);break;default:e.textContent=``}}break;case 5:case 26:case 27:case 6:case 4:case 17:break;default:if(e&1024)throw Error(i(163))}if(e=t.sibling,e!==null){e.return=t.return,sl=e;break}sl=t.return}}function ll(e,t,n){var r=n.flags;switch(n.tag){case 0:case 11:case 15:wl(e,n),r&4&&Wc(5,n);break;case 1:if(wl(e,n),r&4)if(e=n.stateNode,t===null)try{e.componentDidMount()}catch(e){$u(n,n.return,e)}else{var i=Js(n.type,t.memoizedProps);t=t.memoizedState;try{e.componentDidUpdate(i,t,e.__reactInternalSnapshotBeforeUpdate)}catch(e){$u(n,n.return,e)}}r&64&&Kc(n),r&512&&Jc(n,n.return);break;case 3:if(wl(e,n),r&64&&(e=n.updateQueue,e!==null)){if(t=null,n.child!==null)switch(n.child.tag){case 27:case 5:t=n.child.stateNode;break;case 1:t=n.child.stateNode}try{Ya(e,t)}catch(e){$u(n,n.return,e)}}break;case 27:t===null&&r&4&&nl(n);case 26:case 5:wl(e,n),t===null&&r&4&&Xc(n),r&512&&Jc(n,n.return);break;case 12:wl(e,n);break;case 31:wl(e,n),r&4&&hl(e,n);break;case 13:wl(e,n),r&4&&gl(e,n),r&64&&(e=n.memoizedState,e!==null&&(e=e.dehydrated,e!==null&&(n=rd.bind(null,n),_f(e,n))));break;case 22:if(r=n.memoizedState!==null||rl,!r){t=t!==null&&t.memoizedState!==null||il,i=rl;var a=il;rl=r,(il=t)&&!a?El(e,n,!!(n.subtreeFlags&8772)):wl(e,n),rl=i,il=a}break;case 30:break;default:wl(e,n)}}function ul(e){var t=e.alternate;t!==null&&(e.alternate=null,ul(t)),e.child=null,e.deletions=null,e.sibling=null,e.tag===5&&(t=e.stateNode,t!==null&&mt(t)),e.stateNode=null,e.return=null,e.dependencies=null,e.memoizedProps=null,e.memoizedState=null,e.pendingProps=null,e.stateNode=null,e.updateQueue=null}var dl=null,fl=!1;function pl(e,t,n){for(n=n.child;n!==null;)ml(e,t,n),n=n.sibling}function ml(e,t,n){if(Le&&typeof Le.onCommitFiberUnmount==`function`)try{Le.onCommitFiberUnmount(Ie,n)}catch{}switch(n.tag){case 26:il||Yc(n,t),pl(e,t,n),n.memoizedState?n.memoizedState.count--:n.stateNode&&(n=n.stateNode,n.parentNode.removeChild(n));break;case 27:il||Yc(n,t);var r=dl,i=fl;cf(n.type)&&(dl=n.stateNode,fl=!1),pl(e,t,n),Cf(n.stateNode),dl=r,fl=i;break;case 5:il||Yc(n,t);case 6:if(r=dl,i=fl,dl=null,pl(e,t,n),dl=r,fl=i,dl!==null)if(fl)try{(dl.nodeType===9?dl.body:dl.nodeName===`HTML`?dl.ownerDocument.body:dl).removeChild(n.stateNode)}catch(e){$u(n,t,e)}else try{dl.removeChild(n.stateNode)}catch(e){$u(n,t,e)}break;case 18:dl!==null&&(fl?(e=dl,lf(e.nodeType===9?e.body:e.nodeName===`HTML`?e.ownerDocument.body:e,n.stateNode),Up(e)):lf(dl,n.stateNode));break;case 4:r=dl,i=fl,dl=n.stateNode.containerInfo,fl=!0,pl(e,t,n),dl=r,fl=i;break;case 0:case 11:case 14:case 15:Gc(2,n,t),il||Gc(4,n,t),pl(e,t,n);break;case 1:il||(Yc(n,t),r=n.stateNode,typeof r.componentWillUnmount==`function`&&qc(n,t,r)),pl(e,t,n);break;case 21:pl(e,t,n);break;case 22:il=(r=il)||n.memoizedState!==null,pl(e,t,n),il=r;break;default:pl(e,t,n)}}function hl(e,t){if(t.memoizedState===null&&(e=t.alternate,e!==null&&(e=e.memoizedState,e!==null))){e=e.dehydrated;try{Up(e)}catch(e){$u(t,t.return,e)}}}function gl(e,t){if(t.memoizedState===null&&(e=t.alternate,e!==null&&(e=e.memoizedState,e!==null&&(e=e.dehydrated,e!==null))))try{Up(e)}catch(e){$u(t,t.return,e)}}function _l(e){switch(e.tag){case 31:case 13:case 19:var t=e.stateNode;return t===null&&(t=e.stateNode=new ol),t;case 22:return e=e.stateNode,t=e._retryCache,t===null&&(t=e._retryCache=new ol),t;default:throw Error(i(435,e.tag))}}function vl(e,t){var n=_l(e);t.forEach(function(t){if(!n.has(t)){n.add(t);var r=id.bind(null,e,t);t.then(r,r)}})}function yl(e,t){var n=t.deletions;if(n!==null)for(var r=0;r<n.length;r++){var a=n[r],o=e,s=t,c=s;a:for(;c!==null;){switch(c.tag){case 27:if(cf(c.type)){dl=c.stateNode,fl=!1;break a}break;case 5:dl=c.stateNode,fl=!1;break a;case 3:case 4:dl=c.stateNode.containerInfo,fl=!0;break a}c=c.return}if(dl===null)throw Error(i(160));ml(o,s,a),dl=null,fl=!1,o=a.alternate,o!==null&&(o.return=null),a.return=null}if(t.subtreeFlags&13886)for(t=t.child;t!==null;)xl(t,e),t=t.sibling}var bl=null;function xl(e,t){var n=e.alternate,r=e.flags;switch(e.tag){case 0:case 11:case 14:case 15:yl(t,e),Sl(e),r&4&&(Gc(3,e,e.return),Wc(3,e),Gc(5,e,e.return));break;case 1:yl(t,e),Sl(e),r&512&&(il||n===null||Yc(n,n.return)),r&64&&rl&&(e=e.updateQueue,e!==null&&(r=e.callbacks,r!==null&&(n=e.shared.hiddenCallbacks,e.shared.hiddenCallbacks=n===null?r:n.concat(r))));break;case 26:var a=bl;if(yl(t,e),Sl(e),r&512&&(il||n===null||Yc(n,n.return)),r&4){var o=n===null?null:n.memoizedState;if(r=e.memoizedState,n===null)if(r===null)if(e.stateNode===null){a:{r=e.type,n=e.memoizedProps,a=a.ownerDocument||a;b:switch(r){case`title`:o=a.getElementsByTagName(`title`)[0],(!o||o[pt]||o[ot]||o.namespaceURI===`http://www.w3.org/2000/svg`||o.hasAttribute(`itemprop`))&&(o=a.createElement(r),a.head.insertBefore(o,a.querySelector(`head > title`))),Gd(o,r,n),o[ot]=e,yt(o),r=o;break a;case`link`:var s=Zf(`link`,`href`,a).get(r+(n.href||``));if(s){for(var c=0;c<s.length;c++)if(o=s[c],o.getAttribute(`href`)===(n.href==null||n.href===``?null:n.href)&&o.getAttribute(`rel`)===(n.rel==null?null:n.rel)&&o.getAttribute(`title`)===(n.title==null?null:n.title)&&o.getAttribute(`crossorigin`)===(n.crossOrigin==null?null:n.crossOrigin)){s.splice(c,1);break b}}o=a.createElement(r),Gd(o,r,n),a.head.appendChild(o);break;case`meta`:if(s=Zf(`meta`,`content`,a).get(r+(n.content||``))){for(c=0;c<s.length;c++)if(o=s[c],o.getAttribute(`content`)===(n.content==null?null:``+n.content)&&o.getAttribute(`name`)===(n.name==null?null:n.name)&&o.getAttribute(`property`)===(n.property==null?null:n.property)&&o.getAttribute(`http-equiv`)===(n.httpEquiv==null?null:n.httpEquiv)&&o.getAttribute(`charset`)===(n.charSet==null?null:n.charSet)){s.splice(c,1);break b}}o=a.createElement(r),Gd(o,r,n),a.head.appendChild(o);break;default:throw Error(i(468,r))}o[ot]=e,yt(o),r=o}e.stateNode=r}else Qf(a,e.type,e.stateNode);else e.stateNode=Kf(a,r,e.memoizedProps);else o===r?r===null&&e.stateNode!==null&&Zc(e,e.memoizedProps,n.memoizedProps):(o===null?n.stateNode!==null&&(n=n.stateNode,n.parentNode.removeChild(n)):o.count--,r===null?Qf(a,e.type,e.stateNode):Kf(a,r,e.memoizedProps))}break;case 27:yl(t,e),Sl(e),r&512&&(il||n===null||Yc(n,n.return)),n!==null&&r&4&&Zc(e,e.memoizedProps,n.memoizedProps);break;case 5:if(yl(t,e),Sl(e),r&512&&(il||n===null||Yc(n,n.return)),e.flags&32){a=e.stateNode;try{Gt(a,``)}catch(t){$u(e,e.return,t)}}r&4&&e.stateNode!=null&&(a=e.memoizedProps,Zc(e,a,n===null?a:n.memoizedProps)),r&1024&&(al=!0);break;case 6:if(yl(t,e),Sl(e),r&4){if(e.stateNode===null)throw Error(i(162));r=e.memoizedProps,n=e.stateNode;try{n.nodeValue=r}catch(t){$u(e,e.return,t)}}break;case 3:if(Xf=null,a=bl,bl=Ef(t.containerInfo),yl(t,e),bl=a,Sl(e),r&4&&n!==null&&n.memoizedState.isDehydrated)try{Up(t.containerInfo)}catch(t){$u(e,e.return,t)}al&&(al=!1,Cl(e));break;case 4:r=bl,bl=Ef(e.stateNode.containerInfo),yl(t,e),Sl(e),bl=r;break;case 12:yl(t,e),Sl(e);break;case 31:yl(t,e),Sl(e),r&4&&(r=e.updateQueue,r!==null&&(e.updateQueue=null,vl(e,r)));break;case 13:yl(t,e),Sl(e),e.child.flags&8192&&e.memoizedState!==null!=(n!==null&&n.memoizedState!==null)&&(cu=De()),r&4&&(r=e.updateQueue,r!==null&&(e.updateQueue=null,vl(e,r)));break;case 22:a=e.memoizedState!==null;var l=n!==null&&n.memoizedState!==null,u=rl,d=il;if(rl=u||a,il=d||l,yl(t,e),il=d,rl=u,Sl(e),r&8192)a:for(t=e.stateNode,t._visibility=a?t._visibility&-2:t._visibility|1,a&&(n===null||l||rl||il||Tl(e)),n=null,t=e;;){if(t.tag===5||t.tag===26){if(n===null){l=n=t;try{if(o=l.stateNode,a)s=o.style,typeof s.setProperty==`function`?s.setProperty(`display`,`none`,`important`):s.display=`none`;else{c=l.stateNode;var f=l.memoizedProps.style,p=f!=null&&f.hasOwnProperty(`display`)?f.display:null;c.style.display=p==null||typeof p==`boolean`?``:(``+p).trim()}}catch(e){$u(l,l.return,e)}}}else if(t.tag===6){if(n===null){l=t;try{l.stateNode.nodeValue=a?``:l.memoizedProps}catch(e){$u(l,l.return,e)}}}else if(t.tag===18){if(n===null){l=t;try{var m=l.stateNode;a?uf(m,!0):uf(l.stateNode,!1)}catch(e){$u(l,l.return,e)}}}else if((t.tag!==22&&t.tag!==23||t.memoizedState===null||t===e)&&t.child!==null){t.child.return=t,t=t.child;continue}if(t===e)break a;for(;t.sibling===null;){if(t.return===null||t.return===e)break a;n===t&&(n=null),t=t.return}n===t&&(n=null),t.sibling.return=t.return,t=t.sibling}r&4&&(r=e.updateQueue,r!==null&&(n=r.retryQueue,n!==null&&(r.retryQueue=null,vl(e,n))));break;case 19:yl(t,e),Sl(e),r&4&&(r=e.updateQueue,r!==null&&(e.updateQueue=null,vl(e,r)));break;case 30:break;case 21:break;default:yl(t,e),Sl(e)}}function Sl(e){var t=e.flags;if(t&2){try{for(var n,r=e.return;r!==null;){if(Qc(r)){n=r;break}r=r.return}if(n==null)throw Error(i(160));switch(n.tag){case 27:var a=n.stateNode;tl(e,$c(e),a);break;case 5:var o=n.stateNode;n.flags&32&&(Gt(o,``),n.flags&=-33),tl(e,$c(e),o);break;case 3:case 4:var s=n.stateNode.containerInfo;el(e,$c(e),s);break;default:throw Error(i(161))}}catch(t){$u(e,e.return,t)}e.flags&=-3}t&4096&&(e.flags&=-4097)}function Cl(e){if(e.subtreeFlags&1024)for(e=e.child;e!==null;){var t=e;Cl(t),t.tag===5&&t.flags&1024&&t.stateNode.reset(),e=e.sibling}}function wl(e,t){if(t.subtreeFlags&8772)for(t=t.child;t!==null;)ll(e,t.alternate,t),t=t.sibling}function Tl(e){for(e=e.child;e!==null;){var t=e;switch(t.tag){case 0:case 11:case 14:case 15:Gc(4,t,t.return),Tl(t);break;case 1:Yc(t,t.return);var n=t.stateNode;typeof n.componentWillUnmount==`function`&&qc(t,t.return,n),Tl(t);break;case 27:Cf(t.stateNode);case 26:case 5:Yc(t,t.return),Tl(t);break;case 22:t.memoizedState===null&&Tl(t);break;case 30:Tl(t);break;default:Tl(t)}e=e.sibling}}function El(e,t,n){for(n&&=!!(t.subtreeFlags&8772),t=t.child;t!==null;){var r=t.alternate,i=e,a=t,o=a.flags;switch(a.tag){case 0:case 11:case 15:El(i,a,n),Wc(4,a);break;case 1:if(El(i,a,n),r=a,i=r.stateNode,typeof i.componentDidMount==`function`)try{i.componentDidMount()}catch(e){$u(r,r.return,e)}if(r=a,i=r.updateQueue,i!==null){var s=r.stateNode;try{var c=i.shared.hiddenCallbacks;if(c!==null)for(i.shared.hiddenCallbacks=null,i=0;i<c.length;i++)Ja(c[i],s)}catch(e){$u(r,r.return,e)}}n&&o&64&&Kc(a),Jc(a,a.return);break;case 27:nl(a);case 26:case 5:El(i,a,n),n&&r===null&&o&4&&Xc(a),Jc(a,a.return);break;case 12:El(i,a,n);break;case 31:El(i,a,n),n&&o&4&&hl(i,a);break;case 13:El(i,a,n),n&&o&4&&gl(i,a);break;case 22:a.memoizedState===null&&El(i,a,n),Jc(a,a.return);break;case 30:break;default:El(i,a,n)}t=t.sibling}}function Dl(e,t){var n=null;e!==null&&e.memoizedState!==null&&e.memoizedState.cachePool!==null&&(n=e.memoizedState.cachePool.pool),e=null,t.memoizedState!==null&&t.memoizedState.cachePool!==null&&(e=t.memoizedState.cachePool.pool),e!==n&&(e!=null&&e.refCount++,n!=null&&sa(n))}function Ol(e,t){e=null,t.alternate!==null&&(e=t.alternate.memoizedState.cache),t=t.memoizedState.cache,t!==e&&(t.refCount++,e!=null&&sa(e))}function kl(e,t,n,r){if(t.subtreeFlags&10256)for(t=t.child;t!==null;)Al(e,t,n,r),t=t.sibling}function Al(e,t,n,r){var i=t.flags;switch(t.tag){case 0:case 11:case 15:kl(e,t,n,r),i&2048&&Wc(9,t);break;case 1:kl(e,t,n,r);break;case 3:kl(e,t,n,r),i&2048&&(e=null,t.alternate!==null&&(e=t.alternate.memoizedState.cache),t=t.memoizedState.cache,t!==e&&(t.refCount++,e!=null&&sa(e)));break;case 12:if(i&2048){kl(e,t,n,r),e=t.stateNode;try{var a=t.memoizedProps,o=a.id,s=a.onPostCommit;typeof s==`function`&&s(o,t.alternate===null?`mount`:`update`,e.passiveEffectDuration,-0)}catch(e){$u(t,t.return,e)}}else kl(e,t,n,r);break;case 31:kl(e,t,n,r);break;case 13:kl(e,t,n,r);break;case 23:break;case 22:a=t.stateNode,o=t.alternate,t.memoizedState===null?a._visibility&2?kl(e,t,n,r):(a._visibility|=2,jl(e,t,n,r,!!(t.subtreeFlags&10256)||!1)):a._visibility&2?kl(e,t,n,r):Ml(e,t),i&2048&&Dl(o,t);break;case 24:kl(e,t,n,r),i&2048&&Ol(t.alternate,t);break;default:kl(e,t,n,r)}}function jl(e,t,n,r,i){for(i&&=!!(t.subtreeFlags&10256)||!1,t=t.child;t!==null;){var a=e,o=t,s=n,c=r,l=o.flags;switch(o.tag){case 0:case 11:case 15:jl(a,o,s,c,i),Wc(8,o);break;case 23:break;case 22:var u=o.stateNode;o.memoizedState===null?(u._visibility|=2,jl(a,o,s,c,i)):u._visibility&2?jl(a,o,s,c,i):Ml(a,o),i&&l&2048&&Dl(o.alternate,o);break;case 24:jl(a,o,s,c,i),i&&l&2048&&Ol(o.alternate,o);break;default:jl(a,o,s,c,i)}t=t.sibling}}function Ml(e,t){if(t.subtreeFlags&10256)for(t=t.child;t!==null;){var n=e,r=t,i=r.flags;switch(r.tag){case 22:Ml(n,r),i&2048&&Dl(r.alternate,r);break;case 24:Ml(n,r),i&2048&&Ol(r.alternate,r);break;default:Ml(n,r)}t=t.sibling}}var Nl=8192;function Pl(e,t,n){if(e.subtreeFlags&Nl)for(e=e.child;e!==null;)Fl(e,t,n),e=e.sibling}function Fl(e,t,n){switch(e.tag){case 26:Pl(e,t,n),e.flags&Nl&&e.memoizedState!==null&&tp(n,bl,e.memoizedState,e.memoizedProps);break;case 5:Pl(e,t,n);break;case 3:case 4:var r=bl;bl=Ef(e.stateNode.containerInfo),Pl(e,t,n),bl=r;break;case 22:e.memoizedState===null&&(r=e.alternate,r!==null&&r.memoizedState!==null?(r=Nl,Nl=16777216,Pl(e,t,n),Nl=r):Pl(e,t,n));break;default:Pl(e,t,n)}}function Il(e){var t=e.alternate;if(t!==null&&(e=t.child,e!==null)){t.child=null;do t=e.sibling,e.sibling=null,e=t;while(e!==null)}}function Ll(e){var t=e.deletions;if(e.flags&16){if(t!==null)for(var n=0;n<t.length;n++){var r=t[n];sl=r,Bl(r,e)}Il(e)}if(e.subtreeFlags&10256)for(e=e.child;e!==null;)Rl(e),e=e.sibling}function Rl(e){switch(e.tag){case 0:case 11:case 15:Ll(e),e.flags&2048&&Gc(9,e,e.return);break;case 3:Ll(e);break;case 12:Ll(e);break;case 22:var t=e.stateNode;e.memoizedState!==null&&t._visibility&2&&(e.return===null||e.return.tag!==13)?(t._visibility&=-3,zl(e)):Ll(e);break;default:Ll(e)}}function zl(e){var t=e.deletions;if(e.flags&16){if(t!==null)for(var n=0;n<t.length;n++){var r=t[n];sl=r,Bl(r,e)}Il(e)}for(e=e.child;e!==null;){switch(t=e,t.tag){case 0:case 11:case 15:Gc(8,t,t.return),zl(t);break;case 22:n=t.stateNode,n._visibility&2&&(n._visibility&=-3,zl(t));break;default:zl(t)}e=e.sibling}}function Bl(e,t){for(;sl!==null;){var n=sl;switch(n.tag){case 0:case 11:case 15:Gc(8,n,t);break;case 23:case 22:if(n.memoizedState!==null&&n.memoizedState.cachePool!==null){var r=n.memoizedState.cachePool.pool;r!=null&&r.refCount++}break;case 24:sa(n.memoizedState.cache)}if(r=n.child,r!==null)r.return=n,sl=r;else a:for(n=e;sl!==null;){r=sl;var i=r.sibling,a=r.return;if(ul(r),r===n){sl=null;break a}if(i!==null){i.return=a,sl=i;break a}sl=a}}}var Vl={getCacheForType:function(e){var t=$i(aa),n=t.data.get(e);return n===void 0&&(n=e(),t.data.set(e,n)),n},cacheSignal:function(){return $i(aa).controller.signal}},Hl=typeof WeakMap==`function`?WeakMap:Map,Ul=0,Wl=null,Gl=null,Kl=0,ql=0,Jl=null,Yl=!1,Xl=!1,Zl=!1,Ql=0,$l=0,eu=0,tu=0,nu=0,ru=0,iu=0,au=null,ou=null,su=!1,cu=0,lu=0,uu=1/0,du=null,fu=null,pu=0,mu=null,hu=null,gu=0,_u=0,vu=null,yu=null,bu=0,xu=null;function Su(){return Ul&2&&Kl!==0?Kl&-Kl:P.T===null?it():bd()}function Cu(){if(ru===0)if(!(Kl&536870912)||Pi){var e=We;We<<=1,!(We&3932160)&&(We=262144),ru=e}else ru=536870912;return e=to.current,e!==null&&(e.flags|=32),ru}function wu(e,t,n){(e===Wl&&(ql===2||ql===9)||e.cancelPendingCommit!==null)&&(ju(e,0),Ou(e,Kl,ru,!1)),Qe(e,n),(!(Ul&2)||e!==Wl)&&(e===Wl&&(!(Ul&2)&&(tu|=n),$l===4&&Ou(e,Kl,ru,!1)),fd(e))}function Tu(e,t,n){if(Ul&6)throw Error(i(327));var r=!n&&!(t&127)&&(t&e.expiredLanes)===0||Je(e,t),a=r?Ru(e,t):Iu(e,t,!0),o=r;do{if(a===0){Xl&&!r&&Ou(e,t,0,!1);break}if(n=e.current.alternate,o&&!Du(n)){a=Iu(e,t,!1),o=!1;continue}if(a===2){if(o=t,e.errorRecoveryDisabledLanes&o)var s=0;else s=e.pendingLanes&-536870913,s=s===0?s&536870912?536870912:0:s;if(s!==0){t=s;a:{var c=e;a=au;var l=c.current.memoizedState.isDehydrated;if(l&&(ju(c,s).flags|=256),s=Iu(c,s,!1),s!==2){if(Zl&&!l){c.errorRecoveryDisabledLanes|=o,tu|=o,a=4;break a}o=ou,ou=a,o!==null&&(ou===null?ou=o:ou.push.apply(ou,o))}a=s}if(o=!1,a!==2)continue}}if(a===1){ju(e,0),Ou(e,t,0,!0);break}a:{switch(r=e,o=a,o){case 0:case 1:throw Error(i(345));case 4:if((t&4194048)!==t)break;case 6:Ou(r,t,ru,!Yl);break a;case 2:ou=null;break;case 3:case 5:break;default:throw Error(i(329))}if((t&62914560)===t&&(a=cu+300-De(),10<a)){if(Ou(r,t,ru,!Yl),qe(r,0,!0)!==0)break a;gu=t,r.timeoutHandle=nf(Eu.bind(null,r,n,ou,du,su,t,ru,tu,iu,Yl,o,`Throttled`,-0,0),a);break a}Eu(r,n,ou,du,su,t,ru,tu,iu,Yl,o,null,-0,0)}break}while(1);fd(e)}function Eu(e,t,n,r,i,a,o,s,c,l,u,d,f,p){if(e.timeoutHandle=-1,d=t.subtreeFlags,d&8192||(d&16785408)==16785408){d={stylesheets:null,count:0,imgCount:0,imgBytes:0,suspenseyImages:[],waitingForImages:!0,waitingForViewTransition:!1,unsuspend:$t},Fl(t,a,d);var m=(a&62914560)===a?cu-De():(a&4194048)===a?lu-De():0;if(m=rp(d,m),m!==null){gu=a,e.cancelPendingCommit=m(Gu.bind(null,e,t,a,n,r,i,o,s,c,u,d,null,f,p)),Ou(e,a,o,!l);return}}Gu(e,t,a,n,r,i,o,s,c)}function Du(e){for(var t=e;;){var n=t.tag;if((n===0||n===11||n===15)&&t.flags&16384&&(n=t.updateQueue,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(!Sr(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 Ou(e,t,n,r){t&=~nu,t&=~tu,e.suspendedLanes|=t,e.pingedLanes&=~t,r&&(e.warmLanes|=t),r=e.expirationTimes;for(var i=t;0<i;){var a=31-ze(i),o=1<<a;r[a]=-1,i&=~o}n!==0&&L(e,n,t)}function ku(){return Ul&6?!0:(pd(0,!1),!1)}function Au(){if(Gl!==null){if(ql===0)var e=Gl.return;else e=Gl,B=Ki=null,Ao(e),Aa=null,ja=0,e=Gl;for(;e!==null;)Uc(e.alternate,e),e=e.return;Gl=null}}function ju(e,t){var n=e.timeoutHandle;n!==-1&&(e.timeoutHandle=-1,rf(n)),n=e.cancelPendingCommit,n!==null&&(e.cancelPendingCommit=null,n()),gu=0,Au(),Wl=e,Gl=n=ui(e.current,null),Kl=t,ql=0,Jl=null,Yl=!1,Xl=Je(e,t),Zl=!1,iu=ru=nu=tu=eu=$l=0,ou=au=null,su=!1,t&8&&(t|=t&32);var r=e.entangledLanes;if(r!==0)for(e=e.entanglements,r&=t;0<r;){var i=31-ze(r),a=1<<i;t|=e[i],r&=~a}return Ql=t,ei(),n}function Mu(e,t){fo=null,P.H=Bs,t===ba||t===Sa?(t=Oa(),ql=3):t===xa?(t=Oa(),ql=4):ql=t===ic?8:typeof t==`object`&&t&&typeof t.then==`function`?6:1,Jl=t,Gl===null&&($l=1,Qs(e,_i(t,e.current)))}function H(){var e=to.current;return e===null?!0:(Kl&4194048)===Kl?no===null:(Kl&62914560)===Kl||Kl&536870912?e===no:!1}function Nu(){var e=P.H;return P.H=Bs,e===null?Bs:e}function Pu(){var e=P.A;return P.A=Vl,e}function Fu(){$l=4,Yl||(Kl&4194048)!==Kl&&to.current!==null||(Xl=!0),!(eu&134217727)&&!(tu&134217727)||Wl===null||Ou(Wl,Kl,ru,!1)}function Iu(e,t,n){var r=Ul;Ul|=2;var i=Nu(),a=Pu();(Wl!==e||Kl!==t)&&(du=null,ju(e,t)),t=!1;var o=$l;a:do try{if(ql!==0&&Gl!==null){var s=Gl,c=Jl;switch(ql){case 8:Au(),o=6;break a;case 3:case 2:case 9:case 6:to.current===null&&(t=!0);var l=ql;if(ql=0,Jl=null,Hu(e,s,c,l),n&&Xl){o=0;break a}break;default:l=ql,ql=0,Jl=null,Hu(e,s,c,l)}}Lu(),o=$l;break}catch(t){Mu(e,t)}while(1);return t&&e.shellSuspendCounter++,B=Ki=null,Ul=r,P.H=i,P.A=a,Gl===null&&(Wl=null,Kl=0,ei()),o}function Lu(){for(;Gl!==null;)Bu(Gl)}function Ru(e,t){var n=Ul;Ul|=2;var r=Nu(),a=Pu();Wl!==e||Kl!==t?(du=null,uu=De()+500,ju(e,t)):Xl=Je(e,t);a:do try{if(ql!==0&&Gl!==null){t=Gl;var o=Jl;b:switch(ql){case 1:ql=0,Jl=null,Hu(e,t,o,1);break;case 2:case 9:if(wa(o)){ql=0,Jl=null,Vu(t);break}t=function(){ql!==2&&ql!==9||Wl!==e||(ql=7),fd(e)},o.then(t,t);break a;case 3:ql=7;break a;case 4:ql=5;break a;case 7:wa(o)?(ql=0,Jl=null,Vu(t)):(ql=0,Jl=null,Hu(e,t,o,7));break;case 5:var s=null;switch(Gl.tag){case 26:s=Gl.memoizedState;case 5:case 27:var c=Gl;if(s?ep(s):c.stateNode.complete){ql=0,Jl=null;var l=c.sibling;if(l!==null)Gl=l;else{var u=c.return;u===null?Gl=null:(Gl=u,Uu(u))}break b}}ql=0,Jl=null,Hu(e,t,o,5);break;case 6:ql=0,Jl=null,Hu(e,t,o,6);break;case 8:Au(),$l=6;break a;default:throw Error(i(462))}}zu();break}catch(t){Mu(e,t)}while(1);return B=Ki=null,P.H=r,P.A=a,Ul=n,Gl===null?(Wl=null,Kl=0,ei(),$l):0}function zu(){for(;Gl!==null&&!Te();)Bu(Gl)}function Bu(e){var t=Pc(e.alternate,e,Ql);e.memoizedProps=e.pendingProps,t===null?Uu(e):Gl=t}function Vu(e){var t=e,n=t.alternate;switch(t.tag){case 15:case 0:t=vc(n,t,t.pendingProps,t.type,void 0,Kl);break;case 11:t=vc(n,t,t.pendingProps,t.type.render,t.ref,Kl);break;case 5:Ao(t);default:Uc(n,t),t=Gl=z(t,Ql),t=Pc(n,t,Ql)}e.memoizedProps=e.pendingProps,t===null?Uu(e):Gl=t}function Hu(e,t,n,r){B=Ki=null,Ao(t),Aa=null,ja=0;var i=t.return;try{if(rc(e,i,t,n,Kl)){$l=1,Qs(e,_i(n,e.current)),Gl=null;return}}catch(t){if(i!==null)throw Gl=i,t;$l=1,Qs(e,_i(n,e.current)),Gl=null;return}t.flags&32768?(Pi||r===1?e=!0:Xl||Kl&536870912?e=!1:(Yl=e=!0,(r===2||r===9||r===3||r===6)&&(r=to.current,r!==null&&r.tag===13&&(r.flags|=16384))),Wu(t,e)):Uu(t)}function Uu(e){var t=e;do{if(t.flags&32768){Wu(t,Yl);return}e=t.return;var n=Vc(t.alternate,t,Ql);if(n!==null){Gl=n;return}if(t=t.sibling,t!==null){Gl=t;return}Gl=t=e}while(t!==null);$l===0&&($l=5)}function Wu(e,t){do{var n=Hc(e.alternate,e);if(n!==null){n.flags&=32767,Gl=n;return}if(n=e.return,n!==null&&(n.flags|=32768,n.subtreeFlags=0,n.deletions=null),!t&&(e=e.sibling,e!==null)){Gl=e;return}Gl=e=n}while(e!==null);$l=6,Gl=null}function Gu(e,t,n,r,a,o,s,c,l){e.cancelPendingCommit=null;do Xu();while(pu!==0);if(Ul&6)throw Error(i(327));if(t!==null){if(t===e.current)throw Error(i(177));if(o=t.lanes|t.childLanes,o|=$r,$e(e,n,o,s,c,l),e===Wl&&(Gl=Wl=null,Kl=0),hu=t,mu=e,gu=n,_u=o,vu=a,yu=r,t.subtreeFlags&10256||t.flags&10256?(e.callbackNode=null,e.callbackPriority=0,ad(je,function(){return Zu(),null})):(e.callbackNode=null,e.callbackPriority=0),r=!!(t.flags&13878),t.subtreeFlags&13878||r){r=P.T,P.T=null,a=F.p,F.p=2,s=Ul,Ul|=4;try{cl(e,t,n)}finally{Ul=s,F.p=a,P.T=r}}pu=1,Ku(),qu(),Ju()}}function Ku(){if(pu===1){pu=0;var e=mu,t=hu,n=!!(t.flags&13878);if(t.subtreeFlags&13878||n){n=P.T,P.T=null;var r=F.p;F.p=2;var i=Ul;Ul|=4;try{xl(t,e);var a=U,o=Dr(e.containerInfo),s=a.focusedElem,c=a.selectionRange;if(o!==s&&s&&s.ownerDocument&&Er(s.ownerDocument.documentElement,s)){if(c!==null&&Or(s)){var l=c.start,u=c.end;if(u===void 0&&(u=l),`selectionStart`in s)s.selectionStart=l,s.selectionEnd=Math.min(u,s.value.length);else{var d=s.ownerDocument||document,f=d&&d.defaultView||window;if(f.getSelection){var p=f.getSelection(),m=s.textContent.length,h=Math.min(c.start,m),g=c.end===void 0?h:Math.min(c.end,m);!p.extend&&h>g&&(o=g,g=h,h=o);var _=Tr(s,h),v=Tr(s,g);if(_&&v&&(p.rangeCount!==1||p.anchorNode!==_.node||p.anchorOffset!==_.offset||p.focusNode!==v.node||p.focusOffset!==v.offset)){var y=d.createRange();y.setStart(_.node,_.offset),p.removeAllRanges(),h>g?(p.addRange(y),p.extend(v.node,v.offset)):(y.setEnd(v.node,v.offset),p.addRange(y))}}}}for(d=[],p=s;p=p.parentNode;)p.nodeType===1&&d.push({element:p,left:p.scrollLeft,top:p.scrollTop});for(typeof s.focus==`function`&&s.focus(),s=0;s<d.length;s++){var b=d[s];b.element.scrollLeft=b.left,b.element.scrollTop=b.top}}_p=!!Yd,U=Yd=null}finally{Ul=i,F.p=r,P.T=n}}e.current=t,pu=2}}function qu(){if(pu===2){pu=0;var e=mu,t=hu,n=!!(t.flags&8772);if(t.subtreeFlags&8772||n){n=P.T,P.T=null;var r=F.p;F.p=2;var i=Ul;Ul|=4;try{ll(e,t.alternate,t)}finally{Ul=i,F.p=r,P.T=n}}pu=3}}function Ju(){if(pu===4||pu===3){pu=0,Ee();var e=mu,t=hu,n=gu,r=yu;t.subtreeFlags&10256||t.flags&10256?pu=5:(pu=0,hu=mu=null,Yu(e,e.pendingLanes));var i=e.pendingLanes;if(i===0&&(fu=null),rt(n),t=t.stateNode,Le&&typeof Le.onCommitFiberRoot==`function`)try{Le.onCommitFiberRoot(Ie,t,void 0,(t.current.flags&128)==128)}catch{}if(r!==null){t=P.T,i=F.p,F.p=2,P.T=null;try{for(var a=e.onRecoverableError,o=0;o<r.length;o++){var s=r[o];a(s.value,{componentStack:s.stack})}}finally{P.T=t,F.p=i}}gu&3&&Xu(),fd(e),i=e.pendingLanes,n&261930&&i&42?e===xu?bu++:(bu=0,xu=e):bu=0,pd(0,!1)}}function Yu(e,t){(e.pooledCacheLanes&=t)===0&&(t=e.pooledCache,t!=null&&(e.pooledCache=null,sa(t)))}function Xu(){return Ku(),qu(),Ju(),Zu()}function Zu(){if(pu!==5)return!1;var e=mu,t=_u;_u=0;var n=rt(gu),r=P.T,a=F.p;try{F.p=32>n?32:n,P.T=null,n=vu,vu=null;var o=mu,s=gu;if(pu=0,hu=mu=null,gu=0,Ul&6)throw Error(i(331));var c=Ul;if(Ul|=4,Rl(o.current),Al(o,o.current,s,n),Ul=c,pd(0,!1),Le&&typeof Le.onPostCommitFiberRoot==`function`)try{Le.onPostCommitFiberRoot(Ie,o)}catch{}return!0}finally{F.p=a,P.T=r,Yu(e,t)}}function Qu(e,t,n){t=_i(n,t),t=ec(e.stateNode,t,2),e=Ha(e,t,2),e!==null&&(Qe(e,2),fd(e))}function $u(e,t,n){if(e.tag===3)Qu(e,e,n);else for(;t!==null;){if(t.tag===3){Qu(t,e,n);break}if(t.tag===1){var r=t.stateNode;if(typeof t.type.getDerivedStateFromError==`function`||typeof r.componentDidCatch==`function`&&(fu===null||!fu.has(r))){e=_i(n,e),n=tc(2),r=Ha(t,n,2),r!==null&&(nc(n,r,t,e),Qe(r,2),fd(r));break}}t=t.return}}function ed(e,t,n){var r=e.pingCache;if(r===null){r=e.pingCache=new Hl;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)||(Zl=!0,i.add(n),e=td.bind(null,e,t,n),t.then(e,e))}function td(e,t,n){var r=e.pingCache;r!==null&&r.delete(t),e.pingedLanes|=e.suspendedLanes&n,e.warmLanes&=~n,Wl===e&&(Kl&n)===n&&($l===4||$l===3&&(Kl&62914560)===Kl&&300>De()-cu?!(Ul&2)&&ju(e,0):nu|=n,iu===Kl&&(iu=0)),fd(e)}function nd(e,t){t===0&&(t=Xe()),e=ri(e,t),e!==null&&(Qe(e,t),fd(e))}function rd(e){var t=e.memoizedState,n=0;t!==null&&(n=t.retryLane),nd(e,n)}function id(e,t){var n=0;switch(e.tag){case 31:case 13:var r=e.stateNode,a=e.memoizedState;a!==null&&(n=a.retryLane);break;case 19:r=e.stateNode;break;case 22:r=e.stateNode._retryCache;break;default:throw Error(i(314))}r!==null&&r.delete(t),nd(e,n)}function ad(e,t){return Ce(e,t)}var od=null,sd=null,cd=!1,ld=!1,ud=!1,dd=0;function fd(e){e!==sd&&e.next===null&&(sd===null?od=sd=e:sd=sd.next=e),ld=!0,cd||(cd=!0,yd())}function pd(e,t){if(!ud&&ld){ud=!0;do for(var n=!1,r=od;r!==null;){if(!t)if(e!==0){var i=r.pendingLanes;if(i===0)var a=0;else{var o=r.suspendedLanes,s=r.pingedLanes;a=(1<<31-ze(42|e)+1)-1,a&=i&~(o&~s),a=a&201326741?a&201326741|1:a?a|2:0}a!==0&&(n=!0,vd(r,a))}else a=Kl,a=qe(r,r===Wl?a:0,r.cancelPendingCommit!==null||r.timeoutHandle!==-1),!(a&3)||Je(r,a)||(n=!0,vd(r,a));r=r.next}while(n);ud=!1}}function md(){hd()}function hd(){ld=cd=!1;var e=0;dd!==0&&tf()&&(e=dd);for(var t=De(),n=null,r=od;r!==null;){var i=r.next,a=gd(r,t);a===0?(r.next=null,n===null?od=i:n.next=i,i===null&&(sd=n)):(n=r,(e!==0||a&3)&&(ld=!0)),r=i}pu!==0&&pu!==5||pd(e,!1),dd!==0&&(dd=0)}function gd(e,t){for(var n=e.suspendedLanes,r=e.pingedLanes,i=e.expirationTimes,a=e.pendingLanes&-62914561;0<a;){var o=31-ze(a),s=1<<o,c=i[o];c===-1?((s&n)===0||(s&r)!==0)&&(i[o]=Ye(s,t)):c<=t&&(e.expiredLanes|=s),a&=~s}if(t=Wl,n=Kl,n=qe(e,e===t?n:0,e.cancelPendingCommit!==null||e.timeoutHandle!==-1),r=e.callbackNode,n===0||e===t&&(ql===2||ql===9)||e.cancelPendingCommit!==null)return r!==null&&r!==null&&we(r),e.callbackNode=null,e.callbackPriority=0;if(!(n&3)||Je(e,n)){if(t=n&-n,t===e.callbackPriority)return t;switch(r!==null&&we(r),rt(n)){case 2:case 8:n=Ae;break;case 32:n=je;break;case 268435456:n=Ne;break;default:n=je}return r=_d.bind(null,e),n=Ce(n,r),e.callbackPriority=t,e.callbackNode=n,t}return r!==null&&r!==null&&we(r),e.callbackPriority=2,e.callbackNode=null,2}function _d(e,t){if(pu!==0&&pu!==5)return e.callbackNode=null,e.callbackPriority=0,null;var n=e.callbackNode;if(Xu()&&e.callbackNode!==n)return null;var r=Kl;return r=qe(e,e===Wl?r:0,e.cancelPendingCommit!==null||e.timeoutHandle!==-1),r===0?null:(Tu(e,r,t),gd(e,De()),e.callbackNode!=null&&e.callbackNode===n?_d.bind(null,e):null)}function vd(e,t){if(Xu())return null;Tu(e,t,!0)}function yd(){of(function(){Ul&6?Ce(ke,md):hd()})}function bd(){if(dd===0){var e=ua;e===0&&(e=Ue,Ue<<=1,!(Ue&261888)&&(Ue=256)),dd=e}return dd}function xd(e){return e==null||typeof e==`symbol`||typeof e==`boolean`?null:typeof e==`function`?e:Qt(``+e)}function Sd(e,t){var n=t.ownerDocument.createElement(`input`);return n.name=t.name,n.value=t.value,e.id&&n.setAttribute(`form`,e.id),t.parentNode.insertBefore(n,t),e=new FormData(e),n.parentNode.removeChild(n),e}function Cd(e,t,n,r,i){if(t===`submit`&&n&&n.stateNode===i){var a=xd((i[st]||null).action),o=r.submitter;o&&(t=(t=o[st]||null)?xd(t.formAction):o.getAttribute(`formAction`),t!==null&&(a=t,o=null));var s=new xn(`action`,`action`,null,r,i);e.push({event:s,listeners:[{instance:null,listener:function(){if(r.defaultPrevented){if(dd!==0){var e=o?Sd(i,o):new FormData(i);Es(n,{pending:!0,data:e,method:i.method,action:a},null,e)}}else typeof a==`function`&&(s.preventDefault(),e=o?Sd(i,o):new FormData(i),Es(n,{pending:!0,data:e,method:i.method,action:a},a,e))},currentTarget:i}]})}}for(var wd=0;wd<Jr.length;wd++){var Td=Jr[wd];Yr(Td.toLowerCase(),`on`+(Td[0].toUpperCase()+Td.slice(1)))}Yr(Br,`onAnimationEnd`),Yr(Vr,`onAnimationIteration`),Yr(Hr,`onAnimationStart`),Yr(`dblclick`,`onDoubleClick`),Yr(`focusin`,`onFocus`),Yr(`focusout`,`onBlur`),Yr(Ur,`onTransitionRun`),Yr(Wr,`onTransitionStart`),Yr(Gr,`onTransitionCancel`),Yr(Kr,`onTransitionEnd`),Ct(`onMouseEnter`,[`mouseout`,`mouseover`]),Ct(`onMouseLeave`,[`mouseout`,`mouseover`]),Ct(`onPointerEnter`,[`pointerout`,`pointerover`]),Ct(`onPointerLeave`,[`pointerout`,`pointerover`]),St(`onChange`,`change click focusin focusout input keydown keyup selectionchange`.split(` `)),St(`onSelect`,`focusout contextmenu dragend focusin keydown keyup mousedown mouseup selectionchange`.split(` `)),St(`onBeforeInput`,[`compositionend`,`keypress`,`textInput`,`paste`]),St(`onCompositionEnd`,`compositionend focusout keydown keypress keyup mousedown`.split(` `)),St(`onCompositionStart`,`compositionstart focusout keydown keypress keyup mousedown`.split(` `)),St(`onCompositionUpdate`,`compositionupdate focusout keydown keypress keyup mousedown`.split(` `));var Ed=`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(` `),Dd=new Set(`beforetoggle cancel close invalid load scroll scrollend toggle`.split(` `).concat(Ed));function Od(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;a=s,i.currentTarget=l;try{a(i)}catch(e){Xr(e)}i.currentTarget=null,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;a=s,i.currentTarget=l;try{a(i)}catch(e){Xr(e)}i.currentTarget=null,a=c}}}}function kd(e,t){var n=t[lt];n===void 0&&(n=t[lt]=new Set);var r=e+`__bubble`;n.has(r)||(Nd(t,e,2,!1),n.add(r))}function Ad(e,t,n){var r=0;t&&(r|=4),Nd(n,e,r,t)}var jd=`_reactListening`+Math.random().toString(36).slice(2);function Md(e){if(!e[jd]){e[jd]=!0,bt.forEach(function(t){t!==`selectionchange`&&(Dd.has(t)||Ad(t,!1,e),Ad(t,!0,e))});var t=e.nodeType===9?e:e.ownerDocument;t===null||t[jd]||(t[jd]=!0,Ad(`selectionchange`,!1,t))}}function Nd(e,t,n,r){switch(wp(t)){case 2:var i=vp;break;case 8:i=yp;break;default:i=bp}n=i.bind(null,t,n,e),i=void 0,!un||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 Pd(e,t,n,r,i){var a=r;if(!(t&1)&&!(t&2)&&r!==null)a:for(;;){if(r===null)return;var s=r.tag;if(s===3||s===4){var c=r.stateNode.containerInfo;if(c===i)break;if(s===4)for(s=r.return;s!==null;){var l=s.tag;if((l===3||l===4)&&s.stateNode.containerInfo===i)return;s=s.return}for(;c!==null;){if(s=ht(c),s===null)return;if(l=s.tag,l===5||l===6||l===26||l===27){r=a=s;continue a}c=c.parentNode}}r=r.return}sn(function(){var r=a,i=tn(n),s=[];a:{var c=qr.get(e);if(c!==void 0){var l=xn,u=e;switch(e){case`keypress`:if(gn(n)===0)break a;case`keydown`:case`keyup`:l=zn;break;case`focusin`:u=`focus`,l=An;break;case`focusout`:u=`blur`,l=An;break;case`beforeblur`:case`afterblur`:l=An;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`:l=On;break;case`drag`:case`dragend`:case`dragenter`:case`dragexit`:case`dragleave`:case`dragover`:case`dragstart`:case`drop`:l=kn;break;case`touchcancel`:case`touchend`:case`touchmove`:case`touchstart`:l=Vn;break;case Br:case Vr:case Hr:l=jn;break;case Kr:l=Hn;break;case`scroll`:case`scrollend`:l=Cn;break;case`wheel`:l=Un;break;case`copy`:case`cut`:case`paste`:l=Mn;break;case`gotpointercapture`:case`lostpointercapture`:case`pointercancel`:case`pointerdown`:case`pointermove`:case`pointerout`:case`pointerover`:case`pointerup`:l=Bn;break;case`toggle`:case`beforetoggle`:l=Wn}var d=!!(t&4),f=!d&&(e===`scroll`||e===`scrollend`),p=d?c===null?null:c+`Capture`:c;d=[];for(var m=r,h;m!==null;){var g=m;if(h=g.stateNode,g=g.tag,g!==5&&g!==26&&g!==27||h===null||p===null||(g=cn(m,p),g!=null&&d.push(Fd(m,g,h))),f)break;m=m.return}0<d.length&&(c=new l(c,u,null,n,i),s.push({event:c,listeners:d}))}}if(!(t&7)){a:{if(c=e===`mouseover`||e===`pointerover`,l=e===`mouseout`||e===`pointerout`,c&&n!==en&&(u=n.relatedTarget||n.fromElement)&&(ht(u)||u[ct]))break a;if((l||c)&&(c=i.window===i?i:(c=i.ownerDocument)?c.defaultView||c.parentWindow:window,l?(u=n.relatedTarget||n.toElement,l=r,u=u?ht(u):null,u!==null&&(f=o(u),d=u.tag,u!==f||d!==5&&d!==27&&d!==6)&&(u=null)):(l=null,u=r),l!==u)){if(d=On,g=`onMouseLeave`,p=`onMouseEnter`,m=`mouse`,(e===`pointerout`||e===`pointerover`)&&(d=Bn,g=`onPointerLeave`,p=`onPointerEnter`,m=`pointer`),f=l==null?c:_t(l),h=u==null?c:_t(u),c=new d(g,m+`leave`,l,n,i),c.target=f,c.relatedTarget=h,g=null,ht(i)===r&&(d=new d(p,m+`enter`,u,n,i),d.target=h,d.relatedTarget=f,g=d),f=g,l&&u)b:{for(d=Ld,p=l,m=u,h=0,g=p;g;g=d(g))h++;g=0;for(var _=m;_;_=d(_))g++;for(;0<h-g;)p=d(p),h--;for(;0<g-h;)m=d(m),g--;for(;h--;){if(p===m||m!==null&&p===m.alternate){d=p;break b}p=d(p),m=d(m)}d=null}else d=null;l!==null&&Rd(s,c,l,d,!1),u!==null&&f!==null&&Rd(s,f,u,d,!0)}}a:{if(c=r?_t(r):window,l=c.nodeName&&c.nodeName.toLowerCase(),l===`select`||l===`input`&&c.type===`file`)var v=ur;else if(ir(c))if(dr)v=br;else{v=vr;var y=_r}else l=c.nodeName,!l||l.toLowerCase()!==`input`||c.type!==`checkbox`&&c.type!==`radio`?r&&Yt(r.elementType)&&(v=ur):v=yr;if(v&&=v(e,r)){ar(s,v,n,i);break a}y&&y(e,c,r),e===`focusout`&&r&&c.type===`number`&&r.memoizedProps.value!=null&&Vt(c,`number`,c.value)}switch(y=r?_t(r):window,e){case`focusin`:(ir(y)||y.contentEditable===`true`)&&(Ar=y,jr=r,Mr=null);break;case`focusout`:Mr=jr=Ar=null;break;case`mousedown`:Nr=!0;break;case`contextmenu`:case`mouseup`:case`dragend`:Nr=!1,Pr(s,n,i);break;case`selectionchange`:if(kr)break;case`keydown`:case`keyup`:Pr(s,n,i)}var b;if(Kn)b:{switch(e){case`compositionstart`:var x=`onCompositionStart`;break b;case`compositionend`:x=`onCompositionEnd`;break b;case`compositionupdate`:x=`onCompositionUpdate`;break b}x=void 0}else er?Qn(e,n)&&(x=`onCompositionEnd`):e===`keydown`&&n.keyCode===229&&(x=`onCompositionStart`);x&&(Yn&&n.locale!==`ko`&&(er||x!==`onCompositionStart`?x===`onCompositionEnd`&&er&&(b=hn()):(fn=i,pn=`value`in fn?fn.value:fn.textContent,er=!0)),y=Id(r,x),0<y.length&&(x=new Nn(x,e,null,n,i),s.push({event:x,listeners:y}),b?x.data=b:(b=$n(n),b!==null&&(x.data=b)))),(b=Jn?tr(e,n):nr(e,n))&&(x=Id(r,`onBeforeInput`),0<x.length&&(y=new Nn(`onBeforeInput`,`beforeinput`,null,n,i),s.push({event:y,listeners:x}),y.data=b)),Cd(s,e,r,n,i)}Od(s,t)})}function Fd(e,t,n){return{instance:e,listener:t,currentTarget:n}}function Id(e,t){for(var n=t+`Capture`,r=[];e!==null;){var i=e,a=i.stateNode;if(i=i.tag,i!==5&&i!==26&&i!==27||a===null||(i=cn(e,n),i!=null&&r.unshift(Fd(e,i,a)),i=cn(e,t),i!=null&&r.push(Fd(e,i,a))),e.tag===3)return r;e=e.return}return[]}function Ld(e){if(e===null)return null;do e=e.return;while(e&&e.tag!==5&&e.tag!==27);return e||null}function Rd(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(s=s.tag,c!==null&&c===r)break;s!==5&&s!==26&&s!==27||l===null||(c=l,i?(l=cn(n,a),l!=null&&o.unshift(Fd(n,l,c))):i||(l=cn(n,a),l!=null&&o.push(Fd(n,l,c)))),n=n.return}o.length!==0&&e.push({event:t,listeners:o})}var zd=/\r\n?/g,Bd=/\u0000|\uFFFD/g;function Vd(e){return(typeof e==`string`?e:``+e).replace(zd,`
10
- `).replace(Bd,``)}function Hd(e,t){return t=Vd(t),Vd(e)===t}function Ud(e,t,n,r,a,o){switch(n){case`children`:typeof r==`string`?t===`body`||t===`textarea`&&r===``||Gt(e,r):(typeof r==`number`||typeof r==`bigint`)&&t!==`body`&&Gt(e,``+r);break;case`className`:kt(e,`class`,r);break;case`tabIndex`:kt(e,`tabindex`,r);break;case`dir`:case`role`:case`viewBox`:case`width`:case`height`:kt(e,n,r);break;case`style`:Jt(e,r,o);break;case`data`:if(t!==`object`){kt(e,`data`,r);break}case`src`:case`href`:if(r===``&&(t!==`a`||n!==`href`)){e.removeAttribute(n);break}if(r==null||typeof r==`function`||typeof r==`symbol`||typeof r==`boolean`){e.removeAttribute(n);break}r=Qt(``+r),e.setAttribute(n,r);break;case`action`:case`formAction`:if(typeof r==`function`){e.setAttribute(n,`javascript:throw new Error('A React form was unexpectedly submitted. If you called form.submit() manually, consider using form.requestSubmit() instead. If you\\'re trying to use event.stopPropagation() in a submit event handler, consider also calling event.preventDefault().')`);break}if(typeof o==`function`&&(n===`formAction`?(t!==`input`&&Ud(e,t,`name`,a.name,a,null),Ud(e,t,`formEncType`,a.formEncType,a,null),Ud(e,t,`formMethod`,a.formMethod,a,null),Ud(e,t,`formTarget`,a.formTarget,a,null)):(Ud(e,t,`encType`,a.encType,a,null),Ud(e,t,`method`,a.method,a,null),Ud(e,t,`target`,a.target,a,null))),r==null||typeof r==`symbol`||typeof r==`boolean`){e.removeAttribute(n);break}r=Qt(``+r),e.setAttribute(n,r);break;case`onClick`:r!=null&&(e.onclick=$t);break;case`onScroll`:r!=null&&kd(`scroll`,e);break;case`onScrollEnd`:r!=null&&kd(`scrollend`,e);break;case`dangerouslySetInnerHTML`:if(r!=null){if(typeof r!=`object`||!(`__html`in r))throw Error(i(61));if(n=r.__html,n!=null){if(a.children!=null)throw Error(i(60));e.innerHTML=n}}break;case`multiple`:e.multiple=r&&typeof r!=`function`&&typeof r!=`symbol`;break;case`muted`:e.muted=r&&typeof r!=`function`&&typeof r!=`symbol`;break;case`suppressContentEditableWarning`:case`suppressHydrationWarning`:case`defaultValue`:case`defaultChecked`:case`innerHTML`:case`ref`:break;case`autoFocus`:break;case`xlinkHref`:if(r==null||typeof r==`function`||typeof r==`boolean`||typeof r==`symbol`){e.removeAttribute(`xlink:href`);break}n=Qt(``+r),e.setAttributeNS(`http://www.w3.org/1999/xlink`,`xlink:href`,n);break;case`contentEditable`:case`spellCheck`:case`draggable`:case`value`:case`autoReverse`:case`externalResourcesRequired`:case`focusable`:case`preserveAlpha`:r!=null&&typeof r!=`function`&&typeof r!=`symbol`?e.setAttribute(n,``+r):e.removeAttribute(n);break;case`inert`:case`allowFullScreen`:case`async`:case`autoPlay`:case`controls`:case`default`:case`defer`:case`disabled`:case`disablePictureInPicture`:case`disableRemotePlayback`:case`formNoValidate`:case`hidden`:case`loop`:case`noModule`:case`noValidate`:case`open`:case`playsInline`:case`readOnly`:case`required`:case`reversed`:case`scoped`:case`seamless`:case`itemScope`:r&&typeof r!=`function`&&typeof r!=`symbol`?e.setAttribute(n,``):e.removeAttribute(n);break;case`capture`:case`download`:!0===r?e.setAttribute(n,``):!1!==r&&r!=null&&typeof r!=`function`&&typeof r!=`symbol`?e.setAttribute(n,r):e.removeAttribute(n);break;case`cols`:case`rows`:case`size`:case`span`:r!=null&&typeof r!=`function`&&typeof r!=`symbol`&&!isNaN(r)&&1<=r?e.setAttribute(n,r):e.removeAttribute(n);break;case`rowSpan`:case`start`:r==null||typeof r==`function`||typeof r==`symbol`||isNaN(r)?e.removeAttribute(n):e.setAttribute(n,r);break;case`popover`:kd(`beforetoggle`,e),kd(`toggle`,e),Ot(e,`popover`,r);break;case`xlinkActuate`:At(e,`http://www.w3.org/1999/xlink`,`xlink:actuate`,r);break;case`xlinkArcrole`:At(e,`http://www.w3.org/1999/xlink`,`xlink:arcrole`,r);break;case`xlinkRole`:At(e,`http://www.w3.org/1999/xlink`,`xlink:role`,r);break;case`xlinkShow`:At(e,`http://www.w3.org/1999/xlink`,`xlink:show`,r);break;case`xlinkTitle`:At(e,`http://www.w3.org/1999/xlink`,`xlink:title`,r);break;case`xlinkType`:At(e,`http://www.w3.org/1999/xlink`,`xlink:type`,r);break;case`xmlBase`:At(e,`http://www.w3.org/XML/1998/namespace`,`xml:base`,r);break;case`xmlLang`:At(e,`http://www.w3.org/XML/1998/namespace`,`xml:lang`,r);break;case`xmlSpace`:At(e,`http://www.w3.org/XML/1998/namespace`,`xml:space`,r);break;case`is`:Ot(e,`is`,r);break;case`innerText`:case`textContent`:break;default:(!(2<n.length)||n[0]!==`o`&&n[0]!==`O`||n[1]!==`n`&&n[1]!==`N`)&&(n=Xt.get(n)||n,Ot(e,n,r))}}function Wd(e,t,n,r,a,o){switch(n){case`style`:Jt(e,r,o);break;case`dangerouslySetInnerHTML`:if(r!=null){if(typeof r!=`object`||!(`__html`in r))throw Error(i(61));if(n=r.__html,n!=null){if(a.children!=null)throw Error(i(60));e.innerHTML=n}}break;case`children`:typeof r==`string`?Gt(e,r):(typeof r==`number`||typeof r==`bigint`)&&Gt(e,``+r);break;case`onScroll`:r!=null&&kd(`scroll`,e);break;case`onScrollEnd`:r!=null&&kd(`scrollend`,e);break;case`onClick`:r!=null&&(e.onclick=$t);break;case`suppressContentEditableWarning`:case`suppressHydrationWarning`:case`innerHTML`:case`ref`:break;case`innerText`:case`textContent`:break;default:if(!xt.hasOwnProperty(n))a:{if(n[0]===`o`&&n[1]===`n`&&(a=n.endsWith(`Capture`),t=n.slice(2,a?n.length-7:void 0),o=e[st]||null,o=o==null?null:o[n],typeof o==`function`&&e.removeEventListener(t,o,a),typeof r==`function`)){typeof o!=`function`&&o!==null&&(n in e?e[n]=null:e.hasAttribute(n)&&e.removeAttribute(n)),e.addEventListener(t,r,a);break a}n in e?e[n]=r:!0===r?e.setAttribute(n,``):Ot(e,n,r)}}}function Gd(e,t,n){switch(t){case`div`:case`span`:case`svg`:case`path`:case`a`:case`g`:case`p`:case`li`:break;case`img`:kd(`error`,e),kd(`load`,e);var r=!1,a=!1,o;for(o in n)if(n.hasOwnProperty(o)){var s=n[o];if(s!=null)switch(o){case`src`:r=!0;break;case`srcSet`:a=!0;break;case`children`:case`dangerouslySetInnerHTML`:throw Error(i(137,t));default:Ud(e,t,o,s,n,null)}}a&&Ud(e,t,`srcSet`,n.srcSet,n,null),r&&Ud(e,t,`src`,n.src,n,null);return;case`input`:kd(`invalid`,e);var c=o=s=a=null,l=null,u=null;for(r in n)if(n.hasOwnProperty(r)){var d=n[r];if(d!=null)switch(r){case`name`:a=d;break;case`type`:s=d;break;case`checked`:l=d;break;case`defaultChecked`:u=d;break;case`value`:o=d;break;case`defaultValue`:c=d;break;case`children`:case`dangerouslySetInnerHTML`:if(d!=null)throw Error(i(137,t));break;default:Ud(e,t,r,d,n,null)}}Bt(e,o,c,l,u,s,a,!1);return;case`select`:for(a in kd(`invalid`,e),r=s=o=null,n)if(n.hasOwnProperty(a)&&(c=n[a],c!=null))switch(a){case`value`:o=c;break;case`defaultValue`:s=c;break;case`multiple`:r=c;default:Ud(e,t,a,c,n,null)}t=o,n=s,e.multiple=!!r,t==null?n!=null&&Ht(e,!!r,n,!0):Ht(e,!!r,t,!1);return;case`textarea`:for(s in kd(`invalid`,e),o=a=r=null,n)if(n.hasOwnProperty(s)&&(c=n[s],c!=null))switch(s){case`value`:r=c;break;case`defaultValue`:a=c;break;case`children`:o=c;break;case`dangerouslySetInnerHTML`:if(c!=null)throw Error(i(91));break;default:Ud(e,t,s,c,n,null)}Wt(e,r,a,o);return;case`option`:for(l in n)if(n.hasOwnProperty(l)&&(r=n[l],r!=null))switch(l){case`selected`:e.selected=r&&typeof r!=`function`&&typeof r!=`symbol`;break;default:Ud(e,t,l,r,n,null)}return;case`dialog`:kd(`beforetoggle`,e),kd(`toggle`,e),kd(`cancel`,e),kd(`close`,e);break;case`iframe`:case`object`:kd(`load`,e);break;case`video`:case`audio`:for(r=0;r<Ed.length;r++)kd(Ed[r],e);break;case`image`:kd(`error`,e),kd(`load`,e);break;case`details`:kd(`toggle`,e);break;case`embed`:case`source`:case`link`:kd(`error`,e),kd(`load`,e);case`area`:case`base`:case`br`:case`col`:case`hr`:case`keygen`:case`meta`:case`param`:case`track`:case`wbr`:case`menuitem`:for(u in n)if(n.hasOwnProperty(u)&&(r=n[u],r!=null))switch(u){case`children`:case`dangerouslySetInnerHTML`:throw Error(i(137,t));default:Ud(e,t,u,r,n,null)}return;default:if(Yt(t)){for(d in n)n.hasOwnProperty(d)&&(r=n[d],r!==void 0&&Wd(e,t,d,r,n,void 0));return}}for(c in n)n.hasOwnProperty(c)&&(r=n[c],r!=null&&Ud(e,t,c,r,n,null))}function Kd(e,t,n,r){switch(t){case`div`:case`span`:case`svg`:case`path`:case`a`:case`g`:case`p`:case`li`:break;case`input`:var a=null,o=null,s=null,c=null,l=null,u=null,d=null;for(m in n){var f=n[m];if(n.hasOwnProperty(m)&&f!=null)switch(m){case`checked`:break;case`value`:break;case`defaultValue`:l=f;default:r.hasOwnProperty(m)||Ud(e,t,m,null,r,f)}}for(var p in r){var m=r[p];if(f=n[p],r.hasOwnProperty(p)&&(m!=null||f!=null))switch(p){case`type`:o=m;break;case`name`:a=m;break;case`checked`:u=m;break;case`defaultChecked`:d=m;break;case`value`:s=m;break;case`defaultValue`:c=m;break;case`children`:case`dangerouslySetInnerHTML`:if(m!=null)throw Error(i(137,t));break;default:m!==f&&Ud(e,t,p,m,r,f)}}zt(e,s,c,l,u,d,o,a);return;case`select`:for(o in m=s=c=p=null,n)if(l=n[o],n.hasOwnProperty(o)&&l!=null)switch(o){case`value`:break;case`multiple`:m=l;default:r.hasOwnProperty(o)||Ud(e,t,o,null,r,l)}for(a in r)if(o=r[a],l=n[a],r.hasOwnProperty(a)&&(o!=null||l!=null))switch(a){case`value`:p=o;break;case`defaultValue`:c=o;break;case`multiple`:s=o;default:o!==l&&Ud(e,t,a,o,r,l)}t=c,n=s,r=m,p==null?!!r!=!!n&&(t==null?Ht(e,!!n,n?[]:``,!1):Ht(e,!!n,t,!0)):Ht(e,!!n,p,!1);return;case`textarea`:for(c in m=p=null,n)if(a=n[c],n.hasOwnProperty(c)&&a!=null&&!r.hasOwnProperty(c))switch(c){case`value`:break;case`children`:break;default:Ud(e,t,c,null,r,a)}for(s in r)if(a=r[s],o=n[s],r.hasOwnProperty(s)&&(a!=null||o!=null))switch(s){case`value`:p=a;break;case`defaultValue`:m=a;break;case`children`:break;case`dangerouslySetInnerHTML`:if(a!=null)throw Error(i(91));break;default:a!==o&&Ud(e,t,s,a,r,o)}Ut(e,p,m);return;case`option`:for(var h in n)if(p=n[h],n.hasOwnProperty(h)&&p!=null&&!r.hasOwnProperty(h))switch(h){case`selected`:e.selected=!1;break;default:Ud(e,t,h,null,r,p)}for(l in r)if(p=r[l],m=n[l],r.hasOwnProperty(l)&&p!==m&&(p!=null||m!=null))switch(l){case`selected`:e.selected=p&&typeof p!=`function`&&typeof p!=`symbol`;break;default:Ud(e,t,l,p,r,m)}return;case`img`:case`link`:case`area`:case`base`:case`br`:case`col`:case`embed`:case`hr`:case`keygen`:case`meta`:case`param`:case`source`:case`track`:case`wbr`:case`menuitem`:for(var g in n)p=n[g],n.hasOwnProperty(g)&&p!=null&&!r.hasOwnProperty(g)&&Ud(e,t,g,null,r,p);for(u in r)if(p=r[u],m=n[u],r.hasOwnProperty(u)&&p!==m&&(p!=null||m!=null))switch(u){case`children`:case`dangerouslySetInnerHTML`:if(p!=null)throw Error(i(137,t));break;default:Ud(e,t,u,p,r,m)}return;default:if(Yt(t)){for(var _ in n)p=n[_],n.hasOwnProperty(_)&&p!==void 0&&!r.hasOwnProperty(_)&&Wd(e,t,_,void 0,r,p);for(d in r)p=r[d],m=n[d],!r.hasOwnProperty(d)||p===m||p===void 0&&m===void 0||Wd(e,t,d,p,r,m);return}}for(var v in n)p=n[v],n.hasOwnProperty(v)&&p!=null&&!r.hasOwnProperty(v)&&Ud(e,t,v,null,r,p);for(f in r)p=r[f],m=n[f],!r.hasOwnProperty(f)||p===m||p==null&&m==null||Ud(e,t,f,p,r,m)}function qd(e){switch(e){case`css`:case`script`:case`font`:case`img`:case`image`:case`input`:case`link`:return!0;default:return!1}}function Jd(){if(typeof performance.getEntriesByType==`function`){for(var e=0,t=0,n=performance.getEntriesByType(`resource`),r=0;r<n.length;r++){var i=n[r],a=i.transferSize,o=i.initiatorType,s=i.duration;if(a&&s&&qd(o)){for(o=0,s=i.responseEnd,r+=1;r<n.length;r++){var c=n[r],l=c.startTime;if(l>s)break;var u=c.transferSize,d=c.initiatorType;u&&qd(d)&&(c=c.responseEnd,o+=u*(c<s?1:(s-l)/(c-l)))}if(--r,t+=8*(a+o)/(i.duration/1e3),e++,10<e)break}}if(0<e)return t/e/1e6}return navigator.connection&&(e=navigator.connection.downlink,typeof e==`number`)?e:5}var Yd=null,U=null;function Xd(e){return e.nodeType===9?e:e.ownerDocument}function Zd(e){switch(e){case`http://www.w3.org/2000/svg`:return 1;case`http://www.w3.org/1998/Math/MathML`:return 2;default:return 0}}function Qd(e,t){if(e===0)switch(t){case`svg`:return 1;case`math`:return 2;default:return 0}return e===1&&t===`foreignObject`?0:e}function $d(e,t){return e===`textarea`||e===`noscript`||typeof t.children==`string`||typeof t.children==`number`||typeof t.children==`bigint`||typeof t.dangerouslySetInnerHTML==`object`&&t.dangerouslySetInnerHTML!==null&&t.dangerouslySetInnerHTML.__html!=null}var ef=null;function tf(){var e=window.event;return e&&e.type===`popstate`?e!==ef&&(ef=e,!0):(ef=null,!1)}var nf=typeof setTimeout==`function`?setTimeout:void 0,rf=typeof clearTimeout==`function`?clearTimeout:void 0,af=typeof Promise==`function`?Promise:void 0,of=typeof queueMicrotask==`function`?queueMicrotask:af===void 0?nf:function(e){return af.resolve(null).then(e).catch(sf)};function sf(e){setTimeout(function(){throw e})}function cf(e){return e===`head`}function lf(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===`/$`||n===`/&`){if(r===0){e.removeChild(i),Up(t);return}r--}else if(n===`$`||n===`$?`||n===`$~`||n===`$!`||n===`&`)r++;else if(n===`html`)Cf(e.ownerDocument.documentElement);else if(n===`head`){n=e.ownerDocument.head,Cf(n);for(var a=n.firstChild;a;){var o=a.nextSibling,s=a.nodeName;a[pt]||s===`SCRIPT`||s===`STYLE`||s===`LINK`&&a.rel.toLowerCase()===`stylesheet`||n.removeChild(a),a=o}}else n===`body`&&Cf(e.ownerDocument.body);n=i}while(n);Up(t)}function uf(e,t){var n=e;e=0;do{var r=n.nextSibling;if(n.nodeType===1?t?(n._stashedDisplay=n.style.display,n.style.display=`none`):(n.style.display=n._stashedDisplay||``,n.getAttribute(`style`)===``&&n.removeAttribute(`style`)):n.nodeType===3&&(t?(n._stashedText=n.nodeValue,n.nodeValue=``):n.nodeValue=n._stashedText||``),r&&r.nodeType===8)if(n=r.data,n===`/$`){if(e===0)break;e--}else n!==`$`&&n!==`$?`&&n!==`$~`&&n!==`$!`||e++;n=r}while(n)}function df(e){var t=e.firstChild;for(t&&t.nodeType===10&&(t=t.nextSibling);t;){var n=t;switch(t=t.nextSibling,n.nodeName){case`HTML`:case`HEAD`:case`BODY`:df(n),mt(n);continue;case`SCRIPT`:case`STYLE`:continue;case`LINK`:if(n.rel.toLowerCase()===`stylesheet`)continue}e.removeChild(n)}}function ff(e,t,n,r){for(;e.nodeType===1;){var i=n;if(e.nodeName.toLowerCase()!==t.toLowerCase()){if(!r&&(e.nodeName!==`INPUT`||e.type!==`hidden`))break}else if(!r)if(t===`input`&&e.type===`hidden`){var a=i.name==null?null:``+i.name;if(i.type===`hidden`&&e.getAttribute(`name`)===a)return e}else return e;else if(!e[pt])switch(t){case`meta`:if(!e.hasAttribute(`itemprop`))break;return e;case`link`:if(a=e.getAttribute(`rel`),a===`stylesheet`&&e.hasAttribute(`data-precedence`)||a!==i.rel||e.getAttribute(`href`)!==(i.href==null||i.href===``?null:i.href)||e.getAttribute(`crossorigin`)!==(i.crossOrigin==null?null:i.crossOrigin)||e.getAttribute(`title`)!==(i.title==null?null:i.title))break;return e;case`style`:if(e.hasAttribute(`data-precedence`))break;return e;case`script`:if(a=e.getAttribute(`src`),(a!==(i.src==null?null:i.src)||e.getAttribute(`type`)!==(i.type==null?null:i.type)||e.getAttribute(`crossorigin`)!==(i.crossOrigin==null?null:i.crossOrigin))&&a&&e.hasAttribute(`async`)&&!e.hasAttribute(`itemprop`))break;return e;default:return e}if(e=vf(e.nextSibling),e===null)break}return null}function pf(e,t,n){if(t===``)return null;for(;e.nodeType!==3;)if((e.nodeType!==1||e.nodeName!==`INPUT`||e.type!==`hidden`)&&!n||(e=vf(e.nextSibling),e===null))return null;return e}function mf(e,t){for(;e.nodeType!==8;)if((e.nodeType!==1||e.nodeName!==`INPUT`||e.type!==`hidden`)&&!t||(e=vf(e.nextSibling),e===null))return null;return e}function hf(e){return e.data===`$?`||e.data===`$~`}function gf(e){return e.data===`$!`||e.data===`$?`&&e.ownerDocument.readyState!==`loading`}function _f(e,t){var n=e.ownerDocument;if(e.data===`$~`)e._reactRetry=t;else if(e.data!==`$?`||n.readyState!==`loading`)t();else{var r=function(){t(),n.removeEventListener(`DOMContentLoaded`,r)};n.addEventListener(`DOMContentLoaded`,r),e._reactRetry=r}}function vf(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===`$?`||t===`$~`||t===`&`||t===`F!`||t===`F`)break;if(t===`/$`||t===`/&`)return null}}return e}var yf=null;function bf(e){e=e.nextSibling;for(var t=0;e;){if(e.nodeType===8){var n=e.data;if(n===`/$`||n===`/&`){if(t===0)return vf(e.nextSibling);t--}else n!==`$`&&n!==`$!`&&n!==`$?`&&n!==`$~`&&n!==`&`||t++}e=e.nextSibling}return null}function xf(e){e=e.previousSibling;for(var t=0;e;){if(e.nodeType===8){var n=e.data;if(n===`$`||n===`$!`||n===`$?`||n===`$~`||n===`&`){if(t===0)return e;t--}else n!==`/$`&&n!==`/&`||t++}e=e.previousSibling}return null}function Sf(e,t,n){switch(t=Xd(n),e){case`html`:if(e=t.documentElement,!e)throw Error(i(452));return e;case`head`:if(e=t.head,!e)throw Error(i(453));return e;case`body`:if(e=t.body,!e)throw Error(i(454));return e;default:throw Error(i(451))}}function Cf(e){for(var t=e.attributes;t.length;)e.removeAttributeNode(t[0]);mt(e)}var wf=new Map,Tf=new Set;function Ef(e){return typeof e.getRootNode==`function`?e.getRootNode():e.nodeType===9?e:e.ownerDocument}var Df=F.d;F.d={f:Of,r:kf,D:Mf,C:Nf,L:Pf,m:Ff,X:Lf,S:If,M:Rf};function Of(){var e=Df.f(),t=ku();return e||t}function kf(e){var t=gt(e);t!==null&&t.tag===5&&t.type===`form`?Os(t):Df.r(e)}var Af=typeof document>`u`?null:document;function jf(e,t,n){var r=Af;if(r&&typeof t==`string`&&t){var i=Rt(t);i=`link[rel="`+e+`"][href="`+i+`"]`,typeof n==`string`&&(i+=`[crossorigin="`+n+`"]`),Tf.has(i)||(Tf.add(i),e={rel:e,crossOrigin:n,href:t},r.querySelector(i)===null&&(t=r.createElement(`link`),Gd(t,`link`,e),yt(t),r.head.appendChild(t)))}}function Mf(e){Df.D(e),jf(`dns-prefetch`,e,null)}function Nf(e,t){Df.C(e,t),jf(`preconnect`,e,t)}function Pf(e,t,n){Df.L(e,t,n);var r=Af;if(r&&e&&t){var i=`link[rel="preload"][as="`+Rt(t)+`"]`;t===`image`&&n&&n.imageSrcSet?(i+=`[imagesrcset="`+Rt(n.imageSrcSet)+`"]`,typeof n.imageSizes==`string`&&(i+=`[imagesizes="`+Rt(n.imageSizes)+`"]`)):i+=`[href="`+Rt(e)+`"]`;var a=i;switch(t){case`style`:a=Bf(e);break;case`script`:a=Wf(e)}wf.has(a)||(e=p({rel:`preload`,href:t===`image`&&n&&n.imageSrcSet?void 0:e,as:t},n),wf.set(a,e),r.querySelector(i)!==null||t===`style`&&r.querySelector(Vf(a))||t===`script`&&r.querySelector(Gf(a))||(t=r.createElement(`link`),Gd(t,`link`,e),yt(t),r.head.appendChild(t)))}}function Ff(e,t){Df.m(e,t);var n=Af;if(n&&e){var r=t&&typeof t.as==`string`?t.as:`script`,i=`link[rel="modulepreload"][as="`+Rt(r)+`"][href="`+Rt(e)+`"]`,a=i;switch(r){case`audioworklet`:case`paintworklet`:case`serviceworker`:case`sharedworker`:case`worker`:case`script`:a=Wf(e)}if(!wf.has(a)&&(e=p({rel:`modulepreload`,href:e},t),wf.set(a,e),n.querySelector(i)===null)){switch(r){case`audioworklet`:case`paintworklet`:case`serviceworker`:case`sharedworker`:case`worker`:case`script`:if(n.querySelector(Gf(a)))return}r=n.createElement(`link`),Gd(r,`link`,e),yt(r),n.head.appendChild(r)}}}function If(e,t,n){Df.S(e,t,n);var r=Af;if(r&&e){var i=vt(r).hoistableStyles,a=Bf(e);t||=`default`;var o=i.get(a);if(!o){var s={loading:0,preload:null};if(o=r.querySelector(Vf(a)))s.loading=5;else{e=p({rel:`stylesheet`,href:e,"data-precedence":t},n),(n=wf.get(a))&&Jf(e,n);var c=o=r.createElement(`link`);yt(c),Gd(c,`link`,e),c._p=new Promise(function(e,t){c.onload=e,c.onerror=t}),c.addEventListener(`load`,function(){s.loading|=1}),c.addEventListener(`error`,function(){s.loading|=2}),s.loading|=4,qf(o,t,r)}o={type:`stylesheet`,instance:o,count:1,state:s},i.set(a,o)}}}function Lf(e,t){Df.X(e,t);var n=Af;if(n&&e){var r=vt(n).hoistableScripts,i=Wf(e),a=r.get(i);a||(a=n.querySelector(Gf(i)),a||(e=p({src:e,async:!0},t),(t=wf.get(i))&&Yf(e,t),a=n.createElement(`script`),yt(a),Gd(a,`link`,e),n.head.appendChild(a)),a={type:`script`,instance:a,count:1,state:null},r.set(i,a))}}function Rf(e,t){Df.M(e,t);var n=Af;if(n&&e){var r=vt(n).hoistableScripts,i=Wf(e),a=r.get(i);a||(a=n.querySelector(Gf(i)),a||(e=p({src:e,async:!0,type:`module`},t),(t=wf.get(i))&&Yf(e,t),a=n.createElement(`script`),yt(a),Gd(a,`link`,e),n.head.appendChild(a)),a={type:`script`,instance:a,count:1,state:null},r.set(i,a))}}function zf(e,t,n,r){var a=(a=le.current)?Ef(a):null;if(!a)throw Error(i(446));switch(e){case`meta`:case`title`:return null;case`style`:return typeof n.precedence==`string`&&typeof n.href==`string`?(t=Bf(n.href),n=vt(a).hoistableStyles,r=n.get(t),r||(r={type:`style`,instance:null,count:0,state:null},n.set(t,r)),r):{type:`void`,instance:null,count:0,state:null};case`link`:if(n.rel===`stylesheet`&&typeof n.href==`string`&&typeof n.precedence==`string`){e=Bf(n.href);var o=vt(a).hoistableStyles,s=o.get(e);if(s||(a=a.ownerDocument||a,s={type:`stylesheet`,instance:null,count:0,state:{loading:0,preload:null}},o.set(e,s),(o=a.querySelector(Vf(e)))&&!o._p&&(s.instance=o,s.state.loading=5),wf.has(e)||(n={rel:`preload`,as:`style`,href:n.href,crossOrigin:n.crossOrigin,integrity:n.integrity,media:n.media,hrefLang:n.hrefLang,referrerPolicy:n.referrerPolicy},wf.set(e,n),o||Uf(a,e,n,s.state))),t&&r===null)throw Error(i(528,``));return s}if(t&&r!==null)throw Error(i(529,``));return null;case`script`:return t=n.async,n=n.src,typeof n==`string`&&t&&typeof t!=`function`&&typeof t!=`symbol`?(t=Wf(n),n=vt(a).hoistableScripts,r=n.get(t),r||(r={type:`script`,instance:null,count:0,state:null},n.set(t,r)),r):{type:`void`,instance:null,count:0,state:null};default:throw Error(i(444,e))}}function Bf(e){return`href="`+Rt(e)+`"`}function Vf(e){return`link[rel="stylesheet"][`+e+`]`}function Hf(e){return p({},e,{"data-precedence":e.precedence,precedence:null})}function Uf(e,t,n,r){e.querySelector(`link[rel="preload"][as="style"][`+t+`]`)?r.loading=1:(t=e.createElement(`link`),r.preload=t,t.addEventListener(`load`,function(){return r.loading|=1}),t.addEventListener(`error`,function(){return r.loading|=2}),Gd(t,`link`,n),yt(t),e.head.appendChild(t))}function Wf(e){return`[src="`+Rt(e)+`"]`}function Gf(e){return`script[async]`+e}function Kf(e,t,n){if(t.count++,t.instance===null)switch(t.type){case`style`:var r=e.querySelector(`style[data-href~="`+Rt(n.href)+`"]`);if(r)return t.instance=r,yt(r),r;var a=p({},n,{"data-href":n.href,"data-precedence":n.precedence,href:null,precedence:null});return r=(e.ownerDocument||e).createElement(`style`),yt(r),Gd(r,`style`,a),qf(r,n.precedence,e),t.instance=r;case`stylesheet`:a=Bf(n.href);var o=e.querySelector(Vf(a));if(o)return t.state.loading|=4,t.instance=o,yt(o),o;r=Hf(n),(a=wf.get(a))&&Jf(r,a),o=(e.ownerDocument||e).createElement(`link`),yt(o);var s=o;return s._p=new Promise(function(e,t){s.onload=e,s.onerror=t}),Gd(o,`link`,r),t.state.loading|=4,qf(o,n.precedence,e),t.instance=o;case`script`:return o=Wf(n.src),(a=e.querySelector(Gf(o)))?(t.instance=a,yt(a),a):(r=n,(a=wf.get(o))&&(r=p({},n),Yf(r,a)),e=e.ownerDocument||e,a=e.createElement(`script`),yt(a),Gd(a,`link`,r),e.head.appendChild(a),t.instance=a);case`void`:return null;default:throw Error(i(443,t.type))}else t.type===`stylesheet`&&!(t.state.loading&4)&&(r=t.instance,t.state.loading|=4,qf(r,n.precedence,e));return t.instance}function qf(e,t,n){for(var r=n.querySelectorAll(`link[rel="stylesheet"][data-precedence],style[data-precedence]`),i=r.length?r[r.length-1]:null,a=i,o=0;o<r.length;o++){var s=r[o];if(s.dataset.precedence===t)a=s;else if(a!==i)break}a?a.parentNode.insertBefore(e,a.nextSibling):(t=n.nodeType===9?n.head:n,t.insertBefore(e,t.firstChild))}function Jf(e,t){e.crossOrigin??=t.crossOrigin,e.referrerPolicy??=t.referrerPolicy,e.title??=t.title}function Yf(e,t){e.crossOrigin??=t.crossOrigin,e.referrerPolicy??=t.referrerPolicy,e.integrity??=t.integrity}var Xf=null;function Zf(e,t,n){if(Xf===null){var r=new Map,i=Xf=new Map;i.set(n,r)}else i=Xf,r=i.get(n),r||(r=new Map,i.set(n,r));if(r.has(e))return r;for(r.set(e,null),n=n.getElementsByTagName(e),i=0;i<n.length;i++){var a=n[i];if(!(a[pt]||a[ot]||e===`link`&&a.getAttribute(`rel`)===`stylesheet`)&&a.namespaceURI!==`http://www.w3.org/2000/svg`){var o=a.getAttribute(t)||``;o=e+o;var s=r.get(o);s?s.push(a):r.set(o,[a])}}return r}function Qf(e,t,n){e=e.ownerDocument||e,e.head.insertBefore(n,t===`title`?e.querySelector(`head > title`):null)}function $f(e,t,n){if(n===1||t.itemProp!=null)return!1;switch(e){case`meta`:case`title`:return!0;case`style`:if(typeof t.precedence!=`string`||typeof t.href!=`string`||t.href===``)break;return!0;case`link`:if(typeof t.rel!=`string`||typeof t.href!=`string`||t.href===``||t.onLoad||t.onError)break;switch(t.rel){case`stylesheet`:return e=t.disabled,typeof t.precedence==`string`&&e==null;default:return!0}case`script`:if(t.async&&typeof t.async!=`function`&&typeof t.async!=`symbol`&&!t.onLoad&&!t.onError&&t.src&&typeof t.src==`string`)return!0}return!1}function ep(e){return!(e.type===`stylesheet`&&!(e.state.loading&3))}function tp(e,t,n,r){if(n.type===`stylesheet`&&(typeof r.media!=`string`||!1!==matchMedia(r.media).matches)&&!(n.state.loading&4)){if(n.instance===null){var i=Bf(r.href),a=t.querySelector(Vf(i));if(a){t=a._p,typeof t==`object`&&t&&typeof t.then==`function`&&(e.count++,e=ip.bind(e),t.then(e,e)),n.state.loading|=4,n.instance=a,yt(a);return}a=t.ownerDocument||t,r=Hf(r),(i=wf.get(i))&&Jf(r,i),a=a.createElement(`link`),yt(a);var o=a;o._p=new Promise(function(e,t){o.onload=e,o.onerror=t}),Gd(a,`link`,r),n.instance=a}e.stylesheets===null&&(e.stylesheets=new Map),e.stylesheets.set(n,t),(t=n.state.preload)&&!(n.state.loading&3)&&(e.count++,n=ip.bind(e),t.addEventListener(`load`,n),t.addEventListener(`error`,n))}}var np=0;function rp(e,t){return e.stylesheets&&e.count===0&&op(e,e.stylesheets),0<e.count||0<e.imgCount?function(n){var r=setTimeout(function(){if(e.stylesheets&&op(e,e.stylesheets),e.unsuspend){var t=e.unsuspend;e.unsuspend=null,t()}},6e4+t);0<e.imgBytes&&np===0&&(np=62500*Jd());var i=setTimeout(function(){if(e.waitingForImages=!1,e.count===0&&(e.stylesheets&&op(e,e.stylesheets),e.unsuspend)){var t=e.unsuspend;e.unsuspend=null,t()}},(e.imgBytes>np?50:800)+t);return e.unsuspend=n,function(){e.unsuspend=null,clearTimeout(r),clearTimeout(i)}}:null}function ip(){if(this.count--,this.count===0&&(this.imgCount===0||!this.waitingForImages)){if(this.stylesheets)op(this,this.stylesheets);else if(this.unsuspend){var e=this.unsuspend;this.unsuspend=null,e()}}}var ap=null;function op(e,t){e.stylesheets=null,e.unsuspend!==null&&(e.count++,ap=new Map,t.forEach(sp,e),ap=null,ip.call(e))}function sp(e,t){if(!(t.state.loading&4)){var n=ap.get(e);if(n)var r=n.get(null);else{n=new Map,ap.set(e,n);for(var i=e.querySelectorAll(`link[data-precedence],style[data-precedence]`),a=0;a<i.length;a++){var o=i[a];(o.nodeName===`LINK`||o.getAttribute(`media`)!==`not all`)&&(n.set(o.dataset.precedence,o),r=o)}r&&n.set(null,r)}i=t.instance,o=i.getAttribute(`data-precedence`),a=n.get(o)||r,a===r&&n.set(null,i),n.set(o,i),this.count++,r=ip.bind(this),i.addEventListener(`load`,r),i.addEventListener(`error`,r),a?a.parentNode.insertBefore(i,a.nextSibling):(e=e.nodeType===9?e.head:e,e.insertBefore(i,e.firstChild)),t.state.loading|=4}}var cp={$$typeof:C,Provider:null,Consumer:null,_currentValue:I,_currentValue2:I,_threadCount:0};function lp(e,t,n,r,i,a,o,s,c){this.tag=1,this.containerInfo=e,this.pingCache=this.current=this.pendingChildren=null,this.timeoutHandle=-1,this.callbackNode=this.next=this.pendingContext=this.context=this.cancelPendingCommit=null,this.callbackPriority=0,this.expirationTimes=Ze(-1),this.entangledLanes=this.shellSuspendCounter=this.errorRecoveryDisabledLanes=this.expiredLanes=this.warmLanes=this.pingedLanes=this.suspendedLanes=this.pendingLanes=0,this.entanglements=Ze(0),this.hiddenUpdates=Ze(null),this.identifierPrefix=r,this.onUncaughtError=i,this.onCaughtError=a,this.onRecoverableError=o,this.pooledCache=null,this.pooledCacheLanes=0,this.formState=c,this.incompleteTransitions=new Map}function up(e,t,n,r,i,a,o,s,c,l,u,d){return e=new lp(e,t,n,o,c,l,u,d,s),t=1,!0===a&&(t|=24),a=ci(3,null,null,t),e.current=a,a.stateNode=e,t=oa(),t.refCount++,e.pooledCache=t,t.refCount++,a.memoizedState={element:r,isDehydrated:n,cache:t},za(a),e}function dp(e){return e?(e=oi,e):oi}function fp(e,t,n,r,i,a){i=dp(i),r.context===null?r.context=i:r.pendingContext=i,r=Va(t),r.payload={element:n},a=a===void 0?null:a,a!==null&&(r.callback=a),n=Ha(e,r,t),n!==null&&(wu(n,e,t),Ua(n,e,t))}function pp(e,t){if(e=e.memoizedState,e!==null&&e.dehydrated!==null){var n=e.retryLane;e.retryLane=n!==0&&n<t?n:t}}function mp(e,t){pp(e,t),(e=e.alternate)&&pp(e,t)}function hp(e){if(e.tag===13||e.tag===31){var t=ri(e,67108864);t!==null&&wu(t,e,67108864),mp(e,67108864)}}function gp(e){if(e.tag===13||e.tag===31){var t=Su();t=nt(t);var n=ri(e,t);n!==null&&wu(n,e,t),mp(e,t)}}var _p=!0;function vp(e,t,n,r){var i=P.T;P.T=null;var a=F.p;try{F.p=2,bp(e,t,n,r)}finally{F.p=a,P.T=i}}function yp(e,t,n,r){var i=P.T;P.T=null;var a=F.p;try{F.p=8,bp(e,t,n,r)}finally{F.p=a,P.T=i}}function bp(e,t,n,r){if(_p){var i=xp(r);if(i===null)Pd(e,t,r,Sp,n),Np(e,r);else if(Fp(i,e,t,n,r))r.stopPropagation();else if(Np(e,r),t&4&&-1<Mp.indexOf(e)){for(;i!==null;){var a=gt(i);if(a!==null)switch(a.tag){case 3:if(a=a.stateNode,a.current.memoizedState.isDehydrated){var o=Ke(a.pendingLanes);if(o!==0){var s=a;for(s.pendingLanes|=2,s.entangledLanes|=2;o;){var c=1<<31-ze(o);s.entanglements[1]|=c,o&=~c}fd(a),!(Ul&6)&&(uu=De()+500,pd(0,!1))}}break;case 31:case 13:s=ri(a,2),s!==null&&wu(s,a,2),ku(),mp(a,2)}if(a=xp(r),a===null&&Pd(e,t,r,Sp,n),a===i)break;i=a}i!==null&&r.stopPropagation()}else Pd(e,t,r,null,n)}}function xp(e){return e=tn(e),Cp(e)}var Sp=null;function Cp(e){if(Sp=null,e=ht(e),e!==null){var t=o(e);if(t===null)e=null;else{var n=t.tag;if(n===13){if(e=s(t),e!==null)return e;e=null}else if(n===31){if(e=c(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 Sp=e,null}function wp(e){switch(e){case`beforetoggle`: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`toggle`: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 2;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`touchmove`:case`wheel`:case`mouseenter`:case`mouseleave`:case`pointerenter`:case`pointerleave`:return 8;case`message`:switch(Oe()){case ke:return 2;case Ae:return 8;case je:case Me:return 32;case Ne:return 268435456;default:return 32}default:return 32}}var Tp=!1,Ep=null,Dp=null,Op=null,kp=new Map,Ap=new Map,jp=[],Mp=`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`.split(` `);function Np(e,t){switch(e){case`focusin`:case`focusout`:Ep=null;break;case`dragenter`:case`dragleave`:Dp=null;break;case`mouseover`:case`mouseout`:Op=null;break;case`pointerover`:case`pointerout`:kp.delete(t.pointerId);break;case`gotpointercapture`:case`lostpointercapture`:Ap.delete(t.pointerId)}}function Pp(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=gt(t),t!==null&&hp(t)),e):(e.eventSystemFlags|=r,t=e.targetContainers,i!==null&&t.indexOf(i)===-1&&t.push(i),e)}function Fp(e,t,n,r,i){switch(t){case`focusin`:return Ep=Pp(Ep,e,t,n,r,i),!0;case`dragenter`:return Dp=Pp(Dp,e,t,n,r,i),!0;case`mouseover`:return Op=Pp(Op,e,t,n,r,i),!0;case`pointerover`:var a=i.pointerId;return kp.set(a,Pp(kp.get(a)||null,e,t,n,r,i)),!0;case`gotpointercapture`:return a=i.pointerId,Ap.set(a,Pp(Ap.get(a)||null,e,t,n,r,i)),!0}return!1}function Ip(e){var t=ht(e.target);if(t!==null){var n=o(t);if(n!==null){if(t=n.tag,t===13){if(t=s(n),t!==null){e.blockedOn=t,R(e.priority,function(){gp(n)});return}}else if(t===31){if(t=c(n),t!==null){e.blockedOn=t,R(e.priority,function(){gp(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 Lp(e){if(e.blockedOn!==null)return!1;for(var t=e.targetContainers;0<t.length;){var n=xp(e.nativeEvent);if(n===null){n=e.nativeEvent;var r=new n.constructor(n.type,n);en=r,n.target.dispatchEvent(r),en=null}else return t=gt(n),t!==null&&hp(t),e.blockedOn=n,!1;t.shift()}return!0}function Rp(e,t,n){Lp(e)&&n.delete(t)}function zp(){Tp=!1,Ep!==null&&Lp(Ep)&&(Ep=null),Dp!==null&&Lp(Dp)&&(Dp=null),Op!==null&&Lp(Op)&&(Op=null),kp.forEach(Rp),Ap.forEach(Rp)}function Bp(e,n){e.blockedOn===n&&(e.blockedOn=null,Tp||(Tp=!0,t.unstable_scheduleCallback(t.unstable_NormalPriority,zp)))}var Vp=null;function Hp(e){Vp!==e&&(Vp=e,t.unstable_scheduleCallback(t.unstable_NormalPriority,function(){Vp===e&&(Vp=null);for(var t=0;t<e.length;t+=3){var n=e[t],r=e[t+1],i=e[t+2];if(typeof r!=`function`){if(Cp(r||n)===null)continue;break}var a=gt(n);a!==null&&(e.splice(t,3),t-=3,Es(a,{pending:!0,data:i,method:n.method,action:r},r,i))}}))}function Up(e){function t(t){return Bp(t,e)}Ep!==null&&Bp(Ep,e),Dp!==null&&Bp(Dp,e),Op!==null&&Bp(Op,e),kp.forEach(t),Ap.forEach(t);for(var n=0;n<jp.length;n++){var r=jp[n];r.blockedOn===e&&(r.blockedOn=null)}for(;0<jp.length&&(n=jp[0],n.blockedOn===null);)Ip(n),n.blockedOn===null&&jp.shift();if(n=(e.ownerDocument||e).$$reactFormReplay,n!=null)for(r=0;r<n.length;r+=3){var i=n[r],a=n[r+1],o=i[st]||null;if(typeof a==`function`)o||Hp(n);else if(o){var s=null;if(a&&a.hasAttribute(`formAction`)){if(i=a,o=a[st]||null)s=o.formAction;else if(Cp(i)!==null)continue}else s=o.action;typeof s==`function`?n[r+1]=s:(n.splice(r,3),r-=3),Hp(n)}}}function Wp(){function e(e){e.canIntercept&&e.info===`react-transition`&&e.intercept({handler:function(){return new Promise(function(e){return i=e})},focusReset:`manual`,scroll:`manual`})}function t(){i!==null&&(i(),i=null),r||setTimeout(n,20)}function n(){if(!r&&!navigation.transition){var e=navigation.currentEntry;e&&e.url!=null&&navigation.navigate(e.url,{state:e.getState(),info:`react-transition`,history:`replace`})}}if(typeof navigation==`object`){var r=!1,i=null;return navigation.addEventListener(`navigate`,e),navigation.addEventListener(`navigatesuccess`,t),navigation.addEventListener(`navigateerror`,t),setTimeout(n,100),function(){r=!0,navigation.removeEventListener(`navigate`,e),navigation.removeEventListener(`navigatesuccess`,t),navigation.removeEventListener(`navigateerror`,t),i!==null&&(i(),i=null)}}}function Gp(e){this._internalRoot=e}Kp.prototype.render=Gp.prototype.render=function(e){var t=this._internalRoot;if(t===null)throw Error(i(409));var n=t.current;fp(n,Su(),e,t,null,null)},Kp.prototype.unmount=Gp.prototype.unmount=function(){var e=this._internalRoot;if(e!==null){this._internalRoot=null;var t=e.containerInfo;fp(e.current,2,null,e,null,null),ku(),t[ct]=null}};function Kp(e){this._internalRoot=e}Kp.prototype.unstable_scheduleHydration=function(e){if(e){var t=it();e={blockedOn:null,target:e,priority:t};for(var n=0;n<jp.length&&t!==0&&t<jp[n].priority;n++);jp.splice(n,0,e),n===0&&Ip(e)}};var qp=n.version;if(qp!==`19.2.8`)throw Error(i(527,qp,`19.2.8`));F.findDOMNode=function(e){var t=e._reactInternals;if(t===void 0)throw typeof e.render==`function`?Error(i(188)):(e=Object.keys(e).join(`,`),Error(i(268,e)));return e=u(t),e=e===null?null:d(e),e=e===null?null:e.stateNode,e};var Jp={bundleType:0,version:`19.2.8`,rendererPackageName:`react-dom`,currentDispatcherRef:P,reconcilerVersion:`19.2.8`};if(typeof __REACT_DEVTOOLS_GLOBAL_HOOK__<`u`){var Yp=__REACT_DEVTOOLS_GLOBAL_HOOK__;if(!Yp.isDisabled&&Yp.supportsFiber)try{Ie=Yp.inject(Jp),Le=Yp}catch{}}e.createRoot=function(e,t){if(!a(e))throw Error(i(299));var n=!1,r=``,o=Ys,s=Xs,c=Zs;return t!=null&&(!0===t.unstable_strictMode&&(n=!0),t.identifierPrefix!==void 0&&(r=t.identifierPrefix),t.onUncaughtError!==void 0&&(o=t.onUncaughtError),t.onCaughtError!==void 0&&(s=t.onCaughtError),t.onRecoverableError!==void 0&&(c=t.onRecoverableError)),t=up(e,1,!1,null,null,n,r,null,o,s,c,Wp),e[ct]=t.current,Md(e),new Gp(t)}})),v=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=_()})),y=function(){return y=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},y.apply(this,arguments)};function b(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 x(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 S=`right-scroll-bar-position`,C=`width-before-scroll-bar`,w=`with-scroll-bars-hidden`,T=`--removed-body-scroll-bar-size`;function E(e,t){return typeof e==`function`?e(t):e&&(e.current=t),e}var D=l(f());function O(e,t){var n=(0,D.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 k=typeof window<`u`?D.useLayoutEffect:D.useEffect,A=new WeakMap;function j(e,t){var n=O(t||null,function(t){return e.forEach(function(e){return E(e,t)})});return k(function(){var t=A.get(n);if(t){var r=new Set(t),i=new Set(e),a=n.current;r.forEach(function(e){i.has(e)||E(e,null)}),i.forEach(function(e){r.has(e)||E(e,a)})}A.set(n,e)},[e]),n}function M(e){return e}function N(e,t){t===void 0&&(t=M);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 ee(e){e===void 0&&(e={});var t=N(null);return t.options=y({async:!0,ssr:!1},e),t}var te=function(e){var t=e.sideCar,n=b(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 D.createElement(r,y({},n))};te.isSideCarExport=!0;function P(e,t){return e.useMedium(t),te}var F=ee(),I=function(){},ne=D.forwardRef(function(e,t){var n=D.useRef(null),r=D.useState({onScrollCapture:I,onWheelCapture:I,onTouchMoveCapture:I}),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,_=e.as,v=_===void 0?`div`:_,x=e.gapMode,S=b(e,[`forwardProps`,`children`,`className`,`removeScrollBar`,`enabled`,`shards`,`sideCar`,`noRelative`,`noIsolation`,`inert`,`allowPinchZoom`,`as`,`gapMode`]),C=f,w=j([n,t]),T=y(y({},S),i);return D.createElement(D.Fragment,null,u&&D.createElement(C,{sideCar:F,removeScrollBar:l,shards:d,noRelative:p,noIsolation:m,inert:h,setCallbacks:a,allowPinchZoom:!!g,lockRef:n,gapMode:x}),o?D.cloneElement(D.Children.only(s),y(y({},T),{ref:w})):D.createElement(v,y({},T,{className:c,ref:w}),s))});ne.defaultProps={enabled:!0,removeScrollBar:!0,inert:!1},ne.classNames={fullWidth:C,zeroRight:S};var re,ie=function(){if(re)return re;if(typeof __webpack_nonce__<`u`)return __webpack_nonce__};function ae(){if(!document)return null;var e=document.createElement(`style`);e.type=`text/css`;var t=ie();return t&&e.setAttribute(`nonce`,t),e}function oe(e,t){e.styleSheet?e.styleSheet.cssText=t:e.appendChild(document.createTextNode(t))}function se(e){(document.head||document.getElementsByTagName(`head`)[0]).appendChild(e)}var ce=function(){var e=0,t=null;return{add:function(n){e==0&&(t=ae())&&(oe(t,n),se(t)),e++},remove:function(){e--,!e&&t&&(t.parentNode&&t.parentNode.removeChild(t),t=null)}}},le=function(){var e=ce();return function(t,n){D.useEffect(function(){return e.add(t),function(){e.remove()}},[t&&n])}},ue=function(){var e=le();return function(t){var n=t.styles,r=t.dynamic;return e(n,r),null}},de={left:0,top:0,right:0,gap:0},fe=function(e){return parseInt(e||``,10)||0},pe=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[fe(n),fe(r),fe(i)]},me=function(e){if(e===void 0&&(e=`margin`),typeof window>`u`)return de;var t=pe(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])}},he=ue(),ge=`data-scroll-locked`,_e=function(e,t,n,r){var i=e.left,a=e.top,o=e.right,s=e.gap;return n===void 0&&(n=`margin`),`
11
- .${w} {
12
- overflow: hidden ${r};
13
- padding-right: ${s}px ${r};
14
- }
15
- body[${ge}] {
16
- overflow: hidden ${r};
17
- overscroll-behavior: contain;
18
- ${[t&&`position: relative ${r};`,n===`margin`&&`
19
- padding-left: ${i}px;
20
- padding-top: ${a}px;
21
- padding-right: ${o}px;
22
- margin-left:0;
23
- margin-top:0;
24
- margin-right: ${s}px ${r};
25
- `,n===`padding`&&`padding-right: ${s}px ${r};`].filter(Boolean).join(``)}
26
- }
27
-
28
- .${S} {
29
- right: ${s}px ${r};
30
- }
31
-
32
- .${C} {
33
- margin-right: ${s}px ${r};
34
- }
35
-
36
- .${S} .${S} {
37
- right: 0 ${r};
38
- }
39
-
40
- .${C} .${C} {
41
- margin-right: 0 ${r};
42
- }
43
-
44
- body[${ge}] {
45
- ${T}: ${s}px;
46
- }
47
- `},ve=function(){var e=parseInt(document.body.getAttribute(`data-scroll-locked`)||`0`,10);return isFinite(e)?e:0},ye=function(){D.useEffect(function(){return document.body.setAttribute(ge,(ve()+1).toString()),function(){var e=ve()-1;e<=0?document.body.removeAttribute(ge):document.body.setAttribute(ge,e.toString())}},[])},be=function(e){var t=e.noRelative,n=e.noImportant,r=e.gapMode,i=r===void 0?`margin`:r;ye();var a=D.useMemo(function(){return me(i)},[i]);return D.createElement(he,{styles:_e(a,!t,i,n?``:`!important`)})},xe=!1;if(typeof window<`u`)try{var Se=Object.defineProperty({},"passive",{get:function(){return xe=!0,!0}});window.addEventListener(`test`,Se,Se),window.removeEventListener(`test`,Se,Se)}catch{xe=!1}var Ce=xe?{passive:!1}:!1,we=function(e){return e.tagName===`TEXTAREA`},Te=function(e,t){if(!(e instanceof Element))return!1;var n=window.getComputedStyle(e);return n[t]!==`hidden`&&!(n.overflowY===n.overflowX&&!we(e)&&n[t]===`visible`)},Ee=function(e){return Te(e,`overflowY`)},De=function(e){return Te(e,`overflowX`)},Oe=function(e,t){var n=t.ownerDocument,r=t;do{if(typeof ShadowRoot<`u`&&r instanceof ShadowRoot&&(r=r.host),je(e,r)){var i=Me(e,r);if(i[1]>i[2])return!0}r=r.parentNode}while(r&&r!==n.body);return!1},ke=function(e){return[e.scrollTop,e.scrollHeight,e.clientHeight]},Ae=function(e){return[e.scrollLeft,e.scrollWidth,e.clientWidth]},je=function(e,t){return e===`v`?Ee(t):De(t)},Me=function(e,t){return e===`v`?ke(t):Ae(t)},Ne=function(e,t){return e===`h`&&t===`rtl`?-1:1},Pe=function(e,t,n,r,i){var a=Ne(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=Me(e,s),m=p[0],h=p[1]-p[2]-a*m;(m||h)&&je(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},Fe=function(e){return`changedTouches`in e?[e.changedTouches[0].clientX,e.changedTouches[0].clientY]:[0,0]},Ie=function(e){return[e.deltaX,e.deltaY]},Le=function(e){return e&&`current`in e?e.current:e},Re=function(e,t){return e[0]===t[0]&&e[1]===t[1]},ze=function(e){return`
48
- .block-interactivity-${e} {pointer-events: none;}
49
- .allow-interactivity-${e} {pointer-events: all;}
50
- `},Be=0,Ve=[];function He(e){var t=D.useRef([]),n=D.useRef([0,0]),r=D.useRef(),i=D.useState(Be++)[0],a=D.useState(ue)[0],o=D.useRef(e);D.useEffect(function(){o.current=e},[e]),D.useEffect(function(){if(e.inert){document.body.classList.add(`block-interactivity-${i}`);var t=x([e.lockRef.current],(e.shards||[]).map(Le),!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=D.useCallback(function(e,t){if(`touches`in e&&e.touches.length===2||e.type===`wheel`&&e.ctrlKey)return!o.current.allowPinchZoom;var i=Fe(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=Oe(d,u);if(!m)return!0;if(m?l=d:(l=d===`v`?`h`:`v`,m=Oe(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 Pe(h,t,e,h===`h`?s:c,!0)},[]),c=D.useCallback(function(e){var n=e;if(!(!Ve.length||Ve[Ve.length-1]!==a)){var r=`deltaY`in n?Ie(n):Fe(n),i=t.current.filter(function(e){return e.name===n.type&&(e.target===n.target||n.target===e.shadowParent)&&Re(e.delta,r)})[0];if(i&&i.should){n.cancelable&&n.preventDefault();return}if(!i){var c=(o.current.shards||[]).map(Le).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=D.useCallback(function(e,n,r,i){var a={name:e,delta:n,target:r,should:i,shadowParent:Ue(r)};t.current.push(a),setTimeout(function(){t.current=t.current.filter(function(e){return e!==a})},1)},[]),u=D.useCallback(function(e){n.current=Fe(e),r.current=void 0},[]),d=D.useCallback(function(t){l(t.type,Ie(t),t.target,s(t,e.lockRef.current))},[]),f=D.useCallback(function(t){l(t.type,Fe(t),t.target,s(t,e.lockRef.current))},[]);D.useEffect(function(){return Ve.push(a),e.setCallbacks({onScrollCapture:d,onWheelCapture:d,onTouchMoveCapture:f}),document.addEventListener(`wheel`,c,Ce),document.addEventListener(`touchmove`,c,Ce),document.addEventListener(`touchstart`,u,Ce),function(){Ve=Ve.filter(function(e){return e!==a}),document.removeEventListener(`wheel`,c,Ce),document.removeEventListener(`touchmove`,c,Ce),document.removeEventListener(`touchstart`,u,Ce)}},[]);var p=e.removeScrollBar,m=e.inert;return D.createElement(D.Fragment,null,m?D.createElement(a,{styles:ze(i)}):null,p?D.createElement(be,{noRelative:e.noRelative,gapMode:e.gapMode}):null)}function Ue(e){for(var t=null;e!==null;)e instanceof ShadowRoot&&(t=e.host,e=e.host),e=e.parentNode;return t}var We=P(F,He),Ge=D.forwardRef(function(e,t){return D.createElement(ne,y({},e,{ref:t,sideCar:We}))});Ge.classNames=ne.classNames;function Ke(e){return Object.keys(e)}function qe(e){return e&&typeof e==`object`&&!Array.isArray(e)}function Je(e,t){let n={...e},r=t;return qe(e)&&qe(t)&&Object.keys(t).forEach(t=>{qe(r[t])&&t in e?n[t]=Je(n[t],r[t]):n[t]=r[t]}),n}function Ye(e){return e.replace(/[A-Z]/g,e=>`-${e.toLowerCase()}`)}function Xe(e){return typeof e!=`string`||!e.includes(`var(--mantine-scale)`)?e:e.match(/^calc\((.*?)\)$/)?.[1].split(`*`)[0].trim()}function Ze(e){let t=Xe(e);return typeof t==`number`?t:typeof t==`string`?t.includes(`calc`)||t.includes(`var`)?t:t.includes(`px`)?Number(t.replace(`px`,``)):t.includes(`rem`)?Number(t.replace(`rem`,``))*16:t.includes(`em`)?Number(t.replace(`em`,``))*16:Number(t):NaN}function Qe(e){return e===`0rem`?`0rem`:`calc(${e} * var(--mantine-scale))`}function $e(e,{shouldScale:t=!1}={}){function n(r){if(r===0||r===`0`)return`0${e}`;if(typeof r==`number`){let n=`${r/16}${e}`;return t?Qe(n):n}if(typeof r==`string`){if(r===``||r.startsWith(`calc(`)||r.startsWith(`clamp(`)||r.includes(`rgba(`))return r;if(r.includes(`,`))return r.split(`,`).map(e=>n(e)).join(`,`);if(r.includes(` `))return r.split(` `).map(e=>n(e)).join(` `);let i=r.replace(`px`,``);if(!Number.isNaN(Number(i))){let n=`${Number(i)/16}${e}`;return t?Qe(n):n}}return r}return n}var L=$e(`rem`,{shouldScale:!0}),et=$e(`em`);function tt(e){return Object.keys(e).reduce((t,n)=>(e[n]!==void 0&&(t[n]=e[n]),t),{})}function nt(e){if(typeof e==`number`)return!0;if(typeof e==`string`){if(e.startsWith(`calc(`)||e.startsWith(`var(`)||e.includes(` `)&&e.trim()!==``)return!0;let t=/^[+-]?[0-9]+(\.[0-9]+)?(px|em|rem|ex|ch|lh|rlh|vw|vh|vmin|vmax|vb|vi|svw|svh|lvw|lvh|dvw|dvh|cm|mm|in|pt|pc|q|cqw|cqh|cqi|cqb|cqmin|cqmax|%)?$/;return e.trim().split(/\s+/).every(e=>t.test(e))}return!1}function rt(e){return Array.isArray(e)||e===null?!1:typeof e==`object`&&e.type!==D.Fragment}var it=o((e=>{var t=Symbol.for(`react.transitional.element`),n=Symbol.for(`react.fragment`);function r(e,n,r){var i=null;if(r!==void 0&&(i=``+r),n.key!==void 0&&(i=``+n.key),`key`in n)for(var a in r={},n)a!==`key`&&(r[a]=n[a]);else r=n;return n=r.ref,{$$typeof:t,type:e,key:i,ref:n===void 0?null:n,props:r}}e.Fragment=n,e.jsx=r,e.jsxs=r})),R=o(((e,t)=>{t.exports=it()}))();function at(e){let t=(0,D.createContext)(null);return[({children:e,value:n})=>(0,R.jsx)(t.Provider,{value:n,children:e}),()=>{let n=(0,D.useContext)(t);if(n===null)throw Error(e);return n}]}function ot(e=null){let t=(0,D.createContext)(e);return[({children:e,value:n})=>(0,R.jsx)(t.Provider,{value:n,children:e}),()=>(0,D.useContext)(t)]}function st(e,t){return n=>{if(typeof n!=`string`||n.trim().length===0)throw Error(t);return`${e}-${n}`}}function ct(e,t){let n=e;for(;(n=n.parentElement)&&!n.matches(t););return n}function lt(e,t,n){for(let n=e-1;n>=0;--n)if(!t[n].disabled)return n;if(n){for(let e=t.length-1;e>-1;--e)if(!t[e].disabled)return e}return e}function ut(e,t,n){for(let n=e+1;n<t.length;n+=1)if(!t[n].disabled)return n;if(n){for(let e=0;e<t.length;e+=1)if(!t[e].disabled)return e}return e}function dt(e,t,n){return ct(e,n)===ct(t,n)}function ft({parentSelector:e,siblingSelector:t,onKeyDown:n,loop:r=!0,activateOnFocus:i=!1,dir:a=`rtl`,orientation:o}){return s=>{n?.(s);let c=Array.from(ct(s.currentTarget,e)?.querySelectorAll(t)||[]).filter(t=>dt(s.currentTarget,t,e)),l=c.findIndex(e=>s.currentTarget===e),u=ut(l,c,r),d=lt(l,c,r),f=a===`rtl`?d:u,p=a===`rtl`?u:d;switch(s.key){case`ArrowRight`:o===`horizontal`&&(s.stopPropagation(),s.preventDefault(),c[f].focus(),i&&c[f].click());break;case`ArrowLeft`:o===`horizontal`&&(s.stopPropagation(),s.preventDefault(),c[p].focus(),i&&c[p].click());break;case`ArrowUp`:o===`vertical`&&(s.stopPropagation(),s.preventDefault(),c[d].focus(),i&&c[d].click());break;case`ArrowDown`:o===`vertical`&&(s.stopPropagation(),s.preventDefault(),c[u].focus(),i&&c[u].click());break;case`Home`:s.stopPropagation(),s.preventDefault(),!c[0].disabled&&c[0].focus();break;case`End`:{s.stopPropagation(),s.preventDefault();let e=c.length-1;!c[e].disabled&&c[e].focus();break}}}}var pt={app:100,modal:200,popover:300,overlay:400,max:9999};function mt(e){return pt[e]}var ht=()=>{};function gt(e,t={active:!0}){return typeof e!=`function`||!t.active?t.onKeyDown||ht:n=>{n.key===`Escape`&&(e(n),t.onTrigger?.())}}function _t(e,t=`size`,n=!0){if(e!==void 0)return nt(e)?n?L(e):e:`var(--${t}-${e})`}function vt(e){return _t(e,`mantine-spacing`)}function yt(e){return e===void 0?`var(--mantine-radius-default)`:_t(e,`mantine-radius`)}function bt(e){return _t(e,`mantine-font-size`)}function xt(e){return _t(e,`mantine-line-height`,!1)}function St(e){if(e)return _t(e,`mantine-shadow`,!1)}function Ct(e,t){return n=>{e?.(n),t?.(n)}}function wt(e,t){return e in t?Ze(t[e]):Ze(e)}function Tt(e,t){let n=e.map(e=>({value:e,px:wt(e,t)}));return n.sort((e,t)=>e.px-t.px),n}function Et(e){return typeof e==`object`&&e?`base`in e?e.base:void 0:e}function Dt(e,t,n){return n?Array.from(ct(n,t)?.querySelectorAll(e)||[]).findIndex(e=>e===n):null}function Ot(e,t,n){return t===void 0&&n===void 0?e:t!==void 0&&n===void 0?Math.max(e,t):Math.min(t===void 0&&n!==void 0?e:Math.max(e,t),n)}function kt(e=`mantine-`){return`${e}${Math.random().toString(36).slice(2,11)}`}function At(e,t){if(e===t||Number.isNaN(e)&&Number.isNaN(t))return!0;if(!(e instanceof Object)||!(t instanceof Object))return!1;let n=Object.keys(e),{length:r}=n;if(r!==Object.keys(t).length)return!1;for(let i=0;i<r;i+=1){let r=n[i];if(!(r in t)||e[r]!==t[r]&&!(Number.isNaN(e[r])&&Number.isNaN(t[r])))return!1}return!0}function jt(e){let t=(0,D.useRef)(e);return(0,D.useEffect)(()=>{t.current=e}),(0,D.useMemo)(()=>((...e)=>t.current?.(...e)),[])}function Mt(e,t){let{delay:n,flushOnUnmount:r,leading:i}=typeof t==`number`?{delay:t,flushOnUnmount:!1,leading:!1}:t,a=jt(e),o=(0,D.useRef)(0),s=(0,D.useMemo)(()=>{let e=Object.assign((...t)=>{window.clearTimeout(o.current);let r=e._isFirstCall;e._isFirstCall=!1;function s(){window.clearTimeout(o.current),o.current=0,e._isFirstCall=!0}if(i&&r){a(...t),e.flush=()=>{o.current!==0&&(s(),a(...t))},e.cancel=()=>{s()},o.current=window.setTimeout(()=>{s()},n);return}if(i&&!r){e.flush=()=>{o.current!==0&&(s(),a(...t))},e.cancel=()=>{s()},o.current=window.setTimeout(()=>{s()},n);return}let c=()=>{o.current!==0&&(s(),a(...t))};e.flush=c,e.cancel=()=>{s()},o.current=window.setTimeout(c,n)},{flush:()=>{},cancel:()=>{},_isFirstCall:!0});return e},[a,n,i]);return(0,D.useEffect)(()=>()=>{r?s.flush():s.cancel()},[s,r]),s}var Nt=[`mousedown`,`touchstart`];function Pt(e,t,n){let r=(0,D.useRef)(null),i=t||Nt;return(0,D.useEffect)(()=>{let t=t=>{let{target:i}=t??{};if(Array.isArray(n)){let r=!document.body.contains(i)&&i?.tagName!==`HTML`;n.every(e=>!!e&&!t.composedPath().includes(e))&&!r&&e(t)}else r.current&&!r.current.contains(i)&&e(t)};return i.forEach(e=>document.addEventListener(e,t)),()=>{i.forEach(e=>document.removeEventListener(e,t))}},[r,e,n]),r}function Ft(e={timeout:2e3}){let[t,n]=(0,D.useState)(null),[r,i]=(0,D.useState)(!1),[a,o]=(0,D.useState)(null),s=t=>{window.clearTimeout(a),o(window.setTimeout(()=>i(!1),e.timeout)),i(t)};return{copy:e=>{`clipboard`in navigator?navigator.clipboard.writeText(e).then(()=>s(!0)).catch(e=>n(e)):n(Error(`useClipboard: navigator.clipboard is not supported`))},reset:()=>{i(!1),n(null),window.clearTimeout(a)},error:t,copied:r}}function It(e,t){try{return e.addEventListener(`change`,t),()=>e.removeEventListener(`change`,t)}catch{return e.addListener(t),()=>e.removeListener(t)}}function Lt(e,t){return typeof window<`u`&&`matchMedia`in window&&window.matchMedia(e).matches}function Rt(e,t,{getInitialValueInEffect:n}={getInitialValueInEffect:!0}){let[r,i]=(0,D.useState)(n?t:Lt(e));return(0,D.useEffect)(()=>{try{let t=window.matchMedia(e);return i(t.matches),It(t,e=>i(e.matches))}catch{return}},[e]),r||!1}function zt(e,t){return Rt(`(prefers-color-scheme: dark)`,e===`dark`,t)?`dark`:`light`}var Bt=typeof document<`u`?D.useLayoutEffect:D.useEffect;function Vt(e,t){let n=(0,D.useRef)(!1);(0,D.useEffect)(()=>()=>{n.current=!1},[]),(0,D.useEffect)(()=>{if(n.current)return e();n.current=!0},t)}function Ht({opened:e,shouldReturnFocus:t=!0}){let n=(0,D.useRef)(null),r=()=>{n.current&&`focus`in n.current&&typeof n.current.focus==`function`&&n.current?.focus({preventScroll:!0})};return Vt(()=>{let i=-1,a=e=>{e.key===`Tab`&&window.clearTimeout(i)};return document.addEventListener(`keydown`,a),e?n.current=document.activeElement:t&&(i=window.setTimeout(r,10)),()=>{window.clearTimeout(i),document.removeEventListener(`keydown`,a)}},[e,t]),r}var Ut=/input|select|textarea|button|object/,Wt=`a, input, select, textarea, button, object, [tabindex]`;function Gt(e){return e.style.display===`none`}function Kt(e){if(e.getAttribute(`aria-hidden`)||e.getAttribute(`hidden`)||e.getAttribute(`type`)===`hidden`)return!1;let t=e;for(;t&&t!==document.body&&t.nodeType!==11;){if(Gt(t))return!1;t=t.parentNode}return!0}function qt(e){let t=e.getAttribute(`tabindex`);return t===null&&(t=void 0),parseInt(t,10)}function Jt(e){let t=e.nodeName.toLowerCase(),n=!Number.isNaN(qt(e));return(Ut.test(t)&&!e.disabled||e instanceof HTMLAnchorElement&&e.href||n)&&Kt(e)}function Yt(e){let t=qt(e);return(Number.isNaN(t)||t>=0)&&Jt(e)}function Xt(e){return Array.from(e.querySelectorAll(Wt)).filter(Yt)}function Zt(e,t){let n=Xt(e);if(!n.length){t.preventDefault();return}let r=n[t.shiftKey?0:n.length-1],i=e.getRootNode(),a=r===i.activeElement||e===i.activeElement,o=i.activeElement;if(o.tagName===`INPUT`&&o.getAttribute(`type`)===`radio`&&(a=n.filter(e=>e.getAttribute(`type`)===`radio`&&e.getAttribute(`name`)===o.getAttribute(`name`)).includes(r)),!a)return;t.preventDefault();let s=n[t.shiftKey?n.length-1:0];s&&s.focus()}function Qt(e=!0){let t=(0,D.useRef)(null),n=e=>{let t=e.querySelector(`[data-autofocus]`);if(!t){let n=Array.from(e.querySelectorAll(Wt));t=n.find(Yt)||n.find(Jt)||null,!t&&Jt(e)&&(t=e)}t&&t.focus({preventScroll:!0})},r=(0,D.useCallback)(r=>{e&&r!==null&&t.current!==r&&(r?(setTimeout(()=>{r.getRootNode()&&n(r)}),t.current=r):t.current=null)},[e]);return(0,D.useEffect)(()=>{if(!e)return;t.current&&setTimeout(()=>n(t.current));let r=e=>{e.key===`Tab`&&t.current&&Zt(t.current,e)};return document.addEventListener(`keydown`,r),()=>document.removeEventListener(`keydown`,r)},[e]),r}var $t=e=>(e+1)%1e6;function en(){let[,e]=(0,D.useReducer)($t,0);return e}var tn=D.default.useId||(()=>void 0);function nn(){let e=tn();return e?`mantine-${e.replace(/:/g,``)}`:``}function rn(e){let t=nn(),[n,r]=(0,D.useState)(t);return Bt(()=>{r(kt())},[]),typeof e==`string`?e:typeof window>`u`?t:n}function an(e,t,n){(0,D.useEffect)(()=>(window.addEventListener(e,t,n),()=>window.removeEventListener(e,t,n)),[e,t])}function on(e,t=`use-local-storage`){try{return JSON.stringify(e)}catch{throw Error(`@mantine/hooks ${t}: Failed to serialize the value`)}}function sn(e){try{return e&&JSON.parse(e)}catch{return e}}function cn(e){return{getItem:t=>{try{return window[e].getItem(t)}catch{return console.warn(`use-local-storage: Failed to get value from storage, localStorage is blocked`),null}},setItem:(t,n)=>{try{window[e].setItem(t,n)}catch{console.warn(`use-local-storage: Failed to set value to storage, localStorage is blocked`)}},removeItem:t=>{try{window[e].removeItem(t)}catch{console.warn(`use-local-storage: Failed to remove value from storage, localStorage is blocked`)}}}}function ln(e,t){let n=e===`localStorage`?`mantine-local-storage`:`mantine-session-storage`,{getItem:r,setItem:i,removeItem:a}=cn(e);return function({key:o,defaultValue:s,getInitialValueInEffect:c=!0,sync:l=!0,deserialize:u=sn,serialize:d=e=>on(e,t)}){let f=(0,D.useCallback)(t=>{let n;try{n=typeof window>`u`||!(e in window)||window[e]===null||!!t}catch{n=!0}if(n)return s;let i=r(o);return i===null?s:u(i)},[o,s]),[p,m]=(0,D.useState)(f(c)),h=(0,D.useCallback)(e=>{e instanceof Function?m(t=>{let r=e(t);return i(o,d(r)),queueMicrotask(()=>{window.dispatchEvent(new CustomEvent(n,{detail:{key:o,value:e(t)}}))}),r}):(i(o,d(e)),window.dispatchEvent(new CustomEvent(n,{detail:{key:o,value:e}})),m(e))},[o]),g=(0,D.useCallback)(()=>{a(o),m(s),window.dispatchEvent(new CustomEvent(n,{detail:{key:o,value:s}}))},[o,s]);return an(`storage`,t=>{l&&t.storageArea===window[e]&&t.key===o&&m(u(t.newValue??void 0))}),an(n,e=>{l&&e.detail.key===o&&m(e.detail.value)}),(0,D.useEffect)(()=>{s!==void 0&&p===void 0&&h(s)},[s,p,h]),(0,D.useEffect)(()=>{let e=f();e!==void 0&&h(e)},[o]),[p===void 0?s:p,h,g]}}function un(e){let{getItem:t}=cn(e);return function({key:n,defaultValue:r,deserialize:i=sn}){let a;try{a=typeof window>`u`||!(e in window)||window[e]===null}catch{a=!0}if(a)return r;let o=t(n);return o===null?r:i(o)}}function dn(e){return ln(`localStorage`,`use-local-storage`)(e)}un(`localStorage`);function fn(e,t){if(typeof e==`function`)return e(t);typeof e==`object`&&e&&`current`in e&&(e.current=t)}function pn(...e){let t=new Map;return n=>{if(e.forEach(e=>{let r=fn(e,n);r&&t.set(e,r)}),t.size>0)return()=>{e.forEach(e=>{let n=t.get(e);n&&typeof n==`function`?n():fn(e,null)}),t.clear()}}}function mn(...e){return(0,D.useCallback)(pn(...e),e)}function hn({value:e,defaultValue:t,finalValue:n,onChange:r=()=>{}}){let[i,a]=(0,D.useState)(t===void 0?n:t);return e===void 0?[i,(e,...t)=>{a(e),r?.(e,...t)},!1]:[e,r,!0]}function gn(e,t){return Rt(`(prefers-reduced-motion: reduce)`,e,t)}function _n(e,t){if(!e||!t)return!1;if(e===t)return!0;if(e.length!==t.length)return!1;for(let n=0;n<e.length;n+=1)if(!At(e[n],t[n]))return!1;return!0}function vn(e){let t=(0,D.useRef)([]),n=(0,D.useRef)(0);return _n(t.current,e)||(t.current=e,n.current+=1),[n.current]}function yn(e,t){(0,D.useEffect)(e,vn(t))}function bn(e=!1,t={}){let[n,r]=(0,D.useState)(e),i=(0,D.useCallback)(()=>{r(e=>e||(t.onOpen?.(),!0))},[t.onOpen]),a=(0,D.useCallback)(()=>{r(e=>e&&(t.onClose?.(),!1))},[t.onClose]);return[n,{open:i,close:a,toggle:(0,D.useCallback)(()=>{n?a():i()},[a,i,n])}]}function xn(e,t,n={autoInvoke:!1}){let r=(0,D.useRef)(null),i=(0,D.useCallback)((...n)=>{r.current||=window.setTimeout(()=>{e(n),r.current=null},t)},[t]),a=(0,D.useCallback)(()=>{r.current&&=(window.clearTimeout(r.current),null)},[]);return(0,D.useEffect)(()=>(n.autoInvoke&&i(),a),[a,i]),{start:i,clear:a}}function Sn(e){let t=(0,D.useRef)(void 0);return(0,D.useEffect)(()=>{t.current=e},[e]),t.current}function Cn(e,t,n){let r=(0,D.useRef)(null),i=(0,D.useRef)(null);return(0,D.useEffect)(()=>{let a=typeof n==`function`?n():n;return(a||i.current)&&(r.current=new MutationObserver(e),r.current.observe(a||i.current,t)),()=>{r.current?.disconnect()}},[e,t]),i}function wn(){let[e,t]=(0,D.useState)(!1);return(0,D.useEffect)(()=>t(!0),[]),e}function Tn(){return typeof process<`u`?`production`:`development`}function En(e){return e?.props?.ref}function Dn(e,t=document){let n=t.querySelector(e);if(n)return n;let r=t.querySelectorAll(`*`);for(let t=0;t<r.length;t+=1){let n=r[t];if(n.shadowRoot){let t=Dn(e,n.shadowRoot);if(t)return t}}return null}function On(e,t=document){let n=[],r=t.querySelectorAll(e);n.push(...Array.from(r));let i=t.querySelectorAll(`*`);for(let t=0;t<i.length;t+=1){let r=i[t];if(r.shadowRoot){let t=On(e,r.shadowRoot);n.push(...t)}}return n}function kn(e){if(!e)return document;let t=e.getRootNode();return t instanceof ShadowRoot||t instanceof Document?t:document}function An(e){let t=D.Children.toArray(e);return t.length!==1||!rt(t[0])?null:t[0]}function jn(e){return e}function Mn(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=Mn(e[t]))&&(r&&(r+=` `),r+=n)}else for(n in e)e[n]&&(r&&(r+=` `),r+=n);return r}function Nn(){for(var e,t,n=0,r=``,i=arguments.length;n<i;n++)(e=arguments[n])&&(t=Mn(e))&&(r&&(r+=` `),r+=t);return r}var Pn={};function Fn(e){let t={};return e.forEach(e=>{Object.entries(e).forEach(([e,n])=>{t[e]?t[e]=Nn(t[e],n):t[e]=n})}),t}function In({theme:e,classNames:t,props:n,stylesCtx:r}){return Fn((Array.isArray(t)?t:[t]).map(t=>typeof t==`function`?t(e,n,r):t||Pn))}function Ln({theme:e,styles:t,props:n,stylesCtx:r}){return(Array.isArray(t)?t:[t]).reduce((t,i)=>typeof i==`function`?{...t,...i(e,n,r)}:{...t,...i},{})}var Rn=(0,D.createContext)(null);function zn(){let e=(0,D.useContext)(Rn);if(!e)throw Error(`[@mantine/core] MantineProvider was not found in tree`);return e}function Bn(){return zn().cssVariablesResolver}function Vn(){return zn().classNamesPrefix}function Hn(){return zn().getStyleNonce}function Un(){return zn().withStaticClasses}function Wn(){return zn().headless}function Gn(){return zn().stylesTransform?.sx}function Kn(){return zn().stylesTransform?.styles}function qn(){return zn().env||`default`}function Jn(e){return/^#?([0-9A-F]{3}){1,2}([0-9A-F]{2})?$/i.test(e)}function Yn(e){let t=e.replace(`#`,``);if(t.length===3){let e=t.split(``);t=[e[0],e[0],e[1],e[1],e[2],e[2]].join(``)}if(t.length===8){let e=parseInt(t.slice(6,8),16)/255;return{r:parseInt(t.slice(0,2),16),g:parseInt(t.slice(2,4),16),b:parseInt(t.slice(4,6),16),a:e}}let n=parseInt(t,16);return{r:n>>16&255,g:n>>8&255,b:n&255,a:1}}function Xn(e){let[t,n,r,i]=e.replace(/[^0-9,./]/g,``).split(/[/,]/).map(Number);return{r:t,g:n,b:r,a:i===void 0?1:i}}function Zn(e){let t=e.match(/^hsla?\(\s*(\d+)\s*,\s*(\d+%)\s*,\s*(\d+%)\s*(,\s*(0?\.\d+|\d+(\.\d+)?))?\s*\)$/i);if(!t)return{r:0,g:0,b:0,a:1};let n=parseInt(t[1],10),r=parseInt(t[2],10)/100,i=parseInt(t[3],10)/100,a=t[5]?parseFloat(t[5]):void 0,o=(1-Math.abs(2*i-1))*r,s=n/60,c=o*(1-Math.abs(s%2-1)),l=i-o/2,u,d,f;return s>=0&&s<1?(u=o,d=c,f=0):s>=1&&s<2?(u=c,d=o,f=0):s>=2&&s<3?(u=0,d=o,f=c):s>=3&&s<4?(u=0,d=c,f=o):s>=4&&s<5?(u=c,d=0,f=o):(u=o,d=0,f=c),{r:Math.round((u+l)*255),g:Math.round((d+l)*255),b:Math.round((f+l)*255),a:a||1}}function Qn(e){return Jn(e)?Yn(e):e.startsWith(`rgb`)?Xn(e):e.startsWith(`hsl`)?Zn(e):{r:0,g:0,b:0,a:1}}function $n(e,t){if(e.startsWith(`var(`))return`color-mix(in srgb, ${e}, black ${t*100}%)`;let{r:n,g:r,b:i,a}=Qn(e),o=1-t,s=e=>Math.round(e*o);return`rgba(${s(n)}, ${s(r)}, ${s(i)}, ${a})`}function er(e,t){return typeof e.primaryShade==`number`?e.primaryShade:t===`dark`?e.primaryShade.dark:e.primaryShade.light}function tr(e){return e<=.03928?e/12.92:((e+.055)/1.055)**2.4}function nr(e){let t=e.match(/oklch\((.*?)%\s/);return t?parseFloat(t[1]):null}function rr(e){if(e.startsWith(`oklch(`))return(nr(e)||0)/100;let{r:t,g:n,b:r}=Qn(e),i=t/255,a=n/255,o=r/255,s=tr(i),c=tr(a),l=tr(o);return .2126*s+.7152*c+.0722*l}function ir(e,t=.179){return!e.startsWith(`var(`)&&rr(e)>t}function ar({color:e,theme:t,colorScheme:n}){if(typeof e!=`string`)throw Error(`[@mantine/core] Failed to parse color. Expected color to be a string, instead got ${typeof e}`);if(e===`bright`)return{color:e,value:n===`dark`?t.white:t.black,shade:void 0,isThemeColor:!1,isLight:ir(n===`dark`?t.white:t.black,t.luminanceThreshold),variable:`--mantine-color-bright`};if(e===`dimmed`)return{color:e,value:n===`dark`?t.colors.dark[2]:t.colors.gray[7],shade:void 0,isThemeColor:!1,isLight:ir(n===`dark`?t.colors.dark[2]:t.colors.gray[6],t.luminanceThreshold),variable:`--mantine-color-dimmed`};if(e===`white`||e===`black`)return{color:e,value:e===`white`?t.white:t.black,shade:void 0,isThemeColor:!1,isLight:ir(e===`white`?t.white:t.black,t.luminanceThreshold),variable:`--mantine-color-${e}`};let[r,i]=e.split(`.`),a=i?Number(i):void 0,o=r in t.colors;if(o){let e=a===void 0?t.colors[r][er(t,n||`light`)]:t.colors[r][a];return{color:r,value:e,shade:a,isThemeColor:o,isLight:ir(e,t.luminanceThreshold),variable:i?`--mantine-color-${r}-${a}`:`--mantine-color-${r}-filled`}}return{color:e,value:e,isThemeColor:o,isLight:ir(e,t.luminanceThreshold),shade:a,variable:void 0}}function or(e,t){let n=ar({color:e||t.primaryColor,theme:t});return n.variable?`var(${n.variable})`:e}function sr(e,t){let n={from:e?.from||t.defaultGradient.from,to:e?.to||t.defaultGradient.to,deg:e?.deg??t.defaultGradient.deg??0},r=or(n.from,t),i=or(n.to,t);return`linear-gradient(${n.deg}deg, ${r} 0%, ${i} 100%)`}function cr(e,t){if(typeof e!=`string`||t>1||t<0)return`rgba(0, 0, 0, 1)`;if(e.startsWith(`var(`))return`color-mix(in srgb, ${e}, transparent ${(1-t)*100}%)`;if(e.startsWith(`oklch`))return e.includes(`/`)?e.replace(/\/\s*[\d.]+\s*\)/,`/ ${t})`):e.replace(`)`,` / ${t})`);let{r:n,g:r,b:i}=Qn(e);return`rgba(${n}, ${r}, ${i}, ${t})`}var lr=cr,ur=({color:e,theme:t,variant:n,gradient:r,autoContrast:i})=>{let a=ar({color:e,theme:t}),o=typeof i==`boolean`?i:t.autoContrast;if(n===`none`)return{background:`transparent`,hover:`transparent`,color:`inherit`,border:`none`};if(n===`filled`){let t=o&&a.isLight?`var(--mantine-color-black)`:`var(--mantine-color-white)`;return a.isThemeColor?a.shade===void 0?{background:`var(--mantine-color-${e}-filled)`,hover:`var(--mantine-color-${e}-filled-hover)`,color:t,border:`${L(1)} solid transparent`}:{background:`var(--mantine-color-${a.color}-${a.shade})`,hover:`var(--mantine-color-${a.color}-${a.shade===9?8:a.shade+1})`,color:t,border:`${L(1)} solid transparent`}:{background:e,hover:$n(e,.1),color:t,border:`${L(1)} solid transparent`}}if(n===`light`){if(a.isThemeColor){if(a.shade===void 0)return{background:`var(--mantine-color-${e}-light)`,hover:`var(--mantine-color-${e}-light-hover)`,color:`var(--mantine-color-${e}-light-color)`,border:`${L(1)} solid transparent`};let n=t.colors[a.color][a.shade];return{background:cr(n,.1),hover:cr(n,.12),color:`var(--mantine-color-${a.color}-${Math.min(a.shade,6)})`,border:`${L(1)} solid transparent`}}return{background:cr(e,.1),hover:cr(e,.12),color:e,border:`${L(1)} solid transparent`}}if(n===`outline`)return a.isThemeColor?a.shade===void 0?{background:`transparent`,hover:`var(--mantine-color-${e}-outline-hover)`,color:`var(--mantine-color-${e}-outline)`,border:`${L(1)} solid var(--mantine-color-${e}-outline)`}:{background:`transparent`,hover:cr(t.colors[a.color][a.shade],.05),color:`var(--mantine-color-${a.color}-${a.shade})`,border:`${L(1)} solid var(--mantine-color-${a.color}-${a.shade})`}:{background:`transparent`,hover:cr(e,.05),color:e,border:`${L(1)} solid ${e}`};if(n===`subtle`){if(a.isThemeColor){if(a.shade===void 0)return{background:`transparent`,hover:`var(--mantine-color-${e}-light-hover)`,color:`var(--mantine-color-${e}-light-color)`,border:`${L(1)} solid transparent`};let n=t.colors[a.color][a.shade];return{background:`transparent`,hover:cr(n,.12),color:`var(--mantine-color-${a.color}-${Math.min(a.shade,6)})`,border:`${L(1)} solid transparent`}}return{background:`transparent`,hover:cr(e,.12),color:e,border:`${L(1)} solid transparent`}}return n===`transparent`?a.isThemeColor?a.shade===void 0?{background:`transparent`,hover:`transparent`,color:`var(--mantine-color-${e}-light-color)`,border:`${L(1)} solid transparent`}:{background:`transparent`,hover:`transparent`,color:`var(--mantine-color-${a.color}-${Math.min(a.shade,6)})`,border:`${L(1)} solid transparent`}:{background:`transparent`,hover:`transparent`,color:e,border:`${L(1)} solid transparent`}:n===`white`?a.isThemeColor?a.shade===void 0?{background:`var(--mantine-color-white)`,hover:$n(t.white,.01),color:`var(--mantine-color-${e}-filled)`,border:`${L(1)} solid transparent`}:{background:`var(--mantine-color-white)`,hover:$n(t.white,.01),color:`var(--mantine-color-${a.color}-${a.shade})`,border:`${L(1)} solid transparent`}:{background:`var(--mantine-color-white)`,hover:$n(t.white,.01),color:e,border:`${L(1)} solid transparent`}:n===`gradient`?{background:sr(r,t),hover:sr(r,t),color:`var(--mantine-color-white)`,border:`none`}:n==="default"?{background:`var(--mantine-color-default)`,hover:`var(--mantine-color-default-hover)`,color:`var(--mantine-color-default-color)`,border:`${L(1)} solid var(--mantine-color-default-border)`}:{}},dr={dark:[`#C9C9C9`,`#b8b8b8`,`#828282`,`#696969`,`#424242`,`#3b3b3b`,`#2e2e2e`,`#242424`,`#1f1f1f`,`#141414`],gray:[`#f8f9fa`,`#f1f3f5`,`#e9ecef`,`#dee2e6`,`#ced4da`,`#adb5bd`,`#868e96`,`#495057`,`#343a40`,`#212529`],red:[`#fff5f5`,`#ffe3e3`,`#ffc9c9`,`#ffa8a8`,`#ff8787`,`#ff6b6b`,`#fa5252`,`#f03e3e`,`#e03131`,`#c92a2a`],pink:[`#fff0f6`,`#ffdeeb`,`#fcc2d7`,`#faa2c1`,`#f783ac`,`#f06595`,`#e64980`,`#d6336c`,`#c2255c`,`#a61e4d`],grape:[`#f8f0fc`,`#f3d9fa`,`#eebefa`,`#e599f7`,`#da77f2`,`#cc5de8`,`#be4bdb`,`#ae3ec9`,`#9c36b5`,`#862e9c`],violet:[`#f3f0ff`,`#e5dbff`,`#d0bfff`,`#b197fc`,`#9775fa`,`#845ef7`,`#7950f2`,`#7048e8`,`#6741d9`,`#5f3dc4`],indigo:[`#edf2ff`,`#dbe4ff`,`#bac8ff`,`#91a7ff`,`#748ffc`,`#5c7cfa`,`#4c6ef5`,`#4263eb`,`#3b5bdb`,`#364fc7`],blue:[`#e7f5ff`,`#d0ebff`,`#a5d8ff`,`#74c0fc`,`#4dabf7`,`#339af0`,`#228be6`,`#1c7ed6`,`#1971c2`,`#1864ab`],cyan:[`#e3fafc`,`#c5f6fa`,`#99e9f2`,`#66d9e8`,`#3bc9db`,`#22b8cf`,`#15aabf`,`#1098ad`,`#0c8599`,`#0b7285`],teal:[`#e6fcf5`,`#c3fae8`,`#96f2d7`,`#63e6be`,`#38d9a9`,`#20c997`,`#12b886`,`#0ca678`,`#099268`,`#087f5b`],green:[`#ebfbee`,`#d3f9d8`,`#b2f2bb`,`#8ce99a`,`#69db7c`,`#51cf66`,`#40c057`,`#37b24d`,`#2f9e44`,`#2b8a3e`],lime:[`#f4fce3`,`#e9fac8`,`#d8f5a2`,`#c0eb75`,`#a9e34b`,`#94d82d`,`#82c91e`,`#74b816`,`#66a80f`,`#5c940d`],yellow:[`#fff9db`,`#fff3bf`,`#ffec99`,`#ffe066`,`#ffd43b`,`#fcc419`,`#fab005`,`#f59f00`,`#f08c00`,`#e67700`],orange:[`#fff4e6`,`#ffe8cc`,`#ffd8a8`,`#ffc078`,`#ffa94d`,`#ff922b`,`#fd7e14`,`#f76707`,`#e8590c`,`#d9480f`]},fr=`-apple-system, BlinkMacSystemFont, Segoe UI, Roboto, Helvetica, Arial, sans-serif, Apple Color Emoji, Segoe UI Emoji`,pr={scale:1,fontSmoothing:!0,focusRing:`auto`,white:`#fff`,black:`#000`,colors:dr,primaryShade:{light:6,dark:8},primaryColor:`blue`,variantColorResolver:ur,autoContrast:!1,luminanceThreshold:.3,fontFamily:fr,fontFamilyMonospace:`ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, Liberation Mono, Courier New, monospace`,respectReducedMotion:!1,cursorType:`default`,defaultGradient:{from:`blue`,to:`cyan`,deg:45},defaultRadius:`sm`,activeClassName:`mantine-active`,focusClassName:``,headings:{fontFamily:fr,fontWeight:`700`,textWrap:`wrap`,sizes:{h1:{fontSize:L(34),lineHeight:`1.3`},h2:{fontSize:L(26),lineHeight:`1.35`},h3:{fontSize:L(22),lineHeight:`1.4`},h4:{fontSize:L(18),lineHeight:`1.45`},h5:{fontSize:L(16),lineHeight:`1.5`},h6:{fontSize:L(14),lineHeight:`1.5`}}},fontSizes:{xs:L(12),sm:L(14),md:L(16),lg:L(18),xl:L(20)},lineHeights:{xs:`1.4`,sm:`1.45`,md:`1.55`,lg:`1.6`,xl:`1.65`},radius:{xs:L(2),sm:L(4),md:L(8),lg:L(16),xl:L(32)},spacing:{xs:L(10),sm:L(12),md:L(16),lg:L(20),xl:L(32)},breakpoints:{xs:`36em`,sm:`48em`,md:`62em`,lg:`75em`,xl:`88em`},shadows:{xs:`0 ${L(1)} ${L(3)} rgba(0, 0, 0, 0.05), 0 ${L(1)} ${L(2)} rgba(0, 0, 0, 0.1)`,sm:`0 ${L(1)} ${L(3)} rgba(0, 0, 0, 0.05), rgba(0, 0, 0, 0.05) 0 ${L(10)} ${L(15)} ${L(-5)}, rgba(0, 0, 0, 0.04) 0 ${L(7)} ${L(7)} ${L(-5)}`,md:`0 ${L(1)} ${L(3)} rgba(0, 0, 0, 0.05), rgba(0, 0, 0, 0.05) 0 ${L(20)} ${L(25)} ${L(-5)}, rgba(0, 0, 0, 0.04) 0 ${L(10)} ${L(10)} ${L(-5)}`,lg:`0 ${L(1)} ${L(3)} rgba(0, 0, 0, 0.05), rgba(0, 0, 0, 0.05) 0 ${L(28)} ${L(23)} ${L(-7)}, rgba(0, 0, 0, 0.04) 0 ${L(12)} ${L(12)} ${L(-7)}`,xl:`0 ${L(1)} ${L(3)} rgba(0, 0, 0, 0.05), rgba(0, 0, 0, 0.05) 0 ${L(36)} ${L(28)} ${L(-7)}, rgba(0, 0, 0, 0.04) 0 ${L(17)} ${L(17)} ${L(-7)}`},other:{},components:{}};function mr(e){return e===`auto`||e===`dark`||e===`light`}function hr({key:e=`mantine-color-scheme-value`}={}){let t;return{get:t=>{if(typeof window>`u`)return t;try{let n=window.localStorage.getItem(e);return mr(n)?n:t}catch{return t}},set:t=>{try{window.localStorage.setItem(e,t)}catch(e){console.warn(`[@mantine/core] Local storage color scheme manager was unable to save color scheme.`,e)}},subscribe:n=>{t=t=>{t.storageArea===window.localStorage&&t.key===e&&mr(t.newValue)&&n(t.newValue)},window.addEventListener(`storage`,t)},unsubscribe:()=>{window.removeEventListener(`storage`,t)},clear:()=>{window.localStorage.removeItem(e)}}}var gr=`[@mantine/core] MantineProvider: Invalid theme.primaryColor, it accepts only key of theme.colors, learn more – https://mantine.dev/theming/colors/#primary-color`,_r=`[@mantine/core] MantineProvider: Invalid theme.primaryShade, it accepts only 0-9 integers or an object { light: 0-9, dark: 0-9 }`;function vr(e){return e<0||e>9?!1:parseInt(e.toString(),10)===e}function yr(e){if(!(e.primaryColor in e.colors))throw Error(gr);if(typeof e.primaryShade==`object`&&(!vr(e.primaryShade.dark)||!vr(e.primaryShade.light))||typeof e.primaryShade==`number`&&!vr(e.primaryShade))throw Error(_r)}function br(e,t){if(!t)return yr(e),e;let n=Je(e,t);return t.fontFamily&&!t.headings?.fontFamily&&(n.headings.fontFamily=t.fontFamily),yr(n),n}var xr=(0,D.createContext)(null),Sr=()=>(0,D.useContext)(xr)||pr;function Cr(){let e=(0,D.useContext)(xr);if(!e)throw Error(`@mantine/core: MantineProvider was not found in component tree, make sure you have it in your app`);return e}function wr({theme:e,children:t,inherit:n=!0}){let r=Sr(),i=(0,D.useMemo)(()=>br(n?r:pr,e),[e,r,n]);return(0,R.jsx)(xr.Provider,{value:i,children:t})}wr.displayName=`@mantine/core/MantineThemeProvider`;function Tr(){let e=Cr(),t=Hn(),n=Ke(e.breakpoints).reduce((t,n)=>{let r=e.breakpoints[n].includes(`px`),i=Ze(e.breakpoints[n]);return`${t}@media (max-width: ${r?`${i-.1}px`:et(i-.1)}) {.mantine-visible-from-${n} {display: none !important;}}@media (min-width: ${r?`${i}px`:et(i)}) {.mantine-hidden-from-${n} {display: none !important;}}`},``);return(0,R.jsx)(`style`,{"data-mantine-styles":`classes`,nonce:t?.(),dangerouslySetInnerHTML:{__html:n}})}function Er(e){return Object.entries(e).map(([e,t])=>`${e}: ${t};`).join(``)}function Dr(e,t){let n=t?[t]:[`:root`,`:host`],r=Er(e.variables),i=r?`${n.join(`, `)}{${r}}`:``,a=Er(e.dark),o=Er(e.light),s=e=>n.map(t=>t===`:host`?`${t}([data-mantine-color-scheme="${e}"])`:`${t}[data-mantine-color-scheme="${e}"]`).join(`, `);return`${i}
51
-
52
- ${a?`${s(`dark`)}{${a}}`:``}
53
-
54
- ${o?`${s(`light`)}{${o}}`:``}`}function Or({color:e,theme:t,autoContrast:n}){return(typeof n==`boolean`?n:t.autoContrast)&&ar({color:e||t.primaryColor,theme:t}).isLight?`var(--mantine-color-black)`:`var(--mantine-color-white)`}function kr(e,t){return Or({color:e.colors[e.primaryColor][er(e,t)],theme:e,autoContrast:null})}function Ar({theme:e,color:t,colorScheme:n,name:r=t,withColorValues:i=!0}){if(!e.colors[t])return{};if(n===`light`){let n=er(e,`light`),a={[`--mantine-color-${r}-text`]:`var(--mantine-color-${r}-filled)`,[`--mantine-color-${r}-filled`]:`var(--mantine-color-${r}-${n})`,[`--mantine-color-${r}-filled-hover`]:`var(--mantine-color-${r}-${n===9?8:n+1})`,[`--mantine-color-${r}-light`]:lr(e.colors[t][n],.1),[`--mantine-color-${r}-light-hover`]:lr(e.colors[t][n],.12),[`--mantine-color-${r}-light-color`]:`var(--mantine-color-${r}-${n})`,[`--mantine-color-${r}-outline`]:`var(--mantine-color-${r}-${n})`,[`--mantine-color-${r}-outline-hover`]:lr(e.colors[t][n],.05)};return i?{[`--mantine-color-${r}-0`]:e.colors[t][0],[`--mantine-color-${r}-1`]:e.colors[t][1],[`--mantine-color-${r}-2`]:e.colors[t][2],[`--mantine-color-${r}-3`]:e.colors[t][3],[`--mantine-color-${r}-4`]:e.colors[t][4],[`--mantine-color-${r}-5`]:e.colors[t][5],[`--mantine-color-${r}-6`]:e.colors[t][6],[`--mantine-color-${r}-7`]:e.colors[t][7],[`--mantine-color-${r}-8`]:e.colors[t][8],[`--mantine-color-${r}-9`]:e.colors[t][9],...a}:a}let a=er(e,`dark`),o={[`--mantine-color-${r}-text`]:`var(--mantine-color-${r}-4)`,[`--mantine-color-${r}-filled`]:`var(--mantine-color-${r}-${a})`,[`--mantine-color-${r}-filled-hover`]:`var(--mantine-color-${r}-${a===9?8:a+1})`,[`--mantine-color-${r}-light`]:lr(e.colors[t][Math.max(0,a-2)],.15),[`--mantine-color-${r}-light-hover`]:lr(e.colors[t][Math.max(0,a-2)],.2),[`--mantine-color-${r}-light-color`]:`var(--mantine-color-${r}-${Math.max(a-5,0)})`,[`--mantine-color-${r}-outline`]:`var(--mantine-color-${r}-${Math.max(a-4,0)})`,[`--mantine-color-${r}-outline-hover`]:lr(e.colors[t][Math.max(a-4,0)],.05)};return i?{[`--mantine-color-${r}-0`]:e.colors[t][0],[`--mantine-color-${r}-1`]:e.colors[t][1],[`--mantine-color-${r}-2`]:e.colors[t][2],[`--mantine-color-${r}-3`]:e.colors[t][3],[`--mantine-color-${r}-4`]:e.colors[t][4],[`--mantine-color-${r}-5`]:e.colors[t][5],[`--mantine-color-${r}-6`]:e.colors[t][6],[`--mantine-color-${r}-7`]:e.colors[t][7],[`--mantine-color-${r}-8`]:e.colors[t][8],[`--mantine-color-${r}-9`]:e.colors[t][9],...o}:o}function jr(e){return!!e&&typeof e==`object`&&`mantine-virtual-color`in e}function Mr(e,t,n){Ke(t).forEach(r=>Object.assign(e,{[`--mantine-${n}-${r}`]:t[r]}))}var Nr=e=>{let t=er(e,`light`),n=e.defaultRadius in e.radius?e.radius[e.defaultRadius]:L(e.defaultRadius),r={variables:{"--mantine-z-index-app":`100`,"--mantine-z-index-modal":`200`,"--mantine-z-index-popover":`300`,"--mantine-z-index-overlay":`400`,"--mantine-z-index-max":`9999`,"--mantine-scale":e.scale.toString(),"--mantine-cursor-type":e.cursorType,"--mantine-webkit-font-smoothing":e.fontSmoothing?`antialiased`:`unset`,"--mantine-moz-font-smoothing":e.fontSmoothing?`grayscale`:`unset`,"--mantine-color-white":e.white,"--mantine-color-black":e.black,"--mantine-line-height":e.lineHeights.md,"--mantine-font-family":e.fontFamily,"--mantine-font-family-monospace":e.fontFamilyMonospace,"--mantine-font-family-headings":e.headings.fontFamily,"--mantine-heading-font-weight":e.headings.fontWeight,"--mantine-heading-text-wrap":e.headings.textWrap,"--mantine-radius-default":n,"--mantine-primary-color-filled":`var(--mantine-color-${e.primaryColor}-filled)`,"--mantine-primary-color-filled-hover":`var(--mantine-color-${e.primaryColor}-filled-hover)`,"--mantine-primary-color-light":`var(--mantine-color-${e.primaryColor}-light)`,"--mantine-primary-color-light-hover":`var(--mantine-color-${e.primaryColor}-light-hover)`,"--mantine-primary-color-light-color":`var(--mantine-color-${e.primaryColor}-light-color)`},light:{"--mantine-color-scheme":`light`,"--mantine-primary-color-contrast":kr(e,`light`),"--mantine-color-bright":`var(--mantine-color-black)`,"--mantine-color-text":e.black,"--mantine-color-body":e.white,"--mantine-color-error":`var(--mantine-color-red-6)`,"--mantine-color-placeholder":`var(--mantine-color-gray-5)`,"--mantine-color-anchor":`var(--mantine-color-${e.primaryColor}-${t})`,"--mantine-color-default":`var(--mantine-color-white)`,"--mantine-color-default-hover":`var(--mantine-color-gray-0)`,"--mantine-color-default-color":`var(--mantine-color-black)`,"--mantine-color-default-border":`var(--mantine-color-gray-4)`,"--mantine-color-dimmed":`var(--mantine-color-gray-6)`,"--mantine-color-disabled":`var(--mantine-color-gray-2)`,"--mantine-color-disabled-color":`var(--mantine-color-gray-5)`,"--mantine-color-disabled-border":`var(--mantine-color-gray-3)`},dark:{"--mantine-color-scheme":`dark`,"--mantine-primary-color-contrast":kr(e,`dark`),"--mantine-color-bright":`var(--mantine-color-white)`,"--mantine-color-text":`var(--mantine-color-dark-0)`,"--mantine-color-body":`var(--mantine-color-dark-7)`,"--mantine-color-error":`var(--mantine-color-red-8)`,"--mantine-color-placeholder":`var(--mantine-color-dark-3)`,"--mantine-color-anchor":`var(--mantine-color-${e.primaryColor}-4)`,"--mantine-color-default":`var(--mantine-color-dark-6)`,"--mantine-color-default-hover":`var(--mantine-color-dark-5)`,"--mantine-color-default-color":`var(--mantine-color-white)`,"--mantine-color-default-border":`var(--mantine-color-dark-4)`,"--mantine-color-dimmed":`var(--mantine-color-dark-2)`,"--mantine-color-disabled":`var(--mantine-color-dark-6)`,"--mantine-color-disabled-color":`var(--mantine-color-dark-3)`,"--mantine-color-disabled-border":`var(--mantine-color-dark-4)`}};Mr(r.variables,e.breakpoints,`breakpoint`),Mr(r.variables,e.spacing,`spacing`),Mr(r.variables,e.fontSizes,`font-size`),Mr(r.variables,e.lineHeights,`line-height`),Mr(r.variables,e.shadows,`shadow`),Mr(r.variables,e.radius,`radius`),e.colors[e.primaryColor].forEach((t,n)=>{r.variables[`--mantine-primary-color-${n}`]=`var(--mantine-color-${e.primaryColor}-${n})`}),Ke(e.colors).forEach(t=>{let n=e.colors[t];if(jr(n)){Object.assign(r.light,Ar({theme:e,name:n.name,color:n.light,colorScheme:`light`,withColorValues:!0})),Object.assign(r.dark,Ar({theme:e,name:n.name,color:n.dark,colorScheme:`dark`,withColorValues:!0}));return}n.forEach((e,n)=>{r.variables[`--mantine-color-${t}-${n}`]=e}),Object.assign(r.light,Ar({theme:e,color:t,colorScheme:`light`,withColorValues:!1})),Object.assign(r.dark,Ar({theme:e,color:t,colorScheme:`dark`,withColorValues:!1}))});let i=e.headings.sizes;return Ke(i).forEach(t=>{r.variables[`--mantine-${t}-font-size`]=i[t].fontSize,r.variables[`--mantine-${t}-line-height`]=i[t].lineHeight,r.variables[`--mantine-${t}-font-weight`]=i[t].fontWeight||e.headings.fontWeight}),r};function Pr({theme:e,generator:t}){let n=Nr(e),r=t?.(e);return r?Je(n,r):n}var Fr=Nr(pr);function Ir(e){let t={variables:{},light:{},dark:{}};return Ke(e.variables).forEach(n=>{Fr.variables[n]!==e.variables[n]&&(t.variables[n]=e.variables[n])}),Ke(e.light).forEach(n=>{Fr.light[n]!==e.light[n]&&(t.light[n]=e.light[n])}),Ke(e.dark).forEach(n=>{Fr.dark[n]!==e.dark[n]&&(t.dark[n]=e.dark[n])}),t}function Lr(e){return Dr({variables:{},dark:{"--mantine-color-scheme":`dark`},light:{"--mantine-color-scheme":`light`}},e)}function Rr({cssVariablesSelector:e,deduplicateCssVariables:t}){let n=Cr(),r=Hn(),i=Pr({theme:n,generator:Bn()}),a=(e===void 0||e===`:root`||e===`:host`)&&t,o=Dr(a?Ir(i):i,e);return o?(0,R.jsx)(`style`,{"data-mantine-styles":!0,nonce:r?.(),dangerouslySetInnerHTML:{__html:`${o}${a?``:Lr(e)}`}}):null}Rr.displayName=`@mantine/CssVariables`;function zr(e,t){let n=typeof window<`u`&&`matchMedia`in window&&window.matchMedia(`(prefers-color-scheme: dark)`)?.matches,r=e===`auto`?n?`dark`:`light`:e;t()?.setAttribute(`data-mantine-color-scheme`,r)}function Br({manager:e,defaultColorScheme:t,getRootElement:n,forceColorScheme:r}){let i=(0,D.useRef)(null),[a,o]=(0,D.useState)(()=>e.get(t)),s=r||a,c=(0,D.useCallback)(t=>{r||(zr(t,n),o(t),e.set(t))},[e.set,s,r]),l=(0,D.useCallback)(()=>{o(t),zr(t,n),e.clear()},[e.clear,t]);return(0,D.useEffect)(()=>(e.subscribe(c),e.unsubscribe),[e.subscribe,e.unsubscribe]),Bt(()=>{zr(e.get(t),n)},[]),(0,D.useEffect)(()=>{if(r)return zr(r,n),()=>{};r===void 0&&zr(a,n),typeof window<`u`&&`matchMedia`in window&&(i.current=window.matchMedia(`(prefers-color-scheme: dark)`));let e=e=>{a===`auto`&&zr(e.matches?`dark`:`light`,n)};return i.current?.addEventListener(`change`,e),()=>i.current?.removeEventListener(`change`,e)},[a,r]),{colorScheme:s,setColorScheme:c,clearColorScheme:l}}function Vr({respectReducedMotion:e,getRootElement:t}){Bt(()=>{e&&t()?.setAttribute(`data-respect-reduced-motion`,`true`)},[e])}function Hr({theme:e,children:t,getStyleNonce:n,withStaticClasses:r=!0,withGlobalClasses:i=!0,deduplicateCssVariables:a=!0,withCssVariables:o=!0,cssVariablesSelector:s,classNamesPrefix:c=`mantine`,colorSchemeManager:l=hr(),defaultColorScheme:u=`light`,getRootElement:d=()=>document.documentElement,cssVariablesResolver:f,forceColorScheme:p,stylesTransform:m,env:h}){let{colorScheme:g,setColorScheme:_,clearColorScheme:v}=Br({defaultColorScheme:u,forceColorScheme:p,manager:l,getRootElement:d});return Vr({respectReducedMotion:e?.respectReducedMotion||!1,getRootElement:d}),(0,R.jsx)(Rn.Provider,{value:{colorScheme:g,setColorScheme:_,clearColorScheme:v,getRootElement:d,classNamesPrefix:c,getStyleNonce:n,cssVariablesResolver:f,cssVariablesSelector:s??`:root`,withStaticClasses:r,stylesTransform:m,env:h},children:(0,R.jsxs)(wr,{theme:e,children:[o&&(0,R.jsx)(Rr,{cssVariablesSelector:s,deduplicateCssVariables:a}),i&&(0,R.jsx)(Tr,{}),t]})})}Hr.displayName=`@mantine/core/MantineProvider`;function Ur({classNames:e,styles:t,props:n,stylesCtx:r}){let i=Cr();return{resolvedClassNames:In({theme:i,classNames:e,props:n,stylesCtx:r||void 0}),resolvedStyles:Ln({theme:i,styles:t,props:n,stylesCtx:r||void 0})}}var Wr={always:`mantine-focus-always`,auto:`mantine-focus-auto`,never:`mantine-focus-never`};function Gr({theme:e,options:t,unstyled:n}){return Nn(t?.focusable&&!n&&(e.focusClassName||Wr[e.focusRing]),t?.active&&!n&&e.activeClassName)}function Kr({selector:e,stylesCtx:t,options:n,props:r,theme:i}){return In({theme:i,classNames:n?.classNames,props:n?.props||r,stylesCtx:t})[e]}function qr({selector:e,stylesCtx:t,theme:n,classNames:r,props:i}){return In({theme:n,classNames:r,props:i,stylesCtx:t})[e]}function Jr({rootSelector:e,selector:t,className:n}){return e===t?n:void 0}function Yr({selector:e,classes:t,unstyled:n}){return n?void 0:t[e]}function Xr({themeName:e,classNamesPrefix:t,selector:n,withStaticClass:r}){return r===!1?[]:e.map(e=>`${t}-${e}-${n}`)}function Zr({themeName:e,theme:t,selector:n,props:r,stylesCtx:i}){return e.map(e=>In({theme:t,classNames:t.components[e]?.classNames,props:r,stylesCtx:i})?.[n])}function Qr({options:e,classes:t,selector:n,unstyled:r}){return e?.variant&&!r?t[`${n}--${e.variant}`]:void 0}function $r({theme:e,options:t,themeName:n,selector:r,classNamesPrefix:i,classNames:a,classes:o,unstyled:s,className:c,rootSelector:l,props:u,stylesCtx:d,withStaticClasses:f,headless:p,transformedStyles:m}){return Nn(Gr({theme:e,options:t,unstyled:s||p}),Zr({theme:e,themeName:n,selector:r,props:u,stylesCtx:d}),Qr({options:t,classes:o,selector:r,unstyled:s}),qr({selector:r,stylesCtx:d,theme:e,classNames:a,props:u}),qr({selector:r,stylesCtx:d,theme:e,classNames:m,props:u}),Kr({selector:r,stylesCtx:d,options:t,props:u,theme:e}),Jr({rootSelector:l,selector:r,className:c}),Yr({selector:r,classes:o,unstyled:s||p}),f&&!p&&Xr({themeName:n,classNamesPrefix:i,selector:r,withStaticClass:t?.withStaticClass}),t?.className)}function ei({theme:e,themeName:t,props:n,stylesCtx:r,selector:i}){return t.map(t=>Ln({theme:e,styles:e.components[t]?.styles,props:n,stylesCtx:r})[i]).reduce((e,t)=>({...e,...t}),{})}function ti({style:e,theme:t}){return Array.isArray(e)?[...e].reduce((e,n)=>({...e,...ti({style:n,theme:t})}),{}):typeof e==`function`?e(t):e??{}}function ni(e){return e.reduce((e,t)=>(t&&Object.keys(t).forEach(n=>{e[n]={...e[n],...tt(t[n])}}),e),{})}function ri({vars:e,varsResolver:t,theme:n,props:r,stylesCtx:i,selector:a,themeName:o,headless:s}){return ni([s?{}:t?.(n,r,i),...o.map(e=>n.components?.[e]?.vars?.(n,r,i)),e?.(n,r,i)])?.[a]}function ii({theme:e,themeName:t,selector:n,options:r,props:i,stylesCtx:a,rootSelector:o,styles:s,style:c,vars:l,varsResolver:u,headless:d,withStylesTransform:f}){return{...!f&&ei({theme:e,themeName:t,props:i,stylesCtx:a,selector:n}),...!f&&Ln({theme:e,styles:s,props:i,stylesCtx:a})[n],...!f&&Ln({theme:e,styles:r?.styles,props:r?.props||i,stylesCtx:a})[n],...ri({theme:e,props:i,stylesCtx:a,vars:l,varsResolver:u,selector:n,themeName:t,headless:d}),...o===n?ti({style:c,theme:e}):null,...ti({style:r?.style,theme:e})}}function ai({props:e,stylesCtx:t,themeName:n}){let r=Cr(),i=Kn()?.();return{getTransformedStyles:a=>i?[...a.map(n=>i(n,{props:e,theme:r,ctx:t})),...n.map(n=>i(r.components[n]?.styles,{props:e,theme:r,ctx:t}))].filter(Boolean):[],withStylesTransform:!!i}}function oi({name:e,classes:t,props:n,stylesCtx:r,className:i,style:a,rootSelector:o=`root`,unstyled:s,classNames:c,styles:l,vars:u,varsResolver:d,attributes:f}){let p=Cr(),m=Vn(),h=Un(),g=Wn(),_=(Array.isArray(e)?e:[e]).filter(e=>e),{withStylesTransform:v,getTransformedStyles:y}=ai({props:n,stylesCtx:r,themeName:_});return(e,b)=>({className:$r({theme:p,options:b,themeName:_,selector:e,classNamesPrefix:m,classNames:c,classes:t,unstyled:s,className:i,rootSelector:o,props:n,stylesCtx:r,withStaticClasses:h,headless:g,transformedStyles:y([b?.styles,l])}),style:ii({theme:p,themeName:_,selector:e,options:b,props:n,stylesCtx:r,rootSelector:o,styles:l,style:a,vars:u,varsResolver:d,headless:g,withStylesTransform:v}),...f?.[e]})}function si(e,t){return typeof e==`boolean`?e:t.autoContrast}function ci(e){let t=document.createElement(`style`);return t.setAttribute(`data-mantine-styles`,`inline`),t.innerHTML=`*, *::before, *::after {transition: none !important;}`,t.setAttribute(`data-mantine-disable-transition`,`true`),e&&t.setAttribute(`nonce`,e),document.head.appendChild(t),()=>document.querySelectorAll(`[data-mantine-disable-transition]`).forEach(e=>e.remove())}function li({keepTransitions:e}={}){let t=(0,D.useRef)(ht),n=(0,D.useRef)(-1),r=(0,D.useContext)(Rn),i=Hn(),a=(0,D.useRef)(i?.());if(!r)throw Error(`[@mantine/core] MantineProvider was not found in tree`);let o=i=>{r.setColorScheme(i),t.current=e?()=>{}:ci(a.current),window.clearTimeout(n.current),n.current=window.setTimeout(()=>{t.current?.()},10)},s=()=>{r.clearColorScheme(),t.current=e?()=>{}:ci(a.current),window.clearTimeout(n.current),n.current=window.setTimeout(()=>{t.current?.()},10)},c=zt(`light`,{getInitialValueInEffect:!1}),l=r.colorScheme===`auto`?c:r.colorScheme,u=(0,D.useCallback)(()=>o(l===`light`?`dark`:`light`),[o,l]);return(0,D.useEffect)(()=>()=>{t.current?.(),window.clearTimeout(n.current)},[]),{colorScheme:r.colorScheme,setColorScheme:o,clearColorScheme:s,toggleColorScheme:u}}function ui(e,t={getInitialValueInEffect:!0}){let n=zt(e,t),{colorScheme:r}=li();return r===`auto`?n:r}function z(e,t,n){let r=Cr(),i=r.components[e]?.defaultProps,a=typeof i==`function`?i(r):i;return{...t,...a,...tt(n)}}function di(e){return e}function fi(e){return Ke(e).reduce((t,n)=>e[n]===void 0?t:`${t}${Ye(n)}:${e[n]};`,``).trim()}function pi({selector:e,styles:t,media:n,container:r}){let i=t?fi(t):``,a=Array.isArray(n)?n.map(t=>`@media${t.query}{${e}{${fi(t.styles)}}}`):[],o=Array.isArray(r)?r.map(t=>`@container ${t.query}{${e}{${fi(t.styles)}}}`):[];return`${i?`${e}{${i}}`:``}${a.join(``)}${o.join(``)}`.trim()}function mi(e){let t=Hn();return(0,R.jsx)(`style`,{"data-mantine-styles":`inline`,nonce:t?.(),dangerouslySetInnerHTML:{__html:pi(e)}})}function hi(e){let{m:t,mx:n,my:r,mt:i,mb:a,ml:o,mr:s,me:c,ms:l,p:u,px:d,py:f,pt:p,pb:m,pl:h,pr:g,pe:_,ps:v,bd:y,bdrs:b,bg:x,c:S,opacity:C,ff:w,fz:T,fw:E,lts:D,ta:O,lh:k,fs:A,tt:j,td:M,w:N,miw:ee,maw:te,h:P,mih:F,mah:I,bgsz:ne,bgp:re,bgr:ie,bga:ae,pos:oe,top:se,left:ce,bottom:le,right:ue,inset:de,display:fe,flex:pe,hiddenFrom:me,visibleFrom:he,lightHidden:ge,darkHidden:_e,sx:ve,...ye}=e;return{styleProps:tt({m:t,mx:n,my:r,mt:i,mb:a,ml:o,mr:s,me:c,ms:l,p:u,px:d,py:f,pt:p,pb:m,pl:h,pr:g,pe:_,ps:v,bd:y,bg:x,c:S,opacity:C,ff:w,fz:T,fw:E,lts:D,ta:O,lh:k,fs:A,tt:j,td:M,w:N,miw:ee,maw:te,h:P,mih:F,mah:I,bgsz:ne,bgp:re,bgr:ie,bga:ae,pos:oe,top:se,left:ce,bottom:le,right:ue,inset:de,display:fe,flex:pe,bdrs:b,hiddenFrom:me,visibleFrom:he,lightHidden:ge,darkHidden:_e,sx:ve}),rest:ye}}var gi={m:{type:`spacing`,property:`margin`},mt:{type:`spacing`,property:`marginTop`},mb:{type:`spacing`,property:`marginBottom`},ml:{type:`spacing`,property:`marginLeft`},mr:{type:`spacing`,property:`marginRight`},ms:{type:`spacing`,property:`marginInlineStart`},me:{type:`spacing`,property:`marginInlineEnd`},mx:{type:`spacing`,property:`marginInline`},my:{type:`spacing`,property:`marginBlock`},p:{type:`spacing`,property:`padding`},pt:{type:`spacing`,property:`paddingTop`},pb:{type:`spacing`,property:`paddingBottom`},pl:{type:`spacing`,property:`paddingLeft`},pr:{type:`spacing`,property:`paddingRight`},ps:{type:`spacing`,property:`paddingInlineStart`},pe:{type:`spacing`,property:`paddingInlineEnd`},px:{type:`spacing`,property:`paddingInline`},py:{type:`spacing`,property:`paddingBlock`},bd:{type:`border`,property:`border`},bdrs:{type:`radius`,property:`borderRadius`},bg:{type:`color`,property:`background`},c:{type:`textColor`,property:`color`},opacity:{type:`identity`,property:`opacity`},ff:{type:`fontFamily`,property:`fontFamily`},fz:{type:`fontSize`,property:`fontSize`},fw:{type:`identity`,property:`fontWeight`},lts:{type:`size`,property:`letterSpacing`},ta:{type:`identity`,property:`textAlign`},lh:{type:`lineHeight`,property:`lineHeight`},fs:{type:`identity`,property:`fontStyle`},tt:{type:`identity`,property:`textTransform`},td:{type:`identity`,property:`textDecoration`},w:{type:`spacing`,property:`width`},miw:{type:`spacing`,property:`minWidth`},maw:{type:`spacing`,property:`maxWidth`},h:{type:`spacing`,property:`height`},mih:{type:`spacing`,property:`minHeight`},mah:{type:`spacing`,property:`maxHeight`},bgsz:{type:`size`,property:`backgroundSize`},bgp:{type:`identity`,property:`backgroundPosition`},bgr:{type:`identity`,property:`backgroundRepeat`},bga:{type:`identity`,property:`backgroundAttachment`},pos:{type:`identity`,property:`position`},top:{type:`size`,property:`top`},left:{type:`size`,property:`left`},bottom:{type:`size`,property:`bottom`},right:{type:`size`,property:`right`},inset:{type:`size`,property:`inset`},display:{type:`identity`,property:`display`},flex:{type:`identity`,property:`flex`}};function _i(e,t){let n=ar({color:e,theme:t});return n.color===`dimmed`?`var(--mantine-color-dimmed)`:n.color===`bright`?`var(--mantine-color-bright)`:n.variable?`var(${n.variable})`:n.color}function vi(e,t){let n=ar({color:e,theme:t});return n.isThemeColor&&n.shade===void 0?`var(--mantine-color-${n.color}-text)`:_i(e,t)}function yi(e,t){if(typeof e==`number`)return L(e);if(typeof e==`string`){let[n,r,...i]=e.split(` `).filter(e=>e.trim()!==``),a=`${L(n)}`;return r&&(a+=` ${r}`),i.length>0&&(a+=` ${_i(i.join(` `),t)}`),a.trim()}return e}var bi={text:`var(--mantine-font-family)`,mono:`var(--mantine-font-family-monospace)`,monospace:`var(--mantine-font-family-monospace)`,heading:`var(--mantine-font-family-headings)`,headings:`var(--mantine-font-family-headings)`};function xi(e){return typeof e==`string`&&e in bi?bi[e]:e}var Si=[`h1`,`h2`,`h3`,`h4`,`h5`,`h6`];function Ci(e,t){return typeof e==`string`&&e in t.fontSizes?`var(--mantine-font-size-${e})`:typeof e==`string`&&Si.includes(e)?`var(--mantine-${e}-font-size)`:typeof e==`number`||typeof e==`string`?L(e):e}function wi(e){return e}var Ti=[`h1`,`h2`,`h3`,`h4`,`h5`,`h6`];function Ei(e,t){return typeof e==`string`&&e in t.lineHeights?`var(--mantine-line-height-${e})`:typeof e==`string`&&Ti.includes(e)?`var(--mantine-${e}-line-height)`:e}function Di(e,t){return typeof e==`string`&&e in t.radius?`var(--mantine-radius-${e})`:typeof e==`number`||typeof e==`string`?L(e):e}function Oi(e){return typeof e==`number`?L(e):e}function ki(e,t){if(typeof e==`number`)return L(e);if(typeof e==`string`){let n=e.replace(`-`,``);if(!(n in t.spacing))return L(e);let r=`--mantine-spacing-${n}`;return e.startsWith(`-`)?`calc(var(${r}) * -1)`:`var(${r})`}return e}var Ai={color:_i,textColor:vi,fontSize:Ci,spacing:ki,radius:Di,identity:wi,size:Oi,lineHeight:Ei,fontFamily:xi,border:yi};function ji(e){return e.replace(`(min-width: `,``).replace(`em)`,``)}function Mi({media:e,...t}){let n=Object.keys(e).sort((e,t)=>Number(ji(e))-Number(ji(t))).map(t=>({query:t,styles:e[t]}));return{...t,media:n}}function Ni(e){if(typeof e!=`object`||!e)return!1;let t=Object.keys(e);return t.length!==1||t[0]!==`base`}function Pi(e){return typeof e==`object`&&e?`base`in e?e.base:void 0:e}function Fi(e){return typeof e==`object`&&e?Ke(e).filter(e=>e!==`base`):[]}function Ii(e,t){return typeof e==`object`&&e&&t in e?e[t]:e}function Li({styleProps:e,data:t,theme:n}){return Mi(Ke(e).reduce((r,i)=>{if(i===`hiddenFrom`||i===`visibleFrom`||i===`sx`)return r;let a=t[i],o=Array.isArray(a.property)?a.property:[a.property],s=Pi(e[i]);if(!Ni(e[i]))return o.forEach(e=>{r.inlineStyles[e]=Ai[a.type](s,n)}),r;r.hasResponsiveStyles=!0;let c=Fi(e[i]);return o.forEach(t=>{s!=null&&(r.styles[t]=Ai[a.type](s,n)),c.forEach(o=>{let s=`(min-width: ${n.breakpoints[o]})`;r.media[s]={...r.media[s],[t]:Ai[a.type](Ii(e[i],o),n)}})}),r},{hasResponsiveStyles:!1,styles:{},inlineStyles:{},media:{}}))}function Ri(){return`__m__-${(0,D.useId)().replace(/[:«»]/g,``)}`}function zi(e,t){return Array.isArray(e)?[...e].reduce((e,n)=>({...e,...zi(n,t)}),{}):typeof e==`function`?e(t):e??{}}function Bi(e){return e}function Vi(e){return e.startsWith(`data-`)?e:`data-${e}`}function Hi(e){return Object.keys(e).reduce((t,n)=>{let r=e[n];return r===void 0||r===``||r===!1||r===null||(t[Vi(n)]=e[n]),t},{})}function Ui(e){return e?typeof e==`string`?{[Vi(e)]:!0}:Array.isArray(e)?[...e].reduce((e,t)=>({...e,...Ui(t)}),{}):Hi(e):null}function Wi(e,t){return Array.isArray(e)?[...e].reduce((e,n)=>({...e,...Wi(n,t)}),{}):typeof e==`function`?e(t):e??{}}function Gi({theme:e,style:t,vars:n,styleProps:r}){let i=Wi(t,e),a=Wi(n,e);return{...i,...a,...r}}var Ki=(0,D.forwardRef)(({component:e,style:t,__vars:n,className:r,variant:i,mod:a,size:o,hiddenFrom:s,visibleFrom:c,lightHidden:l,darkHidden:u,renderRoot:d,__size:f,...p},m)=>{let h=Cr(),g=e||`div`,{styleProps:_,rest:v}=hi(p),y=Gn()?.()?.(_.sx),b=Ri(),x=Li({styleProps:_,theme:h,data:gi}),S={ref:m,style:Gi({theme:h,style:t,vars:n,styleProps:x.inlineStyles}),className:Nn(r,y,{[b]:x.hasResponsiveStyles,"mantine-light-hidden":l,"mantine-dark-hidden":u,[`mantine-hidden-from-${s}`]:s,[`mantine-visible-from-${c}`]:c}),"data-variant":i,"data-size":nt(o)?void 0:o||void 0,size:f,...Ui(a),...v};return(0,R.jsxs)(R.Fragment,{children:[x.hasResponsiveStyles&&(0,R.jsx)(mi,{selector:`.${b}`,styles:x.styles,media:x.media}),typeof d==`function`?d(S):(0,R.jsx)(g,{...S})]})});Ki.displayName=`@mantine/core/Box`;var B=Bi(Ki);function qi(e){return e}function Ji(e){let t=e;return e=>{let n=(0,D.forwardRef)((n,r)=>(0,R.jsx)(t,{...e,...n,ref:r}));return n.extend=t.extend,n.displayName=`WithProps(${t.displayName})`,n}}function V(e){let t=(0,D.forwardRef)(e);return t.extend=qi,t.withProps=e=>{let n=(0,D.forwardRef)((n,r)=>(0,R.jsx)(t,{...e,...n,ref:r}));return n.extend=t.extend,n.displayName=`WithProps(${t.displayName})`,n},t}function Yi(e){let t=(0,D.forwardRef)(e);return t.withProps=e=>{let n=(0,D.forwardRef)((n,r)=>(0,R.jsx)(t,{...e,...n,ref:r}));return n.extend=t.extend,n.displayName=`WithProps(${t.displayName})`,n},t.extend=qi,t}var Xi=(0,D.createContext)({dir:`ltr`,toggleDirection:()=>{},setDirection:()=>{}});function Zi(){return(0,D.useContext)(Xi)}var Qi=l(g(),1);function $i(e){if(!e||typeof e==`string`)return 0;let t=e/36;return Math.round((4+15*t**.25+t/5)*10)}function ea(e){return e?.current?e.current.scrollHeight:`auto`}var ta=typeof window<`u`&&window.requestAnimationFrame,na=0,ra=e=>({height:0,overflow:`hidden`,...e?{}:{display:`none`}});function ia({transitionDuration:e,transitionTimingFunction:t=`ease`,onTransitionEnd:n=()=>{},opened:r,keepMounted:i=!1}){let a=(0,D.useRef)(null),o=ra(i),[s,c]=(0,D.useState)(r?{}:o),l=e=>{(0,Qi.flushSync)(()=>c(e))},u=e=>{l(t=>({...t,...e}))};function d(n){let r=e||$i(n);return{transition:`height ${r}ms ${t}, opacity ${r}ms ${t}`}}Vt(()=>{typeof ta==`function`&&ta(r?()=>{u({willChange:`height`,display:`block`,overflow:`hidden`}),ta(()=>{let e=ea(a);u({...d(e),height:e})})}:()=>{let e=ea(a);u({...d(e),willChange:`height`,height:e}),ta(()=>u({height:na,overflow:`hidden`}))})},[r]);let f=e=>{if(e.target===a.current&&e.propertyName===`height`)if(r){let e=ea(a);e===s.height?l({}):u({height:e}),n()}else s.height===na&&(l(o),n())};function p({style:e={},refKey:t=`ref`,...n}={}){let i=n[t],o={"aria-hidden":!r,...n,[t]:pn(a,i),onTransitionEnd:f,style:{boxSizing:`border-box`,...e,...s}};return o.inert=!r,o}return p}var aa={transitionDuration:200,transitionTimingFunction:`ease`,animateOpacity:!0},oa=V((e,t)=>{let{children:n,in:r,transitionDuration:i,transitionTimingFunction:a,style:o,onTransitionEnd:s,animateOpacity:c,keepMounted:l,...u}=z(`Collapse`,aa,e),d=Cr(),f=gn(),p=d.respectReducedMotion&&f?0:i,m=ia({opened:r,transitionDuration:p,transitionTimingFunction:a,onTransitionEnd:s,keepMounted:l});return p===0?r?(0,R.jsx)(B,{...u,children:n}):null:(0,R.jsx)(B,{...m({style:{opacity:r||!c?1:0,transition:c?`opacity ${p}ms ${a}`:`none`,...zi(o,d)},ref:t,...u}),children:n})});oa.displayName=`@mantine/core/Collapse`;function sa(){return typeof window<`u`}function ca(e){return da(e)?(e.nodeName||``).toLowerCase():`#document`}function la(e){var t;return(e==null||(t=e.ownerDocument)==null?void 0:t.defaultView)||window}function ua(e){return((da(e)?e.ownerDocument:e.document)||window.document)?.documentElement}function da(e){return sa()?e instanceof Node||e instanceof la(e).Node:!1}function fa(e){return sa()?e instanceof Element||e instanceof la(e).Element:!1}function pa(e){return sa()?e instanceof HTMLElement||e instanceof la(e).HTMLElement:!1}function ma(e){return!sa()||typeof ShadowRoot>`u`?!1:e instanceof ShadowRoot||e instanceof la(e).ShadowRoot}function ha(e){let{overflow:t,overflowX:n,overflowY:r,display:i}=Ea(e);return/auto|scroll|overlay|hidden|clip/.test(t+r+n)&&i!==`inline`&&i!==`contents`}function ga(e){return/^(table|td|th)$/.test(ca(e))}function _a(e){try{if(e.matches(`:popover-open`))return!0}catch{}try{return e.matches(`:modal`)}catch{return!1}}var va=/transform|translate|scale|rotate|perspective|filter/,ya=/paint|layout|strict|content/,ba=e=>!!e&&e!==`none`,xa;function Sa(e){let t=fa(e)?Ea(e):e;return ba(t.transform)||ba(t.translate)||ba(t.scale)||ba(t.rotate)||ba(t.perspective)||!wa()&&(ba(t.backdropFilter)||ba(t.filter))||va.test(t.willChange||``)||ya.test(t.contain||``)}function Ca(e){let t=Oa(e);for(;pa(t)&&!Ta(t);){if(Sa(t))return t;if(_a(t))return null;t=Oa(t)}return null}function wa(){return xa??=typeof CSS<`u`&&CSS.supports&&CSS.supports(`-webkit-backdrop-filter`,`none`),xa}function Ta(e){return/^(html|body|#document)$/.test(ca(e))}function Ea(e){return la(e).getComputedStyle(e)}function Da(e){return fa(e)?{scrollLeft:e.scrollLeft,scrollTop:e.scrollTop}:{scrollLeft:e.scrollX,scrollTop:e.scrollY}}function Oa(e){if(ca(e)===`html`)return e;let t=e.assignedSlot||e.parentNode||ma(e)&&e.host||ua(e);return ma(t)?t.host:t}function ka(e){let t=Oa(e);return Ta(t)?(e.ownerDocument||e).body:pa(t)&&ha(t)?t:ka(t)}function Aa(e,t,n){t===void 0&&(t=[]),n===void 0&&(n=!0);let r=ka(e),i=r===e.ownerDocument?.body,a=la(r);if(i){let e=ja(a);return t.concat(a,a.visualViewport||[],ha(r)?r:[],e&&n?Aa(e):[])}return t.concat(r,Aa(r,[],n))}function ja(e){return e.parent&&Object.getPrototypeOf(e.parent)?e.frameElement:null}var Ma=[`top`,`right`,`bottom`,`left`],Na=Math.min,Pa=Math.max,Fa=Math.round,Ia=Math.floor,La=e=>({x:e,y:e}),Ra={left:`right`,right:`left`,bottom:`top`,top:`bottom`};function za(e,t,n){return Pa(e,Na(t,n))}function Ba(e,t){return typeof e==`function`?e(t):e}function Va(e){return e.split(`-`)[0]}function Ha(e){return e.split(`-`)[1]}function Ua(e){return e===`x`?`y`:`x`}function Wa(e){return e===`y`?`height`:`width`}function Ga(e){let t=e[0];return t===`t`||t===`b`?`y`:`x`}function Ka(e){return Ua(Ga(e))}function qa(e,t,n){n===void 0&&(n=!1);let r=Ha(e),i=Ka(e),a=Wa(i),o=i===`x`?r===(n?`end`:`start`)?`right`:`left`:r===`start`?`bottom`:`top`;return t.reference[a]>t.floating[a]&&(o=no(o)),[o,no(o)]}function Ja(e){let t=no(e);return[Ya(e),t,Ya(t)]}function Ya(e){return e.includes(`start`)?e.replace(`start`,`end`):e.replace(`end`,`start`)}var Xa=[`left`,`right`],Za=[`right`,`left`],Qa=[`top`,`bottom`],$a=[`bottom`,`top`];function eo(e,t,n){switch(e){case`top`:case`bottom`:return n?t?Za:Xa:t?Xa:Za;case`left`:case`right`:return t?Qa:$a;default:return[]}}function to(e,t,n,r){let i=Ha(e),a=eo(Va(e),n===`start`,r);return i&&(a=a.map(e=>e+`-`+i),t&&(a=a.concat(a.map(Ya)))),a}function no(e){let t=Va(e);return Ra[t]+e.slice(t.length)}function ro(e){return{top:e.top??0,right:e.right??0,bottom:e.bottom??0,left:e.left??0}}function io(e){return typeof e==`number`?{top:e,right:e,bottom:e,left:e}:ro(e)}function ao(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 oo(){let e=navigator.userAgentData;return e!=null&&e.platform?e.platform:navigator.platform}function so(){let e=navigator.userAgentData;return e&&Array.isArray(e.brands)?e.brands.map(e=>{let{brand:t,version:n}=e;return t+`/`+n}).join(` `):navigator.userAgent}function co(){return/apple/i.test(navigator.vendor)}function lo(){return oo().toLowerCase().startsWith(`mac`)&&!navigator.maxTouchPoints}function uo(){return so().includes(`jsdom/`)}var fo=`data-floating-ui-focusable`,po=`input:not([type='hidden']):not([disabled]),[contenteditable]:not([contenteditable='false']),textarea:not([disabled])`;function mo(e){let t=e.activeElement;for(;((n=t)==null||(n=n.shadowRoot)==null?void 0:n.activeElement)!=null;){var n;t=t.shadowRoot.activeElement}return t}function ho(e,t){if(!e||!t)return!1;let n=t.getRootNode==null?void 0:t.getRootNode();if(e.contains(t))return!0;if(n&&ma(n)){let n=t;for(;n;){if(e===n)return!0;n=n.parentNode||n.host}}return!1}function go(e){return`composedPath`in e?e.composedPath()[0]:e.target}function _o(e,t){if(t==null)return!1;if(`composedPath`in e)return e.composedPath().includes(t);let n=e;return n.target!=null&&t.contains(n.target)}function vo(e){return e.matches(`html,body`)}function yo(e){return e?.ownerDocument||document}function bo(e){return pa(e)&&e.matches(po)}function xo(e){if(!e||uo())return!0;try{return e.matches(`:focus-visible`)}catch{return!0}}function So(e){return e?e.hasAttribute(fo)?e:e.querySelector(`[data-floating-ui-focusable]`)||e:null}function Co(e,t,n){return n===void 0&&(n=!0),e.filter(e=>e.parentId===t&&(!n||e.context?.open)).flatMap(t=>[t,...Co(e,t.id,n)])}function wo(e){return`nativeEvent`in e}function To(e,t){let n=[`mouse`,`pen`];return t||n.push(``,void 0),n.includes(e)}var Eo=typeof document<`u`?D.useLayoutEffect:function(){},Do={...D};function Oo(e){let t=D.useRef(e);return Eo(()=>{t.current=e}),t}var ko=Do.useInsertionEffect||(e=>e());function Ao(e){let t=D.useRef(()=>{});return ko(()=>{t.current=e}),D.useCallback(function(){var e=[...arguments];return t.current==null?void 0:t.current(...e)},[])}function jo(e,t,n){let{reference:r,floating:i}=e,a=Ga(t),o=Ka(t),s=Wa(o),c=Va(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}}let m=Ha(t);return m&&(p[o]+=f*(m===`end`?1:-1)*(n&&l?-1:1)),p}async function Mo(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}=Ba(t,e),p=io(f),m=o[d?u===`floating`?`reference`:`floating`:u],h=ao(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=ao(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 No=50,Po=async(e,t,n)=>{let{placement:r=`bottom`,strategy:i=`absolute`,middleware:a=[],platform:o}=n,s=o.detectOverflow?o:{...o,detectOverflow:Mo},c=await(o.isRTL==null?void 0:o.isRTL(t)),l=await o.getElementRects({reference:e,floating:t,strategy:i}),{x:u,y:d}=jo(l,r,c),f=r,p=0,m={};for(let n=0;n<a.length;n++){let h=a[n];if(!h)continue;let{name:g,fn:_}=h,{x:v,y,data:b,reset:x}=await _({x:u,y:d,initialPlacement:r,placement:f,strategy:i,middlewareData:m,rects:l,platform:s,elements:{reference:e,floating:t}});u=v??u,d=y??d,m[g]={...m[g],...b},x&&p<No&&(p++,typeof x==`object`&&(x.placement&&(f=x.placement),x.rects&&(l=x.rects===!0?await o.getElementRects({reference:e,floating:t,strategy:i}):x.rects),{x:u,y:d}=jo(l,f,c)),n=-1)}return{x:u,y:d,placement:f,strategy:i,middlewareData:m}},Fo=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}=Ba(e,t)||{};if(l==null)return{};let d=io(u),f={x:n,y:r},p=Ka(i),m=Wa(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=Na(d[_],T),D=Na(d[v],T),O=C-h[m]-D,k=C/2-h[m]/2+w,A=za(E,k,O),j=!c.arrow&&Ha(i)!=null&&k!==A&&a.reference[m]/2-(k<E?E:D)-h[m]/2<0,M=j?k<E?k-E:k-O:0;return{[p]:f[p]+M,data:{[p]:A,centerOffset:k-A-M,...j&&{alignmentOffset:M}},reset:j}}}),Io=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}=Ba(e,t);if((n=i.arrow)!=null&&n.alignmentOffset)return{};let g=Va(r),_=Ga(o),v=Va(o)===o,y=await(s.isRTL==null?void 0:s.isRTL(c.floating)),b=d||(v||!m?[no(o)]:Ja(o)),x=p!==`none`;!d&&x&&b.push(...to(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=qa(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`||_===Ga(t)||T.every(e=>Ga(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=Ga(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 Lo(e,t){return{top:e.top-t.height,right:e.right-t.width,bottom:e.bottom-t.height,left:e.left-t.width}}function Ro(e){return Ma.some(t=>e[t]>=0)}var zo=function(e){return e===void 0&&(e={}),{name:`hide`,options:e,async fn(t){let{rects:n,platform:r}=t,{strategy:i=`referenceHidden`,...a}=Ba(e,t);switch(i){case`referenceHidden`:{let e=Lo(await r.detectOverflow(t,{...a,elementContext:`reference`}),n.reference);return{data:{referenceHiddenOffsets:e,referenceHidden:Ro(e)}}}case`escaped`:{let e=Lo(await r.detectOverflow(t,{...a,altBoundary:!0}),n.floating);return{data:{escapedOffsets:e,escaped:Ro(e)}}}default:return{}}}}};function Bo(e){let t=Na(...e.map(e=>e.left)),n=Na(...e.map(e=>e.top)),r=Pa(...e.map(e=>e.right)),i=Pa(...e.map(e=>e.bottom));return{x:t,y:n,width:r-t,height:i-n}}function Vo(e){let t=e.slice().sort((e,t)=>e.y-t.y),n=[],r=null;for(let e=0;e<t.length;e++){let i=t[e];!r||i.y-r.y>r.height/2?n.push([i]):n[n.length-1].push(i),r=i}return n.map(e=>ao(Bo(e)))}var Ho=function(e){return e===void 0&&(e={}),{name:`inline`,options:e,async fn(t){let{placement:n,elements:r,rects:i,platform:a,strategy:o}=t,{padding:s=2,x:c,y:l}=Ba(e,t),u=Array.from(await(a.getClientRects==null?void 0:a.getClientRects(r.reference))||[]);if(!u.length)return{};let d=Vo(u),f=ao(Bo(u)),p=io(s);function m(){if(d.length===2&&(d[0].left>d[1].right||d[1].left>d[0].right)&&c!=null&&l!=null)return d.find(e=>c>e.left-p.left&&c<e.right+p.right&&l>e.top-p.top&&l<e.bottom+p.bottom)||f;if(d.length>=2){if(Ga(n)===`y`){let e=d[0],t=d[d.length-1],r=Va(n)===`top`,i=e.top,a=t.bottom,o=r?e.left:t.left;return ao({x:o,y:i,width:(r?e.right:t.right)-o,height:a-i})}let e=Va(n)===`left`,t=Pa(...d.map(e=>e.right)),r=Na(...d.map(e=>e.left)),i=d.filter(n=>e?n.left===r:n.right===t),a=i[0].top,o=i[i.length-1].bottom;return ao({x:r,y:a,width:t-r,height:o-a})}return f}let h=await a.getElementRects({reference:{getBoundingClientRect:m},floating:r.floating,strategy:o});return i.reference.x!==h.reference.x||i.reference.y!==h.reference.y||i.reference.width!==h.reference.width||i.reference.height!==h.reference.height?{reset:{rects:h}}:{}}}},Uo=new Set([`left`,`top`]);async function Wo(e,t){let{placement:n,platform:r,elements:i}=e,a=await(r.isRTL==null?void 0:r.isRTL(i.floating)),o=Va(n),s=Ha(n),c=Ga(n)===`y`,l=Uo.has(o)?-1:1,u=a&&c?-1:1,d=Ba(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 Go=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 Wo(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}}}}},Ko=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}=Ba(e,t),u={x:n,y:r},d=await a.detectOverflow(t,l),f=Ga(i),p=Ua(f),m=u[p],h=u[f],g=(e,t)=>za(t+d[e===`y`?`top`:`left`],t,t-d[e===`y`?`bottom`:`right`]);o&&(m=g(p,m)),s&&(h=g(f,h));let _=c.fn({...t,[p]:m,[f]:h});return{..._,data:{x:_.x-n,y:_.y-r,enabled:{[p]:o,[f]:s}}}}}},qo=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}=Ba(e,t),u={x:n,y:r},d=Ga(i),f=Ua(d),p=u[f],m=u[d],h=Ba(s,t),g=typeof h==`number`?{mainAxis:h,crossAxis:0}:{mainAxis:h.mainAxis??0,crossAxis:h.crossAxis??0};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=Uo.has(Va(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}}}},Jo=function(e){return e===void 0&&(e={}),{name:`size`,options:e,async fn(t){let{placement:n,rects:r,platform:i,elements:a}=t,{apply:o=()=>{},...s}=Ba(e,t),c=await i.detectOverflow(t,s),l=Va(n),u=Ha(n),d=Ga(n)===`y`,{width:f,height:p}=r.floating,m,h;l===`top`||l===`bottom`?(m=l,h=u===(await(i.isRTL==null?void 0:i.isRTL(a.floating))?`start`:`end`)?`left`:`right`):(h=l,m=u===`end`?`top`:`bottom`);let g=p-c.top-c.bottom,_=f-c.left-c.right,v=Na(p-c[m],g),y=Na(f-c[h],_),b=t.middlewareData.shift,x=!b,S=v,C=y;b!=null&&b.enabled.x&&(C=_),b!=null&&b.enabled.y&&(S=g),x&&!u&&(d?C=f-2*Pa(c.left,c.right):S=p-2*Pa(c.top,c.bottom)),await o({...t,availableWidth:C,availableHeight:S});let w=await i.getDimensions(a.floating);return f!==w.width||p!==w.height?{reset:{rects:!0}}:{}}}};function Yo(e){let t=Ea(e),n=parseFloat(t.width)||0,r=parseFloat(t.height)||0,i=pa(e),a=i?e.offsetWidth:n,o=i?e.offsetHeight:r,s=Fa(n)!==a||Fa(r)!==o;return s&&(n=a,r=o),{width:n,height:r,$:s}}function Xo(e){return fa(e)?e:e.contextElement}function Zo(e){let t=Xo(e);if(!pa(t))return La(1);let n=t.getBoundingClientRect(),{width:r,height:i,$:a}=Yo(t),o=(a?Fa(n.width):n.width)/r,s=(a?Fa(n.height):n.height)/i;return(!o||!Number.isFinite(o))&&(o=1),(!s||!Number.isFinite(s))&&(s=1),{x:o,y:s}}var Qo=La(0);function $o(e){let t=la(e);return!wa()||!t.visualViewport?Qo:{x:t.visualViewport.offsetLeft,y:t.visualViewport.offsetTop}}function es(e,t,n){return t===void 0&&(t=!1),!!n&&t&&n===la(e)}function ts(e,t,n,r){t===void 0&&(t=!1),n===void 0&&(n=!1);let i=e.getBoundingClientRect(),a=Xo(e),o=La(1);t&&(r?fa(r)&&(o=Zo(r)):o=Zo(e));let s=es(a,n,r)?$o(a):La(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&&r){let e=la(a),t=fa(r)?la(r):r,n=e,i=ja(n);for(;i&&t!==n;){let e=Zo(i),t=i.getBoundingClientRect(),r=Ea(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=la(i),i=ja(n)}}return ao({width:u,height:d,x:c,y:l})}function ns(e,t){let n=Da(e).scrollLeft;return t?t.left+n:ts(ua(e)).left+n}function rs(e,t){let n=e.getBoundingClientRect();return{x:n.left+t.scrollLeft-ns(e,n),y:n.top+t.scrollTop}}function is(e){let{elements:t,rect:n,offsetParent:r,strategy:i}=e,a=i===`fixed`,o=ua(r),s=t?_a(t.floating):!1;if(r===o||s&&a)return n;let c={scrollLeft:0,scrollTop:0},l=La(1),u=La(0),d=pa(r);if((d||!a)&&((ca(r)!==`body`||ha(o))&&(c=Da(r)),d)){let e=ts(r);l=Zo(r),u.x=e.x+r.clientLeft,u.y=e.y+r.clientTop}let f=o&&!d&&!a?rs(o,c):La(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 as(e){return e.getClientRects?Array.from(e.getClientRects()):[]}function os(e){let t=Da(e),n=e.ownerDocument.body,r=Pa(e.scrollWidth,e.clientWidth,n.scrollWidth,n.clientWidth),i=Pa(e.scrollHeight,e.clientHeight,n.scrollHeight,n.clientHeight),a=-t.scrollLeft+ns(e),o=-t.scrollTop;return Ea(n).direction===`rtl`&&(a+=Pa(e.clientWidth,n.clientWidth)-r),{width:r,height:i,x:a,y:o}}var ss=25;function cs(e,t,n){n===void 0&&(n=`viewport`);let r=n===`layoutViewport`,i=la(e),a=ua(e),o=i.visualViewport,s=a.clientWidth,c=a.clientHeight,l=0,u=0;if(o){let e=!wa()||t===`fixed`;r?e||(l=-o.offsetLeft,u=-o.offsetTop):(s=o.width,c=o.height,e&&(l=o.offsetLeft,u=o.offsetTop))}if(ns(a)<=0){let e=a.ownerDocument,t=e.body,n=getComputedStyle(t),r=e.compatMode===`CSS1Compat`&&parseFloat(n.marginLeft)+parseFloat(n.marginRight)||0,i=Math.abs(a.clientWidth-t.clientWidth-r),o=getComputedStyle(a).scrollbarGutter===`stable both-edges`?i/2:i;o<=ss&&(s-=o)}return{width:s,height:c,x:l,y:u}}function ls(e,t){let n=ts(e,!0,t===`fixed`),r=n.top+e.clientTop,i=n.left+e.clientLeft,a=Zo(e);return{width:e.clientWidth*a.x,height:e.clientHeight*a.y,x:i*a.x,y:r*a.y}}function us(e,t,n){let r;if(t===`viewport`||t===`layoutViewport`)r=cs(e,n,t);else if(t===`document`)r=os(ua(e));else if(fa(t))r=ls(t,n);else{let n=$o(e);r={x:t.x-n.x,y:t.y-n.y,width:t.width,height:t.height}}return ao(r)}function ds(e,t){let n=t.get(e);if(n)return n;let r=Aa(e,[],!1).filter(e=>fa(e)&&ca(e)!==`body`),i=null,a=Ea(e).position===`fixed`,o=a?Oa(e):e;for(;fa(o)&&!Ta(o);){let e=Ea(o),t=Sa(o),n=i?i.position:a?`fixed`:``;!t&&(n===`fixed`||n===`absolute`&&e.position===`static`)?r=r.filter(e=>e!==o):i=e,o=Oa(o)}return t.set(e,r),r}function fs(e){let{element:t,boundary:n,rootBoundary:r,strategy:i}=e,a=[...n===`clippingAncestors`?_a(t)?[]:ds(t,this._c):[].concat(n),r],o=us(t,a[0],i),s=o.top,c=o.right,l=o.bottom,u=o.left;for(let e=1;e<a.length;e++){let n=us(t,a[e],i);s=Pa(n.top,s),c=Na(n.right,c),l=Na(n.bottom,l),u=Pa(n.left,u)}return{width:c-u,height:l-s,x:u,y:s}}function ps(e){let{width:t,height:n}=Yo(e);return{width:t,height:n}}function ms(e,t,n){let r=pa(t),i=ua(t),a=n===`fixed`,o=ts(e,!0,a,t),s={scrollLeft:0,scrollTop:0},c=La(0);if((r||!a)&&((ca(t)!==`body`||ha(i))&&(s=Da(t)),r)){let e=ts(t,!0,a,t);c.x=e.x+t.clientLeft,c.y=e.y+t.clientTop}!r&&i&&(c.x=ns(i));let l=i&&!r&&!a?rs(i,s):La(0);return{x:o.left+s.scrollLeft-c.x-l.x,y:o.top+s.scrollTop-c.y-l.y,width:o.width,height:o.height}}function hs(e){return Ea(e).position===`static`}function gs(e,t){if(!pa(e)||Ea(e).position===`fixed`)return null;if(t)return t(e);let n=e.offsetParent;return ua(e)===n&&(n=n.ownerDocument.body),n}function _s(e,t){let n=la(e);if(_a(e))return n;if(!pa(e)){let t=Oa(e);for(;t&&!Ta(t);){if(fa(t)&&!hs(t))return t;t=Oa(t)}return n}let r=gs(e,t);for(;r&&ga(r)&&hs(r);)r=gs(r,t);return r&&Ta(r)&&hs(r)&&!Sa(r)?n:r||Ca(e)||n}var vs=async function(e){let t=this.getOffsetParent||_s,n=this.getDimensions,r=await n(e.floating);return{reference:ms(e.reference,await t(e.floating),e.strategy),floating:{x:0,y:0,width:r.width,height:r.height}}};function ys(e){return Ea(e).direction===`rtl`}var bs={convertOffsetParentRelativeRectToViewportRelativeRect:is,getDocumentElement:ua,getClippingRect:fs,getOffsetParent:_s,getElementRects:vs,getClientRects:as,getDimensions:ps,getScale:Zo,isElement:fa,isRTL:ys};function xs(e,t){return e.x===t.x&&e.y===t.y&&e.width===t.width&&e.height===t.height}function Ss(e,t,n){let r=null,i,a=ua(e);function o(){var e;clearTimeout(i),(e=r)==null||e.disconnect(),r=null}function s(n,c){n===void 0&&(n=!1),c===void 0&&(c=1),o();let l=e.getBoundingClientRect(),{left:u,top:d,width:f,height:p}=l;if(n||t(),!f||!p)return;let m=Ia(d),h=Ia(a.clientWidth-(u+f)),g=Ia(a.clientHeight-(d+p)),_=Ia(u),v={rootMargin:-m+`px `+-h+`px `+-g+`px `+-_+`px`,threshold:Pa(0,Na(1,c))||1},y=!0;function b(t){let n=t[0].intersectionRatio;if(!xs(l,e.getBoundingClientRect()))return s();if(n!==c){if(!y)return s();n?s(!1,n):i=setTimeout(()=>{s(!1,1e-7)},1e3)}y=!1}try{r=new IntersectionObserver(b,{...v,root:a.ownerDocument})}catch{r=new IntersectionObserver(b,v)}r.observe(e)}let c=la(e),l=()=>s(n);return c.addEventListener(`resize`,l),s(!0),()=>{c.removeEventListener(`resize`,l),o()}}function Cs(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=Xo(e),u=i||a?[...l?Aa(l):[],...t?Aa(t):[]]:[];u.forEach(e=>{i&&e.addEventListener(`scroll`,n),a&&e.addEventListener(`resize`,n)});let d=l&&s?Ss(l,n,a):null,f=-1,p=null;o&&(p=new ResizeObserver(e=>{let[r]=e;r&&r.target===l&&p&&t&&(p.unobserve(t),cancelAnimationFrame(f),f=requestAnimationFrame(()=>{var e;(e=p)==null||e.observe(t)})),n()}),l&&!c&&p.observe(l),t&&p.observe(t));let m,h=c?ts(e):null;c&&g();function g(){let t=ts(e);h&&!xs(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 ws=Go,Ts=Ko,Es=Io,Ds=Jo,Os=zo,ks=Fo,As=Ho,js=qo,Ms=(e,t,n)=>{let r=new Map,i=n??{},a={...bs,...i.platform,_c:r};return Po(e,t,{...i,platform:a})},Ns=typeof document<`u`?D.useLayoutEffect:function(){};function Ps(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(!Ps(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)&&!Ps(e[n],t[n]))return!1}return!0}return e!==e&&t!==t}function Fs(e){return typeof window>`u`?1:(e.ownerDocument.defaultView||window).devicePixelRatio||1}function Is(e,t){let n=Fs(e);return Math.round(t*n)/n}function Ls(e){let t=D.useRef(e);return Ns(()=>{t.current=e}),t}function Rs(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]=D.useState({x:0,y:0,strategy:n,placement:t,middlewareData:{},isPositioned:!1}),[f,p]=D.useState(r);Ps(f,r)||p(r);let[m,h]=D.useState(null),[g,_]=D.useState(null),v=D.useCallback(e=>{e!==S.current&&(S.current=e,h(e))},[]),y=D.useCallback(e=>{e!==C.current&&(C.current=e,_(e))},[]),b=a||m,x=o||g,S=D.useRef(null),C=D.useRef(null),w=D.useRef(u),T=c!=null,E=Ls(c),O=Ls(i),k=Ls(l),A=D.useCallback(()=>{if(!S.current||!C.current)return;let e={placement:t,strategy:n,middleware:f};O.current&&(e.platform=O.current),Ms(S.current,C.current,e).then(e=>{let t={...e,isPositioned:k.current!==!1};j.current&&!Ps(w.current,t)&&(w.current=t,Qi.flushSync(()=>{d(t)}))})},[f,t,n,O,k]);Ns(()=>{l===!1&&w.current.isPositioned&&(w.current.isPositioned=!1,d(e=>({...e,isPositioned:!1})))},[l]);let j=D.useRef(!1);Ns(()=>(j.current=!0,()=>{j.current=!1}),[]),Ns(()=>{if(b&&(S.current=b),x&&(C.current=x),b&&x){if(E.current)return E.current(b,x,A);A()}},[b,x,A,E,T]);let M=D.useMemo(()=>({reference:S,floating:C,setReference:v,setFloating:y}),[v,y]),N=D.useMemo(()=>({reference:b,floating:x}),[b,x]),ee=D.useMemo(()=>{let e={position:n,left:0,top:0};if(!N.floating)return e;let t=Is(N.floating,u.x),r=Is(N.floating,u.y);return s?{...e,transform:`translate(`+t+`px, `+r+`px)`,...Fs(N.floating)>=1.5&&{willChange:`transform`}}:{position:n,left:t,top:r}},[n,s,N.floating,u.x,u.y]);return D.useMemo(()=>({...u,update:A,refs:M,elements:N,floatingStyles:ee}),[u,A,M,N,ee])}var zs=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?{}:ks({element:r.current,padding:i}).fn(n):r?ks({element:r,padding:i}).fn(n):{}}}},Bs=(e,t)=>{let n=ws(e);return{name:n.name,fn:n.fn,options:[e,t]}},Vs=(e,t)=>{let n=Ts(e);return{name:n.name,fn:n.fn,options:[e,t]}},Hs=(e,t)=>({fn:js(e).fn,options:[e,t]}),Us=(e,t)=>{let n=Es(e);return{name:n.name,fn:n.fn,options:[e,t]}},Ws=(e,t)=>{let n=Ds(e);return{name:n.name,fn:n.fn,options:[e,t]}},Gs=(e,t)=>{let n=Os(e);return{name:n.name,fn:n.fn,options:[e,t]}},Ks=(e,t)=>{let n=As(e);return{name:n.name,fn:n.fn,options:[e,t]}},qs=(e,t)=>{let n=zs(e);return{name:n.name,fn:n.fn,options:[e,t]}};function Js(e){let t=D.useRef(void 0),n=D.useCallback(t=>{let n=e.map(e=>{if(e!=null){if(typeof e==`function`){let n=e,r=n(t);return typeof r==`function`?r:()=>{n(null)}}return e.current=t,()=>{e.current=null}}});return()=>{n.forEach(e=>e?.())}},e);return D.useMemo(()=>e.every(e=>e==null)?null:e=>{t.current&&=(t.current(),void 0),e!=null&&(t.current=n(e))},e)}var Ys=`data-floating-ui-focusable`,Xs=`active`,Zs=`selected`,Qs=`ArrowLeft`,$s=`ArrowRight`,ec=`ArrowUp`,tc=`ArrowDown`,nc=[Qs,$s],rc=[ec,tc];[...nc,...rc];var ic={...D},ac=!1,oc=0,sc=()=>`floating-ui-`+Math.random().toString(36).slice(2,6)+oc++;function cc(){let[e,t]=D.useState(()=>ac?sc():void 0);return Eo(()=>{e??t(sc())},[]),D.useEffect(()=>{ac=!0},[]),e}var lc=ic.useId||cc;function uc(){let e=new Map;return{emit(t,n){var r;(r=e.get(t))==null||r.forEach(e=>e(n))},on(t,n){e.has(t)||e.set(t,new Set),e.get(t).add(n)},off(t,n){var r;(r=e.get(t))==null||r.delete(n)}}}var dc=D.createContext(null),fc=D.createContext(null),pc=()=>D.useContext(dc)?.id||null,mc=()=>D.useContext(fc);function hc(e){return`data-floating-ui-`+e}function gc(e){e.current!==-1&&(clearTimeout(e.current),e.current=-1)}var _c=hc(`safe-polygon`);function vc(e,t,n){if(n&&!To(n))return 0;if(typeof e==`number`)return e;if(typeof e==`function`){let n=e();return typeof n==`number`?n:n?.[t]}return e?.[t]}function yc(e){return typeof e==`function`?e():e}function bc(e,t){t===void 0&&(t={});let{open:n,onOpenChange:r,dataRef:i,events:a,elements:o}=e,{enabled:s=!0,delay:c=0,handleClose:l=null,mouseOnly:u=!1,restMs:d=0,move:f=!0}=t,p=mc(),m=pc(),h=Oo(l),g=Oo(c),_=Oo(n),v=Oo(d),y=D.useRef(),b=D.useRef(-1),x=D.useRef(),S=D.useRef(-1),C=D.useRef(!0),w=D.useRef(!1),T=D.useRef(()=>{}),E=D.useRef(!1),O=Ao(()=>{let e=i.current.openEvent?.type;return e?.includes(`mouse`)&&e!==`mousedown`});D.useEffect(()=>{if(!s)return;function e(e){let{open:t}=e;t||(gc(b),gc(S),C.current=!0,E.current=!1)}return a.on(`openchange`,e),()=>{a.off(`openchange`,e)}},[s,a]),D.useEffect(()=>{if(!s||!h.current||!n)return;function e(e){O()&&r(!1,e,`hover`)}let t=yo(o.floating).documentElement;return t.addEventListener(`mouseleave`,e),()=>{t.removeEventListener(`mouseleave`,e)}},[o.floating,n,r,s,h,O]);let k=D.useCallback(function(e,t,n){t===void 0&&(t=!0),n===void 0&&(n=`hover`);let i=vc(g.current,`close`,y.current);i&&!x.current?(gc(b),b.current=window.setTimeout(()=>r(!1,e,n),i)):t&&(gc(b),r(!1,e,n))},[g,r]),A=Ao(()=>{T.current(),x.current=void 0}),j=Ao(()=>{if(w.current){let e=yo(o.floating).body;e.style.pointerEvents=``,e.removeAttribute(_c),w.current=!1}}),M=Ao(()=>i.current.openEvent?[`click`,`mousedown`].includes(i.current.openEvent.type):!1);D.useEffect(()=>{if(!s)return;function e(e){if(gc(b),C.current=!1,u&&!To(y.current)||yc(v.current)>0&&!vc(g.current,`open`))return;let t=vc(g.current,`open`,y.current);t?b.current=window.setTimeout(()=>{_.current||r(!0,e,`hover`)},t):n||r(!0,e,`hover`)}function t(e){if(M()){j();return}T.current();let t=yo(o.floating);if(gc(S),E.current=!1,h.current&&i.current.floatingContext){n||gc(b),x.current=h.current({...i.current.floatingContext,tree:p,x:e.clientX,y:e.clientY,onClose(){j(),A(),M()||k(e,!0,`safe-polygon`)}});let r=x.current;t.addEventListener(`mousemove`,r),T.current=()=>{t.removeEventListener(`mousemove`,r)};return}(y.current!==`touch`||!ho(o.floating,e.relatedTarget))&&k(e)}function a(e){M()||i.current.floatingContext&&(h.current==null||h.current({...i.current.floatingContext,tree:p,x:e.clientX,y:e.clientY,onClose(){j(),A(),M()||k(e)}})(e))}function c(){gc(b)}function l(e){M()||k(e,!1)}if(fa(o.domReference)){let r=o.domReference,i=o.floating;return n&&r.addEventListener(`mouseleave`,a),f&&r.addEventListener(`mousemove`,e,{once:!0}),r.addEventListener(`mouseenter`,e),r.addEventListener(`mouseleave`,t),i&&(i.addEventListener(`mouseleave`,a),i.addEventListener(`mouseenter`,c),i.addEventListener(`mouseleave`,l)),()=>{n&&r.removeEventListener(`mouseleave`,a),f&&r.removeEventListener(`mousemove`,e),r.removeEventListener(`mouseenter`,e),r.removeEventListener(`mouseleave`,t),i&&(i.removeEventListener(`mouseleave`,a),i.removeEventListener(`mouseenter`,c),i.removeEventListener(`mouseleave`,l))}}},[o,s,e,u,f,k,A,j,r,n,_,p,g,h,i,M,v]),Eo(()=>{var e;if(s&&n&&(e=h.current)!=null&&(e=e.__options)!=null&&e.blockPointerEvents&&O()){w.current=!0;let e=o.floating;if(fa(o.domReference)&&e){var t;let n=yo(o.floating).body;n.setAttribute(_c,``);let r=o.domReference,i=p==null||(t=p.nodesRef.current.find(e=>e.id===m))==null||(t=t.context)==null?void 0:t.elements.floating;return i&&(i.style.pointerEvents=``),n.style.pointerEvents=`none`,r.style.pointerEvents=`auto`,e.style.pointerEvents=`auto`,()=>{n.style.pointerEvents=``,r.style.pointerEvents=``,e.style.pointerEvents=``}}}},[s,n,m,o,p,h,O]),Eo(()=>{n||(y.current=void 0,E.current=!1,A(),j())},[n,A,j]),D.useEffect(()=>()=>{A(),gc(b),gc(S),j()},[s,o.domReference,A,j]);let N=D.useMemo(()=>{function e(e){y.current=e.pointerType}return{onPointerDown:e,onPointerEnter:e,onMouseMove(e){let{nativeEvent:t}=e;function i(){!C.current&&!_.current&&r(!0,t,`hover`)}u&&!To(y.current)||n||yc(v.current)===0||E.current&&e.movementX**2+e.movementY**2<2||(gc(S),y.current===`touch`?i():(E.current=!0,S.current=window.setTimeout(i,yc(v.current))))}}},[u,r,n,_,v]);return D.useMemo(()=>s?{reference:N}:{},[s,N])}var xc=()=>{},Sc=D.createContext({delay:0,initialDelay:0,timeoutMs:0,currentId:null,setCurrentId:xc,setState:xc,isInstantPhase:!1}),Cc=()=>D.useContext(Sc);function wc(e){let{children:t,delay:n,timeoutMs:r=0}=e,[i,a]=D.useReducer((e,t)=>({...e,...t}),{delay:n,timeoutMs:r,initialDelay:n,currentId:null,isInstantPhase:!1}),o=D.useRef(null),s=D.useCallback(e=>{a({currentId:e})},[]);return Eo(()=>{i.currentId?o.current===null?o.current=i.currentId:i.isInstantPhase||a({isInstantPhase:!0}):(i.isInstantPhase&&a({isInstantPhase:!1}),o.current=null)},[i.currentId,i.isInstantPhase]),(0,R.jsx)(Sc.Provider,{value:D.useMemo(()=>({...i,setState:a,setCurrentId:s}),[i,s]),children:t})}function Tc(e,t){t===void 0&&(t={});let{open:n,onOpenChange:r,floatingId:i}=e,{id:a,enabled:o=!0}=t,s=a??i,c=Cc(),{currentId:l,setCurrentId:u,initialDelay:d,setState:f,timeoutMs:p}=c;return Eo(()=>{o&&l&&(f({delay:{open:1,close:vc(d,`close`)}}),l!==s&&r(!1))},[o,s,r,f,l,d]),Eo(()=>{function e(){r(!1),f({delay:d,currentId:null})}if(o&&l&&!n&&l===s){if(p){let t=window.setTimeout(e,p);return()=>{clearTimeout(t)}}e()}},[o,n,f,l,s,r,d,p]),Eo(()=>{o&&(u===xc||!n||u(s))},[o,n,u,s]),c}var Ec={pointerdown:`onPointerDown`,mousedown:`onMouseDown`,click:`onClick`},Dc={pointerdown:`onPointerDownCapture`,mousedown:`onMouseDownCapture`,click:`onClickCapture`},Oc=e=>({escapeKey:typeof e==`boolean`?e:e?.escapeKey??!1,outsidePress:typeof e==`boolean`?e:e?.outsidePress??!0});function kc(e,t){t===void 0&&(t={});let{open:n,onOpenChange:r,elements:i,dataRef:a}=e,{enabled:o=!0,escapeKey:s=!0,outsidePress:c=!0,outsidePressEvent:l=`pointerdown`,referencePress:u=!1,referencePressEvent:d=`pointerdown`,ancestorScroll:f=!1,bubbles:p,capture:m}=t,h=mc(),g=Ao(typeof c==`function`?c:()=>!1),_=typeof c==`function`?g:c,v=D.useRef(!1),{escapeKey:y,outsidePress:b}=Oc(p),{escapeKey:x,outsidePress:S}=Oc(m),C=D.useRef(!1),w=Ao(e=>{if(!n||!o||!s||e.key!==`Escape`||C.current)return;let t=a.current.floatingContext?.nodeId,i=h?Co(h.nodesRef.current,t):[];if(!y&&(e.stopPropagation(),i.length>0)){let e=!0;if(i.forEach(t=>{var n;if((n=t.context)!=null&&n.open&&!t.context.dataRef.current.__escapeKeyBubbles){e=!1;return}}),!e)return}r(!1,wo(e)?e.nativeEvent:e,`escape-key`)}),T=Ao(e=>{var t;let n=()=>{var t;w(e),(t=go(e))==null||t.removeEventListener(`keydown`,n)};(t=go(e))==null||t.addEventListener(`keydown`,n)}),E=Ao(e=>{let t=a.current.insideReactTree;a.current.insideReactTree=!1;let n=v.current;if(v.current=!1,l===`click`&&n||t||typeof _==`function`&&!_(e))return;let o=go(e),s=`[`+hc(`inert`)+`]`,c=yo(i.floating).querySelectorAll(s),u=fa(o)?o:null;for(;u&&!Ta(u);){let e=Oa(u);if(Ta(e)||!fa(e))break;u=e}if(c.length&&fa(o)&&!vo(o)&&!ho(o,i.floating)&&Array.from(c).every(e=>!ho(u,e)))return;if(pa(o)&&A){let t=Ta(o),n=Ea(o),r=/auto|scroll/,i=t||r.test(n.overflowX),a=t||r.test(n.overflowY),s=i&&o.clientWidth>0&&o.scrollWidth>o.clientWidth,c=a&&o.clientHeight>0&&o.scrollHeight>o.clientHeight,l=n.direction===`rtl`,u=c&&(l?e.offsetX<=o.offsetWidth-o.clientWidth:e.offsetX>o.clientWidth),d=s&&e.offsetY>o.clientHeight;if(u||d)return}let d=a.current.floatingContext?.nodeId,f=h&&Co(h.nodesRef.current,d).some(t=>_o(e,t.context?.elements.floating));if(_o(e,i.floating)||_o(e,i.domReference)||f)return;let p=h?Co(h.nodesRef.current,d):[];if(p.length>0){let e=!0;if(p.forEach(t=>{var n;if((n=t.context)!=null&&n.open&&!t.context.dataRef.current.__outsidePressBubbles){e=!1;return}}),!e)return}r(!1,e,`outside-press`)}),O=Ao(e=>{var t;let n=()=>{var t;E(e),(t=go(e))==null||t.removeEventListener(l,n)};(t=go(e))==null||t.addEventListener(l,n)});D.useEffect(()=>{if(!n||!o)return;a.current.__escapeKeyBubbles=y,a.current.__outsidePressBubbles=b;let e=-1;function t(e){r(!1,e,`ancestor-scroll`)}function c(){window.clearTimeout(e),C.current=!0}function u(){e=window.setTimeout(()=>{C.current=!1},wa()?5:0)}let d=yo(i.floating);s&&(d.addEventListener(`keydown`,x?T:w,x),d.addEventListener(`compositionstart`,c),d.addEventListener(`compositionend`,u)),_&&d.addEventListener(l,S?O:E,S);let p=[];return f&&(fa(i.domReference)&&(p=Aa(i.domReference)),fa(i.floating)&&(p=p.concat(Aa(i.floating))),!fa(i.reference)&&i.reference&&i.reference.contextElement&&(p=p.concat(Aa(i.reference.contextElement)))),p=p.filter(e=>e!==d.defaultView?.visualViewport),p.forEach(e=>{e.addEventListener(`scroll`,t)}),()=>{s&&(d.removeEventListener(`keydown`,x?T:w,x),d.removeEventListener(`compositionstart`,c),d.removeEventListener(`compositionend`,u)),_&&d.removeEventListener(l,S?O:E,S),p.forEach(e=>{e.removeEventListener(`scroll`,t)}),window.clearTimeout(e)}},[a,i,s,_,l,n,r,f,o,y,b,w,x,T,E,S,O]),D.useEffect(()=>{a.current.insideReactTree=!1},[a,_,l]);let k=D.useMemo(()=>({onKeyDown:w,...u&&{[Ec[d]]:e=>{r(!1,e.nativeEvent,`reference-press`)},...d!==`click`&&{onClick(e){r(!1,e.nativeEvent,`reference-press`)}}}}),[w,r,u,d]),A=D.useMemo(()=>{function e(e){e.button===0&&(v.current=!0)}return{onKeyDown:w,onMouseDown:e,onMouseUp:e,[Dc[l]]:()=>{a.current.insideReactTree=!0}}},[w,l,a]);return D.useMemo(()=>o?{reference:k,floating:A}:{},[o,k,A])}function Ac(e){let{open:t=!1,onOpenChange:n,elements:r}=e,i=lc(),a=D.useRef({}),[o]=D.useState(()=>uc()),s=pc()!=null,[c,l]=D.useState(r.reference),u=Ao((e,t,r)=>{a.current.openEvent=e?t:void 0,o.emit(`openchange`,{open:e,event:t,reason:r,nested:s}),n?.(e,t,r)}),d=D.useMemo(()=>({setPositionReference:l}),[]),f=D.useMemo(()=>({reference:c||r.reference||null,floating:r.floating||null,domReference:r.reference}),[c,r.reference,r.floating]);return D.useMemo(()=>({dataRef:a,open:t,onOpenChange:u,elements:f,events:o,floatingId:i,refs:d}),[t,u,f,o,i,d])}function jc(e){let{elements:t,...n}=e===void 0?{}:e,{nodeId:r}=n,i=Ac({...n,elements:{reference:t?.reference??null,floating:t?.floating??null}}),a=n.rootContext||i,o=a.elements,[s,c]=D.useState(null),[l,u]=D.useState(null),d=o?.domReference||s,f=D.useRef(null),p=mc();Eo(()=>{d&&(f.current=d)},[d]);let m=Rs({...n,elements:{...o,...l&&{reference:l}}}),h=D.useCallback(e=>{let t=fa(e)?{getBoundingClientRect:()=>e.getBoundingClientRect(),getClientRects:()=>e.getClientRects(),contextElement:e}:e;u(t),m.refs.setReference(t)},[m.refs]),g=D.useCallback(e=>{(fa(e)||e===null)&&(f.current=e,c(e)),(fa(m.refs.reference.current)||m.refs.reference.current===null||e!==null&&!fa(e))&&m.refs.setReference(e)},[m.refs]),_=D.useMemo(()=>({...m.refs,setReference:g,setPositionReference:h,domReference:f}),[m.refs,g,h]),v=D.useMemo(()=>({...m.elements,domReference:d}),[m.elements,d]),y=D.useMemo(()=>({...m,...a,refs:_,elements:v,nodeId:r}),[m,_,v,r,a]);return Eo(()=>{a.dataRef.current.floatingContext=y;let e=p?.nodesRef.current.find(e=>e.id===r);e&&(e.context=y)}),D.useMemo(()=>({...m,context:y,refs:_,elements:v}),[m,_,v,y])}function Mc(){return lo()&&co()}function Nc(e,t){t===void 0&&(t={});let{open:n,onOpenChange:r,events:i,dataRef:a,elements:o}=e,{enabled:s=!0,visibleOnly:c=!0}=t,l=D.useRef(!1),u=D.useRef(-1),d=D.useRef(!0);D.useEffect(()=>{if(!s)return;let e=la(o.domReference);function t(){!n&&pa(o.domReference)&&o.domReference===mo(yo(o.domReference))&&(l.current=!0)}function r(){d.current=!0}function i(){d.current=!1}return e.addEventListener(`blur`,t),Mc()&&(e.addEventListener(`keydown`,r,!0),e.addEventListener(`pointerdown`,i,!0)),()=>{e.removeEventListener(`blur`,t),Mc()&&(e.removeEventListener(`keydown`,r,!0),e.removeEventListener(`pointerdown`,i,!0))}},[o.domReference,n,s]),D.useEffect(()=>{if(!s)return;function e(e){let{reason:t}=e;(t===`reference-press`||t===`escape-key`)&&(l.current=!0)}return i.on(`openchange`,e),()=>{i.off(`openchange`,e)}},[i,s]),D.useEffect(()=>()=>{gc(u)},[]);let f=D.useMemo(()=>({onMouseLeave(){l.current=!1},onFocus(e){if(l.current)return;let t=go(e.nativeEvent);if(c&&fa(t)){if(Mc()&&!e.relatedTarget){if(!d.current&&!bo(t))return}else if(!xo(t))return}r(!0,e.nativeEvent,`focus`)},onBlur(e){l.current=!1;let t=e.relatedTarget,n=e.nativeEvent,i=fa(t)&&t.hasAttribute(hc(`focus-guard`))&&t.getAttribute(`data-type`)===`outside`;u.current=window.setTimeout(()=>{let e=mo(o.domReference?o.domReference.ownerDocument:document);!t&&e===o.domReference||ho(a.current.floatingContext?.refs.floating.current,e)||ho(o.domReference,e)||i||r(!1,n,`focus`)})}}),[a,o.domReference,r,c]);return D.useMemo(()=>s?{reference:f}:{},[s,f])}function Pc(e,t,n){let r=new Map,i=n===`item`,a=e;if(i&&e){let{[Xs]:t,[Zs]:n,...r}=e;a=r}return{...n===`floating`&&{tabIndex:-1,[Ys]:``},...a,...t.map(t=>{let r=t?t[n]:null;return typeof r==`function`?e?r(e):null:r}).concat(e).reduce((e,t)=>(t&&Object.entries(t).forEach(t=>{let[n,a]=t;if(!(i&&[Xs,Zs].includes(n)))if(n.indexOf(`on`)===0){if(r.has(n)||r.set(n,[]),typeof a==`function`){var o;(o=r.get(n))==null||o.push(a),e[n]=function(){var e=[...arguments];return r.get(n)?.map(t=>t(...e)).find(e=>e!==void 0)}}}else e[n]=a}),e),{})}}function Fc(e){e===void 0&&(e=[]);let t=e.map(e=>e?.reference),n=e.map(e=>e?.floating),r=e.map(e=>e?.item),i=D.useCallback(t=>Pc(t,e,`reference`),t),a=D.useCallback(t=>Pc(t,e,`floating`),n),o=D.useCallback(t=>Pc(t,e,`item`),r);return D.useMemo(()=>({getReferenceProps:i,getFloatingProps:a,getItemProps:o}),[i,a,o])}var Ic=new Map([[`select`,`listbox`],[`combobox`,`listbox`],[`label`,!1]]);function Lc(e,t){t===void 0&&(t={});let{open:n,elements:r,floatingId:i}=e,{enabled:a=!0,role:o=`dialog`}=t,s=lc(),c=r.domReference?.id||s,l=D.useMemo(()=>So(r.floating)?.id||i,[r.floating,i]),u=Ic.get(o)??o,d=pc()!=null,f=D.useMemo(()=>u===`tooltip`||o===`label`?{[`aria-`+(o===`label`?`labelledby`:`describedby`)]:n?l:void 0}:{"aria-expanded":n?`true`:`false`,"aria-haspopup":u===`alertdialog`?`dialog`:u,"aria-controls":n?l:void 0,...u===`listbox`&&{role:`combobox`},...u===`menu`&&{id:c},...u===`menu`&&d&&{role:`menuitem`},...o===`select`&&{"aria-autocomplete":`none`},...o===`combobox`&&{"aria-autocomplete":`list`}},[u,l,d,n,c,o]),p=D.useMemo(()=>{let e={id:l,...u&&{role:u}};return u===`tooltip`||o===`label`?e:{...e,...u===`menu`&&{"aria-labelledby":c}}},[u,l,c,o]),m=D.useCallback(e=>{let{active:t,selected:n}=e,r={role:`option`,...t&&{id:l+`-fui-option`}};switch(o){case`select`:case`combobox`:return{...r,"aria-selected":n}}return{}},[l,o]);return D.useMemo(()=>a?{reference:f,floating:p,item:m}:{},[a,f,p,m])}var Rc={root:`m_d57069b5`,content:`m_b1336c6`,viewport:`m_c0783ff9`,viewportInner:`m_f8f631dd`,scrollbar:`m_c44ba933`,thumb:`m_d8b5e363`,corner:`m_21657268`},[zc,Bc]=at(`ScrollArea.Root component was not found in tree`);function Vc(e,t){let n=jt(t);Bt(()=>{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 Hc=(0,D.forwardRef)((e,t)=>{let{style:n,...r}=e,i=Bc(),[a,o]=(0,D.useState)(0),[s,c]=(0,D.useState)(0),l=!!(a&&s);return Vc(i.scrollbarX,()=>{let e=i.scrollbarX?.offsetHeight||0;i.onCornerHeightChange(e),c(e)}),Vc(i.scrollbarY,()=>{let e=i.scrollbarY?.offsetWidth||0;i.onCornerWidthChange(e),o(e)}),l?(0,R.jsx)(`div`,{...r,ref:t,style:{...n,width:a,height:s}}):null}),Uc=(0,D.forwardRef)((e,t)=>{let n=Bc(),r=!!(n.scrollbarX&&n.scrollbarY);return n.type!==`scroll`&&r?(0,R.jsx)(Hc,{...e,ref:t}):null}),Wc={scrollHideDelay:1e3,type:`hover`},Gc=(0,D.forwardRef)((e,t)=>{let{type:n,scrollHideDelay:r,scrollbars:i,getStyles:a,...o}=z(`ScrollAreaRoot`,Wc,e),[s,c]=(0,D.useState)(null),[l,u]=(0,D.useState)(null),[d,f]=(0,D.useState)(null),[p,m]=(0,D.useState)(null),[h,g]=(0,D.useState)(null),[_,v]=(0,D.useState)(0),[y,b]=(0,D.useState)(0),[x,S]=(0,D.useState)(!1),[C,w]=(0,D.useState)(!1),T=mn(t,e=>c(e));return(0,R.jsx)(zc,{value:{type:n,scrollHideDelay:r,scrollArea:s,viewport:l,onViewportChange:u,content:d,onContentChange:f,scrollbarX:p,onScrollbarXChange:m,scrollbarXEnabled:x,onScrollbarXEnabledChange:S,scrollbarY:h,onScrollbarYChange:g,scrollbarYEnabled:C,onScrollbarYEnabledChange:w,onCornerWidthChange:v,onCornerHeightChange:b,getStyles:a},children:(0,R.jsx)(B,{...o,ref:T,__vars:{"--sa-corner-width":i===`xy`?`${_}px`:`0px`,"--sa-corner-height":i===`xy`?`${y}px`:`0px`}})})});Gc.displayName=`@mantine/core/ScrollAreaRoot`;function Kc(e,t){let n=e/t;return Number.isNaN(n)?0:n}function qc(e){let t=Kc(e.viewport,e.content),n=e.scrollbar.paddingStart+e.scrollbar.paddingEnd,r=(e.scrollbar.size-n)*t;return Math.max(r,18)}function Jc(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 Yc(e,[t,n]){return Math.min(n,Math.max(t,e))}function Xc(e,t,n=`ltr`){let r=qc(t),i=t.scrollbar.paddingStart+t.scrollbar.paddingEnd,a=t.scrollbar.size-i,o=t.content-t.viewport,s=a-r,c=Yc(e,n===`ltr`?[0,o]:[o*-1,0]);return Jc([0,o],[0,s])(c)}function Zc(e,t,n,r=`ltr`){let i=qc(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 Jc([c,l],d)(e)}function Qc(e,t){return e>0&&e<t}function $c(e){return e?parseInt(e,10):0}function el(e,t,{checkForDefaultPrevented:n=!0}={}){return r=>{e?.(r),(n===!1||!r.defaultPrevented)&&t?.(r)}}var[tl,nl]=at(`ScrollAreaScrollbar was not found in tree`),rl=(0,D.forwardRef)((e,t)=>{let{sizes:n,hasThumb:r,onThumbChange:i,onThumbPointerUp:a,onThumbPointerDown:o,onThumbPositionChange:s,onDragScroll:c,onWheelScroll:l,onResize:u,...d}=e,f=Bc(),[p,m]=(0,D.useState)(null),h=mn(t,e=>m(e)),g=(0,D.useRef)(null),_=(0,D.useRef)(``),{viewport:v}=f,y=n.content-n.viewport,b=jt(l),x=jt(s),S=Mt(u,10),C=e=>{if(g.current){let t=e.clientX-g.current.left,n=e.clientY-g.current.top;c({x:t,y:n})}};return(0,D.useEffect)(()=>{let e=e=>{let t=e.target;p?.contains(t)&&b(e,y)};return document.addEventListener(`wheel`,e,{passive:!1}),()=>document.removeEventListener(`wheel`,e,{passive:!1})},[v,p,y,b]),(0,D.useEffect)(x,[n,x]),Vc(p,S),Vc(f.content,S),(0,R.jsx)(tl,{value:{scrollbar:p,hasThumb:r,onThumbChange:jt(i),onThumbPointerUp:jt(a),onThumbPositionChange:x,onThumbPointerDown:jt(o)},children:(0,R.jsx)(`div`,{...d,ref:h,"data-mantine-scrollbar":!0,style:{position:`absolute`,...d.style},onPointerDown:el(e.onPointerDown,e=>{e.preventDefault(),e.button===0&&(e.target.setPointerCapture(e.pointerId),g.current=p.getBoundingClientRect(),_.current=document.body.style.webkitUserSelect,document.body.style.webkitUserSelect=`none`,C(e))}),onPointerMove:el(e.onPointerMove,C),onPointerUp:el(e.onPointerUp,e=>{let t=e.target;t.hasPointerCapture(e.pointerId)&&(e.preventDefault(),t.releasePointerCapture(e.pointerId))}),onLostPointerCapture:()=>{document.body.style.webkitUserSelect=_.current,g.current=null}})})}),il=(0,D.forwardRef)((e,t)=>{let{sizes:n,onSizesChange:r,style:i,...a}=e,o=Bc(),[s,c]=(0,D.useState)(),l=(0,D.useRef)(null),u=mn(t,l,o.onScrollbarXChange);return(0,D.useEffect)(()=>{l.current&&c(getComputedStyle(l.current))},[l]),(0,R.jsx)(rl,{"data-orientation":`horizontal`,...a,ref:u,sizes:n,style:{...i,"--sa-thumb-width":`${qc(n)}px`},onThumbPointerDown:t=>e.onThumbPointerDown(t.x),onDragScroll:t=>e.onDragScroll(t.x),onWheelScroll:(t,n)=>{if(o.viewport){let r=o.viewport.scrollLeft+t.deltaX;e.onWheelScroll(r),Qc(r,n)&&t.preventDefault()}},onResize:()=>{l.current&&o.viewport&&s&&r({content:o.viewport.scrollWidth,viewport:o.viewport.offsetWidth,scrollbar:{size:l.current.clientWidth,paddingStart:$c(s.paddingLeft),paddingEnd:$c(s.paddingRight)}})}})});il.displayName=`@mantine/core/ScrollAreaScrollbarX`;var al=(0,D.forwardRef)((e,t)=>{let{sizes:n,onSizesChange:r,style:i,...a}=e,o=Bc(),[s,c]=(0,D.useState)(),l=(0,D.useRef)(null),u=mn(t,l,o.onScrollbarYChange);return(0,D.useEffect)(()=>{l.current&&c(window.getComputedStyle(l.current))},[]),(0,R.jsx)(rl,{...a,"data-orientation":`vertical`,ref:u,sizes:n,style:{"--sa-thumb-height":`${qc(n)}px`,...i},onThumbPointerDown:t=>e.onThumbPointerDown(t.y),onDragScroll:t=>e.onDragScroll(t.y),onWheelScroll:(t,n)=>{if(o.viewport){let r=o.viewport.scrollTop+t.deltaY;e.onWheelScroll(r),Qc(r,n)&&t.preventDefault()}},onResize:()=>{l.current&&o.viewport&&s&&r({content:o.viewport.scrollHeight,viewport:o.viewport.offsetHeight,scrollbar:{size:l.current.clientHeight,paddingStart:$c(s.paddingTop),paddingEnd:$c(s.paddingBottom)}})}})});al.displayName=`@mantine/core/ScrollAreaScrollbarY`;var ol=(0,D.forwardRef)((e,t)=>{let{orientation:n=`vertical`,...r}=e,{dir:i}=Zi(),a=Bc(),o=(0,D.useRef)(null),s=(0,D.useRef)(0),[c,l]=(0,D.useState)({content:0,viewport:0,scrollbar:{size:0,paddingStart:0,paddingEnd:0}}),u=Kc(c.viewport,c.content),d={...r,sizes:c,onSizesChange:l,hasThumb:u>0&&u<1,onThumbChange:e=>{o.current=e},onThumbPointerUp:()=>{s.current=0},onThumbPointerDown:e=>{s.current=e}},f=(e,t)=>Zc(e,s.current,c,t);return n===`horizontal`?(0,R.jsx)(il,{...d,ref:t,onThumbPositionChange:()=>{if(a.viewport&&o.current){let e=a.viewport.scrollLeft,t=Xc(e,c,i);o.current.style.transform=`translate3d(${t}px, 0, 0)`}},onWheelScroll:e=>{a.viewport&&(a.viewport.scrollLeft=e)},onDragScroll:e=>{a.viewport&&(a.viewport.scrollLeft=f(e,i))}}):n===`vertical`?(0,R.jsx)(al,{...d,ref:t,onThumbPositionChange:()=>{if(a.viewport&&o.current){let e=a.viewport.scrollTop,t=Xc(e,c);c.scrollbar.size===0?o.current.style.setProperty(`--thumb-opacity`,`0`):o.current.style.setProperty(`--thumb-opacity`,`1`),o.current.style.transform=`translate3d(0, ${t}px, 0)`}},onWheelScroll:e=>{a.viewport&&(a.viewport.scrollTop=e)},onDragScroll:e=>{a.viewport&&(a.viewport.scrollTop=f(e))}}):null});ol.displayName=`@mantine/core/ScrollAreaScrollbarVisible`;var sl=(0,D.forwardRef)((e,t)=>{let n=Bc(),{forceMount:r,...i}=e,[a,o]=(0,D.useState)(!1),s=e.orientation===`horizontal`,c=Mt(()=>{if(n.viewport){let e=n.viewport.offsetWidth<n.viewport.scrollWidth,t=n.viewport.offsetHeight<n.viewport.scrollHeight;o(s?e:t)}},10);return Vc(n.viewport,c),Vc(n.content,c),r||a?(0,R.jsx)(ol,{"data-state":a?`visible`:`hidden`,...i,ref:t}):null});sl.displayName=`@mantine/core/ScrollAreaScrollbarAuto`;var cl=(0,D.forwardRef)((e,t)=>{let{forceMount:n,...r}=e,i=Bc(),[a,o]=(0,D.useState)(!1);return(0,D.useEffect)(()=>{let{scrollArea:e}=i,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]),n||a?(0,R.jsx)(sl,{"data-state":a?`visible`:`hidden`,...r,ref:t}):null});cl.displayName=`@mantine/core/ScrollAreaScrollbarHover`;var ll=(0,D.forwardRef)((e,t)=>{let{forceMount:n,...r}=e,i=Bc(),a=e.orientation===`horizontal`,[o,s]=(0,D.useState)(`hidden`),c=Mt(()=>s(`idle`),100);return(0,D.useEffect)(()=>{if(o===`idle`){let e=window.setTimeout(()=>s(`hidden`),i.scrollHideDelay);return()=>window.clearTimeout(e)}},[o,i.scrollHideDelay]),(0,D.useEffect)(()=>{let{viewport:e}=i,t=a?`scrollLeft`:`scrollTop`;if(e){let n=e[t],r=()=>{let r=e[t];n!==r&&(s(`scrolling`),c()),n=r};return e.addEventListener(`scroll`,r),()=>e.removeEventListener(`scroll`,r)}},[i.viewport,a,c]),n||o!==`hidden`?(0,R.jsx)(ol,{"data-state":o===`hidden`?`hidden`:`visible`,...r,ref:t,onPointerEnter:el(e.onPointerEnter,()=>s(`interacting`)),onPointerLeave:el(e.onPointerLeave,()=>s(`idle`))}):null}),ul=(0,D.forwardRef)((e,t)=>{let{forceMount:n,...r}=e,i=Bc(),{onScrollbarXEnabledChange:a,onScrollbarYEnabledChange:o}=i,s=e.orientation===`horizontal`;return(0,D.useEffect)(()=>(s?a(!0):o(!0),()=>{s?a(!1):o(!1)}),[s,a,o]),i.type===`hover`?(0,R.jsx)(cl,{...r,ref:t,forceMount:n}):i.type===`scroll`?(0,R.jsx)(ll,{...r,ref:t,forceMount:n}):i.type===`auto`?(0,R.jsx)(sl,{...r,ref:t,forceMount:n}):i.type===`always`?(0,R.jsx)(ol,{...r,ref:t}):null});ul.displayName=`@mantine/core/ScrollAreaScrollbar`;function dl(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)}var fl=(0,D.forwardRef)((e,t)=>{let{style:n,...r}=e,i=Bc(),a=nl(),{onThumbPositionChange:o}=a,s=mn(t,e=>a.onThumbChange(e)),c=(0,D.useRef)(void 0),l=Mt(()=>{c.current&&=(c.current(),void 0)},100);return(0,D.useEffect)(()=>{let{viewport:e}=i;if(e){let t=()=>{if(l(),!c.current){let t=dl(e,o);c.current=t,o()}};return o(),e.addEventListener(`scroll`,t),()=>e.removeEventListener(`scroll`,t)}},[i.viewport,l,o]),(0,R.jsx)(`div`,{"data-state":a.hasThumb?`visible`:`hidden`,...r,ref:s,style:{width:`var(--sa-thumb-width)`,height:`var(--sa-thumb-height)`,...n},onPointerDownCapture:el(e.onPointerDownCapture,e=>{let t=e.target.getBoundingClientRect(),n=e.clientX-t.left,r=e.clientY-t.top;a.onThumbPointerDown({x:n,y:r})}),onPointerUp:el(e.onPointerUp,a.onThumbPointerUp)})});fl.displayName=`@mantine/core/ScrollAreaThumb`;var pl=(0,D.forwardRef)((e,t)=>{let{forceMount:n,...r}=e,i=nl();return n||i.hasThumb?(0,R.jsx)(fl,{ref:t,...r}):null});pl.displayName=`@mantine/core/ScrollAreaThumb`;var ml=(0,D.forwardRef)(({children:e,style:t,onWheel:n,...r},i)=>{let a=Bc(),o=mn(i,a.onViewportChange),s=e=>{if(n?.(e),a.scrollbarXEnabled&&a.viewport&&e.shiftKey){let{scrollTop:t,scrollHeight:n,clientHeight:r,scrollWidth:i,clientWidth:o}=a.viewport,s=t<1,c=t>=n-r-1;i>o&&(s||c)&&e.stopPropagation()}};return(0,R.jsx)(B,{...r,ref:o,onWheel:s,style:{overflowX:a.scrollbarXEnabled?`scroll`:`hidden`,overflowY:a.scrollbarYEnabled?`scroll`:`hidden`,...t},children:(0,R.jsx)(`div`,{...a.getStyles(`content`),ref:a.onContentChange,children:e})})});ml.displayName=`@mantine/core/ScrollAreaViewport`;var hl={scrollHideDelay:1e3,type:`hover`,scrollbars:`xy`},gl=jn((e,{scrollbarSize:t,overscrollBehavior:n,scrollbars:r})=>{let i=n;return n&&r&&(r===`x`?i=`${n} auto`:r===`y`&&(i=`auto ${n}`)),{root:{"--scrollarea-scrollbar-size":L(t),"--scrollarea-over-scroll-behavior":i}}}),_l=V((e,t)=>{let n=z(`ScrollArea`,hl,e),{classNames:r,className:i,style:a,styles:o,unstyled:s,scrollbarSize:c,vars:l,type:u,scrollHideDelay:d,viewportProps:f,viewportRef:p,onScrollPositionChange:m,children:h,offsetScrollbars:g,scrollbars:_,onBottomReached:v,onTopReached:y,overscrollBehavior:b,attributes:x,...S}=n,[C,w]=(0,D.useState)(!1),[T,E]=(0,D.useState)(!1),[O,k]=(0,D.useState)(!1),A=oi({name:`ScrollArea`,props:n,classes:Rc,className:i,style:a,classNames:r,styles:o,unstyled:s,attributes:x,vars:l,varsResolver:gl}),j=(0,D.useRef)(null),M=Js([p,j]);return(0,D.useEffect)(()=>{if(!j.current||g!==`present`)return;let e=j.current,t=new ResizeObserver(()=>{let{scrollHeight:t,clientHeight:n,scrollWidth:r,clientWidth:i}=e;E(t>n),k(r>i)});return t.observe(e),()=>t.disconnect()},[j,g]),(0,R.jsxs)(Gc,{getStyles:A,type:u===`never`?`always`:u,scrollHideDelay:d,ref:t,scrollbars:_,...A(`root`),...S,children:[(0,R.jsx)(ml,{...f,...A(`viewport`,{style:f?.style}),ref:M,"data-offset-scrollbars":g===!0?`xy`:g||void 0,"data-scrollbars":_||void 0,"data-horizontal-hidden":g===`present`&&!O?`true`:void 0,"data-vertical-hidden":g===`present`&&!T?`true`:void 0,onScroll:e=>{f?.onScroll?.(e),m?.({x:e.currentTarget.scrollLeft,y:e.currentTarget.scrollTop});let{scrollTop:t,scrollHeight:n,clientHeight:r}=e.currentTarget;t-(n-r)>=-.8&&v?.(),t===0&&y?.()},children:h}),(_===`xy`||_===`x`)&&(0,R.jsx)(ul,{...A(`scrollbar`),orientation:`horizontal`,"data-hidden":u===`never`||g===`present`&&!O||void 0,forceMount:!0,onMouseEnter:()=>w(!0),onMouseLeave:()=>w(!1),children:(0,R.jsx)(pl,{...A(`thumb`)})}),(_===`xy`||_===`y`)&&(0,R.jsx)(ul,{...A(`scrollbar`),orientation:`vertical`,"data-hidden":u===`never`||g===`present`&&!T||void 0,forceMount:!0,onMouseEnter:()=>w(!0),onMouseLeave:()=>w(!1),children:(0,R.jsx)(pl,{...A(`thumb`)})}),(0,R.jsx)(Uc,{...A(`corner`),"data-hovered":C||void 0,"data-hidden":u===`never`||void 0})]})});_l.displayName=`@mantine/core/ScrollArea`;var vl=V((e,t)=>{let{children:n,classNames:r,styles:i,scrollbarSize:a,scrollHideDelay:o,type:s,dir:c,offsetScrollbars:l,overscrollBehavior:u,viewportRef:d,onScrollPositionChange:f,unstyled:p,variant:m,viewportProps:h,scrollbars:g,style:_,vars:v,onBottomReached:y,onTopReached:b,onOverflowChange:x,...S}=z(`ScrollAreaAutosize`,hl,e),C=(0,D.useRef)(null),w=Js([d,C]),[T,E]=(0,D.useState)(!1),O=(0,D.useRef)(!1);return(0,D.useEffect)(()=>{if(!x)return;let e=C.current;if(!e)return;let t=()=>{let t=e.scrollHeight>e.clientHeight;t!==T&&(O.current?x?.(t):(O.current=!0,t&&x?.(!0)),E(t))};t();let n=new ResizeObserver(t);return n.observe(e),()=>n.disconnect()},[x,T]),(0,R.jsx)(B,{...S,ref:t,style:[{display:`flex`,overflow:`hidden`},_],children:(0,R.jsx)(B,{style:{display:`flex`,flexDirection:`column`,flex:1,overflow:`hidden`,...g===`y`&&{minWidth:0},...g===`x`&&{minHeight:0},...g===`xy`&&{minWidth:0,minHeight:0},...g===!1&&{minWidth:0,minHeight:0}},children:(0,R.jsx)(_l,{classNames:r,styles:i,scrollHideDelay:o,scrollbarSize:a,type:s,dir:c,offsetScrollbars:l,overscrollBehavior:u,viewportRef:w,onScrollPositionChange:f,unstyled:p,variant:m,viewportProps:h,vars:v,scrollbars:g,onBottomReached:y,onTopReached:b,"data-autosize":`true`,children:n})})})});_l.classes=Rc,vl.displayName=`@mantine/core/ScrollAreaAutosize`,vl.classes=Rc,_l.Autosize=vl;var yl={root:`m_87cf2631`},bl={__staticSelector:`UnstyledButton`},xl=Yi((e,t)=>{let n=z(`UnstyledButton`,bl,e),{className:r,component:i=`button`,__staticSelector:a,unstyled:o,classNames:s,styles:c,style:l,attributes:u,...d}=n,f=oi({name:a,props:n,classes:yl,className:r,style:l,classNames:s,styles:c,unstyled:o,attributes:u});return(0,R.jsx)(B,{...f(`root`,{focusable:!0}),component:i,ref:t,type:i===`button`?`button`:void 0,...d})});xl.classes=yl,xl.displayName=`@mantine/core/UnstyledButton`;var Sl={root:`m_515a97f8`},Cl=V((e,t)=>{let n=z(`VisuallyHidden`,null,e),{classNames:r,className:i,style:a,styles:o,unstyled:s,vars:c,attributes:l,...u}=n,d=oi({name:`VisuallyHidden`,classes:Sl,props:n,className:i,style:a,classNames:r,styles:o,unstyled:s,attributes:l});return(0,R.jsx)(B,{component:`span`,ref:t,...d(`root`),...u})});Cl.classes=Sl,Cl.displayName=`@mantine/core/VisuallyHidden`;var wl={root:`m_1b7284a3`},Tl=jn((e,{radius:t,shadow:n})=>({root:{"--paper-radius":t===void 0?void 0:yt(t),"--paper-shadow":St(n)}})),El=Yi((e,t)=>{let n=z(`Paper`,null,e),{classNames:r,className:i,style:a,styles:o,unstyled:s,withBorder:c,vars:l,radius:u,shadow:d,variant:f,mod:p,attributes:m,...h}=n,g=oi({name:`Paper`,props:n,classes:wl,className:i,style:a,classNames:r,styles:o,unstyled:s,attributes:m,vars:l,varsResolver:Tl});return(0,R.jsx)(B,{ref:t,mod:[{"data-with-border":c},p],...g(`root`),variant:f,...h})});El.classes=wl,El.displayName=`@mantine/core/Paper`;function Dl(e,t,n,r){return e===`center`||r===`center`?{top:t}:e===`end`?{bottom:n}:e===`start`?{top:n}:{}}function Ol(e,t,n,r,i){return e===`center`||r===`center`?{left:t}:e===`end`?{[i===`ltr`?`right`:`left`]:n}:e===`start`?{[i===`ltr`?`left`:`right`]:n}:{}}var kl={bottom:`borderTopLeftRadius`,left:`borderTopRightRadius`,right:`borderBottomLeftRadius`,top:`borderBottomRightRadius`};function Al({position:e,arrowSize:t,arrowOffset:n,arrowRadius:r,arrowPosition:i,arrowX:a,arrowY:o,dir:s}){let[c,l=`center`]=e.split(`-`),u={width:t,height:t,transform:`rotate(45deg)`,position:`absolute`,[kl[c]]:r},d=-t/2;return c===`left`?{...u,...Dl(l,o,n,i),right:d,borderLeftColor:`transparent`,borderBottomColor:`transparent`,clipPath:`polygon(100% 0, 0 0, 100% 100%)`}:c===`right`?{...u,...Dl(l,o,n,i),left:d,borderRightColor:`transparent`,borderTopColor:`transparent`,clipPath:`polygon(0 100%, 0 0, 100% 100%)`}:c===`top`?{...u,...Ol(l,a,n,i,s),bottom:d,borderTopColor:`transparent`,borderLeftColor:`transparent`,clipPath:`polygon(0 100%, 100% 100%, 100% 0)`}:c===`bottom`?{...u,...Ol(l,a,n,i,s),top:d,borderBottomColor:`transparent`,borderRightColor:`transparent`,clipPath:`polygon(0 100%, 0 0, 100% 0)`}:{}}var jl=(0,D.forwardRef)(({position:e,arrowSize:t,arrowOffset:n,arrowRadius:r,arrowPosition:i,visible:a,arrowX:o,arrowY:s,style:c,...l},u)=>{let{dir:d}=Zi();return a?(0,R.jsx)(`div`,{...l,ref:u,style:{...c,...Al({position:e,arrowSize:t,arrowOffset:n,arrowRadius:r,arrowPosition:i,dir:d,arrowX:o,arrowY:s})}}):null});jl.displayName=`@mantine/core/FloatingArrow`;function Ml(e,t){if(e===`rtl`&&(t.includes(`right`)||t.includes(`left`))){let[e,n]=t.split(`-`),r=e===`right`?`left`:`right`;return n===void 0?r:`${r}-${n}`}return t}var Nl={root:`m_9814e45f`},Pl={zIndex:mt(`modal`)},Fl=jn((e,{gradient:t,color:n,backgroundOpacity:r,blur:i,radius:a,zIndex:o})=>({root:{"--overlay-bg":t||(n!==void 0||r!==void 0)&&cr(n||`#000`,r??.6)||void 0,"--overlay-filter":i?`blur(${L(i)})`:void 0,"--overlay-radius":a===void 0?void 0:yt(a),"--overlay-z-index":o?.toString()}})),Il=Yi((e,t)=>{let n=z(`Overlay`,Pl,e),{classNames:r,className:i,style:a,styles:o,unstyled:s,vars:c,fixed:l,center:u,children:d,radius:f,zIndex:p,gradient:m,blur:h,color:g,backgroundOpacity:_,mod:v,attributes:y,...b}=n,x=oi({name:`Overlay`,props:n,classes:Nl,className:i,style:a,classNames:r,styles:o,unstyled:s,attributes:y,vars:c,varsResolver:Fl});return(0,R.jsx)(B,{ref:t,...x(`root`),mod:[{center:u,fixed:l},v],...b,children:d})});Il.classes=Nl,Il.displayName=`@mantine/core/Overlay`;function Ll(e){let t=document.createElement(`div`);return t.setAttribute(`data-portal`,`true`),typeof e.className==`string`&&t.classList.add(...e.className.split(` `).filter(Boolean)),typeof e.style==`object`&&Object.assign(t.style,e.style),typeof e.id==`string`&&t.setAttribute(`id`,e.id),t}function Rl({target:e,reuseTargetNode:t,...n}){if(e)return typeof e==`string`?document.querySelector(e)||Ll(n):e;if(t){let e=document.querySelector(`[data-mantine-shared-portal-node]`);if(e)return e;let t=Ll(n);return t.setAttribute(`data-mantine-shared-portal-node`,`true`),document.body.appendChild(t),t}return Ll(n)}var zl={reuseTargetNode:!0},Bl=V((e,t)=>{let{children:n,target:r,reuseTargetNode:i,...a}=z(`Portal`,zl,e),[o,s]=(0,D.useState)(!1),c=(0,D.useRef)(null);return Bt(()=>(s(!0),c.current=Rl({target:r,reuseTargetNode:i,...a}),fn(t,c.current),!r&&!i&&c.current&&document.body.appendChild(c.current),()=>{!r&&!i&&c.current&&document.body.removeChild(c.current)}),[r]),!o||!c.current?null:(0,Qi.createPortal)((0,R.jsx)(R.Fragment,{children:n}),c.current)});Bl.displayName=`@mantine/core/Portal`;var Vl=V(({withinPortal:e=!0,children:t,...n},r)=>qn()===`test`||!e?(0,R.jsx)(R.Fragment,{children:t}):(0,R.jsx)(Bl,{ref:r,...n,children:t}));Vl.displayName=`@mantine/core/OptionalPortal`;var Hl=e=>({in:{opacity:1,transform:`scale(1)`},out:{opacity:0,transform:`scale(.9) translateY(${e===`bottom`?10:-10}px)`},transitionProperty:`transform, opacity`}),Ul={fade:{in:{opacity:1},out:{opacity:0},transitionProperty:`opacity`},"fade-up":{in:{opacity:1,transform:`translateY(0)`},out:{opacity:0,transform:`translateY(30px)`},transitionProperty:`opacity, transform`},"fade-down":{in:{opacity:1,transform:`translateY(0)`},out:{opacity:0,transform:`translateY(-30px)`},transitionProperty:`opacity, transform`},"fade-left":{in:{opacity:1,transform:`translateX(0)`},out:{opacity:0,transform:`translateX(30px)`},transitionProperty:`opacity, transform`},"fade-right":{in:{opacity:1,transform:`translateX(0)`},out:{opacity:0,transform:`translateX(-30px)`},transitionProperty:`opacity, transform`},scale:{in:{opacity:1,transform:`scale(1)`},out:{opacity:0,transform:`scale(0)`},common:{transformOrigin:`top`},transitionProperty:`transform, opacity`},"scale-y":{in:{opacity:1,transform:`scaleY(1)`},out:{opacity:0,transform:`scaleY(0)`},common:{transformOrigin:`top`},transitionProperty:`transform, opacity`},"scale-x":{in:{opacity:1,transform:`scaleX(1)`},out:{opacity:0,transform:`scaleX(0)`},common:{transformOrigin:`left`},transitionProperty:`transform, opacity`},"skew-up":{in:{opacity:1,transform:`translateY(0) skew(0deg, 0deg)`},out:{opacity:0,transform:`translateY(-20px) skew(-10deg, -5deg)`},common:{transformOrigin:`top`},transitionProperty:`transform, opacity`},"skew-down":{in:{opacity:1,transform:`translateY(0) skew(0deg, 0deg)`},out:{opacity:0,transform:`translateY(20px) skew(-10deg, -5deg)`},common:{transformOrigin:`bottom`},transitionProperty:`transform, opacity`},"rotate-left":{in:{opacity:1,transform:`translateY(0) rotate(0deg)`},out:{opacity:0,transform:`translateY(20px) rotate(-5deg)`},common:{transformOrigin:`bottom`},transitionProperty:`transform, opacity`},"rotate-right":{in:{opacity:1,transform:`translateY(0) rotate(0deg)`},out:{opacity:0,transform:`translateY(20px) rotate(5deg)`},common:{transformOrigin:`top`},transitionProperty:`transform, opacity`},"slide-down":{in:{opacity:1,transform:`translateY(0)`},out:{opacity:0,transform:`translateY(-100%)`},common:{transformOrigin:`top`},transitionProperty:`transform, opacity`},"slide-up":{in:{opacity:1,transform:`translateY(0)`},out:{opacity:0,transform:`translateY(100%)`},common:{transformOrigin:`bottom`},transitionProperty:`transform, opacity`},"slide-left":{in:{opacity:1,transform:`translateX(0)`},out:{opacity:0,transform:`translateX(100%)`},common:{transformOrigin:`left`},transitionProperty:`transform, opacity`},"slide-right":{in:{opacity:1,transform:`translateX(0)`},out:{opacity:0,transform:`translateX(-100%)`},common:{transformOrigin:`right`},transitionProperty:`transform, opacity`},pop:{...Hl(`bottom`),common:{transformOrigin:`center center`}},"pop-bottom-left":{...Hl(`bottom`),common:{transformOrigin:`bottom left`}},"pop-bottom-right":{...Hl(`bottom`),common:{transformOrigin:`bottom right`}},"pop-top-left":{...Hl(`top`),common:{transformOrigin:`top left`}},"pop-top-right":{...Hl(`top`),common:{transformOrigin:`top right`}}},Wl={entering:`in`,entered:`in`,exiting:`out`,exited:`out`,"pre-exiting":`out`,"pre-entering":`out`};function Gl({transition:e,state:t,duration:n,timingFunction:r}){let i={WebkitBackfaceVisibility:`hidden`,transitionDuration:`${n}ms`,transitionTimingFunction:r};return typeof e==`string`?e in Ul?{transitionProperty:Ul[e].transitionProperty,...i,...Ul[e].common,...Ul[e][Wl[t]]}:{}:{transitionProperty:e.transitionProperty,...i,...e.common,...e[Wl[t]]}}function Kl({duration:e,exitDuration:t,timingFunction:n,mounted:r,onEnter:i,onExit:a,onEntered:o,onExited:s,enterDelay:c,exitDelay:l}){let u=Cr(),d=gn(),f=u.respectReducedMotion?d:!1,[p,m]=(0,D.useState)(f?0:e),[h,g]=(0,D.useState)(r?`entered`:`exited`),_=(0,D.useRef)(-1),v=(0,D.useRef)(-1),y=(0,D.useRef)(-1);function b(){window.clearTimeout(_.current),window.clearTimeout(v.current),cancelAnimationFrame(y.current)}let x=n=>{b();let r=n?i:a,c=n?o:s,l=f?0:n?e:t;m(l),l===0?(typeof r==`function`&&r(),typeof c==`function`&&c(),g(n?`entered`:`exited`)):y.current=requestAnimationFrame(()=>{Qi.flushSync(()=>{g(n?`pre-entering`:`pre-exiting`)}),y.current=requestAnimationFrame(()=>{typeof r==`function`&&r(),g(n?`entering`:`exiting`),_.current=window.setTimeout(()=>{typeof c==`function`&&c(),g(n?`entered`:`exited`)},l)})})},S=e=>{if(b(),typeof(e?c:l)!=`number`){x(e);return}v.current=window.setTimeout(()=>{x(e)},e?c:l)};return Vt(()=>{S(r)},[r]),(0,D.useEffect)(()=>()=>{b()},[]),{transitionDuration:p,transitionStatus:h,transitionTimingFunction:n||`ease`}}function ql({keepMounted:e,transition:t=`fade`,duration:n=250,exitDuration:r=n,mounted:i,children:a,timingFunction:o=`ease`,onExit:s,onEntered:c,onEnter:l,onExited:u,enterDelay:d,exitDelay:f}){let p=qn(),{transitionDuration:m,transitionStatus:h,transitionTimingFunction:g}=Kl({mounted:i,exitDuration:r,duration:n,timingFunction:o,onExit:s,onEntered:c,onEnter:l,onExited:u,enterDelay:d,exitDelay:f});return m===0||p===`test`?i?(0,R.jsx)(R.Fragment,{children:a({})}):e?a({display:`none`}):null:h===`exited`?e?a({display:`none`}):null:(0,R.jsx)(R.Fragment,{children:a(Gl({transition:t,duration:m,state:h,timingFunction:g}))})}ql.displayName=`@mantine/core/Transition`;var[Jl,Yl]=at(`Popover component was not found in the tree`),Xl={dropdown:`m_38a85659`,arrow:`m_a31dc6c1`,overlay:`m_3d7bc908`};function Zl({children:e,active:t=!0,refProp:n=`ref`,innerRef:r}){let i=mn(Qt(t),r),a=An(e);return a?(0,D.cloneElement)(a,{[n]:i}):e}function Ql(e){return(0,R.jsx)(Cl,{tabIndex:-1,"data-autofocus":!0,...e})}Zl.displayName=`@mantine/core/FocusTrap`,Ql.displayName=`@mantine/core/FocusTrapInitialFocus`,Zl.InitialFocus=Ql;var $l=V((e,t)=>{let n=z(`PopoverDropdown`,null,e),{className:r,style:i,vars:a,children:o,onKeyDownCapture:s,variant:c,classNames:l,styles:u,...d}=n,f=Yl(),p=Ht({opened:f.opened,shouldReturnFocus:f.returnFocus}),m=f.withRoles?{"aria-labelledby":f.getTargetId(),id:f.getDropdownId(),role:`dialog`,tabIndex:-1}:{},h=mn(t,f.floating);return f.disabled?null:(0,R.jsx)(Vl,{...f.portalProps,withinPortal:f.withinPortal,children:(0,R.jsx)(ql,{mounted:f.opened,...f.transitionProps,transition:f.transitionProps?.transition||`fade`,duration:f.transitionProps?.duration??150,keepMounted:f.keepMounted,exitDuration:typeof f.transitionProps?.exitDuration==`number`?f.transitionProps.exitDuration:f.transitionProps?.duration,children:e=>(0,R.jsx)(Zl,{active:f.trapFocus&&f.opened,innerRef:h,children:(0,R.jsxs)(B,{...m,...d,variant:c,onKeyDownCapture:gt(()=>{f.onClose?.(),f.onDismiss?.()},{active:f.closeOnEscape,onTrigger:p,onKeyDown:s}),"data-position":f.placement,"data-fixed":f.floatingStrategy===`fixed`||void 0,...f.getStyles(`dropdown`,{className:r,props:n,classNames:l,styles:u,style:[{...e,zIndex:f.zIndex,top:f.y??0,left:f.x??0,width:f.width===`target`?void 0:L(f.width),...f.referenceHidden?{display:`none`}:null},f.resolvedStyles.dropdown,u?.dropdown,i]}),children:[o,(0,R.jsx)(jl,{ref:f.arrowRef,arrowX:f.arrowX,arrowY:f.arrowY,visible:f.withArrow,position:f.placement,arrowSize:f.arrowSize,arrowRadius:f.arrowRadius,arrowOffset:f.arrowOffset,arrowPosition:f.arrowPosition,...f.getStyles(`arrow`,{props:n,classNames:l,styles:u})})]})})})})});$l.classes=Xl,$l.displayName=`@mantine/core/PopoverDropdown`;var eu={refProp:`ref`,popupType:`dialog`},tu=V((e,t)=>{let{children:n,refProp:r,popupType:i,...a}=z(`PopoverTarget`,eu,e),o=An(n);if(!o)throw Error(`Popover.Target component children should be an element or a component that accepts ref. Fragments, strings, numbers and other primitive values are not supported`);let s=a,c=Yl(),l=mn(c.reference,En(o),t),u=c.withRoles?{"aria-haspopup":i,"aria-expanded":c.opened,"aria-controls":c.opened?c.getDropdownId():void 0,id:c.getTargetId()}:{},d=o.props;return(0,D.cloneElement)(o,{...s,...u,...c.targetProps,className:Nn(c.targetProps.className,s.className,d.className),[r]:l,...c.controlled?null:{onClick:()=>{c.onToggle(),d.onClick?.()}}})});tu.displayName=`@mantine/core/PopoverTarget`;function nu(e){if(e===void 0)return{shift:!0,flip:!0};let t={...e};return e.shift===void 0&&(t.shift=!0),e.flip===void 0&&(t.flip=!0),t}function ru(e,t,n){let r=nu(e.middlewares),i=[Bs(e.offset),Gs()];return e.dropdownVisible&&n!==`test`&&e.preventPositionChangeWhenVisible&&(r.flip=!1),r.flip&&i.push(typeof r.flip==`boolean`?Us():Us(r.flip)),r.shift&&i.push(Vs(typeof r.shift==`boolean`?{limiter:Hs(),padding:5}:{limiter:Hs(),padding:5,...r.shift})),r.inline&&i.push(typeof r.inline==`boolean`?Ks():Ks(r.inline)),i.push(qs({element:e.arrowRef,padding:e.arrowOffset})),(r.size||e.width===`target`)&&i.push(Ws({...typeof r.size==`boolean`?{}:r.size,apply({rects:n,availableWidth:i,availableHeight:a,...o}){let s=t().refs.floating.current?.style??{};r.size&&(typeof r.size==`object`&&r.size.apply?r.size.apply({rects:n,availableWidth:i,availableHeight:a,...o}):Object.assign(s,{maxWidth:`${i}px`,maxHeight:`${a}px`})),e.width===`target`&&Object.assign(s,{width:`${n.reference.width}px`})}})),i}function iu(e){let t=qn(),[n,r]=hn({value:e.opened,defaultValue:e.defaultOpened,finalValue:!1,onChange:e.onChange}),i=(0,D.useRef)(n),a=()=>{n&&!e.disabled&&r(!1)},o=()=>{e.disabled||r(!n)},s=jc({strategy:e.strategy,placement:e.preventPositionChangeWhenVisible?e.positionRef.current:e.position,middleware:ru(e,()=>s,t),whileElementsMounted:e.keepMounted?void 0:Cs});return(0,D.useEffect)(()=>{if(!(!s.refs.reference.current||!s.refs.floating.current)&&n)return Cs(s.refs.reference.current,s.refs.floating.current,s.update)},[n,s.update]),Vt(()=>{e.onPositionChange?.(s.placement),e.positionRef.current=s.placement},[s.placement,e.preventPositionChangeWhenVisible]),Vt(()=>{n!==i.current&&(n?e.onOpen?.():e.onClose?.()),i.current=n},[n,e.onClose,e.onOpen]),Bt(()=>{let t=-1;return n&&(t=window.setTimeout(()=>e.setDropdownVisible(!0),4)),()=>{window.clearTimeout(t)}},[n,e.position]),{floating:s,controlled:typeof e.opened==`boolean`,opened:n,onClose:a,onToggle:o}}var au={position:`bottom`,offset:8,positionDependencies:[],transitionProps:{transition:`fade`,duration:150},middlewares:{flip:!0,shift:!0,inline:!1},arrowSize:7,arrowOffset:5,arrowRadius:0,arrowPosition:`side`,closeOnClickOutside:!0,withinPortal:!0,closeOnEscape:!0,trapFocus:!1,withRoles:!0,returnFocus:!1,withOverlay:!1,hideDetached:!0,clickOutsideEvents:[`mousedown`,`touchstart`],zIndex:mt(`popover`),__staticSelector:`Popover`,width:`max-content`},ou=jn((e,{radius:t,shadow:n})=>({dropdown:{"--popover-radius":t===void 0?void 0:yt(t),"--popover-shadow":St(n)}}));function su(e){let t=z(`Popover`,au,e),{children:n,position:r,offset:i,onPositionChange:a,positionDependencies:o,opened:s,transitionProps:c,onExitTransitionEnd:l,onEnterTransitionEnd:u,width:d,middlewares:f,withArrow:p,arrowSize:m,arrowOffset:h,arrowRadius:g,arrowPosition:_,unstyled:v,classNames:y,styles:b,closeOnClickOutside:x,withinPortal:S,portalProps:C,closeOnEscape:w,clickOutsideEvents:T,trapFocus:E,onClose:O,onDismiss:k,onOpen:A,onChange:j,zIndex:M,radius:N,shadow:ee,id:te,defaultOpened:P,__staticSelector:F,withRoles:I,disabled:ne,returnFocus:re,variant:ie,keepMounted:ae,vars:oe,floatingStrategy:se,withOverlay:ce,overlayProps:le,hideDetached:ue,attributes:de,preventPositionChangeWhenVisible:fe,...pe}=t,me=oi({name:F,props:t,classes:Xl,classNames:y,styles:b,unstyled:v,attributes:de,rootSelector:`dropdown`,vars:oe,varsResolver:ou}),{resolvedStyles:he}=Ur({classNames:y,styles:b,props:t}),[ge,_e]=(0,D.useState)(s??P??!1),ve=(0,D.useRef)(r),ye=(0,D.useRef)(null),[be,xe]=(0,D.useState)(null),[Se,Ce]=(0,D.useState)(null),{dir:we}=Zi(),Te=qn(),Ee=rn(te),De=iu({middlewares:f,width:d,position:Ml(we,r),offset:typeof i==`number`?i+(p?m/2:0):i,arrowRef:ye,arrowOffset:h,onPositionChange:a,positionDependencies:o,opened:s,defaultOpened:P,onChange:j,onOpen:A,onClose:O,onDismiss:k,strategy:se,dropdownVisible:ge,setDropdownVisible:_e,positionRef:ve,disabled:ne,preventPositionChangeWhenVisible:fe,keepMounted:ae});Pt(()=>{x&&(De.onClose(),k?.())},T,[be,Se]);let Oe=(0,D.useCallback)(e=>{xe(e),De.floating.refs.setReference(e)},[De.floating.refs.setReference]),ke=(0,D.useCallback)(e=>{Ce(e),De.floating.refs.setFloating(e)},[De.floating.refs.setFloating]),Ae=(0,D.useCallback)(()=>{c?.onExited?.(),l?.(),_e(!1),fe||(ve.current=r)},[c?.onExited,l,fe,r]),je=(0,D.useCallback)(()=>{c?.onEntered?.(),u?.()},[c?.onEntered,u]);return(0,R.jsxs)(Jl,{value:{returnFocus:re,disabled:ne,controlled:De.controlled,reference:Oe,floating:ke,x:De.floating.x,y:De.floating.y,arrowX:De.floating?.middlewareData?.arrow?.x,arrowY:De.floating?.middlewareData?.arrow?.y,opened:De.opened,arrowRef:ye,transitionProps:{...c,onExited:Ae,onEntered:je},width:d,withArrow:p,arrowSize:m,arrowOffset:h,arrowRadius:g,arrowPosition:_,placement:De.floating.placement,trapFocus:E,withinPortal:S,portalProps:C,zIndex:M,radius:N,shadow:ee,closeOnEscape:w,onDismiss:k,onClose:De.onClose,onToggle:De.onToggle,getTargetId:()=>`${Ee}-target`,getDropdownId:()=>`${Ee}-dropdown`,withRoles:I,targetProps:pe,__staticSelector:F,classNames:y,styles:b,unstyled:v,variant:ie,keepMounted:ae,getStyles:me,resolvedStyles:he,floatingStrategy:se,referenceHidden:ue&&Te!==`test`?De.floating.middlewareData.hide?.referenceHidden:!1},children:[n,ce&&(0,R.jsx)(ql,{transition:`fade`,mounted:De.opened,duration:c?.duration||250,exitDuration:c?.exitDuration||250,children:e=>(0,R.jsx)(Vl,{withinPortal:S,children:(0,R.jsx)(Il,{...le,...me(`overlay`,{className:le?.className,style:[e,le?.style]})})})})]})}su.Target=tu,su.Dropdown=$l,su.displayName=`@mantine/core/Popover`,su.extend=e=>e;var cu={root:`m_5ae2e3c`,barsLoader:`m_7a2bd4cd`,bar:`m_870bb79`,"bars-loader-animation":`m_5d2b3b9d`,dotsLoader:`m_4e3f22d7`,dot:`m_870c4af`,"loader-dots-animation":`m_aac34a1`,ovalLoader:`m_b34414df`,"oval-loader-animation":`m_f8e89c4b`},lu=(0,D.forwardRef)(({className:e,...t},n)=>(0,R.jsxs)(B,{component:`span`,className:Nn(cu.barsLoader,e),...t,ref:n,children:[(0,R.jsx)(`span`,{className:cu.bar}),(0,R.jsx)(`span`,{className:cu.bar}),(0,R.jsx)(`span`,{className:cu.bar})]}));lu.displayName=`@mantine/core/Bars`;var uu=(0,D.forwardRef)(({className:e,...t},n)=>(0,R.jsxs)(B,{component:`span`,className:Nn(cu.dotsLoader,e),...t,ref:n,children:[(0,R.jsx)(`span`,{className:cu.dot}),(0,R.jsx)(`span`,{className:cu.dot}),(0,R.jsx)(`span`,{className:cu.dot})]}));uu.displayName=`@mantine/core/Dots`;var du=(0,D.forwardRef)(({className:e,...t},n)=>(0,R.jsx)(B,{component:`span`,className:Nn(cu.ovalLoader,e),...t,ref:n}));du.displayName=`@mantine/core/Oval`;var fu={bars:lu,oval:du,dots:uu},pu={loaders:fu,type:`oval`},mu=jn((e,{size:t,color:n})=>({root:{"--loader-size":_t(t,`loader-size`),"--loader-color":n?or(n,e):void 0}})),hu=V((e,t)=>{let n=z(`Loader`,pu,e),{size:r,color:i,type:a,vars:o,className:s,style:c,classNames:l,styles:u,unstyled:d,loaders:f,variant:p,children:m,attributes:h,...g}=n,_=oi({name:`Loader`,props:n,classes:cu,className:s,style:c,classNames:l,styles:u,unstyled:d,attributes:h,vars:o,varsResolver:mu});return m?(0,R.jsx)(B,{..._(`root`),ref:t,...g,children:m}):(0,R.jsx)(B,{..._(`root`),ref:t,component:f[a],variant:p,size:r,...g})});hu.defaultLoaders=fu,hu.classes=cu,hu.displayName=`@mantine/core/Loader`;var gu={root:`m_8d3f4000`,icon:`m_8d3afb97`,loader:`m_302b9fb1`,group:`m_1a0f1b21`,groupSection:`m_437b6484`},_u={orientation:`horizontal`},vu=jn((e,{borderWidth:t})=>({group:{"--ai-border-width":L(t)}})),yu=V((e,t)=>{let n=z(`ActionIconGroup`,_u,e),{className:r,style:i,classNames:a,styles:o,unstyled:s,orientation:c,vars:l,borderWidth:u,variant:d,mod:f,attributes:p,...m}=z(`ActionIconGroup`,_u,e),h=oi({name:`ActionIconGroup`,props:n,classes:gu,className:r,style:i,classNames:a,styles:o,unstyled:s,attributes:p,vars:l,varsResolver:vu,rootSelector:`group`});return(0,R.jsx)(B,{...h(`group`),ref:t,variant:d,mod:[{"data-orientation":c},f],role:`group`,...m})});yu.classes=gu,yu.displayName=`@mantine/core/ActionIconGroup`;var bu=jn((e,{radius:t,color:n,gradient:r,variant:i,autoContrast:a,size:o})=>{let s=e.variantColorResolver({color:n||e.primaryColor,theme:e,gradient:r,variant:i||`filled`,autoContrast:a});return{groupSection:{"--section-height":_t(o,`section-height`),"--section-padding-x":_t(o,`section-padding-x`),"--section-fz":bt(o),"--section-radius":t===void 0?void 0:yt(t),"--section-bg":n||i?s.background:void 0,"--section-color":s.color,"--section-bd":n||i?s.border:void 0}}}),xu=V((e,t)=>{let n=z(`ActionIconGroupSection`,null,e),{className:r,style:i,classNames:a,styles:o,unstyled:s,vars:c,variant:l,gradient:u,radius:d,autoContrast:f,attributes:p,...m}=n,h=oi({name:`ActionIconGroupSection`,props:n,classes:gu,className:r,style:i,classNames:a,styles:o,unstyled:s,attributes:p,vars:c,varsResolver:bu,rootSelector:`groupSection`});return(0,R.jsx)(B,{...h(`groupSection`),ref:t,variant:l,...m})});xu.classes=gu,xu.displayName=`@mantine/core/ActionIconGroupSection`;var Su=jn((e,{size:t,radius:n,variant:r,gradient:i,color:a,autoContrast:o})=>{let s=e.variantColorResolver({color:a||e.primaryColor,theme:e,gradient:i,variant:r||`filled`,autoContrast:o});return{root:{"--ai-size":_t(t,`ai-size`),"--ai-radius":n===void 0?void 0:yt(n),"--ai-bg":a||r?s.background:void 0,"--ai-hover":a||r?s.hover:void 0,"--ai-hover-color":a||r?s.hoverColor:void 0,"--ai-color":s.color,"--ai-bd":a||r?s.border:void 0}}}),Cu=Yi((e,t)=>{let n=z(`ActionIcon`,null,e),{className:r,unstyled:i,variant:a,classNames:o,styles:s,style:c,loading:l,loaderProps:u,size:d,color:f,radius:p,__staticSelector:m,gradient:h,vars:g,children:_,disabled:v,"data-disabled":y,autoContrast:b,mod:x,attributes:S,...C}=n,w=oi({name:[`ActionIcon`,m],props:n,className:r,style:c,classes:gu,classNames:o,styles:s,unstyled:i,attributes:S,vars:g,varsResolver:Su});return(0,R.jsxs)(xl,{...w(`root`,{active:!v&&!l&&!y}),...C,unstyled:i,variant:a,size:d,disabled:v||l,ref:t,mod:[{loading:l,disabled:v||y},x],children:[typeof l==`boolean`&&(0,R.jsx)(ql,{mounted:l,transition:`slide-down`,duration:150,children:e=>(0,R.jsx)(B,{component:`span`,...w(`loader`,{style:e}),"aria-hidden":!0,children:(0,R.jsx)(hu,{color:`var(--ai-color)`,size:`calc(var(--ai-size) * 0.55)`,...u})})}),(0,R.jsx)(B,{component:`span`,mod:{loading:l},...w(`icon`),children:_})]})});Cu.classes=gu,Cu.displayName=`@mantine/core/ActionIcon`,Cu.Group=yu,Cu.GroupSection=xu;var wu=(0,D.forwardRef)(({size:e=`var(--cb-icon-size, 70%)`,style:t,...n},r)=>(0,R.jsx)(`svg`,{viewBox:`0 0 15 15`,fill:`none`,xmlns:`http://www.w3.org/2000/svg`,style:{...t,width:e,height:e},ref:r,...n,children:(0,R.jsx)(`path`,{d:`M11.7816 4.03157C12.0062 3.80702 12.0062 3.44295 11.7816 3.2184C11.5571 2.99385 11.193 2.99385 10.9685 3.2184L7.50005 6.68682L4.03164 3.2184C3.80708 2.99385 3.44301 2.99385 3.21846 3.2184C2.99391 3.44295 2.99391 3.80702 3.21846 4.03157L6.68688 7.49999L3.21846 10.9684C2.99391 11.193 2.99391 11.557 3.21846 11.7816C3.44301 12.0061 3.80708 12.0061 4.03164 11.7816L7.50005 8.31316L10.9685 11.7816C11.193 12.0061 11.5571 12.0061 11.7816 11.7816C12.0062 11.557 12.0062 11.193 11.7816 10.9684L8.31322 7.49999L11.7816 4.03157Z`,fill:`currentColor`,fillRule:`evenodd`,clipRule:`evenodd`})}));wu.displayName=`@mantine/core/CloseIcon`;var Tu={root:`m_86a44da5`,"root--subtle":`m_220c80f2`},Eu={variant:`subtle`},Du=jn((e,{size:t,radius:n,iconSize:r})=>({root:{"--cb-size":_t(t,`cb-size`),"--cb-radius":n===void 0?void 0:yt(n),"--cb-icon-size":L(r)}})),Ou=Yi((e,t)=>{let n=z(`CloseButton`,Eu,e),{iconSize:r,children:i,vars:a,radius:o,className:s,classNames:c,style:l,styles:u,unstyled:d,"data-disabled":f,disabled:p,variant:m,icon:h,mod:g,attributes:_,__staticSelector:v,...y}=n,b=oi({name:v||`CloseButton`,props:n,className:s,style:l,classes:Tu,classNames:c,styles:u,unstyled:d,attributes:_,vars:a,varsResolver:Du});return(0,R.jsxs)(xl,{ref:t,...y,unstyled:d,variant:m,disabled:p,mod:[{disabled:p||f},g],...b(`root`,{variant:m,active:!p&&!f}),children:[h||(0,R.jsx)(wu,{}),i]})});Ou.classes=Tu,Ou.displayName=`@mantine/core/CloseButton`;function ku(e){return D.Children.toArray(e).filter(Boolean)}var Au={root:`m_4081bf90`},ju={preventGrowOverflow:!0,gap:`md`,align:`center`,justify:`flex-start`,wrap:`wrap`},Mu=jn((e,{grow:t,preventGrowOverflow:n,gap:r,align:i,justify:a,wrap:o},{childWidth:s})=>({root:{"--group-child-width":t&&n?s:void 0,"--group-gap":vt(r),"--group-align":i,"--group-justify":a,"--group-wrap":o}})),H=V((e,t)=>{let n=z(`Group`,ju,e),{classNames:r,className:i,style:a,styles:o,unstyled:s,children:c,gap:l,align:u,justify:d,wrap:f,grow:p,preventGrowOverflow:m,vars:h,variant:g,__size:_,mod:v,attributes:y,...b}=n,x=ku(c),S=x.length,C=vt(l??`md`),w=oi({name:`Group`,props:n,stylesCtx:{childWidth:`calc(${100/S}% - (${C} - ${C} / ${S}))`},className:i,style:a,classes:Au,classNames:r,styles:o,unstyled:s,attributes:y,vars:h,varsResolver:Mu});return(0,R.jsx)(B,{...w(`root`),ref:t,variant:g,mod:[{grow:p},v],size:_,...b,children:x})});H.classes=Au,H.displayName=`@mantine/core/Group`;var[Nu,Pu]=at(`ModalBase component was not found in tree`);function Fu({opened:e,transitionDuration:t}){let[n,r]=(0,D.useState)(e),i=(0,D.useRef)(-1),a=gn()?0:t;return(0,D.useEffect)(()=>(e?(r(!0),window.clearTimeout(i.current)):a===0?r(!1):i.current=window.setTimeout(()=>r(!1),a),()=>window.clearTimeout(i.current)),[e,a]),n}function Iu({id:e,transitionProps:t,opened:n,trapFocus:r,closeOnEscape:i,onClose:a,returnFocus:o}){let s=rn(e),[c,l]=(0,D.useState)(!1),[u,d]=(0,D.useState)(!1),f=Fu({opened:n,transitionDuration:typeof t?.duration==`number`?t?.duration:200});return an(`keydown`,e=>{e.key===`Escape`&&i&&!e.isComposing&&n&&e.target?.getAttribute(`data-mantine-stop-propagation`)!==`true`&&a()},{capture:!0}),Ht({opened:n,shouldReturnFocus:r&&o}),{_id:s,titleMounted:c,bodyMounted:u,shouldLockScroll:f,setTitleMounted:l,setBodyMounted:d}}var Lu=(0,D.forwardRef)(({keepMounted:e,opened:t,onClose:n,id:r,transitionProps:i,onExitTransitionEnd:a,onEnterTransitionEnd:o,trapFocus:s,closeOnEscape:c,returnFocus:l,closeOnClickOutside:u,withinPortal:d,portalProps:f,lockScroll:p,children:m,zIndex:h,shadow:g,padding:_,__vars:v,unstyled:y,removeScrollProps:b,...x},S)=>{let{_id:C,titleMounted:w,bodyMounted:T,shouldLockScroll:E,setTitleMounted:D,setBodyMounted:O}=Iu({id:r,transitionProps:i,opened:t,trapFocus:s,closeOnEscape:c,onClose:n,returnFocus:l}),{key:k,...A}=b||{};return(0,R.jsx)(Vl,{...f,withinPortal:d,children:(0,R.jsx)(Nu,{value:{opened:t,onClose:n,closeOnClickOutside:u,onExitTransitionEnd:a,onEnterTransitionEnd:o,transitionProps:{...i,keepMounted:e},getTitleId:()=>`${C}-title`,getBodyId:()=>`${C}-body`,titleMounted:w,bodyMounted:T,setTitleMounted:D,setBodyMounted:O,trapFocus:s,closeOnEscape:c,zIndex:h,unstyled:y},children:(0,R.jsx)(Ge,{enabled:E&&p,...A,children:(0,R.jsx)(B,{ref:S,...x,__vars:{...v,"--mb-z-index":(h||mt(`modal`)).toString(),"--mb-shadow":St(g),"--mb-padding":vt(_)},children:m})},k)})})});Lu.displayName=`@mantine/core/ModalBase`;var Ru={title:`m_615af6c9`,header:`m_b5489c3c`,inner:`m_60c222c7`,content:`m_fd1ab0aa`,close:`m_606cb269`,body:`m_5df29311`};function zu(){let e=Pu();return(0,D.useEffect)(()=>(e.setBodyMounted(!0),()=>e.setBodyMounted(!1)),[]),e.getBodyId()}var Bu=(0,D.forwardRef)(({className:e,...t},n)=>{let r=zu(),i=Pu();return(0,R.jsx)(B,{ref:n,...t,id:r,className:Nn({[Ru.body]:!i.unstyled},e)})});Bu.displayName=`@mantine/core/ModalBaseBody`;var Vu=(0,D.forwardRef)(({className:e,onClick:t,...n},r)=>{let i=Pu();return(0,R.jsx)(Ou,{ref:r,...n,onClick:e=>{i.onClose(),t?.(e)},className:Nn({[Ru.close]:!i.unstyled},e),unstyled:i.unstyled})});Vu.displayName=`@mantine/core/ModalBaseCloseButton`;var Hu=(0,D.forwardRef)(({transitionProps:e,className:t,innerProps:n,onKeyDown:r,style:i,...a},o)=>{let s=Pu();return(0,R.jsx)(ql,{mounted:s.opened,transition:`pop`,...s.transitionProps,onExited:()=>{s.onExitTransitionEnd?.(),s.transitionProps?.onExited?.()},onEntered:()=>{s.onEnterTransitionEnd?.(),s.transitionProps?.onEntered?.()},...e,children:e=>(0,R.jsx)(`div`,{...n,className:Nn({[Ru.inner]:!s.unstyled},n.className),children:(0,R.jsx)(Zl,{active:s.opened&&s.trapFocus,innerRef:o,children:(0,R.jsx)(El,{...a,component:`section`,role:`dialog`,tabIndex:-1,"aria-modal":!0,"aria-describedby":s.bodyMounted?s.getBodyId():void 0,"aria-labelledby":s.titleMounted?s.getTitleId():void 0,style:[i,e],className:Nn({[Ru.content]:!s.unstyled},t),unstyled:s.unstyled,children:a.children})})})})});Hu.displayName=`@mantine/core/ModalBaseContent`;var Uu=(0,D.forwardRef)(({className:e,...t},n)=>{let r=Pu();return(0,R.jsx)(B,{component:`header`,ref:n,className:Nn({[Ru.header]:!r.unstyled},e),...t})});Uu.displayName=`@mantine/core/ModalBaseHeader`;var Wu={duration:200,timingFunction:`ease`,transition:`fade`};function Gu(e){let t=Pu();return{...Wu,...t.transitionProps,...e}}var Ku=(0,D.forwardRef)(({onClick:e,transitionProps:t,style:n,visible:r,...i},a)=>{let o=Pu(),s=Gu(t);return(0,R.jsx)(ql,{mounted:r===void 0?o.opened:r,...s,transition:`fade`,children:t=>(0,R.jsx)(Il,{ref:a,fixed:!0,style:[n,t],zIndex:o.zIndex,unstyled:o.unstyled,onClick:t=>{e?.(t),o.closeOnClickOutside&&o.onClose()},...i})})});Ku.displayName=`@mantine/core/ModalBaseOverlay`;function qu(){let e=Pu();return(0,D.useEffect)(()=>(e.setTitleMounted(!0),()=>e.setTitleMounted(!1)),[]),e.getTitleId()}var Ju=(0,D.forwardRef)(({className:e,...t},n)=>{let r=qu(),i=Pu();return(0,R.jsx)(B,{component:`h2`,ref:n,className:Nn({[Ru.title]:!i.unstyled},e),...t,id:r})});Ju.displayName=`@mantine/core/ModalBaseTitle`;function Yu({children:e}){return(0,R.jsx)(R.Fragment,{children:e})}var[Xu,Zu]=ot({size:`sm`}),Qu={wrapper:`m_6c018570`,input:`m_8fb7ebe7`,section:`m_82577fc2`,placeholder:`m_88bacfd0`,root:`m_46b77525`,label:`m_8fdc1311`,required:`m_78a94662`,error:`m_8f816625`,description:`m_fe47ce59`},$u=V((e,t)=>{let n=z(`InputClearButton`,null,e),{size:r,variant:i,vars:a,classNames:o,styles:s,...c}=n,l=Zu(),{resolvedClassNames:u,resolvedStyles:d}=Ur({classNames:o,styles:s,props:n});return(0,R.jsx)(Ou,{variant:i||`transparent`,ref:t,size:r||l?.size||`sm`,classNames:u,styles:d,__staticSelector:`InputClearButton`,style:{pointerEvents:`all`,background:`var(--input-bg)`,...c.style},...c})});$u.displayName=`@mantine/core/InputClearButton`;var ed={xs:7,sm:8,md:10,lg:12,xl:15};function td({__clearable:e,__clearSection:t,rightSection:n,__defaultRightSection:r,size:i=`sm`}){let a=e&&t;return a&&(n||r)?(0,R.jsxs)(`div`,{"data-combined-clear-section":!0,style:{display:`flex`,gap:2,alignItems:`center`,paddingInlineEnd:ed[i]},children:[a,n||r]}):n===null?null:n||a||r}var[nd,rd]=ot({offsetBottom:!1,offsetTop:!1,describedBy:void 0,getStyles:null,inputId:void 0,labelId:void 0}),id=jn((e,{size:t})=>({description:{"--input-description-size":t===void 0?void 0:`calc(${bt(t)} - ${L(2)})`}})),ad=V((e,t)=>{let n=z(`InputDescription`,null,e),{classNames:r,className:i,style:a,styles:o,unstyled:s,vars:c,size:l,__staticSelector:u,__inheritStyles:d=!0,attributes:f,variant:p,...m}=z(`InputDescription`,null,n),h=rd(),g=oi({name:[`InputWrapper`,u],props:n,classes:Qu,className:i,style:a,classNames:r,styles:o,unstyled:s,attributes:f,rootSelector:`description`,vars:c,varsResolver:id}),_=d&&h?.getStyles||g;return(0,R.jsx)(B,{component:`p`,ref:t,variant:p,size:l,..._(`description`,h?.getStyles?{className:i,style:a}:void 0),...m})});ad.classes=Qu,ad.displayName=`@mantine/core/InputDescription`;var od=jn((e,{size:t})=>({error:{"--input-error-size":t===void 0?void 0:`calc(${bt(t)} - ${L(2)})`}})),sd=V((e,t)=>{let n=z(`InputError`,null,e),{classNames:r,className:i,style:a,styles:o,unstyled:s,vars:c,size:l,attributes:u,__staticSelector:d,__inheritStyles:f=!0,variant:p,...m}=n,h=oi({name:[`InputWrapper`,d],props:n,classes:Qu,className:i,style:a,classNames:r,styles:o,unstyled:s,attributes:u,rootSelector:`error`,vars:c,varsResolver:od}),g=rd(),_=f&&g?.getStyles||h;return(0,R.jsx)(B,{component:`p`,ref:t,variant:p,size:l,..._(`error`,g?.getStyles?{className:i,style:a}:void 0),...m})});sd.classes=Qu,sd.displayName=`@mantine/core/InputError`;var cd={labelElement:`label`},ld=jn((e,{size:t})=>({label:{"--input-label-size":bt(t),"--input-asterisk-color":void 0}})),ud=V((e,t)=>{let n=z(`InputLabel`,cd,e),{classNames:r,className:i,style:a,styles:o,unstyled:s,vars:c,labelElement:l,size:u,required:d,htmlFor:f,onMouseDown:p,children:m,__staticSelector:h,variant:g,mod:_,attributes:v,...y}=z(`InputLabel`,cd,n),b=oi({name:[`InputWrapper`,h],props:n,classes:Qu,className:i,style:a,classNames:r,styles:o,unstyled:s,attributes:v,rootSelector:`label`,vars:c,varsResolver:ld}),x=rd(),S=x?.getStyles||b;return(0,R.jsxs)(B,{...S(`label`,x?.getStyles?{className:i,style:a}:void 0),component:l,variant:g,size:u,ref:t,htmlFor:l===`label`?f:void 0,mod:[{required:d},_],onMouseDown:e=>{p?.(e),!e.defaultPrevented&&e.detail>1&&e.preventDefault()},...y,children:[m,d&&(0,R.jsx)(`span`,{...S(`required`),"aria-hidden":!0,children:` *`})]})});ud.classes=Qu,ud.displayName=`@mantine/core/InputLabel`;var dd=V((e,t)=>{let n=z(`InputPlaceholder`,null,e),{classNames:r,className:i,style:a,styles:o,unstyled:s,vars:c,__staticSelector:l,variant:u,error:d,mod:f,attributes:p,...m}=n,h=oi({name:[`InputPlaceholder`,l],props:n,classes:Qu,className:i,style:a,classNames:r,styles:o,unstyled:s,attributes:p,rootSelector:`placeholder`});return(0,R.jsx)(B,{...h(`placeholder`),mod:[{error:!!d},f],component:`span`,variant:u,ref:t,...m})});dd.classes=Qu,dd.displayName=`@mantine/core/InputPlaceholder`;function fd(e,{hasDescription:t,hasError:n}){let r=e.findIndex(e=>e===`input`),i=e.slice(0,r),a=e.slice(r+1),o=t&&i.includes(`description`)||n&&i.includes(`error`);return{offsetBottom:t&&a.includes(`description`)||n&&a.includes(`error`),offsetTop:o}}var pd={labelElement:`label`,inputContainer:e=>e,inputWrapperOrder:[`label`,`description`,`input`,`error`]},md=jn((e,{size:t})=>({label:{"--input-label-size":bt(t),"--input-asterisk-color":void 0},error:{"--input-error-size":t===void 0?void 0:`calc(${bt(t)} - ${L(2)})`},description:{"--input-description-size":t===void 0?void 0:`calc(${bt(t)} - ${L(2)})`}})),hd=V((e,t)=>{let n=z(`InputWrapper`,pd,e),{classNames:r,className:i,style:a,styles:o,unstyled:s,vars:c,size:l,variant:u,__staticSelector:d,inputContainer:f,inputWrapperOrder:p,label:m,error:h,description:g,labelProps:_,descriptionProps:v,errorProps:y,labelElement:b,children:x,withAsterisk:S,id:C,required:w,__stylesApiProps:T,mod:E,attributes:O,...k}=n,A=oi({name:[`InputWrapper`,d],props:T||n,classes:Qu,className:i,style:a,classNames:r,styles:o,unstyled:s,attributes:O,vars:c,varsResolver:md}),j={size:l,variant:u,__staticSelector:d},M=rn(C),N=typeof S==`boolean`?S:w,ee=y?.id||`${M}-error`,te=v?.id||`${M}-description`,P=M,F=!!h&&typeof h!=`boolean`,I=!!g,ne=`${F?ee:``} ${I?te:``}`,re=ne.trim().length>0?ne.trim():void 0,ie=_?.id||`${M}-label`,ae=m&&(0,R.jsx)(ud,{labelElement:b,id:ie,htmlFor:P,required:N,...j,..._,children:m},`label`),oe=I&&(0,R.jsx)(ad,{...v,...j,size:v?.size||j.size,id:v?.id||te,children:g},`description`),se=(0,R.jsx)(D.Fragment,{children:f(x)},`input`),ce=F&&(0,D.createElement)(sd,{...y,...j,size:y?.size||j.size,key:`error`,id:y?.id||ee},h),le=p.map(e=>{switch(e){case`label`:return ae;case`input`:return se;case`description`:return oe;case`error`:return ce;default:return null}});return(0,R.jsx)(nd,{value:{getStyles:A,describedBy:re,inputId:P,labelId:ie,...fd(p,{hasDescription:I,hasError:F})},children:(0,R.jsx)(B,{ref:t,variant:u,size:l,mod:[{error:!!h},E],...A(`root`),...k,children:le})})});hd.classes=Qu,hd.displayName=`@mantine/core/InputWrapper`;var gd={variant:`default`,leftSectionPointerEvents:`none`,rightSectionPointerEvents:`none`,withAria:!0,withErrorStyles:!0,size:`sm`},_d=jn((e,t,n)=>({wrapper:{"--input-margin-top":n.offsetTop?`calc(var(--mantine-spacing-xs) / 2)`:void 0,"--input-margin-bottom":n.offsetBottom?`calc(var(--mantine-spacing-xs) / 2)`:void 0,"--input-height":_t(t.size,`input-height`),"--input-fz":bt(t.size),"--input-radius":t.radius===void 0?void 0:yt(t.radius),"--input-left-section-width":t.leftSectionWidth===void 0?void 0:L(t.leftSectionWidth),"--input-right-section-width":t.rightSectionWidth===void 0?void 0:L(t.rightSectionWidth),"--input-padding-y":t.multiline?_t(t.size,`input-padding-y`):void 0,"--input-left-section-pointer-events":t.leftSectionPointerEvents,"--input-right-section-pointer-events":t.rightSectionPointerEvents}})),vd=Yi((e,t)=>{let n=z(`Input`,gd,e),{classNames:r,className:i,style:a,styles:o,unstyled:s,required:c,__staticSelector:l,__stylesApiProps:u,size:d,wrapperProps:f,error:p,disabled:m,leftSection:h,leftSectionProps:g,leftSectionWidth:_,rightSection:v,rightSectionProps:y,rightSectionWidth:b,rightSectionPointerEvents:x,leftSectionPointerEvents:S,variant:C,vars:w,pointer:T,multiline:E,radius:D,id:O,withAria:k,withErrorStyles:A,mod:j,inputSize:M,attributes:N,__clearSection:ee,__clearable:te,__defaultRightSection:P,...F}=n,{styleProps:I,rest:ne}=hi(F),re=rd(),ie={offsetBottom:re?.offsetBottom,offsetTop:re?.offsetTop},ae=oi({name:[`Input`,l],props:u||n,classes:Qu,className:i,style:a,classNames:r,styles:o,unstyled:s,attributes:N,stylesCtx:ie,rootSelector:`wrapper`,vars:w,varsResolver:_d}),oe=k?{required:c,disabled:m,"aria-invalid":!!p,"aria-describedby":re?.describedBy,id:re?.inputId||O}:{},se=td({__clearable:te,__clearSection:ee,rightSection:v,__defaultRightSection:P,size:d});return(0,R.jsx)(Xu,{value:{size:d||`sm`},children:(0,R.jsxs)(B,{...ae(`wrapper`),...I,...f,mod:[{error:!!p&&A,pointer:T,disabled:m,multiline:E,"data-with-right-section":!!se,"data-with-left-section":!!h},j],variant:C,size:d,children:[h&&(0,R.jsx)(`div`,{...g,"data-position":`left`,...ae(`section`,{className:g?.className,style:g?.style}),children:h}),(0,R.jsx)(B,{component:`input`,...ne,...oe,ref:t,required:c,mod:{disabled:m,error:!!p&&A},variant:C,__size:M,...ae(`input`)}),se&&(0,R.jsx)(`div`,{...y,"data-position":`right`,...ae(`section`,{className:y?.className,style:y?.style}),children:se})]})})});vd.classes=Qu,vd.Wrapper=hd,vd.Label=ud,vd.Error=sd,vd.Description=ad,vd.Placeholder=dd,vd.ClearButton=$u,vd.displayName=`@mantine/core/Input`;function yd(e,t,n){let r=z(e,t,n),{label:i,description:a,error:o,required:s,classNames:c,styles:l,className:u,unstyled:d,__staticSelector:f,__stylesApiProps:p,errorProps:m,labelProps:h,descriptionProps:g,wrapperProps:_,id:v,size:y,style:b,inputContainer:x,inputWrapperOrder:S,withAsterisk:C,variant:w,vars:T,mod:E,attributes:D,...O}=r,{styleProps:k,rest:A}=hi(O),j={label:i,description:a,error:o,required:s,classNames:c,className:u,__staticSelector:f,__stylesApiProps:p||r,errorProps:m,labelProps:h,descriptionProps:g,unstyled:d,styles:l,size:y,style:b,inputContainer:x,inputWrapperOrder:S,withAsterisk:C,variant:w,id:v,mod:E,attributes:D,..._};return{...A,classNames:c,styles:l,unstyled:d,wrapperProps:{...j,...k},inputProps:{required:s,classNames:c,styles:l,unstyled:d,size:y,__staticSelector:f,__stylesApiProps:p||r,error:o,variant:w,id:v,attributes:D}}}var bd={__staticSelector:`InputBase`,withAria:!0,size:`sm`},xd=Yi((e,t)=>{let{inputProps:n,wrapperProps:r,...i}=yd(`InputBase`,bd,e);return(0,R.jsx)(vd.Wrapper,{...r,children:(0,R.jsx)(vd,{...n,...i,ref:t})})});xd.classes={...vd.classes,...vd.Wrapper.classes},xd.displayName=`@mantine/core/InputBase`;var Sd={gap:{type:`spacing`,property:`gap`},rowGap:{type:`spacing`,property:`rowGap`},columnGap:{type:`spacing`,property:`columnGap`},align:{type:`identity`,property:`alignItems`},justify:{type:`identity`,property:`justifyContent`},wrap:{type:`identity`,property:`flexWrap`},direction:{type:`identity`,property:`flexDirection`}},Cd={root:`m_8bffd616`},wd=Yi((e,t)=>{let n=z(`Flex`,null,e),{classNames:r,className:i,style:a,styles:o,unstyled:s,vars:c,gap:l,rowGap:u,columnGap:d,align:f,justify:p,wrap:m,direction:h,attributes:g,..._}=n,v=oi({name:`Flex`,classes:Cd,props:n,className:i,style:a,classNames:r,styles:o,unstyled:s,attributes:g,vars:c}),y=Cr(),b=Ri(),x=Li({styleProps:{gap:l,rowGap:u,columnGap:d,align:f,justify:p,wrap:m,direction:h},theme:y,data:Sd});return(0,R.jsxs)(R.Fragment,{children:[x.hasResponsiveStyles&&(0,R.jsx)(mi,{selector:`.${b}`,styles:x.styles,media:x.media}),(0,R.jsx)(B,{ref:t,...v(`root`,{className:b,style:tt(x.inlineStyles)}),..._})]})});wd.classes=Cd,wd.displayName=`@mantine/core/Flex`;var Td={root:`m_96b553a6`};function Ed(e,t){if(!t||!e)return!1;let n=t.parentNode;for(;n!=null;){if(n===e)return!0;n=n.parentNode}return!1}function Dd({target:e,parent:t,ref:n,displayAfterTransitionEnd:r}){let i=(0,D.useRef)(-1),[a,o]=(0,D.useState)(!1),[s,c]=(0,D.useState)(typeof r==`boolean`&&r),l=()=>{if(!e||!t||!n.current)return;let r=e.getBoundingClientRect(),i=t.getBoundingClientRect(),a=window.getComputedStyle(e),o=window.getComputedStyle(t),s=$c(a.borderTopWidth)+$c(o.borderTopWidth),c=$c(a.borderLeftWidth)+$c(o.borderLeftWidth),l={top:r.top-i.top-s,left:r.left-i.left-c,width:r.width,height:r.height};n.current.style.transform=`translateY(${l.top}px) translateX(${l.left}px)`,n.current.style.width=`${l.width}px`,n.current.style.height=`${l.height}px`},u=()=>{window.clearTimeout(i.current),n.current&&(n.current.style.transitionDuration=`0ms`),l(),i.current=window.setTimeout(()=>{n.current&&(n.current.style.transitionDuration=``)},30)},d=(0,D.useRef)(null),f=(0,D.useRef)(null);return(0,D.useEffect)(()=>{if(l(),e)return d.current=new ResizeObserver(u),d.current.observe(e),t&&(f.current=new ResizeObserver(u),f.current.observe(t)),()=>{d.current?.disconnect(),f.current?.disconnect()}},[t,e]),(0,D.useEffect)(()=>{if(t){let e=e=>{Ed(e.target,t)&&(u(),c(!1))};return t.addEventListener(`transitionend`,e),()=>{t.removeEventListener(`transitionend`,e)}}},[t]),xn(()=>{Tn()!==`test`&&o(!0)},20,{autoInvoke:!0}),Cn(e=>{e.forEach(e=>{e.type===`attributes`&&e.attributeName===`dir`&&u()})},{attributes:!0,attributeFilter:[`dir`]},()=>document.documentElement),{initialized:a,hidden:s}}var Od=jn((e,{transitionDuration:t})=>({root:{"--transition-duration":typeof t==`number`?`${t}ms`:t}})),kd=V((e,t)=>{let n=z(`FloatingIndicator`,null,e),{classNames:r,className:i,style:a,styles:o,unstyled:s,vars:c,target:l,parent:u,transitionDuration:d,mod:f,displayAfterTransitionEnd:p,attributes:m,...h}=n,g=oi({name:`FloatingIndicator`,classes:Td,props:n,className:i,style:a,classNames:r,styles:o,unstyled:s,attributes:m,vars:c,varsResolver:Od}),_=(0,D.useRef)(null),{initialized:v,hidden:y}=Dd({target:l,parent:u,ref:_,displayAfterTransitionEnd:p}),b=mn(t,_);return!l||!u?null:(0,R.jsx)(B,{ref:b,mod:[{initialized:v,hidden:y},f],...g(`root`),...h})});kd.displayName=`@mantine/core/FloatingIndicator`,kd.classes=Td;function Ad({open:e,close:t,openDelay:n,closeDelay:r}){let i=(0,D.useRef)(-1),a=(0,D.useRef)(-1),o=()=>{window.clearTimeout(i.current),window.clearTimeout(a.current)};return(0,D.useEffect)(()=>o,[]),{openDropdown:()=>{o(),n===0||n===void 0?e():i.current=window.setTimeout(e,n)},closeDropdown:()=>{o(),r===0||r===void 0?t():a.current=window.setTimeout(t,r)}}}var[jd,Md]=at(`Accordion component was not found in the tree`),Nd={root:`m_9bdbb667`,panel:`m_df78851f`,content:`m_4ba554d4`,itemTitle:`m_8fa820a0`,control:`m_4ba585b8`,"control--default":`m_6939a5e9`,"control--contained":`m_4271d21b`,label:`m_df3ffa0f`,chevron:`m_3f35ae96`,icon:`m_9bd771fe`,item:`m_9bd7b098`,"item--default":`m_fe19b709`,"item--contained":`m_1f921b3b`,"item--filled":`m_2cdf939a`,"item--separated":`m_9f59b069`};function Pd({style:e,size:t=16,...n}){return(0,R.jsx)(`svg`,{viewBox:`0 0 15 15`,fill:`none`,xmlns:`http://www.w3.org/2000/svg`,style:{...e,width:L(t),height:L(t),display:`block`},...n,children:(0,R.jsx)(`path`,{d:`M3.13523 6.15803C3.3241 5.95657 3.64052 5.94637 3.84197 6.13523L7.5 9.56464L11.158 6.13523C11.3595 5.94637 11.6759 5.95657 11.8648 6.15803C12.0536 6.35949 12.0434 6.67591 11.842 6.86477L7.84197 10.6148C7.64964 10.7951 7.35036 10.7951 7.15803 10.6148L3.15803 6.86477C2.95657 6.67591 2.94637 6.35949 3.13523 6.15803Z`,fill:`currentColor`,fillRule:`evenodd`,clipRule:`evenodd`})})}Pd.displayName=`@mantine/core/AccordionChevron`;var[Fd,Id]=at(`Accordion.Item component was not found in the tree`),Ld=V((e,t)=>{let{classNames:n,className:r,style:i,styles:a,vars:o,chevron:s,icon:c,onClick:l,onKeyDown:u,children:d,disabled:f,mod:p,...m}=z(`AccordionControl`,null,e),{value:h}=Id(),g=Md(),_=g.isItemActive(h),v=typeof g.order==`number`,y=`h${g.order}`,b=(0,R.jsxs)(xl,{...m,...g.getStyles(`control`,{className:r,classNames:n,style:i,styles:a,variant:g.variant}),unstyled:g.unstyled,mod:[`accordion-control`,{active:_,"chevron-position":g.chevronPosition,disabled:f},p],ref:t,onClick:e=>{l?.(e),g.onChange(h)},type:`button`,disabled:f,"aria-expanded":_,"aria-controls":g.getRegionId(h),id:g.getControlId(h),onKeyDown:ft({siblingSelector:`[data-accordion-control]`,parentSelector:`[data-accordion]`,activateOnFocus:!1,loop:g.loop,orientation:`vertical`,onKeyDown:u}),children:[(0,R.jsx)(B,{component:`span`,mod:{rotate:!g.disableChevronRotation&&_,position:g.chevronPosition},...g.getStyles(`chevron`,{classNames:n,styles:a}),children:s||g.chevron}),(0,R.jsx)(`span`,{...g.getStyles(`label`,{classNames:n,styles:a}),children:d}),c&&(0,R.jsx)(B,{component:`span`,mod:{"chevron-position":g.chevronPosition},...g.getStyles(`icon`,{classNames:n,styles:a}),children:c})]});return v?(0,R.jsx)(y,{...g.getStyles(`itemTitle`,{classNames:n,styles:a}),children:b}):b});Ld.displayName=`@mantine/core/AccordionControl`,Ld.classes=Nd;var Rd=V((e,t)=>{let{classNames:n,className:r,style:i,styles:a,vars:o,value:s,mod:c,...l}=z(`AccordionItem`,null,e),u=Md();return(0,R.jsx)(Fd,{value:{value:s},children:(0,R.jsx)(B,{ref:t,mod:[{active:u.isItemActive(s)},c],...u.getStyles(`item`,{className:r,classNames:n,styles:a,style:i,variant:u.variant}),...l})})});Rd.displayName=`@mantine/core/AccordionItem`,Rd.classes=Nd;var zd=V((e,t)=>{let{classNames:n,className:r,style:i,styles:a,vars:o,children:s,...c}=z(`AccordionPanel`,null,e),{value:l}=Id(),u=Md();return(0,R.jsx)(oa,{ref:t,...u.getStyles(`panel`,{className:r,classNames:n,style:i,styles:a}),...c,in:u.isItemActive(l),transitionDuration:u.transitionDuration??200,role:`region`,id:u.getRegionId(l),"aria-labelledby":u.getControlId(l),children:(0,R.jsx)(`div`,{...u.getStyles(`content`,{classNames:n,styles:a}),children:s})})});zd.displayName=`@mantine/core/AccordionPanel`,zd.classes=Nd;var Bd={multiple:!1,disableChevronRotation:!1,chevronPosition:`right`,variant:`default`,chevronSize:`auto`,chevronIconSize:16},Vd=jn((e,{transitionDuration:t,chevronSize:n,radius:r})=>({root:{"--accordion-transition-duration":t===void 0?void 0:`${t}ms`,"--accordion-chevron-size":n===void 0?void 0:L(n),"--accordion-radius":r===void 0?void 0:yt(r)}}));function Hd(e){let t=z(`Accordion`,Bd,e),{classNames:n,className:r,style:i,styles:a,unstyled:o,vars:s,children:c,multiple:l,value:u,defaultValue:d,onChange:f,id:p,loop:m,transitionDuration:h,disableChevronRotation:g,chevronPosition:_,chevronSize:v,order:y,chevron:b,variant:x,radius:S,chevronIconSize:C,attributes:w,...T}=t,E=rn(p),[D,O]=hn({value:u,defaultValue:d,finalValue:l?[]:null,onChange:f}),k=e=>Array.isArray(D)?D.includes(e):e===D,A=e=>{let t=Array.isArray(D)?D.includes(e)?D.filter(t=>t!==e):[...D,e]:e===D?null:e;O(t)},j=oi({name:`Accordion`,classes:Nd,props:t,className:r,style:i,classNames:n,styles:a,unstyled:o,attributes:w,vars:s,varsResolver:Vd});return(0,R.jsx)(jd,{value:{isItemActive:k,onChange:A,getControlId:st(`${E}-control`,`Accordion.Item component was rendered with invalid value or without value`),getRegionId:st(`${E}-panel`,`Accordion.Item component was rendered with invalid value or without value`),chevron:b===null?null:b||(0,R.jsx)(Pd,{size:C}),transitionDuration:h,disableChevronRotation:g,chevronPosition:_,order:y,loop:m,getStyles:j,variant:x,unstyled:o},children:(0,R.jsx)(B,{...j(`root`),id:E,...T,variant:x,"data-accordion":!0,children:c})})}Hd.extend=e=>e,Hd.withProps=Ji(Hd),Hd.classes=Nd,Hd.displayName=`@mantine/core/Accordion`,Hd.Item=Rd,Hd.Panel=zd,Hd.Control=Ld,Hd.Chevron=Pd;var Ud={root:`m_66836ed3`,wrapper:`m_a5d60502`,body:`m_667c2793`,title:`m_6a03f287`,label:`m_698f4f23`,icon:`m_667f2a6a`,message:`m_7fa78076`,closeButton:`m_87f54839`},Wd=jn((e,{radius:t,color:n,variant:r,autoContrast:i})=>{let a=e.variantColorResolver({color:n||e.primaryColor,theme:e,variant:r||`light`,autoContrast:i});return{root:{"--alert-radius":t===void 0?void 0:yt(t),"--alert-bg":n||r?a.background:void 0,"--alert-color":a.color,"--alert-bd":n||r?a.border:void 0}}}),Gd=V((e,t)=>{let n=z(`Alert`,null,e),{classNames:r,className:i,style:a,styles:o,unstyled:s,vars:c,radius:l,color:u,title:d,children:f,id:p,icon:m,withCloseButton:h,onClose:g,closeButtonLabel:_,variant:v,autoContrast:y,role:b,attributes:x,...S}=n,C=oi({name:`Alert`,classes:Ud,props:n,className:i,style:a,classNames:r,styles:o,unstyled:s,attributes:x,vars:c,varsResolver:Wd}),w=rn(p),T=d&&`${w}-title`||void 0,E=`${w}-body`;return(0,R.jsx)(B,{id:w,...C(`root`,{variant:v}),variant:v,ref:t,role:b||`alert`,...S,"aria-describedby":f?E:void 0,"aria-labelledby":d?T:void 0,children:(0,R.jsxs)(`div`,{...C(`wrapper`),children:[m&&(0,R.jsx)(`div`,{...C(`icon`),children:m}),(0,R.jsxs)(`div`,{...C(`body`),children:[d&&(0,R.jsx)(`div`,{...C(`title`),"data-with-close-button":h||void 0,children:(0,R.jsx)(`span`,{id:T,...C(`label`),children:d})}),f&&(0,R.jsx)(`div`,{id:E,...C(`message`),"data-variant":v,children:f})]}),h&&(0,R.jsx)(Ou,{...C(`closeButton`),onClick:g,variant:`transparent`,size:16,iconSize:16,"aria-label":_,unstyled:s})]})})});Gd.classes=Ud,Gd.displayName=`@mantine/core/Alert`;var Kd={root:`m_b6d8b162`};function qd(e){if(e===`start`)return`start`;if(e===`end`||e)return`end`}var Jd={inherit:!1},Yd=jn((e,{variant:t,lineClamp:n,gradient:r,size:i,color:a})=>({root:{"--text-fz":bt(i),"--text-lh":xt(i),"--text-gradient":t===`gradient`?sr(r,e):void 0,"--text-line-clamp":typeof n==`number`?n.toString():void 0,"--text-color":a?or(a,e):void 0}})),U=Yi((e,t)=>{let n=z(`Text`,Jd,e),{lineClamp:r,truncate:i,inline:a,inherit:o,gradient:s,span:c,__staticSelector:l,vars:u,className:d,style:f,classNames:p,styles:m,unstyled:h,variant:g,mod:_,size:v,attributes:y,...b}=n,x=oi({name:[`Text`,l],props:n,classes:Kd,className:d,style:f,classNames:p,styles:m,unstyled:h,attributes:y,vars:u,varsResolver:Yd});return(0,R.jsx)(B,{...x(`root`,{focusable:!0}),ref:t,component:c?`span`:`p`,variant:g,mod:[{"data-truncate":qd(i),"data-line-clamp":typeof r==`number`,"data-inline":a,"data-inherit":o},_],size:v,...b})});U.classes=Kd,U.displayName=`@mantine/core/Text`;var Xd={root:`m_849cf0da`},Zd={underline:`hover`},Qd=Yi((e,t)=>{let{underline:n,className:r,unstyled:i,mod:a,...o}=z(`Anchor`,Zd,e);return(0,R.jsx)(U,{component:`a`,ref:t,className:Nn({[Xd.root]:!i},r),...o,mod:[{underline:n},a],__staticSelector:`Anchor`,unstyled:i})});Qd.classes=Xd,Qd.displayName=`@mantine/core/Anchor`;var[$d,ef]=at(`AppShell was not found in tree`),tf={root:`m_89ab340`,navbar:`m_45252eee`,aside:`m_9cdde9a`,header:`m_3b16f56b`,main:`m_8983817`,footer:`m_3840c879`,section:`m_6dcfc7c7`},nf=V((e,t)=>{let{classNames:n,className:r,style:i,styles:a,unstyled:o,vars:s,withBorder:c,zIndex:l,mod:u,...d}=z(`AppShellAside`,null,e),f=ef();return f.disabled?null:(0,R.jsx)(B,{component:`aside`,ref:t,mod:[{"with-border":c??f.withBorder},u],...f.getStyles(`aside`,{className:Nn({[Ge.classNames.zeroRight]:f.offsetScrollbars},r),classNames:n,styles:a,style:i}),...d,__vars:{"--app-shell-aside-z-index":`calc(${l??f.zIndex} + 1)`}})});nf.classes=tf,nf.displayName=`@mantine/core/AppShellAside`;var rf=V((e,t)=>{let{classNames:n,className:r,style:i,styles:a,unstyled:o,vars:s,withBorder:c,zIndex:l,mod:u,...d}=z(`AppShellFooter`,null,e),f=ef();return f.disabled?null:(0,R.jsx)(B,{component:`footer`,ref:t,mod:[{"with-border":c??f.withBorder},u],...f.getStyles(`footer`,{className:Nn({[Ge.classNames.zeroRight]:f.offsetScrollbars},r),classNames:n,styles:a,style:i}),...d,__vars:{"--app-shell-footer-z-index":(l??f.zIndex)?.toString()}})});rf.classes=tf,rf.displayName=`@mantine/core/AppShellFooter`;var af=V((e,t)=>{let{classNames:n,className:r,style:i,styles:a,unstyled:o,vars:s,withBorder:c,zIndex:l,mod:u,...d}=z(`AppShellHeader`,null,e),f=ef();return f.disabled?null:(0,R.jsx)(B,{component:`header`,ref:t,mod:[{"with-border":c??f.withBorder},u],...f.getStyles(`header`,{className:Nn({[Ge.classNames.zeroRight]:f.offsetScrollbars},r),classNames:n,styles:a,style:i}),...d,__vars:{"--app-shell-header-z-index":(l??f.zIndex)?.toString()}})});af.classes=tf,af.displayName=`@mantine/core/AppShellHeader`;var of=V((e,t)=>{let{classNames:n,className:r,style:i,styles:a,vars:o,...s}=z(`AppShellMain`,null,e),c=ef();return(0,R.jsx)(B,{component:`main`,ref:t,...c.getStyles(`main`,{className:r,style:i,classNames:n,styles:a}),...s})});of.classes=tf,of.displayName=`@mantine/core/AppShellMain`;function sf(e){return typeof e==`object`?e.base:e}function cf(e){let t=typeof e==`object`&&!!e&&e.base!==void 0&&Object.keys(e).length===1;return typeof e==`number`||typeof e==`string`||t}function lf(e){return!(typeof e!=`object`||!e||Object.keys(e).length===1&&`base`in e)}function uf({baseStyles:e,minMediaStyles:t,maxMediaStyles:n,aside:r,theme:i,mode:a}){let o=r?.width,s=`translateX(var(--app-shell-aside-width))`,c=`translateX(calc(var(--app-shell-aside-width) * -1))`;if(r?.breakpoint&&!r?.collapsed?.mobile&&(n[r?.breakpoint]=n[r?.breakpoint]||{},a===`fixed`?(n[r?.breakpoint][`--app-shell-aside-width`]=`100%`,n[r?.breakpoint][`--app-shell-aside-offset`]=`0px`):(n[r?.breakpoint][`--app-shell-aside-width`]=`0px`,n[r?.breakpoint][`--app-shell-aside-offset`]=`0px`)),cf(o)){let t=L(sf(o));e[`--app-shell-aside-width`]=t,e[`--app-shell-aside-offset`]=t}if(lf(o)&&(o.base!==void 0&&(e[`--app-shell-aside-width`]=L(o.base),e[`--app-shell-aside-offset`]=L(o.base)),Ke(o).forEach(e=>{e!==`base`&&(t[e]=t[e]||{},t[e][`--app-shell-aside-width`]=L(o[e]),t[e][`--app-shell-aside-offset`]=L(o[e]))})),r?.breakpoint&&a===`static`&&(t[r.breakpoint]=t[r.breakpoint]||{},t[r.breakpoint][`--app-shell-aside-position`]=`sticky`,t[r.breakpoint][`--app-shell-aside-grid-row`]=`2`,t[r.breakpoint][`--app-shell-aside-grid-column`]=`3`,t[r.breakpoint][`--app-shell-main-column-end`]=`3`),r?.collapsed?.desktop){let e=r.breakpoint;t[e]=t[e]||{},t[e][`--app-shell-aside-transform`]=s,t[e][`--app-shell-aside-transform-rtl`]=c,a===`fixed`?t[e][`--app-shell-aside-offset`]=`0px !important`:(t[e][`--app-shell-aside-width`]=`0px`,t[e][`--app-shell-aside-display`]=`none`,t[e][`--app-shell-main-column-end`]=`-1`),t[e][`--app-shell-aside-scroll-locked-visibility`]=`hidden`}if(r?.collapsed?.mobile){let e=wt(r.breakpoint,i.breakpoints)-.1;n[e]=n[e]||{},a===`fixed`?(n[e][`--app-shell-aside-width`]=`100%`,n[e][`--app-shell-aside-offset`]=`0px`):n[e][`--app-shell-aside-width`]=`0px`,n[e][`--app-shell-aside-transform`]=s,n[e][`--app-shell-aside-transform-rtl`]=c,n[e][`--app-shell-aside-scroll-locked-visibility`]=`hidden`}}function df({baseStyles:e,minMediaStyles:t,footer:n,mode:r}){let i=n?.height,a=r===`static`?!0:n?.offset??!0;if(r===`static`&&n&&(e[`--app-shell-footer-position`]=`sticky`,e[`--app-shell-footer-grid-column`]=`1 / -1`,e[`--app-shell-footer-grid-row`]=`3`),cf(i)){let t=L(sf(i));e[`--app-shell-footer-height`]=t,a&&(e[`--app-shell-footer-offset`]=t)}lf(i)&&(i.base!==void 0&&(e[`--app-shell-footer-height`]=L(i.base),a&&(e[`--app-shell-footer-offset`]=L(i.base))),Ke(i).forEach(e=>{e!==`base`&&(t[e]=t[e]||{},t[e][`--app-shell-footer-height`]=L(i[e]),a&&(t[e][`--app-shell-footer-offset`]=L(i[e])))})),n?.collapsed&&(e[`--app-shell-footer-transform`]=`translateY(var(--app-shell-footer-height))`,r===`fixed`&&(e[`--app-shell-footer-offset`]=`0px !important`))}function ff({baseStyles:e,minMediaStyles:t,header:n,mode:r}){let i=n?.height,a=r===`static`?!0:n?.offset??!0;if(r===`static`&&n&&(e[`--app-shell-header-position`]=`sticky`,e[`--app-shell-header-grid-column`]=`1 / -1`,e[`--app-shell-header-grid-row`]=`1`),cf(i)){let t=L(sf(i));e[`--app-shell-header-height`]=t,a&&(e[`--app-shell-header-offset`]=t)}lf(i)&&(i.base!==void 0&&(e[`--app-shell-header-height`]=L(i.base),a&&(e[`--app-shell-header-offset`]=L(i.base))),Ke(i).forEach(e=>{e!==`base`&&(t[e]=t[e]||{},t[e][`--app-shell-header-height`]=L(i[e]),a&&(t[e][`--app-shell-header-offset`]=L(i[e])))})),n?.collapsed&&(e[`--app-shell-header-transform`]=`translateY(calc(var(--app-shell-header-height) * -1))`,r===`fixed`&&(e[`--app-shell-header-offset`]=`0px !important`))}function pf({baseStyles:e,minMediaStyles:t,maxMediaStyles:n,navbar:r,theme:i,mode:a}){let o=r?.width,s=`translateX(calc(var(--app-shell-navbar-width) * -1))`,c=`translateX(var(--app-shell-navbar-width))`;if(r?.breakpoint&&!r?.collapsed?.mobile&&(n[r?.breakpoint]=n[r?.breakpoint]||{},n[r?.breakpoint][`--app-shell-navbar-offset`]=`0px`,n[r?.breakpoint][`--app-shell-navbar-width`]=`100%`,a===`static`&&(n[r?.breakpoint][`--app-shell-navbar-grid-width`]=`0px`)),cf(o)){let t=L(sf(o));e[`--app-shell-navbar-width`]=t,e[`--app-shell-navbar-offset`]=t,a===`static`&&(e[`--app-shell-navbar-grid-width`]=t)}if(lf(o)&&(o.base!==void 0&&(e[`--app-shell-navbar-width`]=L(o.base),e[`--app-shell-navbar-offset`]=L(o.base),a===`static`&&(e[`--app-shell-navbar-grid-width`]=L(o.base))),Ke(o).forEach(e=>{e!==`base`&&(t[e]=t[e]||{},t[e][`--app-shell-navbar-width`]=L(o[e]),t[e][`--app-shell-navbar-offset`]=L(o[e]),a===`static`&&(t[e][`--app-shell-navbar-grid-width`]=L(o[e])))})),r?.breakpoint&&a===`static`&&(t[r.breakpoint]=t[r.breakpoint]||{},t[r.breakpoint][`--app-shell-navbar-position`]=`sticky`,t[r.breakpoint][`--app-shell-navbar-grid-row`]=`2`,t[r.breakpoint][`--app-shell-navbar-grid-column`]=`1`,t[r.breakpoint][`--app-shell-main-column-start`]=`2`),r?.collapsed?.desktop){let e=r.breakpoint;t[e]=t[e]||{},t[e][`--app-shell-navbar-transform`]=s,t[e][`--app-shell-navbar-transform-rtl`]=c,a===`fixed`?t[e][`--app-shell-navbar-offset`]=`0px !important`:(t[e][`--app-shell-navbar-width`]=`0px`,t[e][`--app-shell-navbar-display`]=`none`,t[e][`--app-shell-main-column-start`]=`1`)}if(r?.collapsed?.mobile){let e=wt(r.breakpoint,i.breakpoints)-.1;n[e]=n[e]||{},n[e][`--app-shell-navbar-width`]=`100%`,n[e][`--app-shell-navbar-offset`]=`0px`,a===`static`&&(n[e][`--app-shell-navbar-grid-width`]=`0px`),n[e][`--app-shell-navbar-transform`]=s,n[e][`--app-shell-navbar-transform-rtl`]=c}}function mf(e){return Number(e)===0?`0px`:vt(e)}function hf({padding:e,baseStyles:t,minMediaStyles:n}){cf(e)&&(t[`--app-shell-padding`]=mf(sf(e))),lf(e)&&(e.base&&(t[`--app-shell-padding`]=mf(e.base)),Ke(e).forEach(t=>{t!==`base`&&(n[t]=n[t]||{},n[t][`--app-shell-padding`]=mf(e[t]))}))}function gf({navbar:e,header:t,footer:n,aside:r,padding:i,theme:a,mode:o}){let s={},c={},l={};o===`static`&&(l[`--app-shell-main-grid-column`]=`1 / -1`,l[`--app-shell-main-grid-row`]=`2`),pf({baseStyles:l,minMediaStyles:s,maxMediaStyles:c,navbar:e,theme:a,mode:o}),uf({baseStyles:l,minMediaStyles:s,maxMediaStyles:c,aside:r,theme:a,mode:o}),ff({baseStyles:l,minMediaStyles:s,header:t,mode:o}),df({baseStyles:l,minMediaStyles:s,footer:n,mode:o}),hf({baseStyles:l,minMediaStyles:s,padding:i});let u=Tt(Ke(s),a.breakpoints).map(e=>({query:`(min-width: ${et(e.px)})`,styles:s[e.value]})),d=Tt(Ke(c),a.breakpoints).map(e=>({query:`(max-width: ${et(e.px)})`,styles:c[e.value]}));return{baseStyles:l,media:[...u,...d]}}function _f({navbar:e,header:t,aside:n,footer:r,padding:i,mode:a,selector:o}){let s=Cr(),c=zn(),{media:l,baseStyles:u}=gf({navbar:e,header:t,footer:r,aside:n,padding:i,theme:s,mode:a});return(0,R.jsx)(mi,{media:l,styles:u,selector:o||c.cssVariablesSelector})}var vf=V((e,t)=>{let{classNames:n,className:r,style:i,styles:a,unstyled:o,vars:s,withBorder:c,zIndex:l,mod:u,...d}=z(`AppShellNavbar`,null,e),f=ef();return f.disabled?null:(0,R.jsx)(B,{component:`nav`,ref:t,mod:[{"with-border":c??f.withBorder},u],...f.getStyles(`navbar`,{className:r,classNames:n,styles:a,style:i}),...d,__vars:{"--app-shell-navbar-z-index":`calc(${l??f.zIndex} + 1)`}})});vf.classes=tf,vf.displayName=`@mantine/core/AppShellNavbar`;var yf=Yi((e,t)=>{let{classNames:n,className:r,style:i,styles:a,vars:o,grow:s,mod:c,...l}=z(`AppShellSection`,null,e),u=ef();return(0,R.jsx)(B,{ref:t,mod:[{grow:s},c],...u.getStyles(`section`,{className:r,style:i,classNames:n,styles:a}),...l})});yf.classes=tf,yf.displayName=`@mantine/core/AppShellSection`;function bf({transitionDuration:e,disabled:t}){let[n,r]=(0,D.useState)(!0),i=(0,D.useRef)(-1),a=(0,D.useRef)(-1);return an(`resize`,()=>{r(!0),clearTimeout(i.current),i.current=window.setTimeout(()=>(0,D.startTransition)(()=>{r(!1)}),200)}),Bt(()=>{r(!0),clearTimeout(a.current),a.current=window.setTimeout(()=>(0,D.startTransition)(()=>{r(!1)}),e||0)},[t,e]),n}var xf={withBorder:!0,padding:0,transitionDuration:200,transitionTimingFunction:`ease`,zIndex:mt(`app`),mode:`fixed`},Sf=jn((e,{transitionDuration:t,transitionTimingFunction:n})=>({root:{"--app-shell-transition-duration":`${t}ms`,"--app-shell-transition-timing-function":n}})),Cf=V((e,t)=>{let n=z(`AppShell`,xf,e),{classNames:r,className:i,style:a,styles:o,unstyled:s,vars:c,navbar:l,withBorder:u,padding:d,transitionDuration:f,transitionTimingFunction:p,header:m,zIndex:h,layout:g,disabled:_,aside:v,footer:y,offsetScrollbars:b=!0,mode:x,mod:S,attributes:C,id:w,...T}=n,E=oi({name:`AppShell`,classes:tf,props:n,className:i,style:a,classNames:r,styles:o,unstyled:s,attributes:C,vars:c,varsResolver:Sf}),D=bf({disabled:_,transitionDuration:f}),O=rn(w);return(0,R.jsxs)($d,{value:{getStyles:E,withBorder:u,zIndex:h,disabled:_,offsetScrollbars:b,mode:x},children:[(0,R.jsx)(_f,{navbar:l,header:m,aside:v,footer:y,padding:d,mode:x,selector:x===`static`?`#${O}`:void 0}),(0,R.jsx)(B,{ref:t,...E(`root`),mod:[{resizing:D,layout:g,disabled:_,mode:x},S],id:O,...T})]})});Cf.classes=tf,Cf.displayName=`@mantine/core/AppShell`,Cf.Navbar=vf,Cf.Header=af,Cf.Main=of,Cf.Aside=nf,Cf.Footer=rf,Cf.Section=yf;function wf(e){return typeof e==`string`?{value:e,label:e}:`value`in e&&!(`label`in e)?{value:e.value,label:e.value,disabled:e.disabled}:typeof e==`number`?{value:e.toString(),label:e.toString()}:`group`in e?{group:e.group,items:e.items.map(e=>wf(e))}:e}function Tf(e){return e?e.map(e=>wf(e)):[]}function Ef(e){return e.reduce((e,t)=>`group`in t?{...e,...Ef(t.items)}:(e[t.value]=t,e),{})}var Df={dropdown:`m_88b62a41`,search:`m_985517d8`,options:`m_b2821a6e`,option:`m_92253aa5`,empty:`m_2530cd1d`,header:`m_858f94bd`,footer:`m_82b967cb`,group:`m_254f3e4f`,groupLabel:`m_2bb2e9e5`,chevron:`m_2943220b`,optionsDropdownOption:`m_390b5f4`,optionsDropdownCheckIcon:`m_8ee53fc2`,optionsDropdownCheckPlaceholder:`m_a530ee0a`},Of={error:null},kf=jn((e,{size:t,color:n})=>({chevron:{"--combobox-chevron-size":_t(t,`combobox-chevron-size`),"--combobox-chevron-color":n?or(n,e):void 0}})),Af=V((e,t)=>{let n=z(`ComboboxChevron`,Of,e),{size:r,error:i,style:a,className:o,classNames:s,styles:c,unstyled:l,vars:u,mod:d,...f}=n,p=oi({name:`ComboboxChevron`,classes:Df,props:n,style:a,className:o,classNames:s,styles:c,unstyled:l,vars:u,varsResolver:kf,rootSelector:`chevron`});return(0,R.jsx)(B,{component:`svg`,...f,...p(`chevron`),size:r,viewBox:`0 0 15 15`,fill:`none`,xmlns:`http://www.w3.org/2000/svg`,mod:[`combobox-chevron`,{error:i},d],ref:t,children:(0,R.jsx)(`path`,{d:`M4.93179 5.43179C4.75605 5.60753 4.75605 5.89245 4.93179 6.06819C5.10753 6.24392 5.39245 6.24392 5.56819 6.06819L7.49999 4.13638L9.43179 6.06819C9.60753 6.24392 9.89245 6.24392 10.0682 6.06819C10.2439 5.89245 10.2439 5.60753 10.0682 5.43179L7.81819 3.18179C7.73379 3.0974 7.61933 3.04999 7.49999 3.04999C7.38064 3.04999 7.26618 3.0974 7.18179 3.18179L4.93179 5.43179ZM10.0682 9.56819C10.2439 9.39245 10.2439 9.10753 10.0682 8.93179C9.89245 8.75606 9.60753 8.75606 9.43179 8.93179L7.49999 10.8636L5.56819 8.93179C5.39245 8.75606 5.10753 8.75606 4.93179 8.93179C4.75605 9.10753 4.75605 9.39245 4.93179 9.56819L7.18179 11.8182C7.35753 11.9939 7.64245 11.9939 7.81819 11.8182L10.0682 9.56819Z`,fill:`currentColor`,fillRule:`evenodd`,clipRule:`evenodd`})})});Af.classes=Df,Af.displayName=`@mantine/core/ComboboxChevron`;var[jf,Mf]=at(`Combobox component was not found in tree`),Nf=(0,D.forwardRef)(({size:e,onMouseDown:t,onClick:n,onClear:r,...i},a)=>(0,R.jsx)(vd.ClearButton,{ref:a,tabIndex:-1,"aria-hidden":!0,...i,onMouseDown:e=>{e.preventDefault(),t?.(e)},onClick:e=>{r(),n?.(e)}}));Nf.displayName=`@mantine/core/ComboboxClearButton`;var Pf=V((e,t)=>{let{classNames:n,styles:r,className:i,style:a,hidden:o,...s}=z(`ComboboxDropdown`,null,e),c=Mf();return(0,R.jsx)(su.Dropdown,{...s,ref:t,role:`presentation`,"data-hidden":o||void 0,...c.getStyles(`dropdown`,{className:i,style:a,classNames:n,styles:r})})});Pf.classes=Df,Pf.displayName=`@mantine/core/ComboboxDropdown`;var Ff={refProp:`ref`},If=V((e,t)=>{let{children:n,refProp:r}=z(`ComboboxDropdownTarget`,Ff,e);if(Mf(),!rt(n))throw Error(`Combobox.DropdownTarget component children should be an element or a component that accepts ref. Fragments, strings, numbers and other primitive values are not supported`);return(0,R.jsx)(su.Target,{ref:t,refProp:r,children:n})});If.displayName=`@mantine/core/ComboboxDropdownTarget`;var Lf=V((e,t)=>{let{classNames:n,className:r,style:i,styles:a,vars:o,...s}=z(`ComboboxEmpty`,null,e),c=Mf();return(0,R.jsx)(B,{ref:t,...c.getStyles(`empty`,{className:r,classNames:n,styles:a,style:i}),...s})});Lf.classes=Df,Lf.displayName=`@mantine/core/ComboboxEmpty`;function Rf({onKeyDown:e,withKeyboardNavigation:t,withAriaAttributes:n,withExpandedAttribute:r,targetType:i,autoComplete:a}){let o=Mf(),[s,c]=(0,D.useState)(null),l=n=>{if(e?.(n),!o.readOnly&&t){if(n.nativeEvent.isComposing)return;if(n.nativeEvent.code===`ArrowDown`&&(n.preventDefault(),o.store.dropdownOpened?c(o.store.selectNextOption()):(o.store.openDropdown(`keyboard`),c(o.store.selectActiveOption()),o.store.updateSelectedOptionIndex(`selected`,{scrollIntoView:!0}))),n.nativeEvent.code===`ArrowUp`&&(n.preventDefault(),o.store.dropdownOpened?c(o.store.selectPreviousOption()):(o.store.openDropdown(`keyboard`),c(o.store.selectActiveOption()),o.store.updateSelectedOptionIndex(`selected`,{scrollIntoView:!0}))),n.nativeEvent.code===`Enter`||n.nativeEvent.code===`NumpadEnter`){if(n.nativeEvent.keyCode===229)return;let e=o.store.getSelectedOptionIndex();o.store.dropdownOpened&&e!==-1?(n.preventDefault(),o.store.clickSelectedOption()):i===`button`&&(n.preventDefault(),o.store.openDropdown(`keyboard`))}n.key===`Escape`&&o.store.closeDropdown(`keyboard`),n.nativeEvent.code===`Space`&&i===`button`&&(n.preventDefault(),o.store.toggleDropdown(`keyboard`))}};return{...n?{"aria-haspopup":`listbox`,"aria-expanded":r?!!(o.store.listId&&o.store.dropdownOpened):void 0,"aria-controls":o.store.dropdownOpened&&o.store.listId?o.store.listId:void 0,"aria-activedescendant":o.store.dropdownOpened&&s||void 0,autoComplete:a,"data-expanded":o.store.dropdownOpened||void 0,"data-mantine-stop-propagation":o.store.dropdownOpened||void 0}:{},onKeyDown:l}}var zf={refProp:`ref`,targetType:`input`,withKeyboardNavigation:!0,withAriaAttributes:!0,withExpandedAttribute:!1,autoComplete:`off`},Bf=V((e,t)=>{let{children:n,refProp:r,withKeyboardNavigation:i,withAriaAttributes:a,withExpandedAttribute:o,targetType:s,autoComplete:c,...l}=z(`ComboboxEventsTarget`,zf,e),u=An(n);if(!u)throw Error(`Combobox.EventsTarget component children should be an element or a component that accepts ref. Fragments, strings, numbers and other primitive values are not supported`);let d=Mf(),f=Rf({targetType:s,withAriaAttributes:a,withKeyboardNavigation:i,withExpandedAttribute:o,onKeyDown:u.props.onKeyDown,autoComplete:c});return(0,D.cloneElement)(u,{...f,...l,[r]:mn(t,d.store.targetRef,En(u))})});Bf.displayName=`@mantine/core/ComboboxEventsTarget`;var Vf=V((e,t)=>{let{classNames:n,className:r,style:i,styles:a,vars:o,...s}=z(`ComboboxFooter`,null,e),c=Mf();return(0,R.jsx)(B,{ref:t,...c.getStyles(`footer`,{className:r,classNames:n,style:i,styles:a}),...s,onMouseDown:e=>{e.preventDefault()}})});Vf.classes=Df,Vf.displayName=`@mantine/core/ComboboxFooter`;var Hf=V((e,t)=>{let{classNames:n,className:r,style:i,styles:a,vars:o,children:s,label:c,id:l,...u}=z(`ComboboxGroup`,null,e),d=Mf(),f=rn(l);return(0,R.jsxs)(B,{ref:t,role:`group`,"aria-labelledby":c?f:void 0,...d.getStyles(`group`,{className:r,classNames:n,style:i,styles:a}),...u,children:[c&&(0,R.jsx)(`div`,{id:f,...d.getStyles(`groupLabel`,{classNames:n,styles:a}),children:c}),s]})});Hf.classes=Df,Hf.displayName=`@mantine/core/ComboboxGroup`;var Uf=V((e,t)=>{let{classNames:n,className:r,style:i,styles:a,vars:o,...s}=z(`ComboboxHeader`,null,e),c=Mf();return(0,R.jsx)(B,{ref:t,...c.getStyles(`header`,{className:r,classNames:n,style:i,styles:a}),...s,onMouseDown:e=>{e.preventDefault()}})});Uf.classes=Df,Uf.displayName=`@mantine/core/ComboboxHeader`;function Wf({value:e,valuesDivider:t=`,`,...n}){return(0,R.jsx)(`input`,{type:`hidden`,value:Array.isArray(e)?e.join(t):e||``,...n})}Wf.displayName=`@mantine/core/ComboboxHiddenInput`;var Gf=V((e,t)=>{let n=z(`ComboboxOption`,null,e),{classNames:r,className:i,style:a,styles:o,vars:s,onClick:c,id:l,active:u,onMouseDown:d,onMouseOver:f,disabled:p,selected:m,mod:h,...g}=n,_=Mf(),v=(0,D.useId)(),y=l||v;return(0,R.jsx)(B,{..._.getStyles(`option`,{className:i,classNames:r,styles:o,style:a}),...g,ref:t,id:y,mod:[`combobox-option`,{"combobox-active":u,"combobox-disabled":p,"combobox-selected":m},h],role:`option`,onClick:e=>{p?e.preventDefault():(_.onOptionSubmit?.(n.value,n),c?.(e))},onMouseDown:e=>{e.preventDefault(),d?.(e)},onMouseOver:e=>{_.resetSelectionOnOptionHover&&_.store.resetSelectedOption(),f?.(e)}})});Gf.classes=Df,Gf.displayName=`@mantine/core/ComboboxOption`;var Kf=V((e,t)=>{let{classNames:n,className:r,style:i,styles:a,id:o,onMouseDown:s,labelledBy:c,...l}=z(`ComboboxOptions`,null,e),u=Mf(),d=rn(o);return(0,D.useEffect)(()=>{u.store.setListId(d)},[d]),(0,R.jsx)(B,{ref:t,...u.getStyles(`options`,{className:r,style:i,classNames:n,styles:a}),...l,id:d,role:`listbox`,"aria-labelledby":c,onMouseDown:e=>{e.preventDefault(),s?.(e)}})});Kf.classes=Df,Kf.displayName=`@mantine/core/ComboboxOptions`;var qf={withAriaAttributes:!0,withKeyboardNavigation:!0},Jf=V((e,t)=>{let{classNames:n,styles:r,unstyled:i,vars:a,withAriaAttributes:o,onKeyDown:s,withKeyboardNavigation:c,size:l,...u}=z(`ComboboxSearch`,qf,e),d=Mf(),f=d.getStyles(`search`),p=Rf({targetType:`input`,withAriaAttributes:o,withKeyboardNavigation:c,withExpandedAttribute:!1,onKeyDown:s,autoComplete:`off`});return(0,R.jsx)(vd,{ref:mn(t,d.store.searchRef),classNames:[{input:f.className},n],styles:[{input:f.style},r],size:l||d.size,...p,...u,__staticSelector:`Combobox`})});Jf.classes=Df,Jf.displayName=`@mantine/core/ComboboxSearch`;var Yf={refProp:`ref`,targetType:`input`,withKeyboardNavigation:!0,withAriaAttributes:!0,withExpandedAttribute:!1,autoComplete:`off`},Xf=V((e,t)=>{let{children:n,refProp:r,withKeyboardNavigation:i,withAriaAttributes:a,withExpandedAttribute:o,targetType:s,autoComplete:c,...l}=z(`ComboboxTarget`,Yf,e),u=An(n);if(!u)throw Error(`Combobox.Target component children should be an element or a component that accepts ref. Fragments, strings, numbers and other primitive values are not supported`);let d=Mf(),f=Rf({targetType:s,withAriaAttributes:a,withKeyboardNavigation:i,withExpandedAttribute:o,onKeyDown:u.props.onKeyDown,autoComplete:c}),p=(0,D.cloneElement)(u,{...f,...l});return(0,R.jsx)(su.Target,{ref:mn(t,d.store.targetRef),children:p})});Xf.displayName=`@mantine/core/ComboboxTarget`;function Zf(e,t,n){for(let n=e-1;n>=0;--n)if(!t[n].hasAttribute(`data-combobox-disabled`))return n;if(n){for(let e=t.length-1;e>-1;--e)if(!t[e].hasAttribute(`data-combobox-disabled`))return e}return e}function Qf(e,t,n){for(let n=e+1;n<t.length;n+=1)if(!t[n].hasAttribute(`data-combobox-disabled`))return n;if(n){for(let e=0;e<t.length;e+=1)if(!t[e].hasAttribute(`data-combobox-disabled`))return e}return e}function $f(e){for(let t=0;t<e.length;t+=1)if(!e[t].hasAttribute(`data-combobox-disabled`))return t;return-1}function ep({defaultOpened:e,opened:t,onOpenedChange:n,onDropdownClose:r,onDropdownOpen:i,loop:a=!0,scrollBehavior:o=`instant`}={}){let[s,c]=hn({value:t,defaultValue:e,finalValue:!1,onChange:n}),l=(0,D.useRef)(null),u=(0,D.useRef)(-1),d=(0,D.useRef)(null),f=(0,D.useRef)(null),p=(0,D.useRef)(-1),m=(0,D.useRef)(-1),h=(0,D.useRef)(-1),g=(0,D.useCallback)((e=`unknown`)=>{s||(c(!0),i?.(e))},[c,i,s]),_=(0,D.useCallback)((e=`unknown`)=>{s&&(c(!1),r?.(e))},[c,r,s]),v=(0,D.useCallback)((e=`unknown`)=>{s?_(e):g(e)},[_,g,s]),y=(0,D.useCallback)(()=>{let e=kn(f.current),t=Dn(`#${l.current} [data-combobox-selected]`,e);t?.removeAttribute(`data-combobox-selected`),t?.removeAttribute(`aria-selected`)},[]),b=(0,D.useCallback)(e=>{let t=kn(f.current),n=Dn(`#${l.current}`,t),r=n?On(`[data-combobox-option]`,n):null;if(!r)return null;let i=e>=r.length?0:e<0?r.length-1:e;return u.current=i,r?.[i]&&!r[i].hasAttribute(`data-combobox-disabled`)?(y(),r[i].setAttribute(`data-combobox-selected`,`true`),r[i].setAttribute(`aria-selected`,`true`),r[i].scrollIntoView({block:`nearest`,behavior:o}),r[i].id):null},[o,y]),x=(0,D.useCallback)(()=>{let e=kn(f.current),t=Dn(`#${l.current} [data-combobox-active]`,e);if(t){let n=On(`#${l.current} [data-combobox-option]`,e).findIndex(e=>e===t);return b(n)}return b(0)},[b]),S=(0,D.useCallback)(()=>{let e=kn(f.current),t=On(`#${l.current} [data-combobox-option]`,e);return b(Qf(u.current,t,a))},[b,a]),C=(0,D.useCallback)(()=>{let e=kn(f.current),t=On(`#${l.current} [data-combobox-option]`,e);return b(Zf(u.current,t,a))},[b,a]),w=(0,D.useCallback)(()=>{let e=kn(f.current),t=On(`#${l.current} [data-combobox-option]`,e);return b($f(t))},[b]),T=(0,D.useCallback)((e=`selected`,t)=>{h.current=window.setTimeout(()=>{let n=kn(f.current),r=On(`#${l.current} [data-combobox-option]`,n),i=r.findIndex(t=>t.hasAttribute(`data-combobox-${e}`));u.current=i,t?.scrollIntoView&&r[i]?.scrollIntoView({block:`nearest`,behavior:o})},0)},[]),E=(0,D.useCallback)(()=>{u.current=-1,y()},[y]),O=(0,D.useCallback)(()=>{let e=kn(f.current);(On(`#${l.current} [data-combobox-option]`,e)?.[u.current])?.click()},[]),k=(0,D.useCallback)(e=>{l.current=e},[]),A=(0,D.useCallback)(()=>{p.current=window.setTimeout(()=>d.current?.focus(),0)},[]),j=(0,D.useCallback)(()=>{m.current=window.setTimeout(()=>f.current?.focus(),0)},[]),M=(0,D.useCallback)(()=>u.current,[]);return(0,D.useEffect)(()=>()=>{window.clearTimeout(p.current),window.clearTimeout(m.current),window.clearTimeout(h.current)},[]),{dropdownOpened:s,openDropdown:g,closeDropdown:_,toggleDropdown:v,selectedOptionIndex:u.current,getSelectedOptionIndex:M,selectOption:b,selectFirstOption:w,selectActiveOption:x,selectNextOption:S,selectPreviousOption:C,resetSelectedOption:E,updateSelectedOptionIndex:T,listId:l.current,setListId:k,clickSelectedOption:O,searchRef:d,focusSearchInput:A,targetRef:f,focusTarget:j}}var tp={keepMounted:!0,withinPortal:!0,resetSelectionOnOptionHover:!1,width:`target`,transitionProps:{transition:`fade`,duration:0},size:`sm`},np=jn((e,{size:t,dropdownPadding:n})=>({options:{"--combobox-option-fz":bt(t),"--combobox-option-padding":_t(t,`combobox-option-padding`)},dropdown:{"--combobox-padding":n===void 0?void 0:L(n),"--combobox-option-fz":bt(t),"--combobox-option-padding":_t(t,`combobox-option-padding`)}}));function rp(e){let t=z(`Combobox`,tp,e),{classNames:n,styles:r,unstyled:i,children:a,store:o,vars:s,onOptionSubmit:c,onClose:l,size:u,dropdownPadding:d,resetSelectionOnOptionHover:f,__staticSelector:p,readOnly:m,attributes:h,...g}=t,_=ep(),v=o||_,y=oi({name:p||`Combobox`,classes:Df,props:t,classNames:n,styles:r,unstyled:i,attributes:h,vars:s,varsResolver:np}),b=()=>{l?.(),v.closeDropdown()};return(0,R.jsx)(jf,{value:{getStyles:y,store:v,onOptionSubmit:c,size:u,resetSelectionOnOptionHover:f,readOnly:m},children:(0,R.jsx)(su,{opened:v.dropdownOpened,preventPositionChangeWhenVisible:!1,...g,onChange:e=>!e&&b(),withRoles:!1,unstyled:i,children:a})})}rp.extend=e=>e,rp.classes=Df,rp.displayName=`@mantine/core/Combobox`,rp.Target=Xf,rp.Dropdown=Pf,rp.Options=Kf,rp.Option=Gf,rp.Search=Jf,rp.Empty=Lf,rp.Chevron=Af,rp.Footer=Vf,rp.Header=Uf,rp.EventsTarget=Bf,rp.DropdownTarget=If,rp.Group=Hf,rp.ClearButton=Nf,rp.HiddenInput=Wf;var ip={root:`m_5f75b09e`,body:`m_5f6e695e`,labelWrapper:`m_d3ea56bb`,label:`m_8ee546b8`,description:`m_328f68c0`,error:`m_8e8a99cc`},ap=ip,op=(0,D.forwardRef)(({__staticSelector:e,__stylesApiProps:t,className:n,classNames:r,styles:i,unstyled:a,children:o,label:s,description:c,id:l,disabled:u,error:d,size:f,labelPosition:p=`left`,bodyElement:m=`div`,labelElement:h=`label`,variant:g,style:_,vars:v,mod:y,attributes:b,...x},S)=>{let C=oi({name:e,props:t,className:n,style:_,classes:ip,classNames:r,styles:i,unstyled:a,attributes:b});return(0,R.jsx)(B,{...C(`root`),ref:S,__vars:{"--label-fz":bt(f),"--label-lh":_t(f,`label-lh`)},mod:[{"label-position":p},y],variant:g,size:f,...x,children:(0,R.jsxs)(B,{component:m,htmlFor:m===`label`?l:void 0,...C(`body`),children:[o,(0,R.jsxs)(`div`,{...C(`labelWrapper`),"data-disabled":u||void 0,children:[s&&(0,R.jsx)(B,{component:h,htmlFor:h===`label`?l:void 0,...C(`label`),"data-disabled":u||void 0,children:s}),c&&(0,R.jsx)(vd.Description,{size:f,__inheritStyles:!1,...C(`description`),children:c}),d&&typeof d!=`boolean`&&(0,R.jsx)(vd.Error,{size:f,__inheritStyles:!1,...C(`error`),children:d})]})]})})});op.displayName=`@mantine/core/InlineInput`;var sp={root:`m_bf2d988c`,inner:`m_26062bec`,input:`m_26063560`,icon:`m_bf295423`,"input--outline":`m_215c4542`},cp=(0,D.createContext)(null),lp=cp.Provider,up=()=>(0,D.useContext)(cp),[dp,fp]=ot(),pp={card:`m_26775b0a`},mp={withBorder:!0},hp=jn((e,{radius:t})=>({card:{"--card-radius":yt(t)}})),gp=V((e,t)=>{let n=z(`CheckboxCard`,mp,e),{classNames:r,className:i,style:a,styles:o,unstyled:s,vars:c,checked:l,mod:u,withBorder:d,value:f,onClick:p,defaultChecked:m,onChange:h,attributes:g,..._}=n,v=oi({name:`CheckboxCard`,classes:pp,props:n,className:i,style:a,classNames:r,styles:o,unstyled:s,attributes:g,vars:c,varsResolver:hp,rootSelector:`card`}),y=up(),[b,x]=hn({value:typeof l==`boolean`?l:y?y.value.includes(f||``):void 0,defaultValue:m,finalValue:!1,onChange:h});return(0,R.jsx)(dp,{value:{checked:b},children:(0,R.jsx)(xl,{ref:t,mod:[{"with-border":d,checked:b},u],...v(`card`),..._,role:`checkbox`,"aria-checked":b,onClick:e=>{p?.(e),y?.onChange(f||``),x(!b)}})})});gp.displayName=`@mantine/core/CheckboxCard`,gp.classes=pp;function _p({children:e,role:t}){let n=rd();return n?(0,R.jsx)(`div`,{role:t,"aria-labelledby":n.labelId,"aria-describedby":n.describedBy,children:e}):(0,R.jsx)(R.Fragment,{children:e})}var vp=V((e,t)=>{let{value:n,defaultValue:r,onChange:i,size:a,wrapperProps:o,children:s,readOnly:c,disabled:l,...u}=z(`CheckboxGroup`,null,e),[d,f]=hn({value:n,defaultValue:r,finalValue:[],onChange:i});return(0,R.jsx)(lp,{value:{value:d,onChange:e=>{let t=typeof e==`string`?e:e.currentTarget.value;!c&&f(d.includes(t)?d.filter(e=>e!==t):[...d,t])},size:a,disabled:l},children:(0,R.jsx)(vd.Wrapper,{size:a,ref:t,...o,...u,labelElement:`div`,__staticSelector:`CheckboxGroup`,children:(0,R.jsx)(_p,{role:`group`,children:s})})})});vp.classes=vd.Wrapper.classes,vp.displayName=`@mantine/core/CheckboxGroup`;function yp({size:e,style:t,...n}){let r=e===void 0?t:{width:L(e),height:L(e),...t};return(0,R.jsx)(`svg`,{viewBox:`0 0 10 7`,fill:`none`,xmlns:`http://www.w3.org/2000/svg`,style:r,"aria-hidden":!0,...n,children:(0,R.jsx)(`path`,{d:`M4 4.586L1.707 2.293A1 1 0 1 0 .293 3.707l3 3a.997.997 0 0 0 1.414 0l5-5A1 1 0 1 0 8.293.293L4 4.586z`,fill:`currentColor`,fillRule:`evenodd`,clipRule:`evenodd`})})}function bp({indeterminate:e,...t}){return e?(0,R.jsx)(`svg`,{xmlns:`http://www.w3.org/2000/svg`,fill:`none`,viewBox:`0 0 32 6`,"aria-hidden":!0,...t,children:(0,R.jsx)(`rect`,{width:`32`,height:`6`,fill:`currentColor`,rx:`3`})}):(0,R.jsx)(yp,{...t})}var xp={indicator:`m_5e5256ee`,icon:`m_1b1c543a`,"indicator--outline":`m_76e20374`},Sp={icon:bp,variant:`filled`},Cp=jn((e,{radius:t,color:n,size:r,iconColor:i,variant:a,autoContrast:o})=>{let s=ar({color:n||e.primaryColor,theme:e}),c=s.isThemeColor&&s.shade===void 0?`var(--mantine-color-${s.color}-outline)`:s.color;return{indicator:{"--checkbox-size":_t(r,`checkbox-size`),"--checkbox-radius":t===void 0?void 0:yt(t),"--checkbox-color":a===`outline`?c:or(n,e),"--checkbox-icon-color":i?or(i,e):si(o,e)?Or({color:n,theme:e,autoContrast:o}):void 0}}}),wp=V((e,t)=>{let n=z(`CheckboxIndicator`,Sp,e),{classNames:r,className:i,style:a,styles:o,unstyled:s,vars:c,icon:l,indeterminate:u,radius:d,color:f,iconColor:p,autoContrast:m,checked:h,mod:g,variant:_,disabled:v,attributes:y,...b}=n,x=oi({name:`CheckboxIndicator`,classes:xp,props:n,className:i,style:a,classNames:r,styles:o,unstyled:s,attributes:y,vars:c,varsResolver:Cp,rootSelector:`indicator`}),S=fp(),C=typeof h==`boolean`||typeof u==`boolean`?h||u:S?.checked||!1;return(0,R.jsx)(B,{ref:t,...x(`indicator`,{variant:_}),variant:_,mod:[{checked:C,disabled:v},g],...b,children:(0,R.jsx)(l,{indeterminate:u,...x(`icon`)})})});wp.displayName=`@mantine/core/CheckboxIndicator`,wp.classes=xp;var Tp={labelPosition:`right`,icon:bp,variant:`filled`},Ep=jn((e,{radius:t,color:n,size:r,iconColor:i,variant:a,autoContrast:o})=>{let s=ar({color:n||e.primaryColor,theme:e}),c=s.isThemeColor&&s.shade===void 0?`var(--mantine-color-${s.color}-outline)`:s.color;return{root:{"--checkbox-size":_t(r,`checkbox-size`),"--checkbox-radius":t===void 0?void 0:yt(t),"--checkbox-color":a===`outline`?c:or(n,e),"--checkbox-icon-color":i?or(i,e):si(o,e)?Or({color:n,theme:e,autoContrast:o}):void 0}}}),Dp=V((e,t)=>{let n=z(`Checkbox`,Tp,e),{classNames:r,className:i,style:a,styles:o,unstyled:s,vars:c,color:l,label:u,id:d,size:f,radius:p,wrapperProps:m,checked:h,labelPosition:g,description:_,error:v,disabled:y,variant:b,indeterminate:x,icon:S,rootRef:C,iconColor:w,onChange:T,autoContrast:E,mod:O,attributes:k,...A}=n,j=up(),M=f||j?.size,N=oi({name:`Checkbox`,props:n,classes:sp,className:i,style:a,classNames:r,styles:o,unstyled:s,attributes:k,vars:c,varsResolver:Ep}),{styleProps:ee,rest:te}=hi(A),P=rn(d),F={checked:j?.value.includes(te.value)??h,onChange:e=>{j?.onChange(e),T?.(e)},disabled:j?.disabled??y},I=(0,D.useRef)(null),ne=t||I;return(0,D.useEffect)(()=>{ne&&`current`in ne&&ne.current&&(ne.current.indeterminate=x||!1,x?ne.current.setAttribute(`data-indeterminate`,`true`):ne.current.removeAttribute(`data-indeterminate`))},[x,ne]),(0,R.jsx)(op,{...N(`root`),__staticSelector:`Checkbox`,__stylesApiProps:n,id:P,size:M,labelPosition:g,label:u,description:_,error:v,disabled:F.disabled,classNames:r,styles:o,unstyled:s,"data-checked":F.checked||h||void 0,variant:b,ref:C,mod:O,inert:te.inert,...ee,...m,children:(0,R.jsxs)(B,{...N(`inner`),mod:{"data-label-position":g},children:[(0,R.jsx)(B,{component:`input`,id:P,ref:ne,mod:{error:!!v},...N(`input`,{focusable:!0,variant:b}),...te,...F,inert:te.inert,type:`checkbox`}),(0,R.jsx)(S,{indeterminate:x,...N(`icon`)})]})})});Dp.classes={...sp,...ap},Dp.displayName=`@mantine/core/Checkbox`,Dp.Group=vp,Dp.Indicator=wp,Dp.Card=gp;function Op(e){return`group`in e}function kp({options:e,search:t,limit:n}){let r=t.trim().toLowerCase(),i=[];for(let a=0;a<e.length;a+=1){let o=e[a];if(i.length===n)return i;Op(o)&&i.push({group:o.group,items:kp({options:o.items,search:t,limit:n-i.length})}),Op(o)||o.label.toLowerCase().includes(r)&&i.push(o)}return i}function Ap(e){if(e.length===0)return!0;for(let t of e)if(!(`group`in t)||t.items.length>0)return!1;return!0}function jp(e,t=new Set){if(Array.isArray(e))for(let n of e)if(Op(n))jp(n.items,t);else{if(n.value===void 0)throw Error(`[@mantine/core] Each option must have value property`);if(typeof n.value!=`string`)throw Error(`[@mantine/core] Option value must be a string, other data formats are not supported, got ${typeof n.value}`);if(t.has(n.value))throw Error(`[@mantine/core] Duplicate options are not supported. Option with value "${n.value}" was provided more than once`);t.add(n.value)}}function Mp(e,t){return Array.isArray(e)?e.includes(t):e===t}function Np({data:e,withCheckIcon:t,withAlignedLabels:n,value:r,checkIconPosition:i,unstyled:a,renderOption:o}){if(!Op(e)){let s=Mp(r,e.value),c=t&&(s?(0,R.jsx)(yp,{className:Df.optionsDropdownCheckIcon}):n?(0,R.jsx)(`div`,{className:Df.optionsDropdownCheckPlaceholder}):null),l=(0,R.jsxs)(R.Fragment,{children:[i===`left`&&c,(0,R.jsx)(`span`,{children:e.label}),i===`right`&&c]});return(0,R.jsx)(rp.Option,{value:e.value,disabled:e.disabled,className:Nn({[Df.optionsDropdownOption]:!a}),"data-reverse":i===`right`||void 0,"data-checked":s||void 0,"aria-selected":s,active:s,children:typeof o==`function`?o({option:e,checked:s}):l})}let s=e.items.map(e=>(0,R.jsx)(Np,{data:e,value:r,unstyled:a,withCheckIcon:t,withAlignedLabels:n,checkIconPosition:i,renderOption:o},e.value));return(0,R.jsx)(rp.Group,{label:e.group,children:s})}function Pp({data:e,hidden:t,hiddenWhenEmpty:n,filter:r,search:i,limit:a,maxDropdownHeight:o,withScrollArea:s=!0,filterOptions:c=!0,withCheckIcon:l=!1,withAlignedLabels:u=!1,value:d,checkIconPosition:f,nothingFoundMessage:p,unstyled:m,labelId:h,renderOption:g,scrollAreaProps:_,"aria-label":v}){jp(e);let y=typeof i==`string`?(r||kp)({options:e,search:c?i:``,limit:a??1/0}):e,b=Ap(y),x=y.map(e=>(0,R.jsx)(Np,{data:e,withCheckIcon:l,withAlignedLabels:u,value:d,checkIconPosition:f,unstyled:m,renderOption:g},Op(e)?e.group:e.value));return(0,R.jsx)(rp.Dropdown,{hidden:t||n&&b,"data-composed":!0,children:(0,R.jsxs)(rp.Options,{labelledBy:h,"aria-label":v,children:[s?(0,R.jsx)(_l.Autosize,{mah:o??220,type:`scroll`,scrollbarSize:`var(--combobox-padding)`,offsetScrollbars:`y`,..._,children:x}):x,b&&p&&(0,R.jsx)(rp.Empty,{children:p})]})})}var Fp=V((e,t)=>{let n=z(`Autocomplete`,null,e),{classNames:r,styles:i,unstyled:a,vars:o,dropdownOpened:s,defaultDropdownOpened:c,onDropdownClose:l,onDropdownOpen:u,onFocus:d,onBlur:f,onClick:p,onChange:m,data:h,value:g,defaultValue:_,selectFirstOptionOnChange:v,selectFirstOptionOnDropdownOpen:y,onOptionSubmit:b,comboboxProps:x,readOnly:S,disabled:C,filter:w,limit:T,withScrollArea:E,maxDropdownHeight:O,size:k,id:A,renderOption:j,autoComplete:M,scrollAreaProps:N,onClear:ee,clearButtonProps:te,error:P,clearable:F,rightSection:I,autoSelectOnBlur:ne,openOnFocus:re=!0,attributes:ie,...ae}=n,oe=rn(A),se=Tf(h),ce=Ef(se),[le,ue]=hn({value:g,defaultValue:_,finalValue:``,onChange:m}),de=ep({opened:s,defaultOpened:c,onDropdownOpen:()=>{u?.(),y&&de.selectFirstOption()},onDropdownClose:()=>{l?.(),setTimeout(de.resetSelectedOption,0)}}),fe=e=>{ue(e),de.resetSelectedOption()},{resolvedClassNames:pe,resolvedStyles:me}=Ur({props:n,styles:i,classNames:r});(0,D.useEffect)(()=>{v&&de.selectFirstOption()},[v,le]);let he=(0,R.jsx)(rp.ClearButton,{...te,onClear:()=>{fe(``),ee?.()}});return(0,R.jsxs)(rp,{store:de,__staticSelector:`Autocomplete`,classNames:pe,styles:me,unstyled:a,readOnly:S,size:k,attributes:ie,keepMounted:ne,onOptionSubmit:e=>{b?.(e),fe(ce[e].label),de.closeDropdown()},...x,children:[(0,R.jsx)(rp.Target,{autoComplete:M,children:(0,R.jsx)(xd,{ref:t,...ae,size:k,__staticSelector:`Autocomplete`,__clearSection:he,__clearable:F&&!!le&&!C&&!S,rightSection:I,disabled:C,readOnly:S,value:le,error:P,onChange:e=>{fe(e.currentTarget.value),de.openDropdown(),v&&de.selectFirstOption()},onFocus:e=>{re&&de.openDropdown(),d?.(e)},onBlur:e=>{ne&&de.clickSelectedOption(),de.closeDropdown(),f?.(e)},onClick:e=>{de.openDropdown(),p?.(e)},classNames:pe,styles:me,unstyled:a,attributes:ie,id:oe})}),(0,R.jsx)(Pp,{data:se,hidden:S||C,filter:w,search:le,limit:T,hiddenWhenEmpty:!0,withScrollArea:E,maxDropdownHeight:O,unstyled:a,labelId:ae.label?`${oe}-label`:void 0,"aria-label":ae.label?void 0:ae[`aria-label`],renderOption:j,scrollAreaProps:N})]})});Fp.classes={...xd.classes,...rp.classes},Fp.displayName=`@mantine/core/Autocomplete`;var Ip={root:`m_347db0ec`,"root--dot":`m_fbd81e3d`,label:`m_5add502a`,section:`m_91fdda9b`},Lp=jn((e,{radius:t,color:n,gradient:r,variant:i,size:a,autoContrast:o,circle:s})=>{let c=e.variantColorResolver({color:n||e.primaryColor,theme:e,gradient:r,variant:i||`filled`,autoContrast:o});return{root:{"--badge-height":_t(a,`badge-height`),"--badge-padding-x":_t(a,`badge-padding-x`),"--badge-fz":_t(a,`badge-fz`),"--badge-radius":s||t===void 0?void 0:yt(t),"--badge-bg":n||i?c.background:void 0,"--badge-color":n||i?c.color:void 0,"--badge-bd":n||i?c.border:void 0,"--badge-dot-color":i===`dot`?or(n,e):void 0}}}),Rp=Yi((e,t)=>{let n=z(`Badge`,null,e),{classNames:r,className:i,style:a,styles:o,unstyled:s,vars:c,radius:l,color:u,gradient:d,leftSection:f,rightSection:p,children:m,variant:h,fullWidth:g,autoContrast:_,circle:v,mod:y,attributes:b,...x}=n,S=oi({name:`Badge`,props:n,classes:Ip,className:i,style:a,classNames:r,styles:o,unstyled:s,attributes:b,vars:c,varsResolver:Lp});return(0,R.jsxs)(B,{variant:h,mod:[{block:g,circle:v,"with-right-section":!!p,"with-left-section":!!f},y],...S(`root`,{variant:h}),ref:t,...x,children:[f&&(0,R.jsx)(`span`,{...S(`section`),"data-position":`left`,children:f}),(0,R.jsx)(`span`,{...S(`label`),children:m}),p&&(0,R.jsx)(`span`,{...S(`section`),"data-position":`right`,children:p})]})});Rp.classes=Ip,Rp.displayName=`@mantine/core/Badge`;var zp={root:`m_77c9d27d`,inner:`m_80f1301b`,label:`m_811560b9`,section:`m_a74036a`,loader:`m_a25b86ee`,group:`m_80d6d844`,groupSection:`m_70be2a01`},Bp={orientation:`horizontal`},Vp=jn((e,{borderWidth:t})=>({group:{"--button-border-width":L(t)}})),Hp=V((e,t)=>{let n=z(`ButtonGroup`,Bp,e),{className:r,style:i,classNames:a,styles:o,unstyled:s,orientation:c,vars:l,borderWidth:u,variant:d,mod:f,attributes:p,...m}=z(`ButtonGroup`,Bp,e),h=oi({name:`ButtonGroup`,props:n,classes:zp,className:r,style:i,classNames:a,styles:o,unstyled:s,attributes:p,vars:l,varsResolver:Vp,rootSelector:`group`});return(0,R.jsx)(B,{...h(`group`),ref:t,variant:d,mod:[{"data-orientation":c},f],role:`group`,...m})});Hp.classes=zp,Hp.displayName=`@mantine/core/ButtonGroup`;var Up=jn((e,{radius:t,color:n,gradient:r,variant:i,autoContrast:a,size:o})=>{let s=e.variantColorResolver({color:n||e.primaryColor,theme:e,gradient:r,variant:i||`filled`,autoContrast:a});return{groupSection:{"--section-height":_t(o,`section-height`),"--section-padding-x":_t(o,`section-padding-x`),"--section-fz":o?.includes(`compact`)?bt(o.replace(`compact-`,``)):bt(o),"--section-radius":t===void 0?void 0:yt(t),"--section-bg":n||i?s.background:void 0,"--section-color":s.color,"--section-bd":n||i?s.border:void 0}}}),Wp=V((e,t)=>{let n=z(`ButtonGroupSection`,null,e),{className:r,style:i,classNames:a,styles:o,unstyled:s,vars:c,variant:l,gradient:u,radius:d,autoContrast:f,attributes:p,...m}=n,h=oi({name:`ButtonGroupSection`,props:n,classes:zp,className:r,style:i,classNames:a,styles:o,unstyled:s,attributes:p,vars:c,varsResolver:Up,rootSelector:`groupSection`});return(0,R.jsx)(B,{...h(`groupSection`),ref:t,variant:l,...m})});Wp.classes=zp,Wp.displayName=`@mantine/core/ButtonGroupSection`;var Gp={in:{opacity:1,transform:`translate(-50%, calc(-50% + ${L(1)}))`},out:{opacity:0,transform:`translate(-50%, -200%)`},common:{transformOrigin:`center`},transitionProperty:`transform, opacity`},Kp=jn((e,{radius:t,color:n,gradient:r,variant:i,size:a,justify:o,autoContrast:s})=>{let c=e.variantColorResolver({color:n||e.primaryColor,theme:e,gradient:r,variant:i||`filled`,autoContrast:s});return{root:{"--button-justify":o,"--button-height":_t(a,`button-height`),"--button-padding-x":_t(a,`button-padding-x`),"--button-fz":a?.includes(`compact`)?bt(a.replace(`compact-`,``)):bt(a),"--button-radius":t===void 0?void 0:yt(t),"--button-bg":n||i?c.background:void 0,"--button-hover":n||i?c.hover:void 0,"--button-color":c.color,"--button-bd":n||i?c.border:void 0,"--button-hover-color":n||i?c.hoverColor:void 0}}}),qp=Yi((e,t)=>{let n=z(`Button`,null,e),{style:r,vars:i,className:a,color:o,disabled:s,children:c,leftSection:l,rightSection:u,fullWidth:d,variant:f,radius:p,loading:m,loaderProps:h,gradient:g,classNames:_,styles:v,unstyled:y,"data-disabled":b,autoContrast:x,mod:S,attributes:C,...w}=n,T=oi({name:`Button`,props:n,classes:zp,className:a,style:r,classNames:_,styles:v,unstyled:y,attributes:C,vars:i,varsResolver:Kp}),E=!!l,D=!!u;return(0,R.jsxs)(xl,{ref:t,...T(`root`,{active:!s&&!m&&!b}),unstyled:y,variant:f,disabled:s||m,mod:[{disabled:s||b,loading:m,block:d,"with-left-section":E,"with-right-section":D},S],...w,children:[typeof m==`boolean`&&(0,R.jsx)(ql,{mounted:m,transition:Gp,duration:150,children:e=>(0,R.jsx)(B,{component:`span`,...T(`loader`,{style:e}),"aria-hidden":!0,children:(0,R.jsx)(hu,{color:`var(--button-color)`,size:`calc(var(--button-height) / 1.8)`,...h})})}),(0,R.jsxs)(`span`,{...T(`inner`),children:[l&&(0,R.jsx)(B,{component:`span`,...T(`section`),mod:{position:`left`},children:l}),(0,R.jsx)(B,{component:`span`,mod:{loading:m},...T(`label`),children:c}),u&&(0,R.jsx)(B,{component:`span`,...T(`section`),mod:{position:`right`},children:u})]})]})});qp.classes=zp,qp.displayName=`@mantine/core/Button`,qp.Group=Hp,qp.GroupSection=Wp;var[Jp,Yp]=at(`Card component was not found in tree`),Xp={root:`m_e615b15f`,section:`m_599a2148`},Zp=Yi((e,t)=>{let{classNames:n,className:r,style:i,styles:a,vars:o,withBorder:s,inheritPadding:c,mod:l,...u}=z(`CardSection`,null,e),d=Yp();return(0,R.jsx)(B,{ref:t,mod:[{"with-border":s,"inherit-padding":c},l],...d.getStyles(`section`,{className:r,style:i,styles:a,classNames:n}),...u})});Zp.classes=Xp,Zp.displayName=`@mantine/core/CardSection`;var Qp=jn((e,{padding:t})=>({root:{"--card-padding":vt(t)}})),$p=Yi((e,t)=>{let n=z(`Card`,null,e),{classNames:r,className:i,style:a,styles:o,unstyled:s,vars:c,children:l,padding:u,attributes:d,...f}=n,p=oi({name:`Card`,props:n,classes:Xp,className:i,style:a,classNames:r,styles:o,unstyled:s,attributes:d,vars:c,varsResolver:Qp}),m=D.Children.toArray(l),h=m.map((e,t)=>typeof e==`object`&&e&&`type`in e&&e.type===Zp?(0,D.cloneElement)(e,{"data-first-section":t===0||void 0,"data-last-section":t===m.length-1||void 0}):e);return(0,R.jsx)(Jp,{value:{getStyles:p},children:(0,R.jsx)(El,{ref:t,unstyled:s,...p(`root`),...f,children:h})})});$p.classes=Xp,$p.displayName=`@mantine/core/Card`,$p.Section=Zp;var em={root:`m_b183c0a2`},tm=jn((e,{color:t})=>({root:{"--code-bg":t?or(t,e):void 0}})),nm=V((e,t)=>{let n=z(`Code`,null,e),{classNames:r,className:i,style:a,styles:o,unstyled:s,vars:c,color:l,block:u,variant:d,mod:f,attributes:p,...m}=n,h=oi({name:`Code`,props:n,classes:em,className:i,style:a,classNames:r,styles:o,unstyled:s,attributes:p,vars:c,varsResolver:tm});return(0,R.jsx)(B,{component:u?`pre`:`code`,variant:d,ref:t,mod:[{block:u},f],...h(`root`),...m,dir:`ltr`})});nm.classes=em,nm.displayName=`@mantine/core/Code`;var rm={timeout:1e3};function im(e){let{children:t,timeout:n,value:r,...i}=z(`CopyButton`,rm,e),a=Ft({timeout:n});return(0,R.jsx)(R.Fragment,{children:t({copy:()=>a.copy(r),copied:a.copied,...i})})}im.displayName=`@mantine/core/CopyButton`;var am={root:`m_3eebeb36`,label:`m_9e365f20`},om={orientation:`horizontal`},sm=jn((e,{color:t,variant:n,size:r})=>({root:{"--divider-color":t?or(t,e):void 0,"--divider-border-style":n,"--divider-size":_t(r,`divider-size`)}})),cm=V((e,t)=>{let n=z(`Divider`,om,e),{classNames:r,className:i,style:a,styles:o,unstyled:s,vars:c,color:l,orientation:u,label:d,labelPosition:f,mod:p,attributes:m,...h}=n,g=oi({name:`Divider`,classes:am,props:n,className:i,style:a,classNames:r,styles:o,unstyled:s,attributes:m,vars:c,varsResolver:sm});return(0,R.jsx)(B,{ref:t,mod:[{orientation:u,"with-label":!!d},p],...g(`root`),...h,role:`separator`,children:d&&(0,R.jsx)(B,{component:`span`,mod:{position:f},...g(`label`),children:d})})});cm.classes=am,cm.displayName=`@mantine/core/Divider`;var eee={multiple:!1},lm=(0,D.forwardRef)((e,t)=>{let{onChange:n,children:r,multiple:i,accept:a,name:o,form:s,resetRef:c,disabled:l,capture:u,inputProps:d,...f}=z(`FileButton`,eee,e),p=(0,D.useRef)(null),m=()=>{!l&&p.current?.click()};return fn(c,()=>{p.current&&(p.current.value=``)}),(0,R.jsxs)(R.Fragment,{children:[(0,R.jsx)(`input`,{style:{display:`none`},type:`file`,accept:a,multiple:i,onChange:e=>{if(e.currentTarget.files===null)return n(i?[]:null);n(i?Array.from(e.currentTarget.files):e.currentTarget.files[0]||null)},ref:mn(t,p),name:o,form:s,capture:u,...d}),r({onClick:m,...f})]})});lm.displayName=`@mantine/core/FileButton`;var um={root:`m_9e117634`},tee=jn((e,{radius:t,fit:n})=>({root:{"--image-radius":t===void 0?void 0:yt(t),"--image-object-fit":n}})),dm=Yi((e,t)=>{let n=z(`Image`,null,e),{classNames:r,className:i,style:a,styles:o,unstyled:s,vars:c,onError:l,src:u,radius:d,fit:f,fallbackSrc:p,mod:m,attributes:h,...g}=n,[_,v]=(0,D.useState)(!u);(0,D.useEffect)(()=>v(!u),[u]);let y=oi({name:`Image`,classes:um,props:n,className:i,style:a,classNames:r,styles:o,unstyled:s,attributes:h,vars:c,varsResolver:tee});return _&&p?(0,R.jsx)(B,{component:`img`,ref:t,src:p,...y(`root`),onError:l,mod:[`fallback`,m],...g}):(0,R.jsx)(B,{component:`img`,ref:t,...y(`root`),src:u,onError:e=>{l?.(e),v(!0)},mod:m,...g})});dm.classes=um,dm.displayName=`@mantine/core/Image`;function fm(){return fm=Object.assign?Object.assign.bind():function(e){for(var t=1;t<arguments.length;t++){var n=arguments[t];for(var r in n)({}).hasOwnProperty.call(n,r)&&(e[r]=n[r])}return e},fm.apply(null,arguments)}function pm(e,t){if(e==null)return{};var n={};for(var r in e)if({}.hasOwnProperty.call(e,r)){if(t.indexOf(r)!==-1)continue;n[r]=e[r]}return n}var mm=D.useLayoutEffect,nee=function(e){var t=D.useRef(e);return mm(function(){t.current=e}),t},hm=function(e,t){if(typeof e==`function`){e(t);return}e.current=t},gm=function(e,t){var n=D.useRef();return D.useCallback(function(r){e.current=r,n.current&&hm(n.current,null),n.current=t,t&&hm(t,r)},[t])},_m={"min-height":`0`,"max-height":`none`,height:`0`,visibility:`hidden`,overflow:`hidden`,position:`absolute`,"z-index":`-1000`,top:`0`,right:`0`,display:`block`},vm=function(e){Object.keys(_m).forEach(function(t){e.style.setProperty(t,_m[t],`important`)})},ym=null,bm=function(e,t){var n=e.scrollHeight;return t.sizingStyle.boxSizing===`border-box`?n+t.borderSize:n-t.paddingSize};function xm(e,t,n,r){n===void 0&&(n=1),r===void 0&&(r=1/0),ym||(ym=document.createElement(`textarea`),ym.setAttribute(`tabindex`,`-1`),ym.setAttribute(`aria-hidden`,`true`),vm(ym)),ym.parentNode===null&&document.body.appendChild(ym);var i=e.paddingSize,a=e.borderSize,o=e.sizingStyle,s=o.boxSizing;Object.keys(o).forEach(function(e){var t=e;ym.style[t]=o[t]}),vm(ym),ym.value=t;var c=bm(ym,e);ym.value=t,c=bm(ym,e),ym.value=`x`;var l=ym.scrollHeight-i,u=l*n;s===`border-box`&&(u=u+i+a),c=Math.max(u,c);var d=l*r;return s===`border-box`&&(d=d+i+a),c=Math.min(d,c),[c,l]}var Sm=function(){},Cm=function(e,t){return e.reduce(function(e,n){return e[n]=t[n],e},{})},wm=[`borderBottomWidth`,`borderLeftWidth`,`borderRightWidth`,`borderTopWidth`,`boxSizing`,`fontFamily`,`fontSize`,`fontStyle`,`fontWeight`,`letterSpacing`,`lineHeight`,`paddingBottom`,`paddingLeft`,`paddingRight`,`paddingTop`,`tabSize`,`textIndent`,`textRendering`,`textTransform`,`width`,`wordBreak`,`wordSpacing`,`scrollbarGutter`],Tm=!!document.documentElement.currentStyle,ree=function(e){var t=window.getComputedStyle(e);if(t===null)return null;var n=Cm(wm,t),r=n.boxSizing;return r===``?null:(Tm&&r===`border-box`&&(n.width=parseFloat(n.width)+parseFloat(n.borderRightWidth)+parseFloat(n.borderLeftWidth)+parseFloat(n.paddingRight)+parseFloat(n.paddingLeft)+`px`),{sizingStyle:n,paddingSize:parseFloat(n.paddingBottom)+parseFloat(n.paddingTop),borderSize:parseFloat(n.borderBottomWidth)+parseFloat(n.borderTopWidth)})};function Em(e,t,n){var r=nee(n);D.useLayoutEffect(function(){var n=function(e){return r.current(e)};if(e)return e.addEventListener(t,n),function(){return e.removeEventListener(t,n)}},[])}var Dm=function(e,t){Em(document.body,`reset`,function(n){e.current.form===n.target&&t(n)})},Om=function(e){Em(window,`resize`,e)},km=function(e){Em(document.fonts,`loadingdone`,e)},Am=[`cacheMeasurements`,`maxRows`,`minRows`,`onChange`,`onHeightChange`],iee=D.forwardRef(function(e,t){var n=e.cacheMeasurements,r=e.maxRows,i=e.minRows,a=e.onChange,o=a===void 0?Sm:a,s=e.onHeightChange,c=s===void 0?Sm:s,l=pm(e,Am),u=l.value!==void 0,d=D.useRef(null),f=gm(d,t),p=D.useRef(0),m=D.useRef(),h=function(){var e=d.current,t=n&&m.current?m.current:ree(e);if(t){m.current=t;var a=xm(t,e.value||e.placeholder||`x`,i,r),o=a[0],s=a[1];p.current!==o&&(p.current=o,e.style.setProperty(`height`,o+`px`,`important`),c(o,{rowHeight:s}))}};return D.useLayoutEffect(h),Dm(d,function(){if(!u){var e=d.current.value;requestAnimationFrame(function(){var t=d.current;t&&e!==t.value&&h()})}}),Om(h),km(h),D.createElement(`textarea`,fm({},l,{onChange:function(e){u||h(),o(e)},ref:f}))}),aee={size:`sm`},jm=V((e,t)=>{let{autosize:n,maxRows:r,minRows:i,__staticSelector:a,resize:o,...s}=z(`Textarea`,aee,e),c=n&&Tn()!==`test`,l=c?{maxRows:r,minRows:i}:{};return(0,R.jsx)(xd,{component:c?iee:`textarea`,ref:t,...s,__staticSelector:a||`Textarea`,multiline:!0,"data-no-overflow":n&&r===void 0||void 0,__vars:{"--input-resize":o},...l})});jm.classes=xd.classes,jm.displayName=`@mantine/core/Textarea`;function Mm(e,t){if(typeof e==`string`&&e.trim().length===0)return!0;try{return t(e),!0}catch{return!1}}var oee={serialize:JSON.stringify,deserialize:JSON.parse,size:`sm`},Nm=V((e,t)=>{let{value:n,defaultValue:r,onChange:i,formatOnBlur:a,validationError:o,serialize:s,deserialize:c,onFocus:l,onBlur:u,readOnly:d,error:f,...p}=z(`JsonInput`,oee,e),[m,h]=hn({value:n,defaultValue:r,finalValue:``,onChange:i}),[g,_]=(0,D.useState)(Mm(m,c));return(0,R.jsx)(jm,{value:m,onChange:e=>h(e.currentTarget.value),onFocus:e=>{l?.(e),_(!0)},onBlur:e=>{typeof u==`function`&&u(e);let t=Mm(e.currentTarget.value,c);a&&!d&&t&&e.currentTarget.value.trim()!==``&&h(s(c(e.currentTarget.value),null,2)),_(t)},ref:t,readOnly:d,...p,autoComplete:`off`,__staticSelector:`JsonInput`,error:g?f:o||!0,"data-monospace":!0})});Nm.classes=xd.classes,Nm.displayName=`@mantine/core/JsonInput`;var[Pm,Fm]=at(`List component was not found in tree`),Im={root:`m_abbac491`,item:`m_abb6bec2`,itemWrapper:`m_75cd9f71`,itemIcon:`m_60f83e5b`},Lm=V((e,t)=>{let{classNames:n,className:r,style:i,styles:a,vars:o,icon:s,children:c,mod:l,...u}=z(`ListItem`,null,e),d=Fm(),f=s||d.icon,p={classNames:n,styles:a};return(0,R.jsx)(B,{...d.getStyles(`item`,{...p,className:r,style:i}),component:`li`,mod:[{"with-icon":!!f,centered:d.center},l],ref:t,...u,children:(0,R.jsxs)(`div`,{...d.getStyles(`itemWrapper`,p),children:[f&&(0,R.jsx)(`span`,{...d.getStyles(`itemIcon`,p),children:f}),(0,R.jsx)(`span`,{...d.getStyles(`itemLabel`,p),children:c})]})})});Lm.classes=Im,Lm.displayName=`@mantine/core/ListItem`;var Rm={type:`unordered`},zm=jn((e,{size:t,spacing:n})=>({root:{"--list-fz":bt(t),"--list-lh":xt(t),"--list-spacing":vt(n)}})),Bm=V((e,t)=>{let n=z(`List`,Rm,e),{classNames:r,className:i,style:a,styles:o,unstyled:s,vars:c,children:l,type:u,withPadding:d,icon:f,spacing:p,center:m,listStyleType:h,mod:g,attributes:_,...v}=n,y=oi({name:`List`,classes:Im,props:n,className:i,style:a,classNames:r,styles:o,unstyled:s,attributes:_,vars:c,varsResolver:zm});return(0,R.jsx)(Pm,{value:{center:m,icon:f,getStyles:y},children:(0,R.jsx)(B,{...y(`root`,{style:{listStyleType:h}}),component:u===`unordered`?`ul`:`ol`,mod:[{"with-padding":d,type:f?`none`:h},g],ref:t,...v,children:l})})});Bm.classes=Im,Bm.displayName=`@mantine/core/List`,Bm.Item=Lm;var[Vm,Hm]=at(`Menu component was not found in the tree`),Um={dropdown:`m_dc9b7c9f`,label:`m_9bfac126`,divider:`m_efdf90cb`,item:`m_99ac2aa1`,itemLabel:`m_5476e0d3`,itemSection:`m_8b75e504`,chevron:`m_b85b0bed`},Wm=V((e,t)=>{let{classNames:n,className:r,style:i,styles:a,vars:o,...s}=z(`MenuDivider`,null,e),c=Hm();return(0,R.jsx)(B,{ref:t,...c.getStyles(`divider`,{className:r,style:i,styles:a,classNames:n}),...s})});Wm.classes=Um,Wm.displayName=`@mantine/core/MenuDivider`;var Gm=V((e,t)=>{let{classNames:n,className:r,style:i,styles:a,vars:o,onMouseEnter:s,onMouseLeave:c,onKeyDown:l,children:u,...d}=z(`MenuDropdown`,null,e),f=(0,D.useRef)(null),p=Hm(),m=Ct(l,e=>{(e.key===`ArrowUp`||e.key===`ArrowDown`)&&(e.preventDefault(),f.current?.querySelectorAll(`[data-menu-item]:not(:disabled)`)[0]?.focus())}),h=Ct(s,()=>(p.trigger===`hover`||p.trigger===`click-hover`)&&p.openDropdown()),g=Ct(c,()=>(p.trigger===`hover`||p.trigger===`click-hover`)&&p.closeDropdown());return(0,R.jsxs)(su.Dropdown,{...d,onMouseEnter:h,onMouseLeave:g,role:`menu`,"aria-orientation":`vertical`,ref:mn(t,f),...p.getStyles(`dropdown`,{className:r,style:i,styles:a,classNames:n,withStaticClass:!1}),tabIndex:-1,"data-menu-dropdown":!0,onKeyDown:m,children:[p.withInitialFocusPlaceholder&&(0,R.jsx)(`div`,{tabIndex:-1,"data-autofocus":!0,"data-mantine-stop-propagation":!0,style:{outline:0}}),u]})});Gm.classes=Um,Gm.displayName=`@mantine/core/MenuDropdown`;var[Km,qm]=ot(),Jm=Yi((e,t)=>{let{classNames:n,className:r,style:i,styles:a,vars:o,color:s,closeMenuOnClick:c,leftSection:l,rightSection:u,children:d,disabled:f,"data-disabled":p,...m}=z(`MenuItem`,null,e),h=Hm(),g=qm(),_=Cr(),{dir:v}=Zi(),y=(0,D.useRef)(null),b=m,x=Ct(b.onClick,()=>{p||(typeof c==`boolean`?c&&h.closeDropdownImmediately():h.closeOnItemClick&&h.closeDropdownImmediately())}),S=s?_.variantColorResolver({color:s,theme:_,variant:`light`}):void 0,C=s?ar({color:s,theme:_}):null,w=Ct(b.onKeyDown,e=>{e.key===`ArrowLeft`&&g&&(g.close(),g.focusParentItem())});return(0,R.jsxs)(xl,{onMouseDown:e=>e.preventDefault(),...m,unstyled:h.unstyled,tabIndex:h.menuItemTabIndex,...h.getStyles(`item`,{className:r,style:i,styles:a,classNames:n}),ref:mn(y,t),role:`menuitem`,disabled:f,"data-menu-item":!0,"data-disabled":f||p||void 0,"data-mantine-stop-propagation":!0,onClick:x,onKeyDown:ft({siblingSelector:`[data-menu-item]:not([data-disabled])`,parentSelector:`[data-menu-dropdown]`,activateOnFocus:!1,loop:h.loop,dir:v,orientation:`vertical`,onKeyDown:w}),__vars:{"--menu-item-color":C?.isThemeColor&&C?.shade===void 0?`var(--mantine-color-${C.color}-6)`:S?.color,"--menu-item-hover":S?.hover},children:[l&&(0,R.jsx)(`div`,{...h.getStyles(`itemSection`,{styles:a,classNames:n}),"data-position":`left`,children:l}),d&&(0,R.jsx)(`div`,{...h.getStyles(`itemLabel`,{styles:a,classNames:n}),children:d}),u&&(0,R.jsx)(`div`,{...h.getStyles(`itemSection`,{styles:a,classNames:n}),"data-position":`right`,children:u})]})});Jm.classes=Um,Jm.displayName=`@mantine/core/MenuItem`;var Ym=V((e,t)=>{let{classNames:n,className:r,style:i,styles:a,vars:o,...s}=z(`MenuLabel`,null,e),c=Hm();return(0,R.jsx)(B,{ref:t,...c.getStyles(`label`,{className:r,style:i,styles:a,classNames:n}),...s})});Ym.classes=Um,Ym.displayName=`@mantine/core/MenuLabel`;var Xm=V((e,t)=>{let{classNames:n,className:r,style:i,styles:a,vars:o,onMouseEnter:s,onMouseLeave:c,onKeyDown:l,children:u,...d}=z(`MenuSubDropdown`,null,e),f=(0,D.useRef)(null),p=Hm(),m=qm(),h=Ct(s,m?.open),g=Ct(c,m?.close);return(0,R.jsx)(su.Dropdown,{...d,onMouseEnter:h,onMouseLeave:g,role:`menu`,"aria-orientation":`vertical`,ref:mn(t,f),...p.getStyles(`dropdown`,{className:r,style:i,styles:a,classNames:n,withStaticClass:!1}),tabIndex:-1,"data-menu-dropdown":!0,children:u})});Xm.classes=Um,Xm.displayName=`@mantine/core/MenuSubDropdown`;var Zm=Yi((e,t)=>{let{classNames:n,className:r,style:i,styles:a,vars:o,color:s,leftSection:c,rightSection:l,children:u,disabled:d,"data-disabled":f,closeMenuOnClick:p,...m}=z(`MenuSubItem`,null,e),h=Hm(),g=qm(),_=Cr(),{dir:v}=Zi(),y=(0,D.useRef)(null),b=m,x=s?_.variantColorResolver({color:s,theme:_,variant:`light`}):void 0,S=s?ar({color:s,theme:_}):null,C=Ct(b.onKeyDown,e=>{e.key===`ArrowRight`&&(g?.open(),g?.focusFirstItem()),e.key===`ArrowLeft`&&g?.parentContext&&(g.parentContext.close(),g.parentContext.focusParentItem())}),w=Ct(b.onClick,()=>{!f&&p&&h.closeDropdownImmediately()}),T=Ct(b.onMouseEnter,g?.open),E=Ct(b.onMouseLeave,g?.close);return(0,R.jsxs)(xl,{onMouseDown:e=>e.preventDefault(),...m,unstyled:h.unstyled,tabIndex:h.menuItemTabIndex,...h.getStyles(`item`,{className:r,style:i,styles:a,classNames:n}),ref:mn(y,t),role:`menuitem`,disabled:d,"data-menu-item":!0,"data-sub-menu-item":!0,"data-disabled":d||f||void 0,"data-mantine-stop-propagation":!0,onMouseEnter:T,onMouseLeave:E,onClick:w,onKeyDown:ft({siblingSelector:`[data-menu-item]:not([data-disabled])`,parentSelector:`[data-menu-dropdown]`,activateOnFocus:!1,loop:h.loop,dir:v,orientation:`vertical`,onKeyDown:C}),__vars:{"--menu-item-color":S?.isThemeColor&&S?.shade===void 0?`var(--mantine-color-${S.color}-6)`:x?.color,"--menu-item-hover":x?.hover},children:[c&&(0,R.jsx)(`div`,{...h.getStyles(`itemSection`,{styles:a,classNames:n}),"data-position":`left`,children:c}),u&&(0,R.jsx)(`div`,{...h.getStyles(`itemLabel`,{styles:a,classNames:n}),children:u}),(0,R.jsx)(`div`,{...h.getStyles(`itemSection`,{styles:a,classNames:n}),"data-position":`right`,children:l||(0,R.jsx)(Pd,{...h.getStyles(`chevron`),size:14})})]})});Zm.classes=Um,Zm.displayName=`@mantine/core/MenuSubItem`;function Qm({children:e,refProp:t}){if(!rt(e))throw Error(`Menu.Sub.Target component children should be an element or a component that accepts ref. Fragments, strings, numbers and other primitive values are not supported`);return Hm(),(0,R.jsx)(su.Target,{refProp:t,popupType:`menu`,children:e})}Qm.displayName=`@mantine/core/MenuSubTarget`;var see={offset:0,position:`right-start`,transitionProps:{duration:0},openDelay:0,middlewares:{shift:{crossAxis:!0}}};function $m(e){let{children:t,closeDelay:n,openDelay:r,...i}=z(`MenuSub`,see,e),a=rn(),[o,{open:s,close:c}]=bn(!1),l=qm(),{openDropdown:u,closeDropdown:d}=Ad({open:s,close:c,closeDelay:n,openDelay:r});return(0,R.jsx)(Km,{value:{opened:o,close:d,open:u,focusFirstItem:()=>window.setTimeout(()=>{document.getElementById(`${a}-dropdown`)?.querySelectorAll(`[data-menu-item]:not([data-disabled])`)[0]?.focus()},16),focusParentItem:()=>window.setTimeout(()=>{document.getElementById(`${a}-target`)?.focus()},16),parentContext:l},children:(0,R.jsx)(su,{opened:o,withinPortal:!1,withArrow:!1,id:a,...i,children:t})})}$m.extend=e=>e,$m.displayName=`@mantine/core/MenuSub`,$m.Target=Qm,$m.Dropdown=Xm,$m.Item=Zm;var cee={refProp:`ref`},eh=(0,D.forwardRef)((e,t)=>{let{children:n,refProp:r,...i}=z(`MenuTarget`,cee,e),a=An(n);if(!a)throw Error(`Menu.Target component children should be an element or a component that accepts ref. Fragments, strings, numbers and other primitive values are not supported`);let o=Hm(),s=a.props,c=Ct(s.onClick,()=>{o.trigger===`click`?o.toggleDropdown():o.trigger===`click-hover`&&(o.setOpenedViaClick(!0),o.opened||o.openDropdown())}),l=Ct(s.onMouseEnter,()=>(o.trigger===`hover`||o.trigger===`click-hover`)&&o.openDropdown()),u=Ct(s.onMouseLeave,()=>{(o.trigger===`hover`||o.trigger===`click-hover`&&!o.openedViaClick)&&o.closeDropdown()});return(0,R.jsx)(su.Target,{refProp:r,popupType:`menu`,ref:t,...i,children:(0,D.cloneElement)(a,{onClick:c,onMouseEnter:l,onMouseLeave:u,"data-expanded":o.opened?!0:void 0})})});eh.displayName=`@mantine/core/MenuTarget`;var lee={trapFocus:!0,closeOnItemClick:!0,withInitialFocusPlaceholder:!0,clickOutsideEvents:[`mousedown`,`touchstart`,`keydown`],loop:!0,trigger:`click`,openDelay:0,closeDelay:100,menuItemTabIndex:-1};function th(e){let t=z(`Menu`,lee,e),{children:n,onOpen:r,onClose:i,opened:a,defaultOpened:o,trapFocus:s,onChange:c,closeOnItemClick:l,loop:u,closeOnEscape:d,trigger:f,openDelay:p,closeDelay:m,classNames:h,styles:g,unstyled:_,variant:v,vars:y,menuItemTabIndex:b,keepMounted:x,withInitialFocusPlaceholder:S,attributes:C,...w}=t,T=oi({name:`Menu`,classes:Um,props:t,classNames:h,styles:g,unstyled:_,attributes:C}),[E,O]=hn({value:a,defaultValue:o,finalValue:!1,onChange:c}),[k,A]=(0,D.useState)(!1),j=()=>{O(!1),A(!1),E&&i?.()},M=()=>{O(!0),!E&&r?.()},N=()=>{E?j():M()},{openDropdown:ee,closeDropdown:te}=Ad({open:M,close:j,closeDelay:m,openDelay:p}),P=e=>Dt(`[data-menu-item]`,`[data-menu-dropdown]`,e),{resolvedClassNames:F,resolvedStyles:I}=Ur({classNames:h,styles:g,props:t});return(0,R.jsx)(Vm,{value:{getStyles:T,opened:E,toggleDropdown:N,getItemIndex:P,openedViaClick:k,setOpenedViaClick:A,closeOnItemClick:l,closeDropdown:f===`click`?j:te,openDropdown:f===`click`?M:ee,closeDropdownImmediately:j,loop:u,trigger:f,unstyled:_,menuItemTabIndex:b,withInitialFocusPlaceholder:S},children:(0,R.jsx)(su,{returnFocus:!0,...w,opened:E,onChange:N,defaultOpened:o,trapFocus:!x&&s,closeOnEscape:d,__staticSelector:`Menu`,classNames:F,styles:I,unstyled:_,variant:v,keepMounted:x,children:n})})}th.extend=e=>e,th.withProps=Ji(th),th.classes=Um,th.displayName=`@mantine/core/Menu`,th.Item=Jm,th.Label=Ym,th.Dropdown=Gm,th.Target=eh,th.Divider=Wm,th.Sub=$m;var nh={root:`m_9df02822`,content:`m_54c44539`,inner:`m_1f958f16`,header:`m_d0e2b9cd`},[uee,rh]=at(`Modal component was not found in tree`),ih=V((e,t)=>{let{classNames:n,className:r,style:i,styles:a,vars:o,...s}=z(`ModalBody`,null,e),c=rh();return(0,R.jsx)(Bu,{ref:t,...c.getStyles(`body`,{classNames:n,style:i,styles:a,className:r}),...s})});ih.classes=nh,ih.displayName=`@mantine/core/ModalBody`;var ah=V((e,t)=>{let{classNames:n,className:r,style:i,styles:a,vars:o,...s}=z(`ModalCloseButton`,null,e),c=rh();return(0,R.jsx)(Vu,{ref:t,...c.getStyles(`close`,{classNames:n,style:i,styles:a,className:r}),...s})});ah.classes=nh,ah.displayName=`@mantine/core/ModalCloseButton`;var oh=V((e,t)=>{let{classNames:n,className:r,style:i,styles:a,vars:o,children:s,__hidden:c,...l}=z(`ModalContent`,null,e),u=rh(),d=u.scrollAreaComponent||Yu;return(0,R.jsx)(Hu,{...u.getStyles(`content`,{className:r,style:i,styles:a,classNames:n}),innerProps:u.getStyles(`inner`,{className:r,style:i,styles:a,classNames:n}),"data-full-screen":u.fullScreen||void 0,"data-modal-content":!0,"data-hidden":c||void 0,ref:t,...l,children:(0,R.jsx)(d,{style:{maxHeight:u.fullScreen?`100dvh`:`calc(100dvh - (${L(u.yOffset)} * 2))`},children:s})})});oh.classes=nh,oh.displayName=`@mantine/core/ModalContent`;var sh=V((e,t)=>{let{classNames:n,className:r,style:i,styles:a,vars:o,...s}=z(`ModalHeader`,null,e),c=rh();return(0,R.jsx)(Uu,{ref:t,...c.getStyles(`header`,{classNames:n,style:i,styles:a,className:r}),...s})});sh.classes=nh,sh.displayName=`@mantine/core/ModalHeader`;var ch=V((e,t)=>{let{classNames:n,className:r,style:i,styles:a,vars:o,...s}=z(`ModalOverlay`,null,e),c=rh();return(0,R.jsx)(Ku,{ref:t,...c.getStyles(`overlay`,{classNames:n,style:i,styles:a,className:r}),...s})});ch.classes=nh,ch.displayName=`@mantine/core/ModalOverlay`;var lh={__staticSelector:`Modal`,closeOnClickOutside:!0,withinPortal:!0,lockScroll:!0,trapFocus:!0,returnFocus:!0,closeOnEscape:!0,keepMounted:!1,zIndex:mt(`modal`),transitionProps:{duration:200,transition:`fade-down`},yOffset:`5dvh`},uh=jn((e,{radius:t,size:n,yOffset:r,xOffset:i})=>({root:{"--modal-radius":t===void 0?void 0:yt(t),"--modal-size":_t(n,`modal-size`),"--modal-y-offset":L(r),"--modal-x-offset":L(i)}})),dh=V((e,t)=>{let n=z(`ModalRoot`,lh,e),{classNames:r,className:i,style:a,styles:o,unstyled:s,vars:c,yOffset:l,scrollAreaComponent:u,radius:d,fullScreen:f,centered:p,xOffset:m,__staticSelector:h,attributes:g,..._}=n,v=oi({name:h,classes:nh,props:n,className:i,style:a,classNames:r,styles:o,unstyled:s,attributes:g,vars:c,varsResolver:uh});return(0,R.jsx)(uee,{value:{yOffset:l,scrollAreaComponent:u,getStyles:v,fullScreen:f},children:(0,R.jsx)(Lu,{ref:t,...v(`root`),"data-full-screen":f||void 0,"data-centered":p||void 0,"data-offset-scrollbars":u===_l.Autosize||void 0,unstyled:s,..._})})});dh.classes=nh,dh.displayName=`@mantine/core/ModalRoot`;var[fh,ph]=ot();function mh({children:e}){let[t,n]=(0,D.useState)([]),[r,i]=(0,D.useState)(mt(`modal`));return(0,R.jsx)(fh,{value:{stack:t,addModal:(e,t)=>{n(t=>[...new Set([...t,e])]),i(e=>typeof t==`number`&&typeof e==`number`?Math.max(e,t):e)},removeModal:e=>n(t=>t.filter(t=>t!==e)),getZIndex:e=>`calc(${r} + ${t.indexOf(e)} + 1)`,currentId:t[t.length-1],maxZIndex:r},children:e})}mh.displayName=`@mantine/core/ModalStack`;var hh=V((e,t)=>{let{classNames:n,className:r,style:i,styles:a,vars:o,...s}=z(`ModalTitle`,null,e),c=rh();return(0,R.jsx)(Ju,{ref:t,...c.getStyles(`title`,{classNames:n,style:i,styles:a,className:r}),...s})});hh.classes=nh,hh.displayName=`@mantine/core/ModalTitle`;var gh={closeOnClickOutside:!0,withinPortal:!0,lockScroll:!0,trapFocus:!0,returnFocus:!0,closeOnEscape:!0,keepMounted:!1,zIndex:mt(`modal`),transitionProps:{duration:200,transition:`fade-down`},withOverlay:!0,withCloseButton:!0},_h=V((e,t)=>{let{title:n,withOverlay:r,overlayProps:i,withCloseButton:a,closeButtonProps:o,children:s,radius:c,opened:l,stackId:u,zIndex:d,...f}=z(`Modal`,gh,e),p=ph(),m=!!n||a,h=p&&u?{closeOnEscape:p.currentId===u,trapFocus:p.currentId===u,zIndex:p.getZIndex(u)}:{},g=r===!1?!1:u&&p?p.currentId===u:l;return(0,D.useEffect)(()=>{p&&u&&(l?p.addModal(u,d||mt(`modal`)):p.removeModal(u))},[l,u,d]),(0,R.jsxs)(dh,{ref:t,radius:c,opened:l,zIndex:p&&u?p.getZIndex(u):d,...f,...h,children:[r&&(0,R.jsx)(ch,{visible:g,transitionProps:p&&u?{duration:0}:void 0,...i}),(0,R.jsxs)(oh,{radius:c,__hidden:p&&u&&l?u!==p.currentId:!1,children:[m&&(0,R.jsxs)(sh,{children:[n&&(0,R.jsx)(hh,{children:n}),a&&(0,R.jsx)(ah,{...o})]}),(0,R.jsx)(ih,{children:s})]})]})});_h.classes=nh,_h.displayName=`@mantine/core/Modal`,_h.Root=dh,_h.Overlay=ch,_h.Content=oh,_h.Body=ih,_h.Header=sh,_h.Title=hh,_h.CloseButton=ah,_h.Stack=mh;var[vh,yh]=ot(),bh={root:`m_7cda1cd6`,"root--default":`m_44da308b`,"root--contrast":`m_e3a01f8`,label:`m_1e0e6180`,remove:`m_ae386778`,group:`m_1dcfd90b`},[xh,Sh]=ot(),Ch=jn((e,{gap:t},{size:n})=>({group:{"--pg-gap":t===void 0?_t(n,`pg-gap`):_t(t)}})),wh=V((e,t)=>{let n=z(`PillGroup`,null,e),{classNames:r,className:i,style:a,styles:o,unstyled:s,vars:c,size:l,disabled:u,attributes:d,...f}=n,p=yh()?.size||l||void 0,m=oi({name:`PillGroup`,classes:bh,props:n,className:i,style:a,classNames:r,styles:o,unstyled:s,attributes:d,vars:c,varsResolver:Ch,stylesCtx:{size:p},rootSelector:`group`});return(0,R.jsx)(xh,{value:{size:p,disabled:u},children:(0,R.jsx)(B,{ref:t,size:p,...m(`group`),...f})})});wh.classes=bh,wh.displayName=`@mantine/core/PillGroup`;var Th={variant:`default`},Eh=jn((e,{radius:t},{size:n})=>({root:{"--pill-fz":_t(n,`pill-fz`),"--pill-height":_t(n,`pill-height`),"--pill-radius":t===void 0?void 0:yt(t)}})),Dh=V((e,t)=>{let n=z(`Pill`,Th,e),{classNames:r,className:i,style:a,styles:o,unstyled:s,vars:c,variant:l,children:u,withRemoveButton:d,onRemove:f,removeButtonProps:p,radius:m,size:h,disabled:g,mod:_,attributes:v,...y}=n,b=Sh(),x=yh(),S=h||b?.size||void 0,C=x?.variant===`filled`?`contrast`:l||`default`,w=oi({name:`Pill`,classes:bh,props:n,className:i,style:a,classNames:r,styles:o,unstyled:s,attributes:v,vars:c,varsResolver:Eh,stylesCtx:{size:S}});return(0,R.jsxs)(B,{component:`span`,ref:t,variant:C,size:S,...w(`root`,{variant:C}),mod:[{"with-remove":d&&!g,disabled:g||b?.disabled},_],...y,children:[(0,R.jsx)(`span`,{...w(`label`),children:u}),d&&(0,R.jsx)(Ou,{variant:`transparent`,radius:m,tabIndex:-1,"aria-hidden":!0,unstyled:s,...p,...w(`remove`,{className:p?.className,style:p?.style}),onMouseDown:e=>{e.preventDefault(),e.stopPropagation(),p?.onMouseDown?.(e)},onClick:e=>{e.stopPropagation(),f?.(),p?.onClick?.(e)}})]})});Dh.classes=bh,Dh.displayName=`@mantine/core/Pill`,Dh.Group=wh;var Oh={field:`m_45c4369d`},kh={type:`visible`},Ah=V((e,t)=>{let n=z(`PillsInputField`,kh,e),{classNames:r,className:i,style:a,styles:o,unstyled:s,vars:c,type:l,disabled:u,id:d,pointer:f,mod:p,attributes:m,...h}=n,g=yh(),_=rd(),v=oi({name:`PillsInputField`,classes:Oh,props:n,className:i,style:a,classNames:r,styles:o,unstyled:s,attributes:m,rootSelector:`field`}),y=u||g?.disabled;return(0,R.jsx)(B,{component:`input`,ref:mn(t,g?.fieldRef),"data-type":l,disabled:y,mod:[{disabled:y,pointer:f},p],...v(`field`),...h,id:_?.inputId||d,"aria-invalid":g?.hasError,"aria-describedby":_?.describedBy,type:`text`,onMouseDown:e=>!f&&e.stopPropagation()})});Ah.classes=Oh,Ah.displayName=`@mantine/core/PillsInputField`;var jh={size:`sm`},Mh=V((e,t)=>{let{children:n,onMouseDown:r,onClick:i,size:a,disabled:o,__staticSelector:s,error:c,variant:l,...u}=z(`PillsInput`,jh,e),d=(0,D.useRef)(null);return(0,R.jsx)(vh,{value:{fieldRef:d,size:a,disabled:o,hasError:!!c,variant:l},children:(0,R.jsx)(xd,{size:a,error:c,variant:l,component:`div`,ref:t,"data-no-overflow":!0,onMouseDown:e=>{e.preventDefault(),r?.(e),d.current?.focus()},onClick:e=>{e.preventDefault(),e.currentTarget.closest(`fieldset`)?.disabled||(d.current?.focus(),i?.(e))},...u,multiline:!0,disabled:o,__staticSelector:s||`PillsInput`,withAria:!1,children:n})})});Mh.displayName=`@mantine/core/PillsInput`,Mh.Field=Ah;function Nh({data:e,value:t}){let n=t.map(e=>e.trim().toLowerCase());return e.reduce((e,t)=>(Op(t)?e.push({group:t.group,items:t.items.filter(e=>n.indexOf(e.value.toLowerCase().trim())===-1)}):n.indexOf(t.value.toLowerCase().trim())===-1&&e.push(t),e),[])}var Ph={xs:41,sm:50,md:60,lg:72,xl:89},Fh={maxValues:1/0,withCheckIcon:!0,checkIconPosition:`left`,hiddenInputValuesDivider:`,`,clearSearchOnChange:!0,openOnFocus:!0,size:`sm`},Ih=V((e,t)=>{let n=z(`MultiSelect`,Fh,e),{classNames:r,className:i,style:a,styles:o,unstyled:s,vars:c,size:l,value:u,defaultValue:d,onChange:f,onKeyDown:p,variant:m,data:h,dropdownOpened:g,defaultDropdownOpened:_,onDropdownOpen:v,onDropdownClose:y,selectFirstOptionOnChange:b,selectFirstOptionOnDropdownOpen:x,onOptionSubmit:S,comboboxProps:C,filter:w,limit:T,withScrollArea:E,maxDropdownHeight:O,searchValue:k,defaultSearchValue:A,onSearchChange:j,readOnly:M,disabled:N,onFocus:ee,onBlur:te,radius:P,rightSection:F,rightSectionWidth:I,rightSectionPointerEvents:ne,rightSectionProps:re,leftSection:ie,leftSectionWidth:ae,leftSectionPointerEvents:oe,leftSectionProps:se,inputContainer:ce,inputWrapperOrder:le,withAsterisk:ue,labelProps:de,descriptionProps:fe,errorProps:pe,wrapperProps:me,description:he,label:ge,error:_e,maxValues:ve,searchable:ye,nothingFoundMessage:be,withCheckIcon:xe,withAlignedLabels:Se,checkIconPosition:Ce,hidePickedOptions:we,withErrorStyles:Te,name:Ee,form:De,id:Oe,clearable:ke,clearButtonProps:Ae,hiddenInputProps:je,placeholder:Me,hiddenInputValuesDivider:Ne,required:Pe,mod:Fe,renderOption:Ie,onRemove:Le,onClear:Re,scrollAreaProps:ze,chevronColor:Be,attributes:Ve,clearSearchOnChange:He,openOnFocus:Ue,...We}=n,Ge=rn(Oe),Ke=Tf(h),qe=Ef(Ke),Je=(0,D.useRef)({}),Ye=ep({opened:g,defaultOpened:_,onDropdownOpen:()=>{v?.(),x&&Ye.selectFirstOption()},onDropdownClose:()=>{y?.(),Ye.resetSelectedOption()}}),{styleProps:Xe,rest:{type:Ze,autoComplete:Qe,...$e}}=hi(We),[L,et]=hn({value:u,defaultValue:d,finalValue:[],onChange:f}),[tt,nt]=hn({value:k,defaultValue:A,finalValue:``,onChange:j}),rt=e=>{nt(e),Ye.resetSelectedOption()},it=oi({name:`MultiSelect`,classes:{},props:n,classNames:r,styles:o,unstyled:s,attributes:Ve}),{resolvedClassNames:at,resolvedStyles:ot}=Ur({props:n,styles:o,classNames:r}),st=e=>{p?.(e),e.key===` `&&!ye&&(e.preventDefault(),Ye.toggleDropdown()),e.key===`Backspace`&&tt.length===0&&L.length>0&&(Le?.(L[L.length-1]),et(L.slice(0,L.length-1)))},ct=L.map((e,t)=>{let n=qe[e]||Je.current[e];return(0,R.jsx)(Dh,{withRemoveButton:!M&&!qe[e]?.disabled,onRemove:()=>{et(L.filter(t=>e!==t)),Le?.(e)},unstyled:s,disabled:N,...it(`pill`),children:n?.label||e},`${e}-${t}`)});(0,D.useEffect)(()=>{b&&Ye.selectFirstOption()},[b,tt]),(0,D.useEffect)(()=>{L.forEach(e=>{e in qe&&(Je.current[e]=qe[e])})},[qe,L]);let lt=(0,R.jsx)(rp.ClearButton,{...Ae,onClear:()=>{Re?.(),et([]),rt(``)}}),ut=Nh({data:Ke,value:L}),dt=ke&&L.length>0&&!N&&!M,ft=dt?{paddingInlineEnd:Ph[l]??Ph.sm}:void 0;return(0,R.jsxs)(R.Fragment,{children:[(0,R.jsxs)(rp,{store:Ye,classNames:at,styles:ot,unstyled:s,size:l,readOnly:M,__staticSelector:`MultiSelect`,attributes:Ve,onOptionSubmit:e=>{S?.(e),He&&rt(``),Ye.updateSelectedOptionIndex(`selected`),L.includes(qe[e].value)?(et(L.filter(t=>t!==qe[e].value)),Le?.(qe[e].value)):L.length<ve&&et([...L,qe[e].value])},...C,children:[(0,R.jsx)(rp.DropdownTarget,{children:(0,R.jsx)(Mh,{...Xe,__staticSelector:`MultiSelect`,classNames:at,styles:ot,unstyled:s,size:l,className:i,style:a,variant:m,disabled:N,radius:P,__defaultRightSection:(0,R.jsx)(rp.Chevron,{size:l,error:_e,unstyled:s,color:Be}),__clearSection:lt,__clearable:dt,rightSection:F,rightSectionPointerEvents:ne||`none`,rightSectionWidth:I,rightSectionProps:re,leftSection:ie,leftSectionWidth:ae,leftSectionPointerEvents:oe,leftSectionProps:se,inputContainer:ce,inputWrapperOrder:le,withAsterisk:ue,labelProps:de,descriptionProps:fe,errorProps:pe,wrapperProps:me,description:he,label:ge,error:_e,withErrorStyles:Te,__stylesApiProps:{...n,rightSectionPointerEvents:ne||`none`,multiline:!0},pointer:!ye,onClick:()=>ye?Ye.openDropdown():Ye.toggleDropdown(),"data-expanded":Ye.dropdownOpened||void 0,id:Ge,required:Pe,mod:Fe,attributes:Ve,children:(0,R.jsxs)(Dh.Group,{attributes:Ve,disabled:N,unstyled:s,...it(`pillsList`,{style:ft}),children:[ct,(0,R.jsx)(rp.EventsTarget,{autoComplete:Qe,children:(0,R.jsx)(Mh.Field,{...$e,ref:t,id:Ge,placeholder:Me,type:!ye&&!Me?`hidden`:`visible`,...it(`inputField`),unstyled:s,onFocus:e=>{ee?.(e),Ue&&ye&&Ye.openDropdown()},onBlur:e=>{te?.(e),Ye.closeDropdown(),rt(``)},onKeyDown:st,value:tt,onChange:e=>{rt(e.currentTarget.value),ye&&Ye.openDropdown(),b&&Ye.selectFirstOption()},disabled:N,readOnly:M||!ye,pointer:!ye})})]})})}),(0,R.jsx)(Pp,{data:we?ut:Ke,hidden:M||N,filter:w,search:tt,limit:T,hiddenWhenEmpty:!be,withScrollArea:E,maxDropdownHeight:O,filterOptions:ye,value:L,checkIconPosition:Ce,withCheckIcon:xe,withAlignedLabels:Se,nothingFoundMessage:be,unstyled:s,labelId:ge?`${Ge}-label`:void 0,"aria-label":ge?void 0:We[`aria-label`],renderOption:Ie,scrollAreaProps:ze})]}),(0,R.jsx)(rp.HiddenInput,{name:Ee,valuesDivider:Ne,value:L,form:De,disabled:N,...je})]})});Ih.classes={...xd.classes,...rp.classes},Ih.displayName=`@mantine/core/MultiSelect`;function Lh(e){return`group`in e}function Rh({data:e}){if(Lh(e)){let t=e.items.map(e=>(0,R.jsx)(Rh,{data:e},e.value));return(0,R.jsx)(`optgroup`,{label:e.group,children:t})}let{value:t,label:n,...r}=e;return(0,R.jsx)(`option`,{value:e.value,...r,children:e.label},e.value)}Rh.displayName=`@mantine/core/NativeSelectOption`;var zh={rightSectionPointerEvents:`none`},Bh=V((e,t)=>{let{data:n,children:r,size:i,error:a,rightSection:o,unstyled:s,...c}=z(`NativeSelect`,zh,e),l=Tf(n).map((e,t)=>(0,R.jsx)(Rh,{data:e},t));return(0,R.jsx)(xd,{component:`select`,ref:t,...c,__staticSelector:`NativeSelect`,size:i,pointer:!0,error:a,unstyled:s,rightSection:o||(0,R.jsx)(Af,{size:i,error:a,unstyled:s}),children:r||l})});Bh.classes=xd.classes,Bh.displayName=`@mantine/core/NativeSelect`;var Vh={root:`m_a513464`,icon:`m_a4ceffb`,loader:`m_b0920b15`,body:`m_a49ed24`,title:`m_3feedf16`,description:`m_3d733a3a`,closeButton:`m_919a4d88`},Hh={withCloseButton:!0},dee=jn((e,{radius:t,color:n})=>({root:{"--notification-radius":t===void 0?void 0:yt(t),"--notification-color":n?or(n,e):void 0}})),Uh=V((e,t)=>{let n=z(`Notification`,Hh,e),{className:r,color:i,radius:a,loading:o,withCloseButton:s,withBorder:c,title:l,icon:u,children:d,onClose:f,closeButtonProps:p,classNames:m,style:h,styles:g,unstyled:_,vars:v,mod:y,loaderProps:b,role:x,attributes:S,...C}=n,w=oi({name:`Notification`,classes:Vh,props:n,className:r,style:h,classNames:m,styles:g,unstyled:_,attributes:S,vars:v,varsResolver:dee});return(0,R.jsxs)(B,{...w(`root`),mod:[{"data-with-icon":!!u||o,"data-with-border":c},y],ref:t,role:x||`alert`,...C,children:[u&&!o&&(0,R.jsx)(`div`,{...w(`icon`),children:u}),o&&(0,R.jsx)(hu,{size:28,color:i,...b,...w(`loader`)}),(0,R.jsxs)(`div`,{...w(`body`),children:[l&&(0,R.jsx)(`div`,{...w(`title`),children:l}),(0,R.jsx)(B,{...w(`description`),mod:{"data-with-title":!!l},children:d})]}),s&&(0,R.jsx)(Ou,{iconSize:16,color:`gray`,...p,unstyled:_,onClick:f,...w(`closeButton`)})]})});Uh.classes=Vh,Uh.displayName=`@mantine/core/Notification`;function Wh(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}var Gh;(function(e){e.event=`event`,e.props=`prop`})(Gh||={});function Kh(){}function fee(e){var t,n=void 0;return function(){for(var r=[],i=arguments.length;i--;)r[i]=arguments[i];return t&&r.length===t.length&&r.every(function(e,n){return e===t[n]})?n:(t=r,n=e.apply(void 0,r),n)}}function qh(e){return!!(e||``).match(/\d/)}function Jh(e){return e==null}function pee(e){return typeof e==`number`&&isNaN(e)}function Yh(e){return Jh(e)||pee(e)||typeof e==`number`&&!isFinite(e)}function Xh(e){return e.replace(/[-[\]/{}()*+?.\\^$|]/g,`\\$&`)}function mee(e){switch(e){case`lakh`:return/(\d+?)(?=(\d\d)+(\d)(?!\d))(\.\d+)?/g;case`wan`:return/(\d)(?=(\d{4})+(?!\d))/g;default:return/(\d)(?=(\d{3})+(?!\d))/g}}function hee(e,t,n){var r=mee(n),i=e.search(/[1-9]/);return i=i===-1?e.length:i,e.substring(0,i)+e.substring(i,e.length).replace(r,`$1`+t)}function Zh(e){var t=(0,D.useRef)(e);return t.current=e,(0,D.useRef)(function(){for(var e=[],n=arguments.length;n--;)e[n]=arguments[n];return t.current.apply(t,e)}).current}function Qh(e,t){t===void 0&&(t=!0);var n=e[0]===`-`,r=n&&t;e=e.replace(`-`,``);var i=e.split(`.`);return{beforeDecimal:i[0],afterDecimal:i[1]||``,hasNegation:n,addNegation:r}}function $h(e){if(!e)return e;var t=e[0]===`-`;t&&(e=e.substring(1,e.length));var n=e.split(`.`),r=n[0].replace(/^0+/,``)||`0`,i=n[1]||``;return(t?`-`:``)+r+(i?`.`+i:``)}function eg(e,t,n){for(var r=``,i=n?`0`:``,a=0;a<=t-1;a++)r+=e[a]||i;return r}function tg(e,t){return Array(t+1).join(e)}function ng(e){var t=e+``,n=t[0]===`-`?`-`:``;n&&(t=t.substring(1));var r=t.split(/[eE]/g),i=r[0],a=r[1];if(a=Number(a),!a)return n+i;i=i.replace(`.`,``);var o=1+a,s=i.length;return o<0?i=`0.`+tg(`0`,Math.abs(o))+i:o>=s?i+=tg(`0`,o-s):i=(i.substring(0,o)||`0`)+`.`+i.substring(o),n+i}function rg(e,t,n){if([``,`-`].indexOf(e)!==-1)return e;var r=(e.indexOf(`.`)!==-1||n)&&t,i=Qh(e),a=i.beforeDecimal,o=i.afterDecimal,s=i.hasNegation,c=parseFloat(`0.`+(o||`0`)),l=(o.length<=t?`0.`+o:c.toFixed(t)).split(`.`),u=a;a&&Number(l[0])&&(u=a.split(``).reverse().reduce(function(e,t,n){return e.length>n?(Number(e[0])+Number(t)).toString()+e.substring(1,e.length):t+e},l[0]));var d=eg(l[1]||``,t,n),f=s?`-`:``,p=r?`.`:``;return``+f+u+p+d}function ig(e,t){if(e.value=e.value,e!==null){if(e.createTextRange){var n=e.createTextRange();return n.move(`character`,t),n.select(),!0}return e.selectionStart||e.selectionStart===0?(e.focus(),e.setSelectionRange(t,t),!0):(e.focus(),!1)}}var ag=fee(function(e,t){for(var n=0,r=0,i=e.length,a=t.length;e[n]===t[n]&&n<i;)n++;for(;e[i-1-r]===t[a-1-r]&&a-r>n&&i-r>n;)r++;return{from:{start:n,end:i-r},to:{start:n,end:a-r}}}),gee=function(e,t){var n=Math.min(e.selectionStart,t);return{from:{start:n,end:e.selectionEnd},to:{start:n,end:t}}};function _ee(e,t,n){return Math.min(Math.max(e,t),n)}function og(e){return Math.max(e.selectionStart,e.selectionEnd)}function sg(){return typeof navigator<`u`&&!(navigator.platform&&/iPhone|iPod/.test(navigator.platform))}function cg(e){return{from:{start:0,end:0},to:{start:0,end:e.length},lastValue:``}}function lg(e){var t=e.currentValue,n=e.formattedValue,r=e.currentValueIndex,i=e.formattedValueIndex;return t[r]===n[i]}function ug(e,t,n,r,i,a,o){o===void 0&&(o=lg);var s=i.findIndex(function(e){return e}),c=e.slice(0,s);!t&&!n.startsWith(c)&&(t=c,n=c+n,r+=c.length);for(var l=n.length,u=e.length,d={},f=Array(l),p=0;p<l;p++){f[p]=-1;for(var m=0,h=u;m<h;m++)if(o({currentValue:n,lastValue:t,formattedValue:e,currentValueIndex:p,formattedValueIndex:m})&&d[m]!==!0){f[p]=m,d[m]=!0;break}}for(var g=r;g<l&&(f[g]===-1||!a(n[g]));)g++;var _=g===l||f[g]===-1?u:f[g];for(g=r-1;g>0&&f[g]===-1;)g--;var v=g===-1||f[g]===-1?0:f[g]+1;return v>_?_:r-v<_-r?v:_}function dg(e,t,n,r){var i=e.length;if(t=_ee(t,0,i),r===`left`){for(;t>=0&&!n[t];)t--;t===-1&&(t=n.indexOf(!0))}else{for(;t<=i&&!n[t];)t++;t>i&&(t=n.lastIndexOf(!0))}return t===-1&&(t=i),t}function fg(e){for(var t=Array.from({length:e.length+1}).map(function(){return!0}),n=0,r=t.length;n<r;n++)t[n]=!!(qh(e[n])||qh(e[n-1]));return t}function pg(e,t,n,r,i,a){a===void 0&&(a=Kh);var o=Zh(function(e,t){var n,a;return Yh(e)?(a=``,n=``):typeof e==`number`||t?(a=typeof e==`number`?ng(e):e,n=r(a)):(a=i(e,void 0),n=r(a)),{formattedValue:n,numAsString:a}}),s=(0,D.useState)(function(){return o(Jh(e)?t:e,n)}),c=s[0],l=s[1],u=Zh(function(e,t){e.formattedValue!==c.formattedValue&&l({formattedValue:e.formattedValue,numAsString:e.value}),a(e,t)}),d=e,f=n;Jh(e)&&(d=c.numAsString,f=!0);var p=o(d,f);return(0,D.useMemo)(function(){l(p)},[p.formattedValue]),(0,D.useEffect)(function(){if(!Jh(t)&&Jh(e)&&c.formattedValue!==``){var n=parseFloat(c.numAsString);u({formattedValue:c.formattedValue,value:c.numAsString,floatValue:isNaN(n)?void 0:n},{event:void 0,source:Gh.props})}},[]),[c,u]}function mg(e){return e.replace(/[^0-9]/g,``)}function hg(e){return e}function vee(e){var t=e.type;t===void 0&&(t=`text`);var n=e.displayType;n===void 0&&(n=`input`);var r=e.customInput,i=e.renderText,a=e.getInputRef,o=e.format;o===void 0&&(o=hg);var s=e.removeFormatting;s===void 0&&(s=mg);var c=e.defaultValue,l=e.valueIsNumericString,u=e.onValueChange,d=e.isAllowed,f=e.onChange;f===void 0&&(f=Kh);var p=e.onKeyDown;p===void 0&&(p=Kh);var m=e.onMouseUp;m===void 0&&(m=Kh);var h=e.onFocus;h===void 0&&(h=Kh);var g=e.onBlur;g===void 0&&(g=Kh);var _=e.value,v=e.getCaretBoundary;v===void 0&&(v=fg);var y=e.isValidInputCharacter;y===void 0&&(y=qh);var b=e.isCharacterSame,x=Wh(e,[`type`,`displayType`,`customInput`,`renderText`,`getInputRef`,`format`,`removeFormatting`,`defaultValue`,`valueIsNumericString`,`onValueChange`,`isAllowed`,`onChange`,`onKeyDown`,`onMouseUp`,`onFocus`,`onBlur`,`value`,`getCaretBoundary`,`isValidInputCharacter`,`isCharacterSame`]),S=pg(_,c,!!l,o,s,u),C=S[0],w=C.formattedValue,T=C.numAsString,E=S[1],O=(0,D.useRef)(),k=(0,D.useRef)({formattedValue:w,numAsString:T}),A=function(e,t){k.current={formattedValue:e.formattedValue,numAsString:e.value},E(e,t)},j=(0,D.useState)(!1),M=j[0],N=j[1],ee=(0,D.useRef)(null),te=(0,D.useRef)({setCaretTimeout:null,focusTimeout:null});(0,D.useEffect)(function(){return N(!0),function(){clearTimeout(te.current.setCaretTimeout),clearTimeout(te.current.focusTimeout)}},[]);var P=o,F=function(e,t){var n=parseFloat(t);return{formattedValue:e,value:t,floatValue:isNaN(n)?void 0:n}},I=function(e,t,n){(e.selectionStart!==0||e.selectionEnd!==e.value.length)&&(ig(e,t),te.current.setCaretTimeout=setTimeout(function(){e.value===n&&e.selectionStart!==t&&ig(e,t)},0))},ne=function(e,t,n){return dg(e,t,v(e),n)},re=function(e,t,n){var r=v(t),i=ug(t,w,e,n,r,y,b);return i=dg(t,i,r),i},ie=function(e){var t=e.formattedValue;t===void 0&&(t=``);var n=e.input,r=e.source,i=e.event,a=e.numAsString,o;if(n){var s=e.inputValue||n.value,c=og(n);n.value=t,o=re(s,t,c),o!==void 0&&I(n,o,t)}t!==w&&A(F(t,a),{event:i,source:r})};(0,D.useEffect)(function(){var e=k.current,t=e.formattedValue,n=e.numAsString;(w!==t||T!==n)&&A(F(w,T),{event:void 0,source:Gh.props})},[w,T]);var ae=ee.current?og(ee.current):void 0;(typeof window<`u`?D.useLayoutEffect:D.useEffect)(function(){var e=ee.current;if(w!==k.current.formattedValue&&e){var t=re(k.current.formattedValue,w,ae);e.value=w,I(e,t,w)}},[w]);var oe=function(e,t,n){var r=t.target,i=O.current?gee(O.current,r.selectionEnd):ag(w,e),a=Object.assign(Object.assign({},i),{lastValue:w}),o=s(e,a),c=P(o);if(o=s(c,void 0),d&&!d(F(c,o))){var l=t.target,u=re(e,w,og(l));return l.value=w,I(l,u,w),!1}return ie({formattedValue:c,numAsString:o,inputValue:e,event:t,source:n,input:t.target}),!0},se=function(e,t){t===void 0&&(t=0),O.current={selectionStart:e.selectionStart,selectionEnd:e.selectionEnd+t}},ce=function(e){var t=e.target.value;oe(t,e,Gh.event)&&f(e),O.current=void 0},le=function(e){var t=e.target,n=e.key,r=t.selectionStart,i=t.selectionEnd,a=t.value;a===void 0&&(a=``);var o;n===`ArrowLeft`||n===`Backspace`?o=Math.max(r-1,0):n===`ArrowRight`?o=Math.min(r+1,a.length):n===`Delete`&&(o=r);var s=0;n===`Delete`&&r===i&&(s=1);var c=n===`ArrowLeft`||n===`ArrowRight`;if(o===void 0||r!==i&&!c){p(e),se(t,s);return}var l=o;c?(l=ne(a,o,n===`ArrowLeft`?`left`:`right`),l!==o&&e.preventDefault()):n===`Delete`&&!y(a[o])?l=ne(a,o,`right`):n===`Backspace`&&!y(a[o])&&(l=ne(a,o,`left`)),l!==o&&I(t,l,a),p(e),se(t,s)},ue=function(e){var t=e.target,n=function(){var e=t.selectionStart,n=t.selectionEnd,r=t.value;if(r===void 0&&(r=``),e===n){var i=ne(r,e);i!==e&&I(t,i,r)}};n(),requestAnimationFrame(function(){n()}),m(e),se(t)},de=function(e){e.persist&&e.persist();var t=e.target,n=e.currentTarget;ee.current=t,te.current.focusTimeout=setTimeout(function(){var r=t.selectionStart,i=t.selectionEnd,a=t.value;a===void 0&&(a=``);var o=ne(a,r);o!==r&&(r!==0||i!==a.length)&&I(t,o,a),h(Object.assign(Object.assign({},e),{currentTarget:n}))},0)},fe=function(e){ee.current=null,clearTimeout(te.current.focusTimeout),clearTimeout(te.current.setCaretTimeout),g(e)},pe=M&&sg()?`numeric`:void 0,me=Object.assign({inputMode:pe},x,{type:t,value:w,onChange:ce,onKeyDown:le,onMouseUp:ue,onFocus:de,onBlur:fe});if(n===`text`)return i?D.createElement(D.Fragment,null,i(w,x)||null):D.createElement(`span`,Object.assign({},x,{ref:a}),w);if(r){var he=r;return D.createElement(he,Object.assign({},me,{ref:a}))}return D.createElement(`input`,Object.assign({},me,{ref:a}))}function gg(e,t){var n=t.decimalScale,r=t.fixedDecimalScale,i=t.prefix;i===void 0&&(i=``);var a=t.suffix;a===void 0&&(a=``);var o=t.allowNegative,s=t.thousandsGroupStyle;if(s===void 0&&(s=`thousand`),e===``||e===`-`)return e;var c=_g(t),l=c.thousandSeparator,u=c.decimalSeparator,d=n!==0&&e.indexOf(`.`)!==-1||n&&r,f=Qh(e,o),p=f.beforeDecimal,m=f.afterDecimal,h=f.addNegation;return n!==void 0&&(m=eg(m,n,!!r)),l&&(p=hee(p,l,s)),i&&(p=i+p),a&&(m+=a),h&&(p=`-`+p),e=p+(d&&u||``)+m,e}function _g(e){var t=e.decimalSeparator;t===void 0&&(t=`.`);var n=e.thousandSeparator,r=e.allowedDecimalSeparators;return n===!0&&(n=`,`),r||=[t,`.`],{decimalSeparator:t,thousandSeparator:n,allowedDecimalSeparators:r}}function vg(e,t){e===void 0&&(e=``);var n=RegExp(`(-)`),r=RegExp(`(-)(.)*(-)`),i=n.test(e),a=r.test(e);return e=e.replace(/-/g,``),i&&!a&&t&&(e=`-`+e),e}function yg(e,t){return RegExp(`(^-)|[0-9]|`+Xh(e),t?`g`:void 0)}function bg(e,t,n){return e===``||!t?.match(/\d/)&&!n?.match(/\d/)&&typeof e==`string`&&!isNaN(Number(e))}function xg(e,t,n){var r;t===void 0&&(t=cg(e));var i=n.allowNegative,a=n.prefix;a===void 0&&(a=``);var o=n.suffix;o===void 0&&(o=``);var s=n.decimalScale,c=t.from,l=t.to,u=l.start,d=l.end,f=_g(n),p=f.allowedDecimalSeparators,m=f.decimalSeparator,h=e[d]===m;if(qh(e)&&(e===a||e===o)&&t.lastValue===``)return e;if(d-u===1&&p.indexOf(e[u])!==-1){var g=s===0?``:m;e=e.substring(0,u)+g+e.substring(u+1,e.length)}var _=function(e,t,n){var r=!1,i=!1;a.startsWith(`-`)?r=!1:e.startsWith(`--`)?(r=!1,i=!0):o.startsWith(`-`)&&e.length===o.length?r=!1:e[0]===`-`&&(r=!0);var s=+!!r;return i&&(s=2),s&&(e=e.substring(s),t-=s,n-=s),{value:e,start:t,end:n,hasNegation:r}},v=_(e,u,d),y=v.hasNegation;r=v,e=r.value,u=r.start,d=r.end;var b=_(t.lastValue,c.start,c.end),x=b.start,S=b.end,C=b.value,w=e.substring(u,d);e.length&&C.length&&(x>C.length-o.length||S<a.length)&&!(w&&o.startsWith(w))&&(e=C);var T=0;e.startsWith(a)?T+=a.length:u<a.length&&(T=u),e=e.substring(T),d-=T;var E=e.length,D=e.length-o.length;e.endsWith(o)?E=D:(d>D||d>e.length-o.length)&&(E=d),e=e.substring(0,E),e=vg(y?`-`+e:e,i),e=(e.match(yg(m,!0))||[]).join(``);var O=e.indexOf(m);e=e.replace(new RegExp(Xh(m),`g`),function(e,t){return t===O?`.`:``});var k=Qh(e,i),A=k.beforeDecimal,j=k.afterDecimal,M=k.addNegation;return l.end-l.start<c.end-c.start&&A===``&&h&&!parseFloat(j)&&(e=M?`-`:``),e}function Sg(e,t){var n=t.prefix;n===void 0&&(n=``);var r=t.suffix;r===void 0&&(r=``);var i=Array.from({length:e.length+1}).map(function(){return!0}),a=e[0]===`-`;i.fill(!1,0,Math.min(n.length+ +!!a,e.length));var o=e.length;return i.fill(!1,o-r.length+1,o+1),i}function Cg(e){var t=_g(e),n=t.thousandSeparator,r=t.decimalSeparator,i=e.prefix;i===void 0&&(i=``);var a=e.allowNegative;if(a===void 0&&(a=!0),n===r)throw Error(`
55
- Decimal separator can't be same as thousand separator.
56
- thousandSeparator: `+n+` (thousandSeparator = {true} is same as thousandSeparator = ",")
57
- decimalSeparator: `+r+` (default value for decimalSeparator is .)
58
- `);return i.startsWith(`-`)&&a&&(console.error(`
59
- Prefix can't start with '-' when allowNegative is true.
60
- prefix: `+i+`
61
- allowNegative: `+a+`
62
- `),a=!1),Object.assign(Object.assign({},e),{allowNegative:a})}function wg(e){e=Cg(e),e.decimalSeparator,e.allowedDecimalSeparators,e.thousandsGroupStyle;var t=e.suffix,n=e.allowNegative,r=e.allowLeadingZeros,i=e.onKeyDown;i===void 0&&(i=Kh);var a=e.onBlur;a===void 0&&(a=Kh);var o=e.thousandSeparator,s=e.decimalScale,c=e.fixedDecimalScale,l=e.prefix;l===void 0&&(l=``);var u=e.defaultValue,d=e.value,f=e.valueIsNumericString,p=e.onValueChange,m=Wh(e,[`decimalSeparator`,`allowedDecimalSeparators`,`thousandsGroupStyle`,`suffix`,`allowNegative`,`allowLeadingZeros`,`onKeyDown`,`onBlur`,`thousandSeparator`,`decimalScale`,`fixedDecimalScale`,`prefix`,`defaultValue`,`value`,`valueIsNumericString`,`onValueChange`]),h=_g(e),g=h.decimalSeparator,_=h.allowedDecimalSeparators,v=function(t){return gg(t,e)},y=function(t,n){return xg(t,n,e)},b=Jh(d)?u:d,x=f??bg(b,l,t);Jh(d)?Jh(u)||(x||=typeof u==`number`):x||=typeof d==`number`;var S=function(e){return Yh(e)?e:(typeof e==`number`&&(e=ng(e)),x&&typeof s==`number`?rg(e,s,!!c):e)},C=pg(S(d),S(u),!!x,v,y,p),w=C[0],T=w.numAsString,E=w.formattedValue,D=C[1];return Object.assign(Object.assign({},m),{value:E,valueIsNumericString:!1,isValidInputCharacter:function(e){return e===g||qh(e)},isCharacterSame:function(e){var t=e.currentValue,n=e.lastValue,r=e.formattedValue,i=e.currentValueIndex,a=e.formattedValueIndex,o=t[i],u=r[a],f=ag(n,t).to,p=function(e){return y(e).indexOf(`.`)+l.length};return d===0&&c&&s&&t[f.start]===g&&p(t)<i&&p(r)>a?!1:i>=f.start&&i<f.end&&_&&_.includes(o)&&u===g?!0:o===u},onValueChange:D,format:v,removeFormatting:y,getCaretBoundary:function(t){return Sg(t,e)},onKeyDown:function(e){var t=e.target,r=e.key,a=t.selectionStart,u=t.selectionEnd,d=t.value;if(d===void 0&&(d=``),(r===`Backspace`||r===`Delete`)&&u<l.length&&d!==`-`){e.preventDefault();return}if(a!==u){i(e);return}r===`Backspace`&&d[0]===`-`&&a===l.length+1&&n&&ig(t,1),s&&c&&(r===`Backspace`&&d[a-1]===g?(ig(t,a-1),e.preventDefault()):r===`Delete`&&d[a]===g&&e.preventDefault()),_?.includes(r)&&d[a]===g&&ig(t,a+1);var f=o===!0?`,`:o;r===`Backspace`&&d[a-1]===f&&ig(t,a-1),r===`Delete`&&d[a]===f&&ig(t,a+1),i(e)},onBlur:function(t){var n=T;n.match(/\d/g)||(n=``),r||(n=$h(n)),c&&s&&(n=rg(n,s,c)),n!==T&&D({formattedValue:gg(n,e),value:n,floatValue:parseFloat(n)},{event:t,source:Gh.event}),a(t)}})}function Tg(e){var t=wg(e);return D.createElement(vee,Object.assign({},t))}var Eg={root:`m_e2f5cd4e`,controls:`m_95e17d22`,control:`m_80b4b171`};function Dg({direction:e,style:t,...n}){return(0,R.jsx)(`svg`,{style:{width:`var(--ni-chevron-size)`,height:`var(--ni-chevron-size)`,transform:e===`up`?`rotate(180deg)`:void 0,...t},viewBox:`0 0 15 15`,fill:`none`,xmlns:`http://www.w3.org/2000/svg`,...n,children:(0,R.jsx)(`path`,{d:`M3.13523 6.15803C3.3241 5.95657 3.64052 5.94637 3.84197 6.13523L7.5 9.56464L11.158 6.13523C11.3595 5.94637 11.6759 5.95657 11.8648 6.15803C12.0536 6.35949 12.0434 6.67591 11.842 6.86477L7.84197 10.6148C7.64964 10.7951 7.35036 10.7951 7.15803 10.6148L3.15803 6.86477C2.95657 6.67591 2.94637 6.35949 3.13523 6.15803Z`,fill:`currentColor`,fillRule:`evenodd`,clipRule:`evenodd`})})}var Og=/^(0\.0*|-0(\.0*)?)$/,kg=/^-?0\d+(\.\d+)?\.?$/,Ag=/\.\d*0$/,jg=/^-?\d+\.$/;function Mg(e){return typeof e==`string`&&e!==``&&!Number.isNaN(Number(e))}function Ng(e){return typeof e==`number`?e<2**53-1:e===``||Mg(e)&&Number(e)<2**53-1}function Pg(e){return e.toString().replace(`.`,``).length}function Fg(e,t){return(typeof e==`number`?e<2**53-1:!Number.isNaN(Number(e)))&&!Number.isNaN(e)&&Pg(t)<14&&t!==``}function Ig(e,t,n){return e===void 0||(t===void 0||e>=t)&&(n===void 0||e<=n)}var Lg={step:1,clampBehavior:`blur`,allowDecimal:!0,allowNegative:!0,withKeyboardEvents:!0,allowLeadingZeros:!0,trimLeadingZeroesOnBlur:!0,startValue:0,allowedDecimalSeparators:[`.`,`,`]},Rg=jn((e,{size:t})=>({controls:{"--ni-chevron-size":_t(t,`ni-chevron-size`)}}));function zg(e,t,n){let r=e.toString(),i=jg.test(r),a=r.replace(/^0+(?=\d)/,``),o=parseFloat(a);if(Number.isNaN(o))return a;if(o>2**53-1)return t===void 0?a:t;let s=Ot(o,n,t);return i?`${s.toString().replace(/^0+(?=\d)/,``)}.`:s}var Bg=V((e,t)=>{let n=z(`NumberInput`,Lg,e),{className:r,classNames:i,styles:a,unstyled:o,vars:s,onChange:c,onValueChange:l,value:u,defaultValue:d,max:f,min:p,step:m,hideControls:h,rightSection:g,isAllowed:_,clampBehavior:v,onBlur:y,allowDecimal:b,decimalScale:x,onKeyDown:S,onKeyDownCapture:C,handlersRef:w,startValue:T,disabled:E,rightSectionPointerEvents:O,allowNegative:k,readOnly:A,size:j,rightSectionWidth:M,stepHoldInterval:N,stepHoldDelay:ee,allowLeadingZeros:te,withKeyboardEvents:P,trimLeadingZeroesOnBlur:F,allowedDecimalSeparators:I,attributes:ne,...re}=n,ie=oi({name:`NumberInput`,classes:Eg,props:n,classNames:i,styles:a,unstyled:o,attributes:ne,vars:s,varsResolver:Rg}),{resolvedClassNames:ae,resolvedStyles:oe}=Ur({classNames:i,styles:a,props:n}),[se,ce]=hn({value:u,defaultValue:d,finalValue:``,onChange:c}),le=ee!==void 0&&N!==void 0,ue=(0,D.useRef)(null),de=(0,D.useRef)(null),fe=(0,D.useRef)(0),pe=(e,t)=>{t.source===`event`&&ce(Fg(e.floatValue,e.value)&&!Og.test(e.value)&&!(te&&kg.test(e.value))&&!Ag.test(e.value)&&!jg.test(e.value)?e.floatValue:e.value),l?.(e,t)},me=e=>{let t=String(e).match(/(?:\.(\d+))?(?:[eE]([+-]?\d+))?$/);return t?Math.max(0,(t[1]?t[1].length:0)-(t[2]?+t[2]:0)):0},he=e=>{ue.current&&e!==void 0&&ue.current.setSelectionRange(e,e)},ge=(0,D.useRef)(ht);ge.current=()=>{if(!Ng(se))return;let e,t=me(se),n=me(m),r=Math.max(t,n),i=10**r;if(!Mg(se)&&(typeof se!=`number`||Number.isNaN(se)))e=Ot(T,p,f);else if(f!==void 0){let t=(Math.round(Number(se)*i)+Math.round(m*i))/i;e=t<=f?t:f}else e=(Math.round(Number(se)*i)+Math.round(m*i))/i;let a=e.toFixed(r);ce(parseFloat(a)),l?.({floatValue:parseFloat(a),formattedValue:a,value:a},{source:`increment`}),setTimeout(()=>he(ue.current?.value.length),0)};let _e=(0,D.useRef)(ht);_e.current=()=>{if(!Ng(se))return;let e,t=p===void 0?k?-(2**53-1):0:p,n=me(se),r=me(m),i=Math.max(n,r),a=10**i;if(!Mg(se)&&typeof se!=`number`||Number.isNaN(se))e=Ot(T,t,f);else{let n=(Math.round(Number(se)*a)-Math.round(m*a))/a;e=t!==void 0&&n<t?t:n}let o=e.toFixed(i);ce(parseFloat(o)),l?.({floatValue:parseFloat(o),formattedValue:o,value:o},{source:`decrement`}),setTimeout(()=>he(ue.current?.value.length),0)};let ve=e=>{let t=e.clipboardData.getData(`text`),n=re.decimalSeparator||`.`,r=(I||[`.`,`,`]).filter(e=>e!==n);if(r.some(e=>t.includes(e))){e.preventDefault();let i=t;r.forEach(e=>{i=i.split(e).join(n)});let a=ue.current;if(a){let e=a.selectionStart??0,t=a.selectionEnd??0,n=a.value,r=n.substring(0,e)+i+n.substring(t);(Object.getOwnPropertyDescriptor(window.HTMLInputElement.prototype,`value`)?.set)?.call(a,r),a.dispatchEvent(new Event(`change`,{bubbles:!0}));let o=e+i.length;setTimeout(()=>he(o),0)}}re.onPaste?.(e)},ye=e=>{S?.(e),!(A||!P)&&(e.key===`ArrowUp`&&(e.preventDefault(),ge.current?.()),e.key===`ArrowDown`&&(e.preventDefault(),_e.current?.()))},be=e=>{if(C?.(e),e.key===`Backspace`){let t=ue.current;t&&t.selectionStart===0&&t.selectionStart===t.selectionEnd&&(e.preventDefault(),window.setTimeout(()=>he(0),0))}},xe=e=>{let t=se;v===`blur`&&typeof t==`number`&&(t=Ot(t,p,f)),F&&typeof t==`string`&&me(t)<15&&(t=zg(t,f,p)),se!==t&&ce(t),y?.(e)};fn(w,{increment:ge.current,decrement:_e.current});let Se=e=>{e?ge.current?.():_e.current?.(),fe.current+=1},Ce=e=>{if(Se(e),le){let t=typeof N==`number`?N:N(fe.current);de.current=window.setTimeout(()=>Ce(e),t)}},we=(e,t)=>{e.preventDefault(),ue.current?.focus(),Se(t),le&&(de.current=window.setTimeout(()=>Ce(t),ee))},Te=()=>{de.current&&window.clearTimeout(de.current),de.current=null,fe.current=0},Ee=(0,R.jsxs)(`div`,{...ie(`controls`),children:[(0,R.jsx)(xl,{...ie(`control`),tabIndex:-1,"aria-hidden":!0,disabled:E||typeof se==`number`&&f!==void 0&&se>=f,mod:{direction:`up`},onMouseDown:e=>e.preventDefault(),onPointerDown:e=>{we(e,!0)},onPointerUp:Te,onPointerLeave:Te,children:(0,R.jsx)(Dg,{direction:`up`})}),(0,R.jsx)(xl,{...ie(`control`),tabIndex:-1,"aria-hidden":!0,disabled:E||typeof se==`number`&&p!==void 0&&se<=p,mod:{direction:`down`},onMouseDown:e=>e.preventDefault(),onPointerDown:e=>{we(e,!1)},onPointerUp:Te,onPointerLeave:Te,children:(0,R.jsx)(Dg,{direction:`down`})})]});return(0,R.jsx)(xd,{component:Tg,allowNegative:k,className:Nn(Eg.root,r),size:j,inputMode:`decimal`,...re,readOnly:A,disabled:E,value:se,getInputRef:mn(t,ue),onValueChange:pe,rightSection:h||A||!Ng(se)?g:g||Ee,classNames:ae,styles:oe,unstyled:o,__staticSelector:`NumberInput`,decimalScale:b?x:0,onPaste:ve,onKeyDown:ye,onKeyDownCapture:be,rightSectionPointerEvents:O??(E?`none`:void 0),rightSectionWidth:M??`var(--ni-right-section-width-${j||`sm`})`,allowLeadingZeros:te,allowedDecimalSeparators:I,onBlur:xe,attributes:ne,isAllowed:e=>v===`strict`?_?_(e)&&Ig(e.floatValue,p,f):Ig(e.floatValue,p,f):!_||_(e)})});Bg.classes={...xd.classes,...Eg},Bg.displayName=`@mantine/core/NumberInput`;var Vg={root:`m_db6d6462`,section:`m_2242eb65`,"stripes-animation":`m_81a374bd`,"stripes-animation-vertical":`m_e0fb7a86`,label:`m_91e40b74`},[Hg,Ug]=at(`Progress.Root component was not found in tree`),Wg=V((e,t)=>{let{classNames:n,className:r,style:i,styles:a,vars:o,...s}=z(`ProgressLabel`,null,e),c=Ug();return(0,R.jsx)(B,{ref:t,...c.getStyles(`label`,{className:r,style:i,classNames:n,styles:a}),...s})});Wg.classes=Vg,Wg.displayName=`@mantine/core/ProgressLabel`;var Gg=jn((e,{size:t,radius:n,transitionDuration:r})=>({root:{"--progress-size":_t(t,`progress-size`),"--progress-radius":n===void 0?void 0:yt(n),"--progress-transition-duration":typeof r==`number`?`${r}ms`:void 0}})),Kg=V((e,t)=>{let n=z(`ProgressRoot`,null,e),{classNames:r,className:i,style:a,styles:o,unstyled:s,vars:c,autoContrast:l,transitionDuration:u,orientation:d,attributes:f,mod:p,...m}=n,h=oi({name:`Progress`,classes:Vg,props:n,className:i,style:a,classNames:r,styles:o,unstyled:s,attributes:f,vars:c,varsResolver:Gg});return(0,R.jsx)(Hg,{value:{getStyles:h,autoContrast:l},children:(0,R.jsx)(B,{ref:t,mod:[{orientation:d},p],...h(`root`),...m})})});Kg.classes=Vg,Kg.displayName=`@mantine/core/ProgressRoot`;var qg={withAria:!0},Jg=V((e,t)=>{let{classNames:n,className:r,style:i,styles:a,vars:o,value:s,withAria:c,color:l,striped:u,animated:d,mod:f,...p}=z(`ProgressSection`,qg,e),m=Ug(),h=Cr(),g=c?{role:`progressbar`,"aria-valuemax":100,"aria-valuemin":0,"aria-valuenow":s,"aria-valuetext":`${s}%`}:{};return(0,R.jsx)(B,{ref:t,...m.getStyles(`section`,{className:r,classNames:n,styles:a,style:i}),...p,...g,mod:[{striped:u||d,animated:d},f],__vars:{"--progress-section-size":`${s}%`,"--progress-section-color":or(l,h),"--progress-label-color":si(m.autoContrast,h)?Or({color:l,theme:h,autoContrast:m.autoContrast}):void 0}})});Jg.classes=Vg,Jg.displayName=`@mantine/core/ProgressSection`;var Yg=V((e,t)=>{let n=z(`Progress`,null,e),{value:r,classNames:i,styles:a,vars:o,color:s,striped:c,animated:l,"aria-label":u,...d}=n,{resolvedClassNames:f,resolvedStyles:p}=Ur({classNames:i,styles:a,props:n});return(0,R.jsx)(Kg,{ref:t,classNames:f,styles:p,vars:o,...d,children:(0,R.jsx)(Jg,{value:r,color:s,striped:c,animated:l,"aria-label":u})})});Yg.classes=Vg,Yg.displayName=`@mantine/core/Progress`,Yg.Section=Jg,Yg.Root=Kg,Yg.Label=Wg;var Xg={root:`m_f3f1af94`,inner:`m_89c4f5e4`,icon:`m_f3ed6b2b`,radio:`m_8a3dbb89`,"radio--outline":`m_1bfe9d39`},[Zg,Qg]=ot(),[$g,e_]=ot(),t_={card:`m_9dc8ae12`},n_={withBorder:!0},r_=jn((e,{radius:t})=>({card:{"--card-radius":yt(t)}})),i_=V((e,t)=>{let n=z(`RadioCard`,n_,e),{classNames:r,className:i,style:a,styles:o,unstyled:s,vars:c,checked:l,mod:u,withBorder:d,value:f,onClick:p,name:m,onKeyDown:h,attributes:g,..._}=n,v=oi({name:`RadioCard`,classes:t_,props:n,className:i,style:a,classNames:r,styles:o,unstyled:s,attributes:g,vars:c,varsResolver:r_,rootSelector:`card`}),{dir:y}=Zi(),b=Qg(),x=typeof l==`boolean`?l:b?.value===f||!1,S=m||b?.name,C=e=>{if(h?.(e),[`ArrowDown`,`ArrowUp`,`ArrowLeft`,`ArrowRight`].includes(e.nativeEvent.code)){e.preventDefault();let t=Array.from(document.querySelectorAll(`[role="radio"][name="${S||`__mantine`}"]`)),n=t.findIndex(t=>t===e.target),r=n+1>=t.length?0:n+1,i=n-1<0?t.length-1:n-1;e.nativeEvent.code===`ArrowDown`&&(t[r].focus(),t[r].click()),e.nativeEvent.code===`ArrowUp`&&(t[i].focus(),t[i].click()),e.nativeEvent.code===`ArrowLeft`&&(t[y===`ltr`?i:r].focus(),t[y===`ltr`?i:r].click()),e.nativeEvent.code===`ArrowRight`&&(t[y===`ltr`?r:i].focus(),t[y===`ltr`?r:i].click())}};return(0,R.jsx)($g,{value:{checked:x},children:(0,R.jsx)(xl,{ref:t,mod:[{"with-border":d,checked:x},u],...v(`card`),..._,role:`radio`,"aria-checked":x,name:S,onClick:e=>{p?.(e),b?.onChange(f||``)},onKeyDown:C})})});i_.displayName=`@mantine/core/RadioCard`,i_.classes=t_;var a_=V((e,t)=>{let{value:n,defaultValue:r,onChange:i,size:a,wrapperProps:o,children:s,name:c,readOnly:l,disabled:u,...d}=z(`RadioGroup`,null,e),f=rn(c),[p,m]=hn({value:n,defaultValue:r,finalValue:``,onChange:i});return(0,R.jsx)(Zg,{value:{value:p,onChange:e=>!l&&m(typeof e==`string`?e:e.currentTarget.value),size:a,name:f,disabled:u},children:(0,R.jsx)(vd.Wrapper,{size:a,ref:t,...o,...d,labelElement:`div`,__staticSelector:`RadioGroup`,children:(0,R.jsx)(_p,{role:`radiogroup`,children:s})})})});a_.classes=vd.Wrapper.classes,a_.displayName=`@mantine/core/RadioGroup`;function o_({size:e,style:t,...n}){return(0,R.jsx)(`svg`,{xmlns:`http://www.w3.org/2000/svg`,fill:`none`,viewBox:`0 0 5 5`,style:{width:L(e),height:L(e),...t},"aria-hidden":!0,...n,children:(0,R.jsx)(`circle`,{cx:`2.5`,cy:`2.5`,r:`2.5`,fill:`currentColor`})})}var s_={indicator:`m_717d7ff6`,icon:`m_3e4da632`,"indicator--outline":`m_2980836c`},yee={icon:o_},bee=jn((e,{radius:t,color:n,size:r,iconColor:i,variant:a,autoContrast:o})=>{let s=ar({color:n||e.primaryColor,theme:e}),c=s.isThemeColor&&s.shade===void 0?`var(--mantine-color-${s.color}-outline)`:s.color;return{indicator:{"--radio-size":_t(r,`radio-size`),"--radio-radius":t===void 0?void 0:yt(t),"--radio-color":a===`outline`?c:or(n,e),"--radio-icon-size":_t(r,`radio-icon-size`),"--radio-icon-color":i?or(i,e):si(o,e)?Or({color:n,theme:e,autoContrast:o}):void 0}}}),c_=V((e,t)=>{let n=z(`RadioIndicator`,yee,e),{classNames:r,className:i,style:a,styles:o,unstyled:s,vars:c,icon:l,radius:u,color:d,iconColor:f,autoContrast:p,checked:m,mod:h,variant:g,disabled:_,attributes:v,...y}=n,b=oi({name:`RadioIndicator`,classes:s_,props:n,className:i,style:a,classNames:r,styles:o,unstyled:s,attributes:v,vars:c,varsResolver:bee,rootSelector:`indicator`}),x=e_(),S=typeof m==`boolean`?m:x?.checked||!1;return(0,R.jsx)(B,{ref:t,...b(`indicator`,{variant:g}),variant:g,mod:[{checked:S,disabled:_},h],...y,children:(0,R.jsx)(l,{...b(`icon`)})})});c_.displayName=`@mantine/core/RadioIndicator`,c_.classes=s_;var l_={labelPosition:`right`},u_=jn((e,{size:t,radius:n,color:r,iconColor:i,variant:a,autoContrast:o})=>{let s=ar({color:r||e.primaryColor,theme:e}),c=s.isThemeColor&&s.shade===void 0?`var(--mantine-color-${s.color}-outline)`:s.color;return{root:{"--radio-size":_t(t,`radio-size`),"--radio-radius":n===void 0?void 0:yt(n),"--radio-color":a===`outline`?c:or(r,e),"--radio-icon-color":i?or(i,e):si(o,e)?Or({color:r,theme:e,autoContrast:o}):void 0,"--radio-icon-size":_t(t,`radio-icon-size`)}}}),d_=V((e,t)=>{let n=z(`Radio`,l_,e),{classNames:r,className:i,style:a,styles:o,unstyled:s,vars:c,id:l,size:u,label:d,labelPosition:f,description:p,error:m,radius:h,color:g,variant:_,disabled:v,wrapperProps:y,icon:b=o_,rootRef:x,iconColor:S,onChange:C,mod:w,attributes:T,checked:E,...D}=n,O=oi({name:`Radio`,classes:Xg,props:n,className:i,style:a,classNames:r,styles:o,unstyled:s,attributes:T,vars:c,varsResolver:u_}),k=Qg(),A=k?.size??u,j=n.size?u:A,{styleProps:M,rest:N}=hi(D),ee=rn(l),te=k?k.value===N.value:void 0,P={checked:te??E,name:k?.name??N.name,onChange:e=>{k?.onChange(e),C?.(e)},disabled:k?.disabled??v};return(0,R.jsx)(op,{...O(`root`),__staticSelector:`Radio`,__stylesApiProps:n,id:ee,size:j,labelPosition:f,label:d,description:p,error:m,disabled:P.disabled,classNames:r,styles:o,unstyled:s,"data-checked":(te??E)||void 0,variant:_,ref:x,mod:w,...M,...y,children:(0,R.jsxs)(B,{...O(`inner`),mod:{"label-position":f},children:[(0,R.jsx)(B,{...O(`radio`,{focusable:!0,variant:_}),...N,...P,component:`input`,mod:{error:!!m},ref:t,id:ee,type:`radio`}),(0,R.jsx)(b,{...O(`icon`),"aria-hidden":!0})]})})});d_.classes=Xg,d_.displayName=`@mantine/core/Radio`,d_.Group=a_,d_.Card=i_,d_.Indicator=c_;var f_={duration:100,transition:`fade`};function p_(e,t){return{...f_,...t,...e}}var m_={tooltip:`m_1b3c8819`,arrow:`m_f898399f`};function h_({offset:e,position:t,defaultOpened:n}){let[r,i]=(0,D.useState)(n),a=(0,D.useRef)(null),{x:o,y:s,elements:c,refs:l,update:u,placement:d}=jc({placement:t,middleware:[Vs({crossAxis:!0,padding:5,rootBoundary:`document`})]}),f=d.includes(`right`)?e:t.includes(`left`)?e*-1:0,p=d.includes(`bottom`)?e:t.includes(`top`)?e*-1:0,m=(0,D.useCallback)(({clientX:e,clientY:t})=>{l.setPositionReference({getBoundingClientRect(){return{width:0,height:0,x:e,y:t,left:e+f,top:t+p,right:e,bottom:t}}})},[c.reference]);return(0,D.useEffect)(()=>{if(l.floating.current){let e=a.current;e.addEventListener(`mousemove`,m);let t=Aa(l.floating.current);return t.forEach(e=>{e.addEventListener(`scroll`,u)}),()=>{e.removeEventListener(`mousemove`,m),t.forEach(e=>{e.removeEventListener(`scroll`,u)})}}},[c.reference,l.floating.current,u,m,r]),{handleMouseMove:m,x:o,y:s,opened:r,setOpened:i,boundaryRef:a,floating:l.setFloating}}var g_={refProp:`ref`,withinPortal:!0,offset:10,position:`right`,zIndex:mt(`popover`)},__=jn((e,{radius:t,color:n})=>({tooltip:{"--tooltip-radius":t===void 0?void 0:yt(t),"--tooltip-bg":n?or(n,e):void 0,"--tooltip-color":n?`var(--mantine-color-white)`:void 0}})),v_=V((e,t)=>{let n=z(`TooltipFloating`,g_,e),{children:r,refProp:i,withinPortal:a,style:o,className:s,classNames:c,styles:l,unstyled:u,radius:d,color:f,label:p,offset:m,position:h,multiline:g,zIndex:_,disabled:v,defaultOpened:y,variant:b,vars:x,portalProps:S,attributes:C,...w}=n,T=Cr(),E=oi({name:`TooltipFloating`,props:n,classes:m_,className:s,style:o,classNames:c,styles:l,unstyled:u,attributes:C,rootSelector:`tooltip`,vars:x,varsResolver:__}),{handleMouseMove:O,x:k,y:A,opened:j,boundaryRef:M,floating:N,setOpened:ee}=h_({offset:m,position:h,defaultOpened:y}),te=An(r);if(!te)throw Error(`[@mantine/core] Tooltip.Floating component children should be an element or a component that accepts ref, fragments, strings, numbers and other primitive values are not supported`);let P=mn(M,En(te),t),F=te.props,I=e=>{F.onMouseEnter?.(e),O(e),ee(!0)},ne=e=>{F.onMouseLeave?.(e),ee(!1)};return(0,R.jsxs)(R.Fragment,{children:[(0,R.jsx)(Vl,{...S,withinPortal:a,children:(0,R.jsx)(B,{...w,...E(`tooltip`,{style:{...zi(o,T),zIndex:_,display:!v&&j?`block`:`none`,top:(A&&Math.round(A))??``,left:(k&&Math.round(k))??``}}),variant:b,ref:N,mod:{multiline:g},children:p})}),(0,D.cloneElement)(te,{...F,[i]:P,onMouseEnter:I,onMouseLeave:ne})]})});v_.classes=m_,v_.displayName=`@mantine/core/TooltipFloating`;var y_=(0,D.createContext)(!1),b_=y_.Provider,x_=()=>(0,D.useContext)(y_),S_={openDelay:0,closeDelay:0};function C_(e){let{openDelay:t,closeDelay:n,children:r}=z(`TooltipGroup`,S_,e);return(0,R.jsx)(b_,{value:!0,children:(0,R.jsx)(wc,{delay:{open:t,close:n},children:r})})}C_.displayName=`@mantine/core/TooltipGroup`,C_.extend=e=>e;function w_(e){if(e===void 0)return{shift:!0,flip:!0};let t={...e};return e.shift===void 0&&(t.shift=!0),e.flip===void 0&&(t.flip=!0),t}function T_(e){let t=w_(e.middlewares),n=[Bs(e.offset)];return t.shift&&n.push(Vs(typeof t.shift==`boolean`?{padding:8}:{padding:8,...t.shift})),t.flip&&n.push(typeof t.flip==`boolean`?Us():Us(t.flip)),n.push(qs({element:e.arrowRef,padding:e.arrowOffset})),t.inline?n.push(typeof t.inline==`boolean`?Ks():Ks(t.inline)):e.inline&&n.push(Ks()),n}function E_(e){let[t,n]=(0,D.useState)(e.defaultOpened),r=typeof e.opened==`boolean`?e.opened:t,i=x_(),a=rn(),o=(0,D.useCallback)(e=>{n(e),e&&g(a)},[a]),{x:s,y:c,context:l,refs:u,placement:d,middlewareData:{arrow:{x:f,y:p}={}}}=jc({strategy:e.strategy,placement:e.position,open:r,onOpenChange:o,middleware:T_(e),whileElementsMounted:Cs}),{delay:m,currentId:h,setCurrentId:g}=Tc(l,{id:a}),{getReferenceProps:_,getFloatingProps:v}=Fc([bc(l,{enabled:e.events?.hover,delay:i?m:{open:e.openDelay,close:e.closeDelay},mouseOnly:!e.events?.touch}),Nc(l,{enabled:e.events?.focus,visibleOnly:!0}),Lc(l,{role:`tooltip`}),kc(l,{enabled:e.opened===void 0})]);Vt(()=>{e.onPositionChange?.(d)},[d]);let y=r&&h&&h!==a;return{x:s,y:c,arrowX:f,arrowY:p,reference:u.setReference,floating:u.setFloating,getFloatingProps:v,getReferenceProps:_,isGroupPhase:y,opened:r,placement:d}}var D_={position:`top`,refProp:`ref`,withinPortal:!0,arrowSize:4,arrowOffset:5,arrowRadius:0,arrowPosition:`side`,offset:5,transitionProps:{duration:100,transition:`fade`},events:{hover:!0,focus:!1,touch:!1},zIndex:mt(`popover`),positionDependencies:[],middlewares:{flip:!0,shift:!0,inline:!1}},O_=jn((e,{radius:t,color:n,variant:r,autoContrast:i})=>{let a=e.variantColorResolver({theme:e,color:n||e.primaryColor,autoContrast:i,variant:r||`filled`});return{tooltip:{"--tooltip-radius":t===void 0?void 0:yt(t),"--tooltip-bg":n?a.background:void 0,"--tooltip-color":n?a.color:void 0}}}),k_=V((e,t)=>{let n=z(`Tooltip`,D_,e),{children:r,position:i,refProp:a,label:o,openDelay:s,closeDelay:c,onPositionChange:l,opened:u,defaultOpened:d,withinPortal:f,radius:p,color:m,classNames:h,styles:g,unstyled:_,style:v,className:y,withArrow:b,arrowSize:x,arrowOffset:S,arrowRadius:C,arrowPosition:w,offset:T,transitionProps:E,multiline:O,events:k,zIndex:A,disabled:j,positionDependencies:M,onClick:N,onMouseEnter:ee,onMouseLeave:te,inline:P,variant:F,keepMounted:I,vars:ne,portalProps:re,mod:ie,floatingStrategy:ae,middlewares:oe,autoContrast:se,attributes:ce,target:le,...ue}=z(`Tooltip`,D_,n),{dir:de}=Zi(),fe=(0,D.useRef)(null),pe=E_({position:Ml(de,i),closeDelay:c,openDelay:s,onPositionChange:l,opened:u,defaultOpened:d,events:k,arrowRef:fe,arrowOffset:S,offset:typeof T==`number`?T+(b?x/2:0):T,positionDependencies:[...M,le??r],inline:P,strategy:ae,middlewares:oe});(0,D.useEffect)(()=>{let e=le instanceof HTMLElement?le:typeof le==`string`?document.querySelector(le):le?.current||null;e&&pe.reference(e)},[le,pe]);let me=oi({name:`Tooltip`,props:n,classes:m_,className:y,style:v,classNames:h,styles:g,unstyled:_,attributes:ce,rootSelector:`tooltip`,vars:ne,varsResolver:O_}),he=An(r);if(!le&&!he)throw Error(`[@mantine/core] Tooltip component children should be an element or a component that accepts ref, fragments, strings, numbers and other primitive values are not supported`);if(le){let e=p_(E,{duration:100,transition:`fade`});return(0,R.jsx)(R.Fragment,{children:(0,R.jsx)(Vl,{...re,withinPortal:f,children:(0,R.jsx)(ql,{...e,keepMounted:I,mounted:!j&&!!pe.opened,duration:pe.isGroupPhase?10:e.duration,children:e=>(0,R.jsxs)(B,{...ue,"data-fixed":ae===`fixed`||void 0,variant:F,mod:[{multiline:O},ie],...pe.getFloatingProps({ref:pe.floating,className:me(`tooltip`).className,style:{...me(`tooltip`).style,...e,zIndex:A,top:pe.y??0,left:pe.x??0}}),children:[o,(0,R.jsx)(jl,{ref:fe,arrowX:pe.arrowX,arrowY:pe.arrowY,visible:b,position:pe.placement,arrowSize:x,arrowOffset:S,arrowRadius:C,arrowPosition:w,...me(`arrow`)})]})})})})}let ge=he.props,_e=mn(pe.reference,En(he),t),ve=p_(E,{duration:100,transition:`fade`});return(0,R.jsxs)(R.Fragment,{children:[(0,R.jsx)(Vl,{...re,withinPortal:f,children:(0,R.jsx)(ql,{...ve,keepMounted:I,mounted:!j&&!!pe.opened,duration:pe.isGroupPhase?10:ve.duration,children:e=>(0,R.jsxs)(B,{...ue,"data-fixed":ae===`fixed`||void 0,variant:F,mod:[{multiline:O},ie],...pe.getFloatingProps({ref:pe.floating,className:me(`tooltip`).className,style:{...me(`tooltip`).style,...e,zIndex:A,top:pe.y??0,left:pe.x??0}}),children:[o,(0,R.jsx)(jl,{ref:fe,arrowX:pe.arrowX,arrowY:pe.arrowY,visible:b,position:pe.placement,arrowSize:x,arrowOffset:S,arrowRadius:C,arrowPosition:w,...me(`arrow`)})]})})}),(0,D.cloneElement)(he,pe.getReferenceProps({onClick:N,onMouseEnter:ee,onMouseLeave:te,onMouseMove:n.onMouseMove,onPointerDown:n.onPointerDown,onPointerEnter:n.onPointerEnter,...ge,className:Nn(y,ge.className),[a]:_e}))]})});k_.classes=m_,k_.displayName=`@mantine/core/Tooltip`,k_.Floating=v_,k_.Group=C_;var A_={root:`m_cf365364`,indicator:`m_9e182ccd`,label:`m_1738fcb2`,input:`m_1714d588`,control:`m_69686b9b`,innerLabel:`m_78882f40`},j_={withItemsBorders:!0},M_=jn((e,{radius:t,color:n,transitionDuration:r,size:i,transitionTimingFunction:a})=>({root:{"--sc-radius":t===void 0?void 0:yt(t),"--sc-color":n?or(n,e):void 0,"--sc-shadow":n?void 0:`var(--mantine-shadow-xs)`,"--sc-transition-duration":r===void 0?void 0:`${r}ms`,"--sc-transition-timing-function":a,"--sc-padding":_t(i,`sc-padding`),"--sc-font-size":bt(i)}})),N_=V((e,t)=>{let n=z(`SegmentedControl`,j_,e),{classNames:r,className:i,style:a,styles:o,unstyled:s,vars:c,data:l,value:u,defaultValue:d,onChange:f,size:p,name:m,disabled:h,readOnly:g,fullWidth:_,orientation:v,radius:y,color:b,transitionDuration:x,transitionTimingFunction:S,variant:C,autoContrast:w,withItemsBorders:T,mod:E,attributes:O,...k}=n,A=oi({name:`SegmentedControl`,props:n,classes:A_,className:i,style:a,classNames:r,styles:o,unstyled:s,attributes:O,vars:c,varsResolver:M_}),j=Cr(),M=l.map(e=>typeof e==`string`?{label:e,value:e}:e),N=wn(),[ee,te]=(0,D.useState)(kt()),[P,F]=(0,D.useState)(null),[I,ne]=(0,D.useState)({}),re=(e,t)=>{I[t]=e,ne(I)},[ie,ae]=hn({value:u,defaultValue:d,finalValue:Array.isArray(l)?M.find(e=>!e.disabled)?.value??l[0]?.value??null:null,onChange:f}),oe=rn(m),se=M.map(e=>(0,D.createElement)(B,{...A(`control`),mod:{active:ie===e.value,orientation:v},key:e.value},(0,D.createElement)(`input`,{...A(`input`),disabled:h||e.disabled,type:`radio`,name:oe,value:e.value,id:`${oe}-${e.value}`,checked:ie===e.value,onChange:()=>!g&&ae(e.value),"data-focus-ring":j.focusRing,key:`${e.value}-input`}),(0,D.createElement)(B,{component:`label`,...A(`label`),mod:{active:ie===e.value&&!(h||e.disabled),disabled:h||e.disabled,"read-only":g},htmlFor:`${oe}-${e.value}`,ref:t=>re(t,e.value),__vars:{"--sc-label-color":b===void 0?void 0:Or({color:b,theme:j,autoContrast:w})},key:`${e.value}-label`},(0,R.jsx)(`span`,{...A(`innerLabel`),children:e.label})))),ce=mn(t,e=>F(e));return yn(()=>{te(kt())},[l.length]),l.length===0?null:(0,R.jsxs)(B,{...A(`root`),variant:C,size:p,ref:ce,mod:[{"full-width":_,orientation:v,initialized:N,"with-items-borders":T},E],...k,role:`radiogroup`,"data-disabled":h,children:[typeof ie==`string`&&(0,R.jsx)(kd,{target:I[ie],parent:P,component:`span`,transitionDuration:`var(--sc-transition-duration)`,...A(`indicator`)},ee),se]})});N_.classes=A_,N_.displayName=`@mantine/core/SegmentedControl`;var xee={withCheckIcon:!0,allowDeselect:!0,checkIconPosition:`left`,openOnFocus:!0},P_=V((e,t)=>{let n=z(`Select`,xee,e),{classNames:r,styles:i,unstyled:a,vars:o,dropdownOpened:s,defaultDropdownOpened:c,onDropdownClose:l,onDropdownOpen:u,onFocus:d,onBlur:f,onClick:p,onChange:m,data:h,value:g,defaultValue:_,selectFirstOptionOnChange:v,selectFirstOptionOnDropdownOpen:y,onOptionSubmit:b,comboboxProps:x,readOnly:S,disabled:C,filter:w,limit:T,withScrollArea:E,maxDropdownHeight:O,size:k,searchable:A,rightSection:j,checkIconPosition:M,withCheckIcon:N,withAlignedLabels:ee,nothingFoundMessage:te,name:P,form:F,searchValue:I,defaultSearchValue:ne,onSearchChange:re,allowDeselect:ie,error:ae,rightSectionPointerEvents:oe,id:se,clearable:ce,clearButtonProps:le,hiddenInputProps:ue,renderOption:de,onClear:fe,autoComplete:pe,scrollAreaProps:me,__defaultRightSection:he,__clearSection:ge,__clearable:_e,chevronColor:ve,autoSelectOnBlur:ye,openOnFocus:be,attributes:xe,...Se}=n,Ce=(0,D.useMemo)(()=>Tf(h),[h]),we=(0,D.useRef)({}),Te=(0,D.useMemo)(()=>Ef(Ce),[Ce]),Ee=rn(se),[De,Oe,ke]=hn({value:g,defaultValue:_,finalValue:null,onChange:m}),Ae=typeof De==`string`?De in Te?Te[De]:we.current[De]:void 0,je=Sn(Ae),[Me,Ne,Pe]=hn({value:I,defaultValue:ne,finalValue:Ae?Ae.label:``,onChange:re}),Fe=ep({opened:s,defaultOpened:c,onDropdownOpen:()=>{u?.(),y?Fe.selectFirstOption():Fe.updateSelectedOptionIndex(`active`,{scrollIntoView:!0})},onDropdownClose:()=>{l?.(),setTimeout(Fe.resetSelectedOption,0)}}),Ie=e=>{Ne(e),Fe.resetSelectedOption()},{resolvedClassNames:Le,resolvedStyles:Re}=Ur({props:n,styles:i,classNames:r});(0,D.useEffect)(()=>{v&&Fe.selectFirstOption()},[v,Me]),(0,D.useEffect)(()=>{g===null&&Ie(``),typeof g==`string`&&Ae&&(je?.value!==Ae.value||je?.label!==Ae.label)&&Ie(Ae.label)},[g,Ae]),(0,D.useEffect)(()=>{!ke&&!Pe&&Ie(typeof De==`string`?De in Te?Te[De]?.label:we.current[De]?.label||``:``)},[Te,De]),(0,D.useEffect)(()=>{De&&De in Te&&(we.current[De]=Te[De])},[Te,De]);let ze=(0,R.jsx)(rp.ClearButton,{...le,onClear:()=>{Oe(null,null),Ie(``),fe?.()}}),Be=ce&&!!De&&!C&&!S;return(0,R.jsxs)(R.Fragment,{children:[(0,R.jsxs)(rp,{store:Fe,__staticSelector:`Select`,classNames:Le,styles:Re,unstyled:a,readOnly:S,size:k,attributes:xe,keepMounted:ye,onOptionSubmit:e=>{b?.(e);let t=ie&&Te[e].value===De?null:Te[e],n=t?t.value:null;n!==De&&Oe(n,t),!ke&&Ie(typeof n==`string`&&t?.label||``),Fe.closeDropdown()},...x,children:[(0,R.jsx)(rp.Target,{targetType:A?`input`:`button`,autoComplete:pe,children:(0,R.jsx)(xd,{id:Ee,ref:t,__defaultRightSection:(0,R.jsx)(rp.Chevron,{size:k,error:ae,unstyled:a,color:ve}),__clearSection:ze,__clearable:Be,rightSection:j,rightSectionPointerEvents:oe||`none`,...Se,size:k,__staticSelector:`Select`,disabled:C,readOnly:S||!A,value:Me,onChange:e=>{Ie(e.currentTarget.value),Fe.openDropdown(),v&&Fe.selectFirstOption()},onFocus:e=>{be&&A&&Fe.openDropdown(),d?.(e)},onBlur:e=>{ye&&Fe.clickSelectedOption(),A&&Fe.closeDropdown();let t=typeof De==`string`&&(De in Te?Te[De]:we.current[De]);Ie(t&&t.label||``),f?.(e)},onClick:e=>{A?Fe.openDropdown():Fe.toggleDropdown(),p?.(e)},classNames:Le,styles:Re,unstyled:a,pointer:!A,error:ae,attributes:xe})}),(0,R.jsx)(Pp,{data:Ce,hidden:S||C,filter:w,search:Me,limit:T,hiddenWhenEmpty:!te,withScrollArea:E,maxDropdownHeight:O,filterOptions:!!A&&Ae?.label!==Me,value:De,checkIconPosition:M,withCheckIcon:N,withAlignedLabels:ee,nothingFoundMessage:te,unstyled:a,labelId:Se.label?`${Ee}-label`:void 0,"aria-label":Se.label?void 0:Se[`aria-label`],renderOption:de,scrollAreaProps:me})]}),(0,R.jsx)(rp.HiddenInput,{value:De,name:P,form:F,disabled:C,...ue})]})});P_.classes={...xd.classes,...rp.classes},P_.displayName=`@mantine/core/Select`;var F_={container:`m_925c2d2c`,root:`m_2415a157`};function See({spacing:e,verticalSpacing:t,cols:n,selector:r}){let i=Cr(),a=t===void 0?e:t,o=tt({"--sg-spacing-x":vt(Et(e)),"--sg-spacing-y":vt(Et(a)),"--sg-cols":Et(n)?.toString()}),s=Ke(i.breakpoints).reduce((t,r)=>(t[r]||(t[r]={}),typeof e==`object`&&e[r]!==void 0&&(t[r][`--sg-spacing-x`]=vt(e[r])),typeof a==`object`&&a[r]!==void 0&&(t[r][`--sg-spacing-y`]=vt(a[r])),typeof n==`object`&&n[r]!==void 0&&(t[r][`--sg-cols`]=n[r]),t),{}),c=Tt(Ke(s),i.breakpoints).filter(e=>Ke(s[e.value]).length>0).map(e=>({query:`(min-width: ${i.breakpoints[e.value]})`,styles:s[e.value]}));return(0,R.jsx)(mi,{styles:o,media:c,selector:r})}function I_(e){return typeof e==`object`&&e?Ke(e):[]}function Cee(e){return e.sort((e,t)=>Ze(e)-Ze(t))}function wee({spacing:e,verticalSpacing:t,cols:n}){return Cee(Array.from(new Set([...I_(e),...I_(t),...I_(n)])))}function Tee({spacing:e,verticalSpacing:t,cols:n,selector:r}){let i=t===void 0?e:t,a=tt({"--sg-spacing-x":vt(Et(e)),"--sg-spacing-y":vt(Et(i)),"--sg-cols":Et(n)?.toString()}),o=wee({spacing:e,verticalSpacing:t,cols:n}),s=o.reduce((t,r)=>(t[r]||(t[r]={}),typeof e==`object`&&e[r]!==void 0&&(t[r][`--sg-spacing-x`]=vt(e[r])),typeof i==`object`&&i[r]!==void 0&&(t[r][`--sg-spacing-y`]=vt(i[r])),typeof n==`object`&&n[r]!==void 0&&(t[r][`--sg-cols`]=n[r]),t),{}),c=o.map(e=>({query:`simple-grid (min-width: ${e})`,styles:s[e]}));return(0,R.jsx)(mi,{styles:a,container:c,selector:r})}var Eee={cols:1,spacing:`md`,type:`media`},L_=V((e,t)=>{let n=z(`SimpleGrid`,Eee,e),{classNames:r,className:i,style:a,styles:o,unstyled:s,vars:c,cols:l,verticalSpacing:u,spacing:d,type:f,attributes:p,...m}=n,h=oi({name:`SimpleGrid`,classes:F_,props:n,className:i,style:a,classNames:r,styles:o,unstyled:s,attributes:p,vars:c}),g=Ri();return f===`container`?(0,R.jsxs)(R.Fragment,{children:[(0,R.jsx)(Tee,{...n,selector:`.${g}`}),(0,R.jsx)(`div`,{...h(`container`),children:(0,R.jsx)(B,{ref:t,...h(`root`,{className:g}),...m})})]}):(0,R.jsxs)(R.Fragment,{children:[(0,R.jsx)(See,{...n,selector:`.${g}`}),(0,R.jsx)(B,{ref:t,...h(`root`,{className:g}),...m})]})});L_.classes=F_,L_.displayName=`@mantine/core/SimpleGrid`;var R_={root:`m_6d731127`},Dee={gap:`md`,align:`stretch`,justify:`flex-start`},Oee=jn((e,{gap:t,align:n,justify:r})=>({root:{"--stack-gap":vt(t),"--stack-align":n,"--stack-justify":r}})),W=V((e,t)=>{let n=z(`Stack`,Dee,e),{classNames:r,className:i,style:a,styles:o,unstyled:s,vars:c,align:l,justify:u,gap:d,variant:f,attributes:p,...m}=n,h=oi({name:`Stack`,props:n,classes:R_,className:i,style:a,classNames:r,styles:o,unstyled:s,attributes:p,vars:c,varsResolver:Oee});return(0,R.jsx)(B,{ref:t,...h(`root`),variant:f,...m})});W.classes=R_,W.displayName=`@mantine/core/Stack`;var z_={root:`m_5f93f3bb`,input:`m_926b4011`,track:`m_9307d992`,thumb:`m_93039a1d`,trackLabel:`m_8277e082`},B_=(0,D.createContext)(null),V_=B_.Provider,H_=()=>(0,D.useContext)(B_),U_=V((e,t)=>{let{value:n,defaultValue:r,onChange:i,size:a,wrapperProps:o,children:s,readOnly:c,disabled:l,...u}=z(`SwitchGroup`,null,e),[d,f]=hn({value:n,defaultValue:r,finalValue:[],onChange:i});return(0,R.jsx)(V_,{value:{value:d,onChange:e=>{let t=e.currentTarget.value;!c&&f(d.includes(t)?d.filter(e=>e!==t):[...d,t])},size:a,disabled:l},children:(0,R.jsx)(vd.Wrapper,{size:a,ref:t,...o,...u,labelElement:`div`,__staticSelector:`SwitchGroup`,children:(0,R.jsx)(_p,{role:`group`,children:s})})})});U_.classes=vd.Wrapper.classes,U_.displayName=`@mantine/core/SwitchGroup`;var W_={labelPosition:`right`,withThumbIndicator:!0},G_=jn((e,{radius:t,color:n,size:r})=>({root:{"--switch-radius":t===void 0?void 0:yt(t),"--switch-height":_t(r,`switch-height`),"--switch-width":_t(r,`switch-width`),"--switch-thumb-size":_t(r,`switch-thumb-size`),"--switch-label-font-size":_t(r,`switch-label-font-size`),"--switch-track-label-padding":_t(r,`switch-track-label-padding`),"--switch-color":n?or(n,e):void 0}})),K_=V((e,t)=>{let n=z(`Switch`,W_,e),{classNames:r,className:i,style:a,styles:o,unstyled:s,vars:c,color:l,label:u,offLabel:d,onLabel:f,id:p,size:m,radius:h,wrapperProps:g,thumbIcon:_,checked:v,defaultChecked:y,onChange:b,labelPosition:x,description:S,error:C,disabled:w,variant:T,rootRef:E,mod:D,withThumbIndicator:O,attributes:k,...A}=n,j=H_(),M=m||j?.size,N=oi({name:`Switch`,props:n,classes:z_,className:i,style:a,classNames:r,styles:o,unstyled:s,attributes:k,vars:c,varsResolver:G_}),{styleProps:ee,rest:te}=hi(A),P=rn(p),F={checked:j?.value.includes(te.value)??v,onChange:e=>{j?.onChange(e),b?.(e)},disabled:j?.disabled??w},[I,ne]=hn({value:F.checked??v,defaultValue:y,finalValue:!1});return(0,R.jsxs)(op,{...N(`root`),__staticSelector:`Switch`,__stylesApiProps:n,id:P,size:M,labelPosition:x,label:u,description:S,error:C,disabled:F.disabled,bodyElement:`label`,labelElement:`span`,classNames:r,styles:o,unstyled:s,"data-checked":F.checked,variant:T,ref:E,mod:D,inert:te.inert,...ee,...g,children:[(0,R.jsx)(`input`,{...te,...F,checked:I,"data-checked":F.checked,onChange:e=>{F.onChange?.(e),ne(e.currentTarget.checked)},id:P,ref:t,type:`checkbox`,role:`switch`,inert:te.inert,...N(`input`)}),(0,R.jsxs)(B,{"aria-hidden":`true`,component:`span`,mod:{error:C,"label-position":x,"without-labels":!f&&!d},...N(`track`),children:[(0,R.jsx)(B,{component:`span`,mod:{"reduce-motion":!0,"with-thumb-indicator":O&&!_},...N(`thumb`),children:_}),(0,R.jsx)(`span`,{...N(`trackLabel`),children:I?f:d})]})]})});K_.classes={...z_,...ap},K_.displayName=`@mantine/core/Switch`,K_.Group=U_;var[q_,J_]=at(`Table component was not found in the tree`),Y_={table:`m_b23fa0ef`,th:`m_4e7aa4f3`,tr:`m_4e7aa4fd`,td:`m_4e7aa4ef`,tbody:`m_b2404537`,thead:`m_b242d975`,caption:`m_9e5a3ac7`,scrollContainer:`m_a100c15`,scrollContainerInner:`m_62259741`};function X_(e,t){if(!t)return;let n={};return t.columnBorder&&e.withColumnBorders&&(n[`data-with-column-border`]=!0),t.rowBorder&&e.withRowBorders&&(n[`data-with-row-border`]=!0),t.striped&&e.striped&&(n[`data-striped`]=e.striped),t.highlightOnHover&&e.highlightOnHover&&(n[`data-hover`]=!0),t.captionSide&&e.captionSide&&(n[`data-side`]=e.captionSide),t.stickyHeader&&e.stickyHeader&&(n[`data-sticky`]=!0),n}function Z_(e,t){let n=`Table${e.charAt(0).toUpperCase()}${e.slice(1)}`,r=V((r,i)=>{let a=z(n,{},r),{classNames:o,className:s,style:c,styles:l,...u}=a,d=J_();return(0,R.jsx)(B,{component:e,ref:i,...X_(d,t),...d.getStyles(e,{className:s,classNames:o,style:c,styles:l,props:a}),...u})});return r.displayName=`@mantine/core/${n}`,r.classes=Y_,r}var Q_=Z_(`th`,{columnBorder:!0}),$_=Z_(`td`,{columnBorder:!0}),ev=Z_(`tr`,{rowBorder:!0,striped:!0,highlightOnHover:!0}),tv=Z_(`thead`,{stickyHeader:!0}),nv=Z_(`tbody`),rv=Z_(`tfoot`),iv=Z_(`caption`,{captionSide:!0});function av({data:e}){return(0,R.jsxs)(R.Fragment,{children:[e.caption&&(0,R.jsx)(iv,{children:e.caption}),e.head&&(0,R.jsx)(tv,{children:(0,R.jsx)(ev,{children:e.head.map((e,t)=>(0,R.jsx)(Q_,{children:e},t))})}),e.body&&(0,R.jsx)(nv,{children:e.body.map((e,t)=>(0,R.jsx)(ev,{children:e.map((e,t)=>(0,R.jsx)($_,{children:e},t))},t))}),e.foot&&(0,R.jsx)(rv,{children:(0,R.jsx)(ev,{children:e.foot.map((e,t)=>(0,R.jsx)(Q_,{children:e},t))})})]})}av.displayName=`@mantine/core/TableDataRenderer`;var ov={type:`scrollarea`},sv=jn((e,{minWidth:t,maxHeight:n,type:r})=>({scrollContainer:{"--table-min-width":L(t),"--table-max-height":L(n),"--table-overflow":r===`native`?`auto`:void 0}})),cv=V((e,t)=>{let n=z(`TableScrollContainer`,ov,e),{classNames:r,className:i,style:a,styles:o,unstyled:s,vars:c,children:l,minWidth:u,maxHeight:d,type:f,scrollAreaProps:p,attributes:m,...h}=n,g=oi({name:`TableScrollContainer`,classes:Y_,props:n,className:i,style:a,classNames:r,styles:o,unstyled:s,attributes:m,vars:c,varsResolver:sv,rootSelector:`scrollContainer`});return(0,R.jsx)(B,{component:f===`scrollarea`?_l:`div`,...f===`scrollarea`?d?{offsetScrollbars:`xy`,...p}:{offsetScrollbars:`x`,...p}:{},ref:t,...g(`scrollContainer`),...h,children:(0,R.jsx)(`div`,{...g(`scrollContainerInner`),children:l})})});cv.classes=Y_,cv.displayName=`@mantine/core/TableScrollContainer`;var lv={withRowBorders:!0,verticalSpacing:7},uv=jn((e,{layout:t,captionSide:n,horizontalSpacing:r,verticalSpacing:i,borderColor:a,stripedColor:o,highlightOnHoverColor:s,striped:c,highlightOnHover:l,stickyHeaderOffset:u,stickyHeader:d})=>({table:{"--table-layout":t,"--table-caption-side":n,"--table-horizontal-spacing":vt(r),"--table-vertical-spacing":vt(i),"--table-border-color":a?or(a,e):void 0,"--table-striped-color":c&&o?or(o,e):void 0,"--table-highlight-on-hover-color":l&&s?or(s,e):void 0,"--table-sticky-header-offset":d?L(u):void 0}})),dv=V((e,t)=>{let n=z(`Table`,lv,e),{classNames:r,className:i,style:a,styles:o,unstyled:s,vars:c,horizontalSpacing:l,verticalSpacing:u,captionSide:d,stripedColor:f,highlightOnHoverColor:p,striped:m,highlightOnHover:h,withColumnBorders:g,withRowBorders:_,withTableBorder:v,borderColor:y,layout:b,variant:x,data:S,children:C,stickyHeader:w,stickyHeaderOffset:T,mod:E,tabularNums:D,attributes:O,...k}=n,A=oi({name:`Table`,props:n,className:i,style:a,classes:Y_,classNames:r,styles:o,unstyled:s,attributes:O,rootSelector:`table`,vars:c,varsResolver:uv});return(0,R.jsx)(q_,{value:{getStyles:A,stickyHeader:w,striped:m===!0?`odd`:m||void 0,highlightOnHover:h,withColumnBorders:g,withRowBorders:_,captionSide:d||`bottom`},children:(0,R.jsx)(B,{component:`table`,variant:x,ref:t,mod:[{"data-with-table-border":v,"data-tabular-nums":D},E],...A(`table`),...k,children:C||!!S&&(0,R.jsx)(av,{data:S})})})});dv.classes=Y_,dv.displayName=`@mantine/core/Table`,dv.Td=$_,dv.Th=Q_,dv.Tr=ev,dv.Thead=tv,dv.Tbody=nv,dv.Tfoot=rv,dv.Caption=iv,dv.ScrollContainer=cv,dv.DataRenderer=av;var fv=V((e,t)=>{let n=z(`TextInput`,null,e);return(0,R.jsx)(xd,{component:`input`,ref:t,...n,__staticSelector:`TextInput`})});fv.classes=xd.classes,fv.displayName=`@mantine/core/TextInput`;var pv={root:`m_7341320d`},mv=jn((e,{size:t,radius:n,variant:r,gradient:i,color:a,autoContrast:o})=>{let s=e.variantColorResolver({color:a||e.primaryColor,theme:e,gradient:i,variant:r||`filled`,autoContrast:o});return{root:{"--ti-size":_t(t,`ti-size`),"--ti-radius":n===void 0?void 0:yt(n),"--ti-bg":a||r?s.background:void 0,"--ti-color":a||r?s.color:void 0,"--ti-bd":a||r?s.border:void 0}}}),hv=V((e,t)=>{let n=z(`ThemeIcon`,null,e),{classNames:r,className:i,style:a,styles:o,unstyled:s,vars:c,autoContrast:l,attributes:u,...d}=n,f=oi({name:`ThemeIcon`,classes:pv,props:n,className:i,style:a,classNames:r,styles:o,unstyled:s,attributes:u,vars:c,varsResolver:mv});return(0,R.jsx)(B,{ref:t,...f(`root`),...d})});hv.classes=pv,hv.displayName=`@mantine/core/ThemeIcon`;var gv=[`h1`,`h2`,`h3`,`h4`,`h5`,`h6`],_v=[`xs`,`sm`,`md`,`lg`,`xl`];function vv(e,t){let n=t===void 0?`h${e}`:t;return gv.includes(n)?{fontSize:`var(--mantine-${n}-font-size)`,fontWeight:`var(--mantine-${n}-font-weight)`,lineHeight:`var(--mantine-${n}-line-height)`}:_v.includes(n)?{fontSize:`var(--mantine-font-size-${n})`,fontWeight:`var(--mantine-h${e}-font-weight)`,lineHeight:`var(--mantine-h${e}-line-height)`}:{fontSize:L(n),fontWeight:`var(--mantine-h${e}-font-weight)`,lineHeight:`var(--mantine-h${e}-line-height)`}}var yv={root:`m_8a5d1357`},bv={order:1},xv=jn((e,{order:t,size:n,lineClamp:r,textWrap:i})=>{let a=vv(t||1,n);return{root:{"--title-fw":a.fontWeight,"--title-lh":a.lineHeight,"--title-fz":a.fontSize,"--title-line-clamp":typeof r==`number`?r.toString():void 0,"--title-text-wrap":i}}}),Sv=V((e,t)=>{let n=z(`Title`,bv,e),{classNames:r,className:i,style:a,styles:o,unstyled:s,order:c,vars:l,size:u,variant:d,lineClamp:f,textWrap:p,mod:m,attributes:h,...g}=n,_=oi({name:`Title`,props:n,classes:yv,className:i,style:a,classNames:r,styles:o,unstyled:s,attributes:h,vars:l,varsResolver:xv});return[1,2,3,4,5,6].includes(c)?(0,R.jsx)(B,{..._(`root`),component:`h${c}`,variant:d,ref:t,mod:[{order:c,"data-line-clamp":typeof f==`number`},m],size:u,...g}):null});Sv.classes=yv,Sv.displayName=`@mantine/core/Title`;function Cv(e){let t=e,n=!1,r=new Set;return{getState(){return t},updateState(e){t=typeof e==`function`?e(t):e},setState(e){this.updateState(e),r.forEach(e=>e(t))},initialize(e){n||=(t=e,!0)},subscribe(e){return r.add(e),()=>r.delete(e)}}}function wv(e){return(0,D.useSyncExternalStore)(e.subscribe,()=>e.getState(),()=>e.getState())}function Tv(e,t,n){let r=[],i=[],a={};for(let o of e){let e=o.position||t;a[e]=a[e]||0,a[e]+=1,a[e]<=n?i.push(o):r.push(o)}return{notifications:i,queue:r}}var Ev=Cv({notifications:[],queue:[],defaultPosition:`bottom-right`,limit:5}),Dv=(e=Ev)=>wv(e);function Ov(e,t){let n=e.getState(),r=Tv(t([...n.notifications,...n.queue]),n.defaultPosition,n.limit);e.setState({notifications:r.notifications,queue:r.queue,limit:n.limit,defaultPosition:n.defaultPosition})}function kv(e,t=Ev){let n=e.id||kt();return Ov(t,t=>e.id&&t.some(t=>t.id===e.id)?t:[...t,{...e,id:n}]),n}function Av(e,t=Ev){return Ov(t,t=>t.filter(t=>t.id!==e||(t.onClose?.(t),!1))),e}function jv(e,t=Ev){return Ov(t,t=>t.map(t=>t.id===e.id?{...t,...e}:t)),e.id}function Mv(e=Ev){Ov(e,()=>[])}function Nv(e=Ev){Ov(e,t=>t.slice(0,e.getState().limit))}var Pv={show:kv,hide:Av,update:jv,clean:Mv,cleanQueue:Nv,updateState:Ov};function Fv(e,t){return Fv=Object.setPrototypeOf?Object.setPrototypeOf.bind():function(e,t){return e.__proto__=t,e},Fv(e,t)}function Iv(e,t){e.prototype=Object.create(t.prototype),e.prototype.constructor=e,Fv(e,t)}var Lv={disabled:!1},Rv=D.createContext(null),zv=function(e){return e.scrollTop},Bv=`unmounted`,Vv=`exited`,Hv=`entering`,Uv=`entered`,Wv=`exiting`,Gv=function(e){Iv(t,e);function t(t,n){var r=e.call(this,t,n)||this,i=n,a=i&&!i.isMounting?t.enter:t.appear,o;return r.appearStatus=null,t.in?a?(o=Vv,r.appearStatus=Hv):o=Uv:o=t.unmountOnExit||t.mountOnEnter?Bv:Vv,r.state={status:o},r.nextCallback=null,r}t.getDerivedStateFromProps=function(e,t){return e.in&&t.status===`unmounted`?{status:Vv}:null};var n=t.prototype;return n.componentDidMount=function(){this.updateStatus(!0,this.appearStatus)},n.componentDidUpdate=function(e){var t=null;if(e!==this.props){var n=this.state.status;this.props.in?n!==`entering`&&n!==`entered`&&(t=Hv):(n===`entering`||n===`entered`)&&(t=Wv)}this.updateStatus(!1,t)},n.componentWillUnmount=function(){this.cancelNextCallback()},n.getTimeouts=function(){var e=this.props.timeout,t=n=r=e,n,r;return e!=null&&typeof e!=`number`&&(t=e.exit,n=e.enter,r=e.appear===void 0?n:e.appear),{exit:t,enter:n,appear:r}},n.updateStatus=function(e,t){if(e===void 0&&(e=!1),t!==null)if(this.cancelNextCallback(),t===`entering`){if(this.props.unmountOnExit||this.props.mountOnEnter){var n=this.props.nodeRef?this.props.nodeRef.current:Qi.default.findDOMNode(this);n&&zv(n)}this.performEnter(e)}else this.performExit();else this.props.unmountOnExit&&this.state.status===`exited`&&this.setState({status:Bv})},n.performEnter=function(e){var t=this,n=this.props.enter,r=this.context?this.context.isMounting:e,i=this.props.nodeRef?[r]:[Qi.default.findDOMNode(this),r],a=i[0],o=i[1],s=this.getTimeouts(),c=r?s.appear:s.enter;if(!e&&!n||Lv.disabled){this.safeSetState({status:Uv},function(){t.props.onEntered(a)});return}this.props.onEnter(a,o),this.safeSetState({status:Hv},function(){t.props.onEntering(a,o),t.onTransitionEnd(c,function(){t.safeSetState({status:Uv},function(){t.props.onEntered(a,o)})})})},n.performExit=function(){var e=this,t=this.props.exit,n=this.getTimeouts(),r=this.props.nodeRef?void 0:Qi.default.findDOMNode(this);if(!t||Lv.disabled){this.safeSetState({status:Vv},function(){e.props.onExited(r)});return}this.props.onExit(r),this.safeSetState({status:Wv},function(){e.props.onExiting(r),e.onTransitionEnd(n.exit,function(){e.safeSetState({status:Vv},function(){e.props.onExited(r)})})})},n.cancelNextCallback=function(){this.nextCallback!==null&&(this.nextCallback.cancel(),this.nextCallback=null)},n.safeSetState=function(e,t){t=this.setNextCallback(t),this.setState(e,t)},n.setNextCallback=function(e){var t=this,n=!0;return this.nextCallback=function(r){n&&(n=!1,t.nextCallback=null,e(r))},this.nextCallback.cancel=function(){n=!1},this.nextCallback},n.onTransitionEnd=function(e,t){this.setNextCallback(t);var n=this.props.nodeRef?this.props.nodeRef.current:Qi.default.findDOMNode(this),r=e==null&&!this.props.addEndListener;if(!n||r){setTimeout(this.nextCallback,0);return}if(this.props.addEndListener){var i=this.props.nodeRef?[this.nextCallback]:[n,this.nextCallback],a=i[0],o=i[1];this.props.addEndListener(a,o)}e!=null&&setTimeout(this.nextCallback,e)},n.render=function(){var e=this.state.status;if(e===`unmounted`)return null;var t=this.props,n=t.children;t.in,t.mountOnEnter,t.unmountOnExit,t.appear,t.enter,t.exit,t.timeout,t.addEndListener,t.onEnter,t.onEntering,t.onEntered,t.onExit,t.onExiting,t.onExited,t.nodeRef;var r=pm(t,[`children`,`in`,`mountOnEnter`,`unmountOnExit`,`appear`,`enter`,`exit`,`timeout`,`addEndListener`,`onEnter`,`onEntering`,`onEntered`,`onExit`,`onExiting`,`onExited`,`nodeRef`]);return D.createElement(Rv.Provider,{value:null},typeof n==`function`?n(e,r):D.cloneElement(D.Children.only(n),r))},t}(D.Component);Gv.contextType=Rv,Gv.propTypes={};function Kv(){}Gv.defaultProps={in:!1,mountOnEnter:!1,unmountOnExit:!1,appear:!1,enter:!0,exit:!0,onEnter:Kv,onEntering:Kv,onEntered:Kv,onExit:Kv,onExiting:Kv,onExited:Kv},Gv.UNMOUNTED=Bv,Gv.EXITED=Vv,Gv.ENTERING=Hv,Gv.ENTERED=Uv,Gv.EXITING=Wv;function kee(e){if(e===void 0)throw ReferenceError(`this hasn't been initialised - super() hasn't been called`);return e}function qv(e,t){var n=function(e){return t&&(0,D.isValidElement)(e)?t(e):e},r=Object.create(null);return e&&D.Children.map(e,function(e){return e}).forEach(function(e){r[e.key]=n(e)}),r}function Aee(e,t){e||={},t||={};function n(n){return n in t?t[n]:e[n]}var r=Object.create(null),i=[];for(var a in e)a in t?i.length&&(r[a]=i,i=[]):i.push(a);var o,s={};for(var c in t){if(r[c])for(o=0;o<r[c].length;o++){var l=r[c][o];s[r[c][o]]=n(l)}s[c]=n(c)}for(o=0;o<i.length;o++)s[i[o]]=n(i[o]);return s}function Jv(e,t,n){return n[t]==null?e.props[t]:n[t]}function jee(e,t){return qv(e.children,function(n){return(0,D.cloneElement)(n,{onExited:t.bind(null,n),in:!0,appear:Jv(n,`appear`,e),enter:Jv(n,`enter`,e),exit:Jv(n,`exit`,e)})})}function Mee(e,t,n){var r=qv(e.children),i=Aee(t,r);return Object.keys(i).forEach(function(a){var o=i[a];if((0,D.isValidElement)(o)){var s=a in t,c=a in r,l=t[a],u=(0,D.isValidElement)(l)&&!l.props.in;c&&(!s||u)?i[a]=(0,D.cloneElement)(o,{onExited:n.bind(null,o),in:!0,exit:Jv(o,`exit`,e),enter:Jv(o,`enter`,e)}):!c&&s&&!u?i[a]=(0,D.cloneElement)(o,{in:!1}):c&&s&&(0,D.isValidElement)(l)&&(i[a]=(0,D.cloneElement)(o,{onExited:n.bind(null,o),in:l.props.in,exit:Jv(o,`exit`,e),enter:Jv(o,`enter`,e)}))}}),i}var Nee=Object.values||function(e){return Object.keys(e).map(function(t){return e[t]})},Pee={component:`div`,childFactory:function(e){return e}},Yv=function(e){Iv(t,e);function t(t,n){var r=e.call(this,t,n)||this;return r.state={contextValue:{isMounting:!0},handleExited:r.handleExited.bind(kee(r)),firstRender:!0},r}var n=t.prototype;return n.componentDidMount=function(){this.mounted=!0,this.setState({contextValue:{isMounting:!1}})},n.componentWillUnmount=function(){this.mounted=!1},t.getDerivedStateFromProps=function(e,t){var n=t.children,r=t.handleExited;return{children:t.firstRender?jee(e,r):Mee(e,n,r),firstRender:!1}},n.handleExited=function(e,t){var n=qv(this.props.children);e.key in n||(e.props.onExited&&e.props.onExited(t),this.mounted&&this.setState(function(t){var n=fm({},t.children);return delete n[e.key],{children:n}}))},n.render=function(){var e=this.props,t=e.component,n=e.childFactory,r=pm(e,[`component`,`childFactory`]),i=this.state.contextValue,a=Nee(this.state.children).map(n);return delete r.appear,delete r.enter,delete r.exit,t===null?D.createElement(Rv.Provider,{value:i},a):D.createElement(Rv.Provider,{value:i},D.createElement(t,r,a))},t}(D.Component);Yv.propTypes={},Yv.defaultProps=Pee;var Xv=[`bottom-center`,`bottom-left`,`bottom-right`,`top-center`,`top-left`,`top-right`];function Fee(e,t){return e.reduce((e,n)=>(e[n.position||t].push(n),e),Xv.reduce((e,t)=>(e[t]=[],e),{}))}var Zv={left:`translateX(-100%)`,right:`translateX(100%)`,"top-center":`translateY(-100%)`,"bottom-center":`translateY(100%)`},Iee={left:`translateX(0)`,right:`translateX(0)`,"top-center":`translateY(0)`,"bottom-center":`translateY(0)`};function Lee({state:e,maxHeight:t,position:n,transitionDuration:r}){let[i,a]=n.split(`-`),o=a===`center`?`${i}-center`:a,s={opacity:0,maxHeight:t,transform:Zv[o],transitionDuration:`${r}ms, ${r}ms, ${r}ms`,transitionTimingFunction:`cubic-bezier(.51,.3,0,1.21), cubic-bezier(.51,.3,0,1.21), linear`,transitionProperty:`opacity, transform, max-height`},c={opacity:1,transform:Iee[o]},l={opacity:0,maxHeight:0,transform:Zv[o]},u={entering:c,entered:c,exiting:l,exited:l};return{...s,...u[e]}}function Ree(e,t){return typeof t==`number`?t:t===!1||e===!1?!1:e}var Qv=(0,D.forwardRef)(({data:e,onHide:t,autoClose:n,...r},i)=>{let{autoClose:a,message:o,...s}=e,c=Ree(n,e.autoClose),l=(0,D.useRef)(-1),u=()=>window.clearTimeout(l.current),d=()=>{t(e.id),u()},f=()=>{typeof c==`number`&&(l.current=window.setTimeout(d,c))};return(0,D.useEffect)(()=>{e.onOpen?.(e)},[]),(0,D.useEffect)(()=>(f(),u),[c]),(0,R.jsx)(Uh,{...r,...s,onClose:d,ref:i,onMouseEnter:u,onMouseLeave:f,children:o})});Qv.displayName=`@mantine/notifications/NotificationContainer`;var $v={root:`m_b37d9ac7`,notification:`m_5ed0edd0`},zee=Gv,Bee={position:`bottom-right`,autoClose:4e3,transitionDuration:250,containerWidth:440,notificationMaxHeight:200,limit:5,zIndex:mt(`overlay`),store:Ev,withinPortal:!0},Vee=jn((e,{zIndex:t,containerWidth:n})=>({root:{"--notifications-z-index":t?.toString(),"--notifications-container-width":L(n)}})),ey=V((e,t)=>{let n=z(`Notifications`,Bee,e),{classNames:r,className:i,style:a,styles:o,unstyled:s,vars:c,position:l,autoClose:u,transitionDuration:d,containerWidth:f,notificationMaxHeight:p,limit:m,zIndex:h,store:g,portalProps:_,withinPortal:v,...y}=n,b=Cr(),x=Dv(g),S=en(),C=gn(),w=(0,D.useRef)({}),T=(0,D.useRef)(0),E=b.respectReducedMotion&&C?1:d,O=oi({name:`Notifications`,classes:$v,props:n,className:i,style:a,classNames:r,styles:o,unstyled:s,vars:c,varsResolver:Vee});(0,D.useEffect)(()=>{g?.updateState(e=>({...e,limit:m||5,defaultPosition:l}))},[m,l]),Vt(()=>{x.notifications.length>T.current&&setTimeout(()=>S(),0),T.current=x.notifications.length},[x.notifications]);let k=Fee(x.notifications,l),A=Xv.reduce((e,t)=>(e[t]=k[t].map(({style:e,...n})=>(0,R.jsx)(zee,{timeout:E,onEnter:()=>w.current[n.id].offsetHeight,nodeRef:{current:w.current[n.id]},children:r=>(0,R.jsx)(Qv,{ref:e=>{e&&(w.current[n.id]=e)},data:n,onHide:e=>Av(e,g),autoClose:u,...O(`notification`,{style:{...Lee({state:r,position:t,transitionDuration:E,maxHeight:p}),...e}})})},n.id)),e),{});return(0,R.jsxs)(Vl,{withinPortal:v,..._,children:[(0,R.jsx)(B,{...O(`root`),"data-position":`top-center`,ref:t,...y,children:(0,R.jsx)(Yv,{children:A[`top-center`]})}),(0,R.jsx)(B,{...O(`root`),"data-position":`top-left`,...y,children:(0,R.jsx)(Yv,{children:A[`top-left`]})}),(0,R.jsx)(B,{...O(`root`,{className:Ge.classNames.fullWidth}),"data-position":`top-right`,...y,children:(0,R.jsx)(Yv,{children:A[`top-right`]})}),(0,R.jsx)(B,{...O(`root`,{className:Ge.classNames.fullWidth}),"data-position":`bottom-right`,...y,children:(0,R.jsx)(Yv,{children:A[`bottom-right`]})}),(0,R.jsx)(B,{...O(`root`),"data-position":`bottom-left`,...y,children:(0,R.jsx)(Yv,{children:A[`bottom-left`]})}),(0,R.jsx)(B,{...O(`root`),"data-position":`bottom-center`,...y,children:(0,R.jsx)(Yv,{children:A[`bottom-center`]})})]})});ey.classes=$v,ey.displayName=`@mantine/notifications/Notifications`,ey.show=Pv.show,ey.hide=Pv.hide,ey.update=Pv.update,ey.clean=Pv.clean,ey.cleanQueue=Pv.cleanQueue,ey.updateState=Pv.updateState;var Hee=v(),Uee=di({colors:{inspector:[`#eef3ff`,`#dce6ff`,`#b7ccff`,`#8facfc`,`#6b8ef8`,`#4f78f3`,`#3d68ee`,`#2f59e0`,`#2749b8`,`#16265e`],gray:[`#f7f8fa`,`#eef0f4`,`#e2e5ec`,`#cfd4de`,`#b0b7c5`,`#8d95a6`,`#6c7486`,`#515868`,`#3a3f4b`,`#23272f`],dark:[`#c9cdd6`,`#aeb4c0`,`#8b93a3`,`#6a7284`,`#464c5b`,`#363b47`,`#2b2f3a`,`#23262f`,`#1a1d24`,`#131519`],green:[`#e6f7ee`,`#c6efd7`,`#96e2b8`,`#5fd196`,`#33bd79`,`#1aa864`,`#109655`,`#0d7d47`,`#0a6339`,`#074a2b`],red:[`#ffecec`,`#ffd7d7`,`#ffb3b3`,`#ff8585`,`#f95f60`,`#ef4344`,`#e03236`,`#c62328`,`#a11a1f`,`#7d1418`],yellow:[`#fff7e6`,`#ffecc2`,`#ffdb8a`,`#fbc94f`,`#f5b722`,`#e8a800`,`#d19700`,`#a87800`,`#855f00`,`#634700`],blue:[`#e7f1ff`,`#cfe2ff`,`#a3c8ff`,`#6fa6fb`,`#4589f5`,`#2a75ee`,`#1b66e0`,`#1553bb`,`#124399`,`#0d2f6b`],teal:[`#e2f7f4`,`#bfeee8`,`#8adfd4`,`#4ecabb`,`#23b2a2`,`#109e8f`,`#0d8a7d`,`#0a6f65`,`#08574f`,`#06403a`],violet:[`#faf0ff`,`#f0dcff`,`#e0bbff`,`#cb91fb`,`#b264f5`,`#a03bf5`,`#9127e6`,`#7a1fc4`,`#63189e`,`#3f0f66`]},primaryColor:`inspector`,primaryShade:{light:7,dark:8},autoContrast:!0,defaultRadius:`md`,cursorType:`pointer`,fontFamily:`"Fredoka", sans-serif`,fontFamilyMonospace:`"Roboto Mono", monospace`,headings:{fontFamily:`"Fredoka", sans-serif`,fontWeight:`600`},components:{Accordion:Hd.extend({classNames:(e,t)=>t.variant===`disclosure`?{root:`disclosure-sections`,chevron:`disclosure-chevron`,control:`filter-toggle`}:{}}),ActionIcon:Cu.extend({defaultProps:{variant:`subtle`,color:`gray`,radius:`md`}}),Alert:Gd.extend({defaultProps:{radius:`md`},styles:(e,t)=>t.variant===`warning`?{root:{backgroundColor:`light-dark(var(--mantine-color-yellow-1), var(--mantine-color-yellow-light))`,borderInlineStart:`3px solid var(--mantine-color-yellow-5)`},title:{color:`light-dark(var(--mantine-color-black), var(--mantine-color-yellow-light-color))`},message:{color:`light-dark(var(--mantine-color-black), var(--mantine-color-yellow-light-color))`}}:t.variant===`reauth`?{root:{backgroundColor:`var(--mantine-color-body)`,border:`1px solid var(--mantine-color-red-3)`}}:{root:{}}}),AppShell:Cf.extend({defaultProps:{padding:0},styles:{main:{height:`100dvh`,overflow:`hidden`}}}),Autocomplete:Fp.extend({defaultProps:{radius:`md`,clearable:!0,clearButtonProps:{tabIndex:-1}}}),Badge:Rp.extend({defaultProps:{size:`sm`,radius:`sm`,fw:600},styles:(e,t)=>{if(t.variant===`status`&&t.color){let e=t.color;return e===`orange`||e===`yellow`?{root:{backgroundColor:`var(--mantine-color-${e}-5)`,color:`var(--mantine-color-black)`}}:{root:{backgroundColor:`light-dark(var(--mantine-color-${e}-light), var(--mantine-color-${e}-filled))`,color:`light-dark(var(--mantine-color-${e}-light-color), var(--mantine-color-white))`}}}return{root:{}}}}),Button:qp.extend({defaultProps:{radius:`md`}}),Card:$p.extend({defaultProps:{padding:`lg`,radius:`md`,withBorder:!0},classNames:(e,t)=>t.variant===`responsive`?{root:`card-responsive`}:{},styles:(e,t)=>t.variant===`disabled`?{root:{backgroundColor:`var(--inspector-surface-card)`,opacity:.4,pointerEvents:`none`}}:t.variant===`sidebar`?{root:{backgroundColor:`var(--inspector-surface-card)`,maxHeight:`100%`,display:`flex`,flexDirection:`column`,overflow:`hidden`}}:t.variant===`highlighted`?{root:{backgroundColor:`var(--inspector-surface-card)`,borderColor:`var(--inspector-highlight-border)`,borderWidth:2}}:t.variant===`errored`?{root:{backgroundColor:`var(--inspector-surface-card)`,borderColor:`var(--inspector-error-border)`,borderWidth:2}}:t.variant===`preview`?{root:{backgroundColor:`var(--inspector-surface-card)`,overflow:`hidden`}}:t.variant===`inset`?{root:{backgroundColor:`var(--inspector-surface-inset)`,"--inspector-code-surface":`var(--inspector-surface-code-oncard)`}}:{root:{backgroundColor:`var(--inspector-surface-card)`}}}),Code:nm.extend({styles:(e,t)=>{let n={backgroundColor:`var(--inspector-code-surface, var(--inspector-surface-code))`};return t.variant===`wrapping`&&(n.wordBreak=`break-all`,n.whiteSpace=`pre-wrap`),t.block&&(n.margin=`0`),t.variant===`nowrap`&&(n.whiteSpace=`nowrap`,n.overflow=`hidden`,n.textOverflow=`ellipsis`),{root:n}}}),Flex:wd.extend({styles:(e,t)=>t.variant===`screen`?{root:{overflow:`hidden`}}:{root:{}}}),Group:H.extend({classNames:(e,t)=>t.variant===`sectionHeader`?{root:`filter-toggle`}:{}}),Input:vd.extend({styles:()=>({input:{backgroundColor:`var(--inspector-input-background)`}})}),Modal:_h.extend({defaultProps:{closeButtonProps:{"aria-label":`Close`}}}),ModalRoot:_h.Root.extend({defaultProps:{transitionProps:{transition:`fade-down`,duration:200}}}),Paper:El.extend({classNames:(e,t)=>t.variant===`code`?{root:`paper-code`}:{},styles:(e,t)=>t.variant===`code`?{root:{padding:`var(--mantine-spacing-md)`,backgroundColor:`var(--inspector-surface-code)`,fontFamily:`var(--mantine-font-family-monospace)`,fontSize:`var(--mantine-font-size-sm)`,overflow:`auto`}}:t.variant===`contained`?{root:{overflow:`hidden`,minWidth:0}}:t.variant===`panel`?{root:{display:`flex`,flexDirection:`column`,overflow:`hidden`,minHeight:0}}:{root:{}}}),ScrollArea:_l.extend({defaultProps:{type:`scroll`}}),ScrollAreaAutosize:_l.Autosize.extend({defaultProps:{type:`scroll`}}),Select:P_.extend({defaultProps:{radius:`md`}}),Switch:K_.extend({defaultProps:{radius:`xl`}}),Text:U.extend({classNames:(e,t)=>t.variant===`tabGlow`?{root:`tab-glow`}:{},styles:(e,t)=>t.variant===`monoBreak`?{root:{wordBreak:`break-all`}}:t.variant===`nowrap`?{root:{whiteSpace:`nowrap`}}:t.variant===`consoleLine`?{root:{whiteSpace:`pre-wrap`,wordBreak:`break-word`}}:t.variant===`versionBadge`||t.variant===`copyrightBadge`?{root:{color:`var(--inspector-text-secondary)`,fontSize:`var(--mantine-font-size-xs)`,whiteSpace:`nowrap`,userSelect:`none`}}:{root:{}}}),TextInput:fv.extend({defaultProps:{radius:`md`}}),Title:Sv.extend({styles:(e,t)=>t.variant===`section`?{root:{backgroundColor:`var(--inspector-surface-subtle)`,padding:`0.375rem 0.75rem`,borderRadius:`var(--mantine-radius-sm)`}}:{root:{}}}),UnstyledButton:xl.extend({classNames:(e,t)=>t.variant===`listItem`?{root:`list-item`}:t.variant===`filterToggle`?{root:`filter-toggle`}:{},styles:(e,t)=>t.variant===`listItem`?{root:{borderRadius:`var(--mantine-radius-md)`}}:{root:{}}})}}),Wee=Object.create,ty=Object.defineProperty,Gee=Object.getOwnPropertyDescriptor,Kee=Object.getOwnPropertyNames,ny=Object.getPrototypeOf,ry=Object.prototype.hasOwnProperty,G=(e,t)=>()=>(t||e((t={exports:{}}).exports,t),t.exports),iy=(e,t)=>{let n={};for(var r in e)ty(n,r,{get:e[r],enumerable:!0});return t&&ty(n,Symbol.toStringTag,{value:`Module`}),n},ay=(e,t,n,r)=>{if(t&&typeof t==`object`||typeof t==`function`)for(var i=Kee(t),a=0,o=i.length,s;a<o;a++)s=i[a],!ry.call(e,s)&&s!==n&&ty(e,s,{get:(e=>t[e]).bind(null,s),enumerable:!(r=Gee(t,s))||r.enumerable});return e},oy=(e,t,n)=>(n=e==null?{}:Wee(ny(e)),ay(t||!e||!e.__esModule?ty(n,`default`,{value:e,enumerable:!0}):n,e)),sy=new Set([`https://json-schema.org/draft/2020-12/schema`,`http://json-schema.org/draft/2020-12/schema`]),cy=new Set([`https://json-schema.org/draft/2019-09/schema`,`http://json-schema.org/draft/2019-09/schema`]),ly=new Set([`https://json-schema.org/draft-07/schema`,`http://json-schema.org/draft-07/schema`]),uy=new Set([`https://json-schema.org/draft-06/schema`,`http://json-schema.org/draft-06/schema`]);function dy(e){return typeof e==`string`&&cy.has(e.replace(/#$/,``))}function fy(e,t){if(!(`$schema`in e)||typeof e.$schema!=`string`)return`2020-12`;let n=e.$schema.replace(/#$/,``);if(sy.has(n))return`2020-12`;if(cy.has(n))return`2019-09`;if(ly.has(n)||uy.has(n))return`draft-7`;throw Error(`JSON Schema declares an unsupported dialect ("$schema": "${e.$schema.slice(0,200)}"). The default validator supports JSON Schema 2020-12, 2019-09, draft-07, and draft-06; ${t}`)}var py,my=Object.freeze({status:`aborted`});function K(e,t,n){function r(n,r){if(n._zod||Object.defineProperty(n,"_zod",{value:{def:r,constr:o,traits:new Set},enumerable:!1}),n._zod.traits.has(e))return;n._zod.traits.add(e),t(n,r);let i=o.prototype,a=Object.keys(i);for(let e=0;e<a.length;e++){let t=a[e];t in n||(n[t]=i[t].bind(n))}}let i=n?.Parent??Object;class a extends i{}Object.defineProperty(a,"name",{value:e});function o(e){var t;let i=n?.Parent?new a:this;r(i,e),(t=i._zod).deferred??(t.deferred=[]);for(let e of i._zod.deferred)e();return i}return Object.defineProperty(o,"init",{value:r}),Object.defineProperty(o,Symbol.hasInstance,{value:t=>n?.Parent&&t instanceof n.Parent?!0:t?._zod?.traits?.has(e)}),Object.defineProperty(o,"name",{value:e}),o}var hy=class extends Error{constructor(){super(`Encountered Promise during synchronous parse. Use .parseAsync() instead.`)}},gy=class extends Error{constructor(e){super(`Encountered unidirectional transform during encode: ${e}`),this.name=`ZodEncodeError`}};(py=globalThis).__zod_globalConfig??(py.__zod_globalConfig={});var _y=globalThis.__zod_globalConfig;function vy(e){return e&&Object.assign(_y,e),_y}function yy(e){let t=Object.values(e).filter(e=>typeof e==`number`);return Object.entries(e).filter(([e,n])=>t.indexOf(+e)===-1).map(([e,t])=>t)}function by(e,t){return typeof t==`bigint`?t.toString():t}function xy(e){return{get value(){{let t=e();return Object.defineProperty(this,"value",{value:t}),t}}}}function Sy(e){return e==null}function Cy(e){let t=+!!e.startsWith(`^`),n=e.endsWith(`$`)?e.length-1:e.length;return e.slice(t,n)}function wy(e,t){let n=e/t,r=Math.round(n),i=2**-52*Math.max(Math.abs(n),1);return Math.abs(n-r)<i?0:n-r}var Ty=Symbol(`evaluating`);function Ey(e,t,n){let r;Object.defineProperty(e,t,{get(){if(r!==Ty)return r===void 0&&(r=Ty,r=n()),r},set(n){Object.defineProperty(e,t,{value:n})},configurable:!0})}function Dy(e,t,n){Object.defineProperty(e,t,{value:n,writable:!0,enumerable:!0,configurable:!0})}function Oy(...e){let t={};for(let n of e){let e=Object.getOwnPropertyDescriptors(n);Object.assign(t,e)}return Object.defineProperties({},t)}function ky(e){return JSON.stringify(e)}function Ay(e){return e.toLowerCase().trim().replace(/[^\w\s-]/g,``).replace(/[\s_-]+/g,`-`).replace(/^-+|-+$/g,``)}var jy=`captureStackTrace`in Error?Error.captureStackTrace:(...e)=>{};function My(e){return typeof e==`object`&&!!e&&!Array.isArray(e)}var Ny=xy(()=>{if(_y.jitless||typeof navigator<`u`&&navigator?.userAgent?.includes(`Cloudflare`))return!1;try{return Function(``),!0}catch{return!1}});function Py(e){if(My(e)===!1)return!1;let t=e.constructor;if(t===void 0||typeof t!=`function`)return!0;let n=t.prototype;return My(n)!==!1&&Object.prototype.hasOwnProperty.call(n,`isPrototypeOf`)!==!1}function Fy(e){return Py(e)?{...e}:Array.isArray(e)?[...e]:e instanceof Map?new Map(e):e instanceof Set?new Set(e):e}var Iy=new Set([`string`,`number`,`symbol`]);function Ly(e){return e.replace(/[.*+?^${}()|[\]\\]/g,`\\$&`)}function Ry(e,t,n){let r=new e._zod.constr(t??e._zod.def);return(!t||n?.parent)&&(r._zod.parent=e),r}function zy(e){let t=e;if(!t)return{};if(typeof t==`string`)return{error:()=>t};if(t?.message!==void 0){if(t?.error!==void 0)throw Error("Cannot specify both `message` and `error` params");t.error=t.message}return delete t.message,typeof t.error==`string`?{...t,error:()=>t.error}:t}function By(e){return Object.keys(e).filter(t=>e[t]._zod.optin===`optional`&&e[t]._zod.optout===`optional`)}var Vy={safeint:[-(2**53-1),2**53-1],int32:[-2147483648,2147483647],uint32:[0,4294967295],float32:[-34028234663852886e22,34028234663852886e22],float64:[-Number.MAX_VALUE,Number.MAX_VALUE]};function Hy(e,t){let n=e._zod.def,r=n.checks;if(r&&r.length>0)throw Error(`.pick() cannot be used on object schemas containing refinements`);return Ry(e,Oy(e._zod.def,{get shape(){let e={};for(let r in t){if(!(r in n.shape))throw Error(`Unrecognized key: "${r}"`);t[r]&&(e[r]=n.shape[r])}return Dy(this,`shape`,e),e},checks:[]}))}function Uy(e,t){let n=e._zod.def,r=n.checks;if(r&&r.length>0)throw Error(`.omit() cannot be used on object schemas containing refinements`);return Ry(e,Oy(e._zod.def,{get shape(){let r={...e._zod.def.shape};for(let e in t){if(!(e in n.shape))throw Error(`Unrecognized key: "${e}"`);t[e]&&delete r[e]}return Dy(this,`shape`,r),r},checks:[]}))}function Wy(e,t){if(!Py(t))throw Error(`Invalid input to extend: expected a plain object`);let n=e._zod.def.checks;if(n&&n.length>0){let n=e._zod.def.shape;for(let e in t)if(Object.getOwnPropertyDescriptor(n,e)!==void 0)throw Error("Cannot overwrite keys on object schemas containing refinements. Use `.safeExtend()` instead.")}return Ry(e,Oy(e._zod.def,{get shape(){let n={...e._zod.def.shape,...t};return Dy(this,`shape`,n),n}}))}function Gy(e,t){if(!Py(t))throw Error(`Invalid input to safeExtend: expected a plain object`);return Ry(e,Oy(e._zod.def,{get shape(){let n={...e._zod.def.shape,...t};return Dy(this,`shape`,n),n}}))}function Ky(e,t){if(e._zod.def.checks?.length)throw Error(`.merge() cannot be used on object schemas containing refinements. Use .safeExtend() instead.`);return Ry(e,Oy(e._zod.def,{get shape(){let n={...e._zod.def.shape,...t._zod.def.shape};return Dy(this,`shape`,n),n},get catchall(){return t._zod.def.catchall},checks:t._zod.def.checks??[]}))}function qy(e,t,n){let r=t._zod.def.checks;if(r&&r.length>0)throw Error(`.partial() cannot be used on object schemas containing refinements`);return Ry(t,Oy(t._zod.def,{get shape(){let r=t._zod.def.shape,i={...r};if(n)for(let t in n){if(!(t in r))throw Error(`Unrecognized key: "${t}"`);n[t]&&(i[t]=e?new e({type:`optional`,innerType:r[t]}):r[t])}else for(let t in r)i[t]=e?new e({type:`optional`,innerType:r[t]}):r[t];return Dy(this,`shape`,i),i},checks:[]}))}function Jy(e,t,n){return Ry(t,Oy(t._zod.def,{get shape(){let r=t._zod.def.shape,i={...r};if(n)for(let t in n){if(!(t in i))throw Error(`Unrecognized key: "${t}"`);n[t]&&(i[t]=new e({type:`nonoptional`,innerType:r[t]}))}else for(let t in r)i[t]=new e({type:`nonoptional`,innerType:r[t]});return Dy(this,`shape`,i),i}}))}function Yy(e,t=0){if(e.aborted===!0)return!0;for(let n=t;n<e.issues.length;n++)if(e.issues[n]?.continue!==!0)return!0;return!1}function Xy(e,t=0){if(e.aborted===!0)return!0;for(let n=t;n<e.issues.length;n++)if(e.issues[n]?.continue===!1)return!0;return!1}function Zy(e,t){return t.map(t=>{var n;return(n=t).path??(n.path=[]),t.path.unshift(e),t})}function Qy(e){return typeof e==`string`?e:e?.message}function $y(e,t,n){let r=e.message?e.message:Qy(e.inst?._zod.def?.error?.(e))??Qy(t?.error?.(e))??Qy(n.customError?.(e))??Qy(n.localeError?.(e))??`Invalid input`,{inst:i,continue:a,input:o,...s}=e;return s.path??=[],s.message=r,t?.reportInput&&(s.input=o),s}function eb(e){return Array.isArray(e)?`array`:typeof e==`string`?`string`:`unknown`}function tb(...e){let[t,n,r]=e;return typeof t==`string`?{message:t,code:`custom`,input:n,inst:r}:{...t}}var nb=(e,t)=>{e.name=`$ZodError`,Object.defineProperty(e,"_zod",{value:e._zod,enumerable:!1}),Object.defineProperty(e,"issues",{value:t,enumerable:!1}),e.message=JSON.stringify(t,by,2),Object.defineProperty(e,"toString",{value:()=>e.message,enumerable:!1})},rb=K(`$ZodError`,nb),ib=K(`$ZodError`,nb,{Parent:Error});function ab(e,t=e=>e.message){let n={},r=[];for(let i of e.issues)i.path.length>0?(n[i.path[0]]=n[i.path[0]]||[],n[i.path[0]].push(t(i))):r.push(t(i));return{formErrors:r,fieldErrors:n}}function ob(e,t=e=>e.message){let n={_errors:[]},r=(e,i=[])=>{for(let a of e.issues)if(a.code===`invalid_union`&&a.errors.length)a.errors.map(e=>r({issues:e},[...i,...a.path]));else if(a.code===`invalid_key`)r({issues:a.issues},[...i,...a.path]);else if(a.code===`invalid_element`)r({issues:a.issues},[...i,...a.path]);else{let e=[...i,...a.path];if(e.length===0)n._errors.push(t(a));else{let r=n,i=0;for(;i<e.length;){let n=e[i];i===e.length-1?(r[n]=r[n]||{_errors:[]},r[n]._errors.push(t(a))):r[n]=r[n]||{_errors:[]},r=r[n],i++}}}};return r(e),n}var sb=e=>(t,n,r,i)=>{let a=r?{...r,async:!1}:{async:!1},o=t._zod.run({value:n,issues:[]},a);if(o instanceof Promise)throw new hy;if(o.issues.length){let t=new((i?.Err)??e)(o.issues.map(e=>$y(e,a,vy())));throw jy(t,i?.callee),t}return o.value},cb=e=>async(t,n,r,i)=>{let a=r?{...r,async:!0}:{async:!0},o=t._zod.run({value:n,issues:[]},a);if(o instanceof Promise&&(o=await o),o.issues.length){let t=new((i?.Err)??e)(o.issues.map(e=>$y(e,a,vy())));throw jy(t,i?.callee),t}return o.value},lb=e=>(t,n,r)=>{let i=r?{...r,async:!1}:{async:!1},a=t._zod.run({value:n,issues:[]},i);if(a instanceof Promise)throw new hy;return a.issues.length?{success:!1,error:new(e??rb)(a.issues.map(e=>$y(e,i,vy())))}:{success:!0,data:a.value}},ub=lb(ib),db=e=>async(t,n,r)=>{let i=r?{...r,async:!0}:{async:!0},a=t._zod.run({value:n,issues:[]},i);return a instanceof Promise&&(a=await a),a.issues.length?{success:!1,error:new e(a.issues.map(e=>$y(e,i,vy())))}:{success:!0,data:a.value}},fb=db(ib),pb=e=>(t,n,r)=>{let i=r?{...r,direction:`backward`}:{direction:`backward`};return sb(e)(t,n,i)},mb=e=>(t,n,r)=>sb(e)(t,n,r),hb=e=>async(t,n,r)=>{let i=r?{...r,direction:`backward`}:{direction:`backward`};return cb(e)(t,n,i)},gb=e=>async(t,n,r)=>cb(e)(t,n,r),_b=e=>(t,n,r)=>{let i=r?{...r,direction:`backward`}:{direction:`backward`};return lb(e)(t,n,i)},vb=e=>(t,n,r)=>lb(e)(t,n,r),yb=e=>async(t,n,r)=>{let i=r?{...r,direction:`backward`}:{direction:`backward`};return db(e)(t,n,i)},bb=e=>async(t,n,r)=>db(e)(t,n,r),xb=/^[cC][0-9a-z]{6,}$/,Sb=/^[0-9a-z]+$/,Cb=/^[0-9A-HJKMNP-TV-Za-hjkmnp-tv-z]{26}$/,wb=/^[0-9a-vA-V]{20}$/,Tb=/^[A-Za-z0-9]{27}$/,Eb=/^[a-zA-Z0-9_-]{21}$/,Db=/^P(?:(\d+W)|(?!.*W)(?=\d|T\d)(\d+Y)?(\d+M)?(\d+D)?(T(?=\d)(\d+H)?(\d+M)?(\d+([.,]\d+)?S)?)?)$/,Ob=/^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{12})$/,kb=e=>e?RegExp(`^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-${e}[0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12})$`):/^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$/,Ab=/^(?!\.)(?!.*\.\.)([A-Za-z0-9_'+\-\.]*)[A-Za-z0-9_+-]@([A-Za-z0-9][A-Za-z0-9\-]*\.)+[A-Za-z]{2,}$/,jb=`^(\\p{Extended_Pictographic}|\\p{Emoji_Component})+$`;function Mb(){return new RegExp(jb,`u`)}var Nb=/^(?:(?:25[0-5]|2[0-4][0-9]|1[0-9][0-9]|[1-9][0-9]|[0-9])\.){3}(?:25[0-5]|2[0-4][0-9]|1[0-9][0-9]|[1-9][0-9]|[0-9])$/,Pb=/^(([0-9a-fA-F]{1,4}:){7}[0-9a-fA-F]{1,4}|([0-9a-fA-F]{1,4}:){1,7}:|([0-9a-fA-F]{1,4}:){1,6}:[0-9a-fA-F]{1,4}|([0-9a-fA-F]{1,4}:){1,5}(:[0-9a-fA-F]{1,4}){1,2}|([0-9a-fA-F]{1,4}:){1,4}(:[0-9a-fA-F]{1,4}){1,3}|([0-9a-fA-F]{1,4}:){1,3}(:[0-9a-fA-F]{1,4}){1,4}|([0-9a-fA-F]{1,4}:){1,2}(:[0-9a-fA-F]{1,4}){1,5}|[0-9a-fA-F]{1,4}:((:[0-9a-fA-F]{1,4}){1,6})|:((:[0-9a-fA-F]{1,4}){1,7}|:))$/,Fb=/^((25[0-5]|2[0-4][0-9]|1[0-9][0-9]|[1-9][0-9]|[0-9])\.){3}(25[0-5]|2[0-4][0-9]|1[0-9][0-9]|[1-9][0-9]|[0-9])\/([0-9]|[1-2][0-9]|3[0-2])$/,Ib=/^(([0-9a-fA-F]{1,4}:){7}[0-9a-fA-F]{1,4}|::|([0-9a-fA-F]{1,4})?::([0-9a-fA-F]{1,4}:?){0,6})\/(12[0-8]|1[01][0-9]|[1-9]?[0-9])$/,Lb=/^$|^(?:[0-9a-zA-Z+/]{4})*(?:(?:[0-9a-zA-Z+/]{2}==)|(?:[0-9a-zA-Z+/]{3}=))?$/,Rb=/^[A-Za-z0-9_-]*$/,zb=/^https?$/,Bb=/^\+[1-9]\d{6,14}$/,Vb=`(?:(?:\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\\d|30)|(?:02)-(?:0[1-9]|1\\d|2[0-8])))`,Hb=RegExp(`^${Vb}$`);function Ub(e){let t=`(?:[01]\\d|2[0-3]):[0-5]\\d`;return typeof e.precision==`number`?e.precision===-1?`${t}`:e.precision===0?`${t}:[0-5]\\d`:`${t}:[0-5]\\d\\.\\d{${e.precision}}`:`${t}(?::[0-5]\\d(?:\\.\\d+)?)?`}function Wb(e){return RegExp(`^${Ub(e)}$`)}function Gb(e){let t=Ub({precision:e.precision}),n=[`Z`];e.local&&n.push(``),e.offset&&n.push(`([+-](?:[01]\\d|2[0-3]):[0-5]\\d)`);let r=`${t}(?:${n.join(`|`)})`;return RegExp(`^${Vb}T(?:${r})$`)}var Kb=e=>{let t=e?`[\\s\\S]{${e?.minimum??0},${e?.maximum??``}}`:`[\\s\\S]*`;return RegExp(`^${t}$`)},qb=/^-?\d+$/,Jb=/^-?\d+(?:\.\d+)?$/,Yb=/^(?:true|false)$/i,Xb=/^null$/i,Zb=/^undefined$/i,Qb=/^[^A-Z]*$/,$b=/^[^a-z]*$/,ex=K(`$ZodCheck`,(e,t)=>{var n;e._zod??={},e._zod.def=t,(n=e._zod).onattach??(n.onattach=[])}),tx={number:`number`,bigint:`bigint`,object:`date`},nx=K(`$ZodCheckLessThan`,(e,t)=>{ex.init(e,t);let n=tx[typeof t.value];e._zod.onattach.push(e=>{let n=e._zod.bag,r=(t.inclusive?n.maximum:n.exclusiveMaximum)??1/0;t.value<r&&(t.inclusive?n.maximum=t.value:n.exclusiveMaximum=t.value)}),e._zod.check=r=>{(t.inclusive?r.value<=t.value:r.value<t.value)||r.issues.push({origin:n,code:`too_big`,maximum:typeof t.value==`object`?t.value.getTime():t.value,input:r.value,inclusive:t.inclusive,inst:e,continue:!t.abort})}}),rx=K(`$ZodCheckGreaterThan`,(e,t)=>{ex.init(e,t);let n=tx[typeof t.value];e._zod.onattach.push(e=>{let n=e._zod.bag,r=(t.inclusive?n.minimum:n.exclusiveMinimum)??-1/0;t.value>r&&(t.inclusive?n.minimum=t.value:n.exclusiveMinimum=t.value)}),e._zod.check=r=>{(t.inclusive?r.value>=t.value:r.value>t.value)||r.issues.push({origin:n,code:`too_small`,minimum:typeof t.value==`object`?t.value.getTime():t.value,input:r.value,inclusive:t.inclusive,inst:e,continue:!t.abort})}}),ix=K(`$ZodCheckMultipleOf`,(e,t)=>{ex.init(e,t),e._zod.onattach.push(e=>{var n;(n=e._zod.bag).multipleOf??(n.multipleOf=t.value)}),e._zod.check=n=>{if(typeof n.value!=typeof t.value)throw Error(`Cannot mix number and bigint in multiple_of check.`);(typeof n.value==`bigint`?n.value%t.value===BigInt(0):wy(n.value,t.value)===0)||n.issues.push({origin:typeof n.value,code:`not_multiple_of`,divisor:t.value,input:n.value,inst:e,continue:!t.abort})}}),ax=K(`$ZodCheckNumberFormat`,(e,t)=>{ex.init(e,t),t.format=t.format||`float64`;let n=t.format?.includes(`int`),r=n?`int`:`number`,[i,a]=Vy[t.format];e._zod.onattach.push(e=>{let r=e._zod.bag;r.format=t.format,r.minimum=i,r.maximum=a,n&&(r.pattern=qb)}),e._zod.check=o=>{let s=o.value;if(n){if(!Number.isInteger(s)){o.issues.push({expected:r,format:t.format,code:`invalid_type`,continue:!1,input:s,inst:e});return}if(!Number.isSafeInteger(s)){s>0?o.issues.push({input:s,code:`too_big`,maximum:2**53-1,note:`Integers must be within the safe integer range.`,inst:e,origin:r,inclusive:!0,continue:!t.abort}):o.issues.push({input:s,code:`too_small`,minimum:-(2**53-1),note:`Integers must be within the safe integer range.`,inst:e,origin:r,inclusive:!0,continue:!t.abort});return}}s<i&&o.issues.push({origin:`number`,input:s,code:`too_small`,minimum:i,inclusive:!0,inst:e,continue:!t.abort}),s>a&&o.issues.push({origin:`number`,input:s,code:`too_big`,maximum:a,inclusive:!0,inst:e,continue:!t.abort})}}),ox=K(`$ZodCheckMaxLength`,(e,t)=>{var n;ex.init(e,t),(n=e._zod.def).when??(n.when=e=>{let t=e.value;return!Sy(t)&&t.length!==void 0}),e._zod.onattach.push(e=>{let n=e._zod.bag.maximum??1/0;t.maximum<n&&(e._zod.bag.maximum=t.maximum)}),e._zod.check=n=>{let r=n.value;if(r.length<=t.maximum)return;let i=eb(r);n.issues.push({origin:i,code:`too_big`,maximum:t.maximum,inclusive:!0,input:r,inst:e,continue:!t.abort})}}),sx=K(`$ZodCheckMinLength`,(e,t)=>{var n;ex.init(e,t),(n=e._zod.def).when??(n.when=e=>{let t=e.value;return!Sy(t)&&t.length!==void 0}),e._zod.onattach.push(e=>{let n=e._zod.bag.minimum??-1/0;t.minimum>n&&(e._zod.bag.minimum=t.minimum)}),e._zod.check=n=>{let r=n.value;if(r.length>=t.minimum)return;let i=eb(r);n.issues.push({origin:i,code:`too_small`,minimum:t.minimum,inclusive:!0,input:r,inst:e,continue:!t.abort})}}),cx=K(`$ZodCheckLengthEquals`,(e,t)=>{var n;ex.init(e,t),(n=e._zod.def).when??(n.when=e=>{let t=e.value;return!Sy(t)&&t.length!==void 0}),e._zod.onattach.push(e=>{let n=e._zod.bag;n.minimum=t.length,n.maximum=t.length,n.length=t.length}),e._zod.check=n=>{let r=n.value,i=r.length;if(i===t.length)return;let a=eb(r),o=i>t.length;n.issues.push({origin:a,...o?{code:`too_big`,maximum:t.length}:{code:`too_small`,minimum:t.length},inclusive:!0,exact:!0,input:n.value,inst:e,continue:!t.abort})}}),lx=K(`$ZodCheckStringFormat`,(e,t)=>{var n,r;ex.init(e,t),e._zod.onattach.push(e=>{let n=e._zod.bag;n.format=t.format,t.pattern&&(n.patterns??=new Set,n.patterns.add(t.pattern))}),t.pattern?(n=e._zod).check??(n.check=n=>{t.pattern.lastIndex=0,!t.pattern.test(n.value)&&n.issues.push({origin:`string`,code:`invalid_format`,format:t.format,input:n.value,...t.pattern?{pattern:t.pattern.toString()}:{},inst:e,continue:!t.abort})}):(r=e._zod).check??(r.check=()=>{})}),ux=K(`$ZodCheckRegex`,(e,t)=>{lx.init(e,t),e._zod.check=n=>{t.pattern.lastIndex=0,!t.pattern.test(n.value)&&n.issues.push({origin:`string`,code:`invalid_format`,format:`regex`,input:n.value,pattern:t.pattern.toString(),inst:e,continue:!t.abort})}}),dx=K(`$ZodCheckLowerCase`,(e,t)=>{t.pattern??=Qb,lx.init(e,t)}),fx=K(`$ZodCheckUpperCase`,(e,t)=>{t.pattern??=$b,lx.init(e,t)}),px=K(`$ZodCheckIncludes`,(e,t)=>{ex.init(e,t);let n=Ly(t.includes),r=new RegExp(typeof t.position==`number`?`^.{${t.position}}${n}`:n);t.pattern=r,e._zod.onattach.push(e=>{let t=e._zod.bag;t.patterns??=new Set,t.patterns.add(r)}),e._zod.check=n=>{n.value.includes(t.includes,t.position)||n.issues.push({origin:`string`,code:`invalid_format`,format:`includes`,includes:t.includes,input:n.value,inst:e,continue:!t.abort})}}),mx=K(`$ZodCheckStartsWith`,(e,t)=>{ex.init(e,t);let n=RegExp(`^${Ly(t.prefix)}.*`);t.pattern??=n,e._zod.onattach.push(e=>{let t=e._zod.bag;t.patterns??=new Set,t.patterns.add(n)}),e._zod.check=n=>{n.value.startsWith(t.prefix)||n.issues.push({origin:`string`,code:`invalid_format`,format:`starts_with`,prefix:t.prefix,input:n.value,inst:e,continue:!t.abort})}}),hx=K(`$ZodCheckEndsWith`,(e,t)=>{ex.init(e,t);let n=RegExp(`.*${Ly(t.suffix)}$`);t.pattern??=n,e._zod.onattach.push(e=>{let t=e._zod.bag;t.patterns??=new Set,t.patterns.add(n)}),e._zod.check=n=>{n.value.endsWith(t.suffix)||n.issues.push({origin:`string`,code:`invalid_format`,format:`ends_with`,suffix:t.suffix,input:n.value,inst:e,continue:!t.abort})}}),gx=K(`$ZodCheckOverwrite`,(e,t)=>{ex.init(e,t),e._zod.check=e=>{e.value=t.tx(e.value)}}),_x=class{constructor(e=[]){this.content=[],this.indent=0,this&&(this.args=e)}indented(e){this.indent+=1,e(this),--this.indent}write(e){if(typeof e==`function`){e(this,{execution:`sync`}),e(this,{execution:`async`});return}let t=e.split(`
63
- `).filter(e=>e),n=Math.min(...t.map(e=>e.length-e.trimStart().length)),r=t.map(e=>e.slice(n)).map(e=>` `.repeat(this.indent*2)+e);for(let e of r)this.content.push(e)}compile(){let e=Function,t=this?.args,n=[...(this?.content??[``]).map(e=>` ${e}`)];return new e(...t,n.join(`
64
- `))}},vx={major:4,minor:4,patch:3},yx=K(`$ZodType`,(e,t)=>{var n;e??={},e._zod.def=t,e._zod.bag=e._zod.bag||{},e._zod.version=vx;let r=[...e._zod.def.checks??[]];e._zod.traits.has(`$ZodCheck`)&&r.unshift(e);for(let t of r)for(let n of t._zod.onattach)n(e);if(r.length===0)(n=e._zod).deferred??(n.deferred=[]),e._zod.deferred?.push(()=>{e._zod.run=e._zod.parse});else{let t=(e,t,n)=>{let r=Yy(e),i;for(let a of t){if(a._zod.def.when){if(Xy(e)||!a._zod.def.when(e))continue}else if(r)continue;let t=e.issues.length,o=a._zod.check(e);if(o instanceof Promise&&n?.async===!1)throw new hy;if(i||o instanceof Promise)i=(i??Promise.resolve()).then(async()=>{await o,e.issues.length!==t&&(r||=Yy(e,t))});else{if(e.issues.length===t)continue;r||=Yy(e,t)}}return i?i.then(()=>e):e},n=(n,i,a)=>{if(Yy(n))return n.aborted=!0,n;let o=t(i,r,a);if(o instanceof Promise){if(a.async===!1)throw new hy;return o.then(t=>e._zod.parse(t,a))}return e._zod.parse(o,a)};e._zod.run=(i,a)=>{if(a.skipChecks)return e._zod.parse(i,a);if(a.direction===`backward`){let t=e._zod.parse({value:i.value,issues:[]},{...a,skipChecks:!0});return t instanceof Promise?t.then(e=>n(e,i,a)):n(t,i,a)}let o=e._zod.parse(i,a);if(o instanceof Promise){if(a.async===!1)throw new hy;return o.then(e=>t(e,r,a))}return t(o,r,a)}}Ey(e,`~standard`,()=>({validate:t=>{try{let n=ub(e,t);return n.success?{value:n.data}:{issues:n.error?.issues}}catch{return fb(e,t).then(e=>e.success?{value:e.data}:{issues:e.error?.issues})}},vendor:`zod`,version:1}))}),bx=K(`$ZodString`,(e,t)=>{yx.init(e,t),e._zod.pattern=[...e?._zod.bag?.patterns??[]].pop()??Kb(e._zod.bag),e._zod.parse=(n,r)=>{if(t.coerce)try{n.value=String(n.value)}catch{}return typeof n.value==`string`||n.issues.push({expected:`string`,code:`invalid_type`,input:n.value,inst:e}),n}}),xx=K(`$ZodStringFormat`,(e,t)=>{lx.init(e,t),bx.init(e,t)}),Sx=K(`$ZodGUID`,(e,t)=>{t.pattern??=Ob,xx.init(e,t)}),Cx=K(`$ZodUUID`,(e,t)=>{if(t.version){let e={v1:1,v2:2,v3:3,v4:4,v5:5,v6:6,v7:7,v8:8}[t.version];if(e===void 0)throw Error(`Invalid UUID version: "${t.version}"`);t.pattern??=kb(e)}else t.pattern??=kb();xx.init(e,t)}),wx=K(`$ZodEmail`,(e,t)=>{t.pattern??=Ab,xx.init(e,t)}),Tx=K(`$ZodURL`,(e,t)=>{xx.init(e,t),e._zod.check=n=>{try{let r=n.value.trim();if(!t.normalize&&t.protocol?.source===zb.source&&!/^https?:\/\//i.test(r)){n.issues.push({code:`invalid_format`,format:`url`,note:`Invalid URL format`,input:n.value,inst:e,continue:!t.abort});return}let i=new URL(r);t.hostname&&(t.hostname.lastIndex=0,t.hostname.test(i.hostname)||n.issues.push({code:`invalid_format`,format:`url`,note:`Invalid hostname`,pattern:t.hostname.source,input:n.value,inst:e,continue:!t.abort})),t.protocol&&(t.protocol.lastIndex=0,t.protocol.test(i.protocol.endsWith(`:`)?i.protocol.slice(0,-1):i.protocol)||n.issues.push({code:`invalid_format`,format:`url`,note:`Invalid protocol`,pattern:t.protocol.source,input:n.value,inst:e,continue:!t.abort})),n.value=t.normalize?i.href:r;return}catch{n.issues.push({code:`invalid_format`,format:`url`,input:n.value,inst:e,continue:!t.abort})}}}),Ex=K(`$ZodEmoji`,(e,t)=>{t.pattern??=Mb(),xx.init(e,t)}),Dx=K(`$ZodNanoID`,(e,t)=>{t.pattern??=Eb,xx.init(e,t)}),Ox=K(`$ZodCUID`,(e,t)=>{t.pattern??=xb,xx.init(e,t)}),kx=K(`$ZodCUID2`,(e,t)=>{t.pattern??=Sb,xx.init(e,t)}),Ax=K(`$ZodULID`,(e,t)=>{t.pattern??=Cb,xx.init(e,t)}),jx=K(`$ZodXID`,(e,t)=>{t.pattern??=wb,xx.init(e,t)}),Mx=K(`$ZodKSUID`,(e,t)=>{t.pattern??=Tb,xx.init(e,t)}),Nx=K(`$ZodISODateTime`,(e,t)=>{t.pattern??=Gb(t),xx.init(e,t)}),Px=K(`$ZodISODate`,(e,t)=>{t.pattern??=Hb,xx.init(e,t)}),Fx=K(`$ZodISOTime`,(e,t)=>{t.pattern??=Wb(t),xx.init(e,t)}),Ix=K(`$ZodISODuration`,(e,t)=>{t.pattern??=Db,xx.init(e,t)}),Lx=K(`$ZodIPv4`,(e,t)=>{t.pattern??=Nb,xx.init(e,t),e._zod.bag.format=`ipv4`}),Rx=K(`$ZodIPv6`,(e,t)=>{t.pattern??=Pb,xx.init(e,t),e._zod.bag.format=`ipv6`,e._zod.check=n=>{try{new URL(`http://[${n.value}]`)}catch{n.issues.push({code:`invalid_format`,format:`ipv6`,input:n.value,inst:e,continue:!t.abort})}}}),zx=K(`$ZodCIDRv4`,(e,t)=>{t.pattern??=Fb,xx.init(e,t)}),Bx=K(`$ZodCIDRv6`,(e,t)=>{t.pattern??=Ib,xx.init(e,t),e._zod.check=n=>{let r=n.value.split(`/`);try{if(r.length!==2)throw Error();let[e,t]=r;if(!t)throw Error();let n=Number(t);if(`${n}`!==t||n<0||n>128)throw Error();new URL(`http://[${e}]`)}catch{n.issues.push({code:`invalid_format`,format:`cidrv6`,input:n.value,inst:e,continue:!t.abort})}}});function Vx(e){if(e===``)return!0;if(/\s/.test(e)||e.length%4!=0)return!1;try{return atob(e),!0}catch{return!1}}var Hx=K(`$ZodBase64`,(e,t)=>{t.pattern??=Lb,xx.init(e,t),e._zod.bag.contentEncoding=`base64`,e._zod.check=n=>{Vx(n.value)||n.issues.push({code:`invalid_format`,format:`base64`,input:n.value,inst:e,continue:!t.abort})}});function Ux(e){if(!Rb.test(e))return!1;let t=e.replace(/[-_]/g,e=>e===`-`?`+`:`/`);return Vx(t.padEnd(Math.ceil(t.length/4)*4,`=`))}var Wx=K(`$ZodBase64URL`,(e,t)=>{t.pattern??=Rb,xx.init(e,t),e._zod.bag.contentEncoding=`base64url`,e._zod.check=n=>{Ux(n.value)||n.issues.push({code:`invalid_format`,format:`base64url`,input:n.value,inst:e,continue:!t.abort})}}),Gx=K(`$ZodE164`,(e,t)=>{t.pattern??=Bb,xx.init(e,t)});function Kx(e,t=null){try{let n=e.split(`.`);if(n.length!==3)return!1;let[r]=n;if(!r)return!1;let i=JSON.parse(atob(r));return!(`typ`in i&&i?.typ!==`JWT`||!i.alg||t&&(!(`alg`in i)||i.alg!==t))}catch{return!1}}var qx=K(`$ZodJWT`,(e,t)=>{xx.init(e,t),e._zod.check=n=>{Kx(n.value,t.alg)||n.issues.push({code:`invalid_format`,format:`jwt`,input:n.value,inst:e,continue:!t.abort})}}),Jx=K(`$ZodNumber`,(e,t)=>{yx.init(e,t),e._zod.pattern=e._zod.bag.pattern??Jb,e._zod.parse=(n,r)=>{if(t.coerce)try{n.value=Number(n.value)}catch{}let i=n.value;if(typeof i==`number`&&!Number.isNaN(i)&&Number.isFinite(i))return n;let a=typeof i==`number`?Number.isNaN(i)?`NaN`:Number.isFinite(i)?void 0:`Infinity`:void 0;return n.issues.push({expected:`number`,code:`invalid_type`,input:i,inst:e,...a?{received:a}:{}}),n}}),Yx=K(`$ZodNumberFormat`,(e,t)=>{ax.init(e,t),Jx.init(e,t)}),Xx=K(`$ZodBoolean`,(e,t)=>{yx.init(e,t),e._zod.pattern=Yb,e._zod.parse=(n,r)=>{if(t.coerce)try{n.value=!!n.value}catch{}let i=n.value;return typeof i==`boolean`||n.issues.push({expected:`boolean`,code:`invalid_type`,input:i,inst:e}),n}}),Zx=K(`$ZodUndefined`,(e,t)=>{yx.init(e,t),e._zod.pattern=Zb,e._zod.values=new Set([void 0]),e._zod.parse=(t,n)=>{let r=t.value;return r===void 0||t.issues.push({expected:`undefined`,code:`invalid_type`,input:r,inst:e}),t}}),Qx=K(`$ZodNull`,(e,t)=>{yx.init(e,t),e._zod.pattern=Xb,e._zod.values=new Set([null]),e._zod.parse=(t,n)=>{let r=t.value;return r===null||t.issues.push({expected:`null`,code:`invalid_type`,input:r,inst:e}),t}}),$x=K(`$ZodAny`,(e,t)=>{yx.init(e,t),e._zod.parse=e=>e}),eS=K(`$ZodUnknown`,(e,t)=>{yx.init(e,t),e._zod.parse=e=>e}),tS=K(`$ZodNever`,(e,t)=>{yx.init(e,t),e._zod.parse=(t,n)=>(t.issues.push({expected:`never`,code:`invalid_type`,input:t.value,inst:e}),t)});function nS(e,t,n){e.issues.length&&t.issues.push(...Zy(n,e.issues)),t.value[n]=e.value}var rS=K(`$ZodArray`,(e,t)=>{yx.init(e,t),e._zod.parse=(n,r)=>{let i=n.value;if(!Array.isArray(i))return n.issues.push({expected:`array`,code:`invalid_type`,input:i,inst:e}),n;n.value=Array(i.length);let a=[];for(let e=0;e<i.length;e++){let o=i[e],s=t.element._zod.run({value:o,issues:[]},r);s instanceof Promise?a.push(s.then(t=>nS(t,n,e))):nS(s,n,e)}return a.length?Promise.all(a).then(()=>n):n}});function iS(e,t,n,r,i,a){let o=n in r;if(e.issues.length){if(i&&a&&!o)return;t.issues.push(...Zy(n,e.issues))}if(!o&&!i){e.issues.length||t.issues.push({code:`invalid_type`,expected:`nonoptional`,input:void 0,path:[n]});return}e.value===void 0?o&&(t.value[n]=void 0):t.value[n]=e.value}function aS(e){let t=Object.keys(e.shape);for(let n of t)if(!e.shape?.[n]?._zod?.traits?.has(`$ZodType`))throw Error(`Invalid element at key "${n}": expected a Zod schema`);let n=By(e.shape);return{...e,keys:t,keySet:new Set(t),numKeys:t.length,optionalKeys:new Set(n)}}function oS(e,t,n,r,i,a){let o=[],s=i.keySet,c=i.catchall._zod,l=c.def.type,u=c.optin===`optional`,d=c.optout===`optional`;for(let i in t){if(i===`__proto__`||s.has(i))continue;if(l===`never`){o.push(i);continue}let a=c.run({value:t[i],issues:[]},r);a instanceof Promise?e.push(a.then(e=>iS(e,n,i,t,u,d))):iS(a,n,i,t,u,d)}return o.length&&n.issues.push({code:`unrecognized_keys`,keys:o,input:t,inst:a}),e.length?Promise.all(e).then(()=>n):n}var sS=K(`$ZodObject`,(e,t)=>{if(yx.init(e,t),!Object.getOwnPropertyDescriptor(t,`shape`)?.get){let e=t.shape;Object.defineProperty(t,"shape",{get:()=>{let n={...e};return Object.defineProperty(t,"shape",{value:n}),n}})}let n=xy(()=>aS(t));Ey(e._zod,`propValues`,()=>{let e=t.shape,n={};for(let t in e){let r=e[t]._zod;if(r.values){n[t]??(n[t]=new Set);for(let e of r.values)n[t].add(e)}}return n});let r=My,i=t.catchall,a;e._zod.parse=(t,o)=>{a??=n.value;let s=t.value;if(!r(s))return t.issues.push({expected:`object`,code:`invalid_type`,input:s,inst:e}),t;t.value={};let c=[],l=a.shape;for(let e of a.keys){let n=l[e],r=n._zod.optin===`optional`,i=n._zod.optout===`optional`,a=n._zod.run({value:s[e],issues:[]},o);a instanceof Promise?c.push(a.then(n=>iS(n,t,e,s,r,i))):iS(a,t,e,s,r,i)}return i?oS(c,s,t,o,n.value,e):c.length?Promise.all(c).then(()=>t):t}}),cS=K(`$ZodObjectJIT`,(e,t)=>{sS.init(e,t);let n=e._zod.parse,r=xy(()=>aS(t)),i=e=>{let t=new _x([`shape`,`payload`,`ctx`]),n=r.value,i=e=>{let t=ky(e);return`shape[${t}]._zod.run({ value: input[${t}], issues: [] }, ctx)`};t.write(`const input = payload.value;`);let a=Object.create(null),o=0;for(let e of n.keys)a[e]=`key_${o++}`;t.write(`const newResult = {};`);for(let r of n.keys){let n=a[r],o=ky(r),s=e[r],c=s?._zod?.optin===`optional`,l=s?._zod?.optout===`optional`;t.write(`const ${n} = ${i(r)};`),c&&l?t.write(`
65
- if (${n}.issues.length) {
66
- if (${o} in input) {
67
- payload.issues = payload.issues.concat(${n}.issues.map(iss => ({
68
- ...iss,
69
- path: iss.path ? [${o}, ...iss.path] : [${o}]
70
- })));
71
- }
72
- }
73
-
74
- if (${n}.value === undefined) {
75
- if (${o} in input) {
76
- newResult[${o}] = undefined;
77
- }
78
- } else {
79
- newResult[${o}] = ${n}.value;
80
- }
81
-
82
- `):c?t.write(`
83
- if (${n}.issues.length) {
84
- payload.issues = payload.issues.concat(${n}.issues.map(iss => ({
85
- ...iss,
86
- path: iss.path ? [${o}, ...iss.path] : [${o}]
87
- })));
88
- }
89
-
90
- if (${n}.value === undefined) {
91
- if (${o} in input) {
92
- newResult[${o}] = undefined;
93
- }
94
- } else {
95
- newResult[${o}] = ${n}.value;
96
- }
97
-
98
- `):t.write(`
99
- const ${n}_present = ${o} in input;
100
- if (${n}.issues.length) {
101
- payload.issues = payload.issues.concat(${n}.issues.map(iss => ({
102
- ...iss,
103
- path: iss.path ? [${o}, ...iss.path] : [${o}]
104
- })));
105
- }
106
- if (!${n}_present && !${n}.issues.length) {
107
- payload.issues.push({
108
- code: "invalid_type",
109
- expected: "nonoptional",
110
- input: undefined,
111
- path: [${o}]
112
- });
113
- }
114
-
115
- if (${n}_present) {
116
- if (${n}.value === undefined) {
117
- newResult[${o}] = undefined;
118
- } else {
119
- newResult[${o}] = ${n}.value;
120
- }
121
- }
122
-
123
- `)}t.write(`payload.value = newResult;`),t.write(`return payload;`);let s=t.compile();return(t,n)=>s(e,t,n)},a,o=My,s=!_y.jitless,c=s&&Ny.value,l=t.catchall,u;e._zod.parse=(d,f)=>{u??=r.value;let p=d.value;return o(p)?s&&c&&f?.async===!1&&f.jitless!==!0?(a||=i(t.shape),d=a(d,f),l?oS([],p,d,f,u,e):d):n(d,f):(d.issues.push({expected:`object`,code:`invalid_type`,input:p,inst:e}),d)}});function lS(e,t,n,r){for(let n of e)if(n.issues.length===0)return t.value=n.value,t;let i=e.filter(e=>!Yy(e));return i.length===1?(t.value=i[0].value,i[0]):(t.issues.push({code:`invalid_union`,input:t.value,inst:n,errors:e.map(e=>e.issues.map(e=>$y(e,r,vy())))}),t)}var uS=K(`$ZodUnion`,(e,t)=>{yx.init(e,t),Ey(e._zod,`optin`,()=>t.options.some(e=>e._zod.optin===`optional`)?`optional`:void 0),Ey(e._zod,`optout`,()=>t.options.some(e=>e._zod.optout===`optional`)?`optional`:void 0),Ey(e._zod,`values`,()=>{if(t.options.every(e=>e._zod.values))return new Set(t.options.flatMap(e=>Array.from(e._zod.values)))}),Ey(e._zod,`pattern`,()=>{if(t.options.every(e=>e._zod.pattern)){let e=t.options.map(e=>e._zod.pattern);return RegExp(`^(${e.map(e=>Cy(e.source)).join(`|`)})$`)}});let n=t.options.length===1?t.options[0]._zod.run:null;e._zod.parse=(r,i)=>{if(n)return n(r,i);let a=!1,o=[];for(let e of t.options){let t=e._zod.run({value:r.value,issues:[]},i);if(t instanceof Promise)o.push(t),a=!0;else{if(t.issues.length===0)return t;o.push(t)}}return a?Promise.all(o).then(t=>lS(t,r,e,i)):lS(o,r,e,i)}}),dS=K(`$ZodDiscriminatedUnion`,(e,t)=>{t.inclusive=!1,uS.init(e,t);let n=e._zod.parse;Ey(e._zod,`propValues`,()=>{let e={};for(let n of t.options){let r=n._zod.propValues;if(!r||Object.keys(r).length===0)throw Error(`Invalid discriminated union option at index "${t.options.indexOf(n)}"`);for(let[t,n]of Object.entries(r)){e[t]||(e[t]=new Set);for(let r of n)e[t].add(r)}}return e});let r=xy(()=>{let e=t.options,n=new Map;for(let r of e){let e=r._zod.propValues?.[t.discriminator];if(!e||e.size===0)throw Error(`Invalid discriminated union option at index "${t.options.indexOf(r)}"`);for(let t of e){if(n.has(t))throw Error(`Duplicate discriminator value "${String(t)}"`);n.set(t,r)}}return n});e._zod.parse=(i,a)=>{let o=i.value;if(!My(o))return i.issues.push({code:`invalid_type`,expected:`object`,input:o,inst:e}),i;let s=r.value.get(o?.[t.discriminator]);return s?s._zod.run(i,a):t.unionFallback||a.direction===`backward`?n(i,a):(i.issues.push({code:`invalid_union`,errors:[],note:`No matching discriminator`,discriminator:t.discriminator,options:Array.from(r.value.keys()),input:o,path:[t.discriminator],inst:e}),i)}}),fS=K(`$ZodIntersection`,(e,t)=>{yx.init(e,t),e._zod.parse=(e,n)=>{let r=e.value,i=t.left._zod.run({value:r,issues:[]},n),a=t.right._zod.run({value:r,issues:[]},n);return i instanceof Promise||a instanceof Promise?Promise.all([i,a]).then(([t,n])=>mS(e,t,n)):mS(e,i,a)}});function pS(e,t){if(e===t||e instanceof Date&&t instanceof Date&&+e==+t)return{valid:!0,data:e};if(Py(e)&&Py(t)){let n=Object.keys(t),r=Object.keys(e).filter(e=>n.indexOf(e)!==-1),i={...e,...t};for(let n of r){let r=pS(e[n],t[n]);if(!r.valid)return{valid:!1,mergeErrorPath:[n,...r.mergeErrorPath]};i[n]=r.data}return{valid:!0,data:i}}if(Array.isArray(e)&&Array.isArray(t)){if(e.length!==t.length)return{valid:!1,mergeErrorPath:[]};let n=[];for(let r=0;r<e.length;r++){let i=e[r],a=t[r],o=pS(i,a);if(!o.valid)return{valid:!1,mergeErrorPath:[r,...o.mergeErrorPath]};n.push(o.data)}return{valid:!0,data:n}}return{valid:!1,mergeErrorPath:[]}}function mS(e,t,n){let r=new Map,i;for(let n of t.issues)if(n.code===`unrecognized_keys`){i??=n;for(let e of n.keys)r.has(e)||r.set(e,{}),r.get(e).l=!0}else e.issues.push(n);for(let t of n.issues)if(t.code===`unrecognized_keys`)for(let e of t.keys)r.has(e)||r.set(e,{}),r.get(e).r=!0;else e.issues.push(t);let a=[...r].filter(([,e])=>e.l&&e.r).map(([e])=>e);if(a.length&&i&&e.issues.push({...i,keys:a}),Yy(e))return e;let o=pS(t.value,n.value);if(!o.valid)throw Error(`Unmergable intersection. Error path: ${JSON.stringify(o.mergeErrorPath)}`);return e.value=o.data,e}var hS=K(`$ZodRecord`,(e,t)=>{yx.init(e,t),e._zod.parse=(n,r)=>{let i=n.value;if(!Py(i))return n.issues.push({expected:`record`,code:`invalid_type`,input:i,inst:e}),n;let a=[],o=t.keyType._zod.values;if(o){n.value={};let s=new Set;for(let c of o)if(typeof c==`string`||typeof c==`number`||typeof c==`symbol`){s.add(typeof c==`number`?c.toString():c);let o=t.keyType._zod.run({value:c,issues:[]},r);if(o instanceof Promise)throw Error(`Async schemas not supported in object keys currently`);if(o.issues.length){n.issues.push({code:`invalid_key`,origin:`record`,issues:o.issues.map(e=>$y(e,r,vy())),input:c,path:[c],inst:e});continue}let l=o.value,u=t.valueType._zod.run({value:i[c],issues:[]},r);u instanceof Promise?a.push(u.then(e=>{e.issues.length&&n.issues.push(...Zy(c,e.issues)),n.value[l]=e.value})):(u.issues.length&&n.issues.push(...Zy(c,u.issues)),n.value[l]=u.value)}let c;for(let e in i)s.has(e)||(c??=[],c.push(e));c&&c.length>0&&n.issues.push({code:`unrecognized_keys`,input:i,inst:e,keys:c})}else{n.value={};for(let o of Reflect.ownKeys(i)){if(o===`__proto__`||!Object.prototype.propertyIsEnumerable.call(i,o))continue;let s=t.keyType._zod.run({value:o,issues:[]},r);if(s instanceof Promise)throw Error(`Async schemas not supported in object keys currently`);if(typeof o==`string`&&Jb.test(o)&&s.issues.length){let e=t.keyType._zod.run({value:Number(o),issues:[]},r);if(e instanceof Promise)throw Error(`Async schemas not supported in object keys currently`);e.issues.length===0&&(s=e)}if(s.issues.length){t.mode===`loose`?n.value[o]=i[o]:n.issues.push({code:`invalid_key`,origin:`record`,issues:s.issues.map(e=>$y(e,r,vy())),input:o,path:[o],inst:e});continue}let c=t.valueType._zod.run({value:i[o],issues:[]},r);c instanceof Promise?a.push(c.then(e=>{e.issues.length&&n.issues.push(...Zy(o,e.issues)),n.value[s.value]=e.value})):(c.issues.length&&n.issues.push(...Zy(o,c.issues)),n.value[s.value]=c.value)}}return a.length?Promise.all(a).then(()=>n):n}}),gS=K(`$ZodEnum`,(e,t)=>{yx.init(e,t);let n=yy(t.entries),r=new Set(n);e._zod.values=r,e._zod.pattern=RegExp(`^(${n.filter(e=>Iy.has(typeof e)).map(e=>typeof e==`string`?Ly(e):e.toString()).join(`|`)})$`),e._zod.parse=(t,i)=>{let a=t.value;return r.has(a)||t.issues.push({code:`invalid_value`,values:n,input:a,inst:e}),t}}),_S=K(`$ZodLiteral`,(e,t)=>{if(yx.init(e,t),t.values.length===0)throw Error(`Cannot create literal schema with no valid values`);let n=new Set(t.values);e._zod.values=n,e._zod.pattern=RegExp(`^(${t.values.map(e=>typeof e==`string`?Ly(e):e?Ly(e.toString()):String(e)).join(`|`)})$`),e._zod.parse=(r,i)=>{let a=r.value;return n.has(a)||r.issues.push({code:`invalid_value`,values:t.values,input:a,inst:e}),r}}),vS=K(`$ZodTransform`,(e,t)=>{yx.init(e,t),e._zod.optin=`optional`,e._zod.parse=(n,r)=>{if(r.direction===`backward`)throw new gy(e.constructor.name);let i=t.transform(n.value,n);if(r.async)return(i instanceof Promise?i:Promise.resolve(i)).then(e=>(n.value=e,n.fallback=!0,n));if(i instanceof Promise)throw new hy;return n.value=i,n.fallback=!0,n}});function yS(e,t){return t===void 0&&(e.issues.length||e.fallback)?{issues:[],value:void 0}:e}var bS=K(`$ZodOptional`,(e,t)=>{yx.init(e,t),e._zod.optin=`optional`,e._zod.optout=`optional`,Ey(e._zod,`values`,()=>t.innerType._zod.values?new Set([...t.innerType._zod.values,void 0]):void 0),Ey(e._zod,`pattern`,()=>{let e=t.innerType._zod.pattern;return e?RegExp(`^(${Cy(e.source)})?$`):void 0}),e._zod.parse=(e,n)=>{if(t.innerType._zod.optin===`optional`){let r=e.value,i=t.innerType._zod.run(e,n);return i instanceof Promise?i.then(e=>yS(e,r)):yS(i,r)}return e.value===void 0?e:t.innerType._zod.run(e,n)}}),xS=K(`$ZodExactOptional`,(e,t)=>{bS.init(e,t),Ey(e._zod,`values`,()=>t.innerType._zod.values),Ey(e._zod,`pattern`,()=>t.innerType._zod.pattern),e._zod.parse=(e,n)=>t.innerType._zod.run(e,n)}),SS=K(`$ZodNullable`,(e,t)=>{yx.init(e,t),Ey(e._zod,`optin`,()=>t.innerType._zod.optin),Ey(e._zod,`optout`,()=>t.innerType._zod.optout),Ey(e._zod,`pattern`,()=>{let e=t.innerType._zod.pattern;return e?RegExp(`^(${Cy(e.source)}|null)$`):void 0}),Ey(e._zod,`values`,()=>t.innerType._zod.values?new Set([...t.innerType._zod.values,null]):void 0),e._zod.parse=(e,n)=>e.value===null?e:t.innerType._zod.run(e,n)}),CS=K(`$ZodDefault`,(e,t)=>{yx.init(e,t),e._zod.optin=`optional`,Ey(e._zod,`values`,()=>t.innerType._zod.values),e._zod.parse=(e,n)=>{if(n.direction===`backward`)return t.innerType._zod.run(e,n);if(e.value===void 0)return e.value=t.defaultValue,e;let r=t.innerType._zod.run(e,n);return r instanceof Promise?r.then(e=>wS(e,t)):wS(r,t)}});function wS(e,t){return e.value===void 0&&(e.value=t.defaultValue),e}var TS=K(`$ZodPrefault`,(e,t)=>{yx.init(e,t),e._zod.optin=`optional`,Ey(e._zod,`values`,()=>t.innerType._zod.values),e._zod.parse=(e,n)=>(n.direction===`backward`||e.value===void 0&&(e.value=t.defaultValue),t.innerType._zod.run(e,n))}),ES=K(`$ZodNonOptional`,(e,t)=>{yx.init(e,t),Ey(e._zod,`values`,()=>{let e=t.innerType._zod.values;return e?new Set([...e].filter(e=>e!==void 0)):void 0}),e._zod.parse=(n,r)=>{let i=t.innerType._zod.run(n,r);return i instanceof Promise?i.then(t=>DS(t,e)):DS(i,e)}});function DS(e,t){return!e.issues.length&&e.value===void 0&&e.issues.push({code:`invalid_type`,expected:`nonoptional`,input:e.value,inst:t}),e}var OS=K(`$ZodCatch`,(e,t)=>{yx.init(e,t),e._zod.optin=`optional`,Ey(e._zod,`optout`,()=>t.innerType._zod.optout),Ey(e._zod,`values`,()=>t.innerType._zod.values),e._zod.parse=(e,n)=>{if(n.direction===`backward`)return t.innerType._zod.run(e,n);let r=t.innerType._zod.run(e,n);return r instanceof Promise?r.then(r=>(e.value=r.value,r.issues.length&&(e.value=t.catchValue({...e,error:{issues:r.issues.map(e=>$y(e,n,vy()))},input:e.value}),e.issues=[],e.fallback=!0),e)):(e.value=r.value,r.issues.length&&(e.value=t.catchValue({...e,error:{issues:r.issues.map(e=>$y(e,n,vy()))},input:e.value}),e.issues=[],e.fallback=!0),e)}}),kS=K(`$ZodPipe`,(e,t)=>{yx.init(e,t),Ey(e._zod,`values`,()=>t.in._zod.values),Ey(e._zod,`optin`,()=>t.in._zod.optin),Ey(e._zod,`optout`,()=>t.out._zod.optout),Ey(e._zod,`propValues`,()=>t.in._zod.propValues),e._zod.parse=(e,n)=>{if(n.direction===`backward`){let r=t.out._zod.run(e,n);return r instanceof Promise?r.then(e=>AS(e,t.in,n)):AS(r,t.in,n)}let r=t.in._zod.run(e,n);return r instanceof Promise?r.then(e=>AS(e,t.out,n)):AS(r,t.out,n)}});function AS(e,t,n){return e.issues.length?(e.aborted=!0,e):t._zod.run({value:e.value,issues:e.issues,fallback:e.fallback},n)}var jS=K(`$ZodPreprocess`,(e,t)=>{kS.init(e,t)}),MS=K(`$ZodReadonly`,(e,t)=>{yx.init(e,t),Ey(e._zod,`propValues`,()=>t.innerType._zod.propValues),Ey(e._zod,`values`,()=>t.innerType._zod.values),Ey(e._zod,`optin`,()=>t.innerType?._zod?.optin),Ey(e._zod,`optout`,()=>t.innerType?._zod?.optout),e._zod.parse=(e,n)=>{if(n.direction===`backward`)return t.innerType._zod.run(e,n);let r=t.innerType._zod.run(e,n);return r instanceof Promise?r.then(NS):NS(r)}});function NS(e){return e.value=Object.freeze(e.value),e}var PS=K(`$ZodLazy`,(e,t)=>{yx.init(e,t),Ey(e._zod,`innerType`,()=>{let e=t;return e._cachedInner||=t.getter(),e._cachedInner}),Ey(e._zod,`pattern`,()=>e._zod.innerType?._zod?.pattern),Ey(e._zod,`propValues`,()=>e._zod.innerType?._zod?.propValues),Ey(e._zod,`optin`,()=>e._zod.innerType?._zod?.optin??void 0),Ey(e._zod,`optout`,()=>e._zod.innerType?._zod?.optout??void 0),e._zod.parse=(t,n)=>e._zod.innerType._zod.run(t,n)}),FS=K(`$ZodCustom`,(e,t)=>{ex.init(e,t),yx.init(e,t),e._zod.parse=(e,t)=>e,e._zod.check=n=>{let r=n.value,i=t.fn(r);if(i instanceof Promise)return i.then(t=>IS(t,n,r,e));IS(i,n,r,e)}});function IS(e,t,n,r){if(!e){let e={code:`custom`,input:n,inst:r,path:[...r._zod.def.path??[]],continue:!r._zod.def.abort};r._zod.def.params&&(e.params=r._zod.def.params),t.issues.push(tb(e))}}var LS,RS=class{constructor(){this._map=new WeakMap,this._idmap=new Map}add(e,...t){let n=t[0];return this._map.set(e,n),n&&typeof n==`object`&&`id`in n&&this._idmap.set(n.id,e),this}clear(){return this._map=new WeakMap,this._idmap=new Map,this}remove(e){let t=this._map.get(e);return t&&typeof t==`object`&&`id`in t&&this._idmap.delete(t.id),this._map.delete(e),this}get(e){let t=e._zod.parent;if(t){let n={...this.get(t)??{}};delete n.id;let r={...n,...this._map.get(e)};return Object.keys(r).length?r:void 0}return this._map.get(e)}has(e){return this._map.has(e)}};function zS(){return new RS}(LS=globalThis).__zod_globalRegistry??(LS.__zod_globalRegistry=zS());var BS=globalThis.__zod_globalRegistry;function VS(e,t){return new e({type:`string`,...zy(t)})}function HS(e,t){return new e({type:`string`,format:`email`,check:`string_format`,abort:!1,...zy(t)})}function US(e,t){return new e({type:`string`,format:`guid`,check:`string_format`,abort:!1,...zy(t)})}function WS(e,t){return new e({type:`string`,format:`uuid`,check:`string_format`,abort:!1,...zy(t)})}function GS(e,t){return new e({type:`string`,format:`uuid`,check:`string_format`,abort:!1,version:`v4`,...zy(t)})}function KS(e,t){return new e({type:`string`,format:`uuid`,check:`string_format`,abort:!1,version:`v6`,...zy(t)})}function qS(e,t){return new e({type:`string`,format:`uuid`,check:`string_format`,abort:!1,version:`v7`,...zy(t)})}function JS(e,t){return new e({type:`string`,format:`url`,check:`string_format`,abort:!1,...zy(t)})}function YS(e,t){return new e({type:`string`,format:`emoji`,check:`string_format`,abort:!1,...zy(t)})}function XS(e,t){return new e({type:`string`,format:`nanoid`,check:`string_format`,abort:!1,...zy(t)})}function ZS(e,t){return new e({type:`string`,format:`cuid`,check:`string_format`,abort:!1,...zy(t)})}function QS(e,t){return new e({type:`string`,format:`cuid2`,check:`string_format`,abort:!1,...zy(t)})}function $S(e,t){return new e({type:`string`,format:`ulid`,check:`string_format`,abort:!1,...zy(t)})}function eC(e,t){return new e({type:`string`,format:`xid`,check:`string_format`,abort:!1,...zy(t)})}function tC(e,t){return new e({type:`string`,format:`ksuid`,check:`string_format`,abort:!1,...zy(t)})}function nC(e,t){return new e({type:`string`,format:`ipv4`,check:`string_format`,abort:!1,...zy(t)})}function rC(e,t){return new e({type:`string`,format:`ipv6`,check:`string_format`,abort:!1,...zy(t)})}function iC(e,t){return new e({type:`string`,format:`cidrv4`,check:`string_format`,abort:!1,...zy(t)})}function aC(e,t){return new e({type:`string`,format:`cidrv6`,check:`string_format`,abort:!1,...zy(t)})}function oC(e,t){return new e({type:`string`,format:`base64`,check:`string_format`,abort:!1,...zy(t)})}function sC(e,t){return new e({type:`string`,format:`base64url`,check:`string_format`,abort:!1,...zy(t)})}function cC(e,t){return new e({type:`string`,format:`e164`,check:`string_format`,abort:!1,...zy(t)})}function lC(e,t){return new e({type:`string`,format:`jwt`,check:`string_format`,abort:!1,...zy(t)})}function uC(e,t){return new e({type:`string`,format:`datetime`,check:`string_format`,offset:!1,local:!1,precision:null,...zy(t)})}function dC(e,t){return new e({type:`string`,format:`date`,check:`string_format`,...zy(t)})}function fC(e,t){return new e({type:`string`,format:`time`,check:`string_format`,precision:null,...zy(t)})}function pC(e,t){return new e({type:`string`,format:`duration`,check:`string_format`,...zy(t)})}function mC(e,t){return new e({type:`number`,checks:[],...zy(t)})}function hC(e,t){return new e({type:`number`,coerce:!0,checks:[],...zy(t)})}function gC(e,t){return new e({type:`number`,check:`number_format`,abort:!1,format:`safeint`,...zy(t)})}function _C(e,t){return new e({type:`boolean`,...zy(t)})}function vC(e,t){return new e({type:`undefined`,...zy(t)})}function yC(e,t){return new e({type:`null`,...zy(t)})}function bC(e){return new e({type:`any`})}function xC(e){return new e({type:`unknown`})}function SC(e,t){return new e({type:`never`,...zy(t)})}function CC(e,t){return new nx({check:`less_than`,...zy(t),value:e,inclusive:!1})}function wC(e,t){return new nx({check:`less_than`,...zy(t),value:e,inclusive:!0})}function TC(e,t){return new rx({check:`greater_than`,...zy(t),value:e,inclusive:!1})}function EC(e,t){return new rx({check:`greater_than`,...zy(t),value:e,inclusive:!0})}function DC(e,t){return new ix({check:`multiple_of`,...zy(t),value:e})}function OC(e,t){return new ox({check:`max_length`,...zy(t),maximum:e})}function kC(e,t){return new sx({check:`min_length`,...zy(t),minimum:e})}function AC(e,t){return new cx({check:`length_equals`,...zy(t),length:e})}function jC(e,t){return new ux({check:`string_format`,format:`regex`,...zy(t),pattern:e})}function MC(e){return new dx({check:`string_format`,format:`lowercase`,...zy(e)})}function qee(e){return new fx({check:`string_format`,format:`uppercase`,...zy(e)})}function Jee(e,t){return new px({check:`string_format`,format:`includes`,...zy(t),includes:e})}function Yee(e,t){return new mx({check:`string_format`,format:`starts_with`,...zy(t),prefix:e})}function Xee(e,t){return new hx({check:`string_format`,format:`ends_with`,...zy(t),suffix:e})}function NC(e){return new gx({check:`overwrite`,tx:e})}function Zee(e){return NC(t=>t.normalize(e))}function Qee(){return NC(e=>e.trim())}function $ee(){return NC(e=>e.toLowerCase())}function ete(){return NC(e=>e.toUpperCase())}function tte(){return NC(e=>Ay(e))}function nte(e,t,n){return new e({type:`array`,element:t,...zy(n)})}function rte(e,t,n){let r=zy(n);return r.abort??=!0,new e({type:`custom`,check:`custom`,fn:t,...r})}function ite(e,t,n){return new e({type:`custom`,check:`custom`,fn:t,...zy(n)})}function ate(e,t){let n=ote(t=>(t.addIssue=e=>{if(typeof e==`string`)t.issues.push(tb(e,t.value,n._zod.def));else{let r=e;r.fatal&&(r.continue=!1),r.code??=`custom`,r.input??=t.value,r.inst??=n,r.continue??=!n._zod.def.abort,t.issues.push(tb(r))}},e(t.value,t)),t);return n}function ote(e,t){let n=new ex({check:`custom`,...zy(t)});return n._zod.check=e,n}function PC(e){let t=e?.target??`draft-2020-12`;return t===`draft-4`&&(t=`draft-04`),t===`draft-7`&&(t=`draft-07`),{processors:e.processors??{},metadataRegistry:e?.metadata??BS,target:t,unrepresentable:e?.unrepresentable??`throw`,override:e?.override??(()=>{}),io:e?.io??`output`,counter:0,seen:new Map,cycles:e?.cycles??`ref`,reused:e?.reused??`inline`,external:e?.external??void 0}}function FC(e,t,n={path:[],schemaPath:[]}){var r;let i=e._zod.def,a=t.seen.get(e);if(a)return a.count++,n.schemaPath.includes(e)&&(a.cycle=n.path),a.schema;let o={schema:{},count:1,cycle:void 0,path:n.path};t.seen.set(e,o);let s=e._zod.toJSONSchema?.();if(s)o.schema=s;else{let r={...n,schemaPath:[...n.schemaPath,e],path:n.path};if(e._zod.processJSONSchema)e._zod.processJSONSchema(t,o.schema,r);else{let n=o.schema,a=t.processors[i.type];if(!a)throw Error(`[toJSONSchema]: Non-representable type encountered: ${i.type}`);a(e,t,n,r)}let a=e._zod.parent;a&&(o.ref||=a,FC(a,t,r),t.seen.get(a).isParent=!0)}let c=t.metadataRegistry.get(e);return c&&Object.assign(o.schema,c),t.io===`input`&&RC(e)&&(delete o.schema.examples,delete o.schema.default),t.io===`input`&&`_prefault`in o.schema&&((r=o.schema).default??(r.default=o.schema._prefault)),delete o.schema._prefault,t.seen.get(e).schema}function IC(e,t){let n=e.seen.get(t);if(!n)throw Error(`Unprocessed schema. This is a bug in Zod.`);let r=new Map;for(let t of e.seen.entries()){let n=e.metadataRegistry.get(t[0])?.id;if(n){let e=r.get(n);if(e&&e!==t[0])throw Error(`Duplicate schema id "${n}" detected during JSON Schema conversion. Two different schemas cannot share the same id when converted together.`);r.set(n,t[0])}}let i=t=>{let r=e.target===`draft-2020-12`?`$defs`:`definitions`;if(e.external){let n=e.external.registry.get(t[0])?.id,i=e.external.uri??(e=>e);if(n)return{ref:i(n)};let a=t[1].defId??t[1].schema.id??`schema${e.counter++}`;return t[1].defId=a,{defId:a,ref:`${i(`__shared`)}#/${r}/${a}`}}if(t[1]===n)return{ref:`#`};let i=`#/${r}/`,a=t[1].schema.id??`__schema${e.counter++}`;return{defId:a,ref:i+a}},a=e=>{if(e[1].schema.$ref)return;let t=e[1],{ref:n,defId:r}=i(e);t.def={...t.schema},r&&(t.defId=r);let a=t.schema;for(let e in a)delete a[e];a.$ref=n};if(e.cycles===`throw`)for(let t of e.seen.entries()){let e=t[1];if(e.cycle)throw Error(`Cycle detected: #/${e.cycle?.join(`/`)}/<root>
124
-
125
- Set the \`cycles\` parameter to \`"ref"\` to resolve cyclical schemas with defs.`)}for(let n of e.seen.entries()){let r=n[1];if(t===n[0]){a(n);continue}if(e.external){let r=e.external.registry.get(n[0])?.id;if(t!==n[0]&&r){a(n);continue}}if(e.metadataRegistry.get(n[0])?.id){a(n);continue}if(r.cycle){a(n);continue}if(r.count>1&&e.reused===`ref`){a(n);continue}}}function LC(e,t){let n=e.seen.get(t);if(!n)throw Error(`Unprocessed schema. This is a bug in Zod.`);let r=t=>{let n=e.seen.get(t);if(n.ref===null)return;let i=n.def??n.schema,a={...i},o=n.ref;if(n.ref=null,o){r(o);let n=e.seen.get(o),s=n.schema;if(s.$ref&&(e.target===`draft-07`||e.target===`draft-04`||e.target===`openapi-3.0`)?(i.allOf=i.allOf??[],i.allOf.push(s)):Object.assign(i,s),Object.assign(i,a),t._zod.parent===o)for(let e in i)e!==`$ref`&&e!==`allOf`&&(e in a||delete i[e]);if(s.$ref&&n.def)for(let e in i)e!==`$ref`&&e!==`allOf`&&e in n.def&&JSON.stringify(i[e])===JSON.stringify(n.def[e])&&delete i[e]}let s=t._zod.parent;if(s&&s!==o){r(s);let t=e.seen.get(s);if(t?.schema.$ref&&(i.$ref=t.schema.$ref,t.def))for(let e in i)e!==`$ref`&&e!==`allOf`&&e in t.def&&JSON.stringify(i[e])===JSON.stringify(t.def[e])&&delete i[e]}e.override({zodSchema:t,jsonSchema:i,path:n.path??[]})};for(let t of[...e.seen.entries()].reverse())r(t[0]);let i={};if(e.target===`draft-2020-12`?i.$schema=`https://json-schema.org/draft/2020-12/schema`:e.target===`draft-07`?i.$schema=`http://json-schema.org/draft-07/schema#`:e.target===`draft-04`?i.$schema=`http://json-schema.org/draft-04/schema#`:e.target,e.external?.uri){let n=e.external.registry.get(t)?.id;if(!n)throw Error("Schema is missing an `id` property");i.$id=e.external.uri(n)}Object.assign(i,n.def??n.schema);let a=e.metadataRegistry.get(t)?.id;a!==void 0&&i.id===a&&delete i.id;let o=e.external?.defs??{};for(let t of e.seen.entries()){let e=t[1];e.def&&e.defId&&(e.def.id===e.defId&&delete e.def.id,o[e.defId]=e.def)}e.external||Object.keys(o).length>0&&(e.target===`draft-2020-12`?i.$defs=o:i.definitions=o);try{let n=JSON.parse(JSON.stringify(i));return Object.defineProperty(n,"~standard",{value:{...t[`~standard`],jsonSchema:{input:zC(t,`input`,e.processors),output:zC(t,`output`,e.processors)}},enumerable:!1,writable:!1}),n}catch{throw Error(`Error converting schema to JSON.`)}}function RC(e,t){let n=t??{seen:new Set};if(n.seen.has(e))return!1;n.seen.add(e);let r=e._zod.def;if(r.type===`transform`)return!0;if(r.type===`array`)return RC(r.element,n);if(r.type===`set`)return RC(r.valueType,n);if(r.type===`lazy`)return RC(r.getter(),n);if(r.type===`promise`||r.type===`optional`||r.type===`nonoptional`||r.type===`nullable`||r.type===`readonly`||r.type==="default"||r.type===`prefault`)return RC(r.innerType,n);if(r.type===`intersection`)return RC(r.left,n)||RC(r.right,n);if(r.type===`record`||r.type===`map`)return RC(r.keyType,n)||RC(r.valueType,n);if(r.type===`pipe`)return e._zod.traits.has(`$ZodCodec`)?!0:RC(r.in,n)||RC(r.out,n);if(r.type===`object`){for(let e in r.shape)if(RC(r.shape[e],n))return!0;return!1}if(r.type===`union`){for(let e of r.options)if(RC(e,n))return!0;return!1}if(r.type===`tuple`){for(let e of r.items)if(RC(e,n))return!0;return!!(r.rest&&RC(r.rest,n))}return!1}var ste=(e,t={})=>n=>{let r=PC({...n,processors:t});return FC(e,r),IC(r,e),LC(r,e)},zC=(e,t,n={})=>r=>{let{libraryOptions:i,target:a}=r??{},o=PC({...i??{},target:a,io:t,processors:n});return FC(e,o),IC(o,e),LC(o,e)},cte={guid:`uuid`,url:`uri`,datetime:`date-time`,json_string:`json-string`,regex:``},BC=(e,t,n,r)=>{let i=n;i.type=`string`;let{minimum:a,maximum:o,format:s,patterns:c,contentEncoding:l}=e._zod.bag;if(typeof a==`number`&&(i.minLength=a),typeof o==`number`&&(i.maxLength=o),s&&(i.format=cte[s]??s,i.format===``&&delete i.format,s===`time`&&delete i.format),l&&(i.contentEncoding=l),c&&c.size>0){let e=[...c];e.length===1?i.pattern=e[0].source:e.length>1&&(i.allOf=[...e.map(e=>({...t.target===`draft-07`||t.target===`draft-04`||t.target===`openapi-3.0`?{type:`string`}:{},pattern:e.source}))])}},VC=(e,t,n,r)=>{let i=n,{minimum:a,maximum:o,format:s,multipleOf:c,exclusiveMaximum:l,exclusiveMinimum:u}=e._zod.bag;i.type=typeof s==`string`&&s.includes(`int`)?`integer`:`number`;let d=typeof u==`number`&&u>=(a??-1/0),f=typeof l==`number`&&l<=(o??1/0),p=t.target===`draft-04`||t.target===`openapi-3.0`;d?p?(i.minimum=u,i.exclusiveMinimum=!0):i.exclusiveMinimum=u:typeof a==`number`&&(i.minimum=a),f?p?(i.maximum=l,i.exclusiveMaximum=!0):i.exclusiveMaximum=l:typeof o==`number`&&(i.maximum=o),typeof c==`number`&&(i.multipleOf=c)},HC=(e,t,n,r)=>{n.type=`boolean`},lte=(e,t,n,r)=>{if(t.unrepresentable===`throw`)throw Error(`BigInt cannot be represented in JSON Schema`)},ute=(e,t,n,r)=>{if(t.unrepresentable===`throw`)throw Error(`Symbols cannot be represented in JSON Schema`)},UC=(e,t,n,r)=>{t.target===`openapi-3.0`?(n.type=`string`,n.nullable=!0,n.enum=[null]):n.type=`null`},WC=(e,t,n,r)=>{if(t.unrepresentable===`throw`)throw Error(`Undefined cannot be represented in JSON Schema`)},dte=(e,t,n,r)=>{if(t.unrepresentable===`throw`)throw Error(`Void cannot be represented in JSON Schema`)},GC=(e,t,n,r)=>{n.not={}},fte=(e,t,n,r)=>{},pte=(e,t,n,r)=>{},mte=(e,t,n,r)=>{if(t.unrepresentable===`throw`)throw Error(`Date cannot be represented in JSON Schema`)},KC=(e,t,n,r)=>{let i=e._zod.def,a=yy(i.entries);a.every(e=>typeof e==`number`)&&(n.type=`number`),a.every(e=>typeof e==`string`)&&(n.type=`string`),n.enum=a},qC=(e,t,n,r)=>{let i=e._zod.def,a=[];for(let e of i.values)if(e===void 0){if(t.unrepresentable===`throw`)throw Error("Literal `undefined` cannot be represented in JSON Schema")}else if(typeof e==`bigint`){if(t.unrepresentable===`throw`)throw Error(`BigInt literals cannot be represented in JSON Schema`);a.push(Number(e))}else a.push(e);if(a.length!==0)if(a.length===1){let e=a[0];n.type=e===null?`null`:typeof e,t.target===`draft-04`||t.target===`openapi-3.0`?n.enum=[e]:n.const=e}else a.every(e=>typeof e==`number`)&&(n.type=`number`),a.every(e=>typeof e==`string`)&&(n.type=`string`),a.every(e=>typeof e==`boolean`)&&(n.type=`boolean`),a.every(e=>e===null)&&(n.type=`null`),n.enum=a},hte=(e,t,n,r)=>{if(t.unrepresentable===`throw`)throw Error(`NaN cannot be represented in JSON Schema`)},gte=(e,t,n,r)=>{let i=n,a=e._zod.pattern;if(!a)throw Error(`Pattern not found in template literal`);i.type=`string`,i.pattern=a.source},_te=(e,t,n,r)=>{let i=n,a={type:`string`,format:`binary`,contentEncoding:`binary`},{minimum:o,maximum:s,mime:c}=e._zod.bag;o!==void 0&&(a.minLength=o),s!==void 0&&(a.maxLength=s),c?c.length===1?(a.contentMediaType=c[0],Object.assign(i,a)):(Object.assign(i,a),i.anyOf=c.map(e=>({contentMediaType:e}))):Object.assign(i,a)},vte=(e,t,n,r)=>{n.type=`boolean`},JC=(e,t,n,r)=>{if(t.unrepresentable===`throw`)throw Error(`Custom types cannot be represented in JSON Schema`)},yte=(e,t,n,r)=>{if(t.unrepresentable===`throw`)throw Error(`Function types cannot be represented in JSON Schema`)},YC=(e,t,n,r)=>{if(t.unrepresentable===`throw`)throw Error(`Transforms cannot be represented in JSON Schema`)},bte=(e,t,n,r)=>{if(t.unrepresentable===`throw`)throw Error(`Map cannot be represented in JSON Schema`)},xte=(e,t,n,r)=>{if(t.unrepresentable===`throw`)throw Error(`Set cannot be represented in JSON Schema`)},XC=(e,t,n,r)=>{let i=n,a=e._zod.def,{minimum:o,maximum:s}=e._zod.bag;typeof o==`number`&&(i.minItems=o),typeof s==`number`&&(i.maxItems=s),i.type=`array`,i.items=FC(a.element,t,{...r,path:[...r.path,`items`]})},ZC=(e,t,n,r)=>{let i=n,a=e._zod.def;i.type=`object`,i.properties={};let o=a.shape;for(let e in o)i.properties[e]=FC(o[e],t,{...r,path:[...r.path,`properties`,e]});let s=new Set(Object.keys(o)),c=new Set([...s].filter(e=>{let n=a.shape[e]._zod;return t.io===`input`?n.optin===void 0:n.optout===void 0}));c.size>0&&(i.required=Array.from(c)),a.catchall?._zod.def.type===`never`?i.additionalProperties=!1:a.catchall?a.catchall&&(i.additionalProperties=FC(a.catchall,t,{...r,path:[...r.path,`additionalProperties`]})):t.io===`output`&&(i.additionalProperties=!1)},QC=(e,t,n,r)=>{let i=e._zod.def,a=i.inclusive===!1,o=i.options.map((e,n)=>FC(e,t,{...r,path:[...r.path,a?`oneOf`:`anyOf`,n]}));a?n.oneOf=o:n.anyOf=o},$C=(e,t,n,r)=>{let i=e._zod.def,a=FC(i.left,t,{...r,path:[...r.path,`allOf`,0]}),o=FC(i.right,t,{...r,path:[...r.path,`allOf`,1]}),s=e=>`allOf`in e&&Object.keys(e).length===1;n.allOf=[...s(a)?a.allOf:[a],...s(o)?o.allOf:[o]]},Ste=(e,t,n,r)=>{let i=n,a=e._zod.def;i.type=`array`;let o=t.target===`draft-2020-12`?`prefixItems`:`items`,s=t.target===`draft-2020-12`||t.target===`openapi-3.0`?`items`:`additionalItems`,c=a.items.map((e,n)=>FC(e,t,{...r,path:[...r.path,o,n]})),l=a.rest?FC(a.rest,t,{...r,path:[...r.path,s,...t.target===`openapi-3.0`?[a.items.length]:[]]}):null;t.target===`draft-2020-12`?(i.prefixItems=c,l&&(i.items=l)):t.target===`openapi-3.0`?(i.items={anyOf:c},l&&i.items.anyOf.push(l),i.minItems=c.length,l||(i.maxItems=c.length)):(i.items=c,l&&(i.additionalItems=l));let{minimum:u,maximum:d}=e._zod.bag;typeof u==`number`&&(i.minItems=u),typeof d==`number`&&(i.maxItems=d)},ew=(e,t,n,r)=>{let i=n,a=e._zod.def;i.type=`object`;let o=a.keyType,s=o._zod.bag?.patterns;if(a.mode===`loose`&&s&&s.size>0){let e=FC(a.valueType,t,{...r,path:[...r.path,`patternProperties`,`*`]});i.patternProperties={};for(let t of s)i.patternProperties[t.source]=e}else(t.target===`draft-07`||t.target===`draft-2020-12`)&&(i.propertyNames=FC(a.keyType,t,{...r,path:[...r.path,`propertyNames`]})),i.additionalProperties=FC(a.valueType,t,{...r,path:[...r.path,`additionalProperties`]});let c=o._zod.values;if(c){let e=[...c].filter(e=>typeof e==`string`||typeof e==`number`);e.length>0&&(i.required=e)}},tw=(e,t,n,r)=>{let i=e._zod.def,a=FC(i.innerType,t,r),o=t.seen.get(e);t.target===`openapi-3.0`?(o.ref=i.innerType,n.nullable=!0):n.anyOf=[a,{type:`null`}]},nw=(e,t,n,r)=>{let i=e._zod.def;FC(i.innerType,t,r);let a=t.seen.get(e);a.ref=i.innerType},rw=(e,t,n,r)=>{let i=e._zod.def;FC(i.innerType,t,r);let a=t.seen.get(e);a.ref=i.innerType,n.default=JSON.parse(JSON.stringify(i.defaultValue))},iw=(e,t,n,r)=>{let i=e._zod.def;FC(i.innerType,t,r);let a=t.seen.get(e);a.ref=i.innerType,t.io===`input`&&(n._prefault=JSON.parse(JSON.stringify(i.defaultValue)))},aw=(e,t,n,r)=>{let i=e._zod.def;FC(i.innerType,t,r);let a=t.seen.get(e);a.ref=i.innerType;let o;try{o=i.catchValue(void 0)}catch{throw Error(`Dynamic catch values are not supported in JSON Schema`)}n.default=o},ow=(e,t,n,r)=>{let i=e._zod.def,a=i.in._zod.traits.has(`$ZodTransform`),o=t.io===`input`?a?i.out:i.in:i.out;FC(o,t,r);let s=t.seen.get(e);s.ref=o},sw=(e,t,n,r)=>{let i=e._zod.def;FC(i.innerType,t,r);let a=t.seen.get(e);a.ref=i.innerType,n.readOnly=!0},Cte=(e,t,n,r)=>{let i=e._zod.def;FC(i.innerType,t,r);let a=t.seen.get(e);a.ref=i.innerType},cw=(e,t,n,r)=>{let i=e._zod.def;FC(i.innerType,t,r);let a=t.seen.get(e);a.ref=i.innerType},lw=(e,t,n,r)=>{let i=e._zod.innerType;FC(i,t,r);let a=t.seen.get(e);a.ref=i},uw={string:BC,number:VC,boolean:HC,bigint:lte,symbol:ute,null:UC,undefined:WC,void:dte,never:GC,any:fte,unknown:pte,date:mte,enum:KC,literal:qC,nan:hte,template_literal:gte,file:_te,success:vte,custom:JC,function:yte,transform:YC,map:bte,set:xte,array:XC,object:ZC,union:QC,intersection:$C,tuple:Ste,record:ew,nullable:tw,nonoptional:nw,default:rw,prefault:iw,catch:aw,pipe:ow,readonly:sw,promise:Cte,optional:cw,lazy:lw};function dw(e,t){if(`_idmap`in e){let n=e,r=PC({...t,processors:uw}),i={};for(let e of n._idmap.entries()){let[t,n]=e;FC(n,r)}let a={};r.external={registry:n,uri:t?.uri,defs:i};for(let e of n._idmap.entries()){let[t,n]=e;IC(r,n),a[t]=LC(r,n)}return Object.keys(i).length>0&&(a.__shared={[r.target===`draft-2020-12`?`$defs`:`definitions`]:i}),{schemas:a}}let n=PC({...t,processors:uw});return FC(e,n),IC(n,e),LC(n,e)}var wte=K(`ZodISODateTime`,(e,t)=>{Nx.init(e,t),Sw.init(e,t)});function fw(e){return uC(wte,e)}var Tte=K(`ZodISODate`,(e,t)=>{Px.init(e,t),Sw.init(e,t)});function pw(e){return dC(Tte,e)}var Ete=K(`ZodISOTime`,(e,t)=>{Fx.init(e,t),Sw.init(e,t)});function Dte(e){return fC(Ete,e)}var Ote=K(`ZodISODuration`,(e,t)=>{Ix.init(e,t),Sw.init(e,t)});function kte(e){return pC(Ote,e)}var mw=(e,t)=>{rb.init(e,t),e.name=`ZodError`,Object.defineProperties(e,{format:{value:t=>ob(e,t)},flatten:{value:t=>ab(e,t)},addIssue:{value:t=>{e.issues.push(t),e.message=JSON.stringify(e.issues,by,2)}},addIssues:{value:t=>{e.issues.push(...t),e.message=JSON.stringify(e.issues,by,2)}},isEmpty:{get(){return e.issues.length===0}}})},hw=K(`ZodError`,mw),gw=K(`ZodError`,mw,{Parent:Error}),Ate=sb(gw),jte=cb(gw),_w=lb(gw),Mte=db(gw),Nte=pb(gw),Pte=mb(gw),Fte=hb(gw),Ite=gb(gw),Lte=_b(gw),Rte=vb(gw),zte=yb(gw),Bte=bb(gw),vw=new WeakMap;function yw(e,t,n){let r=Object.getPrototypeOf(e),i=vw.get(r);if(i||(i=new Set,vw.set(r,i)),!i.has(t)){i.add(t);for(let e in n){let t=n[e];Object.defineProperty(r,e,{configurable:!0,enumerable:!1,get(){let n=t.bind(this);return Object.defineProperty(this,e,{configurable:!0,writable:!0,enumerable:!0,value:n}),n},set(t){Object.defineProperty(this,e,{configurable:!0,writable:!0,enumerable:!0,value:t})}})}}}var bw=K(`ZodType`,(e,t)=>(yx.init(e,t),Object.assign(e[`~standard`],{jsonSchema:{input:zC(e,`input`),output:zC(e,`output`)}}),e.toJSONSchema=ste(e,{}),e.def=t,e.type=t.type,Object.defineProperty(e,"_def",{value:t}),e.parse=(t,n)=>Ate(e,t,n,{callee:e.parse}),e.safeParse=(t,n)=>_w(e,t,n),e.parseAsync=async(t,n)=>jte(e,t,n,{callee:e.parseAsync}),e.safeParseAsync=async(t,n)=>Mte(e,t,n),e.spa=e.safeParseAsync,e.encode=(t,n)=>Nte(e,t,n),e.decode=(t,n)=>Pte(e,t,n),e.encodeAsync=async(t,n)=>Fte(e,t,n),e.decodeAsync=async(t,n)=>Ite(e,t,n),e.safeEncode=(t,n)=>Lte(e,t,n),e.safeDecode=(t,n)=>Rte(e,t,n),e.safeEncodeAsync=async(t,n)=>zte(e,t,n),e.safeDecodeAsync=async(t,n)=>Bte(e,t,n),yw(e,`ZodType`,{check(...e){let t=this.def;return this.clone(Oy(t,{checks:[...t.checks??[],...e.map(e=>typeof e==`function`?{_zod:{check:e,def:{check:`custom`},onattach:[]}}:e)]}),{parent:!0})},with(...e){return this.check(...e)},clone(e,t){return Ry(this,e,t)},brand(){return this},register(e,t){return e.add(this,t),this},refine(e,t){return this.check(dne(e,t))},superRefine(e,t){return this.check(fne(e,t))},overwrite(e){return this.check(NC(e))},optional(){return iT(this)},exactOptional(){return oT(this)},nullable(){return cT(this)},nullish(){return iT(cT(this))},nonoptional(e){return mT(this,e)},array(){return Y(this)},or(e){return Z([this,e])},and(e){return Xw(this,e)},transform(e){return gT(this,nT(e))},default(e){return uT(this,e)},prefault(e){return fT(this,e)},catch(e){return ane(this,e)},pipe(e){return gT(this,e)},readonly(){return cne(this)},describe(e){let t=this.clone();return BS.add(t,{description:e}),t},meta(...e){if(e.length===0)return BS.get(this);let t=this.clone();return BS.add(t,e[0]),t},isOptional(){return this.safeParse(void 0).success},isNullable(){return this.safeParse(null).success},apply(e){return e(this)}}),Object.defineProperty(e,"description",{get(){return BS.get(e)?.description},configurable:!0}),e)),xw=K(`_ZodString`,(e,t)=>{bx.init(e,t),bw.init(e,t),e._zod.processJSONSchema=(t,n,r)=>BC(e,t,n,r);let n=e._zod.bag;e.format=n.format??null,e.minLength=n.minimum??null,e.maxLength=n.maximum??null,yw(e,`_ZodString`,{regex(...e){return this.check(jC(...e))},includes(...e){return this.check(Jee(...e))},startsWith(...e){return this.check(Yee(...e))},endsWith(...e){return this.check(Xee(...e))},min(...e){return this.check(kC(...e))},max(...e){return this.check(OC(...e))},length(...e){return this.check(AC(...e))},nonempty(...e){return this.check(kC(1,...e))},lowercase(e){return this.check(MC(e))},uppercase(e){return this.check(qee(e))},trim(){return this.check(Qee())},normalize(...e){return this.check(Zee(...e))},toLowerCase(){return this.check($ee())},toUpperCase(){return this.check(ete())},slugify(){return this.check(tte())}})}),Vte=K(`ZodString`,(e,t)=>{bx.init(e,t),xw.init(e,t),e.email=t=>e.check(HS(Cw,t)),e.url=t=>e.check(JS(Ew,t)),e.jwt=t=>e.check(lC(kw,t)),e.emoji=t=>e.check(YS(Ute,t)),e.guid=t=>e.check(US(ww,t)),e.uuid=t=>e.check(WS(Tw,t)),e.uuidv4=t=>e.check(GS(Tw,t)),e.uuidv6=t=>e.check(KS(Tw,t)),e.uuidv7=t=>e.check(qS(Tw,t)),e.nanoid=t=>e.check(XS(Wte,t)),e.guid=t=>e.check(US(ww,t)),e.cuid=t=>e.check(ZS(Gte,t)),e.cuid2=t=>e.check(QS(Kte,t)),e.ulid=t=>e.check($S(qte,t)),e.base64=t=>e.check(oC(ene,t)),e.base64url=t=>e.check(sC(tne,t)),e.xid=t=>e.check(eC(Jte,t)),e.ksuid=t=>e.check(tC(Yte,t)),e.ipv4=t=>e.check(nC(Xte,t)),e.ipv6=t=>e.check(rC(Zte,t)),e.cidrv4=t=>e.check(iC(Qte,t)),e.cidrv6=t=>e.check(aC($te,t)),e.e164=t=>e.check(cC(Ow,t)),e.datetime=t=>e.check(fw(t)),e.date=t=>e.check(pw(t)),e.time=t=>e.check(Dte(t)),e.duration=t=>e.check(kte(t))});function q(e){return VS(Vte,e)}var Sw=K(`ZodStringFormat`,(e,t)=>{xx.init(e,t),xw.init(e,t)}),Cw=K(`ZodEmail`,(e,t)=>{wx.init(e,t),Sw.init(e,t)});function Hte(e){return HS(Cw,e)}var ww=K(`ZodGUID`,(e,t)=>{Sx.init(e,t),Sw.init(e,t)}),Tw=K(`ZodUUID`,(e,t)=>{Cx.init(e,t),Sw.init(e,t)}),Ew=K(`ZodURL`,(e,t)=>{Tx.init(e,t),Sw.init(e,t)});function Dw(e){return JS(Ew,e)}var Ute=K(`ZodEmoji`,(e,t)=>{Ex.init(e,t),Sw.init(e,t)}),Wte=K(`ZodNanoID`,(e,t)=>{Dx.init(e,t),Sw.init(e,t)}),Gte=K(`ZodCUID`,(e,t)=>{Ox.init(e,t),Sw.init(e,t)}),Kte=K(`ZodCUID2`,(e,t)=>{kx.init(e,t),Sw.init(e,t)}),qte=K(`ZodULID`,(e,t)=>{Ax.init(e,t),Sw.init(e,t)}),Jte=K(`ZodXID`,(e,t)=>{jx.init(e,t),Sw.init(e,t)}),Yte=K(`ZodKSUID`,(e,t)=>{Mx.init(e,t),Sw.init(e,t)}),Xte=K(`ZodIPv4`,(e,t)=>{Lx.init(e,t),Sw.init(e,t)}),Zte=K(`ZodIPv6`,(e,t)=>{Rx.init(e,t),Sw.init(e,t)}),Qte=K(`ZodCIDRv4`,(e,t)=>{zx.init(e,t),Sw.init(e,t)}),$te=K(`ZodCIDRv6`,(e,t)=>{Bx.init(e,t),Sw.init(e,t)}),ene=K(`ZodBase64`,(e,t)=>{Hx.init(e,t),Sw.init(e,t)}),tne=K(`ZodBase64URL`,(e,t)=>{Wx.init(e,t),Sw.init(e,t)}),Ow=K(`ZodE164`,(e,t)=>{Gx.init(e,t),Sw.init(e,t)}),kw=K(`ZodJWT`,(e,t)=>{qx.init(e,t),Sw.init(e,t)}),Aw=K(`ZodNumber`,(e,t)=>{Jx.init(e,t),bw.init(e,t),e._zod.processJSONSchema=(t,n,r)=>VC(e,t,n,r),yw(e,`ZodNumber`,{gt(e,t){return this.check(TC(e,t))},gte(e,t){return this.check(EC(e,t))},min(e,t){return this.check(EC(e,t))},lt(e,t){return this.check(CC(e,t))},lte(e,t){return this.check(wC(e,t))},max(e,t){return this.check(wC(e,t))},int(e){return this.check(Mw(e))},safe(e){return this.check(Mw(e))},positive(e){return this.check(TC(0,e))},nonnegative(e){return this.check(EC(0,e))},negative(e){return this.check(CC(0,e))},nonpositive(e){return this.check(wC(0,e))},multipleOf(e,t){return this.check(DC(e,t))},step(e,t){return this.check(DC(e,t))},finite(){return this}});let n=e._zod.bag;e.minValue=Math.max(n.minimum??-1/0,n.exclusiveMinimum??-1/0)??null,e.maxValue=Math.min(n.maximum??1/0,n.exclusiveMaximum??1/0)??null,e.isInt=(n.format??``).includes(`int`)||Number.isSafeInteger(n.multipleOf??.5),e.isFinite=!0,e.format=n.format??null});function J(e){return mC(Aw,e)}var jw=K(`ZodNumberFormat`,(e,t)=>{Yx.init(e,t),Aw.init(e,t)});function Mw(e){return gC(jw,e)}var Nw=K(`ZodBoolean`,(e,t)=>{Xx.init(e,t),bw.init(e,t),e._zod.processJSONSchema=(t,n,r)=>HC(e,t,n,r)});function Pw(e){return _C(Nw,e)}var Fw=K(`ZodUndefined`,(e,t)=>{Zx.init(e,t),bw.init(e,t),e._zod.processJSONSchema=(t,n,r)=>WC(e,t,n,r)});function Iw(e){return vC(Fw,e)}var Lw=K(`ZodNull`,(e,t)=>{Qx.init(e,t),bw.init(e,t),e._zod.processJSONSchema=(t,n,r)=>UC(e,t,n,r)});function Rw(e){return yC(Lw,e)}var zw=K(`ZodAny`,(e,t)=>{$x.init(e,t),bw.init(e,t),e._zod.processJSONSchema=(e,t,n)=>void 0});function Bw(){return bC(zw)}var Vw=K(`ZodUnknown`,(e,t)=>{eS.init(e,t),bw.init(e,t),e._zod.processJSONSchema=(e,t,n)=>void 0});function Hw(){return xC(Vw)}var nne=K(`ZodNever`,(e,t)=>{tS.init(e,t),bw.init(e,t),e._zod.processJSONSchema=(t,n,r)=>GC(e,t,n,r)});function Uw(e){return SC(nne,e)}var rne=K(`ZodArray`,(e,t)=>{rS.init(e,t),bw.init(e,t),e._zod.processJSONSchema=(t,n,r)=>XC(e,t,n,r),e.element=t.element,yw(e,`ZodArray`,{min(e,t){return this.check(kC(e,t))},nonempty(e){return this.check(kC(1,e))},max(e,t){return this.check(OC(e,t))},length(e,t){return this.check(AC(e,t))},unwrap(){return this.element}})});function Y(e,t){return nte(rne,e,t)}var Ww=K(`ZodObject`,(e,t)=>{cS.init(e,t),bw.init(e,t),e._zod.processJSONSchema=(t,n,r)=>ZC(e,t,n,r),Ey(e,`shape`,()=>t.shape),yw(e,`ZodObject`,{keyof(){return $w(Object.keys(this._zod.def.shape))},catchall(e){return this.clone({...this._zod.def,catchall:e})},passthrough(){return this.clone({...this._zod.def,catchall:Hw()})},loose(){return this.clone({...this._zod.def,catchall:Hw()})},strict(){return this.clone({...this._zod.def,catchall:Uw()})},strip(){return this.clone({...this._zod.def,catchall:void 0})},extend(e){return Wy(this,e)},safeExtend(e){return Gy(this,e)},merge(e){return Ky(this,e)},pick(e){return Hy(this,e)},omit(e){return Uy(this,e)},partial(...e){return qy(rT,this,e[0])},required(...e){return Jy(pT,this,e[0])}})});function X(e,t){return new Ww({type:`object`,shape:e??{},...zy(t)})}function Gw(e,t){return new Ww({type:`object`,shape:e,catchall:Hw(),...zy(t)})}var Kw=K(`ZodUnion`,(e,t)=>{uS.init(e,t),bw.init(e,t),e._zod.processJSONSchema=(t,n,r)=>QC(e,t,n,r),e.options=t.options});function Z(e,t){return new Kw({type:`union`,options:e,...zy(t)})}var qw=K(`ZodDiscriminatedUnion`,(e,t)=>{Kw.init(e,t),dS.init(e,t)});function Jw(e,t,n){return new qw({type:`union`,options:t,discriminator:e,...zy(n)})}var Yw=K(`ZodIntersection`,(e,t)=>{fS.init(e,t),bw.init(e,t),e._zod.processJSONSchema=(t,n,r)=>$C(e,t,n,r)});function Xw(e,t){return new Yw({type:`intersection`,left:e,right:t})}var Zw=K(`ZodRecord`,(e,t)=>{hS.init(e,t),bw.init(e,t),e._zod.processJSONSchema=(t,n,r)=>ew(e,t,n,r),e.keyType=t.keyType,e.valueType=t.valueType});function Q(e,t,n){return!t||!t._zod?new Zw({type:`record`,keyType:q(),valueType:e,...zy(t)}):new Zw({type:`record`,keyType:e,valueType:t,...zy(n)})}var Qw=K(`ZodEnum`,(e,t)=>{gS.init(e,t),bw.init(e,t),e._zod.processJSONSchema=(t,n,r)=>KC(e,t,n,r),e.enum=t.entries,e.options=Object.values(t.entries);let n=new Set(Object.keys(t.entries));e.extract=(e,r)=>{let i={};for(let r of e)if(n.has(r))i[r]=t.entries[r];else throw Error(`Key ${r} not found in enum`);return new Qw({...t,checks:[],...zy(r),entries:i})},e.exclude=(e,r)=>{let i={...t.entries};for(let t of e)if(n.has(t))delete i[t];else throw Error(`Key ${t} not found in enum`);return new Qw({...t,checks:[],...zy(r),entries:i})}});function $w(e,t){return new Qw({type:`enum`,entries:Array.isArray(e)?Object.fromEntries(e.map(e=>[e,e])):e,...zy(t)})}var eT=K(`ZodLiteral`,(e,t)=>{_S.init(e,t),bw.init(e,t),e._zod.processJSONSchema=(t,n,r)=>qC(e,t,n,r),e.values=new Set(t.values),Object.defineProperty(e,"value",{get(){if(t.values.length>1)throw Error("This schema contains multiple valid literal values. Use `.values` instead.");return t.values[0]}})});function $(e,t){return new eT({type:`literal`,values:Array.isArray(e)?e:[e],...zy(t)})}var tT=K(`ZodTransform`,(e,t)=>{vS.init(e,t),bw.init(e,t),e._zod.processJSONSchema=(t,n,r)=>YC(e,t,n,r),e._zod.parse=(n,r)=>{if(r.direction===`backward`)throw new gy(e.constructor.name);n.addIssue=r=>{if(typeof r==`string`)n.issues.push(tb(r,n.value,t));else{let t=r;t.fatal&&(t.continue=!1),t.code??=`custom`,t.input??=n.value,t.inst??=e,n.issues.push(tb(t))}};let i=t.transform(n.value,n);return i instanceof Promise?i.then(e=>(n.value=e,n.fallback=!0,n)):(n.value=i,n.fallback=!0,n)}});function nT(e){return new tT({type:`transform`,transform:e})}var rT=K(`ZodOptional`,(e,t)=>{bS.init(e,t),bw.init(e,t),e._zod.processJSONSchema=(t,n,r)=>cw(e,t,n,r),e.unwrap=()=>e._zod.def.innerType});function iT(e){return new rT({type:`optional`,innerType:e})}var aT=K(`ZodExactOptional`,(e,t)=>{xS.init(e,t),bw.init(e,t),e._zod.processJSONSchema=(t,n,r)=>cw(e,t,n,r),e.unwrap=()=>e._zod.def.innerType});function oT(e){return new aT({type:`optional`,innerType:e})}var sT=K(`ZodNullable`,(e,t)=>{SS.init(e,t),bw.init(e,t),e._zod.processJSONSchema=(t,n,r)=>tw(e,t,n,r),e.unwrap=()=>e._zod.def.innerType});function cT(e){return new sT({type:`nullable`,innerType:e})}var lT=K(`ZodDefault`,(e,t)=>{CS.init(e,t),bw.init(e,t),e._zod.processJSONSchema=(t,n,r)=>rw(e,t,n,r),e.unwrap=()=>e._zod.def.innerType,e.removeDefault=e.unwrap});function uT(e,t){return new lT({type:`default`,innerType:e,get defaultValue(){return typeof t==`function`?t():Fy(t)}})}var dT=K(`ZodPrefault`,(e,t)=>{TS.init(e,t),bw.init(e,t),e._zod.processJSONSchema=(t,n,r)=>iw(e,t,n,r),e.unwrap=()=>e._zod.def.innerType});function fT(e,t){return new dT({type:`prefault`,innerType:e,get defaultValue(){return typeof t==`function`?t():Fy(t)}})}var pT=K(`ZodNonOptional`,(e,t)=>{ES.init(e,t),bw.init(e,t),e._zod.processJSONSchema=(t,n,r)=>nw(e,t,n,r),e.unwrap=()=>e._zod.def.innerType});function mT(e,t){return new pT({type:`nonoptional`,innerType:e,...zy(t)})}var ine=K(`ZodCatch`,(e,t)=>{OS.init(e,t),bw.init(e,t),e._zod.processJSONSchema=(t,n,r)=>aw(e,t,n,r),e.unwrap=()=>e._zod.def.innerType,e.removeCatch=e.unwrap});function ane(e,t){return new ine({type:`catch`,innerType:e,catchValue:typeof t==`function`?t:()=>t})}var hT=K(`ZodPipe`,(e,t)=>{kS.init(e,t),bw.init(e,t),e._zod.processJSONSchema=(t,n,r)=>ow(e,t,n,r),e.in=t.in,e.out=t.out});function gT(e,t){return new hT({type:`pipe`,in:e,out:t})}var one=K(`ZodPreprocess`,(e,t)=>{hT.init(e,t),jS.init(e,t)}),sne=K(`ZodReadonly`,(e,t)=>{MS.init(e,t),bw.init(e,t),e._zod.processJSONSchema=(t,n,r)=>sw(e,t,n,r),e.unwrap=()=>e._zod.def.innerType});function cne(e){return new sne({type:`readonly`,innerType:e})}var lne=K(`ZodLazy`,(e,t)=>{PS.init(e,t),bw.init(e,t),e._zod.processJSONSchema=(t,n,r)=>lw(e,t,n,r),e.unwrap=()=>e._zod.def.getter()});function _T(e){return new lne({type:`lazy`,getter:e})}var vT=K(`ZodCustom`,(e,t)=>{FS.init(e,t),bw.init(e,t),e._zod.processJSONSchema=(t,n,r)=>JC(e,t,n,r)});function une(e,t){return rte(vT,e??(()=>!0),t)}function dne(e,t={}){return ite(vT,e,t)}function fne(e,t){return ate(e,t)}function yT(e,t){return new one({type:`pipe`,in:nT(e),out:t})}var bT={invalid_type:`invalid_type`,too_big:`too_big`,too_small:`too_small`,invalid_format:`invalid_format`,not_multiple_of:`not_multiple_of`,unrecognized_keys:`unrecognized_keys`,invalid_union:`invalid_union`,invalid_key:`invalid_key`,invalid_element:`invalid_element`,invalid_value:`invalid_value`,custom:`custom`},pne;pne||={};function xT(e){return hC(Aw,e)}var ST=`2025-11-25`,CT=[ST,`2025-06-18`,`2025-03-26`,`2024-11-05`,`2024-10-07`],wT=`io.modelcontextprotocol/related-task`,TT=`io.modelcontextprotocol/protocolVersion`,ET=`io.modelcontextprotocol/clientInfo`,DT=`io.modelcontextprotocol/serverInfo`,OT=`io.modelcontextprotocol/clientCapabilities`,kT=`io.modelcontextprotocol/subscriptionId`,AT=`io.modelcontextprotocol/logLevel`,jT=_T(()=>Z([q(),J(),Pw(),Rw(),Q(q(),jT),Y(jT)])),MT=Q(q(),jT),NT=Y(jT),PT=Z([q(),J().int()]),FT=q(),IT=X({ttl:J().optional()}),LT=X({taskId:q()}),RT=Gw({progressToken:PT.optional(),[wT]:LT.optional()}),zT=X({_meta:RT.optional()}),BT=zT.extend({task:IT.optional()}),VT=X({method:q(),params:zT.loose().optional()}),HT=X({_meta:RT.optional()}),UT=X({method:q(),params:HT.loose().optional()}),WT=Gw({get[DT](){return aE.optional().catch(void 0)}}),GT=Gw({_meta:WT.optional()}),KT=Z([q(),J().int()]),qT=X({jsonrpc:$(`2.0`),id:KT,...VT.shape}).strict(),JT=X({jsonrpc:$(`2.0`),...UT.shape}).strict(),YT=X({jsonrpc:$(`2.0`),id:KT,result:GT}).strict(),XT=X({jsonrpc:$(`2.0`),id:KT.optional(),error:X({code:J().int(),message:q(),data:Hw().optional()})}).strict(),ZT=Z([qT,JT,YT,XT]),QT=Z([YT,XT]),$T=GT.strict(),eE=HT.extend({requestId:KT.optional(),reason:q().optional()}),tE=UT.extend({method:$(`notifications/cancelled`),params:eE}),nE=X({src:q(),mimeType:q().optional(),sizes:Y(q()).optional(),theme:$w([`light`,`dark`]).optional()}),rE=X({icons:Y(nE).optional()}),iE=X({name:q(),title:q().optional()}),aE=iE.extend({...iE.shape,...rE.shape,version:q(),websiteUrl:q().optional(),description:q().optional()}),oE=yT(e=>e&&typeof e==`object`&&!Array.isArray(e)&&Object.keys(e).length===0?{form:{}}:e,Xw(X({form:Xw(X({applyDefaults:Pw().optional()}),MT).optional(),url:MT.optional()}),MT.optional())),sE=Gw({list:MT.optional(),cancel:MT.optional(),requests:Gw({sampling:Gw({createMessage:MT.optional()}).optional(),elicitation:Gw({create:MT.optional()}).optional()}).optional()}),cE=Gw({list:MT.optional(),cancel:MT.optional(),requests:Gw({tools:Gw({call:MT.optional()}).optional()}).optional()}),lE=X({experimental:Q(q(),MT).optional(),sampling:X({context:MT.optional(),tools:MT.optional()}).optional(),elicitation:oE.optional(),roots:X({listChanged:Pw().optional()}).optional(),tasks:sE.optional(),extensions:Q(q(),MT).optional()}),uE=zT.extend({protocolVersion:q(),capabilities:lE,clientInfo:aE}),dE=VT.extend({method:$(`initialize`),params:uE}),fE=X({experimental:Q(q(),MT).optional(),logging:MT.optional(),completions:MT.optional(),prompts:X({listChanged:Pw().optional()}).optional(),resources:X({subscribe:Pw().optional(),listChanged:Pw().optional()}).optional(),tools:X({listChanged:Pw().optional()}).optional(),tasks:cE.optional(),extensions:Q(q(),MT).optional()}),pE=GT.extend({protocolVersion:q(),capabilities:fE,serverInfo:aE,instructions:q().optional()}),mE=UT.extend({method:$(`notifications/initialized`),params:HT.optional()}),hE=VT.extend({method:$(`server/discover`),params:zT.optional()}),gE=GT.extend({supportedVersions:Y(q()),capabilities:fE,instructions:q().optional()}),_E=VT.extend({method:$(`ping`),params:zT.optional()}),vE=X({progress:J(),total:iT(J()),message:iT(q())}),yE=X({...HT.shape,...vE.shape,progressToken:PT}),bE=UT.extend({method:$(`notifications/progress`),params:yE}),xE=zT.extend({cursor:FT.optional()}),SE=VT.extend({params:xE.optional()}),CE=GT.extend({nextCursor:FT.optional()}),wE=X({uri:q(),mimeType:iT(q()),_meta:Q(q(),Hw()).optional()}),TE=wE.extend({text:q()}),EE=q().refine(e=>{try{return atob(e),!0}catch{return!1}},{message:`Invalid Base64 string`}),DE=wE.extend({blob:EE}),OE=$w([`user`,`assistant`]),kE=X({audience:Y(OE).optional(),priority:J().min(0).max(1).optional(),lastModified:fw({offset:!0}).optional()}),AE=X({...iE.shape,...rE.shape,uri:q(),description:iT(q()),mimeType:iT(q()),size:iT(J()),annotations:kE.optional(),_meta:iT(Gw({}))}),jE=X({...iE.shape,...rE.shape,uriTemplate:q(),description:iT(q()),mimeType:iT(q()),annotations:kE.optional(),_meta:iT(Gw({}))}),ME=SE.extend({method:$(`resources/list`)}),NE=CE.extend({resources:Y(AE)}),PE=SE.extend({method:$(`resources/templates/list`)}),FE=CE.extend({resourceTemplates:Y(jE)}),IE=zT.extend({uri:q()}),LE=IE,RE=VT.extend({method:$(`resources/read`),params:LE}),zE=GT.extend({contents:Y(Z([TE,DE]))}),BE=UT.extend({method:$(`notifications/resources/list_changed`),params:HT.optional()}),VE=IE,HE=VT.extend({method:$(`resources/subscribe`),params:VE}),UE=IE,WE=VT.extend({method:$(`resources/unsubscribe`),params:UE}),GE=X({toolsListChanged:Pw().optional(),promptsListChanged:Pw().optional(),resourcesListChanged:Pw().optional(),resourceSubscriptions:Y(q()).optional()}),KE=zT.extend({notifications:GE}),qE=VT.extend({method:$(`subscriptions/listen`),params:KE}),JE=HT.extend({notifications:GE}),YE=UT.extend({method:$(`notifications/subscriptions/acknowledged`),params:JE}),XE=WT.extend({[kT]:KT}),ZE=GT.extend({_meta:XE}),QE=HT.extend({uri:q()}),$E=UT.extend({method:$(`notifications/resources/updated`),params:QE}),eD=X({name:q(),description:iT(q()),required:iT(Pw())}),tD=X({...iE.shape,...rE.shape,description:iT(q()),arguments:iT(Y(eD)),_meta:iT(Gw({}))}),nD=SE.extend({method:$(`prompts/list`)}),rD=CE.extend({prompts:Y(tD)}),iD=zT.extend({name:q(),arguments:Q(q(),q()).optional()}),aD=VT.extend({method:$(`prompts/get`),params:iD}),oD=X({type:$(`text`),text:q(),annotations:kE.optional(),_meta:Q(q(),Hw()).optional()}),sD=X({type:$(`image`),data:EE,mimeType:q(),annotations:kE.optional(),_meta:Q(q(),Hw()).optional()}),cD=X({type:$(`audio`),data:EE,mimeType:q(),annotations:kE.optional(),_meta:Q(q(),Hw()).optional()}),lD=X({type:$(`tool_use`),name:q(),id:q(),input:Q(q(),Hw()),_meta:Q(q(),Hw()).optional()}),uD=X({type:$(`resource`),resource:Z([TE,DE]),annotations:kE.optional(),_meta:Q(q(),Hw()).optional()}),dD=AE.extend({type:$(`resource_link`)}),fD=Z([oD,sD,cD,dD,uD]),pD=X({role:OE,content:fD}),mD=GT.extend({description:q().optional(),messages:Y(pD)}),hD=UT.extend({method:$(`notifications/prompts/list_changed`),params:HT.optional()}),gD=X({title:q().optional(),readOnlyHint:Pw().optional(),destructiveHint:Pw().optional(),idempotentHint:Pw().optional(),openWorldHint:Pw().optional()}),_D=X({taskSupport:$w([`required`,`optional`,`forbidden`]).optional()}),vD=X({...iE.shape,...rE.shape,description:q().optional(),inputSchema:X({type:$(`object`),properties:Q(q(),jT).optional(),required:Y(q()).optional()}).catchall(Hw()),outputSchema:Gw({$schema:q().optional()}).optional(),annotations:gD.optional(),execution:_D.optional(),_meta:Q(q(),Hw()).optional()}),yD=SE.extend({method:$(`tools/list`)}),bD=CE.extend({tools:Y(vD)}),xD=GT.extend({content:Y(fD).default([]),structuredContent:Hw().optional(),isError:Pw().optional()}),SD=xD.or(GT.extend({toolResult:Hw()})),CD=BT.extend({name:q(),arguments:Q(q(),Hw()).optional()}),wD=VT.extend({method:$(`tools/call`),params:CD}),TD=UT.extend({method:$(`notifications/tools/list_changed`),params:HT.optional()}),ED=X({autoRefresh:Pw().default(!0),debounceMs:J().int().nonnegative().default(300)}),DD=$w([`debug`,`info`,`notice`,`warning`,`error`,`critical`,`alert`,`emergency`]),OD=zT.extend({level:DD}),kD=VT.extend({method:$(`logging/setLevel`),params:OD}),AD=HT.extend({level:DD,logger:q().optional(),data:Hw()}),jD=UT.extend({method:$(`notifications/message`),params:AD}),MD=X({name:q().optional()}),ND=X({hints:Y(MD).optional(),costPriority:J().min(0).max(1).optional(),speedPriority:J().min(0).max(1).optional(),intelligencePriority:J().min(0).max(1).optional()}),PD=X({mode:$w([`auto`,`required`,`none`]).optional()}),FD=X({type:$(`tool_result`),toolUseId:q().describe(`The unique identifier for the corresponding tool call.`),content:Y(fD),structuredContent:Hw().optional(),isError:Pw().optional(),_meta:Q(q(),Hw()).optional()}),ID=Jw(`type`,[oD,sD,cD]),LD=Jw(`type`,[oD,sD,cD,lD,FD]),RD=X({role:OE,content:Z([LD,Y(LD)]),_meta:Q(q(),Hw()).optional()}),zD=BT.extend({messages:Y(RD),modelPreferences:ND.optional(),systemPrompt:q().optional(),includeContext:$w([`none`,`thisServer`,`allServers`]).optional(),temperature:J().optional(),maxTokens:J().int(),stopSequences:Y(q()).optional(),metadata:MT.optional(),tools:Y(vD).optional(),toolChoice:PD.optional()}),BD=VT.extend({method:$(`sampling/createMessage`),params:zD}),VD=GT.extend({model:q(),stopReason:iT($w([`endTurn`,`stopSequence`,`maxTokens`]).or(q())),role:OE,content:ID}),HD=GT.extend({model:q(),stopReason:iT($w([`endTurn`,`stopSequence`,`maxTokens`,`toolUse`]).or(q())),role:OE,content:Z([LD,Y(LD)])}),UD=X({type:$(`boolean`),title:q().optional(),description:q().optional(),default:Pw().optional()}),WD=X({type:$(`string`),title:q().optional(),description:q().optional(),minLength:J().optional(),maxLength:J().optional(),format:$w([`email`,`uri`,`date`,`date-time`]).optional(),default:q().optional()}),GD=X({type:$w([`number`,`integer`]),title:q().optional(),description:q().optional(),minimum:J().optional(),maximum:J().optional(),default:J().optional()}),KD=X({type:$(`string`),title:q().optional(),description:q().optional(),enum:Y(q()),default:q().optional()}),qD=X({type:$(`string`),title:q().optional(),description:q().optional(),oneOf:Y(X({const:q(),title:q()})),default:q().optional()}),JD=X({type:$(`string`),title:q().optional(),description:q().optional(),enum:Y(q()),enumNames:Y(q()).optional(),default:q().optional()}),YD=Z([KD,qD]),XD=X({type:$(`array`),title:q().optional(),description:q().optional(),minItems:J().optional(),maxItems:J().optional(),items:X({type:$(`string`),enum:Y(q())}),default:Y(q()).optional()}),ZD=X({type:$(`array`),title:q().optional(),description:q().optional(),minItems:J().optional(),maxItems:J().optional(),items:X({anyOf:Y(X({const:q(),title:q()}))}),default:Y(q()).optional()}),QD=Z([XD,ZD]),$D=Z([JD,YD,QD]),eO=Z([$D,UD,WD,GD]),tO=BT.extend({mode:$(`form`).optional(),message:q(),requestedSchema:X({type:$(`object`),properties:Q(q(),eO),required:Y(q()).optional()}).catchall(Hw())}),nO=BT.extend({mode:$(`url`),message:q(),elicitationId:q(),url:q().url()}),rO=Z([tO,nO]),iO=VT.extend({method:$(`elicitation/create`),params:rO}),aO=HT.extend({elicitationId:q()}),oO=UT.extend({method:$(`notifications/elicitation/complete`),params:aO}),sO=GT.extend({action:$w([`accept`,`decline`,`cancel`]),content:yT(e=>e===null?void 0:e,Q(q(),Z([q(),J(),Pw(),Y(q())])).optional())}),cO=X({type:$(`ref/resource`),uri:q()}),lO=X({type:$(`ref/prompt`),name:q()}),uO=zT.extend({ref:Z([lO,cO]),argument:X({name:q(),value:q()}),context:X({arguments:Q(q(),q()).optional()}).optional()}),dO=VT.extend({method:$(`completion/complete`),params:uO}),fO=GT.extend({completion:Gw({values:Y(q()).max(100),total:iT(J().int()),hasMore:iT(Pw())})}),pO=X({uri:q().startsWith(`file://`),name:q().optional(),_meta:Q(q(),Hw()).optional()}),mO=VT.extend({method:$(`roots/list`),params:zT.optional()}),hO=GT.extend({roots:Y(pO)}),gO=UT.extend({method:$(`notifications/roots/list_changed`),params:HT.optional()}),_O=Gw({ttl:J().optional(),pollInterval:J().optional()}),vO=$w([`working`,`input_required`,`completed`,`failed`,`cancelled`]),yO=X({taskId:q(),status:vO,ttl:Z([J(),Rw()]),createdAt:q(),lastUpdatedAt:q(),pollInterval:iT(J()),statusMessage:iT(q())}),bO=GT.extend({task:yO}),xO=HT.merge(yO),SO=UT.extend({method:$(`notifications/tasks/status`),params:xO}),CO=VT.extend({method:$(`tasks/get`),params:zT.extend({taskId:q()})}),wO=GT.merge(yO),TO=VT.extend({method:$(`tasks/result`),params:zT.extend({taskId:q()})}),EO=GT.loose(),DO=SE.extend({method:$(`tasks/list`)}),OO=CE.extend({tasks:Y(yO)}),kO=VT.extend({method:$(`tasks/cancel`),params:zT.extend({taskId:q()})}),AO=GT.merge(yO),mne=Z([_E,dE,hE,dO,kD,aD,nD,ME,PE,RE,HE,WE,qE,wD,yD]),hne=Z([tE,bE,mE,gO]),gne=Z([$T,VD,HD,sO,hO]),_ne=Z([_E,BD,iO,mO]),vne=Z([tE,bE,jD,$E,BE,TD,hD,YE,oO]),yne=Z([$T,pE,gE,fO,mD,rD,NE,FE,zE,xD,bD,ZE]),jO=Dw().superRefine((e,t)=>{if(!URL.canParse(e))return t.addIssue({code:bT.custom,message:`URL must be parseable`,fatal:!0}),my}).refine(e=>{let t=new URL(e);return t.protocol!==`javascript:`&&t.protocol!==`data:`&&t.protocol!==`vbscript:`},{message:`URL cannot use javascript:, data:, or vbscript: scheme`}),MO=Gw({resource:q().url(),authorization_servers:Y(jO).optional(),jwks_uri:q().url().optional(),scopes_supported:Y(q()).optional(),bearer_methods_supported:Y(q()).optional(),resource_signing_alg_values_supported:Y(q()).optional(),resource_name:q().optional(),resource_documentation:q().optional(),resource_policy_uri:q().url().optional(),resource_tos_uri:q().url().optional(),tls_client_certificate_bound_access_tokens:Pw().optional(),authorization_details_types_supported:Y(q()).optional(),dpop_signing_alg_values_supported:Y(q()).optional(),dpop_bound_access_tokens_required:Pw().optional()}),NO=Gw({issuer:q(),authorization_endpoint:jO,token_endpoint:jO,registration_endpoint:jO.optional(),scopes_supported:Y(q()).optional(),response_types_supported:Y(q()),response_modes_supported:Y(q()).optional(),grant_types_supported:Y(q()).optional(),token_endpoint_auth_methods_supported:Y(q()).optional(),token_endpoint_auth_signing_alg_values_supported:Y(q()).optional(),service_documentation:jO.optional(),revocation_endpoint:jO.optional(),revocation_endpoint_auth_methods_supported:Y(q()).optional(),revocation_endpoint_auth_signing_alg_values_supported:Y(q()).optional(),introspection_endpoint:q().optional(),introspection_endpoint_auth_methods_supported:Y(q()).optional(),introspection_endpoint_auth_signing_alg_values_supported:Y(q()).optional(),code_challenge_methods_supported:Y(q()).optional(),client_id_metadata_document_supported:Pw().optional(),authorization_response_iss_parameter_supported:Pw().optional().catch(void 0)}),PO=Gw({issuer:q(),authorization_endpoint:jO,token_endpoint:jO,userinfo_endpoint:jO.optional(),jwks_uri:jO,registration_endpoint:jO.optional(),scopes_supported:Y(q()).optional(),response_types_supported:Y(q()),response_modes_supported:Y(q()).optional(),grant_types_supported:Y(q()).optional(),acr_values_supported:Y(q()).optional(),subject_types_supported:Y(q()),id_token_signing_alg_values_supported:Y(q()),id_token_encryption_alg_values_supported:Y(q()).optional(),id_token_encryption_enc_values_supported:Y(q()).optional(),userinfo_signing_alg_values_supported:Y(q()).optional(),userinfo_encryption_alg_values_supported:Y(q()).optional(),userinfo_encryption_enc_values_supported:Y(q()).optional(),request_object_signing_alg_values_supported:Y(q()).optional(),request_object_encryption_alg_values_supported:Y(q()).optional(),request_object_encryption_enc_values_supported:Y(q()).optional(),token_endpoint_auth_methods_supported:Y(q()).optional(),token_endpoint_auth_signing_alg_values_supported:Y(q()).optional(),display_values_supported:Y(q()).optional(),claim_types_supported:Y(q()).optional(),claims_supported:Y(q()).optional(),service_documentation:q().optional(),claims_locales_supported:Y(q()).optional(),ui_locales_supported:Y(q()).optional(),claims_parameter_supported:Pw().optional(),request_parameter_supported:Pw().optional(),request_uri_parameter_supported:Pw().optional(),require_request_uri_registration:Pw().optional(),op_policy_uri:jO.optional(),op_tos_uri:jO.optional(),client_id_metadata_document_supported:Pw().optional(),authorization_response_iss_parameter_supported:Pw().optional().catch(void 0)}),FO=X({...PO.shape,...NO.pick({code_challenge_methods_supported:!0}).shape}),IO=X({access_token:q(),id_token:q().optional(),token_type:q(),expires_in:xT().optional(),scope:q().optional(),refresh_token:q().optional()}).strip(),LO=X({issued_token_type:$(`urn:ietf:params:oauth:token-type:id-jag`),access_token:q(),token_type:q().optional(),expires_in:J().optional(),scope:q().optional()}).strip(),RO=X({error:q(),error_description:q().optional(),error_uri:q().optional()}),zO=jO.optional().or($(``).transform(()=>void 0)),BO=X({redirect_uris:Y(jO),token_endpoint_auth_method:q().optional(),grant_types:Y(q()).optional(),response_types:Y(q()).optional(),application_type:q().optional(),client_name:q().optional(),client_uri:jO.optional(),logo_uri:zO,scope:q().optional(),contacts:Y(q()).optional(),tos_uri:zO,policy_uri:q().optional(),jwks_uri:jO.optional(),jwks:Bw().optional(),software_id:q().optional(),software_version:q().optional(),software_statement:q().optional()}).strip(),VO=X({client_id:q(),client_secret:q().optional(),client_id_issued_at:J().optional(),client_secret_expires_at:J().optional()}).strip(),HO=BO.merge(VO),bne=X({error:q(),error_description:q().optional()}).strip(),xne=X({token:q(),token_type_hint:q().optional()}).strip(),UO=Symbol.for(`mcp.sdk.errorBrands`);function WO(e,t){let n=new Set,r=t;for(;typeof r==`function`;){let e=r.mcpBrand;Object.prototype.hasOwnProperty.call(r,`mcpBrand`)&&typeof e==`string`&&n.add(e),r=Object.getPrototypeOf(r)}n.size!==0&&Object.defineProperty(e,UO,{value:n,enumerable:!1,configurable:!0})}function GO(e,t){try{if(typeof t==`object`&&t&&Object.prototype.hasOwnProperty.call(e,`mcpBrand`)&&typeof e.mcpBrand==`string`&&Object.prototype.hasOwnProperty.call(t,UO)){let n=t[UO];if(n&&typeof n.has==`function`&&n.has(e.mcpBrand))return!0}}catch{}return Function.prototype[Symbol.hasInstance].call(e,t)}var KO=function(e){return e.InvalidRequest=`invalid_request`,e.InvalidClient=`invalid_client`,e.InvalidGrant=`invalid_grant`,e.UnauthorizedClient=`unauthorized_client`,e.UnsupportedGrantType=`unsupported_grant_type`,e.InvalidScope=`invalid_scope`,e.AccessDenied=`access_denied`,e.ServerError=`server_error`,e.TemporarilyUnavailable=`temporarily_unavailable`,e.UnsupportedResponseType=`unsupported_response_type`,e.UnsupportedTokenType=`unsupported_token_type`,e.InvalidToken=`invalid_token`,e.MethodNotAllowed=`method_not_allowed`,e.TooManyRequests=`too_many_requests`,e.InvalidClientMetadata=`invalid_client_metadata`,e.InvalidRedirectUri=`invalid_redirect_uri`,e.InsufficientScope=`insufficient_scope`,e.InvalidTarget=`invalid_target`,e}({}),qO=class e extends Error{static{Object.defineProperty(this,"mcpBrand",{value:`mcp.OAuthError`})}static[Symbol.hasInstance](e){return GO(this,e)}static isInstance(e){if(typeof this!=`function`)throw TypeError("isInstance must be called on the class (e.g. `SdkError.isInstance(value)`); for callbacks use `v => SdkError.isInstance(v)`");return GO(this,e)}constructor(e,t,n){super(t),this.code=e,this.errorUri=n,this.name=`OAuthError`,WO(this,new.target)}toResponseObject(){let e={error:this.code,error_description:this.message};return this.errorUri&&(e.error_uri=this.errorUri),e}static fromResponse(t){return new e(t.error,t.error_description??t.error,t.error_uri)}},JO=function(e){return e.NotConnected=`NOT_CONNECTED`,e.AlreadyConnected=`ALREADY_CONNECTED`,e.NotInitialized=`NOT_INITIALIZED`,e.CapabilityNotSupported=`CAPABILITY_NOT_SUPPORTED`,e.RequestTimeout=`REQUEST_TIMEOUT`,e.ConnectionClosed=`CONNECTION_CLOSED`,e.SendFailed=`SEND_FAILED`,e.InvalidResult=`INVALID_RESULT`,e.UnsupportedResultType=`UNSUPPORTED_RESULT_TYPE`,e.InputRequiredRoundsExceeded=`INPUT_REQUIRED_ROUNDS_EXCEEDED`,e.ListPaginationExceeded=`LIST_PAGINATION_EXCEEDED`,e.MethodNotSupportedByProtocolVersion=`METHOD_NOT_SUPPORTED_BY_PROTOCOL_VERSION`,e.EraNegotiationFailed=`ERA_NEGOTIATION_FAILED`,e.ClientHttpNotImplemented=`CLIENT_HTTP_NOT_IMPLEMENTED`,e.ClientHttpAuthentication=`CLIENT_HTTP_AUTHENTICATION`,e.ClientHttpForbidden=`CLIENT_HTTP_FORBIDDEN`,e.ClientHttpUnexpectedContent=`CLIENT_HTTP_UNEXPECTED_CONTENT`,e.ClientHttpFailedToOpenStream=`CLIENT_HTTP_FAILED_TO_OPEN_STREAM`,e.ClientHttpFailedToTerminateSession=`CLIENT_HTTP_FAILED_TO_TERMINATE_SESSION`,e}({}),YO=class extends Error{static{Object.defineProperty(this,"mcpBrand",{value:`mcp.SdkError`})}static[Symbol.hasInstance](e){return GO(this,e)}static isInstance(e){if(typeof this!=`function`)throw TypeError("isInstance must be called on the class (e.g. `SdkError.isInstance(value)`); for callbacks use `v => SdkError.isInstance(v)`");return GO(this,e)}constructor(e,t,n){super(t),this.code=e,this.data=n,this.name=`SdkError`,WO(this,new.target)}},XO=class extends YO{static{Object.defineProperty(this,"mcpBrand",{value:`mcp.SdkHttpError`})}constructor(e,t,n){super(e,t,n),this.name=`SdkHttpError`}get status(){return this.data.status}get statusText(){return this.data.statusText}};function Sne(e){let t=typeof e==`string`?new URL(e):new URL(e.href);return t.hash=``,t}function Cne({requestedResource:e,configuredResource:t}){let n=typeof e==`string`?new URL(e):new URL(e.href),r=typeof t==`string`?new URL(t):new URL(t.href);if(n.origin!==r.origin||n.pathname.length<r.pathname.length)return!1;let i=n.pathname.endsWith(`/`)?n.pathname:n.pathname+`/`,a=r.pathname.endsWith(`/`)?r.pathname:r.pathname+`/`;return i.startsWith(a)}var ZO=`2026-07-28`,QO=[ZO];function $O(e){return e>=ZO}function ek(e){return e.filter(e=>!$O(e))}function tk(e){return e.filter(e=>$O(e))}function nk(e){let t=e.structuredContent;return t===void 0||!(typeof t!=`object`||!t||Array.isArray(t))||(e.content?.some(e=>e.type===`text`)??!1)?e:{...e,content:[...e.content??[],{type:`text`,text:JSON.stringify(t)}]}}var rk=[`task`,`inputRequests`,`requestState`];function ik(e){return typeof e!=`object`||!e||Array.isArray(e)||e.content!==void 0||rk.some(t=>t in e)?e:{...e,content:[]}}function ak(){let e=_T(()=>Z([q(),J(),Pw(),Rw(),Q(q(),e),Y(e)])),t=Q(q(),e),n=Z([q(),J().int()]),r=q(),i=X({ttl:J().optional()}),a=X({taskId:q()}),o=Gw({progressToken:n.optional(),"io.modelcontextprotocol/related-task":a.optional()}),s=X({_meta:o.optional()}),c=s.extend({task:i.optional()}),l=X({method:q(),params:s.loose().optional()}),u=X({_meta:o.optional()}),d=X({method:q(),params:u.loose().optional()}),f=Gw({_meta:o.optional()}),p=Z([q(),J().int()]),m=f.strict(),h=u.extend({requestId:p.optional(),reason:q().optional()}),g=d.extend({method:$(`notifications/cancelled`),params:h}),_=X({src:q(),mimeType:q().optional(),sizes:Y(q()).optional(),theme:$w([`light`,`dark`]).optional()}),v=X({icons:Y(_).optional()}),y=X({name:q(),title:q().optional()}),b=y.extend({...y.shape,...v.shape,version:q(),websiteUrl:q().optional(),description:q().optional()}),x=yT(e=>e&&typeof e==`object`&&!Array.isArray(e)&&Object.keys(e).length===0?{form:{}}:e,Xw(X({form:Xw(X({applyDefaults:Pw().optional()}),t).optional(),url:t.optional()}),t.optional())),S=Gw({list:t.optional(),cancel:t.optional(),requests:Gw({sampling:Gw({createMessage:t.optional()}).optional(),elicitation:Gw({create:t.optional()}).optional()}).optional()}),C=Gw({list:t.optional(),cancel:t.optional(),requests:Gw({tools:Gw({call:t.optional()}).optional()}).optional()}),w=X({experimental:Q(q(),t).optional(),sampling:X({context:t.optional(),tools:t.optional()}).optional(),elicitation:x.optional(),roots:X({listChanged:Pw().optional()}).optional(),tasks:S.optional(),extensions:Q(q(),t).optional()}),T=s.extend({protocolVersion:q(),capabilities:w,clientInfo:b}),E=l.extend({method:$(`initialize`),params:T}),D=X({experimental:Q(q(),t).optional(),logging:t.optional(),completions:t.optional(),prompts:X({listChanged:Pw().optional()}).optional(),resources:X({subscribe:Pw().optional(),listChanged:Pw().optional()}).optional(),tools:X({listChanged:Pw().optional()}).optional(),tasks:C.optional(),extensions:Q(q(),t).optional()}),O=f.extend({protocolVersion:q(),capabilities:D,serverInfo:b,instructions:q().optional()}),k=d.extend({method:$(`notifications/initialized`),params:u.optional()}),A=l.extend({method:$(`ping`),params:s.optional()}),j=X({progress:J(),total:iT(J()),message:iT(q())}),M=X({...u.shape,...j.shape,progressToken:n}),N=d.extend({method:$(`notifications/progress`),params:M}),ee=s.extend({cursor:r.optional()}),te=l.extend({params:ee.optional()}),P=f.extend({nextCursor:r.optional()}),F=X({uri:q(),mimeType:iT(q()),_meta:Q(q(),Hw()).optional()}),I=F.extend({text:q()}),ne=q().refine(e=>{try{return atob(e),!0}catch{return!1}},{message:`Invalid Base64 string`}),re=F.extend({blob:ne}),ie=$w([`user`,`assistant`]),ae=X({audience:Y(ie).optional(),priority:J().min(0).max(1).optional(),lastModified:fw({offset:!0}).optional()}),oe=X({...y.shape,...v.shape,uri:q(),description:iT(q()),mimeType:iT(q()),size:iT(J()),annotations:ae.optional(),_meta:iT(Gw({}))}),se=X({...y.shape,...v.shape,uriTemplate:q(),description:iT(q()),mimeType:iT(q()),annotations:ae.optional(),_meta:iT(Gw({}))}),ce=te.extend({method:$(`resources/list`)}),le=P.extend({resources:Y(oe)}),ue=te.extend({method:$(`resources/templates/list`)}),de=P.extend({resourceTemplates:Y(se)}),fe=s.extend({uri:q()}),pe=fe,me=l.extend({method:$(`resources/read`),params:pe}),he=f.extend({contents:Y(Z([I,re]))}),ge=d.extend({method:$(`notifications/resources/list_changed`),params:u.optional()}),_e=fe,ve=l.extend({method:$(`resources/subscribe`),params:_e}),ye=fe,be=l.extend({method:$(`resources/unsubscribe`),params:ye}),xe=u.extend({uri:q()}),Se=d.extend({method:$(`notifications/resources/updated`),params:xe}),Ce=X({name:q(),description:iT(q()),required:iT(Pw())}),we=X({...y.shape,...v.shape,description:iT(q()),arguments:iT(Y(Ce)),_meta:iT(Gw({}))}),Te=te.extend({method:$(`prompts/list`)}),Ee=P.extend({prompts:Y(we)}),De=s.extend({name:q(),arguments:Q(q(),q()).optional()}),Oe=l.extend({method:$(`prompts/get`),params:De}),ke=X({type:$(`text`),text:q(),annotations:ae.optional(),_meta:Q(q(),Hw()).optional()}),Ae=X({type:$(`image`),data:ne,mimeType:q(),annotations:ae.optional(),_meta:Q(q(),Hw()).optional()}),je=X({type:$(`audio`),data:ne,mimeType:q(),annotations:ae.optional(),_meta:Q(q(),Hw()).optional()}),Me=X({type:$(`tool_use`),name:q(),id:q(),input:Q(q(),Hw()),_meta:Q(q(),Hw()).optional()}),Ne=X({type:$(`resource`),resource:Z([I,re]),annotations:ae.optional(),_meta:Q(q(),Hw()).optional()}),Pe=oe.extend({type:$(`resource_link`)}),Fe=Z([ke,Ae,je,Pe,Ne]),Ie=X({role:ie,content:Fe}),Le=f.extend({description:q().optional(),messages:Y(Ie)}),Re=d.extend({method:$(`notifications/prompts/list_changed`),params:u.optional()}),ze=X({title:q().optional(),readOnlyHint:Pw().optional(),destructiveHint:Pw().optional(),idempotentHint:Pw().optional(),openWorldHint:Pw().optional()}),Be=X({taskSupport:$w([`required`,`optional`,`forbidden`]).optional()}),Ve=X({...y.shape,...v.shape,description:q().optional(),inputSchema:X({type:$(`object`),properties:Q(q(),e).optional(),required:Y(q()).optional()}).catchall(Hw()),outputSchema:X({type:$(`object`),properties:Q(q(),e).optional(),required:Y(q()).optional()}).catchall(Hw()).optional(),annotations:ze.optional(),execution:Be.optional(),_meta:Q(q(),Hw()).optional()}),He=te.extend({method:$(`tools/list`)}),Ue=P.extend({tools:Y(Ve)}),We=f.extend({content:Y(Fe),structuredContent:Q(q(),Hw()).optional(),isError:Pw().optional()}),Ge=c.extend({name:q(),arguments:Q(q(),Hw()).optional()}),Ke=l.extend({method:$(`tools/call`),params:Ge}),qe=d.extend({method:$(`notifications/tools/list_changed`),params:u.optional()}),Je=$w([`debug`,`info`,`notice`,`warning`,`error`,`critical`,`alert`,`emergency`]),Ye=s.extend({level:Je}),Xe=l.extend({method:$(`logging/setLevel`),params:Ye}),Ze=u.extend({level:Je,logger:q().optional(),data:Hw()}),Qe=d.extend({method:$(`notifications/message`),params:Ze}),$e=X({name:q().optional()}),L=X({hints:Y($e).optional(),costPriority:J().min(0).max(1).optional(),speedPriority:J().min(0).max(1).optional(),intelligencePriority:J().min(0).max(1).optional()}),et=X({mode:$w([`auto`,`required`,`none`]).optional()}),tt=X({type:$(`tool_result`),toolUseId:q().describe(`The unique identifier for the corresponding tool call.`),content:Y(Fe),structuredContent:X({}).loose().optional(),isError:Pw().optional(),_meta:Q(q(),Hw()).optional()}),nt=Jw(`type`,[ke,Ae,je]),rt=Jw(`type`,[ke,Ae,je,Me,tt]),it=X({role:ie,content:Z([rt,Y(rt)]),_meta:Q(q(),Hw()).optional()}),R=c.extend({messages:Y(it),modelPreferences:L.optional(),systemPrompt:q().optional(),includeContext:$w([`none`,`thisServer`,`allServers`]).optional(),temperature:J().optional(),maxTokens:J().int(),stopSequences:Y(q()).optional(),metadata:t.optional(),tools:Y(Ve).optional(),toolChoice:et.optional()}),at=l.extend({method:$(`sampling/createMessage`),params:R}),ot=f.extend({model:q(),stopReason:iT($w([`endTurn`,`stopSequence`,`maxTokens`]).or(q())),role:ie,content:nt}),st=f.extend({model:q(),stopReason:iT($w([`endTurn`,`stopSequence`,`maxTokens`,`toolUse`]).or(q())),role:ie,content:Z([rt,Y(rt)])}),ct=X({type:$(`boolean`),title:q().optional(),description:q().optional(),default:Pw().optional()}),lt=X({type:$(`string`),title:q().optional(),description:q().optional(),minLength:J().optional(),maxLength:J().optional(),format:$w([`email`,`uri`,`date`,`date-time`]).optional(),default:q().optional()}),ut=X({type:$w([`number`,`integer`]),title:q().optional(),description:q().optional(),minimum:J().optional(),maximum:J().optional(),default:J().optional()}),dt=X({type:$(`string`),title:q().optional(),description:q().optional(),enum:Y(q()),default:q().optional()}),ft=X({type:$(`string`),title:q().optional(),description:q().optional(),oneOf:Y(X({const:q(),title:q()})),default:q().optional()}),pt=X({type:$(`string`),title:q().optional(),description:q().optional(),enum:Y(q()),enumNames:Y(q()).optional(),default:q().optional()}),mt=Z([dt,ft]),ht=X({type:$(`array`),title:q().optional(),description:q().optional(),minItems:J().optional(),maxItems:J().optional(),items:X({type:$(`string`),enum:Y(q())}),default:Y(q()).optional()}),gt=X({type:$(`array`),title:q().optional(),description:q().optional(),minItems:J().optional(),maxItems:J().optional(),items:X({anyOf:Y(X({const:q(),title:q()}))}),default:Y(q()).optional()}),_t=Z([ht,gt]),vt=Z([pt,mt,_t]),yt=Z([vt,ct,lt,ut]),bt=c.extend({mode:$(`form`).optional(),message:q(),requestedSchema:X({type:$(`object`),properties:Q(q(),yt),required:Y(q()).optional()}).catchall(Hw())}),xt=c.extend({mode:$(`url`),message:q(),elicitationId:q(),url:q().url()}),St=Z([bt,xt]),Ct=l.extend({method:$(`elicitation/create`),params:St}),wt=u.extend({elicitationId:q()}),Tt=d.extend({method:$(`notifications/elicitation/complete`),params:wt}),Et=f.extend({action:$w([`accept`,`decline`,`cancel`]),content:yT(e=>e===null?void 0:e,Q(q(),Z([q(),J(),Pw(),Y(q())])).optional())}),Dt=X({type:$(`ref/resource`),uri:q()}),Ot=X({type:$(`ref/prompt`),name:q()}),kt=s.extend({ref:Z([Ot,Dt]),argument:X({name:q(),value:q()}),context:X({arguments:Q(q(),q()).optional()}).optional()}),At=l.extend({method:$(`completion/complete`),params:kt}),jt=f.extend({completion:Gw({values:Y(q()).max(100),total:iT(J().int()),hasMore:iT(Pw())})}),Mt=X({uri:q().startsWith(`file://`),name:q().optional(),_meta:Q(q(),Hw()).optional()}),Nt=l.extend({method:$(`roots/list`),params:s.optional()}),Pt=f.extend({roots:Y(Mt)}),Ft=d.extend({method:$(`notifications/roots/list_changed`),params:u.optional()}),It=Gw({ttl:J().optional(),pollInterval:J().optional()}),Lt=$w([`working`,`input_required`,`completed`,`failed`,`cancelled`]),Rt=X({taskId:q(),status:Lt,ttl:Z([J(),Rw()]),createdAt:q(),lastUpdatedAt:q(),pollInterval:iT(J()),statusMessage:iT(q())}),zt=f.extend({task:Rt}),Bt=u.merge(Rt),Vt=d.extend({method:$(`notifications/tasks/status`),params:Bt}),Ht=l.extend({method:$(`tasks/get`),params:s.extend({taskId:q()})}),Ut=f.merge(Rt),Wt=l.extend({method:$(`tasks/result`),params:s.extend({taskId:q()})}),Gt=f.loose(),Kt=te.extend({method:$(`tasks/list`)}),qt=P.extend({tasks:Y(Rt)}),Jt=l.extend({method:$(`tasks/cancel`),params:s.extend({taskId:q()})});return{JSONValueSchema:e,JSONObjectSchema:t,ProgressTokenSchema:n,CursorSchema:r,TaskMetadataSchema:i,RelatedTaskMetadataSchema:a,RequestMetaSchema:o,BaseRequestParamsSchema:s,TaskAugmentedRequestParamsSchema:c,RequestSchema:l,NotificationsParamsSchema:u,NotificationSchema:d,ResultSchema:f,RequestIdSchema:p,EmptyResultSchema:m,CancelledNotificationParamsSchema:h,CancelledNotificationSchema:g,IconSchema:_,IconsSchema:v,BaseMetadataSchema:y,ImplementationSchema:b,ClientTasksCapabilitySchema:S,ServerTasksCapabilitySchema:C,ClientCapabilitiesSchema:w,InitializeRequestParamsSchema:T,InitializeRequestSchema:E,ServerCapabilitiesSchema:D,InitializeResultSchema:O,InitializedNotificationSchema:k,PingRequestSchema:A,ProgressSchema:j,ProgressNotificationParamsSchema:M,ProgressNotificationSchema:N,PaginatedRequestParamsSchema:ee,PaginatedRequestSchema:te,PaginatedResultSchema:P,ResourceContentsSchema:F,TextResourceContentsSchema:I,BlobResourceContentsSchema:re,RoleSchema:ie,AnnotationsSchema:ae,ResourceSchema:oe,ResourceTemplateSchema:se,ListResourcesRequestSchema:ce,ListResourcesResultSchema:le,ListResourceTemplatesRequestSchema:ue,ListResourceTemplatesResultSchema:de,ResourceRequestParamsSchema:fe,ReadResourceRequestParamsSchema:pe,ReadResourceRequestSchema:me,ReadResourceResultSchema:he,ResourceListChangedNotificationSchema:ge,SubscribeRequestParamsSchema:_e,SubscribeRequestSchema:ve,UnsubscribeRequestParamsSchema:ye,UnsubscribeRequestSchema:be,ResourceUpdatedNotificationParamsSchema:xe,ResourceUpdatedNotificationSchema:Se,PromptArgumentSchema:Ce,PromptSchema:we,ListPromptsRequestSchema:Te,ListPromptsResultSchema:Ee,GetPromptRequestParamsSchema:De,GetPromptRequestSchema:Oe,TextContentSchema:ke,ImageContentSchema:Ae,AudioContentSchema:je,ToolUseContentSchema:Me,EmbeddedResourceSchema:Ne,ResourceLinkSchema:Pe,ContentBlockSchema:Fe,PromptMessageSchema:Ie,GetPromptResultSchema:Le,PromptListChangedNotificationSchema:Re,ToolAnnotationsSchema:ze,ToolExecutionSchema:Be,ToolSchema:Ve,ListToolsRequestSchema:He,ListToolsResultSchema:Ue,CallToolResultSchema:We,CallToolRequestParamsSchema:Ge,CallToolRequestSchema:Ke,ToolListChangedNotificationSchema:qe,LoggingLevelSchema:Je,SetLevelRequestParamsSchema:Ye,SetLevelRequestSchema:Xe,LoggingMessageNotificationParamsSchema:Ze,LoggingMessageNotificationSchema:Qe,ModelHintSchema:$e,ModelPreferencesSchema:L,ToolChoiceSchema:et,ToolResultContentSchema:tt,SamplingContentSchema:nt,SamplingMessageContentBlockSchema:rt,SamplingMessageSchema:it,CreateMessageRequestParamsSchema:R,CreateMessageRequestSchema:at,CreateMessageResultSchema:ot,CreateMessageResultWithToolsSchema:st,BooleanSchemaSchema:ct,StringSchemaSchema:lt,NumberSchemaSchema:ut,UntitledSingleSelectEnumSchemaSchema:dt,TitledSingleSelectEnumSchemaSchema:ft,LegacyTitledEnumSchemaSchema:pt,SingleSelectEnumSchemaSchema:mt,UntitledMultiSelectEnumSchemaSchema:ht,TitledMultiSelectEnumSchemaSchema:gt,MultiSelectEnumSchemaSchema:_t,EnumSchemaSchema:vt,PrimitiveSchemaDefinitionSchema:yt,ElicitRequestFormParamsSchema:bt,ElicitRequestURLParamsSchema:xt,ElicitRequestParamsSchema:St,ElicitRequestSchema:Ct,ElicitationCompleteNotificationParamsSchema:wt,ElicitationCompleteNotificationSchema:Tt,ElicitResultSchema:Et,ResourceTemplateReferenceSchema:Dt,PromptReferenceSchema:Ot,CompleteRequestParamsSchema:kt,CompleteRequestSchema:At,CompleteResultSchema:jt,RootSchema:Mt,ListRootsRequestSchema:Nt,ListRootsResultSchema:Pt,RootsListChangedNotificationSchema:Ft,TaskCreationParamsSchema:It,TaskStatusSchema:Lt,TaskSchema:Rt,CreateTaskResultSchema:zt,TaskStatusNotificationParamsSchema:Bt,TaskStatusNotificationSchema:Vt,GetTaskRequestSchema:Ht,GetTaskResultSchema:Ut,GetTaskPayloadRequestSchema:Wt,GetTaskPayloadResultSchema:Gt,ListTasksRequestSchema:Kt,ListTasksResultSchema:qt,CancelTaskRequestSchema:Jt,CancelTaskResultSchema:f.merge(Rt),ClientRequestSchema:Z([A,E,At,Xe,Oe,Te,ce,ue,me,ve,be,Ke,He,Ht,Wt,Kt,Jt]),ClientNotificationSchema:Z([g,N,k,Ft,Vt]),ClientResultSchema:Z([m,ot,st,Et,Pt,Ut,qt,zt]),ServerRequestSchema:Z([A,at,Ct,Nt,Ht,Wt,Kt,Jt]),ServerNotificationSchema:Z([g,N,Qe,Se,ge,qe,Re,Vt,Tt]),ServerResultSchema:Z([m,O,jt,Le,Ee,le,de,he,We,Ue,Ut,qt,zt]),CallToolResultWireSchema:Hw().superRefine((e,t)=>{if(!(typeof e!=`object`||!e||Array.isArray(e)||e.content!==void 0)){for(let n of rk)if(n in e){t.addIssue({code:`custom`,message:`content is required when the body carries '${n}' — another result family cannot default into an empty tools/call success`});return}}}).transform(ik).pipe(We)}}var ok;function sk(){return ok??=ak()}function ck(e){return e.type!==`object`}var lk=new Set([`const`,`enum`,`default`,`examples`]),uk=new Set([`properties`,`patternProperties`,`$defs`,`definitions`,`dependentSchemas`,`dependencies`]);function dk(e){return e!==void 0&&!(typeof e==`string`&&e.startsWith(`#`))}function fk(e){let t=typeof e.$schema==`string`?e.$schema:void 0;if(dk(e.$id))return{...t!==void 0&&{$schema:t},type:`object`,properties:{result:e},required:[`result`]};let n=dy(e.$schema)&&e.$recursiveAnchor!==!0,r=(e,t)=>{if(Array.isArray(e))return e.map(e=>r(e,!1));if(typeof e!=`object`||!e||!t&&dk(e.$id))return e;let i={},a=!1;for(let[o,s]of Object.entries(e))t?i[o]=r(s,!1):(o===`$ref`||o===`$dynamicRef`)&&typeof s==`string`?i[o]=s===`#`?`#/properties/result`:s.startsWith(`#/`)?`#/properties/result${s.slice(1)}`:s:o===`$recursiveRef`&&s===`#`&&n?a=!0:i[o]=lk.has(o)?s:uk.has(o)?r(s,!0):r(s,!1);return a&&(`$ref`in i?i.allOf=[...Array.isArray(i.allOf)?i.allOf:[],{$ref:`#/properties/result`}]:i.$ref=`#/properties/result`),i};return{...t!==void 0&&{$schema:t},type:`object`,properties:{result:r(e,!1)},required:[`result`]}}var pk={ping:null,initialize:null,"completion/complete":null,"logging/setLevel":null,"prompts/get":null,"prompts/list":null,"resources/list":null,"resources/templates/list":null,"resources/read":null,"resources/subscribe":null,"resources/unsubscribe":null,"tools/call":null,"tools/list":null,"tasks/get":null,"tasks/result":null,"tasks/list":null,"tasks/cancel":null,"sampling/createMessage":null,"elicitation/create":null,"roots/list":null},mk={"notifications/cancelled":null,"notifications/progress":null,"notifications/initialized":null,"notifications/roots/list_changed":null,"notifications/tasks/status":null,"notifications/message":null,"notifications/resources/updated":null,"notifications/resources/list_changed":null,"notifications/tools/list_changed":null,"notifications/prompts/list_changed":null,"notifications/elicitation/complete":null},hk={ping:null,initialize:null,"completion/complete":null,"logging/setLevel":null,"prompts/get":null,"prompts/list":null,"resources/list":null,"resources/templates/list":null,"resources/read":null,"resources/subscribe":null,"resources/unsubscribe":null,"tools/call":null,"tools/list":null,"sampling/createMessage":null,"elicitation/create":null,"roots/list":null},gk;function _k(){if(gk)return gk;let e=sk();return gk={requestSchemas:{ping:e.PingRequestSchema,initialize:e.InitializeRequestSchema,"completion/complete":e.CompleteRequestSchema,"logging/setLevel":e.SetLevelRequestSchema,"prompts/get":e.GetPromptRequestSchema,"prompts/list":e.ListPromptsRequestSchema,"resources/list":e.ListResourcesRequestSchema,"resources/templates/list":e.ListResourceTemplatesRequestSchema,"resources/read":e.ReadResourceRequestSchema,"resources/subscribe":e.SubscribeRequestSchema,"resources/unsubscribe":e.UnsubscribeRequestSchema,"tools/call":e.CallToolRequestSchema,"tools/list":e.ListToolsRequestSchema,"tasks/get":e.GetTaskRequestSchema,"tasks/result":e.GetTaskPayloadRequestSchema,"tasks/list":e.ListTasksRequestSchema,"tasks/cancel":e.CancelTaskRequestSchema,"sampling/createMessage":e.CreateMessageRequestSchema,"elicitation/create":e.ElicitRequestSchema,"roots/list":e.ListRootsRequestSchema},notificationSchemas:{"notifications/cancelled":e.CancelledNotificationSchema,"notifications/progress":e.ProgressNotificationSchema,"notifications/initialized":e.InitializedNotificationSchema,"notifications/roots/list_changed":e.RootsListChangedNotificationSchema,"notifications/tasks/status":e.TaskStatusNotificationSchema,"notifications/message":e.LoggingMessageNotificationSchema,"notifications/resources/updated":e.ResourceUpdatedNotificationSchema,"notifications/resources/list_changed":e.ResourceListChangedNotificationSchema,"notifications/tools/list_changed":e.ToolListChangedNotificationSchema,"notifications/prompts/list_changed":e.PromptListChangedNotificationSchema,"notifications/elicitation/complete":e.ElicitationCompleteNotificationSchema},resultSchemas:{ping:e.EmptyResultSchema,initialize:e.InitializeResultSchema,"completion/complete":e.CompleteResultSchema,"logging/setLevel":e.EmptyResultSchema,"prompts/get":e.GetPromptResultSchema,"prompts/list":e.ListPromptsResultSchema,"resources/list":e.ListResourcesResultSchema,"resources/templates/list":e.ListResourceTemplatesResultSchema,"resources/read":e.ReadResourceResultSchema,"resources/subscribe":e.EmptyResultSchema,"resources/unsubscribe":e.EmptyResultSchema,"tools/call":e.CallToolResultWireSchema,"tools/list":e.ListToolsResultSchema,"sampling/createMessage":e.CreateMessageResultWithToolsSchema,"elicitation/create":e.ElicitResultSchema,"roots/list":e.ListRootsResultSchema}},gk}function vk(e){return Object.prototype.hasOwnProperty.call(pk,e)}function yk(e){return Object.prototype.hasOwnProperty.call(mk,e)}function bk(e){return Object.prototype.hasOwnProperty.call(hk,e)}function xk(e){return bk(e)?_k().resultSchemas[e]:void 0}function Sk(e){return vk(e)?_k().requestSchemas[e]:void 0}function Ck(e){return yk(e)?_k().notificationSchemas[e]:void 0}Object.keys(pk),Object.keys(mk);function wk(e){return typeof e==`object`&&!!e&&!Array.isArray(e)}function Tk(e,t){if(e===void 0)return{ok:!1,reason:`not-in-era`};let n=e.safeParse(t);return n.success?{ok:!0,value:n.data}:{ok:!1,reason:`invalid`,message:String(n.error)}}var Ek={ok:!1,reason:`not-in-era`};function Dk(e){return wk(e)&&wk(e.outputSchema)&&ck(e.outputSchema)}function Ok(e){return e}var kk={era:`2025-11-25`,hasRequestMethod:vk,hasNotificationMethod:yk,validateRequest:(e,t)=>Tk(Sk(e),t),validateResult:(e,t)=>Tk(xk(e),t),validateNotification:(e,t)=>Tk(Ck(e),t),hasInputRequestMethod:()=>!1,validateInputRequest:()=>Ek,validateInputResponse:()=>Ek,samplingResultVariant:((e,t)=>{let n=sk();return Tk(e?n.CreateMessageResultWithToolsSchema:n.CreateMessageResultSchema,t)}),outboundEnvelope:e=>void 0,validateEnvelopeMeta:e=>[],projectCallToolResult(e,t){let n=nk(e),r=n.structuredContent;if(r===void 0)return n;let i=typeof r!=`object`||!r||Array.isArray(r),a=t!==void 0&&ck(t);return!i&&!a?n:{...n,structuredContent:{result:r}}},decodeResult(e,t){if(wk(t)&&`resultType`in t){let e={...t};return delete e.resultType,{kind:`complete`,result:Ok(e)}}return{kind:`complete`,result:Ok(t)}},encodeResult(e,t){if(e!==`tools/list`)return t;let n=t.tools;return!Array.isArray(n)||!n.some(e=>Dk(e))?t:{...t,tools:n.map(e=>Dk(e)?{...e,outputSchema:fk(e.outputSchema)}:e)}},encodeErrorCode:e=>e===-32002?-32602:e,checkInboundEnvelope:e=>void 0};function Ak(){let e=_T(()=>Z([q(),J(),Pw(),Rw(),Q(q(),e),Y(e)])),t=Q(q(),e),n=Z([q(),J().int()]),r=q(),i=Z([q(),J().int()]),a=$w([`user`,`assistant`]),o=$w([`debug`,`info`,`notice`,`warning`,`error`,`critical`,`alert`,`emergency`]),s=q().refine(e=>{try{return atob(e),!0}catch{return!1}},{message:`Invalid Base64 string`}),c=X({ttl:J().optional()}),l=X({taskId:q()}),u=Gw({progressToken:n.optional(),"io.modelcontextprotocol/related-task":l.optional()}),d=X({_meta:u.optional()}),f=d.extend({task:c.optional()}),p=X({_meta:u.optional()}),m=X({method:q(),params:p.loose().optional()}),h=X({src:q(),mimeType:q().optional(),sizes:Y(q()).optional(),theme:$w([`light`,`dark`]).optional()}),g=X({icons:Y(h).optional()}),_=X({name:q(),title:q().optional()}),v=_.extend({..._.shape,...g.shape,version:q(),websiteUrl:q().optional(),description:q().optional()}),y=yT(e=>e&&typeof e==`object`&&!Array.isArray(e)&&Object.keys(e).length===0?{form:{}}:e,Xw(X({form:Xw(X({applyDefaults:Pw().optional()}),t).optional(),url:t.optional()}),t.optional())),b=Gw({list:t.optional(),cancel:t.optional(),requests:Gw({sampling:Gw({createMessage:t.optional()}).optional(),elicitation:Gw({create:t.optional()}).optional()}).optional()}),x=Gw({list:t.optional(),cancel:t.optional(),requests:Gw({tools:Gw({call:t.optional()}).optional()}).optional()}),S=X({experimental:Q(q(),t).optional(),sampling:X({context:t.optional(),tools:t.optional()}).optional(),elicitation:y.optional(),roots:X({listChanged:Pw().optional()}).optional(),tasks:b.optional(),extensions:Q(q(),t).optional()}),C=X({experimental:Q(q(),t).optional(),logging:t.optional(),completions:t.optional(),prompts:X({listChanged:Pw().optional()}).optional(),resources:X({subscribe:Pw().optional(),listChanged:Pw().optional()}).optional(),tools:X({listChanged:Pw().optional()}).optional(),tasks:x.optional(),extensions:Q(q(),t).optional()}),w=X({progress:J(),total:iT(J()),message:iT(q())}),T=X({...p.shape,...w.shape,progressToken:n}),E=m.extend({method:$(`notifications/progress`),params:T}),D=p.extend({level:o,logger:q().optional(),data:Hw()}),O=m.extend({method:$(`notifications/message`),params:D}),k=X({uri:q(),mimeType:iT(q()),_meta:Q(q(),Hw()).optional()}),A=k.extend({text:q()}),j=k.extend({blob:s}),M=X({audience:Y(a).optional(),priority:J().min(0).max(1).optional(),lastModified:fw({offset:!0}).optional()}),N=X({..._.shape,...g.shape,uri:q(),description:iT(q()),mimeType:iT(q()),size:iT(J()),annotations:M.optional(),_meta:iT(Gw({}))}),ee=X({..._.shape,...g.shape,uriTemplate:q(),description:iT(q()),mimeType:iT(q()),annotations:M.optional(),_meta:iT(Gw({}))}),te=m.extend({method:$(`notifications/resources/list_changed`),params:p.optional()}),P=p.extend({uri:q()}),F=m.extend({method:$(`notifications/resources/updated`),params:P}),I=X({name:q(),description:iT(q()),required:iT(Pw())}),ne=X({..._.shape,...g.shape,description:iT(q()),arguments:iT(Y(I)),_meta:iT(Gw({}))}),re=m.extend({method:$(`notifications/prompts/list_changed`),params:p.optional()}),ie=X({type:$(`text`),text:q(),annotations:M.optional(),_meta:Q(q(),Hw()).optional()}),ae=X({type:$(`image`),data:s,mimeType:q(),annotations:M.optional(),_meta:Q(q(),Hw()).optional()}),oe=X({type:$(`audio`),data:s,mimeType:q(),annotations:M.optional(),_meta:Q(q(),Hw()).optional()}),se=X({type:$(`tool_use`),name:q(),id:q(),input:Q(q(),Hw()),_meta:Q(q(),Hw()).optional()}),ce=X({type:$(`resource`),resource:Z([A,j]),annotations:M.optional(),_meta:Q(q(),Hw()).optional()}),le=N.extend({type:$(`resource_link`)}),ue=Z([ie,ae,oe,le,ce]),de=X({role:a,content:ue}),fe=X({title:q().optional(),readOnlyHint:Pw().optional(),destructiveHint:Pw().optional(),idempotentHint:Pw().optional(),openWorldHint:Pw().optional()}),pe=m.extend({method:$(`notifications/tools/list_changed`),params:p.optional()}),me=X({name:q().optional()}),he=X({hints:Y(me).optional(),costPriority:J().min(0).max(1).optional(),speedPriority:J().min(0).max(1).optional(),intelligencePriority:J().min(0).max(1).optional()}),ge=X({mode:$w([`auto`,`required`,`none`]).optional()}),_e=X({type:$(`boolean`),title:q().optional(),description:q().optional(),default:Pw().optional()}),ve=X({type:$(`string`),title:q().optional(),description:q().optional(),minLength:J().optional(),maxLength:J().optional(),format:$w([`email`,`uri`,`date`,`date-time`]).optional(),default:q().optional()}),ye=X({type:$w([`number`,`integer`]),title:q().optional(),description:q().optional(),minimum:J().optional(),maximum:J().optional(),default:J().optional()}),be=X({type:$(`string`),title:q().optional(),description:q().optional(),enum:Y(q()),default:q().optional()}),xe=X({type:$(`string`),title:q().optional(),description:q().optional(),oneOf:Y(X({const:q(),title:q()})),default:q().optional()}),Se=X({type:$(`string`),title:q().optional(),description:q().optional(),enum:Y(q()),enumNames:Y(q()).optional(),default:q().optional()}),Ce=Z([be,xe]),we=X({type:$(`array`),title:q().optional(),description:q().optional(),minItems:J().optional(),maxItems:J().optional(),items:X({type:$(`string`),enum:Y(q())}),default:Y(q()).optional()}),Te=X({type:$(`array`),title:q().optional(),description:q().optional(),minItems:J().optional(),maxItems:J().optional(),items:X({anyOf:Y(X({const:q(),title:q()}))}),default:Y(q()).optional()}),Ee=Z([we,Te]),De=Z([Se,Ce,Ee]),Oe=Z([De,_e,ve,ye]),ke=f.extend({mode:$(`form`).optional(),message:q(),requestedSchema:X({type:$(`object`),properties:Q(q(),Oe),required:Y(q()).optional()}).catchall(Hw())}),Ae=X({type:$(`ref/resource`),uri:q()}),je=X({type:$(`ref/prompt`),name:q()}),Me=X({uri:q().startsWith(`file://`),name:q().optional(),_meta:Q(q(),Hw()).optional()}),Ne=S.shape,Pe=X({experimental:Ne.experimental,sampling:Ne.sampling,elicitation:Ne.elicitation,roots:Ne.roots,extensions:Ne.extensions}),Fe=C.shape,Ie=X({experimental:Fe.experimental,logging:Fe.logging,completions:Fe.completions,prompts:Fe.prompts,resources:Fe.resources,tools:Fe.tools,extensions:Fe.extensions}),Le=Gw({progressToken:n.optional(),[TT]:q(),[ET]:v.optional(),[OT]:Pe,[AT]:o.optional()}),Re=X({..._.shape,...g.shape,description:q().optional(),inputSchema:Gw({$schema:q().optional(),type:$(`object`)}),outputSchema:Gw({$schema:q().optional()}).optional(),annotations:fe.optional(),_meta:Q(q(),Hw()).optional()}),ze=X({type:$(`tool_result`),toolUseId:q(),content:Y(ue),structuredContent:Hw().optional(),isError:Pw().optional(),_meta:Q(q(),Hw()).optional()}),Be=Z([ie,ae,oe,se,ze]),Ve=X({role:a,content:Z([Be,Y(Be)]),_meta:Q(q(),Hw()).optional()}),He=q(),Ue=Gw({[DT]:v.optional().catch(void 0)}),We=Ue.optional();function Ge(e){return Gw({_meta:We,resultType:He.default(`complete`),...e})}let Ke=Ge({}),qe=Ge({nextCursor:r.optional()}),Je=Ge({content:Y(ue),structuredContent:Hw().optional(),isError:Pw().optional()}),Ye=Ge({ttlMs:J().int().min(0),cacheScope:$w([`public`,`private`]),tools:Y(Re),nextCursor:r.optional()}),Xe=Ge({ttlMs:J().int().min(0),cacheScope:$w([`public`,`private`]),prompts:Y(ne),nextCursor:r.optional()}),Ze=Ge({description:q().optional(),messages:Y(de)}),Qe=Ge({ttlMs:J().int().min(0),cacheScope:$w([`public`,`private`]),resources:Y(N),nextCursor:r.optional()}),$e=Ge({ttlMs:J().int().min(0),cacheScope:$w([`public`,`private`]),resourceTemplates:Y(ee),nextCursor:r.optional()}),L=Ge({ttlMs:J().int().min(0),cacheScope:$w([`public`,`private`]),contents:Y(Z([A,j]))}),et=Ge({completion:X({values:Y(q()).max(100),total:J().int().optional(),hasMore:Pw().optional()}).loose()}),tt=Ge({ttlMs:J().int().min(0),cacheScope:$w([`public`,`private`])}),nt=Ge({ttlMs:J().int().min(0).catch(0),cacheScope:$w([`public`,`private`]).catch(`private`),supportedVersions:Y(q()),capabilities:Ie,instructions:q().optional()}),rt=X({messages:Y(Ve),modelPreferences:he.optional(),systemPrompt:q().optional(),includeContext:$w([`none`,`thisServer`,`allServers`]).optional(),temperature:J().optional(),maxTokens:J().int(),stopSequences:Y(q()).optional(),metadata:t.optional(),tools:Y(Re).optional(),toolChoice:ge.optional()}),it=X({method:$(`sampling/createMessage`),params:rt}),R=X({method:$(`roots/list`),params:X({_meta:Q(q(),Hw()).optional()}).optional()}),at=X({...Ve.shape,model:q(),stopReason:q().optional()}),ot=X({roots:Y(Me)}),st=X({action:$w([`accept`,`decline`,`cancel`]),content:Q(q(),Z([q(),J(),Pw(),Y(q())])).optional()}),ct=X({mode:$(`url`),message:q(),url:q().url()}),lt=Z([ke,ct]),ut=X({method:$(`elicitation/create`),params:lt}),dt=Z([it,R,ut]),ft=Z([at,ot,st]),pt=Q(q(),dt),mt=Q(q(),ft),ht=Ge({inputRequests:pt.optional(),requestState:q().optional()}),gt={inputResponses:mt.optional(),requestState:q().optional()},_t=X({_meta:Le,...gt}),vt=Gw({progressToken:n.optional()});function yt(e,t){return X({method:$(e),params:X({_meta:Le,...t})})}function bt(e,t){return X({method:$(e),params:X({_meta:vt.optional(),...t}).optional()})}let xt={name:q(),arguments:Q(q(),Hw()).optional(),...gt},St={cursor:r.optional()},Ct=yt(`tools/call`,xt),wt=yt(`tools/list`,St),Tt=yt(`prompts/list`,St),Et=yt(`prompts/get`,{name:q(),arguments:Q(q(),q()).optional(),...gt}),Dt=yt(`resources/list`,St),Ot=yt(`resources/templates/list`,St),kt=yt(`resources/read`,{uri:q(),...gt}),At={ref:Z([je,Ae]),argument:X({name:q(),value:q()}),context:X({arguments:Q(q(),q()).optional()}).optional()},jt=yt(`completion/complete`,At),Mt=yt(`server/discover`,{}),Nt=X({toolsListChanged:Pw().optional(),promptsListChanged:Pw().optional(),resourcesListChanged:Pw().optional(),resourceSubscriptions:Y(q()).optional()}),Pt={notifications:Nt},Ft=yt(`subscriptions/listen`,Pt),It=Ue.extend({"io.modelcontextprotocol/subscriptionId":i}),Lt=Gw({_meta:It,resultType:He.default(`complete`)}),Rt={"tools/call":bt(`tools/call`,xt),"tools/list":bt(`tools/list`,St),"prompts/get":bt(`prompts/get`,{name:q(),arguments:Q(q(),q()).optional()}),"prompts/list":bt(`prompts/list`,St),"resources/list":bt(`resources/list`,St),"resources/templates/list":bt(`resources/templates/list`,St),"resources/read":bt(`resources/read`,{uri:q()}),"completion/complete":bt(`completion/complete`,At),"server/discover":bt(`server/discover`,{}),"subscriptions/listen":bt(`subscriptions/listen`,Pt)};function zt(e){return Gw({_meta:We,...e})}let Bt={"tools/call":zt({content:Y(ue),structuredContent:Hw().optional(),isError:Pw().optional()}),"tools/list":zt({ttlMs:J().int().min(0),cacheScope:$w([`public`,`private`]),tools:Y(Re),nextCursor:r.optional()}),"prompts/get":zt({description:q().optional(),messages:Y(de)}),"prompts/list":zt({ttlMs:J().int().min(0),cacheScope:$w([`public`,`private`]),prompts:Y(ne),nextCursor:r.optional()}),"resources/list":zt({ttlMs:J().int().min(0),cacheScope:$w([`public`,`private`]),resources:Y(N),nextCursor:r.optional()}),"resources/templates/list":zt({ttlMs:J().int().min(0),cacheScope:$w([`public`,`private`]),resourceTemplates:Y(ee),nextCursor:r.optional()}),"resources/read":zt({ttlMs:J().int().min(0),cacheScope:$w([`public`,`private`]),contents:Y(Z([A,j]))}),"completion/complete":zt({completion:X({values:Y(q()).max(100),total:J().int().optional(),hasMore:Pw().optional()}).loose()}),"server/discover":zt({ttlMs:J().int().min(0).catch(0),cacheScope:$w([`public`,`private`]).catch(`private`),supportedVersions:Y(q()),capabilities:Ie,instructions:q().optional()}),"subscriptions/listen":zt({})},Vt=Gw({"io.modelcontextprotocol/subscriptionId":i.optional()}),Ht=X({method:$(`notifications/subscriptions/acknowledged`),params:X({_meta:Vt.optional(),notifications:Nt})}),Ut=X({_meta:Vt.optional(),requestId:i,reason:q().optional()}),Wt=X({method:$(`notifications/cancelled`),params:Ut}),Gt={"notifications/cancelled":Wt,"notifications/progress":E,"notifications/message":O,"notifications/resources/updated":F,"notifications/resources/list_changed":te,"notifications/tools/list_changed":pe,"notifications/prompts/list_changed":re,"notifications/subscriptions/acknowledged":Ht},Kt=e=>X({jsonrpc:$(`2.0`),id:Z([q(),J().int()]),result:e}).strict();return{JSONValueSchema:e,JSONObjectSchema:t,ProgressTokenSchema:n,CursorSchema:r,RequestIdSchema:i,RoleSchema:a,LoggingLevelSchema:o,TaskMetadataSchema:c,RelatedTaskMetadataSchema:l,RequestMetaSchema:u,BaseRequestParamsSchema:d,TaskAugmentedRequestParamsSchema:f,NotificationsParamsSchema:p,NotificationSchema:m,IconSchema:h,IconsSchema:g,BaseMetadataSchema:_,ImplementationSchema:v,ClientTasksCapabilitySchema:b,ServerTasksCapabilitySchema:x,ClientCapabilitiesSchema:S,ServerCapabilitiesSchema:C,ProgressSchema:w,ProgressNotificationParamsSchema:T,ProgressNotificationSchema:E,LoggingMessageNotificationParamsSchema:D,LoggingMessageNotificationSchema:O,ResourceContentsSchema:k,TextResourceContentsSchema:A,BlobResourceContentsSchema:j,AnnotationsSchema:M,ResourceSchema:N,ResourceTemplateSchema:ee,ResourceListChangedNotificationSchema:te,ResourceUpdatedNotificationParamsSchema:P,ResourceUpdatedNotificationSchema:F,PromptArgumentSchema:I,PromptSchema:ne,PromptListChangedNotificationSchema:re,TextContentSchema:ie,ImageContentSchema:ae,AudioContentSchema:oe,ToolUseContentSchema:se,EmbeddedResourceSchema:ce,ResourceLinkSchema:le,ContentBlockSchema:ue,PromptMessageSchema:de,ToolAnnotationsSchema:fe,ToolListChangedNotificationSchema:pe,ModelHintSchema:me,ModelPreferencesSchema:he,ToolChoiceSchema:ge,BooleanSchemaSchema:_e,StringSchemaSchema:ve,NumberSchemaSchema:ye,UntitledSingleSelectEnumSchemaSchema:be,TitledSingleSelectEnumSchemaSchema:xe,LegacyTitledEnumSchemaSchema:Se,SingleSelectEnumSchemaSchema:Ce,UntitledMultiSelectEnumSchemaSchema:we,TitledMultiSelectEnumSchemaSchema:Te,MultiSelectEnumSchemaSchema:Ee,EnumSchemaSchema:De,PrimitiveSchemaDefinitionSchema:Oe,ElicitRequestFormParamsSchema:ke,ResourceTemplateReferenceSchema:Ae,PromptReferenceSchema:je,RootSchema:Me,ClientCapabilities2026Schema:Pe,ServerCapabilities2026Schema:Ie,RequestMetaEnvelopeSchema:Le,ToolSchema:Re,ToolResultContentSchema:ze,SamplingMessageContentBlockSchema:Be,SamplingMessageSchema:Ve,ResultTypeSchema:He,ResultMetaSchema:Ue,ResultSchema:Ke,PaginatedResultSchema:qe,CallToolResultSchema:Je,ListToolsResultSchema:Ye,ListPromptsResultSchema:Xe,GetPromptResultSchema:Ze,ListResourcesResultSchema:Qe,ListResourceTemplatesResultSchema:$e,ReadResourceResultSchema:L,CompleteResultSchema:et,CacheableResultSchema:tt,DiscoverResultSchema:nt,CreateMessageRequestParamsSchema:rt,CreateMessageRequestSchema:it,ListRootsRequestSchema:R,CreateMessageResultSchema:at,ListRootsResultSchema:ot,ElicitResultSchema:st,ElicitRequestURLParamsSchema:ct,ElicitRequestParamsSchema:lt,ElicitRequestSchema:ut,InputRequestSchema:dt,InputResponseSchema:ft,InputRequestsSchema:pt,InputResponsesSchema:mt,InputRequiredResultSchema:ht,InputResponseRequestParamsSchema:_t,CallToolRequestSchema:Ct,ListToolsRequestSchema:wt,ListPromptsRequestSchema:Tt,GetPromptRequestSchema:Et,ListResourcesRequestSchema:Dt,ListResourceTemplatesRequestSchema:Ot,ReadResourceRequestSchema:kt,CompleteRequestSchema:jt,DiscoverRequestSchema:Mt,SubscriptionFilterSchema:Nt,SubscriptionsListenRequestSchema:Ft,SubscriptionsListenResultMetaSchema:It,SubscriptionsListenResultSchema:Lt,dispatchRequestSchemas:Rt,dispatchResultSchemas:Bt,NotificationMetaSchema:Vt,SubscriptionsAcknowledgedNotificationSchema:Ht,CancelledNotificationParamsSchema:Ut,CancelledNotificationSchema:Wt,notificationSchemas2026:Gt,JSONRPCResultResponseSchema:Kt(Ke),CallToolResultResponseSchema:Kt(Z([Je,ht])),ListToolsResultResponseSchema:Kt(Ye),ListPromptsResultResponseSchema:Kt(Xe),GetPromptResultResponseSchema:Kt(Z([Ze,ht])),ListResourcesResultResponseSchema:Kt(Qe),ListResourceTemplatesResultResponseSchema:Kt($e),ReadResourceResultResponseSchema:Kt(Z([L,ht])),CompleteResultResponseSchema:Kt(et),DiscoverResultResponseSchema:Kt(nt)}}var jk;function Mk(){return jk??=Ak()}var Nk=[`tools/list`,`prompts/list`,`resources/list`,`resources/templates/list`,`resources/read`,`server/discover`];function Pk(e){return Nk.includes(e)}var Fk=Symbol(`modelcontextprotocol.resultCacheHintFallback`);function Ik(e){return e[Fk]}function Lk(e){return typeof e==`number`&&Number.isSafeInteger(e)&&e>=0}function Rk(e){return e===`public`||e===`private`}var zk=function(e){return e[e.ParseError=-32700]=`ParseError`,e[e.InvalidRequest=-32600]=`InvalidRequest`,e[e.MethodNotFound=-32601]=`MethodNotFound`,e[e.InvalidParams=-32602]=`InvalidParams`,e[e.InternalError=-32603]=`InternalError`,e[e.ResourceNotFound=-32002]=`ResourceNotFound`,e[e.MissingRequiredClientCapability=-32021]=`MissingRequiredClientCapability`,e[e.UnsupportedProtocolVersion=-32022]=`UnsupportedProtocolVersion`,e[e.UrlElicitationRequired=-32042]=`UrlElicitationRequired`,e}({}),Bk=class e extends Error{static{Object.defineProperty(this,"mcpBrand",{value:`mcp.ProtocolError`})}static[Symbol.hasInstance](e){return GO(this,e)}static isInstance(e){if(typeof this!=`function`)throw TypeError("isInstance must be called on the class (e.g. `SdkError.isInstance(value)`); for callbacks use `v => SdkError.isInstance(v)`");return GO(this,e)}constructor(e,t,n){super(t),this.code=e,this.data=n,this.name=`ProtocolError`,WO(this,new.target)}static fromError(t,n,r){if(t===zk.UrlElicitationRequired&&r){let e=r;if(e.elicitations)return new Hk(e.elicitations,n)}if(t===zk.UnsupportedProtocolVersion&&r){let e=r;if(Array.isArray(e.supported)&&typeof e.requested==`string`)return new Uk({supported:e.supported,requested:e.requested},n)}if(t===zk.InvalidParams||t===zk.ResourceNotFound){let e=r;if(typeof e?.uri==`string`&&(t===zk.ResourceNotFound||Object.keys(e).length===1))return new Vk(e.uri,n)}if(t===zk.MissingRequiredClientCapability&&r){let e=r;if(e.requiredCapabilities!==null&&typeof e.requiredCapabilities==`object`&&!Array.isArray(e.requiredCapabilities))return new Wk({requiredCapabilities:e.requiredCapabilities},n)}return new e(t,n,r)}},Vk=class extends Bk{static{Object.defineProperty(this,"mcpBrand",{value:`mcp.ResourceNotFoundError`})}constructor(e,t=`Resource not found: ${e}`){super(zk.InvalidParams,t,{uri:e})}get uri(){return this.data.uri}},Hk=class extends Bk{static{Object.defineProperty(this,"mcpBrand",{value:`mcp.UrlElicitationRequiredError`})}constructor(e,t=`URL elicitation${e.length>1?`s`:``} required`){super(zk.UrlElicitationRequired,t,{elicitations:e})}get elicitations(){return this.data?.elicitations??[]}},Uk=class extends Bk{static{Object.defineProperty(this,"mcpBrand",{value:`mcp.UnsupportedProtocolVersionError`})}constructor(e,t=`Unsupported protocol version: ${e.requested}`){super(zk.UnsupportedProtocolVersion,t,e)}get supported(){return this.data.supported}get requested(){return this.data.requested}},Wk=class extends Bk{static{Object.defineProperty(this,"mcpBrand",{value:`mcp.MissingRequiredClientCapabilityError`})}constructor(e,t=`Missing required client capabilities: ${Object.keys(e.requiredCapabilities).join(`, `)}`){super(zk.MissingRequiredClientCapability,t,e)}get requiredCapabilities(){return this.data.requiredCapabilities}},Gk=0,Kk=`private`,qk=[`tools/call`,`prompts/get`,`resources/read`];function Jk(e,t){let n=t.resultType;if(n===void 0)return{...t,resultType:`complete`};if(n===`complete`||qk.includes(e))return t;throw new Bk(zk.InternalError,`Handler for ${e} returned resultType '${String(n)}', but results of ${e} only support 'complete' on protocol revision 2026-07-28`)}function Yk(e,t){let n=Ik(t);if(t.resultType!==`complete`||!Pk(e))return n===void 0?t:eA(t);let r=t,i=Lk(r.ttlMs)?r.ttlMs:Qk(n),a=Rk(r.cacheScope)?r.cacheScope:$k(n),o={...r,ttlMs:i,cacheScope:a};return delete o[Fk],o}function Xk(e){return typeof e==`object`&&!!e&&!Array.isArray(e)}function Zk(e,t){if(t===void 0)return e;let n=e._meta;return n===void 0?{...e,_meta:{[DT]:t}}:!Xk(n)||n[`io.modelcontextprotocol/serverInfo`]!==void 0?e:{...e,_meta:{...n,[DT]:t}}}function Qk(e){return e!==void 0&&Lk(e.ttlMs)?e.ttlMs:Gk}function $k(e){return e!==void 0&&Rk(e.cacheScope)?e.cacheScope:Kk}function eA(e){let t={...e};return delete t[Fk],t}var tA=[`elicitation/create`,`sampling/createMessage`,`roots/list`],nA;function rA(){if(nA)return nA;let e=Mk();return nA={request:{"elicitation/create":X({method:$(`elicitation/create`),params:e.ElicitRequestParamsSchema}),"sampling/createMessage":X({method:$(`sampling/createMessage`),params:e.CreateMessageRequestParamsSchema}),"roots/list":X({method:$(`roots/list`),params:Gw({}).optional()})},response:{"elicitation/create":e.ElicitResultSchema,"sampling/createMessage":e.CreateMessageResultSchema,"roots/list":e.ListRootsResultSchema}},nA}function iA(e){return tA.includes(e)}function aA(e){return iA(e)?rA().request[e]:void 0}function oA(e){return iA(e)?rA().response[e]:void 0}var sA={"tools/call":null,"tools/list":null,"prompts/get":null,"prompts/list":null,"resources/list":null,"resources/templates/list":null,"resources/read":null,"completion/complete":null,"server/discover":null,"subscriptions/listen":null},cA={"notifications/cancelled":null,"notifications/progress":null,"notifications/message":null,"notifications/resources/updated":null,"notifications/resources/list_changed":null,"notifications/tools/list_changed":null,"notifications/prompts/list_changed":null,"notifications/subscriptions/acknowledged":null};function lA(e){return Object.prototype.hasOwnProperty.call(sA,e)}function uA(e){return Object.prototype.hasOwnProperty.call(cA,e)}function dA(e){return Object.prototype.hasOwnProperty.call(sA,e)}function fA(e){return lA(e)?Mk().dispatchRequestSchemas[e]:void 0}function pA(e){return dA(e)?Mk().dispatchResultSchemas[e]:void 0}function mA(e){return uA(e)?Mk().notificationSchemas2026[e]:void 0}Object.keys(sA),Object.keys(cA);function hA(e){return typeof e==`object`&&!!e&&!Array.isArray(e)}function gA(e,t){if(e===void 0)return{ok:!1,reason:`not-in-era`};let n=e.safeParse(t);return n.success?{ok:!0,value:n.data}:{ok:!1,reason:`invalid`,message:String(n.error)}}var _A={ok:!1,reason:`not-in-era`},vA=[TT,OT];function yA(e,t){let n=t,r=!1,i=()=>(r||=(n={...n},!0),n),a=t.tools;e===`tools/list`&&Array.isArray(a)&&a.some(e=>hA(e)&&`execution`in e)&&(i().tools=a.map(e=>{if(!hA(e)||!(`execution`in e))return e;let t={...e};return delete t.execution,t}));let o=t.capabilities;if(hA(o)&&`tasks`in o){let e={...o};delete e.tasks,i().capabilities=e}return n}var bA={era:`2026-07-28`,hasRequestMethod:lA,hasNotificationMethod:uA,hasInputRequestMethod:e=>aA(e)!==void 0,validateRequest:(e,t)=>gA(fA(e),t),validateResult:(e,t)=>gA(pA(e),t),validateNotification:(e,t)=>gA(mA(e),t),validateInputRequest:(e,t)=>gA(aA(e),t),validateInputResponse:(e,t)=>gA(oA(e),t),samplingResultVariant:()=>_A,outboundEnvelope(e){return{[TT]:e.protocolVersion,[ET]:e.clientInfo,[OT]:e.clientCapabilities,...e.logLevel!==void 0&&{"io.modelcontextprotocol/logLevel":e.logLevel}}},validateEnvelopeMeta(e){let t=[];for(let n of vA)n in e||t.push({key:n,problem:`missing`});let n=Mk().RequestMetaEnvelopeSchema.safeParse(e);if(!n.success)for(let e of n.error.issues){let n=e.path.map(String),r=n.length>0?n.join(`.`):`_meta`;n.length===1&&t.some(e=>e.key===r&&e.problem===`missing`)||t.push({key:r,problem:e.message})}return t},projectCallToolResult:e=>nk(e),inputRequestSchema:aA,decodeResult(e,t){if(!hA(t))return{kind:`invalid`,error:new YO(JO.InvalidResult,`Invalid result for ${e}: not an object`,{method:e})};let n=t.resultType;if(n===void 0)return{kind:`invalid`,error:new YO(JO.InvalidResult,`Invalid result for ${e}: missing required resultType — servers implementing protocol revision 2026-07-28 MUST include it (the absent-means-complete bridge applies only to earlier-revision servers)`,{method:e,violation:`missing-resultType`})};if(typeof n!=`string`)return{kind:`invalid`,error:new YO(JO.InvalidResult,`Invalid result for ${e}: non-string resultType`,{method:e,resultType:n})};if(n===`input_required`){let n=t.inputRequests,r=hA(n)?n:{},i=t.requestState;return Object.keys(r).length===0&&typeof i!=`string`?{kind:`invalid`,error:new YO(JO.InvalidResult,`Invalid result for ${e}: input_required carries neither inputRequests nor requestState (every input_required result must include at least one of the two)`,{method:e,violation:`input-required-missing-both`})}:{kind:`input_required`,inputRequests:r,...typeof i==`string`&&{requestState:i}}}if(n!==`complete`)return{kind:`invalid`,error:new YO(JO.UnsupportedResultType,`Unsupported result type '${n}' for ${e}`,{resultType:n,method:e})};let r=SA(),i=Object.hasOwn(r,e)?r[e]:void 0;if(i!==void 0){let n=i.safeParse(t);if(!n.success)return{kind:`invalid`,error:new YO(JO.InvalidResult,`Invalid result for ${e}: ${n.error}`,{method:e})}}let a={...t};return delete a.resultType,{kind:`complete`,result:a}},encodeResult(e,t,n){return Zk(Yk(e,Jk(e,yA(e,t))),n)},encodeErrorCode:e=>e===-32002?-32602:e,checkInboundEnvelope(e){if(e.envelope===void 0)return`Request is missing the required _meta envelope for protocol revision 2026-07-28 (io.modelcontextprotocol/protocolVersion, io.modelcontextprotocol/clientCapabilities)`;let t=Mk().RequestMetaEnvelopeSchema.safeParse(e.envelope);if(!t.success)return`Invalid _meta envelope for protocol revision 2026-07-28: ${t.error.issues.map(e=>e.message).join(`; `)}`}},xA;function SA(){if(xA)return xA;let e=Mk();return xA={"tools/call":e.CallToolResultSchema,"tools/list":e.ListToolsResultSchema,"prompts/get":e.GetPromptResultSchema,"prompts/list":e.ListPromptsResultSchema,"resources/list":e.ListResourcesResultSchema,"resources/templates/list":e.ListResourceTemplatesResultSchema,"resources/read":e.ReadResourceResultSchema,"completion/complete":e.CompleteResultSchema,"server/discover":e.DiscoverResultSchema},xA}var CA=`2026-07-28`;function wA(e){return e!==void 0&&$O(e)?bA:kk}function TA(e){return e.revision===void 0?e.era===`modern`?bA.era:kk.era:wA(e.revision).era}function EA(e){return OA.some(t=>t.hasRequestMethod(e))}function DA(e){return OA.some(t=>t.hasNotificationMethod(e))}var OA=[kk,bA],kA=iy({AnnotationsSchema:()=>kE,AudioContentSchema:()=>cD,BaseMetadataSchema:()=>iE,BaseRequestParamsSchema:()=>zT,BlobResourceContentsSchema:()=>DE,BooleanSchemaSchema:()=>UD,CallToolRequestParamsSchema:()=>CD,CallToolRequestSchema:()=>wD,CallToolResultSchema:()=>xD,CancelTaskRequestSchema:()=>kO,CancelTaskResultSchema:()=>AO,CancelledNotificationParamsSchema:()=>eE,CancelledNotificationSchema:()=>tE,ClientCapabilitiesSchema:()=>lE,ClientNotificationSchema:()=>hne,ClientRequestSchema:()=>mne,ClientResultSchema:()=>gne,ClientTasksCapabilitySchema:()=>sE,CompatibilityCallToolResultSchema:()=>SD,CompleteRequestParamsSchema:()=>uO,CompleteRequestSchema:()=>dO,CompleteResultSchema:()=>fO,ContentBlockSchema:()=>fD,CreateMessageRequestParamsSchema:()=>zD,CreateMessageRequestSchema:()=>BD,CreateMessageResultSchema:()=>VD,CreateMessageResultWithToolsSchema:()=>HD,CreateTaskResultSchema:()=>bO,CursorSchema:()=>FT,DiscoverRequestSchema:()=>hE,DiscoverResultSchema:()=>gE,ElicitRequestFormParamsSchema:()=>tO,ElicitRequestParamsSchema:()=>rO,ElicitRequestSchema:()=>iO,ElicitRequestURLParamsSchema:()=>nO,ElicitResultSchema:()=>sO,ElicitationCompleteNotificationParamsSchema:()=>aO,ElicitationCompleteNotificationSchema:()=>oO,EmbeddedResourceSchema:()=>uD,EmptyResultSchema:()=>$T,EnumSchemaSchema:()=>$D,GetPromptRequestParamsSchema:()=>iD,GetPromptRequestSchema:()=>aD,GetPromptResultSchema:()=>mD,GetTaskPayloadRequestSchema:()=>TO,GetTaskPayloadResultSchema:()=>EO,GetTaskRequestSchema:()=>CO,GetTaskResultSchema:()=>wO,IconSchema:()=>nE,IconsSchema:()=>rE,ImageContentSchema:()=>sD,ImplementationSchema:()=>aE,InitializeRequestParamsSchema:()=>uE,InitializeRequestSchema:()=>dE,InitializeResultSchema:()=>pE,InitializedNotificationSchema:()=>mE,JSONArraySchema:()=>NT,JSONObjectSchema:()=>MT,JSONRPCErrorResponseSchema:()=>XT,JSONRPCMessageSchema:()=>ZT,JSONRPCNotificationSchema:()=>JT,JSONRPCRequestSchema:()=>qT,JSONRPCResponseSchema:()=>QT,JSONRPCResultResponseSchema:()=>YT,JSONValueSchema:()=>jT,LegacyTitledEnumSchemaSchema:()=>JD,ListChangedOptionsBaseSchema:()=>ED,ListPromptsRequestSchema:()=>nD,ListPromptsResultSchema:()=>rD,ListResourceTemplatesRequestSchema:()=>PE,ListResourceTemplatesResultSchema:()=>FE,ListResourcesRequestSchema:()=>ME,ListResourcesResultSchema:()=>NE,ListRootsRequestSchema:()=>mO,ListRootsResultSchema:()=>hO,ListTasksRequestSchema:()=>DO,ListTasksResultSchema:()=>OO,ListToolsRequestSchema:()=>yD,ListToolsResultSchema:()=>bD,LoggingLevelSchema:()=>DD,LoggingMessageNotificationParamsSchema:()=>AD,LoggingMessageNotificationSchema:()=>jD,ModelHintSchema:()=>MD,ModelPreferencesSchema:()=>ND,MultiSelectEnumSchemaSchema:()=>QD,NotificationSchema:()=>UT,NotificationsParamsSchema:()=>HT,NumberSchemaSchema:()=>GD,PaginatedRequestParamsSchema:()=>xE,PaginatedRequestSchema:()=>SE,PaginatedResultSchema:()=>CE,PingRequestSchema:()=>_E,PrimitiveSchemaDefinitionSchema:()=>eO,ProgressNotificationParamsSchema:()=>yE,ProgressNotificationSchema:()=>bE,ProgressSchema:()=>vE,ProgressTokenSchema:()=>PT,PromptArgumentSchema:()=>eD,PromptListChangedNotificationSchema:()=>hD,PromptMessageSchema:()=>pD,PromptReferenceSchema:()=>lO,PromptSchema:()=>tD,ReadResourceRequestParamsSchema:()=>LE,ReadResourceRequestSchema:()=>RE,ReadResourceResultSchema:()=>zE,RelatedTaskMetadataSchema:()=>LT,RequestIdSchema:()=>KT,RequestMetaSchema:()=>RT,RequestSchema:()=>VT,ResourceContentsSchema:()=>wE,ResourceLinkSchema:()=>dD,ResourceListChangedNotificationSchema:()=>BE,ResourceRequestParamsSchema:()=>IE,ResourceSchema:()=>AE,ResourceTemplateReferenceSchema:()=>cO,ResourceTemplateSchema:()=>jE,ResourceUpdatedNotificationParamsSchema:()=>QE,ResourceUpdatedNotificationSchema:()=>$E,ResultMetaObjectSchema:()=>WT,ResultSchema:()=>GT,RoleSchema:()=>OE,RootSchema:()=>pO,RootsListChangedNotificationSchema:()=>gO,SamplingContentSchema:()=>ID,SamplingMessageContentBlockSchema:()=>LD,SamplingMessageSchema:()=>RD,ServerCapabilitiesSchema:()=>fE,ServerNotificationSchema:()=>vne,ServerRequestSchema:()=>_ne,ServerResultSchema:()=>yne,ServerTasksCapabilitySchema:()=>cE,SetLevelRequestParamsSchema:()=>OD,SetLevelRequestSchema:()=>kD,SingleSelectEnumSchemaSchema:()=>YD,StringSchemaSchema:()=>WD,SubscribeRequestParamsSchema:()=>VE,SubscribeRequestSchema:()=>HE,SubscriptionFilterSchema:()=>GE,SubscriptionsAcknowledgedNotificationParamsSchema:()=>JE,SubscriptionsAcknowledgedNotificationSchema:()=>YE,SubscriptionsListenRequestParamsSchema:()=>KE,SubscriptionsListenRequestSchema:()=>qE,SubscriptionsListenResultMetaSchema:()=>XE,SubscriptionsListenResultSchema:()=>ZE,TaskAugmentedRequestParamsSchema:()=>BT,TaskCreationParamsSchema:()=>_O,TaskMetadataSchema:()=>IT,TaskSchema:()=>yO,TaskStatusNotificationParamsSchema:()=>xO,TaskStatusNotificationSchema:()=>SO,TaskStatusSchema:()=>vO,TextContentSchema:()=>oD,TextResourceContentsSchema:()=>TE,TitledMultiSelectEnumSchemaSchema:()=>ZD,TitledSingleSelectEnumSchemaSchema:()=>qD,ToolAnnotationsSchema:()=>gD,ToolChoiceSchema:()=>PD,ToolExecutionSchema:()=>_D,ToolListChangedNotificationSchema:()=>TD,ToolResultContentSchema:()=>FD,ToolSchema:()=>vD,ToolUseContentSchema:()=>lD,UnsubscribeRequestParamsSchema:()=>UE,UnsubscribeRequestSchema:()=>WE,UntitledMultiSelectEnumSchemaSchema:()=>XD,UntitledSingleSelectEnumSchemaSchema:()=>KD}),AA=e=>qT.safeParse(e).success,jA=e=>JT.safeParse(e).success,MA=e=>YT.safeParse(e).success,NA=e=>XT.safeParse(e).success,PA=e=>typeof e==`object`&&!!e&&!Array.isArray(e)&&e.resultType===`input_required`,FA=`Mcp-Param-`,IA=`x-mcp-header`,LA=/^[!#$%&'*+\-.^_`|~0-9A-Za-z]+$/,RA=new Set([`string`,`integer`,`boolean`,`number`]);function zA(e){let t=[],n=new Map,r=(e,i,a)=>{if(typeof e!=`object`||!e)return;let o=e;if(IA in o){if(!a||i.length===0)return`${HA(i)}: x-mcp-header is only permitted on properties statically reachable via a chain of 'properties' keys (not under items, additionalProperties, oneOf/anyOf/allOf/not, if/then/else, or $ref)`;let e=o[IA];if(typeof e!=`string`||e.length===0)return`${HA(i)}: x-mcp-header MUST be a non-empty string`;if(!LA.test(e))return`${HA(i)}: x-mcp-header '${e}' is not a valid RFC 9110 token (no spaces, control characters or HTTP delimiters)`;let r=typeof o.type==`string`?o.type:void 0;if(r===void 0||!RA.has(r))return`${HA(i)}: x-mcp-header is only permitted on primitive-typed properties (string, integer, boolean); got ${r??`<none>`}`;let s=e.toLowerCase(),c=n.get(s);if(c!==void 0)return`x-mcp-header '${e}' is not case-insensitively unique (also declared as '${c}')`;n.set(s,e),t.push({path:i,headerName:e,type:r})}let s=o.properties;if(typeof s==`object`&&s)for(let[e,t]of Object.entries(s)){let n=r(t,[...i,e],a);if(n!==void 0)return n}for(let e of BA){let t=o[e];if(t===void 0)continue;let n=Array.isArray(t)?t:typeof t==`object`&&t&&VA.has(e)?Object.values(t):[t];for(let t of n){let n=r(t,[...i,`<${e}>`],!1);if(n!==void 0)return n}}},i=r(e,[],!0);return i===void 0?{valid:!0,declarations:t}:{valid:!1,reason:i}}var BA=[`items`,`prefixItems`,`contains`,`additionalProperties`,`unevaluatedProperties`,`unevaluatedItems`,`propertyNames`,`patternProperties`,`dependentSchemas`,`oneOf`,`anyOf`,`allOf`,`not`,`if`,`then`,`else`,`$defs`,`definitions`],VA=new Set([`patternProperties`,`dependentSchemas`,`$defs`,`definitions`]);function HA(e){return e.length===0?`<root>`:e.join(`.`)}var UA=`=?base64?`,WA=`?=`;function GA(e){if(typeof e==`string`)return e;if(typeof e==`boolean`)return e?`true`:`false`;if(typeof e==`number`)return!Number.isFinite(e)||Number.isInteger(e)&&!Number.isSafeInteger(e)?void 0:String(e)}function KA(e){if(e.length===0||e.startsWith(UA)&&e.endsWith(WA)||e!==e.trim())return!0;for(let t=0;t<e.length;t++){let n=e.codePointAt(t);if(!(n===9||n>=32&&n<=126))return!0}return!1}function qA(e){let t=new TextEncoder().encode(e),n=``;for(let e of t)n+=String.fromCodePoint(e);return btoa(n)}function JA(e){return KA(e)?`${UA}${qA(e)}${WA}`:e}function YA(e,t){let n=e;for(let e of t){if(typeof n!=`object`||!n)return;n=n[e]}return n}function XA(e,t){let n={};for(let r of e){let e=YA(t,r.path);if(e==null)continue;let i=GA(e);i!==void 0&&(n[`${FA}${r.headerName}`]=JA(i))}return n}zk.InvalidRequest,zk.UnsupportedProtocolVersion,zk.InvalidParams,zk.MethodNotFound,zk.InvalidParams,zk.MissingRequiredClientCapability,zk.ParseError,zk.InvalidRequest,zk.MethodNotFound,zk.UnsupportedProtocolVersion,zk.MissingRequiredClientCapability;function ZA(e,t){return _w(e,t)}function QA(e){return new Set(e.flatMap(e=>Object.keys(e.shape)))}function $A(e){if(e==null)return!1;let t=typeof e;return t!==`object`&&t!==`function`||!(`~standard`in e)?!1:typeof e[`~standard`]?.validate==`function`}var ej=!1,tj=`draft-2020-12`;function nj(e,t=`input`){let n=e[`~standard`],r;if(n.jsonSchema)r=n.jsonSchema[t]({target:tj});else if(n.vendor===`zod`){if(!(`_zod`in e))throw Error(`Schema appears to be from zod 3, which the SDK cannot convert to JSON Schema. Upgrade to zod >=4.2.0, or wrap your JSON Schema with fromJsonSchema().`);ej||(ej=!0,console.warn("[mcp-sdk] Your zod version does not implement `~standard.jsonSchema` (added in zod 4.2.0). Falling back to z.toJSONSchema(). Upgrade to zod >=4.2.0 to silence this warning.")),r=dw(e,{target:tj,io:t})}else throw Error(`Schema library "${n.vendor}" does not implement StandardJSONSchemaV1 (\`~standard.jsonSchema\`). Upgrade to a version that does, or wrap your JSON Schema with fromJsonSchema().`);if(t===`output`)return r.type===void 0&&rj(r)?{type:`object`,...r}:r;if(r.type!==void 0&&r.type!==`object`)throw Error(`MCP tool and prompt schemas must describe objects (got type: ${JSON.stringify(r.type)}). Wrap your schema in z.object({...}) or equivalent.`);return{type:`object`,...r}}function rj(e){if(`properties`in e||`patternProperties`in e||`additionalProperties`in e||`required`in e)return!0;for(let t of[`oneOf`,`anyOf`,`allOf`]){let n=e[t];if(Array.isArray(n)&&n.length>0)return n.every(e=>typeof e==`object`&&!!e&&(e.type===`object`||rj(e)))}return!1}function ij(e){return e.path?.length?`${e.path.map(e=>String(typeof e==`object`?e.key:e)).join(`.`)}: ${e.message}`:e.message}async function aj(e,t){let n=await e[`~standard`].validate(t);return n.issues&&n.issues.length>0?{success:!1,error:n.issues.map(e=>ij(e)).join(`, `)}:{success:!0,data:n.value}}function oj(e){let t=dw(e,{target:tj,io:`input`});return typeof t.pattern==`string`?t.pattern:void 0}var sj=/\\\.\\d\{(\d+)\}/;function cj(e){let t=sj.exec(e),n=[void 0,-1,0];return t&&n.push(Number(t[1])),[!1,!0].flatMap(e=>[!1,!0].flatMap(t=>n.map(n=>fw({local:e,offset:t,precision:n}))))}function lj(e,t){let n;switch(e){case`email`:n=[Hte()];break;case`uri`:n=[Dw()];break;case`date`:n=[pw()];break;case`date-time`:n=cj(t)}return new Set(n.map(e=>oj(e)).filter(e=>e!==void 0))}function uj(e,t,n){return n!==`zod`||lj(e,t).has(t)}function dj(e){return typeof e==`object`&&!!e&&!Array.isArray(e)}function fj(e){try{return nj(e,`input`)}catch(e){let t=e instanceof Error?e.message:String(e);throw new Bk(zk.InvalidParams,`Elicitation requestedSchema must describe an object with flat primitive properties: ${t}`)}}var pj=new Set([`$comment`,`deprecated`,`description`,`examples`,`readOnly`,`title`,`writeOnly`]);function mj(e){return pj.has(e)||e.startsWith(`x-`)}var hj=new Set([`$schema`,...Object.keys(tO.shape.requestedSchema.shape)]),gj={string:QA([WD,KD,qD,JD]),number:QA([GD]),integer:QA([GD]),boolean:QA([UD]),array:QA([XD,ZD])},_j=new Set(WD.shape.format.unwrap().options);function vj(e,t,n,r){if(!dj(e))return e;let i=typeof e.type==`string`&&Object.hasOwn(gj,e.type)?gj[e.type]:void 0;if(i===void 0)return e;let a={};for(let[o,s]of Object.entries(e))i.has(o)||mj(o)?a[o]=s:o===`pattern`&&e.type===`string`&&typeof e.format==`string`?_j.has(e.format)?(typeof s!=`string`||!uj(e.format,s,n))&&r.push(`${t}.${o}`):a[o]=s:r.push(`${t}.${o}`);return a}function yj(e,t){let n={},r=[];for(let[i,a]of Object.entries(e))i===`properties`&&dj(a)?n[i]=Object.fromEntries(Object.entries(a).map(([e,n])=>[e,vj(n,`properties.${e}`,t,r)])):hj.has(i)?n[i]=a:mj(i)||r.push(i);if(r.length>0)throw new Bk(zk.InvalidParams,`Elicitation requestedSchema contains unsupported JSON Schema constraint(s) after Standard Schema conversion: ${r.join(`, `)}`);return n}function bj(e,t){if(!dj(e.properties))return t;let n=Object.entries(e.properties).filter(([,e])=>!ZA(eO,e).success).map(([e])=>`properties.${e}`);return n.length>0?n.join(`, `):t}function xj(e,t,n=``){return Array.isArray(e)&&Array.isArray(t)?e.flatMap((e,r)=>xj(e,t[r],`${n}[${r}]`)):!dj(e)||!dj(t)?[]:Object.entries(e).flatMap(([e,r])=>{let i=n?`${n}.${e}`:e;return Object.prototype.hasOwnProperty.call(t,e)?xj(r,t[e],i):mj(e)?[]:[i]})}function Sj(e){if(!$A(e.requestedSchema))return{...e,mode:`form`,requestedSchema:e.requestedSchema};let t=e.requestedSchema[`~standard`].vendor,n=yj(fj(e.requestedSchema),t),r=ZA(tO.shape.requestedSchema,n);if(!r.success)throw new Bk(zk.InvalidParams,`Elicitation requestedSchema only supports flat primitive properties (string, number, integer, boolean, and string enums): ${bj(n,r.error.message)}`);let i=xj(n,r.data);if(i.length>0)throw new Bk(zk.InvalidParams,`Elicitation requestedSchema contains unsupported JSON Schema constraint(s) after Standard Schema conversion: ${i.join(`, `)}`);let a=(r.data.required??[]).filter(e=>!Object.prototype.hasOwnProperty.call(r.data.properties,e));if(a.length>0)throw new Bk(zk.InvalidParams,`Elicitation requestedSchema lists required properties that are not defined in properties: ${a.join(`, `)}`);return{...e,mode:`form`,requestedSchema:r.data}}function Cj(e){let t=e.inputRequests!==void 0&&Object.keys(e.inputRequests).length>0,n=typeof e.requestState==`string`;if(!t&&!n)throw TypeError(`inputRequired() requires at least one of inputRequests (with at least one entry) or requestState (spec: every InputRequiredResult MUST include at least one of the two)`);return{resultType:`input_required`,...e.inputRequests!==void 0&&{inputRequests:e.inputRequests},...e.requestState!==void 0&&{requestState:e.requestState}}}Object.assign(Cj,{elicit(e){try{return{method:`elicitation/create`,params:Sj(e)}}catch(e){throw e instanceof Bk?TypeError(e.message,{cause:e}):e}},elicitUrl(e){return{method:`elicitation/create`,params:{...e,mode:`url`}}},createMessage(e){return{method:`sampling/createMessage`,params:e}},listRoots(){return{method:`roots/list`}}});function wj(e){return{"~standard":{version:1,vendor:`modelcontextprotocol`,validate:(t,n)=>PA(t)?{value:t}:e[`~standard`].validate(t,n)}}}var Tj=!0,Ej=10,Dj=250;function Oj(e){return{autoFulfill:e?.autoFulfill??Tj,maxRounds:e?.maxRounds??Ej}}function kj(e,t,n){let r=t!==void 0&&Object.keys(t).length>0;return!r&&n===void 0?e:{...e,...r&&{inputResponses:t},...n!==void 0&&{requestState:n}}}function Aj(e,t){return`Multi-round-trip request '${e}' still required input after ${t} rounds (inputRequired.maxRounds)`}function jj(e,t){return new Promise((n,r)=>{if(t?.aborted){r(t.reason instanceof YO?t.reason:new YO(JO.RequestTimeout,String(t.reason)));return}let i=setTimeout(()=>{t?.removeEventListener(`abort`,a),n()},e),a=()=>{clearTimeout(i),r(t?.reason instanceof YO?t.reason:new YO(JO.RequestTimeout,String(t?.reason)))};t?.addEventListener(`abort`,a,{once:!0})})}function Mj(e){let t=new AbortController,n=()=>t.abort(e?.reason);return e?.addEventListener(`abort`,n,{once:!0}),e?.aborted&&t.abort(e.reason),{signal:t.signal,abort:e=>t.abort(e),dispose:()=>e?.removeEventListener(`abort`,n)}}async function Nj(e){let{config:t,method:n,originalParams:r,requestOptions:i,hooks:a,signal:o}=e,s=e.flowStartedAt??Date.now(),c=e.firstPayload,l=0;for(;;){if(l+=1,l>t.maxRounds)throw new YO(JO.InputRequiredRoundsExceeded,Aj(n,t.maxRounds),{rounds:t.maxRounds,lastResult:{inputRequests:c.inputRequests,...c.requestState!==void 0&&{requestState:c.requestState}}});i.onprogress?.({progress:l,message:`Fulfilling input required by '${n}' (round ${l})`});let e=Object.entries(c.inputRequests??{}),u;if(e.length>0){let t=Mj(o);try{let n=await Promise.all(e.map(async([e,n])=>{try{return[e,await a.dispatchInputRequest(e,n,t.signal)]}catch(e){throw t.abort(e),e}}));u=Object.fromEntries(n)}finally{t.dispose()}}else await jj(Dj,o);let d={...i.timeout!==void 0&&{timeout:i.timeout}};if(i.maxTotalTimeout!==void 0){let e=Date.now()-s,t=i.maxTotalTimeout-e;if(t<=0)throw new YO(JO.RequestTimeout,`Maximum total timeout exceeded`,{maxTotalTimeout:i.maxTotalTimeout,totalElapsed:e});d.maxTotalTimeout=t}let f=await a.retry(kj(r,u,c.requestState),d);if(PA(f)){c={inputRequests:f.inputRequests??{},...f.requestState!==void 0&&{requestState:f.requestState}};continue}return f}}var Pj=`AnnotationsSchema.AudioContentSchema.BaseMetadataSchema.BlobResourceContentsSchema.BooleanSchemaSchema.CallToolRequestSchema.CallToolRequestParamsSchema.CallToolResultSchema.CancelledNotificationSchema.CancelledNotificationParamsSchema.CancelTaskRequestSchema.CancelTaskResultSchema.ClientCapabilitiesSchema.ClientNotificationSchema.ClientRequestSchema.ClientResultSchema.CompatibilityCallToolResultSchema.CompleteRequestSchema.CompleteRequestParamsSchema.CompleteResultSchema.ContentBlockSchema.CreateMessageRequestSchema.CreateMessageRequestParamsSchema.CreateMessageResultSchema.CreateMessageResultWithToolsSchema.CreateTaskResultSchema.CursorSchema.DiscoverRequestSchema.DiscoverResultSchema.ElicitationCompleteNotificationSchema.ElicitationCompleteNotificationParamsSchema.ElicitRequestSchema.ElicitRequestFormParamsSchema.ElicitRequestParamsSchema.ElicitRequestURLParamsSchema.ElicitResultSchema.EmbeddedResourceSchema.EmptyResultSchema.EnumSchemaSchema.GetPromptRequestSchema.GetPromptRequestParamsSchema.GetPromptResultSchema.GetTaskPayloadRequestSchema.GetTaskPayloadResultSchema.GetTaskRequestSchema.GetTaskResultSchema.IconSchema.IconsSchema.ImageContentSchema.ImplementationSchema.InitializedNotificationSchema.InitializeRequestSchema.InitializeRequestParamsSchema.InitializeResultSchema.JSONArraySchema.JSONObjectSchema.JSONRPCErrorResponseSchema.JSONRPCMessageSchema.JSONRPCNotificationSchema.JSONRPCRequestSchema.JSONRPCResponseSchema.JSONRPCResultResponseSchema.JSONValueSchema.LegacyTitledEnumSchemaSchema.ListPromptsRequestSchema.ListPromptsResultSchema.ListResourcesRequestSchema.ListResourcesResultSchema.ListResourceTemplatesRequestSchema.ListResourceTemplatesResultSchema.ListRootsRequestSchema.ListRootsResultSchema.ListTasksRequestSchema.ListTasksResultSchema.ListToolsRequestSchema.ListToolsResultSchema.LoggingLevelSchema.LoggingMessageNotificationSchema.LoggingMessageNotificationParamsSchema.ModelHintSchema.ModelPreferencesSchema.MultiSelectEnumSchemaSchema.NotificationSchema.NumberSchemaSchema.PaginatedRequestSchema.PaginatedRequestParamsSchema.PaginatedResultSchema.PingRequestSchema.PrimitiveSchemaDefinitionSchema.ProgressSchema.ProgressNotificationSchema.ProgressNotificationParamsSchema.ProgressTokenSchema.PromptSchema.PromptArgumentSchema.PromptListChangedNotificationSchema.PromptMessageSchema.PromptReferenceSchema.ReadResourceRequestSchema.ReadResourceRequestParamsSchema.ReadResourceResultSchema.RelatedTaskMetadataSchema.RequestSchema.RequestIdSchema.RequestMetaSchema.ResourceSchema.ResourceContentsSchema.ResourceLinkSchema.ResourceListChangedNotificationSchema.ResourceRequestParamsSchema.ResourceTemplateSchema.ResourceTemplateReferenceSchema.ResourceUpdatedNotificationSchema.ResourceUpdatedNotificationParamsSchema.ResultMetaObjectSchema.ResultSchema.RoleSchema.RootSchema.RootsListChangedNotificationSchema.SamplingContentSchema.SamplingMessageSchema.SamplingMessageContentBlockSchema.ServerCapabilitiesSchema.ServerNotificationSchema.ServerRequestSchema.ServerResultSchema.SetLevelRequestSchema.SetLevelRequestParamsSchema.SingleSelectEnumSchemaSchema.StringSchemaSchema.SubscribeRequestSchema.SubscribeRequestParamsSchema.SubscriptionFilterSchema.SubscriptionsAcknowledgedNotificationSchema.SubscriptionsAcknowledgedNotificationParamsSchema.SubscriptionsListenRequestSchema.SubscriptionsListenRequestParamsSchema.SubscriptionsListenResultSchema.SubscriptionsListenResultMetaSchema.TaskAugmentedRequestParamsSchema.TaskCreationParamsSchema.TaskMetadataSchema.TaskSchema.TaskStatusSchema.TaskStatusNotificationSchema.TaskStatusNotificationParamsSchema.TextContentSchema.TextResourceContentsSchema.TitledMultiSelectEnumSchemaSchema.TitledSingleSelectEnumSchemaSchema.ToolSchema.ToolAnnotationsSchema.ToolChoiceSchema.ToolExecutionSchema.ToolListChangedNotificationSchema.ToolResultContentSchema.ToolUseContentSchema.UnsubscribeRequestSchema.UnsubscribeRequestParamsSchema.UntitledMultiSelectEnumSchemaSchema.UntitledSingleSelectEnumSchemaSchema`.split(`.`),Fj={IdJagTokenExchangeResponseSchema:LO,OAuthClientInformationFullSchema:HO,OAuthClientInformationSchema:VO,OAuthClientMetadataSchema:BO,OAuthClientRegistrationErrorSchema:bne,OAuthErrorResponseSchema:RO,OAuthMetadataSchema:NO,OAuthProtectedResourceMetadataSchema:MO,OAuthTokenRevocationRequestSchema:xne,OAuthTokensSchema:IO,OpenIdProviderDiscoveryMetadataSchema:FO,OpenIdProviderMetadataSchema:PO},Ij={},Lj={};function Rj(e,t){let n=e.slice(0,-6);Ij[n]=t,Lj[n]=e=>t.safeParse(e).success}for(let e of Pj)Rj(e,kA[e]);for(let[e,t]of Object.entries(Fj))Rj(e,t);Object.freeze(Ij);var zj=Object.freeze(Lj);function Bj(e){switch(e){case`initialize`:case`notifications/initialized`:return wA(void 0);case`server/discover`:return wA(CA);default:return}}var Vj=[TT,ET,OT,AT],Hj=[`inputResponses`,`requestState`];function Uj(e,t){let n=e.params;if(!Jj(n))return{message:e,lifted:{}};let r=n._meta,i=Jj(r)?Vj.filter(e=>e in r):[],a=t===`request`?Hj.filter(e=>e in n):[];if(i.length===0&&a.length===0)return{message:e,lifted:{}};let o={},s={...n};if(i.length>0&&Jj(r)){let e={},t={...r};for(let n of i)e[n]=r[n],delete t[n];o.envelope=e,Object.keys(t).length>0?s._meta=t:delete s._meta}for(let e of a)e===`inputResponses`&&(o.inputResponses=s[e]),e===`requestState`&&(o.requestState=s[e]),delete s[e];return{message:{...e,params:s},lifted:o}}function Wj(e,t){let n=e.validateResult(t,void 0);if(!(!n.ok&&n.reason===`not-in-era`))return{"~standard":{version:1,vendor:`mcp-wire-codec`,validate(n){let r=e.validateResult(t,n);return r.ok?{value:r.value}:{issues:[{message:r.reason===`invalid`?r.message:`not-in-era: ${t}`}]}}}}}function Gj(e){return()=>e}var Kj=Gj(void 0),qj=class{_transport;_requestMessageId=0;_requestHandlers=new Map;_requestHandlerAbortControllers=new Map;_notificationHandlers=new Map;_responseHandlers=new Map;_progressHandlers=new Map;_timeoutInfo=new Map;_pendingDebouncedNotifications=new Set;_negotiatedProtocolVersion;_supportedProtocolVersions;onclose;onerror;fallbackRequestHandler;fallbackNotificationHandler;constructor(e){this._options=e,this._supportedProtocolVersions=e?.supportedProtocolVersions??CT,this.setNotificationHandler(`notifications/cancelled`,e=>{this._oncancel(e)}),this.setNotificationHandler(`notifications/progress`,e=>{this._onprogress(e)}),this.setRequestHandler(`ping`,e=>({}))}_shouldDropInbound(e){}_outboundMetaEnvelope(){}_envelopeOutbound(e){let t=this._outboundMetaEnvelope();if(t===void 0)return e;let n=e.params??{};return{...e,params:{...n,_meta:{...t,...n._meta}}}}_resolveNonCompleteResult(e,t){return Promise.reject(new YO(JO.UnsupportedResultType,`Unsupported result type '${e.kind}' for ${t.request.method}`,{resultType:e.kind,method:t.request.method}))}_getRequestHandler(e){return this._requestHandlers.get(e)}async _oncancel(e){e.params.requestId&&this._requestHandlerAbortControllers.get(e.params.requestId)?.abort(e.params.reason)}_setupTimeout(e,t,n,r,i=!1){this._timeoutInfo.set(e,{timeoutId:setTimeout(r,t),startTime:Date.now(),timeout:t,maxTotalTimeout:n,resetTimeoutOnProgress:i,onTimeout:r})}_resetTimeout(e){let t=this._timeoutInfo.get(e);if(!t)return!1;let n=Date.now()-t.startTime;if(t.maxTotalTimeout&&n>=t.maxTotalTimeout)throw this._timeoutInfo.delete(e),new YO(JO.RequestTimeout,`Maximum total timeout exceeded`,{maxTotalTimeout:t.maxTotalTimeout,totalElapsed:n});return clearTimeout(t.timeoutId),t.timeoutId=setTimeout(t.onTimeout,t.timeout),!0}_cleanupTimeout(e){let t=this._timeoutInfo.get(e);t&&(clearTimeout(t.timeoutId),this._timeoutInfo.delete(e))}async connect(e){this._transport=e;let t=this.transport?.onclose;this._transport.onclose=()=>{try{t?.()}finally{this._onclose()}};let n=this.transport?.onerror;this._transport.onerror=e=>{n?.(e),this._onerror(e)};let r=this._transport?.onmessage;this._transport.onmessage=(e,t)=>{r?.(e,t),MA(e)||NA(e)?this._onresponse(e):AA(e)?this._onrequest(e,t):jA(e)?this._onnotification(e,t):this._onerror(Error(`Unknown message type: ${JSON.stringify(e)}`))},e.setSupportedProtocolVersions?.(this._supportedProtocolVersions),await this._transport.start()}_onclose(){let e=this._responseHandlers;this._responseHandlers=new Map,this._progressHandlers.clear(),this._pendingDebouncedNotifications.clear();for(let e of this._timeoutInfo.values())clearTimeout(e.timeoutId);this._timeoutInfo.clear();let t=this._requestHandlerAbortControllers;this._requestHandlerAbortControllers=new Map;let n=new YO(JO.ConnectionClosed,`Connection closed`);this._transport=void 0;try{this.onclose?.()}finally{for(let t of e.values())t(n);for(let e of t.values())e.abort(n)}}_onerror(e){this.onerror?.(e)}_onnotification(e,t){let{message:n}=Uj(e,`notification`),r=this._negotiatedWireCodec();if(t?.classification===void 0&&this._shouldDropInbound(e)===`drop`)return;if(t?.classification!==void 0){let e=TA(t.classification);if(e!==r.era){this._onerror(Error(`Era mismatch on inbound notification '${n.method}': classified as ${e} but this instance serves ${r.era}`));return}}if(DA(n.method)&&!r.hasNotificationMethod(n.method))return;let i=this._notificationHandlers.get(n.method),a=this.fallbackNotificationHandler;(i!==void 0||a!==void 0)&&Promise.resolve().then(()=>i===void 0?a(n):i(n,r)).catch(e=>this._onerror(Error(`Uncaught error in notification handler: ${e}`)))}_onrequest(e,t){let{message:n,lifted:r}=Uj(e,`request`),i=this._negotiatedWireCodec();if(t?.classification===void 0&&this._shouldDropInbound(e)===`drop`){this._onerror(Error(`Dropped inbound request '${e.method}': not servable on this connection's protocol era`));return}let a=this._transport,o=(e,t,r)=>{let i={jsonrpc:`2.0`,id:n.id,error:{code:e,message:t,...r!==void 0&&{data:r}}};a?.send(i).catch(e=>this._onerror(Error(`Failed to send an error response: ${e}`)))};if(t?.classification!==void 0){let e=TA(t.classification);if(e!==i.era){this._onerror(Error(`Era mismatch on inbound request '${n.method}': classified as ${e} but this instance serves ${i.era}`));let r=t.classification.revision??e;o(zk.UnsupportedProtocolVersion,`Unsupported protocol version: ${r}`,{supported:this._supportedProtocolVersions,requested:r});return}}if(EA(n.method)&&!i.hasRequestMethod(n.method)){o(zk.MethodNotFound,`Method not found`);return}let s=this._requestHandlers.get(n.method)??this.fallbackRequestHandler;if(s===void 0){o(zk.MethodNotFound,`Method not found`);return}let c=i.checkInboundEnvelope(r);if(c!==void 0){o(zk.InvalidParams,c);return}let l=(e,t)=>this._notificationViaCodec(this._resolveOutboundCodec(e.method),e,{...t,relatedRequestId:n.id}),u=(e,t,r)=>this._requestWithSchemaViaCodec(this._resolveOutboundCodec(e.method),e,t,{...r,relatedRequestId:n.id}),d=new AbortController;this._requestHandlerAbortControllers.set(n.id,d);let f=r.inputResponses===void 0?void 0:Zj(r.inputResponses),p={sessionId:a?.sessionId,mcpReq:{id:n.id,method:n.method,_meta:n.params?._meta,...r.envelope!==void 0&&{envelope:r.envelope},...f!==void 0&&{inputResponses:f.accepted},...f!==void 0&&f.droppedKeys.length>0&&{droppedInputResponseKeys:f.droppedKeys},requestState:r.requestState===void 0?Kj:Gj(r.requestState),signal:d.signal,send:((e,t,n)=>{let r=this._resolveOutboundCodec(e.method);if(this._assertOutboundRequestInEra(r,e.method),$A(t))return u(e,t,n);let i=Wj(r,e.method);if(i===void 0)throw TypeError(`'${e.method}' is not a spec method; pass a result schema as the second argument to ctx.mcpReq.send().`);return u(e,i,t)}),notify:l},http:t?.authInfo?{authInfo:t.authInfo}:void 0},m=this.buildContext(p,t);Promise.resolve().then(()=>s(n,m)).then(async e=>{if(d.signal.aborted)return;let t;try{t=i.encodeResult(n.method,e,this._outboundServerInfo())}catch(e){this._onerror(Error(`Failed to encode result for ${n.method}: ${e}`)),o(zk.InternalError,`Internal error`);return}let r={result:t,jsonrpc:`2.0`,id:n.id};await a?.send(r)},async e=>{if(d.signal.aborted)return;let t=Number.isSafeInteger(e.code)?e.code:zk.InternalError,r={jsonrpc:`2.0`,id:n.id,error:{code:i.encodeErrorCode(t),message:e.message??`Internal error`,...e.data!==void 0&&{data:e.data}}};await a?.send(r)}).catch(e=>this._onerror(Error(`Failed to send response: ${e}`))).finally(()=>{this._requestHandlerAbortControllers.get(n.id)===d&&this._requestHandlerAbortControllers.delete(n.id)})}_onprogress(e){let{progressToken:t,...n}=e.params,r=Number(t),i=this._progressHandlers.get(r);if(!i){this._onerror(Error(`Received a progress notification for an unknown token: ${JSON.stringify(e)}`));return}let a=this._responseHandlers.get(r),o=this._timeoutInfo.get(r);if(o&&a&&o.resetTimeoutOnProgress)try{this._resetTimeout(r)}catch(e){this._responseHandlers.delete(r),this._progressHandlers.delete(r),this._cleanupTimeout(r),a(e);return}i(n)}_onresponse(e){let t=Number(e.id),n=this._responseHandlers.get(t);if(n===void 0){this._onerror(Error(`Received a response for an unknown message ID: ${JSON.stringify(e)}`));return}this._responseHandlers.delete(t),this._cleanupTimeout(t),this._progressHandlers.delete(t),MA(e)?n(e):n(Bk.fromError(e.error.code,e.error.message,e.error.data))}get transport(){return this._transport}async close(){await this._transport?.close()}request(e,t,n){let r=this._resolveOutboundCodec(e.method);if(this._assertOutboundRequestInEra(r,e.method),$A(t))return this._requestWithSchemaViaCodec(r,e,t,n);let i=Wj(r,e.method);if(i===void 0)throw TypeError(`'${e.method}' is not a spec method; pass a result schema as the second argument to request().`);return this._requestWithSchemaViaCodec(r,e,i,t)}_negotiatedWireCodec(){return wA(this._negotiatedProtocolVersion)}_wireCodec(){return this._negotiatedWireCodec()}_resolveOutboundCodec(e){if(this._negotiatedProtocolVersion===void 0){let t=Bj(e);if(t)return t}return this._negotiatedWireCodec()}_assertOutboundRequestInEra(e,t){if(EA(t)&&!e.hasRequestMethod(t))throw new YO(JO.MethodNotSupportedByProtocolVersion,`Method '${t}' is not supported by the negotiated protocol version (wire era ${e.era})`,{method:t,era:e.era})}_requestWithSchema(e,t,n){let r=this._resolveOutboundCodec(e.method);return this._assertOutboundRequestInEra(r,e.method),this._requestWithSchemaViaCodec(r,e,t,n)}_requestWithSchemaViaCodec(e,t,n,r){let{relatedRequestId:i,resumptionToken:a,onresumptiontoken:o,headers:s}=r??{},c=Date.now(),l,u;return new Promise((d,f)=>{let p=e=>{f(e)};if(!this._transport){p(Error(`Not connected`));return}if(this._options?.enforceStrictCapabilities===!0)try{this.assertCapabilityForMethod(t.method)}catch(e){p(e);return}if(r?.signal?.aborted){let e=r.signal.reason;throw e instanceof YO?e:new YO(JO.RequestTimeout,String(e))}let m=e.era===`2026-07-28`&&this._transport.hasPerRequestStream===!0?new AbortController:void 0,h=this._requestMessageId++;u=h;let g={...t,jsonrpc:`2.0`,id:h};r?.onprogress&&(this._progressHandlers.set(h,r.onprogress),g.params={...t.params,_meta:{...t.params?._meta,progressToken:h}});let _=this._envelopeOutbound(g),v=!1,y=e=>{v||(this._progressHandlers.delete(h),m===void 0?this._transport?.send(this._envelopeOutbound({jsonrpc:`2.0`,method:`notifications/cancelled`,params:{requestId:h,reason:String(e)}}),{relatedRequestId:i,resumptionToken:a,onresumptiontoken:o}).catch(e=>this._onerror(Error(`Failed to send cancellation: ${e}`))):m.abort(),f(e instanceof YO?e:new YO(JO.RequestTimeout,String(e))))};this._responseHandlers.set(h,i=>{if(r?.signal?.aborted)return;if(v=!0,i instanceof Error)return f(i);let a;try{a=e.decodeResult(t.method,i.result)}catch(e){return f(e instanceof Error?e:Error(String(e)))}if(a.kind===`invalid`)return f(a.error);if(a.kind===`input_required`){if(r?.allowInputRequired===!0)return d(rM(a));let i={codec:e,request:t,resultSchema:n,options:r,flowStartedAt:c,retry:(r,i)=>this._requestWithSchemaViaCodec(e,r===void 0?{method:t.method}:{method:t.method,params:r},n,i)};return d(this._resolveNonCompleteResult(a,i))}let o=a.result;aj(n,o).then(e=>{e.success?d(e.data):f(new YO(JO.InvalidResult,`Invalid result for ${t.method}: ${e.error}`))},f)}),l=()=>y(r?.signal?.reason),r?.signal?.addEventListener(`abort`,l,{once:!0});let b=r?.timeout??6e4;this._setupTimeout(h,b,r?.maxTotalTimeout,()=>y(new YO(JO.RequestTimeout,`Request timed out`,{timeout:b})),r?.resetTimeoutOnProgress??!1),this._transport.send(_,{relatedRequestId:i,resumptionToken:a,onresumptiontoken:o,headers:s,requestSignal:m?.signal}).catch(e=>{this._progressHandlers.delete(h),f(e)})}).finally(()=>{l&&r?.signal?.removeEventListener(`abort`,l),u!==void 0&&(this._responseHandlers.delete(u),this._cleanupTimeout(u))})}async notification(e,t){return this._notificationViaCodec(this._resolveOutboundCodec(e.method),e,t)}async _notificationViaCodec(e,t,n){if(!this._transport)throw new YO(JO.NotConnected,`Not connected`);if(DA(t.method)&&!e.hasNotificationMethod(t.method))throw new YO(JO.MethodNotSupportedByProtocolVersion,`Notification '${t.method}' is not supported by the negotiated protocol version (wire era ${e.era})`,{method:t.method,era:e.era});this.assertNotificationCapability(t.method);let r=this._envelopeOutbound({jsonrpc:`2.0`,...t});if((this._options?.debouncedNotificationMethods??[]).includes(t.method)&&!t.params&&!n?.relatedRequestId){if(this._pendingDebouncedNotifications.has(t.method))return;this._pendingDebouncedNotifications.add(t.method),Promise.resolve().then(()=>{this._pendingDebouncedNotifications.delete(t.method),this._transport&&this._transport?.send(r,n).catch(e=>this._onerror(e))});return}await this._transport.send(r,n)}setRequestHandler(e,t,n){this.assertRequestHandlerCapability(e);let r;if(typeof t==`function`){if(!EA(e))throw TypeError(`'${e}' is not a spec request method; pass schemas as the second argument to setRequestHandler().`);r=(n,r)=>{let i=this._negotiatedWireCodec(),a=i.validateRequest(e,n);if(!a.ok&&a.reason===`not-in-era`&&(a=i.validateInputRequest(e,n)),!a.ok)throw a.reason===`not-in-era`?new Bk(zk.InternalError,`No wire schema for ${e} in the resolved era`):Error(a.message);return Promise.resolve(t(a.value,r))}}else if(n)r=async(r,i)=>{let a=await aj(t.params,{...r.params});if(!a.success)throw new Bk(zk.InvalidParams,`Invalid params for ${e}: ${a.error}`);return n(a.data,i)};else throw TypeError(`setRequestHandler: handler is required`);this._requestHandlers.set(e,this._wrapHandler(e,r))}_wrapHandler(e,t){return t}_outboundServerInfo(){}removeRequestHandler(e){this._requestHandlers.delete(e)}assertCanSetRequestHandler(e){if(this._requestHandlers.has(e))throw Error(`A request handler for ${e} already exists, which would be overridden`)}setNotificationHandler(e,t,n){if(typeof t==`function`){if(!DA(e))throw TypeError(`'${e}' is not a spec notification method; pass schemas as the second argument to setNotificationHandler().`);this._notificationHandlers.set(e,(n,r)=>{let i=r.validateNotification(e,n);if(!i.ok)throw i.reason===`not-in-era`?new Bk(zk.InternalError,`No wire schema for ${e} in the resolved era`):Error(i.message);return Promise.resolve(t(i.value))});return}if(!n)throw TypeError(`setNotificationHandler: handler is required`);this._notificationHandlers.set(e,async r=>{let i=await aj(t.params,{...r.params});if(!i.success)throw new Bk(zk.InvalidParams,`Invalid params for notification ${e}: ${i.error}`);await n(i.data,r)})}removeNotificationHandler(e){this._notificationHandlers.delete(e)}};function Jj(e){return typeof e==`object`&&!!e&&!Array.isArray(e)}function Yj(e,t){let n={...e};for(let e in t){let r=e,i=t[r];if(i===void 0)continue;let a=n[r];n[r]=Jj(a)&&Jj(i)?{...a,...i}:i}return n}function Xj(e){return typeof e==`object`&&!!e&&!Array.isArray(e)}function Zj(e){let t={},n=[];if(!Xj(e))return{accepted:t,droppedKeys:n};for(let[r,i]of Object.entries(e)){if(!Xj(i)||`method`in i||`result`in i){n.push(r);continue}t[r]=i}return{accepted:t,droppedKeys:n}}function Qj(e){throw new YO(JO.SendFailed,`ctx.mcpReq.${e} is not available while fulfilling an embedded input request: the request is fulfilled locally and has no related peer request`)}function $j(e,t,n,r,i){return{sessionId:i,mcpReq:{id:e,method:t,_meta:n?._meta,requestState:Gj(void 0),signal:r,send:(()=>Qj(`send`)),notify:()=>Qj(`notify`)}}}async function eM(e,t,n,r,i){if(!Xj(r)||typeof r.method!=`string`)throw new YO(JO.InvalidResult,`Invalid input request '${n}': each inputRequests entry must be an embedded request object with a method`,{key:n});let a=r.method;if(!t.hasInputRequestMethod(a))throw new YO(JO.InvalidResult,`Invalid input request '${n}': '${a}' is not an embedded request the ${t.era} revision defines (expected elicitation/create, sampling/createMessage, or roots/list)`,{key:n,method:a});let o=e.getRequestHandler(a);if(o===void 0)throw new YO(JO.CapabilityNotSupported,`Cannot fulfil input request '${n}': no handler is registered for '${a}' on this client. Declare the corresponding capability and register a handler, or handle input_required results manually.`,{key:n,method:a});let s=Xj(r.params)?r.params:void 0;return await o({jsonrpc:`2.0`,id:n,method:a,...s!==void 0&&{params:s}},e.buildContext($j(n,a,s,i,e.sessionId)))}function tM(e,t){return{...e?.signal!==void 0&&{signal:e.signal},...e?.onprogress!==void 0&&{onprogress:e.onprogress},...e?.resetTimeoutOnProgress!==void 0&&{resetTimeoutOnProgress:e.resetTimeoutOnProgress},...e?.headers!==void 0&&{headers:e.headers},...t.timeout!==void 0&&{timeout:t.timeout},...t.maxTotalTimeout!==void 0&&{maxTotalTimeout:t.maxTotalTimeout},allowInputRequired:!0}}function nM(e,t,n,r){let{codec:i,request:a,options:o,flowStartedAt:s}=r,c={inputRequests:n.inputRequests,...n.requestState!==void 0&&{requestState:n.requestState}},l={dispatchInputRequest:(t,n,r)=>eM(e,i,t,n,r),retry:(e,t)=>r.retry(e,tM(o,t))};return Nj({config:t,method:a.method,originalParams:a.params,firstPayload:c,flowStartedAt:s,signal:o?.signal,requestOptions:{...o?.timeout!==void 0&&{timeout:o.timeout},...o?.maxTotalTimeout!==void 0&&{maxTotalTimeout:o.maxTotalTimeout},...o?.onprogress!==void 0&&{onprogress:o.onprogress}},hooks:l})}function rM(e){return{resultType:`input_required`,inputRequests:e.inputRequests,...e.requestState!==void 0&&{requestState:e.requestState}}}G((e=>{var t=/; *([!#$%&'*+.^_`|~0-9A-Za-z-]+) *= *("(?:[\u000b\u0020\u0021\u0023-\u005b\u005d-\u007e\u0080-\u00ff]|\\[\u000b\u0020-\u00ff])*"|[!#$%&'*+.^_`|~0-9A-Za-z-]+) */g,n=/\\([\u000b\u0020-\u00ff])/g,r=/^[!#$%&'*+.^_`|~0-9A-Za-z-]+\/[!#$%&'*+.^_`|~0-9A-Za-z-]+$/;e.parse=i;function i(e){if(!e)throw TypeError(`argument string is required`);var i=typeof e==`object`?a(e):e;if(typeof i!=`string`)throw TypeError(`argument string is required to be a string`);var s=i.indexOf(`;`),c=s===-1?i.trim():i.slice(0,s).trim();if(!r.test(c))throw TypeError(`invalid media type`);var l=new o(c.toLowerCase());if(s!==-1){var u,d,f;for(t.lastIndex=s;d=t.exec(i);){if(d.index!==s)throw TypeError(`invalid parameter format`);s+=d[0].length,u=d[1].toLowerCase(),f=d[2],f.charCodeAt(0)===34&&(f=f.slice(1,-1),f.indexOf(`\\`)!==-1&&(f=f.replace(n,`$1`))),l.parameters[u]=f}if(s!==i.length)throw TypeError(`invalid parameter format`)}return l}function a(e){var t;if(typeof e.getHeader==`function`?t=e.getHeader(`content-type`):typeof e.headers==`object`&&(t=e.headers&&e.headers[`content-type`]),typeof t!=`string`)throw TypeError(`content-type header is missing from object`);return t}function o(e){this.parameters=Object.create(null),this.type=e}}))();var iM=1e6,aM=1e6,oM=1e4,sM=1e6,cM=class e{static isTemplate(e){return/\{[^}\s]+\}/.test(e)}static validateLength(e,t,n){if(e.length>t)throw Error(`${n} exceeds maximum length of ${t} characters (got ${e.length})`)}template;parts;get variableNames(){return this.parts.flatMap(e=>typeof e==`string`?[]:e.names)}constructor(t){e.validateLength(t,iM,`Template`),this.template=t,this.parts=this.parse(t)}toString(){return this.template}parse(t){let n=[],r=``,i=0,a=0;for(;i<t.length;)if(t[i]===`{`){r&&=(n.push(r),``);let o=t.indexOf(`}`,i);if(o===-1)throw Error(`Unclosed template expression`);if(a++,a>oM)throw Error(`Template contains too many expressions (max ${oM})`);let s=t.slice(i+1,o),c=this.getOperator(s),l=s.includes(`*`),u=this.getNames(s),d=u[0];for(let t of u)e.validateLength(t,aM,`Variable name`);n.push({name:d,operator:c,names:u,exploded:l}),i=o+1}else r+=t[i],i++;return r&&n.push(r),n}getOperator(e){return[`+`,`#`,`.`,`/`,`?`,`&`].find(t=>e.startsWith(t))||``}getNames(e){let t=this.getOperator(e);return e.slice(t.length).split(`,`).map(e=>e.replace(`*`,``).trim()).filter(e=>e.length>0)}encodeValue(t,n){return e.validateLength(t,aM,`Variable value`),n===`+`||n===`#`?encodeURI(t):encodeURIComponent(t)}expandPart(e,t){if(e.operator===`?`||e.operator===`&`){let n=e.names.map(n=>{let r=t[n];return r===void 0?``:`${n}=${Array.isArray(r)?r.map(t=>this.encodeValue(t,e.operator)).join(`,`):this.encodeValue(r.toString(),e.operator)}`}).filter(e=>e.length>0);return n.length===0?``:(e.operator===`?`?`?`:`&`)+n.join(`&`)}if(e.names.length>1){let n=e.names.map(e=>t[e]).filter(e=>e!==void 0);return n.length===0?``:n.map(e=>Array.isArray(e)?e[0]:e).join(`,`)}let n=t[e.name];if(n===void 0)return``;let r=(Array.isArray(n)?n:[n]).map(t=>this.encodeValue(t,e.operator));switch(e.operator){case``:return r.join(`,`);case`+`:return r.join(`,`);case`#`:return`#`+r.join(`,`);case`.`:return`.`+r.join(`.`);case`/`:return`/`+r.join(`/`);default:return r.join(`,`)}}expand(e){let t=``,n=!1;for(let r of this.parts){if(typeof r==`string`){t+=r;continue}let i=this.expandPart(r,e);i&&(t+=(r.operator===`?`||r.operator===`&`)&&n?i.replace(`?`,`&`):i,(r.operator===`?`||r.operator===`&`)&&(n=!0))}return t}escapeRegExp(e){return e.replaceAll(/[.*+?^${}()|[\]\\]/g,String.raw`\$&`)}partToRegExp(t){let n=[];for(let n of t.names)e.validateLength(n,aM,`Variable name`);if(t.operator===`?`||t.operator===`&`){for(let e=0;e<t.names.length;e++){let r=t.names[e],i=e===0?`\\`+t.operator:`&`;n.push({pattern:i+this.escapeRegExp(r)+`=([^&]+)`,name:r})}return n}let r,i=t.name;switch(t.operator){case``:r=t.exploded?`([^/,]+(?:,[^/,]+)*)`:`([^/,]+)`;break;case`+`:case`#`:r=`(.+)`;break;case`.`:r=String.raw`\.([^/,]+)`;break;case`/`:r=`/`+(t.exploded?`([^/,]+(?:,[^/,]+)*)`:`([^/,]+)`);break;default:r=`([^/]+)`}return n.push({pattern:r,name:i}),n}match(t){e.validateLength(t,iM,`URI`);let n=`^`,r=[];for(let e of this.parts)if(typeof e==`string`)n+=this.escapeRegExp(e);else{let t=this.partToRegExp(e);for(let{pattern:i,name:a}of t)n+=i,r.push({name:a,exploded:e.exploded})}n+=`$`,e.validateLength(n,sM,`Generated regex pattern`);let i=new RegExp(n),a=t.match(i);if(!a)return null;let o={};for(let[e,t]of r.entries()){let{name:n,exploded:r}=t,i=a[e+1],s=n.replace(`*`,``);o[s]=r&&i.includes(`,`)?i.split(`,`):i}return o}};function lM(e,t){let n=typeof e;if(n!==typeof t)return!1;if(Array.isArray(e)){if(!Array.isArray(t))return!1;let n=e.length;if(n!==t.length)return!1;for(let r=0;r<n;r++)if(!lM(e[r],t[r]))return!1;return!0}if(n===`object`){if(!e||!t)return e===t;let n=Object.keys(e),r=Object.keys(t);if(n.length!==r.length)return!1;for(let r of n)if(!lM(e[r],t[r]))return!1;return!0}return e===t}function uM(e){return encodeURI(dM(e))}function dM(e){return e.replace(/~/g,`~0`).replace(/\//g,`~1`)}var fM={prefixItems:!0,items:!0,allOf:!0,anyOf:!0,oneOf:!0},pM={$defs:!0,definitions:!0,properties:!0,patternProperties:!0,dependentSchemas:!0},mM={id:!0,$id:!0,$ref:!0,$schema:!0,$anchor:!0,$vocabulary:!0,$comment:!0,default:!0,enum:!0,const:!0,required:!0,type:!0,maximum:!0,minimum:!0,exclusiveMaximum:!0,exclusiveMinimum:!0,multipleOf:!0,maxLength:!0,minLength:!0,pattern:!0,format:!0,maxItems:!0,minItems:!0,uniqueItems:!0,maxProperties:!0,minProperties:!0},hM=typeof self<`u`&&self.location&&self.location.origin!==`null`?new URL(self.location.origin+self.location.pathname+location.search):new URL(`https://github.com/cfworker`);function gM(e,t=Object.create(null),n=hM,r=``){if(e&&typeof e==`object`&&!Array.isArray(e)){let i=e.$id||e.id;if(i){let a=new URL(i,n.href);a.hash.length>1?t[a.href]=e:(a.hash=``,r===``?n=a:gM(e,t,n))}}else if(e!==!0&&e!==!1)return t;let i=n.href+(r?`#`+r:``);if(t[i]!==void 0)throw Error(`Duplicate schema URI "${i}".`);if(t[i]=e,e===!0||e===!1)return t;if(e.__absolute_uri__===void 0&&Object.defineProperty(e,"__absolute_uri__",{enumerable:!1,value:i}),e.$ref&&e.__absolute_ref__===void 0){let t=new URL(e.$ref,n.href);t.hash=t.hash,Object.defineProperty(e,"__absolute_ref__",{enumerable:!1,value:t.href})}if(e.$recursiveRef&&e.__absolute_recursive_ref__===void 0){let t=new URL(e.$recursiveRef,n.href);t.hash=t.hash,Object.defineProperty(e,"__absolute_recursive_ref__",{enumerable:!1,value:t.href})}if(e.$anchor){let r=new URL(`#`+e.$anchor,n.href);t[r.href]=e}for(let i in e){if(mM[i])continue;let a=`${r}/${uM(i)}`,o=e[i];if(Array.isArray(o)){if(fM[i]){let e=o.length;for(let r=0;r<e;r++)gM(o[r],t,n,`${a}/${r}`)}}else if(pM[i])for(let e in o)gM(o[e],t,n,`${a}/${uM(e)}`);else gM(o,t,n,a)}return t}var _M=/^(\d\d\d\d)-(\d\d)-(\d\d)$/,vM=[0,31,28,31,30,31,30,31,31,30,31,30,31],yM=/^(\d\d):(\d\d):(\d\d)(\.\d+)?(z|[+-]\d\d(?::?\d\d)?)?$/i,bM=/^(?=.{1,253}\.?$)[a-z0-9](?:[a-z0-9-]{0,61}[a-z0-9])?(?:\.[a-z0-9](?:[-0-9a-z]{0,61}[0-9a-z])?)*\.?$/i,xM=/^(?:[a-z][a-z0-9+\-.]*:)?(?:\/?\/(?:(?:[a-z0-9\-._~!$&'()*+,;=:]|%[0-9a-f]{2})*@)?(?:\[(?:(?:(?:(?:[0-9a-f]{1,4}:){6}|::(?:[0-9a-f]{1,4}:){5}|(?:[0-9a-f]{1,4})?::(?:[0-9a-f]{1,4}:){4}|(?:(?:[0-9a-f]{1,4}:){0,1}[0-9a-f]{1,4})?::(?:[0-9a-f]{1,4}:){3}|(?:(?:[0-9a-f]{1,4}:){0,2}[0-9a-f]{1,4})?::(?:[0-9a-f]{1,4}:){2}|(?:(?:[0-9a-f]{1,4}:){0,3}[0-9a-f]{1,4})?::[0-9a-f]{1,4}:|(?:(?:[0-9a-f]{1,4}:){0,4}[0-9a-f]{1,4})?::)(?:[0-9a-f]{1,4}:[0-9a-f]{1,4}|(?:(?:25[0-5]|2[0-4]\d|[01]?\d\d?)\.){3}(?:25[0-5]|2[0-4]\d|[01]?\d\d?))|(?:(?:[0-9a-f]{1,4}:){0,5}[0-9a-f]{1,4})?::[0-9a-f]{1,4}|(?:(?:[0-9a-f]{1,4}:){0,6}[0-9a-f]{1,4})?::)|[Vv][0-9a-f]+\.[a-z0-9\-._~!$&'()*+,;=:]+)\]|(?:(?:25[0-5]|2[0-4]\d|[01]?\d\d?)\.){3}(?:25[0-5]|2[0-4]\d|[01]?\d\d?)|(?:[a-z0-9\-._~!$&'"()*+,;=]|%[0-9a-f]{2})*)(?::\d*)?(?:\/(?:[a-z0-9\-._~!$&'"()*+,;=:@]|%[0-9a-f]{2})*)*|\/(?:(?:[a-z0-9\-._~!$&'"()*+,;=:@]|%[0-9a-f]{2})+(?:\/(?:[a-z0-9\-._~!$&'"()*+,;=:@]|%[0-9a-f]{2})*)*)?|(?:[a-z0-9\-._~!$&'"()*+,;=:@]|%[0-9a-f]{2})+(?:\/(?:[a-z0-9\-._~!$&'"()*+,;=:@]|%[0-9a-f]{2})*)*)?(?:\?(?:[a-z0-9\-._~!$&'"()*+,;=:@/?]|%[0-9a-f]{2})*)?(?:#(?:[a-z0-9\-._~!$&'"()*+,;=:@/?]|%[0-9a-f]{2})*)?$/i,SM=/^(?:(?:[^\x00-\x20"'<>%\\^`{|}]|%[0-9a-f]{2})|\{[+#./;?&=,!@|]?(?:[a-z0-9_]|%[0-9a-f]{2})+(?::[1-9][0-9]{0,3}|\*)?(?:,(?:[a-z0-9_]|%[0-9a-f]{2})+(?::[1-9][0-9]{0,3}|\*)?)*\})*$/i,CM=/^(?:(?:https?|ftp):\/\/)(?:\S+(?::\S*)?@)?(?:(?!10(?:\.\d{1,3}){3})(?!127(?:\.\d{1,3}){3})(?!169\.254(?:\.\d{1,3}){2})(?!192\.168(?:\.\d{1,3}){2})(?!172\.(?:1[6-9]|2\d|3[0-1])(?:\.\d{1,3}){2})(?:[1-9]\d?|1\d\d|2[01]\d|22[0-3])(?:\.(?:1?\d{1,2}|2[0-4]\d|25[0-5])){2}(?:\.(?:[1-9]\d?|1\d\d|2[0-4]\d|25[0-4]))|(?:(?:[a-z\u{00a1}-\u{ffff}0-9]+-?)*[a-z\u{00a1}-\u{ffff}0-9]+)(?:\.(?:[a-z\u{00a1}-\u{ffff}0-9]+-?)*[a-z\u{00a1}-\u{ffff}0-9]+)*(?:\.(?:[a-z\u{00a1}-\u{ffff}]{2,})))(?::\d{2,5})?(?:\/[^\s]*)?$/iu,wM=/^(?:urn:uuid:)?[0-9a-f]{8}-(?:[0-9a-f]{4}-){3}[0-9a-f]{12}$/i,TM=/^(?:\/(?:[^~/]|~0|~1)*)*$/,EM=/^#(?:\/(?:[a-z0-9_\-.!$&'()*+,;:=@]|%[0-9a-f]{2}|~0|~1)*)*$/i,DM=/^(?:0|[1-9][0-9]*)(?:#|(?:\/(?:[^~/]|~0|~1)*)*)$/,OM=e=>{if(e[0]===`"`)return!1;let[t,n,...r]=e.split(`@`);return!t||!n||r.length!==0||t.length>64||n.length>253||t[0]===`.`||t.endsWith(`.`)||t.includes(`..`)||!/^[a-z0-9.-]+$/i.test(n)||!/^[a-z0-9.!#$%&'*+/=?^_`{|}~-]+$/i.test(t)?!1:n.split(`.`).every(e=>/^[a-z0-9]([a-z0-9-]{0,61}[a-z0-9])?$/i.test(e))},kM=/^(?:(?:25[0-5]|2[0-4]\d|[01]?\d\d?)\.){3}(?:25[0-5]|2[0-4]\d|[01]?\d\d?)$/,AM=/^((([0-9a-f]{1,4}:){7}([0-9a-f]{1,4}|:))|(([0-9a-f]{1,4}:){6}(:[0-9a-f]{1,4}|((25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)(\.(25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)){3})|:))|(([0-9a-f]{1,4}:){5}(((:[0-9a-f]{1,4}){1,2})|:((25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)(\.(25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)){3})|:))|(([0-9a-f]{1,4}:){4}(((:[0-9a-f]{1,4}){1,3})|((:[0-9a-f]{1,4})?:((25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)(\.(25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)){3}))|:))|(([0-9a-f]{1,4}:){3}(((:[0-9a-f]{1,4}){1,4})|((:[0-9a-f]{1,4}){0,2}:((25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)(\.(25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)){3}))|:))|(([0-9a-f]{1,4}:){2}(((:[0-9a-f]{1,4}){1,5})|((:[0-9a-f]{1,4}){0,3}:((25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)(\.(25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)){3}))|:))|(([0-9a-f]{1,4}:){1}(((:[0-9a-f]{1,4}){1,6})|((:[0-9a-f]{1,4}){0,4}:((25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)(\.(25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)){3}))|:))|(:(((:[0-9a-f]{1,4}){1,7})|((:[0-9a-f]{1,4}){0,5}:((25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)(\.(25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)){3}))|:)))$/i,jM=e=>e.length>1&&e.length<80&&(/^P\d+([.,]\d+)?W$/.test(e)||/^P[\dYMDTHS]*(\d[.,]\d+)?[YMDHS]$/.test(e)&&/^P([.,\d]+Y)?([.,\d]+M)?([.,\d]+D)?(T([.,\d]+H)?([.,\d]+M)?([.,\d]+S)?)?$/.test(e));function MM(e){return e.test.bind(e)}var NM={date:FM,time:IM.bind(void 0,!1),"date-time":RM,duration:jM,uri:VM,"uri-reference":MM(xM),"uri-template":MM(SM),url:MM(CM),email:OM,hostname:MM(bM),ipv4:MM(kM),ipv6:MM(AM),regex:UM,uuid:MM(wM),"json-pointer":MM(TM),"json-pointer-uri-fragment":MM(EM),"relative-json-pointer":MM(DM)};function PM(e){return e%4==0&&(e%100!=0||e%400==0)}function FM(e){let t=e.match(_M);if(!t)return!1;let n=+t[1],r=+t[2],i=+t[3];return r>=1&&r<=12&&i>=1&&i<=(r==2&&PM(n)?29:vM[r])}function IM(e,t){let n=t.match(yM);if(!n)return!1;let r=+n[1],i=+n[2],a=+n[3],o=!!n[5];return(r<=23&&i<=59&&a<=59||r==23&&i==59&&a==60)&&(!e||o)}var LM=/t|\s/i;function RM(e){let t=e.split(LM);return t.length==2&&FM(t[0])&&IM(!0,t[1])}var zM=/\/|:/,BM=/^(?:[a-z][a-z0-9+\-.]*:)(?:\/?\/(?:(?:[a-z0-9\-._~!$&'()*+,;=:]|%[0-9a-f]{2})*@)?(?:\[(?:(?:(?:(?:[0-9a-f]{1,4}:){6}|::(?:[0-9a-f]{1,4}:){5}|(?:[0-9a-f]{1,4})?::(?:[0-9a-f]{1,4}:){4}|(?:(?:[0-9a-f]{1,4}:){0,1}[0-9a-f]{1,4})?::(?:[0-9a-f]{1,4}:){3}|(?:(?:[0-9a-f]{1,4}:){0,2}[0-9a-f]{1,4})?::(?:[0-9a-f]{1,4}:){2}|(?:(?:[0-9a-f]{1,4}:){0,3}[0-9a-f]{1,4})?::[0-9a-f]{1,4}:|(?:(?:[0-9a-f]{1,4}:){0,4}[0-9a-f]{1,4})?::)(?:[0-9a-f]{1,4}:[0-9a-f]{1,4}|(?:(?:25[0-5]|2[0-4]\d|[01]?\d\d?)\.){3}(?:25[0-5]|2[0-4]\d|[01]?\d\d?))|(?:(?:[0-9a-f]{1,4}:){0,5}[0-9a-f]{1,4})?::[0-9a-f]{1,4}|(?:(?:[0-9a-f]{1,4}:){0,6}[0-9a-f]{1,4})?::)|[Vv][0-9a-f]+\.[a-z0-9\-._~!$&'()*+,;=:]+)\]|(?:(?:25[0-5]|2[0-4]\d|[01]?\d\d?)\.){3}(?:25[0-5]|2[0-4]\d|[01]?\d\d?)|(?:[a-z0-9\-._~!$&'()*+,;=]|%[0-9a-f]{2})*)(?::\d*)?(?:\/(?:[a-z0-9\-._~!$&'()*+,;=:@]|%[0-9a-f]{2})*)*|\/(?:(?:[a-z0-9\-._~!$&'()*+,;=:@]|%[0-9a-f]{2})+(?:\/(?:[a-z0-9\-._~!$&'()*+,;=:@]|%[0-9a-f]{2})*)*)?|(?:[a-z0-9\-._~!$&'()*+,;=:@]|%[0-9a-f]{2})+(?:\/(?:[a-z0-9\-._~!$&'()*+,;=:@]|%[0-9a-f]{2})*)*)(?:\?(?:[a-z0-9\-._~!$&'()*+,;=:@/?]|%[0-9a-f]{2})*)?(?:#(?:[a-z0-9\-._~!$&'()*+,;=:@/?]|%[0-9a-f]{2})*)?$/i;function VM(e){return zM.test(e)&&BM.test(e)}var HM=/[^\\]\\Z/;function UM(e){if(HM.test(e))return!1;try{return new RegExp(e,`u`),!0}catch{return!1}}function WM(e){let t=0,n=e.length,r=0,i;for(;r<n;)t++,i=e.charCodeAt(r++),i>=55296&&i<=56319&&r<n&&(i=e.charCodeAt(r),(i&64512)==56320&&r++);return t}function GM(e,t,n=`2019-09`,r=gM(t),i=!0,a=null,o=`#`,s=`#`,c=Object.create(null)){if(t===!0)return{valid:!0,errors:[]};if(t===!1)return{valid:!1,errors:[{instanceLocation:o,keyword:`false`,keywordLocation:o,error:`False boolean schema.`}]};let l=typeof e,u;switch(l){case`boolean`:case`number`:case`string`:u=l;break;case`object`:u=e===null?`null`:Array.isArray(e)?`array`:`object`;break;default:throw Error(`Instances of "${l}" type are not supported.`)}let{$ref:d,$recursiveRef:f,$recursiveAnchor:p,type:m,const:h,enum:g,required:_,not:v,anyOf:y,allOf:b,oneOf:x,if:S,then:C,else:w,format:T,properties:E,patternProperties:D,additionalProperties:O,unevaluatedProperties:k,minProperties:A,maxProperties:j,propertyNames:M,dependentRequired:N,dependentSchemas:ee,dependencies:te,prefixItems:P,items:F,additionalItems:I,unevaluatedItems:ne,contains:re,minContains:ie,maxContains:ae,minItems:oe,maxItems:se,uniqueItems:ce,minimum:le,maximum:ue,exclusiveMinimum:de,exclusiveMaximum:fe,multipleOf:pe,minLength:me,maxLength:he,pattern:ge,__absolute_ref__:_e,__absolute_recursive_ref__:ve}=t,ye=[];if(p===!0&&a===null&&(a=t),f===`#`){let l=a===null?r[ve]:a,u=`${s}/$recursiveRef`,d=GM(e,a===null?t:a,n,r,i,l,o,u,c);d.valid||ye.push({instanceLocation:o,keyword:`$recursiveRef`,keywordLocation:u,error:`A subschema had errors.`},...d.errors)}if(d!==void 0){let t=r[_e||d];if(t===void 0){let e=`Unresolved $ref "${d}".`;throw _e&&_e!==d&&(e+=` Absolute URI "${_e}".`),e+=`\nKnown schemas:\n- ${Object.keys(r).join(`
126
- - `)}`,Error(e)}let l=`${s}/$ref`,u=GM(e,t,n,r,i,a,o,l,c);if(u.valid||ye.push({instanceLocation:o,keyword:`$ref`,keywordLocation:l,error:`A subschema had errors.`},...u.errors),n===`4`||n===`7`)return{valid:ye.length===0,errors:ye}}if(Array.isArray(m)){let t=m.length,n=!1;for(let r=0;r<t;r++)if(u===m[r]||m[r]===`integer`&&u===`number`&&e%1==0&&e===e){n=!0;break}n||ye.push({instanceLocation:o,keyword:`type`,keywordLocation:`${s}/type`,error:`Instance type "${u}" is invalid. Expected "${m.join(`", "`)}".`})}else m===`integer`?(u!==`number`||e%1||e!==e)&&ye.push({instanceLocation:o,keyword:`type`,keywordLocation:`${s}/type`,error:`Instance type "${u}" is invalid. Expected "${m}".`}):m!==void 0&&u!==m&&ye.push({instanceLocation:o,keyword:`type`,keywordLocation:`${s}/type`,error:`Instance type "${u}" is invalid. Expected "${m}".`});if(h!==void 0&&(u===`object`||u===`array`?lM(e,h)||ye.push({instanceLocation:o,keyword:`const`,keywordLocation:`${s}/const`,error:`Instance does not match ${JSON.stringify(h)}.`}):e!==h&&ye.push({instanceLocation:o,keyword:`const`,keywordLocation:`${s}/const`,error:`Instance does not match ${JSON.stringify(h)}.`})),g!==void 0&&(u===`object`||u===`array`?g.some(t=>lM(e,t))||ye.push({instanceLocation:o,keyword:`enum`,keywordLocation:`${s}/enum`,error:`Instance does not match any of ${JSON.stringify(g)}.`}):g.some(t=>e===t)||ye.push({instanceLocation:o,keyword:`enum`,keywordLocation:`${s}/enum`,error:`Instance does not match any of ${JSON.stringify(g)}.`})),v!==void 0){let t=`${s}/not`;GM(e,v,n,r,i,a,o,t).valid&&ye.push({instanceLocation:o,keyword:`not`,keywordLocation:t,error:`Instance matched "not" schema.`})}let be=[];if(y!==void 0){let t=`${s}/anyOf`,l=ye.length,u=!1;for(let s=0;s<y.length;s++){let l=y[s],d=Object.create(c),f=GM(e,l,n,r,i,p===!0?a:null,o,`${t}/${s}`,d);ye.push(...f.errors),u||=f.valid,f.valid&&be.push(d)}u?ye.length=l:ye.splice(l,0,{instanceLocation:o,keyword:`anyOf`,keywordLocation:t,error:`Instance does not match any subschemas.`})}if(b!==void 0){let t=`${s}/allOf`,l=ye.length,u=!0;for(let s=0;s<b.length;s++){let l=b[s],d=Object.create(c),f=GM(e,l,n,r,i,p===!0?a:null,o,`${t}/${s}`,d);ye.push(...f.errors),u&&=f.valid,f.valid&&be.push(d)}u?ye.length=l:ye.splice(l,0,{instanceLocation:o,keyword:`allOf`,keywordLocation:t,error:`Instance does not match every subschema.`})}if(x!==void 0){let t=`${s}/oneOf`,l=ye.length,u=x.filter((s,l)=>{let u=Object.create(c),d=GM(e,s,n,r,i,p===!0?a:null,o,`${t}/${l}`,u);return ye.push(...d.errors),d.valid&&be.push(u),d.valid}).length;u===1?ye.length=l:ye.splice(l,0,{instanceLocation:o,keyword:`oneOf`,keywordLocation:t,error:`Instance does not match exactly one subschema (${u} matches).`})}if((u===`object`||u===`array`)&&Object.assign(c,...be),S!==void 0){let t=`${s}/if`;if(GM(e,S,n,r,i,a,o,t,c).valid){if(C!==void 0){let l=GM(e,C,n,r,i,a,o,`${s}/then`,c);l.valid||ye.push({instanceLocation:o,keyword:`if`,keywordLocation:t,error:`Instance does not match "then" schema.`},...l.errors)}}else if(w!==void 0){let l=GM(e,w,n,r,i,a,o,`${s}/else`,c);l.valid||ye.push({instanceLocation:o,keyword:`if`,keywordLocation:t,error:`Instance does not match "else" schema.`},...l.errors)}}if(u===`object`){if(_!==void 0)for(let t of _)t in e||ye.push({instanceLocation:o,keyword:`required`,keywordLocation:`${s}/required`,error:`Instance does not have required property "${t}".`});let t=Object.keys(e);if(A!==void 0&&t.length<A&&ye.push({instanceLocation:o,keyword:`minProperties`,keywordLocation:`${s}/minProperties`,error:`Instance does not have at least ${A} properties.`}),j!==void 0&&t.length>j&&ye.push({instanceLocation:o,keyword:`maxProperties`,keywordLocation:`${s}/maxProperties`,error:`Instance does not have at least ${j} properties.`}),M!==void 0){let t=`${s}/propertyNames`;for(let s in e){let e=`${o}/${uM(s)}`,c=GM(s,M,n,r,i,a,e,t);c.valid||ye.push({instanceLocation:o,keyword:`propertyNames`,keywordLocation:t,error:`Property name "${s}" does not match schema.`},...c.errors)}}if(N!==void 0){let t=`${s}/dependantRequired`;for(let n in N)if(n in e){let r=N[n];for(let i of r)i in e||ye.push({instanceLocation:o,keyword:`dependentRequired`,keywordLocation:t,error:`Instance has "${n}" but does not have "${i}".`})}}if(ee!==void 0)for(let t in ee){let l=`${s}/dependentSchemas`;if(t in e){let s=GM(e,ee[t],n,r,i,a,o,`${l}/${uM(t)}`,c);s.valid||ye.push({instanceLocation:o,keyword:`dependentSchemas`,keywordLocation:l,error:`Instance has "${t}" but does not match dependant schema.`},...s.errors)}}if(te!==void 0){let t=`${s}/dependencies`;for(let s in te)if(s in e){let c=te[s];if(Array.isArray(c))for(let n of c)n in e||ye.push({instanceLocation:o,keyword:`dependencies`,keywordLocation:t,error:`Instance has "${s}" but does not have "${n}".`});else{let l=GM(e,c,n,r,i,a,o,`${t}/${uM(s)}`);l.valid||ye.push({instanceLocation:o,keyword:`dependencies`,keywordLocation:t,error:`Instance has "${s}" but does not match dependant schema.`},...l.errors)}}}let l=Object.create(null),u=!1;if(E!==void 0){let t=`${s}/properties`;for(let s in E){if(!(s in e))continue;let d=`${o}/${uM(s)}`,f=GM(e[s],E[s],n,r,i,a,d,`${t}/${uM(s)}`);if(f.valid)c[s]=l[s]=!0;else if(u=i,ye.push({instanceLocation:o,keyword:`properties`,keywordLocation:t,error:`Property "${s}" does not match schema.`},...f.errors),u)break}}if(!u&&D!==void 0){let t=`${s}/patternProperties`;for(let s in D){let d=new RegExp(s,`u`),f=D[s];for(let p in e){if(!d.test(p))continue;let m=`${o}/${uM(p)}`,h=GM(e[p],f,n,r,i,a,m,`${t}/${uM(s)}`);h.valid?c[p]=l[p]=!0:(u=i,ye.push({instanceLocation:o,keyword:`patternProperties`,keywordLocation:t,error:`Property "${p}" matches pattern "${s}" but does not match associated schema.`},...h.errors))}}}if(!u&&O!==void 0){let t=`${s}/additionalProperties`;for(let s in e){if(l[s])continue;let d=`${o}/${uM(s)}`,f=GM(e[s],O,n,r,i,a,d,t);f.valid?c[s]=!0:(u=i,ye.push({instanceLocation:o,keyword:`additionalProperties`,keywordLocation:t,error:`Property "${s}" does not match additional properties schema.`},...f.errors))}}else if(!u&&k!==void 0){let t=`${s}/unevaluatedProperties`;for(let s in e)if(!c[s]){let l=`${o}/${uM(s)}`,u=GM(e[s],k,n,r,i,a,l,t);u.valid?c[s]=!0:ye.push({instanceLocation:o,keyword:`unevaluatedProperties`,keywordLocation:t,error:`Property "${s}" does not match unevaluated properties schema.`},...u.errors)}}}else if(u===`array`){se!==void 0&&e.length>se&&ye.push({instanceLocation:o,keyword:`maxItems`,keywordLocation:`${s}/maxItems`,error:`Array has too many items (${e.length} > ${se}).`}),oe!==void 0&&e.length<oe&&ye.push({instanceLocation:o,keyword:`minItems`,keywordLocation:`${s}/minItems`,error:`Array has too few items (${e.length} < ${oe}).`});let t=e.length,l=0,u=!1;if(P!==void 0){let d=`${s}/prefixItems`,f=Math.min(P.length,t);for(;l<f;l++){let t=GM(e[l],P[l],n,r,i,a,`${o}/${l}`,`${d}/${l}`);if(c[l]=!0,!t.valid&&(u=i,ye.push({instanceLocation:o,keyword:`prefixItems`,keywordLocation:d,error:`Items did not match schema.`},...t.errors),u))break}}if(F!==void 0){let d=`${s}/items`;if(Array.isArray(F)){let s=Math.min(F.length,t);for(;l<s;l++){let t=GM(e[l],F[l],n,r,i,a,`${o}/${l}`,`${d}/${l}`);if(c[l]=!0,!t.valid&&(u=i,ye.push({instanceLocation:o,keyword:`items`,keywordLocation:d,error:`Items did not match schema.`},...t.errors),u))break}}else for(;l<t;l++){let t=GM(e[l],F,n,r,i,a,`${o}/${l}`,d);if(c[l]=!0,!t.valid&&(u=i,ye.push({instanceLocation:o,keyword:`items`,keywordLocation:d,error:`Items did not match schema.`},...t.errors),u))break}if(!u&&I!==void 0){let d=`${s}/additionalItems`;for(;l<t;l++){let t=GM(e[l],I,n,r,i,a,`${o}/${l}`,d);c[l]=!0,t.valid||(u=i,ye.push({instanceLocation:o,keyword:`additionalItems`,keywordLocation:d,error:`Items did not match additional items schema.`},...t.errors))}}}if(re!==void 0)if(t===0&&ie===void 0)ye.push({instanceLocation:o,keyword:`contains`,keywordLocation:`${s}/contains`,error:`Array is empty. It must contain at least one item matching the schema.`});else if(ie!==void 0&&t<ie)ye.push({instanceLocation:o,keyword:`minContains`,keywordLocation:`${s}/minContains`,error:`Array has less items (${t}) than minContains (${ie}).`});else{let l=`${s}/contains`,u=ye.length,d=0;for(let s=0;s<t;s++){let t=GM(e[s],re,n,r,i,a,`${o}/${s}`,l);t.valid?(c[s]=!0,d++):ye.push(...t.errors)}d>=(ie||0)&&(ye.length=u),ie===void 0&&ae===void 0&&d===0?ye.splice(u,0,{instanceLocation:o,keyword:`contains`,keywordLocation:l,error:`Array does not contain item matching schema.`}):ie!==void 0&&d<ie?ye.push({instanceLocation:o,keyword:`minContains`,keywordLocation:`${s}/minContains`,error:`Array must contain at least ${ie} items matching schema. Only ${d} items were found.`}):ae!==void 0&&d>ae&&ye.push({instanceLocation:o,keyword:`maxContains`,keywordLocation:`${s}/maxContains`,error:`Array may contain at most ${ae} items matching schema. ${d} items were found.`})}if(!u&&ne!==void 0){let u=`${s}/unevaluatedItems`;for(;l<t;l++){if(c[l])continue;let t=GM(e[l],ne,n,r,i,a,`${o}/${l}`,u);c[l]=!0,t.valid||ye.push({instanceLocation:o,keyword:`unevaluatedItems`,keywordLocation:u,error:`Items did not match unevaluated items schema.`},...t.errors)}}if(ce)for(let n=0;n<t;n++){let r=e[n],i=typeof r==`object`&&!!r;for(let a=0;a<t;a++){if(n===a)continue;let t=e[a];(r===t||i&&typeof t==`object`&&t&&lM(r,t))&&(ye.push({instanceLocation:o,keyword:`uniqueItems`,keywordLocation:`${s}/uniqueItems`,error:`Duplicate items at indexes ${n} and ${a}.`}),n=2**53-1,a=2**53-1)}}}else if(u===`number`){if(n===`4`?(le!==void 0&&(de===!0&&e<=le||e<le)&&ye.push({instanceLocation:o,keyword:`minimum`,keywordLocation:`${s}/minimum`,error:`${e} is less than ${de?`or equal to `:``} ${le}.`}),ue!==void 0&&(fe===!0&&e>=ue||e>ue)&&ye.push({instanceLocation:o,keyword:`maximum`,keywordLocation:`${s}/maximum`,error:`${e} is greater than ${fe?`or equal to `:``} ${ue}.`})):(le!==void 0&&e<le&&ye.push({instanceLocation:o,keyword:`minimum`,keywordLocation:`${s}/minimum`,error:`${e} is less than ${le}.`}),ue!==void 0&&e>ue&&ye.push({instanceLocation:o,keyword:`maximum`,keywordLocation:`${s}/maximum`,error:`${e} is greater than ${ue}.`}),de!==void 0&&e<=de&&ye.push({instanceLocation:o,keyword:`exclusiveMinimum`,keywordLocation:`${s}/exclusiveMinimum`,error:`${e} is less than ${de}.`}),fe!==void 0&&e>=fe&&ye.push({instanceLocation:o,keyword:`exclusiveMaximum`,keywordLocation:`${s}/exclusiveMaximum`,error:`${e} is greater than or equal to ${fe}.`})),pe!==void 0){let t=e%pe;Math.abs(0-t)>=1.1920929e-7&&Math.abs(pe-t)>=1.1920929e-7&&ye.push({instanceLocation:o,keyword:`multipleOf`,keywordLocation:`${s}/multipleOf`,error:`${e} is not a multiple of ${pe}.`})}}else if(u===`string`){let t=me===void 0&&he===void 0?0:WM(e);me!==void 0&&t<me&&ye.push({instanceLocation:o,keyword:`minLength`,keywordLocation:`${s}/minLength`,error:`String is too short (${t} < ${me}).`}),he!==void 0&&t>he&&ye.push({instanceLocation:o,keyword:`maxLength`,keywordLocation:`${s}/maxLength`,error:`String is too long (${t} > ${he}).`}),ge!==void 0&&!new RegExp(ge,`u`).test(e)&&ye.push({instanceLocation:o,keyword:`pattern`,keywordLocation:`${s}/pattern`,error:`String does not match pattern.`}),T!==void 0&&NM[T]&&!NM[T](e)&&ye.push({instanceLocation:o,keyword:`format`,keywordLocation:`${s}/format`,error:`String does not match format "${T}".`})}return{valid:ye.length===0,errors:ye}}var KM=class{schema;draft;shortCircuit;lookup;constructor(e,t=`2019-09`,n=!0){this.schema=e,this.draft=t,this.shortCircuit=n,this.lookup=gM(e)}validate(e){return GM(e,this.schema,this.draft,this.lookup,this.shortCircuit)}addSchema(e,t){t&&(e={...e,$id:t}),gM(e,this.lookup)}},qM=class{shortcircuit;draft;constructor(e){this.shortcircuit=e?.shortcircuit??!0,this.draft=e?.draft}_draftFor(e){let t=fy(e,`pass an explicit { draft } to CfWorkerJsonSchemaValidator to validate other dialects.`);return t===`draft-7`?`7`:t}getValidator(e){let t=new KM(e,this.draft??this._draftFor(e),this.shortcircuit);return e=>{let n=t.validate(e);return n.valid?{valid:!0,data:e,errorMessage:void 0}:{valid:!1,data:void 0,errorMessage:n.errors.map(e=>`${e.instanceLocation}: ${e.error}`).join(`; `)}}}},JM=globalThis.crypto;async function YM(e){return(await JM).getRandomValues(new Uint8Array(e))}async function XM(e){let t=``;for(;t.length<e;){let n=await YM(e-t.length);for(let e of n)e<198&&(t+=`abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ0123456789-._~`[e%66])}return t}async function ZM(e){return await XM(e)}async function QM(e){let t=await(await JM).subtle.digest(`SHA-256`,new TextEncoder().encode(e));return btoa(String.fromCharCode(...new Uint8Array(t))).replace(/\//g,`_`).replace(/\+/g,`-`).replace(/=/g,``)}async function $M(e){if(e||=43,e<43||e>128)throw`Expected a length between 43 and 128. Received ${e}.`;let t=await ZM(e);return{code_verifier:t,code_challenge:await QM(t)}}var eN=`modulepreload`,tN=function(e){return`/`+e},nN={},rN=function(e,t,n){let r=Promise.resolve();if(t&&t.length>0){let e=document.getElementsByTagName(`link`),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?import.meta.resolve(e):new URL(e,import.meta.url).href}r=o(t.map(t=>{if(t=tN(t,n),t=s(t),t in nN)return;nN[t]=!0;let r=t.endsWith(`.css`);for(let n=e.length-1;n>=0;n--){let i=e[n];if(i.href===t&&(!r||i.rel===`stylesheet`))return}let i=document.createElement(`link`);if(i.rel=r?`stylesheet`:eN,r||(i.as=`script`),i.crossOrigin=``,i.href=t,a&&i.setAttribute(`nonce`,a),document.head.appendChild(i),r)return new Promise((e,n)=>{i.addEventListener(`load`,e),i.addEventListener(`error`,()=>n(Error(`Unable to preload CSS for ${t}`)))})}))}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)})},iN=class extends Error{static{Object.defineProperty(this,"mcpBrand",{value:`mcp.OAuthClientFlowError`})}static[Symbol.hasInstance](e){return GO(this,e)}static isInstance(e){if(typeof this!=`function`)throw TypeError("isInstance must be called on the class (e.g. `SdkError.isInstance(value)`); for callbacks use `v => SdkError.isInstance(v)`");return GO(this,e)}constructor(e){super(e),this.name=new.target.name,WO(this,new.target)}},aN=class extends iN{static{Object.defineProperty(this,"mcpBrand",{value:`mcp.IssuerMismatchError`})}kind;expected;received;constructor(e,t,n){super(`Issuer mismatch in ${e===`metadata`?`authorization server metadata (RFC 8414 §3.3)`:`authorization response (RFC 9207)`}: expected ${JSON.stringify(t)}, received ${JSON.stringify(n)}`),this.kind=e,this.expected=t,this.received=n}},oN=class extends iN{static{Object.defineProperty(this,"mcpBrand",{value:`mcp.RegistrationRejectedError`})}status;body;submittedMetadata;constructor(e){super(`Dynamic Client Registration rejected (HTTP ${e.status}): ${e.body}`),this.status=e.status,this.body=e.body,this.submittedMetadata=e.submittedMetadata}},sN=class extends iN{static{Object.defineProperty(this,"mcpBrand",{value:`mcp.InsecureTokenEndpointError`})}tokenEndpoint;constructor(e){super(`Refusing to send credentials to non-https token endpoint '${e}'. OAuth token requests MUST use TLS (localhost / 127.0.0.1 / ::1 are exempt).`),this.tokenEndpoint=e}},cN=class extends iN{static{Object.defineProperty(this,"mcpBrand",{value:`mcp.AuthorizationServerMismatchError`})}constructor(e,t){super(`Authorization server changed between redirect and callback (redirected to ${JSON.stringify(e)}, callback resolved ${JSON.stringify(t)}); refusing to send authorization_code/code_verifier to a different token endpoint`),this.recordedIssuer=e,this.currentIssuer=t}};(class extends iN{static{Object.defineProperty(this,"mcpBrand",{value:`mcp.InsufficientScopeError`})}requiredScope;resourceMetadataUrl;errorDescription;constructor(e){super(`Insufficient scope${e.requiredScope?`: required "${e.requiredScope}"`:``}`),this.requiredScope=e.requiredScope,this.resourceMetadataUrl=e.resourceMetadataUrl,this.errorDescription=e.errorDescription}});function lN(e,t,n){if(e!==void 0)return e.issuer===void 0?(n?.canPersistStamp!==!1&&console.warn(`[mcp-sdk] SEP-2352: stored OAuth credential has no 'issuer' stamp (pre-upgrade storage or provider not round-tripping the value). SEP-2352 isolation is inactive for this read; ensure your provider round-trips the issuer field.`),e):uN(e.issuer,t)?e:void 0}function uN(e,t){return e===t||e.endsWith(`/`)&&e.slice(0,-1)===t||t.endsWith(`/`)&&t.slice(0,-1)===e}var dN=class extends Error{static{Object.defineProperty(this,"mcpBrand",{value:`mcp.UnauthorizedError`})}static[Symbol.hasInstance](e){return GO(this,e)}static isInstance(e){if(typeof this!=`function`)throw TypeError("isInstance must be called on the class (e.g. `SdkError.isInstance(value)`); for callbacks use `v => SdkError.isInstance(v)`");return GO(this,e)}constructor(e){super(e??`Unauthorized`),this.name=`UnauthorizedError`,WO(this,new.target)}};function fN(e){return e?.authorization_response_iss_parameter_supported===!0}function pN({iss:e,expectedIssuer:t,issParameterSupported:n}){if(t!==void 0){if(e===void 0){if(n)throw new aN(`authorization_response`,t,void 0);return}if(e!==t)throw new aN(`authorization_response`,t,e)}}function mN(...e){let t=new Set;for(let n of e)if(n)for(let e of n.split(/\s+/))e&&t.add(e);return t.size>0?[...t].join(` `):void 0}function hN(e,t){if(!e)return!1;let n=new Set((t??``).split(/\s+/).filter(Boolean));for(let t of e.split(/\s+/))if(t&&!n.has(t))return!0;return!1}function gN(e){return[`client_secret_basic`,`client_secret_post`,`none`].includes(e)}var _N=`code`,vN=`S256`;function yN(e,t){let n=e.client_secret!==void 0;return`token_endpoint_auth_method`in e&&e.token_endpoint_auth_method&&gN(e.token_endpoint_auth_method)&&(t.length===0||t.includes(e.token_endpoint_auth_method))?e.token_endpoint_auth_method:t.length===0?n?`client_secret_basic`:`none`:n&&t.includes(`client_secret_basic`)?`client_secret_basic`:n&&t.includes(`client_secret_post`)?`client_secret_post`:t.includes(`none`)?`none`:n?`client_secret_post`:`none`}function bN(e,t,n,r){let{client_id:i,client_secret:a}=t;switch(e){case`client_secret_basic`:xN(i,a,n);return;case`client_secret_post`:SN(i,a,r);return;case`none`:CN(i,r);return;default:throw Error(`Unsupported client authentication method: ${e}`)}}function xN(e,t,n){if(!t)throw Error(`client_secret_basic authentication requires a client_secret`);let r=btoa(`${e}:${t}`);n.set(`Authorization`,`Basic ${r}`)}function SN(e,t,n){n.set(`client_id`,e),t&&n.set(`client_secret`,t)}function CN(e,t){t.set(`client_id`,e)}function wN(e){return e===`localhost`||e===`127.0.0.1`||e===`[::1]`||e===`::1`}function TN(e){let t=new URL(String(e));if(t.protocol!==`https:`&&!wN(t.hostname))throw new sN(t.href);return t}function EN(e){for(let t of e??[]){let e;try{e=new URL(t)}catch{continue}if(e.protocol!==`http:`&&e.protocol!==`https:`||wN(e.hostname))return`native`}return`web`}function DN(e){let t=e.clientMetadata;return{...t,grant_types:t.grant_types??(e.redirectUrl===void 0?void 0:[`authorization_code`,`refresh_token`]),application_type:t.application_type??EN(t.redirect_uris)}}async function ON(e){let t=e instanceof Response?e.status:void 0,n=e instanceof Response?await e.text():e;try{let e=RO.parse(JSON.parse(n));return qO.fromResponse(e)}catch(e){let r=`${t?`HTTP ${t}: `:``}Invalid OAuth error response: ${e}. Raw body: ${n}`;return new qO(KO.ServerError,r)}}async function kN(e,t){try{return await jN(e,t)}catch(n){if(n instanceof qO){if(n.code===KO.InvalidClient||n.code===KO.UnauthorizedClient)return await e.invalidateCredentials?.(`client`),await e.invalidateCredentials?.(`tokens`),await jN(e,t);if(n.code===KO.InvalidGrant)return await e.invalidateCredentials?.(`tokens`),await jN(e,t)}throw n}}function AN(e){let{requestedScope:t,resourceMetadata:n,authServerMetadata:r,clientMetadata:i}=e,a=t||n?.scopes_supported?.join(` `)||i.scope;return a&&r?.scopes_supported?.includes(`offline_access`)&&!a.split(` `).includes(`offline_access`)&&i.grant_types?.includes(`refresh_token`)&&(a=`${a} offline_access`),a}async function jN(e,{serverUrl:t,authorizationCode:n,iss:r,scope:i,resourceMetadataUrl:a,fetchFn:o,skipIssuerMetadataValidation:s,forceReauthorization:c}){let l=DN(e),u=await e.discoveryState?.(),d,f,p,m,h=a;if(!h&&u?.resourceMetadataUrl&&(h=new URL(u.resourceMetadataUrl)),u?.authorizationServerUrl){if(f=u.authorizationServerUrl,d=u.resourceMetadata,p=u.authorizationServerMetadata??await VN(f,{fetchFn:o,skipIssuerValidation:s}),!d)try{d=await PN(t,{resourceMetadataUrl:h},o)}catch(e){if(e instanceof TypeError)throw e}(p!==u.authorizationServerMetadata||d!==u.resourceMetadata)&&await e.saveDiscoveryState?.({authorizationServerUrl:String(f),resourceMetadataUrl:h?.toString(),resourceMetadata:d,authorizationServerMetadata:p})}else{let e=await HN(t,{resourceMetadataUrl:h,fetchFn:o,skipIssuerMetadataValidation:s});f=e.authorizationServerUrl,p=e.authorizationServerMetadata,d=e.resourceMetadata,m={authorizationServerUrl:String(f),resourceMetadataUrl:h?.toString(),resourceMetadata:d,authorizationServerMetadata:p}}let g=p?.issuer??String(f),_={issuer:g};if(await e.saveAuthorizationServerUrl?.(g),n!==void 0){let t=u?.authorizationServerMetadata?.issuer??u?.authorizationServerUrl;if(t===void 0){if(e.saveDiscoveryState!==void 0)throw new cN(`discoveryState was not available on the callback leg; ensure your provider persists discoveryState alongside codeVerifier`,g);console.warn(`[mcp-sdk] OAuthClientProvider does not implement saveDiscoveryState()/discoveryState(); the SEP-2352 callback-leg authorization-server binding cannot be checked. Implement discoveryState (persist alongside codeVerifier) — see docs/migration/upgrade-to-v2.md §SEP-2352.`)}else if(!uN(t,g))throw new cN(t,g)}m&&await e.saveDiscoveryState?.(m);let v=await NN(t,e,d);v&&await e.saveResourceUrl?.(String(v));let y=AN({requestedScope:i,resourceMetadata:d,authServerMetadata:p,clientMetadata:e.clientMetadata}),b=await Promise.resolve(e.clientInformation(_)),x=lN(b,g,{canPersistStamp:e.saveClientInformation!==void 0});if(x===void 0&&b?.issuer&&e.saveClientInformation===void 0)throw new cN(b.issuer,g);if(x&&x.issuer===void 0&&(x={...x,issuer:g},await e.saveClientInformation?.(x,_)),!x){if(n!==void 0)throw Error(`Existing OAuth client information is required when exchanging an authorization code`);let t=p?.client_id_metadata_document_supported===!0,r=e.clientMetadataUrl;if(r&&!MN(r))throw new qO(KO.InvalidClientMetadata,`clientMetadataUrl must be a valid HTTPS URL with a non-root pathname, got: ${r}`);if(t&&r)x={client_id:r,issuer:g},await e.saveClientInformation?.(x,_);else{if(!e.saveClientInformation)throw Error(`OAuth client information must be saveable for dynamic registration`);x={...await YN(f,{metadata:p,clientMetadata:l,scope:y,fetchFn:o}),issuer:g},await e.saveClientInformation(x,_)}}let S=!e.redirectUrl;if(n!==void 0||S){n!==void 0&&pN({iss:r,expectedIssuer:p?.issuer,issParameterSupported:fN(p)});let t=await JN(e,f,{metadata:p,resource:v,authorizationCode:n,iss:r,scope:y,fetchFn:o});return await e.saveTokens({...t,issuer:g},_),`AUTHORIZED`}let C=lN(await e.tokens(_),g);if(C&&C.issuer===void 0&&(C={...C,issuer:g},await e.saveTokens(C,_)),C?.refresh_token&&!c)try{let t=await qN(f,{metadata:p,clientInformation:x,refreshToken:C.refresh_token,resource:v,addClientAuthentication:e.addClientAuthentication,fetchFn:o});return await e.saveTokens({...t,issuer:g},_),`AUTHORIZED`}catch(e){if(e instanceof sN||!(!(e instanceof qO)||e.code===KO.ServerError))throw e}let w=e.state?await e.state():void 0,{authorizationUrl:T,codeVerifier:E}=await UN(f,{metadata:p,clientInformation:x,state:w,redirectUrl:e.redirectUrl,scope:y,resource:v});return await e.saveCodeVerifier(E),await e.redirectToAuthorization(T),`REDIRECT`}function MN(e){if(!e)return!1;try{let t=new URL(e);return t.protocol===`https:`&&t.pathname!==`/`}catch{return!1}}async function NN(e,t,n){let r=Sne(e);if(t.validateResourceURL)return await t.validateResourceURL(r,n?.resource);if(n){if(!Cne({requestedResource:r,configuredResource:n.resource}))throw Error(`Protected resource ${n.resource} does not match expected ${r} (or origin)`);return new URL(n.resource)}}async function PN(e,t,n=fetch){let r=await zN(e,`oauth-protected-resource`,n,{protocolVersion:t?.protocolVersion,metadataUrl:t?.resourceMetadataUrl});if(!r||r.status===404)throw await r?.text?.().catch(()=>{}),Error(`Resource server does not implement OAuth 2.0 Protected Resource Metadata.`);if(!r.ok)throw await r.text?.().catch(()=>{}),Error(`HTTP ${r.status} trying to load well-known OAuth protected resource metadata.`);return MO.parse(await r.json())}async function FN(e,t,n=fetch){try{return await n(e,{headers:t})}catch(r){if(!(r instanceof TypeError))throw r;if(t)try{return await n(e,{})}catch(e){if(!(e instanceof TypeError))throw e;return}return}}function IN(e,t=``,n={}){return t.endsWith(`/`)&&(t=t.slice(0,-1)),n.prependPathname?`${t}/.well-known/${e}`:`/.well-known/${e}${t}`}async function LN(e,t,n=fetch){return await FN(e,{"MCP-Protocol-Version":t},n)}function RN(e,t){return e?t===`/`?!1:e.status>=400&&e.status<500||e.status===502:!0}async function zN(e,t,n,r){let i=new URL(e),a=r?.protocolVersion??`2025-11-25`,o;if(r?.metadataUrl)o=new URL(r.metadataUrl);else{let e=IN(t,i.pathname);o=new URL(e,r?.metadataServerUrl??i),o.search=i.search}let s=await LN(o,a,n);return!r?.metadataUrl&&RN(s,i.pathname)&&(s=await LN(new URL(`/.well-known/${t}`,i),a,n)),s}function BN(e){let t=typeof e==`string`?new URL(e):e,n=t.pathname!==`/`,r=[];if(!n)return r.push({url:new URL(`/.well-known/oauth-authorization-server`,t.origin),type:`oauth`},{url:new URL(`/.well-known/openid-configuration`,t.origin),type:`oidc`}),r;let i=t.pathname;return i.endsWith(`/`)&&(i=i.slice(0,-1)),r.push({url:new URL(`/.well-known/oauth-authorization-server${i}`,t.origin),type:`oauth`},{url:new URL(`/.well-known/openid-configuration${i}`,t.origin),type:`oidc`},{url:new URL(`${i}/.well-known/openid-configuration`,t.origin),type:`oidc`}),r}async function VN(e,{fetchFn:t=fetch,protocolVersion:n=ST,skipIssuerValidation:r=!1}={}){let i={"MCP-Protocol-Version":n,Accept:`application/json`},a=BN(e);for(let{url:n,type:o}of a){let a=await FN(n,i,t);if(!a)continue;if(!a.ok){if(await a.text?.().catch(()=>{}),a.status>=400&&a.status<500||a.status===502)continue;throw Error(`HTTP ${a.status} trying to load ${o===`oauth`?`OAuth`:`OpenID provider`} metadata from ${n}`)}let s=o===`oauth`?NO.parse(await a.json()):FO.parse(await a.json());if(!r){let t=typeof e==`string`?e:e.href;if(!(s.issuer===t||t.endsWith(`/`)&&s.issuer===t.slice(0,-1)))throw new aN(`metadata`,t,s.issuer)}return s}}async function HN(e,t){let n,r;try{n=await PN(e,{resourceMetadataUrl:t?.resourceMetadataUrl},t?.fetchFn),n.authorization_servers&&n.authorization_servers.length>0&&(r=n.authorization_servers[0])}catch(e){if(e instanceof TypeError)throw e}r||=String(new URL(`/`,e));let i=await VN(r,{fetchFn:t?.fetchFn,skipIssuerValidation:t?.skipIssuerMetadataValidation});return{authorizationServerUrl:r,authorizationServerMetadata:i,resourceMetadata:n}}async function UN(e,{metadata:t,clientInformation:n,redirectUrl:r,scope:i,state:a,resource:o}){let s;if(t){if(s=new URL(t.authorization_endpoint),!t.response_types_supported.includes(_N))throw Error(`Incompatible auth server: does not support response type ${_N}`);if(t.code_challenge_methods_supported&&!t.code_challenge_methods_supported.includes(vN))throw Error(`Incompatible auth server: does not support code challenge method ${vN}`)}else s=new URL(`/authorize`,e);let c=await $M(),l=c.code_verifier,u=c.code_challenge;return s.searchParams.set(`response_type`,_N),s.searchParams.set(`client_id`,n.client_id),s.searchParams.set(`code_challenge`,u),s.searchParams.set(`code_challenge_method`,vN),s.searchParams.set(`redirect_uri`,String(r)),a&&s.searchParams.set(`state`,a),i&&s.searchParams.set(`scope`,i),i?.split(` `).includes(`offline_access`)&&s.searchParams.append(`prompt`,`consent`),o&&s.searchParams.set(`resource`,o.href),{authorizationUrl:s,codeVerifier:l}}function WN(e,t,n){return new URLSearchParams({grant_type:`authorization_code`,code:e,code_verifier:t,redirect_uri:String(n)})}async function GN(e,{metadata:t,tokenRequestParams:n,clientInformation:r,addClientAuthentication:i,resource:a,fetchFn:o}){let s=TN(t?.token_endpoint??new URL(`/token`,e)),c=new Headers({"Content-Type":`application/x-www-form-urlencoded`,Accept:`application/json`});a&&n.set(`resource`,a.href),i?await i(c,n,s,t):r&&bN(yN(r,t?.token_endpoint_auth_methods_supported??[]),r,c,n);let l=await(o??fetch)(s,{method:`POST`,headers:c,body:n});if(!l.ok)throw await ON(l);let u=await l.json();try{return IO.parse(u)}catch(e){throw typeof u==`object`&&u&&`error`in u?await ON(JSON.stringify(u)):e}}async function KN(e,{metadata:t,clientInformation:n,authorizationCode:r,iss:i,codeVerifier:a,redirectUri:o,resource:s,addClientAuthentication:c,fetchFn:l}){return pN({iss:i,expectedIssuer:t?.issuer,issParameterSupported:fN(t)}),GN(e,{metadata:t,tokenRequestParams:WN(r,a,o),clientInformation:n,addClientAuthentication:c,resource:s,fetchFn:l})}async function qN(e,{metadata:t,clientInformation:n,refreshToken:r,resource:i,addClientAuthentication:a,fetchFn:o}){return{refresh_token:r,...await GN(e,{metadata:t,tokenRequestParams:new URLSearchParams({grant_type:`refresh_token`,refresh_token:r}),clientInformation:n,addClientAuthentication:a,resource:i,fetchFn:o})}}async function JN(e,t,{metadata:n,resource:r,authorizationCode:i,iss:a,scope:o,fetchFn:s}={}){i!==void 0&&pN({iss:a,expectedIssuer:n?.issuer,issParameterSupported:fN(n)});let c=o??e.clientMetadata.scope,l;if(e.prepareTokenRequest&&(l=await e.prepareTokenRequest(c)),!l){if(!i)throw Error(`Either provider.prepareTokenRequest() or authorizationCode is required`);if(!e.redirectUrl)throw Error(`redirectUrl is required for authorization_code flow`);l=WN(i,await e.codeVerifier(),e.redirectUrl)}let u=await e.clientInformation({issuer:n?.issuer??String(t)});return GN(t,{metadata:n,tokenRequestParams:l,clientInformation:u??void 0,addClientAuthentication:e.addClientAuthentication,resource:r,fetchFn:s})}async function YN(e,{metadata:t,clientMetadata:n,scope:r,fetchFn:i}){let a;if(t){if(!t.registration_endpoint)throw Error(`Incompatible auth server: does not support dynamic client registration`);a=new URL(t.registration_endpoint)}else a=new URL(`/register`,e);let o={...n,...r===void 0?{}:{scope:r}},s=await(i??fetch)(a,{method:`POST`,headers:{"Content-Type":`application/json`},body:JSON.stringify(o)});if(!s.ok)throw new oN({status:s.status,body:await s.text(),submittedMetadata:o});return HO.parse(await s.json())}var XN=new Set([`tools/list`,`prompts/list`,`resources/list`,`resources/templates/list`,`server/discover`]),ZN=class{_entries=new Map;_maxEntries;_stamp=0;_cappedSize=0;constructor(e){this._maxEntries=e?.maxEntries??512}get size(){return this._entries.size}get(e){return this._entries.get(QN(e))}set(e,t){let n=QN(e),r=XN.has(e.method),i=!this._entries.has(n);if(!r&&i&&this._maxEntries>0&&this._cappedSize>=this._maxEntries){for(let e of this._entries.keys())if(!XN.has(e.slice(0,e.indexOf(`\0`)))){this._entries.delete(e),this._cappedSize--;break}}let a=++this._stamp;return this._entries.set(n,{...t,stamp:a}),i&&!r&&this._cappedSize++,a}delete(e){this._entries.delete(QN(e))&&!XN.has(e.method)&&this._cappedSize--}evict(e){let t=`${e}\0`,n=XN.has(e);for(let e of this._entries.keys())e.startsWith(t)&&(this._entries.delete(e),n||this._cappedSize--)}clear(){this._entries.clear(),this._cappedSize=0}};function QN(e){return`${e.method}\0${JSON.stringify([e.partition??``,e.params??``])}`}function $N(e,t){return t===void 0?e:`${e}\0${t}`}var eP=864e5,tP=class{_evictionGeneration=new Map;_toolIndex;_toolOutputValidatorIndex;_serverIdentity=``;constructor(e,t,n=()=>{},r=``,i=Date.now){this._store=e,this._isUserSupplied=t,this._reportError=n,this._cachePartition=r,this._now=i}now(){return this._now()}setServerIdentity(e){this._serverIdentity=e}_partitionFor(e){return JSON.stringify([this._serverIdentity,e===`public`?``:this._cachePartition])}async _probe(e,t){let n={method:e,params:t??``},r=this._partitionFor(`private`),i=await this._store.get({...n,partition:r});if(i!==void 0)return i;let a=this._partitionFor(`public`);if(a===r)return;let o=await this._store.get({...n,partition:a});return o?.scope===`public`?o:void 0}async evict(e){this._evictionGeneration.set(e,(this._evictionGeneration.get(e)??0)+1),await this._deleteBoth(e,``)}async _deleteBoth(e,t){let n=this._partitionFor(`private`),r=this._partitionFor(`public`);try{await this._store.delete({method:e,params:t,partition:n})}catch(e){this._reportError(e)}if(r!==n)try{await this._store.delete({method:e,params:t,partition:r})}catch(e){this._reportError(e)}}async evictKey(e,t){let n=$N(e,t),r=this._evictionGeneration.get(n);r!==void 0&&this._evictionGeneration.set(n,r+1),await this._deleteBoth(e,t)}captureGeneration(e,t){let n=$N(e,t),r=this._evictionGeneration.get(n)??0;return this._evictionGeneration.set(n,r),r}async write(e,t,n,r){if((this._evictionGeneration.get($N(e,r?.params))??0)!==n)return;let i=r?.params??``,a=this._partitionFor(`private`),o=this._partitionFor(`public`),s=(r?.scope??`private`)===`public`?o:a;try{await this._store.set({method:e,params:i,partition:s},{value:nP(t),expiresAt:r?.expiresAt,scope:r?.scope})}catch(e){this._reportError(e)}if(o!==a)try{await this._store.delete({method:e,params:i,partition:s===a?o:a})}catch(e){this._reportError(e)}}async read(e,t){let n=await this._probe(e,t);if(!(n?.expiresAt===void 0||!(n.expiresAt>this.now())))try{let e=JSON.parse(n.value);if(typeof e!=`object`||!e||Array.isArray(e))throw TypeError(`cached document is not an object`);return{value:e}}catch(n){this._reportError(n),await this._deleteBoth(e,t??``);return}}resetForReconnect(){this._isUserSupplied||this._store.clear(),this._evictionGeneration.clear(),this._toolIndex=void 0,this._toolOutputValidatorIndex=void 0,this._serverIdentity=``}async toolDefinition(e){let t=await this._probe(`tools/list`);if(t===void 0){this._toolIndex=void 0;return}if(this._toolIndex?.stamp!==t.stamp){let e=this._decodeListTools(t),n=new Map;if(e!==void 0)for(let t of e.tools)n.set(t.name,t);this._toolIndex={stamp:t.stamp,byName:n}}return this._toolIndex.byName.get(e)}async outputValidator(e,t){let n=await this._probe(`tools/list`);if(n===void 0){this._toolOutputValidatorIndex=void 0;return}if(this._toolOutputValidatorIndex?.stamp!==n.stamp){let e=this._decodeListTools(n)??{tools:[]},r=new Map;for(let n of e.tools){let e=t(n);e!==void 0&&r.set(n.name,e)}this._toolOutputValidatorIndex={stamp:n.stamp,byName:r}}return this._toolOutputValidatorIndex.byName.get(e)}_decodeListTools(e){try{let t=JSON.parse(e.value);if(!Array.isArray(t?.tools)||!t.tools.every(e=>typeof e==`object`&&!!e))throw TypeError(`cached tools/list document has a malformed tools array`);return t}catch(e){this._reportError(e);return}}};function nP(e){let t;try{t=JSON.stringify(e)}catch(e){throw TypeError(`cache value is not JSON-serializable: ${e instanceof Error?e.message:String(e)}`)}if(typeof t!=`string`)throw TypeError(`cache value is not JSON-serializable: it has no JSON representation`);return t}var rP=Symbol.for(`mcp.authSeamEscape`);function iP(e){return(typeof e==`object`&&!!e||typeof e==`function`)&&e[rP]===!0}var aP=-32022,oP=new Set([-32001,-32020,-32021]);function sP(e,t){switch(e.kind){case`result`:return cP(e.result,t);case`rpc-error`:return lP(e,t);case`http-error`:return uP(e,t);case`network-error`:return dP(e.error,t);case`auth-required`:return{kind:`error`,error:e.error};case`closed`:return t.transportKind===`stdio`?{kind:`legacy`}:dP(Error(`Connection closed during the version negotiation probe`),t);case`timeout`:return t.transportKind===`stdio`?{kind:`legacy`}:{kind:`error`,error:new YO(JO.RequestTimeout,`Version negotiation probe timed out after ${e.timeoutMs}ms`,{timeout:e.timeoutMs})}}}function cP(e,t){let n=wA(CA).validateResult(`server/discover`,e);if(!n.ok)return{kind:`legacy`};let r=n.value.supportedVersions,i=t.clientModernVersions.find(e=>r.includes(e));return i===void 0?t.fallbackAvailable?{kind:`legacy`}:{kind:`error`,error:new Uk({supported:[...r],requested:t.requestedVersion})}:{kind:`modern`,version:i,discover:n.value}}function lP(e,t){let{code:n,message:r,data:i}=e;if(n===aP){let e=mP(i);if(e===void 0)return{kind:`legacy`};let n=new Uk({supported:e,requested:hP(i)??t.requestedVersion},r),a=tk(e),o=t.clientModernVersions.find(e=>a.includes(e));return o===void 0?a.length>0?{kind:`error`,error:n}:t.fallbackAvailable?{kind:`legacy`}:{kind:`error`,error:n}:{kind:`corrective`,version:o,error:n}}return oP.has(n),{kind:`legacy`}}function uP(e,t){if(e.status===401||e.status===403){let t=e.status===403;return{kind:`error`,error:new XO(t?JO.ClientHttpForbidden:JO.ClientHttpAuthentication,`Version negotiation failed: ${t?`the server denied access (HTTP 403)`:`the server requires authorization (HTTP 401)`}`,{status:e.status,statusText:e.statusText,text:e.body})}}if(e.status>=500)return{kind:`error`,error:new XO(JO.EraNegotiationFailed,`Version negotiation failed: the server answered the probe with HTTP ${e.status}`,{status:e.status,statusText:e.statusText,text:e.body})};let n=gP(e.body);return n===void 0?{kind:`legacy`}:lP(n,t)}function dP(e,t){return t.environment===`browser`&&fP(e)?{kind:`legacy`}:{kind:`error`,error:new YO(JO.EraNegotiationFailed,`Version negotiation probe failed: ${pP(e)}`,{cause:e})}}function fP(e){return e instanceof TypeError||e instanceof Error&&e.name===`TypeError`}function pP(e){return e instanceof Error?e.message:String(e)}function mP(e){if(typeof e!=`object`||!e)return;let t=e.supported;if(!(!Array.isArray(t)||t.length===0||!t.every(e=>typeof e==`string`)))return t}function hP(e){if(typeof e!=`object`||!e)return;let t=e.requested;return typeof t==`string`?t:void 0}function gP(e){if(e===void 0||e===``)return;let t;try{t=JSON.parse(e)}catch{return}if(typeof t!=`object`||!t)return;let n=t.error;if(typeof n!=`object`||!n)return;let{code:r,message:i,data:a}=n;if(typeof r==`number`)return{code:r,message:typeof i==`string`?i:``,data:a}}var _P=`legacy`;function vP(e,t){let n=e?.mode??_P;if(n===`legacy`)return{kind:`legacy`};let r=e?.probe??{};if(typeof n==`object`){if(!$O(n.pin))throw TypeError(`versionNegotiation: { pin: '${n.pin}' } is not a modern protocol revision — pinning is for 2026-07-28 and later; omit versionNegotiation (or use mode: 'legacy') for 2025-era servers.`);return{kind:`pin`,version:n.pin,probe:r}}let i=t?tk(t):[];return{kind:`auto`,modernVersions:i.length>0?i:[...QO],fallbackAvailable:!t||ek(t).length>0,probe:r}}function yP(){let e=globalThis;return e.window!==void 0&&e.document!==void 0?`browser`:`node`}function bP(e){return`stderr`in e&&`pid`in e?`stdio`:`http`}var xP=class e{_pending;_probeCounter=0;_savedOnMessage;_savedOnError;_savedOnClose;_closeDelivered=!1;constructor(e){this._transport=e,this._savedOnMessage=e.onmessage,this._savedOnError=e.onerror,this._savedOnClose=e.onclose}static async open(t){let n=new e(t);t.onmessage=e=>{let t=n._pending;if(t!==void 0&&(MA(e)||NA(e))&&e.id===t.id){n._pending=void 0,MA(e)?t.resolve({kind:`response`,result:e.result}):t.resolve({kind:`response`,error:e.error});return}},t.onerror=e=>{n._savedOnError?.(e)},t.onclose=()=>{let e=n._pending;e!==void 0&&(n._pending=void 0,e.resolve({kind:`closed`})),n._closeDelivered=!0,n._savedOnClose?.()};try{await t.start()}catch(e){throw n.detach(),e}return n}async exchange(e,t){let n=`server-discover-probe-${++this._probeCounter}`;return new Promise(r=>{let i=!1,a=e=>{i||(i=!0,clearTimeout(o),this._pending?.id===n&&(this._pending=void 0),r(e))},o=setTimeout(()=>a({kind:`timeout`}),t);this._pending={id:n,resolve:a},this._transport.send(e(n)).catch(e=>a({kind:`send-error`,error:e}))})}detach(){if(this._pending=void 0,this._transport.onmessage=this._savedOnMessage,this._transport.onerror=this._savedOnError,this._closeDelivered&&this._savedOnClose!==void 0){let e=this._savedOnClose,t=this._transport,n=!1,r=()=>{if(!n){n=!0;return}e()};t.onclose=r,SP.set(t,()=>{t.onclose===r&&(t.onclose=e)})}else this._transport.onclose=this._savedOnClose}release(){this.detach();let e=this._transport,t=e.start,n=!0;e.start=async function(){if(n){n=!1,e.start=t;return}return t.call(e)}}},SP=new WeakMap;function CP(e){let t=SP.get(e);SP.delete(e),t?.()}function wP(e,t,n,r){return{jsonrpc:`2.0`,id:e,method:`server/discover`,params:{_meta:wA(t).outboundEnvelope({protocolVersion:t,clientInfo:n,clientCapabilities:r})}}}function TP(e,t){switch(e.kind){case`response`:return e.error===void 0?{kind:`result`,result:e.result}:{kind:`rpc-error`,...e.error};case`send-error`:{let t=e.error;if(iP(t)||t instanceof dN||t instanceof Error&&t.name===`UnauthorizedError`)return{kind:`auth-required`,error:t};if(t instanceof XO){let e=t.data?.text;return{kind:`http-error`,status:t.data.status,body:typeof e==`string`?e:void 0,statusText:t.data.statusText}}return{kind:`network-error`,error:t}}case`closed`:return{kind:`closed`};case`timeout`:return{kind:`timeout`,timeoutMs:t}}}async function EP(e,t){let n=e.probe.timeoutMs??t.defaultTimeoutMs,r=Math.max(0,e.probe.maxRetries??0),i=e.kind===`pin`?[e.version]:e.modernVersions,a=e.kind===`auto`&&e.fallbackAvailable,o=await xP.open(t.transport),s=async()=>{let s=i[0],c=!1,l=r;for(;;){let r=await o.exchange(e=>wP(e,s,t.clientInfo,t.capabilities),n);if(r.kind===`timeout`&&l>0){l--;continue}let u=TP(r,n),d=sP(u,{clientModernVersions:i,requestedVersion:s,fallbackAvailable:a,environment:t.environment,transportKind:t.transportKind});switch(d.kind){case`modern`:return{era:`modern`,version:d.version,discover:d.discover};case`corrective`:if(c)throw d.error;c=!0,s=d.version;continue;case`legacy`:{let n=u.kind===`closed`?`the connection closed during the server/discover probe`:void 0;if(e.kind===`pin`)throw new YO(JO.EraNegotiationFailed,n===void 0?`Version negotiation failed: the server did not offer pinned protocol version ${e.version} via server/discover (no fallback in pin mode)`:`Version negotiation failed: ${n} before the server offered pinned protocol version ${e.version} (no fallback in pin mode)`);if(!e.fallbackAvailable)throw new YO(JO.EraNegotiationFailed,n===void 0?`Version negotiation failed: the server gave no modern evidence and this client supports no pre-2026-07-28 protocol version to fall back to`:`Version negotiation failed: ${n} and this client supports no pre-2026-07-28 protocol version to fall back to`);if(n!==void 0&&t.disposableProbe!==!0)throw new YO(JO.EraNegotiationFailed,`Version negotiation failed: ${n} (this transport probed in place — the disposable sibling probe requires the SDK's base StdioClientTransport)`);return{era:`legacy`}}case`error`:throw d.error}}},c;try{c=await s()}catch(e){throw o.detach(),e}return o.release(),c}function DP(e){let t=Object.getPrototypeOf(e);if(t===null||!Object.prototype.hasOwnProperty.call(t,`_dispose`))return;let n=e._serverParams;return typeof n==`object`&&n&&typeof n.command==`string`?n:void 0}async function wne(e,t,n,r){let i=t.constructor,a=new i({...n,stderr:`ignore`}),o=t.close,s=!1,c,l=new Promise((e,t)=>{c=()=>t(OP())});t.close=async function(){return s=!0,c?.(),o.call(t)};let u;try{let t=EP(e,{...r,transport:a,transportKind:`stdio`,disposableProbe:!0});t.catch(()=>{}),u=await Promise.race([t,l])}finally{await Tne(a),t.close=o}if(s)throw OP();return u}function OP(){return new YO(JO.EraNegotiationFailed,`Version negotiation failed: the transport was closed during the server/discover probe`)}async function Tne(e){try{let t=e._dispose;await(typeof t==`function`?t.call(e):e.close())}catch{}}function kP(e){let t=e._meta?.[DT];return zj.Implementation(t)?t:void 0}function AP(e,t){if(!(!e||typeof t!=`object`||!t)){if(e.type===`object`&&e.properties&&typeof e.properties==`object`){let n=t,r=e.properties;for(let e of Object.keys(r)){let t=r[e];n[e]===void 0&&Object.prototype.hasOwnProperty.call(t,`default`)&&(n[e]=t.default),n[e]!==void 0&&AP(t,n[e])}}if(Array.isArray(e.anyOf))for(let n of e.anyOf)typeof n!=`boolean`&&AP(n,t);if(Array.isArray(e.oneOf))for(let n of e.oneOf)typeof n!=`boolean`&&AP(n,t)}}function Ene(e){if(!e)return{supportsFormMode:!1,supportsUrlMode:!1};let t=e.form!==void 0,n=e.url!==void 0;return{supportsFormMode:t||!t&&!n,supportsUrlMode:n}}function Dne(e){if(typeof e==`object`&&e&&(e.kind===`legacy`&&!(`supportedVersions`in e)&&!(`discover`in e)||e.kind===`modern`&&gE.safeParse(e.discover).success))return e;throw new YO(JO.EraNegotiationFailed,`connect({ prior }): unrecognized prior — expected { kind: 'modern', discover } or { kind: 'legacy' }`)}var jP={"notifications/tools/list_changed":[`tools/list`],"notifications/prompts/list_changed":[`prompts/list`],"notifications/resources/list_changed":[`resources/list`,`resources/templates/list`]},One=64,kne=class extends qj{_serverCapabilities;_serverVersion;_capabilities;_instructions;_jsonSchemaValidator;_cache;_defaultCacheTtlMs;_listMaxPages;_listChangedDebounceTimers=new Map;_listChangedConfig;_enforceStrictCapabilities;_versionNegotiation;_supportedProtocolVersionsOption;_inputRequiredDriverConfig;_listenState=new Map;_nextListenId=0;_autoOpenedSubscription;_discoverResult;_resetConnectionState(){if(this._negotiatedProtocolVersion=void 0,this._serverCapabilities=void 0,this._serverVersion=void 0,this._instructions=void 0,this._discoverResult=void 0,this._autoOpenedSubscription=void 0,this._listenState.size>0){let e=new YO(JO.ConnectionClosed,`subscriptions/listen: client reconnected or closed; subscription state from the previous connection was reset`);for(let t of this._listenState.values())t.settle({cause:`remote`,error:e})}this._listenState.clear();for(let e of this._listChangedDebounceTimers.values())clearTimeout(e);this._listChangedDebounceTimers.clear(),this._cache.resetForReconnect()}async close(){try{await super.close()}finally{this._resetConnectionState()}}constructor(e,t){super(t),this._clientInfo=e,this._capabilities=t?.capabilities?{...t.capabilities}:{},this._jsonSchemaValidator=t?.jsonSchemaValidator??new qM,this._enforceStrictCapabilities=t?.enforceStrictCapabilities??!1,this._versionNegotiation=t?.versionNegotiation,this._supportedProtocolVersionsOption=t?.supportedProtocolVersions,this._inputRequiredDriverConfig=Oj(t?.inputRequired),this._cache=new tP(t?.responseCacheStore??new ZN,t?.responseCacheStore!==void 0,e=>this._reportStoreError(e),t?.cachePartition??``),this._defaultCacheTtlMs=t?.defaultCacheTtlMs??0,this._listMaxPages=t?.listMaxPages??One,t?.listChanged&&(this._listChangedConfig=t.listChanged)}buildContext(e,t){return e}_shouldDropInbound(e){if(this._negotiatedProtocolVersion!==void 0&&$O(this._negotiatedProtocolVersion)&&AA(e))return`drop`}_outboundMetaEnvelope(){let e=this._negotiatedProtocolVersion;if(e!==void 0)return this._wireCodec().outboundEnvelope({protocolVersion:e,clientInfo:this._clientInfo,clientCapabilities:this._capabilities})}_resolveNonCompleteResult(e,t){return this._inputRequiredDriverConfig.autoFulfill?nM({getRequestHandler:e=>this._getRequestHandler(e),buildContext:e=>this.buildContext(e,void 0),sessionId:this.transport?.sessionId},this._inputRequiredDriverConfig,e,t):Promise.reject(new YO(JO.UnsupportedResultType,`Unsupported result type 'input_required' for ${t.request.method}: multi-round-trip auto-fulfilment is not enabled on this instance — pass allowInputRequired: true to handle it manually, or enable inputRequired.autoFulfill`,{resultType:`input_required`,method:t.request.method}))}_setupListChangedHandlers(e){e.tools&&this._serverCapabilities?.tools?.listChanged&&this._setupListChangedHandler(`tools`,`notifications/tools/list_changed`,e.tools,async()=>(await this.listTools(void 0,{cacheMode:`refresh`})).tools),e.prompts&&this._serverCapabilities?.prompts?.listChanged&&this._setupListChangedHandler(`prompts`,`notifications/prompts/list_changed`,e.prompts,async()=>(await this.listPrompts(void 0,{cacheMode:`refresh`})).prompts),e.resources&&this._serverCapabilities?.resources?.listChanged&&this._setupListChangedHandler(`resources`,`notifications/resources/list_changed`,e.resources,async()=>(await this.listResources(void 0,{cacheMode:`refresh`})).resources)}registerCapabilities(e){if(this.transport)throw Error(`Cannot register capabilities after connecting to transport`);this._capabilities=Yj(this._capabilities,e)}setVersionNegotiation(e){if(this.transport)throw Error(`Cannot configure version negotiation after connecting to transport`);this._versionNegotiation=e}_wrapHandler(e,t){return e===`elicitation/create`?async(e,n)=>{let r=wA(this._negotiatedProtocolVersion),i=r.validateRequest(`elicitation/create`,e);if(!i.ok&&i.reason===`not-in-era`&&(i=r.validateInputRequest(`elicitation/create`,e)),!i.ok)throw new Bk(i.reason===`not-in-era`?zk.InternalError:zk.InvalidParams,i.reason===`not-in-era`?`No wire schema for elicitation/create in the resolved era`:`Invalid elicitation request: ${i.message}`);let{params:a}=i.value;a.mode=a.mode??`form`;let{supportsFormMode:o,supportsUrlMode:s}=Ene(this._capabilities.elicitation);if(a.mode===`form`&&!o)throw new Bk(zk.InvalidParams,`Client does not support form-mode elicitation requests`);if(a.mode===`url`&&!s)throw new Bk(zk.InvalidParams,`Client does not support URL-mode elicitation requests`);let c=await t(e,n),l=r.validateResult(`elicitation/create`,c);if(!l.ok&&l.reason===`not-in-era`&&(l=r.validateInputResponse(`elicitation/create`,c)),!l.ok)throw new Bk(l.reason===`not-in-era`?zk.InternalError:zk.InvalidParams,l.reason===`not-in-era`?`No wire schema for elicitation/create in the resolved era`:`Invalid elicitation result: ${l.message}`);let u=l.value,d=a.mode===`form`?a.requestedSchema:void 0;if(a.mode===`form`&&u.action===`accept`&&u.content&&d&&this._capabilities.elicitation?.form?.applyDefaults)try{AP(d,u.content)}catch{}return u}:e===`sampling/createMessage`?async(e,n)=>{let r=wA(this._negotiatedProtocolVersion),i=r.validateRequest(`sampling/createMessage`,e);if(!i.ok&&i.reason===`not-in-era`&&(i=r.validateInputRequest(`sampling/createMessage`,e)),!i.ok)throw new Bk(i.reason===`not-in-era`?zk.InternalError:zk.InvalidParams,i.reason===`not-in-era`?`No wire schema for sampling/createMessage in the resolved era`:`Invalid sampling request: ${i.message}`);let{params:a}=i.value,o=await t(e,n),s=!!(a.tools||a.toolChoice),c=r.samplingResultVariant(s,o);if(!c.ok&&c.reason===`not-in-era`&&(c=r.validateInputResponse(`sampling/createMessage`,o)),!c.ok)throw new Bk(c.reason===`not-in-era`?zk.InternalError:zk.InvalidParams,c.reason===`not-in-era`?`No result schema for sampling/createMessage in the resolved era`:`Invalid sampling result: ${c.message}`);return c.value}:t}assertCapability(e,t){if(!this._serverCapabilities?.[e])throw new YO(JO.CapabilityNotSupported,`Server does not support ${e} (required for ${t})`)}async connect(e,t){if(t?.prior!=null)return this._connectFromPrior(e,Dne(t.prior),t);let n=vP(this._versionNegotiation,this._supportedProtocolVersionsOption);return n.kind===`legacy`?this._connectPlainLegacy(e,t):this._connectNegotiated(e,n,t)}async _connectPlainLegacy(e,t){if(await super.connect(e),e.sessionId!==void 0){let t=this._negotiatedProtocolVersion;t!==void 0&&e.setProtocolVersion?.(t);return}this._resetConnectionState(),await this._legacyHandshake(e,t)}async _legacyHandshake(e,t){let n=ek(this._supportedProtocolVersions);try{let r=n[0];if(r===void 0)throw new YO(JO.EraNegotiationFailed,`Cannot run the initialize handshake: supportedProtocolVersions contains no pre-2026-07-28 protocol version`);let i=await this.request({method:`initialize`,params:{protocolVersion:r,capabilities:this._capabilities,clientInfo:this._clientInfo}},t);if(i===void 0)throw Error(`Server sent invalid initialize result: ${i}`);if(!n.includes(i.protocolVersion))throw Error(`Server's protocol version is not supported: ${i.protocolVersion}`);this._serverCapabilities=i.capabilities,this._serverVersion=i.serverInfo,this._cache.setServerIdentity(this._deriveServerIdentity(e)),e.setProtocolVersion&&e.setProtocolVersion(i.protocolVersion),this._instructions=i.instructions,await this.notification({method:`notifications/initialized`}),this._negotiatedProtocolVersion=i.protocolVersion,this._listChangedConfig&&this._setupListChangedHandlers(this._listChangedConfig)}catch(e){throw this.close(),e}}async _connectNegotiated(e,t,n){if(e.sessionId!==void 0){await super.connect(e);let t=this._negotiatedProtocolVersion;t!==void 0&&e.setProtocolVersion&&e.setProtocolVersion(t);return}this._resetConnectionState();let r;try{let i=bP(e),a={clientInfo:this._clientInfo,capabilities:this._capabilities,environment:yP(),defaultTimeoutMs:n?.timeout??6e4},o=i===`stdio`?DP(e):void 0;r=o===void 0?await EP(t,{...a,transport:e,transportKind:i}):await wne(t,e,o,a)}catch(t){throw await e.close().catch(()=>{}),CP(e),t}if(CP(e),await super.connect(e),r.era===`legacy`){await this._legacyHandshake(e,n);return}if(this._serverCapabilities=r.discover.capabilities,this._serverVersion=kP(r.discover),this._cache.setServerIdentity(this._deriveServerIdentity(e)),this._instructions=r.discover.instructions,this._discoverResult=r.discover,this._negotiatedProtocolVersion=r.version,e.setProtocolVersion&&e.setProtocolVersion(r.version),this._listChangedConfig){let e=this._listChangedConfig,t=this._serverCapabilities,r={...e.tools&&t?.tools?.listChanged&&{tools:e.tools},...e.prompts&&t?.prompts?.listChanged&&{prompts:e.prompts},...e.resources&&t?.resources?.listChanged&&{resources:e.resources}},i=!0;try{this._setupListChangedHandlers(r)}catch(e){i=!1,this.onerror?.(e instanceof Error?e:Error(String(e)))}let a=i?{...r.tools&&{toolsListChanged:!0},...r.prompts&&{promptsListChanged:!0},...r.resources&&{resourcesListChanged:!0}}:{};if(Object.keys(a).length>0){let e=new AbortController,t=()=>e.abort(n?.signal?.reason);n?.signal?.aborted&&t(),n?.signal?.addEventListener(`abort`,t);try{this._autoOpenedSubscription=await this.listen(a,{timeout:n?.timeout,signal:e.signal})}catch(e){if(n?.signal?.aborted)throw await this.close().catch(()=>{}),e;this.onerror?.(e instanceof Error?e:Error(String(e)))}finally{n?.signal?.removeEventListener(`abort`,t)}}}}async _connectFromPrior(e,t,n){if(t.kind===`legacy`)return this._connectPlainLegacy(e,n);let r=t.discover;this._resetConnectionState();let i=this._supportedProtocolVersionsOption,a=(i&&tk(i).length>0?tk(i):QO).find(e=>r.supportedVersions.includes(e));if(a===void 0)throw new YO(JO.EraNegotiationFailed,`connect({ prior }) with a modern verdict requires a 2026-07-28+ mutual protocol version; the supplied DiscoverResult and this client's supportedProtocolVersions have no modern overlap. For a server known to be legacy, pass prior: { kind: 'legacy' } to skip the probe and initialize directly, or use versionNegotiation: { mode: 'auto' } to re-probe with legacy fallback.`);if(await super.connect(e),this._discoverResult=r,this._serverCapabilities=r.capabilities,this._serverVersion=kP(r),this._cache.setServerIdentity(this._deriveServerIdentity(e)),this._instructions=r.instructions,this._negotiatedProtocolVersion=a,e.setProtocolVersion?.(a),this._listChangedConfig)try{this._setupListChangedHandlers(this._listChangedConfig)}catch(e){this.onerror?.(e instanceof Error?e:Error(String(e)))}}getServerCapabilities(){return this._serverCapabilities}getServerVersion(){return this._serverVersion}_deriveServerIdentity(e){let t=this._serverVersion;return t===void 0?e.sessionId??`anonymous:${Date.now()}-${Math.random().toString(36).slice(2)}`:`${t.name}@${t.version}`}getNegotiatedProtocolVersion(){return this._negotiatedProtocolVersion}getProtocolEra(){let e=this._negotiatedProtocolVersion;if(e!==void 0)return $O(e)?`modern`:`legacy`}getInstructions(){return this._instructions}getDiscoverResult(){return this._discoverResult}assertCapabilityForMethod(e){switch(e){case`logging/setLevel`:if(!this._serverCapabilities?.logging)throw new YO(JO.CapabilityNotSupported,`Server does not support logging (required for ${e})`);break;case`prompts/get`:case`prompts/list`:if(!this._serverCapabilities?.prompts)throw new YO(JO.CapabilityNotSupported,`Server does not support prompts (required for ${e})`);break;case`resources/list`:case`resources/templates/list`:case`resources/read`:case`resources/subscribe`:case`resources/unsubscribe`:if(!this._serverCapabilities?.resources)throw new YO(JO.CapabilityNotSupported,`Server does not support resources (required for ${e})`);if(e===`resources/subscribe`&&!this._serverCapabilities.resources.subscribe)throw new YO(JO.CapabilityNotSupported,`Server does not support resource subscriptions (required for ${e})`);break;case`tools/call`:case`tools/list`:if(!this._serverCapabilities?.tools)throw new YO(JO.CapabilityNotSupported,`Server does not support tools (required for ${e})`);break;case`completion/complete`:if(!this._serverCapabilities?.completions)throw new YO(JO.CapabilityNotSupported,`Server does not support completions (required for ${e})`)}}assertNotificationCapability(e){if(e===`notifications/roots/list_changed`&&!this._capabilities.roots?.listChanged)throw new YO(JO.CapabilityNotSupported,`Client does not support roots list changed notifications (required for ${e})`)}assertRequestHandlerCapability(e){switch(e){case`sampling/createMessage`:if(!this._capabilities.sampling)throw new YO(JO.CapabilityNotSupported,`Client does not support sampling capability (required for ${e})`);break;case`elicitation/create`:if(!this._capabilities.elicitation)throw new YO(JO.CapabilityNotSupported,`Client does not support elicitation capability (required for ${e})`);break;case`roots/list`:if(!this._capabilities.roots)throw new YO(JO.CapabilityNotSupported,`Client does not support roots capability (required for ${e})`)}}async ping(e){return this.request({method:`ping`},e)}async discover(e){let t=await this._requestWithSchema({method:`server/discover`},gE,e);return this._discoverResult=t,t}async complete(e,t){return this.request({method:`completion/complete`,params:e},t)}async setLoggingLevel(e,t){return this.request({method:`logging/setLevel`,params:{level:e}},t)}async getPrompt(e,t){return this.request({method:`prompts/get`,params:e},t)}async listPrompts(e,t){if(!this._serverCapabilities?.prompts&&!this._enforceStrictCapabilities)return console.debug(`Client.listPrompts() called but server does not advertise prompts capability - returning empty list`),{prompts:[]};if(e?.cursor!==void 0)return this.request({method:`prompts/list`,params:e},t);let n=await this._serveFromCache(`prompts/list`,void 0,t);return n===void 0?this._listAllPages(`prompts/list`,e,t,(e,t)=>e.prompts.push(...t.prompts)):n}async listResources(e,t){if(!this._serverCapabilities?.resources&&!this._enforceStrictCapabilities)return console.debug(`Client.listResources() called but server does not advertise resources capability - returning empty list`),{resources:[]};if(e?.cursor!==void 0)return this.request({method:`resources/list`,params:e},t);let n=await this._serveFromCache(`resources/list`,void 0,t);return n===void 0?this._listAllPages(`resources/list`,e,t,(e,t)=>e.resources.push(...t.resources)):n}async listResourceTemplates(e,t){if(!this._serverCapabilities?.resources&&!this._enforceStrictCapabilities)return console.debug(`Client.listResourceTemplates() called but server does not advertise resources capability - returning empty list`),{resourceTemplates:[]};if(e?.cursor!==void 0)return this.request({method:`resources/templates/list`,params:e},t);let n=await this._serveFromCache(`resources/templates/list`,void 0,t);return n===void 0?this._listAllPages(`resources/templates/list`,e,t,(e,t)=>e.resourceTemplates.push(...t.resourceTemplates)):n}async _listAllPages(e,t,n,r,i){let a=n?.cacheMode===`bypass`,o=this._cache.captureGeneration(e),s=await this.request({method:e,...t&&{params:{...t}}},n),c=s.nextCursor,l=new Set,u=1;for(;c!==void 0&&!l.has(c);){if(this._listMaxPages!==0&&u>=this._listMaxPages)throw new YO(JO.ListPaginationExceeded,`${e}: exceeded listMaxPages (${this._listMaxPages}); server pagination did not terminate`,{method:e,listMaxPages:this._listMaxPages});l.add(c);let i=await this.request({method:e,params:{...t,cursor:c}},n);r(s,i),c=i.nextCursor,u++}return delete s.nextCursor,i?.(s),a||await this._cache.write(e,s,o,this._freshness(s)),s}_freshness(e,t){let n=e,r=typeof n.ttlMs==`number`?n.ttlMs:this._defaultCacheTtlMs,i=n.cacheScope===`public`?`public`:`private`;return{expiresAt:this._cache.now()+Math.min(Math.max(0,r),eP),scope:i,params:t}}async _serveFromCache(e,t,n){if(n?.cacheMode===`bypass`||n?.cacheMode===`refresh`)return;let r=await this._cache.read(e,t).catch(e=>void this._reportStoreError(e));if(r!==void 0){if(n?.signal?.aborted){let e=n.signal.reason;throw e instanceof YO?e:new YO(JO.RequestTimeout,String(e))}return r.value}}_reportStoreError(e){this.onerror?.(e instanceof Error?e:Error(String(e)))}_compileOutputValidator(e){if(e.outputSchema)try{return{ok:!0,validator:this._jsonSchemaValidator.getValidator(e.outputSchema)}}catch(e){return{ok:!1,compileError:e}}}async _resolveXMcpHeaderScan(e,t){let n=t??await this._cache.toolDefinition(e);return n===void 0?void 0:zA(n.inputSchema)}async readResource(e,t){let n=await this._serveFromCache(`resources/read`,e.uri,t);if(n!==void 0)return n;let r=this._cache.captureGeneration(`resources/read`,e.uri),i=await this.request({method:`resources/read`,params:e},t);if(t?.cacheMode!==`bypass`){let n=this._freshness(i,e.uri);n.expiresAt>this._cache.now()?await this._cache.write(`resources/read`,i,r,n):t?.cacheMode===`refresh`&&await this._cache.evictKey(`resources/read`,e.uri)}return i}async subscribeResource(e,t){return this.request({method:`resources/subscribe`,params:e},t)}async unsubscribeResource(e,t){return this.request({method:`resources/unsubscribe`,params:e},t)}async listen(e,t){if(this.transport===void 0)throw new YO(JO.NotConnected,`Not connected`);let n=this._negotiatedProtocolVersion;if(n===void 0||!$O(n))throw new YO(JO.MethodNotSupportedByProtocolVersion,`subscriptions/listen requires a 2026-07-28-era connection (negotiated: ${n??`none`}). On a 2025-era connection, change notifications are delivered unsolicited: use ClientOptions.listChanged and resources/subscribe instead.`,{method:`subscriptions/listen`,protocolVersion:n});if(t?.signal?.aborted){let e=t.signal.reason;throw e instanceof YO?e:new YO(JO.RequestTimeout,String(e))}let r=new AbortController,i=`listen:${this._nextListenId++}`,a=`opening`,o,s,c,l,u=new Promise((e,t)=>{c=e,l=t}),d,f=new Promise(e=>{d=e}),p=e=>{if(a===`closed`)return;let n=a===`opening`;if(o!==void 0&&(clearTimeout(o),o=void 0),`ack`in e){a=`open`,c(e.ack);return}a=`closed`,s!==void 0&&t?.signal?.removeEventListener(`abort`,s),this._listenState.delete(i),r.abort(),d(e.cause),n&&l(e.error??new YO(JO.ConnectionClosed,`subscriptions/listen closed before the server acknowledged`))},m=async()=>{r.abort(),await this.notification({method:`notifications/cancelled`,params:{requestId:i}}).catch(()=>{})},h=async()=>{a!==`closed`&&(p({cause:`local`}),await m())};this._listenState.set(i,{settle:p});let g=t?.timeout??6e4;if(o=setTimeout(()=>{p({cause:`remote`,error:new YO(JO.RequestTimeout,`subscriptions/listen ack timed out`,{timeout:g})}),m().catch(()=>{})},g),t?.signal){let e=t.signal;s=()=>{if(a===`closed`)return;let t=e.reason;p({cause:`local`,error:t instanceof Error?t:Error(String(t??`Aborted`))}),m().catch(()=>{})},e.addEventListener(`abort`,s,{once:!0})}let _={jsonrpc:`2.0`,id:i,method:`subscriptions/listen`,params:{_meta:{...this._outboundMetaEnvelope()},notifications:e}};try{await this.transport.send(_,{requestSignal:r.signal,onRequestStreamEnd:()=>p({cause:`remote`,error:Error(`subscriptions/listen: stream ended`)})})}catch(e){p({cause:`remote`,error:e instanceof Error?e:Error(String(e))})}return{honoredFilter:await u,close:h,closed:f}}get autoOpenedSubscription(){return this._autoOpenedSubscription}_onnotification(e,t){let n=Object.hasOwn(jP,e.method)?jP[e.method]:void 0;if(e.method===`notifications/resources/updated`){let t=e.params?.uri;typeof t==`string`&&this._cache.evictKey(`resources/read`,t)}else if(n!==void 0)for(let e of n)this._cache.evict(e);if(e.method===`notifications/subscriptions/acknowledged`){let t=e.params?._meta?.[kT],n=typeof t==`string`?this._listenState.get(t):void 0;if(n!==void 0){let t=this._wireCodec().validateNotification(`notifications/subscriptions/acknowledged`,e);n.settle({ack:t.ok?t.value.params.notifications:{}});return}}if(e.method===`notifications/cancelled`){let t=e.params?.requestId,n=typeof t==`string`?this._listenState.get(t):void 0;if(n!==void 0){n.settle({cause:`remote`,error:Error(`subscriptions/listen: server cancelled the subscription`)});return}}super._onnotification(e,t)}_onresponse(e){let t=e.id,n=typeof t==`string`?this._listenState.get(t):void 0;if(n!==void 0){NA(e)?n.settle({cause:`remote`,error:Bk.fromError(e.error.code,e.error.message,e.error.data)}):n.settle({cause:`graceful`,error:new YO(JO.ConnectionClosed,`subscriptions/listen: server closed the subscription gracefully before acknowledging`)});return}super._onresponse(e)}_onclose(){if(this._listenState.size>0){let e=new YO(JO.ConnectionClosed,`Connection closed`);for(let t of this._listenState.values())t.settle({cause:`remote`,error:e});this._listenState.clear()}super._onclose()}async callTool(e,t){let n=this.getProtocolEra()===`modern`&&yP()!==`browser`,r=async()=>{if(!n)return t;let r;try{r=await this._resolveXMcpHeaderScan(e.name,t?.toolDefinition)}catch(e){this._reportStoreError(e)}if(!r?.valid||r.declarations.length===0)return t;let i=XA(r.declarations,e.arguments);return Object.keys(i).length===0?t:{...t,headers:{...t?.headers,...i}}},i=t?.toolDefinition===void 0?await this._cache.outputValidator(e.name,e=>this._compileOutputValidator(e)).catch(e=>void this._reportStoreError(e)):this._compileOutputValidator(t.toolDefinition),a=()=>{if(i===void 0||i.ok)return;let t=i.compileError,n=(t instanceof Error?t.message:String(t)).slice(0,200);throw new Bk(zk.InvalidParams,`Tool '${e.name}' has an invalid outputSchema: ${n}`)};a();let o;try{o=await this.request({method:`tools/call`,params:e},await r())}catch(s){let c=s instanceof Bk&&s.code===-32020;if(!n||!c||t?.toolDefinition!==void 0)throw s;let l={signal:t?.signal,timeout:t?.timeout,cacheMode:`refresh`};await this._cache.evict(`tools/list`),await this.listTools(void 0,l).catch(e=>this._reportStoreError(e)),i=await this._cache.outputValidator(e.name,e=>this._compileOutputValidator(e)).catch(e=>void this._reportStoreError(e)),a(),o=await this.request({method:`tools/call`,params:e},await r())}let s=i!==void 0&&i.ok?i.validator:void 0;if(s){if(o.structuredContent===void 0&&!o.isError)throw new Bk(zk.InvalidRequest,`Tool ${e.name} has an output schema but did not return structured content`);if(o.structuredContent!==void 0&&!o.isError)try{let e=s(o.structuredContent);if(!e.valid)throw new Bk(zk.InvalidParams,`Structured content does not match the tool's output schema: ${e.errorMessage}`)}catch(e){throw e instanceof Bk?e:new Bk(zk.InvalidParams,`Failed to validate structured content: ${e instanceof Error?e.message:String(e)}`)}}return o}async listTools(e,t){if(!this._serverCapabilities?.tools&&!this._enforceStrictCapabilities)return console.debug(`Client.listTools() called but server does not advertise tools capability - returning empty list`),{tools:[]};if(e?.cursor!==void 0){let n=await this.request({method:`tools/list`,params:e},t);return this._excludeInvalidXMcpHeaderTools(n),n}let n=await this._serveFromCache(`tools/list`,void 0,t);return n===void 0?this._listAllPages(`tools/list`,e,t,(e,t)=>e.tools.push(...t.tools),e=>this._excludeInvalidXMcpHeaderTools(e)):n}_excludeInvalidXMcpHeaderTools(e){if(this.getProtocolEra()!==`modern`||!this.transport||bP(this.transport)===`stdio`)return;let t=e.tools.filter(e=>{let t=zA(e.inputSchema);return t.valid?!0:(console.warn(`[mcp-sdk] excluding tool '${e.name}' from tools/list: invalid x-mcp-header declaration — ${t.reason}`),!1)});t.length!==e.tools.length&&(e.tools=t)}_setupListChangedHandler(e,t,n,r){let i=ZA(ED,n);if(!i.success)throw Error(`Invalid ${e} listChanged options: ${i.error.message}`);if(typeof n.onChanged!=`function`)throw TypeError(`Invalid ${e} listChanged options: onChanged must be a function`);let{autoRefresh:a,debounceMs:o}=i.data,{onChanged:s}=n,c=async()=>{if(!a){s(null,null);return}try{s(null,await r())}catch(e){s(e instanceof Error?e:Error(String(e)),null)}};this.setNotificationHandler(t,()=>{if(o){let t=this._listChangedDebounceTimers.get(e);t&&clearTimeout(t);let n=setTimeout(c,o);this._listChangedDebounceTimers.set(e,n)}else c()})}async sendRootsListChanged(){return this.notification({method:`notifications/roots/list_changed`})}};async function Ane(e){let{tokenEndpoint:t,audience:n,resource:r,idToken:i,clientId:a,clientSecret:o,scope:s,fetchFn:c=fetch}=e,l=TN(t),u=new URLSearchParams({grant_type:`urn:ietf:params:oauth:grant-type:token-exchange`,requested_token_type:`urn:ietf:params:oauth:token-type:id-jag`,audience:String(n),resource:String(r),subject_token:i,subject_token_type:`urn:ietf:params:oauth:token-type:id_token`,client_id:a});o&&u.set(`client_secret`,o),s&&u.set(`scope`,s);let d=await c(l,{method:`POST`,headers:{"Content-Type":`application/x-www-form-urlencoded`},body:u.toString()});if(!d.ok){let e=await d.json().catch(()=>({})),t=RO.safeParse(e);if(t.success){let{error:e,error_description:n}=t.data;throw Error(`Token exchange failed: ${e}${n?` - ${n}`:``}`)}throw Error(`Token exchange failed with status ${d.status}: ${JSON.stringify(e)}`)}let f=LO.safeParse(await d.json());if(!f.success)throw Error(`Invalid token exchange response: ${f.error.message}`);return{jwtAuthGrant:f.data.access_token,expiresIn:f.data.expires_in,scope:f.data.scope}}async function jne(e){let{idpUrl:t,fetchFn:n=fetch,...r}=e,i=await VN(String(t),{fetchFn:n});if(!i?.token_endpoint)throw Error(`Failed to discover token endpoint for IdP: ${t}`);return Ane({...r,tokenEndpoint:i.token_endpoint,fetchFn:n})}(class extends Error{static{Object.defineProperty(this,"mcpBrand",{value:`mcp.SseError`})}static[Symbol.hasInstance](e){return GO(this,e)}static isInstance(e){if(typeof this!=`function`)throw TypeError("isInstance must be called on the class (e.g. `SdkError.isInstance(value)`); for callbacks use `v => SdkError.isInstance(v)`");return GO(this,e)}constructor(e,t,n){super(`SSE error: ${t}`),this.code=e,this.event=n,WO(this,new.target)}});var Mne=`x-mcp-header`,MP=`Mcp-Param-`,Nne=/^[!#$%&'*+\-.^_`|~0-9A-Za-z]+$/,Pne=new Set([`string`,`integer`,`boolean`,`number`]),Fne=[`items`,`prefixItems`,`contains`,`additionalProperties`,`unevaluatedProperties`,`unevaluatedItems`,`propertyNames`,`patternProperties`,`dependentSchemas`,`oneOf`,`anyOf`,`allOf`,`not`,`if`,`then`,`else`,`$defs`,`definitions`],Ine=new Set([`patternProperties`,`dependentSchemas`,`$defs`,`definitions`]);function NP(e){return e.length===0?`<root>`:e.join(`.`)}function PP(e){return typeof e==`object`&&!!e}function FP(e){let t=[],n=new Map,r=(e,i,a)=>{if(!PP(e))return;let o=e;if(`x-mcp-header`in o){if(!a||i.length===0)return`${NP(i)}: x-mcp-header is only permitted on properties statically reachable via a chain of 'properties' keys (not under items, additionalProperties, oneOf/anyOf/allOf/not, if/then/else, or $ref)`;let e=o[Mne];if(typeof e!=`string`||e.length===0)return`${NP(i)}: x-mcp-header MUST be a non-empty string`;if(!Nne.test(e))return`${NP(i)}: x-mcp-header '${e}' is not a valid RFC 9110 token (no spaces, control characters or HTTP delimiters)`;let r=typeof o.type==`string`?o.type:void 0;if(r===void 0||!Pne.has(r))return`${NP(i)}: x-mcp-header is only permitted on primitive-typed properties (string, integer, boolean); got ${r??`<none>`}`;let s=e.toLowerCase(),c=n.get(s);if(c!==void 0)return`x-mcp-header '${e}' is not case-insensitively unique (also declared as '${c}')`;n.set(s,e),t.push({path:i,headerName:e,type:r})}let s=o.properties;if(PP(s))for(let[e,t]of Object.entries(s)){let n=r(t,[...i,e],a);if(n!==void 0)return n}for(let e of Fne){let t=o[e];if(t===void 0)continue;let n=Array.isArray(t)?t:PP(t)&&Ine.has(e)?Object.values(t):[t];for(let t of n){let n=r(t,[...i,`<${e}>`],!1);if(n!==void 0)return n}}},i=r(e,[],!0);return i===void 0?{valid:!0,declarations:t}:{valid:!1,reason:i}}var IP=`=?base64?`,LP=`?=`;function Lne(e){if(typeof e==`string`)return e;if(typeof e==`boolean`)return e?`true`:`false`;if(typeof e==`number`)return!Number.isFinite(e)||Number.isInteger(e)&&!Number.isSafeInteger(e)?void 0:String(e)}function Rne(e){if(e.length===0||e.startsWith(IP)&&e.endsWith(LP)||e!==e.trim())return!0;for(let t=0;t<e.length;t++){let n=e.codePointAt(t);if(!(n===9||n>=32&&n<=126))return!0}return!1}function zne(e){let t=new TextEncoder().encode(e),n=``;for(let e of t)n+=String.fromCodePoint(e);return btoa(n)}function Bne(e){return Rne(e)?`${IP}${zne(e)}${LP}`:e}function Vne(e,t){let n=e;for(let e of t){if(typeof n!=`object`||!n)return;n=n[e]}return n}function Hne(e,t){let n={};for(let r of e){let e=Vne(t,r.path);if(e==null)continue;let i=Lne(e);i!==void 0&&(n[`${MP}${r.headerName}`]=Bne(i))}return n}function Une(e,t){let n=FP(e.inputSchema);return!n.valid||n.declarations.length===0?{}:Hne(n.declarations,t)}function Wne(e){let t=FP(e.inputSchema);return t.valid?t.declarations.map(e=>({path:e.path.join(`.`),header:`${MP}${e.headerName}`,headerName:e.headerName,type:e.type})):[]}function RP(e){if(!(`type`in e)||e.type===void 0)return`stdio`;let t=e.type;if(t===`stdio`)return`stdio`;if(t===`sse`)return`sse`;if(t===`streamable-http`)return`streamable-http`;throw Error(`Invalid server type: ${t}. Valid types are: stdio, sse, streamable-http`)}function zP(e){return e===`sse`||e===`streamable-http`}function Gne(e){if(e.type===`sse`||e.type===`streamable-http`)return e.url}function BP(e){return e===`disconnected`||e===`error`}var VP={active:!1,status:`ended`,honoredUris:[]},Kne=6e4,qne=1e3;function HP(e){let t=e?.modernLogLevel??`debug`;return t===`off`?void 0:t}var UP=[`off`,`debug`,`info`,`notice`,`warning`,`error`,`critical`,`alert`,`emergency`];function Jne(e){return typeof e==`string`&&UP.includes(e)}var Yne=`2026-07-28`;function Xne(e){switch(e){case`auto`:return{mode:`auto`};case`modern`:return{mode:{pin:Yne}};case`legacy`:return{mode:`legacy`}}}function WP(e){return e}function Zne(e,t){if(!e)return e;if(t.type===`number`||t.type===`integer`)return Number(e);if(t.type===`boolean`)return e.toLowerCase()===`true`;if(t.type===`object`||t.type===`array`)try{return JSON.parse(e)}catch{return e}return e}function Qne(e,t){let n={},r=e.inputSchema?.properties||{};for(let[e,i]of Object.entries(t)){let t=r[e];n[e]=t?Zne(i,t):i}return n}function $ne(e){let t={};for(let[n,r]of Object.entries(e))t[n]=typeof r==`string`?r:r==null?String(r):JSON.stringify(r);return t}var ere=new Set([`stdio`,`sse`,`streamable-http`]),tre=new Set([`legacy`,`auto`,`modern`]);function nre(e){return typeof e==`string`&&tre.has(e)}function GP(e){let t=e.type,n;return n=typeof t==`string`?t===`http`?`streamable-http`:ere.has(t)?t:`stdio`:`stdio`,{...e,type:n}}function KP(e){return Array.isArray(e)?e.filter(e=>typeof e?.uri==`string`?e.uri.trim()!==``:(console.warn("Dropping root without a string `uri`:",e),!1)).map(e=>{let t=e.name;t!==void 0&&typeof t!=`string`&&console.warn("Dropping non-string `name` on root:",e);let n=typeof t==`string`?t.trim():void 0,{name:r,...i}=e;return n?{...i,name:n}:i}):(console.warn("Ignoring `roots`: expected an array, got",typeof e),[])}function rre(e){return e?Object.entries(e).map(([e,t])=>({key:e,value:t})):[]}function ire(e){if(e.headers===void 0&&e.metadata===void 0&&e.connectionTimeout===void 0&&e.requestTimeout===void 0&&e.taskTtl===void 0&&e.autoRefreshOnListChanged===void 0&&e.paginatedLists===void 0&&e.advertisedExtensions===void 0&&e.maxFetchRequests===void 0&&e.oauth===void 0&&e.roots===void 0&&e.protocolEra===void 0&&e.modernLogLevel===void 0&&e.env===void 0&&e.cwd===void 0)return;let t={headers:e.headers?Object.entries(e.headers).map(([e,t])=>({key:e,value:t})):[],env:rre(e.env),metadata:e.metadata??[],connectionTimeout:e.connectionTimeout??0,requestTimeout:e.requestTimeout??0,taskTtl:e.taskTtl??6e4,autoRefreshOnListChanged:e.autoRefreshOnListChanged??!1,paginatedLists:e.paginatedLists??!1,maxFetchRequests:e.maxFetchRequests??1e3,roots:e.roots??[]};return nre(e.protocolEra)&&(t.protocolEra=e.protocolEra),Jne(e.modernLogLevel)&&(t.modernLogLevel=e.modernLogLevel),e.advertisedExtensions&&Object.keys(e.advertisedExtensions).length>0&&(t.advertisedExtensions={...e.advertisedExtensions}),e.oauth?.clientId&&(t.oauthClientId=e.oauth.clientId),e.oauth?.clientSecret&&(t.oauthClientSecret=e.oauth.clientSecret),e.oauth?.scopes&&(t.oauthScopes=e.oauth.scopes),e.oauth?.onInsufficientScope&&(t.oauthOnInsufficientScope=e.oauth.onInsufficientScope),e.oauth?.enterpriseManaged===!0&&(t.enterpriseManaged=!0),e.cwd&&(t.cwd=e.cwd),t}function are(e){let t={},n={};for(let{key:t,value:r}of e.headers)t.trim()!==``&&(n[t]=r);Object.keys(n).length>0&&(t.headers=n);let r=e.metadata.filter(e=>e.key.trim()!==``);r.length>0&&(t.metadata=r),e.connectionTimeout>0&&(t.connectionTimeout=e.connectionTimeout),e.requestTimeout>0&&(t.requestTimeout=e.requestTimeout),e.taskTtl>0&&e.taskTtl!==6e4&&(t.taskTtl=e.taskTtl),e.autoRefreshOnListChanged&&(t.autoRefreshOnListChanged=!0),e.paginatedLists&&(t.paginatedLists=!0),e.advertisedExtensions&&Object.keys(e.advertisedExtensions).length>0&&(t.advertisedExtensions={...e.advertisedExtensions}),e.protocolEra!==void 0&&e.protocolEra!==`legacy`&&(t.protocolEra=e.protocolEra),e.modernLogLevel!==void 0&&e.modernLogLevel!==`debug`&&(t.modernLogLevel=e.modernLogLevel),e.maxFetchRequests!==1e3&&(t.maxFetchRequests=e.maxFetchRequests);let i={};e.oauthClientId&&(i.clientId=e.oauthClientId),e.oauthClientSecret&&(i.clientSecret=e.oauthClientSecret),e.oauthScopes&&(i.scopes=e.oauthScopes),e.oauthOnInsufficientScope&&(i.onInsufficientScope=e.oauthOnInsufficientScope),e.enterpriseManaged===!0&&(i.enterpriseManaged=!0),Object.keys(i).length>0&&(t.oauth=i);let a=KP(e.roots);return a.length>0&&(t.roots=a),t}var ore=new Set(Object.keys({headers:!0,metadata:!0,protocolEra:!0,modernLogLevel:!0,connectionTimeout:!0,requestTimeout:!0,taskTtl:!0,autoRefreshOnListChanged:!0,paginatedLists:!0,advertisedExtensions:!0,maxFetchRequests:!0,oauth:!0,roots:!0}));function sre(e){return Object.entries(e.mcpServers).map(([e,t])=>{let n={},r={},i=WP(n);for(let[e,n]of Object.entries(WP(t)))ore.has(e)?i[e]=n:r[e]=n;let a=GP(r),o={id:e,name:e,config:a,connection:{status:`disconnected`}},s=a.type===`stdio`||a.type===void 0?a:void 0,c=ire({...n,env:s?.env,cwd:s?.cwd});return c!==void 0&&(o.settings=c),o})}function cre(e){let t={};for(let n of e){let e={...n.config};n.settings!==void 0&&Object.assign(e,are(n.settings)),t[n.id]=e}return{mcpServers:t}}function lre(e){return JSON.stringify(cre(e),null,2)}var ure=class{baseTransport;callbacks;negotiatedProtocolVersion;hooks;constructor(e,t,n={}){this.baseTransport=e,this.callbacks=t,this.hooks=n}async start(){return this.baseTransport.start()}async send(e,t){return`id`in e&&e.id!==null&&e.id!==void 0?`result`in e||`error`in e?this.callbacks.trackResponse?.(e,`client`):`method`in e&&this.callbacks.trackRequest?.(e,`client`):`method`in e&&this.callbacks.trackNotification?.(e,`client`),this.baseTransport.send(e,t)}async close(){return this.baseTransport.close()}get onclose(){return this.baseTransport.onclose}set onclose(e){this.baseTransport.onclose=e}get onerror(){return this.baseTransport.onerror}set onerror(e){this.baseTransport.onerror=e}get onmessage(){return this.baseTransport.onmessage}set onmessage(e){e?this.baseTransport.onmessage=(t,n)=>{if(`id`in t&&t.id!==null&&t.id!==void 0)if(`result`in t||`error`in t){if(this.callbacks.trackResponse?.(t,`server`),this.hooks.consumeIncomingResponse?.(t))return;if(this.hooks.rewriteIncomingResult&&`result`in t){let r=this.hooks.rewriteIncomingResult(t);if(r!==t){e(r,n);return}}}else`method`in t&&this.callbacks.trackRequest?.(t,`server`);else`method`in t&&this.callbacks.trackNotification?.(t,`server`);e(t,n)}:this.baseTransport.onmessage=void 0}get sessionId(){return this.baseTransport.sessionId}setProtocolVersion(e){this.negotiatedProtocolVersion=e,this.baseTransport.setProtocolVersion?.(e)}get protocolVersion(){return this.negotiatedProtocolVersion}},qP=`io.modelcontextprotocol/tasks`,JP=`io.modelcontextprotocol/inspector/modernTaskHandle`;function dre(e){return typeof e==`object`&&!!e&&e.resultType===`task`&&typeof e.taskId==`string`}var fre=$w([`working`,`input_required`,`completed`,`failed`,`cancelled`]),YP=Gw({taskId:q(),status:fre,statusMessage:q().optional(),createdAt:q(),lastUpdatedAt:q(),ttlMs:J().nullable().optional(),pollIntervalMs:J().optional(),result:Q(q(),Hw()).optional(),error:Q(q(),Hw()).optional(),inputRequests:Q(q(),Hw()).optional()}),pre=Gw({}),mre=Gw({});function XP(e){let{ttlMs:t,pollIntervalMs:n,...r}=e,i={...r};return i.ttl=t??null,n!=null&&(i.pollInterval=n),i}function hre(e){return e.inputRequests}var gre=`io.modelcontextprotocol/enterprise-managed-authorization`,ZP=[{key:qP,label:`Tasks (io.modelcontextprotocol/tasks)`,defaultAdvertised:!0},{key:`io.modelcontextprotocol/ui`,label:`MCP Apps UI (io.modelcontextprotocol/ui)`,defaultAdvertised:!0,advertisement:{mimeTypes:[`text/html;profile=mcp-app`]}}];function _re(e){let t={};for(let n of ZP)(e.advertised?.[n.key]??n.defaultAdvertised)&&(t[n.key]=n.advertisement?structuredClone(n.advertisement):{});return e.enterpriseManaged&&(t[gre]={}),t}var QP=G((e=>{Object.defineProperty(e,"__esModule",{value:!0}),e.regexpCode=e.getEsmExportName=e.getProperty=e.safeStringify=e.stringify=e.strConcat=e.addCodeArg=e.str=e._=e.nil=e._Code=e.Name=e.IDENTIFIER=e._CodeOrName=void 0;var t=class{};e._CodeOrName=t,e.IDENTIFIER=/^[a-z$_][a-z$_0-9]*$/i;var n=class extends t{constructor(t){if(super(),!e.IDENTIFIER.test(t))throw Error(`CodeGen: name must be a valid identifier`);this.str=t}toString(){return this.str}emptyStr(){return!1}get names(){return{[this.str]:1}}};e.Name=n;var r=class extends t{constructor(e){super(),this._items=typeof e==`string`?[e]:e}toString(){return this.str}emptyStr(){if(this._items.length>1)return!1;let e=this._items[0];return e===``||e===`""`}get str(){return this._str??=this._items.reduce((e,t)=>`${e}${t}`,``)}get names(){return this._names??=this._items.reduce((e,t)=>(t instanceof n&&(e[t.str]=(e[t.str]||0)+1),e),{})}};e._Code=r,e.nil=new r(``);function i(e,...t){let n=[e[0]],i=0;for(;i<t.length;)s(n,t[i]),n.push(e[++i]);return new r(n)}e._=i;let a=new r(`+`);function o(e,...t){let n=[p(e[0])],i=0;for(;i<t.length;)n.push(a),s(n,t[i]),n.push(a,p(e[++i]));return c(n),new r(n)}e.str=o;function s(e,t){t instanceof r?e.push(...t._items):t instanceof n?e.push(t):e.push(d(t))}e.addCodeArg=s;function c(e){let t=1;for(;t<e.length-1;){if(e[t]===a){let n=l(e[t-1],e[t+1]);if(n!==void 0){e.splice(t-1,3,n);continue}e[t++]=`+`}t++}}function l(e,t){if(t===`""`)return e;if(e===`""`)return t;if(typeof e==`string`)return t instanceof n||e[e.length-1]!==`"`?void 0:typeof t==`string`?t[0]===`"`?e.slice(0,-1)+t.slice(1):void 0:`${e.slice(0,-1)}${t}"`;if(typeof t==`string`&&t[0]===`"`&&!(e instanceof n))return`"${e}${t.slice(1)}`}function u(e,t){return t.emptyStr()?e:e.emptyStr()?t:o`${e}${t}`}e.strConcat=u;function d(e){return typeof e==`number`||typeof e==`boolean`||e===null?e:p(Array.isArray(e)?e.join(`,`):e)}function f(e){return new r(p(e))}e.stringify=f;function p(e){return JSON.stringify(e).replace(/\u2028/g,`\\u2028`).replace(/\u2029/g,`\\u2029`)}e.safeStringify=p;function m(t){return typeof t==`string`&&e.IDENTIFIER.test(t)?new r(`.${t}`):i`[${t}]`}e.getProperty=m;function h(t){if(typeof t==`string`&&e.IDENTIFIER.test(t))return new r(`${t}`);throw Error(`CodeGen: invalid export name: ${t}, use explicit $id name mapping`)}e.getEsmExportName=h;function g(e){return new r(e.toString())}e.regexpCode=g})),$P=G((e=>{Object.defineProperty(e,"__esModule",{value:!0}),e.ValueScope=e.ValueScopeName=e.Scope=e.varKinds=e.UsedValueState=void 0;let t=QP();var n=class extends Error{constructor(e){super(`CodeGen: "code" for ${e} not defined`),this.value=e.value}},r;(function(e){e[e.Started=0]=`Started`,e[e.Completed=1]=`Completed`})(r||(e.UsedValueState=r={})),e.varKinds={const:new t.Name(`const`),let:new t.Name(`let`),var:new t.Name(`var`)};var i=class{constructor({prefixes:e,parent:t}={}){this._names={},this._prefixes=e,this._parent=t}toName(e){return e instanceof t.Name?e:this.name(e)}name(e){return new t.Name(this._newName(e))}_newName(e){let t=this._names[e]||this._nameGroup(e);return`${e}${t.index++}`}_nameGroup(e){if((this._parent?._prefixes)?.has(e)||this._prefixes&&!this._prefixes.has(e))throw Error(`CodeGen: prefix "${e}" is not allowed in this scope`);return this._names[e]={prefix:e,index:0}}};e.Scope=i;var a=class extends t.Name{constructor(e,t){super(t),this.prefix=e}setValue(e,{property:n,itemIndex:r}){this.value=e,this.scopePath=(0,t._)`.${new t.Name(n)}[${r}]`}};e.ValueScopeName=a;let o=(0,t._)`\n`;e.ValueScope=class extends i{constructor(e){super(e),this._values={},this._scope=e.scope,this.opts={...e,_n:e.lines?o:t.nil}}get(){return this._scope}name(e){return new a(e,this._newName(e))}value(e,t){if(t.ref===void 0)throw Error(`CodeGen: ref must be passed in value`);let n=this.toName(e),{prefix:r}=n,i=t.key??t.ref,a=this._values[r];if(a){let e=a.get(i);if(e)return e}else a=this._values[r]=new Map;a.set(i,n);let o=this._scope[r]||(this._scope[r]=[]),s=o.length;return o[s]=t.ref,n.setValue(t,{property:r,itemIndex:s}),n}getValue(e,t){let n=this._values[e];if(n)return n.get(t)}scopeRefs(e,n=this._values){return this._reduceValues(n,n=>{if(n.scopePath===void 0)throw Error(`CodeGen: name "${n}" has no value`);return(0,t._)`${e}${n.scopePath}`})}scopeCode(e=this._values,t,n){return this._reduceValues(e,e=>{if(e.value===void 0)throw Error(`CodeGen: name "${e}" has no value`);return e.value.code},t,n)}_reduceValues(i,a,o={},s){let c=t.nil;for(let l in i){let u=i[l];if(!u)continue;let d=o[l]=o[l]||new Map;u.forEach(i=>{if(d.has(i))return;d.set(i,r.Started);let o=a(i);if(o){let n=this.opts.es5?e.varKinds.var:e.varKinds.const;c=(0,t._)`${c}${n} ${i} = ${o};${this.opts._n}`}else if(o=s?.(i))c=(0,t._)`${c}${o}${this.opts._n}`;else throw new n(i);d.set(i,r.Completed)})}return c}}})),eF=G((e=>{Object.defineProperty(e,"__esModule",{value:!0}),e.or=e.and=e.not=e.CodeGen=e.operators=e.varKinds=e.ValueScopeName=e.ValueScope=e.Scope=e.Name=e.regexpCode=e.stringify=e.getProperty=e.nil=e.strConcat=e.str=e._=void 0;let t=QP(),n=$P();var r=QP();Object.defineProperty(e,"_",{enumerable:!0,get:function(){return r._}}),Object.defineProperty(e,"str",{enumerable:!0,get:function(){return r.str}}),Object.defineProperty(e,"strConcat",{enumerable:!0,get:function(){return r.strConcat}}),Object.defineProperty(e,"nil",{enumerable:!0,get:function(){return r.nil}}),Object.defineProperty(e,"getProperty",{enumerable:!0,get:function(){return r.getProperty}}),Object.defineProperty(e,"stringify",{enumerable:!0,get:function(){return r.stringify}}),Object.defineProperty(e,"regexpCode",{enumerable:!0,get:function(){return r.regexpCode}}),Object.defineProperty(e,"Name",{enumerable:!0,get:function(){return r.Name}});var i=$P();Object.defineProperty(e,"Scope",{enumerable:!0,get:function(){return i.Scope}}),Object.defineProperty(e,"ValueScope",{enumerable:!0,get:function(){return i.ValueScope}}),Object.defineProperty(e,"ValueScopeName",{enumerable:!0,get:function(){return i.ValueScopeName}}),Object.defineProperty(e,"varKinds",{enumerable:!0,get:function(){return i.varKinds}}),e.operators={GT:new t._Code(`>`),GTE:new t._Code(`>=`),LT:new t._Code(`<`),LTE:new t._Code(`<=`),EQ:new t._Code(`===`),NEQ:new t._Code(`!==`),NOT:new t._Code(`!`),OR:new t._Code(`||`),AND:new t._Code(`&&`),ADD:new t._Code(`+`)};var a=class{optimizeNodes(){return this}optimizeNames(e,t){return this}},o=class extends a{constructor(e,t,n){super(),this.varKind=e,this.name=t,this.rhs=n}render({es5:e,_n:t}){let r=e?n.varKinds.var:this.varKind,i=this.rhs===void 0?``:` = ${this.rhs}`;return`${r} ${this.name}${i};`+t}optimizeNames(e,t){if(e[this.name.str])return this.rhs&&=k(this.rhs,e,t),this}get names(){return this.rhs instanceof t._CodeOrName?this.rhs.names:{}}},s=class extends a{constructor(e,t,n){super(),this.lhs=e,this.rhs=t,this.sideEffects=n}render({_n:e}){return`${this.lhs} = ${this.rhs};`+e}optimizeNames(e,n){if(!(this.lhs instanceof t.Name&&!e[this.lhs.str]&&!this.sideEffects))return this.rhs=k(this.rhs,e,n),this}get names(){return O(this.lhs instanceof t.Name?{}:{...this.lhs.names},this.rhs)}},c=class extends s{constructor(e,t,n,r){super(e,n,r),this.op=t}render({_n:e}){return`${this.lhs} ${this.op}= ${this.rhs};`+e}},l=class extends a{constructor(e){super(),this.label=e,this.names={}}render({_n:e}){return`${this.label}:`+e}},u=class extends a{constructor(e){super(),this.label=e,this.names={}}render({_n:e}){return`break${this.label?` ${this.label}`:``};`+e}},d=class extends a{constructor(e){super(),this.error=e}render({_n:e}){return`throw ${this.error};`+e}get names(){return this.error.names}},f=class extends a{constructor(e){super(),this.code=e}render({_n:e}){return`${this.code};`+e}optimizeNodes(){return`${this.code}`?this:void 0}optimizeNames(e,t){return this.code=k(this.code,e,t),this}get names(){return this.code instanceof t._CodeOrName?this.code.names:{}}},p=class extends a{constructor(e=[]){super(),this.nodes=e}render(e){return this.nodes.reduce((t,n)=>t+n.render(e),``)}optimizeNodes(){let{nodes:e}=this,t=e.length;for(;t--;){let n=e[t].optimizeNodes();Array.isArray(n)?e.splice(t,1,...n):n?e[t]=n:e.splice(t,1)}return e.length>0?this:void 0}optimizeNames(e,t){let{nodes:n}=this,r=n.length;for(;r--;){let i=n[r];i.optimizeNames(e,t)||(A(e,i.names),n.splice(r,1))}return n.length>0?this:void 0}get names(){return this.nodes.reduce((e,t)=>D(e,t.names),{})}},m=class extends p{render(e){return`{`+e._n+super.render(e)+`}`+e._n}},h=class extends p{},g=class extends m{};g.kind=`else`;var _=class e extends m{constructor(e,t){super(t),this.condition=e}render(e){let t=`if(${this.condition})`+super.render(e);return this.else&&(t+=`else `+this.else.render(e)),t}optimizeNodes(){super.optimizeNodes();let t=this.condition;if(t===!0)return this.nodes;let n=this.else;if(n){let e=n.optimizeNodes();n=this.else=Array.isArray(e)?new g(e):e}if(n)return t===!1?n instanceof e?n:n.nodes:this.nodes.length?this:new e(j(t),n instanceof e?[n]:n.nodes);if(!(t===!1||!this.nodes.length))return this}optimizeNames(e,t){if(this.else=this.else?.optimizeNames(e,t),super.optimizeNames(e,t)||this.else)return this.condition=k(this.condition,e,t),this}get names(){let e=super.names;return O(e,this.condition),this.else&&D(e,this.else.names),e}};_.kind=`if`;var v=class extends m{};v.kind=`for`;var y=class extends v{constructor(e){super(),this.iteration=e}render(e){return`for(${this.iteration})`+super.render(e)}optimizeNames(e,t){if(super.optimizeNames(e,t))return this.iteration=k(this.iteration,e,t),this}get names(){return D(super.names,this.iteration.names)}},b=class extends v{constructor(e,t,n,r){super(),this.varKind=e,this.name=t,this.from=n,this.to=r}render(e){let t=e.es5?n.varKinds.var:this.varKind,{name:r,from:i,to:a}=this;return`for(${t} ${r}=${i}; ${r}<${a}; ${r}++)`+super.render(e)}get names(){return O(O(super.names,this.from),this.to)}},x=class extends v{constructor(e,t,n,r){super(),this.loop=e,this.varKind=t,this.name=n,this.iterable=r}render(e){return`for(${this.varKind} ${this.name} ${this.loop} ${this.iterable})`+super.render(e)}optimizeNames(e,t){if(super.optimizeNames(e,t))return this.iterable=k(this.iterable,e,t),this}get names(){return D(super.names,this.iterable.names)}},S=class extends m{constructor(e,t,n){super(),this.name=e,this.args=t,this.async=n}render(e){return`${this.async?`async `:``}function ${this.name}(${this.args})`+super.render(e)}};S.kind=`func`;var C=class extends p{render(e){return`return `+super.render(e)}};C.kind=`return`;var w=class extends m{render(e){let t=`try`+super.render(e);return this.catch&&(t+=this.catch.render(e)),this.finally&&(t+=this.finally.render(e)),t}optimizeNodes(){var e,t;return super.optimizeNodes(),(e=this.catch)==null||e.optimizeNodes(),(t=this.finally)==null||t.optimizeNodes(),this}optimizeNames(e,t){var n,r;return super.optimizeNames(e,t),(n=this.catch)==null||n.optimizeNames(e,t),(r=this.finally)==null||r.optimizeNames(e,t),this}get names(){let e=super.names;return this.catch&&D(e,this.catch.names),this.finally&&D(e,this.finally.names),e}},T=class extends m{constructor(e){super(),this.error=e}render(e){return`catch(${this.error})`+super.render(e)}};T.kind=`catch`;var E=class extends m{render(e){return`finally`+super.render(e)}};E.kind=`finally`,e.CodeGen=class{constructor(e,t={}){this._values={},this._blockStarts=[],this._constants={},this.opts={...t,_n:t.lines?`
127
- `:``},this._extScope=e,this._scope=new n.Scope({parent:e}),this._nodes=[new h]}toString(){return this._root.render(this.opts)}name(e){return this._scope.name(e)}scopeName(e){return this._extScope.name(e)}scopeValue(e,t){let n=this._extScope.value(e,t);return(this._values[n.prefix]||(this._values[n.prefix]=new Set)).add(n),n}getScopeValue(e,t){return this._extScope.getValue(e,t)}scopeRefs(e){return this._extScope.scopeRefs(e,this._values)}scopeCode(){return this._extScope.scopeCode(this._values)}_def(e,t,n,r){let i=this._scope.toName(t);return n!==void 0&&r&&(this._constants[i.str]=n),this._leafNode(new o(e,i,n)),i}const(e,t,r){return this._def(n.varKinds.const,e,t,r)}let(e,t,r){return this._def(n.varKinds.let,e,t,r)}var(e,t,r){return this._def(n.varKinds.var,e,t,r)}assign(e,t,n){return this._leafNode(new s(e,t,n))}add(t,n){return this._leafNode(new c(t,e.operators.ADD,n))}code(e){return typeof e==`function`?e():e!==t.nil&&this._leafNode(new f(e)),this}object(...e){let n=[`{`];for(let[r,i]of e)n.length>1&&n.push(`,`),n.push(r),(r!==i||this.opts.es5)&&(n.push(`:`),(0,t.addCodeArg)(n,i));return n.push(`}`),new t._Code(n)}if(e,t,n){if(this._blockNode(new _(e)),t&&n)this.code(t).else().code(n).endIf();else if(t)this.code(t).endIf();else if(n)throw Error(`CodeGen: "else" body without "then" body`);return this}elseIf(e){return this._elseNode(new _(e))}else(){return this._elseNode(new g)}endIf(){return this._endBlockNode(_,g)}_for(e,t){return this._blockNode(e),t&&this.code(t).endFor(),this}for(e,t){return this._for(new y(e),t)}forRange(e,t,r,i,a=this.opts.es5?n.varKinds.var:n.varKinds.let){let o=this._scope.toName(e);return this._for(new b(a,o,t,r),()=>i(o))}forOf(e,r,i,a=n.varKinds.const){let o=this._scope.toName(e);if(this.opts.es5){let e=r instanceof t.Name?r:this.var(`_arr`,r);return this.forRange(`_i`,0,(0,t._)`${e}.length`,n=>{this.var(o,(0,t._)`${e}[${n}]`),i(o)})}return this._for(new x(`of`,a,o,r),()=>i(o))}forIn(e,r,i,a=this.opts.es5?n.varKinds.var:n.varKinds.const){if(this.opts.ownProperties)return this.forOf(e,(0,t._)`Object.keys(${r})`,i);let o=this._scope.toName(e);return this._for(new x(`in`,a,o,r),()=>i(o))}endFor(){return this._endBlockNode(v)}label(e){return this._leafNode(new l(e))}break(e){return this._leafNode(new u(e))}return(e){let t=new C;if(this._blockNode(t),this.code(e),t.nodes.length!==1)throw Error(`CodeGen: "return" should have one node`);return this._endBlockNode(C)}try(e,t,n){if(!t&&!n)throw Error(`CodeGen: "try" without "catch" and "finally"`);let r=new w;if(this._blockNode(r),this.code(e),t){let e=this.name(`e`);this._currNode=r.catch=new T(e),t(e)}return n&&(this._currNode=r.finally=new E,this.code(n)),this._endBlockNode(T,E)}throw(e){return this._leafNode(new d(e))}block(e,t){return this._blockStarts.push(this._nodes.length),e&&this.code(e).endBlock(t),this}endBlock(e){let t=this._blockStarts.pop();if(t===void 0)throw Error(`CodeGen: not in self-balancing block`);let n=this._nodes.length-t;if(n<0||e!==void 0&&n!==e)throw Error(`CodeGen: wrong number of nodes: ${n} vs ${e} expected`);return this._nodes.length=t,this}func(e,n=t.nil,r,i){return this._blockNode(new S(e,n,r)),i&&this.code(i).endFunc(),this}endFunc(){return this._endBlockNode(S)}optimize(e=1){for(;e-->0;)this._root.optimizeNodes(),this._root.optimizeNames(this._root.names,this._constants)}_leafNode(e){return this._currNode.nodes.push(e),this}_blockNode(e){this._currNode.nodes.push(e),this._nodes.push(e)}_endBlockNode(e,t){let n=this._currNode;if(n instanceof e||t&&n instanceof t)return this._nodes.pop(),this;throw Error(`CodeGen: not in block "${t?`${e.kind}/${t.kind}`:e.kind}"`)}_elseNode(e){let t=this._currNode;if(!(t instanceof _))throw Error(`CodeGen: "else" without "if"`);return this._currNode=t.else=e,this}get _root(){return this._nodes[0]}get _currNode(){let e=this._nodes;return e[e.length-1]}set _currNode(e){let t=this._nodes;t[t.length-1]=e}};function D(e,t){for(let n in t)e[n]=(e[n]||0)+(t[n]||0);return e}function O(e,n){return n instanceof t._CodeOrName?D(e,n.names):e}function k(e,n,r){if(e instanceof t.Name)return i(e);if(!a(e))return e;return new t._Code(e._items.reduce((e,n)=>(n instanceof t.Name&&(n=i(n)),n instanceof t._Code?e.push(...n._items):e.push(n),e),[]));function i(e){let t=r[e.str];return t===void 0||n[e.str]!==1?e:(delete n[e.str],t)}function a(e){return e instanceof t._Code&&e._items.some(e=>e instanceof t.Name&&n[e.str]===1&&r[e.str]!==void 0)}}function A(e,t){for(let n in t)e[n]=(e[n]||0)-(t[n]||0)}function j(e){return typeof e==`boolean`||typeof e==`number`||e===null?!e:(0,t._)`!${F(e)}`}e.not=j;let M=P(e.operators.AND);function N(...e){return e.reduce(M)}e.and=N;let ee=P(e.operators.OR);function te(...e){return e.reduce(ee)}e.or=te;function P(e){return(n,r)=>n===t.nil?r:r===t.nil?n:(0,t._)`${F(n)} ${e} ${F(r)}`}function F(e){return e instanceof t.Name?e:(0,t._)`(${e})`}})),tF=G((e=>{Object.defineProperty(e,"__esModule",{value:!0}),e.checkStrictMode=e.getErrorPath=e.Type=e.useFunc=e.setEvaluated=e.evaluatedPropsToName=e.mergeEvaluated=e.eachItem=e.unescapeJsonPointer=e.escapeJsonPointer=e.escapeFragment=e.unescapeFragment=e.schemaRefOrVal=e.schemaHasRulesButRef=e.schemaHasRules=e.checkUnknownRules=e.alwaysValidSchema=e.toHash=void 0;let t=eF(),n=QP();function r(e){let t={};for(let n of e)t[n]=!0;return t}e.toHash=r;function i(e,t){return typeof t==`boolean`?t:Object.keys(t).length===0||(a(e,t),!o(t,e.self.RULES.all))}e.alwaysValidSchema=i;function a(e,t=e.schema){let{opts:n,self:r}=e;if(!n.strictSchema||typeof t==`boolean`)return;let i=r.RULES.keywords;for(let n in t)i[n]||x(e,`unknown keyword: "${n}"`)}e.checkUnknownRules=a;function o(e,t){if(typeof e==`boolean`)return!e;for(let n in e)if(t[n])return!0;return!1}e.schemaHasRules=o;function s(e,t){if(typeof e==`boolean`)return!e;for(let n in e)if(n!==`$ref`&&t.all[n])return!0;return!1}e.schemaHasRulesButRef=s;function c({topSchemaRef:e,schemaPath:n},r,i,a){if(!a){if(typeof r==`number`||typeof r==`boolean`)return r;if(typeof r==`string`)return(0,t._)`${r}`}return(0,t._)`${e}${n}${(0,t.getProperty)(i)}`}e.schemaRefOrVal=c;function l(e){return f(decodeURIComponent(e))}e.unescapeFragment=l;function u(e){return encodeURIComponent(d(e))}e.escapeFragment=u;function d(e){return typeof e==`number`?`${e}`:e.replace(/~/g,`~0`).replace(/\//g,`~1`)}e.escapeJsonPointer=d;function f(e){return e.replace(/~1/g,`/`).replace(/~0/g,`~`)}e.unescapeJsonPointer=f;function p(e,t){if(Array.isArray(e))for(let n of e)t(n);else t(e)}e.eachItem=p;function m({mergeNames:e,mergeToName:n,mergeValues:r,resultToName:i}){return(a,o,s,c)=>{let l=s===void 0?o:s instanceof t.Name?(o instanceof t.Name?e(a,o,s):n(a,o,s),s):o instanceof t.Name?(n(a,s,o),o):r(o,s);return c===t.Name&&!(l instanceof t.Name)?i(a,l):l}}e.mergeEvaluated={props:m({mergeNames:(e,n,r)=>e.if((0,t._)`${r} !== true && ${n} !== undefined`,()=>{e.if((0,t._)`${n} === true`,()=>e.assign(r,!0),()=>e.assign(r,(0,t._)`${r} || {}`).code((0,t._)`Object.assign(${r}, ${n})`))}),mergeToName:(e,n,r)=>e.if((0,t._)`${r} !== true`,()=>{n===!0?e.assign(r,!0):(e.assign(r,(0,t._)`${r} || {}`),g(e,r,n))}),mergeValues:(e,t)=>e===!0||{...e,...t},resultToName:h}),items:m({mergeNames:(e,n,r)=>e.if((0,t._)`${r} !== true && ${n} !== undefined`,()=>e.assign(r,(0,t._)`${n} === true ? true : ${r} > ${n} ? ${r} : ${n}`)),mergeToName:(e,n,r)=>e.if((0,t._)`${r} !== true`,()=>e.assign(r,n===!0||(0,t._)`${r} > ${n} ? ${r} : ${n}`)),mergeValues:(e,t)=>e===!0||Math.max(e,t),resultToName:(e,t)=>e.var(`items`,t)})};function h(e,n){if(n===!0)return e.var(`props`,!0);let r=e.var(`props`,(0,t._)`{}`);return n!==void 0&&g(e,r,n),r}e.evaluatedPropsToName=h;function g(e,n,r){Object.keys(r).forEach(r=>e.assign((0,t._)`${n}${(0,t.getProperty)(r)}`,!0))}e.setEvaluated=g;let _={};function v(e,t){return e.scopeValue(`func`,{ref:t,code:_[t.code]||(_[t.code]=new n._Code(t.code))})}e.useFunc=v;var y;(function(e){e[e.Num=0]=`Num`,e[e.Str=1]=`Str`})(y||(e.Type=y={}));function b(e,n,r){if(e instanceof t.Name){let i=n===y.Num;return r?i?(0,t._)`"[" + ${e} + "]"`:(0,t._)`"['" + ${e} + "']"`:i?(0,t._)`"/" + ${e}`:(0,t._)`"/" + ${e}.replace(/~/g, "~0").replace(/\\//g, "~1")`}return r?(0,t.getProperty)(e).toString():`/`+d(e)}e.getErrorPath=b;function x(e,t,n=e.opts.strictSchema){if(n){if(t=`strict mode: ${t}`,n===!0)throw Error(t);e.self.logger.warn(t)}}e.checkStrictMode=x})),nF=G((e=>{Object.defineProperty(e,"__esModule",{value:!0});let t=eF();e.default={data:new t.Name(`data`),valCxt:new t.Name(`valCxt`),instancePath:new t.Name(`instancePath`),parentData:new t.Name(`parentData`),parentDataProperty:new t.Name(`parentDataProperty`),rootData:new t.Name(`rootData`),dynamicAnchors:new t.Name(`dynamicAnchors`),vErrors:new t.Name(`vErrors`),errors:new t.Name(`errors`),this:new t.Name(`this`),self:new t.Name(`self`),scope:new t.Name(`scope`),json:new t.Name(`json`),jsonPos:new t.Name(`jsonPos`),jsonLen:new t.Name(`jsonLen`),jsonPart:new t.Name(`jsonPart`)}})),rF=G((e=>{Object.defineProperty(e,"__esModule",{value:!0}),e.extendErrors=e.resetErrorsCount=e.reportExtraError=e.reportError=e.keyword$DataError=e.keywordError=void 0;let t=eF(),n=tF(),r=nF();e.keywordError={message:({keyword:e})=>(0,t.str)`must pass "${e}" keyword validation`},e.keyword$DataError={message:({keyword:e,schemaType:n})=>n?(0,t.str)`"${e}" keyword must be ${n} ($data)`:(0,t.str)`"${e}" keyword is invalid ($data)`};function i(n,r=e.keywordError,i,a){let{it:o}=n,{gen:s,compositeRule:u,allErrors:f}=o,p=d(n,r,i);a??(u||f)?c(s,p):l(o,(0,t._)`[${p}]`)}e.reportError=i;function a(t,n=e.keywordError,i){let{it:a}=t,{gen:o,compositeRule:s,allErrors:u}=a;c(o,d(t,n,i)),s||u||l(a,r.default.vErrors)}e.reportExtraError=a;function o(e,n){e.assign(r.default.errors,n),e.if((0,t._)`${r.default.vErrors} !== null`,()=>e.if(n,()=>e.assign((0,t._)`${r.default.vErrors}.length`,n),()=>e.assign(r.default.vErrors,null)))}e.resetErrorsCount=o;function s({gen:e,keyword:n,schemaValue:i,data:a,errsCount:o,it:s}){if(o===void 0)throw Error(`ajv implementation error`);let c=e.name(`err`);e.forRange(`i`,o,r.default.errors,o=>{e.const(c,(0,t._)`${r.default.vErrors}[${o}]`),e.if((0,t._)`${c}.instancePath === undefined`,()=>e.assign((0,t._)`${c}.instancePath`,(0,t.strConcat)(r.default.instancePath,s.errorPath))),e.assign((0,t._)`${c}.schemaPath`,(0,t.str)`${s.errSchemaPath}/${n}`),s.opts.verbose&&(e.assign((0,t._)`${c}.schema`,i),e.assign((0,t._)`${c}.data`,a))})}e.extendErrors=s;function c(e,n){let i=e.const(`err`,n);e.if((0,t._)`${r.default.vErrors} === null`,()=>e.assign(r.default.vErrors,(0,t._)`[${i}]`),(0,t._)`${r.default.vErrors}.push(${i})`),e.code((0,t._)`${r.default.errors}++`)}function l(e,n){let{gen:r,validateName:i,schemaEnv:a}=e;a.$async?r.throw((0,t._)`new ${e.ValidationError}(${n})`):(r.assign((0,t._)`${i}.errors`,n),r.return(!1))}let u={keyword:new t.Name(`keyword`),schemaPath:new t.Name(`schemaPath`),params:new t.Name(`params`),propertyName:new t.Name(`propertyName`),message:new t.Name(`message`),schema:new t.Name(`schema`),parentSchema:new t.Name(`parentSchema`)};function d(e,n,r){let{createErrors:i}=e.it;return i===!1?(0,t._)`{}`:f(e,n,r)}function f(e,t,n={}){let{gen:r,it:i}=e,a=[p(i,n),m(e,n)];return h(e,t,a),r.object(...a)}function p({errorPath:e},{instancePath:i}){let a=i?(0,t.str)`${e}${(0,n.getErrorPath)(i,n.Type.Str)}`:e;return[r.default.instancePath,(0,t.strConcat)(r.default.instancePath,a)]}function m({keyword:e,it:{errSchemaPath:r}},{schemaPath:i,parentSchema:a}){let o=a?r:(0,t.str)`${r}/${e}`;return i&&(o=(0,t.str)`${o}${(0,n.getErrorPath)(i,n.Type.Str)}`),[u.schemaPath,o]}function h(e,{params:n,message:i},a){let{keyword:o,data:s,schemaValue:c,it:l}=e,{opts:d,propertyName:f,topSchemaRef:p,schemaPath:m}=l;a.push([u.keyword,o],[u.params,typeof n==`function`?n(e):n||(0,t._)`{}`]),d.messages&&a.push([u.message,typeof i==`function`?i(e):i]),d.verbose&&a.push([u.schema,c],[u.parentSchema,(0,t._)`${p}${m}`],[r.default.data,s]),f&&a.push([u.propertyName,f])}})),vre=G((e=>{Object.defineProperty(e,"__esModule",{value:!0}),e.boolOrEmptySchema=e.topBoolOrEmptySchema=void 0;let t=rF(),n=eF(),r=nF(),i={message:`boolean schema is false`};function a(e){let{gen:t,schema:i,validateName:a}=e;i===!1?s(e,!1):typeof i==`object`&&i.$async===!0?t.return(r.default.data):(t.assign((0,n._)`${a}.errors`,null),t.return(!0))}e.topBoolOrEmptySchema=a;function o(e,t){let{gen:n,schema:r}=e;r===!1?(n.var(t,!1),s(e)):n.var(t,!0)}e.boolOrEmptySchema=o;function s(e,n){let{gen:r,data:a}=e,o={gen:r,keyword:`false schema`,data:a,schema:!1,schemaCode:!1,schemaValue:!1,params:{},it:e};(0,t.reportError)(o,i,void 0,n)}})),iF=G((e=>{Object.defineProperty(e,"__esModule",{value:!0}),e.getRules=e.isJSONType=void 0;let t=new Set([`string`,`number`,`integer`,`boolean`,`null`,`object`,`array`]);function n(e){return typeof e==`string`&&t.has(e)}e.isJSONType=n;function r(){let e={number:{type:`number`,rules:[]},string:{type:`string`,rules:[]},array:{type:`array`,rules:[]},object:{type:`object`,rules:[]}};return{types:{...e,integer:!0,boolean:!0,null:!0},rules:[{rules:[]},e.number,e.string,e.array,e.object],post:{rules:[]},all:{},keywords:{}}}e.getRules=r})),aF=G((e=>{Object.defineProperty(e,"__esModule",{value:!0}),e.shouldUseRule=e.shouldUseGroup=e.schemaHasRulesForType=void 0;function t({schema:e,self:t},r){let i=t.RULES.types[r];return i&&i!==!0&&n(e,i)}e.schemaHasRulesForType=t;function n(e,t){return t.rules.some(t=>r(e,t))}e.shouldUseGroup=n;function r(e,t){return e[t.keyword]!==void 0||t.definition.implements?.some(t=>e[t]!==void 0)}e.shouldUseRule=r})),oF=G((e=>{Object.defineProperty(e,"__esModule",{value:!0}),e.reportTypeError=e.checkDataTypes=e.checkDataType=e.coerceAndCheckDataType=e.getJSONTypes=e.getSchemaTypes=e.DataType=void 0;let t=iF(),n=aF(),r=rF(),i=eF(),a=tF();var o;(function(e){e[e.Correct=0]=`Correct`,e[e.Wrong=1]=`Wrong`})(o||(e.DataType=o={}));function s(e){let t=c(e.type);if(t.includes(`null`)){if(e.nullable===!1)throw Error(`type: null contradicts nullable: false`)}else{if(!t.length&&e.nullable!==void 0)throw Error(`"nullable" cannot be used without "type"`);e.nullable===!0&&t.push(`null`)}return t}e.getSchemaTypes=s;function c(e){let n=Array.isArray(e)?e:e?[e]:[];if(n.every(t.isJSONType))return n;throw Error(`type must be JSONType or JSONType[]: `+n.join(`,`))}e.getJSONTypes=c;function l(e,t){let{gen:r,data:i,opts:a}=e,s=d(t,a.coerceTypes),c=t.length>0&&!(s.length===0&&t.length===1&&(0,n.schemaHasRulesForType)(e,t[0]));if(c){let n=h(t,i,a.strictNumbers,o.Wrong);r.if(n,()=>{s.length?f(e,t,s):_(e)})}return c}e.coerceAndCheckDataType=l;let u=new Set([`string`,`number`,`integer`,`boolean`,`null`]);function d(e,t){return t?e.filter(e=>u.has(e)||t===`array`&&e===`array`):[]}function f(e,t,n){let{gen:r,data:a,opts:o}=e,s=r.let(`dataType`,(0,i._)`typeof ${a}`),c=r.let(`coerced`,(0,i._)`undefined`);o.coerceTypes===`array`&&r.if((0,i._)`${s} == 'object' && Array.isArray(${a}) && ${a}.length == 1`,()=>r.assign(a,(0,i._)`${a}[0]`).assign(s,(0,i._)`typeof ${a}`).if(h(t,a,o.strictNumbers),()=>r.assign(c,a))),r.if((0,i._)`${c} !== undefined`);for(let e of n)(u.has(e)||e===`array`&&o.coerceTypes===`array`)&&l(e);r.else(),_(e),r.endIf(),r.if((0,i._)`${c} !== undefined`,()=>{r.assign(a,c),p(e,c)});function l(e){switch(e){case`string`:r.elseIf((0,i._)`${s} == "number" || ${s} == "boolean"`).assign(c,(0,i._)`"" + ${a}`).elseIf((0,i._)`${a} === null`).assign(c,(0,i._)`""`);return;case`number`:r.elseIf((0,i._)`${s} == "boolean" || ${a} === null
128
- || (${s} == "string" && ${a} && ${a} == +${a})`).assign(c,(0,i._)`+${a}`);return;case`integer`:r.elseIf((0,i._)`${s} === "boolean" || ${a} === null
129
- || (${s} === "string" && ${a} && ${a} == +${a} && !(${a} % 1))`).assign(c,(0,i._)`+${a}`);return;case`boolean`:r.elseIf((0,i._)`${a} === "false" || ${a} === 0 || ${a} === null`).assign(c,!1).elseIf((0,i._)`${a} === "true" || ${a} === 1`).assign(c,!0);return;case`null`:r.elseIf((0,i._)`${a} === "" || ${a} === 0 || ${a} === false`),r.assign(c,null);return;case`array`:r.elseIf((0,i._)`${s} === "string" || ${s} === "number"
130
- || ${s} === "boolean" || ${a} === null`).assign(c,(0,i._)`[${a}]`)}}}function p({gen:e,parentData:t,parentDataProperty:n},r){e.if((0,i._)`${t} !== undefined`,()=>e.assign((0,i._)`${t}[${n}]`,r))}function m(e,t,n,r=o.Correct){let a=r===o.Correct?i.operators.EQ:i.operators.NEQ,s;switch(e){case`null`:return(0,i._)`${t} ${a} null`;case`array`:s=(0,i._)`Array.isArray(${t})`;break;case`object`:s=(0,i._)`${t} && typeof ${t} == "object" && !Array.isArray(${t})`;break;case`integer`:s=c((0,i._)`!(${t} % 1) && !isNaN(${t})`);break;case`number`:s=c();break;default:return(0,i._)`typeof ${t} ${a} ${e}`}return r===o.Correct?s:(0,i.not)(s);function c(e=i.nil){return(0,i.and)((0,i._)`typeof ${t} == "number"`,e,n?(0,i._)`isFinite(${t})`:i.nil)}}e.checkDataType=m;function h(e,t,n,r){if(e.length===1)return m(e[0],t,n,r);let o,s=(0,a.toHash)(e);if(s.array&&s.object){let e=(0,i._)`typeof ${t} != "object"`;o=s.null?e:(0,i._)`!${t} || ${e}`,delete s.null,delete s.array,delete s.object}else o=i.nil;s.number&&delete s.integer;for(let e in s)o=(0,i.and)(o,m(e,t,n,r));return o}e.checkDataTypes=h;let g={message:({schema:e})=>`must be ${e}`,params:({schema:e,schemaValue:t})=>typeof e==`string`?(0,i._)`{type: ${e}}`:(0,i._)`{type: ${t}}`};function _(e){let t=v(e);(0,r.reportError)(t,g)}e.reportTypeError=_;function v(e){let{gen:t,data:n,schema:r}=e,i=(0,a.schemaRefOrVal)(e,r,`type`);return{gen:t,keyword:`type`,data:n,schema:r.type,schemaCode:i,schemaValue:i,parentSchema:r,params:{},it:e}}})),yre=G((e=>{Object.defineProperty(e,"__esModule",{value:!0}),e.assignDefaults=void 0;let t=eF(),n=tF();function r(e,t){let{properties:n,items:r}=e.schema;if(t===`object`&&n)for(let t in n)i(e,t,n[t].default);else t===`array`&&Array.isArray(r)&&r.forEach((t,n)=>i(e,n,t.default))}e.assignDefaults=r;function i(e,r,i){let{gen:a,compositeRule:o,data:s,opts:c}=e;if(i===void 0)return;let l=(0,t._)`${s}${(0,t.getProperty)(r)}`;if(o){(0,n.checkStrictMode)(e,`default is ignored for: ${l}`);return}let u=(0,t._)`${l} === undefined`;c.useDefaults===`empty`&&(u=(0,t._)`${u} || ${l} === null || ${l} === ""`),a.if(u,(0,t._)`${l} = ${(0,t.stringify)(i)}`)}})),sF=G((e=>{Object.defineProperty(e,"__esModule",{value:!0}),e.validateUnion=e.validateArray=e.usePattern=e.callValidateCode=e.schemaProperties=e.allSchemaProperties=e.noPropertyInData=e.propertyInData=e.isOwnProperty=e.hasPropFunc=e.reportMissingProp=e.checkMissingProp=e.checkReportMissingProp=void 0;let t=eF(),n=tF(),r=nF(),i=tF();function a(e,n){let{gen:r,data:i,it:a}=e;r.if(d(r,i,n,a.opts.ownProperties),()=>{e.setParams({missingProperty:(0,t._)`${n}`},!0),e.error()})}e.checkReportMissingProp=a;function o({gen:e,data:n,it:{opts:r}},i,a){return(0,t.or)(...i.map(i=>(0,t.and)(d(e,n,i,r.ownProperties),(0,t._)`${a} = ${i}`)))}e.checkMissingProp=o;function s(e,t){e.setParams({missingProperty:t},!0),e.error()}e.reportMissingProp=s;function c(e){return e.scopeValue(`func`,{ref:Object.prototype.hasOwnProperty,code:(0,t._)`Object.prototype.hasOwnProperty`})}e.hasPropFunc=c;function l(e,n,r){return(0,t._)`${c(e)}.call(${n}, ${r})`}e.isOwnProperty=l;function u(e,n,r,i){let a=(0,t._)`${n}${(0,t.getProperty)(r)} !== undefined`;return i?(0,t._)`${a} && ${l(e,n,r)}`:a}e.propertyInData=u;function d(e,n,r,i){let a=(0,t._)`${n}${(0,t.getProperty)(r)} === undefined`;return i?(0,t.or)(a,(0,t.not)(l(e,n,r))):a}e.noPropertyInData=d;function f(e){return e?Object.keys(e).filter(e=>e!==`__proto__`):[]}e.allSchemaProperties=f;function p(e,t){return f(t).filter(r=>!(0,n.alwaysValidSchema)(e,t[r]))}e.schemaProperties=p;function m({schemaCode:e,data:n,it:{gen:i,topSchemaRef:a,schemaPath:o,errorPath:s},it:c},l,u,d){let f=d?(0,t._)`${e}, ${n}, ${a}${o}`:n,p=[[r.default.instancePath,(0,t.strConcat)(r.default.instancePath,s)],[r.default.parentData,c.parentData],[r.default.parentDataProperty,c.parentDataProperty],[r.default.rootData,r.default.rootData]];c.opts.dynamicRef&&p.push([r.default.dynamicAnchors,r.default.dynamicAnchors]);let m=(0,t._)`${f}, ${i.object(...p)}`;return u===t.nil?(0,t._)`${l}(${m})`:(0,t._)`${l}.call(${u}, ${m})`}e.callValidateCode=m;let h=(0,t._)`new RegExp`;function g({gen:e,it:{opts:n}},r){let a=n.unicodeRegExp?`u`:``,{regExp:o}=n.code,s=o(r,a);return e.scopeValue(`pattern`,{key:s.toString(),ref:s,code:(0,t._)`${o.code===`new RegExp`?h:(0,i.useFunc)(e,o)}(${r}, ${a})`})}e.usePattern=g;function _(e){let{gen:r,data:i,keyword:a,it:o}=e,s=r.name(`valid`);if(o.allErrors){let e=r.let(`valid`,!0);return c(()=>r.assign(e,!1)),e}return r.var(s,!0),c(()=>r.break()),s;function c(o){let c=r.const(`len`,(0,t._)`${i}.length`);r.forRange(`i`,0,c,i=>{e.subschema({keyword:a,dataProp:i,dataPropType:n.Type.Num},s),r.if((0,t.not)(s),o)})}}e.validateArray=_;function v(e){let{gen:r,schema:i,keyword:a,it:o}=e;if(!Array.isArray(i))throw Error(`ajv implementation error`);if(i.some(e=>(0,n.alwaysValidSchema)(o,e))&&!o.opts.unevaluated)return;let s=r.let(`valid`,!1),c=r.name(`_valid`);r.block(()=>i.forEach((n,i)=>{let o=e.subschema({keyword:a,schemaProp:i,compositeRule:!0},c);r.assign(s,(0,t._)`${s} || ${c}`),e.mergeValidEvaluated(o,c)||r.if((0,t.not)(s))})),e.result(s,()=>e.reset(),()=>e.error(!0))}e.validateUnion=v})),bre=G((e=>{Object.defineProperty(e,"__esModule",{value:!0}),e.validateKeywordUsage=e.validSchemaType=e.funcKeywordCode=e.macroKeywordCode=void 0;let t=eF(),n=nF(),r=sF(),i=rF();function a(e,n){let{gen:r,keyword:i,schema:a,parentSchema:o,it:s}=e,c=n.macro.call(s.self,a,o,s),l=u(r,i,c);s.opts.validateSchema!==!1&&s.self.validateSchema(c,!0);let d=r.name(`valid`);e.subschema({schema:c,schemaPath:t.nil,errSchemaPath:`${s.errSchemaPath}/${i}`,topSchemaRef:l,compositeRule:!0},d),e.pass(d,()=>e.error(!0))}e.macroKeywordCode=a;function o(e,i){let{gen:a,keyword:o,schema:d,parentSchema:f,$data:p,it:m}=e;l(m,i);let h=u(a,o,!p&&i.compile?i.compile.call(m.self,d,f,m):i.validate),g=a.let(`valid`);e.block$data(g,_),e.ok(i.valid??g);function _(){if(i.errors===!1)b(),i.modifying&&s(e),x(()=>e.error());else{let t=i.async?v():y();i.modifying&&s(e),x(()=>c(e,t))}}function v(){let e=a.let(`ruleErrs`,null);return a.try(()=>b((0,t._)`await `),n=>a.assign(g,!1).if((0,t._)`${n} instanceof ${m.ValidationError}`,()=>a.assign(e,(0,t._)`${n}.errors`),()=>a.throw(n))),e}function y(){let e=(0,t._)`${h}.errors`;return a.assign(e,null),b(t.nil),e}function b(o=i.async?(0,t._)`await `:t.nil){let s=m.opts.passContext?n.default.this:n.default.self,c=!(`compile`in i&&!p||i.schema===!1);a.assign(g,(0,t._)`${o}${(0,r.callValidateCode)(e,h,s,c)}`,i.modifying)}function x(e){a.if((0,t.not)(i.valid??g),e)}}e.funcKeywordCode=o;function s(e){let{gen:n,data:r,it:i}=e;n.if(i.parentData,()=>n.assign(r,(0,t._)`${i.parentData}[${i.parentDataProperty}]`))}function c(e,r){let{gen:a}=e;a.if((0,t._)`Array.isArray(${r})`,()=>{a.assign(n.default.vErrors,(0,t._)`${n.default.vErrors} === null ? ${r} : ${n.default.vErrors}.concat(${r})`).assign(n.default.errors,(0,t._)`${n.default.vErrors}.length`),(0,i.extendErrors)(e)},()=>e.error())}function l({schemaEnv:e},t){if(t.async&&!e.$async)throw Error(`async keyword in sync schema`)}function u(e,n,r){if(r===void 0)throw Error(`keyword "${n}" failed to compile`);return e.scopeValue(`keyword`,typeof r==`function`?{ref:r}:{ref:r,code:(0,t.stringify)(r)})}function d(e,t,n=!1){return!t.length||t.some(t=>t===`array`?Array.isArray(e):t===`object`?e&&typeof e==`object`&&!Array.isArray(e):typeof e==t||n&&e===void 0)}e.validSchemaType=d;function f({schema:e,opts:t,self:n,errSchemaPath:r},i,a){if(Array.isArray(i.keyword)?!i.keyword.includes(a):i.keyword!==a)throw Error(`ajv implementation error`);let o=i.dependencies;if(o?.some(t=>!Object.prototype.hasOwnProperty.call(e,t)))throw Error(`parent schema must have dependencies of ${a}: ${o.join(`,`)}`);if(i.validateSchema&&!i.validateSchema(e[a])){let e=`keyword "${a}" value is invalid at path "${r}": `+n.errorsText(i.validateSchema.errors);if(t.validateSchema===`log`)n.logger.error(e);else throw Error(e)}}e.validateKeywordUsage=f})),xre=G((e=>{Object.defineProperty(e,"__esModule",{value:!0}),e.extendSubschemaMode=e.extendSubschemaData=e.getSubschema=void 0;let t=eF(),n=tF();function r(e,{keyword:r,schemaProp:i,schema:a,schemaPath:o,errSchemaPath:s,topSchemaRef:c}){if(r!==void 0&&a!==void 0)throw Error(`both "keyword" and "schema" passed, only one allowed`);if(r!==void 0){let a=e.schema[r];return i===void 0?{schema:a,schemaPath:(0,t._)`${e.schemaPath}${(0,t.getProperty)(r)}`,errSchemaPath:`${e.errSchemaPath}/${r}`}:{schema:a[i],schemaPath:(0,t._)`${e.schemaPath}${(0,t.getProperty)(r)}${(0,t.getProperty)(i)}`,errSchemaPath:`${e.errSchemaPath}/${r}/${(0,n.escapeFragment)(i)}`}}if(a!==void 0){if(o===void 0||s===void 0||c===void 0)throw Error(`"schemaPath", "errSchemaPath" and "topSchemaRef" are required with "schema"`);return{schema:a,schemaPath:o,topSchemaRef:c,errSchemaPath:s}}throw Error(`either "keyword" or "schema" must be passed`)}e.getSubschema=r;function i(e,r,{dataProp:i,dataPropType:a,data:o,dataTypes:s,propertyName:c}){if(o!==void 0&&i!==void 0)throw Error(`both "data" and "dataProp" passed, only one allowed`);let{gen:l}=r;if(i!==void 0){let{errorPath:o,dataPathArr:s,opts:c}=r;u(l.let(`data`,(0,t._)`${r.data}${(0,t.getProperty)(i)}`,!0)),e.errorPath=(0,t.str)`${o}${(0,n.getErrorPath)(i,a,c.jsPropertySyntax)}`,e.parentDataProperty=(0,t._)`${i}`,e.dataPathArr=[...s,e.parentDataProperty]}o!==void 0&&(u(o instanceof t.Name?o:l.let(`data`,o,!0)),c!==void 0&&(e.propertyName=c)),s&&(e.dataTypes=s);function u(t){e.data=t,e.dataLevel=r.dataLevel+1,e.dataTypes=[],r.definedProperties=new Set,e.parentData=r.data,e.dataNames=[...r.dataNames,t]}}e.extendSubschemaData=i;function a(e,{jtdDiscriminator:t,jtdMetadata:n,compositeRule:r,createErrors:i,allErrors:a}){r!==void 0&&(e.compositeRule=r),i!==void 0&&(e.createErrors=i),a!==void 0&&(e.allErrors=a),e.jtdDiscriminator=t,e.jtdMetadata=n}e.extendSubschemaMode=a})),cF=G(((e,t)=>{t.exports=function e(t,n){if(t===n)return!0;if(t&&n&&typeof t==`object`&&typeof n==`object`){if(t.constructor!==n.constructor)return!1;var r,i,a;if(Array.isArray(t)){if(r=t.length,r!=n.length)return!1;for(i=r;i--!==0;)if(!e(t[i],n[i]))return!1;return!0}if(t.constructor===RegExp)return t.source===n.source&&t.flags===n.flags;if(t.valueOf!==Object.prototype.valueOf)return t.valueOf()===n.valueOf();if(t.toString!==Object.prototype.toString)return t.toString()===n.toString();if(a=Object.keys(t),r=a.length,r!==Object.keys(n).length)return!1;for(i=r;i--!==0;)if(!Object.prototype.hasOwnProperty.call(n,a[i]))return!1;for(i=r;i--!==0;){var o=a[i];if(!e(t[o],n[o]))return!1}return!0}return t!==t&&n!==n}})),Sre=G(((e,t)=>{var n=t.exports=function(e,t,n){typeof t==`function`&&(n=t,t={}),n=t.cb||n;var i=typeof n==`function`?n:n.pre||function(){},a=n.post||function(){};r(t,i,a,e,``,e)};n.keywords={additionalItems:!0,items:!0,contains:!0,additionalProperties:!0,propertyNames:!0,not:!0,if:!0,then:!0,else:!0},n.arrayKeywords={items:!0,allOf:!0,anyOf:!0,oneOf:!0},n.propsKeywords={$defs:!0,definitions:!0,properties:!0,patternProperties:!0,dependencies:!0},n.skipKeywords={default:!0,enum:!0,const:!0,required:!0,maximum:!0,minimum:!0,exclusiveMaximum:!0,exclusiveMinimum:!0,multipleOf:!0,maxLength:!0,minLength:!0,pattern:!0,format:!0,maxItems:!0,minItems:!0,uniqueItems:!0,maxProperties:!0,minProperties:!0};function r(e,t,a,o,s,c,l,u,d,f){if(o&&typeof o==`object`&&!Array.isArray(o)){for(var p in t(o,s,c,l,u,d,f),o){var m=o[p];if(Array.isArray(m)){if(p in n.arrayKeywords)for(var h=0;h<m.length;h++)r(e,t,a,m[h],s+`/`+p+`/`+h,c,s,p,o,h)}else if(p in n.propsKeywords){if(m&&typeof m==`object`)for(var g in m)r(e,t,a,m[g],s+`/`+p+`/`+i(g),c,s,p,o,g)}else(p in n.keywords||e.allKeys&&!(p in n.skipKeywords))&&r(e,t,a,m,s+`/`+p,c,s,p,o)}a(o,s,c,l,u,d,f)}}function i(e){return e.replace(/~/g,`~0`).replace(/\//g,`~1`)}})),lF=G((e=>{Object.defineProperty(e,"__esModule",{value:!0}),e.getSchemaRefs=e.resolveUrl=e.normalizeId=e._getFullPath=e.getFullPath=e.inlineRef=void 0;let t=tF(),n=cF(),r=Sre(),i=new Set([`type`,`format`,`pattern`,`maxLength`,`minLength`,`maxProperties`,`minProperties`,`maxItems`,`minItems`,`maximum`,`minimum`,`uniqueItems`,`multipleOf`,`required`,`enum`,`const`]);function a(e,t=!0){return typeof e==`boolean`?!0:t===!0?!s(e):t?c(e)<=t:!1}e.inlineRef=a;let o=new Set([`$ref`,`$recursiveRef`,`$recursiveAnchor`,`$dynamicRef`,`$dynamicAnchor`]);function s(e){for(let t in e){if(o.has(t))return!0;let n=e[t];if(Array.isArray(n)&&n.some(s)||typeof n==`object`&&s(n))return!0}return!1}function c(e){let n=0;for(let r in e)if(r===`$ref`||(n++,!i.has(r)&&(typeof e[r]==`object`&&(0,t.eachItem)(e[r],e=>n+=c(e)),n===1/0)))return 1/0;return n}function l(e,t=``,n){return n!==!1&&(t=f(t)),u(e,e.parse(t))}e.getFullPath=l;function u(e,t){return e.serialize(t).split(`#`)[0]+`#`}e._getFullPath=u;let d=/#\/?$/;function f(e){return e?e.replace(d,``):``}e.normalizeId=f;function p(e,t,n){return n=f(n),e.resolve(t,n)}e.resolveUrl=p;let m=/^[a-z_][-a-z0-9._]*$/i;function h(e,t){if(typeof e==`boolean`)return{};let{schemaId:i,uriResolver:a}=this.opts,o=f(e[i]||t),s={"":o},c=l(a,o,!1),u={},d=new Set;return r(e,{allKeys:!0},(e,t,n,r)=>{if(r===void 0)return;let a=c+t,o=s[r];typeof e[i]==`string`&&(o=l.call(this,e[i])),g.call(this,e.$anchor),g.call(this,e.$dynamicAnchor),s[t]=o;function l(t){let n=this.opts.uriResolver.resolve;if(t=f(o?n(o,t):t),d.has(t))throw h(t);d.add(t);let r=this.refs[t];return typeof r==`string`&&(r=this.refs[r]),typeof r==`object`?p(e,r.schema,t):t!==f(a)&&(t[0]===`#`?(p(e,u[t],t),u[t]=e):this.refs[t]=a),t}function g(e){if(typeof e==`string`){if(!m.test(e))throw Error(`invalid anchor "${e}"`);l.call(this,`#${e}`)}}}),u;function p(e,t,r){if(t!==void 0&&!n(e,t))throw h(r)}function h(e){return Error(`reference "${e}" resolves to more than one schema`)}}e.getSchemaRefs=h})),uF=G((e=>{Object.defineProperty(e,"__esModule",{value:!0}),e.getData=e.KeywordCxt=e.validateFunctionCode=void 0;let t=vre(),n=oF(),r=aF(),i=oF(),a=yre(),o=bre(),s=xre(),c=eF(),l=nF(),u=lF(),d=tF(),f=rF();function p(e){if(S(e)&&(w(e),x(e))){_(e);return}m(e,()=>(0,t.topBoolOrEmptySchema)(e))}e.validateFunctionCode=p;function m({gen:e,validateName:t,schema:n,schemaEnv:r,opts:i},a){i.code.es5?e.func(t,(0,c._)`${l.default.data}, ${l.default.valCxt}`,r.$async,()=>{e.code((0,c._)`"use strict"; ${y(n,i)}`),g(e,i),e.code(a)}):e.func(t,(0,c._)`${l.default.data}, ${h(i)}`,r.$async,()=>e.code(y(n,i)).code(a))}function h(e){return(0,c._)`{${l.default.instancePath}="", ${l.default.parentData}, ${l.default.parentDataProperty}, ${l.default.rootData}=${l.default.data}${e.dynamicRef?(0,c._)`, ${l.default.dynamicAnchors}={}`:c.nil}}={}`}function g(e,t){e.if(l.default.valCxt,()=>{e.var(l.default.instancePath,(0,c._)`${l.default.valCxt}.${l.default.instancePath}`),e.var(l.default.parentData,(0,c._)`${l.default.valCxt}.${l.default.parentData}`),e.var(l.default.parentDataProperty,(0,c._)`${l.default.valCxt}.${l.default.parentDataProperty}`),e.var(l.default.rootData,(0,c._)`${l.default.valCxt}.${l.default.rootData}`),t.dynamicRef&&e.var(l.default.dynamicAnchors,(0,c._)`${l.default.valCxt}.${l.default.dynamicAnchors}`)},()=>{e.var(l.default.instancePath,(0,c._)`""`),e.var(l.default.parentData,(0,c._)`undefined`),e.var(l.default.parentDataProperty,(0,c._)`undefined`),e.var(l.default.rootData,l.default.data),t.dynamicRef&&e.var(l.default.dynamicAnchors,(0,c._)`{}`)})}function _(e){let{schema:t,opts:n,gen:r}=e;m(e,()=>{n.$comment&&t.$comment&&A(e),D(e),r.let(l.default.vErrors,null),r.let(l.default.errors,0),n.unevaluated&&v(e),T(e),j(e)})}function v(e){let{gen:t,validateName:n}=e;e.evaluated=t.const(`evaluated`,(0,c._)`${n}.evaluated`),t.if((0,c._)`${e.evaluated}.dynamicProps`,()=>t.assign((0,c._)`${e.evaluated}.props`,(0,c._)`undefined`)),t.if((0,c._)`${e.evaluated}.dynamicItems`,()=>t.assign((0,c._)`${e.evaluated}.items`,(0,c._)`undefined`))}function y(e,t){let n=typeof e==`object`&&e[t.schemaId];return n&&(t.code.source||t.code.process)?(0,c._)`/*# sourceURL=${n} */`:c.nil}function b(e,n){if(S(e)&&(w(e),x(e))){C(e,n);return}(0,t.boolOrEmptySchema)(e,n)}function x({schema:e,self:t}){if(typeof e==`boolean`)return!e;for(let n in e)if(t.RULES.all[n])return!0;return!1}function S(e){return typeof e.schema!=`boolean`}function C(e,t){let{schema:n,gen:r,opts:i}=e;i.$comment&&n.$comment&&A(e),O(e),k(e);let a=r.const(`_errs`,l.default.errors);T(e,a),r.var(t,(0,c._)`${a} === ${l.default.errors}`)}function w(e){(0,d.checkUnknownRules)(e),E(e)}function T(e,t){if(e.opts.jtd)return N(e,[],!1,t);let r=(0,n.getSchemaTypes)(e.schema);N(e,r,!(0,n.coerceAndCheckDataType)(e,r),t)}function E(e){let{schema:t,errSchemaPath:n,opts:r,self:i}=e;t.$ref&&r.ignoreKeywordsWithRef&&(0,d.schemaHasRulesButRef)(t,i.RULES)&&i.logger.warn(`$ref: keywords ignored in schema at path "${n}"`)}function D(e){let{schema:t,opts:n}=e;t.default!==void 0&&n.useDefaults&&n.strictSchema&&(0,d.checkStrictMode)(e,`default is ignored in the schema root`)}function O(e){let t=e.schema[e.opts.schemaId];t&&(e.baseId=(0,u.resolveUrl)(e.opts.uriResolver,e.baseId,t))}function k(e){if(e.schema.$async&&!e.schemaEnv.$async)throw Error(`async schema in sync schema`)}function A({gen:e,schemaEnv:t,schema:n,errSchemaPath:r,opts:i}){let a=n.$comment;if(i.$comment===!0)e.code((0,c._)`${l.default.self}.logger.log(${a})`);else if(typeof i.$comment==`function`){let n=(0,c.str)`${r}/$comment`,i=e.scopeValue(`root`,{ref:t.root});e.code((0,c._)`${l.default.self}.opts.$comment(${a}, ${n}, ${i}.schema)`)}}function j(e){let{gen:t,schemaEnv:n,validateName:r,ValidationError:i,opts:a}=e;n.$async?t.if((0,c._)`${l.default.errors} === 0`,()=>t.return(l.default.data),()=>t.throw((0,c._)`new ${i}(${l.default.vErrors})`)):(t.assign((0,c._)`${r}.errors`,l.default.vErrors),a.unevaluated&&M(e),t.return((0,c._)`${l.default.errors} === 0`))}function M({gen:e,evaluated:t,props:n,items:r}){n instanceof c.Name&&e.assign((0,c._)`${t}.props`,n),r instanceof c.Name&&e.assign((0,c._)`${t}.items`,r)}function N(e,t,n,a){let{gen:o,schema:s,data:u,allErrors:f,opts:p,self:m}=e,{RULES:h}=m;if(s.$ref&&(p.ignoreKeywordsWithRef||!(0,d.schemaHasRulesButRef)(s,h))){o.block(()=>se(e,`$ref`,h.all.$ref.definition));return}p.jtd||te(e,t),o.block(()=>{for(let e of h.rules)g(e);g(h.post)});function g(d){(0,r.shouldUseGroup)(s,d)&&(d.type?(o.if((0,i.checkDataType)(d.type,u,p.strictNumbers)),ee(e,d),t.length===1&&t[0]===d.type&&n&&(o.else(),(0,i.reportTypeError)(e)),o.endIf()):ee(e,d),f||o.if((0,c._)`${l.default.errors} === ${a||0}`))}}function ee(e,t){let{gen:n,schema:i,opts:{useDefaults:o}}=e;o&&(0,a.assignDefaults)(e,t.type),n.block(()=>{for(let n of t.rules)(0,r.shouldUseRule)(i,n)&&se(e,n.keyword,n.definition,t.type)})}function te(e,t){e.schemaEnv.meta||!e.opts.strictTypes||(P(e,t),e.opts.allowUnionTypes||F(e,t),I(e,e.dataTypes))}function P(e,t){if(t.length){if(!e.dataTypes.length){e.dataTypes=t;return}t.forEach(t=>{re(e.dataTypes,t)||ae(e,`type "${t}" not allowed by context "${e.dataTypes.join(`,`)}"`)}),ie(e,t)}}function F(e,t){t.length>1&&!(t.length===2&&t.includes(`null`))&&ae(e,`use allowUnionTypes to allow union type keyword`)}function I(e,t){let n=e.self.RULES.all;for(let i in n){let a=n[i];if(typeof a==`object`&&(0,r.shouldUseRule)(e.schema,a)){let{type:n}=a.definition;n.length&&!n.some(e=>ne(t,e))&&ae(e,`missing type "${n.join(`,`)}" for keyword "${i}"`)}}}function ne(e,t){return e.includes(t)||t===`number`&&e.includes(`integer`)}function re(e,t){return e.includes(t)||t===`integer`&&e.includes(`number`)}function ie(e,t){let n=[];for(let r of e.dataTypes)re(t,r)?n.push(r):t.includes(`integer`)&&r===`number`&&n.push(`integer`);e.dataTypes=n}function ae(e,t){let n=e.schemaEnv.baseId+e.errSchemaPath;t+=` at "${n}" (strictTypes)`,(0,d.checkStrictMode)(e,t,e.opts.strictTypes)}var oe=class{constructor(e,t,n){if((0,o.validateKeywordUsage)(e,t,n),this.gen=e.gen,this.allErrors=e.allErrors,this.keyword=n,this.data=e.data,this.schema=e.schema[n],this.$data=t.$data&&e.opts.$data&&this.schema&&this.schema.$data,this.schemaValue=(0,d.schemaRefOrVal)(e,this.schema,n,this.$data),this.schemaType=t.schemaType,this.parentSchema=e.schema,this.params={},this.it=e,this.def=t,this.$data)this.schemaCode=e.gen.const(`vSchema`,ue(this.$data,e));else if(this.schemaCode=this.schemaValue,!(0,o.validSchemaType)(this.schema,t.schemaType,t.allowUndefined))throw Error(`${n} value must be ${JSON.stringify(t.schemaType)}`);(`code`in t?t.trackErrors:t.errors!==!1)&&(this.errsCount=e.gen.const(`_errs`,l.default.errors))}result(e,t,n){this.failResult((0,c.not)(e),t,n)}failResult(e,t,n){this.gen.if(e),n?n():this.error(),t?(this.gen.else(),t(),this.allErrors&&this.gen.endIf()):this.allErrors?this.gen.endIf():this.gen.else()}pass(e,t){this.failResult((0,c.not)(e),void 0,t)}fail(e){if(e===void 0){this.error(),this.allErrors||this.gen.if(!1);return}this.gen.if(e),this.error(),this.allErrors?this.gen.endIf():this.gen.else()}fail$data(e){if(!this.$data)return this.fail(e);let{schemaCode:t}=this;this.fail((0,c._)`${t} !== undefined && (${(0,c.or)(this.invalid$data(),e)})`)}error(e,t,n){if(t){this.setParams(t),this._error(e,n),this.setParams({});return}this._error(e,n)}_error(e,t){(e?f.reportExtraError:f.reportError)(this,this.def.error,t)}$dataError(){(0,f.reportError)(this,this.def.$dataError||f.keyword$DataError)}reset(){if(this.errsCount===void 0)throw Error(`add "trackErrors" to keyword definition`);(0,f.resetErrorsCount)(this.gen,this.errsCount)}ok(e){this.allErrors||this.gen.if(e)}setParams(e,t){t?Object.assign(this.params,e):this.params=e}block$data(e,t,n=c.nil){this.gen.block(()=>{this.check$data(e,n),t()})}check$data(e=c.nil,t=c.nil){if(!this.$data)return;let{gen:n,schemaCode:r,schemaType:i,def:a}=this;n.if((0,c.or)((0,c._)`${r} === undefined`,t)),e!==c.nil&&n.assign(e,!0),(i.length||a.validateSchema)&&(n.elseIf(this.invalid$data()),this.$dataError(),e!==c.nil&&n.assign(e,!1)),n.else()}invalid$data(){let{gen:e,schemaCode:t,schemaType:n,def:r,it:a}=this;return(0,c.or)(o(),s());function o(){if(n.length){if(!(t instanceof c.Name))throw Error(`ajv implementation error`);let e=Array.isArray(n)?n:[n];return(0,c._)`${(0,i.checkDataTypes)(e,t,a.opts.strictNumbers,i.DataType.Wrong)}`}return c.nil}function s(){if(r.validateSchema){let n=e.scopeValue(`validate$data`,{ref:r.validateSchema});return(0,c._)`!${n}(${t})`}return c.nil}}subschema(e,t){let n=(0,s.getSubschema)(this.it,e);(0,s.extendSubschemaData)(n,this.it,e),(0,s.extendSubschemaMode)(n,e);let r={...this.it,...n,items:void 0,props:void 0};return b(r,t),r}mergeEvaluated(e,t){let{it:n,gen:r}=this;n.opts.unevaluated&&(n.props!==!0&&e.props!==void 0&&(n.props=d.mergeEvaluated.props(r,e.props,n.props,t)),n.items!==!0&&e.items!==void 0&&(n.items=d.mergeEvaluated.items(r,e.items,n.items,t)))}mergeValidEvaluated(e,t){let{it:n,gen:r}=this;if(n.opts.unevaluated&&(n.props!==!0||n.items!==!0))return r.if(t,()=>this.mergeEvaluated(e,c.Name)),!0}};e.KeywordCxt=oe;function se(e,t,n,r){let i=new oe(e,n,t);`code`in n?n.code(i,r):i.$data&&n.validate?(0,o.funcKeywordCode)(i,n):`macro`in n?(0,o.macroKeywordCode)(i,n):(n.compile||n.validate)&&(0,o.funcKeywordCode)(i,n)}let ce=/^\/(?:[^~]|~0|~1)*$/,le=/^([0-9]+)(#|\/(?:[^~]|~0|~1)*)?$/;function ue(e,{dataLevel:t,dataNames:n,dataPathArr:r}){let i,a;if(e===``)return l.default.rootData;if(e[0]===`/`){if(!ce.test(e))throw Error(`Invalid JSON-pointer: ${e}`);i=e,a=l.default.rootData}else{let o=le.exec(e);if(!o)throw Error(`Invalid JSON-pointer: ${e}`);let s=+o[1];if(i=o[2],i===`#`){if(s>=t)throw Error(u(`property/index`,s));return r[t-s]}if(s>t)throw Error(u(`data`,s));if(a=n[t-s],!i)return a}let o=a,s=i.split(`/`);for(let e of s)e&&(a=(0,c._)`${a}${(0,c.getProperty)((0,d.unescapeJsonPointer)(e))}`,o=(0,c._)`${o} && ${a}`);return o;function u(e,n){return`Cannot access ${e} ${n} levels up, current level is ${t}`}}e.getData=ue})),dF=G((e=>{Object.defineProperty(e,"__esModule",{value:!0}),e.default=class extends Error{constructor(e){super(`validation failed`),this.errors=e,this.ajv=this.validation=!0}}})),fF=G((e=>{Object.defineProperty(e,"__esModule",{value:!0});let t=lF();e.default=class extends Error{constructor(e,n,r,i){super(i||`can't resolve reference ${r} from id ${n}`),this.missingRef=(0,t.resolveUrl)(e,n,r),this.missingSchema=(0,t.normalizeId)((0,t.getFullPath)(e,this.missingRef))}}})),pF=G((e=>{Object.defineProperty(e,"__esModule",{value:!0}),e.resolveSchema=e.getCompilingSchema=e.resolveRef=e.compileSchema=e.SchemaEnv=void 0;let t=eF(),n=dF(),r=nF(),i=lF(),a=tF(),o=uF();var s=class{constructor(e){this.refs={},this.dynamicAnchors={};let t;typeof e.schema==`object`&&(t=e.schema),this.schema=e.schema,this.schemaId=e.schemaId,this.root=e.root||this,this.baseId=e.baseId??(0,i.normalizeId)(t?.[e.schemaId||`$id`]),this.schemaPath=e.schemaPath,this.localRefs=e.localRefs,this.meta=e.meta,this.$async=t?.$async,this.refs={}}};e.SchemaEnv=s;function c(e){let a=d.call(this,e);if(a)return a;let s=(0,i.getFullPath)(this.opts.uriResolver,e.root.baseId),{es5:c,lines:l}=this.opts.code,{ownProperties:u}=this.opts,f=new t.CodeGen(this.scope,{es5:c,lines:l,ownProperties:u}),p;e.$async&&(p=f.scopeValue(`Error`,{ref:n.default,code:(0,t._)`require("ajv/dist/runtime/validation_error").default`}));let m=f.scopeName(`validate`);e.validateName=m;let h={gen:f,allErrors:this.opts.allErrors,data:r.default.data,parentData:r.default.parentData,parentDataProperty:r.default.parentDataProperty,dataNames:[r.default.data],dataPathArr:[t.nil],dataLevel:0,dataTypes:[],definedProperties:new Set,topSchemaRef:f.scopeValue(`schema`,this.opts.code.source===!0?{ref:e.schema,code:(0,t.stringify)(e.schema)}:{ref:e.schema}),validateName:m,ValidationError:p,schema:e.schema,schemaEnv:e,rootId:s,baseId:e.baseId||s,schemaPath:t.nil,errSchemaPath:e.schemaPath||(this.opts.jtd?``:`#`),errorPath:(0,t._)`""`,opts:this.opts,self:this},g;try{this._compilations.add(e),(0,o.validateFunctionCode)(h),f.optimize(this.opts.code.optimize);let n=f.toString();g=`${f.scopeRefs(r.default.scope)}return ${n}`,this.opts.code.process&&(g=this.opts.code.process(g,e));let i=Function(`${r.default.self}`,`${r.default.scope}`,g)(this,this.scope.get());if(this.scope.value(m,{ref:i}),i.errors=null,i.schema=e.schema,i.schemaEnv=e,e.$async&&(i.$async=!0),this.opts.code.source===!0&&(i.source={validateName:m,validateCode:n,scopeValues:f._values}),this.opts.unevaluated){let{props:e,items:n}=h;i.evaluated={props:e instanceof t.Name?void 0:e,items:n instanceof t.Name?void 0:n,dynamicProps:e instanceof t.Name,dynamicItems:n instanceof t.Name},i.source&&(i.source.evaluated=(0,t.stringify)(i.evaluated))}return e.validate=i,e}catch(t){throw delete e.validate,delete e.validateName,g&&this.logger.error(`Error compiling schema, function code:`,g),t}finally{this._compilations.delete(e)}}e.compileSchema=c;function l(e,t,n){n=(0,i.resolveUrl)(this.opts.uriResolver,t,n);let r=e.refs[n];if(r)return r;let a=p.call(this,e,n);if(a===void 0){let r=e.localRefs?.[n],{schemaId:i}=this.opts;r&&(a=new s({schema:r,schemaId:i,root:e,baseId:t}))}if(a!==void 0)return e.refs[n]=u.call(this,a)}e.resolveRef=l;function u(e){return(0,i.inlineRef)(e.schema,this.opts.inlineRefs)?e.schema:e.validate?e:c.call(this,e)}function d(e){for(let t of this._compilations)if(f(t,e))return t}e.getCompilingSchema=d;function f(e,t){return e.schema===t.schema&&e.root===t.root&&e.baseId===t.baseId}function p(e,t){let n;for(;typeof(n=this.refs[t])==`string`;)t=n;return n||this.schemas[t]||m.call(this,e,t)}function m(e,t){let n=this.opts.uriResolver.parse(t),r=(0,i._getFullPath)(this.opts.uriResolver,n),a=(0,i.getFullPath)(this.opts.uriResolver,e.baseId,void 0);if(Object.keys(e.schema).length>0&&r===a)return g.call(this,n,e);let o=(0,i.normalizeId)(r),l=this.refs[o]||this.schemas[o];if(typeof l==`string`){let t=m.call(this,e,l);return typeof t?.schema==`object`?g.call(this,n,t):void 0}if(typeof l?.schema==`object`){if(l.validate||c.call(this,l),o===(0,i.normalizeId)(t)){let{schema:t}=l,{schemaId:n}=this.opts,r=t[n];return r&&(a=(0,i.resolveUrl)(this.opts.uriResolver,a,r)),new s({schema:t,schemaId:n,root:e,baseId:a})}return g.call(this,n,l)}}e.resolveSchema=m;let h=new Set([`properties`,`patternProperties`,`enum`,`dependencies`,`definitions`]);function g(e,{baseId:t,schema:n,root:r}){if(e.fragment?.[0]!==`/`)return;for(let r of e.fragment.slice(1).split(`/`)){if(typeof n==`boolean`)return;let e=n[(0,a.unescapeFragment)(r)];if(e===void 0)return;n=e;let o=typeof n==`object`&&n[this.opts.schemaId];!h.has(r)&&o&&(t=(0,i.resolveUrl)(this.opts.uriResolver,t,o))}let o;if(typeof n!=`boolean`&&n.$ref&&!(0,a.schemaHasRulesButRef)(n,this.RULES)){let e=(0,i.resolveUrl)(this.opts.uriResolver,t,n.$ref);o=m.call(this,r,e)}let{schemaId:c}=this.opts;if(o||=new s({schema:n,schemaId:c,root:r,baseId:t}),o.schema!==o.root.schema)return o}})),Cre=G(((e,t)=>{t.exports={$id:`https://raw.githubusercontent.com/ajv-validator/ajv/master/lib/refs/data.json#`,description:`Meta-schema for $data reference (JSON AnySchema extension proposal)`,type:`object`,required:[`$data`],properties:{$data:{type:`string`,anyOf:[{format:`relative-json-pointer`},{format:`json-pointer`}]}},additionalProperties:!1}})),mF=G(((e,t)=>{let n=RegExp.prototype.test.bind(/^[\da-f]{8}-[\da-f]{4}-[\da-f]{4}-[\da-f]{4}-[\da-f]{12}$/iu),r=RegExp.prototype.test.bind(/^(?:(?:25[0-5]|2[0-4]\d|1\d{2}|[1-9]\d|\d)\.){3}(?:25[0-5]|2[0-4]\d|1\d{2}|[1-9]\d|\d)$/u);function i(e){let t=``,n=0,r=0;for(r=0;r<e.length;r++)if(n=e[r].charCodeAt(0),n!==48){if(!(n>=48&&n<=57||n>=65&&n<=70||n>=97&&n<=102))return``;t+=e[r];break}for(r+=1;r<e.length;r++){if(n=e[r].charCodeAt(0),!(n>=48&&n<=57||n>=65&&n<=70||n>=97&&n<=102))return``;t+=e[r]}return t}let a=RegExp.prototype.test.bind(/[^!"$&'()*+,\-.;=_`a-z{}~]/u);function o(e){return e.length=0,!0}function s(e,t,n){if(e.length){let r=i(e);if(r!==``)t.push(r);else return n.error=!0,!1;e.length=0}return!0}function c(e){let t=0,n={error:!1,address:``,zone:``},r=[],a=[],c=!1,l=!1,u=s;for(let i=0;i<e.length;i++){let s=e[i];if(s!==`[`&&s!==`]`){if(s===`:`){if(c===!0&&(l=!0),!u(a,r,n))break;if(++t>7){n.error=!0;break}i>0&&e[i-1]===`:`&&(c=!0),r.push(`:`);continue}if(s===`%`){if(!u(a,r,n))break;u=o}else{a.push(s);continue}}}return a.length&&(u===o?n.zone=a.join(``):l?r.push(a.join(``)):r.push(i(a))),n.address=r.join(``),n}function l(e){if(u(e,`:`)<2)return{host:e,isIPV6:!1};let t=c(e);if(t.error)return{host:e,isIPV6:!1};{let e=t.address,n=t.address;return t.zone&&(e+=`%`+t.zone,n+=`%25`+t.zone),{host:e,isIPV6:!0,escapedHost:n}}}function u(e,t){let n=0;for(let r=0;r<e.length;r++)e[r]===t&&n++;return n}function d(e){let t=e,n=[],r=-1,i=0;for(;i=t.length;){if(i===1){if(t===`.`)break;if(t===`/`){n.push(`/`);break}n.push(t);break}if(i===2){if(t[0]===`.`){if(t[1]===`.`)break;if(t[1]===`/`){t=t.slice(2);continue}}else if(t[0]===`/`&&(t[1]===`.`||t[1]===`/`)){n.push(`/`);break}}else if(i===3&&t===`/..`){n.length!==0&&n.pop(),n.push(`/`);break}if(t[0]===`.`){if(t[1]===`.`){if(t[2]===`/`){t=t.slice(3);continue}}else if(t[1]===`/`){t=t.slice(2);continue}}else if(t[0]===`/`&&t[1]===`.`){if(t[2]===`/`){t=t.slice(2);continue}if(t[2]===`.`&&t[3]===`/`){t=t.slice(3),n.length!==0&&n.pop();continue}}if((r=t.indexOf(`/`,1))===-1){n.push(t);break}n.push(t.slice(0,r)),t=t.slice(r)}return n.join(``)}function f(e,t){let n=t===!0?unescape:escape;return e.scheme!==void 0&&(e.scheme=n(e.scheme)),e.userinfo!==void 0&&(e.userinfo=n(e.userinfo)),e.host!==void 0&&(e.host=n(e.host)),e.path!==void 0&&(e.path=n(e.path)),e.query!==void 0&&(e.query=n(e.query)),e.fragment!==void 0&&(e.fragment=n(e.fragment)),e}function p(e){let t=[];if(e.userinfo!==void 0&&(t.push(e.userinfo),t.push(`@`)),e.host!==void 0){let n=unescape(e.host);if(!r(n)){let t=l(n);n=t.isIPV6===!0?`[${t.escapedHost}]`:e.host}t.push(n)}return(typeof e.port==`number`||typeof e.port==`string`)&&(t.push(`:`),t.push(String(e.port))),t.length?t.join(``):void 0}t.exports={nonSimpleDomain:a,recomposeAuthority:p,normalizeComponentEncoding:f,removeDotSegments:d,isIPv4:r,isUUID:n,normalizeIPv6:l,stringArrayToHexStripped:i}})),wre=G(((e,t)=>{let{isUUID:n}=mF(),r=/([\da-z][\d\-a-z]{0,31}):((?:[\w!$'()*+,\-.:;=@]|%[\da-f]{2})+)/iu,i=[`http`,`https`,`ws`,`wss`,`urn`,`urn:uuid`];function a(e){return i.indexOf(e)!==-1}function o(e){return e.secure===!0?!0:e.secure===!1?!1:e.scheme?e.scheme.length===3&&(e.scheme[0]===`w`||e.scheme[0]===`W`)&&(e.scheme[1]===`s`||e.scheme[1]===`S`)&&(e.scheme[2]===`s`||e.scheme[2]===`S`):!1}function s(e){return e.host||(e.error=e.error||`HTTP URIs must have a host.`),e}function c(e){let t=String(e.scheme).toLowerCase()===`https`;return(e.port===(t?443:80)||e.port===``)&&(e.port=void 0),e.path||=`/`,e}function l(e){return e.secure=o(e),e.resourceName=(e.path||`/`)+(e.query?`?`+e.query:``),e.path=void 0,e.query=void 0,e}function u(e){if((e.port===(o(e)?443:80)||e.port===``)&&(e.port=void 0),typeof e.secure==`boolean`&&(e.scheme=e.secure?`wss`:`ws`,e.secure=void 0),e.resourceName){let[t,n]=e.resourceName.split(`?`);e.path=t&&t!==`/`?t:void 0,e.query=n,e.resourceName=void 0}return e.fragment=void 0,e}function d(e,t){if(!e.path)return e.error=`URN can not be parsed`,e;let n=e.path.match(r);if(n){let r=t.scheme||e.scheme||`urn`;e.nid=n[1].toLowerCase(),e.nss=n[2];let i=y(`${r}:${t.nid||e.nid}`);e.path=void 0,i&&(e=i.parse(e,t))}else e.error=e.error||`URN can not be parsed.`;return e}function f(e,t){if(e.nid===void 0)throw Error(`URN without nid cannot be serialized`);let n=t.scheme||e.scheme||`urn`,r=e.nid.toLowerCase(),i=y(`${n}:${t.nid||r}`);i&&(e=i.serialize(e,t));let a=e,o=e.nss;return a.path=`${r||t.nid}:${o}`,t.skipEscape=!0,a}function p(e,t){let r=e;return r.uuid=r.nss,r.nss=void 0,!t.tolerant&&(!r.uuid||!n(r.uuid))&&(r.error=r.error||`UUID is not valid.`),r}function m(e){let t=e;return t.nss=(e.uuid||``).toLowerCase(),t}let h={scheme:`http`,domainHost:!0,parse:s,serialize:c},g={scheme:`https`,domainHost:h.domainHost,parse:s,serialize:c},_={scheme:`ws`,domainHost:!0,parse:l,serialize:u},v={http:h,https:g,ws:_,wss:{scheme:`wss`,domainHost:_.domainHost,parse:_.parse,serialize:_.serialize},urn:{scheme:`urn`,parse:d,serialize:f,skipNormalize:!0},"urn:uuid":{scheme:`urn:uuid`,parse:p,serialize:m,skipNormalize:!0}};Object.setPrototypeOf(v,null);function y(e){return e&&(v[e]||v[e.toLowerCase()])||void 0}t.exports={wsIsSecure:o,SCHEMES:v,isValidSchemeName:a,getSchemeHandler:y}})),Tre=G(((e,t)=>{let{normalizeIPv6:n,removeDotSegments:r,recomposeAuthority:i,normalizeComponentEncoding:a,isIPv4:o,nonSimpleDomain:s}=mF(),{SCHEMES:c,getSchemeHandler:l}=wre();function u(e,t){return typeof e==`string`?e=m(g(e,t),t):typeof e==`object`&&(e=g(m(e,t),t)),e}function d(e,t,n){let r=n?Object.assign({scheme:`null`},n):{scheme:`null`},i=f(g(e,r),g(t,r),r,!0);return r.skipEscape=!0,m(i,r)}function f(e,t,n,i){let a={};return i||(e=g(m(e,n),n),t=g(m(t,n),n)),n||={},!n.tolerant&&t.scheme?(a.scheme=t.scheme,a.userinfo=t.userinfo,a.host=t.host,a.port=t.port,a.path=r(t.path||``),a.query=t.query):(t.userinfo!==void 0||t.host!==void 0||t.port!==void 0?(a.userinfo=t.userinfo,a.host=t.host,a.port=t.port,a.path=r(t.path||``),a.query=t.query):(t.path?(t.path[0]===`/`?a.path=r(t.path):(a.path=(e.userinfo!==void 0||e.host!==void 0||e.port!==void 0)&&!e.path?`/`+t.path:e.path?e.path.slice(0,e.path.lastIndexOf(`/`)+1)+t.path:t.path,a.path=r(a.path)),a.query=t.query):(a.path=e.path,a.query=t.query===void 0?e.query:t.query),a.userinfo=e.userinfo,a.host=e.host,a.port=e.port),a.scheme=e.scheme),a.fragment=t.fragment,a}function p(e,t,n){return typeof e==`string`?(e=unescape(e),e=m(a(g(e,n),!0),{...n,skipEscape:!0})):typeof e==`object`&&(e=m(a(e,!0),{...n,skipEscape:!0})),typeof t==`string`?(t=unescape(t),t=m(a(g(t,n),!0),{...n,skipEscape:!0})):typeof t==`object`&&(t=m(a(t,!0),{...n,skipEscape:!0})),e.toLowerCase()===t.toLowerCase()}function m(e,t){let n={host:e.host,scheme:e.scheme,userinfo:e.userinfo,port:e.port,path:e.path,query:e.query,nid:e.nid,nss:e.nss,uuid:e.uuid,fragment:e.fragment,reference:e.reference,resourceName:e.resourceName,secure:e.secure,error:``},a=Object.assign({},t),o=[],s=l(a.scheme||n.scheme);s&&s.serialize&&s.serialize(n,a),n.path!==void 0&&(a.skipEscape?n.path=unescape(n.path):(n.path=escape(n.path),n.scheme!==void 0&&(n.path=n.path.split(`%3A`).join(`:`)))),a.reference!==`suffix`&&n.scheme&&o.push(n.scheme,`:`);let c=i(n);if(c!==void 0&&(a.reference!==`suffix`&&o.push(`//`),o.push(c),n.path&&n.path[0]!==`/`&&o.push(`/`)),n.path!==void 0){let e=n.path;!a.absolutePath&&(!s||!s.absolutePath)&&(e=r(e)),c===void 0&&e[0]===`/`&&e[1]===`/`&&(e=`/%2F`+e.slice(2)),o.push(e)}return n.query!==void 0&&o.push(`?`,n.query),n.fragment!==void 0&&o.push(`#`,n.fragment),o.join(``)}let h=/^(?:([^#/:?]+):)?(?:\/\/((?:([^#/?@]*)@)?(\[[^#/?\]]+\]|[^#/:?]*)(?::(\d*))?))?([^#?]*)(?:\?([^#]*))?(?:#((?:.|[\n\r])*))?/u;function g(e,t){let r=Object.assign({},t),i={scheme:void 0,userinfo:void 0,host:``,port:void 0,path:``,query:void 0,fragment:void 0},a=!1;r.reference===`suffix`&&(e=r.scheme?r.scheme+`:`+e:`//`+e);let c=e.match(h);if(c){if(i.scheme=c[1],i.userinfo=c[3],i.host=c[4],i.port=parseInt(c[5],10),i.path=c[6]||``,i.query=c[7],i.fragment=c[8],isNaN(i.port)&&(i.port=c[5]),i.host)if(o(i.host)===!1){let e=n(i.host);i.host=e.host.toLowerCase(),a=e.isIPV6}else a=!0;i.reference=i.scheme===void 0&&i.userinfo===void 0&&i.host===void 0&&i.port===void 0&&i.query===void 0&&!i.path?`same-document`:i.scheme===void 0?`relative`:i.fragment===void 0?`absolute`:`uri`,r.reference&&r.reference!==`suffix`&&r.reference!==i.reference&&(i.error=i.error||`URI is not a `+r.reference+` reference.`);let t=l(r.scheme||i.scheme);if(!r.unicodeSupport&&(!t||!t.unicodeSupport)&&i.host&&(r.domainHost||t&&t.domainHost)&&a===!1&&s(i.host))try{i.host=URL.domainToASCII(i.host.toLowerCase())}catch(e){i.error=i.error||`Host's domain name can not be converted to ASCII: `+e}(!t||t&&!t.skipNormalize)&&(e.indexOf(`%`)!==-1&&(i.scheme!==void 0&&(i.scheme=unescape(i.scheme)),i.host!==void 0&&(i.host=unescape(i.host))),i.path&&=escape(unescape(i.path)),i.fragment&&=encodeURI(decodeURIComponent(i.fragment))),t&&t.parse&&t.parse(i,r)}else i.error=i.error||`URI can not be parsed.`;return i}let _={SCHEMES:c,normalize:u,resolve:d,resolveComponent:f,equal:p,serialize:m,parse:g};t.exports=_,t.exports.default=_,t.exports.fastUri=_})),Ere=G((e=>{Object.defineProperty(e,"__esModule",{value:!0});let t=Tre();t.code=`require("ajv/dist/runtime/uri").default`,e.default=t})),hF=G((e=>{Object.defineProperty(e,"__esModule",{value:!0}),e.CodeGen=e.Name=e.nil=e.stringify=e.str=e._=e.KeywordCxt=void 0;var t=uF();Object.defineProperty(e,"KeywordCxt",{enumerable:!0,get:function(){return t.KeywordCxt}});var n=eF();Object.defineProperty(e,"_",{enumerable:!0,get:function(){return n._}}),Object.defineProperty(e,"str",{enumerable:!0,get:function(){return n.str}}),Object.defineProperty(e,"stringify",{enumerable:!0,get:function(){return n.stringify}}),Object.defineProperty(e,"nil",{enumerable:!0,get:function(){return n.nil}}),Object.defineProperty(e,"Name",{enumerable:!0,get:function(){return n.Name}}),Object.defineProperty(e,"CodeGen",{enumerable:!0,get:function(){return n.CodeGen}});let r=dF(),i=fF(),a=iF(),o=pF(),s=eF(),c=lF(),l=oF(),u=tF(),d=Cre(),f=Ere(),p=(e,t)=>new RegExp(e,t);p.code=`new RegExp`;let m=[`removeAdditional`,`useDefaults`,`coerceTypes`],h=new Set([`validate`,`serialize`,`parse`,`wrapper`,`root`,`schema`,`keyword`,`pattern`,`formats`,`validate$data`,`func`,`obj`,`Error`]),g={errorDataPath:``,format:"`validateFormats: false` can be used instead.",nullable:`"nullable" keyword is supported by default.`,jsonPointers:`Deprecated jsPropertySyntax can be used instead.`,extendRefs:`Deprecated ignoreKeywordsWithRef can be used instead.`,missingRefs:`Pass empty schema with $id that should be ignored to ajv.addSchema.`,processCode:"Use option `code: {process: (code, schemaEnv: object) => string}`",sourceCode:"Use option `code: {source: true}`",strictDefaults:"It is default now, see option `strict`.",strictKeywords:"It is default now, see option `strict`.",uniqueItems:`"uniqueItems" keyword is always validated.`,unknownFormats:"Disable strict mode or pass `true` to `ajv.addFormat` (or `formats` option).",cache:`Map is used as cache, schema object as key.`,serialize:`Map is used as cache, schema object as key.`,ajvErrors:`It is default now.`},_={ignoreKeywordsWithRef:``,jsPropertySyntax:``,unicode:`"minLength"/"maxLength" account for unicode characters by default.`};function v(e){let t=e.strict,n=e.code?.optimize,r=n===!0||n===void 0?1:n||0,i=e.code?.regExp??p,a=e.uriResolver??f.default;return{strictSchema:e.strictSchema??t??!0,strictNumbers:e.strictNumbers??t??!0,strictTypes:e.strictTypes??t??`log`,strictTuples:e.strictTuples??t??`log`,strictRequired:e.strictRequired??t??!1,code:e.code?{...e.code,optimize:r,regExp:i}:{optimize:r,regExp:i},loopRequired:e.loopRequired??200,loopEnum:e.loopEnum??200,meta:e.meta??!0,messages:e.messages??!0,inlineRefs:e.inlineRefs??!0,schemaId:e.schemaId??`$id`,addUsedSchema:e.addUsedSchema??!0,validateSchema:e.validateSchema??!0,validateFormats:e.validateFormats??!0,unicodeRegExp:e.unicodeRegExp??!0,int32range:e.int32range??!0,uriResolver:a}}var y=class{constructor(e={}){this.schemas={},this.refs={},this.formats={},this._compilations=new Set,this._loading={},this._cache=new Map,e=this.opts={...e,...v(e)};let{es5:t,lines:n}=this.opts.code;this.scope=new s.ValueScope({scope:{},prefixes:h,es5:t,lines:n}),this.logger=D(e.logger);let r=e.validateFormats;e.validateFormats=!1,this.RULES=(0,a.getRules)(),b.call(this,g,e,`NOT SUPPORTED`),b.call(this,_,e,`DEPRECATED`,`warn`),this._metaOpts=T.call(this),e.formats&&C.call(this),this._addVocabularies(),this._addDefaultMetaSchema(),e.keywords&&w.call(this,e.keywords),typeof e.meta==`object`&&this.addMetaSchema(e.meta),S.call(this),e.validateFormats=r}_addVocabularies(){this.addKeyword(`$async`)}_addDefaultMetaSchema(){let{$data:e,meta:t,schemaId:n}=this.opts,r=d;n===`id`&&(r={...d},r.id=r.$id,delete r.$id),t&&e&&this.addMetaSchema(r,r[n],!1)}defaultMeta(){let{meta:e,schemaId:t}=this.opts;return this.opts.defaultMeta=typeof e==`object`?e[t]||e:void 0}validate(e,t){let n;if(typeof e==`string`){if(n=this.getSchema(e),!n)throw Error(`no schema with key or ref "${e}"`)}else n=this.compile(e);let r=n(t);return`$async`in n||(this.errors=n.errors),r}compile(e,t){let n=this._addSchema(e,t);return n.validate||this._compileSchemaEnv(n)}compileAsync(e,t){if(typeof this.opts.loadSchema!=`function`)throw Error(`options.loadSchema should be a function`);let{loadSchema:n}=this.opts;return r.call(this,e,t);async function r(e,t){await a.call(this,e.$schema);let n=this._addSchema(e,t);return n.validate||o.call(this,n)}async function a(e){e&&!this.getSchema(e)&&await r.call(this,{$ref:e},!0)}async function o(e){try{return this._compileSchemaEnv(e)}catch(t){if(!(t instanceof i.default))throw t;return s.call(this,t),await c.call(this,t.missingSchema),o.call(this,e)}}function s({missingSchema:e,missingRef:t}){if(this.refs[e])throw Error(`AnySchema ${e} is loaded but ${t} cannot be resolved`)}async function c(e){let n=await l.call(this,e);this.refs[e]||await a.call(this,n.$schema),this.refs[e]||this.addSchema(n,e,t)}async function l(e){let t=this._loading[e];if(t)return t;try{return await(this._loading[e]=n(e))}finally{delete this._loading[e]}}}addSchema(e,t,n,r=this.opts.validateSchema){if(Array.isArray(e)){for(let t of e)this.addSchema(t,void 0,n,r);return this}let i;if(typeof e==`object`){let{schemaId:t}=this.opts;if(i=e[t],i!==void 0&&typeof i!=`string`)throw Error(`schema ${t} must be string`)}return t=(0,c.normalizeId)(t||i),this._checkUnique(t),this.schemas[t]=this._addSchema(e,n,t,r,!0),this}addMetaSchema(e,t,n=this.opts.validateSchema){return this.addSchema(e,t,!0,n),this}validateSchema(e,t){if(typeof e==`boolean`)return!0;let n;if(n=e.$schema,n!==void 0&&typeof n!=`string`)throw Error(`$schema must be a string`);if(n=n||this.opts.defaultMeta||this.defaultMeta(),!n)return this.logger.warn(`meta-schema not available`),this.errors=null,!0;let r=this.validate(n,e);if(!r&&t){let e=`schema is invalid: `+this.errorsText();if(this.opts.validateSchema===`log`)this.logger.error(e);else throw Error(e)}return r}getSchema(e){let t;for(;typeof(t=x.call(this,e))==`string`;)e=t;if(t===void 0){let{schemaId:n}=this.opts,r=new o.SchemaEnv({schema:{},schemaId:n});if(t=o.resolveSchema.call(this,r,e),!t)return;this.refs[e]=t}return t.validate||this._compileSchemaEnv(t)}removeSchema(e){if(e instanceof RegExp)return this._removeAllSchemas(this.schemas,e),this._removeAllSchemas(this.refs,e),this;switch(typeof e){case`undefined`:return this._removeAllSchemas(this.schemas),this._removeAllSchemas(this.refs),this._cache.clear(),this;case`string`:{let t=x.call(this,e);return typeof t==`object`&&this._cache.delete(t.schema),delete this.schemas[e],delete this.refs[e],this}case`object`:{let t=e;this._cache.delete(t);let n=e[this.opts.schemaId];return n&&(n=(0,c.normalizeId)(n),delete this.schemas[n],delete this.refs[n]),this}default:throw Error(`ajv.removeSchema: invalid parameter`)}}addVocabulary(e){for(let t of e)this.addKeyword(t);return this}addKeyword(e,t){let n;if(typeof e==`string`)n=e,typeof t==`object`&&(this.logger.warn(`these parameters are deprecated, see docs for addKeyword`),t.keyword=n);else if(typeof e==`object`&&t===void 0){if(t=e,n=t.keyword,Array.isArray(n)&&!n.length)throw Error(`addKeywords: keyword must be string or non-empty array`)}else throw Error(`invalid addKeywords parameters`);if(k.call(this,n,t),!t)return(0,u.eachItem)(n,e=>A.call(this,e)),this;M.call(this,t);let r={...t,type:(0,l.getJSONTypes)(t.type),schemaType:(0,l.getJSONTypes)(t.schemaType)};return(0,u.eachItem)(n,r.type.length===0?e=>A.call(this,e,r):e=>r.type.forEach(t=>A.call(this,e,r,t))),this}getKeyword(e){let t=this.RULES.all[e];return typeof t==`object`?t.definition:!!t}removeKeyword(e){let{RULES:t}=this;delete t.keywords[e],delete t.all[e];for(let n of t.rules){let t=n.rules.findIndex(t=>t.keyword===e);t>=0&&n.rules.splice(t,1)}return this}addFormat(e,t){return typeof t==`string`&&(t=new RegExp(t)),this.formats[e]=t,this}errorsText(e=this.errors,{separator:t=`, `,dataVar:n=`data`}={}){return!e||e.length===0?`No errors`:e.map(e=>`${n}${e.instancePath} ${e.message}`).reduce((e,n)=>e+t+n)}$dataMetaSchema(e,t){let n=this.RULES.all;e=JSON.parse(JSON.stringify(e));for(let r of t){let t=r.split(`/`).slice(1),i=e;for(let e of t)i=i[e];for(let e in n){let t=n[e];if(typeof t!=`object`)continue;let{$data:r}=t.definition,a=i[e];r&&a&&(i[e]=ee(a))}}return e}_removeAllSchemas(e,t){for(let n in e){let r=e[n];(!t||t.test(n))&&(typeof r==`string`?delete e[n]:r&&!r.meta&&(this._cache.delete(r.schema),delete e[n]))}}_addSchema(e,t,n,r=this.opts.validateSchema,i=this.opts.addUsedSchema){let a,{schemaId:s}=this.opts;if(typeof e==`object`)a=e[s];else if(this.opts.jtd)throw Error(`schema must be object`);else if(typeof e!=`boolean`)throw Error(`schema must be object or boolean`);let l=this._cache.get(e);if(l!==void 0)return l;n=(0,c.normalizeId)(a||n);let u=c.getSchemaRefs.call(this,e,n);return l=new o.SchemaEnv({schema:e,schemaId:s,meta:t,baseId:n,localRefs:u}),this._cache.set(l.schema,l),i&&!n.startsWith(`#`)&&(n&&this._checkUnique(n),this.refs[n]=l),r&&this.validateSchema(e,!0),l}_checkUnique(e){if(this.schemas[e]||this.refs[e])throw Error(`schema with key or id "${e}" already exists`)}_compileSchemaEnv(e){if(e.meta?this._compileMetaSchema(e):o.compileSchema.call(this,e),!e.validate)throw Error(`ajv implementation error`);return e.validate}_compileMetaSchema(e){let t=this.opts;this.opts=this._metaOpts;try{o.compileSchema.call(this,e)}finally{this.opts=t}}};y.ValidationError=r.default,y.MissingRefError=i.default,e.default=y;function b(e,t,n,r=`error`){for(let i in e){let a=i;a in t&&this.logger[r](`${n}: option ${i}. ${e[a]}`)}}function x(e){return e=(0,c.normalizeId)(e),this.schemas[e]||this.refs[e]}function S(){let e=this.opts.schemas;if(e)if(Array.isArray(e))this.addSchema(e);else for(let t in e)this.addSchema(e[t],t)}function C(){for(let e in this.opts.formats){let t=this.opts.formats[e];t&&this.addFormat(e,t)}}function w(e){if(Array.isArray(e)){this.addVocabulary(e);return}this.logger.warn(`keywords option as map is deprecated, pass array`);for(let t in e){let n=e[t];n.keyword||=t,this.addKeyword(n)}}function T(){let e={...this.opts};for(let t of m)delete e[t];return e}let E={log(){},warn(){},error(){}};function D(e){if(e===!1)return E;if(e===void 0)return console;if(e.log&&e.warn&&e.error)return e;throw Error(`logger must implement log, warn and error methods`)}let O=/^[a-z_$][a-z0-9_$:-]*$/i;function k(e,t){let{RULES:n}=this;if((0,u.eachItem)(e,e=>{if(n.keywords[e])throw Error(`Keyword ${e} is already defined`);if(!O.test(e))throw Error(`Keyword ${e} has invalid name`)}),t&&t.$data&&!(`code`in t||`validate`in t))throw Error(`$data keyword must have "code" or "validate" function`)}function A(e,t,n){var r;let i=t?.post;if(n&&i)throw Error(`keyword with "post" flag cannot have "type"`);let{RULES:a}=this,o=i?a.post:a.rules.find(({type:e})=>e===n);if(o||(o={type:n,rules:[]},a.rules.push(o)),a.keywords[e]=!0,!t)return;let s={keyword:e,definition:{...t,type:(0,l.getJSONTypes)(t.type),schemaType:(0,l.getJSONTypes)(t.schemaType)}};t.before?j.call(this,o,s,t.before):o.rules.push(s),a.all[e]=s,(r=t.implements)==null||r.forEach(e=>this.addKeyword(e))}function j(e,t,n){let r=e.rules.findIndex(e=>e.keyword===n);r>=0?e.rules.splice(r,0,t):(e.rules.push(t),this.logger.warn(`rule ${n} is not defined`))}function M(e){let{metaSchema:t}=e;t!==void 0&&(e.$data&&this.opts.$data&&(t=ee(t)),e.validateSchema=this.compile(t,!0))}let N={$ref:`https://raw.githubusercontent.com/ajv-validator/ajv/master/lib/refs/data.json#`};function ee(e){return{anyOf:[e,N]}}})),Dre=G((e=>{Object.defineProperty(e,"__esModule",{value:!0}),e.default={keyword:`id`,code(){throw Error(`NOT SUPPORTED: keyword "id", use "$id" for schema ID`)}}})),gF=G((e=>{Object.defineProperty(e,"__esModule",{value:!0}),e.callRef=e.getValidate=void 0;let t=fF(),n=sF(),r=eF(),i=nF(),a=pF(),o=tF(),s={keyword:`$ref`,schemaType:`string`,code(e){let{gen:n,schema:i,it:o}=e,{baseId:s,schemaEnv:u,validateName:d,opts:f,self:p}=o,{root:m}=u;if((i===`#`||i===`#/`)&&s===m.baseId)return g();let h=a.resolveRef.call(p,m,s,i);if(h===void 0)throw new t.default(o.opts.uriResolver,s,i);if(h instanceof a.SchemaEnv)return _(h);return v(h);function g(){if(u===m)return l(e,d,u,u.$async);let t=n.scopeValue(`root`,{ref:m});return l(e,(0,r._)`${t}.validate`,m,m.$async)}function _(t){l(e,c(e,t),t,t.$async)}function v(t){let a=n.scopeValue(`schema`,f.code.source===!0?{ref:t,code:(0,r.stringify)(t)}:{ref:t}),o=n.name(`valid`),s=e.subschema({schema:t,dataTypes:[],schemaPath:r.nil,topSchemaRef:a,errSchemaPath:i},o);e.mergeEvaluated(s),e.ok(o)}}};function c(e,t){let{gen:n}=e;return t.validate?n.scopeValue(`validate`,{ref:t.validate}):(0,r._)`${n.scopeValue(`wrapper`,{ref:t})}.validate`}e.getValidate=c;function l(e,t,a,s){let{gen:c,it:l}=e,{allErrors:u,schemaEnv:d,opts:f}=l,p=f.passContext?i.default.this:r.nil;s?m():h();function m(){if(!d.$async)throw Error(`async schema referenced by sync schema`);let i=c.let(`valid`);c.try(()=>{c.code((0,r._)`await ${(0,n.callValidateCode)(e,t,p)}`),_(t),u||c.assign(i,!0)},e=>{c.if((0,r._)`!(${e} instanceof ${l.ValidationError})`,()=>c.throw(e)),g(e),u||c.assign(i,!1)}),e.ok(i)}function h(){e.result((0,n.callValidateCode)(e,t,p),()=>_(t),()=>g(t))}function g(e){let t=(0,r._)`${e}.errors`;c.assign(i.default.vErrors,(0,r._)`${i.default.vErrors} === null ? ${t} : ${i.default.vErrors}.concat(${t})`),c.assign(i.default.errors,(0,r._)`${i.default.vErrors}.length`)}function _(e){if(!l.opts.unevaluated)return;let t=a?.validate?.evaluated;if(l.props!==!0)if(t&&!t.dynamicProps)t.props!==void 0&&(l.props=o.mergeEvaluated.props(c,t.props,l.props));else{let t=c.var(`props`,(0,r._)`${e}.evaluated.props`);l.props=o.mergeEvaluated.props(c,t,l.props,r.Name)}if(l.items!==!0)if(t&&!t.dynamicItems)t.items!==void 0&&(l.items=o.mergeEvaluated.items(c,t.items,l.items));else{let t=c.var(`items`,(0,r._)`${e}.evaluated.items`);l.items=o.mergeEvaluated.items(c,t,l.items,r.Name)}}}e.callRef=l,e.default=s})),_F=G((e=>{Object.defineProperty(e,"__esModule",{value:!0});let t=Dre(),n=gF();e.default=[`$schema`,`$id`,`$defs`,`$vocabulary`,{keyword:`$comment`},`definitions`,t.default,n.default]})),Ore=G((e=>{Object.defineProperty(e,"__esModule",{value:!0});let t=eF(),n=t.operators,r={maximum:{okStr:`<=`,ok:n.LTE,fail:n.GT},minimum:{okStr:`>=`,ok:n.GTE,fail:n.LT},exclusiveMaximum:{okStr:`<`,ok:n.LT,fail:n.GTE},exclusiveMinimum:{okStr:`>`,ok:n.GT,fail:n.LTE}};e.default={keyword:Object.keys(r),type:`number`,schemaType:`number`,$data:!0,error:{message:({keyword:e,schemaCode:n})=>(0,t.str)`must be ${r[e].okStr} ${n}`,params:({keyword:e,schemaCode:n})=>(0,t._)`{comparison: ${r[e].okStr}, limit: ${n}}`},code(e){let{keyword:n,data:i,schemaCode:a}=e;e.fail$data((0,t._)`${i} ${r[n].fail} ${a} || isNaN(${i})`)}}})),kre=G((e=>{Object.defineProperty(e,"__esModule",{value:!0});let t=eF();e.default={keyword:`multipleOf`,type:`number`,schemaType:`number`,$data:!0,error:{message:({schemaCode:e})=>(0,t.str)`must be multiple of ${e}`,params:({schemaCode:e})=>(0,t._)`{multipleOf: ${e}}`},code(e){let{gen:n,data:r,schemaCode:i,it:a}=e,o=a.opts.multipleOfPrecision,s=n.let(`res`),c=o?(0,t._)`Math.abs(Math.round(${s}) - ${s}) > 1e-${o}`:(0,t._)`${s} !== parseInt(${s})`;e.fail$data((0,t._)`(${i} === 0 || (${s} = ${r}/${i}, ${c}))`)}}})),Are=G((e=>{Object.defineProperty(e,"__esModule",{value:!0});function t(e){let t=e.length,n=0,r=0,i;for(;r<t;)n++,i=e.charCodeAt(r++),i>=55296&&i<=56319&&r<t&&(i=e.charCodeAt(r),(i&64512)==56320&&r++);return n}e.default=t,t.code=`require("ajv/dist/runtime/ucs2length").default`})),jre=G((e=>{Object.defineProperty(e,"__esModule",{value:!0});let t=eF(),n=tF(),r=Are();e.default={keyword:[`maxLength`,`minLength`],type:`string`,schemaType:`number`,$data:!0,error:{message({keyword:e,schemaCode:n}){let r=e===`maxLength`?`more`:`fewer`;return(0,t.str)`must NOT have ${r} than ${n} characters`},params:({schemaCode:e})=>(0,t._)`{limit: ${e}}`},code(e){let{keyword:i,data:a,schemaCode:o,it:s}=e,c=i===`maxLength`?t.operators.GT:t.operators.LT,l=s.opts.unicode===!1?(0,t._)`${a}.length`:(0,t._)`${(0,n.useFunc)(e.gen,r.default)}(${a})`;e.fail$data((0,t._)`${l} ${c} ${o}`)}}})),Mre=G((e=>{Object.defineProperty(e,"__esModule",{value:!0});let t=sF(),n=tF(),r=eF();e.default={keyword:`pattern`,type:`string`,schemaType:`string`,$data:!0,error:{message:({schemaCode:e})=>(0,r.str)`must match pattern "${e}"`,params:({schemaCode:e})=>(0,r._)`{pattern: ${e}}`},code(e){let{gen:i,data:a,$data:o,schema:s,schemaCode:c,it:l}=e,u=l.opts.unicodeRegExp?`u`:``;if(o){let{regExp:t}=l.opts.code,o=t.code===`new RegExp`?(0,r._)`new RegExp`:(0,n.useFunc)(i,t),s=i.let(`valid`);i.try(()=>i.assign(s,(0,r._)`${o}(${c}, ${u}).test(${a})`),()=>i.assign(s,!1)),e.fail$data((0,r._)`!${s}`)}else{let n=(0,t.usePattern)(e,s);e.fail$data((0,r._)`!${n}.test(${a})`)}}}})),Nre=G((e=>{Object.defineProperty(e,"__esModule",{value:!0});let t=eF();e.default={keyword:[`maxProperties`,`minProperties`],type:`object`,schemaType:`number`,$data:!0,error:{message({keyword:e,schemaCode:n}){let r=e===`maxProperties`?`more`:`fewer`;return(0,t.str)`must NOT have ${r} than ${n} properties`},params:({schemaCode:e})=>(0,t._)`{limit: ${e}}`},code(e){let{keyword:n,data:r,schemaCode:i}=e,a=n===`maxProperties`?t.operators.GT:t.operators.LT;e.fail$data((0,t._)`Object.keys(${r}).length ${a} ${i}`)}}})),Pre=G((e=>{Object.defineProperty(e,"__esModule",{value:!0});let t=sF(),n=eF(),r=tF();e.default={keyword:`required`,type:`object`,schemaType:`array`,$data:!0,error:{message:({params:{missingProperty:e}})=>(0,n.str)`must have required property '${e}'`,params:({params:{missingProperty:e}})=>(0,n._)`{missingProperty: ${e}}`},code(e){let{gen:i,schema:a,schemaCode:o,data:s,$data:c,it:l}=e,{opts:u}=l;if(!c&&a.length===0)return;let d=a.length>=u.loopRequired;if(l.allErrors?f():p(),u.strictRequired){let t=e.parentSchema.properties,{definedProperties:n}=e.it;for(let e of a)if(t?.[e]===void 0&&!n.has(e)){let t=`required property "${e}" is not defined at "${l.schemaEnv.baseId+l.errSchemaPath}" (strictRequired)`;(0,r.checkStrictMode)(l,t,l.opts.strictRequired)}}function f(){if(d||c)e.block$data(n.nil,m);else for(let n of a)(0,t.checkReportMissingProp)(e,n)}function p(){let n=i.let(`missing`);if(d||c){let t=i.let(`valid`,!0);e.block$data(t,()=>h(n,t)),e.ok(t)}else i.if((0,t.checkMissingProp)(e,a,n)),(0,t.reportMissingProp)(e,n),i.else()}function m(){i.forOf(`prop`,o,n=>{e.setParams({missingProperty:n}),i.if((0,t.noPropertyInData)(i,s,n,u.ownProperties),()=>e.error())})}function h(r,a){e.setParams({missingProperty:r}),i.forOf(r,o,()=>{i.assign(a,(0,t.propertyInData)(i,s,r,u.ownProperties)),i.if((0,n.not)(a),()=>{e.error(),i.break()})},n.nil)}}}})),Fre=G((e=>{Object.defineProperty(e,"__esModule",{value:!0});let t=eF();e.default={keyword:[`maxItems`,`minItems`],type:`array`,schemaType:`number`,$data:!0,error:{message({keyword:e,schemaCode:n}){let r=e===`maxItems`?`more`:`fewer`;return(0,t.str)`must NOT have ${r} than ${n} items`},params:({schemaCode:e})=>(0,t._)`{limit: ${e}}`},code(e){let{keyword:n,data:r,schemaCode:i}=e,a=n===`maxItems`?t.operators.GT:t.operators.LT;e.fail$data((0,t._)`${r}.length ${a} ${i}`)}}})),vF=G((e=>{Object.defineProperty(e,"__esModule",{value:!0});let t=cF();t.code=`require("ajv/dist/runtime/equal").default`,e.default=t})),Ire=G((e=>{Object.defineProperty(e,"__esModule",{value:!0});let t=oF(),n=eF(),r=tF(),i=vF();e.default={keyword:`uniqueItems`,type:`array`,schemaType:`boolean`,$data:!0,error:{message:({params:{i:e,j:t}})=>(0,n.str)`must NOT have duplicate items (items ## ${t} and ${e} are identical)`,params:({params:{i:e,j:t}})=>(0,n._)`{i: ${e}, j: ${t}}`},code(e){let{gen:a,data:o,$data:s,schema:c,parentSchema:l,schemaCode:u,it:d}=e;if(!s&&!c)return;let f=a.let(`valid`),p=l.items?(0,t.getSchemaTypes)(l.items):[];e.block$data(f,m,(0,n._)`${u} === false`),e.ok(f);function m(){let t=a.let(`i`,(0,n._)`${o}.length`),r=a.let(`j`);e.setParams({i:t,j:r}),a.assign(f,!0),a.if((0,n._)`${t} > 1`,()=>(h()?g:_)(t,r))}function h(){return p.length>0&&!p.some(e=>e===`object`||e===`array`)}function g(r,i){let s=a.name(`item`),c=(0,t.checkDataTypes)(p,s,d.opts.strictNumbers,t.DataType.Wrong),l=a.const(`indices`,(0,n._)`{}`);a.for((0,n._)`;${r}--;`,()=>{a.let(s,(0,n._)`${o}[${r}]`),a.if(c,(0,n._)`continue`),p.length>1&&a.if((0,n._)`typeof ${s} == "string"`,(0,n._)`${s} += "_"`),a.if((0,n._)`typeof ${l}[${s}] == "number"`,()=>{a.assign(i,(0,n._)`${l}[${s}]`),e.error(),a.assign(f,!1).break()}).code((0,n._)`${l}[${s}] = ${r}`)})}function _(t,s){let c=(0,r.useFunc)(a,i.default),l=a.name(`outer`);a.label(l).for((0,n._)`;${t}--;`,()=>a.for((0,n._)`${s} = ${t}; ${s}--;`,()=>a.if((0,n._)`${c}(${o}[${t}], ${o}[${s}])`,()=>{e.error(),a.assign(f,!1).break(l)})))}}}})),Lre=G((e=>{Object.defineProperty(e,"__esModule",{value:!0});let t=eF(),n=tF(),r=vF();e.default={keyword:`const`,$data:!0,error:{message:`must be equal to constant`,params:({schemaCode:e})=>(0,t._)`{allowedValue: ${e}}`},code(e){let{gen:i,data:a,$data:o,schemaCode:s,schema:c}=e;o||c&&typeof c==`object`?e.fail$data((0,t._)`!${(0,n.useFunc)(i,r.default)}(${a}, ${s})`):e.fail((0,t._)`${c} !== ${a}`)}}})),Rre=G((e=>{Object.defineProperty(e,"__esModule",{value:!0});let t=eF(),n=tF(),r=vF();e.default={keyword:`enum`,schemaType:`array`,$data:!0,error:{message:`must be equal to one of the allowed values`,params:({schemaCode:e})=>(0,t._)`{allowedValues: ${e}}`},code(e){let{gen:i,data:a,$data:o,schema:s,schemaCode:c,it:l}=e;if(!o&&s.length===0)throw Error(`enum must have non-empty array`);let u=s.length>=l.opts.loopEnum,d,f=()=>d??=(0,n.useFunc)(i,r.default),p;if(u||o)p=i.let(`valid`),e.block$data(p,m);else{if(!Array.isArray(s))throw Error(`ajv implementation error`);let e=i.const(`vSchema`,c);p=(0,t.or)(...s.map((t,n)=>h(e,n)))}e.pass(p);function m(){i.assign(p,!1),i.forOf(`v`,c,e=>i.if((0,t._)`${f()}(${a}, ${e})`,()=>i.assign(p,!0).break()))}function h(e,n){let r=s[n];return typeof r==`object`&&r?(0,t._)`${f()}(${a}, ${e}[${n}])`:(0,t._)`${a} === ${r}`}}}})),yF=G((e=>{Object.defineProperty(e,"__esModule",{value:!0});let t=Ore(),n=kre(),r=jre(),i=Mre(),a=Nre(),o=Pre(),s=Fre(),c=Ire(),l=Lre(),u=Rre();e.default=[t.default,n.default,r.default,i.default,a.default,o.default,s.default,c.default,{keyword:`type`,schemaType:[`string`,`array`]},{keyword:`nullable`,schemaType:`boolean`},l.default,u.default]})),bF=G((e=>{Object.defineProperty(e,"__esModule",{value:!0}),e.validateAdditionalItems=void 0;let t=eF(),n=tF(),r={keyword:`additionalItems`,type:`array`,schemaType:[`boolean`,`object`],before:`uniqueItems`,error:{message:({params:{len:e}})=>(0,t.str)`must NOT have more than ${e} items`,params:({params:{len:e}})=>(0,t._)`{limit: ${e}}`},code(e){let{parentSchema:t,it:r}=e,{items:a}=t;if(!Array.isArray(a)){(0,n.checkStrictMode)(r,`"additionalItems" is ignored when "items" is not an array of schemas`);return}i(e,a)}};function i(e,r){let{gen:i,schema:a,data:o,keyword:s,it:c}=e;c.items=!0;let l=i.const(`len`,(0,t._)`${o}.length`);if(a===!1)e.setParams({len:r.length}),e.pass((0,t._)`${l} <= ${r.length}`);else if(typeof a==`object`&&!(0,n.alwaysValidSchema)(c,a)){let n=i.var(`valid`,(0,t._)`${l} <= ${r.length}`);i.if((0,t.not)(n),()=>u(n)),e.ok(n)}function u(a){i.forRange(`i`,r.length,l,r=>{e.subschema({keyword:s,dataProp:r,dataPropType:n.Type.Num},a),c.allErrors||i.if((0,t.not)(a),()=>i.break())})}}e.validateAdditionalItems=i,e.default=r})),xF=G((e=>{Object.defineProperty(e,"__esModule",{value:!0}),e.validateTuple=void 0;let t=eF(),n=tF(),r=sF(),i={keyword:`items`,type:`array`,schemaType:[`object`,`array`,`boolean`],before:`uniqueItems`,code(e){let{schema:t,it:i}=e;if(Array.isArray(t))return a(e,`additionalItems`,t);i.items=!0,!(0,n.alwaysValidSchema)(i,t)&&e.ok((0,r.validateArray)(e))}};function a(e,r,i=e.schema){let{gen:a,parentSchema:o,data:s,keyword:c,it:l}=e;f(o),l.opts.unevaluated&&i.length&&l.items!==!0&&(l.items=n.mergeEvaluated.items(a,i.length,l.items));let u=a.name(`valid`),d=a.const(`len`,(0,t._)`${s}.length`);i.forEach((r,i)=>{(0,n.alwaysValidSchema)(l,r)||(a.if((0,t._)`${d} > ${i}`,()=>e.subschema({keyword:c,schemaProp:i,dataProp:i},u)),e.ok(u))});function f(e){let{opts:t,errSchemaPath:a}=l,o=i.length,s=o===e.minItems&&(o===e.maxItems||e[r]===!1);if(t.strictTuples&&!s){let e=`"${c}" is ${o}-tuple, but minItems or maxItems/${r} are not specified or different at path "${a}"`;(0,n.checkStrictMode)(l,e,t.strictTuples)}}}e.validateTuple=a,e.default=i})),zre=G((e=>{Object.defineProperty(e,"__esModule",{value:!0});let t=xF();e.default={keyword:`prefixItems`,type:`array`,schemaType:[`array`],before:`uniqueItems`,code:e=>(0,t.validateTuple)(e,`items`)}})),Bre=G((e=>{Object.defineProperty(e,"__esModule",{value:!0});let t=eF(),n=tF(),r=sF(),i=bF();e.default={keyword:`items`,type:`array`,schemaType:[`object`,`boolean`],before:`uniqueItems`,error:{message:({params:{len:e}})=>(0,t.str)`must NOT have more than ${e} items`,params:({params:{len:e}})=>(0,t._)`{limit: ${e}}`},code(e){let{schema:t,parentSchema:a,it:o}=e,{prefixItems:s}=a;o.items=!0,!(0,n.alwaysValidSchema)(o,t)&&(s?(0,i.validateAdditionalItems)(e,s):e.ok((0,r.validateArray)(e)))}}})),Vre=G((e=>{Object.defineProperty(e,"__esModule",{value:!0});let t=eF(),n=tF();e.default={keyword:`contains`,type:`array`,schemaType:[`object`,`boolean`],before:`uniqueItems`,trackErrors:!0,error:{message:({params:{min:e,max:n}})=>n===void 0?(0,t.str)`must contain at least ${e} valid item(s)`:(0,t.str)`must contain at least ${e} and no more than ${n} valid item(s)`,params:({params:{min:e,max:n}})=>n===void 0?(0,t._)`{minContains: ${e}}`:(0,t._)`{minContains: ${e}, maxContains: ${n}}`},code(e){let{gen:r,schema:i,parentSchema:a,data:o,it:s}=e,c,l,{minContains:u,maxContains:d}=a;s.opts.next?(c=u===void 0?1:u,l=d):c=1;let f=r.const(`len`,(0,t._)`${o}.length`);if(e.setParams({min:c,max:l}),l===void 0&&c===0){(0,n.checkStrictMode)(s,`"minContains" == 0 without "maxContains": "contains" keyword ignored`);return}if(l!==void 0&&c>l){(0,n.checkStrictMode)(s,`"minContains" > "maxContains" is always invalid`),e.fail();return}if((0,n.alwaysValidSchema)(s,i)){let n=(0,t._)`${f} >= ${c}`;l!==void 0&&(n=(0,t._)`${n} && ${f} <= ${l}`),e.pass(n);return}s.items=!0;let p=r.name(`valid`);l===void 0&&c===1?h(p,()=>r.if(p,()=>r.break())):c===0?(r.let(p,!0),l!==void 0&&r.if((0,t._)`${o}.length > 0`,m)):(r.let(p,!1),m()),e.result(p,()=>e.reset());function m(){let e=r.name(`_valid`),t=r.let(`count`,0);h(e,()=>r.if(e,()=>g(t)))}function h(t,i){r.forRange(`i`,0,f,r=>{e.subschema({keyword:`contains`,dataProp:r,dataPropType:n.Type.Num,compositeRule:!0},t),i()})}function g(e){r.code((0,t._)`${e}++`),l===void 0?r.if((0,t._)`${e} >= ${c}`,()=>r.assign(p,!0).break()):(r.if((0,t._)`${e} > ${l}`,()=>r.assign(p,!1).break()),c===1?r.assign(p,!0):r.if((0,t._)`${e} >= ${c}`,()=>r.assign(p,!0)))}}}})),SF=G((e=>{Object.defineProperty(e,"__esModule",{value:!0}),e.validateSchemaDeps=e.validatePropertyDeps=e.error=void 0;let t=eF(),n=tF(),r=sF();e.error={message:({params:{property:e,depsCount:n,deps:r}})=>{let i=n===1?`property`:`properties`;return(0,t.str)`must have ${i} ${r} when property ${e} is present`},params:({params:{property:e,depsCount:n,deps:r,missingProperty:i}})=>(0,t._)`{property: ${e},
131
- missingProperty: ${i},
132
- depsCount: ${n},
133
- deps: ${r}}`};let i={keyword:`dependencies`,type:`object`,schemaType:`object`,error:e.error,code(e){let[t,n]=a(e);o(e,t),s(e,n)}};function a({schema:e}){let t={},n={};for(let r in e){if(r===`__proto__`)continue;let i=Array.isArray(e[r])?t:n;i[r]=e[r]}return[t,n]}function o(e,n=e.schema){let{gen:i,data:a,it:o}=e;if(Object.keys(n).length===0)return;let s=i.let(`missing`);for(let c in n){let l=n[c];if(l.length===0)continue;let u=(0,r.propertyInData)(i,a,c,o.opts.ownProperties);e.setParams({property:c,depsCount:l.length,deps:l.join(`, `)}),o.allErrors?i.if(u,()=>{for(let t of l)(0,r.checkReportMissingProp)(e,t)}):(i.if((0,t._)`${u} && (${(0,r.checkMissingProp)(e,l,s)})`),(0,r.reportMissingProp)(e,s),i.else())}}e.validatePropertyDeps=o;function s(e,t=e.schema){let{gen:i,data:a,keyword:o,it:s}=e,c=i.name(`valid`);for(let l in t)(0,n.alwaysValidSchema)(s,t[l])||(i.if((0,r.propertyInData)(i,a,l,s.opts.ownProperties),()=>{let t=e.subschema({keyword:o,schemaProp:l},c);e.mergeValidEvaluated(t,c)},()=>i.var(c,!0)),e.ok(c))}e.validateSchemaDeps=s,e.default=i})),Hre=G((e=>{Object.defineProperty(e,"__esModule",{value:!0});let t=eF(),n=tF();e.default={keyword:`propertyNames`,type:`object`,schemaType:[`object`,`boolean`],error:{message:`property name must be valid`,params:({params:e})=>(0,t._)`{propertyName: ${e.propertyName}}`},code(e){let{gen:r,schema:i,data:a,it:o}=e;if((0,n.alwaysValidSchema)(o,i))return;let s=r.name(`valid`);r.forIn(`key`,a,n=>{e.setParams({propertyName:n}),e.subschema({keyword:`propertyNames`,data:n,dataTypes:[`string`],propertyName:n,compositeRule:!0},s),r.if((0,t.not)(s),()=>{e.error(!0),o.allErrors||r.break()})}),e.ok(s)}}})),CF=G((e=>{Object.defineProperty(e,"__esModule",{value:!0});let t=sF(),n=eF(),r=nF(),i=tF();e.default={keyword:`additionalProperties`,type:[`object`],schemaType:[`boolean`,`object`],allowUndefined:!0,trackErrors:!0,error:{message:`must NOT have additional properties`,params:({params:e})=>(0,n._)`{additionalProperty: ${e.additionalProperty}}`},code(e){let{gen:a,schema:o,parentSchema:s,data:c,errsCount:l,it:u}=e;if(!l)throw Error(`ajv implementation error`);let{allErrors:d,opts:f}=u;if(u.props=!0,f.removeAdditional!==`all`&&(0,i.alwaysValidSchema)(u,o))return;let p=(0,t.allSchemaProperties)(s.properties),m=(0,t.allSchemaProperties)(s.patternProperties);h(),e.ok((0,n._)`${l} === ${r.default.errors}`);function h(){a.forIn(`key`,c,e=>{!p.length&&!m.length?v(e):a.if(g(e),()=>v(e))})}function g(r){let o;if(p.length>8){let e=(0,i.schemaRefOrVal)(u,s.properties,`properties`);o=(0,t.isOwnProperty)(a,e,r)}else o=p.length?(0,n.or)(...p.map(e=>(0,n._)`${r} === ${e}`)):n.nil;return m.length&&(o=(0,n.or)(o,...m.map(i=>(0,n._)`${(0,t.usePattern)(e,i)}.test(${r})`))),(0,n.not)(o)}function _(e){a.code((0,n._)`delete ${c}[${e}]`)}function v(t){if(f.removeAdditional===`all`||f.removeAdditional&&o===!1){_(t);return}if(o===!1){e.setParams({additionalProperty:t}),e.error(),d||a.break();return}if(typeof o==`object`&&!(0,i.alwaysValidSchema)(u,o)){let r=a.name(`valid`);f.removeAdditional===`failing`?(y(t,r,!1),a.if((0,n.not)(r),()=>{e.reset(),_(t)})):(y(t,r),d||a.if((0,n.not)(r),()=>a.break()))}}function y(t,n,r){let a={keyword:`additionalProperties`,dataProp:t,dataPropType:i.Type.Str};r===!1&&Object.assign(a,{compositeRule:!0,createErrors:!1,allErrors:!1}),e.subschema(a,n)}}}})),Ure=G((e=>{Object.defineProperty(e,"__esModule",{value:!0});let t=uF(),n=sF(),r=tF(),i=CF();e.default={keyword:`properties`,type:`object`,schemaType:`object`,code(e){let{gen:a,schema:o,parentSchema:s,data:c,it:l}=e;l.opts.removeAdditional===`all`&&s.additionalProperties===void 0&&i.default.code(new t.KeywordCxt(l,i.default,`additionalProperties`));let u=(0,n.allSchemaProperties)(o);for(let e of u)l.definedProperties.add(e);l.opts.unevaluated&&u.length&&l.props!==!0&&(l.props=r.mergeEvaluated.props(a,(0,r.toHash)(u),l.props));let d=u.filter(e=>!(0,r.alwaysValidSchema)(l,o[e]));if(d.length===0)return;let f=a.name(`valid`);for(let t of d)p(t)?m(t):(a.if((0,n.propertyInData)(a,c,t,l.opts.ownProperties)),m(t),l.allErrors||a.else().var(f,!0),a.endIf()),e.it.definedProperties.add(t),e.ok(f);function p(e){return l.opts.useDefaults&&!l.compositeRule&&o[e].default!==void 0}function m(t){e.subschema({keyword:`properties`,schemaProp:t,dataProp:t},f)}}}})),Wre=G((e=>{Object.defineProperty(e,"__esModule",{value:!0});let t=sF(),n=eF(),r=tF(),i=tF();e.default={keyword:`patternProperties`,type:`object`,schemaType:`object`,code(e){let{gen:a,schema:o,data:s,parentSchema:c,it:l}=e,{opts:u}=l,d=(0,t.allSchemaProperties)(o),f=d.filter(e=>(0,r.alwaysValidSchema)(l,o[e]));if(d.length===0||f.length===d.length&&(!l.opts.unevaluated||l.props===!0))return;let p=u.strictSchema&&!u.allowMatchingProperties&&c.properties,m=a.name(`valid`);l.props!==!0&&!(l.props instanceof n.Name)&&(l.props=(0,i.evaluatedPropsToName)(a,l.props));let{props:h}=l;g();function g(){for(let e of d)p&&_(e),l.allErrors?v(e):(a.var(m,!0),v(e),a.if(m))}function _(e){for(let t in p)new RegExp(e).test(t)&&(0,r.checkStrictMode)(l,`property ${t} matches pattern ${e} (use allowMatchingProperties)`)}function v(r){a.forIn(`key`,s,o=>{a.if((0,n._)`${(0,t.usePattern)(e,r)}.test(${o})`,()=>{let t=f.includes(r);t||e.subschema({keyword:`patternProperties`,schemaProp:r,dataProp:o,dataPropType:i.Type.Str},m),l.opts.unevaluated&&h!==!0?a.assign((0,n._)`${h}[${o}]`,!0):!t&&!l.allErrors&&a.if((0,n.not)(m),()=>a.break())})})}}}})),Gre=G((e=>{Object.defineProperty(e,"__esModule",{value:!0});let t=tF();e.default={keyword:`not`,schemaType:[`object`,`boolean`],trackErrors:!0,code(e){let{gen:n,schema:r,it:i}=e;if((0,t.alwaysValidSchema)(i,r)){e.fail();return}let a=n.name(`valid`);e.subschema({keyword:`not`,compositeRule:!0,createErrors:!1,allErrors:!1},a),e.failResult(a,()=>e.reset(),()=>e.error())},error:{message:`must NOT be valid`}}})),Kre=G((e=>{Object.defineProperty(e,"__esModule",{value:!0}),e.default={keyword:`anyOf`,schemaType:`array`,trackErrors:!0,code:sF().validateUnion,error:{message:`must match a schema in anyOf`}}})),qre=G((e=>{Object.defineProperty(e,"__esModule",{value:!0});let t=eF(),n=tF();e.default={keyword:`oneOf`,schemaType:`array`,trackErrors:!0,error:{message:`must match exactly one schema in oneOf`,params:({params:e})=>(0,t._)`{passingSchemas: ${e.passing}}`},code(e){let{gen:r,schema:i,parentSchema:a,it:o}=e;if(!Array.isArray(i))throw Error(`ajv implementation error`);if(o.opts.discriminator&&a.discriminator)return;let s=i,c=r.let(`valid`,!1),l=r.let(`passing`,null),u=r.name(`_valid`);e.setParams({passing:l}),r.block(d),e.result(c,()=>e.reset(),()=>e.error(!0));function d(){s.forEach((i,a)=>{let s;(0,n.alwaysValidSchema)(o,i)?r.var(u,!0):s=e.subschema({keyword:`oneOf`,schemaProp:a,compositeRule:!0},u),a>0&&r.if((0,t._)`${u} && ${c}`).assign(c,!1).assign(l,(0,t._)`[${l}, ${a}]`).else(),r.if(u,()=>{r.assign(c,!0),r.assign(l,a),s&&e.mergeEvaluated(s,t.Name)})})}}}})),Jre=G((e=>{Object.defineProperty(e,"__esModule",{value:!0});let t=tF();e.default={keyword:`allOf`,schemaType:`array`,code(e){let{gen:n,schema:r,it:i}=e;if(!Array.isArray(r))throw Error(`ajv implementation error`);let a=n.name(`valid`);r.forEach((n,r)=>{if((0,t.alwaysValidSchema)(i,n))return;let o=e.subschema({keyword:`allOf`,schemaProp:r},a);e.ok(a),e.mergeEvaluated(o)})}}})),Yre=G((e=>{Object.defineProperty(e,"__esModule",{value:!0});let t=eF(),n=tF(),r={keyword:`if`,schemaType:[`object`,`boolean`],trackErrors:!0,error:{message:({params:e})=>(0,t.str)`must match "${e.ifClause}" schema`,params:({params:e})=>(0,t._)`{failingKeyword: ${e.ifClause}}`},code(e){let{gen:r,parentSchema:a,it:o}=e;a.then===void 0&&a.else===void 0&&(0,n.checkStrictMode)(o,`"if" without "then" and "else" is ignored`);let s=i(o,`then`),c=i(o,`else`);if(!s&&!c)return;let l=r.let(`valid`,!0),u=r.name(`_valid`);if(d(),e.reset(),s&&c){let t=r.let(`ifClause`);e.setParams({ifClause:t}),r.if(u,f(`then`,t),f(`else`,t))}else s?r.if(u,f(`then`)):r.if((0,t.not)(u),f(`else`));e.pass(l,()=>e.error(!0));function d(){let t=e.subschema({keyword:`if`,compositeRule:!0,createErrors:!1,allErrors:!1},u);e.mergeEvaluated(t)}function f(n,i){return()=>{let a=e.subschema({keyword:n},u);r.assign(l,u),e.mergeValidEvaluated(a,l),i?r.assign(i,(0,t._)`${n}`):e.setParams({ifClause:n})}}}};function i(e,t){let r=e.schema[t];return r!==void 0&&!(0,n.alwaysValidSchema)(e,r)}e.default=r})),Xre=G((e=>{Object.defineProperty(e,"__esModule",{value:!0});let t=tF();e.default={keyword:[`then`,`else`],schemaType:[`object`,`boolean`],code({keyword:e,parentSchema:n,it:r}){n.if===void 0&&(0,t.checkStrictMode)(r,`"${e}" without "if" is ignored`)}}})),wF=G((e=>{Object.defineProperty(e,"__esModule",{value:!0});let t=bF(),n=zre(),r=xF(),i=Bre(),a=Vre(),o=SF(),s=Hre(),c=CF(),l=Ure(),u=Wre(),d=Gre(),f=Kre(),p=qre(),m=Jre(),h=Yre(),g=Xre();function _(e=!1){let _=[d.default,f.default,p.default,m.default,h.default,g.default,s.default,c.default,o.default,l.default,u.default];return e?_.push(n.default,i.default):_.push(t.default,r.default),_.push(a.default),_}e.default=_})),Zre=G((e=>{Object.defineProperty(e,"__esModule",{value:!0});let t=eF();e.default={keyword:`format`,type:[`number`,`string`],schemaType:`string`,$data:!0,error:{message:({schemaCode:e})=>(0,t.str)`must match format "${e}"`,params:({schemaCode:e})=>(0,t._)`{format: ${e}}`},code(e,n){let{gen:r,data:i,$data:a,schema:o,schemaCode:s,it:c}=e,{opts:l,errSchemaPath:u,schemaEnv:d,self:f}=c;if(!l.validateFormats)return;a?p():m();function p(){let a=r.scopeValue(`formats`,{ref:f.formats,code:l.code.formats}),o=r.const(`fDef`,(0,t._)`${a}[${s}]`),c=r.let(`fType`),u=r.let(`format`);r.if((0,t._)`typeof ${o} == "object" && !(${o} instanceof RegExp)`,()=>r.assign(c,(0,t._)`${o}.type || "string"`).assign(u,(0,t._)`${o}.validate`),()=>r.assign(c,(0,t._)`"string"`).assign(u,o)),e.fail$data((0,t.or)(p(),m()));function p(){return l.strictSchema===!1?t.nil:(0,t._)`${s} && !${u}`}function m(){let e=d.$async?(0,t._)`(${o}.async ? await ${u}(${i}) : ${u}(${i}))`:(0,t._)`${u}(${i})`,r=(0,t._)`(typeof ${u} == "function" ? ${e} : ${u}.test(${i}))`;return(0,t._)`${u} && ${u} !== true && ${c} === ${n} && !${r}`}}function m(){let a=f.formats[o];if(!a){m();return}if(a===!0)return;let[s,c,p]=h(a);s===n&&e.pass(g());function m(){if(l.strictSchema===!1){f.logger.warn(e());return}throw Error(e());function e(){return`unknown format "${o}" ignored in schema at path "${u}"`}}function h(e){let n=e instanceof RegExp?(0,t.regexpCode)(e):l.code.formats?(0,t._)`${l.code.formats}${(0,t.getProperty)(o)}`:void 0,i=r.scopeValue(`formats`,{key:o,ref:e,code:n});return typeof e==`object`&&!(e instanceof RegExp)?[e.type||`string`,e.validate,(0,t._)`${i}.validate`]:[`string`,e,i]}function g(){if(typeof a==`object`&&!(a instanceof RegExp)&&a.async){if(!d.$async)throw Error(`async format in sync schema`);return(0,t._)`await ${p}(${i})`}return typeof c==`function`?(0,t._)`${p}(${i})`:(0,t._)`${p}.test(${i})`}}}}})),TF=G((e=>{Object.defineProperty(e,"__esModule",{value:!0}),e.default=[Zre().default]})),EF=G((e=>{Object.defineProperty(e,"__esModule",{value:!0}),e.contentVocabulary=e.metadataVocabulary=void 0,e.metadataVocabulary=[`title`,`description`,`default`,`deprecated`,`readOnly`,`writeOnly`,`examples`],e.contentVocabulary=[`contentMediaType`,`contentEncoding`,`contentSchema`]})),DF=G((e=>{Object.defineProperty(e,"__esModule",{value:!0});let t=_F(),n=yF(),r=wF(),i=TF(),a=EF();e.default=[t.default,n.default,(0,r.default)(),i.default,a.metadataVocabulary,a.contentVocabulary]})),Qre=G((e=>{Object.defineProperty(e,"__esModule",{value:!0}),e.DiscrError=void 0;var t;(function(e){e.Tag=`tag`,e.Mapping=`mapping`})(t||(e.DiscrError=t={}))})),OF=G((e=>{Object.defineProperty(e,"__esModule",{value:!0});let t=eF(),n=Qre(),r=pF(),i=fF(),a=tF();e.default={keyword:`discriminator`,type:`object`,schemaType:`object`,error:{message:({params:{discrError:e,tagName:t}})=>e===n.DiscrError.Tag?`tag "${t}" must be string`:`value of tag "${t}" must be in oneOf`,params:({params:{discrError:e,tag:n,tagName:r}})=>(0,t._)`{error: ${e}, tag: ${r}, tagValue: ${n}}`},code(e){let{gen:o,data:s,schema:c,parentSchema:l,it:u}=e,{oneOf:d}=l;if(!u.opts.discriminator)throw Error(`discriminator: requires discriminator option`);let f=c.propertyName;if(typeof f!=`string`)throw Error(`discriminator: requires propertyName`);if(c.mapping)throw Error(`discriminator: mapping is not supported`);if(!d)throw Error(`discriminator: requires oneOf keyword`);let p=o.let(`valid`,!1),m=o.const(`tag`,(0,t._)`${s}${(0,t.getProperty)(f)}`);o.if((0,t._)`typeof ${m} == "string"`,()=>h(),()=>e.error(!1,{discrError:n.DiscrError.Tag,tag:m,tagName:f})),e.ok(p);function h(){let r=_();o.if(!1);for(let e in r)o.elseIf((0,t._)`${m} === ${e}`),o.assign(p,g(r[e]));o.else(),e.error(!1,{discrError:n.DiscrError.Mapping,tag:m,tagName:f}),o.endIf()}function g(n){let r=o.name(`valid`),i=e.subschema({keyword:`oneOf`,schemaProp:n},r);return e.mergeEvaluated(i,t.Name),r}function _(){let e={},t=o(l),n=!0;for(let e=0;e<d.length;e++){let c=d[e];if(c?.$ref&&!(0,a.schemaHasRulesButRef)(c,u.self.RULES)){let e=c.$ref;if(c=r.resolveRef.call(u.self,u.schemaEnv.root,u.baseId,e),c instanceof r.SchemaEnv&&(c=c.schema),c===void 0)throw new i.default(u.opts.uriResolver,u.baseId,e)}let l=c?.properties?.[f];if(typeof l!=`object`)throw Error(`discriminator: oneOf subschemas (or referenced schemas) must have "properties/${f}"`);n&&=t||o(c),s(l,e)}if(!n)throw Error(`discriminator: "${f}" must be required`);return e;function o({required:e}){return Array.isArray(e)&&e.includes(f)}function s(e,t){if(e.const)c(e.const,t);else if(e.enum)for(let n of e.enum)c(n,t);else throw Error(`discriminator: "properties/${f}" must have "const" or "enum"`)}function c(t,n){if(typeof t!=`string`||t in e)throw Error(`discriminator: "${f}" values must be unique strings`);e[t]=n}}}}})),$re=G(((e,t)=>{t.exports={$schema:`http://json-schema.org/draft-07/schema#`,$id:`http://json-schema.org/draft-07/schema#`,title:`Core schema meta-schema`,definitions:{schemaArray:{type:`array`,minItems:1,items:{$ref:`#`}},nonNegativeInteger:{type:`integer`,minimum:0},nonNegativeIntegerDefault0:{allOf:[{$ref:`#/definitions/nonNegativeInteger`},{default:0}]},simpleTypes:{enum:[`array`,`boolean`,`integer`,`null`,`number`,`object`,`string`]},stringArray:{type:`array`,items:{type:`string`},uniqueItems:!0,default:[]}},type:[`object`,`boolean`],properties:{$id:{type:`string`,format:`uri-reference`},$schema:{type:`string`,format:`uri`},$ref:{type:`string`,format:`uri-reference`},$comment:{type:`string`},title:{type:`string`},description:{type:`string`},default:!0,readOnly:{type:`boolean`,default:!1},examples:{type:`array`,items:!0},multipleOf:{type:`number`,exclusiveMinimum:0},maximum:{type:`number`},exclusiveMaximum:{type:`number`},minimum:{type:`number`},exclusiveMinimum:{type:`number`},maxLength:{$ref:`#/definitions/nonNegativeInteger`},minLength:{$ref:`#/definitions/nonNegativeIntegerDefault0`},pattern:{type:`string`,format:`regex`},additionalItems:{$ref:`#`},items:{anyOf:[{$ref:`#`},{$ref:`#/definitions/schemaArray`}],default:!0},maxItems:{$ref:`#/definitions/nonNegativeInteger`},minItems:{$ref:`#/definitions/nonNegativeIntegerDefault0`},uniqueItems:{type:`boolean`,default:!1},contains:{$ref:`#`},maxProperties:{$ref:`#/definitions/nonNegativeInteger`},minProperties:{$ref:`#/definitions/nonNegativeIntegerDefault0`},required:{$ref:`#/definitions/stringArray`},additionalProperties:{$ref:`#`},definitions:{type:`object`,additionalProperties:{$ref:`#`},default:{}},properties:{type:`object`,additionalProperties:{$ref:`#`},default:{}},patternProperties:{type:`object`,additionalProperties:{$ref:`#`},propertyNames:{format:`regex`},default:{}},dependencies:{type:`object`,additionalProperties:{anyOf:[{$ref:`#`},{$ref:`#/definitions/stringArray`}]}},propertyNames:{$ref:`#`},const:!0,enum:{type:`array`,items:!0,minItems:1,uniqueItems:!0},type:{anyOf:[{$ref:`#/definitions/simpleTypes`},{type:`array`,items:{$ref:`#/definitions/simpleTypes`},minItems:1,uniqueItems:!0}]},format:{type:`string`},contentMediaType:{type:`string`},contentEncoding:{type:`string`},if:{$ref:`#`},then:{$ref:`#`},else:{$ref:`#`},allOf:{$ref:`#/definitions/schemaArray`},anyOf:{$ref:`#/definitions/schemaArray`},oneOf:{$ref:`#/definitions/schemaArray`},not:{$ref:`#`}},default:!0}})),kF=G(((e,t)=>{Object.defineProperty(e,"__esModule",{value:!0}),e.MissingRefError=e.ValidationError=e.CodeGen=e.Name=e.nil=e.stringify=e.str=e._=e.KeywordCxt=e.Ajv=void 0;let n=hF(),r=DF(),i=OF(),a=$re(),o=[`/properties`],s=`http://json-schema.org/draft-07/schema`;var c=class extends n.default{_addVocabularies(){super._addVocabularies(),r.default.forEach(e=>this.addVocabulary(e)),this.opts.discriminator&&this.addKeyword(i.default)}_addDefaultMetaSchema(){if(super._addDefaultMetaSchema(),!this.opts.meta)return;let e=this.opts.$data?this.$dataMetaSchema(a,o):a;this.addMetaSchema(e,s,!1),this.refs[`http://json-schema.org/schema`]=s}defaultMeta(){return this.opts.defaultMeta=super.defaultMeta()||(this.getSchema(s)?s:void 0)}};e.Ajv=c,t.exports=e=c,t.exports.Ajv=c,Object.defineProperty(e,"__esModule",{value:!0}),e.default=c;var l=uF();Object.defineProperty(e,"KeywordCxt",{enumerable:!0,get:function(){return l.KeywordCxt}});var u=eF();Object.defineProperty(e,"_",{enumerable:!0,get:function(){return u._}}),Object.defineProperty(e,"str",{enumerable:!0,get:function(){return u.str}}),Object.defineProperty(e,"stringify",{enumerable:!0,get:function(){return u.stringify}}),Object.defineProperty(e,"nil",{enumerable:!0,get:function(){return u.nil}}),Object.defineProperty(e,"Name",{enumerable:!0,get:function(){return u.Name}}),Object.defineProperty(e,"CodeGen",{enumerable:!0,get:function(){return u.CodeGen}});var d=dF();Object.defineProperty(e,"ValidationError",{enumerable:!0,get:function(){return d.default}});var f=fF();Object.defineProperty(e,"MissingRefError",{enumerable:!0,get:function(){return f.default}})})),AF=G((e=>{Object.defineProperty(e,"__esModule",{value:!0}),e.dynamicAnchor=void 0;let t=eF(),n=nF(),r=pF(),i=gF(),a={keyword:`$dynamicAnchor`,schemaType:`string`,code:e=>o(e,e.schema)};function o(e,r){let{gen:i,it:a}=e;a.schemaEnv.root.dynamicAnchors[r]=!0;let o=(0,t._)`${n.default.dynamicAnchors}${(0,t.getProperty)(r)}`,c=a.errSchemaPath===`#`?a.validateName:s(e);i.if((0,t._)`!${o}`,()=>i.assign(o,c))}e.dynamicAnchor=o;function s(e){let{schemaEnv:t,schema:n,self:a}=e.it,{root:o,baseId:s,localRefs:c,meta:l}=t.root,{schemaId:u}=a.opts,d=new r.SchemaEnv({schema:n,schemaId:u,root:o,baseId:s,localRefs:c,meta:l});return r.compileSchema.call(a,d),(0,i.getValidate)(e,d)}e.default=a})),jF=G((e=>{Object.defineProperty(e,"__esModule",{value:!0}),e.dynamicRef=void 0;let t=eF(),n=nF(),r=gF(),i={keyword:`$dynamicRef`,schemaType:`string`,code:e=>a(e,e.schema)};function a(e,i){let{gen:a,keyword:o,it:s}=e;if(i[0]!==`#`)throw Error(`"${o}" only supports hash fragment reference`);let c=i.slice(1);if(s.allErrors)l();else{let t=a.let(`valid`,!1);l(t),e.ok(t)}function l(e){if(s.schemaEnv.root.dynamicAnchors[c]){let r=a.let(`_v`,(0,t._)`${n.default.dynamicAnchors}${(0,t.getProperty)(c)}`);a.if(r,u(r,e),u(s.validateName,e))}else u(s.validateName,e)()}function u(t,n){return n?()=>a.block(()=>{(0,r.callRef)(e,t),a.let(n,!0)}):()=>(0,r.callRef)(e,t)}}e.dynamicRef=a,e.default=i})),eie=G((e=>{Object.defineProperty(e,"__esModule",{value:!0});let t=AF(),n=tF();e.default={keyword:`$recursiveAnchor`,schemaType:`boolean`,code(e){e.schema?(0,t.dynamicAnchor)(e,``):(0,n.checkStrictMode)(e.it,`$recursiveAnchor: false is ignored`)}}})),tie=G((e=>{Object.defineProperty(e,"__esModule",{value:!0});let t=jF();e.default={keyword:`$recursiveRef`,schemaType:`string`,code:e=>(0,t.dynamicRef)(e,e.schema)}})),MF=G((e=>{Object.defineProperty(e,"__esModule",{value:!0});let t=AF(),n=jF(),r=eie(),i=tie();e.default=[t.default,n.default,r.default,i.default]})),nie=G((e=>{Object.defineProperty(e,"__esModule",{value:!0});let t=SF();e.default={keyword:`dependentRequired`,type:`object`,schemaType:`object`,error:t.error,code:e=>(0,t.validatePropertyDeps)(e)}})),rie=G((e=>{Object.defineProperty(e,"__esModule",{value:!0});let t=SF();e.default={keyword:`dependentSchemas`,type:`object`,schemaType:`object`,code:e=>(0,t.validateSchemaDeps)(e)}})),iie=G((e=>{Object.defineProperty(e,"__esModule",{value:!0});let t=tF();e.default={keyword:[`maxContains`,`minContains`],type:`array`,schemaType:`number`,code({keyword:e,parentSchema:n,it:r}){n.contains===void 0&&(0,t.checkStrictMode)(r,`"${e}" without "contains" is ignored`)}}})),NF=G((e=>{Object.defineProperty(e,"__esModule",{value:!0});let t=nie(),n=rie(),r=iie();e.default=[t.default,n.default,r.default]})),aie=G((e=>{Object.defineProperty(e,"__esModule",{value:!0});let t=eF(),n=tF(),r=nF();e.default={keyword:`unevaluatedProperties`,type:`object`,schemaType:[`boolean`,`object`],trackErrors:!0,error:{message:`must NOT have unevaluated properties`,params:({params:e})=>(0,t._)`{unevaluatedProperty: ${e.unevaluatedProperty}}`},code(e){let{gen:i,schema:a,data:o,errsCount:s,it:c}=e;if(!s)throw Error(`ajv implementation error`);let{allErrors:l,props:u}=c;u instanceof t.Name?i.if((0,t._)`${u} !== true`,()=>i.forIn(`key`,o,e=>i.if(f(u,e),()=>d(e)))):u!==!0&&i.forIn(`key`,o,e=>u===void 0?d(e):i.if(p(u,e),()=>d(e))),c.props=!0,e.ok((0,t._)`${s} === ${r.default.errors}`);function d(r){if(a===!1){e.setParams({unevaluatedProperty:r}),e.error(),l||i.break();return}if(!(0,n.alwaysValidSchema)(c,a)){let a=i.name(`valid`);e.subschema({keyword:`unevaluatedProperties`,dataProp:r,dataPropType:n.Type.Str},a),l||i.if((0,t.not)(a),()=>i.break())}}function f(e,n){return(0,t._)`!${e} || !${e}[${n}]`}function p(e,n){let r=[];for(let i in e)e[i]===!0&&r.push((0,t._)`${n} !== ${i}`);return(0,t.and)(...r)}}}})),oie=G((e=>{Object.defineProperty(e,"__esModule",{value:!0});let t=eF(),n=tF();e.default={keyword:`unevaluatedItems`,type:`array`,schemaType:[`boolean`,`object`],error:{message:({params:{len:e}})=>(0,t.str)`must NOT have more than ${e} items`,params:({params:{len:e}})=>(0,t._)`{limit: ${e}}`},code(e){let{gen:r,schema:i,data:a,it:o}=e,s=o.items||0;if(s===!0)return;let c=r.const(`len`,(0,t._)`${a}.length`);if(i===!1)e.setParams({len:s}),e.fail((0,t._)`${c} > ${s}`);else if(typeof i==`object`&&!(0,n.alwaysValidSchema)(o,i)){let n=r.var(`valid`,(0,t._)`${c} <= ${s}`);r.if((0,t.not)(n),()=>l(n,s)),e.ok(n)}o.items=!0;function l(i,a){r.forRange(`i`,a,c,a=>{e.subschema({keyword:`unevaluatedItems`,dataProp:a,dataPropType:n.Type.Num},i),o.allErrors||r.if((0,t.not)(i),()=>r.break())})}}}})),PF=G((e=>{Object.defineProperty(e,"__esModule",{value:!0});let t=aie(),n=oie();e.default=[t.default,n.default]})),sie=G(((e,t)=>{t.exports={$schema:`https://json-schema.org/draft/2019-09/schema`,$id:`https://json-schema.org/draft/2019-09/schema`,$vocabulary:{"https://json-schema.org/draft/2019-09/vocab/core":!0,"https://json-schema.org/draft/2019-09/vocab/applicator":!0,"https://json-schema.org/draft/2019-09/vocab/validation":!0,"https://json-schema.org/draft/2019-09/vocab/meta-data":!0,"https://json-schema.org/draft/2019-09/vocab/format":!1,"https://json-schema.org/draft/2019-09/vocab/content":!0},$recursiveAnchor:!0,title:`Core and Validation specifications meta-schema`,allOf:[{$ref:`meta/core`},{$ref:`meta/applicator`},{$ref:`meta/validation`},{$ref:`meta/meta-data`},{$ref:`meta/format`},{$ref:`meta/content`}],type:[`object`,`boolean`],properties:{definitions:{$comment:`While no longer an official keyword as it is replaced by $defs, this keyword is retained in the meta-schema to prevent incompatible extensions as it remains in common use.`,type:`object`,additionalProperties:{$recursiveRef:`#`},default:{}},dependencies:{$comment:`"dependencies" is no longer a keyword, but schema authors should avoid redefining it to facilitate a smooth transition to "dependentSchemas" and "dependentRequired"`,type:`object`,additionalProperties:{anyOf:[{$recursiveRef:`#`},{$ref:`meta/validation#/$defs/stringArray`}]}}}}})),cie=G(((e,t)=>{t.exports={$schema:`https://json-schema.org/draft/2019-09/schema`,$id:`https://json-schema.org/draft/2019-09/meta/applicator`,$vocabulary:{"https://json-schema.org/draft/2019-09/vocab/applicator":!0},$recursiveAnchor:!0,title:`Applicator vocabulary meta-schema`,type:[`object`,`boolean`],properties:{additionalItems:{$recursiveRef:`#`},unevaluatedItems:{$recursiveRef:`#`},items:{anyOf:[{$recursiveRef:`#`},{$ref:`#/$defs/schemaArray`}]},contains:{$recursiveRef:`#`},additionalProperties:{$recursiveRef:`#`},unevaluatedProperties:{$recursiveRef:`#`},properties:{type:`object`,additionalProperties:{$recursiveRef:`#`},default:{}},patternProperties:{type:`object`,additionalProperties:{$recursiveRef:`#`},propertyNames:{format:`regex`},default:{}},dependentSchemas:{type:`object`,additionalProperties:{$recursiveRef:`#`}},propertyNames:{$recursiveRef:`#`},if:{$recursiveRef:`#`},then:{$recursiveRef:`#`},else:{$recursiveRef:`#`},allOf:{$ref:`#/$defs/schemaArray`},anyOf:{$ref:`#/$defs/schemaArray`},oneOf:{$ref:`#/$defs/schemaArray`},not:{$recursiveRef:`#`}},$defs:{schemaArray:{type:`array`,minItems:1,items:{$recursiveRef:`#`}}}}})),lie=G(((e,t)=>{t.exports={$schema:`https://json-schema.org/draft/2019-09/schema`,$id:`https://json-schema.org/draft/2019-09/meta/content`,$vocabulary:{"https://json-schema.org/draft/2019-09/vocab/content":!0},$recursiveAnchor:!0,title:`Content vocabulary meta-schema`,type:[`object`,`boolean`],properties:{contentMediaType:{type:`string`},contentEncoding:{type:`string`},contentSchema:{$recursiveRef:`#`}}}})),uie=G(((e,t)=>{t.exports={$schema:`https://json-schema.org/draft/2019-09/schema`,$id:`https://json-schema.org/draft/2019-09/meta/core`,$vocabulary:{"https://json-schema.org/draft/2019-09/vocab/core":!0},$recursiveAnchor:!0,title:`Core vocabulary meta-schema`,type:[`object`,`boolean`],properties:{$id:{type:`string`,format:`uri-reference`,$comment:`Non-empty fragments not allowed.`,pattern:`^[^#]*#?$`},$schema:{type:`string`,format:`uri`},$anchor:{type:`string`,pattern:`^[A-Za-z][-A-Za-z0-9.:_]*$`},$ref:{type:`string`,format:`uri-reference`},$recursiveRef:{type:`string`,format:`uri-reference`},$recursiveAnchor:{type:`boolean`,default:!1},$vocabulary:{type:`object`,propertyNames:{type:`string`,format:`uri`},additionalProperties:{type:`boolean`}},$comment:{type:`string`},$defs:{type:`object`,additionalProperties:{$recursiveRef:`#`},default:{}}}}})),die=G(((e,t)=>{t.exports={$schema:`https://json-schema.org/draft/2019-09/schema`,$id:`https://json-schema.org/draft/2019-09/meta/format`,$vocabulary:{"https://json-schema.org/draft/2019-09/vocab/format":!0},$recursiveAnchor:!0,title:`Format vocabulary meta-schema`,type:[`object`,`boolean`],properties:{format:{type:`string`}}}})),fie=G(((e,t)=>{t.exports={$schema:`https://json-schema.org/draft/2019-09/schema`,$id:`https://json-schema.org/draft/2019-09/meta/meta-data`,$vocabulary:{"https://json-schema.org/draft/2019-09/vocab/meta-data":!0},$recursiveAnchor:!0,title:`Meta-data vocabulary meta-schema`,type:[`object`,`boolean`],properties:{title:{type:`string`},description:{type:`string`},default:!0,deprecated:{type:`boolean`,default:!1},readOnly:{type:`boolean`,default:!1},writeOnly:{type:`boolean`,default:!1},examples:{type:`array`,items:!0}}}})),pie=G(((e,t)=>{t.exports={$schema:`https://json-schema.org/draft/2019-09/schema`,$id:`https://json-schema.org/draft/2019-09/meta/validation`,$vocabulary:{"https://json-schema.org/draft/2019-09/vocab/validation":!0},$recursiveAnchor:!0,title:`Validation vocabulary meta-schema`,type:[`object`,`boolean`],properties:{multipleOf:{type:`number`,exclusiveMinimum:0},maximum:{type:`number`},exclusiveMaximum:{type:`number`},minimum:{type:`number`},exclusiveMinimum:{type:`number`},maxLength:{$ref:`#/$defs/nonNegativeInteger`},minLength:{$ref:`#/$defs/nonNegativeIntegerDefault0`},pattern:{type:`string`,format:`regex`},maxItems:{$ref:`#/$defs/nonNegativeInteger`},minItems:{$ref:`#/$defs/nonNegativeIntegerDefault0`},uniqueItems:{type:`boolean`,default:!1},maxContains:{$ref:`#/$defs/nonNegativeInteger`},minContains:{$ref:`#/$defs/nonNegativeInteger`,default:1},maxProperties:{$ref:`#/$defs/nonNegativeInteger`},minProperties:{$ref:`#/$defs/nonNegativeIntegerDefault0`},required:{$ref:`#/$defs/stringArray`},dependentRequired:{type:`object`,additionalProperties:{$ref:`#/$defs/stringArray`}},const:!0,enum:{type:`array`,items:!0},type:{anyOf:[{$ref:`#/$defs/simpleTypes`},{type:`array`,items:{$ref:`#/$defs/simpleTypes`},minItems:1,uniqueItems:!0}]}},$defs:{nonNegativeInteger:{type:`integer`,minimum:0},nonNegativeIntegerDefault0:{$ref:`#/$defs/nonNegativeInteger`,default:0},simpleTypes:{enum:[`array`,`boolean`,`integer`,`null`,`number`,`object`,`string`]},stringArray:{type:`array`,items:{type:`string`},uniqueItems:!0,default:[]}}}})),mie=G((e=>{Object.defineProperty(e,"__esModule",{value:!0});let t=sie(),n=cie(),r=lie(),i=uie(),a=die(),o=fie(),s=pie(),c=[`/properties`];function l(e){return[t,n,r,i,l(this,a),o,l(this,s)].forEach(e=>this.addMetaSchema(e,void 0,!1)),this;function l(t,n){return e?t.$dataMetaSchema(n,c):n}}e.default=l})),hie=G(((e,t)=>{Object.defineProperty(e,"__esModule",{value:!0}),e.MissingRefError=e.ValidationError=e.CodeGen=e.Name=e.nil=e.stringify=e.str=e._=e.KeywordCxt=e.Ajv2019=void 0;let n=hF(),r=DF(),i=MF(),a=NF(),o=PF(),s=OF(),c=mie(),l=`https://json-schema.org/draft/2019-09/schema`;var u=class extends n.default{constructor(e={}){super({...e,dynamicRef:!0,next:!0,unevaluated:!0})}_addVocabularies(){super._addVocabularies(),this.addVocabulary(i.default),r.default.forEach(e=>this.addVocabulary(e)),this.addVocabulary(a.default),this.addVocabulary(o.default),this.opts.discriminator&&this.addKeyword(s.default)}_addDefaultMetaSchema(){super._addDefaultMetaSchema();let{$data:e,meta:t}=this.opts;t&&(c.default.call(this,e),this.refs[`http://json-schema.org/schema`]=l)}defaultMeta(){return this.opts.defaultMeta=super.defaultMeta()||(this.getSchema(l)?l:void 0)}};e.Ajv2019=u,t.exports=e=u,t.exports.Ajv2019=u,Object.defineProperty(e,"__esModule",{value:!0}),e.default=u;var d=uF();Object.defineProperty(e,"KeywordCxt",{enumerable:!0,get:function(){return d.KeywordCxt}});var f=eF();Object.defineProperty(e,"_",{enumerable:!0,get:function(){return f._}}),Object.defineProperty(e,"str",{enumerable:!0,get:function(){return f.str}}),Object.defineProperty(e,"stringify",{enumerable:!0,get:function(){return f.stringify}}),Object.defineProperty(e,"nil",{enumerable:!0,get:function(){return f.nil}}),Object.defineProperty(e,"Name",{enumerable:!0,get:function(){return f.Name}}),Object.defineProperty(e,"CodeGen",{enumerable:!0,get:function(){return f.CodeGen}});var p=dF();Object.defineProperty(e,"ValidationError",{enumerable:!0,get:function(){return p.default}});var m=fF();Object.defineProperty(e,"MissingRefError",{enumerable:!0,get:function(){return m.default}})})),gie=G((e=>{Object.defineProperty(e,"__esModule",{value:!0});let t=_F(),n=yF(),r=wF(),i=MF(),a=NF(),o=PF(),s=TF(),c=EF();e.default=[i.default,t.default,n.default,(0,r.default)(!0),s.default,c.metadataVocabulary,c.contentVocabulary,a.default,o.default]})),_ie=G(((e,t)=>{t.exports={$schema:`https://json-schema.org/draft/2020-12/schema`,$id:`https://json-schema.org/draft/2020-12/schema`,$vocabulary:{"https://json-schema.org/draft/2020-12/vocab/core":!0,"https://json-schema.org/draft/2020-12/vocab/applicator":!0,"https://json-schema.org/draft/2020-12/vocab/unevaluated":!0,"https://json-schema.org/draft/2020-12/vocab/validation":!0,"https://json-schema.org/draft/2020-12/vocab/meta-data":!0,"https://json-schema.org/draft/2020-12/vocab/format-annotation":!0,"https://json-schema.org/draft/2020-12/vocab/content":!0},$dynamicAnchor:`meta`,title:`Core and Validation specifications meta-schema`,allOf:[{$ref:`meta/core`},{$ref:`meta/applicator`},{$ref:`meta/unevaluated`},{$ref:`meta/validation`},{$ref:`meta/meta-data`},{$ref:`meta/format-annotation`},{$ref:`meta/content`}],type:[`object`,`boolean`],$comment:`This meta-schema also defines keywords that have appeared in previous drafts in order to prevent incompatible extensions as they remain in common use.`,properties:{definitions:{$comment:`"definitions" has been replaced by "$defs".`,type:`object`,additionalProperties:{$dynamicRef:`#meta`},deprecated:!0,default:{}},dependencies:{$comment:`"dependencies" has been split and replaced by "dependentSchemas" and "dependentRequired" in order to serve their differing semantics.`,type:`object`,additionalProperties:{anyOf:[{$dynamicRef:`#meta`},{$ref:`meta/validation#/$defs/stringArray`}]},deprecated:!0,default:{}},$recursiveAnchor:{$comment:`"$recursiveAnchor" has been replaced by "$dynamicAnchor".`,$ref:`meta/core#/$defs/anchorString`,deprecated:!0},$recursiveRef:{$comment:`"$recursiveRef" has been replaced by "$dynamicRef".`,$ref:`meta/core#/$defs/uriReferenceString`,deprecated:!0}}}})),vie=G(((e,t)=>{t.exports={$schema:`https://json-schema.org/draft/2020-12/schema`,$id:`https://json-schema.org/draft/2020-12/meta/applicator`,$vocabulary:{"https://json-schema.org/draft/2020-12/vocab/applicator":!0},$dynamicAnchor:`meta`,title:`Applicator vocabulary meta-schema`,type:[`object`,`boolean`],properties:{prefixItems:{$ref:`#/$defs/schemaArray`},items:{$dynamicRef:`#meta`},contains:{$dynamicRef:`#meta`},additionalProperties:{$dynamicRef:`#meta`},properties:{type:`object`,additionalProperties:{$dynamicRef:`#meta`},default:{}},patternProperties:{type:`object`,additionalProperties:{$dynamicRef:`#meta`},propertyNames:{format:`regex`},default:{}},dependentSchemas:{type:`object`,additionalProperties:{$dynamicRef:`#meta`},default:{}},propertyNames:{$dynamicRef:`#meta`},if:{$dynamicRef:`#meta`},then:{$dynamicRef:`#meta`},else:{$dynamicRef:`#meta`},allOf:{$ref:`#/$defs/schemaArray`},anyOf:{$ref:`#/$defs/schemaArray`},oneOf:{$ref:`#/$defs/schemaArray`},not:{$dynamicRef:`#meta`}},$defs:{schemaArray:{type:`array`,minItems:1,items:{$dynamicRef:`#meta`}}}}})),yie=G(((e,t)=>{t.exports={$schema:`https://json-schema.org/draft/2020-12/schema`,$id:`https://json-schema.org/draft/2020-12/meta/unevaluated`,$vocabulary:{"https://json-schema.org/draft/2020-12/vocab/unevaluated":!0},$dynamicAnchor:`meta`,title:`Unevaluated applicator vocabulary meta-schema`,type:[`object`,`boolean`],properties:{unevaluatedItems:{$dynamicRef:`#meta`},unevaluatedProperties:{$dynamicRef:`#meta`}}}})),bie=G(((e,t)=>{t.exports={$schema:`https://json-schema.org/draft/2020-12/schema`,$id:`https://json-schema.org/draft/2020-12/meta/content`,$vocabulary:{"https://json-schema.org/draft/2020-12/vocab/content":!0},$dynamicAnchor:`meta`,title:`Content vocabulary meta-schema`,type:[`object`,`boolean`],properties:{contentEncoding:{type:`string`},contentMediaType:{type:`string`},contentSchema:{$dynamicRef:`#meta`}}}})),xie=G(((e,t)=>{t.exports={$schema:`https://json-schema.org/draft/2020-12/schema`,$id:`https://json-schema.org/draft/2020-12/meta/core`,$vocabulary:{"https://json-schema.org/draft/2020-12/vocab/core":!0},$dynamicAnchor:`meta`,title:`Core vocabulary meta-schema`,type:[`object`,`boolean`],properties:{$id:{$ref:`#/$defs/uriReferenceString`,$comment:`Non-empty fragments not allowed.`,pattern:`^[^#]*#?$`},$schema:{$ref:`#/$defs/uriString`},$ref:{$ref:`#/$defs/uriReferenceString`},$anchor:{$ref:`#/$defs/anchorString`},$dynamicRef:{$ref:`#/$defs/uriReferenceString`},$dynamicAnchor:{$ref:`#/$defs/anchorString`},$vocabulary:{type:`object`,propertyNames:{$ref:`#/$defs/uriString`},additionalProperties:{type:`boolean`}},$comment:{type:`string`},$defs:{type:`object`,additionalProperties:{$dynamicRef:`#meta`}}},$defs:{anchorString:{type:`string`,pattern:`^[A-Za-z_][-A-Za-z0-9._]*$`},uriString:{type:`string`,format:`uri`},uriReferenceString:{type:`string`,format:`uri-reference`}}}})),Sie=G(((e,t)=>{t.exports={$schema:`https://json-schema.org/draft/2020-12/schema`,$id:`https://json-schema.org/draft/2020-12/meta/format-annotation`,$vocabulary:{"https://json-schema.org/draft/2020-12/vocab/format-annotation":!0},$dynamicAnchor:`meta`,title:`Format vocabulary meta-schema for annotation results`,type:[`object`,`boolean`],properties:{format:{type:`string`}}}})),Cie=G(((e,t)=>{t.exports={$schema:`https://json-schema.org/draft/2020-12/schema`,$id:`https://json-schema.org/draft/2020-12/meta/meta-data`,$vocabulary:{"https://json-schema.org/draft/2020-12/vocab/meta-data":!0},$dynamicAnchor:`meta`,title:`Meta-data vocabulary meta-schema`,type:[`object`,`boolean`],properties:{title:{type:`string`},description:{type:`string`},default:!0,deprecated:{type:`boolean`,default:!1},readOnly:{type:`boolean`,default:!1},writeOnly:{type:`boolean`,default:!1},examples:{type:`array`,items:!0}}}})),wie=G(((e,t)=>{t.exports={$schema:`https://json-schema.org/draft/2020-12/schema`,$id:`https://json-schema.org/draft/2020-12/meta/validation`,$vocabulary:{"https://json-schema.org/draft/2020-12/vocab/validation":!0},$dynamicAnchor:`meta`,title:`Validation vocabulary meta-schema`,type:[`object`,`boolean`],properties:{type:{anyOf:[{$ref:`#/$defs/simpleTypes`},{type:`array`,items:{$ref:`#/$defs/simpleTypes`},minItems:1,uniqueItems:!0}]},const:!0,enum:{type:`array`,items:!0},multipleOf:{type:`number`,exclusiveMinimum:0},maximum:{type:`number`},exclusiveMaximum:{type:`number`},minimum:{type:`number`},exclusiveMinimum:{type:`number`},maxLength:{$ref:`#/$defs/nonNegativeInteger`},minLength:{$ref:`#/$defs/nonNegativeIntegerDefault0`},pattern:{type:`string`,format:`regex`},maxItems:{$ref:`#/$defs/nonNegativeInteger`},minItems:{$ref:`#/$defs/nonNegativeIntegerDefault0`},uniqueItems:{type:`boolean`,default:!1},maxContains:{$ref:`#/$defs/nonNegativeInteger`},minContains:{$ref:`#/$defs/nonNegativeInteger`,default:1},maxProperties:{$ref:`#/$defs/nonNegativeInteger`},minProperties:{$ref:`#/$defs/nonNegativeIntegerDefault0`},required:{$ref:`#/$defs/stringArray`},dependentRequired:{type:`object`,additionalProperties:{$ref:`#/$defs/stringArray`}}},$defs:{nonNegativeInteger:{type:`integer`,minimum:0},nonNegativeIntegerDefault0:{$ref:`#/$defs/nonNegativeInteger`,default:0},simpleTypes:{enum:[`array`,`boolean`,`integer`,`null`,`number`,`object`,`string`]},stringArray:{type:`array`,items:{type:`string`},uniqueItems:!0,default:[]}}}})),Tie=G((e=>{Object.defineProperty(e,"__esModule",{value:!0});let t=_ie(),n=vie(),r=yie(),i=bie(),a=xie(),o=Sie(),s=Cie(),c=wie(),l=[`/properties`];function u(e){return[t,n,r,i,a,u(this,o),s,u(this,c)].forEach(e=>this.addMetaSchema(e,void 0,!1)),this;function u(t,n){return e?t.$dataMetaSchema(n,l):n}}e.default=u})),Eie=G(((e,t)=>{Object.defineProperty(e,"__esModule",{value:!0}),e.MissingRefError=e.ValidationError=e.CodeGen=e.Name=e.nil=e.stringify=e.str=e._=e.KeywordCxt=e.Ajv2020=void 0;let n=hF(),r=gie(),i=OF(),a=Tie(),o=`https://json-schema.org/draft/2020-12/schema`;var s=class extends n.default{constructor(e={}){super({...e,dynamicRef:!0,next:!0,unevaluated:!0})}_addVocabularies(){super._addVocabularies(),r.default.forEach(e=>this.addVocabulary(e)),this.opts.discriminator&&this.addKeyword(i.default)}_addDefaultMetaSchema(){super._addDefaultMetaSchema();let{$data:e,meta:t}=this.opts;t&&(a.default.call(this,e),this.refs[`http://json-schema.org/schema`]=o)}defaultMeta(){return this.opts.defaultMeta=super.defaultMeta()||(this.getSchema(o)?o:void 0)}};e.Ajv2020=s,t.exports=e=s,t.exports.Ajv2020=s,Object.defineProperty(e,"__esModule",{value:!0}),e.default=s;var c=uF();Object.defineProperty(e,"KeywordCxt",{enumerable:!0,get:function(){return c.KeywordCxt}});var l=eF();Object.defineProperty(e,"_",{enumerable:!0,get:function(){return l._}}),Object.defineProperty(e,"str",{enumerable:!0,get:function(){return l.str}}),Object.defineProperty(e,"stringify",{enumerable:!0,get:function(){return l.stringify}}),Object.defineProperty(e,"nil",{enumerable:!0,get:function(){return l.nil}}),Object.defineProperty(e,"Name",{enumerable:!0,get:function(){return l.Name}}),Object.defineProperty(e,"CodeGen",{enumerable:!0,get:function(){return l.CodeGen}});var u=dF();Object.defineProperty(e,"ValidationError",{enumerable:!0,get:function(){return u.default}});var d=fF();Object.defineProperty(e,"MissingRefError",{enumerable:!0,get:function(){return d.default}})})),Die=G((e=>{Object.defineProperty(e,"__esModule",{value:!0}),e.formatNames=e.fastFormats=e.fullFormats=void 0;function t(e,t){return{validate:e,compare:t}}e.fullFormats={date:t(a,o),time:t(c(!0),l),"date-time":t(f(!0),p),"iso-time":t(c(),u),"iso-date-time":t(f(),m),duration:/^P(?!$)((\d+Y)?(\d+M)?(\d+D)?(T(?=\d)(\d+H)?(\d+M)?(\d+S)?)?|(\d+W)?)$/,uri:_,"uri-reference":/^(?:[a-z][a-z0-9+\-.]*:)?(?:\/?\/(?:(?:[a-z0-9\-._~!$&'()*+,;=:]|%[0-9a-f]{2})*@)?(?:\[(?:(?:(?:(?:[0-9a-f]{1,4}:){6}|::(?:[0-9a-f]{1,4}:){5}|(?:[0-9a-f]{1,4})?::(?:[0-9a-f]{1,4}:){4}|(?:(?:[0-9a-f]{1,4}:){0,1}[0-9a-f]{1,4})?::(?:[0-9a-f]{1,4}:){3}|(?:(?:[0-9a-f]{1,4}:){0,2}[0-9a-f]{1,4})?::(?:[0-9a-f]{1,4}:){2}|(?:(?:[0-9a-f]{1,4}:){0,3}[0-9a-f]{1,4})?::[0-9a-f]{1,4}:|(?:(?:[0-9a-f]{1,4}:){0,4}[0-9a-f]{1,4})?::)(?:[0-9a-f]{1,4}:[0-9a-f]{1,4}|(?:(?:25[0-5]|2[0-4]\d|[01]?\d\d?)\.){3}(?:25[0-5]|2[0-4]\d|[01]?\d\d?))|(?:(?:[0-9a-f]{1,4}:){0,5}[0-9a-f]{1,4})?::[0-9a-f]{1,4}|(?:(?:[0-9a-f]{1,4}:){0,6}[0-9a-f]{1,4})?::)|[Vv][0-9a-f]+\.[a-z0-9\-._~!$&'()*+,;=:]+)\]|(?:(?:25[0-5]|2[0-4]\d|[01]?\d\d?)\.){3}(?:25[0-5]|2[0-4]\d|[01]?\d\d?)|(?:[a-z0-9\-._~!$&'"()*+,;=]|%[0-9a-f]{2})*)(?::\d*)?(?:\/(?:[a-z0-9\-._~!$&'"()*+,;=:@]|%[0-9a-f]{2})*)*|\/(?:(?:[a-z0-9\-._~!$&'"()*+,;=:@]|%[0-9a-f]{2})+(?:\/(?:[a-z0-9\-._~!$&'"()*+,;=:@]|%[0-9a-f]{2})*)*)?|(?:[a-z0-9\-._~!$&'"()*+,;=:@]|%[0-9a-f]{2})+(?:\/(?:[a-z0-9\-._~!$&'"()*+,;=:@]|%[0-9a-f]{2})*)*)?(?:\?(?:[a-z0-9\-._~!$&'"()*+,;=:@/?]|%[0-9a-f]{2})*)?(?:#(?:[a-z0-9\-._~!$&'"()*+,;=:@/?]|%[0-9a-f]{2})*)?$/i,"uri-template":/^(?:(?:[^\x00-\x20"'<>%\\^`{|}]|%[0-9a-f]{2})|\{[+#./;?&=,!@|]?(?:[a-z0-9_]|%[0-9a-f]{2})+(?::[1-9][0-9]{0,3}|\*)?(?:,(?:[a-z0-9_]|%[0-9a-f]{2})+(?::[1-9][0-9]{0,3}|\*)?)*\})*$/i,url:/^(?:https?|ftp):\/\/(?:\S+(?::\S*)?@)?(?:(?!(?:10|127)(?:\.\d{1,3}){3})(?!(?:169\.254|192\.168)(?:\.\d{1,3}){2})(?!172\.(?:1[6-9]|2\d|3[0-1])(?:\.\d{1,3}){2})(?:[1-9]\d?|1\d\d|2[01]\d|22[0-3])(?:\.(?:1?\d{1,2}|2[0-4]\d|25[0-5])){2}(?:\.(?:[1-9]\d?|1\d\d|2[0-4]\d|25[0-4]))|(?:(?:[a-z0-9\u{00a1}-\u{ffff}]+-)*[a-z0-9\u{00a1}-\u{ffff}]+)(?:\.(?:[a-z0-9\u{00a1}-\u{ffff}]+-)*[a-z0-9\u{00a1}-\u{ffff}]+)*(?:\.(?:[a-z\u{00a1}-\u{ffff}]{2,})))(?::\d{2,5})?(?:\/[^\s]*)?$/iu,email:/^[a-z0-9!#$%&'*+/=?^_`{|}~-]+(?:\.[a-z0-9!#$%&'*+/=?^_`{|}~-]+)*@(?:[a-z0-9](?:[a-z0-9-]*[a-z0-9])?\.)+[a-z0-9](?:[a-z0-9-]*[a-z0-9])?$/i,hostname:/^(?=.{1,253}\.?$)[a-z0-9](?:[a-z0-9-]{0,61}[a-z0-9])?(?:\.[a-z0-9](?:[-0-9a-z]{0,61}[0-9a-z])?)*\.?$/i,ipv4:/^(?:(?:25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)\.){3}(?:25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)$/,ipv6:/^((([0-9a-f]{1,4}:){7}([0-9a-f]{1,4}|:))|(([0-9a-f]{1,4}:){6}(:[0-9a-f]{1,4}|((25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)(\.(25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)){3})|:))|(([0-9a-f]{1,4}:){5}(((:[0-9a-f]{1,4}){1,2})|:((25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)(\.(25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)){3})|:))|(([0-9a-f]{1,4}:){4}(((:[0-9a-f]{1,4}){1,3})|((:[0-9a-f]{1,4})?:((25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)(\.(25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)){3}))|:))|(([0-9a-f]{1,4}:){3}(((:[0-9a-f]{1,4}){1,4})|((:[0-9a-f]{1,4}){0,2}:((25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)(\.(25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)){3}))|:))|(([0-9a-f]{1,4}:){2}(((:[0-9a-f]{1,4}){1,5})|((:[0-9a-f]{1,4}){0,3}:((25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)(\.(25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)){3}))|:))|(([0-9a-f]{1,4}:){1}(((:[0-9a-f]{1,4}){1,6})|((:[0-9a-f]{1,4}){0,4}:((25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)(\.(25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)){3}))|:))|(:(((:[0-9a-f]{1,4}){1,7})|((:[0-9a-f]{1,4}){0,5}:((25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)(\.(25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)){3}))|:)))$/i,regex:E,uuid:/^(?:urn:uuid:)?[0-9a-f]{8}-(?:[0-9a-f]{4}-){3}[0-9a-f]{12}$/i,"json-pointer":/^(?:\/(?:[^~/]|~0|~1)*)*$/,"json-pointer-uri-fragment":/^#(?:\/(?:[a-z0-9_\-.!$&'()*+,;:=@]|%[0-9a-f]{2}|~0|~1)*)*$/i,"relative-json-pointer":/^(?:0|[1-9][0-9]*)(?:#|(?:\/(?:[^~/]|~0|~1)*)*)$/,byte:y,int32:{type:`number`,validate:S},int64:{type:`number`,validate:C},float:{type:`number`,validate:w},double:{type:`number`,validate:w},password:!0,binary:!0},e.fastFormats={...e.fullFormats,date:t(/^\d\d\d\d-[0-1]\d-[0-3]\d$/,o),time:t(/^(?:[0-2]\d:[0-5]\d:[0-5]\d|23:59:60)(?:\.\d+)?(?:z|[+-]\d\d(?::?\d\d)?)$/i,l),"date-time":t(/^\d\d\d\d-[0-1]\d-[0-3]\dt(?:[0-2]\d:[0-5]\d:[0-5]\d|23:59:60)(?:\.\d+)?(?:z|[+-]\d\d(?::?\d\d)?)$/i,p),"iso-time":t(/^(?:[0-2]\d:[0-5]\d:[0-5]\d|23:59:60)(?:\.\d+)?(?:z|[+-]\d\d(?::?\d\d)?)?$/i,u),"iso-date-time":t(/^\d\d\d\d-[0-1]\d-[0-3]\d[t\s](?:[0-2]\d:[0-5]\d:[0-5]\d|23:59:60)(?:\.\d+)?(?:z|[+-]\d\d(?::?\d\d)?)?$/i,m),uri:/^(?:[a-z][a-z0-9+\-.]*:)(?:\/?\/)?[^\s]*$/i,"uri-reference":/^(?:(?:[a-z][a-z0-9+\-.]*:)?\/?\/)?(?:[^\\\s#][^\s#]*)?(?:#[^\\\s]*)?$/i,email:/^[a-z0-9.!#$%&'*+/=?^_`{|}~-]+@[a-z0-9](?:[a-z0-9-]{0,61}[a-z0-9])?(?:\.[a-z0-9](?:[a-z0-9-]{0,61}[a-z0-9])?)*$/i},e.formatNames=Object.keys(e.fullFormats);function n(e){return e%4==0&&(e%100!=0||e%400==0)}let r=/^(\d\d\d\d)-(\d\d)-(\d\d)$/,i=[0,31,28,31,30,31,30,31,31,30,31,30,31];function a(e){let t=r.exec(e);if(!t)return!1;let a=+t[1],o=+t[2],s=+t[3];return o>=1&&o<=12&&s>=1&&s<=(o===2&&n(a)?29:i[o])}function o(e,t){if(e&&t)return e>t?1:e<t?-1:0}let s=/^(\d\d):(\d\d):(\d\d(?:\.\d+)?)(z|([+-])(\d\d)(?::?(\d\d))?)?$/i;function c(e){return function(t){let n=s.exec(t);if(!n)return!1;let r=+n[1],i=+n[2],a=+n[3],o=n[4],c=n[5]===`-`?-1:1,l=+(n[6]||0),u=+(n[7]||0);if(l>23||u>59||e&&!o)return!1;if(r<=23&&i<=59&&a<60)return!0;let d=i-u*c,f=r-l*c-+(d<0);return(f===23||f===-1)&&(d===59||d===-1)&&a<61}}function l(e,t){if(!(e&&t))return;let n=new Date(`2020-01-01T`+e).valueOf(),r=new Date(`2020-01-01T`+t).valueOf();if(n&&r)return n-r}function u(e,t){if(!(e&&t))return;let n=s.exec(e),r=s.exec(t);if(n&&r)return e=n[1]+n[2]+n[3],t=r[1]+r[2]+r[3],e>t?1:e<t?-1:0}let d=/t|\s/i;function f(e){let t=c(e);return function(e){let n=e.split(d);return n.length===2&&a(n[0])&&t(n[1])}}function p(e,t){if(!(e&&t))return;let n=new Date(e).valueOf(),r=new Date(t).valueOf();if(n&&r)return n-r}function m(e,t){if(!(e&&t))return;let[n,r]=e.split(d),[i,a]=t.split(d),s=o(n,i);if(s!==void 0)return s||l(r,a)}let h=/\/|:/,g=/^(?:[a-z][a-z0-9+\-.]*:)(?:\/?\/(?:(?:[a-z0-9\-._~!$&'()*+,;=:]|%[0-9a-f]{2})*@)?(?:\[(?:(?:(?:(?:[0-9a-f]{1,4}:){6}|::(?:[0-9a-f]{1,4}:){5}|(?:[0-9a-f]{1,4})?::(?:[0-9a-f]{1,4}:){4}|(?:(?:[0-9a-f]{1,4}:){0,1}[0-9a-f]{1,4})?::(?:[0-9a-f]{1,4}:){3}|(?:(?:[0-9a-f]{1,4}:){0,2}[0-9a-f]{1,4})?::(?:[0-9a-f]{1,4}:){2}|(?:(?:[0-9a-f]{1,4}:){0,3}[0-9a-f]{1,4})?::[0-9a-f]{1,4}:|(?:(?:[0-9a-f]{1,4}:){0,4}[0-9a-f]{1,4})?::)(?:[0-9a-f]{1,4}:[0-9a-f]{1,4}|(?:(?:25[0-5]|2[0-4]\d|[01]?\d\d?)\.){3}(?:25[0-5]|2[0-4]\d|[01]?\d\d?))|(?:(?:[0-9a-f]{1,4}:){0,5}[0-9a-f]{1,4})?::[0-9a-f]{1,4}|(?:(?:[0-9a-f]{1,4}:){0,6}[0-9a-f]{1,4})?::)|[Vv][0-9a-f]+\.[a-z0-9\-._~!$&'()*+,;=:]+)\]|(?:(?:25[0-5]|2[0-4]\d|[01]?\d\d?)\.){3}(?:25[0-5]|2[0-4]\d|[01]?\d\d?)|(?:[a-z0-9\-._~!$&'()*+,;=]|%[0-9a-f]{2})*)(?::\d*)?(?:\/(?:[a-z0-9\-._~!$&'()*+,;=:@]|%[0-9a-f]{2})*)*|\/(?:(?:[a-z0-9\-._~!$&'()*+,;=:@]|%[0-9a-f]{2})+(?:\/(?:[a-z0-9\-._~!$&'()*+,;=:@]|%[0-9a-f]{2})*)*)?|(?:[a-z0-9\-._~!$&'()*+,;=:@]|%[0-9a-f]{2})+(?:\/(?:[a-z0-9\-._~!$&'()*+,;=:@]|%[0-9a-f]{2})*)*)(?:\?(?:[a-z0-9\-._~!$&'()*+,;=:@/?]|%[0-9a-f]{2})*)?(?:#(?:[a-z0-9\-._~!$&'()*+,;=:@/?]|%[0-9a-f]{2})*)?$/i;function _(e){return h.test(e)&&g.test(e)}let v=/^(?:[A-Za-z0-9+/]{4})*(?:[A-Za-z0-9+/]{2}==|[A-Za-z0-9+/]{3}=)?$/gm;function y(e){return v.lastIndex=0,v.test(e)}let b=-(2**31),x=2**31-1;function S(e){return Number.isInteger(e)&&e<=x&&e>=b}function C(e){return Number.isInteger(e)}function w(){return!0}let T=/[^\\]\\Z/;function E(e){if(T.test(e))return!1;try{return new RegExp(e),!0}catch{return!1}}})),Oie=G((e=>{Object.defineProperty(e,"__esModule",{value:!0}),e.formatLimitDefinition=void 0;let t=kF(),n=eF(),r=n.operators,i={formatMaximum:{okStr:`<=`,ok:r.LTE,fail:r.GT},formatMinimum:{okStr:`>=`,ok:r.GTE,fail:r.LT},formatExclusiveMaximum:{okStr:`<`,ok:r.LT,fail:r.GTE},formatExclusiveMinimum:{okStr:`>`,ok:r.GT,fail:r.LTE}};e.formatLimitDefinition={keyword:Object.keys(i),type:`string`,schemaType:`string`,$data:!0,error:{message:({keyword:e,schemaCode:t})=>(0,n.str)`should be ${i[e].okStr} ${t}`,params:({keyword:e,schemaCode:t})=>(0,n._)`{comparison: ${i[e].okStr}, limit: ${t}}`},code(e){let{gen:r,data:a,schemaCode:o,keyword:s,it:c}=e,{opts:l,self:u}=c;if(!l.validateFormats)return;let d=new t.KeywordCxt(c,u.RULES.all.format.definition,`format`);d.$data?f():p();function f(){let t=r.scopeValue(`formats`,{ref:u.formats,code:l.code.formats}),i=r.const(`fmt`,(0,n._)`${t}[${d.schemaCode}]`);e.fail$data((0,n.or)((0,n._)`typeof ${i} != "object"`,(0,n._)`${i} instanceof RegExp`,(0,n._)`typeof ${i}.compare != "function"`,m(i)))}function p(){let t=d.schema,i=u.formats[t];if(!i||i===!0)return;if(typeof i!=`object`||i instanceof RegExp||typeof i.compare!=`function`)throw Error(`"${s}": format "${t}" does not define "compare" function`);let a=r.scopeValue(`formats`,{key:t,ref:i,code:l.code.formats?(0,n._)`${l.code.formats}${(0,n.getProperty)(t)}`:void 0});e.fail$data(m(a))}function m(e){return(0,n._)`${e}.compare(${a}, ${o}) ${i[s].fail} 0`}},dependencies:[`format`]},e.default=t=>(t.addKeyword(e.formatLimitDefinition),t)})),kie=G(((e,t)=>{Object.defineProperty(e,"__esModule",{value:!0});let n=Die(),r=Oie(),i=eF(),a=new i.Name(`fullFormats`),o=new i.Name(`fastFormats`),s=(e,t={keywords:!0})=>{if(Array.isArray(t))return c(e,t,n.fullFormats,a),e;let[i,s]=t.mode===`fast`?[n.fastFormats,o]:[n.fullFormats,a];return c(e,t.formats||n.formatNames,i,s),t.keywords&&(0,r.default)(e),e};s.get=(e,t=`full`)=>{let r=(t===`fast`?n.fastFormats:n.fullFormats)[e];if(!r)throw Error(`Unknown format "${e}"`);return r};function c(e,t,n,r){var a;(a=e.opts.code).formats??(a.formats=(0,i._)`require("ajv-formats/dist/formats").${r}`);for(let r of t)e.addFormat(r,n[r])}t.exports=e=s,Object.defineProperty(e,"__esModule",{value:!0}),e.default=s})),FF=kF(),IF=hie(),LF=Eie(),RF=oy(kie(),1).default;function zF(e){let t=new e({strict:!1,validateFormats:!0,validateSchema:!1,allErrors:!0});return RF(t),t}var BF=class{_ajv;_ajvDraft7;_ajv2019;_userAjv;constructor(e){this._userAjv=e!==void 0,this._ajv=e}get ajv(){return this._ajv??=zF(LF.Ajv2020)}_engineFor(e){if(this._userAjv)return this.ajv;let t=fy(e,`pass a pre-configured Ajv instance to AjvJsonSchemaValidator(ajv) to validate other dialects.`);return t===`2020-12`?this.ajv:t===`2019-09`?this._ajv2019??=zF(IF.Ajv2019):this._ajvDraft7??=zF(FF.Ajv)}getValidator(e){let t=this._engineFor(e),n=`$id`in e&&typeof e.$id==`string`?t.getSchema(e.$id)??t.compile(e):t.compile(e);return e=>n(e)?{valid:!0,data:e,errorMessage:void 0}:{valid:!1,data:void 0,errorMessage:t.errorsText(n.errors)}}};FF.Ajv;function VF(e,t,n){if(!t.outputSchema)return;let r=n.structuredContent;if(r==null)return n.isError?void 0:`Tool "${t.name}" declares an output schema but returned no structured content`;try{let n=e.getValidator(t.outputSchema)(r);return n.valid?void 0:n.errorMessage}catch{return}}var HF=UT.extend({method:$(`notifications/tasks/list_changed`),params:Q(q(),Hw()).optional()}),UF=class extends CustomEvent{constructor(e,t){super(e,{detail:t})}},WF=class extends EventTarget{dispatchTypedEvent(e,...t){let n=t[0]??void 0;this.dispatchEvent(new UF(e,n))}addEventListener(e,t,n){super.addEventListener(e,t,n)}removeEventListener(e,t,n){super.removeEventListener(e,t,n)}},GF=class extends WF{},KF=class{id;timestamp;request;taskId;origin;resolvePromise;rejectPromise;onRemove;constructor(e,t,n,r,i=`server-request`){this.onRemove=r,this.id=`sampling-${crypto.randomUUID()}`,this.timestamp=new Date,this.request=e;let a=e.params?._meta?.[wT];this.taskId=a?.taskId,this.origin=i,this.resolvePromise=t,this.rejectPromise=n}async respond(e){if(!this.resolvePromise)throw Error(`Request already resolved or rejected`);this.resolvePromise(e),this.resolvePromise=void 0,this.rejectPromise=void 0,this.remove()}async reject(e){if(!this.rejectPromise)throw Error(`Request already resolved or rejected`);this.rejectPromise(e),this.resolvePromise=void 0,this.rejectPromise=void 0,this.remove()}cancel(){this.rejectPromise&&this.rejectPromise(Error(`Connection torn down`)),this.resolvePromise=void 0,this.rejectPromise=void 0}remove(){this.onRemove(this.id)}},qF=class{id;timestamp;request;taskId;origin;resolvePromise;rejectCallback;onRemove;constructor(e,t,n,r,i=`server-request`){this.onRemove=n,this.id=`elicitation-${crypto.randomUUID()}`,this.timestamp=new Date,this.request=e;let a=e.params?._meta?.[wT];this.taskId=a?.taskId,this.origin=i,this.resolvePromise=t,this.rejectCallback=r}reject(e){this.rejectCallback&&=(this.rejectCallback(e),void 0)}async respond(e){if(!this.resolvePromise)throw Error(`Request already resolved`);this.resolvePromise(e),this.resolvePromise=void 0,this.remove()}completeIfPending(){this.resolvePromise&&this.respond({action:`accept`})}cancel(){this.resolvePromise&&=(this.resolvePromise({action:`cancel`}),void 0),this.rejectCallback=void 0}remove(){this.onRemove(this.id)}},JF=class extends Error{url;constructor(e){super(`The server asked for the same URL elicitation again (${e}); cancelling the call to avoid a loop.`),this.name=`UrlElicitationLoopError`,this.url=e}};function YF(e){return e instanceof Hk?e.elicitations??[]:e instanceof Bk&&e.code===zk.UrlElicitationRequired?e.data?.elicitations??[]:null}var XF=class extends Error{toolName;constructor(e){super(e?`Tool call "${e}" was cancelled.`:`Tool call was cancelled.`),this.name=`ToolCallCancelledError`,this.toolName=e}};function ZF(e){return Array.isArray(e)&&e.length>0&&typeof e[0]==`object`&&e[0]!==null&&`code`in e[0]}function QF(e){return e.some(e=>Array.isArray(e.path)&&(e.path.includes(`access_token`)||e.path.includes(`token_type`)))?`The authorization server did not return valid tokens. Check your OAuth client ID and secret, then try again.`:e.map(e=>`${Array.isArray(e.path)&&e.path.length?e.path.join(`.`):`input`}: ${e.message??`invalid`}`).join(` `)}function $F(e){if(e instanceof hw)return QF(e.issues);let t=e instanceof Error?e.message:typeof e==`string`?e:String(e),n=t.trim();if(n.startsWith(`[`))try{let e=JSON.parse(n);if(ZF(e))return QF(e)}catch{}return t}function eI(e,t){let n=e.trim();try{return new URL(n)}catch(e){let r=e instanceof Error?e.message:String(e);throw Error(`Invalid ${t}: "${n}" (${r})`,{cause:e})}}var tI=e=>{let t=new URLSearchParams(e),n=t.get(`code`);if(n){let e=t.get(`iss`);return e===null?{successful:!0,code:n}:{successful:!0,code:n,iss:e}}let r=t.get(`error`),i=t.get(`error_description`),a=t.get(`error_uri`);return r?{successful:!1,error:r,error_description:i,error_uri:a}:{successful:!1,error:`invalid_request`,error_description:`Missing code or error in response`,error_uri:null}},nI=()=>{if(typeof crypto>`u`||!crypto.getRandomValues)throw Error(`crypto.getRandomValues is not available; refusing to generate an OAuth state with a non-cryptographic RNG.`);let e=new Uint8Array(32);return crypto.getRandomValues(e),Array.from(e,e=>e.toString(16).padStart(2,`0`)).join(``)},rI=e=>!e||typeof e!=`string`?null:/^[a-f0-9]{64}$/i.test(e)?{authId:e}:null,iI=e=>{let t=e.error,n=e.error_description,r=e.error_uri;return[`Error: ${t}.`,n?`Details: ${n}.`:``,r?`More info: ${r}.`:``].filter(Boolean).join(`
134
- `)};function aI(e){return oI(e,new Set)}function oI(e,t){if(e==null)return!1;if(typeof e!=`object`)return/\bfailed\b[^\n]*\(401\)/i.test(String(e));if(t.has(e))return!1;if(t.add(e),dN.isInstance(e))return!0;let n=e.status,r=e.code;if(n===401||r===401||e instanceof Error&&/\bfailed\b[^\n]*\(401\)/i.test(e.message)||`cause`in e&&oI(e.cause,t))return!0;let i=e.data;return!!(typeof i==`object`&&i&&`cause`in i&&oI(i.cause,t))}var sI=new URL(`mcp-inspector:ema-step-up`),cI=class extends Error{authChallenge;status;constructor(e,t,n){super(n??`Auth challenge: ${e.reason}`),this.name=`AuthChallengeError`,this.authChallenge=e,this.status=t}},lI=class extends Error{authorizationUrl;authChallenge;emaStepUpConfirm;constructor(e,t,n){super(`Interactive auth recovery required`),this.name=`AuthRecoveryRequiredError`,this.authorizationUrl=e,this.authChallenge=t,this.emaStepUpConfirm=n?.emaStepUpConfirm}};function uI(e){return e instanceof lI||aI(e)}function dI(e){return fI(e,new Set)}function fI(e,t){if(typeof e!=`object`||!e||t.has(e))return;if(t.add(e),e instanceof lI||e instanceof cI)return e;let n=fI(e.cause,t);if(n)return n;let r=e.data;if(typeof r==`object`&&r)return fI(r.cause,t)}function pI(e){let t=e.match(/Bearer\s+(.+)/i);if(!t)return{};let n={},r=/([\w-]+)(?:="([^"]*)"|=([^\s,]+))?/g,i;for(;(i=r.exec(t[1]))!==null;){let e=i[2]??i[3];e!==void 0&&(n[i[1].toLowerCase()]=e)}return{error:n.error,scope:n.scope,resourceMetadata:n.resource_metadata,errorDescription:n.error_description}}function mI(e){return e?.trim()?e.trim().split(/\s+/).filter(Boolean):[]}function hI(e,t){let n=new Set,r=[];for(let i of[...mI(e),...t.filter(Boolean)])n.has(i)||(n.add(i),r.push(i));return r}function gI(e,t){return e===403?t.error===`insufficient_scope`?`insufficient_scope`:`unauthorized`:t.error===`insufficient_scope`?`insufficient_scope`:t.error===`invalid_token`?`invalid_token`:e===401?`token_expired`:`unauthorized`}function _I(e,t){if(e instanceof cI)return e.authChallenge;if(typeof e!=`object`||!e)return;let n=e.authChallenge;if(n?.reason)return{...n,...t?{context:{...n.context,...t}}:{}};let r=e.status??e.code;if(r!==401&&r!==403)return;let i=n?.raw?.wwwAuthenticate??e.wwwAuthenticate??e.headers?.get?.(`WWW-Authenticate`)??void 0;if(!i?.length)return;let a=pI(i),o=mI(a.scope);return{reason:gI(r,a),...o.length>0?{requiredScopes:o}:{},...t?{context:t}:{},raw:{httpStatus:r,wwwAuthenticate:i}}}function vI(e){if(e instanceof cI)return!0;if(typeof e!=`object`||!e)return!1;let t=e.authChallenge;if(t?.reason)return!0;let n=e.status??e.code;if(n!==401&&n!==403)return!1;let r=t?.raw?.wwwAuthenticate??e.wwwAuthenticate??e.headers?.get?.(`WWW-Authenticate`)??void 0;return r!==void 0&&r.length>0}var yI=()=>{};function bI(){let e={level:`silent`,fatal:yI,error:yI,warn:yI,info:yI,debug:yI,trace:yI,silent:yI,child:()=>e};return e}var xI=bI(),SI=new Set([`authorization`,`cookie`,`set-cookie`,`proxy-authorization`,`x-api-key`,`x-mcp-remote-auth`]),CI=`[REDACTED]`,wI=new Set([`client_secret`,`code`,`refresh_token`,`access_token`,`id_token`,`code_verifier`,`client_assertion`,`assertion`,`password`,`token`]),TI=`[REDACTED]`;function EI(e){return wI.has(e.toLowerCase())}function DI(e){let t={};for(let[n,r]of Object.entries(e))t[n]=SI.has(n.toLowerCase())?CI:r;return t}function OI(e){let t=e.indexOf(`?`);if(t===-1)return e;let n=e.slice(0,t),r=e.slice(t+1),i=r.indexOf(`#`),a=i===-1?r:r.slice(0,i),o=i===-1?``:r.slice(i);try{let t=new URLSearchParams(a),r=!1;for(let e of new Set(t.keys()))EI(e)&&(r=!0,t.set(e,TI));return r?`${n}?${t.toString()}${o}`:e}catch{return e}}function kI(e){if(Array.isArray(e))return e.map(kI);if(typeof e==`object`&&e){let t={};for(let[n,r]of Object.entries(e))t[n]=EI(n)&&typeof r==`string`?TI:kI(r);return t}return e}function AI(e,t){if(!e)return e;if((t??``).toLowerCase().includes(`application/x-www-form-urlencoded`))try{let t=new URLSearchParams(e),n=!1;for(let e of new Set(t.keys()))EI(e)&&(n=!0,t.set(e,TI));return n?t.toString():e}catch{return e}try{let t=JSON.parse(e);if(typeof t==`object`&&t)return JSON.stringify(kI(t))}catch{}return e}function jI(e,t){let n=t.toLowerCase();for(let[t,r]of Object.entries(e))if(t.toLowerCase()===n)return r}function MI(e,t){return e!==`GET`||!t?!1:t.includes(`text/event-stream`)||t.includes(`application/x-ndjson`)}function NI(e,t){return async(n,r)=>{let i=Date.now(),a=new Date,o=`${a.getTime()}-${Math.random().toString(36).slice(2,11)}`,s=typeof n==`string`?n:n instanceof URL?n.toString():n.url,c=r?.method||`GET`,l={};n instanceof Request&&n.headers.forEach((e,t)=>{l[t]=e}),r?.headers&&new Headers(r.headers).forEach((e,t)=>{l[t]=e});let u=DI(l),d=jI(l,`content-type`),f=OI(s),p;if(r?.body)if(typeof r.body==`string`)p=r.body;else try{p=String(r.body)}catch{p=void 0}else if(n instanceof Request&&n.body)try{p=await n.clone().text()}catch{p=void 0}let m=AI(p,d),h,g;try{h=await e(n,r)}catch(e){g=e instanceof Error?e.message:String(e);let n={id:o,timestamp:a,method:c,url:f,requestHeaders:u,requestBody:m,error:g,duration:Date.now()-i};throw t.trackRequest?.(n),e}let _=h.status,v=h.statusText,y={};h.headers.forEach((e,t)=>{y[t]=e});let b=DI(y),x=MI(c,h.headers.get(`content-type`)),S={id:o,timestamp:a,method:c,url:f,requestHeaders:u,requestBody:m,responseStatus:_,responseStatusText:v,responseHeaders:b,responseBody:void 0,duration:Date.now()-i};if(t.trackRequest?.(S),!x&&h.body&&!h.bodyUsed){let e=h.headers.get(`content-type`);try{h.clone().text().then(n=>{t.updateResponseBody?.(o,AI(n,e)??n)}).catch(()=>{})}catch{}}return h}}var PI=class{authorizationUrl=null;callback;constructor(e){this.callback=e}navigateToAuthorization(e){this.authorizationUrl=e,this.callback(e)instanceof Promise}getAuthorizationUrl(){return this.authorizationUrl}},FI=class{capturedAuthUrl=null;eventTarget=null;suppressAuthorizationNavigation=!1;cachedScope;serverUrl;storage;redirectUrlProvider;navigation;clientMetadataUrl;constructor(e,t){this.serverUrl=e,this.storage=t.storage,this.redirectUrlProvider=t.redirectUrlProvider,this.navigation=t.navigation,this.clientMetadataUrl=t.clientMetadataUrl}async prepareForAuth(){this.cachedScope=await this.storage.getScope(this.serverUrl)}setEventTarget(e){this.eventTarget=e}getCapturedAuthUrl(){return this.capturedAuthUrl}clearCapturedAuthUrl(){this.capturedAuthUrl=null}setSuppressAuthorizationNavigation(e){this.suppressAuthorizationNavigation=e}get scope(){return this.cachedScope}get redirectUrl(){return this.redirectUrlProvider.getRedirectUrl()}get redirect_uris(){return[this.redirectUrl]}get clientMetadata(){return{redirect_uris:this.redirect_uris,token_endpoint_auth_method:`none`,grant_types:[`authorization_code`,`refresh_token`],response_types:[`code`],client_name:`MCP Inspector`,client_uri:`https://github.com/modelcontextprotocol/inspector`,scope:this.scope??``,application_type:`native`}}state(){return nI()}async clientInformation(e){return await this.storage.getClientInformation(this.serverUrl,!0)||await this.storage.getClientInformation(this.serverUrl,!1,e?.issuer)}async saveClientInformation(e,t){let n=t&&`registrationKind`in t?t.registrationKind:`dcr`,r=t&&`issuer`in t?t.issuer:void 0;await this.storage.saveClientInformation(this.serverUrl,e,{registrationKind:n,issuer:r})}async saveScope(e){await this.storage.saveScope(this.serverUrl,e),this.cachedScope=e}async savePreregisteredClientInformation(e){await this.storage.savePreregisteredClientInformation(this.serverUrl,e)}async tokens(e){return await this.storage.getTokens(this.serverUrl,e?.issuer)}async saveTokens(e,t){await this.storage.saveTokens(this.serverUrl,e,{issuer:t?.issuer})}redirectToAuthorization(e){this.capturedAuthUrl=e,this.suppressAuthorizationNavigation||(this.eventTarget&&this.eventTarget.dispatchEvent(new CustomEvent(`oauthAuthorizationRequired`,{detail:{url:e}})),this.navigation.navigateToAuthorization(e))}async saveCodeVerifier(e){await this.storage.saveCodeVerifier(this.serverUrl,e)}async codeVerifier(){let e=await this.storage.getCodeVerifier(this.serverUrl);if(!e)throw Error(`No code verifier saved for session`);return e}async clear(){await this.storage.clear(this.serverUrl)}async getServerMetadata(){return this.storage.getServerMetadata(this.serverUrl)}async saveServerMetadata(e){await this.storage.saveServerMetadata(this.serverUrl,e)}async saveDiscoveryState(e){await this.storage.saveDiscoveryState(this.serverUrl,e)}async discoveryState(){return this.storage.getDiscoveryState(this.serverUrl)}async invalidateCredentials(e){switch(e){case`all`:await this.storage.clear(this.serverUrl);return;case`client`:await this.storage.clearClientInformation(this.serverUrl);return;case`tokens`:await this.storage.clearTokens(this.serverUrl);return;case`verifier`:await this.storage.clearCodeVerifier(this.serverUrl);return;case`discovery`:await this.storage.clearDiscoveryState(this.serverUrl);return}}};function II(e){return e?`ema`:`standard`}var LI={completedAt:null,isInitiatingAuth:!1,oauthTokens:null,oauthStep:`authorization_code`,oauthMetadata:null,resourceMetadata:null,resourceMetadataError:null,resource:null,authServerUrl:null,oauthClientInfo:null,authorizationUrl:null,authorizationCode:``,latestError:null,statusMessage:null,validationError:null};async function RI(e,t){if(t.forceReauthorization&&t.authorizationCode!==void 0)throw Error(`forceReauthorization cannot be combined with authorizationCode`);return kN(e,{serverUrl:t.serverUrl,authorizationCode:t.authorizationCode,iss:t.iss,scope:t.scope,resourceMetadataUrl:t.resourceMetadataUrl,fetchFn:t.fetchFn,skipIssuerMetadataValidation:t.skipIssuerMetadataValidation,forceReauthorization:t.forceReauthorization})}function zI(e){return e===`disabled`?`This server uses enterprise-managed authorization, but Enterprise IdP is turned off in Client Settings. Open Client Settings, enable "Enterprise IdP configuration", then try connecting again.`:`This server uses enterprise-managed authorization, but the Inspector client IdP is not configured. Open Client Settings, enable Enterprise IdP, and set issuer, client ID, and client secret.`}var BI=class extends Error{reason;constructor(e){super(zI(e)),this.name=`EmaClientNotConfiguredError`,this.reason=e}};function VI(e){return e instanceof BI}var HI=`urn:ietf:params:oauth:grant-type:jwt-bearer`,UI=`openid offline_access`;function WI(e){let t=e.replace(/-/g,`+`).replace(/_/g,`/`),n=t.padEnd(t.length+(4-t.length%4)%4,`=`),r=atob(n),i=Uint8Array.from(r,e=>e.charCodeAt(0));return new TextDecoder().decode(i)}function GI(e){let t=e.split(`.`);if(!(t.length<2))try{let e=JSON.parse(WI(t[1]));if(typeof e.exp==`number`&&Number.isFinite(e.exp))return e.exp*1e3}catch{return}}function KI(e,t=6e4,n=Date.now()){let r=GI(e);return r!==void 0&&n>=r-t}function qI(e){let t=e.split(`.`);return t.length===3&&t[0].length>0&&t[1].length>0&&t[2]!==void 0}function JI(e){if(!qI(e))return;let t=e.split(`.`);try{return{header:JSON.parse(WI(t[0])),payload:JSON.parse(WI(t[1]))}}catch{return}}function YI(e){return e.replace(/\/$/,``)}function XI(e){return`ema-idp:${YI(e)}`}async function ZI(e,t){let n;try{n=await e.json()}catch{return Error(`${t}: token request failed (HTTP ${e.status})`)}if(typeof n==`object`&&n){let e=n,r=[t];if(e.error&&r.push(`error=${e.error}`),e.error_description&&r.push(e.error_description),r.length>1)return Error(r.join(`: `))}return Error(`${t}: token request failed (HTTP ${e.status})`)}function QI(e,t,n,r){let i=yN(t,e?.token_endpoint_auth_methods_supported??[]);if(i===`client_secret_basic`&&t.client_secret){let e=btoa(`${t.client_id}:${t.client_secret}`);n.set(`Authorization`,`Basic ${e}`);return}if(i===`client_secret_post`&&t.client_secret){r.set(`client_id`,t.client_id),r.set(`client_secret`,t.client_secret);return}r.set(`client_id`,t.client_id)}async function $I(e,t,n,r,i){let a=new Headers({"Content-Type":`application/x-www-form-urlencoded`,Accept:`application/json`});return QI(n,r,a,t),(i??fetch)(e,{method:`POST`,headers:a,body:t})}function eL(e){return{client_id:e.clientId,client_secret:e.clientSecret,token_endpoint_auth_method:`client_secret_post`}}async function tL(e,t,n){let r=XI(e),i=await t.getServerMetadata(r);return i?.token_endpoint?i:nL(e,n)}async function nL(e,t){let n=await VN(eI(e,`EMA IdP issuer (Client Settings)`),{fetchFn:t});if(!n)throw Error(`Failed to discover OIDC metadata for IdP issuer ${e}`);return NO.parse(n)}async function rL(e){let t=YI(e.idp.issuer),n=await tL(t,e.storage,e.fetchFn),r=eL(e.idp),i=XI(t),a=nI(),{authorizationUrl:o,codeVerifier:s}=await UN(eI(t,`EMA IdP issuer (Client Settings)`),{metadata:n,clientInformation:r,redirectUrl:e.redirectUrl,scope:UI,state:a});return await e.storage.saveCodeVerifier(i,s),await e.storage.savePreregisteredClientInformation(i,r),await e.storage.saveServerMetadata(i,n),{authorizationUrl:o}}async function iL(e){let t=YI(e.idp.issuer),n=XI(t),r=await e.storage.getServerMetadata(n);if(!r)throw Error(`IdP OAuth metadata not found — restart EMA IdP login`);let i=await e.storage.getClientInformation(n,!0)??await e.storage.getClientInformation(n);if(!i)throw Error(`IdP client information not found — restart EMA IdP login`);let a=await e.storage.getCodeVerifier(n);if(!a)throw Error(`IdP PKCE verifier not found — restart EMA IdP login`);let o=await KN(eI(t,`EMA IdP issuer (Client Settings)`),{metadata:r,clientInformation:i,authorizationCode:e.authorizationCode,iss:e.iss,codeVerifier:a,redirectUri:e.redirectUrl,fetchFn:e.fetchFn}),s=o.id_token;if(!s)throw Error(`IdP token response did not include an ID Token`);await e.storage.clearCodeVerifier(n);let c=GI(s);return await e.storage.saveIdpSession(t,{idToken:s,refreshToken:o.refresh_token,idTokenExpiresAt:c}),{idToken:s,refreshToken:o.refresh_token,idTokenExpiresAt:c}}async function aL(e){let t=YI(e.idp.issuer),n=await e.storage.getIdpSession(t);if(!n?.refreshToken)throw Error(`IdP refresh token not available`);let r=await tL(t,e.storage,e.fetchFn);if(!r.token_endpoint)throw Error(`IdP metadata missing token_endpoint`);let i=new URLSearchParams({grant_type:`refresh_token`,refresh_token:n.refreshToken}),a=await $I(eI(r.token_endpoint,`IdP token_endpoint (from OIDC discovery)`),i,r,eL(e.idp),e.fetchFn);if(!a.ok)throw await ZI(a,`EMA IdP refresh (OIDC refresh_token grant)`);let o=await a.json(),s=o.id_token;if(!s)throw Error(`IdP refresh did not return an ID Token`);return await e.storage.saveIdpSession(t,{idToken:s,refreshToken:o.refresh_token??n.refreshToken,idTokenExpiresAt:GI(s)}),s}async function oL(e){let t=YI(e.idp.issuer),n=await e.storage.getIdpSession(t);if(n?.idToken){if(!KI(n.idToken))return n.idToken;if(n.refreshToken)try{return await aL(e)}catch{return}}}function sL(e,t){let n=t?.authorization_servers?.[0];if(n)return eI(n,`protected resource authorization_servers[0]`);try{return new URL(`/`,e)}catch(t){let n=t instanceof Error?t.message:String(t);throw Error(`Invalid MCP server URL: "${e}" (${n})`,{cause:t})}}function cL(e,t){let n=t?.trim();if(n)return n;let r=e?.scopes_supported;if(r&&r.length>0)return r.join(` `)}async function lL(e,t,n){let r=await PN(e,void 0,n);if(!r.resource)throw Error(`EMA requires protected resource metadata with a resource identifier`);let i=sL(e,r),a=await NN(e,{clientMetadata:{scope:t??``,redirect_uris:[]}},r),o=cL(r,t);return{resourceMetadata:r,resourceAsUrl:i,resourceUrl:a??void 0,scope:o}}async function uL(e,t){let n=await VN(e,{fetchFn:t});if(!n)throw Error(`Failed to discover resource authorization server metadata`);return n}async function dL(e){let t=YI(e.idp.issuer),n=e.resource.trim();if(!n)throw Error(`EMA leg 2 requires a resource identifier`);let r;try{r=await jne({idpUrl:t,audience:e.audience,resource:n,idToken:e.idToken,clientId:e.idp.clientId,clientSecret:e.idp.clientSecret,scope:e.scope,fetchFn:e.fetchFn})}catch(e){let t=e instanceof Error?e.message:String(e);throw/Failed to discover token endpoint/i.test(t)?Error(`IdP metadata missing token_endpoint`,{cause:e}):/Invalid token exchange response/i.test(t)?Error(`IdP token exchange did not return an ID-JAG`,{cause:e}):Error(`EMA leg 2 (IdP token exchange for ID-JAG): ${t}`,{cause:e})}if(!r.jwtAuthGrant)throw Error(`IdP token exchange did not return an ID-JAG`);return r.jwtAuthGrant}async function fL(e){let t=await uL(e.resourceAsUrl,e.fetchFn);if(!t.token_endpoint)throw Error(`Resource AS metadata missing token_endpoint`);let n={client_id:e.resourceClientId,...e.resourceClientSecret&&{client_secret:e.resourceClientSecret},token_endpoint_auth_method:e.resourceClientSecret?`client_secret_post`:`none`},r=new URLSearchParams({grant_type:HI,assertion:e.idJag});e.scope&&r.set(`scope`,e.scope),e.resource&&r.set(`resource`,e.resource);let i=await $I(eI(t.token_endpoint,`resource authorization server token_endpoint (from AS discovery)`),r,t,n,e.fetchFn);if(!i.ok)throw await ZI(i,`EMA leg 3 (resource AS JWT bearer grant)`);return IO.parse(await i.json())}function pL(e){let t=e instanceof Error?e.message:String(e);return Error(`EMA legs 2–3 (resource token mint): ${t}`,{cause:e})}async function mL(e,t){let n=t??await lL(e.serverUrl,e.scope,e.fetchFn);if(!e.resourceClientId)throw Error(`EMA requires resource authorization server clientId (per-server oauth.clientId)`);if(!e.resourceClientSecret?.trim())throw Error(`EMA requires resource authorization server client secret in server OAuth settings (Test Client secret from xaa.dev resource registration)`);let r=await oL({idp:e.idp,storage:e.storage,fetchFn:e.fetchFn});if(!r)throw Error(`Valid IdP ID Token required for EMA token mint`);let i=n.resourceAsUrl.href.replace(/\/$/,``),a=n.resourceUrl?.href??n.resourceMetadata.resource,o=await dL({idp:e.idp,idToken:r,audience:i,resource:a,scope:n.scope,fetchFn:e.fetchFn});return fL({resourceAsUrl:n.resourceAsUrl,idJag:o,resourceClientId:e.resourceClientId,resourceClientSecret:e.resourceClientSecret,resource:n.resourceUrl?.href,scope:n.scope,fetchFn:e.fetchFn})}async function hL(e){if(!await oL({idp:e.idp,storage:e.storage,fetchFn:e.fetchFn}))return{status:`no_idp_session`};try{let t=await mL(e);return await e.storage.saveTokens(e.serverUrl,t,{enterpriseManaged:!0}),{status:`success`}}catch(e){return{status:`mint_failed`,error:pL(e)}}}async function gL(e){let{authorizationUrl:t}=await rL({idp:e.idp,redirectUrl:e.redirectUrl,storage:e.storage,fetchFn:e.fetchFn});return t}async function _L(e,t,n){try{await iL({idp:e.idp,authorizationCode:t,iss:n,redirectUrl:e.redirectUrl,storage:e.storage,fetchFn:e.fetchFn})}catch(e){let t=e instanceof Error?e.message:String(e);throw Error(`EMA leg 1 (IdP authorization code exchange): ${t}`,{cause:e})}let r;try{r=await mL(e)}catch(e){throw pL(e)}return await e.storage.saveTokens(e.serverUrl,r,{enterpriseManaged:!0}),r}async function vL(e){if(!await oL({idp:e.idp,storage:e.storage,fetchFn:e.fetchFn}))return;let t=await mL(e);return await e.storage.saveTokens(e.serverUrl,t,{enterpriseManaged:!0}),t}async function yL(e,t){let n=YI(t);if(!n)return`none`;let r=await e.getIdpSession(n);return r?.idToken?!KI(r.idToken)||r.refreshToken?`logged_in`:`expired`:`none`}async function bL(e,t){let n=YI(t);n&&(await e.clearIdpSession(n),await e.clear(XI(n)),await e.clearEnterpriseManagedResourceServers())}function xL(e){return e?.access_token?!KI(e.access_token):!1}function SL(e,t,n){if(e?.client_id)return{registrationKind:`static`,clientId:e.client_id,hasClientSecret:e.client_secret!==void 0&&e.client_secret!==``};if(t?.client_id)return{...n&&{registrationKind:n},clientId:t.client_id,hasClientSecret:t.client_secret!==void 0&&t.client_secret!==``}}function CL(e,t){return(typeof e?.scope==`string`?e.scope.trim():void 0)||(typeof t==`string`?t.trim():void 0)||void 0}async function wL(e){let{serverUrl:t,storage:n,flowState:r}=e,i=e.protocol,a=await n.getTokens(t),o=r?.oauthTokens??void 0,s=o&&xL(o)?o:a&&xL(a)?a:o??a,c=await n.getClientInformation(t,!0),l=await n.getClientInformation(t),u=await n.getScope(t),d=await n.getServerMetadata(t),f=xL(s),p=CL(s,u),m=await n.getClientRegistrationKind(t),h=m===`dcr`||m===`cimd`?m:void 0,g=SL(c,l,c?.client_id?void 0:h),_={authorized:f,protocol:i,serverUrl:t,...e.configuredScope?.trim()&&{configuredScope:e.configuredScope.trim()},...p&&{grantedScope:p},...s&&{tokens:s},...g&&{client:g},...d&&{authorizationServerMetadata:d}};if(i===`ema`&&e.enterpriseManagedAuth?.idp){let t=e.enterpriseManagedAuth.idp,r=YI(t.issuer),i=await yL(n,r),a=await n.getServerMetadata(XI(r));_.ema={idpIssuer:r,idpClientId:t.clientId,idpSession:i,...a&&{idpMetadata:a}},_.enterpriseManaged=!0}return _}function TL(e){return e.enterpriseManaged===!0||!!e.clientId?.trim()||!!e.clientSecret?.trim()||!!e.scope?.trim()||!!e.clientMetadataUrl?.trim()}async function EL(e,t){let[n,r,i]=await Promise.all([e.getTokens(t),e.getClientInformation(t,!0),e.getClientInformation(t)]);return!!(n?.access_token||r?.client_id||i?.client_id)}function DL(e){return II(e.enterpriseManaged)}async function OL(e){let t=e.provider.clientMetadataUrl?.trim();if(!t||(await e.provider.clientInformation())?.client_id)return;let n;try{n=await PN(e.serverUrl)}catch{n=void 0}if(!(await VN(sL(e.serverUrl,n),{...e.fetchFn&&{fetchFn:e.fetchFn}}))?.client_id_metadata_document_supported)return;let r={client_id:t};await e.provider.saveClientInformation(r,{registrationKind:`cimd`})}function kL(e,t=6e4){return e.access_token?!KI(e.access_token,t):!1}var AL=class{inner;emaConfig;constructor(e,t){this.inner=e,this.emaConfig=t}get redirectUrl(){return this.inner.redirectUrl}get clientMetadataUrl(){return this.inner.clientMetadataUrl}get clientMetadata(){return this.inner.clientMetadata}state(){return this.inner.state()}clientInformation(){return this.inner.clientInformation()}saveClientInformation(e){return this.inner.saveClientInformation(e)}async tokens(){let e=await this.inner.tokens();if(e&&kL(e))return e;let t=await vL(this.emaConfig);if(t)return t}saveTokens(e){return this.emaConfig.storage.saveTokens(this.emaConfig.serverUrl,e,{enterpriseManaged:!0})}async redirectToAuthorization(e){let t=await gL(this.emaConfig);this.inner.clearCapturedAuthUrl(),this.inner.redirectToAuthorization(t)}saveCodeVerifier(e){return this.inner.saveCodeVerifier(e)}codeVerifier(){return this.inner.codeVerifier()}},jL=mN,ML=hN;function NL(e,t){return e?.trim()||t?.trim()||void 0}function PL(e,t){return t?.trim()||jL(e,t)}function FL(e){return e===`tool`||e===`prompt`||e===`resource`||e===`app`}function IL(e,t){let n=FL(t?.recoverySource);return e===`step_up`?n?`Step-up authorization succeeded. Retry your action.`:`Step-up authorization succeeded.`:n?`Authentication succeeded. Retry your action.`:`Authentication succeeded.`}function LL(e){return FL(e?.recoverySource)?`Session credentials were updated. Retry your action.`:`Session credentials were updated.`}function RL(e,t){return e===`reauth`?`Sign-in was not completed. Re-authenticate to restore access.`:FL(t?.recoverySource)?`Step-up authorization was not completed. Retry your action.`:`Step-up authorization was not completed.`}function zL(e,t){return e.reason===`insufficient_scope`&&!t?.enterpriseManaged}function BL(e,t){return e.reason===`insufficient_scope`&&t?.enterpriseManaged===!0}function VL(e,t){return zL(e,t)||BL(e,t)}function HL(e,t){let n=e.context?.toolName?.trim();if(n)return t?.enterpriseManaged?`Tool "${n}" needs additional permissions from your organization before it can continue.`:`Tool "${n}" needs additional OAuth scopes before it can continue.`;let r=e.requiredScopes?.filter(Boolean);if(r?.length){let e=r.length===1?`scope`:`scopes`;return t?.enterpriseManaged?`This operation needs additional organization ${e}: ${r.join(`, `)}.`:`This operation needs additional ${e}: ${r.join(`, `)}.`}return t?.enterpriseManaged?`This operation needs additional permissions from your organization before it can continue.`:`This operation needs additional OAuth scopes before it can continue.`}function UL(e){return e?.enterpriseManaged?`Inspector will request the additional permissions from your enterprise identity provider. You may be asked to sign in if your organization session expired.`:`You will be redirected to authorize, then returned to the inspector.`}function WL(e){return e?.enterpriseManaged?`Additional organization permissions required`:`Additional permissions required`}function GL(){return`Requesting additional permissions from your organization…`}function KL(e){return FL(e?.recoverySource)?`Organization permissions were updated. Retry your action.`:`Organization permissions were updated.`}function qL(e){return e?.trim()?e:`Could not obtain the additional permissions from your organization.`}function JL(e){return e.requiredScopes?.filter(Boolean)??[]}function YL(e){let t=e.context?.toolName?.trim();if(t)return`Authorization completed, but required permissions for tool "${t}" were not granted. Grant the requested scopes on the authorization server, then retry.`;let n=e.authorizationScopes?.filter(Boolean)??e.requiredScopes?.filter(Boolean);return n?.length?`Authorization completed, but required scopes were not granted (${n.join(`, `)}). Grant the requested permissions on the authorization server, then retry your action.`:`Authorization completed, but the required permissions were not granted. Grant the requested scopes on the authorization server, then retry your action.`}function XL(e,t){if(t.context===`connect`)return;let n=t.serverName;return e===`step_up`?{title:n?`Step-up authorization for "${n}"`:`Step-up authorization`,message:`Redirecting to authorize additional permissions…`}:t.enterpriseManaged?{title:n?`Re-authenticating "${n}"`:`Re-authenticating`,message:`Re-authenticating…`}:{title:n?`Session expired for "${n}"`:`Session expired`,message:`Session expired, re-authenticating…`}}function ZL(e){return e===`token_expired`||e===`unauthorized`||e===`invalid_token`}function QL(){return`Authorization state was lost`}function $L(e){return`The stored authorization state for ${e?.serverName?`"${e.serverName}"`:`this server`} was lost before the authorization server sent you back, so the sign-in could not be completed. This usually means a new browser session, a different tab, or authorization state that was cleared while the flow was in progress. Authorize again to reconnect.`}function eR(){return`Authorize again`}function tR(){return`Authorization server mismatch`}var nR=120;function rR(e){return e.length>nR?`${e.slice(0,nR)}…`:e}function iR(e){return`Authorization for ${e.serverName?`"${e.serverName}"`:`this server`} was stopped: the flow started at ${rR(e.recordedIssuer)} but the callback resolved ${rR(e.currentIssuer)}. The authorization code was not exchanged. Verify the server's authorization configuration before trying again.`}function aR(e,t){return e.kind===`lost_authorization_state`?{title:QL(),message:$L(t)}:{title:tR(),message:iR({recordedIssuer:e.recordedIssuer,currentIssuer:e.currentIssuer,serverName:t?.serverName})}}function oR(e){let t=e.serverName?`Authentication for "${e.serverName}" needs attention.`:`Authentication needs attention.`;return e.detail?`${t} ${e.detail}`:t}var sR=class{params;oauthConfig;oauthFlowState=null;pendingAuthorizationScope;authChallengeMutex=Promise.resolve();constructor(e){this.params=e,this.oauthConfig={...e.initialConfig},this.pendingAuthorizationScope=void 0}setOAuthConfig(e){this.oauthConfig={...this.oauthConfig,...e}}getServerUrl(){return this.params.getServerUrl()}requireStorage(){let e=this.oauthConfig.storage;if(!e)throw Error(`OAuth storage is required for this operation.`);return e}async createOAuthProvider(){if(!this.oauthConfig.storage||!this.oauthConfig.redirectUrlProvider||!this.oauthConfig.navigation)throw Error(`OAuth environment components (storage, navigation, redirectUrlProvider) are required.`);let e=new FI(this.getServerUrl(),{storage:this.oauthConfig.storage,redirectUrlProvider:this.oauthConfig.redirectUrlProvider,navigation:this.oauthConfig.navigation,clientMetadataUrl:this.oauthConfig.clientMetadataUrl});if(e.setEventTarget(this.params.getEventTarget()),await e.prepareForAuth(),e.scope===void 0&&this.oauthConfig.scope&&await e.saveScope(this.oauthConfig.scope),this.oauthConfig.clientId){let t={client_id:this.oauthConfig.clientId,...this.oauthConfig.clientSecret&&{client_secret:this.oauthConfig.clientSecret}};await e.savePreregisteredClientInformation(t)}return e}isEnterpriseManaged(){return this.oauthConfig.enterpriseManaged===!0}async getEmaFlowConfig(){if(!this.oauthConfig.storage||!this.oauthConfig.redirectUrlProvider)throw Error(`OAuth environment components (storage, redirectUrlProvider) are required.`);let e=this.params.enterpriseManagedAuth?.idp;if(!e){let e=this.params.installEnterpriseManagedAuth;throw new BI(e?.enabled===!1&&e.idp?`disabled`:`not_configured`)}let t=await this.oauthConfig.storage.getScope(this.getServerUrl());return{serverUrl:this.getServerUrl(),idp:e,resourceClientId:this.oauthConfig.clientId,resourceClientSecret:this.oauthConfig.clientSecret,scope:jL(this.oauthConfig.scope,t)||this.oauthConfig.scope,redirectUrl:this.oauthConfig.redirectUrlProvider.getRedirectUrl(),storage:this.oauthConfig.storage,fetchFn:this.params.effectiveAuthFetch}}async trySilentEnterpriseManagedAuth(){if(!this.isEnterpriseManaged())return!1;let e=await hL(await this.getEmaFlowConfig());if(e.status===`success`)return!0;if(e.status===`mint_failed`)throw e.error;return!1}async authenticateEnterpriseManaged(){let e=await this.getEmaFlowConfig(),t=await hL(e);if(t.status===`success`)return;if(t.status===`mint_failed`)throw t.error;let n=await gL(e),r=n.searchParams.get(`state`);if(r&&this.params.onBeforeOAuthRedirect){let e=rI(r);e?.authId&&await this.params.onBeforeOAuthRedirect(e.authId)}return this.requireNavigation().navigateToAuthorization(n),await this.recordAuthorizationCodeFlowState(n),n}async authenticate(){if(this.isEnterpriseManaged())return this.authenticateEnterpriseManaged();let e=await this.createOAuthProvider(),t=this.getServerUrl();if(e.clearCapturedAuthUrl(),await OL({serverUrl:t,provider:e,fetchFn:this.params.effectiveAuthFetch}),await RI(e,{serverUrl:t,scope:e.scope,fetchFn:this.params.effectiveAuthFetch})===`AUTHORIZED`)throw Error(`Unexpected: auth() returned AUTHORIZED without authorization code`);let n=e.getCapturedAuthUrl();if(!n)throw Error(`Failed to capture authorization URL`);let r=n.searchParams.get(`state`);if(r&&this.params.onBeforeOAuthRedirect){let e=rI(r);e?.authId&&await this.params.onBeforeOAuthRedirect(e.authId)}let i=await e.clientInformation();return this.oauthFlowState={...LI,oauthStep:`authorization_code`,authorizationUrl:n,oauthClientInfo:i??null},n}async completeOAuthFlow(e,t){try{if(this.isEnterpriseManaged()){let n=await this.getEmaFlowConfig(),r=this.pendingAuthorizationScope??n.scope,i=await _L(r?{...n,scope:r}:n,e,t),a=this.pendingAuthorizationScope,o=NL(i.scope,a);o&&await this.requireStorage().saveScope(this.getServerUrl(),o),this.pendingAuthorizationScope=void 0;let s=Date.now();this.oauthFlowState={...LI,oauthStep:`complete`,oauthTokens:i,completedAt:s},this.params.dispatchOAuthComplete({tokens:i});return}let n=await this.createOAuthProvider(),r=await RI(n,{serverUrl:this.getServerUrl(),authorizationCode:e,iss:t,fetchFn:this.params.effectiveAuthFetch});if(r!==`AUTHORIZED`)throw Error(`Expected AUTHORIZED after providing authorization code, got: ${r}`);let i=await n.tokens();if(!i)throw Error(`Failed to retrieve tokens after authorization`);let a=this.pendingAuthorizationScope,o=NL(i.scope,a);o&&await n.saveScope(o),this.pendingAuthorizationScope=void 0;let s=await n.clientInformation(),c=Date.now();this.oauthFlowState=this.oauthFlowState?{...this.oauthFlowState,oauthStep:`complete`,oauthTokens:i,oauthClientInfo:s??null,completedAt:c}:{...LI,oauthStep:`complete`,oauthTokens:i,oauthClientInfo:s??null,completedAt:c},this.params.dispatchOAuthComplete({tokens:i})}catch(e){throw this.pendingAuthorizationScope=void 0,this.params.dispatchOAuthError({error:e instanceof Error?e:Error(String(e))}),e}}async getOAuthTokens(){if(this.oauthFlowState?.oauthTokens)return this.oauthFlowState.oauthTokens;let e=await this.createOAuthProvider();try{return await e.tokens()}catch{return}}async clearOAuthTokens(){if(!this.oauthConfig?.storage)return;let e=this.getServerUrl();await this.oauthConfig.storage.clear(e),this.oauthFlowState=null,this.pendingAuthorizationScope=void 0}async isOAuthAuthorized(){return await this.getOAuthTokens()!==void 0}getOAuthFlowState(){return this.oauthFlowState?{...this.oauthFlowState}:void 0}getOAuthFlowStep(){return this.oauthFlowState?.oauthStep}async getOAuthState(){let e=this.oauthConfig.storage;if(!e)return;let t=this.getServerUrl();if(!(!TL(this.oauthConfig)&&!await EL(e,t)))return wL({serverUrl:this.getServerUrl(),protocol:DL(this.oauthConfig),configuredScope:this.oauthConfig.scope,enterpriseManagedAuth:this.params.enterpriseManagedAuth,storage:e,flowState:this.oauthFlowState??void 0})}async refreshEnterpriseManagedTokens(){return this.isEnterpriseManaged()?await vL(await this.getEmaFlowConfig())!==void 0:!1}async checkAuthChallengeSatisfied(e){let t=this.oauthConfig.storage;if(!t)return!1;let n=this.getServerUrl(),r=await t.getTokens(n);if(!r?.access_token)return!1;if(e.reason!==`insufficient_scope`)return e.reason===`token_expired`&&xL(r);let i=await this.enrichChallengeWithAuthorizationScopes(e,r.scope),a=i.authorizationScopes?.join(` `)??i.requiredScopes?.join(` `);return a?.trim()?!ML(a,PL(await t.getScope(n),r.scope)):!1}async handleAuthChallenge(e,t){if(e.reason===`insufficient_scope`&&await this.checkAuthChallengeSatisfied(e))return{kind:`satisfied`};let n=this.authChallengeMutex,r,i=new Promise(e=>{r=e});this.authChallengeMutex=i,await n;try{return e.reason===`insufficient_scope`&&await this.checkAuthChallengeSatisfied(e)?{kind:`satisfied`}:await this.runHandleAuthChallenge(e,t)}finally{r()}}async runHandleAuthChallenge(e,t){return this.isEnterpriseManaged()?this.handleEnterpriseManagedAuthChallenge(e,t):this.handleStandardAuthChallenge(e)}async enrichChallengeWithAuthorizationScopes(e,t){if(e.reason!==`insufficient_scope`)return e;let n=this.oauthConfig.storage,r=this.getServerUrl();t===void 0&&n&&(t=(await n.getTokens(r))?.scope);let i=jL(n?await n.getScope(r):void 0,t),a=e.requiredScopes?.filter(Boolean)??[],o=new Set(mI(i)),s=a.filter(e=>!o.has(e)),c=s.length>0?s:a,l=hI(i,a);return{...e,requiredScopes:c,authorizationScopes:l}}resolveEmaScopeForChallenge(e){if(e.reason===`insufficient_scope`){let t=e.requiredScopes?.join(` `).trim();if(t)return t}return this.oauthConfig.scope?.trim()||void 0}async emaFlowConfigForChallenge(e){let t=await this.getEmaFlowConfig(),n=e.authorizationScopes;if(n&&n.length>0)return{...t,scope:n.join(` `)};let r=this.resolveEmaScopeForChallenge(e);return r?{...t,scope:r}:t}async handleEnterpriseManagedAuthChallenge(e,t){let n=await this.enrichChallengeWithAuthorizationScopes(e);if(n.reason===`insufficient_scope`&&!t?.confirmedStepUp)return{kind:`step_up_confirm`,challenge:n};let r=await this.emaFlowConfigForChallenge(n);if(n.reason===`insufficient_scope`){let e=await hL(r);if(e.status===`success`&&await this.checkAuthChallengeSatisfied(n)){let e=NL((await this.requireStorage().getTokens(this.getServerUrl()))?.scope,n.authorizationScopes?.join(` `));return e&&await this.requireStorage().saveScope(this.getServerUrl(),e),{kind:`satisfied`}}if(e.status===`mint_failed`)return{kind:`failed`,error:e.error}}else if(await vL(r))return{kind:`satisfied`};try{let e=await gL(r);return n.reason===`insufficient_scope`&&n.authorizationScopes?.length&&(this.pendingAuthorizationScope=n.authorizationScopes.join(` `)),{kind:`interactive`,authorizationUrl:e,challenge:n}}catch(e){return{kind:`failed`,error:e instanceof Error?e:Error(String(e))}}}async handleStandardAuthChallenge(e){let t=await this.createOAuthProvider(),n=this.getServerUrl(),r=await t.tokens(),i=await this.enrichChallengeWithAuthorizationScopes(e,r?.scope);t.clearCapturedAuthUrl(),await OL({serverUrl:n,provider:t,fetchFn:this.params.effectiveAuthFetch});let a=i.reason===`insufficient_scope`?i.authorizationScopes?.join(` `):this.oauthConfig.scope?.trim()||(i.requiredScopes?.length?i.requiredScopes.join(` `):void 0);t.setSuppressAuthorizationNavigation(!0);let o;try{o=await RI(t,{serverUrl:n,scope:a,fetchFn:this.params.effectiveAuthFetch,...i.reason===`insufficient_scope`&&{forceReauthorization:ML(a,r?.scope)}})}finally{t.setSuppressAuthorizationNavigation(!1)}if(o===`AUTHORIZED`)if(i.reason===`insufficient_scope`){if(await this.checkAuthChallengeSatisfied(i)){let e=NL((await t.tokens())?.scope,a);return e&&await t.saveScope(e),{kind:`satisfied`}}return await this.tryForceReauthorizationForStepUp(t,n,a,i)||{kind:`failed`,error:Error(YL(i))}}else return{kind:`satisfied`};let s=t.getCapturedAuthUrl();if(!s)return{kind:`failed`,error:Error(`Failed to capture authorization URL`)};i.reason===`insufficient_scope`&&a&&(this.pendingAuthorizationScope=a);let c=await t.clientInformation();return await this.recordAuthorizationCodeFlowState(s,c,i.reason===`insufficient_scope`?`scope_step_up`:`authorization_code`),{kind:`interactive`,authorizationUrl:s,challenge:i}}async beginInteractiveAuthorization(e){let t=e.searchParams.get(`state`);if(t&&this.params.onBeforeOAuthRedirect){let e=rI(t);e?.authId&&await this.params.onBeforeOAuthRedirect(e.authId)}this.requireNavigation().navigateToAuthorization(e);let n=await(await this.createOAuthProvider()).clientInformation();await this.recordAuthorizationCodeFlowState(e,n),this.params.dispatchOAuthAuthorizationRequired({url:e})}requireNavigation(){let e=this.oauthConfig.navigation;if(!e)throw Error(`OAuth navigation is required.`);return e}async recordAuthorizationCodeFlowState(e,t,n=`authorization_code`){this.oauthFlowState={...LI,oauthStep:n,authorizationUrl:e,oauthClientInfo:t??null}}async tryForceReauthorizationForStepUp(e,t,n,r){e.clearCapturedAuthUrl(),e.setSuppressAuthorizationNavigation(!0);let i;try{i=await RI(e,{serverUrl:t,scope:n,fetchFn:this.params.effectiveAuthFetch,forceReauthorization:!0})}finally{e.setSuppressAuthorizationNavigation(!1)}if(i!==`AUTHORIZED`)return null;if(await this.checkAuthChallengeSatisfied(r)){let t=NL((await e.tokens())?.scope,n);return t&&await e.saveScope(t),{kind:`satisfied`}}return null}async createOAuthProviderForTransport(){let e=await this.createOAuthProvider();return this.isEnterpriseManaged()?new AL(e,await this.getEmaFlowConfig()):e}};function cR(e){return{oauthTokens:{access_token:e.access_token,token_type:e.token_type,expires_in:e.expires_in,refresh_token:e.refresh_token,scope:e.scope,id_token:e.id_token}}}var lR=6e4;function uR(e){if(`method`in e&&`id`in e&&e.id!==null&&e.id!==void 0)return e.method===`subscriptions/listen`?void 0:e.id}function dR(e){return typeof e==`object`&&!!e&&`ok`in e&&e.ok===!1&&`kind`in e&&e.kind===`auth_challenge`}function fR(e){return typeof e==`object`&&!!e&&`ok`in e&&e.ok===!1&&`kind`in e&&e.kind===`transport_error`}function pR(e){if(typeof e==`object`&&e&&`sessionId`in e&&typeof e.sessionId==`string`&&!(`ok`in e)||typeof e==`object`&&e&&`ok`in e&&e.ok===!0&&`sessionId`in e)return e.sessionId}async function*mR(e){let t=new TextDecoder,n=``;for(;;){let{done:r,value:i}=await e.read();if(r)break;n+=t.decode(i,{stream:!0});let a=n.split(`
135
- `);n=a.pop()??``;let o=`message`,s=[];for(let e of a)e.startsWith(`event:`)?o=e.slice(6).trim():e.startsWith(`data:`)?s.push(e.slice(5).trimStart()):e===``&&(s.length>0&&(yield{event:o,data:s.join(`
136
- `)}),o=`message`,s=[])}if(n.trim()){let e=n.split(`
137
- `),t=`message`,r=[];for(let n of e)n.startsWith(`event:`)?t=n.slice(6).trim():n.startsWith(`data:`)&&r.push(n.slice(5).trimStart());r.length>0&&(yield{event:t,data:r.join(`
138
- `)})}}var hR=class{_sessionId=void 0;_protocolVersion=void 0;eventStreamReader=null;eventStreamAbort=null;eventStreamConsumeTask=null;restartingEventStream=!1;closed=!1;sseResponseWaits=new Map;options;config;get sessionId(){}getRemoteBackendSessionId(){return this._sessionId}setProtocolVersion(e){this._protocolVersion=e}async attachToSession(e){this.closed&&=!1,await this.stopEventStream(),this._sessionId=e,await this.openEventStream()}constructor(e,t){this.options=e,this.config=t}setAuthRecovery(e){this.options.authRecovery=e}setOnAuthChallenge(e){this.options.onAuthChallenge=e}get fetchFn(){return this.options.fetchFn??globalThis.fetch}get baseUrl(){return this.options.baseUrl.replace(/\/$/,``)}get headers(){let e={"Content-Type":`application/json`};return this.options.authToken&&(e[`x-mcp-remote-auth`]=`Bearer ${this.options.authToken}`),e}async recoverFromAuthChallenge(e,t){let n=this.options.authRecovery;if(!n)throw new cI(e,e.raw?.httpStatus??401);let r=await n.handleAuthChallenge(e);if(r.kind===`satisfied`){await t();return}throw r.kind===`step_up_confirm`?new lI(sI,r.challenge,{emaStepUpConfirm:!0}):r.kind===`interactive`?new lI(r.authorizationUrl,r.challenge):r.error}async start(){if(!(this._sessionId&&!this.closed))return this.startWithRecovery(0)}async startWithRecovery(e){if(this.sessionId)return;if(this.closed)throw Error(`Transport is closed`);let t;if(this.options.authProvider){let e=await this.options.authProvider.tokens();e&&(t=cR(e))}let n={config:this.config,...t&&{authState:t},...this.options.settings&&{settings:this.options.settings}},r=await this.fetchFn(`${this.baseUrl}/api/mcp/connect`,{method:`POST`,headers:this.headers,body:JSON.stringify(n)});if(!r.ok){let e=await r.text(),t=Error(`Remote connect failed (${r.status}): ${e}`);throw t.status=r.status,t}let i=await r.json();if(dR(i)){if(e>=1)throw new cI(i.authChallenge,i.authChallenge.raw?.httpStatus??401);await this.recoverFromAuthChallenge(i.authChallenge,()=>this.startWithRecovery(e+1));return}if(fR(i))throw Error(`Remote connect failed: ${i.error}`);let a=pR(i);if(!a)throw Error(`Remote did not return sessionId`);this._sessionId=a,await this.openEventStream()}async openEventStream(){this.eventStreamAbort=new AbortController;let e=await this.fetchFn(`${this.baseUrl}/api/mcp/events?sessionId=${encodeURIComponent(this._sessionId)}`,{headers:this.options.authToken?{"x-mcp-remote-auth":`Bearer ${this.options.authToken}`}:{},signal:this.eventStreamAbort.signal});if(!e.ok)throw this._sessionId=void 0,Error(`Remote events stream failed (${e.status}): ${await e.text()}`);let t=e.body;if(!t)throw Error(`Remote events stream has no body`);this.eventStreamReader=t.getReader(),this.eventStreamConsumeTask=this.consumeEventStream()}async stopEventStream(){this.restartingEventStream=!0;try{this.eventStreamAbort?.abort();let e=this.eventStreamReader;if(e)try{await e.cancel()}catch{}this.eventStreamReader=null,this.eventStreamConsumeTask&&=(await this.eventStreamConsumeTask,null)}finally{this.restartingEventStream=!1}}async consumeEventStream(){if(this.eventStreamReader)try{for await(let{data:e}of mR(this.eventStreamReader)){if(this.closed)break;try{let t=JSON.parse(e);if(t.type===`message`){let e=t.data;this.settleSseResponseWait(e),this.onmessage?.(e,void 0)}else if(t.type===`fetch_request`&&this.options.onFetchRequest){let e=t.data;this.options.onFetchRequest({...e,timestamp:typeof e.timestamp==`string`?new Date(e.timestamp):e.timestamp})}else if(t.type===`fetch_request_body_update`&&this.options.onFetchResponseBody)this.options.onFetchResponseBody(t.data.id,t.data.responseBody);else if(t.type===`stdio_log`&&this.options.onStderr)this.options.onStderr({timestamp:new Date(t.data.timestamp),message:t.data.message});else if(t.type===`auth_challenge`)this.options.onAuthChallenge?.(t.data);else if(t.type===`transport_error`){let e=Error(t.data.error);t.data.code!==void 0&&(e.code=t.data.code),this.restartingEventStream||(this.onerror?.(e),this.closed||(this.closed=!0,this.onclose?.()))}}catch(e){this.onerror?.(e instanceof Error?e:Error(String(e)))}}}catch(e){!this.closed&&e instanceof Error&&e.name!==`AbortError`&&this.onerror?.(e)}finally{this.eventStreamReader=null,!this.closed&&!this.restartingEventStream&&(this.closed=!0,this.onclose?.())}}async send(e,t){return this.postSend(e,t,0)}async pushAuthState(e){if(!this._sessionId)throw Error(`Transport not started`);if(this.closed)throw Error(`Transport is closed`);let t=e??await this.buildAuthStateFromProvider();if(!t.oauthTokens&&!t.oauthClient)throw Error(`No auth state to push`);let n=await this.fetchFn(`${this.baseUrl}/api/mcp/auth-state`,{method:`POST`,headers:this.headers,body:JSON.stringify({sessionId:this._sessionId,authState:t})});if(!n.ok){let e=await n.text();throw Error(`Remote auth-state update failed (${n.status}): ${e}`)}let r=await n.json();if(!r.ok)throw Error(r.error??`Remote auth-state update failed`)}async buildAuthStateFromProvider(){if(!this.options.authProvider)throw Error(`No auth provider configured`);let e=await this.options.authProvider.tokens();if(!e)throw Error(`No OAuth tokens available`);return cR(e)}get sseResponseTimeoutMs(){return this.options.sseResponseTimeoutMs??lR}settleSseResponseWait(e){if(!(`id`in e)||e.id===null||e.id===void 0||!(`result`in e)&&!(`error`in e))return;let t=this.sseResponseWaits.get(e.id);t&&(this.sseResponseWaits.delete(e.id),t.resolve())}cancelSseResponseWait(e){let t=this.sseResponseWaits.get(e);t&&(this.sseResponseWaits.delete(e),t.reject(Error(`SSE response wait cancelled`)))}cancelAllSseWaits(e){for(let t of this.sseResponseWaits.values())t.reject(e);this.sseResponseWaits.clear()}waitForSseResponse(e){return new Promise((t,n)=>{let r=setTimeout(()=>{this.sseResponseWaits.delete(e),n(Error(`Timed out waiting for MCP response on SSE (${this.sseResponseTimeoutMs}ms)`))},this.sseResponseTimeoutMs);this.sseResponseWaits.set(e,{resolve:()=>{clearTimeout(r),t()},reject:e=>{clearTimeout(r),n(e)}})})}async postSend(e,t,n){let r=uR(e),i;r!==void 0&&(i=this.waitForSseResponse(r),i.catch(()=>{}));let a;try{a=await this.requestSend(e,t)}catch(e){throw r!==void 0&&this.cancelSseResponseWait(r),e}if(a.ok){i&&await i;return}if(r!==void 0&&this.cancelSseResponseWait(r),a.kind===`auth_challenge`){if(n>=1||!this.options.authRecovery?.pushAuthState)throw new cI(a.authChallenge,a.authChallenge.raw?.httpStatus??401);await this.recoverFromAuthChallenge(a.authChallenge,async()=>(await this.options.authRecovery.pushAuthState(),this.postSend(e,t,n+1)));return}throw Error(a.error)}async requestSend(e,t){if(!this._sessionId)throw Error(`Transport not started`);if(this.closed)throw Error(`Transport is closed`);let n={sessionId:this._sessionId,message:e,...t?.relatedRequestId!=null&&{relatedRequestId:t.relatedRequestId},...t?.headers!=null&&{headers:t.headers},...this._protocolVersion!==void 0&&{protocolVersion:this._protocolVersion}},r=await this.fetchFn(`${this.baseUrl}/api/mcp/send`,{method:`POST`,headers:this.headers,body:JSON.stringify(n)});if(!r.ok){let e=await r.text(),t=Error(`Remote send failed (${r.status}): ${e}`);throw t.status=r.status,t}return await r.json()}async close(){if(!this.closed){if(this.closed=!0,this.cancelAllSseWaits(Error(`Transport closed`)),await this.stopEventStream(),this._sessionId){try{await this.fetchFn(`${this.baseUrl}/api/mcp/disconnect`,{method:`POST`,headers:this.headers,body:JSON.stringify({sessionId:this._sessionId})})}catch{}this._sessionId=void 0}this.onclose?.()}}onclose;onerror;onmessage},gR={name:`mcp-inspector`,version:`0.0.0`},_R=5;function vR(){return Error(`Pending request aborted`)}var yR=`Tool call cancelled by user`,bR=500;async function xR(e){try{await e.close()}catch{}}function SR(e){if(typeof e==`object`&&e){let t=e.shape?.method?.value;if(typeof t==`string`)return t}}var CR=500,wR=15e3,TR=8,ER=class e extends GF{static MRTR_MAX_ROUNDS=10;client=null;appRendererClientProxy=null;outputValidator=null;transport=null;baseTransport=null;outboundRequestMethods=new Map;lastAnsweredRequestByMethod=new Map;transportHasAuthProvider=!1;ambientAuthChallengeInFlight=new Map;pipeStderr;initialLoggingLevel;modernLogLevel;sample;elicit;progress;resetTimeoutOnProgress;requestTimeout;defaultMetadata;serverSettings;versionNegotiation;status=`disconnected`;disconnecting=!1;capabilities;serverInfo;instructions;protocolVersion;protocolEra;discoverResult;excludedTools=[];clientCapabilities={};clientInfo;pendingSamples=[];pendingElicitations=[];roots;rootsCapabilityAdvertised;elicitationCapabilityAdvertised;samplingCapabilityAdvertised;tasksCapabilityAdvertised;urlElicitationCapabilityAdvertised;rootsListChangedCapabilityAdvertised;listChangedNotifications;subscribedResources=new Set;modernSubscription=null;modernListenGeneration=0;modernStreamState=VP;modernReconnectAttempts=0;modernReconnectTimer;cancelledTaskIds=new Set;taskInputAbortControllers=new Map;pendingRawWireRequests=new Map;rawWireRequestCounter=0;activeToolCallAbortController;receiverTasks;advertisedExtensions;receiverTaskTtlMs;receiverTaskRecords=new Map;oauthManager=null;logger;transportClientFactory;fetchFn;effectiveAuthFetch;sessionId;transportConfig;directAuthRecoveryActive=null;authRecoveryDepth=0;static MAX_NESTED_AUTH_RECOVERIES=3;directAuthRecovery;constructor(e,t){if(super(),this.transportConfig=e,this.transportClientFactory=t.environment.transport,this.fetchFn=t.environment.fetch,this.logger=t.environment.logger??xI,this.pipeStderr=t.pipeStderr??!1,this.initialLoggingLevel=t.initialLoggingLevel,this.sample=t.sample??!0,this.elicit=t.elicit??!0,this.receiverTasks=t.receiverTasks??!1,this.advertisedExtensions=t.advertisedExtensions,this.receiverTaskTtlMs=t.receiverTaskTtlMs??6e4,this.progress=t.progress??!0,this.resetTimeoutOnProgress=t.resetTimeoutOnProgress??!0,this.requestTimeout=t.timeout,this.defaultMetadata=t.defaultMetadata&&Object.keys(t.defaultMetadata).length>0?t.defaultMetadata:void 0,this.serverSettings=t.serverSettings,this.modernLogLevel=HP(t.serverSettings),this.versionNegotiation=t.versionNegotiation??{mode:`legacy`},this.directAuthRecovery=t.directAuthRecovery??!1,this.roots=t.roots===void 0?void 0:KP(t.roots),this.listChangedNotifications={tools:t.listChangedNotifications?.tools??!0,resources:t.listChangedNotifications?.resources??!0,prompts:t.listChangedNotifications?.prompts??!0},this.effectiveAuthFetch=this.buildEffectiveAuthFetch(),this.sessionId=t.sessionId,t.oauth||t.environment.oauth){let e={...t.environment.oauth,...t.oauth};this.oauthManager=new sR({getServerUrl:()=>this.getServerUrl(),effectiveAuthFetch:this.effectiveAuthFetch,getEventTarget:()=>this,onBeforeOAuthRedirect:e=>(this.sessionId=e,this.saveSession(),Promise.resolve()),initialConfig:e,enterpriseManagedAuth:t.enterpriseManagedAuth,installEnterpriseManagedAuth:t.installEnterpriseManagedAuth,dispatchOAuthComplete:e=>this.dispatchTypedEvent(`oauthComplete`,e),dispatchOAuthAuthorizationRequired:e=>this.dispatchTypedEvent(`oauthAuthorizationRequired`,e),dispatchOAuthError:e=>this.dispatchTypedEvent(`oauthError`,e)})}let n={versionNegotiation:this.versionNegotiation,inputRequired:{autoFulfill:!1}},r={};if(this.sample&&(r.sampling={}),this.elicit){let e={};this.elicit===!0?e.form={}:(this.elicit.form&&(e.form={}),this.elicit.url&&(e.url={})),Object.keys(e).length>0&&(r.elicitation=e)}if(this.roots!==void 0&&(r.roots={listChanged:!0}),this.receiverTasks){let e={};r.sampling&&(e.sampling={createMessage:{}}),r.elicitation&&(e.elicitation={create:{}}),r.tasks={list:{},cancel:{},...Object.keys(e).length>0&&{requests:e}}}let i=_re({enterpriseManaged:t.oauth?.enterpriseManaged??!1,advertised:this.advertisedExtensions});Object.keys(i).length>0&&(r.extensions={...r.extensions,...i}),n.capabilities=r,this.clientCapabilities=r,this.rootsCapabilityAdvertised=r.roots!==void 0,this.elicitationCapabilityAdvertised=r.elicitation!==void 0,this.samplingCapabilityAdvertised=r.sampling!==void 0,this.tasksCapabilityAdvertised=r.tasks!==void 0,this.urlElicitationCapabilityAdvertised=r.elicitation?.url!==void 0,this.rootsListChangedCapabilityAdvertised=r.roots?.listChanged===!0,this.appRendererClientProxy=null,this.clientInfo=t.clientIdentity??{name:gR.name.split(`/`)[1]??gR.name,version:gR.version},this.client=new kne(this.clientInfo,Object.keys(n).length>0?n:void 0)}buildEffectiveAuthFetch(){return NI(this.fetchFn??fetch,{trackRequest:e=>this.dispatchFetchRequest({...e,category:`auth`}),updateResponseBody:(e,t)=>this.dispatchFetchRequestBodyUpdate(e,t)})}createMessageTrackingCallbacks(){return{trackRequest:(e,t)=>{t===`client`&&this.outboundRequestMethods.set(e.id,e.method);let n={id:crypto.randomUUID(),timestamp:new Date,direction:`request`,origin:t,message:e};this.dispatchTypedEvent(`message`,n)},trackResponse:(e,t)=>{let n=e.id;if(t===`server`&&n!==void 0){let e=this.outboundRequestMethods.get(n);this.outboundRequestMethods.delete(n),e!==void 0&&this.lastAnsweredRequestByMethod.set(e,n)}let r={id:crypto.randomUUID(),timestamp:new Date,direction:`response`,origin:t,message:e};this.dispatchTypedEvent(`message`,r)},trackNotification:(e,t)=>{let n={id:crypto.randomUUID(),timestamp:new Date,direction:`notification`,origin:t,message:e};this.dispatchTypedEvent(`message`,n)}}}attachTransportListeners(e){e.onclose=()=>{this.disconnecting||this.status!==`disconnected`&&(this.status!==`error`&&(this.status=`disconnected`,this.dispatchTypedEvent(`statusChange`,this.status)),this.clearAndAnnouncePendingPeerRequests(),this.rejectPendingRawWireRequests(`Connection closed`),this.dispatchTypedEvent(`disconnect`))},e.onerror=e=>{this.status!==`connecting`&&(this.status=`error`,this.dispatchTypedEvent(`statusChange`,this.status),this.dispatchTypedEvent(`error`,e))}}mergeMeta(e){let t=this.defaultMetadata,n=this.protocolEra===`modern`&&this.modernLogLevel?{[AT]:this.modernLogLevel}:void 0,r={...t??{},...n??{},...e??{}};return Object.keys(r).length>0?r:void 0}getRequestOptions(e,t){let n={resetTimeoutOnProgress:this.resetTimeoutOnProgress};if(this.requestTimeout!==void 0&&(n.timeout=this.requestTimeout),t&&(n.signal=t),this.progress){let t=e;n.onprogress=e=>{let n={...e,...t!=null&&{progressToken:t}};this.dispatchTypedEvent(`progressNotification`,n)}}return n}getCacheableRequestOptions(e){let t=this.getRequestOptions();return e!==void 0&&(t.cacheMode=e),t}aggregateListParams(e){let t=this.mergeMeta(e);return t?{_meta:t}:void 0}isHttpOAuthConfig(){let e=RP(this.transportConfig);return(e===`sse`||e===`streamable-http`)&&!!this.oauthManager}static isTerminalTaskStatus(e){return e===`completed`||e===`failed`||e===`cancelled`}installReceiverTaskResponseBypass(e,t){if(!this.client)return;let n=this.client,r=n._requestHandlers.get(e);r&&n._requestHandlers.set(e,(e,n)=>{let i=e?.params?.task;return this.tasksCapabilityAdvertised&&i!=null?t(e):r(e,n)})}createReceiverTask(e){let t=crypto.randomUUID(),n=e.ttl??(typeof this.receiverTaskTtlMs==`function`?this.receiverTaskTtlMs():this.receiverTaskTtlMs),r=new Date().toISOString(),i={taskId:t,status:e.initialStatus,ttl:n,createdAt:r,lastUpdatedAt:r,...e.pollInterval!=null&&{pollInterval:e.pollInterval},...e.statusMessage!=null&&{statusMessage:e.statusMessage}},a,o,s=new Promise((e,t)=>{a=e,o=t});s.catch(()=>{});let c={task:i,payloadPromise:s,resolvePayload:a,rejectPayload:o};return c.cleanupTimeoutId=setTimeout(()=>{c.cleanupTimeoutId=void 0,this.receiverTaskRecords.delete(t)},n),this.receiverTaskRecords.set(t,c),c}emitReceiverTaskStatus(e){if(this.client)try{let t=SO.parse({method:`notifications/tasks/status`,params:e});this.client.notification(t).catch(t=>{this.logger.warn({err:t,taskId:e.taskId},`receiver task status notification failed`)})}catch(t){this.logger.warn({err:t,taskId:e.taskId},`receiver task status notification failed`)}}upsertReceiverTask(e){let t=this.receiverTaskRecords.get(e.taskId);t&&(t.task=e,this.emitReceiverTaskStatus(e))}getReceiverTask(e){return this.receiverTaskRecords.get(e)}listReceiverTasks(){return Array.from(this.receiverTaskRecords.values()).map(e=>e.task)}async getReceiverTaskPayload(e){let t=this.receiverTaskRecords.get(e);if(!t)throw new Bk(zk.InvalidParams,`Unknown taskId: ${e}`);return t.payloadPromise}cancelReceiverTask(t){let n=this.receiverTaskRecords.get(t);if(!n)throw new Bk(zk.InvalidParams,`Unknown taskId: ${t}`);if(e.isTerminalTaskStatus(n.task.status))return n.task;let r=new Date().toISOString(),i={...n.task,status:`cancelled`,lastUpdatedAt:r};return n.task=i,n.rejectPayload(Error(`Task cancelled`)),n.cleanupTimeoutId!=null&&(clearTimeout(n.cleanupTimeoutId),n.cleanupTimeoutId=void 0),this.emitReceiverTaskStatus(i),i}async dropCachedTransport(){if(!this.baseTransport&&!this.transport){this.transportHasAuthProvider=!1;return}try{await this.client?.close()}catch{}this.baseTransport=null,this.transport=null,this.transportHasAuthProvider=!1}registerPeerRequestHandlers(){if(this.samplingCapabilityAdvertised&&this.client){let e=e=>{let t=e.params?.task;if(this.tasksCapabilityAdvertised&&t!=null){let n=this.createReceiverTask({ttl:t.ttl,initialStatus:`input_required`,statusMessage:`Awaiting user input`});(async()=>{let t=new KF(e,e=>{n.resolvePayload(e);let t=new Date().toISOString(),r={...n.task,status:`completed`,lastUpdatedAt:t};n.task=r,this.upsertReceiverTask(r)},e=>{n.rejectPayload(e);let t=new Date().toISOString(),r={...n.task,status:`failed`,lastUpdatedAt:t,statusMessage:e instanceof Error?e.message:String(e)};n.task=r,this.upsertReceiverTask(r)},e=>this.removePendingSample(e));this.addPendingSample(t)})();let r={task:n.task};return Promise.resolve(r)}return this.enqueuePendingSample(e,`server-request`)};this.client.setRequestHandler(`sampling/createMessage`,e),this.tasksCapabilityAdvertised&&this.installReceiverTaskResponseBypass(`sampling/createMessage`,e)}if(this.elicitationCapabilityAdvertised&&this.client){let e=e=>{let t=e.params?.task;if(this.tasksCapabilityAdvertised&&t!=null){let n=this.createReceiverTask({ttl:t.ttl,initialStatus:`input_required`,statusMessage:`Awaiting user input`});(async()=>{let t=new qF(e,e=>{n.resolvePayload(e);let t=new Date().toISOString(),r={...n.task,status:`completed`,lastUpdatedAt:t};n.task=r,this.upsertReceiverTask(r)},e=>this.removePendingElicitation(e),e=>{n.rejectPayload(e);let t=new Date().toISOString(),r={...n.task,status:`failed`,lastUpdatedAt:t,statusMessage:e.message};n.task=r,this.upsertReceiverTask(r)});this.addPendingElicitation(t)})();let r={task:n.task};return Promise.resolve(r)}return this.enqueuePendingElicitation(e,`server-request`)};this.client.setRequestHandler(`elicitation/create`,e),this.tasksCapabilityAdvertised&&this.installReceiverTaskResponseBypass(`elicitation/create`,e)}this.rootsCapabilityAdvertised&&this.client&&this.client.setRequestHandler(`roots/list`,async()=>({roots:this.roots??[]})),this.tasksCapabilityAdvertised&&this.client&&(this.client.setRequestHandler(`tasks/list`,{params:DO.shape.params},async()=>({tasks:this.listReceiverTasks()})),this.client.setRequestHandler(`tasks/get`,{params:CO.shape.params},async e=>{let t=this.getReceiverTask(e.taskId);if(!t)throw new Bk(zk.InvalidParams,`Unknown taskId: ${e.taskId}`);return t.task}),this.client.setRequestHandler(`tasks/result`,{params:TO.shape.params},async e=>this.getReceiverTaskPayload(e.taskId)),this.client.setRequestHandler(`tasks/cancel`,{params:kO.shape.params},async e=>this.cancelReceiverTask(e.taskId)))}registerPeerNotificationHandlers(){this.client&&this.client.setNotificationHandler(`notifications/roots/list_changed`,async()=>{this.dispatchTypedEvent(`rootsChange`,[...this.roots??[]])})}clearReceiverTasks(){for(let e of this.receiverTaskRecords.values())e.cleanupTimeoutId!=null&&clearTimeout(e.cleanupTimeoutId);this.receiverTaskRecords.clear()}resetSubscriptionStream(){let e=this.modernSubscription;this.subscribedResources.clear(),this.modernListenGeneration++,this.clearModernReconnectTimer(),this.modernReconnectAttempts=0,this.modernSubscription=null,this.setModernStreamState(VP),this.dispatchSubscriptionsChange(),e&&xR(e)}resetSessionState(){this.clearReceiverTasks(),this.resetSubscriptionStream(),this.cancelledTaskIds.clear(),this.outboundRequestMethods.clear(),this.lastAnsweredRequestByMethod.clear();for(let[,e]of this.taskInputAbortControllers)e.abort(Error(`Connection ended`));this.taskInputAbortControllers.clear(),this.modernLogLevel=HP(this.serverSettings)}clearPendingPeerRequests(){for(let e of this.pendingSamples)e.cancel();this.pendingSamples=[];for(let e of this.pendingElicitations)e.cancel();this.pendingElicitations=[]}clearAndAnnouncePendingPeerRequests(){(this.pendingSamples.length!==0||this.pendingElicitations.length!==0)&&(this.clearPendingPeerRequests(),this.dispatchTypedEvent(`pendingSamplesChange`,this.pendingSamples),this.dispatchTypedEvent(`pendingElicitationsChange`,this.pendingElicitations))}async connect(){if(!this.client)throw Error(`Client not initialized`);if(this.status===`connected`)return;this.resetSessionState(),this.clearAndAnnouncePendingPeerRequests(),this.rejectPendingRawWireRequests(`Connection ended`);let e=this.oauthManager;if(this.baseTransport&&this.isHttpOAuthConfig()&&e&&!this.transportHasAuthProvider&&!e.isEnterpriseManaged()&&await e.isOAuthAuthorized()&&await this.dropCachedTransport(),!this.baseTransport){let t={fetchFn:this.fetchFn,pipeStderr:this.pipeStderr,onStderr:e=>{this.dispatchStderrLog(e)},onFetchRequest:e=>{this.dispatchFetchRequest({...e,category:`transport`})},onFetchResponseBody:(e,t)=>{this.dispatchFetchRequestBodyUpdate(e,t)},...this.serverSettings&&{settings:this.serverSettings}};if(this.isHttpOAuthConfig()&&e)if(e.isEnterpriseManaged()){await e.trySilentEnterpriseManagedAuth();let n=await e.createOAuthProviderForTransport();if(!(await n.tokens())?.access_token){let e=Error(`Unauthorized: EMA resource access token unavailable`);throw e.status=401,e.code=401,e}t.authProvider=n}else await e.isOAuthAuthorized()&&(t.authProvider=await e.createOAuthProviderForTransport());this.directAuthRecovery&&this.directAuthRecoveryActive!==!1&&this.isHttpOAuthConfig()&&e&&(t.authProvider||this.probesProtocolEra())&&(t.interceptAuthChallenges=!0),this.transportHasAuthProvider=!!t.authProvider;let{transport:n}=this.transportClientFactory(this.transportConfig,t);this.baseTransport=n,this.directAuthRecovery&&(this.directAuthRecoveryActive=!(n instanceof hR)),n instanceof hR&&e&&this.isHttpOAuthConfig()&&(n.setAuthRecovery({handleAuthChallenge:(t,n)=>e.handleAuthChallenge(t,n),pushAuthState:()=>this.pushRemoteAuthState()}),n.setOnAuthChallenge(e=>{this.handleAmbientAuthChallenge(e)}));let r=this.createMessageTrackingCallbacks();this.transport=new ure(n,r,{rewriteIncomingResult:e=>this.rewriteModernTaskResult(e),consumeIncomingResponse:e=>this.consumeRawWireResponse(e)}),this.attachTransportListeners(this.baseTransport)}if(!this.transport)throw Error(`Transport not initialized`);try{this.status=`connecting`,this.dispatchTypedEvent(`statusChange`,this.status),this.registerPeerRequestHandlers(),this.registerPeerNotificationHandlers();let e=this.serverSettings?.connectionTimeout??0,t=this.client.connect(this.transport).catch(e=>{throw dI(e)??e}),n=!1,r=async r=>{if(r>0){if(n=!0,this.status!==`connected`)throw Error(`Connection closed during authorization recovery, after re-authorizing successfully`);return}if(e>0){t.catch(()=>{});let n,r=new Promise((t,r)=>{n=setTimeout(()=>r(Error(`Connection timed out after ${e} ms`)),e)});try{await Promise.race([t,r])}finally{n&&clearTimeout(n)}}else await t};try{await this.invokeMcpClient(r)}catch(t){throw e>0&&await this.disconnect().catch(()=>{}),t}if(n)return;this.status=`connected`,this.dispatchTypedEvent(`statusChange`,this.status),await this.fetchServerInfo(),this.initialLoggingLevel&&this.capabilities?.logging&&await this.client.setLoggingLevel(this.initialLoggingLevel,this.getRequestOptions()),this.client&&(this.listChangedNotifications.tools&&this.capabilities?.tools?.listChanged&&this.client.setNotificationHandler(`notifications/tools/list_changed`,async()=>{this.dispatchTypedEvent(`toolsListChanged`)}),this.listChangedNotifications.resources&&this.capabilities?.resources?.listChanged&&this.client.setNotificationHandler(`notifications/resources/list_changed`,async()=>{this.dispatchTypedEvent(`resourcesListChanged`),this.dispatchTypedEvent(`resourceTemplatesListChanged`)}),this.listChangedNotifications.prompts&&this.capabilities?.prompts?.listChanged&&this.client.setNotificationHandler(`notifications/prompts/list_changed`,async()=>{this.dispatchTypedEvent(`promptsListChanged`)}),this.capabilities?.tasks&&(this.client.setNotificationHandler(`notifications/tasks/list_changed`,{params:HF.shape.params},async()=>{this.dispatchTypedEvent(`tasksListChanged`)}),this.client.setNotificationHandler(`notifications/tasks/status`,{params:SO.shape.params},async e=>{let t=e;this.dispatchTypedEvent(`taskStatusChange`,{taskId:t.taskId,task:t})})),this.capabilities?.resources?.subscribe===!0&&this.client.setNotificationHandler(`notifications/resources/updated`,async e=>{let t=e.params.uri;this.subscribedResources.has(t)&&this.dispatchTypedEvent(`resourceUpdated`,{uri:t})}),this.urlElicitationCapabilityAdvertised&&this.client.setNotificationHandler(`notifications/elicitation/complete`,async e=>{let{elicitationId:t}=e.params,n=this.pendingElicitations.find(e=>e.request.params?.mode===`url`&&e.request.params?.elicitationId===t);n&&n.completeIfPending()})),await this.openModernListenStreamOnConnect(),this.status===`connected`&&!this.disconnecting&&this.dispatchTypedEvent(`connect`)}catch(e){throw uI(e)||(this.status=`error`,this.dispatchTypedEvent(`statusChange`,this.status)),this.baseTransport&&!this.transportHasAuthProvider&&await this.dropCachedTransport(),this.clearAndAnnouncePendingPeerRequests(),e}}async disconnect(e=0){this.disconnecting=!0;try{if(this.client){if(e>0){let t=this.client._responseHandlers,n=Date.now()+e;for(;t?.size!==void 0&&t.size>0&&Date.now()<n;)await new Promise(e=>setTimeout(e,10))}try{await this.client.close()}catch{}}}finally{this.disconnecting=!1}this.baseTransport=null,this.transport=null,this.transportHasAuthProvider=!1,this.clearPendingPeerRequests(),this.status!==`disconnected`&&(this.status=`disconnected`,this.dispatchTypedEvent(`statusChange`,this.status),this.dispatchTypedEvent(`disconnect`)),this.resetSubscriptionStream(),this.cancelledTaskIds.clear(),this.rejectPendingRawWireRequests(`Disconnected`);for(let[,e]of this.taskInputAbortControllers)e.abort(Error(`Disconnected`));this.taskInputAbortControllers.clear(),this.activeToolCallAbortController?.abort(`Disconnected`),this.activeToolCallAbortController=void 0,this.clearReceiverTasks(),this.appRendererClientProxy=null,this.capabilities=void 0,this.serverInfo=void 0,this.instructions=void 0,this.protocolVersion=void 0,this.protocolEra=void 0,this.discoverResult=void 0,this.excludedTools=[],this.modernLogLevel=void 0,this.dispatchTypedEvent(`pendingSamplesChange`,this.pendingSamples),this.dispatchTypedEvent(`pendingElicitationsChange`,this.pendingElicitations),this.dispatchTypedEvent(`capabilitiesChange`,this.capabilities),this.dispatchTypedEvent(`serverInfoChange`,this.serverInfo),this.dispatchTypedEvent(`instructionsChange`,this.instructions),this.dispatchTypedEvent(`protocolVersionChange`,this.protocolVersion),this.dispatchTypedEvent(`protocolEraChange`,this.protocolEra),this.dispatchTypedEvent(`discoverResultChange`,this.discoverResult),this.dispatchTypedEvent(`excludedToolsChange`,this.excludedTools)}getAppRendererClient(){if(!this.client||this.status!==`connected`)return null;if(this.appRendererClientProxy!==null)return this.appRendererClientProxy;let e=this.client;return this.appRendererClientProxy=new Proxy(this.client,{get(t,n,r){let i=Reflect.get(t,n,r);return n===`setNotificationHandler`&&typeof i==`function`?(t,...n)=>{let r=typeof t==`string`?t:SR(t)??t;return i.apply(e,[r,...n])}:i}}),this.appRendererClientProxy}async ping(){if(!this.client)throw Error(`Client not initialized`);await this.client.request({method:`ping`},$T,this.getRequestOptions())}getStatus(){return this.status}getTransportConfig(){return this.transportConfig}getServerType(){return RP(this.transportConfig)}getTaskCapabilities(){if(this.capabilities?.tasks)return{list:!!this.capabilities.tasks.list,cancel:!!this.capabilities.tasks.cancel}}isTasksExtensionNegotiated(){return this.isModernEra()&&this.capabilities?.extensions?.[`io.modelcontextprotocol/tasks`]!==void 0}withModernTaskEnvelope(e){let t=e._meta??{},n={...this.clientCapabilities,extensions:{...this.clientCapabilities.extensions,[qP]:{}}},r=this.getProtocolVersion()??`2026-07-28`;return{...e,_meta:{...t,[TT]:r,[ET]:this.clientInfo,[OT]:n}}}rewriteModernTaskResult(e){if(!dre(e.result))return e;let t=e.result;return{...e,result:{resultType:`complete`,content:[{type:`text`,text:`Modern task ${t.taskId} created`}],_meta:{[JP]:t}}}}async rawWireRequest(e,t,n){let r=this.transport;if(!r)throw Error(`Client is not connected`);let i=`inspector-ext-${this.rawWireRequestCounter+=1}`,a={jsonrpc:`2.0`,id:i,method:e,params:t},o=this.requestTimeout??3e4,s=await new Promise((t,n)=>{let s=setTimeout(()=>{this.pendingRawWireRequests.delete(i),n(Error(`Raw request "${e}" timed out after ${o} ms`))},o);this.pendingRawWireRequests.set(i,{resolve:t,reject:n,timer:s}),r.send(a).catch(e=>{let t=this.pendingRawWireRequests.get(i);t&&(clearTimeout(t.timer),this.pendingRawWireRequests.delete(i)),n(e instanceof Error?e:Error(String(e)))})});return n.parse(s)}consumeRawWireResponse(e){let t=String(e.id),n=this.pendingRawWireRequests.get(t);if(!n)return!1;if(this.pendingRawWireRequests.delete(t),clearTimeout(n.timer),`error`in e){let r=e.error;n.reject(Error(r?.message??`Request ${t} failed`))}else n.resolve(e.result);return!0}rejectPendingRawWireRequests(e){for(let[,t]of this.pendingRawWireRequests)clearTimeout(t.timer),t.reject(Error(e));this.pendingRawWireRequests.clear()}async getRequestorTask(e){if(!this.client)throw Error(`Client is not connected`);if(this.isTasksExtensionNegotiated()){let t=XP(await this.rawWireRequest(`tasks/get`,this.withModernTaskEnvelope({taskId:e}),YP));return this.dispatchTypedEvent(`requestorTaskUpdated`,{taskId:t.taskId,task:t}),t}let t=await this.client.request({method:`tasks/get`,params:{taskId:e}},wO,this.getRequestOptions());return this.dispatchTypedEvent(`requestorTaskUpdated`,{taskId:t.taskId,task:t}),t}async getRequestorTaskResult(e){if(!this.client)throw Error(`Client is not connected`);return await this.client.request({method:`tasks/result`,params:{taskId:e}},xD,this.getRequestOptions())}async cancelRequestorTask(e){if(!this.client)throw Error(`Client is not connected`);this.cancelledTaskIds.add(e);let t=this.taskInputAbortControllers.get(e);t&&t.abort(Error(`Task ${e} cancelled by user`)),this.isTasksExtensionNegotiated()?await this.rawWireRequest(`tasks/cancel`,this.withModernTaskEnvelope({taskId:e}),mre):await this.client.request({method:`tasks/cancel`,params:{taskId:e}},AO,this.getRequestOptions()),this.dispatchTypedEvent(`taskCancelled`,{taskId:e})}async updateRequestorTask(e,t){if(!this.client)throw Error(`Client is not connected`);await this.rawWireRequest(`tasks/update`,this.withModernTaskEnvelope({taskId:e,inputResponses:t}),pre)}cancelToolCall(){let e=this.activeToolCallAbortController;return e?(this.activeToolCallAbortController=void 0,e.abort(yR),!0):!1}async listRequestorTasks(e){if(!this.client)throw Error(`Client is not connected`);let t=await this.client.request({method:`tasks/list`,params:e?{cursor:e}:{}},OO,this.getRequestOptions());return{tasks:t.tasks,nextCursor:t.nextCursor}}enqueuePendingSample(e,t,n){return new Promise((r,i)=>{let a=new KF(e,r,i,e=>this.removePendingSample(e),t);this.addPendingSample(a),this.wirePendingAbort(n,()=>{this.removePendingSample(a.id),i(vR())})})}enqueuePendingElicitation(e,t,n){return new Promise((r,i)=>{let a=new qF(e,r,e=>this.removePendingElicitation(e),i,t);this.addPendingElicitation(a),this.wirePendingAbort(n,()=>{this.removePendingElicitation(a.id),i(vR())})})}wirePendingAbort(e,t){if(e){if(e.aborted){t();return}e.addEventListener(`abort`,t,{once:!0})}}async requestWithInputRequired(t,n,r,i){let a=this.client;if(!a)throw Error(`Client is not connected`);let o=wj(r),s=i.signal,c=0,l=n;for(;;){let r=await a.request({method:t,params:l},o,{...i,allowInputRequired:!0});if(!PA(r))return r;if(c+=1,c>e.MRTR_MAX_ROUNDS)throw Error(`Multi-round-trip "${t}" exceeded ${e.MRTR_MAX_ROUNDS} input_required rounds without completing.`);let u=await this.fulfilInputRequests(r.inputRequests,s);l={...n,...u?{inputResponses:u}:{},...r.requestState===void 0?{}:{requestState:r.requestState}}}}async fulfilInputRequests(e,t,n=`input-required`){if(!e)return;let r={};for(let[i,a]of Object.entries(e))r[i]=await this.fulfilEmbeddedInputRequest(a,t,n);return r}async fulfilEmbeddedInputRequest(e,t,n=`input-required`){switch(e.method){case`roots/list`:return{roots:this.roots??[]};case`elicitation/create`:return this.enqueuePendingElicitation(e,n,t);case`sampling/createMessage`:return this.enqueuePendingSample(e,n,t);default:throw Error(`Unsupported embedded input_required request method: ${e.method}`)}}getPendingSamples(){return[...this.pendingSamples]}addPendingSample(e){this.pendingSamples.push(e),this.dispatchTypedEvent(`pendingSamplesChange`,this.pendingSamples),this.dispatchTypedEvent(`newPendingSample`,e)}removePendingSample(e){let t=this.pendingSamples.findIndex(t=>t.id===e);t!==-1&&(this.pendingSamples.splice(t,1),this.dispatchTypedEvent(`pendingSamplesChange`,this.pendingSamples))}getPendingElicitations(){return[...this.pendingElicitations]}addPendingElicitation(e){this.pendingElicitations.push(e),this.dispatchTypedEvent(`pendingElicitationsChange`,this.pendingElicitations),this.dispatchTypedEvent(`newPendingElicitation`,e)}removePendingElicitation(e){let t=this.pendingElicitations.findIndex(t=>t.id===e);t!==-1&&(this.pendingElicitations.splice(t,1),this.dispatchTypedEvent(`pendingElicitationsChange`,this.pendingElicitations))}getCapabilities(){return this.capabilities}getClientCapabilities(){return this.clientCapabilities}getServerInfo(){return this.serverInfo}getInstructions(){return this.instructions}getProtocolVersion(){return this.protocolVersion}getProtocolEra(){return this.protocolEra}getDiscoverResult(){return this.discoverResult}getServerSettings(){return this.serverSettings}setServerSettings(e){this.serverSettings=e}async setLoggingLevel(e){if(!this.client)throw Error(`Client is not connected`);if(!this.capabilities?.logging)throw Error(`Server does not support logging`);await this.client.setLoggingLevel(e,this.getRequestOptions())}setModernLogLevel(e){this.modernLogLevel=e}getModernLogLevel(){return this.modernLogLevel}async listTools(e,t){if(!this.client)throw Error(`Client is not connected`);let n=this.mergeMeta(t),r={...n?{_meta:n}:{},...e?{cursor:e}:{}},i=await this.invokeMcpClient(()=>this.client.request({method:`tools/list`,params:r},bD,this.getRequestOptions(t?.progressToken)));return{tools:[...i.tools||[]],nextCursor:i.nextCursor}}async listAllTools(e){if(!this.client)throw Error(`Client is not connected`);let t=await this.invokeMcpClient(()=>this.client.listTools(this.aggregateListParams(e?.metadata),this.getCacheableRequestOptions(e?.cacheMode)));return await this.refreshExcludedTools(e?.metadata).catch(e=>{this.logger.warn({err:e},`Excluded-tools walk failed; the SEP-2243 excluded list may be incomplete`)}),{tools:[...t.tools]}}excludesInvalidXMcpHeaderTools(){return this.isModernEra()&&this.getServerType()!==`stdio`}markResponseRejected(e,t){let n=this.lastAnsweredRequestByMethod.get(e);n!==void 0&&this.dispatchTypedEvent(`responseRejected`,{id:n,reason:t})}getExcludedTools(){return this.excludedTools}async refreshExcludedTools(e){let t=[];if(this.excludesInvalidXMcpHeaderTools()){let n=new Set,r;do{let i=await this.listTools(r,e);for(let e of i.tools){let n=FP(e.inputSchema);n.valid||t.push({tool:e,reason:n.reason})}if(r=i.nextCursor,r!==void 0){if(n.has(r))break;n.add(r)}}while(r!==void 0)}return this.excludedTools=t,this.dispatchTypedEvent(`excludedToolsChange`,t),t}async callTool(e,t,n,r,i,a){if(!this.client)throw Error(`Client is not connected`);if(e.execution?.taskSupport===`required`)throw Error(`Tool "${e.name}" requires task support. Use callToolStream() instead of callTool().`);let o={tool:e,args:t,generalMetadata:n,toolSpecificMetadata:r,taskOptions:i,options:a},s=new AbortController;this.activeToolCallAbortController=s;try{return await this.callToolWithRetries(o,s)}finally{this.activeToolCallAbortController===s&&(this.activeToolCallAbortController=void 0)}}async callToolWithRetries(e,t){let{tool:n,args:r,generalMetadata:i,toolSpecificMetadata:a}=e,o=0,s=new Set;for(;;)try{return await this.attemptToolCall(e,t.signal)}catch(e){if(t.signal.aborted&&t.signal.reason===yR)throw new XF(n.name);let c=YF(e);if(c&&c.length>0&&o<_R){let e=c.find(e=>s.has(e.url));if(e){let t=new JF(e.url);throw this.dispatchFailedToolCall(n,r,i,a,t.message),t}o++;for(let e of c)s.add(e.url);let t=await this.runUrlElicitations(c);if(t===`accept`)continue;let l=Error(`Tool call cancelled: required URL elicitation was ${t===`decline`?`declined`:`cancelled`}.`);throw this.dispatchFailedToolCall(n,r,i,a,l.message),l}throw c&&c.length>0&&this.logger.warn({tool:n.name,attempts:o},`Tool "${n.name}" still required URL elicitations after ${_R} attempts; giving up.`),this.dispatchFailedToolCall(n,r,i,a,e instanceof Error?e.message:String(e)),e}}convertStringToolArgs(e,t){let n={};for(let[e,r]of Object.entries(t))typeof r==`string`&&(n[e]=r);return Object.keys(n).length===0?t:{...t,...Qne(e,n)}}applyMirroredParamHeaders(e,t,n){if(this.protocolEra!==`modern`)return;let r=Une(e,t);Object.keys(r).length!==0&&(n.headers={...n.headers,...r})}async attemptToolCall(e,t){let{tool:n,args:r,generalMetadata:i,toolSpecificMetadata:a,taskOptions:o,options:s}=e;if(!this.client)throw Error(`Client is not connected`);let c=this.convertStringToolArgs(n,r),l=i||a?{...i||{},...a||{}}:void 0,u=new Date,d=this.mergeMeta(l),f={name:n.name,arguments:c,_meta:d};o?.ttl!=null&&(f.task={ttl:o.ttl});let p=this.getRequestOptions(d?.progressToken,t);this.applyMirroredParamHeaders(n,c,p);let m=await this.invokeMcpClient(()=>this.requestWithInputRequired(`tools/call`,f,xD,p),{method:`tools/call`,toolName:n.name}),h=m._meta?.[JP],g=h?await this.pollModernTaskToTermination(h):m,_=this.validateToolOutput(n,g);if(_&&!s?.skipOutputValidation)throw new Bk(zk.InvalidParams,_);let v={toolName:n.name,params:r,result:g,timestamp:u,success:!0,metadata:d,outputValidationError:_};return this.dispatchTypedEvent(`toolCallResultChange`,{toolName:n.name,params:r,result:v.result,timestamp:u,success:!0,metadata:d,outputValidationError:_}),v}dispatchFailedToolCall(e,t,n,r,i){let a=n||r?{...n||{},...r||{}}:void 0,o=this.mergeMeta(a);this.dispatchTypedEvent(`toolCallResultChange`,{toolName:e.name,params:t,result:null,timestamp:new Date,success:!1,error:i,metadata:o})}async runUrlElicitations(e){for(let t of e){let e=await this.awaitUrlElicitation(t);if(e!==`accept`)return e}return`accept`}awaitUrlElicitation(e){return new Promise(t=>{let n=new qF({method:`elicitation/create`,params:e},e=>t(e.action),e=>this.removePendingElicitation(e));this.addPendingElicitation(n)})}validateToolOutput(e,t){return this.outputValidator??=new BF,VF(this.outputValidator,e,t)}async submitModernTaskInput(t,n,r,i){if(n.status!==`input_required`)return r;let a=r+1;if(a>e.MRTR_MAX_ROUNDS)throw Error(`Modern task "${n.taskId}" exceeded ${e.MRTR_MAX_ROUNDS} input_required rounds without completing.`);let o=await this.fulfilInputRequests(this.tagInputRequestsWithTask(hre(t),n.taskId),i,`task-input-required`);return o&&await this.updateRequestorTask(n.taskId,o),a}tagInputRequestsWithTask(e,t){if(!e)return e;let n={};for(let[r,i]of Object.entries(e)){let e=i;n[r]={...e,params:{...e.params,_meta:{...e.params?._meta,[wT]:{taskId:t}}}}}return n}modernTaskTerminalOutcome(e,t){return e.status===`completed`?{type:`result`,result:t.result??{content:[]}}:{type:`error`,error:new Bk(zk.InternalError,e.statusMessage??`Task ${e.status}`)}}taskPollInterval(e){let t=e.pollInterval;return typeof t==`number`&&t>0?t:bR}registerTaskInputAbort(e){let t=new AbortController;return this.taskInputAbortControllers.set(e,t),{signal:t.signal,release:()=>{this.taskInputAbortControllers.get(e)===t&&this.taskInputAbortControllers.delete(e)}}}async pollModernTaskToTermination(t){let n=t,r=XP(n),i=e=>{this.dispatchTypedEvent(`toolCallTaskUpdated`,{taskId:e.taskId,task:e}),this.dispatchTypedEvent(`requestorTaskUpdated`,{taskId:e.taskId,task:e})};i(r);let{signal:a,release:o}=this.registerTaskInputAbort(r.taskId);try{let t=0;for(;!e.isTerminalTaskStatus(r.status);)t=await this.submitModernTaskInput(n,r,t,a),await new Promise(e=>setTimeout(e,this.taskPollInterval(r))),n=await this.rawWireRequest(`tasks/get`,this.withModernTaskEnvelope({taskId:r.taskId}),YP),r=XP(n),i(r)}finally{o()}let s=this.modernTaskTerminalOutcome(r,n);if(s.type===`error`)throw s.error;return s.result}async*pollTaskToolCall(t,n){if(!this.client)throw Error(`Client is not connected`);let r=this.client,i=r._progressHandlers,a=new Set(i.keys()),o=this.isTasksExtensionNegotiated(),s=r.request({method:`tools/call`,params:t},o?xD:bO.or(xD),n),c=n.onprogress?[...i.keys()].find(e=>!a.has(e)):void 0,l=await s;if(o){let t=l._meta?.[JP];if(!t){yield{type:`result`,result:l};return}let r=t,a=XP(r);yield{type:`taskCreated`,task:a},c!=null&&n.onprogress&&i.set(c,n.onprogress);let{signal:o,release:s}=this.registerTaskInputAbort(a.taskId),u=0;try{for(;!e.isTerminalTaskStatus(a.status);)u=await this.submitModernTaskInput(r,a,u,o),await new Promise(e=>setTimeout(e,this.taskPollInterval(a))),r=await this.rawWireRequest(`tasks/get`,this.withModernTaskEnvelope({taskId:a.taskId}),YP),a=XP(r),yield{type:`taskStatus`,task:a}}finally{s(),c!=null&&i.delete(c)}yield this.modernTaskTerminalOutcome(a,r);return}if(!(`task`in l)||l.task==null){yield{type:`result`,result:l};return}let u=l.task;yield{type:`taskCreated`,task:u},c!=null&&n.onprogress&&i.set(c,n.onprogress);try{for(;!e.isTerminalTaskStatus(u.status);)await new Promise(e=>setTimeout(e,this.taskPollInterval(u))),u=await r.request({method:`tasks/get`,params:{taskId:u.taskId}},wO,this.getRequestOptions()),yield{type:`taskStatus`,task:u}}finally{c!=null&&i.delete(c)}u.status===`completed`?yield{type:`result`,result:await r.request({method:`tasks/result`,params:{taskId:u.taskId}},xD,this.getRequestOptions())}:yield{type:`error`,error:new Bk(zk.InternalError,u.statusMessage??`Task ${u.status}`)}}async callToolStream(e,t,n,r,i){if(!this.client)throw Error(`Client is not connected`);try{let a=this.convertStringToolArgs(e,t),o=n||r?{...n||{},...r||{}}:void 0,s=new Date,c=this.mergeMeta(o),l={name:e.name,arguments:a};c&&(l._meta=c),i?.ttl!=null&&(l.task={ttl:i.ttl});let u,d,f,p=this.getRequestOptions(c?.progressToken);if(this.applyMirroredParamHeaders(e,a,p),this.progress){let e=p.onprogress;p.onprogress=t=>{e?.(t),d&&this.dispatchTypedEvent(`requestorTaskProgress`,{taskId:d,progress:t})}}let m=this.pollTaskToolCall(l,p);for await(let e of m)switch(e.type){case`taskCreated`:d=e.task.taskId,this.dispatchTypedEvent(`toolCallTaskUpdated`,{taskId:e.task.taskId,task:e.task}),this.dispatchTypedEvent(`requestorTaskUpdated`,{taskId:e.task.taskId,task:e.task});break;case`taskStatus`:d||=e.task.taskId,this.dispatchTypedEvent(`toolCallTaskUpdated`,{taskId:e.task.taskId,task:e.task}),this.dispatchTypedEvent(`requestorTaskUpdated`,{taskId:e.task.taskId,task:e.task});break;case`result`:if(u=e.result,d){let e={taskId:d,ttl:null,status:`completed`,statusMessage:`Task completed`,lastUpdatedAt:new Date().toISOString()};this.dispatchTypedEvent(`toolCallTaskUpdated`,{taskId:d,task:e,result:u}),this.dispatchTypedEvent(`requestorTaskUpdated`,{taskId:d,task:e,result:u})}break;case`error`:{let t=e.error.message||`Task execution failed`;if(f=Error(t),d){let n=this.cancelledTaskIds.has(d);this.cancelledTaskIds.delete(d);let r={taskId:d,ttl:null,status:n?`cancelled`:`failed`,statusMessage:n?`Client cancelled task execution.`:t,lastUpdatedAt:new Date().toISOString()};this.dispatchTypedEvent(`toolCallTaskUpdated`,{taskId:d,task:r,error:e.error}),this.dispatchTypedEvent(`requestorTaskUpdated`,{taskId:d,task:r,error:e.error})}break}}if(f)throw f;if(!u&&d)try{u=await this.client.request({method:`tasks/result`,params:{taskId:d}},xD,this.getRequestOptions())}catch(e){throw Error(`Tool call did not return a result: ${e instanceof Error?e.message:String(e)}`,{cause:e})}if(!u)throw Error(`Tool call did not return a result`);let h={toolName:e.name,params:t,result:u,timestamp:s,success:!0,metadata:c};return this.dispatchTypedEvent(`toolCallResultChange`,{toolName:e.name,params:t,result:h.result,timestamp:s,success:!0,metadata:c}),h}catch(i){let a=n||r?{...n||{},...r||{}}:void 0,o=new Date,s=this.mergeMeta(a);throw this.dispatchTypedEvent(`toolCallResultChange`,{toolName:e.name,params:t,result:null,timestamp:o,success:!1,error:i instanceof Error?i.message:String(i),metadata:s}),i}}async listResources(e,t){if(!this.client)throw Error(`Client is not connected`);let n=this.mergeMeta(t),r={...n?{_meta:n}:{},...e?{cursor:e}:{}},i=await this.invokeMcpClient(()=>this.client.request({method:`resources/list`,params:r},NE,this.getRequestOptions(t?.progressToken)));return{resources:i.resources||[],nextCursor:i.nextCursor}}async listAllResources(e){if(!this.client)throw Error(`Client is not connected`);return{resources:[...(await this.invokeMcpClient(()=>this.client.listResources(this.aggregateListParams(e?.metadata),this.getCacheableRequestOptions(e?.cacheMode)))).resources]}}async readResource(e,t){if(!this.client)throw Error(`Client is not connected`);let n=this.mergeMeta(t),r={uri:e,...n?{_meta:n}:{}},i={result:await this.invokeMcpClient(()=>this.requestWithInputRequired(`resources/read`,r,zE,this.getRequestOptions(t?.progressToken)),{method:`resources/read`}),timestamp:new Date,uri:e,metadata:n};return this.dispatchTypedEvent(`resourceContentChange`,{uri:e,content:i,timestamp:i.timestamp}),i}async readResourceFromTemplate(e,t,n){if(!this.client)throw Error(`Client is not connected`);let r=e,i;try{i=new cM(r).expand(t)}catch(t){throw Error(`Failed to expand URI template "${e}": ${t instanceof Error?t.message:String(t)}`,{cause:t})}let a=await this.readResource(i,n),o={uriTemplate:r,expandedUri:i,result:a.result,timestamp:a.timestamp,params:t,metadata:a.metadata};return this.dispatchTypedEvent(`resourceTemplateContentChange`,{uriTemplate:r,content:o,params:t,timestamp:o.timestamp}),o}async listResourceTemplates(e,t){if(!this.client)throw Error(`Client is not connected`);let n=this.mergeMeta(t),r={...n?{_meta:n}:{},...e?{cursor:e}:{}},i=await this.invokeMcpClient(()=>this.client.request({method:`resources/templates/list`,params:r},FE,this.getRequestOptions(t?.progressToken)),{method:`resources/templates/list`});return{resourceTemplates:i.resourceTemplates||[],nextCursor:i.nextCursor}}async listAllResourceTemplates(e){if(!this.client)throw Error(`Client is not connected`);return{resourceTemplates:[...(await this.invokeMcpClient(()=>this.client.listResourceTemplates(this.aggregateListParams(e?.metadata),this.getCacheableRequestOptions(e?.cacheMode)),{method:`resources/templates/list`})).resourceTemplates]}}async listPrompts(e,t){if(!this.client)throw Error(`Client is not connected`);let n=this.mergeMeta(t),r={...n?{_meta:n}:{},...e?{cursor:e}:{}},i=await this.invokeMcpClient(()=>this.client.request({method:`prompts/list`,params:r},rD,this.getRequestOptions(t?.progressToken)));return{prompts:i.prompts||[],nextCursor:i.nextCursor}}async listAllPrompts(e){if(!this.client)throw Error(`Client is not connected`);return{prompts:[...(await this.invokeMcpClient(()=>this.client.listPrompts(this.aggregateListParams(e?.metadata),this.getCacheableRequestOptions(e?.cacheMode)))).prompts]}}async getPrompt(e,t,n){if(!this.client)throw Error(`Client is not connected`);let r=t?$ne(t):{},i=this.mergeMeta(n),a={name:e,arguments:r,...i?{_meta:i}:{}},o={result:await this.invokeMcpClient(()=>this.requestWithInputRequired(`prompts/get`,a,mD,this.getRequestOptions(n?.progressToken)),{method:`prompts/get`,toolName:e}),timestamp:new Date,name:e,params:Object.keys(r).length>0?r:void 0,metadata:i};return this.dispatchTypedEvent(`promptContentChange`,{name:e,content:o,timestamp:o.timestamp}),o}async getCompletions(e,t,n,r,i){if(!this.client)return{values:[]};try{let a=this.mergeMeta(i),o={ref:e,argument:{name:t,value:n},...r?{context:{arguments:r}}:{},...a?{_meta:a}:{}},s=await this.invokeMcpClient(()=>this.client.complete(o,this.getRequestOptions(i?.progressToken)),{method:`completion/complete`,toolName:e.type===`ref/prompt`?e.name:e.uri});return{values:s.completion.values||[],total:s.completion.total,hasMore:s.completion.hasMore}}catch(e){if(e instanceof Bk&&e.code===zk.MethodNotFound||e instanceof Error&&(e.message.includes(`Method not found`)||e.message.includes(`does not support completions`)))return{values:[]};throw Error(`Failed to get completions: ${e instanceof Error?e.message:String(e)}`,{cause:e})}}async fetchServerInfo(){if(this.client)try{this.capabilities=this.client.getServerCapabilities(),this.dispatchTypedEvent(`capabilitiesChange`,this.capabilities),this.serverInfo=this.client.getServerVersion(),this.instructions=this.client.getInstructions(),this.dispatchTypedEvent(`serverInfoChange`,this.serverInfo),this.instructions!==void 0&&this.dispatchTypedEvent(`instructionsChange`,this.instructions),this.protocolEra=this.client.getProtocolEra(),this.dispatchTypedEvent(`protocolEraChange`,this.protocolEra),this.discoverResult=this.client.getDiscoverResult(),this.dispatchTypedEvent(`discoverResultChange`,this.discoverResult),this.protocolVersion=this.client.getNegotiatedProtocolVersion(),this.dispatchTypedEvent(`protocolVersionChange`,this.protocolVersion)}catch{}}dispatchStderrLog(e){this.dispatchTypedEvent(`stderrLog`,e)}dispatchFetchRequest(e){this.logger.info({component:`InspectorClient`,category:e.category,fetchRequest:{url:e.url,method:e.method,headers:e.requestHeaders,body:e.requestBody??`[no body]`},fetchResponse:e.error?{error:e.error}:{status:e.responseStatus,statusText:e.responseStatusText,headers:e.responseHeaders,body:e.responseBody}},`${e.category} fetch`),this.dispatchTypedEvent(`fetchRequest`,e)}dispatchFetchRequestBodyUpdate(e,t){this.dispatchTypedEvent(`fetchRequestBodyUpdate`,{id:e,responseBody:t})}getSessionId(){return this.sessionId}setSessionId(e){this.sessionId=e}saveSession(){this.sessionId&&this.dispatchTypedEvent(`saveSession`,{sessionId:this.sessionId})}getRoots(){return this.roots===void 0?[]:[...this.roots]}async setRoots(e){if(!this.client)throw Error(`Client is not connected`);if(this.roots=KP(e),this.dispatchTypedEvent(`rootsChange`,[...this.roots]),!this.rootsListChangedCapabilityAdvertised){this.logger.warn("setRoots() on a client that did not advertise `roots.listChanged`; roots are stored locally but the change is not announced");return}try{await this.client.notification({method:`notifications/roots/list_changed`})}catch(e){this.logger.error({error:e},`Failed to send roots/list_changed notification`)}}getSubscribedResources(){return Array.from(this.subscribedResources)}isSubscribedToResource(e){return this.subscribedResources.has(e)}supportsResourceSubscriptions(){return this.capabilities?.resources?.subscribe===!0}isModernEra(){return this.protocolEra===`modern`}getResourceSubscriptionStreamState(){return this.modernStreamState}setModernStreamState(e){this.modernStreamState=e,this.dispatchTypedEvent(`resourceSubscriptionStreamChange`,e)}dispatchSubscriptionsChange(){this.dispatchTypedEvent(`resourceSubscriptionsChange`,Array.from(this.subscribedResources))}buildSubscriptionFilter(){let e={};return this.subscribedResources.size>0&&(e.resourceSubscriptions=Array.from(this.subscribedResources)),this.listChangedNotifications.tools&&this.capabilities?.tools?.listChanged&&(e.toolsListChanged=!0),this.listChangedNotifications.resources&&this.capabilities?.resources?.listChanged&&(e.resourcesListChanged=!0),this.listChangedNotifications.prompts&&this.capabilities?.prompts?.listChanged&&(e.promptsListChanged=!0),e}wantsModernStream(){let e=this.buildSubscriptionFilter();return(e.resourceSubscriptions?.length??0)>0||e.toolsListChanged===!0||e.resourcesListChanged===!0||e.promptsListChanged===!0}modernStreamActive(){return this.subscribedResources.size>0}async openModernListenStreamOnConnect(){if(!this.isModernEra()||!this.wantsModernStream())return;let e=this.modernListenGeneration;try{await this.refreshModernSubscription()}catch(t){this.logger.error({error:t},`Failed to open the modern subscriptions/listen stream on connect`),this.modernListenGeneration===e+1&&this.reconcileModernStreamStateAfterFailedRefresh()}}clearModernReconnectTimer(){this.modernReconnectTimer!==void 0&&(clearTimeout(this.modernReconnectTimer),this.modernReconnectTimer=void 0)}async refreshModernSubscription(e=!1){if(!this.client)return;e||(this.clearModernReconnectTimer(),this.modernReconnectAttempts=0);let t=++this.modernListenGeneration,n=this.modernSubscription;if(this.modernSubscription=null,n&&await xR(n),!this.wantsModernStream()){this.setModernStreamState(VP);return}let r=await this.client.listen(this.buildSubscriptionFilter(),this.getRequestOptions());if(t!==this.modernListenGeneration){await xR(r);return}this.modernSubscription=r,this.modernReconnectAttempts=0,this.setModernStreamState({active:this.modernStreamActive(),status:`acknowledged`,honoredUris:r.honoredFilter.resourceSubscriptions??[]}),r.closed.then(e=>this.onModernSubscriptionClosed(r,e,t),()=>{})}onModernSubscriptionClosed(e,t,n){if(n===this.modernListenGeneration&&this.modernSubscription===e){if(this.modernSubscription=null,!(t===`remote`&&!BP(this.status)&&this.wantsModernStream())){this.setModernStreamState({active:this.modernStreamActive(),status:`ended`,honoredUris:[]});return}this.scheduleModernReconnect()}}reconcileModernStreamStateAfterFailedRefresh(){if(!this.wantsModernStream()){this.setModernStreamState(VP);return}this.scheduleModernReconnect()}scheduleModernReconnect(){this.setModernStreamState({active:this.modernStreamActive(),status:`reconnecting`,honoredUris:[]});let e=Math.min(CR*2**this.modernReconnectAttempts,wR);this.clearModernReconnectTimer(),this.modernReconnectTimer=setTimeout(()=>{this.modernReconnectTimer=void 0,!(BP(this.status)||!this.wantsModernStream())&&this.refreshModernSubscription(!0).catch(()=>this.onModernReconnectFailed())},e)}onModernReconnectFailed(){if(this.modernReconnectAttempts+=1,this.modernReconnectAttempts>TR||BP(this.status)||!this.wantsModernStream()){this.setModernStreamState({active:this.modernStreamActive(),status:`ended`,honoredUris:[]});return}this.scheduleModernReconnect()}async subscribeToResource(e){if(!this.client)throw Error(`Client is not connected`);if(!this.supportsResourceSubscriptions())throw Error(`Server does not support resource subscriptions`);try{if(this.isModernEra()){if(this.subscribedResources.has(e))return;this.subscribedResources.add(e),this.dispatchSubscriptionsChange(),this.setModernStreamState({active:!0,status:`connecting`,honoredUris:this.modernStreamState.honoredUris});let t=this.modernListenGeneration;try{await this.refreshModernSubscription()}catch(n){throw this.modernListenGeneration===t+1&&(this.subscribedResources.delete(e),this.reconcileModernStreamStateAfterFailedRefresh(),this.dispatchSubscriptionsChange()),n}return}await this.client.subscribeResource({uri:e},this.getRequestOptions()),this.subscribedResources.add(e),this.dispatchSubscriptionsChange()}catch(e){throw Error(`Failed to subscribe to resource: ${e instanceof Error?e.message:String(e)}`,{cause:e})}}async unsubscribeFromResource(e){if(!this.client)throw Error(`Client is not connected`);try{if(this.isModernEra()){if(!this.subscribedResources.delete(e))return;this.subscribedResources.size===0&&this.setModernStreamState(VP),this.dispatchSubscriptionsChange();let t=this.modernListenGeneration;try{await this.refreshModernSubscription()}catch(e){throw this.modernListenGeneration===t+1&&this.reconcileModernStreamStateAfterFailedRefresh(),e}}else await this.client.unsubscribeResource({uri:e},this.getRequestOptions()),this.subscribedResources.delete(e),this.dispatchSubscriptionsChange()}catch(e){throw Error(`Failed to unsubscribe from resource: ${e instanceof Error?e.message:String(e)}`,{cause:e})}}ensureOAuthManager(){if(!this.oauthManager)throw Error(`OAuth not configured. Call setOAuthConfig() first.`);return this.oauthManager}getServerUrl(){if(this.transportConfig.type===`sse`||this.transportConfig.type===`streamable-http`)return this.transportConfig.url;throw Error(`OAuth is only supported for HTTP-based transports (SSE, streamable-http)`)}setOAuthConfig(e){if(!this.oauthManager)throw Error(`OAuth config must be set at creation. Pass oauth in constructor.`);this.oauthManager.setOAuthConfig(e)}async authenticate(){return this.ensureOAuthManager().authenticate()}async handleAuthChallenge(e,t){return this.ensureOAuthManager().handleAuthChallenge(e,t)}async checkAuthChallengeSatisfied(e){return this.ensureOAuthManager().checkAuthChallengeSatisfied(e)}async pushRemoteAuthState(){this.baseTransport instanceof hR&&await this.baseTransport.pushAuthState()}async handleAmbientAuthChallenge(e){let t=this.ambientAuthChallengeKey(e),n=this.ambientAuthChallengeInFlight.get(t);if(n)return n;let r=this.runAmbientAuthChallenge(e);this.ambientAuthChallengeInFlight.set(t,r);try{await r}finally{this.ambientAuthChallengeInFlight.get(t)===r&&this.ambientAuthChallengeInFlight.delete(t)}}async runAmbientAuthChallenge(e){try{this.dispatchTypedEvent(`authChallengeAmbient`,{challenge:e});let t=this.oauthManager;if(!t)return;let n=await t.handleAuthChallenge(e);n.kind===`satisfied`?(this.baseTransport instanceof hR?await this.pushRemoteAuthState():await this.reconnectAfterAuthRecovery(),this.dispatchTypedEvent(`authChallengeRecovered`,{challenge:e})):n.kind===`step_up_confirm`?this.dispatchTypedEvent(`authChallengeInteractive`,{challenge:n.challenge,authorizationUrl:sI}):n.kind===`interactive`?this.dispatchTypedEvent(`authChallengeInteractive`,{challenge:n.challenge,authorizationUrl:n.authorizationUrl}):this.dispatchTypedEvent(`oauthError`,{error:n.error})}catch(e){this.dispatchTypedEvent(`oauthError`,{error:e instanceof Error?e:Error(String(e))})}}ambientAuthChallengeKey(e){let t=[...e.requiredScopes??[]].sort().join(` `),n=[...e.authorizationScopes??[]].sort().join(` `);return`${e.reason}:${t}:${n}`}async reconnectAfterAuthRecovery(){await this.disconnect().catch(()=>{}),await this.dropCachedTransport(),await this.connect()}usesDirectAuthRecovery(){return this.directAuthRecovery&&this.directAuthRecoveryActive===!0}probesProtocolEra(){let e=this.versionNegotiation.mode;return e!==void 0&&e!==`legacy`}async withDirectAuthRecovery(t,n,r=0){try{return await t(r)}catch(i){if(r>=1||!this.usesDirectAuthRecovery()||!vI(i)||this.authRecoveryDepth>=e.MAX_NESTED_AUTH_RECOVERIES)throw i;let a=_I(i,n);if(!a)throw i;n?.method||n?.toolName?this.dispatchTypedEvent(`authChallengeCommand`,{challenge:a}):this.dispatchTypedEvent(`authChallengeAmbient`,{challenge:a});let o=await this.handleAuthChallenge(a);if(o.kind===`satisfied`){this.activeToolCallAbortController&&=void 0,this.authRecoveryDepth+=1;try{await this.reconnectAfterAuthRecovery()}finally{--this.authRecoveryDepth}return this.dispatchTypedEvent(`authChallengeRecovered`,{challenge:a}),this.withDirectAuthRecovery(t,n,r+1)}throw o.kind===`step_up_confirm`?new lI(sI,o.challenge,{emaStepUpConfirm:!0}):o.kind===`interactive`?new lI(o.authorizationUrl,o.challenge):(this.dispatchTypedEvent(`oauthError`,{error:o.error}),o.error)}}async invokeMcpClient(e,t){return this.usesDirectAuthRecovery()?this.withDirectAuthRecovery(e,t):e(0)}async completeOAuthFlow(e,t){await this.ensureOAuthManager().completeOAuthFlow(e,t),this.usesDirectAuthRecovery()&&await this.reconnectAfterAuthRecovery()}async beginInteractiveAuthorization(e){return this.ensureOAuthManager().beginInteractiveAuthorization(e)}getRemoteBackendSessionId(){if(this.baseTransport instanceof hR)return this.baseTransport.getRemoteBackendSessionId()}async resumeAfterOAuth(e,t){await this.completeOAuthFlow(e,t?.iss);let n=t?.remoteSessionId,r=this.baseTransport;if(n&&r instanceof hR)try{await r.attachToSession(n),await r.pushAuthState(),this.status!==`connected`&&await this.connect();return}catch{}this.status!==`connected`&&await this.connect()}async getOAuthTokens(){if(this.oauthManager)return this.oauthManager.getOAuthTokens()}async clearOAuthTokens(){await this.oauthManager?.clearOAuthTokens()}async isOAuthAuthorized(){return this.oauthManager?this.oauthManager.isOAuthAuthorized():!1}getOAuthFlowState(){return this.oauthManager?.getOAuthFlowState()}getOAuthFlowStep(){return this.oauthManager?.getOAuthFlowStep()}async getOAuthState(){if(!(!this.isHttpOAuthConfig()||!this.oauthManager))return this.oauthManager.getOAuthState()}},DR={AUTH_TOKEN:`MCP_INSPECTOR_API_TOKEN`},OR=`__INSPECTOR_API_TOKEN__`;function kR(e){return YO.isInstance(e)&&(e.code===JO.InvalidResult||e.code===JO.UnsupportedResultType)}var AR=class extends WF{items=[];client=null;unsubscribe=null;_metadata=void 0;listChanged=!1;error=null;config;listChangedTimer=null;running=!1;runQueued=!1;constructor(e,t){super(),this.client=e,this.config=t;let n=()=>{this.config.deferWhenPaginated&&this.client?.getServerSettings()?.paginatedLists||this.refresh().catch(()=>{})},r=()=>{this.listChangedTimer!==null&&clearTimeout(this.listChangedTimer),this.listChangedTimer=setTimeout(()=>{this.listChangedTimer=null,this.runListChanged()},t.debounceMs)},i=()=>{BP(this.client?.getStatus())&&(this.listChangedTimer!==null&&(clearTimeout(this.listChangedTimer),this.listChangedTimer=null),this.items=[],this.dispatchChange(),this.setListChanged(!1),this.setError(null))};this.client.addEventListener(`connect`,n),this.client.addEventListener(t.listChangedEvent,r),this.client.addEventListener(`statusChange`,i),this.unsubscribe=()=>{this.listChangedTimer!==null&&(clearTimeout(this.listChangedTimer),this.listChangedTimer=null),this.client&&(this.client.removeEventListener(`connect`,n),this.client.removeEventListener(t.listChangedEvent,r),this.client.removeEventListener(`statusChange`,i)),this.client=null}}runListChanged(){if(this.running){this.runQueued=!0;return}this.runListChangedOnce()}async runListChangedOnce(){this.running=!0;try{do{this.runQueued=!1;let e=this.client?.getServerSettings();!(this.config.deferWhenPaginated&&e?.paginatedLists)&&e?.autoRefreshOnListChanged?await this.refresh(void 0,`refresh`).catch(()=>{}):this.config.supportsIndicator&&this.setListChanged(!0)}while(this.runQueued)}finally{this.running=!1}}getItems(){return[...this.items]}getListChanged(){return this.listChanged}clearListChanged(){this.setListChanged(!1)}emit(e,t){this.dispatchTypedEvent(e,t)}setListChanged(e){this.listChanged!==e&&(this.listChanged=e,this.emit(`listChangedChange`,e))}getError(){return this.error}setError(e){this.error!==e&&(this.error=e,this.emit(`errorChange`,e))}setMetadata(e){this._metadata=e}async refresh(e,t){let n;try{n=await this.fetchItems(e,t)}catch(e){let t=e instanceof Error?e:Error(String(e));throw this.setError(t),kR(e)&&this.client?.markResponseRejected?.(this.config.listMethod,t.message),e}return this.setError(null),n===null||this.applyItems(n),this.getItems()}async fetchItems(e,t){let n=this.client;if(!n||n.getStatus()!==`connected`)return null;if(!n.getCapabilities()?.[this.config.capabilityKey])return[];let r=e??this._metadata;return this.config.fetchAll(n,t,r)}applyItems(e){this.items=e,this.dispatchChange()}dispatchChange(){this.emit(this.config.changeEvent,this.getItems())}destroy(){this.unsubscribe?.(),this.unsubscribe=null,this.items=[]}},jR=class extends AR{constructor(e,t=250){super(e,{listMethod:`tools/list`,changeEvent:`toolsChange`,listChangedEvent:`toolsListChanged`,capabilityKey:`tools`,deferWhenPaginated:!0,supportsIndicator:!0,debounceMs:t,fetchAll:async(e,t,n)=>(await e.listAllTools({cacheMode:t,metadata:n})).tools})}getTools(){return this.getItems()}},MR=class extends AR{constructor(e,t=250){super(e,{listMethod:`prompts/list`,changeEvent:`promptsChange`,listChangedEvent:`promptsListChanged`,capabilityKey:`prompts`,deferWhenPaginated:!0,supportsIndicator:!0,debounceMs:t,fetchAll:async(e,t,n)=>(await e.listAllPrompts({cacheMode:t,metadata:n})).prompts})}getPrompts(){return this.getItems()}},NR=class extends AR{constructor(e,t=250){super(e,{listMethod:`resources/list`,changeEvent:`resourcesChange`,listChangedEvent:`resourcesListChanged`,capabilityKey:`resources`,deferWhenPaginated:!0,supportsIndicator:!0,debounceMs:t,fetchAll:async(e,t,n)=>(await e.listAllResources({cacheMode:t,metadata:n})).resources})}getResources(){return this.getItems()}},PR=class extends WF{tools=[];nextCursor=void 0;pageCount=0;loading=!1;client=null;unsubscribe=null;constructor(e){super(),this.client=e;let t=()=>{this.client?.getServerSettings()?.paginatedLists&&this.loadPage(void 0)},n=()=>{BP(this.client?.getStatus())&&this.reset()};this.client.addEventListener(`connect`,t),this.client.addEventListener(`statusChange`,n),this.unsubscribe=()=>{this.client&&(this.client.removeEventListener(`connect`,t),this.client.removeEventListener(`statusChange`,n)),this.client=null}}getTools(){return[...this.tools]}getPagination(){return{nextCursor:this.nextCursor,pageCount:this.pageCount}}clear(){this.reset()}reset(){this.tools=[],this.nextCursor=void 0,this.pageCount=0,this.dispatchTypedEvent(`toolsChange`,this.tools),this.dispatchTypedEvent(`paginationChange`,this.getPagination())}async loadPage(e){let t=this.client;if(!t||t.getStatus()!==`connected`)return{tools:[],nextCursor:void 0};if(this.loading)return{tools:[],nextCursor:this.nextCursor};this.loading=!0;try{let n=await t.listTools(e,void 0);return this.tools=e===void 0?[...n.tools]:[...this.tools,...n.tools],this.pageCount=e===void 0?1:this.pageCount+1,this.nextCursor=n.nextCursor,this.dispatchTypedEvent(`toolsChange`,this.tools),this.dispatchTypedEvent(`paginationChange`,this.getPagination()),{tools:n.tools,nextCursor:n.nextCursor}}finally{this.loading=!1}}destroy(){this.unsubscribe?.(),this.unsubscribe=null,this.tools=[],this.nextCursor=void 0,this.pageCount=0}},FR=class extends WF{prompts=[];nextCursor=void 0;pageCount=0;loading=!1;client=null;unsubscribe=null;constructor(e){super(),this.client=e;let t=()=>{this.client?.getServerSettings()?.paginatedLists&&this.loadPage(void 0)},n=()=>{BP(this.client?.getStatus())&&this.reset()};this.client.addEventListener(`connect`,t),this.client.addEventListener(`statusChange`,n),this.unsubscribe=()=>{this.client&&(this.client.removeEventListener(`connect`,t),this.client.removeEventListener(`statusChange`,n)),this.client=null}}getPrompts(){return[...this.prompts]}getPagination(){return{nextCursor:this.nextCursor,pageCount:this.pageCount}}clear(){this.reset()}reset(){this.prompts=[],this.nextCursor=void 0,this.pageCount=0,this.dispatchTypedEvent(`promptsChange`,this.prompts),this.dispatchTypedEvent(`paginationChange`,this.getPagination())}async loadPage(e,t){let n=this.client;if(!n||n.getStatus()!==`connected`)return{prompts:[],nextCursor:void 0};if(this.loading)return{prompts:[],nextCursor:this.nextCursor};this.loading=!0;try{let r=await n.listPrompts(e,t);return this.prompts=e===void 0?[...r.prompts]:[...this.prompts,...r.prompts],this.pageCount=e===void 0?1:this.pageCount+1,this.nextCursor=r.nextCursor,this.dispatchTypedEvent(`promptsChange`,this.prompts),this.dispatchTypedEvent(`paginationChange`,this.getPagination()),{prompts:r.prompts,nextCursor:r.nextCursor}}finally{this.loading=!1}}destroy(){this.unsubscribe?.(),this.unsubscribe=null,this.prompts=[],this.nextCursor=void 0,this.pageCount=0}},IR=class extends WF{resources=[];nextCursor=void 0;pageCount=0;loading=!1;client=null;unsubscribe=null;constructor(e){super(),this.client=e;let t=()=>{this.client?.getServerSettings()?.paginatedLists&&this.loadPage(void 0)},n=()=>{BP(this.client?.getStatus())&&this.reset()};this.client.addEventListener(`connect`,t),this.client.addEventListener(`statusChange`,n),this.unsubscribe=()=>{this.client&&(this.client.removeEventListener(`connect`,t),this.client.removeEventListener(`statusChange`,n)),this.client=null}}getResources(){return[...this.resources]}getPagination(){return{nextCursor:this.nextCursor,pageCount:this.pageCount}}clear(){this.reset()}reset(){this.resources=[],this.nextCursor=void 0,this.pageCount=0,this.dispatchTypedEvent(`resourcesChange`,this.resources),this.dispatchTypedEvent(`paginationChange`,this.getPagination())}async loadPage(e,t){let n=this.client;if(!n||n.getStatus()!==`connected`)return{resources:[],nextCursor:void 0};if(this.loading)return{resources:[],nextCursor:this.nextCursor};this.loading=!0;try{let r=await n.listResources(e,t);return this.resources=e===void 0?[...r.resources]:[...this.resources,...r.resources],this.pageCount=e===void 0?1:this.pageCount+1,this.nextCursor=r.nextCursor,this.dispatchTypedEvent(`resourcesChange`,this.resources),this.dispatchTypedEvent(`paginationChange`,this.getPagination()),{resources:r.resources,nextCursor:r.nextCursor}}finally{this.loading=!1}}destroy(){this.unsubscribe?.(),this.unsubscribe=null,this.resources=[],this.nextCursor=void 0,this.pageCount=0}},LR=class extends AR{constructor(e,t=250){super(e,{listMethod:`resources/templates/list`,changeEvent:`resourceTemplatesChange`,listChangedEvent:`resourceTemplatesListChanged`,capabilityKey:`resources`,deferWhenPaginated:!1,supportsIndicator:!1,debounceMs:t,fetchAll:async(e,t,n)=>(await e.listAllResourceTemplates({cacheMode:t,metadata:n})).resourceTemplates})}getResourceTemplates(){return this.getItems()}};function RR(e,t,n){let r={...n,taskId:t,createdAt:n.createdAt??n.lastUpdatedAt??``},i=e.findIndex(e=>e.taskId===t);if(i<0)return[r,...e];let a=[...e];return a[i]=r,a}var zR=100,BR=new Set([`completed`,`failed`,`cancelled`]),VR=class extends WF{tasks=[];client=null;unsubscribe=null;dismissedTaskIds=new Set;cancelledTaskIds=new Set;constructor(e){super(),this.client=e;let t=()=>{this.refresh()},n=()=>{this.refresh()},r=()=>{BP(this.client?.getStatus())&&(this.tasks=[],this.dismissedTaskIds.clear(),this.cancelledTaskIds.clear(),this.dispatchTypedEvent(`tasksChange`,[]))},i=(e,t)=>this.dismissedTaskIds.has(e)||this.cancelledTaskIds.has(e)&&t!==`cancelled`,a=e=>{let{taskId:t,task:n}=e.detail;i(t,n.status)||(this.tasks=RR(this.tasks,t,n),this.dispatchTypedEvent(`tasksChange`,this.tasks))},o=e=>{let{taskId:t,task:n}=e.detail;i(t,n.status)||(this.tasks=RR(this.tasks,t,n),this.dispatchTypedEvent(`tasksChange`,this.tasks))},s=e=>{let{taskId:t}=e.detail;if(this.dismissedTaskIds.has(t))return;this.cancelledTaskIds.add(t);let n=this.tasks.findIndex(e=>e.taskId===t);if(n>=0){let e=[...this.tasks];e[n]={...e[n],status:`cancelled`},this.tasks=e,this.dispatchTypedEvent(`tasksChange`,this.tasks)}};this.client.addEventListener(`connect`,t),this.client.addEventListener(`tasksListChanged`,n),this.client.addEventListener(`statusChange`,r),this.client.addEventListener(`taskStatusChange`,a),this.client.addEventListener(`requestorTaskUpdated`,o),this.client.addEventListener(`taskCancelled`,s),this.unsubscribe=()=>{this.client&&(this.client.removeEventListener(`connect`,t),this.client.removeEventListener(`tasksListChanged`,n),this.client.removeEventListener(`statusChange`,r),this.client.removeEventListener(`taskStatusChange`,a),this.client.removeEventListener(`requestorTaskUpdated`,o),this.client.removeEventListener(`taskCancelled`,s)),this.client=null}}getTasks(){return[...this.tasks]}async refresh(){let e=this.client;if(!e||e.getStatus()!==`connected`)return this.getTasks();if(e.isTasksExtensionNegotiated())return this.refreshModern(e);if(!e.getCapabilities()?.tasks)return this.tasks=[],this.dispatchTypedEvent(`tasksChange`,this.tasks),this.getTasks();this.tasks=[];let t,n=0;do{let r=await e.listRequestorTasks(t),i=r.tasks.filter(e=>!this.dismissedTaskIds.has(e.taskId)).map(e=>this.cancelledTaskIds.has(e.taskId)?{...e,status:`cancelled`}:e);if(this.tasks=t?[...this.tasks,...i]:i,t=r.nextCursor,n++,n>=zR)throw Error(`Maximum pagination limit (${zR} pages) reached while listing requestor tasks`)}while(t);return this.dispatchTypedEvent(`tasksChange`,this.tasks),this.getTasks()}async refreshModern(e){let t=this.tasks.map(e=>e.taskId).filter(e=>!this.dismissedTaskIds.has(e));for(let n of t)try{await e.getRequestorTask(n)}catch{}return this.getTasks()}clearCompleted(){let e=[],t=!1;for(let n of this.tasks)BR.has(n.status)?(this.dismissedTaskIds.add(n.taskId),t=!0):e.push(n);t&&(this.tasks=e,this.dispatchTypedEvent(`tasksChange`,this.tasks))}destroy(){this.unsubscribe?.(),this.unsubscribe=null,this.tasks=[],this.dismissedTaskIds.clear(),this.cancelledTaskIds.clear()}},HR=class extends WF{subscribedUris=[];lastUpdatedByUri=new Map;subscriptions=[];streamState=VP;client=null;resourcesState=null;unsubscribe=null;constructor(e,t=null){super(),this.client=e,this.resourcesState=t,this.streamState=e.getResourceSubscriptionStreamState();let n=e=>{this.streamState=e.detail,this.dispatchTypedEvent(`streamStateChange`,this.streamState)},r=e=>{this.subscribedUris=e.detail;let t=new Set(e.detail);for(let e of this.lastUpdatedByUri.keys())t.has(e)||this.lastUpdatedByUri.delete(e);this.rebuild()},i=e=>{let{uri:t}=e.detail;this.subscribedUris.includes(t)&&(this.lastUpdatedByUri.set(t,new Date),this.rebuild())},a=()=>{BP(this.client?.getStatus())&&(this.subscribedUris=[],this.lastUpdatedByUri.clear(),this.subscriptions=[],this.streamState=VP,this.dispatchTypedEvent(`subscriptionsChange`,this.getSubscriptions()),this.dispatchTypedEvent(`streamStateChange`,this.streamState))},o=e=>{this.subscribedUris.length>0&&this.rebuild()};e.addEventListener(`resourceSubscriptionsChange`,r),e.addEventListener(`resourceSubscriptionStreamChange`,n),e.addEventListener(`resourceUpdated`,i),e.addEventListener(`statusChange`,a),t?.addEventListener(`resourcesChange`,o),this.unsubscribe=()=>{this.client?.removeEventListener(`resourceSubscriptionsChange`,r),this.client?.removeEventListener(`resourceSubscriptionStreamChange`,n),this.client?.removeEventListener(`resourceUpdated`,i),this.client?.removeEventListener(`statusChange`,a),this.resourcesState?.removeEventListener(`resourcesChange`,o),this.client=null,this.resourcesState=null}}getSubscriptions(){return[...this.subscriptions]}getStreamState(){return this.streamState}rebuild(){let e=this.resourcesState?.getResources()??[],t=new Map(e.map(e=>[e.uri,e]));this.subscriptions=this.subscribedUris.map(e=>{let n=t.get(e)??{uri:e,name:e},r=this.lastUpdatedByUri.get(e);return r?{resource:n,lastUpdated:r}:{resource:n}}),this.dispatchTypedEvent(`subscriptionsChange`,this.getSubscriptions())}destroy(){this.unsubscribe?.(),this.unsubscribe=null,this.subscribedUris=[],this.lastUpdatedByUri.clear(),this.subscriptions=[],this.streamState=VP}};function UR(e){let t=e.enterpriseManagedAuth;return t?.idp?t.enabled!==!1:!1}function WR(e){if(UR(e))return e.enterpriseManagedAuth.idp}function GR(e){return e.cimd?.enabled===!0}function KR(e){if(GR(e))return e.cimd?.clientMetadataUrl?.trim()||void 0}function qR(e){let t;try{t=new URL(e.trim())}catch{return!1}return t.protocol!==`http:`&&t.protocol!==`https:`?!1:JR(t.hostname)}function JR(e){if(e===`localhost`)return!0;if(e.startsWith(`[`))return e.endsWith(`]`);let t=e.split(`.`);return t.length>=2&&t.every(e=>e!==``)}var YR=q().min(1).superRefine((e,t)=>{let n=e.trim();qR(n)||t.addIssue({code:bT.custom,message:`Invalid URL: "${n}" — must be an http(s) URL (e.g. https://idp.example.com)`})}),XR=`Must be a valid URL, like https://example.com/oauth/client.json`,ZR=`CIMD client metadata URL must use HTTPS`,QR=`Must include a path (not the site root), like https://example.com/oauth/client.json`;function $R(e){let t=e.trim();if(t!==``){if(!qR(t))return XR;try{let e=new URL(t);if(e.protocol!==`https:`)return ZR;if(e.pathname===`/`||e.pathname===``)return QR}catch{return XR}}}function ez(e,t,n){let r=e.trim();if(r===``){n&&t.addIssue({code:bT.custom,message:`CIMD client metadata URL is required when CIMD is enabled`});return}let i=$R(r);i&&t.addIssue({code:bT.custom,message:i})}var tz=X({enabled:Pw(),clientMetadataUrl:q()}).superRefine((e,t)=>{ez(e.clientMetadataUrl,t,e.enabled===!0)}),nz=X({issuer:YR,clientId:q().min(1),clientSecret:q().optional()}),rz=X({enterpriseManagedAuth:X({enabled:Pw().optional(),idp:nz}).optional(),cimd:tz.optional()});function iz(e){return rz.parse(e)}function az(e){return JSON.stringify(e,null,2)}function oz(e){if(e instanceof hw){let t=e.issues[0];return t?`${t.path.length>0?t.path.map(String).join(`.`):`config`}: ${t.message}`:`Invalid client.json shape`}return e instanceof Error?e.message:String(e)}async function sz(e){let t=e.baseUrl.replace(/\/$/,``),n=e.fetchFn??globalThis.fetch,r={};e.authToken&&(r[`x-mcp-remote-auth`]=`Bearer ${e.authToken}`);let i=await n(`${t}/api/storage/client`,{method:`GET`,headers:r});if(!i.ok){if(i.status===404)return{};throw Error(`Failed to read client config: ${i.status}`)}let a=await i.json();return!a||typeof a!=`object`||Object.keys(a).length===0?{}:iz(a)}async function cz(e,t){let n=iz(e),r=t.baseUrl.replace(/\/$/,``),i=t.fetchFn??globalThis.fetch,a={"Content-Type":`application/json`};t.authToken&&(a[`x-mcp-remote-auth`]=`Bearer ${t.authToken}`);let o=await i(`${r}/api/storage/client`,{method:`POST`,headers:a,body:az(n)});if(!o.ok)throw Error(`Failed to write client config: ${o.status}`)}var lz=class extends WF{messages=[];pendingRequestEntries=new Map;client=null;unsubscribe=null;maxMessages;constructor(e,t={}){super(),this.maxMessages=t.maxMessages??1e3,this.client=e;let n=e=>{this.maxMessages>0&&this.messages.length>=this.maxMessages&&this.messages.shift(),this.messages.push(e),this.dispatchTypedEvent(`message`,e),this.dispatchTypedEvent(`messagesChange`,this.getMessages())},r=e=>{let t=e.detail;if(t.direction===`request`){let e=`id`in t.message?t.message.id:void 0;e!==void 0&&this.pendingRequestEntries.set(e,t),n(t);return}if(t.direction===`response`){let e=`id`in t.message?t.message.id:void 0,n=e===void 0?void 0:this.pendingRequestEntries.get(e);if(n){this.pendingRequestEntries.delete(e),n.response=t.message,n.duration=t.timestamp.getTime()-n.timestamp.getTime(),this.dispatchTypedEvent(`message`,n),this.dispatchTypedEvent(`messagesChange`,this.getMessages());return}}n(t)},i=e=>{let{id:t,reason:n}=e.detail;for(let e=this.messages.length-1;e>=0;e--){let r=this.messages[e];if(r.message.id===t&&r.direction!==`notification`&&!(r.direction===`request`&&!r.response)){r.clientError=n,this.dispatchTypedEvent(`message`,r),this.dispatchTypedEvent(`messagesChange`,this.getMessages());return}}},a=()=>{BP(this.client?.getStatus())&&(this.messages=[],this.pendingRequestEntries.clear(),this.dispatchTypedEvent(`messagesChange`,[]))};this.client.addEventListener(`message`,r),this.client.addEventListener(`responseRejected`,i),this.client.addEventListener(`statusChange`,a),this.unsubscribe=()=>{this.client&&(this.client.removeEventListener(`message`,r),this.client.removeEventListener(`responseRejected`,i),this.client.removeEventListener(`statusChange`,a)),this.client=null}}getMessages(e){return e?this.messages.filter(e):[...this.messages]}clearMessages(e){let t=this.messages.length;if(this.messages=e?this.messages.filter(t=>!e(t)):[],e){let e=new Set(this.messages);for(let[t,n]of this.pendingRequestEntries)e.has(n)||this.pendingRequestEntries.delete(t)}else this.pendingRequestEntries.clear();this.messages.length!==t&&this.dispatchTypedEvent(`messagesChange`,this.getMessages())}destroy(){this.unsubscribe?.(),this.unsubscribe=null,this.messages=[],this.pendingRequestEntries.clear()}},uz=class extends WF{fetchRequests=[];client=null;unsubscribe=null;maxFetchRequests;logger;constructor(e,t={}){super(),this.maxFetchRequests=t.maxFetchRequests??1e3,this.logger=t.logger??xI,this.client=e;let n=e=>{let t=e.detail;this.maxFetchRequests>0&&this.fetchRequests.length>=this.maxFetchRequests&&this.fetchRequests.shift(),this.fetchRequests.push(t),this.dispatchTypedEvent(`fetchRequest`,t),this.dispatchTypedEvent(`fetchRequestsChange`,this.getFetchRequests())};this.client.addEventListener(`fetchRequest`,n);let r=e=>{let{id:t,responseBody:n}=e.detail,r=this.fetchRequests.findIndex(e=>e.id===t);if(r===-1){this.maxFetchRequests>0&&this.fetchRequests.length>=this.maxFetchRequests&&(this.logger.warn({fetchRequestId:t,maxFetchRequests:this.maxFetchRequests},`fetchRequestBodyUpdate dropped: entry rotated out before body arrived`),this.dispatchTypedEvent(`fetchRequestBodyDropped`,{id:t,maxFetchRequests:this.maxFetchRequests}));return}this.fetchRequests[r]={...this.fetchRequests[r],responseBody:n},this.dispatchTypedEvent(`fetchRequestsChange`,this.getFetchRequests())};this.client.addEventListener(`fetchRequestBodyUpdate`,r);let i=t.sessionStorage,a=t.sessionId;if(i){let e=e=>{let{sessionId:t}=e.detail,n={fetchRequests:this.getFetchRequests(),createdAt:Date.now(),updatedAt:Date.now()};i.saveSession(t,n).catch(()=>{})};this.client.addEventListener(`saveSession`,e),this.unsubscribe=()=>{this.client&&(this.client.removeEventListener(`fetchRequest`,n),this.client.removeEventListener(`fetchRequestBodyUpdate`,r),this.client.removeEventListener(`saveSession`,e)),this.client=null},a&&i.loadSession(a).then(e=>{this.client&&e?.fetchRequests?.length&&this.hydrateFetchRequests(e.fetchRequests)}).catch(()=>{})}else this.unsubscribe=()=>{this.client&&(this.client.removeEventListener(`fetchRequest`,n),this.client.removeEventListener(`fetchRequestBodyUpdate`,r)),this.client=null}}hydrateFetchRequests(e){if(e.length===0)return;let t=new Set(this.fetchRequests.map(e=>e.id)),n=e.filter(e=>!t.has(e.id));if(n.length===0)return;let r=[...n,...this.fetchRequests];this.fetchRequests=this.maxFetchRequests>0?r.slice(-this.maxFetchRequests):r,this.dispatchTypedEvent(`fetchRequestsChange`,this.getFetchRequests())}getFetchRequests(){return[...this.fetchRequests]}setMaxFetchRequests(e){e!==this.maxFetchRequests&&(this.maxFetchRequests=e,e>0&&this.fetchRequests.length>e&&(this.fetchRequests=this.fetchRequests.slice(-e),this.dispatchTypedEvent(`fetchRequestsChange`,this.getFetchRequests())))}clearFetchRequests(){this.fetchRequests.length!==0&&(this.fetchRequests=[],this.dispatchTypedEvent(`fetchRequestsChange`,[]))}destroy(){this.unsubscribe?.(),this.unsubscribe=null,this.fetchRequests=[]}},dz=class extends WF{stderrLogs=[];client=null;unsubscribe=null;maxStderrLogEvents;constructor(e,t={}){super(),this.maxStderrLogEvents=t.maxStderrLogEvents??1e3,this.client=e;let n=e=>{let t=e.detail;this.maxStderrLogEvents>0&&this.stderrLogs.length>=this.maxStderrLogEvents&&this.stderrLogs.shift(),this.stderrLogs.push(t),this.dispatchTypedEvent(`stderrLog`,t),this.dispatchTypedEvent(`stderrLogsChange`,this.getStderrLogs())};this.client.addEventListener(`stderrLog`,n),this.unsubscribe=()=>{this.client&&this.client.removeEventListener(`stderrLog`,n),this.client=null}}getStderrLogs(){return[...this.stderrLogs]}clearStderrLogs(){this.stderrLogs.length!==0&&(this.stderrLogs=[],this.dispatchTypedEvent(`stderrLogsChange`,[]))}destroy(){this.unsubscribe?.(),this.unsubscribe=null,this.stderrLogs=[]}},fz=`discoveryState was not available`;function pz(e){if(typeof e!=`object`||!e)return!1;let t=e;return typeof t.recordedIssuer!=`string`||typeof t.currentIssuer!=`string`?!1:cN.isInstance(e)||t.name===`AuthorizationServerMismatchError`}function mz(e){if(e.includes(fz))return!0;try{let t=new URL(e);return t.protocol!==`http:`&&t.protocol!==`https:`}catch{return!0}}function hz(e){return gz(e,new Set)}function gz(e,t){if(typeof e!=`object`||!e||t.has(e))return;if(t.add(e),pz(e))return _z(e);let n=gz(e.cause,t);if(n)return n;let r=e.data;if(typeof r==`object`&&r)return gz(r.cause,t)}function _z(e){return mz(e.recordedIssuer)?{kind:`lost_authorization_state`,currentIssuer:e.currentIssuer}:{kind:`issuer_mismatch`,recordedIssuer:e.recordedIssuer,currentIssuer:e.currentIssuer}}function vz(e){return(t,n={})=>({transport:new hR({baseUrl:e.baseUrl,authToken:e.authToken,fetchFn:e.fetchFn,onStderr:n.onStderr,onFetchRequest:n.onFetchRequest,onFetchResponseBody:n.onFetchResponseBody,authProvider:n.authProvider,settings:n.settings},t)})}async function yz(e,t){let n=typeof e==`string`?e:e instanceof URL?e.toString():e.url,r=t?.method??(typeof e==`object`&&`method`in e?e.method:`GET`),i={};e instanceof Request&&e.headers.forEach((e,t)=>{i[t]=e}),t?.headers&&new Headers(t.headers).forEach((e,t)=>{i[t]=e});let a;if(t?.body!==void 0&&t?.body!==null)if(typeof t.body==`string`)a=t.body;else if(t.body instanceof URLSearchParams)a=t.body.toString();else if(t.body instanceof FormData){let e=new URLSearchParams;for(let[n,r]of t.body.entries())typeof r==`string`&&e.set(n,r);a=e.toString()}else a=String(t.body);else e instanceof Request&&e.body&&(a=await e.clone().text());return{url:n,method:r,headers:i,body:a}}function bz(e){return new Response(e.body??null,{status:e.status,statusText:e.statusText,headers:new Headers(e.headers??{})})}function xz(e){let t=e.baseUrl.replace(/\/$/,``),n=e.fetchFn??globalThis.fetch;return async(r,i)=>{let{url:a,method:o,headers:s,body:c}=await yz(r,i),l={"Content-Type":`application/json`,...s};e.authToken&&(l[`x-mcp-remote-auth`]=`Bearer ${e.authToken}`);let u=await n(`${t}/api/fetch`,{method:`POST`,headers:l,body:JSON.stringify({url:a,method:o,headers:s,body:c})});if(!u.ok){let e=await u.text();throw Error(`Remote fetch failed (${u.status}): ${e}`)}return bz(await u.json())}}var Sz=o(((e,t)=>{function n(e){try{return JSON.stringify(e)}catch{return`"[Circular]"`}}t.exports=r;function r(e,t,r){var i=r&&r.stringify||n,a=1;if(typeof e==`object`&&e){var o=t.length+a;if(o===1)return e;var s=Array(o);s[0]=i(e);for(var c=1;c<o;c++)s[c]=i(t[c]);return s.join(` `)}if(typeof e!=`string`)return e;var l=t.length;if(l===0)return e;for(var u=``,d=1-a,f=-1,p=e&&e.length||0,m=0;m<p;){if(e.charCodeAt(m)===37&&m+1<p){switch(f=f>-1?f:0,e.charCodeAt(m+1)){case 100:case 102:if(d>=l||t[d]==null)break;f<m&&(u+=e.slice(f,m)),u+=Number(t[d]),f=m+2,m++;break;case 105:if(d>=l||t[d]==null)break;f<m&&(u+=e.slice(f,m)),u+=Math.floor(Number(t[d])),f=m+2,m++;break;case 79:case 111:case 106:if(d>=l||t[d]===void 0)break;f<m&&(u+=e.slice(f,m));var h=typeof t[d];if(h===`string`){u+=`'`+t[d]+`'`,f=m+2,m++;break}if(h===`function`){u+=t[d].name||`<anonymous>`,f=m+2,m++;break}u+=i(t[d]),f=m+2,m++;break;case 115:if(d>=l)break;f<m&&(u+=e.slice(f,m)),u+=String(t[d]),f=m+2,m++;break;case 37:f<m&&(u+=e.slice(f,m)),u+=`%`,f=m+2,m++,d--}++d}++m}return f===-1?e:(f<p&&(u+=e.slice(f)),u)}})),Cz=l(o(((e,t)=>{var n=Sz();t.exports=f;var r=M().console||{},i={mapHttpRequest:T,mapHttpResponse:T,wrapRequestSerializer:E,wrapResponseSerializer:E,wrapErrorSerializer:E,req:T,res:T,err:C,errWithCause:C};function a(e,t){return e===`silent`?1/0:t.levels.values[e]}var o=Symbol(`pino.logFuncs`),s=Symbol(`pino.hierarchy`),c={error:`log`,fatal:`error`,warn:`error`,info:`log`,debug:`log`,trace:`log`};function l(e,t){t[s]={logger:t,parent:e[s]}}function u(e,t,n){let i={};t.forEach(e=>{i[e]=n[e]?n[e]:r[e]||r[c[e]||`log`]||D}),e[o]=i}function d(e,t){return Array.isArray(e)?e.filter(function(e){return e!==`!stdSerializers.err`}):e===!0&&Object.keys(t)}function f(e){e||={},e.browser=e.browser||{};let t=e.browser.transmit;if(t&&typeof t.send!=`function`)throw Error(`pino: transmit option must have a send function`);let n=e.browser.write||r;e.browser.write&&(e.browser.asObject=!0);let i=e.serializers||{},o=d(e.browser.serialize,i),s=e.browser.serialize;Array.isArray(e.browser.serialize)&&e.browser.serialize.indexOf(`!stdSerializers.err`)>-1&&(s=!1);let c=Object.keys(e.customLevels||{}),f=[`error`,`fatal`,`warn`,`info`,`debug`,`trace`].concat(c);typeof n==`function`&&f.forEach(function(e){n[e]=n}),(e.enabled===!1||e.browser.disabled)&&(e.level=`silent`);let m=e.level||`info`,h=Object.create(n);h.log||=D,u(h,f,n),l({},h),Object.defineProperty(h,"levelVal",{get:v}),Object.defineProperty(h,"level",{get:y,set:x});let _={transmit:t,serialize:o,asObject:e.browser.asObject,asObjectBindingsOnly:e.browser.asObjectBindingsOnly,formatters:e.browser.formatters,levels:f,timestamp:w(e),messageKey:e.messageKey||`msg`,onChild:e.onChild||D};h.levels=p(e),h.level=m,h.isLevelEnabled=function(e){return this.levels.values[e]?this.levels.values[e]>=this.levels.values[this.level]:!1},h.setMaxListeners=h.getMaxListeners=h.emit=h.addListener=h.on=h.prependListener=h.once=h.prependOnceListener=h.removeListener=h.removeAllListeners=h.listeners=h.listenerCount=h.eventNames=h.write=h.flush=D,h.serializers=i,h._serialize=o,h._stdErrSerialize=s,h.child=function(...e){return C.call(this,_,...e)},t&&(h._logEvent=S());function v(){return a(this.level,this)}function y(){return this._level}function x(e){if(e!==`silent`&&!this.levels.values[e])throw Error(`unknown level `+e);this._level=e,g(this,_,h,`error`),g(this,_,h,`fatal`),g(this,_,h,`warn`),g(this,_,h,`info`),g(this,_,h,`debug`),g(this,_,h,`trace`),c.forEach(e=>{g(this,_,h,e)})}function C(n,r,a){if(!r)throw Error(`missing bindings for child Pino`);a||={},o&&r.serializers&&(a.serializers=r.serializers);let s=a.serializers;if(o&&s){var c=Object.assign({},i,s),u=e.browser.serialize===!0?Object.keys(c):o;delete r.serializers,b([r],u,c,this._stdErrSerialize)}function d(e){this._childLevel=(e._childLevel|0)+1,this.bindings=r,c&&(this.serializers=c,this._serialize=u),t&&(this._logEvent=S([].concat(e._logEvent.bindings,r)))}d.prototype=this;let f=new d(this);return l(this,f),f.child=function(...e){return C.call(this,n,...e)},f.level=a.level||this.level,n.onChild(f),f}return h}function p(e){let t=e.customLevels||{};return{values:Object.assign({},f.levels.values,t),labels:Object.assign({},f.levels.labels,m(t))}}function m(e){let t={};return Object.keys(e).forEach(function(n){t[e[n]]=n}),t}f.levels={values:{fatal:60,error:50,warn:40,info:30,debug:20,trace:10},labels:{10:`trace`,20:`debug`,30:`info`,40:`warn`,50:`error`,60:`fatal`}},f.stdSerializers=i,f.stdTimeFunctions=Object.assign({},{nullTime:O,epochTime:k,unixTime:A,isoTime:j});function h(e){let t=[];e.bindings&&t.push(e.bindings);let n=e[s];for(;n.parent;)n=n.parent,n.logger.bindings&&t.push(n.logger.bindings);return t.reverse()}function g(e,t,n,r){if(Object.defineProperty(e,r,{value:a(e.level,n)>a(r,n)?D:n[o][r],writable:!0,enumerable:!0,configurable:!0}),e[r]===D){if(!t.transmit)return;let i=a(t.transmit.level||e.level,n);if(a(r,n)<i)return}e[r]=v(e,t,n,r);let i=h(e);i.length!==0&&(e[r]=_(i,e[r]))}function _(e,t){return function(){return t.apply(this,[...e,...arguments])}}function v(e,t,n,i){return(function(o){return function(){let s=t.timestamp(),c=Array(arguments.length),l=Object.getPrototypeOf&&Object.getPrototypeOf(this)===r?r:this;for(var u=0;u<c.length;u++)c[u]=arguments[u];var d=!1;if(t.serialize&&(b(c,this._serialize,this.serializers,this._stdErrSerialize),d=!0),t.asObject||t.formatters?o.call(l,...y(this,i,c,s,t)):o.apply(l,c),t.transmit){let r=t.transmit.level||e._level,o=a(r,n),l=a(i,n);if(l<o)return;x(this,{ts:s,methodLevel:i,methodValue:l,transmitLevel:r,transmitValue:n.levels.values[t.transmit.level||e._level],send:t.transmit.send,val:a(e._level,n)},c,d)}}})(e[o][i])}function y(e,t,r,i,a){let{level:o,log:s=e=>e}=a.formatters||{},c=r.slice(),l=c[0],u={},d=(e._childLevel|0)+1;if(d<1&&(d=1),i&&(u.time=i),o){let n=o(t,e.levels.values[t]);Object.assign(u,n)}else u.level=e.levels.values[t];if(a.asObjectBindingsOnly){if(typeof l==`object`&&l)for(;d--&&typeof c[0]==`object`;)Object.assign(u,c.shift());return[s(u),...c]}if(typeof l==`object`&&l){for(;d--&&typeof c[0]==`object`;)Object.assign(u,c.shift());l=c.length?n(c.shift(),c):void 0}else typeof l==`string`&&(l=n(c.shift(),c));return l!==void 0&&(u[a.messageKey]=l),[s(u)]}function b(e,t,n,r){for(let i in e)if(r&&e[i]instanceof Error)e[i]=f.stdSerializers.err(e[i]);else if(typeof e[i]==`object`&&!Array.isArray(e[i])&&t)for(let r in e[i])t.indexOf(r)>-1&&r in n&&(e[i][r]=n[r](e[i][r]))}function x(e,t,n,r=!1){let i=t.send,a=t.ts,o=t.methodLevel,s=t.methodValue,c=t.val,l=e._logEvent.bindings;r||b(n,e._serialize||Object.keys(e.serializers),e.serializers,e._stdErrSerialize===void 0||e._stdErrSerialize),e._logEvent.ts=a,e._logEvent.messages=n.filter(function(e){return l.indexOf(e)===-1}),e._logEvent.level.label=o,e._logEvent.level.value=s,i(o,e._logEvent,c),e._logEvent=S(l)}function S(e){return{ts:0,messages:[],bindings:e||[],level:{label:``,value:0}}}function C(e){let t={type:e.constructor.name,msg:e.message,stack:e.stack};for(let n in e)t[n]===void 0&&(t[n]=e[n]);return t}function w(e){return typeof e.timestamp==`function`?e.timestamp:e.timestamp===!1?O:k}function T(){return{}}function E(e){return e}function D(){}function O(){return!1}function k(){return Date.now()}function A(){return Math.round(Date.now()/1e3)}function j(){return new Date(Date.now()).toISOString()}function M(){function e(e){return e!==void 0&&e}try{return typeof globalThis<`u`||Object.defineProperty(Object.prototype,"globalThis",{get:function(){return delete Object.prototype.globalThis,this.globalThis=this},configurable:!0}),globalThis}catch{return e(self)||e(window)||e(this)||{}}}t.exports.default=f,t.exports.pino=f}))(),1);function wz(e){let t=e.baseUrl.replace(/\/$/,``),n=e.fetchFn??globalThis.fetch,r=e.level??`info`;return(0,Cz.default)({level:r,browser:{write:()=>{},transmit:{level:r,send:(r,i)=>{let a={"Content-Type":`application/json`};e.authToken&&(a[`x-mcp-remote-auth`]=`Bearer ${e.authToken}`),n(`${t}/api/log`,{method:`POST`,headers:a,body:JSON.stringify(i)}).catch(()=>{})}}}})}var Tz=class{baseUrl;authToken;fetchFn;constructor(e){this.baseUrl=e.baseUrl.replace(/\/$/,``),this.authToken=e.authToken,this.fetchFn=e.fetchFn??((...e)=>globalThis.fetch(...e))}getStoreId(e){return`inspector-session-${e}`}async saveSession(e,t){let n=this.getStoreId(e),r=`${this.baseUrl}/api/storage/${encodeURIComponent(n)}`,i={"Content-Type":`application/json`};this.authToken&&(i[`x-mcp-remote-auth`]=`Bearer ${this.authToken}`);let a={...t,fetchRequests:t.fetchRequests.map(e=>({...e,timestamp:e.timestamp instanceof Date?e.timestamp.toISOString():e.timestamp}))},o=await this.fetchFn(r,{method:`POST`,headers:i,body:JSON.stringify(a),keepalive:!0});if(!o.ok){let e=await o.text();throw Error(`Failed to save session: ${o.status} ${e}`)}}async loadSession(e){let t=this.getStoreId(e),n=`${this.baseUrl}/api/storage/${encodeURIComponent(t)}`,r={};this.authToken&&(r[`x-mcp-remote-auth`]=`Bearer ${this.authToken}`);let i=await this.fetchFn(n,{method:`GET`,headers:r});if(!i.ok){if(i.status===404)return;let e=await i.text();throw Error(`Failed to load session: ${i.status} ${e}`)}let a=await i.json();return{...a,fetchRequests:a.fetchRequests.map(e=>({...e,timestamp:typeof e.timestamp==`string`?new Date(e.timestamp):e.timestamp instanceof Date?e.timestamp:new Date(e.timestamp)}))}}async deleteSession(e){let t=this.getStoreId(e),n=`${this.baseUrl}/api/storage/${encodeURIComponent(t)}`,r={};this.authToken&&(r[`x-mcp-remote-auth`]=`Bearer ${this.authToken}`);let i=await this.fetchFn(n,{method:`DELETE`,headers:r});if(!i.ok&&i.status!==404){let e=await i.text();throw Error(`Failed to delete session: ${i.status} ${e}`)}}},Ez=Object.freeze({});function Dz(e){let[t,n]=(0,D.useState)(e?.getStatus()??`disconnected`),[r,i]=(0,D.useState)(e?.getCapabilities()),[a,o]=(0,D.useState)(e?.getServerInfo()),[s,c]=(0,D.useState)(e?.getInstructions()),[l,u]=(0,D.useState)(e?.getProtocolVersion()),[d,f]=(0,D.useState)(e?.getProtocolEra()),[p,m]=(0,D.useState)(e?.getDiscoverResult()),[h,g]=(0,D.useState)(e?.getExcludedTools()??[]),[_,v]=(0,D.useState)(void 0);(0,D.useEffect)(()=>{if(!e){n(`disconnected`),i(void 0),o(void 0),c(void 0),u(void 0),f(void 0),m(void 0),g([]),v(void 0);return}n(e.getStatus()),i(e.getCapabilities()),o(e.getServerInfo()),c(e.getInstructions()),u(e.getProtocolVersion()),f(e.getProtocolEra()),m(e.getDiscoverResult()),g(e.getExcludedTools()),v(void 0);let t=e=>{n(e.detail),e.detail===`connecting`&&v(void 0)},r=e=>{v(e.detail.message)},a=e=>{i(e.detail)},s=e=>{o(e.detail)},l=e=>{c(e.detail)},d=e=>{u(e.detail)},p=e=>{f(e.detail)},h=e=>{m(e.detail)},_=e=>{g(e.detail)};return e.addEventListener(`statusChange`,t),e.addEventListener(`error`,r),e.addEventListener(`capabilitiesChange`,a),e.addEventListener(`serverInfoChange`,s),e.addEventListener(`instructionsChange`,l),e.addEventListener(`protocolVersionChange`,d),e.addEventListener(`protocolEraChange`,p),e.addEventListener(`discoverResultChange`,h),e.addEventListener(`excludedToolsChange`,_),()=>{e.removeEventListener(`statusChange`,t),e.removeEventListener(`error`,r),e.removeEventListener(`capabilitiesChange`,a),e.removeEventListener(`serverInfoChange`,s),e.removeEventListener(`instructionsChange`,l),e.removeEventListener(`protocolVersionChange`,d),e.removeEventListener(`protocolEraChange`,p),e.removeEventListener(`discoverResultChange`,h),e.removeEventListener(`excludedToolsChange`,_)}},[e]);let y=(0,D.useCallback)(async()=>{e&&await e.connect()},[e]),b=(0,D.useCallback)(async()=>{e&&await e.disconnect()},[e]);return{status:t,capabilities:r,clientCapabilities:e?.getClientCapabilities()??Ez,serverInfo:a,instructions:s,protocolVersion:l,protocolEra:d,discoverResult:p,excludedTools:h,lastError:_,appRendererClient:e?.getAppRendererClient()??null,connect:y,disconnect:b}}function Oz(e,t){let n={};return t&&(n[`Content-Type`]=`application/json`),e&&(n[`x-mcp-remote-auth`]=`Bearer ${e}`),n}async function kz(e){try{let t=await e.json();if(typeof t?.error==`string`)return t.error}catch{}return`HTTP ${e.status}`}function Az(e){return e.split(`
139
- `).some(e=>e.startsWith(`event:`)||e.startsWith(`data:`))}function jz(e){let{baseUrl:t,authToken:n,fetchFn:r}=e,i=r??globalThis.fetch,a=t.replace(/\/$/,``),[o,s]=(0,D.useState)([]),[c,l]=(0,D.useState)(!0),[u,d]=(0,D.useState)(void 0),f=(0,D.useCallback)(async e=>{e||l(!0),d(void 0);try{let e=await i(`${a}/api/servers`,{method:`GET`,headers:Oz(n,!1)});if(!e.ok)throw Error(await kz(e));let t=await e.json();s(sre(t))}catch(e){d(e instanceof Error?e.message:String(e))}finally{e||l(!1)}},[a,n,i]),p=(0,D.useCallback)(()=>f(!1),[f]);(0,D.useEffect)(()=>{p()},[p]),(0,D.useEffect)(()=>{let e=new AbortController;return(async()=>{try{let t=await i(`${a}/api/servers/events`,{method:`GET`,headers:Oz(n,!1),signal:e.signal});if(!t.ok||!t.body)return;let r=t.body.getReader(),o=new TextDecoder,s=``;for(;;){let{done:e,value:t}=await r.read();if(e)break;s+=o.decode(t,{stream:!0});let n=!1,i=s.indexOf(`
140
-
141
- `);for(;i!==-1;){let e=s.slice(0,i);s=s.slice(i+2),Az(e)&&(n=!0),i=s.indexOf(`
142
-
143
- `)}n&&f(!0)}}catch{}})(),()=>e.abort()},[a,n,i,f]);let m=(0,D.useCallback)(async(e,t)=>{let r=await i(`${a}/api/servers`,{method:`POST`,headers:Oz(n,!0),body:JSON.stringify({id:e,config:t})});if(!r.ok)throw Error(await kz(r));await p()},[a,n,i,p]),h=(0,D.useCallback)(async e=>{let t=await i(`${a}/api/import-source?type=${encodeURIComponent(e)}`,{headers:Oz(n,!1)});if(!t.ok)throw Error(await kz(t));return await t.json()},[a,n,i]);return{servers:o,loading:c,error:u,refresh:p,addServer:m,updateServer:(0,D.useCallback)(async(e,t,r)=>{let o=await i(`${a}/api/servers/${encodeURIComponent(e)}`,{method:`PUT`,headers:Oz(n,!0),body:JSON.stringify({id:t,config:r})});if(!o.ok)throw Error(await kz(o));await p()},[a,n,i,p]),updateServerSettings:(0,D.useCallback)(async(e,t)=>{let r=await i(`${a}/api/servers/${encodeURIComponent(e)}`,{method:`PUT`,headers:Oz(n,!0),body:JSON.stringify({id:e,settings:t})});if(!r.ok)throw Error(await kz(r));await p()},[a,n,i,p]),removeServer:(0,D.useCallback)(async e=>{let t=await i(`${a}/api/servers/${encodeURIComponent(e)}`,{method:`DELETE`,headers:Oz(n,!1)});if(!t.ok)throw Error(await kz(t));await p()},[a,n,i,p]),reorderServers:(0,D.useCallback)(async e=>{s(t=>{let n=new Map(t.map(e=>[e.id,e])),r=e.map(e=>n.get(e)).filter(e=>e!==void 0);if(r.length!==t.length){let n=new Set(e);for(let e of t)n.has(e.id)||r.push(e)}return r});try{let t=await i(`${a}/api/servers/order`,{method:`PUT`,headers:Oz(n,!0),body:JSON.stringify({order:e})});if(!t.ok)throw Error(await kz(t))}catch(e){throw await p(),e instanceof Error?e:Error(String(e))}},[a,n,i,p]),importSource:h}}function Mz({targetId:e,resolveInitial:t,onPersist:n,onError:r,debounceMs:i=300}){let[a,o]=(0,D.useState)(null),s=(0,D.useRef)(void 0),c=(0,D.useRef)(t),l=(0,D.useRef)(n),u=(0,D.useRef)(r),d=(0,D.useRef)(null),f=(0,D.useRef)(e);c.current=t,l.current=n,u.current=r,d.current=a,f.current=e,(0,D.useEffect)(()=>{if(!e){o(null);return}o(c.current(e))},[e]),(0,D.useEffect)(()=>()=>{s.current&&=(clearTimeout(s.current),void 0)},[]);let p=(0,D.useCallback)((e,t)=>{l.current(e,t).catch(t=>{u.current(e,t)})},[]);return{draft:a,onChange:(0,D.useCallback)(t=>{if(!e)return;o(t),s.current&&clearTimeout(s.current);let n=e;s.current=setTimeout(()=>{s.current=void 0,p(n,t)},i)},[e,i,p]),flush:(0,D.useCallback)(()=>{if(!s.current)return;clearTimeout(s.current),s.current=void 0;let e=f.current,t=d.current;e&&t!==null&&p(e,t)},[p])}}function Nz({opened:e,resolveInitial:t,onPersist:n,onError:r,debounceMs:i=300}){let[a,o]=(0,D.useState)(null),s=(0,D.useRef)(void 0),c=(0,D.useRef)(null),l=(0,D.useRef)(t),u=(0,D.useRef)(n),d=(0,D.useRef)(r),f=(0,D.useRef)(e);l.current=t,u.current=n,d.current=r,f.current=e,(0,D.useEffect)(()=>{if(!e){o(null),c.current=null;return}let t=l.current();o(t),c.current=t},[e]),(0,D.useEffect)(()=>()=>{s.current&&=(clearTimeout(s.current),void 0)},[]);let p=(0,D.useCallback)(e=>{u.current(e).catch(e=>{d.current(e)})},[]);return{draft:a,onChange:(0,D.useCallback)(t=>{if(!e)return;let n=c.current;if(n===null)return;let r=typeof t==`function`?t(n):t;c.current=r,o(r),s.current&&clearTimeout(s.current),s.current=setTimeout(()=>{s.current=void 0;let e=c.current;e!==null&&p(e)},i)},[e,i,p]),flush:(0,D.useCallback)(()=>{if(!s.current)return;clearTimeout(s.current),s.current=void 0;let e=c.current;f.current&&e!==null&&p(e)},[p])}}function Pz(e,t,n){let r=t?YI(t):``,[i,a]=(0,D.useState)(`none`),o=(0,D.useCallback)(async()=>{if(!r){a(`none`);return}a(await yL(e,r))},[e,r]);return(0,D.useEffect)(()=>{n&&o()},[n,o]),{loginState:i,refresh:o,logout:(0,D.useCallback)(()=>{r&&bL(e,r).then(()=>{a(`none`)}).catch(()=>{})},[e,r])}}function Fz(e,t){return t===void 0?e:{...e,issuer:t}}var Iz=class{loaded=!1;loadPromise;persistQueue=Promise.resolve();memory;backend;constructor(e,t){this.memory=e,this.backend=t}load(){return this.loadPromise||=this.doLoad(),this.loadPromise}async doLoad(){if(this.loaded)return;let e=await this.backend.read();e&&this.memory.replace(e),this.loaded=!0}async ensureLoaded(){await this.load()}async persist(){let e=this.memory.snapshot(),t=this.persistQueue.catch(()=>{}).then(()=>this.backend.write(e));this.persistQueue=t,await t}resolveReadIssuer(e,t){return t??e.activeIssuer}issuerSlot(e,t){let n=this.resolveReadIssuer(e,t);return n?e.byIssuer?.[n]:void 0}updateIssuerSlot(e,t,n,r,i=!0){let a=this.memory.getState().getServerState(e),o={...a.byIssuer,[t]:{...a.byIssuer?.[t],...n}};this.memory.getState().setServerState(e,{byIssuer:o,...i&&{activeIssuer:t},...r})}mapIssuerSlots(e,t){let n={};for(let[r,i]of Object.entries(e.byIssuer??{}))n[r]={...i,...t(i)};return n}async getClientInformation(e,t,n){await this.ensureLoaded();let r=this.memory.getState().getServerState(e);if(t){let e=r.preregisteredClientInformation;return e?await VO.parseAsync(e):void 0}let i=this.issuerSlot(r,n)?.clientInformation,a=i??r.clientInformation;if(a)return Fz(await VO.parseAsync(a),i?this.resolveReadIssuer(r,n):void 0)}async getClientRegistrationKind(e,t){await this.ensureLoaded();let n=this.memory.getState().getServerState(e);return this.issuerSlot(n,t)?.clientRegistrationKind??n.clientRegistrationKind}async saveClientInformation(e,t,n){await this.ensureLoaded(),n.issuer===void 0?this.memory.getState().setServerState(e,{clientInformation:t,clientRegistrationKind:n.registrationKind}):this.updateIssuerSlot(e,n.issuer,{clientInformation:t,clientRegistrationKind:n.registrationKind},{clientInformation:void 0,clientRegistrationKind:void 0}),await this.persist()}async savePreregisteredClientInformation(e,t){await this.ensureLoaded(),this.memory.getState().setServerState(e,{preregisteredClientInformation:t,clientRegistrationKind:`static`}),await this.persist()}async clearClientInformation(e,t,n){if(await this.ensureLoaded(),t){this.memory.getState().setServerState(e,{preregisteredClientInformation:void 0}),await this.persist();return}if(n!==void 0)this.updateIssuerSlot(e,n,{clientInformation:void 0,clientRegistrationKind:void 0},{},!1);else{let t=this.memory.getState().getServerState(e),n=this.mapIssuerSlots(t,()=>({clientInformation:void 0,clientRegistrationKind:void 0}));this.memory.getState().setServerState(e,{byIssuer:n,clientInformation:void 0,clientRegistrationKind:void 0})}await this.persist()}async getTokens(e,t){await this.ensureLoaded();let n=this.memory.getState().getServerState(e),r=this.issuerSlot(n,t)?.tokens,i=r??n.tokens;if(i)return Fz(await IO.parseAsync(i),r?this.resolveReadIssuer(n,t):void 0)}async saveTokens(e,t,n){await this.ensureLoaded(),n?.issuer===void 0?this.memory.getState().setServerState(e,{tokens:t,...n?.enterpriseManaged===!0&&{enterpriseManaged:!0}}):this.updateIssuerSlot(e,n.issuer,{tokens:t},{tokens:void 0,...n.enterpriseManaged===!0&&{enterpriseManaged:!0}}),await this.persist()}async clearTokens(e,t){if(await this.ensureLoaded(),t!==void 0)this.updateIssuerSlot(e,t,{tokens:void 0},{},!1);else{let t=this.memory.getState().getServerState(e),n=this.mapIssuerSlots(t,()=>({tokens:void 0}));this.memory.getState().setServerState(e,{byIssuer:n,tokens:void 0})}await this.persist()}async getCodeVerifier(e){return await this.ensureLoaded(),this.memory.getState().getServerState(e).codeVerifier}async saveCodeVerifier(e,t){await this.ensureLoaded(),this.memory.getState().setServerState(e,{codeVerifier:t}),await this.persist()}async clearCodeVerifier(e){await this.ensureLoaded(),this.memory.getState().setServerState(e,{codeVerifier:void 0}),await this.persist()}async getScope(e){return await this.ensureLoaded(),this.memory.getState().getServerState(e).scope}async saveScope(e,t){await this.ensureLoaded(),this.memory.getState().setServerState(e,{scope:t}),await this.persist()}async clearScope(e){await this.ensureLoaded(),this.memory.getState().setServerState(e,{scope:void 0}),await this.persist()}async getServerMetadata(e){return await this.ensureLoaded(),this.memory.getState().getServerState(e).serverMetadata||null}async saveServerMetadata(e,t){await this.ensureLoaded(),this.memory.getState().setServerState(e,{serverMetadata:t}),await this.persist()}async clearServerMetadata(e){await this.ensureLoaded(),this.memory.getState().setServerState(e,{serverMetadata:void 0}),await this.persist()}async getDiscoveryState(e){return await this.ensureLoaded(),this.memory.getState().getServerState(e).discoveryState}async saveDiscoveryState(e,t){await this.ensureLoaded(),this.memory.getState().setServerState(e,{discoveryState:t}),await this.persist()}async clearDiscoveryState(e){await this.ensureLoaded(),this.memory.getState().setServerState(e,{discoveryState:void 0}),await this.persist()}async clear(e){await this.ensureLoaded(),this.memory.getState().clearServerState(e),await this.persist()}async getIdpSession(e){await this.ensureLoaded();let t=this.memory.getState().getIdpSession(e);if(!(!t.idToken&&!t.refreshToken&&t.idTokenExpiresAt===void 0))return t}async saveIdpSession(e,t){await this.ensureLoaded(),this.memory.getState().setIdpSession(e,t),await this.persist()}async clearIdpSession(e){await this.ensureLoaded(),this.memory.getState().clearIdpSession(e),await this.persist()}async clearEnterpriseManagedResourceServers(){await this.ensureLoaded(),this.memory.getState().clearEnterpriseManagedResourceServers(),await this.persist()}},Lz=class{servers={};idpSessions={};constructor(e){e&&this.replace(e)}getState(){return{servers:this.servers,idpSessions:this.idpSessions,getServerState:e=>this.servers[e]||{},setServerState:(e,t)=>{this.servers={...this.servers,[e]:{...this.servers[e],...t}}},clearServerState:e=>{let t={...this.servers};delete t[e],this.servers=t},getIdpSession:e=>this.idpSessions[e]||{},setIdpSession:(e,t)=>{this.idpSessions={...this.idpSessions,[e]:{...this.idpSessions[e],...t}}},clearIdpSession:e=>{let t={...this.idpSessions};delete t[e],this.idpSessions=t},clearEnterpriseManagedResourceServers:()=>{let e={...this.servers};for(let[t,n]of Object.entries(this.servers))n.enterpriseManaged===!0&&delete e[t];this.servers=e}}}snapshot(){return{servers:{...this.servers},idpSessions:{...this.idpSessions}}}replace(e){this.servers={...e.servers??{}},this.idpSessions={...e.idpSessions??{}}}};function Rz(e){return JSON.stringify(e,null,2)}function zz(e){return JSON.parse(e)}function Bz(e){return typeof e==`object`&&!!e&&!Array.isArray(e)}function Vz(e){return{servers:e.servers??{},idpSessions:e.idpSessions??{}}}function Hz(e){if(e==null)return null;let t=typeof e==`string`?e?zz(e):null:e;return Bz(t)?Bz(t.state)&&`version`in t?Vz(t.state):`servers`in t||`idpSessions`in t?Vz(t):null:null}function Uz(e){return Rz(e)}function Wz(e){let t=e.baseUrl.replace(/\/$/,``),n=e.fetchFn??globalThis.fetch;return{async read(){let r={};e.authToken&&(r[`x-mcp-remote-auth`]=`Bearer ${e.authToken}`);let i=await n(`${t}/api/storage/${e.storeId}`,{method:`GET`,headers:r});if(!i.ok){if(i.status===404)return null;throw Error(`Failed to read store: ${i.status}`)}return Hz(await i.json())},async write(r){let i={"Content-Type":`application/json`};e.authToken&&(i[`x-mcp-remote-auth`]=`Bearer ${e.authToken}`);let a=await n(`${t}/api/storage/${e.storeId}`,{method:`POST`,headers:i,body:Uz(r)});if(!a.ok)throw Error(`Failed to write store: ${a.status}`)},async remove(){let r={};e.authToken&&(r[`x-mcp-remote-auth`]=`Bearer ${e.authToken}`);let i=await n(`${t}/api/storage/${e.storeId}`,{method:`DELETE`,headers:r});if(!i.ok&&i.status!==404)throw Error(`Failed to delete store: ${i.status}`)}}}var Gz=class extends Iz{constructor(e){super(new Lz,Wz({baseUrl:e.baseUrl,storeId:e.storeId??`oauth`,authToken:e.authToken,fetchFn:e.fetchFn}))}},Kz;function qz(e){return`${e.baseUrl}\0${e.authToken??``}`}var Jz=(...e)=>globalThis.fetch(...e);function Yz(e){let t=qz(e);return Kz?.cacheKey===t||(Kz={cacheKey:t,storage:new Gz({baseUrl:e.baseUrl,authToken:e.authToken,fetchFn:Jz})}),Kz.storage}function Xz(e){if(typeof window>`u`)throw Error(`getWebRemoteOAuthStorage requires a browser environment`);return Yz({baseUrl:`${window.location.protocol}//${window.location.host}`,authToken:e})}function Zz(e){let t=(0,D.useCallback)(t=>{if(!e)return()=>{};let n=()=>t();return e.addEventListener(`errorChange`,n),()=>{e.removeEventListener(`errorChange`,n)}},[e]),n=(0,D.useCallback)(()=>e?.getError()??null,[e]);return(0,D.useSyncExternalStore)(t,n,n)}function Qz(e,t){let[n,r]=(0,D.useState)(t?.getTools()??[]),[i,a]=(0,D.useState)(t?.getListChanged()??!1);return(0,D.useEffect)(()=>{if(!t){r([]),a(!1);return}r(t.getTools()),a(t.getListChanged());let e=e=>{r(e.detail)},n=e=>{a(e.detail)};return t.addEventListener(`toolsChange`,e),t.addEventListener(`listChangedChange`,n),()=>{t.removeEventListener(`toolsChange`,e),t.removeEventListener(`listChangedChange`,n)}},[t]),{tools:n,error:Zz(t),listChanged:i,refresh:(0,D.useCallback)(async()=>{if(!t||!e)return[];t.clearListChanged();let n=await t.refresh(void 0,`refresh`);return r(n),n},[e,t]),clearListChanged:(0,D.useCallback)(()=>{t?.clearListChanged()},[t])}}function $z(e,t){let[n,r]=(0,D.useState)(t?.getPrompts()??[]),[i,a]=(0,D.useState)(t?.getListChanged()??!1);return(0,D.useEffect)(()=>{if(!t){r([]),a(!1);return}r(t.getPrompts()),a(t.getListChanged());let e=e=>{r(e.detail)},n=e=>{a(e.detail)};return t.addEventListener(`promptsChange`,e),t.addEventListener(`listChangedChange`,n),()=>{t.removeEventListener(`promptsChange`,e),t.removeEventListener(`listChangedChange`,n)}},[t]),{prompts:n,error:Zz(t),listChanged:i,refresh:(0,D.useCallback)(async()=>{if(!t||!e)return[];t.clearListChanged();let n=await t.refresh(void 0,`refresh`);return r(n),n},[e,t]),clearListChanged:(0,D.useCallback)(()=>{t?.clearListChanged()},[t])}}function eB(e,t){let[n,r]=(0,D.useState)(t?.getResources()??[]),[i,a]=(0,D.useState)(t?.getListChanged()??!1);return(0,D.useEffect)(()=>{if(!t){r([]),a(!1);return}r(t.getResources()),a(t.getListChanged());let e=e=>{r(e.detail)},n=e=>{a(e.detail)};return t.addEventListener(`resourcesChange`,e),t.addEventListener(`listChangedChange`,n),()=>{t.removeEventListener(`resourcesChange`,e),t.removeEventListener(`listChangedChange`,n)}},[t]),{resources:n,error:Zz(t),listChanged:i,refresh:(0,D.useCallback)(async()=>{if(!t||!e)return[];t.clearListChanged();let n=await t.refresh(void 0,`refresh`);return r(n),n},[e,t]),clearListChanged:(0,D.useCallback)(()=>{t?.clearListChanged()},[t])}}function tB(e,t){let[n,r]=(0,D.useState)(t?.getTools()??[]),[i,a]=(0,D.useState)(t?.getPagination().nextCursor),[o,s]=(0,D.useState)(t?.getPagination().pageCount??0);return(0,D.useEffect)(()=>{if(!t){r([]),a(void 0),s(0);return}r(t.getTools()),a(t.getPagination().nextCursor),s(t.getPagination().pageCount);let e=e=>{r(e.detail)},n=e=>{a(e.detail.nextCursor),s(e.detail.pageCount)};return t.addEventListener(`toolsChange`,e),t.addEventListener(`paginationChange`,n),()=>{t.removeEventListener(`toolsChange`,e),t.removeEventListener(`paginationChange`,n)}},[t]),{tools:n,nextCursor:i,pageCount:o,loadPage:(0,D.useCallback)(async n=>!t||!e?{tools:[],nextCursor:void 0}:t.loadPage(n),[e,t]),clear:(0,D.useCallback)(()=>{t?.clear()},[t])}}function nB(e,t){let[n,r]=(0,D.useState)(t?.getPrompts()??[]),[i,a]=(0,D.useState)(t?.getPagination().nextCursor),[o,s]=(0,D.useState)(t?.getPagination().pageCount??0);return(0,D.useEffect)(()=>{if(!t){r([]),a(void 0),s(0);return}r(t.getPrompts()),a(t.getPagination().nextCursor),s(t.getPagination().pageCount);let e=e=>{r(e.detail)},n=e=>{a(e.detail.nextCursor),s(e.detail.pageCount)};return t.addEventListener(`promptsChange`,e),t.addEventListener(`paginationChange`,n),()=>{t.removeEventListener(`promptsChange`,e),t.removeEventListener(`paginationChange`,n)}},[t]),{prompts:n,nextCursor:i,pageCount:o,loadPage:(0,D.useCallback)(async(n,r)=>!t||!e?{prompts:[],nextCursor:void 0}:t.loadPage(n,r),[e,t]),clear:(0,D.useCallback)(()=>{t?.clear()},[t])}}function rB(e,t){let[n,r]=(0,D.useState)(t?.getResources()??[]),[i,a]=(0,D.useState)(t?.getPagination().nextCursor),[o,s]=(0,D.useState)(t?.getPagination().pageCount??0);return(0,D.useEffect)(()=>{if(!t){r([]),a(void 0),s(0);return}r(t.getResources()),a(t.getPagination().nextCursor),s(t.getPagination().pageCount);let e=e=>{r(e.detail)},n=e=>{a(e.detail.nextCursor),s(e.detail.pageCount)};return t.addEventListener(`resourcesChange`,e),t.addEventListener(`paginationChange`,n),()=>{t.removeEventListener(`resourcesChange`,e),t.removeEventListener(`paginationChange`,n)}},[t]),{resources:n,nextCursor:i,pageCount:o,loadPage:(0,D.useCallback)(async(n,r)=>!t||!e?{resources:[],nextCursor:void 0}:t.loadPage(n,r),[e,t]),clear:(0,D.useCallback)(()=>{t?.clear()},[t])}}function iB({connected:e,paginated:t,managedItems:n,managedRefresh:r,pagedItems:i,pagedNextCursor:a,pagedPageCount:o,loadPage:s}){let c=(0,D.useCallback)(()=>a===void 0?Promise.resolve():s(a),[a,s]),l=(0,D.useCallback)(()=>t?s(void 0):r(),[t,s,r]);return{items:t?i:n,paginated:t,canLoadMore:e&&t&&a!==void 0,loadedPages:e?o:0,onLoadMore:c,onRefresh:l}}function aB(e,t){let[n,r]=(0,D.useState)(t?.getResourceTemplates()??[]);return(0,D.useEffect)(()=>{if(!t){r([]);return}r(t.getResourceTemplates());let e=e=>{r(e.detail)};return t.addEventListener(`resourceTemplatesChange`,e),()=>{t.removeEventListener(`resourceTemplatesChange`,e)}},[t]),{resourceTemplates:n,error:Zz(t),refresh:(0,D.useCallback)(async()=>{if(!t||!e)return[];let n=await t.refresh(void 0,`refresh`);return r(n),n},[e,t])}}function oB(e,t){let[n,r]=(0,D.useState)(t?.getTasks()??[]);return(0,D.useEffect)(()=>{if(!t){r([]);return}r(t.getTasks());let e=e=>{r(e.detail)};return t.addEventListener(`tasksChange`,e),()=>{t.removeEventListener(`tasksChange`,e)}},[t]),{tasks:n,refresh:(0,D.useCallback)(async()=>{if(!t||!e)return[];let n=await t.refresh();return r(n),n},[e,t]),clearCompleted:(0,D.useCallback)(()=>{t?.clearCompleted()},[t])}}function sB(e){let[t,n]=(0,D.useState)(e?.getSubscriptions()??[]),[r,i]=(0,D.useState)(e?.getStreamState()??VP);return(0,D.useEffect)(()=>{if(!e){n([]),i(VP);return}n(e.getSubscriptions()),i(e.getStreamState());let t=e=>{n(e.detail)},r=e=>{i(e.detail)};return e.addEventListener(`subscriptionsChange`,t),e.addEventListener(`streamStateChange`,r),()=>{e.removeEventListener(`subscriptionsChange`,t),e.removeEventListener(`streamStateChange`,r)}},[e]),{subscriptions:t,streamState:r}}function cB(e){let[t,n]=(0,D.useState)(e?.getMessages()??[]);return(0,D.useEffect)(()=>{if(!e){n([]);return}n(e.getMessages());let t=e=>{n(e.detail)};return e.addEventListener(`messagesChange`,t),()=>{e.removeEventListener(`messagesChange`,t)}},[e]),{messages:t}}function lB(e){let[t,n]=(0,D.useState)(e?.getFetchRequests()??[]);return(0,D.useEffect)(()=>{if(!e){n([]);return}n(e.getFetchRequests());let t=e=>{n(e.detail)};return e.addEventListener(`fetchRequestsChange`,t),()=>{e.removeEventListener(`fetchRequestsChange`,t)}},[e]),{fetchRequests:t}}function uB(e){let[t,n]=(0,D.useState)(e?.getStderrLogs()??[]);return(0,D.useEffect)(()=>{if(!e){n([]);return}n(e.getStderrLogs());let t=e=>{n(e.detail)};return e.addEventListener(`stderrLogsChange`,t),()=>{e.removeEventListener(`stderrLogsChange`,t)}},[e]),{stderrLogs:t}}function dB(e){return typeof e==`string`&&e?e:void 0}function fB(e){let{baseUrl:t,authToken:n,fetchFn:r}=e,i=r??globalThis.fetch,a=t.replace(/\/$/,``),[o,s]=(0,D.useState)(void 0),[c,l]=(0,D.useState)(void 0),[u,d]=(0,D.useState)(!0),[f,p]=(0,D.useState)(!0),m=(0,D.useCallback)(async e=>{let t={};n&&(t[`x-mcp-remote-auth`]=`Bearer ${n}`);try{let n=await i(`${a}/api/config`,{method:`GET`,headers:t});if(e()||!n.ok)return;let r=await n.json();if(e())return;s(dB(r.version)),l(dB(r.sandboxUrl)),d(r.writable!==!1)}catch{}finally{e()||p(!1)}},[a,n,i]);return(0,D.useEffect)(()=>{let e=!1;return m(()=>e),()=>{e=!0}},[m]),{version:o,sandboxUrl:c,writable:u,loading:f}}function pB(e){let[t,n]=(0,D.useState)(e?.getPendingSamples()??[]),[r,i]=(0,D.useState)(e?.getPendingElicitations()??[]);return(0,D.useEffect)(()=>{if(!e){n([]),i([]);return}n(e.getPendingSamples()),i(e.getPendingElicitations());let t=e=>{n([...e.detail])},r=e=>{i([...e.detail])};return e.addEventListener(`pendingSamplesChange`,t),e.addEventListener(`pendingElicitationsChange`,r),()=>{e.removeEventListener(`pendingSamplesChange`,t),e.removeEventListener(`pendingElicitationsChange`,r)}},[e]),{pendingSamples:t,pendingElicitations:r}}var mB=`io.modelcontextprotocol/related-task`,hB=une(e=>e!==null&&(typeof e==`object`||typeof e==`function`)),gB=Z([q(),J().int()]),_B=q();Gw({ttl:J().optional(),pollInterval:J().optional()});var vB=X({ttl:J().optional()}),yB=X({taskId:q()}),bB=Gw({progressToken:gB.optional(),[mB]:yB.optional()}),xB=X({_meta:bB.optional()}),SB=xB.extend({task:vB.optional()}),CB=e=>SB.safeParse(e).success,wB=X({method:q(),params:xB.loose().optional()}),TB=X({_meta:bB.optional()}),EB=X({method:q(),params:TB.loose().optional()}),DB=Gw({_meta:bB.optional()}),OB=Z([q(),J().int()]),kB=X({jsonrpc:$(`2.0`),id:OB,...wB.shape}).strict(),AB=e=>kB.safeParse(e).success,jB=X({jsonrpc:$(`2.0`),...EB.shape}).strict(),MB=e=>jB.safeParse(e).success,NB=X({jsonrpc:$(`2.0`),id:OB,result:DB}).strict(),PB=e=>NB.safeParse(e).success,FB;(function(e){e[e.ConnectionClosed=-32e3]=`ConnectionClosed`,e[e.RequestTimeout=-32001]=`RequestTimeout`,e[e.ParseError=-32700]=`ParseError`,e[e.InvalidRequest=-32600]=`InvalidRequest`,e[e.MethodNotFound=-32601]=`MethodNotFound`,e[e.InvalidParams=-32602]=`InvalidParams`,e[e.InternalError=-32603]=`InternalError`,e[e.UrlElicitationRequired=-32042]=`UrlElicitationRequired`})(FB||={});var IB=X({jsonrpc:$(`2.0`),id:OB.optional(),error:X({code:J().int(),message:q(),data:Hw().optional()})}).strict(),LB=e=>IB.safeParse(e).success,RB=Z([kB,jB,NB,IB]);Z([NB,IB]);var zB=DB.strict(),BB=TB.extend({requestId:OB.optional(),reason:q().optional()}),VB=EB.extend({method:$(`notifications/cancelled`),params:BB}),HB=X({icons:Y(X({src:q(),mimeType:q().optional(),sizes:Y(q()).optional(),theme:$w([`light`,`dark`]).optional()})).optional()}),UB=X({name:q(),title:q().optional()}),WB=UB.extend({...UB.shape,...HB.shape,version:q(),websiteUrl:q().optional(),description:q().optional()}),GB=yT(e=>e&&typeof e==`object`&&!Array.isArray(e)&&Object.keys(e).length===0?{form:{}}:e,Xw(X({form:Xw(X({applyDefaults:Pw().optional()}),Q(q(),Hw())).optional(),url:hB.optional()}),Q(q(),Hw()).optional())),KB=Gw({list:hB.optional(),cancel:hB.optional(),requests:Gw({sampling:Gw({createMessage:hB.optional()}).optional(),elicitation:Gw({create:hB.optional()}).optional()}).optional()}),qB=Gw({list:hB.optional(),cancel:hB.optional(),requests:Gw({tools:Gw({call:hB.optional()}).optional()}).optional()}),JB=X({experimental:Q(q(),hB).optional(),sampling:X({context:hB.optional(),tools:hB.optional()}).optional(),elicitation:GB.optional(),roots:X({listChanged:Pw().optional()}).optional(),tasks:KB.optional(),extensions:Q(q(),hB).optional()}),YB=xB.extend({protocolVersion:q(),capabilities:JB,clientInfo:WB}),XB=wB.extend({method:$(`initialize`),params:YB}),ZB=X({experimental:Q(q(),hB).optional(),logging:hB.optional(),completions:hB.optional(),prompts:X({listChanged:Pw().optional()}).optional(),resources:X({subscribe:Pw().optional(),listChanged:Pw().optional()}).optional(),tools:X({listChanged:Pw().optional()}).optional(),tasks:qB.optional(),extensions:Q(q(),hB).optional()}),QB=DB.extend({protocolVersion:q(),capabilities:ZB,serverInfo:WB,instructions:q().optional()}),$B=EB.extend({method:$(`notifications/initialized`),params:TB.optional()}),eV=wB.extend({method:$(`ping`),params:xB.optional()}),tV=X({progress:J(),total:iT(J()),message:iT(q())}),nV=X({...TB.shape,...tV.shape,progressToken:gB}),rV=EB.extend({method:$(`notifications/progress`),params:nV}),iV=xB.extend({cursor:_B.optional()}),aV=wB.extend({params:iV.optional()}),oV=DB.extend({nextCursor:_B.optional()}),sV=$w([`working`,`input_required`,`completed`,`failed`,`cancelled`]),cV=X({taskId:q(),status:sV,ttl:Z([J(),Rw()]),createdAt:q(),lastUpdatedAt:q(),pollInterval:iT(J()),statusMessage:iT(q())}),lV=DB.extend({task:cV}),uV=TB.merge(cV),dV=EB.extend({method:$(`notifications/tasks/status`),params:uV}),fV=wB.extend({method:$(`tasks/get`),params:xB.extend({taskId:q()})}),pV=DB.merge(cV),mV=wB.extend({method:$(`tasks/result`),params:xB.extend({taskId:q()})});DB.loose();var hV=aV.extend({method:$(`tasks/list`)}),gV=oV.extend({tasks:Y(cV)}),_V=wB.extend({method:$(`tasks/cancel`),params:xB.extend({taskId:q()})}),vV=DB.merge(cV),yV=X({uri:q(),mimeType:iT(q()),_meta:Q(q(),Hw()).optional()}),bV=yV.extend({text:q()}),xV=q().refine(e=>{try{return atob(e),!0}catch{return!1}},{message:`Invalid Base64 string`}),SV=yV.extend({blob:xV}),CV=$w([`user`,`assistant`]),wV=X({audience:Y(CV).optional(),priority:J().min(0).max(1).optional(),lastModified:fw({offset:!0}).optional()}),TV=X({...UB.shape,...HB.shape,uri:q(),description:iT(q()),mimeType:iT(q()),size:iT(J()),annotations:wV.optional(),_meta:iT(Gw({}))}),EV=X({...UB.shape,...HB.shape,uriTemplate:q(),description:iT(q()),mimeType:iT(q()),annotations:wV.optional(),_meta:iT(Gw({}))}),DV=aV.extend({method:$(`resources/list`)}),OV=oV.extend({resources:Y(TV)}),kV=aV.extend({method:$(`resources/templates/list`)}),AV=oV.extend({resourceTemplates:Y(EV)}),jV=xB.extend({uri:q()}),MV=jV,NV=wB.extend({method:$(`resources/read`),params:MV}),PV=DB.extend({contents:Y(Z([bV,SV]))}),FV=EB.extend({method:$(`notifications/resources/list_changed`),params:TB.optional()}),IV=jV,LV=wB.extend({method:$(`resources/subscribe`),params:IV}),RV=jV,zV=wB.extend({method:$(`resources/unsubscribe`),params:RV}),BV=TB.extend({uri:q()}),VV=EB.extend({method:$(`notifications/resources/updated`),params:BV}),HV=X({name:q(),description:iT(q()),required:iT(Pw())}),UV=X({...UB.shape,...HB.shape,description:iT(q()),arguments:iT(Y(HV)),_meta:iT(Gw({}))}),WV=aV.extend({method:$(`prompts/list`)}),GV=oV.extend({prompts:Y(UV)}),KV=xB.extend({name:q(),arguments:Q(q(),q()).optional()}),qV=wB.extend({method:$(`prompts/get`),params:KV}),JV=X({type:$(`text`),text:q(),annotations:wV.optional(),_meta:Q(q(),Hw()).optional()}),YV=X({type:$(`image`),data:xV,mimeType:q(),annotations:wV.optional(),_meta:Q(q(),Hw()).optional()}),XV=X({type:$(`audio`),data:xV,mimeType:q(),annotations:wV.optional(),_meta:Q(q(),Hw()).optional()}),ZV=X({type:$(`tool_use`),name:q(),id:q(),input:Q(q(),Hw()),_meta:Q(q(),Hw()).optional()}),QV=X({type:$(`resource`),resource:Z([bV,SV]),annotations:wV.optional(),_meta:Q(q(),Hw()).optional()}),$V=TV.extend({type:$(`resource_link`)}),eH=Z([JV,YV,XV,$V,QV]),tH=X({role:CV,content:eH}),nH=DB.extend({description:q().optional(),messages:Y(tH)}),rH=EB.extend({method:$(`notifications/prompts/list_changed`),params:TB.optional()}),iH=X({title:q().optional(),readOnlyHint:Pw().optional(),destructiveHint:Pw().optional(),idempotentHint:Pw().optional(),openWorldHint:Pw().optional()}),aH=X({taskSupport:$w([`required`,`optional`,`forbidden`]).optional()}),oH=X({...UB.shape,...HB.shape,description:q().optional(),inputSchema:X({type:$(`object`),properties:Q(q(),hB).optional(),required:Y(q()).optional()}).catchall(Hw()),outputSchema:X({type:$(`object`),properties:Q(q(),hB).optional(),required:Y(q()).optional()}).catchall(Hw()).optional(),annotations:iH.optional(),execution:aH.optional(),_meta:Q(q(),Hw()).optional()}),sH=aV.extend({method:$(`tools/list`)}),cH=oV.extend({tools:Y(oH)}),lH=DB.extend({content:Y(eH).default([]),structuredContent:Q(q(),Hw()).optional(),isError:Pw().optional()});lH.or(DB.extend({toolResult:Hw()}));var uH=SB.extend({name:q(),arguments:Q(q(),Hw()).optional()}),dH=wB.extend({method:$(`tools/call`),params:uH}),fH=EB.extend({method:$(`notifications/tools/list_changed`),params:TB.optional()});X({autoRefresh:Pw().default(!0),debounceMs:J().int().nonnegative().default(300)});var pH=$w([`debug`,`info`,`notice`,`warning`,`error`,`critical`,`alert`,`emergency`]),mH=xB.extend({level:pH}),hH=wB.extend({method:$(`logging/setLevel`),params:mH}),gH=TB.extend({level:pH,logger:q().optional(),data:Hw()}),_H=EB.extend({method:$(`notifications/message`),params:gH}),vH=X({hints:Y(X({name:q().optional()})).optional(),costPriority:J().min(0).max(1).optional(),speedPriority:J().min(0).max(1).optional(),intelligencePriority:J().min(0).max(1).optional()}),yH=X({mode:$w([`auto`,`required`,`none`]).optional()}),bH=X({type:$(`tool_result`),toolUseId:q().describe(`The unique identifier for the corresponding tool call.`),content:Y(eH).default([]),structuredContent:X({}).loose().optional(),isError:Pw().optional(),_meta:Q(q(),Hw()).optional()}),xH=Jw(`type`,[JV,YV,XV]),SH=Jw(`type`,[JV,YV,XV,ZV,bH]),CH=X({role:CV,content:Z([SH,Y(SH)]),_meta:Q(q(),Hw()).optional()}),wH=SB.extend({messages:Y(CH),modelPreferences:vH.optional(),systemPrompt:q().optional(),includeContext:$w([`none`,`thisServer`,`allServers`]).optional(),temperature:J().optional(),maxTokens:J().int(),stopSequences:Y(q()).optional(),metadata:hB.optional(),tools:Y(oH).optional(),toolChoice:yH.optional()}),TH=wB.extend({method:$(`sampling/createMessage`),params:wH}),EH=DB.extend({model:q(),stopReason:iT($w([`endTurn`,`stopSequence`,`maxTokens`]).or(q())),role:CV,content:xH}),DH=DB.extend({model:q(),stopReason:iT($w([`endTurn`,`stopSequence`,`maxTokens`,`toolUse`]).or(q())),role:CV,content:Z([SH,Y(SH)])}),OH=X({type:$(`boolean`),title:q().optional(),description:q().optional(),default:Pw().optional()}),kH=X({type:$(`string`),title:q().optional(),description:q().optional(),minLength:J().optional(),maxLength:J().optional(),format:$w([`email`,`uri`,`date`,`date-time`]).optional(),default:q().optional()}),AH=X({type:$w([`number`,`integer`]),title:q().optional(),description:q().optional(),minimum:J().optional(),maximum:J().optional(),default:J().optional()}),jH=X({type:$(`string`),title:q().optional(),description:q().optional(),enum:Y(q()),default:q().optional()}),MH=X({type:$(`string`),title:q().optional(),description:q().optional(),oneOf:Y(X({const:q(),title:q()})),default:q().optional()}),NH=Z([Z([X({type:$(`string`),title:q().optional(),description:q().optional(),enum:Y(q()),enumNames:Y(q()).optional(),default:q().optional()}),Z([jH,MH]),Z([X({type:$(`array`),title:q().optional(),description:q().optional(),minItems:J().optional(),maxItems:J().optional(),items:X({type:$(`string`),enum:Y(q())}),default:Y(q()).optional()}),X({type:$(`array`),title:q().optional(),description:q().optional(),minItems:J().optional(),maxItems:J().optional(),items:X({anyOf:Y(X({const:q(),title:q()}))}),default:Y(q()).optional()})])]),OH,kH,AH]),PH=Z([SB.extend({mode:$(`form`).optional(),message:q(),requestedSchema:X({type:$(`object`),properties:Q(q(),NH),required:Y(q()).optional()})}),SB.extend({mode:$(`url`),message:q(),elicitationId:q(),url:q().url()})]),FH=wB.extend({method:$(`elicitation/create`),params:PH}),IH=TB.extend({elicitationId:q()}),LH=EB.extend({method:$(`notifications/elicitation/complete`),params:IH}),RH=DB.extend({action:$w([`accept`,`decline`,`cancel`]),content:yT(e=>e===null?void 0:e,Q(q(),Z([q(),J(),Pw(),Y(q())])).optional())}),zH=X({type:$(`ref/resource`),uri:q()}),BH=X({type:$(`ref/prompt`),name:q()}),VH=xB.extend({ref:Z([BH,zH]),argument:X({name:q(),value:q()}),context:X({arguments:Q(q(),q()).optional()}).optional()}),HH=wB.extend({method:$(`completion/complete`),params:VH}),UH=DB.extend({completion:Gw({values:Y(q()).max(100),total:iT(J().int()),hasMore:iT(Pw())})}),WH=X({uri:q().startsWith(`file://`),name:q().optional(),_meta:Q(q(),Hw()).optional()}),GH=wB.extend({method:$(`roots/list`),params:xB.optional()}),KH=DB.extend({roots:Y(WH)}),qH=EB.extend({method:$(`notifications/roots/list_changed`),params:TB.optional()});Z([eV,XB,HH,hH,qV,WV,DV,kV,NV,LV,zV,dH,sH,fV,mV,hV,_V]),Z([VB,rV,$B,qH,dV]),Z([zB,EH,DH,RH,KH,pV,gV,lV]),Z([eV,TH,FH,GH,fV,mV,hV,_V]),Z([VB,rV,_H,VV,FV,fH,rH,dV,LH]),Z([zB,QB,UH,nH,GV,OV,AV,PV,lH,cH,pV,gV,lV]);var JH=class e extends Error{constructor(e,t,n){super(`MCP error ${e}: ${t}`),this.code=e,this.data=n,this.name=`McpError`}static fromError(t,n,r){if(t===FB.UrlElicitationRequired&&r){let e=r;if(e.elicitations)return new YH(e.elicitations,n)}return new e(t,n,r)}},YH=class extends JH{constructor(e,t=`URL elicitation${e.length>1?`s`:``} required`){super(FB.UrlElicitationRequired,t,{elicitations:e})}get elicitations(){return this.data?.elicitations??[]}};function XH(e){return!!e._zod}function ZH(e,t){return XH(e)?ub(e,t):e.safeParse(t)}function QH(e){if(!e)return;let t;if(t=XH(e)?e._zod?.def?.shape:e.shape,t){if(typeof t==`function`)try{return t()}catch{return}return t}}function $H(e){if(XH(e)){let t=e._zod?.def;if(t){if(t.value!==void 0)return t.value;if(Array.isArray(t.values)&&t.values.length>0)return t.values[0]}}let t=e._def;if(t){if(t.value!==void 0)return t.value;if(Array.isArray(t.values)&&t.values.length>0)return t.values[0]}let n=e.value;if(n!==void 0)return n}function eU(e){return e===`completed`||e===`failed`||e===`cancelled`}function tU(e){let t=QH(e)?.method;if(!t)throw Error(`Schema is missing a method literal`);let n=$H(t);if(typeof n!=`string`)throw Error(`Schema method literal must be a string`);return n}function nU(e,t){let n=ZH(e,t);if(!n.success)throw n.error;return n.data}var rU=class{constructor(e){this._options=e,this._requestMessageId=0,this._requestHandlers=new Map,this._requestHandlerAbortControllers=new Map,this._notificationHandlers=new Map,this._responseHandlers=new Map,this._progressHandlers=new Map,this._timeoutInfo=new Map,this._pendingDebouncedNotifications=new Set,this._taskProgressTokens=new Map,this._requestResolvers=new Map,this.setNotificationHandler(VB,e=>{this._oncancel(e)}),this.setNotificationHandler(rV,e=>{this._onprogress(e)}),this.setRequestHandler(eV,e=>({})),this._taskStore=e?.taskStore,this._taskMessageQueue=e?.taskMessageQueue,this._taskStore&&(this.setRequestHandler(fV,async(e,t)=>{let n=await this._taskStore.getTask(e.params.taskId,t.sessionId);if(!n)throw new JH(FB.InvalidParams,`Failed to retrieve task: Task not found`);return{...n}}),this.setRequestHandler(mV,async(e,t)=>{let n=async()=>{let r=e.params.taskId;if(this._taskMessageQueue){let e;for(;e=await this._taskMessageQueue.dequeue(r,t.sessionId);){if(e.type===`response`||e.type===`error`){let t=e.message,n=t.id,r=this._requestResolvers.get(n);if(r)if(this._requestResolvers.delete(n),e.type===`response`)r(t);else{let e=t;r(new JH(e.error.code,e.error.message,e.error.data))}else{let t=e.type===`response`?`Response`:`Error`;this._onerror(Error(`${t} handler missing for request ${n}`))}continue}await this._transport?.send(e.message,{relatedRequestId:t.requestId})}}let i=await this._taskStore.getTask(r,t.sessionId);if(!i)throw new JH(FB.InvalidParams,`Task not found: ${r}`);if(!eU(i.status))return await this._waitForTaskUpdate(r,t.signal),await n();if(eU(i.status)){let e=await this._taskStore.getTaskResult(r,t.sessionId);return this._clearTaskQueue(r),{...e,_meta:{...e._meta,[mB]:{taskId:r}}}}return await n()};return await n()}),this.setRequestHandler(hV,async(e,t)=>{try{let{tasks:n,nextCursor:r}=await this._taskStore.listTasks(e.params?.cursor,t.sessionId);return{tasks:n,nextCursor:r,_meta:{}}}catch(e){throw new JH(FB.InvalidParams,`Failed to list tasks: ${e instanceof Error?e.message:String(e)}`)}}),this.setRequestHandler(_V,async(e,t)=>{try{let n=await this._taskStore.getTask(e.params.taskId,t.sessionId);if(!n)throw new JH(FB.InvalidParams,`Task not found: ${e.params.taskId}`);if(eU(n.status))throw new JH(FB.InvalidParams,`Cannot cancel task in terminal status: ${n.status}`);await this._taskStore.updateTaskStatus(e.params.taskId,`cancelled`,`Client cancelled task execution.`,t.sessionId),this._clearTaskQueue(e.params.taskId);let r=await this._taskStore.getTask(e.params.taskId,t.sessionId);if(!r)throw new JH(FB.InvalidParams,`Task not found after cancellation: ${e.params.taskId}`);return{_meta:{},...r}}catch(e){throw e instanceof JH?e:new JH(FB.InvalidRequest,`Failed to cancel task: ${e instanceof Error?e.message:String(e)}`)}}))}async _oncancel(e){e.params.requestId&&this._requestHandlerAbortControllers.get(e.params.requestId)?.abort(e.params.reason)}_setupTimeout(e,t,n,r,i=!1){this._timeoutInfo.set(e,{timeoutId:setTimeout(r,t),startTime:Date.now(),timeout:t,maxTotalTimeout:n,resetTimeoutOnProgress:i,onTimeout:r})}_resetTimeout(e){let t=this._timeoutInfo.get(e);if(!t)return!1;let n=Date.now()-t.startTime;if(t.maxTotalTimeout&&n>=t.maxTotalTimeout)throw this._timeoutInfo.delete(e),JH.fromError(FB.RequestTimeout,`Maximum total timeout exceeded`,{maxTotalTimeout:t.maxTotalTimeout,totalElapsed:n});return clearTimeout(t.timeoutId),t.timeoutId=setTimeout(t.onTimeout,t.timeout),!0}_cleanupTimeout(e){let t=this._timeoutInfo.get(e);t&&(clearTimeout(t.timeoutId),this._timeoutInfo.delete(e))}async connect(e){if(this._transport)throw Error(`Already connected to a transport. Call close() before connecting to a new transport, or use a separate Protocol instance per connection.`);this._transport=e;let t=this.transport?.onclose;this._transport.onclose=()=>{t?.(),this._onclose()};let n=this.transport?.onerror;this._transport.onerror=e=>{n?.(e),this._onerror(e)};let r=this._transport?.onmessage;this._transport.onmessage=(e,t)=>{r?.(e,t),PB(e)||LB(e)?this._onresponse(e):AB(e)?this._onrequest(e,t):MB(e)?this._onnotification(e):this._onerror(Error(`Unknown message type: ${JSON.stringify(e)}`))},await this._transport.start()}_onclose(){let e=this._responseHandlers;this._responseHandlers=new Map,this._progressHandlers.clear(),this._taskProgressTokens.clear(),this._pendingDebouncedNotifications.clear();for(let e of this._timeoutInfo.values())clearTimeout(e.timeoutId);this._timeoutInfo.clear();for(let e of this._requestHandlerAbortControllers.values())e.abort();this._requestHandlerAbortControllers.clear();let t=JH.fromError(FB.ConnectionClosed,`Connection closed`);this._transport=void 0,this.onclose?.();for(let n of e.values())n(t)}_onerror(e){this.onerror?.(e)}_onnotification(e){let t=this._notificationHandlers.get(e.method)??this.fallbackNotificationHandler;t!==void 0&&Promise.resolve().then(()=>t(e)).catch(e=>this._onerror(Error(`Uncaught error in notification handler: ${e}`)))}_onrequest(e,t){let n=this._requestHandlers.get(e.method)??this.fallbackRequestHandler,r=this._transport,i=e.params?._meta?.[mB]?.taskId;if(n===void 0){let t={jsonrpc:`2.0`,id:e.id,error:{code:FB.MethodNotFound,message:`Method not found`}};i&&this._taskMessageQueue?this._enqueueTaskMessage(i,{type:`error`,message:t,timestamp:Date.now()},r?.sessionId).catch(e=>this._onerror(Error(`Failed to enqueue error response: ${e}`))):r?.send(t).catch(e=>this._onerror(Error(`Failed to send an error response: ${e}`)));return}let a=new AbortController;this._requestHandlerAbortControllers.set(e.id,a);let o=CB(e.params)?e.params.task:void 0,s=this._taskStore?this.requestTaskStore(e,r?.sessionId):void 0,c={signal:a.signal,sessionId:r?.sessionId,_meta:e.params?._meta,sendNotification:async t=>{if(a.signal.aborted)return;let n={relatedRequestId:e.id};i&&(n.relatedTask={taskId:i}),await this.notification(t,n)},sendRequest:async(t,n,r)=>{if(a.signal.aborted)throw new JH(FB.ConnectionClosed,`Request was cancelled`);let o={...r,relatedRequestId:e.id};i&&!o.relatedTask&&(o.relatedTask={taskId:i});let c=o.relatedTask?.taskId??i;return c&&s&&await s.updateTaskStatus(c,`input_required`),await this.request(t,n,o)},authInfo:t?.authInfo,requestId:e.id,requestInfo:t?.requestInfo,taskId:i,taskStore:s,taskRequestedTtl:o?.ttl,closeSSEStream:t?.closeSSEStream,closeStandaloneSSEStream:t?.closeStandaloneSSEStream};Promise.resolve().then(()=>{o&&this.assertTaskHandlerCapability(e.method)}).then(()=>n(e,c)).then(async t=>{if(a.signal.aborted)return;let n={result:t,jsonrpc:`2.0`,id:e.id};i&&this._taskMessageQueue?await this._enqueueTaskMessage(i,{type:`response`,message:n,timestamp:Date.now()},r?.sessionId):await r?.send(n)},async t=>{if(a.signal.aborted)return;let n={jsonrpc:`2.0`,id:e.id,error:{code:Number.isSafeInteger(t.code)?t.code:FB.InternalError,message:t.message??`Internal error`,...t.data!==void 0&&{data:t.data}}};i&&this._taskMessageQueue?await this._enqueueTaskMessage(i,{type:`error`,message:n,timestamp:Date.now()},r?.sessionId):await r?.send(n)}).catch(e=>this._onerror(Error(`Failed to send response: ${e}`))).finally(()=>{this._requestHandlerAbortControllers.get(e.id)===a&&this._requestHandlerAbortControllers.delete(e.id)})}_onprogress(e){let{progressToken:t,...n}=e.params,r=Number(t),i=this._progressHandlers.get(r);if(!i){this._onerror(Error(`Received a progress notification for an unknown token: ${JSON.stringify(e)}`));return}let a=this._responseHandlers.get(r),o=this._timeoutInfo.get(r);if(o&&a&&o.resetTimeoutOnProgress)try{this._resetTimeout(r)}catch(e){this._responseHandlers.delete(r),this._progressHandlers.delete(r),this._cleanupTimeout(r),a(e);return}i(n)}_onresponse(e){let t=Number(e.id),n=this._requestResolvers.get(t);if(n){this._requestResolvers.delete(t),PB(e)?n(e):n(new JH(e.error.code,e.error.message,e.error.data));return}let r=this._responseHandlers.get(t);if(r===void 0){this._onerror(Error(`Received a response for an unknown message ID: ${JSON.stringify(e)}`));return}this._responseHandlers.delete(t),this._cleanupTimeout(t);let i=!1;if(PB(e)&&e.result&&typeof e.result==`object`){let n=e.result;if(n.task&&typeof n.task==`object`){let e=n.task;typeof e.taskId==`string`&&(i=!0,this._taskProgressTokens.set(e.taskId,t))}}i||this._progressHandlers.delete(t),PB(e)?r(e):r(JH.fromError(e.error.code,e.error.message,e.error.data))}get transport(){return this._transport}async close(){await this._transport?.close()}async*requestStream(e,t,n){let{task:r}=n??{};if(!r){try{yield{type:`result`,result:await this.request(e,t,n)}}catch(e){yield{type:`error`,error:e instanceof JH?e:new JH(FB.InternalError,String(e))}}return}let i;try{let r=await this.request(e,lV,n);if(r.task)i=r.task.taskId,yield{type:`taskCreated`,task:r.task};else throw new JH(FB.InternalError,`Task creation did not return a task`);for(;;){let e=await this.getTask({taskId:i},n);if(yield{type:`taskStatus`,task:e},eU(e.status)){e.status===`completed`?yield{type:`result`,result:await this.getTaskResult({taskId:i},t,n)}:e.status===`failed`?yield{type:`error`,error:new JH(FB.InternalError,`Task ${i} failed`)}:e.status===`cancelled`&&(yield{type:`error`,error:new JH(FB.InternalError,`Task ${i} was cancelled`)});return}if(e.status===`input_required`){yield{type:`result`,result:await this.getTaskResult({taskId:i},t,n)};return}let r=e.pollInterval??this._options?.defaultTaskPollInterval??1e3;await new Promise(e=>setTimeout(e,r)),n?.signal?.throwIfAborted()}}catch(e){yield{type:`error`,error:e instanceof JH?e:new JH(FB.InternalError,String(e))}}}request(e,t,n){let{relatedRequestId:r,resumptionToken:i,onresumptiontoken:a,task:o,relatedTask:s}=n??{};return new Promise((c,l)=>{let u=e=>{l(e)};if(!this._transport){u(Error(`Not connected`));return}if(this._options?.enforceStrictCapabilities===!0)try{this.assertCapabilityForMethod(e.method),o&&this.assertTaskCapability(e.method)}catch(e){u(e);return}n?.signal?.throwIfAborted();let d=this._requestMessageId++,f={...e,jsonrpc:`2.0`,id:d};n?.onprogress&&(this._progressHandlers.set(d,n.onprogress),f.params={...e.params,_meta:{...e.params?._meta||{},progressToken:d}}),o&&(f.params={...f.params,task:o}),s&&(f.params={...f.params,_meta:{...f.params?._meta||{},[mB]:s}});let p=e=>{this._responseHandlers.delete(d),this._progressHandlers.delete(d),this._cleanupTimeout(d),this._transport?.send({jsonrpc:`2.0`,method:`notifications/cancelled`,params:{requestId:d,reason:String(e)}},{relatedRequestId:r,resumptionToken:i,onresumptiontoken:a}).catch(e=>this._onerror(Error(`Failed to send cancellation: ${e}`))),l(e instanceof JH?e:new JH(FB.RequestTimeout,String(e)))};this._responseHandlers.set(d,e=>{if(!n?.signal?.aborted){if(e instanceof Error)return l(e);try{let n=ZH(t,e.result);n.success?c(n.data):l(n.error)}catch(e){l(e)}}}),n?.signal?.addEventListener(`abort`,()=>{p(n?.signal?.reason)});let m=n?.timeout??6e4;this._setupTimeout(d,m,n?.maxTotalTimeout,()=>p(JH.fromError(FB.RequestTimeout,`Request timed out`,{timeout:m})),n?.resetTimeoutOnProgress??!1);let h=s?.taskId;h?(this._requestResolvers.set(d,e=>{let t=this._responseHandlers.get(d);t?t(e):this._onerror(Error(`Response handler missing for side-channeled request ${d}`))}),this._enqueueTaskMessage(h,{type:`request`,message:f,timestamp:Date.now()}).catch(e=>{this._cleanupTimeout(d),l(e)})):this._transport.send(f,{relatedRequestId:r,resumptionToken:i,onresumptiontoken:a}).catch(e=>{this._cleanupTimeout(d),l(e)})})}async getTask(e,t){return this.request({method:`tasks/get`,params:e},pV,t)}async getTaskResult(e,t,n){return this.request({method:`tasks/result`,params:e},t,n)}async listTasks(e,t){return this.request({method:`tasks/list`,params:e},gV,t)}async cancelTask(e,t){return this.request({method:`tasks/cancel`,params:e},vV,t)}async notification(e,t){if(!this._transport)throw Error(`Not connected`);this.assertNotificationCapability(e.method);let n=t?.relatedTask?.taskId;if(n){let r={...e,jsonrpc:`2.0`,params:{...e.params,_meta:{...e.params?._meta||{},[mB]:t.relatedTask}}};await this._enqueueTaskMessage(n,{type:`notification`,message:r,timestamp:Date.now()});return}if((this._options?.debouncedNotificationMethods??[]).includes(e.method)&&!e.params&&!t?.relatedRequestId&&!t?.relatedTask){if(this._pendingDebouncedNotifications.has(e.method))return;this._pendingDebouncedNotifications.add(e.method),Promise.resolve().then(()=>{if(this._pendingDebouncedNotifications.delete(e.method),!this._transport)return;let n={...e,jsonrpc:`2.0`};t?.relatedTask&&(n={...n,params:{...n.params,_meta:{...n.params?._meta||{},[mB]:t.relatedTask}}}),this._transport?.send(n,t).catch(e=>this._onerror(e))});return}let r={...e,jsonrpc:`2.0`};t?.relatedTask&&(r={...r,params:{...r.params,_meta:{...r.params?._meta||{},[mB]:t.relatedTask}}}),await this._transport.send(r,t)}setRequestHandler(e,t){let n=tU(e);this.assertRequestHandlerCapability(n),this._requestHandlers.set(n,(n,r)=>{let i=nU(e,n);return Promise.resolve(t(i,r))})}removeRequestHandler(e){this._requestHandlers.delete(e)}assertCanSetRequestHandler(e){if(this._requestHandlers.has(e))throw Error(`A request handler for ${e} already exists, which would be overridden`)}setNotificationHandler(e,t){let n=tU(e);this._notificationHandlers.set(n,n=>{let r=nU(e,n);return Promise.resolve(t(r))})}removeNotificationHandler(e){this._notificationHandlers.delete(e)}_cleanupTaskProgressHandler(e){let t=this._taskProgressTokens.get(e);t!==void 0&&(this._progressHandlers.delete(t),this._taskProgressTokens.delete(e))}async _enqueueTaskMessage(e,t,n){if(!this._taskStore||!this._taskMessageQueue)throw Error(`Cannot enqueue task message: taskStore and taskMessageQueue are not configured`);let r=this._options?.maxTaskQueueSize;await this._taskMessageQueue.enqueue(e,t,n,r)}async _clearTaskQueue(e,t){if(this._taskMessageQueue){let n=await this._taskMessageQueue.dequeueAll(e,t);for(let t of n)if(t.type===`request`&&AB(t.message)){let n=t.message.id,r=this._requestResolvers.get(n);r?(r(new JH(FB.InternalError,`Task cancelled or completed`)),this._requestResolvers.delete(n)):this._onerror(Error(`Resolver missing for request ${n} during task ${e} cleanup`))}}}async _waitForTaskUpdate(e,t){let n=this._options?.defaultTaskPollInterval??1e3;try{let t=await this._taskStore?.getTask(e);t?.pollInterval&&(n=t.pollInterval)}catch{}return new Promise((e,r)=>{if(t.aborted){r(new JH(FB.InvalidRequest,`Request cancelled`));return}let i=setTimeout(e,n);t.addEventListener(`abort`,()=>{clearTimeout(i),r(new JH(FB.InvalidRequest,`Request cancelled`))},{once:!0})})}requestTaskStore(e,t){let n=this._taskStore;if(!n)throw Error(`No task store configured`);return{createTask:async r=>{if(!e)throw Error(`No request provided`);return await n.createTask(r,e.id,{method:e.method,params:e.params},t)},getTask:async e=>{let r=await n.getTask(e,t);if(!r)throw new JH(FB.InvalidParams,`Failed to retrieve task: Task not found`);return r},storeTaskResult:async(e,r,i)=>{await n.storeTaskResult(e,r,i,t);let a=await n.getTask(e,t);if(a){let t=dV.parse({method:`notifications/tasks/status`,params:a});await this.notification(t),eU(a.status)&&this._cleanupTaskProgressHandler(e)}},getTaskResult:e=>n.getTaskResult(e,t),updateTaskStatus:async(e,r,i)=>{let a=await n.getTask(e,t);if(!a)throw new JH(FB.InvalidParams,`Task "${e}" not found - it may have been cleaned up`);if(eU(a.status))throw new JH(FB.InvalidParams,`Cannot update task "${e}" from terminal status "${a.status}" to "${r}". Terminal states (completed, failed, cancelled) cannot transition to other states.`);await n.updateTaskStatus(e,r,i,t);let o=await n.getTask(e,t);if(o){let t=dV.parse({method:`notifications/tasks/status`,params:o});await this.notification(t),eU(o.status)&&this._cleanupTaskProgressHandler(e)}},listTasks:e=>n.listTasks(e,t)}}};(e=>typeof u<`u`?u:typeof Proxy<`u`?new Proxy(e,{get:(e,t)=>(typeof u<`u`?u:e)[t]}):e)(function(e){if(typeof u<`u`)return u.apply(this,arguments);throw Error(`Dynamic require of "`+e+`" is not supported`)});var iU=class extends rU{_registeredMethods=new Set;_eventSlots=new Map;onEventDispatch(e,t){}_ensureEventSlot(e){let t=this._eventSlots.get(e);if(!t){let n=this.eventSchemas[e];if(!n)throw Error(`Unknown event: ${String(e)}`);t={listeners:[]},this._eventSlots.set(e,t);let r=n.shape.method.value;this._registeredMethods.add(r);let i=t;super.setNotificationHandler(n,t=>{let n=t.params;this.onEventDispatch(e,n),i.onHandler?.(n);for(let e of[...i.listeners])e(n)})}return t}setEventHandler(e,t){let n=this._ensureEventSlot(e);n.onHandler&&t&&console.warn(`[MCP Apps] on${String(e)} handler replaced. Use addEventListener("${String(e)}", …) to add multiple listeners without replacing.`),n.onHandler=t}getEventHandler(e){return this._eventSlots.get(e)?.onHandler}addEventListener(e,t){this._ensureEventSlot(e).listeners.push(t)}removeEventListener(e,t){let n=this._eventSlots.get(e);if(!n)return;let r=n.listeners.indexOf(t);r!==-1&&n.listeners.splice(r,1)}setRequestHandler=(e,t)=>{this._assertMethodNotRegistered(e,`setRequestHandler`),super.setRequestHandler(e,t)};setNotificationHandler=(e,t)=>{this._assertMethodNotRegistered(e,`setNotificationHandler`),super.setNotificationHandler(e,t)};warnIfRequestHandlerReplaced(e,t,n){t&&n&&console.warn(`[MCP Apps] ${e} handler replaced. Previous handler will no longer be called.`)}replaceRequestHandler=(e,t)=>{let n=e.shape.method.value;this._registeredMethods.add(n),super.setRequestHandler(e,t)};_assertMethodNotRegistered(e,t){let n=e.shape.method.value;if(this._registeredMethods.has(n))throw Error(`Handler for "${n}" already registered (via ${t}). Use addEventListener() to attach multiple listeners, or the on* setter for replace semantics.`);this._registeredMethods.add(n)}},aU=`2026-01-26`,oU=Z([$(`light`),$(`dark`)]).describe(`Color theme preference for the host environment.`),sU=Z([$(`inline`),$(`fullscreen`),$(`pip`)]).describe(`Display mode for UI presentation.`),cU=Q(Z([$(`--color-background-primary`),$(`--color-background-secondary`),$(`--color-background-tertiary`),$(`--color-background-inverse`),$(`--color-background-ghost`),$(`--color-background-info`),$(`--color-background-danger`),$(`--color-background-success`),$(`--color-background-warning`),$(`--color-background-disabled`),$(`--color-text-primary`),$(`--color-text-secondary`),$(`--color-text-tertiary`),$(`--color-text-inverse`),$(`--color-text-ghost`),$(`--color-text-info`),$(`--color-text-danger`),$(`--color-text-success`),$(`--color-text-warning`),$(`--color-text-disabled`),$(`--color-border-primary`),$(`--color-border-secondary`),$(`--color-border-tertiary`),$(`--color-border-inverse`),$(`--color-border-ghost`),$(`--color-border-info`),$(`--color-border-danger`),$(`--color-border-success`),$(`--color-border-warning`),$(`--color-border-disabled`),$(`--color-ring-primary`),$(`--color-ring-secondary`),$(`--color-ring-inverse`),$(`--color-ring-info`),$(`--color-ring-danger`),$(`--color-ring-success`),$(`--color-ring-warning`),$(`--font-sans`),$(`--font-mono`),$(`--font-weight-normal`),$(`--font-weight-medium`),$(`--font-weight-semibold`),$(`--font-weight-bold`),$(`--font-text-xs-size`),$(`--font-text-sm-size`),$(`--font-text-md-size`),$(`--font-text-lg-size`),$(`--font-heading-xs-size`),$(`--font-heading-sm-size`),$(`--font-heading-md-size`),$(`--font-heading-lg-size`),$(`--font-heading-xl-size`),$(`--font-heading-2xl-size`),$(`--font-heading-3xl-size`),$(`--font-text-xs-line-height`),$(`--font-text-sm-line-height`),$(`--font-text-md-line-height`),$(`--font-text-lg-line-height`),$(`--font-heading-xs-line-height`),$(`--font-heading-sm-line-height`),$(`--font-heading-md-line-height`),$(`--font-heading-lg-line-height`),$(`--font-heading-xl-line-height`),$(`--font-heading-2xl-line-height`),$(`--font-heading-3xl-line-height`),$(`--border-radius-xs`),$(`--border-radius-sm`),$(`--border-radius-md`),$(`--border-radius-lg`),$(`--border-radius-xl`),$(`--border-radius-full`),$(`--border-width-regular`),$(`--shadow-hairline`),$(`--shadow-sm`),$(`--shadow-md`),$(`--shadow-lg`)]).describe(`CSS variable keys available to MCP apps for theming.`).describe(`Style variables for theming MCP apps.
144
-
145
- Individual style keys are optional - hosts may provide any subset of these values.
146
- Values are strings containing CSS values (colors, sizes, font stacks, etc.).
147
-
148
- Note: This type uses \`Record<K, string | undefined>\` rather than \`Partial<Record<K, string>>\`
149
- for compatibility with Zod schema generation. Both are functionally equivalent for validation.`),Z([q(),Iw()]).describe(`Style variables for theming MCP apps.
150
-
151
- Individual style keys are optional - hosts may provide any subset of these values.
152
- Values are strings containing CSS values (colors, sizes, font stacks, etc.).
153
-
154
- Note: This type uses \`Record<K, string | undefined>\` rather than \`Partial<Record<K, string>>\`
155
- for compatibility with Zod schema generation. Both are functionally equivalent for validation.`)).describe(`Style variables for theming MCP apps.
156
-
157
- Individual style keys are optional - hosts may provide any subset of these values.
158
- Values are strings containing CSS values (colors, sizes, font stacks, etc.).
159
-
160
- Note: This type uses \`Record<K, string | undefined>\` rather than \`Partial<Record<K, string>>\`
161
- for compatibility with Zod schema generation. Both are functionally equivalent for validation.`),lU=X({method:$(`ui/open-link`),params:X({url:q().describe(`URL to open in the host's browser`)})});X({isError:Pw().optional().describe(`True if the host failed to open the URL (e.g., due to security policy).`)}).passthrough(),X({isError:Pw().optional().describe(`True if the download failed (e.g., user cancelled or host denied).`)}).passthrough(),X({isError:Pw().optional().describe(`True if the host rejected or failed to deliver the message.`)}).passthrough();var uU=X({method:$(`ui/notifications/sandbox-proxy-ready`),params:X({})}),dU=X({connectDomains:Y(q()).optional().describe(`Origins for network requests (fetch/XHR/WebSocket).
162
-
163
- - Maps to CSP \`connect-src\` directive
164
- - Empty or omitted → no network connections (secure default)`),resourceDomains:Y(q()).optional().describe("Origins for static resources (images, scripts, stylesheets, fonts, media).\n\n- Maps to CSP `img-src`, `script-src`, `style-src`, `font-src`, `media-src` directives\n- Wildcard subdomains supported: `https://*.example.com`\n- Empty or omitted → no network resources (secure default)"),frameDomains:Y(q()).optional().describe("Origins for nested iframes.\n\n- Maps to CSP `frame-src` directive\n- Empty or omitted → no nested iframes allowed (`frame-src 'none'`)"),baseUriDomains:Y(q()).optional().describe("Allowed base URIs for the document.\n\n- Maps to CSP `base-uri` directive\n- Empty or omitted → only same origin allowed (`base-uri 'self'`)")}),fU=X({camera:X({}).optional().describe(`Request camera access.
165
-
166
- Maps to Permission Policy \`camera\` feature.`),microphone:X({}).optional().describe(`Request microphone access.
167
-
168
- Maps to Permission Policy \`microphone\` feature.`),geolocation:X({}).optional().describe(`Request geolocation access.
169
-
170
- Maps to Permission Policy \`geolocation\` feature.`),clipboardWrite:X({}).optional().describe(`Request clipboard write access.
171
-
172
- Maps to Permission Policy \`clipboard-write\` feature.`)}),pU=X({method:$(`ui/notifications/size-changed`),params:X({width:J().optional().describe(`New width in pixels.`),height:J().optional().describe(`New height in pixels.`)})});X({method:$(`ui/notifications/tool-input`),params:X({arguments:Q(q(),Hw().describe(`Complete tool call arguments as key-value pairs.`)).optional().describe(`Complete tool call arguments as key-value pairs.`)})}),X({method:$(`ui/notifications/tool-input-partial`),params:X({arguments:Q(q(),Hw().describe(`Partial tool call arguments (incomplete, may change).`)).optional().describe(`Partial tool call arguments (incomplete, may change).`)})}),X({method:$(`ui/notifications/tool-cancelled`),params:X({reason:q().optional().describe(`Optional reason for the cancellation (e.g., "user action", "timeout").`)})});var mU=X({fonts:q().optional()}),hU=X({variables:cU.optional().describe(`CSS variables for theming the app.`),css:mU.optional().describe(`CSS blocks that apps can inject.`)});X({method:$(`ui/resource-teardown`),params:X({})});var gU=Q(q(),Hw()),_U=X({text:X({}).optional().describe(`Host supports text content blocks.`),image:X({}).optional().describe(`Host supports image content blocks.`),audio:X({}).optional().describe(`Host supports audio content blocks.`),resource:X({}).optional().describe(`Host supports resource content blocks.`),resourceLink:X({}).optional().describe(`Host supports resource link content blocks.`),structuredContent:X({}).optional().describe(`Host supports structured content.`)}),vU=X({method:$(`ui/notifications/request-teardown`),params:X({}).optional()}),yU=X({experimental:Q(q(),Q(q(),Bw()).describe(`Experimental features keyed by identifier.`)).optional().describe(`Experimental features keyed by identifier.`),openLinks:X({}).optional().describe(`Host supports opening external URLs.`),downloadFile:X({}).optional().describe(`Host supports file downloads via ui/download-file.`),serverTools:X({listChanged:Pw().optional().describe(`Host supports tools/list_changed notifications.`)}).optional().describe(`Host can proxy tool calls to the MCP server.`),serverResources:X({listChanged:Pw().optional().describe(`Host supports resources/list_changed notifications.`)}).optional().describe(`Host can proxy resource reads to the MCP server.`),logging:X({}).optional().describe(`Host accepts log messages.`),sandbox:X({permissions:fU.optional().describe(`Permissions granted by the host (camera, microphone, geolocation).`),csp:dU.optional().describe(`CSP domains approved by the host.`)}).optional().describe(`Sandbox configuration applied by the host.`),updateModelContext:_U.optional().describe(`Host accepts context updates (ui/update-model-context) to be included in the model's context for future turns.`),message:_U.optional().describe(`Host supports receiving content messages (ui/message) from the view.`),sampling:X({tools:X({}).optional().describe("Host supports tool use via `tools` and `toolChoice` parameters.")}).optional().describe("Host supports LLM sampling (sampling/createMessage) from the view.\nMirrors the MCP `ClientCapabilities.sampling` shape so hosts can pass it through.")}),bU=X({experimental:Q(q(),Q(q(),Bw()).describe(`Experimental features keyed by identifier.`)).optional().describe(`Experimental features keyed by identifier.`),tools:X({listChanged:Pw().optional().describe(`App supports tools/list_changed notifications.`)}).optional().describe(`App exposes MCP-style tools that the host can call.`),availableDisplayModes:Y(sU).optional().describe(`Display modes the app supports.`)}),xU=X({method:$(`ui/notifications/initialized`),params:X({}).optional()});X({csp:dU.optional().describe(`Content Security Policy configuration for UI resources.`),permissions:fU.optional().describe(`Sandbox permissions requested by the UI resource.`),domain:q().optional().describe(`Dedicated origin for view sandbox.
173
-
174
- Useful when views need stable, dedicated origins for OAuth callbacks, CORS policies, or API key allowlists.
175
-
176
- **Host-dependent:** The format and validation rules for this field are determined by each host. Servers MUST consult host-specific documentation for the expected domain format. Common patterns include:
177
- - Hash-based subdomains (e.g., \`{hash}.claudemcpcontent.com\`)
178
- - URL-derived subdomains (e.g., \`www-example-com.oaiusercontent.com\`)
179
-
180
- If omitted, host uses default sandbox origin (typically per-conversation).`),prefersBorder:Pw().optional().describe(`Visual boundary preference - true if view prefers a visible border.
181
-
182
- Boolean requesting whether a visible border and background is provided by the host. Specifying an explicit value for this is recommended because hosts' defaults may vary.
183
-
184
- - \`true\`: request visible border + background
185
- - \`false\`: request no visible border + background
186
- - omitted: host decides border`)});var SU=X({method:$(`ui/request-display-mode`),params:X({mode:sU.describe(`The display mode being requested.`)})});X({mode:sU.describe(`The display mode that was actually set. May differ from requested if not supported.`)}).passthrough();var CU=Z([$(`model`),$(`app`)]).describe(`Tool visibility scope - who can access the tool.`);X({resourceUri:q().optional(),visibility:Y(CU).optional().describe(`Who can access this tool. Default: ["model", "app"]
187
- - "model": Tool visible to and callable by the agent
188
- - "app": Tool callable by the app from this server only`),csp:Uw().optional(),permissions:Uw().optional()}),X({mimeTypes:Y(q()).optional().describe('Array of supported MIME types for UI resources.\nMust include `"text/html;profile=mcp-app"` for MCP Apps support.')});var wU=X({method:$(`ui/download-file`),params:X({contents:Y(Z([QV,$V])).describe(`Resource contents to download — embedded (inline data) or linked (host fetches). Uses standard MCP resource types.`)})}),TU=X({method:$(`ui/message`),params:X({role:$(`user`).describe(`Message role, currently only "user" is supported.`),content:Y(eH).describe(`Message content blocks (text, image, etc.).`)})});X({method:$(`ui/notifications/sandbox-resource-ready`),params:X({html:q().describe(`HTML content to load into the inner iframe.`),sandbox:q().optional().describe(`Optional override for the inner iframe's sandbox attribute.`),csp:dU.optional().describe(`CSP configuration from resource metadata.`),permissions:fU.optional().describe(`Sandbox permissions from resource metadata.`)})}),X({method:$(`ui/notifications/tool-result`),params:lH.describe(`Standard MCP tool execution result.`)});var EU=X({toolInfo:X({id:OB.optional().describe(`JSON-RPC id of the tools/call request.`),tool:oH.describe(`Tool definition including name, inputSchema, etc.`)}).optional().describe(`Metadata of the tool call that instantiated this App.`),theme:oU.optional().describe(`Current color theme preference.`),styles:hU.optional().describe(`Style configuration for theming the app.`),displayMode:sU.optional().describe(`How the UI is currently displayed.`),availableDisplayModes:Y(sU).optional().describe(`Display modes the host supports.`),containerDimensions:Z([X({height:J().describe(`Fixed container height in pixels.`)}),X({maxHeight:Z([J(),Iw()]).optional().describe(`Maximum container height in pixels.`)})]).and(Z([X({width:J().describe(`Fixed container width in pixels.`)}),X({maxWidth:Z([J(),Iw()]).optional().describe(`Maximum container width in pixels.`)})])).optional().describe(`Container dimensions. Represents the dimensions of the iframe or other
189
- container holding the app. Specify either width or maxWidth, and either height or maxHeight.`),locale:q().optional().describe(`User's language and region preference in BCP 47 format.`),timeZone:q().optional().describe(`User's timezone in IANA format.`),userAgent:q().optional().describe(`Host application identifier.`),platform:Z([$(`web`),$(`desktop`),$(`mobile`)]).optional().describe(`Platform type for responsive design decisions.`),deviceCapabilities:X({touch:Pw().optional().describe(`Whether the device supports touch input.`),hover:Pw().optional().describe(`Whether the device supports hover interactions.`)}).optional().describe(`Device input capabilities.`),safeAreaInsets:X({top:J().describe(`Top safe area inset in pixels.`),right:J().describe(`Right safe area inset in pixels.`),bottom:J().describe(`Bottom safe area inset in pixels.`),left:J().describe(`Left safe area inset in pixels.`)}).optional().describe(`Mobile safe area boundaries in pixels.`)}).passthrough();X({method:$(`ui/notifications/host-context-changed`),params:EU.describe(`Partial context update containing only changed fields.`)});var DU=X({method:$(`ui/update-model-context`),params:X({content:Y(eH).optional().describe(`Context content blocks (text, image, etc.).`),structuredContent:Q(q(),Hw().describe(`Structured content for machine-readable context data.`)).optional().describe(`Structured content for machine-readable context data.`)})}),OU=X({method:$(`ui/initialize`),params:X({appInfo:WB.describe(`App identification (name and version).`),appCapabilities:bU.describe(`Features and capabilities this app provides.`),protocolVersion:q().describe(`Protocol version this app supports.`)})});X({protocolVersion:q().describe(`Negotiated protocol version string (e.g., "2025-11-21").`),hostInfo:WB.describe(`Host application identification and version.`),hostCapabilities:yU.describe(`Features and capabilities provided by the host.`),hostContext:EU.describe(`Rich context about the host environment.`)}).passthrough();var kU=class{eventTarget;eventSource;messageListener;constructor(e=window.parent,t){this.eventTarget=e,this.eventSource=t,this.messageListener=e=>{if(t&&e.source!==this.eventSource){console.debug(`Ignoring message from unknown source`,e);return}let n=RB.safeParse(e.data);n.success?(console.debug(`Parsed message`,n.data),this.onmessage?.(n.data)):e.data?.jsonrpc===`2.0`?(console.error(`Failed to parse message`,n.error.message,e),this.onerror?.(Error(`Invalid JSON-RPC message received: `+n.error.message))):console.debug(`Ignoring non-JSON-RPC message`,n.error.message,e)}}async start(){window.addEventListener(`message`,this.messageListener)}async send(e,t){e.method!==`ui/notifications/tool-input-partial`&&console.debug(`Sending message`,e),this.eventTarget.postMessage(e,`*`)}async close(){window.removeEventListener(`message`,this.messageListener),this.onclose?.()}onclose;onerror;onmessage;sessionId;setProtocolVersion},AU=`ui/resourceUri`;function jU(e){let t=e._meta?.ui?.resourceUri;if(t===void 0&&(t=e._meta?.[AU]),typeof t==`string`&&t.startsWith(`ui://`))return t;if(t!==void 0)throw Error(`Invalid UI resource URI: ${JSON.stringify(t)}`)}var MU=[aU],NU=class extends iU{_client;_hostInfo;_capabilities;_appCapabilities;_hostContext={};_appInfo;_initializedReceived=!1;_baseReplaceRequestHandler=this.replaceRequestHandler;replaceRequestHandler=(e,t)=>{this._baseReplaceRequestHandler(e,(e,n)=>(this._initializedReceived||console.warn(`[ext-apps] AppBridge received '${e.method}' before ui/notifications/initialized. The View is calling host methods before completing the handshake; it should await app.connect() first.`),t(e,n)))};eventSchemas={sizechange:pU,sandboxready:uU,initialized:xU,requestteardown:vU,loggingmessage:_H};constructor(e,t,n,r){super(r),this._client=e,this._hostInfo=t,this._capabilities=n,this.addEventListener(`initialized`,()=>{this._initializedReceived=!0}),this._hostContext=r?.hostContext||{},this.setRequestHandler(OU,e=>this._oninitialize(e)),this.setRequestHandler(eV,(e,t)=>(this.onping?.(e.params,t),{})),this.replaceRequestHandler(SU,e=>({mode:this._hostContext.displayMode??`inline`}))}getAppCapabilities(){return this._appCapabilities}getAppVersion(){return this._appInfo}onping;get onsizechange(){return this.getEventHandler(`sizechange`)}set onsizechange(e){this.setEventHandler(`sizechange`,e)}get onsandboxready(){return this.getEventHandler(`sandboxready`)}set onsandboxready(e){this.setEventHandler(`sandboxready`,e)}get oninitialized(){return this.getEventHandler(`initialized`)}set oninitialized(e){this.setEventHandler(`initialized`,e)}_onmessage;get onmessage(){return this._onmessage}set onmessage(e){this.warnIfRequestHandlerReplaced(`onmessage`,this._onmessage,e),this._onmessage=e,this.replaceRequestHandler(TU,async(e,t)=>{if(!this._onmessage)throw Error(`No onmessage handler set`);return this._onmessage(e.params,t)})}_onopenlink;get onopenlink(){return this._onopenlink}set onopenlink(e){this.warnIfRequestHandlerReplaced(`onopenlink`,this._onopenlink,e),this._onopenlink=e,this.replaceRequestHandler(lU,async(e,t)=>{if(!this._onopenlink)throw Error(`No onopenlink handler set`);return this._onopenlink(e.params,t)})}_ondownloadfile;get ondownloadfile(){return this._ondownloadfile}set ondownloadfile(e){this.warnIfRequestHandlerReplaced(`ondownloadfile`,this._ondownloadfile,e),this._ondownloadfile=e,this.replaceRequestHandler(wU,async(e,t)=>{if(!this._ondownloadfile)throw Error(`No ondownloadfile handler set`);return this._ondownloadfile(e.params,t)})}get onrequestteardown(){return this.getEventHandler(`requestteardown`)}set onrequestteardown(e){this.setEventHandler(`requestteardown`,e)}_onrequestdisplaymode;get onrequestdisplaymode(){return this._onrequestdisplaymode}set onrequestdisplaymode(e){this.warnIfRequestHandlerReplaced(`onrequestdisplaymode`,this._onrequestdisplaymode,e),this._onrequestdisplaymode=e,this.replaceRequestHandler(SU,async(e,t)=>{if(!this._onrequestdisplaymode)throw Error(`No onrequestdisplaymode handler set`);return this._onrequestdisplaymode(e.params,t)})}get onloggingmessage(){return this.getEventHandler(`loggingmessage`)}set onloggingmessage(e){this.setEventHandler(`loggingmessage`,e)}_onupdatemodelcontext;get onupdatemodelcontext(){return this._onupdatemodelcontext}set onupdatemodelcontext(e){this.warnIfRequestHandlerReplaced(`onupdatemodelcontext`,this._onupdatemodelcontext,e),this._onupdatemodelcontext=e,this.replaceRequestHandler(DU,async(e,t)=>{if(!this._onupdatemodelcontext)throw Error(`No onupdatemodelcontext handler set`);return this._onupdatemodelcontext(e.params,t)})}_oncalltool;get oncalltool(){return this._oncalltool}set oncalltool(e){this.warnIfRequestHandlerReplaced(`oncalltool`,this._oncalltool,e),this._oncalltool=e,this.replaceRequestHandler(dH,async(e,t)=>{if(!this._oncalltool)throw Error(`No oncalltool handler set`);return this._oncalltool(e.params,t)})}set oncreatesamplingmessage(e){this.setRequestHandler(TH,async(t,n)=>e(t.params,n))}sendToolListChanged(e={}){return this.notification({method:`notifications/tools/list_changed`,params:e})}_onlistresources;get onlistresources(){return this._onlistresources}set onlistresources(e){this.warnIfRequestHandlerReplaced(`onlistresources`,this._onlistresources,e),this._onlistresources=e,this.replaceRequestHandler(DV,async(e,t)=>{if(!this._onlistresources)throw Error(`No onlistresources handler set`);return this._onlistresources(e.params,t)})}_onlistresourcetemplates;get onlistresourcetemplates(){return this._onlistresourcetemplates}set onlistresourcetemplates(e){this.warnIfRequestHandlerReplaced(`onlistresourcetemplates`,this._onlistresourcetemplates,e),this._onlistresourcetemplates=e,this.replaceRequestHandler(kV,async(e,t)=>{if(!this._onlistresourcetemplates)throw Error(`No onlistresourcetemplates handler set`);return this._onlistresourcetemplates(e.params,t)})}_onreadresource;get onreadresource(){return this._onreadresource}set onreadresource(e){this.warnIfRequestHandlerReplaced(`onreadresource`,this._onreadresource,e),this._onreadresource=e,this.replaceRequestHandler(NV,async(e,t)=>{if(!this._onreadresource)throw Error(`No onreadresource handler set`);return this._onreadresource(e.params,t)})}sendResourceListChanged(e={}){return this.notification({method:`notifications/resources/list_changed`,params:e})}_onlistprompts;get onlistprompts(){return this._onlistprompts}set onlistprompts(e){this.warnIfRequestHandlerReplaced(`onlistprompts`,this._onlistprompts,e),this._onlistprompts=e,this.replaceRequestHandler(WV,async(e,t)=>{if(!this._onlistprompts)throw Error(`No onlistprompts handler set`);return this._onlistprompts(e.params,t)})}sendPromptListChanged(e={}){return this.notification({method:`notifications/prompts/list_changed`,params:e})}assertCapabilityForMethod(e){}assertRequestHandlerCapability(e){}assertNotificationCapability(e){}assertTaskCapability(e){throw Error(`Tasks are not supported in MCP Apps`)}assertTaskHandlerCapability(e){throw Error(`Task handlers are not supported in MCP Apps`)}getCapabilities(){return this._capabilities}async _oninitialize(e){let t=e.params.protocolVersion;return this._appInfo!==void 0&&console.warn(`[ext-apps] AppBridge received a second ui/initialize. The View may be double-mounting (e.g. React StrictMode in dev) without closing the previous App instance. Responding normally; the latest appInfo/appCapabilities replace the previous values.`),this._appCapabilities=e.params.appCapabilities,this._appInfo=e.params.appInfo,{protocolVersion:MU.includes(t)?t:aU,hostCapabilities:this.getCapabilities(),hostInfo:this._hostInfo,hostContext:this._hostContext}}setHostContext(e){let t={},n=!1;for(let r of Object.keys(e)){let i=this._hostContext[r],a=e[r];PU(i,a)||(t[r]=a,n=!0)}n&&(this._hostContext=e,this.sendHostContextChange(t))}sendHostContextChange(e){return this.notification({method:`ui/notifications/host-context-changed`,params:e})}sendToolInput(e){return this.notification({method:`ui/notifications/tool-input`,params:e})}sendToolInputPartial(e){return this.notification({method:`ui/notifications/tool-input-partial`,params:e})}sendToolResult(e){return this.notification({method:`ui/notifications/tool-result`,params:e})}sendToolCancelled(e){return this.notification({method:`ui/notifications/tool-cancelled`,params:e})}sendSandboxResourceReady(e){return this.notification({method:`ui/notifications/sandbox-resource-ready`,params:e})}teardownResource(e,t){return this.request({method:`ui/resource-teardown`,params:e},gU,t)}sendResourceTeardown=this.teardownResource;callTool(e,t){return this.request({method:`tools/call`,params:e},lH,t)}listTools(e,t){return this.request({method:`tools/list`,params:e},cH,t)}async connect(e){if(this.transport)throw Error(`AppBridge is already connected. Call close() before connecting again.`);if(this._initializedReceived=!1,this._client){let e=this._client.getServerCapabilities();if(!e)throw Error(`Client server capabilities not available`);e.tools&&(this.oncalltool=async(e,t)=>this._client.request({method:`tools/call`,params:e},lH,{signal:t.signal}),e.tools.listChanged&&this._client.setNotificationHandler(fH,e=>this.sendToolListChanged(e.params))),e.resources&&(this.onlistresources=async(e,t)=>this._client.request({method:`resources/list`,params:e},OV,{signal:t.signal}),this.onlistresourcetemplates=async(e,t)=>this._client.request({method:`resources/templates/list`,params:e},AV,{signal:t.signal}),this.onreadresource=async(e,t)=>this._client.request({method:`resources/read`,params:e},PV,{signal:t.signal}),e.resources.listChanged&&this._client.setNotificationHandler(FV,e=>this.sendResourceListChanged(e.params))),e.prompts&&(this.onlistprompts=async(e,t)=>this._client.request({method:`prompts/list`,params:e},GV,{signal:t.signal}),e.prompts.listChanged&&this._client.setNotificationHandler(rH,e=>this.sendPromptListChanged(e.params)))}return super.connect(e)}};function PU(e,t){return JSON.stringify(e)===JSON.stringify(t)}function FU(e){return jU(e)}function IU(e){return FU(e)!==void 0}var LU={color:void 0,size:void 0,className:void 0,style:void 0,attr:void 0},RU=D.createContext&&D.createContext(LU),zU=[`attr`,`size`,`title`];function BU(e,t){if(e==null)return{};var n,r,i=VU(e,t);if(Object.getOwnPropertySymbols){var a=Object.getOwnPropertySymbols(e);for(r=0;r<a.length;r++)n=a[r],t.indexOf(n)===-1&&{}.propertyIsEnumerable.call(e,n)&&(i[n]=e[n])}return i}function VU(e,t){if(e==null)return{};var n={};for(var r in e)if({}.hasOwnProperty.call(e,r)){if(t.indexOf(r)!==-1)continue;n[r]=e[r]}return n}function HU(){return HU=Object.assign?Object.assign.bind():function(e){for(var t=1;t<arguments.length;t++){var n=arguments[t];for(var r in n)({}).hasOwnProperty.call(n,r)&&(e[r]=n[r])}return e},HU.apply(null,arguments)}function UU(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 WU(e){for(var t=1;t<arguments.length;t++){var n=arguments[t]==null?{}:arguments[t];t%2?UU(Object(n),!0).forEach(function(t){GU(e,t,n[t])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):UU(Object(n)).forEach(function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(n,t))})}return e}function GU(e,t,n){return(t=KU(t))in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function KU(e){var t=qU(e,`string`);return typeof t==`symbol`?t:t+``}function qU(e,t){if(typeof e!=`object`||!e)return e;var n=e[Symbol.toPrimitive];if(n!==void 0){var r=n.call(e,t||`default`);if(typeof r!=`object`)return r;throw TypeError(`@@toPrimitive must return a primitive value.`)}return(t===`string`?String:Number)(e)}function JU(e){return e&&e.map((e,t)=>D.createElement(e.tag,WU({key:t},e.attr),JU(e.child)))}function YU(e){return t=>D.createElement(XU,HU({attr:WU({},e.attr)},t),JU(e.child))}function XU(e){var t=t=>{var n=e.attr,r=e.size,i=e.title,a=BU(e,zU),o=r||t.size||`1em`,s;return t.className&&(s=t.className),e.className&&(s=(s?s+` `:``)+e.className),D.createElement(`svg`,HU({stroke:`currentColor`,fill:`currentColor`,strokeWidth:`0`},t.attr,n,a,{className:s,style:WU(WU({color:e.color||t.color},t.style),e.style),height:o,width:o,xmlns:`http://www.w3.org/2000/svg`}),i&&D.createElement(`title`,null,i),e.children)};return RU===void 0?t(LU):D.createElement(RU.Consumer,null,e=>t(e))}function ZU(e){return YU({tag:`svg`,attr:{viewBox:`0 0 24 24`},child:[{tag:`path`,attr:{fill:`none`,d:`M0 0h24v24H0z`},child:[]},{tag:`path`,attr:{d:`M5 16h3v3h2v-5H5zm3-8H5v2h5V5H8zm6 11h2v-3h3v-2h-5zm2-11V5h-2v5h5V8z`},child:[]}]})(e)}function QU(e){return YU({tag:`svg`,attr:{viewBox:`0 0 24 24`},child:[{tag:`path`,attr:{fill:`none`,d:`M0 0h24v24H0z`},child:[]},{tag:`path`,attr:{d:`M7 14H5v5h5v-2H7zm-2-4h2V7h3V5H5zm12 7h-3v2h5v-5h-2zM14 5v2h3v3h2V5z`},child:[]}]})(e)}function $U(e){return YU({tag:`svg`,attr:{viewBox:`0 0 24 24`},child:[{tag:`path`,attr:{fill:`none`,d:`M0 0h24v24H0z`},child:[]},{tag:`path`,attr:{d:`M19 6.41 17.59 5 12 10.59 6.41 5 5 6.41 10.59 12 5 17.59 6.41 19 12 13.41 17.59 19 19 17.59 13.41 12z`},child:[]}]})(e)}function eW(e){return YU({tag:`svg`,attr:{viewBox:`0 0 24 24`},child:[{tag:`path`,attr:{fill:`none`,d:`M0 0h24v24H0z`},child:[]},{tag:`path`,attr:{d:`M10 6 8.59 7.41 13.17 12l-4.58 4.59L10 18l6-6z`},child:[]}]})(e)}function tW(e){return YU({tag:`svg`,attr:{viewBox:`0 0 24 24`},child:[{tag:`path`,attr:{fill:`none`,d:`M0 0h24v24H0z`},child:[]},{tag:`path`,attr:{d:`M20 11H7.83l5.59-5.59L12 4l-8 8 8 8 1.41-1.41L7.83 13H20z`},child:[]}]})(e)}function nW(e){return YU({tag:`svg`,attr:{viewBox:`0 0 24 24`},child:[{tag:`path`,attr:{fill:`none`,d:`M0 0h24v24H0z`},child:[]},{tag:`path`,attr:{d:`M12 7c-2.76 0-5 2.24-5 5s2.24 5 5 5 5-2.24 5-5-2.24-5-5-5M2 13h2c.55 0 1-.45 1-1s-.45-1-1-1H2c-.55 0-1 .45-1 1s.45 1 1 1m18 0h2c.55 0 1-.45 1-1s-.45-1-1-1h-2c-.55 0-1 .45-1 1s.45 1 1 1M11 2v2c0 .55.45 1 1 1s1-.45 1-1V2c0-.55-.45-1-1-1s-1 .45-1 1m0 18v2c0 .55.45 1 1 1s1-.45 1-1v-2c0-.55-.45-1-1-1s-1 .45-1 1M5.99 4.58a.996.996 0 0 0-1.41 0 .996.996 0 0 0 0 1.41l1.06 1.06c.39.39 1.03.39 1.41 0s.39-1.03 0-1.41zm12.37 12.37a.996.996 0 0 0-1.41 0 .996.996 0 0 0 0 1.41l1.06 1.06c.39.39 1.03.39 1.41 0a.996.996 0 0 0 0-1.41zm1.06-10.96a.996.996 0 0 0 0-1.41.996.996 0 0 0-1.41 0l-1.06 1.06c-.39.39-.39 1.03 0 1.41s1.03.39 1.41 0zM7.05 18.36a.996.996 0 0 0 0-1.41.996.996 0 0 0-1.41 0l-1.06 1.06c-.39.39-.39 1.03 0 1.41s1.03.39 1.41 0z`},child:[]}]})(e)}function rW(e){return YU({tag:`svg`,attr:{viewBox:`0 0 24 24`},child:[{tag:`path`,attr:{fill:`none`,d:`M0 0h24v24H0z`},child:[]},{tag:`path`,attr:{d:`M12 3a9 9 0 1 0 9 9c0-.46-.04-.92-.1-1.36a5.39 5.39 0 0 1-4.4 2.26 5.403 5.403 0 0 1-3.14-9.8c-.44-.06-.9-.1-1.36-.1`},child:[]}]})(e)}function iW(e){return YU({tag:`svg`,attr:{viewBox:`0 0 24 24`},child:[{tag:`path`,attr:{fill:`none`,d:`M0 0h24v24H0z`},child:[]},{tag:`path`,attr:{d:`M12 5V1L7 6l5 5V7c3.31 0 6 2.69 6 6s-2.69 6-6 6-6-2.69-6-6H4c0 4.42 3.58 8 8 8s8-3.58 8-8-3.58-8-8-8`},child:[]}]})(e)}function aW(e){return YU({tag:`svg`,attr:{viewBox:`0 0 24 24`},child:[{tag:`path`,attr:{fill:`none`,d:`M0 0h24v24H0z`},child:[]},{tag:`path`,attr:{d:`M8 5v14l11-7z`},child:[]}]})(e)}function oW(e){return YU({tag:`svg`,attr:{viewBox:`0 0 24 24`},child:[{tag:`path`,attr:{fill:`none`,d:`M0 0h24v24H0z`},child:[]},{tag:`path`,attr:{d:`M19.14 12.94c.04-.3.06-.61.06-.94 0-.32-.02-.64-.07-.94l2.03-1.58a.49.49 0 0 0 .12-.61l-1.92-3.32a.49.49 0 0 0-.59-.22l-2.39.96c-.5-.38-1.03-.7-1.62-.94l-.36-2.54a.484.484 0 0 0-.48-.41h-3.84c-.24 0-.43.17-.47.41l-.36 2.54c-.59.24-1.13.57-1.62.94l-2.39-.96c-.22-.08-.47 0-.59.22L2.74 8.87c-.12.21-.08.47.12.61l2.03 1.58c-.05.3-.09.63-.09.94s.02.64.07.94l-2.03 1.58a.49.49 0 0 0-.12.61l1.92 3.32c.12.22.37.29.59.22l2.39-.96c.5.38 1.03.7 1.62.94l.36 2.54c.05.24.24.41.48.41h3.84c.24 0 .44-.17.47-.41l.36-2.54c.59-.24 1.13-.56 1.62-.94l2.39.96c.22.08.47 0 .59-.22l1.92-3.32c.12-.22.07-.47-.12-.61zM12 15.6c-1.98 0-3.6-1.62-3.6-3.6s1.62-3.6 3.6-3.6 3.6 1.62 3.6 3.6-1.62 3.6-3.6 3.6`},child:[]}]})(e)}function sW(e){return YU({tag:`svg`,attr:{viewBox:`0 0 16 16`,fill:`currentColor`},child:[{tag:`path`,attr:{d:`M15.3542 0.646006C15.1592 0.451006 14.8422 0.451006 14.6472 0.646006L12.5772 2.71601C11.2072 1.71701 9.20723 1.87301 7.93723 3.14401L7.80623 3.27501C7.31923 3.76201 7.31923 4.55501 7.80623 5.04301L10.9882 8.22501C11.2312 8.46901 11.5512 8.59101 11.8722 8.59101C12.1932 8.59101 12.5132 8.46901 12.7562 8.22501L12.9762 8.00501C13.6522 7.33001 14.0162 6.43101 14.0012 5.47601C13.9892 4.72001 13.7412 4.00601 13.2912 3.41701L15.3542 1.35401C15.5492 1.15901 15.5492 0.841006 15.3542 0.646006ZM12.2682 7.29701L12.0482 7.51701C11.9502 7.61501 11.7922 7.61501 11.6942 7.51701L8.51223 4.33501C8.41423 4.23701 8.41423 4.07901 8.51223 3.98101L8.64323 3.85001C9.16723 3.32601 9.86023 3.06001 10.5402 3.06001C11.1502 3.06001 11.7512 3.27401 12.2112 3.70801C12.7092 4.17601 12.9882 4.80901 12.9992 5.49101C13.0092 6.17301 12.7502 6.81501 12.2682 7.29701ZM8.14623 9.14601L7.26623 10.026L5.97323 8.73301L6.85323 7.85301C7.04823 7.65801 7.04823 7.34101 6.85323 7.14601C6.65823 6.95101 6.34123 6.95101 6.14623 7.14601L5.26623 8.02601L5.01323 7.77301C4.52723 7.28701 3.73223 7.28701 3.24523 7.77401L3.02523 7.99401C2.34923 8.66901 1.98523 9.56801 2.00023 10.523C2.01223 11.279 2.26023 11.993 2.71023 12.582L0.647227 14.645C0.452227 14.84 0.452227 15.157 0.647227 15.352C0.745227 15.45 0.873227 15.498 1.00123 15.498C1.12923 15.498 1.25723 15.449 1.35523 15.352L3.42523 13.282C4.02223 13.717 4.73723 13.934 5.46123 13.934C6.39923 13.934 7.34923 13.571 8.06523 12.854L8.19623 12.723C8.68323 12.236 8.68323 11.443 8.19623 10.955L7.97423 10.733L8.85423 9.85301C9.04923 9.65801 9.04923 9.34101 8.85423 9.14601C8.65923 8.95101 8.34223 8.95101 8.14723 9.14601H8.14623ZM7.48923 12.018L7.35723 12.149C6.36323 13.144 4.76123 13.208 3.78923 12.291C3.29123 11.823 3.01223 11.19 3.00123 10.508C2.99123 9.82601 3.25123 9.18401 3.73323 8.70201L3.95323 8.48201C4.00223 8.43301 4.06523 8.40901 4.13023 8.40901C4.19523 8.40901 4.25823 8.43301 4.30723 8.48201C5.37118 9.54596 6.42725 10.602 7.48723 11.662C7.58523 11.76 7.58523 11.918 7.48723 12.016L7.48923 12.018Z`},child:[]}]})(e)}var cW={connected:`var(--inspector-status-connected)`,connecting:`var(--inspector-status-connecting)`,disconnected:`var(--inspector-status-disconnected)`,error:`var(--inspector-status-error)`};function lW(e,t,n){switch(e){case`connected`:return t==null?`Connected`:`Connected (${t}ms)`;case`connecting`:return`Connecting...`;case`disconnected`:return`Disconnected`;case`error`:return n==null?`Error`:`Error (${n})`}}var uW=El.withProps({w:10,h:10,radius:`xl`});function dW({status:e,latencyMs:t,retryCount:n,failed:r=!1,showLabel:i}){let a=Rt(`(min-width: 1500px)`),o=i??a,s=r?`Failed`:lW(e,t,n),c=r?`var(--inspector-status-error)`:cW[e];return(0,R.jsxs)(H,{gap:`xs`,children:[(0,R.jsx)(uW,{bg:c,className:!r&&e===`connecting`?`inspector-pulse`:void 0,title:o?void 0:s}),o&&(0,R.jsx)(U,{size:`sm`,children:s})]})}function fW(e){return YU({tag:`svg`,attr:{viewBox:`0 0 24 24`,fill:`none`,stroke:`currentColor`,strokeWidth:`2`,strokeLinecap:`round`,strokeLinejoin:`round`},child:[{tag:`path`,attr:{d:`M5 5.5a.5 .5 0 0 1 .5 -.5h4a.5 .5 0 0 1 .5 .5v4a.5 .5 0 0 1 -.5 .5h-4a.5 .5 0 0 1 -.5 -.5l0 -4`},child:[]},{tag:`path`,attr:{d:`M5 14.5a.5 .5 0 0 1 .5 -.5h4a.5 .5 0 0 1 .5 .5v4a.5 .5 0 0 1 -.5 .5h-4a.5 .5 0 0 1 -.5 -.5l0 -4`},child:[]},{tag:`path`,attr:{d:`M14 15l3 3l3 -3`},child:[]},{tag:`path`,attr:{d:`M17 18v-12`},child:[]}]})(e)}function pW(e){return YU({tag:`svg`,attr:{viewBox:`0 0 24 24`,fill:`none`,stroke:`currentColor`,strokeWidth:`2`,strokeLinecap:`round`,strokeLinejoin:`round`},child:[{tag:`path`,attr:{d:`M14 9l3 -3l3 3`},child:[]},{tag:`path`,attr:{d:`M5 5.5a.5 .5 0 0 1 .5 -.5h4a.5 .5 0 0 1 .5 .5v4a.5 .5 0 0 1 -.5 .5h-4a.5 .5 0 0 1 -.5 -.5l0 -4`},child:[]},{tag:`path`,attr:{d:`M5 14.5a.5 .5 0 0 1 .5 -.5h4a.5 .5 0 0 1 .5 .5v4a.5 .5 0 0 1 -.5 .5h-4a.5 .5 0 0 1 -.5 -.5l0 -4`},child:[]},{tag:`path`,attr:{d:`M17 6v12`},child:[]}]})(e)}function mW(e){return YU({tag:`svg`,attr:{viewBox:`0 0 24 24`,fill:`none`,stroke:`currentColor`,strokeWidth:`2`,strokeLinecap:`round`,strokeLinejoin:`round`},child:[{tag:`path`,attr:{d:`M4 6a2 2 0 0 1 2 -2h12a2 2 0 0 1 2 2v12a2 2 0 0 1 -2 2h-12a2 2 0 0 1 -2 -2l0 -12`},child:[]},{tag:`path`,attr:{d:`M15 4v16`},child:[]},{tag:`path`,attr:{d:`M10 10l-2 2l2 2`},child:[]}]})(e)}function hW(e){return YU({tag:`svg`,attr:{viewBox:`0 0 24 24`,fill:`none`,stroke:`currentColor`,strokeWidth:`2`,strokeLinecap:`round`,strokeLinejoin:`round`},child:[{tag:`path`,attr:{d:`M4 6a2 2 0 0 1 2 -2h12a2 2 0 0 1 2 2v12a2 2 0 0 1 -2 2h-12a2 2 0 0 1 -2 -2l0 -12`},child:[]},{tag:`path`,attr:{d:`M15 4v16`},child:[]},{tag:`path`,attr:{d:`M9 10l2 2l-2 2`},child:[]}]})(e)}var gW=Cu.withProps({variant:`subtle`,size:36});function _W({open:e,onToggle:t}){let n=e?hW:mW,r=e?`Close monitoring sidebar`:`Open monitoring sidebar`;return(0,R.jsx)(k_,{label:r,children:(0,R.jsx)(gW,{"aria-label":r,onClick:t,children:(0,R.jsx)(n,{size:20})})})}var vW=`/assets/MCP-CWGQJYyH.svg`,yW=`data:image/svg+xml,%3csvg%20width='180'%20height='180'%20viewBox='0%200%20180%20180'%20fill='none'%20xmlns='http://www.w3.org/2000/svg'%3e%3cg%20clip-path='url(%23clip0_19_13)'%3e%3cpath%20d='M18%2084.8528L85.8822%2016.9706C95.2548%207.59798%20110.451%207.59798%20119.823%2016.9706V16.9706C129.196%2026.3431%20129.196%2041.5391%20119.823%2050.9117L68.5581%20102.177'%20stroke='white'%20stroke-width='12'%20stroke-linecap='round'/%3e%3cpath%20d='M69.2652%20101.47L119.823%2050.9117C129.196%2041.5391%20144.392%2041.5391%20153.765%2050.9117L154.118%2051.2652C163.491%2060.6378%20163.491%2075.8338%20154.118%2085.2063L92.7248%20146.6C89.6006%20149.724%2089.6006%20154.789%2092.7248%20157.913L105.331%20170.52'%20stroke='white'%20stroke-width='12'%20stroke-linecap='round'/%3e%3cpath%20d='M102.853%2033.9411L52.6482%2084.1457C43.2756%2093.5183%2043.2756%20108.714%2052.6482%20118.087V118.087C62.0208%20127.459%2077.2167%20127.459%2086.5893%20118.087L136.794%2067.8822'%20stroke='white'%20stroke-width='12'%20stroke-linecap='round'/%3e%3c/g%3e%3cdefs%3e%3cclipPath%20id='clip0_19_13'%3e%3crect%20width='180'%20height='180'%20fill='white'/%3e%3c/clipPath%3e%3c/defs%3e%3c/svg%3e`,bW=1e3,xW=`
190
- `;function SW(e){return e.join(xW)}function CW(e){return[e.serverName,e.status,e.latencyMs??``,e.activeTab,SW(e.availableTabs)].join(xW)}var wW=U.withProps({span:!0,variant:`tabGlow`});function TW(e,t){return e.map(e=>({value:e,label:(0,R.jsx)(wW,{"data-glow":t.includes(e)?`on`:void 0,children:e})}))}var EW=H.withProps({h:`100%`,px:`md`,wrap:`nowrap`,gap:`md`}),DW=H.withProps({gap:`md`,wrap:`nowrap`,flex:1,miw:0}),OW=Qd.withProps({href:`https://modelcontextprotocol.io`,target:`_blank`,rel:`nofollow noopener noreferrer`}),kW=dm.withProps({alt:`MCP`,w:28,h:28,fit:`contain`}),AW=U.withProps({className:`header-anim`,fw:600,size:`lg`,truncate:`end`,miw:0,flex:1}),jW=H.withProps({gap:`sm`,wrap:`nowrap`,flex:1,miw:0,justify:`flex-end`}),MW=H.withProps({className:`header-anim`,gap:`sm`,wrap:`nowrap`}),NW=H.withProps({className:`header-anim`,styles:{root:{gridArea:`1 / 1`,placeSelf:`center`}}}),PW=Cu.withProps({variant:`subtle`,size:36,"aria-label":`Disconnect from server`}),FW=Cu.withProps({variant:`subtle`,size:36,"aria-label":`Client settings`}),IW=Cu.withProps({variant:`subtle`,size:36,"aria-label":`Toggle color scheme`}),LW=200,RW={in:{opacity:1,width:36,marginLeft:0,transform:`translateX(0)`},out:{opacity:0,width:0,marginLeft:`calc(var(--mantine-spacing-sm) * -1)`,transform:`translateX(-8px)`},common:{overflow:`hidden`,flexShrink:0},transitionProperty:`opacity, width, margin-left, transform`};function zW(e){let t=ui(),[n,r]=(0,D.useState)(e.monitorToggle);e.monitorToggle&&e.monitorToggle.open!==n?.open&&r(e.monitorToggle);let i=e.monitorToggle??n,a=t===`dark`?nW:rW,o=e.connected?{serverName:e.serverInfo.name,status:e.status,latencyMs:e.latencyMs,activeTab:e.activeTab,availableTabs:e.availableTabs}:null,[s,c]=(0,D.useState)(o);o&&CW(o)!==(s?CW(s):``)&&c(o);let l=e.connected?o:s,u=e.connected?e.onTabChange:void 0,d=e.connected?e.onDisconnect:void 0,[f,p]=(0,D.useState)(!1);!e.connected&&f&&p(!1),(0,D.useEffect)(()=>{if(!e.connected)return;let t=setTimeout(()=>p(!0),bW);return()=>clearTimeout(t)},[e.connected]);let m=e.connected?e.availableTabs:[],h=SW(m),[g,_]=(0,D.useState)(h),[v,y]=(0,D.useState)([]);if(h!==g){let e=g?g.split(xW):[];_(h),y(f&&e.length?m.filter(t=>!e.includes(t)):[])}let b=e.connected?`in`:`out`;return(0,R.jsxs)(EW,{children:[(0,R.jsxs)(DW,{children:[(0,R.jsx)(k_,{label:`MCP Documentation`,children:(0,R.jsx)(OW,{children:(0,R.jsx)(kW,{src:t===`dark`?yW:vW})})}),(0,R.jsx)(ql,{mounted:e.connected,transition:`fade`,duration:300,exitDuration:300,children:()=>l?(0,R.jsx)(AW,{"data-anim":b,children:l.serverName}):(0,R.jsx)(R.Fragment,{})})]}),(0,R.jsxs)(B,{display:`grid`,flex:`0 0 auto`,children:[(0,R.jsx)(ql,{mounted:e.connected,transition:`fade`,duration:300,exitDuration:300,children:()=>l?(0,R.jsx)(NW,{"data-anim":b,children:(0,R.jsx)(N_,{value:l.activeTab,onChange:u,data:TW(l.availableTabs,v),size:`sm`})}):(0,R.jsx)(R.Fragment,{})}),(0,R.jsx)(ql,{mounted:!e.connected,transition:`fade`,duration:300,exitDuration:300,children:()=>(0,R.jsx)(NW,{"data-anim":e.connected?`out`:`in`,children:(0,R.jsx)(Sv,{order:2,children:`MCP Inspector`})})})]}),(0,R.jsxs)(jW,{children:[(0,R.jsx)(ql,{mounted:e.connected,transition:`fade`,duration:300,exitDuration:300,children:()=>l?(0,R.jsxs)(MW,{"data-anim":b,children:[(0,R.jsx)(dW,{status:l.status,latencyMs:l.latencyMs}),(0,R.jsx)(k_,{label:`Disconnect from server`,children:(0,R.jsx)(PW,{onClick:d,children:(0,R.jsx)(sW,{size:20})})})]}):(0,R.jsx)(R.Fragment,{})}),(0,R.jsx)(k_,{label:`Client settings`,children:(0,R.jsx)(FW,{onClick:e.onOpenClientSettings,children:(0,R.jsx)(oW,{size:20})})}),(0,R.jsx)(k_,{label:t===`dark`?`Switch to light theme`:`Switch to dark theme`,children:(0,R.jsx)(IW,{onClick:e.onToggleTheme,children:(0,R.jsx)(a,{size:20})})}),(0,R.jsx)(ql,{mounted:!!e.monitorToggle,transition:RW,duration:LW,exitDuration:LW,timingFunction:`ease`,children:e=>i?(0,R.jsx)(B,{style:e,children:(0,R.jsx)(_W,{open:i.open,onToggle:i.onToggle})}):(0,R.jsx)(R.Fragment,{})})]})]})}var BW=U.withProps({variant:`versionBadge`});function VW({version:e}){return e?(0,R.jsxs)(BW,{"aria-label":`Inspector version ${e}`,children:[`v`,e]}):null}var HW=`Copyright © Model Context Protocol a Series of LF Projects, LLC.`,UW=U.withProps({variant:`copyrightBadge`});function WW(){return(0,R.jsx)(UW,{children:HW})}function GW(){var e=[...arguments];return(0,D.useMemo)(()=>t=>{e.forEach(e=>e(t))},e)}var KW=typeof window<`u`&&window.document!==void 0&&window.document.createElement!==void 0;function qW(e){let t=Object.prototype.toString.call(e);return t===`[object Window]`||t===`[object global]`}function JW(e){return`nodeType`in e}function YW(e){return e?qW(e)?e:JW(e)?e.ownerDocument?.defaultView??window:window:window}function XW(e){let{Document:t}=YW(e);return e instanceof t}function ZW(e){return!qW(e)&&e instanceof YW(e).HTMLElement}function QW(e){return e instanceof YW(e).SVGElement}function $W(e){return e?qW(e)?e.document:JW(e)?XW(e)?e:ZW(e)||QW(e)?e.ownerDocument:document:document:document}var eG=KW?D.useLayoutEffect:D.useEffect;function tG(e){let t=(0,D.useRef)(e);return eG(()=>{t.current=e}),(0,D.useCallback)(function(){var e=[...arguments];return t.current==null?void 0:t.current(...e)},[])}function nG(){let e=(0,D.useRef)(null);return[(0,D.useCallback)((t,n)=>{e.current=setInterval(t,n)},[]),(0,D.useCallback)(()=>{e.current!==null&&(clearInterval(e.current),e.current=null)},[])]}function rG(e,t){t===void 0&&(t=[e]);let n=(0,D.useRef)(e);return eG(()=>{n.current!==e&&(n.current=e)},t),n}function iG(e,t){let n=(0,D.useRef)();return(0,D.useMemo)(()=>{let t=e(n.current);return n.current=t,t},[...t])}function aG(e){let t=tG(e),n=(0,D.useRef)(null);return[n,(0,D.useCallback)(e=>{e!==n.current&&t?.(e,n.current),n.current=e},[])]}function oG(e){let t=(0,D.useRef)();return(0,D.useEffect)(()=>{t.current=e},[e]),t.current}var sG={};function cG(e,t){return(0,D.useMemo)(()=>{if(t)return t;let n=sG[e]==null?0:sG[e]+1;return sG[e]=n,e+`-`+n},[e,t])}function lG(e){return function(t){return[...arguments].slice(1).reduce((t,n)=>{let r=Object.entries(n);for(let[n,i]of r){let r=t[n];r!=null&&(t[n]=r+e*i)}return t},{...t})}}var uG=lG(1),dG=lG(-1);function fG(e){return`clientX`in e&&`clientY`in e}function pG(e){if(!e)return!1;let{KeyboardEvent:t}=YW(e.target);return t&&e instanceof t}function mG(e){if(!e)return!1;let{TouchEvent:t}=YW(e.target);return t&&e instanceof t}function hG(e){if(mG(e)){if(e.touches&&e.touches.length){let{clientX:t,clientY:n}=e.touches[0];return{x:t,y:n}}if(e.changedTouches&&e.changedTouches.length){let{clientX:t,clientY:n}=e.changedTouches[0];return{x:t,y:n}}}return fG(e)?{x:e.clientX,y:e.clientY}:null}var gG=Object.freeze({Translate:{toString(e){if(!e)return;let{x:t,y:n}=e;return`translate3d(`+(t?Math.round(t):0)+`px, `+(n?Math.round(n):0)+`px, 0)`}},Scale:{toString(e){if(!e)return;let{scaleX:t,scaleY:n}=e;return`scaleX(`+t+`) scaleY(`+n+`)`}},Transform:{toString(e){if(e)return[gG.Translate.toString(e),gG.Scale.toString(e)].join(` `)}},Transition:{toString(e){let{property:t,duration:n,easing:r}=e;return t+` `+n+`ms `+r}}}),_G=`a,frame,iframe,input:not([type=hidden]):not(:disabled),select:not(:disabled),textarea:not(:disabled),button:not(:disabled),*[tabindex]`;function vG(e){return e.matches(_G)?e:e.querySelector(_G)}var yG={display:`none`};function bG(e){let{id:t,value:n}=e;return D.createElement(`div`,{id:t,style:yG},n)}function xG(e){let{id:t,announcement:n,ariaLiveType:r=`assertive`}=e;return D.createElement(`div`,{id:t,style:{position:`fixed`,top:0,left:0,width:1,height:1,margin:-1,border:0,padding:0,overflow:`hidden`,clip:`rect(0 0 0 0)`,clipPath:`inset(100%)`,whiteSpace:`nowrap`},role:`status`,"aria-live":r,"aria-atomic":!0},n)}function SG(){let[e,t]=(0,D.useState)(``);return{announce:(0,D.useCallback)(e=>{e!=null&&t(e)},[]),announcement:e}}var CG=(0,D.createContext)(null);function wG(e){let t=(0,D.useContext)(CG);(0,D.useEffect)(()=>{if(!t)throw Error(`useDndMonitor must be used within a children of <DndContext>`);return t(e)},[e,t])}function TG(){let[e]=(0,D.useState)(()=>new Set),t=(0,D.useCallback)(t=>(e.add(t),()=>e.delete(t)),[e]);return[(0,D.useCallback)(t=>{let{type:n,event:r}=t;e.forEach(e=>e[n]?.call(e,r))},[e]),t]}var EG={draggable:`
191
- To pick up a draggable item, press the space bar.
192
- While dragging, use the arrow keys to move the item.
193
- Press space again to drop the item in its new position, or press escape to cancel.
194
- `},DG={onDragStart(e){let{active:t}=e;return`Picked up draggable item `+t.id+`.`},onDragOver(e){let{active:t,over:n}=e;return n?`Draggable item `+t.id+` was moved over droppable area `+n.id+`.`:`Draggable item `+t.id+` is no longer over a droppable area.`},onDragEnd(e){let{active:t,over:n}=e;return n?`Draggable item `+t.id+` was dropped over droppable area `+n.id:`Draggable item `+t.id+` was dropped.`},onDragCancel(e){let{active:t}=e;return`Dragging was cancelled. Draggable item `+t.id+` was dropped.`}};function OG(e){let{announcements:t=DG,container:n,hiddenTextDescribedById:r,screenReaderInstructions:i=EG}=e,{announce:a,announcement:o}=SG(),s=cG(`DndLiveRegion`),[c,l]=(0,D.useState)(!1);if((0,D.useEffect)(()=>{l(!0)},[]),wG((0,D.useMemo)(()=>({onDragStart(e){let{active:n}=e;a(t.onDragStart({active:n}))},onDragMove(e){let{active:n,over:r}=e;t.onDragMove&&a(t.onDragMove({active:n,over:r}))},onDragOver(e){let{active:n,over:r}=e;a(t.onDragOver({active:n,over:r}))},onDragEnd(e){let{active:n,over:r}=e;a(t.onDragEnd({active:n,over:r}))},onDragCancel(e){let{active:n,over:r}=e;a(t.onDragCancel({active:n,over:r}))}}),[a,t])),!c)return null;let u=D.createElement(D.Fragment,null,D.createElement(bG,{id:r,value:i.draggable}),D.createElement(xG,{id:s,announcement:o}));return n?(0,Qi.createPortal)(u,n):u}var kG;(function(e){e.DragStart=`dragStart`,e.DragMove=`dragMove`,e.DragEnd=`dragEnd`,e.DragCancel=`dragCancel`,e.DragOver=`dragOver`,e.RegisterDroppable=`registerDroppable`,e.SetDroppableDisabled=`setDroppableDisabled`,e.UnregisterDroppable=`unregisterDroppable`})(kG||={});function AG(){}function jG(e,t){return(0,D.useMemo)(()=>({sensor:e,options:t??{}}),[e,t])}function MG(){var e=[...arguments];return(0,D.useMemo)(()=>[...e].filter(e=>e!=null),[...e])}var NG=Object.freeze({x:0,y:0});function PG(e,t){return Math.sqrt((e.x-t.x)**2+(e.y-t.y)**2)}function FG(e,t){let{data:{value:n}}=e,{data:{value:r}}=t;return n-r}function IG(e,t){let{data:{value:n}}=e,{data:{value:r}}=t;return r-n}function LG(e){let{left:t,top:n,height:r,width:i}=e;return[{x:t,y:n},{x:t+i,y:n},{x:t,y:n+r},{x:t+i,y:n+r}]}function RG(e,t){if(!e||e.length===0)return null;let[n]=e;return t?n[t]:n}function zG(e,t,n){return t===void 0&&(t=e.left),n===void 0&&(n=e.top),{x:t+e.width*.5,y:n+e.height*.5}}var BG=e=>{let{collisionRect:t,droppableRects:n,droppableContainers:r}=e,i=zG(t,t.left,t.top),a=[];for(let e of r){let{id:t}=e,r=n.get(t);if(r){let n=PG(zG(r),i);a.push({id:t,data:{droppableContainer:e,value:n}})}}return a.sort(FG)},VG=e=>{let{collisionRect:t,droppableRects:n,droppableContainers:r}=e,i=LG(t),a=[];for(let e of r){let{id:t}=e,r=n.get(t);if(r){let n=LG(r),o=i.reduce((e,t,r)=>e+PG(n[r],t),0),s=Number((o/4).toFixed(4));a.push({id:t,data:{droppableContainer:e,value:s}})}}return a.sort(FG)};function HG(e,t){let n=Math.max(t.top,e.top),r=Math.max(t.left,e.left),i=Math.min(t.left+t.width,e.left+e.width),a=Math.min(t.top+t.height,e.top+e.height),o=i-r,s=a-n;if(r<i&&n<a){let n=t.width*t.height,r=e.width*e.height,i=o*s,a=i/(n+r-i);return Number(a.toFixed(4))}return 0}var UG=e=>{let{collisionRect:t,droppableRects:n,droppableContainers:r}=e,i=[];for(let e of r){let{id:r}=e,a=n.get(r);if(a){let n=HG(a,t);n>0&&i.push({id:r,data:{droppableContainer:e,value:n}})}}return i.sort(IG)};function WG(e,t,n){return{...e,scaleX:t&&n?t.width/n.width:1,scaleY:t&&n?t.height/n.height:1}}function GG(e,t){return e&&t?{x:e.left-t.left,y:e.top-t.top}:NG}function KG(e){return function(t){return[...arguments].slice(1).reduce((t,n)=>({...t,top:t.top+e*n.y,bottom:t.bottom+e*n.y,left:t.left+e*n.x,right:t.right+e*n.x}),{...t})}}var qG=KG(1);function JG(e){if(e.startsWith(`matrix3d(`)){let t=e.slice(9,-1).split(/, /);return{x:+t[12],y:+t[13],scaleX:+t[0],scaleY:+t[5]}}if(e.startsWith(`matrix(`)){let t=e.slice(7,-1).split(/, /);return{x:+t[4],y:+t[5],scaleX:+t[0],scaleY:+t[3]}}return null}function YG(e,t,n){let r=JG(t);if(!r)return e;let{scaleX:i,scaleY:a,x:o,y:s}=r,c=e.left-o-(1-i)*parseFloat(n),l=e.top-s-(1-a)*parseFloat(n.slice(n.indexOf(` `)+1)),u=i?e.width/i:e.width,d=a?e.height/a:e.height;return{width:u,height:d,top:l,right:c+u,bottom:l+d,left:c}}var XG={ignoreTransform:!1};function ZG(e,t){t===void 0&&(t=XG);let n=e.getBoundingClientRect();if(t.ignoreTransform){let{transform:t,transformOrigin:r}=YW(e).getComputedStyle(e);t&&(n=YG(n,t,r))}let{top:r,left:i,width:a,height:o,bottom:s,right:c}=n;return{top:r,left:i,width:a,height:o,bottom:s,right:c}}function QG(e){return ZG(e,{ignoreTransform:!0})}function $G(e){let t=e.innerWidth,n=e.innerHeight;return{top:0,left:0,right:t,bottom:n,width:t,height:n}}function eK(e,t){return t===void 0&&(t=YW(e).getComputedStyle(e)),t.position===`fixed`}function tK(e,t){t===void 0&&(t=YW(e).getComputedStyle(e));let n=/(auto|scroll|overlay)/;return[`overflow`,`overflowX`,`overflowY`].some(e=>{let r=t[e];return typeof r==`string`&&n.test(r)})}function nK(e,t){let n=[];function r(i){if(t!=null&&n.length>=t||!i)return n;if(XW(i)&&i.scrollingElement!=null&&!n.includes(i.scrollingElement))return n.push(i.scrollingElement),n;if(!ZW(i)||QW(i)||n.includes(i))return n;let a=YW(e).getComputedStyle(i);return i!==e&&tK(i,a)&&n.push(i),eK(i,a)?n:r(i.parentNode)}return e?r(e):n}function rK(e){let[t]=nK(e,1);return t??null}function iK(e){return!KW||!e?null:qW(e)?e:JW(e)?XW(e)||e===$W(e).scrollingElement?window:ZW(e)?e:null:null}function aK(e){return qW(e)?e.scrollX:e.scrollLeft}function oK(e){return qW(e)?e.scrollY:e.scrollTop}function sK(e){return{x:aK(e),y:oK(e)}}var cK;(function(e){e[e.Forward=1]=`Forward`,e[e.Backward=-1]=`Backward`})(cK||={});function lK(e){return!KW||!e?!1:e===document.scrollingElement}function uK(e){let t={x:0,y:0},n=lK(e)?{height:window.innerHeight,width:window.innerWidth}:{height:e.clientHeight,width:e.clientWidth},r={x:e.scrollWidth-n.width,y:e.scrollHeight-n.height};return{isTop:e.scrollTop<=t.y,isLeft:e.scrollLeft<=t.x,isBottom:e.scrollTop>=r.y,isRight:e.scrollLeft>=r.x,maxScroll:r,minScroll:t}}var dK={x:.2,y:.2};function fK(e,t,n,r,i){let{top:a,left:o,right:s,bottom:c}=n;r===void 0&&(r=10),i===void 0&&(i=dK);let{isTop:l,isBottom:u,isLeft:d,isRight:f}=uK(e),p={x:0,y:0},m={x:0,y:0},h={height:t.height*i.y,width:t.width*i.x};return!l&&a<=t.top+h.height?(p.y=cK.Backward,m.y=r*Math.abs((t.top+h.height-a)/h.height)):!u&&c>=t.bottom-h.height&&(p.y=cK.Forward,m.y=r*Math.abs((t.bottom-h.height-c)/h.height)),!f&&s>=t.right-h.width?(p.x=cK.Forward,m.x=r*Math.abs((t.right-h.width-s)/h.width)):!d&&o<=t.left+h.width&&(p.x=cK.Backward,m.x=r*Math.abs((t.left+h.width-o)/h.width)),{direction:p,speed:m}}function pK(e){if(e===document.scrollingElement){let{innerWidth:e,innerHeight:t}=window;return{top:0,left:0,right:e,bottom:t,width:e,height:t}}let{top:t,left:n,right:r,bottom:i}=e.getBoundingClientRect();return{top:t,left:n,right:r,bottom:i,width:e.clientWidth,height:e.clientHeight}}function mK(e){return e.reduce((e,t)=>uG(e,sK(t)),NG)}function hK(e){return e.reduce((e,t)=>e+aK(t),0)}function gK(e){return e.reduce((e,t)=>e+oK(t),0)}function _K(e,t){if(t===void 0&&(t=ZG),!e)return;let{top:n,left:r,bottom:i,right:a}=t(e);rK(e)&&(i<=0||a<=0||n>=window.innerHeight||r>=window.innerWidth)&&e.scrollIntoView({block:`center`,inline:`center`})}var vK=[[`x`,[`left`,`right`],hK],[`y`,[`top`,`bottom`],gK]],yK=class{constructor(e,t){this.rect=void 0,this.width=void 0,this.height=void 0,this.top=void 0,this.bottom=void 0,this.right=void 0,this.left=void 0;let n=nK(t),r=mK(n);this.rect={...e},this.width=e.width,this.height=e.height;for(let[e,t,i]of vK)for(let a of t)Object.defineProperty(this,a,{get:()=>{let t=i(n),o=r[e]-t;return this.rect[a]+o},enumerable:!0});Object.defineProperty(this,"rect",{enumerable:!1})}},bK=class{constructor(e){this.target=void 0,this.listeners=[],this.removeAll=()=>{this.listeners.forEach(e=>this.target?.removeEventListener(...e))},this.target=e}add(e,t,n){var r;(r=this.target)==null||r.addEventListener(e,t,n),this.listeners.push([e,t,n])}};function xK(e){let{EventTarget:t}=YW(e);return e instanceof t?e:$W(e)}function SK(e,t){let n=Math.abs(e.x),r=Math.abs(e.y);return typeof t==`number`?Math.sqrt(n**2+r**2)>t:`x`in t&&`y`in t?n>t.x&&r>t.y:`x`in t?n>t.x:`y`in t&&r>t.y}var CK;(function(e){e.Click=`click`,e.DragStart=`dragstart`,e.Keydown=`keydown`,e.ContextMenu=`contextmenu`,e.Resize=`resize`,e.SelectionChange=`selectionchange`,e.VisibilityChange=`visibilitychange`})(CK||={});function wK(e){e.preventDefault()}function TK(e){e.stopPropagation()}var EK;(function(e){e.Space=`Space`,e.Down=`ArrowDown`,e.Right=`ArrowRight`,e.Left=`ArrowLeft`,e.Up=`ArrowUp`,e.Esc=`Escape`,e.Enter=`Enter`,e.Tab=`Tab`})(EK||={});var DK={start:[EK.Space,EK.Enter],cancel:[EK.Esc],end:[EK.Space,EK.Enter,EK.Tab]},OK=(e,t)=>{let{currentCoordinates:n}=t;switch(e.code){case EK.Right:return{...n,x:n.x+25};case EK.Left:return{...n,x:n.x-25};case EK.Down:return{...n,y:n.y+25};case EK.Up:return{...n,y:n.y-25}}},kK=class{constructor(e){this.props=void 0,this.autoScrollEnabled=!1,this.referenceCoordinates=void 0,this.listeners=void 0,this.windowListeners=void 0,this.props=e;let{event:{target:t}}=e;this.props=e,this.listeners=new bK($W(t)),this.windowListeners=new bK(YW(t)),this.handleKeyDown=this.handleKeyDown.bind(this),this.handleCancel=this.handleCancel.bind(this),this.attach()}attach(){this.handleStart(),this.windowListeners.add(CK.Resize,this.handleCancel),this.windowListeners.add(CK.VisibilityChange,this.handleCancel),setTimeout(()=>this.listeners.add(CK.Keydown,this.handleKeyDown))}handleStart(){let{activeNode:e,onStart:t}=this.props,n=e.node.current;n&&_K(n),t(NG)}handleKeyDown(e){if(pG(e)){let{active:t,context:n,options:r}=this.props,{keyboardCodes:i=DK,coordinateGetter:a=OK,scrollBehavior:o=`smooth`}=r,{code:s}=e;if(i.end.includes(s)){this.handleEnd(e);return}if(i.cancel.includes(s)){this.handleCancel(e);return}let{collisionRect:c}=n.current,l=c?{x:c.left,y:c.top}:NG;this.referenceCoordinates||=l;let u=a(e,{active:t,context:n.current,currentCoordinates:l});if(u){let t=dG(u,l),r={x:0,y:0},{scrollableAncestors:i}=n.current;for(let n of i){let i=e.code,{isTop:a,isRight:s,isLeft:c,isBottom:l,maxScroll:d,minScroll:f}=uK(n),p=pK(n),m={x:Math.min(i===EK.Right?p.right-p.width/2:p.right,Math.max(i===EK.Right?p.left:p.left+p.width/2,u.x)),y:Math.min(i===EK.Down?p.bottom-p.height/2:p.bottom,Math.max(i===EK.Down?p.top:p.top+p.height/2,u.y))},h=i===EK.Right&&!s||i===EK.Left&&!c,g=i===EK.Down&&!l||i===EK.Up&&!a;if(h&&m.x!==u.x){let e=n.scrollLeft+t.x,a=i===EK.Right&&e<=d.x||i===EK.Left&&e>=f.x;if(a&&!t.y){n.scrollTo({left:e,behavior:o});return}r.x=a?n.scrollLeft-e:i===EK.Right?n.scrollLeft-d.x:n.scrollLeft-f.x,r.x&&n.scrollBy({left:-r.x,behavior:o});break}if(g&&m.y!==u.y){let e=n.scrollTop+t.y,a=i===EK.Down&&e<=d.y||i===EK.Up&&e>=f.y;if(a&&!t.x){n.scrollTo({top:e,behavior:o});return}r.y=a?n.scrollTop-e:i===EK.Down?n.scrollTop-d.y:n.scrollTop-f.y,r.y&&n.scrollBy({top:-r.y,behavior:o});break}}this.handleMove(e,uG(dG(u,this.referenceCoordinates),r))}}}handleMove(e,t){let{onMove:n}=this.props;e.preventDefault(),n(t)}handleEnd(e){let{onEnd:t}=this.props;e.preventDefault(),this.detach(),t()}handleCancel(e){let{onCancel:t}=this.props;e.preventDefault(),this.detach(),t()}detach(){this.listeners.removeAll(),this.windowListeners.removeAll()}};kK.activators=[{eventName:`onKeyDown`,handler:(e,t,n)=>{let{keyboardCodes:r=DK,onActivation:i}=t,{active:a}=n,{code:o}=e.nativeEvent;if(r.start.includes(o)){let t=a.activatorNode.current;return t&&e.target!==t?!1:(e.preventDefault(),i?.({event:e.nativeEvent}),!0)}return!1}}];function AK(e){return!!(e&&`distance`in e)}function jK(e){return!!(e&&`delay`in e)}var MK=class{constructor(e,t,n){n===void 0&&(n=xK(e.event.target)),this.props=void 0,this.events=void 0,this.autoScrollEnabled=!0,this.document=void 0,this.activated=!1,this.initialCoordinates=void 0,this.timeoutId=null,this.listeners=void 0,this.documentListeners=void 0,this.windowListeners=void 0,this.props=e,this.events=t;let{event:r}=e,{target:i}=r;this.props=e,this.events=t,this.document=$W(i),this.documentListeners=new bK(this.document),this.listeners=new bK(n),this.windowListeners=new bK(YW(i)),this.initialCoordinates=hG(r)??NG,this.handleStart=this.handleStart.bind(this),this.handleMove=this.handleMove.bind(this),this.handleEnd=this.handleEnd.bind(this),this.handleCancel=this.handleCancel.bind(this),this.handleKeydown=this.handleKeydown.bind(this),this.removeTextSelection=this.removeTextSelection.bind(this),this.attach()}attach(){let{events:e,props:{options:{activationConstraint:t,bypassActivationConstraint:n}}}=this;if(this.listeners.add(e.move.name,this.handleMove,{passive:!1}),this.listeners.add(e.end.name,this.handleEnd),e.cancel&&this.listeners.add(e.cancel.name,this.handleCancel),this.windowListeners.add(CK.Resize,this.handleCancel),this.windowListeners.add(CK.DragStart,wK),this.windowListeners.add(CK.VisibilityChange,this.handleCancel),this.windowListeners.add(CK.ContextMenu,wK),this.documentListeners.add(CK.Keydown,this.handleKeydown),t){if(n!=null&&n({event:this.props.event,activeNode:this.props.activeNode,options:this.props.options}))return this.handleStart();if(jK(t)){this.timeoutId=setTimeout(this.handleStart,t.delay),this.handlePending(t);return}if(AK(t)){this.handlePending(t);return}}this.handleStart()}detach(){this.listeners.removeAll(),this.windowListeners.removeAll(),setTimeout(this.documentListeners.removeAll,50),this.timeoutId!==null&&(clearTimeout(this.timeoutId),this.timeoutId=null)}handlePending(e,t){let{active:n,onPending:r}=this.props;r(n,e,this.initialCoordinates,t)}handleStart(){let{initialCoordinates:e}=this,{onStart:t}=this.props;e&&(this.activated=!0,this.documentListeners.add(CK.Click,TK,{capture:!0}),this.removeTextSelection(),this.documentListeners.add(CK.SelectionChange,this.removeTextSelection),t(e))}handleMove(e){let{activated:t,initialCoordinates:n,props:r}=this,{onMove:i,options:{activationConstraint:a}}=r;if(!n)return;let o=hG(e)??NG,s=dG(n,o);if(!t&&a){if(AK(a)){if(a.tolerance!=null&&SK(s,a.tolerance))return this.handleCancel();if(SK(s,a.distance))return this.handleStart()}if(jK(a)&&SK(s,a.tolerance))return this.handleCancel();this.handlePending(a,s);return}e.cancelable&&e.preventDefault(),i(o)}handleEnd(){let{onAbort:e,onEnd:t}=this.props;this.detach(),this.activated||e(this.props.active),t()}handleCancel(){let{onAbort:e,onCancel:t}=this.props;this.detach(),this.activated||e(this.props.active),t()}handleKeydown(e){e.code===EK.Esc&&this.handleCancel()}removeTextSelection(){var e;(e=this.document.getSelection())==null||e.removeAllRanges()}},NK={cancel:{name:`pointercancel`},move:{name:`pointermove`},end:{name:`pointerup`}},PK=class extends MK{constructor(e){let{event:t}=e,n=$W(t.target);super(e,NK,n)}};PK.activators=[{eventName:`onPointerDown`,handler:(e,t)=>{let{nativeEvent:n}=e,{onActivation:r}=t;return!n.isPrimary||n.button!==0?!1:(r?.({event:n}),!0)}}];var FK={move:{name:`mousemove`},end:{name:`mouseup`}},IK;(function(e){e[e.RightClick=2]=`RightClick`})(IK||={});var LK=class extends MK{constructor(e){super(e,FK,$W(e.event.target))}};LK.activators=[{eventName:`onMouseDown`,handler:(e,t)=>{let{nativeEvent:n}=e,{onActivation:r}=t;return n.button!==IK.RightClick&&(r?.({event:n}),!0)}}];var RK={cancel:{name:`touchcancel`},move:{name:`touchmove`},end:{name:`touchend`}},zK=class extends MK{constructor(e){super(e,RK)}static setup(){return window.addEventListener(RK.move.name,e,{capture:!1,passive:!1}),function(){window.removeEventListener(RK.move.name,e)};function e(){}}};zK.activators=[{eventName:`onTouchStart`,handler:(e,t)=>{let{nativeEvent:n}=e,{onActivation:r}=t,{touches:i}=n;return i.length>1?!1:(r?.({event:n}),!0)}}];var BK;(function(e){e[e.Pointer=0]=`Pointer`,e[e.DraggableRect=1]=`DraggableRect`})(BK||={});var VK;(function(e){e[e.TreeOrder=0]=`TreeOrder`,e[e.ReversedTreeOrder=1]=`ReversedTreeOrder`})(VK||={});function HK(e){let{acceleration:t,activator:n=BK.Pointer,canScroll:r,draggingRect:i,enabled:a,interval:o=5,order:s=VK.TreeOrder,pointerCoordinates:c,scrollableAncestors:l,scrollableAncestorRects:u,delta:d,threshold:f}=e,p=WK({delta:d,disabled:!a}),[m,h]=nG(),g=(0,D.useRef)({x:0,y:0}),_=(0,D.useRef)({x:0,y:0}),v=(0,D.useMemo)(()=>{switch(n){case BK.Pointer:return c?{top:c.y,bottom:c.y,left:c.x,right:c.x}:null;case BK.DraggableRect:return i}},[n,i,c]),y=(0,D.useRef)(null),b=(0,D.useCallback)(()=>{let e=y.current;if(!e)return;let t=g.current.x*_.current.x,n=g.current.y*_.current.y;e.scrollBy(t,n)},[]),x=(0,D.useMemo)(()=>s===VK.TreeOrder?[...l].reverse():l,[s,l]);(0,D.useEffect)(()=>{if(!a||!l.length||!v){h();return}for(let e of x){if(r?.(e)===!1)continue;let n=l.indexOf(e),i=u[n];if(!i)continue;let{direction:a,speed:s}=fK(e,i,v,t,f);for(let e of[`x`,`y`])p[e][a[e]]||(s[e]=0,a[e]=0);if(s.x>0||s.y>0){h(),y.current=e,m(b,o),g.current=s,_.current=a;return}}g.current={x:0,y:0},_.current={x:0,y:0},h()},[t,b,r,h,a,o,JSON.stringify(v),JSON.stringify(p),m,l,x,u,JSON.stringify(f)])}var UK={x:{[cK.Backward]:!1,[cK.Forward]:!1},y:{[cK.Backward]:!1,[cK.Forward]:!1}};function WK(e){let{delta:t,disabled:n}=e,r=oG(t);return iG(e=>{if(n||!r||!e)return UK;let i={x:Math.sign(t.x-r.x),y:Math.sign(t.y-r.y)};return{x:{[cK.Backward]:e.x[cK.Backward]||i.x===-1,[cK.Forward]:e.x[cK.Forward]||i.x===1},y:{[cK.Backward]:e.y[cK.Backward]||i.y===-1,[cK.Forward]:e.y[cK.Forward]||i.y===1}}},[n,t,r])}function GK(e,t){let n=t==null?void 0:e.get(t),r=n?n.node.current:null;return iG(e=>t==null?null:r??e??null,[r,t])}function KK(e,t){return(0,D.useMemo)(()=>e.reduce((e,n)=>{let{sensor:r}=n,i=r.activators.map(e=>({eventName:e.eventName,handler:t(e.handler,n)}));return[...e,...i]},[]),[e,t])}var qK;(function(e){e[e.Always=0]=`Always`,e[e.BeforeDragging=1]=`BeforeDragging`,e[e.WhileDragging=2]=`WhileDragging`})(qK||={});var JK;(function(e){e.Optimized=`optimized`})(JK||={});var YK=new Map;function XK(e,t){let{dragging:n,dependencies:r,config:i}=t,[a,o]=(0,D.useState)(null),{frequency:s,measure:c,strategy:l}=i,u=(0,D.useRef)(e),d=g(),f=rG(d),p=(0,D.useCallback)(function(e){e===void 0&&(e=[]),!f.current&&o(t=>t===null?e:t.concat(e.filter(e=>!t.includes(e))))},[f]),m=(0,D.useRef)(null),h=iG(t=>{if(d&&!n)return YK;if(!t||t===YK||u.current!==e||a!=null){let t=new Map;for(let n of e){if(!n)continue;if(a&&a.length>0&&!a.includes(n.id)&&n.rect.current){t.set(n.id,n.rect.current);continue}let e=n.node.current,r=e?new yK(c(e),e):null;n.rect.current=r,r&&t.set(n.id,r)}return t}return t},[e,a,n,d,c]);return(0,D.useEffect)(()=>{u.current=e},[e]),(0,D.useEffect)(()=>{d||p()},[n,d]),(0,D.useEffect)(()=>{a&&a.length>0&&o(null)},[JSON.stringify(a)]),(0,D.useEffect)(()=>{d||typeof s!=`number`||m.current!==null||(m.current=setTimeout(()=>{p(),m.current=null},s))},[s,d,p,...r]),{droppableRects:h,measureDroppableContainers:p,measuringScheduled:a!=null};function g(){switch(l){case qK.Always:return!1;case qK.BeforeDragging:return n;default:return!n}}}function ZK(e,t){return iG(n=>e?n||(typeof t==`function`?t(e):e):null,[t,e])}function QK(e,t){return ZK(e,t)}function $K(e){let{callback:t,disabled:n}=e,r=tG(t),i=(0,D.useMemo)(()=>{if(n||typeof window>`u`||window.MutationObserver===void 0)return;let{MutationObserver:e}=window;return new e(r)},[r,n]);return(0,D.useEffect)(()=>()=>i?.disconnect(),[i]),i}function eq(e){let{callback:t,disabled:n}=e,r=tG(t),i=(0,D.useMemo)(()=>{if(n||typeof window>`u`||window.ResizeObserver===void 0)return;let{ResizeObserver:e}=window;return new e(r)},[n]);return(0,D.useEffect)(()=>()=>i?.disconnect(),[i]),i}function tq(e){return new yK(ZG(e),e)}function nq(e,t,n){t===void 0&&(t=tq);let[r,i]=(0,D.useState)(null);function a(){i(r=>{if(!e)return null;if(e.isConnected===!1)return r??n??null;let i=t(e);return JSON.stringify(r)===JSON.stringify(i)?r:i})}let o=$K({callback(t){if(e)for(let n of t){let{type:t,target:r}=n;if(t===`childList`&&r instanceof HTMLElement&&r.contains(e)){a();break}}}}),s=eq({callback:a});return eG(()=>{a(),e?(s?.observe(e),o?.observe(document.body,{childList:!0,subtree:!0})):(s?.disconnect(),o?.disconnect())},[e]),r}function rq(e){return GG(e,ZK(e))}var iq=[];function aq(e){let t=(0,D.useRef)(e),n=iG(n=>e?n&&n!==iq&&e&&t.current&&e.parentNode===t.current.parentNode?n:nK(e):iq,[e]);return(0,D.useEffect)(()=>{t.current=e},[e]),n}function oq(e){let[t,n]=(0,D.useState)(null),r=(0,D.useRef)(e),i=(0,D.useCallback)(e=>{let t=iK(e.target);t&&n(e=>e?(e.set(t,sK(t)),new Map(e)):null)},[]);return(0,D.useEffect)(()=>{let t=r.current;if(e!==t){a(t);let o=e.map(e=>{let t=iK(e);return t?(t.addEventListener(`scroll`,i,{passive:!0}),[t,sK(t)]):null}).filter(e=>e!=null);n(o.length?new Map(o):null),r.current=e}return()=>{a(e),a(t)};function a(e){e.forEach(e=>{iK(e)?.removeEventListener(`scroll`,i)})}},[i,e]),(0,D.useMemo)(()=>e.length?t?Array.from(t.values()).reduce((e,t)=>uG(e,t),NG):mK(e):NG,[e,t])}function sq(e,t){t===void 0&&(t=[]);let n=(0,D.useRef)(null);return(0,D.useEffect)(()=>{n.current=null},t),(0,D.useEffect)(()=>{let t=e!==NG;t&&!n.current&&(n.current=e),!t&&n.current&&(n.current=null)},[e]),n.current?dG(e,n.current):NG}function cq(e){(0,D.useEffect)(()=>{if(!KW)return;let t=e.map(e=>{let{sensor:t}=e;return t.setup==null?void 0:t.setup()});return()=>{for(let e of t)e?.()}},e.map(e=>{let{sensor:t}=e;return t}))}function lq(e,t){return(0,D.useMemo)(()=>e.reduce((e,n)=>{let{eventName:r,handler:i}=n;return e[r]=e=>{i(e,t)},e},{}),[e,t])}function uq(e){return(0,D.useMemo)(()=>e?$G(e):null,[e])}var dq=[];function fq(e,t){t===void 0&&(t=ZG);let[n]=e,r=uq(n?YW(n):null),[i,a]=(0,D.useState)(dq);function o(){a(()=>e.length?e.map(e=>lK(e)?r:new yK(t(e),e)):dq)}let s=eq({callback:o});return eG(()=>{s?.disconnect(),o(),e.forEach(e=>s?.observe(e))},[e]),i}function pq(e){if(!e)return null;if(e.children.length>1)return e;let t=e.children[0];return ZW(t)?t:e}function mq(e){let{measure:t}=e,[n,r]=(0,D.useState)(null),i=eq({callback:(0,D.useCallback)(e=>{for(let{target:n}of e)if(ZW(n)){r(e=>{let r=t(n);return e?{...e,width:r.width,height:r.height}:r});break}},[t])}),[a,o]=aG((0,D.useCallback)(e=>{let n=pq(e);i?.disconnect(),n&&i?.observe(n),r(n?t(n):null)},[t,i]));return(0,D.useMemo)(()=>({nodeRef:a,rect:n,setRef:o}),[n,a,o])}var hq=[{sensor:PK,options:{}},{sensor:kK,options:{}}],gq={current:{}},_q={draggable:{measure:QG},droppable:{measure:QG,strategy:qK.WhileDragging,frequency:JK.Optimized},dragOverlay:{measure:ZG}},vq=class extends Map{get(e){return e==null?void 0:super.get(e)??void 0}toArray(){return Array.from(this.values())}getEnabled(){return this.toArray().filter(e=>{let{disabled:t}=e;return!t})}getNodeFor(e){return this.get(e)?.node.current??void 0}},yq={activatorEvent:null,active:null,activeNode:null,activeNodeRect:null,collisions:null,containerNodeRect:null,draggableNodes:new Map,droppableRects:new Map,droppableContainers:new vq,over:null,dragOverlay:{nodeRef:{current:null},rect:null,setRef:AG},scrollableAncestors:[],scrollableAncestorRects:[],measuringConfiguration:_q,measureDroppableContainers:AG,windowRect:null,measuringScheduled:!1},bq={activatorEvent:null,activators:[],active:null,activeNodeRect:null,ariaDescribedById:{draggable:``},dispatch:AG,draggableNodes:new Map,over:null,measureDroppableContainers:AG},xq=(0,D.createContext)(bq),Sq=(0,D.createContext)(yq);function Cq(){return{draggable:{active:null,initialCoordinates:{x:0,y:0},nodes:new Map,translate:{x:0,y:0}},droppable:{containers:new vq}}}function wq(e,t){switch(t.type){case kG.DragStart:return{...e,draggable:{...e.draggable,initialCoordinates:t.initialCoordinates,active:t.active}};case kG.DragMove:return e.draggable.active==null?e:{...e,draggable:{...e.draggable,translate:{x:t.coordinates.x-e.draggable.initialCoordinates.x,y:t.coordinates.y-e.draggable.initialCoordinates.y}}};case kG.DragEnd:case kG.DragCancel:return{...e,draggable:{...e.draggable,active:null,initialCoordinates:{x:0,y:0},translate:{x:0,y:0}}};case kG.RegisterDroppable:{let{element:n}=t,{id:r}=n,i=new vq(e.droppable.containers);return i.set(r,n),{...e,droppable:{...e.droppable,containers:i}}}case kG.SetDroppableDisabled:{let{id:n,key:r,disabled:i}=t,a=e.droppable.containers.get(n);if(!a||r!==a.key)return e;let o=new vq(e.droppable.containers);return o.set(n,{...a,disabled:i}),{...e,droppable:{...e.droppable,containers:o}}}case kG.UnregisterDroppable:{let{id:n,key:r}=t,i=e.droppable.containers.get(n);if(!i||r!==i.key)return e;let a=new vq(e.droppable.containers);return a.delete(n),{...e,droppable:{...e.droppable,containers:a}}}default:return e}}function Tq(e){let{disabled:t}=e,{active:n,activatorEvent:r,draggableNodes:i}=(0,D.useContext)(xq),a=oG(r),o=oG(n?.id);return(0,D.useEffect)(()=>{if(!t&&!r&&a&&o!=null){if(!pG(a)||document.activeElement===a.target)return;let e=i.get(o);if(!e)return;let{activatorNode:t,node:n}=e;if(!t.current&&!n.current)return;requestAnimationFrame(()=>{for(let e of[t.current,n.current]){if(!e)continue;let t=vG(e);if(t){t.focus();break}}})}},[r,t,i,o,a]),null}function Eq(e,t){let{transform:n,...r}=t;return e!=null&&e.length?e.reduce((e,t)=>t({transform:e,...r}),n):n}function Dq(e){return(0,D.useMemo)(()=>({draggable:{..._q.draggable,...e?.draggable},droppable:{..._q.droppable,...e?.droppable},dragOverlay:{..._q.dragOverlay,...e?.dragOverlay}}),[e?.draggable,e?.droppable,e?.dragOverlay])}function Oq(e){let{activeNode:t,measure:n,initialRect:r,config:i=!0}=e,a=(0,D.useRef)(!1),{x:o,y:s}=typeof i==`boolean`?{x:i,y:i}:i;eG(()=>{if(!o&&!s||!t){a.current=!1;return}if(a.current||!r)return;let e=t?.node.current;if(!e||e.isConnected===!1)return;let i=GG(n(e),r);if(o||(i.x=0),s||(i.y=0),a.current=!0,Math.abs(i.x)>0||Math.abs(i.y)>0){let t=rK(e);t&&t.scrollBy({top:i.y,left:i.x})}},[t,o,s,r,n])}var kq=(0,D.createContext)({...NG,scaleX:1,scaleY:1}),Aq;(function(e){e[e.Uninitialized=0]=`Uninitialized`,e[e.Initializing=1]=`Initializing`,e[e.Initialized=2]=`Initialized`})(Aq||={});var jq=(0,D.memo)(function(e){let{id:t,accessibility:n,autoScroll:r=!0,children:i,sensors:a=hq,collisionDetection:o=UG,measuring:s,modifiers:c,...l}=e,[u,d]=(0,D.useReducer)(wq,void 0,Cq),[f,p]=TG(),[m,h]=(0,D.useState)(Aq.Uninitialized),g=m===Aq.Initialized,{draggable:{active:_,nodes:v,translate:y},droppable:{containers:b}}=u,x=_==null?null:v.get(_),S=(0,D.useRef)({initial:null,translated:null}),C=(0,D.useMemo)(()=>_==null?null:{id:_,data:x?.data??gq,rect:S},[_,x]),w=(0,D.useRef)(null),[T,E]=(0,D.useState)(null),[O,k]=(0,D.useState)(null),A=rG(l,Object.values(l)),j=cG(`DndDescribedBy`,t),M=(0,D.useMemo)(()=>b.getEnabled(),[b]),N=Dq(s),{droppableRects:ee,measureDroppableContainers:te,measuringScheduled:P}=XK(M,{dragging:g,dependencies:[y.x,y.y],config:N.droppable}),F=GK(v,_),I=(0,D.useMemo)(()=>O?hG(O):null,[O]),ne=Ne(),re=QK(F,N.draggable.measure);Oq({activeNode:_==null?null:v.get(_),config:ne.layoutShiftCompensation,initialRect:re,measure:N.draggable.measure});let ie=nq(F,N.draggable.measure,re),ae=nq(F?F.parentElement:null),oe=(0,D.useRef)({activatorEvent:null,active:null,activeNode:F,collisionRect:null,collisions:null,droppableRects:ee,draggableNodes:v,draggingNode:null,draggingNodeRect:null,droppableContainers:b,over:null,scrollableAncestors:[],scrollAdjustedTranslate:null}),se=b.getNodeFor(oe.current.over?.id),ce=mq({measure:N.dragOverlay.measure}),le=ce.nodeRef.current??F,ue=g?ce.rect??ie:null,de=!!(ce.nodeRef.current&&ce.rect),fe=rq(de?null:ie),pe=uq(le?YW(le):null),me=aq(g?se??F:null),he=fq(me),ge=Eq(c,{transform:{x:y.x-fe.x,y:y.y-fe.y,scaleX:1,scaleY:1},activatorEvent:O,active:C,activeNodeRect:ie,containerNodeRect:ae,draggingNodeRect:ue,over:oe.current.over,overlayNodeRect:ce.rect,scrollableAncestors:me,scrollableAncestorRects:he,windowRect:pe}),_e=I?uG(I,y):null,ve=oq(me),ye=sq(ve),be=sq(ve,[ie]),xe=uG(ge,ye),Se=ue?qG(ue,ge):null,Ce=C&&Se?o({active:C,collisionRect:Se,droppableRects:ee,droppableContainers:M,pointerCoordinates:_e}):null,we=RG(Ce,`id`),[Te,Ee]=(0,D.useState)(null),De=WG(de?ge:uG(ge,be),Te?.rect??null,ie),Oe=(0,D.useRef)(null),ke=(0,D.useCallback)((e,t)=>{let{sensor:n,options:r}=t;if(w.current==null)return;let i=v.get(w.current);if(!i)return;let a=e.nativeEvent,o=new n({active:w.current,activeNode:i,event:a,options:r,context:oe,onAbort(e){if(!v.get(e))return;let{onDragAbort:t}=A.current,n={id:e};t?.(n),f({type:`onDragAbort`,event:n})},onPending(e,t,n,r){if(!v.get(e))return;let{onDragPending:i}=A.current,a={id:e,constraint:t,initialCoordinates:n,offset:r};i?.(a),f({type:`onDragPending`,event:a})},onStart(e){let t=w.current;if(t==null)return;let n=v.get(t);if(!n)return;let{onDragStart:r}=A.current,i={activatorEvent:a,active:{id:t,data:n.data,rect:S}};(0,Qi.unstable_batchedUpdates)(()=>{r?.(i),h(Aq.Initializing),d({type:kG.DragStart,initialCoordinates:e,active:t}),f({type:`onDragStart`,event:i}),E(Oe.current),k(a)})},onMove(e){d({type:kG.DragMove,coordinates:e})},onEnd:s(kG.DragEnd),onCancel:s(kG.DragCancel)});Oe.current=o;function s(e){return async function(){let{active:t,collisions:n,over:r,scrollAdjustedTranslate:i}=oe.current,o=null;if(t&&i){let{cancelDrop:s}=A.current;o={activatorEvent:a,active:t,collisions:n,delta:i,over:r},e===kG.DragEnd&&typeof s==`function`&&await Promise.resolve(s(o))&&(e=kG.DragCancel)}w.current=null,(0,Qi.unstable_batchedUpdates)(()=>{d({type:e}),h(Aq.Uninitialized),Ee(null),E(null),k(null),Oe.current=null;let t=e===kG.DragEnd?`onDragEnd`:`onDragCancel`;if(o){let e=A.current[t];e?.(o),f({type:t,event:o})}})}}},[v]),Ae=KK(a,(0,D.useCallback)((e,t)=>(n,r)=>{let i=n.nativeEvent,a=v.get(r);if(w.current!==null||!a||i.dndKit||i.defaultPrevented)return;let o={active:a};e(n,t.options,o)===!0&&(i.dndKit={capturedBy:t.sensor},w.current=r,ke(n,t))},[v,ke]));cq(a),eG(()=>{ie&&m===Aq.Initializing&&h(Aq.Initialized)},[ie,m]),(0,D.useEffect)(()=>{let{onDragMove:e}=A.current,{active:t,activatorEvent:n,collisions:r,over:i}=oe.current;if(!t||!n)return;let a={active:t,activatorEvent:n,collisions:r,delta:{x:xe.x,y:xe.y},over:i};(0,Qi.unstable_batchedUpdates)(()=>{e?.(a),f({type:`onDragMove`,event:a})})},[xe.x,xe.y]),(0,D.useEffect)(()=>{let{active:e,activatorEvent:t,collisions:n,droppableContainers:r,scrollAdjustedTranslate:i}=oe.current;if(!e||w.current==null||!t||!i)return;let{onDragOver:a}=A.current,o=r.get(we),s=o&&o.rect.current?{id:o.id,rect:o.rect.current,data:o.data,disabled:o.disabled}:null,c={active:e,activatorEvent:t,collisions:n,delta:{x:i.x,y:i.y},over:s};(0,Qi.unstable_batchedUpdates)(()=>{Ee(s),a?.(c),f({type:`onDragOver`,event:c})})},[we]),eG(()=>{oe.current={activatorEvent:O,active:C,activeNode:F,collisionRect:Se,collisions:Ce,droppableRects:ee,draggableNodes:v,draggingNode:le,draggingNodeRect:ue,droppableContainers:b,over:Te,scrollableAncestors:me,scrollAdjustedTranslate:xe},S.current={initial:ue,translated:Se}},[C,F,Ce,Se,v,le,ue,ee,b,Te,me,xe]),HK({...ne,delta:y,draggingRect:Se,pointerCoordinates:_e,scrollableAncestors:me,scrollableAncestorRects:he});let je=(0,D.useMemo)(()=>({active:C,activeNode:F,activeNodeRect:ie,activatorEvent:O,collisions:Ce,containerNodeRect:ae,dragOverlay:ce,draggableNodes:v,droppableContainers:b,droppableRects:ee,over:Te,measureDroppableContainers:te,scrollableAncestors:me,scrollableAncestorRects:he,measuringConfiguration:N,measuringScheduled:P,windowRect:pe}),[C,F,ie,O,Ce,ae,ce,v,b,ee,Te,te,me,he,N,P,pe]),Me=(0,D.useMemo)(()=>({activatorEvent:O,activators:Ae,active:C,activeNodeRect:ie,ariaDescribedById:{draggable:j},dispatch:d,draggableNodes:v,over:Te,measureDroppableContainers:te}),[O,Ae,C,ie,d,j,v,Te,te]);return D.createElement(CG.Provider,{value:p},D.createElement(xq.Provider,{value:Me},D.createElement(Sq.Provider,{value:je},D.createElement(kq.Provider,{value:De},i)),D.createElement(Tq,{disabled:n?.restoreFocus===!1})),D.createElement(OG,{...n,hiddenTextDescribedById:j}));function Ne(){let e=T?.autoScrollEnabled===!1,t=typeof r==`object`?r.enabled===!1:r===!1,n=g&&!e&&!t;return typeof r==`object`?{...r,enabled:n}:{enabled:n}}}),Mq=(0,D.createContext)(null),Nq=`button`,Pq=`Draggable`;function Fq(e){let{id:t,data:n,disabled:r=!1,attributes:i}=e,a=cG(Pq),{activators:o,activatorEvent:s,active:c,activeNodeRect:l,ariaDescribedById:u,draggableNodes:d,over:f}=(0,D.useContext)(xq),{role:p=Nq,roleDescription:m=`draggable`,tabIndex:h=0}=i??{},g=c?.id===t,_=(0,D.useContext)(g?kq:Mq),[v,y]=aG(),[b,x]=aG(),S=lq(o,t),C=rG(n);return eG(()=>(d.set(t,{id:t,key:a,node:v,activatorNode:b,data:C}),()=>{let e=d.get(t);e&&e.key===a&&d.delete(t)}),[d,t]),{active:c,activatorEvent:s,activeNodeRect:l,attributes:(0,D.useMemo)(()=>({role:p,tabIndex:h,"aria-disabled":r,"aria-pressed":g&&p===Nq?!0:void 0,"aria-roledescription":m,"aria-describedby":u.draggable}),[r,p,h,g,m,u.draggable]),isDragging:g,listeners:r?void 0:S,node:v,over:f,setNodeRef:y,setActivatorNodeRef:x,transform:_}}function Iq(){return(0,D.useContext)(Sq)}var Lq=`Droppable`,Rq={timeout:25};function zq(e){let{data:t,disabled:n=!1,id:r,resizeObserverConfig:i}=e,a=cG(Lq),{active:o,dispatch:s,over:c,measureDroppableContainers:l}=(0,D.useContext)(xq),u=(0,D.useRef)({disabled:n}),d=(0,D.useRef)(!1),f=(0,D.useRef)(null),p=(0,D.useRef)(null),{disabled:m,updateMeasurementsFor:h,timeout:g}={...Rq,...i},_=rG(h??r),v=eq({callback:(0,D.useCallback)(()=>{if(!d.current){d.current=!0;return}p.current!=null&&clearTimeout(p.current),p.current=setTimeout(()=>{l(Array.isArray(_.current)?_.current:[_.current]),p.current=null},g)},[g]),disabled:m||!o}),[y,b]=aG((0,D.useCallback)((e,t)=>{v&&(t&&(v.unobserve(t),d.current=!1),e&&v.observe(e))},[v])),x=rG(t);return(0,D.useEffect)(()=>{!v||!y.current||(v.disconnect(),d.current=!1,v.observe(y.current))},[y,v]),(0,D.useEffect)(()=>(s({type:kG.RegisterDroppable,element:{id:r,key:a,disabled:n,node:y,rect:f,data:x}}),()=>s({type:kG.UnregisterDroppable,key:a,id:r})),[r]),(0,D.useEffect)(()=>{n!==u.current.disabled&&(s({type:kG.SetDroppableDisabled,id:r,key:a,disabled:n}),u.current.disabled=n)},[r,a,n,s]),{active:o,rect:f,isOver:c?.id===r,node:y,over:c,setNodeRef:b}}function Bq(e,t,n){let r=e.slice();return r.splice(n<0?r.length+n:n,0,r.splice(t,1)[0]),r}function Vq(e,t){return e.reduce((e,n,r)=>{let i=t.get(n);return i&&(e[r]=i),e},Array(e.length))}function Hq(e){return e!==null&&e>=0}function Uq(e,t){if(e===t)return!0;if(e.length!==t.length)return!1;for(let n=0;n<e.length;n++)if(e[n]!==t[n])return!1;return!0}function Wq(e){return typeof e==`boolean`?{draggable:e,droppable:e}:e}var Gq=e=>{let{rects:t,activeIndex:n,overIndex:r,index:i}=e,a=Bq(t,r,n),o=t[i],s=a[i];return!s||!o?null:{x:s.left-o.left,y:s.top-o.top,scaleX:s.width/o.width,scaleY:s.height/o.height}},Kq=`Sortable`,qq=D.createContext({activeIndex:-1,containerId:Kq,disableTransforms:!1,items:[],overIndex:-1,useDragOverlay:!1,sortedRects:[],strategy:Gq,disabled:{draggable:!1,droppable:!1}});function Jq(e){let{children:t,id:n,items:r,strategy:i=Gq,disabled:a=!1}=e,{active:o,dragOverlay:s,droppableRects:c,over:l,measureDroppableContainers:u}=Iq(),d=cG(Kq,n),f=s.rect!==null,p=(0,D.useMemo)(()=>r.map(e=>typeof e==`object`&&`id`in e?e.id:e),[r]),m=o!=null,h=o?p.indexOf(o.id):-1,g=l?p.indexOf(l.id):-1,_=(0,D.useRef)(p),v=!Uq(p,_.current),y=g!==-1&&h===-1||v,b=Wq(a);eG(()=>{v&&m&&u(p)},[v,p,m,u]),(0,D.useEffect)(()=>{_.current=p},[p]);let x=(0,D.useMemo)(()=>({activeIndex:h,containerId:d,disabled:b,disableTransforms:y,items:p,overIndex:g,useDragOverlay:f,sortedRects:Vq(p,c),strategy:i}),[h,d,b.draggable,b.droppable,y,p,g,c,f,i]);return D.createElement(qq.Provider,{value:x},t)}var Yq=e=>{let{id:t,items:n,activeIndex:r,overIndex:i}=e;return Bq(n,r,i).indexOf(t)},Xq=e=>{let{containerId:t,isSorting:n,wasDragging:r,index:i,items:a,newIndex:o,previousItems:s,previousContainerId:c,transition:l}=e;return!l||!r||s!==a&&i===o?!1:n?!0:o!==i&&t===c},Zq={duration:200,easing:`ease`},Qq=`transform`,$q=gG.Transition.toString({property:Qq,duration:0,easing:`linear`}),eJ={roleDescription:`sortable`};function tJ(e){let{disabled:t,index:n,node:r,rect:i}=e,[a,o]=(0,D.useState)(null),s=(0,D.useRef)(n);return eG(()=>{if(!t&&n!==s.current&&r.current){let e=i.current;if(e){let t=ZG(r.current,{ignoreTransform:!0}),n={x:e.left-t.left,y:e.top-t.top,scaleX:e.width/t.width,scaleY:e.height/t.height};(n.x||n.y)&&o(n)}}n!==s.current&&(s.current=n)},[t,n,r,i]),(0,D.useEffect)(()=>{a&&o(null)},[a]),a}function nJ(e){let{animateLayoutChanges:t=Xq,attributes:n,disabled:r,data:i,getNewIndex:a=Yq,id:o,strategy:s,resizeObserverConfig:c,transition:l=Zq}=e,{items:u,containerId:d,activeIndex:f,disabled:p,disableTransforms:m,sortedRects:h,overIndex:g,useDragOverlay:_,strategy:v}=(0,D.useContext)(qq),y=rJ(r,p),b=u.indexOf(o),x=(0,D.useMemo)(()=>({sortable:{containerId:d,index:b,items:u},...i}),[d,i,b,u]),S=(0,D.useMemo)(()=>u.slice(u.indexOf(o)),[u,o]),{rect:C,node:w,isOver:T,setNodeRef:E}=zq({id:o,data:x,disabled:y.droppable,resizeObserverConfig:{updateMeasurementsFor:S,...c}}),{active:O,activatorEvent:k,activeNodeRect:A,attributes:j,setNodeRef:M,listeners:N,isDragging:ee,over:te,setActivatorNodeRef:P,transform:F}=Fq({id:o,data:x,attributes:{...eJ,...n},disabled:y.draggable}),I=GW(E,M),ne=!!O,re=ne&&!m&&Hq(f)&&Hq(g),ie=!_&&ee,ae=re?(ie&&re?F:null)??(s??v)({rects:h,activeNodeRect:A,activeIndex:f,overIndex:g,index:b}):null,oe=Hq(f)&&Hq(g)?a({id:o,items:u,activeIndex:f,overIndex:g}):b,se=O?.id,ce=(0,D.useRef)({activeId:se,items:u,newIndex:oe,containerId:d}),le=u!==ce.current.items,ue=t({active:O,containerId:d,isDragging:ee,isSorting:ne,id:o,index:b,items:u,newIndex:ce.current.newIndex,previousItems:ce.current.items,previousContainerId:ce.current.containerId,transition:l,wasDragging:ce.current.activeId!=null}),de=tJ({disabled:!ue,index:b,node:w,rect:C});return(0,D.useEffect)(()=>{ne&&ce.current.newIndex!==oe&&(ce.current.newIndex=oe),d!==ce.current.containerId&&(ce.current.containerId=d),u!==ce.current.items&&(ce.current.items=u)},[ne,oe,d,u]),(0,D.useEffect)(()=>{if(se===ce.current.activeId)return;if(se&&!ce.current.activeId){ce.current.activeId=se;return}let e=setTimeout(()=>{ce.current.activeId=se},50);return()=>clearTimeout(e)},[se]),{active:O,activeIndex:f,attributes:j,data:x,rect:C,index:b,newIndex:oe,items:u,isOver:T,isSorting:ne,isDragging:ee,listeners:N,node:w,overIndex:g,over:te,setNodeRef:I,setActivatorNodeRef:P,setDroppableNodeRef:E,setDraggableNodeRef:M,transform:de??ae,transition:fe()};function fe(){if(de||le&&ce.current.newIndex===b)return $q;if(!(ie&&!pG(k)||!l)&&(ne||ue))return gG.Transition.toString({...l,property:Qq})}}function rJ(e,t){return typeof e==`boolean`?{draggable:e,droppable:!1}:{draggable:e?.draggable??t.draggable,droppable:e?.droppable??t.droppable}}function iJ(e){if(!e)return!1;let t=e.data.current;return!!(t&&`sortable`in t&&typeof t.sortable==`object`&&`containerId`in t.sortable&&`items`in t.sortable&&`index`in t.sortable)}var aJ=[EK.Down,EK.Right,EK.Up,EK.Left],oJ=(e,t)=>{let{context:{active:n,collisionRect:r,droppableRects:i,droppableContainers:a,over:o,scrollableAncestors:s}}=t;if(aJ.includes(e.code)){if(e.preventDefault(),!n||!r)return;let t=[];a.getEnabled().forEach(n=>{if(!n||n!=null&&n.disabled)return;let a=i.get(n.id);if(a)switch(e.code){case EK.Down:r.top<a.top&&t.push(n);break;case EK.Up:r.top>a.top&&t.push(n);break;case EK.Left:r.left>a.left&&t.push(n);break;case EK.Right:r.left<a.left&&t.push(n)}});let c=VG({active:n,collisionRect:r,droppableRects:i,droppableContainers:t,pointerCoordinates:null}),l=RG(c,`id`);if(l===o?.id&&c.length>1&&(l=c[1].id),l!=null){let e=a.get(n.id),t=a.get(l),o=t?i.get(t.id):null,c=t?.node.current;if(c&&o&&e&&t){let n=nK(c).some((e,t)=>s[t]!==e),i=sJ(e,t),a=cJ(e,t),l=n||!i?{x:0,y:0}:{x:a?r.width-o.width:0,y:a?r.height-o.height:0},u={x:o.left,y:o.top};return l.x&&l.y?u:dG(u,l)}}}};function sJ(e,t){return!iJ(e)||!iJ(t)?!1:e.data.current.sortable.containerId===t.data.current.sortable.containerId}function cJ(e,t){return!iJ(e)||!iJ(t)||!sJ(e,t)?!1:e.data.current.sortable.index<t.data.current.sortable.index}var lJ={stdio:`STDIO`,sse:`HTTP`,"streamable-http":`HTTP`},uJ=Rp.withProps({variant:`outline`,color:`gray`});function dJ({transport:e}){return(0,R.jsx)(uJ,{children:lJ[e]})}function fJ({status:e,disabled:t=!1,onToggle:n,"aria-label":r=`Toggle server connection`}){let i=e===`connected`,a=e===`connecting`;return(0,R.jsx)(K_,{size:`lg`,checked:i||a,disabled:t||a,onChange:n,"aria-label":r})}function pJ(e){let t=[],n=String(e||``),r=n.indexOf(`,`),i=0,a=!1;for(;!a;){r===-1&&(r=n.length,a=!0);let e=n.slice(i,r).trim();(e||!a)&&t.push(e),i=r+1,r=n.indexOf(`,`,i)}return t}function mJ(e,t){let n=t||{};return(e[e.length-1]===``?[...e,``]:e).join((n.padRight?` `:``)+`,`+(n.padLeft===!1?``:` `)).trim()}var hJ=/^[$_\p{ID_Start}][$_\u{200C}\u{200D}\p{ID_Continue}]*$/u,gJ=/^[$_\p{ID_Start}][-$_\u{200C}\u{200D}\p{ID_Continue}]*$/u,_J={};function vJ(e,t){return((t||_J).jsx?gJ:hJ).test(e)}var yJ=/[ \t\n\f\r]/g;function bJ(e){return typeof e==`object`?e.type===`text`&&xJ(e.value):xJ(e)}function xJ(e){return e.replace(yJ,``)===``}var SJ=class{constructor(e,t,n){this.normal=t,this.property=e,n&&(this.space=n)}};SJ.prototype.normal={},SJ.prototype.property={},SJ.prototype.space=void 0;function CJ(e,t){let n={},r={};for(let t of e)Object.assign(n,t.property),Object.assign(r,t.normal);return new SJ(n,r,t)}function wJ(e){return e.toLowerCase()}var TJ=class{constructor(e,t){this.attribute=t,this.property=e}};TJ.prototype.attribute=``,TJ.prototype.booleanish=!1,TJ.prototype.boolean=!1,TJ.prototype.commaOrSpaceSeparated=!1,TJ.prototype.commaSeparated=!1,TJ.prototype.defined=!1,TJ.prototype.mustUseProperty=!1,TJ.prototype.number=!1,TJ.prototype.overloadedBoolean=!1,TJ.prototype.property=``,TJ.prototype.spaceSeparated=!1,TJ.prototype.space=void 0;var EJ=s({boolean:()=>OJ,booleanish:()=>kJ,commaOrSpaceSeparated:()=>PJ,commaSeparated:()=>NJ,number:()=>jJ,overloadedBoolean:()=>AJ,spaceSeparated:()=>MJ}),DJ=0,OJ=FJ(),kJ=FJ(),AJ=FJ(),jJ=FJ(),MJ=FJ(),NJ=FJ(),PJ=FJ();function FJ(){return 2**++DJ}var IJ=Object.keys(EJ),LJ=class extends TJ{constructor(e,t,n,r){let i=-1;if(super(e,t),RJ(this,`space`,r),typeof n==`number`)for(;++i<IJ.length;){let e=IJ[i];RJ(this,IJ[i],(n&EJ[e])===EJ[e])}}};LJ.prototype.defined=!0;function RJ(e,t,n){n&&(e[t]=n)}function zJ(e){let t={},n={};for(let[r,i]of Object.entries(e.properties)){let a=new LJ(r,e.transform(e.attributes||{},r),i,e.space);e.mustUseProperty&&e.mustUseProperty.includes(r)&&(a.mustUseProperty=!0),t[r]=a,n[wJ(r)]=r,n[wJ(a.attribute)]=r}return new SJ(t,n,e.space)}var BJ=zJ({properties:{ariaActiveDescendant:null,ariaAtomic:kJ,ariaAutoComplete:null,ariaBusy:kJ,ariaChecked:kJ,ariaColCount:jJ,ariaColIndex:jJ,ariaColSpan:jJ,ariaControls:MJ,ariaCurrent:null,ariaDescribedBy:MJ,ariaDetails:null,ariaDisabled:kJ,ariaDropEffect:MJ,ariaErrorMessage:null,ariaExpanded:kJ,ariaFlowTo:MJ,ariaGrabbed:kJ,ariaHasPopup:null,ariaHidden:kJ,ariaInvalid:null,ariaKeyShortcuts:null,ariaLabel:null,ariaLabelledBy:MJ,ariaLevel:jJ,ariaLive:null,ariaModal:kJ,ariaMultiLine:kJ,ariaMultiSelectable:kJ,ariaOrientation:null,ariaOwns:MJ,ariaPlaceholder:null,ariaPosInSet:jJ,ariaPressed:kJ,ariaReadOnly:kJ,ariaRelevant:null,ariaRequired:kJ,ariaRoleDescription:MJ,ariaRowCount:jJ,ariaRowIndex:jJ,ariaRowSpan:jJ,ariaSelected:kJ,ariaSetSize:jJ,ariaSort:null,ariaValueMax:jJ,ariaValueMin:jJ,ariaValueNow:jJ,ariaValueText:null,role:null},transform(e,t){return t===`role`?t:`aria-`+t.slice(4).toLowerCase()}});function VJ(e,t){return t in e?e[t]:t}function HJ(e,t){return VJ(e,t.toLowerCase())}var UJ=zJ({attributes:{acceptcharset:`accept-charset`,classname:`class`,htmlfor:`for`,httpequiv:`http-equiv`},mustUseProperty:[`checked`,`multiple`,`muted`,`selected`],properties:{abbr:null,accept:NJ,acceptCharset:MJ,accessKey:MJ,action:null,allow:null,allowFullScreen:OJ,allowPaymentRequest:OJ,allowUserMedia:OJ,alpha:OJ,alt:null,as:null,async:OJ,autoCapitalize:null,autoComplete:MJ,autoFocus:OJ,autoPlay:OJ,blocking:MJ,capture:null,charSet:null,checked:OJ,cite:null,className:MJ,closedBy:null,colorSpace:null,cols:jJ,colSpan:jJ,command:null,commandFor:null,content:null,contentEditable:kJ,controls:OJ,controlsList:MJ,coords:jJ|NJ,crossOrigin:null,data:null,dateTime:null,decoding:null,default:OJ,defer:OJ,dir:null,dirName:null,disabled:OJ,download:AJ,draggable:kJ,encType:null,enterKeyHint:null,fetchPriority:null,form:null,formAction:null,formEncType:null,formMethod:null,formNoValidate:OJ,formTarget:null,headers:MJ,height:jJ,hidden:AJ,high:jJ,href:null,hrefLang:null,htmlFor:MJ,httpEquiv:MJ,id:null,imageSizes:null,imageSrcSet:null,inert:OJ,inputMode:null,integrity:null,is:null,isMap:OJ,itemId:null,itemProp:MJ,itemRef:MJ,itemScope:OJ,itemType:MJ,kind:null,label:null,lang:null,language:null,list:null,loading:null,loop:OJ,low:jJ,manifest:null,max:null,maxLength:jJ,media:null,method:null,min:null,minLength:jJ,multiple:OJ,muted:OJ,name:null,nonce:null,noModule:OJ,noValidate:OJ,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:OJ,optimum:jJ,pattern:null,ping:MJ,placeholder:null,playsInline:OJ,popover:null,popoverTarget:null,popoverTargetAction:null,poster:null,preload:null,readOnly:OJ,referrerPolicy:null,rel:MJ,required:OJ,reversed:OJ,rows:jJ,rowSpan:jJ,sandbox:MJ,scope:null,scoped:OJ,seamless:OJ,selected:OJ,shadowRootClonable:OJ,shadowRootCustomElementRegistry:OJ,shadowRootDelegatesFocus:OJ,shadowRootMode:null,shadowRootSerializable:OJ,shape:null,size:jJ,sizes:null,slot:null,span:jJ,spellCheck:kJ,src:null,srcDoc:null,srcLang:null,srcSet:null,start:jJ,step:null,style:null,tabIndex:jJ,target:null,title:null,translate:null,type:null,typeMustMatch:OJ,useMap:null,value:kJ,width:jJ,wrap:null,writingSuggestions:null,align:null,aLink:null,archive:MJ,axis:null,background:null,bgColor:null,border:jJ,borderColor:null,bottomMargin:jJ,cellPadding:null,cellSpacing:null,char:null,charOff:null,classId:null,clear:null,code:null,codeBase:null,codeType:null,color:null,compact:OJ,declare:OJ,event:null,face:null,frame:null,frameBorder:null,hSpace:jJ,leftMargin:jJ,link:null,longDesc:null,lowSrc:null,marginHeight:jJ,marginWidth:jJ,noResize:OJ,noHref:OJ,noShade:OJ,noWrap:OJ,object:null,profile:null,prompt:null,rev:null,rightMargin:jJ,rules:null,scheme:null,scrolling:kJ,standby:null,summary:null,text:null,topMargin:jJ,valueType:null,version:null,vAlign:null,vLink:null,vSpace:jJ,allowTransparency:null,autoCorrect:null,autoSave:null,credentialless:OJ,disablePictureInPicture:OJ,disableRemotePlayback:OJ,exportParts:NJ,part:MJ,prefix:null,property:null,results:jJ,security:null,unselectable:null},space:`html`,transform:HJ}),WJ=zJ({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:PJ,accentHeight:jJ,accumulate:null,additive:null,alignmentBaseline:null,alphabetic:jJ,amplitude:jJ,arabicForm:null,ascent:jJ,attributeName:null,attributeType:null,azimuth:jJ,bandwidth:null,baselineShift:null,baseFrequency:null,baseProfile:null,bbox:null,begin:null,bias:jJ,by:null,calcMode:null,capHeight:jJ,className:MJ,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:jJ,diffuseConstant:jJ,direction:null,display:null,dur:null,divisor:jJ,dominantBaseline:null,download:OJ,dx:null,dy:null,edgeMode:null,editable:null,elevation:jJ,enableBackground:null,end:null,event:null,exponent:jJ,externalResourcesRequired:null,fill:null,fillOpacity:jJ,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:NJ,g2:NJ,glyphName:NJ,glyphOrientationHorizontal:null,glyphOrientationVertical:null,glyphRef:null,gradientTransform:null,gradientUnits:null,handler:null,hanging:jJ,hatchContentUnits:null,hatchUnits:null,height:null,href:null,hrefLang:null,horizAdvX:jJ,horizOriginX:jJ,horizOriginY:jJ,id:null,ideographic:jJ,imageRendering:null,initialVisibility:null,in:null,in2:null,intercept:jJ,k:jJ,k1:jJ,k2:jJ,k3:jJ,k4:jJ,kernelMatrix:PJ,kernelUnitLength:null,keyPoints:null,keySplines:null,keyTimes:null,kerning:null,lang:null,lengthAdjust:null,letterSpacing:null,lightingColor:null,limitingConeAngle:jJ,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:jJ,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:jJ,overlineThickness:jJ,paintOrder:null,panose1:null,path:null,pathLength:jJ,patternContentUnits:null,patternTransform:null,patternUnits:null,phase:null,ping:MJ,pitch:null,playbackOrder:null,pointerEvents:null,points:null,pointsAtX:jJ,pointsAtY:jJ,pointsAtZ:jJ,preserveAlpha:null,preserveAspectRatio:null,primitiveUnits:null,propagate:null,property:PJ,r:null,radius:null,referrerPolicy:null,refX:null,refY:null,rel:PJ,rev:PJ,renderingIntent:null,repeatCount:null,repeatDur:null,requiredExtensions:PJ,requiredFeatures:PJ,requiredFonts:PJ,requiredFormats:PJ,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:jJ,specularExponent:jJ,spreadMethod:null,spacing:null,startOffset:null,stdDeviation:null,stemh:null,stemv:null,stitchTiles:null,stopColor:null,stopOpacity:null,strikethroughPosition:jJ,strikethroughThickness:jJ,string:null,stroke:null,strokeDashArray:PJ,strokeDashOffset:null,strokeLineCap:null,strokeLineJoin:null,strokeMiterLimit:jJ,strokeOpacity:jJ,strokeWidth:null,style:null,surfaceScale:jJ,syncBehavior:null,syncBehaviorDefault:null,syncMaster:null,syncTolerance:null,syncToleranceDefault:null,systemLanguage:PJ,tabIndex:jJ,tableValues:null,target:null,targetX:jJ,targetY:jJ,textAnchor:null,textDecoration:null,textRendering:null,textLength:null,timelineBegin:null,title:null,transformBehavior:null,type:null,typeOf:PJ,to:null,transform:null,transformOrigin:null,u1:null,u2:null,underlinePosition:jJ,underlineThickness:jJ,unicode:null,unicodeBidi:null,unicodeRange:null,unitsPerEm:jJ,values:null,vAlphabetic:jJ,vMathematical:jJ,vectorEffect:null,vHanging:jJ,vIdeographic:jJ,version:null,vertAdvY:jJ,vertOriginX:jJ,vertOriginY:jJ,viewBox:null,viewTarget:null,visibility:null,width:null,widths:null,wordSpacing:null,writingMode:null,x:null,x1:null,x2:null,xChannelSelector:null,xHeight:jJ,y:null,y1:null,y2:null,yChannelSelector:null,z:null,zoomAndPan:null},space:`svg`,transform:VJ}),GJ=zJ({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()}}),KJ=zJ({attributes:{xmlnsxlink:`xmlns:xlink`},properties:{xmlnsXLink:null,xmlns:null},space:`xmlns`,transform:HJ}),qJ=zJ({properties:{xmlBase:null,xmlLang:null,xmlSpace:null},space:`xml`,transform(e,t){return`xml:`+t.slice(3).toLowerCase()}}),JJ={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`},YJ=/[A-Z]/g,XJ=/-[a-z]/g,ZJ=/^data[-\w.:]+$/i;function QJ(e,t){let n=wJ(t),r=t,i=TJ;if(n in e.normal)return e.property[e.normal[n]];if(n.length>4&&n.slice(0,4)===`data`&&ZJ.test(t)){if(t.charAt(4)===`-`){let e=t.slice(5).replace(XJ,eY);r=`data`+e.charAt(0).toUpperCase()+e.slice(1)}else{let e=t.slice(4);if(!XJ.test(e)){let n=e.replace(YJ,$J);n.charAt(0)!==`-`&&(n=`-`+n),t=`data`+n}}i=LJ}return new i(r,t)}function $J(e){return`-`+e.toLowerCase()}function eY(e){return e.charAt(1).toUpperCase()}var tY=CJ([BJ,UJ,GJ,KJ,qJ],`html`),nY=CJ([BJ,WJ,GJ,KJ,qJ],`svg`);function rY(e){let t=String(e||``).trim();return t?t.split(/[ \t\n\r\f]+/g):[]}function iY(e){return e.join(` `).trim()}var aY=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(`
195
- `);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})),oY=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(aY());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}})),sY=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))}})),cY=o(((e,t)=>{var n=(e&&e.__importDefault||function(e){return e&&e.__esModule?e:{default:e}})(oY()),r=sY();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})),lY=dY(`end`),uY=dY(`start`);function dY(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 fY(e){let t=uY(e),n=lY(e);if(t&&n)return{start:t,end:n}}function pY(e){return!e||typeof e!=`object`?``:`position`in e||`type`in e?hY(e.position):`start`in e||`end`in e?hY(e):`line`in e||`column`in e?mY(e):``}function mY(e){return gY(e&&e.line)+`:`+gY(e&&e.column)}function hY(e){return mY(e&&e.start)+`-`+mY(e&&e.end)}function gY(e){return e&&typeof e==`number`?e:1}var _Y=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=pY(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}};_Y.prototype.file=``,_Y.prototype.name=``,_Y.prototype.reason=``,_Y.prototype.message=``,_Y.prototype.stack=``,_Y.prototype.column=void 0,_Y.prototype.line=void 0,_Y.prototype.ancestors=void 0,_Y.prototype.cause=void 0,_Y.prototype.fatal=void 0,_Y.prototype.place=void 0,_Y.prototype.ruleId=void 0,_Y.prototype.source=void 0;var vY=l(cY(),1),yY={}.hasOwnProperty,bY=new Map,xY=/[A-Z]/g,SY=new Set([`table`,`tbody`,`thead`,`tfoot`,`tr`]),CY=new Set([`td`,`th`]);function wY(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=FY(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=PY(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`?nY:tY,stylePropertyNameCase:t.stylePropertyNameCase||`dom`,tableCellAlignToStyle:t.tableCellAlignToStyle!==!1},a=TY(i,e,void 0);return a&&typeof a!=`string`?a:i.create(e,i.Fragment,{children:a||void 0},void 0)}function TY(e,t,n){if(t.type===`element`)return EY(e,t,n);if(t.type===`mdxFlowExpression`||t.type===`mdxTextExpression`)return DY(e,t);if(t.type===`mdxJsxFlowElement`||t.type===`mdxJsxTextElement`)return kY(e,t,n);if(t.type===`mdxjsEsm`)return OY(e,t);if(t.type===`root`)return AY(e,t,n);if(t.type===`text`)return jY(e,t)}function EY(e,t,n){let r=e.schema,i=r;t.tagName.toLowerCase()===`svg`&&r.space===`html`&&(i=nY,e.schema=i),e.ancestors.push(t);let a=VY(e,t.tagName,!1),o=IY(e,t),s=RY(e,t);return SY.has(t.tagName)&&(s=s.filter(function(e){return typeof e!=`string`||!bJ(e)})),MY(e,o,a,t),NY(o,s),e.ancestors.pop(),e.schema=r,e.create(t,a,o,n)}function DY(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)}HY(e,t.position)}function OY(e,t){if(t.data&&t.data.estree&&e.evaluater)return e.evaluater.evaluateProgram(t.data.estree);HY(e,t.position)}function kY(e,t,n){let r=e.schema,i=r;t.name===`svg`&&r.space===`html`&&(i=nY,e.schema=i),e.ancestors.push(t);let a=t.name===null?e.Fragment:VY(e,t.name,!0),o=LY(e,t),s=RY(e,t);return MY(e,o,a,t),NY(o,s),e.ancestors.pop(),e.schema=r,e.create(t,a,o,n)}function AY(e,t,n){let r={};return NY(r,RY(e,t)),e.create(t,e.Fragment,r,n)}function jY(e,t){return t.value}function MY(e,t,n,r){typeof n!=`string`&&n!==e.Fragment&&e.passNode&&(t.node=r)}function NY(e,t){if(t.length>0){let n=t.length>1?t:t[0];n&&(e.children=n)}}function PY(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 FY(e,t){return n;function n(n,r,i,a){let o=Array.isArray(i.children),s=uY(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 IY(e,t){let n={},r,i;for(i in t.properties)if(i!==`children`&&yY.call(t.properties,i)){let a=zY(e,i,t.properties[i]);if(a){let[i,o]=a;e.tableCellAlignToStyle&&i===`align`&&typeof o==`string`&&CY.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 LY(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 HY(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 HY(e,t.position);else a=r.value===null||r.value;n[i]=a}return n}function RY(e,t){let n=[],r=-1,i=e.passKeys?new Map:bY;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=TY(e,a,o);s!==void 0&&n.push(s)}return n}function zY(e,t,n){let r=QJ(e.schema,t);if(!(n==null||typeof n==`number`&&Number.isNaN(n))){if(Array.isArray(n)&&(n=r.commaSeparated?mJ(n):iY(n)),r.property===`style`){let t=typeof n==`object`?n:BY(e,String(n));return e.stylePropertyNameCase===`css`&&(t=UY(t)),[`style`,t]}return[e.elementAttributeNameCase===`react`&&r.space?JJ[r.property]||r.property:r.attribute,n]}}function BY(e,t){try{return(0,vY.default)(t,{reactCompat:!0})}catch(t){if(e.ignoreInvalidStyle)return{};let n=t,r=new _Y("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=`https://github.com/syntax-tree/hast-util-to-jsx-runtime#cannot-parse-style-attribute`,r}}function VY(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=vJ(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=vJ(t)&&!/^[a-z]/.test(t)?{type:`Identifier`,name:t}:{type:`Literal`,value:t};if(r.type===`Literal`){let t=r.value;return yY.call(e.components,t)?e.components[t]:t}if(e.evaluater)return e.evaluater.evaluateExpression(r);HY(e)}function HY(e,t){let n=new _Y("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=`https://github.com/syntax-tree/hast-util-to-jsx-runtime#cannot-handle-mdx-estrees-without-createevaluater`,n}function UY(e){let t={},n;for(n in e)yY.call(e,n)&&(t[WY(n)]=e[n]);return t}function WY(e){let t=e.replace(xY,GY);return t.slice(0,3)===`ms-`&&(t=`-`+t),t}function GY(e){return`-`+e.toLowerCase()}var KY={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`]},qY={};function JY(e,t){let n=t||qY;return YY(e,typeof n.includeImageAlt!=`boolean`||n.includeImageAlt,typeof n.includeHtml!=`boolean`||n.includeHtml)}function YY(e,t,n){if(ZY(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 XY(e.children,t,n)}return Array.isArray(e)?XY(e,t,n):``}function XY(e,t,n){let r=[],i=-1;for(;++i<e.length;)r[i]=YY(e[i],t,n);return r.join(``)}function ZY(e){return!!(e&&typeof e==`object`)}var QY=document.createElement(`i`);function $Y(e){let t=`&`+e+`;`;QY.innerHTML=t;let n=QY.textContent;return n.charCodeAt(n.length-1)===59&&e!==`semi`?!1:n!==t&&n}function eX(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 tX(e,t){return e.length>0?(eX(e,e.length,0,t),e):t}var nX={}.hasOwnProperty;function rX(e){let t={},n=-1;for(;++n<e.length;)iX(t,e[n]);return t}function iX(e,t){let n;for(n in t){let r=(nX.call(e,n)?e[n]:void 0)||(e[n]={}),i=t[n],a;if(i)for(a in i){nX.call(r,a)||(r[a]=[]);let e=i[a];aX(r[a],Array.isArray(e)?e:e?[e]:[])}}}function aX(e,t){let n=-1,r=[];for(;++n<t.length;)(t[n].add===`after`?e:r).push(t[n]);eX(e,0,0,r)}function oX(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 sX(e){return e.replace(/[\t\n\r ]+/g,` `).replace(/^ | $/g,``).toLowerCase().toUpperCase()}var cX=bX(/[A-Za-z]/),lX=bX(/[\dA-Za-z]/),uX=bX(/[#-'*+\--9=?A-Z^-~]/);function dX(e){return e!==null&&(e<32||e===127)}var fX=bX(/\d/),pX=bX(/[\dA-Fa-f]/),mX=bX(/[!-/:-@[-`{-~]/);function hX(e){return e!==null&&e<-2}function gX(e){return e!==null&&(e<0||e===32)}function _X(e){return e===-2||e===-1||e===32}var vX=bX(/\p{P}|\p{S}/u),yX=bX(/\s/);function bX(e){return t;function t(t){return t!==null&&t>-1&&e.test(String.fromCharCode(t))}}function xX(e){let t=[],n=-1,r=0,i=0;for(;++n<e.length;){let a=e.charCodeAt(n),o=``;if(a===37&&lX(e.charCodeAt(n+1))&&lX(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 SX(e,t,n,r){let i=r?r-1:1/0,a=0;return o;function o(r){return _X(r)?(e.enter(n),s(r)):t(r)}function s(r){return _X(r)&&a++<i?(e.consume(r),s):(e.exit(n),t(r))}}var CX={tokenize:wX};function wX(e){let t=e.attempt(this.parser.constructs.contentInitial,r,i),n;return t;function r(n){if(n===null){e.consume(n);return}return e.enter(`lineEnding`),e.consume(n),e.exit(`lineEnding`),SX(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);return}return hX(t)?(e.consume(t),e.exit(`chunkText`),a):(e.consume(t),o)}}var TX={tokenize:DX},EX={tokenize:OX};function DX(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++;return eX(t.events,a+1,0,t.events.slice(n)),t.events.length=s,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(EX,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(EX,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);return}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);return}return hX(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++;eX(t.events,a+1,0,t.events.slice(n)),t.events.length=e}}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 OX(e,t,n){return SX(e,e.attempt(this.parser.constructs.document,t,n),`linePrefix`,this.parser.constructs.disable.null.includes(`codeIndented`)?void 0:4)}function kX(e){if(e===null||gX(e)||yX(e))return 1;if(vX(e))return 2}function AX(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 jX={name:`attention`,resolveAll:MX,tokenize:NX};function MX(e,t){let n=-1,r,i,a,o,s,c,l,u;for(;++n<e.length;)if(e[n][0]===`enter`&&e[n][1].type===`attentionSequence`&&e[n][1]._close){for(r=n;r--;)if(e[r][0]===`exit`&&e[r][1].type===`attentionSequence`&&e[r][1]._open&&t.sliceSerialize(e[r][1]).charCodeAt(0)===t.sliceSerialize(e[n][1]).charCodeAt(0)){if((e[r][1]._close||e[n][1]._open)&&(e[n][1].end.offset-e[n][1].start.offset)%3&&!((e[r][1].end.offset-e[r][1].start.offset+e[n][1].end.offset-e[n][1].start.offset)%3))continue;c=e[r][1].end.offset-e[r][1].start.offset>1&&e[n][1].end.offset-e[n][1].start.offset>1?2:1;let d={...e[r][1].end},f={...e[n][1].start};PX(d,-c),PX(f,c),o={type:c>1?`strongSequence`:`emphasisSequence`,start:d,end:{...e[r][1].end}},s={type:c>1?`strongSequence`:`emphasisSequence`,start:{...e[n][1].start},end:f},a={type:c>1?`strongText`:`emphasisText`,start:{...e[r][1].end},end:{...e[n][1].start}},i={type:c>1?`strong`:`emphasis`,start:{...o.start},end:{...s.end}},e[r][1].end={...o.start},e[n][1].start={...s.end},l=[],e[r][1].end.offset-e[r][1].start.offset&&(l=tX(l,[[`enter`,e[r][1],t],[`exit`,e[r][1],t]])),l=tX(l,[[`enter`,i,t],[`enter`,o,t],[`exit`,o,t],[`enter`,a,t]]),l=tX(l,AX(t.parser.constructs.insideSpan.null,e.slice(r+1,n),t)),l=tX(l,[[`exit`,a,t],[`enter`,s,t],[`exit`,s,t],[`exit`,i,t]]),e[n][1].end.offset-e[n][1].start.offset?(u=2,l=tX(l,[[`enter`,e[n][1],t],[`exit`,e[n][1],t]])):u=0,eX(e,r-1,n-r+3,l),n=r+l.length-u-2;break}}for(n=-1;++n<e.length;)e[n][1].type===`attentionSequence`&&(e[n][1].type=`data`);return e}function NX(e,t){let n=this.parser.constructs.attentionMarkers.null,r=this.previous,i=kX(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=kX(o),u=!l||l===2&&i||n.includes(o),d=!i||i===2&&l||n.includes(r);return c._open=!!(a===42?u:u&&(i||!d)),c._close=!!(a===42?d:d&&(l||!u)),t(o)}}function PX(e,t){e.column+=t,e.offset+=t,e._bufferIndex+=t}var FX={name:`autolink`,tokenize:IX};function IX(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 cX(t)?(e.consume(t),o):t===64?n(t):l(t)}function o(e){return e===43||e===45||e===46||lX(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||lX(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||dX(r)?n(r):(e.consume(r),c)}function l(t){return t===64?(e.consume(t),u):uX(t)?(e.consume(t),l):n(t)}function u(e){return lX(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||lX(t))&&r++<63){let n=t===45?f:d;return e.consume(t),n}return n(t)}}var LX={partial:!0,tokenize:RX};function RX(e,t,n){return r;function r(t){return _X(t)?SX(e,i,`linePrefix`)(t):i(t)}function i(e){return e===null||hX(e)?t(e):n(e)}}var zX={continuation:{tokenize:VX},exit:HX,name:`blockQuote`,tokenize:BX};function BX(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 _X(n)?(e.enter(`blockQuotePrefixWhitespace`),e.consume(n),e.exit(`blockQuotePrefixWhitespace`),e.exit(`blockQuotePrefix`),t):(e.exit(`blockQuotePrefix`),t(n))}}function VX(e,t,n){let r=this;return i;function i(t){return _X(t)?SX(e,a,`linePrefix`,r.parser.constructs.disable.null.includes(`codeIndented`)?void 0:4)(t):a(t)}function a(r){return e.attempt(zX,t,n)(r)}}function HX(e){e.exit(`blockQuote`)}var UX={name:`characterEscape`,tokenize:WX};function WX(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 mX(r)?(e.enter(`characterEscapeValue`),e.consume(r),e.exit(`characterEscapeValue`),e.exit(`characterEscape`),t):n(r)}}var GX={name:`characterReference`,tokenize:KX};function KX(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=lX,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=pX,u):(e.enter(`characterReferenceValue`),a=7,o=fX,u(t))}function u(s){if(s===59&&i){let i=e.exit(`characterReferenceValue`);return o===lX&&!$Y(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 qX={partial:!0,tokenize:XX},JX={concrete:!0,name:`codeFenced`,tokenize:YX};function YX(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`),_X(t)?SX(e,d,`whitespace`)(t):d(t))}function d(n){return n===null||hX(n)?(e.exit(`codeFencedFence`),r.interrupt?t(n):e.check(qX,h,b)(n)):(e.enter(`codeFencedFenceInfo`),e.enter(`chunkString`,{contentType:`string`}),f(n))}function f(t){return t===null||hX(t)?(e.exit(`chunkString`),e.exit(`codeFencedFenceInfo`),d(t)):_X(t)?(e.exit(`chunkString`),e.exit(`codeFencedFenceInfo`),SX(e,p,`whitespace`)(t)):t===96&&t===s?n(t):(e.consume(t),f)}function p(t){return t===null||hX(t)?d(t):(e.enter(`codeFencedFenceMeta`),e.enter(`chunkString`,{contentType:`string`}),m(t))}function m(t){return t===null||hX(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&&_X(t)?SX(e,v,`linePrefix`,a+1)(t):v(t)}function v(t){return t===null||hX(t)?e.check(qX,h,b)(t):(e.enter(`codeFlowValue`),y(t))}function y(t){return t===null||hX(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`),_X(t)?SX(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`),_X(t)?SX(e,d,`whitespace`)(t):d(t)):n(t)}function d(r){return r===null||hX(r)?(e.exit(`codeFencedFence`),t(r)):n(r)}}}function XX(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 ZX={name:`codeIndented`,tokenize:$X},QX={partial:!0,tokenize:eZ};function $X(e,t,n){let r=this;return i;function i(t){return e.enter(`codeIndented`),SX(e,a,`linePrefix`,5)(t)}function a(e){let t=r.events[r.events.length-1];return t&&t[1].type===`linePrefix`&&t[2].sliceSerialize(t[1],!0).length>=4?o(e):n(e)}function o(t){return t===null?c(t):hX(t)?e.attempt(QX,o,c)(t):(e.enter(`codeFlowValue`),s(t))}function s(t){return t===null||hX(t)?(e.exit(`codeFlowValue`),o(t)):(e.consume(t),s)}function c(n){return e.exit(`codeIndented`),t(n)}}function eZ(e,t,n){let r=this;return i;function i(t){return r.parser.lazy[r.now().line]?n(t):hX(t)?(e.enter(`lineEnding`),e.consume(t),e.exit(`lineEnding`),i):SX(e,a,`linePrefix`,5)(t)}function a(e){let a=r.events[r.events.length-1];return a&&a[1].type===`linePrefix`&&a[2].sliceSerialize(a[1],!0).length>=4?t(e):hX(e)?i(e):n(e)}}var tZ={name:`codeText`,previous:rZ,resolve:nZ,tokenize:iZ};function nZ(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 rZ(e){return e!==96||this.events[this.events.length-1][1].type===`characterEscape`}function iZ(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)):hX(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||hX(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 aZ=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&&oZ(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),oZ(this.left,e)}unshift(e){this.setCursor(0),this.right.push(e)}unshiftMany(e){this.setCursor(0),oZ(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);oZ(this.right,t.reverse())}else{let t=this.right.splice(this.left.length+this.right.length-e,1/0);oZ(this.left,t.reverse())}}};function oZ(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 sZ(e){let t={},n=-1,r,i,a,o,s,c,l,u=new aZ(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,cZ(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 eX(e,0,1/0,u.slice(0)),!l}function cZ(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 lZ={resolve:dZ,tokenize:fZ},uZ={partial:!0,tokenize:pZ};function dZ(e){return sZ(e),e}function fZ(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):hX(t)?e.check(uZ,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 pZ(e,t,n){let r=this;return i;function i(t){return e.exit(`chunkContent`),e.enter(`lineEnding`),e.consume(t),e.exit(`lineEnding`),SX(e,a,`linePrefix`)}function a(i){if(i===null||hX(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 mZ(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||dX(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||hX(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||gX(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||dX(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 hZ(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):hX(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||hX(t)||s++>999?(e.exit(`chunkString`),u(t)):(e.consume(t),c||=!_X(t),t===92?f:d)}function f(t){return t===91||t===92||t===93?(e.consume(t),s++,d):d(t)}}function gZ(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):hX(t)?(e.enter(`lineEnding`),e.consume(t),e.exit(`lineEnding`),SX(e,l,`linePrefix`)):(e.enter(`chunkString`,{contentType:`string`}),u(t))}function u(t){return t===o||t===null||hX(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 _Z(e,t){let n;return r;function r(i){return hX(i)?(e.enter(`lineEnding`),e.consume(i),e.exit(`lineEnding`),n=!0,r):_X(i)?SX(e,r,n?`linePrefix`:`lineSuffix`)(i):t(i)}}var vZ={name:`definition`,tokenize:bZ},yZ={partial:!0,tokenize:xZ};function bZ(e,t,n){let r=this,i;return a;function a(t){return e.enter(`definition`),o(t)}function o(t){return hZ.call(r,e,s,n,`definitionLabel`,`definitionLabelMarker`,`definitionLabelString`)(t)}function s(t){return i=sX(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 gX(t)?_Z(e,l)(t):l(t)}function l(t){return mZ(e,u,n,`definitionDestination`,`definitionDestinationLiteral`,`definitionDestinationLiteralMarker`,`definitionDestinationRaw`,`definitionDestinationString`)(t)}function u(t){return e.attempt(yZ,d,d)(t)}function d(t){return _X(t)?SX(e,f,`whitespace`)(t):f(t)}function f(a){return a===null||hX(a)?(e.exit(`definition`),r.parser.defined.push(i),t(a)):n(a)}}function xZ(e,t,n){return r;function r(t){return gX(t)?_Z(e,i)(t):n(t)}function i(t){return gZ(e,a,n,`definitionTitle`,`definitionTitleMarker`,`definitionTitleString`)(t)}function a(t){return _X(t)?SX(e,o,`whitespace`)(t):o(t)}function o(e){return e===null||hX(e)?t(e):n(e)}}var SZ={name:`hardBreakEscape`,tokenize:CZ};function CZ(e,t,n){return r;function r(t){return e.enter(`hardBreakEscape`),e.consume(t),i}function i(r){return hX(r)?(e.exit(`hardBreakEscape`),t(r)):n(r)}}var wZ={name:`headingAtx`,resolve:TZ,tokenize:EZ};function TZ(e,t){let n=e.length-2,r=3,i,a;return 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&&(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`},eX(e,r,n-r+1,[[`enter`,i,t],[`enter`,a,t],[`exit`,a,t],[`exit`,i,t]])),e}function EZ(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||gX(t)?(e.exit(`atxHeadingSequence`),s(t)):n(t)}function s(n){return n===35?(e.enter(`atxHeadingSequence`),c(n)):n===null||hX(n)?(e.exit(`atxHeading`),t(n)):_X(n)?SX(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||gX(t)?(e.exit(`atxHeadingText`),s(t)):(e.consume(t),l)}}var DZ=`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(`.`),OZ=[`pre`,`script`,`style`,`textarea`],kZ={concrete:!0,name:`htmlFlow`,resolveTo:MZ,tokenize:NZ},AZ={partial:!0,tokenize:FZ},jZ={partial:!0,tokenize:PZ};function MZ(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 NZ(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:P):cX(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):cX(a)?(e.consume(a),i=4,r.interrupt?t:P):n(a)}function p(i){return i===45?(e.consume(i),r.interrupt?t:P):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 cX(t)?(e.consume(t),o=String.fromCharCode(t),g):n(t)}function g(s){if(s===null||s===47||s===62||gX(s)){let c=s===47,l=o.toLowerCase();return!c&&!a&&OZ.includes(l)?(i=1,r.interrupt?t(s):O(s)):DZ.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||lX(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 _X(t)?(e.consume(t),v):E(t)}function y(t){return t===47?(e.consume(t),E):t===58||t===95||cX(t)?(e.consume(t),b):_X(t)?(e.consume(t),y):E(t)}function b(t){return t===45||t===46||t===58||t===95||lX(t)?(e.consume(t),b):x(t)}function x(t){return t===61?(e.consume(t),S):_X(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):_X(t)?(e.consume(t),S):w(t)}function C(t){return t===c?(e.consume(t),c=null,T):t===null||hX(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||gX(t)?x(t):(e.consume(t),w)}function T(e){return e===47||e===62||_X(e)?y(e):n(e)}function E(t){return t===62?(e.consume(t),D):n(t)}function D(t){return t===null||hX(t)?O(t):_X(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),F):t===63&&i===3?(e.consume(t),P):t===93&&i===5?(e.consume(t),te):hX(t)&&(i===6||i===7)?(e.exit(`htmlFlowData`),e.check(AZ,I,k)(t)):t===null||hX(t)?(e.exit(`htmlFlowData`),k(t)):(e.consume(t),O)}function k(t){return e.check(jZ,A,I)(t)}function A(t){return e.enter(`lineEnding`),e.consume(t),e.exit(`lineEnding`),j}function j(t){return t===null||hX(t)?k(t):(e.enter(`htmlFlowData`),O(t))}function M(t){return t===45?(e.consume(t),P):O(t)}function N(t){return t===47?(e.consume(t),o=``,ee):O(t)}function ee(t){if(t===62){let n=o.toLowerCase();return OZ.includes(n)?(e.consume(t),F):O(t)}return cX(t)&&o.length<8?(e.consume(t),o+=String.fromCharCode(t),ee):O(t)}function te(t){return t===93?(e.consume(t),P):O(t)}function P(t){return t===62?(e.consume(t),F):t===45&&i===2?(e.consume(t),P):O(t)}function F(t){return t===null||hX(t)?(e.exit(`htmlFlowData`),I(t)):(e.consume(t),F)}function I(n){return e.exit(`htmlFlow`),t(n)}}function PZ(e,t,n){let r=this;return i;function i(t){return hX(t)?(e.enter(`lineEnding`),e.consume(t),e.exit(`lineEnding`),a):n(t)}function a(e){return r.parser.lazy[r.now().line]?n(e):t(e)}}function FZ(e,t,n){return r;function r(r){return e.enter(`lineEnding`),e.consume(r),e.exit(`lineEnding`),e.attempt(LX,t,n)}}var IZ={name:`htmlText`,tokenize:LZ};function LZ(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):cX(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):cX(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):hX(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):hX(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):hX(t)?(o=v,N(t)):(e.consume(t),v)}function y(t){return t===null?n(t):t===63?(e.consume(t),b):hX(t)?(o=y,N(t)):(e.consume(t),y)}function b(e){return e===62?M(e):y(e)}function x(t){return cX(t)?(e.consume(t),S):n(t)}function S(t){return t===45||lX(t)?(e.consume(t),S):C(t)}function C(t){return hX(t)?(o=C,N(t)):_X(t)?(e.consume(t),C):M(t)}function w(t){return t===45||lX(t)?(e.consume(t),w):t===47||t===62||gX(t)?T(t):n(t)}function T(t){return t===47?(e.consume(t),M):t===58||t===95||cX(t)?(e.consume(t),E):hX(t)?(o=T,N(t)):_X(t)?(e.consume(t),T):M(t)}function E(t){return t===45||t===46||t===58||t===95||lX(t)?(e.consume(t),E):D(t)}function D(t){return t===61?(e.consume(t),O):hX(t)?(o=D,N(t)):_X(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):hX(t)?(o=O,N(t)):_X(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):hX(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||gX(t)?T(t):(e.consume(t),A)}function j(e){return e===47||e===62||gX(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`),ee}function ee(t){return _X(t)?SX(e,te,`linePrefix`,r.parser.constructs.disable.null.includes(`codeIndented`)?void 0:4)(t):te(t)}function te(t){return e.enter(`htmlTextData`),o(t)}}var RZ={name:`labelEnd`,resolveAll:HZ,resolveTo:UZ,tokenize:WZ},zZ={tokenize:GZ},BZ={tokenize:KZ},VZ={tokenize:qZ};function HZ(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&&eX(e,0,e.length,n),e}function UZ(e,t){let n=e.length,r=0,i,a,o,s;for(;n--;)if(i=e[n][1],a){if(i.type===`link`||i.type===`labelLink`&&i._inactive)break;e[n][0]===`enter`&&i.type===`labelLink`&&(i._inactive=!0)}else if(o){if(e[n][0]===`enter`&&(i.type===`labelImage`||i.type===`labelLink`)&&!i._balanced&&(a=n,i.type!==`labelLink`)){r=2;break}}else i.type===`labelEnd`&&(o=n);let c={type:e[a][1].type===`labelLink`?`link`:`image`,start:{...e[a][1].start},end:{...e[e.length-1][1].end}},l={type:`label`,start:{...e[a][1].start},end:{...e[o][1].end}},u={type:`labelText`,start:{...e[a+r+2][1].end},end:{...e[o-2][1].start}};return s=[[`enter`,c,t],[`enter`,l,t]],s=tX(s,e.slice(a+1,a+r+3)),s=tX(s,[[`enter`,u,t]]),s=tX(s,AX(t.parser.constructs.insideSpan.null,e.slice(a+r+4,o-3),t)),s=tX(s,[[`exit`,u,t],e[o-2],e[o-1],[`exit`,l,t]]),s=tX(s,e.slice(o+1)),s=tX(s,[[`exit`,c,t]]),eX(e,a,e.length,s),e}function WZ(e,t,n){let r=this,i=r.events.length,a,o;for(;i--;)if((r.events[i][1].type===`labelImage`||r.events[i][1].type===`labelLink`)&&!r.events[i][1]._balanced){a=r.events[i][1];break}return s;function s(t){return a?a._inactive?d(t):(o=r.parser.defined.includes(sX(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(zZ,u,o?u:d)(t):t===91?e.attempt(BZ,u,o?l:d)(t):o?u(t):d(t)}function l(t){return e.attempt(VZ,u,d)(t)}function u(e){return t(e)}function d(e){return a._balanced=!0,n(e)}}function GZ(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 gX(t)?_Z(e,a)(t):a(t)}function a(t){return t===41?u(t):mZ(e,o,s,`resourceDestination`,`resourceDestinationLiteral`,`resourceDestinationLiteralMarker`,`resourceDestinationRaw`,`resourceDestinationString`,32)(t)}function o(t){return gX(t)?_Z(e,c)(t):u(t)}function s(e){return n(e)}function c(t){return t===34||t===39||t===40?gZ(e,l,n,`resourceTitle`,`resourceTitleMarker`,`resourceTitleString`)(t):u(t)}function l(t){return gX(t)?_Z(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 KZ(e,t,n){let r=this;return i;function i(t){return hZ.call(r,e,a,o,`reference`,`referenceMarker`,`referenceString`)(t)}function a(e){return r.parser.defined.includes(sX(r.sliceSerialize(r.events[r.events.length-1][1]).slice(1,-1)))?t(e):n(e)}function o(e){return n(e)}}function qZ(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 JZ={name:`labelStartImage`,resolveAll:RZ.resolveAll,tokenize:YZ};function YZ(e,t,n){let r=this;return i;function i(t){return e.enter(`labelImage`),e.enter(`labelImageMarker`),e.consume(t),e.exit(`labelImageMarker`),a}function a(t){return t===91?(e.enter(`labelMarker`),e.consume(t),e.exit(`labelMarker`),e.exit(`labelImage`),o):n(t)}function o(e){return e===94&&`_hiddenFootnoteSupport`in r.parser.constructs?n(e):t(e)}}var XZ={name:`labelStartLink`,resolveAll:RZ.resolveAll,tokenize:ZZ};function ZZ(e,t,n){let r=this;return i;function i(t){return e.enter(`labelLink`),e.enter(`labelMarker`),e.consume(t),e.exit(`labelMarker`),e.exit(`labelLink`),a}function a(e){return e===94&&`_hiddenFootnoteSupport`in r.parser.constructs?n(e):t(e)}}var QZ={name:`lineEnding`,tokenize:$Z};function $Z(e,t){return n;function n(n){return e.enter(`lineEnding`),e.consume(n),e.exit(`lineEnding`),SX(e,t,`linePrefix`)}}var eQ={name:`thematicBreak`,tokenize:tQ};function tQ(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||hX(a))?(e.exit(`thematicBreak`),t(a)):n(a)}function c(t){return t===i?(e.consume(t),r++,c):(e.exit(`thematicBreakSequence`),_X(t)?SX(e,s,`whitespace`)(t):s(t))}}var nQ={continuation:{tokenize:oQ},exit:cQ,name:`list`,tokenize:aQ},rQ={partial:!0,tokenize:lQ},iQ={partial:!0,tokenize:sQ};function aQ(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:fX(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(eQ,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 fX(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(LX,r.interrupt?n:u,e.attempt(rQ,f,d))}function u(e){return r.containerState.initialBlankLine=!0,a++,f(e)}function d(t){return _X(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 oQ(e,t,n){let r=this;return r.containerState._closeFlow=void 0,e.check(LX,i,a);function i(n){return r.containerState.furtherBlankLines=r.containerState.furtherBlankLines||r.containerState.initialBlankLine,SX(e,t,`listItemIndent`,r.containerState.size+1)(n)}function a(n){return r.containerState.furtherBlankLines||!_X(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(iQ,t,o)(n))}function o(i){return r.containerState._closeFlow=!0,r.interrupt=void 0,SX(e,e.attempt(nQ,t,n),`linePrefix`,r.parser.constructs.disable.null.includes(`codeIndented`)?void 0:4)(i)}}function sQ(e,t,n){let r=this;return SX(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 cQ(e){e.exit(this.containerState.type)}function lQ(e,t,n){let r=this;return SX(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!_X(e)&&i&&i[1].type===`listItemPrefixWhitespace`?t(e):n(e)}}var uQ={name:`setextUnderline`,resolveTo:dQ,tokenize:fQ};function dQ(e,t){let n=e.length,r,i,a;for(;n--;)if(e[n][0]===`enter`){if(e[n][1].type===`content`){r=n;break}e[n][1].type===`paragraph`&&(i=n)}else e[n][1].type===`content`&&e.splice(n,1),!a&&e[n][1].type===`definition`&&(a=n);let o={type:`setextHeading`,start:{...e[r][1].start},end:{...e[e.length-1][1].end}};return e[i][1].type=`setextHeadingText`,a?(e.splice(i,0,[`enter`,o,t]),e.splice(a+1,0,[`exit`,e[r][1],t]),e[r][1].end={...e[a][1].end}):e[r][1]=o,e.push([`exit`,o,t]),e}function fQ(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`),_X(t)?SX(e,c,`lineSuffix`)(t):c(t))}function c(r){return r===null||hX(r)?(e.exit(`setextHeadingLine`),t(r)):n(r)}}var pQ={tokenize:mQ};function mQ(e){let t=this,n=e.attempt(LX,r,e.attempt(this.parser.constructs.flowInitial,i,SX(e,e.attempt(this.parser.constructs.flow,i,e.attempt(lZ,i)),`linePrefix`)));return n;function r(r){if(r===null){e.consume(r);return}return e.enter(`lineEndingBlank`),e.consume(r),e.exit(`lineEndingBlank`),t.currentConstruct=void 0,n}function i(r){if(r===null){e.consume(r);return}return e.enter(`lineEnding`),e.consume(r),e.exit(`lineEnding`),t.currentConstruct=void 0,n}}var hQ={resolveAll:yQ()},gQ=vQ(`string`),_Q=vQ(`text`);function vQ(e){return{resolveAll:yQ(e===`text`?bQ: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);return}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 yQ(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 bQ(e,t){let n=0;for(;++n<=e.length;)if((n===e.length||e[n][1].type===`lineEnding`)&&e[n-1][1].type===`data`){let r=e[n-1][1],i=t.sliceStream(r),a=i.length,o=-1,s=0,c;for(;a--;){let e=i[a];if(typeof e==`string`){for(o=e.length;e.charCodeAt(o-1)===32;)s++,o--;if(o)break;o=-1}else if(e===-2)c=!0,s++;else if(e!==-1){a++;break}}if(t._contentTypeTextTrailing&&n===e.length&&(s=0),s){let i={type:n===e.length||c||s<2?`lineSuffix`:`hardBreakTrailing`,start:{_bufferIndex:a?o:r.start._bufferIndex+o,_index:r.start._index+a,line:r.end.line,column:r.end.column-s,offset:r.end.offset-s},end:{...r.end}};r.end={...i.start},r.start.offset===r.end.offset?Object.assign(r,i):(e.splice(n,0,[`enter`,i,t],[`exit`,i,t]),n+=2)}n++}return e}var xQ=s({attentionMarkers:()=>kQ,contentInitial:()=>CQ,disable:()=>AQ,document:()=>SQ,flow:()=>TQ,flowInitial:()=>wQ,insideSpan:()=>OQ,string:()=>EQ,text:()=>DQ}),SQ={42:nQ,43:nQ,45:nQ,48:nQ,49:nQ,50:nQ,51:nQ,52:nQ,53:nQ,54:nQ,55:nQ,56:nQ,57:nQ,62:zX},CQ={91:vZ},wQ={[-2]:ZX,[-1]:ZX,32:ZX},TQ={35:wZ,42:eQ,45:[uQ,eQ],60:kZ,61:uQ,95:eQ,96:JX,126:JX},EQ={38:GX,92:UX},DQ={[-5]:QZ,[-4]:QZ,[-3]:QZ,33:JZ,38:GX,42:jX,60:[FX,IZ],91:XZ,92:[SZ,UX],93:RZ,95:jX,96:tZ},OQ={null:[jX,hQ]},kQ={null:[42,95]},AQ={null:[]};function jQ(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=tX(o,e),g(),o[o.length-1]===null?(w(t,0),l.events=AX(a,l.events,l),l.events):[]}function f(e,t){return NQ(p(e),t)}function p(e){return MQ(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(){let e;for(;r._index<o.length;){let t=o[r._index];if(typeof t==`string`)for(e=r._index,r._bufferIndex<0&&(r._bufferIndex=0);r._index===e&&r._bufferIndex<t.length;)_(t.charCodeAt(r._bufferIndex));else _(t)}}function _(e){u=u(e)}function v(e){hX(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&&eX(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 MQ(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 NQ(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=`
196
- `;break;case-3:o=`\r
197
- `;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 PQ(e){let t={constructs:rX([xQ,...(e||{}).extensions||[]]),content:n(CX),defined:[],document:n(TX),flow:n(pQ),lazy:{},string:n(gQ),text:n(_Q)};return t;function n(e){return n;function n(n){return jQ(t,e,n)}}}function FQ(e){for(;!sZ(e););return e}var IQ=/[\0\t\n\r]/g;function LQ(){let e=1,t=``,n=!0,r;return i;function i(i,a,o){let s=[],c,l,u,d,f;for(i=t+(typeof i==`string`?i.toString():new TextDecoder(a||void 0).decode(i)),u=0,t=``,n&&=(i.charCodeAt(0)===65279&&u++,void 0);u<i.length;){if(IQ.lastIndex=u,c=IQ.exec(i),d=c&&c.index!==void 0?c.index:i.length,f=i.charCodeAt(d),!c){t=i.slice(u);break}if(f===10&&u===d&&r)s.push(-3),r=void 0;else switch(r&&=(s.push(-5),void 0),u<d&&(s.push(i.slice(u,d)),e+=d-u),f){case 0:s.push(65533),e++;break;case 9:for(l=Math.ceil(e/4)*4,s.push(-2);e++<l;)s.push(-1);break;case 10:s.push(-4),e=1;break;default:r=!0,e=1}u=d+1}return o&&(r&&s.push(-5),t&&s.push(t),s.push(null)),s}}var RQ=/\\([!-/:-@[-`{-~])|&(#(?:\d{1,7}|x[\da-f]{1,6})|[\da-z]{1,31});/gi;function zQ(e){return e.replace(RQ,BQ)}function BQ(e,t,n){if(t)return t;if(n.charCodeAt(0)===35){let e=n.charCodeAt(1),t=e===120||e===88;return oX(n.slice(t?2:1),t?16:10)}return $Y(n)||e}var VQ={}.hasOwnProperty;function HQ(e,t,n){return t&&typeof t==`object`&&(n=t,t=void 0),UQ(n)(FQ(PQ(n).document().write(LQ()(e,t,!0))))}function UQ(e){let t={transforms:[],canContainEols:[`emphasis`,`fragment`,`heading`,`paragraph`,`strong`],enter:{autolink:a(ve),autolinkProtocol:T,autolinkEmail:T,atxHeading:a(me),blockQuote:a(le),characterEscape:T,characterReference:T,codeFenced:a(ue),codeFencedFenceInfo:o,codeFencedFenceMeta:o,codeIndented:a(ue,o),codeText:a(de,o),codeTextData:T,data:T,codeFlowValue:T,definition:a(fe),definitionDestinationString:o,definitionLabelString:o,definitionTitleString:o,emphasis:a(pe),hardBreakEscape:a(he),hardBreakTrailing:a(he),htmlFlow:a(ge,o),htmlFlowData:T,htmlText:a(ge,o),htmlTextData:T,image:a(_e),label:o,link:a(ve),listItem:a(be),listItemValue:f,listOrdered:a(ye,d),listUnordered:a(ye),paragraph:a(xe),reference:ne,referenceString:o,resourceDestinationString:o,resourceTitleString:o,setextHeading:a(me),strong:a(Se),thematicBreak:a(we)},exit:{atxHeading:c(),atxHeadingSequence:x,autolink:c(),autolinkEmail:ce,autolinkProtocol:se,blockQuote:c(),characterEscapeValue:E,characterReferenceMarkerHexadecimal:ie,characterReferenceMarkerNumeric:ie,characterReferenceValue:ae,characterReference:oe,codeFenced:c(g),codeFencedFence:h,codeFencedFenceInfo:p,codeFencedFenceMeta:m,codeFlowValue:E,codeIndented:c(_),codeText:c(j),codeTextData:E,data:E,definition:c(),definitionDestinationString:b,definitionLabelString:v,definitionTitleString:y,emphasis:c(),hardBreakEscape:c(O),hardBreakTrailing:c(O),htmlFlow:c(k),htmlFlowData:E,htmlText:c(A),htmlTextData:E,image:c(N),label:te,labelText:ee,lineEnding:D,link:c(M),listItem:c(),listOrdered:c(),listUnordered:c(),paragraph:c(),referenceString:re,resourceDestinationString:P,resourceTitleString:F,resource:I,setextHeading:c(w),setextHeadingLineSequence:C,setextHeadingText:S,strong:c(),thematicBreak:c()}};GQ(t,(e||{}).mdastExtensions||[]);let n={};return r;function r(e){let r={type:`root`,children:[]},a={stack:[r],tokenStack:[],config:t,enter:s,exit:l,buffer:o,resume:u,data:n},c=[],d=-1;for(;++d<e.length;)(e[d][1].type===`listOrdered`||e[d][1].type===`listUnordered`)&&(e[d][0]===`enter`?c.push(d):d=i(e,c.pop(),d));for(d=-1;++d<e.length;){let n=t[e[d][0]];VQ.call(n,e[d][1].type)&&n[e[d][1].type].call(Object.assign({sliceSerialize:e[d][2].sliceSerialize},a),e[d][1])}if(a.tokenStack.length>0){let e=a.tokenStack[a.tokenStack.length-1];(e[1]||qQ).call(a,void 0,e[0])}for(r.position={start:WQ(e.length>0?e[0][1].start:{line:1,column:1,offset:0}),end:WQ(e.length>0?e[e.length-2][1].end:{line:1,column:1,offset:0})},d=-1;++d<t.transforms.length;)r=t.transforms[d](r)||r;return r}function i(e,t,n){let r=t-1,i=-1,a=!1,o,s,c,l;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 i=r;for(s=void 0;i--;){let t=e[i];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=i}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),e.splice(s||r,0,[`exit`,o,t[2]]),r++,n++}if(t[1].type===`listItemPrefix`){let i={type:`listItem`,_spread:!1,start:Object.assign({},t[1].start),end:void 0};o=i,e.splice(r,0,[`enter`,i,t[2]]),r++,n++,c=void 0,l=!0}}}return e[t][1]._spread=a,n}function a(e,t){return n;function n(n){s.call(this,e(n),n),t&&t.call(this,n)}}function o(){this.stack.push({type:`fragment`,children:[]})}function s(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:WQ(t.start),end:void 0}}function c(e){return t;function t(t){e&&e.call(this,t),l.call(this,t)}}function l(e,t){let n=this.stack.pop(),r=this.tokenStack.pop();if(r)r[0].type!==e.type&&(t?t.call(this,e,r[0]):(r[1]||qQ).call(this,e,r[0]));else throw Error("Cannot close `"+e.type+"` ("+pY({start:e.start,end:e.end})+`): it’s not open`);n.position.end=WQ(e.end)}function u(){return JY(this.stack.pop())}function d(){this.data.expectingFirstListItemValue=!0}function f(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 p(){let e=this.resume(),t=this.stack[this.stack.length-1];t.lang=e}function m(){let e=this.resume(),t=this.stack[this.stack.length-1];t.meta=e}function h(){this.data.flowCodeInside||(this.buffer(),this.data.flowCodeInside=!0)}function g(){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 _(){let e=this.resume(),t=this.stack[this.stack.length-1];t.value=e.replace(/(\r?\n|\r)$/g,``)}function v(e){let t=this.resume(),n=this.stack[this.stack.length-1];n.label=t,n.identifier=sX(this.sliceSerialize(e)).toLowerCase()}function y(){let e=this.resume(),t=this.stack[this.stack.length-1];t.title=e}function b(){let e=this.resume(),t=this.stack[this.stack.length-1];t.url=e}function x(e){let t=this.stack[this.stack.length-1];t.depth||=this.sliceSerialize(e).length}function S(){this.data.setextHeadingSlurpLineEnding=!0}function C(e){let t=this.stack[this.stack.length-1];t.depth=this.sliceSerialize(e).codePointAt(0)===61?1:2}function w(){this.data.setextHeadingSlurpLineEnding=void 0}function T(e){let t=this.stack[this.stack.length-1].children,n=t[t.length-1];(!n||n.type!==`text`)&&(n=Ce(),n.position={start:WQ(e.start),end:void 0},t.push(n)),this.stack.push(n)}function E(e){let t=this.stack.pop();t.value+=this.sliceSerialize(e),t.position.end=WQ(e.end)}function D(e){let n=this.stack[this.stack.length-1];if(this.data.atHardBreak){let t=n.children[n.children.length-1];t.position.end=WQ(e.end),this.data.atHardBreak=void 0;return}!this.data.setextHeadingSlurpLineEnding&&t.canContainEols.includes(n.type)&&(T.call(this,e),E.call(this,e))}function O(){this.data.atHardBreak=!0}function k(){let e=this.resume(),t=this.stack[this.stack.length-1];t.value=e}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.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 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 ee(e){let t=this.sliceSerialize(e),n=this.stack[this.stack.length-2];n.label=zQ(t),n.identifier=sX(t).toLowerCase()}function te(){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 P(){let e=this.resume(),t=this.stack[this.stack.length-1];t.url=e}function F(){let e=this.resume(),t=this.stack[this.stack.length-1];t.title=e}function I(){this.data.inReference=void 0}function ne(){this.data.referenceType=`collapsed`}function re(e){let t=this.resume(),n=this.stack[this.stack.length-1];n.label=t,n.identifier=sX(this.sliceSerialize(e)).toLowerCase(),this.data.referenceType=`full`}function ie(e){this.data.characterReferenceType=e.type}function ae(e){let t=this.sliceSerialize(e),n=this.data.characterReferenceType,r;n?(r=oX(t,n===`characterReferenceMarkerNumeric`?10:16),this.data.characterReferenceType=void 0):r=$Y(t);let i=this.stack[this.stack.length-1];i.value+=r}function oe(e){let t=this.stack.pop();t.position.end=WQ(e.end)}function se(e){E.call(this,e);let t=this.stack[this.stack.length-1];t.url=this.sliceSerialize(e)}function ce(e){E.call(this,e);let t=this.stack[this.stack.length-1];t.url=`mailto:`+this.sliceSerialize(e)}function le(){return{type:`blockquote`,children:[]}}function ue(){return{type:`code`,lang:null,meta:null,value:``}}function de(){return{type:`inlineCode`,value:``}}function fe(){return{type:`definition`,identifier:``,label:null,title:null,url:``}}function pe(){return{type:`emphasis`,children:[]}}function me(){return{type:`heading`,depth:0,children:[]}}function he(){return{type:`break`}}function ge(){return{type:`html`,value:``}}function _e(){return{type:`image`,title:null,url:``,alt:null}}function ve(){return{type:`link`,title:null,url:``,children:[]}}function ye(e){return{type:`list`,ordered:e.type===`listOrdered`,start:null,spread:e._spread,children:[]}}function be(e){return{type:`listItem`,spread:e._spread,checked:null,children:[]}}function xe(){return{type:`paragraph`,children:[]}}function Se(){return{type:`strong`,children:[]}}function Ce(){return{type:`text`,value:``}}function we(){return{type:`thematicBreak`}}}function WQ(e){return{line:e.line,column:e.column,offset:e.offset}}function GQ(e,t){let n=-1;for(;++n<t.length;){let r=t[n];Array.isArray(r)?GQ(e,r):KQ(e,r)}}function KQ(e,t){let n;for(n in t)if(VQ.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`enter`:case`exit`:{let r=t[n];r&&Object.assign(e[n],r);break}}}function qQ(e,t){throw Error(e?"Cannot close `"+e.type+"` ("+pY({start:e.start,end:e.end})+"): a different token (`"+t.type+"`, "+pY({start:t.start,end:t.end})+`) is open`:"Cannot close document, a token (`"+t.type+"`, "+pY({start:t.start,end:t.end})+`) is still open`)}function JQ(e){let t=this;t.parser=n;function n(n){return HQ(n,{...t.data(`settings`),...e,extensions:t.data(`micromarkExtensions`)||[],mdastExtensions:t.data(`fromMarkdownExtensions`)||[]})}}function YQ(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 XQ(e,t){let n={type:`element`,tagName:`br`,properties:{},children:[]};return e.patch(t,n),[e.applyData(t,n),{type:`text`,value:`
198
- `}]}function ZQ(e,t){let n=t.value?t.value+`
199
- `:``,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 QQ(e,t){let n={type:`element`,tagName:`del`,properties:{},children:e.all(t)};return e.patch(t,n),e.applyData(t,n)}function $Q(e,t){let n={type:`element`,tagName:`em`,properties:{},children:e.all(t)};return e.patch(t,n),e.applyData(t,n)}function e$(e,t){let n=typeof e.options.clobberPrefix==`string`?e.options.clobberPrefix:`user-content-`,r=String(t.identifier).toUpperCase(),i=xX(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 t$(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 n$(e,t){if(e.options.allowDangerousHtml){let n={type:`raw`,value:t.value};return e.patch(t,n),e.applyData(t,n)}}function r$(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 i$(e,t){let n=String(t.identifier).toUpperCase(),r=e.definitionById.get(n);if(!r)return r$(e,t);let i={src:xX(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 a$(e,t){let n={src:xX(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 o$(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 s$(e,t){let n=String(t.identifier).toUpperCase(),r=e.definitionById.get(n);if(!r)return r$(e,t);let i={href:xX(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 c$(e,t){let n={href:xX(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 l$(e,t,n){let r=e.all(t),i=n?u$(n):d$(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:`
200
- `}),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:`
201
- `});let l={type:`element`,tagName:`li`,properties:a,children:o};return e.patch(t,l),e.applyData(t,l)}function u$(e){let t=!1;if(e.type===`list`){t=e.spread||!1;let n=e.children,r=-1;for(;!t&&++r<n.length;)t=d$(n[r])}return t}function d$(e){return e.spread??e.children.length>1}function f$(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 p$(e,t){let n={type:`element`,tagName:`p`,properties:{},children:e.all(t)};return e.patch(t,n),e.applyData(t,n)}function m$(e,t){let n={type:`root`,children:e.wrap(e.all(t))};return e.patch(t,n),e.applyData(t,n)}function h$(e,t){let n={type:`element`,tagName:`strong`,properties:{},children:e.all(t)};return e.patch(t,n),e.applyData(t,n)}function g$(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=uY(t.children[1]),o=lY(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 _$(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 v$(e,t){let n={type:`element`,tagName:`td`,properties:{},children:e.all(t)};return e.patch(t,n),e.applyData(t,n)}var y$=9,b$=32;function x$(e){let t=String(e),n=/\r?\n|\r/g,r=n.exec(t),i=0,a=[];for(;r;)a.push(S$(t.slice(i,r.index),i>0,!0),r[0]),i=r.index+r[0].length,r=n.exec(t);return a.push(S$(t.slice(i),i>0,!1)),a.join(``)}function S$(e,t,n){let r=0,i=e.length;if(t){let t=e.codePointAt(r);for(;t===y$||t===b$;)r++,t=e.codePointAt(r)}if(n){let t=e.codePointAt(i-1);for(;t===y$||t===b$;)i--,t=e.codePointAt(i-1)}return i>r?e.slice(r,i):``}function C$(e,t){let n={type:`text`,value:x$(String(t.value))};return e.patch(t,n),e.applyData(t,n)}function w$(e,t){let n={type:`element`,tagName:`hr`,properties:{},children:[]};return e.patch(t,n),e.applyData(t,n)}var T$={blockquote:YQ,break:XQ,code:ZQ,delete:QQ,emphasis:$Q,footnoteReference:e$,heading:t$,html:n$,imageReference:i$,image:a$,inlineCode:o$,linkReference:s$,link:c$,listItem:l$,list:f$,paragraph:p$,root:m$,strong:h$,table:g$,tableCell:v$,tableRow:_$,text:C$,thematicBreak:w$,toml:E$,yaml:E$,definition:E$,footnoteDefinition:E$};function E$(){}var D$=typeof self==`object`?self:globalThis,O$=(e,t)=>{switch(e){case`Function`:case`SharedWorker`:case`Worker`:case`eval`:case`setInterval`:case`setTimeout`:throw TypeError(`unable to deserialize `+e)}return new D$[e](t)},k$=(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)e[r(t)]=r(n);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 D$[e]==`function`?O$(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)}}return n(O$(a,o),i)};return r},A$=e=>k$(new Map,e)(0),j$=``,{toString:M$}={},{keys:N$}=Object,P$=e=>{let t=typeof e;if(t!==`object`||!e)return[0,t];let n=M$.call(e).slice(8,-1);switch(n){case`Array`:return[1,j$];case`Object`:return[2,j$];case`Date`:return[3,j$];case`RegExp`:return[4,j$];case`Map`:return[5,j$];case`Set`:return[6,j$];case`DataView`:return[1,n]}return n.includes(`Array`)?[1,n]:e instanceof Error?[7,e.name||`Error`]:[2,n]},F$=([e,t])=>e===0&&(t===`function`||t===`symbol`),I$=(e,t,n,r)=>{let i=(e,t)=>{let i=r.push(e)-1;return n.set(t,i),i},a=r=>{if(n.has(r))return n.get(r);let[o,s]=P$(r);switch(o){case 0:{let t=r;switch(s){case`bigint`:o=8,t=r.toString();break;case`function`:case`symbol`:if(e)throw TypeError(`unable to serialize `+s);t=null;break;case`undefined`:return i([-1],r)}return i([o,t],r)}case 1:{if(s){let e=r;return s===`DataView`?e=new Uint8Array(r.buffer):s===`ArrayBuffer`&&(e=new Uint8Array(r)),i([s,[...e]],r)}let e=[],t=i([o,e],r);for(let t of r)e.push(a(t));return t}case 2:{if(s)switch(s){case`BigInt`:return i([s,r.toString()],r);case`Boolean`:case`Number`:case`String`:return i([s,r.valueOf()],r)}if(t&&`toJSON`in r)return a(r.toJSON());let n=[],c=i([o,n],r);for(let t of N$(r))(e||!F$(P$(r[t])))&&n.push([a(t),a(r[t])]);return c}case 3:return i([o,isNaN(r.getTime())?j$:r.toISOString()],r);case 4:{let{source:e,flags:t}=r;return i([o,{source:e,flags:t}],r)}case 5:{let t=[],n=i([o,t],r);for(let[n,i]of r)(e||!(F$(P$(n))||F$(P$(i))))&&t.push([a(n),a(i)]);return n}case 6:{let t=[],n=i([o,t],r);for(let n of r)(e||!F$(P$(n)))&&t.push(a(n));return n}}let{message:c}=r;return i([o,{name:s,message:c}],r)};return a},L$=(e,{json:t,lossy:n}={})=>{let r=[];return I$(!(t||n),!!t,new Map,r)(e),r},R$=typeof structuredClone==`function`?(e,t)=>t&&(`json`in t||`lossy`in t)?A$(L$(e,t)):structuredClone(e):(e,t)=>A$(L$(e,t));function z$(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 B$(e,t){return`Back to reference `+(e+1)+(t>1?`-`+t:``)}function V$(e){let t=typeof e.options.clobberPrefix==`string`?e.options.clobberPrefix:`user-content-`,n=e.options.footnoteBackContent||z$,r=e.options.footnoteBackLabel||B$,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=xX(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:{...R$(o),id:`footnote-label`},children:[{type:`text`,value:i}]},{type:`text`,value:`
202
- `},{type:`element`,tagName:`ol`,properties:{},children:e.wrap(s,!0)},{type:`text`,value:`
203
- `}]}}var H$=(function(e){if(e==null)return q$;if(typeof e==`function`)return K$(e);if(typeof e==`object`)return Array.isArray(e)?U$(e):W$(e);if(typeof e==`string`)return G$(e);throw Error(`Expected function, string, or object as test`)});function U$(e){let t=[],n=-1;for(;++n<e.length;)t[n]=H$(e[n]);return K$(r);function r(...e){let n=-1;for(;++n<t.length;)if(t[n].apply(this,e))return!0;return!1}}function W$(e){let t=e;return K$(n);function n(n){let r=n,i;for(i in e)if(r[i]!==t[i])return!1;return!0}}function G$(e){return K$(t);function t(t){return t&&t.type===e}}function K$(e){return t;function t(t,n,r){return!!(J$(t)&&e.call(this,t,typeof n==`number`?n:void 0,r||void 0))}}function q$(){return!0}function J$(e){return typeof e==`object`&&!!e&&`type`in e}function Y$(e){return e}var X$=[];function Z$(e,t,n,r){let i;typeof t==`function`&&typeof n!=`function`?(r=n,n=t):i=t;let a=H$(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 (`+Y$(e.type+(t?`<`+t+`>`:``))+`)`})}return u;function u(){let l=X$,u,d,f;if((!t||a(e,i,c[c.length-1]||void 0))&&(l=Q$(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 Q$(e){return Array.isArray(e)?e:typeof e==`number`?[!0,e]:e==null?X$:[e]}function $$(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),Z$(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 e1={}.hasOwnProperty,t1={};function n1(e,t){let n=t||t1,r=new Map,i=new Map,a={all:s,applyData:i1,definitionById:r,footnoteById:i,footnoteCounts:new Map,footnoteOrder:[],handlers:{...T$,...n.handlers},one:o,options:n,patch:r1,wrap:o1};return $$(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(e1.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=R$(n);return r.children=a.all(e),r}return R$(e)}return(a.options.unknownHandler||a1)(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=s1(i.value)),!Array.isArray(i)&&i.type===`element`)){let e=i.children[0];e&&e.type===`text`&&(e.value=s1(e.value))}Array.isArray(i)?t.push(...i):t.push(i)}}}return t}}function r1(e,t){e.position&&(t.position=fY(e))}function i1(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,R$(i)),`children`in n&&n.children&&r!=null&&(n.children=r)}return n}function a1(e,t){let n=t.data||{},r=`value`in t&&!(e1.call(n,`hProperties`)||e1.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 o1(e,t){let n=[],r=-1;for(t&&n.push({type:`text`,value:`
204
- `});++r<e.length;)r&&n.push({type:`text`,value:`
205
- `}),n.push(e[r]);return t&&e.length>0&&n.push({type:`text`,value:`
206
- `}),n}function s1(e){let t=0,n=e.charCodeAt(t);for(;n===9||n===32;)t++,n=e.charCodeAt(t);return e.slice(t)}function c1(e,t){let n=n1(e,t),r=n.one(e,void 0),i=V$(n),a=Array.isArray(r)?{type:`root`,children:r}:r||{type:`root`,children:[]};return i&&(`children`in a,a.children.push({type:`text`,value:`
207
- `},i)),a}function l1(e,t){return e&&`run`in e?async function(n,r){let i=c1(n,{file:r,...t});await e.run(i,r)}:function(n,r){return c1(n,{file:r,...e||t})}}function u1(e){if(e)throw e}var d1=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 f1(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 p1(){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);return}for(;++c<t.length;)(o[c]===null||o[c]===void 0)&&(o[c]=t[c]);t=o,s?m1(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 m1(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 h1={basename:g1,dirname:_1,extname:v1,join:y1,sep:`/`};function g1(e,t){if(t!==void 0&&typeof t!=`string`)throw TypeError(`"ext" argument must be a string`);S1(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 _1(e){if(S1(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 v1(e){S1(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}continue}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 y1(...e){let t=-1,n;for(;++t<e.length;)S1(e[t]),e[t]&&(n=n===void 0?e[t]:n+`/`+e[t]);return n===void 0?`.`:b1(n)}function b1(e){S1(e);let t=e.codePointAt(0)===47,n=x1(e,!t);return n.length===0&&!t&&(n=`.`),n.length>0&&e.codePointAt(e.length-1)===47&&(n+=`/`),t?`/`+n:n}function x1(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 S1(e){if(typeof e!=`string`)throw TypeError(`Path must be a string. Received `+JSON.stringify(e))}var C1={cwd:w1};function w1(){return`/`}function T1(e){return!!(typeof e==`object`&&e&&`href`in e&&e.href&&`protocol`in e&&e.protocol&&e.auth===void 0)}function E1(e){if(typeof e==`string`)e=new URL(e);else if(!T1(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 D1(e)}function D1(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 O1=[`history`,`path`,`basename`,`stem`,`extname`,`dirname`],k1=class{constructor(e){let t;t=e?T1(e)?{path:e}:typeof e==`string`||N1(e)?{value:e}:e:{},this.cwd=`cwd`in t?``:C1.cwd(),this.data={},this.history=[],this.messages=[],this.value,this.map,this.result,this.stored;let n=-1;for(;++n<O1.length;){let e=O1[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)O1.includes(r)||(this[r]=t[r])}get basename(){return typeof this.path==`string`?h1.basename(this.path):void 0}set basename(e){j1(e,`basename`),A1(e,`basename`),this.path=h1.join(this.dirname||``,e)}get dirname(){return typeof this.path==`string`?h1.dirname(this.path):void 0}set dirname(e){M1(this.basename,`dirname`),this.path=h1.join(e||``,this.basename)}get extname(){return typeof this.path==`string`?h1.extname(this.path):void 0}set extname(e){if(A1(e,`extname`),M1(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=h1.join(this.dirname,this.stem+(e||``))}get path(){return this.history[this.history.length-1]}set path(e){T1(e)&&(e=E1(e)),j1(e,`path`),this.path!==e&&this.history.push(e)}get stem(){return typeof this.path==`string`?h1.basename(this.path,this.extname):void 0}set stem(e){j1(e,`stem`),A1(e,`stem`),this.path=h1.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 _Y(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 A1(e,t){if(e&&e.includes(h1.sep))throw Error("`"+t+"` cannot be a path: did not expect `"+h1.sep+"`")}function j1(e,t){if(!e)throw Error("`"+t+"` cannot be empty")}function M1(e,t){if(!e)throw Error("Setting `"+t+"` requires `path` to be set too")}function N1(e){return!!(e&&typeof e==`object`&&`byteLength`in e&&`byteOffset`in e)}var P1=(function(e){let t=this.constructor.prototype,n=t[e],r=function(){return n.apply(r,arguments)};return Object.setPrototypeOf(r,t),r}),F1=l(d1(),1),I1={}.hasOwnProperty,L1=new class e extends P1{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=p1()}copy(){let t=new e,n=-1;for(;++n<this.attachers.length;){let e=this.attachers[n];t.use(...e)}return t.data((0,F1.default)(!0,{},this.namespace)),t}data(e,t){return typeof e==`string`?arguments.length===2?(B1(`data`,this.frozen),this.namespace[e]=t,this):I1.call(this.namespace,e)&&this.namespace[e]||void 0:e?(B1(`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=U1(e),n=this.parser||this.Parser;return R1(`parse`,n),n(String(t),t)}process(e,t){let n=this;return this.freeze(),R1(`process`,this.parser||this.Parser),z1(`process`,this.compiler||this.Compiler),t?r(void 0,t):new Promise(r);function r(r,i){let a=U1(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);G1(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(),R1(`processSync`,this.parser||this.Parser),z1(`processSync`,this.compiler||this.Compiler),this.process(e,r),H1(`processSync`,`process`,t),n;function r(e,r){t=!0,u1(e),n=r}}run(e,t,n){V1(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=U1(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),H1(`runSync`,`run`,n),r;function i(e,t){u1(e),r=t,n=!0}}stringify(e,t){this.freeze();let n=U1(t),r=this.compiler||this.Compiler;return z1(`stringify`,r),V1(e),r(e,n)}use(e,...t){let n=this.attachers,r=this.namespace;if(B1(`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,F1.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];f1(o)&&f1(r)&&(r=(0,F1.default)(!0,o,r)),n[i]=[e,r,...a]}}}}().freeze();function R1(e,t){if(typeof t!=`function`)throw TypeError("Cannot `"+e+"` without `parser`")}function z1(e,t){if(typeof t!=`function`)throw TypeError("Cannot `"+e+"` without `compiler`")}function B1(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 V1(e){if(!f1(e)||typeof e.type!=`string`)throw TypeError("Expected node, got `"+e+"`")}function H1(e,t,n){if(!n)throw Error("`"+e+"` finished async. Use `"+t+"` instead")}function U1(e){return W1(e)?e:new k1(e)}function W1(e){return!!(e&&typeof e==`object`&&`message`in e&&`messages`in e)}function G1(e){return typeof e==`string`||K1(e)}function K1(e){return!!(e&&typeof e==`object`&&`byteLength`in e&&`byteOffset`in e)}var q1=[],J1={allowDangerousHtml:!0},Y1=/^(https?|ircs?|mailto|xmpp)$/i,X1=[{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 Z1(e){let t=Q1(e),n=$1(e);return e0(t.runSync(t.parse(n),n),e)}function Q1(e){let t=e.rehypePlugins||q1,n=e.remarkPlugins||q1,r=e.remarkRehypeOptions?{...e.remarkRehypeOptions,...J1}:J1;return L1().use(JQ).use(n).use(l1,r).use(t)}function $1(e){let t=e.children||``,n=new k1;return typeof t==`string`?n.value=t:``+t,n}function e0(e,t){let n=t.allowedElements,r=t.allowElement,i=t.components,a=t.disallowedElements,o=t.skipHtml,s=t.unwrapDisallowed,c=t.urlTransform||t0;for(let e of X1)Object.hasOwn(t,e.from)&&``+e.from+(e.to?"use `"+e.to+"` instead":`remove it`)+e.id;return $$(e,l),wY(e,{Fragment:R.Fragment,components:i,ignoreInvalidStyle:!0,jsx:R.jsx,jsxs:R.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 KY)if(Object.hasOwn(KY,t)&&Object.hasOwn(e.properties,t)){let n=e.properties[t],r=KY[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 t0(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||Y1.test(e.slice(0,t))?e:``}function n0(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 r0(e){if(typeof e!=`string`)throw TypeError(`Expected a string`);return e.replace(/[|\\{}()[\]^$+*?.]/g,`\\$&`).replace(/-/g,`\\x2d`)}function i0(e,t,n){let r=H$((n||{}).ignore||[]),i=a0(t),a=-1;for(;++a<i.length;)Z$(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:(s!==n&&u.push({type:`text`,value:e.value.slice(s,n)}),Array.isArray(a)?u.push(...a):a&&u.push(a),s=n+d[0].length,l=!0),!r.global)break;d=r.exec(e.value)}return l?(s<e.value.length&&u.push({type:`text`,value:e.value.slice(s)}),n.children.splice(c,1,...u)):u=[e],c+u.length}}function a0(e){let t=[];if(!Array.isArray(e))throw TypeError(`Expected find and replace tuple or list of tuples`);let n=!e[0]||Array.isArray(e[0])?e:[e],r=-1;for(;++r<n.length;){let e=n[r];t.push([o0(e[0]),s0(e[1])])}return t}function o0(e){return typeof e==`string`?new RegExp(r0(e),`g`):e}function s0(e){return typeof e==`function`?e:function(){return e}}var c0=`phrasing`,l0=[`autolink`,`link`,`image`,`label`];function u0(){return{transforms:[v0],enter:{literalAutolink:f0,literalAutolinkEmail:p0,literalAutolinkHttp:p0,literalAutolinkWww:p0},exit:{literalAutolink:_0,literalAutolinkEmail:g0,literalAutolinkHttp:m0,literalAutolinkWww:h0}}}function d0(){return{unsafe:[{character:`@`,before:`[+\\-.\\w]`,after:`[\\-.\\w]`,inConstruct:c0,notInConstruct:l0},{character:`.`,before:`[Ww]`,after:`[\\-.\\w]`,inConstruct:c0,notInConstruct:l0},{character:`:`,before:`[ps]`,after:`\\/`,inConstruct:c0,notInConstruct:l0}]}}function f0(e){this.enter({type:`link`,title:null,url:``,children:[]},e)}function p0(e){this.config.enter.autolinkProtocol.call(this,e)}function m0(e){this.config.exit.autolinkProtocol.call(this,e)}function h0(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 g0(e){this.config.exit.autolinkEmail.call(this,e)}function _0(e){this.exit(e)}function v0(e){i0(e,[[/(https?:\/\/|www(?=\.))([-.\w]+)([^ \t\r\n]*)/gi,y0],[/(?<=^|\s|\p{P}|\p{S})([-.\w+]+)@([-\w]+(?:\.[-\w]+)+)/gu,b0]],{ignore:[`link`,`linkReference`]})}function y0(e,t,n,r,i){let a=``;if(!C0(i)||(/^w/i.test(t)&&(n=t+n,t=``,a=`http://`),!x0(n)))return!1;let o=S0(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 b0(e,t,n,r){return!C0(r,!0)||/[-\d_]$/.test(n)?!1:{type:`link`,title:null,url:`mailto:`+t+`@`+n,children:[{type:`text`,value:t+`@`+n}]}}function x0(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 S0(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=n0(e,`(`),a=n0(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 C0(e,t){let n=e.input.charCodeAt(e.index-1);return(e.index===0||yX(n)||vX(n))&&(!t||n!==47)}N0.peek=M0;function w0(){this.buffer()}function T0(e){this.enter({type:`footnoteReference`,identifier:``,label:``},e)}function E0(){this.buffer()}function D0(e){this.enter({type:`footnoteDefinition`,identifier:``,label:``,children:[]},e)}function O0(e){let t=this.resume(),n=this.stack[this.stack.length-1];n.type,n.identifier=sX(this.sliceSerialize(e)).toLowerCase(),n.label=t}function k0(e){this.exit(e)}function A0(e){let t=this.resume(),n=this.stack[this.stack.length-1];n.type,n.identifier=sX(this.sliceSerialize(e)).toLowerCase(),n.label=t}function j0(e){this.exit(e)}function M0(){return`[`}function N0(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 P0(){return{enter:{gfmFootnoteCallString:w0,gfmFootnoteCall:T0,gfmFootnoteDefinitionLabelString:E0,gfmFootnoteDefinition:D0},exit:{gfmFootnoteCallString:O0,gfmFootnoteCall:k0,gfmFootnoteDefinitionLabelString:A0,gfmFootnoteDefinition:j0}}}function F0(e){let t=!1;return e&&e.firstLineBlank&&(t=!0),{handlers:{footnoteDefinition:n,footnoteReference:N0},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?`
208
- `:` `)+r.indentLines(r.containerFlow(e,a.current()),t?L0:I0))),s(),o}}function I0(e,t,n){return t===0?e:L0(e,t,n)}function L0(e,t,n){return(n?``:` `)+e}var R0=[`autolink`,`destinationLiteral`,`destinationRaw`,`reference`,`titleQuote`,`titleApostrophe`];U0.peek=W0;function z0(){return{canContainEols:[`delete`],enter:{strikethrough:V0},exit:{strikethrough:H0}}}function B0(){return{unsafe:[{character:`~`,inConstruct:`phrasing`,notInConstruct:R0}],handlers:{delete:U0}}}function V0(e){this.enter({type:`delete`,children:[]},e)}function H0(e){this.exit(e)}function U0(e,t,n,r){let i=n.createTracker(r),a=n.enter(`strikethrough`),o=i.move(`~~`);return o+=n.containerPhrasing(e,{...i.current(),before:o,after:`~`}),o+=i.move(`~~`),a(),o}function W0(){return`~`}function G0(e){return e.length}function K0(e,t){let n=t||{},r=(n.align||[]).concat(),i=n.stringLength||G0,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=q0(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]=J0(r[d]);else{let e=J0(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(`
209
- `)}function q0(e){return e==null?``:String(e)}function J0(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}function Y0(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()),X0);return i(),o}function X0(e,t,n){return`>`+(n?``:` `)+e}function Z0(e,t){return Q0(e,t.inConstruct,!0)&&!Q0(e,t.notInConstruct,!1)}function Q0(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 $0(e,t,n,r){let i=-1;for(;++i<n.unsafe.length;)if(n.unsafe[i].character===`
210
- `&&Z0(n.stack,n.unsafe[i]))return/[ \t]/.test(r.before)?``:` `;return`\\
211
- `}function e2(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 t2(e,t){return!!(t.options.fences===!1&&e.value&&!e.lang&&/[^ \r\n]/.test(e.value)&&!/^[\t ]*(?:[\r\n]|$)|(?:^|[\r\n])[\t ]*$/.test(e.value))}function n2(e){let t=e.options.fence||"`";if(t!=="`"&&t!==`~`)throw Error("Cannot serialize code with `"+t+"` for `options.fence`, expected `` ` `` or `~`");return t}function r2(e,t,n,r){let i=n2(n),a=e.value||``,o=i==="`"?`GraveAccent`:`Tilde`;if(t2(e,n)){let e=n.enter(`codeIndented`),t=n.indentLines(a,i2);return e(),t}let s=n.createTracker(r),c=i.repeat(Math.max(e2(a,i)+1,3)),l=n.enter(`codeFenced`),u=s.move(c);if(e.lang){let t=n.enter(`codeFencedLang${o}`);u+=s.move(n.safe(e.lang,{before:u,after:` `,encode:["`"],...s.current()})),t()}if(e.lang&&e.meta){let t=n.enter(`codeFencedMeta${o}`);u+=s.move(` `),u+=s.move(n.safe(e.meta,{before:u,after:`
212
- `,encode:["`"],...s.current()})),t()}return u+=s.move(`
213
- `),a&&(u+=s.move(a+`
214
- `)),u+=s.move(c),l(),u}function i2(e,t,n){return(n?``:` `)+e}function a2(e){let t=e.options.quote||`"`;if(t!==`"`&&t!==`'`)throw Error("Cannot serialize title with `"+t+"` for `options.quote`, expected `\"`, or `'`");return t}function o2(e,t,n,r){let i=a2(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?` `:`
215
- `,...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 s2(e){let t=e.options.emphasis||`*`;if(t!==`*`&&t!==`_`)throw Error("Cannot serialize emphasis with `"+t+"` for `options.emphasis`, expected `*`, or `_`");return t}function c2(e){return`&#x`+e.toString(16).toUpperCase()+`;`}function l2(e,t,n){let r=kX(e),i=kX(t);return r===void 0?i===void 0?n===`_`?{inside:!0,outside:!0}:{inside:!1,outside:!1}:i===1?{inside:!0,outside:!0}:{inside:!1,outside:!0}:r===1?i===void 0?{inside:!1,outside:!1}:i===1?{inside:!0,outside:!0}:{inside:!1,outside:!1}:i===void 0?{inside:!1,outside:!1}:i===1?{inside:!0,outside:!1}:{inside:!1,outside:!1}}u2.peek=d2;function u2(e,t,n,r){let i=s2(n),a=n.enter(`emphasis`),o=n.createTracker(r),s=o.move(i),c=o.move(n.containerPhrasing(e,{after:i,before:s,...o.current()})),l=c.charCodeAt(0),u=l2(r.before.charCodeAt(r.before.length-1),l,i);u.inside&&(c=c2(l)+c.slice(1));let d=c.charCodeAt(c.length-1),f=l2(r.after.charCodeAt(0),d,i);f.inside&&(c=c.slice(0,-1)+c2(d));let p=o.move(i);return a(),n.attentionEncodeSurroundingInfo={after:f.outside,before:u.outside},s+c+p}function d2(e,t,n){return n.options.emphasis||`*`}function f2(e,t){let n=!1;return $$(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)&&JY(e)&&(t.options.setext||n))}function p2(e,t,n,r){let i=Math.max(Math.min(6,e.depth||1),1),a=n.createTracker(r);if(f2(e,n)){let t=n.enter(`headingSetext`),r=n.enter(`phrasing`),o=n.containerPhrasing(e,{...a.current(),before:`
216
- `,after:`
217
- `});return r(),t(),o+`
218
- `+(i===1?`=`:`-`).repeat(o.length-(Math.max(o.lastIndexOf(`\r`),o.lastIndexOf(`
219
- `))+1))}let o=`#`.repeat(i),s=n.enter(`headingAtx`),c=n.enter(`phrasing`);a.move(o+` `);let l=n.containerPhrasing(e,{before:`# `,after:`
220
- `,...a.current()});return/^[\t ]/.test(l)&&(l=c2(l.charCodeAt(0))+l.slice(1)),l=l?o+` `+l:o,n.options.closeAtx&&(l+=` `+o),c(),s(),l}m2.peek=h2;function m2(e){return e.value||``}function h2(){return`<`}g2.peek=_2;function g2(e,t,n,r){let i=a2(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 _2(){return`!`}v2.peek=y2;function v2(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=[],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 y2(){return`!`}b2.peek=x2;function b2(e,t,n){let r=e.value||``,i="`",a=-1;for(;RegExp("(^|[^`])"+i+"([^`]|$)").test(r);)i+="`";for(/[^ \r\n]/.test(r)&&(/^[ \r\n]/.test(r)&&/[ \r\n]$/.test(r)||/^`|`$/.test(r))&&(r=` `+r+` `);++a<n.unsafe.length;){let e=n.unsafe[a],t=n.compilePattern(e),i;if(e.atBreak)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 x2(){return"`"}function S2(e,t){let n=JY(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))}C2.peek=w2;function C2(e,t,n,r){let i=a2(n),a=i===`"`?`Quote`:`Apostrophe`,o=n.createTracker(r),s,c;if(S2(e,n)){let t=n.stack;n.stack=[],s=n.enter(`autolink`);let r=o.move(`<`);return r+=o.move(n.containerPhrasing(e,{before:r,after:`>`,...o.current()})),r+=o.move(`>`),s(),n.stack=t,r}s=n.enter(`link`),c=n.enter(`label`);let 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 w2(e,t,n){return S2(e,n)?`<`:`[`}T2.peek=E2;function T2(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=[],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 E2(){return`[`}function D2(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 O2(e){let t=D2(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 k2(e){let t=e.options.bulletOrdered||`.`;if(t!==`.`&&t!==`)`)throw Error("Cannot serialize items with `"+t+"` for `options.bulletOrdered`, expected `.` or `)`");return t}function A2(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 j2(e,t,n,r){let i=n.enter(`list`),a=n.bulletCurrent,o=e.ordered?k2(n):D2(n),s=e.ordered?o===`.`?`)`:`.`:O2(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),A2(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 M2(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 N2(e,t,n,r){let i=M2(n),a=n.bulletCurrent||D2(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 P2(e,t,n,r){let i=n.enter(`paragraph`),a=n.enter(`phrasing`),o=n.containerPhrasing(e,r);return a(),i(),o}var F2=H$([`break`,`delete`,`emphasis`,`footnote`,`footnoteReference`,`image`,`imageReference`,`inlineCode`,`inlineMath`,`link`,`linkReference`,`mdxJsxTextElement`,`mdxTextExpression`,`strong`,`text`,`textDirective`]);function I2(e,t,n,r){return(e.children.some(function(e){return F2(e)})?n.containerPhrasing:n.containerFlow).call(n,e,r)}function L2(e){let t=e.options.strong||`*`;if(t!==`*`&&t!==`_`)throw Error("Cannot serialize strong with `"+t+"` for `options.strong`, expected `*`, or `_`");return t}R2.peek=z2;function R2(e,t,n,r){let i=L2(n),a=n.enter(`strong`),o=n.createTracker(r),s=o.move(i+i),c=o.move(n.containerPhrasing(e,{after:i,before:s,...o.current()})),l=c.charCodeAt(0),u=l2(r.before.charCodeAt(r.before.length-1),l,i);u.inside&&(c=c2(l)+c.slice(1));let d=c.charCodeAt(c.length-1),f=l2(r.after.charCodeAt(0),d,i);f.inside&&(c=c.slice(0,-1)+c2(d));let p=o.move(i+i);return a(),n.attentionEncodeSurroundingInfo={after:f.outside,before:u.outside},s+c+p}function z2(e,t,n){return n.options.strong||`*`}function B2(e,t,n,r){return n.safe(e.value,r)}function V2(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 H2(e,t,n){let r=(A2(n)+(n.options.ruleSpaces?` `:``)).repeat(V2(n));return n.options.ruleSpaces?r.slice(0,-1):r}var U2={blockquote:Y0,break:$0,code:r2,definition:o2,emphasis:u2,hardBreak:$0,heading:p2,html:m2,image:g2,imageReference:v2,inlineCode:b2,link:C2,linkReference:T2,list:j2,listItem:N2,paragraph:P2,root:I2,strong:R2,text:B2,thematicBreak:H2};function W2(){return{enter:{table:G2,tableData:Y2,tableHeader:Y2,tableRow:q2},exit:{codeText:X2,table:K2,tableData:J2,tableHeader:J2,tableRow:J2}}}function G2(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 K2(e){this.exit(e),this.data.inTable=void 0}function q2(e){this.enter({type:`tableRow`,children:[]},e)}function J2(e){this.exit(e)}function Y2(e){this.enter({type:`tableCell`,children:[]},e)}function X2(e){let t=this.resume();this.data.inTable&&(t=t.replace(/\\([\\|])/g,Z2));let n=this.stack[this.stack.length-1];n.type,n.value=t,this.exit(e)}function Z2(e,t){return t===`|`?t:e}function Q2(e){let t=e||{},n=t.tableCellPadding,r=t.tablePipeAlign,i=t.stringLength,a=n?` `:`|`;return{unsafe:[{character:`\r`,inConstruct:`tableCell`},{character:`
221
- `,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(`
222
- `))}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 K0(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=U2.inlineCode(e,t,n);return n.stack.includes(`tableCell`)&&(r=r.replace(/\|/g,`\\$&`)),r}}function $2(){return{exit:{taskListCheckValueChecked:t4,taskListCheckValueUnchecked:t4,paragraph:n4}}}function e4(){return{unsafe:[{atBreak:!0,character:`-`,after:`[:|-]`}],handlers:{listItem:r4}}}function t4(e){let t=this.stack[this.stack.length-2];t.type,t.checked=e.type===`taskListCheckValueChecked`}function n4(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 r4(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=U2.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 i4(){return[u0(),P0(),z0(),W2(),$2()]}function a4(e){return{extensions:[d0(),F0(e),B0(),Q2(e),e4()]}}var o4={tokenize:b4,partial:!0},s4={tokenize:x4,partial:!0},c4={tokenize:S4,partial:!0},l4={tokenize:C4,partial:!0},u4={tokenize:w4,partial:!0},d4={name:`wwwAutolink`,tokenize:v4,previous:T4},f4={name:`protocolAutolink`,tokenize:y4,previous:E4},p4={name:`emailAutolink`,tokenize:_4,previous:D4},m4={};function h4(){return{text:m4}}for(var g4=48;g4<123;)m4[g4]=p4,g4++,g4===58?g4=65:g4===91&&(g4=97);m4[43]=p4,m4[45]=p4,m4[46]=p4,m4[95]=p4,m4[72]=[p4,f4],m4[104]=[p4,f4],m4[87]=[p4,d4],m4[119]=[p4,d4];function _4(e,t,n){let r=this,i,a;return o;function o(t){return!O4(t)||!D4.call(r,r.previous)||k4(r.events)?n(t):(e.enter(`literalAutolink`),e.enter(`literalAutolinkEmail`),s(t))}function s(t){return O4(t)?(e.consume(t),s):t===64?(e.consume(t),c):n(t)}function c(t){return t===46?e.check(u4,u,l)(t):t===45||t===95||lX(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&&cX(r.previous)?(e.exit(`literalAutolinkEmail`),e.exit(`literalAutolink`),t(o)):n(o)}}function v4(e,t,n){let r=this;return i;function i(t){return t!==87&&t!==119||!T4.call(r,r.previous)||k4(r.events)?n(t):(e.enter(`literalAutolink`),e.enter(`literalAutolinkWww`),e.check(o4,e.attempt(s4,e.attempt(c4,a),n),n)(t))}function a(n){return e.exit(`literalAutolinkWww`),e.exit(`literalAutolink`),t(n)}}function y4(e,t,n){let r=this,i=``,a=!1;return o;function o(t){return(t===72||t===104)&&E4.call(r,r.previous)&&!k4(r.events)?(e.enter(`literalAutolink`),e.enter(`literalAutolinkHttp`),i+=String.fromCodePoint(t),e.consume(t),s):n(t)}function s(t){if(cX(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||dX(t)||gX(t)||yX(t)||vX(t)?n(t):e.attempt(s4,e.attempt(c4,u),n)(t)}function u(n){return e.exit(`literalAutolinkHttp`),e.exit(`literalAutolink`),t(n)}}function b4(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 x4(e,t,n){let r,i,a;return o;function o(t){return t===46||t===95?e.check(l4,c,s)(t):t===null||gX(t)||yX(t)||t!==45&&vX(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 S4(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(l4,t,a)(o):o===null||gX(o)||yX(o)?t(o):(e.consume(o),i)}function a(t){return t===41&&r++,e.consume(t),i}}function C4(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||gX(o)||yX(o)?t(o):n(o)}function i(e){return e===null||e===40||e===91||gX(e)||yX(e)?t(e):r(e)}function a(e){return cX(e)?o(e):n(e)}function o(t){return t===59?(e.consume(t),r):cX(t)?(e.consume(t),o):n(t)}}function w4(e,t,n){return r;function r(t){return e.consume(t),i}function i(e){return lX(e)?n(e):t(e)}}function T4(e){return e===null||e===40||e===42||e===95||e===91||e===93||e===126||gX(e)}function E4(e){return!cX(e)}function D4(e){return!(e===47||O4(e))}function O4(e){return e===43||e===45||e===46||e===95||lX(e)}function k4(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 A4={tokenize:R4,partial:!0};function j4(){return{document:{91:{name:`gfmFootnoteDefinition`,tokenize:F4,continuation:{tokenize:I4},exit:L4}},text:{91:{name:`gfmFootnoteCall`,tokenize:P4},93:{name:`gfmPotentialFootnoteCall`,add:`after`,tokenize:M4,resolveTo:N4}}}}function M4(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=sX(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 N4(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 P4(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||gX(s))return n(s);if(s===93){e.exit(`chunkString`);let a=e.exit(`gfmFootnoteCallString`);return i.includes(sX(r.sliceSerialize(a)))?(e.enter(`gfmFootnoteCallLabelMarker`),e.consume(s),e.exit(`gfmFootnoteCallLabelMarker`),e.exit(`gfmFootnoteCall`),t):n(s)}return gX(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 F4(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||gX(t))return n(t);if(t===93){e.exit(`chunkString`);let n=e.exit(`gfmFootnoteDefinitionLabelString`);return a=sX(r.sliceSerialize(n)),e.enter(`gfmFootnoteDefinitionLabelMarker`),e.consume(t),e.exit(`gfmFootnoteDefinitionLabelMarker`),e.exit(`gfmFootnoteDefinitionLabel`),f}return gX(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),SX(e,p,`gfmFootnoteDefinitionWhitespace`)):n(t)}function p(e){return t(e)}}function I4(e,t,n){return e.check(LX,t,e.attempt(A4,t,n))}function L4(e){e.exit(`gfmFootnoteDefinition`)}function R4(e,t,n){let r=this;return SX(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 z4(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&&eX(o,o.length,0,AX(s,e.slice(r+1,n),t)),eX(o,o.length,0,[[`exit`,a,t],[`enter`,e[n][1],t],[`exit`,e[n][1],t],[`exit`,i,t]]),eX(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=kX(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=kX(a);return l._open=!u||u===2&&!!s,l._close=!s||s===2&&!!u,n(a)}}}var B4=class{constructor(){this.map=[]}add(e,t,n){V4(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}};function V4(e,t,n,r){let i=0;if(n!==0||r.length!==0){for(;i<e.map.length;){if(e.map[i][0]===t){e.map[i][1]+=n,e.map[i][2].push(...r);return}i+=1}e.map.push([t,n,r])}}function H4(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 U4(){return{flow:{null:{name:`table`,tokenize:W4,resolveAll:G4}}}}function W4(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 e=r.events[t][1].type;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?u(e):(o=!0,a+=1,u(e))}function u(t){return t===null?n(t):hX(t)?a>1?(a=0,r.interrupt=!0,e.exit(`tableRow`),e.enter(`lineEnding`),e.consume(t),e.exit(`lineEnding`),p):n(t):_X(t)?SX(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||gX(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,_X(t)?SX(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 _X(t)?SX(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||hX(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 _X(t)?SX(e,b,`whitespace`)(t):b(t)}function b(n){return n===124?m(n):n===null||hX(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||hX(n)?(e.exit(`tableRow`),t(n)):_X(n)?SX(e,C,`whitespace`)(n):(e.enter(`data`),w(n))}function w(t){return t===null||t===124||gX(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 G4(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 B4;for(;++n<e.length;){let p=e[n],m=p[1];p[0]===`enter`?m.type===`tableHead`?(s=!1,c!==0&&(q4(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=K4(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=K4(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=K4(f,t,o,i,n,d)):(o[0]=o[1],d=K4(f,t,a,i,n,d)),i=0):i&&(m.type===`data`||m.type===`tableDelimiterMarker`||m.type===`tableDelimiterFiller`)&&(o[3]=n)}for(c!==0&&q4(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=H4(t.events,n))}return e}function K4(e,t,n,r,i,a){let o=r===1?`tableHeader`:r===2?`tableDelimiter`:`tableData`;n[0]!==0&&(a.end=Object.assign({},J4(t.events,n[0])),e.add(n[0],0,[[`exit`,a,t]]));let s=J4(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=J4(t.events,n[2]),a=J4(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({},J4(t.events,i)),e.add(i,0,[[`exit`,a,t]]),a=void 0),a}function q4(e,t,n,r,i){let a=[],o=J4(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 J4(e,t){let n=e[t],r=n[0]===`enter`?`start`:`end`;return n[1][r]}var Y4={name:`tasklistCheck`,tokenize:Z4};function X4(){return{text:{91:Y4}}}function Z4(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 gX(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 hX(r)?t(r):_X(r)?e.check({tokenize:Q4},t,n)(r):n(r)}}function Q4(e,t,n){return SX(e,r,`whitespace`);function r(e){return e===null?n(e):t(e)}}function $4(e){return rX([h4(),j4(),z4(e),U4(),X4()])}var e3={};function t3(e){let t=this,n=e||e3,r=t.data(),i=r.micromarkExtensions||=[],a=r.fromMarkdownExtensions||=[],o=r.toMarkdownExtensions||=[];i.push($4(n)),a.push(i4()),o.push(a4(n))}var n3={json:()=>rN(()=>import(`./json-BJ8dCynk.js`),[]),markup:()=>rN(()=>import(`./markup-CWGodlA2.js`),__vite__mapDeps([0,1])),css:()=>rN(()=>import(`./css-BwN3NHAj.js`),[]),yaml:()=>rN(()=>import(`./yaml-BXU4NK_h.js`),[]),markdown:()=>rN(()=>import(`./markdown-CZCm46w1.js`),__vite__mapDeps([2,1]))},r3={xml:`markup`,html:`markup`,htm:`markup`,svg:`markup`,yml:`yaml`,md:`markdown`},i3=new Set,a3=new Set,o3=new Map,s3=null,c3=null;function l3(e){return r3[e]??e}async function u3(){return s3||(c3||=(async()=>{let[e,t]=await Promise.all([rN(()=>import(`./prism-light-CWdjx3zH.js`),[]),rN(()=>import(`./tomorrow-DlPePFH9.js`),[])]);return s3={Prism:e.default,style:t.default},s3})(),c3)}async function d3(e){let t=l3(e);if(i3.has(t)||a3.has(t))return;let n=o3.get(t);if(n)return n;let r=n3[t];if(!r){a3.add(t);return}let i=(async()=>{try{let e=await u3(),{default:n}=await r();e.Prism.registerLanguage(t,n),i3.add(t)}catch{a3.add(t)}finally{o3.delete(t)}})();return o3.set(t,i),i}var f3=nm.withProps({block:!0});function p3({language:e,code:t}){let[,n]=(0,D.useState)(0);(0,D.useEffect)(()=>{let t=!1;return d3(e).then(()=>{t||n(e=>e+1)}),()=>{t=!0}},[e]);let r=l3(e),i=s3;if(!i||!i3.has(r))return(0,R.jsx)(f3,{children:t});let{Prism:a,style:o}=i;return(0,R.jsx)(a,{language:r,style:o,customStyle:{margin:0},wrapLongLines:!0,children:t})}var m3=Cu.withProps({variant:`subtle`,fz:24});function h3({value:e,flush:t=!1}){return(0,R.jsx)(im,{value:e,children:({copied:e,copy:n})=>(0,R.jsx)(k_,{label:e?`Copied`:`Copy`,children:(0,R.jsx)(m3,{color:e?`green`:`var(--inspector-text-primary)`,onClick:n,"aria-label":e?`Copied`:`Copy`,...t&&{p:0,h:`auto`,w:`auto`},children:e?`✓`:`⎘`})})})}var g3=W.withProps({gap:4}),_3=H.withProps({wrap:`nowrap`,gap:`xs`,align:`center`}),v3=H.withProps({justify:`space-between`,wrap:`nowrap`,gap:`xs`,align:`center`}),y3=H.withProps({wrap:`nowrap`,gap:`xs`,align:`center`,flex:1,miw:0}),b3=U.withProps({size:`sm`,fw:500,variant:`monoBreak`,flex:1,miw:0}),x3=Rp.withProps({size:`md`,radius:`sm`,tt:`none`,autoContrast:!1,bg:`light-dark(var(--mantine-color-blue-light), var(--mantine-color-blue-9))`,c:`light-dark(var(--mantine-color-blue-light-color), var(--mantine-color-white))`}),S3=U.withProps({size:`sm`,fw:600,flex:1,miw:0});function C3({uri:e,name:t,mimeType:n,action:r}){return(0,R.jsxs)(g3,{children:[!!(t||n)&&(0,R.jsxs)(_3,{justify:t?`space-between`:`flex-end`,children:[t&&(0,R.jsx)(S3,{children:t}),n&&(0,R.jsx)(x3,{children:n})]}),(0,R.jsxs)(v3,{children:[(0,R.jsxs)(y3,{children:[(0,R.jsx)(h3,{value:e}),(0,R.jsx)(b3,{children:e})]}),r]})]})}function w3(e){return e.split(`;`)[0].trim().toLowerCase()}function T3(e){let t=w3(e);return t.startsWith(`image/`)?`image`:t.startsWith(`audio/`)?`audio`:t===`application/pdf`?`pdf`:t===`text/markdown`||t===`text/x-markdown`?`markdown`:t===`application/json`||t.endsWith(`+json`)?`json`:t===`text/csv`?`csv`:t===`text/html`?`html`:t===`text/css`?`css`:t===`text/xml`||t===`application/xml`||t.endsWith(`+xml`)?`xml`:t===`application/javascript`||t===`application/ecmascript`||t===`application/x-javascript`||t.startsWith(`text/`)?`text`:`binary`}var E3=new Set([`markdown`,`json`,`xml`,`css`,`csv`,`html`,`text`]);function D3(e){return E3.has(e)}function O3(e){let t=atob(e),n=new Uint8Array(t.length);for(let e=0;e<t.length;e++)n[e]=t.charCodeAt(e);return new TextDecoder(`utf-8`).decode(n)}function k3(e){let t=atob(e),n=new Uint8Array(t.length);for(let e=0;e<t.length;e++)n[e]=t.charCodeAt(e);return n}function A3(e){try{return O3(e)}catch{return null}}function j3(e){try{return k3(e)}catch{return null}}function M3(e){try{return JSON.stringify(JSON.parse(e),null,2)}catch{return e}}function N3(e){let t=e.trimStart();return t.startsWith(`{`)||t.startsWith(`[`)}function P3(e){let t=e.replace(/>\s*</g,`>
223
- <`).trim(),n=0,r=[];for(let e of t.split(`
224
- `)){let t=e.trim();if(!t)continue;let i=/^<\//.test(t);i&&(n=Math.max(n-1,0)),r.push(` `.repeat(n)+t),/^<[A-Za-z]/.test(t)&&!/\/>$/.test(t)&&!i&&!/^<([A-Za-z][\w-]*)\b[^>]*>.*<\/\1>$/.test(t)&&n++}return r.join(`
225
- `)}var F3=`<meta http-equiv="Content-Security-Policy" content="default-src 'none'; style-src 'unsafe-inline' https://fonts.googleapis.com; img-src data: blob:; font-src data: https://fonts.gstatic.com; base-uri 'none'; object-src 'none'; form-action 'none';">`;function I3(e){return/<head[\s>]/i.test(e)?e.replace(/<head([^>]*)>/i,`<head$1>${F3}`):/<html[\s>]/i.test(e)?e.replace(/<html([^>]*)>/i,`<html$1><head>${F3}</head>`):`<html><head>${F3}</head><body>${e}</body></html>`}var L3=/^(https?:|mailto:|#|\/(?!\/))/i;function R3(e){return typeof e==`string`&&L3.test(e)}var z3=wd.withProps({pos:`relative`,direction:`column`}),B3=nm.withProps({block:!0,p:36});function V3({mimeType:e}){return(0,R.jsx)(W,{gap:`xs`,children:(0,R.jsx)(z3,{children:(0,R.jsx)(B3,{children:`[Binary content (${e}) — preview not supported]`})})})}var H3=l(o(((e,t)=>{((n,r)=>{typeof define==`function`&&define.amd?define([],r):typeof t==`object`&&e!==void 0?t.exports=r():n.Papa=r()})(e,function e(){var t=typeof self<`u`?self:typeof window<`u`?window:t===void 0?{}:t,n,r=!t.document&&!!t.postMessage,i=t.IS_PAPA_WORKER||!1,a={},o=0,s={};function c(e){return e.charCodeAt(0)===65279?e.slice(1):e}function l(e){this._handle=null,this._finished=!1,this._completed=!1,this._halted=!1,this._input=null,this._baseIndex=0,this._partialLine=``,this._rowCount=0,this._start=0,this._nextChunk=null,this.isFirstChunk=!0,this._completeResults={data:[],errors:[],meta:{}},function(e){var t=b(e);t.chunkSize=parseInt(t.chunkSize),e.step||e.chunk||(t.chunkSize=null),this._handle=new m(t),(this._handle.streamer=this)._config=t}.call(this,e),this.parseChunk=function(e,n){var r=parseInt(this._config.skipFirstNLines)||0;if(this.isFirstChunk&&0<r){let t=this._config.newline;t||=(a=this._config.quoteChar||`"`,this._handle.guessLineEndings(e,a)),e=[...e.split(t).slice(r)].join(t)}this.isFirstChunk&&S(this._config.beforeFirstChunk)&&(a=this._config.beforeFirstChunk(e))!==void 0&&(e=a),this.isFirstChunk=!1,this._halted=!1;var r=this._partialLine+e,a=(this._partialLine=``,this._handle.parse(r,this._baseIndex,!this._finished));if(!this._handle.paused()&&!this._handle.aborted()){if(e=a.meta.cursor,r=(this._finished||(this._partialLine=r.substring(e-this._baseIndex),this._baseIndex=e),a&&a.data&&(this._rowCount+=a.data.length),this._finished||this._config.preview&&this._rowCount>=this._config.preview),i)t.postMessage({results:a,workerId:s.WORKER_ID,finished:r});else if(S(this._config.chunk)&&!n){if(this._config.chunk(a,this._handle),this._handle.paused()||this._handle.aborted())return void(this._halted=!0);this._completeResults=a=void 0}return this._config.step||this._config.chunk||(this._completeResults.data=this._completeResults.data.concat(a.data),this._completeResults.errors=this._completeResults.errors.concat(a.errors),this._completeResults.meta=a.meta),this._completed||!r||!S(this._config.complete)||a&&a.meta.aborted||(this._config.complete(this._completeResults,this._input),this._completed=!0),r||a&&a.meta.paused||this._nextChunk(),a}this._halted=!0},this._sendError=function(e){S(this._config.error)?this._config.error(e):i&&this._config.error&&t.postMessage({workerId:s.WORKER_ID,error:e,finished:!1})}}function u(e){var t;(e||={}).chunkSize||(e.chunkSize=s.RemoteChunkSize),l.call(this,e),this._nextChunk=r?function(){this._readChunk(),this._chunkLoaded()}:function(){this._readChunk()},this.stream=function(e){this._input=e,this._nextChunk()},this._readChunk=function(){if(this._finished)this._chunkLoaded();else{if(t=new XMLHttpRequest,this._config.withCredentials&&(t.withCredentials=this._config.withCredentials),r||(t.onload=x(this._chunkLoaded,this),t.onerror=x(this._chunkError,this)),t.open(this._config.downloadRequestBody?`POST`:`GET`,this._input,!r),this._config.downloadRequestHeaders){var e,n=this._config.downloadRequestHeaders;for(e in n)t.setRequestHeader(e,n[e])}var i;this._config.chunkSize&&(i=this._start+this._config.chunkSize-1,t.setRequestHeader(`Range`,`bytes=`+this._start+`-`+i));try{t.send(this._config.downloadRequestBody)}catch(e){this._chunkError(e.message)}r&&t.status===0&&this._chunkError()}},this._chunkLoaded=function(){t.readyState===4&&(t.status<200||400<=t.status?this._chunkError():(this._start+=this._config.chunkSize||t.responseText.length,this._finished=!this._config.chunkSize||this._start>=(e=>(e=e.getResponseHeader(`Content-Range`))===null?-1:parseInt(e.substring(e.lastIndexOf(`/`)+1)))(t),this.parseChunk(t.responseText)))},this._chunkError=function(e){e=t.statusText||e,this._sendError(Error(e))}}function d(e){(e||={}).chunkSize||(e.chunkSize=s.LocalChunkSize),l.call(this,e);var t,n,r=typeof FileReader<`u`;this.stream=function(e){this._input=e,n=e.slice||e.webkitSlice||e.mozSlice,r?((t=new FileReader).onload=x(this._chunkLoaded,this),t.onerror=x(this._chunkError,this)):t=new FileReaderSync,this._nextChunk()},this._nextChunk=function(){this._finished||this._config.preview&&!(this._rowCount<this._config.preview)||this._readChunk()},this._readChunk=function(){var e=this._input,i=(this._config.chunkSize&&(i=Math.min(this._start+this._config.chunkSize,this._input.size),e=n.call(e,this._start,i)),t.readAsText(e,this._config.encoding));r||this._chunkLoaded({target:{result:i}})},this._chunkLoaded=function(e){this._start+=this._config.chunkSize,this._finished=!this._config.chunkSize||this._start>=this._input.size,this.parseChunk(e.target.result)},this._chunkError=function(){this._sendError(t.error)}}function f(e){var t;l.call(this,e||={}),this.stream=function(e){return t=e,this._nextChunk()},this._nextChunk=function(){var e,n;if(!this._finished)return e=this._config.chunkSize,t=e?(n=t.substring(0,e),t.substring(e)):(n=t,``),this._finished=!t,this.parseChunk(n)}}function p(e){l.call(this,e||={});var t=[],n=!0,r=!1;this.pause=function(){l.prototype.pause.apply(this,arguments),this._input.pause()},this.resume=function(){l.prototype.resume.apply(this,arguments),this._input.resume()},this.stream=function(e){this._input=e,this._input.on(`data`,this._streamData),this._input.on(`end`,this._streamEnd),this._input.on(`error`,this._streamError)},this._checkIsFinished=function(){r&&t.length===1&&(this._finished=!0)},this._nextChunk=function(){this._checkIsFinished(),t.length?this.parseChunk(t.shift()):n=!0},this._streamData=x(function(e){try{t.push(typeof e==`string`?e:e.toString(this._config.encoding)),n&&(n=!1,this._checkIsFinished(),this.parseChunk(t.shift()))}catch(e){this._streamError(e)}},this),this._streamError=x(function(e){this._streamCleanUp(),this._sendError(e)},this),this._streamEnd=x(function(){this._streamCleanUp(),r=!0,this._streamData(``)},this),this._streamCleanUp=x(function(){this._input.removeListener(`data`,this._streamData),this._input.removeListener(`end`,this._streamEnd),this._input.removeListener(`error`,this._streamError)},this)}function m(e){var t,n,r,i,a=2**53,o=-a,l=/^\s*-?(\d+\.?|\.\d+|\d+\.\d+)([eE][-+]?\d+)?\s*$/,u=/^((\d{4}-[01]\d-[0-3]\dT[0-2]\d:[0-5]\d:[0-5]\d\.\d+([+-][0-2]\d:[0-5]\d|Z))|(\d{4}-[01]\d-[0-3]\dT[0-2]\d:[0-5]\d:[0-5]\d([+-][0-2]\d:[0-5]\d|Z))|(\d{4}-[01]\d-[0-3]\dT[0-2]\d:[0-5]\d([+-][0-2]\d:[0-5]\d|Z)))$/,d=this,f=0,p=0,m=!1,_=!1,v=[],y={data:[],errors:[],meta:{}};function x(t){return e.skipEmptyLines===`greedy`?t.join(``).trim()===``:t.length===1&&t[0].length===0}function C(){if(y&&r&&(T(`Delimiter`,`UndetectableDelimiter`,`Unable to auto-detect delimiting character; defaulted to '`+s.DefaultDelimiter+`'`),r=!1),e.skipEmptyLines&&(y.data=y.data.filter(function(e){return!x(e)})),w()){if(y)if(Array.isArray(y.data[0])){for(var t=0;w()&&t<y.data.length;t++)y.data[t].forEach(n);y.data.splice(0,1)}else y.data.forEach(n);function n(t,n){t=c(t),S(e.transformHeader)&&(t=e.transformHeader(t,n)),v.push(t)}}function n(t,n){for(var r=e.header?{}:[],i=0;i<t.length;i++){var s=i,c=t[i],c=((t,n)=>(t=>(e.dynamicTypingFunction&&e.dynamicTyping[t]===void 0&&(e.dynamicTyping[t]=e.dynamicTypingFunction(t)),!0===(e.dynamicTyping[t]||e.dynamicTyping)))(t)?n===`true`||n===`TRUE`||n!==`false`&&n!==`FALSE`&&((e=>{if(l.test(e)&&(e=parseFloat(e),o<e&&e<a))return 1})(n)?parseFloat(n):u.test(n)?new Date(n):n===``?null:n):n)(s=e.header?i>=v.length?`__parsed_extra`:v[i]:s,c=e.transform?e.transform(c,s):c);s===`__parsed_extra`?(r[s]=r[s]||[],r[s].push(c)):r[s]=c}return e.header&&(i>v.length?T(`FieldMismatch`,`TooManyFields`,`Too many fields: expected `+v.length+` fields but parsed `+i,p+n):i<v.length&&T(`FieldMismatch`,`TooFewFields`,`Too few fields: expected `+v.length+` fields but parsed `+i,p+n)),r}var i;y&&(e.header||e.dynamicTyping||e.transform)&&(i=1,!y.data.length||Array.isArray(y.data[0])?(y.data=y.data.map(n),i=y.data.length):y.data=n(y.data,0),e.header&&y.meta&&(y.meta.fields=v),p+=i)}function w(){return e.header&&v.length===0}function T(e,t,n,r){e={type:e,code:t,message:n},r!==void 0&&(e.row=r),y.errors.push(e)}S(e.step)&&(i=e.step,e.step=function(t){y=t,w()?C():(C(),y.data.length!==0&&(f+=t.data.length,e.preview&&f>e.preview?n.abort():(y.data=y.data[0],i(y,d))))}),this.parse=function(i,a,o){var c=e.quoteChar||`"`,c=(e.newline||=this.guessLineEndings(i,c),r=!1,e.delimiter?S(e.delimiter)&&(e.delimiter=e.delimiter(i),y.meta.delimiter=e.delimiter):((c=((t,n,r,i,a)=>{var o,c,l,u;a||=[`,`,` `,`|`,`;`,s.RECORD_SEP,s.UNIT_SEP];for(var d=0;d<a.length;d++){for(var f,p=a[d],m=0,h=0,_=0,v=(l=void 0,new g({comments:i,delimiter:p,newline:n,preview:10}).parse(t)),y=0;y<v.data.length;y++)r&&x(v.data[y])?_++:(f=v.data[y].length,h+=f,l===void 0?l=f:0<f&&(m+=Math.abs(f-l),l=f));0<v.data.length&&(h/=v.data.length-_),(c===void 0||m<=c)&&(u===void 0||u<h)&&1.99<h&&(c=m,o=p,u=h)}return{successful:!!(e.delimiter=o),bestDelimiter:o}})(i,e.newline,e.skipEmptyLines,e.comments,e.delimitersToGuess)).successful?e.delimiter=c.bestDelimiter:(r=!0,e.delimiter=s.DefaultDelimiter),y.meta.delimiter=e.delimiter),b(e));return e.preview&&e.header&&c.preview++,t=i,n=new g(c),y=n.parse(t,a,o),C(),m?{meta:{paused:!0}}:y||{meta:{paused:!1}}},this.paused=function(){return m},this.pause=function(){m=!0,n.abort(),t=S(e.chunk)?``:t.substring(n.getCharIndex())},this.resume=function(){d.streamer._halted?(m=!1,d.streamer.parseChunk(t,!0)):setTimeout(d.resume,3)},this.aborted=function(){return _},this.abort=function(){_=!0,n.abort(),y.meta.aborted=!0,S(e.complete)&&e.complete(y),t=``},this.guessLineEndings=function(e,t){e=e.substring(0,1048576);var t=RegExp(h(t)+`([^]*?)`+h(t),`gm`),n=(e=e.replace(t,``)).split(`\r`),t=e.split(`
226
- `),e=1<t.length&&t[0].length<n[0].length;if(n.length===1||e)return`
227
- `;for(var r=0,i=0;i<n.length;i++)n[i][0]===`
228
- `&&r++;return r>=n.length/2?`\r
229
- `:`\r`}}function h(e){return e.replace(/[.*+?^${}()|[\]\\]/g,`\\$&`)}function g(e){var t=(e||={}).delimiter,n=e.newline,r=e.comments,i=e.step,a=e.preview,o=e.fastMode,l=null,u=!1,d=e.quoteChar==null?`"`:e.quoteChar,f=d;if(e.escapeChar!==void 0&&(f=e.escapeChar),(typeof t!=`string`||-1<s.BAD_DELIMITERS.indexOf(t))&&(t=`,`),r===t)throw Error(`Comment character same as delimiter`);!0===r?r=`#`:(typeof r!=`string`||-1<s.BAD_DELIMITERS.indexOf(r))&&(r=!1),n!==`
230
- `&&n!==`\r`&&n!==`\r
231
- `&&(n=`
232
- `);var p=0,m=!1;this.parse=function(s,g,_){if(typeof s!=`string`)throw Error(`Input must be a string`);var v=s.length,y=t.length,b=n.length,x=r.length,C=S(i),w=[],T=[],E=[],D=p=0;if(!s)return ne();if(o||!1!==o&&s.indexOf(d)===-1){for(var O=s.split(n),k=0;k<O.length;k++){if(E=O[k],p+=E.length,k!==O.length-1)p+=n.length;else if(_)return ne();if(!r||E.substring(0,x)!==r){if(C){if(w=[],te(E.split(t)),re(),m)return ne()}else te(E.split(t));if(a&&a<=k)return w=w.slice(0,a),ne(!0)}}return ne()}for(var A=s.indexOf(t,p),j=s.indexOf(n,p),M=new RegExp(h(f)+h(d),`g`),N=s.indexOf(d,p);;)if(s[p]===d)for(N=p,p++;;){if((N=s.indexOf(d,N+1))===-1)return _||T.push({type:`Quotes`,code:`MissingQuotes`,message:`Quoted field unterminated`,row:w.length,index:p}),F();if(N===v-1)return F(s.substring(p,N).replace(M,d));if(d===f&&s[N+1]===f)N++;else if(d===f||N===0||s[N-1]!==f){A!==-1&&A<N+1&&(A=s.indexOf(t,N+1));var ee=P((j=j!==-1&&j<N+1?s.indexOf(n,N+1):j)===-1?A:Math.min(A,j));if(s.substr(N+1+ee,y)===t){E.push(s.substring(p,N).replace(M,d)),s[p=N+1+ee+y]!==d&&(N=s.indexOf(d,p)),A=s.indexOf(t,p),j=s.indexOf(n,p);break}if(ee=P(j),s.substring(N+1+ee,N+1+ee+b)===n){if(E.push(s.substring(p,N).replace(M,d)),I(N+1+ee+b),A=s.indexOf(t,p),N=s.indexOf(d,p),C&&(re(),m))return ne();if(a&&w.length>=a)return ne(!0);break}T.push({type:`Quotes`,code:`InvalidQuotes`,message:`Trailing quote on quoted field is malformed`,row:w.length,index:p}),N++}}else if(r&&E.length===0&&s.substring(p,p+x)===r){if(j===-1)return ne();p=j+b,j=s.indexOf(n,p),A=s.indexOf(t,p)}else if(A!==-1&&(A<j||j===-1))E.push(s.substring(p,A)),p=A+y,A=s.indexOf(t,p);else{if(j===-1)break;if(E.push(s.substring(p,j)),I(j+b),C&&(re(),m))return ne();if(a&&w.length>=a)return ne(!0)}return F();function te(e){w.push(e),D=p}function P(e){var t=0;return t=e!==-1&&(e=s.substring(N+1,e))&&e.trim()===``?e.length:t}function F(e){return _||(e===void 0&&(e=s.substring(p)),E.push(e),p=v,te(E),C&&re()),ne()}function I(e){p=e,te(E),E=[],j=s.indexOf(n,p)}function ne(r){if(e.header&&!g&&w.length&&!u){var i=w[0],a=Object.create(null),o=new Set(i);let t=!1;for(let n=0;n<i.length;n++){let r=c(i[n]);if(a[r=S(e.transformHeader)?e.transformHeader(r,n):r]){let e,s=a[r];for(;e=r+`_`+s,s++,o.has(e););o.add(e),i[n]=e,a[r]++,t=!0,(l=l===null?{}:l)[e]=r}else a[r]=1,i[n]=r;o.add(r)}t&&console.warn(`Duplicate headers found and renamed.`),u=!0}return{data:w,errors:T,meta:{delimiter:t,linebreak:n,aborted:m,truncated:!!r,cursor:D+(g||0),renamedHeaders:l}}}function re(){i(ne()),w=[],T=[]}},this.abort=function(){m=!0},this.getCharIndex=function(){return p}}function _(e){var t=e.data,n=a[t.workerId],r=!1;if(t.error)n.userError(t.error,t.file);else if(t.results&&t.results.data){var i={abort:function(){r=!0,v(t.workerId,{data:[],errors:[],meta:{aborted:!0}})},pause:y,resume:y};if(S(n.userStep)){for(var o=0;o<t.results.data.length&&(n.userStep({data:t.results.data[o],errors:t.results.errors,meta:t.results.meta},i),!r);o++);delete t.results}else S(n.userChunk)&&(n.userChunk(t.results,i,t.file),delete t.results)}t.finished&&!r&&v(t.workerId,t.results)}function v(e,t){var n=a[e];S(n.userComplete)&&n.userComplete(t),n.terminate(),delete a[e]}function y(){throw Error(`Not implemented.`)}function b(e){if(typeof e!=`object`||!e)return e;var t,n=Array.isArray(e)?[]:{};for(t in e)n[t]=b(e[t]);return n}function x(e,t){return function(){e.apply(t,arguments)}}function S(e){return typeof e==`function`}return s.parse=function(n,r){var i=(r||={}).dynamicTyping||!1;if(S(i)&&(r.dynamicTypingFunction=i,i={}),r.dynamicTyping=i,r.transform=!!S(r.transform)&&r.transform,!r.worker||!s.WORKERS_SUPPORTED)return i=null,s.NODE_STREAM_INPUT,typeof n==`string`?(n=c(n),i=new(r.download?u:f)(r)):!0===n.readable&&S(n.read)&&S(n.on)?i=new p(r):(t.File&&n instanceof File||n instanceof Object)&&(i=new d(r)),i.stream(n);(i=(()=>{var n;return!!s.WORKERS_SUPPORTED&&(n=(()=>{var n=t.URL||t.webkitURL||null,r=e.toString();return s.BLOB_URL||=n.createObjectURL(new Blob([`var global = (function() { if (typeof self !== 'undefined') { return self; } if (typeof window !== 'undefined') { return window; } if (typeof global !== 'undefined') { return global; } return {}; })(); global.IS_PAPA_WORKER=true; `,`(`,r,`)();`],{type:`text/javascript`}))})(),(n=new t.Worker(n)).onmessage=_,n.id=o++,a[n.id]=n)})()).userStep=r.step,i.userChunk=r.chunk,i.userComplete=r.complete,i.userError=r.error,r.step=S(r.step),r.chunk=S(r.chunk),r.complete=S(r.complete),r.error=S(r.error),delete r.worker,i.postMessage({input:n,config:r,workerId:i.id})},s.unparse=function(e,t){var n=!1,r=!0,i=`,`,a=`\r
233
- `,o=`"`,c=o+o,l=!1,u=null,d=!1,f=((()=>{if(typeof t==`object`){if(typeof t.delimiter!=`string`||s.BAD_DELIMITERS.filter(function(e){return t.delimiter.indexOf(e)!==-1}).length||(i=t.delimiter),typeof t.quotes!=`boolean`&&typeof t.quotes!=`function`&&!Array.isArray(t.quotes)||(n=t.quotes),typeof t.skipEmptyLines!=`boolean`&&typeof t.skipEmptyLines!=`string`||(l=t.skipEmptyLines),typeof t.newline==`string`&&(a=t.newline),typeof t.quoteChar==`string`&&(o=t.quoteChar,c=o+o),typeof t.header==`boolean`&&(r=t.header),Array.isArray(t.columns)){if(t.columns.length===0)throw Error(`Option columns is empty`);u=t.columns}t.escapeChar!==void 0&&(c=t.escapeChar+o),t.escapeFormulae instanceof RegExp?d=t.escapeFormulae:typeof t.escapeFormulae==`boolean`&&t.escapeFormulae&&(d=/^[=+\-@\t\r].*$/)}})(),new RegExp(h(o),`g`));if(typeof e==`string`&&(e=JSON.parse(e)),Array.isArray(e)){if(!e.length||Array.isArray(e[0]))return p(null,e,l);if(typeof e[0]==`object`)return p(u||Object.keys(e[0]),e,l)}else if(typeof e==`object`)return typeof e.data==`string`&&(e.data=JSON.parse(e.data)),Array.isArray(e.data)&&(e.fields||(e.fields=e.meta&&e.meta.fields||u),e.fields||(e.fields=Array.isArray(e.data[0])?e.fields:typeof e.data[0]==`object`?Object.keys(e.data[0]):[]),Array.isArray(e.data[0])||typeof e.data[0]==`object`||(e.data=[e.data])),p(e.fields||[],e.data||[],l);throw Error(`Unable to serialize unrecognized input`);function p(e,t,n){var o=``,s=(typeof e==`string`&&(e=JSON.parse(e)),typeof t==`string`&&(t=JSON.parse(t)),Array.isArray(e)&&0<e.length),c=!Array.isArray(t[0]);if(s&&r){for(var l=0;l<e.length;l++)0<l&&(o+=i),o+=m(e[l],l);0<t.length&&(o+=a)}for(var u=0;u<t.length;u++){var d=(s?e:t[u]).length,f=!1,p=s?Object.keys(t[u]).length===0:t[u].length===0;if(n&&!s&&(f=n===`greedy`?t[u].join(``).trim()===``:t[u].length===1&&t[u][0].length===0),n===`greedy`&&s){for(var h=[],g=0;g<d;g++){var _=c?e[g]:g;h.push(t[u][_])}f=h.join(``).trim()===``}if(!f){for(var v=0;v<d;v++){0<v&&!p&&(o+=i);var y=s&&c?e[v]:v;o+=m(t[u][y],v)}u<t.length-1&&(!n||0<d&&!p)&&(o+=a)}}return o}function m(e,t){var r,a,l;return e==null?``:e.constructor===Date?JSON.stringify(e).slice(1,25):(l=!1,d&&typeof e==`string`&&d.test(e)&&(e=`'`+e,l=!0),a=(r=e.toString()).replace(f,c),(l=l||!0===n||typeof n==`function`&&n(e,t)||Array.isArray(n)&&n[t]||((e,t)=>{for(var n=0;n<t.length;n++)if(-1<e.indexOf(t[n]))return!0;return!1})(a,s.BAD_DELIMITERS)||-1<a.indexOf(i)||-1<r.indexOf(o)||a.charAt(0)===` `||a.charAt(a.length-1)===` `)?o+a+o:a)}},s.RECORD_SEP=``,s.UNIT_SEP=``,s.BYTE_ORDER_MARK=``,s.BAD_DELIMITERS=[`\r`,`
234
- `,`"`,s.BYTE_ORDER_MARK],s.WORKERS_SUPPORTED=!r&&!!t.Worker,s.NODE_STREAM_INPUT=1,s.LocalChunkSize=10485760,s.RemoteChunkSize=5242880,s.DefaultDelimiter=`,`,s.Parser=g,s.ParserHandle=m,s.NetworkStreamer=u,s.FileStreamer=d,s.StringStreamer=f,s.ReadableStreamStreamer=p,t.jQuery&&((n=t.jQuery).fn.parse=function(e){var r=e.config||{},i=[];return this.each(function(e){if(!(n(this).prop(`tagName`).toUpperCase()===`INPUT`&&n(this).attr(`type`).toLowerCase()===`file`&&t.FileReader)||!this.files||this.files.length===0)return!0;for(var a=0;a<this.files.length;a++)i.push({file:this.files[a],inputElem:this,instanceConfig:n.extend({},r)})}),a(),this;function a(){if(i.length===0)S(e.complete)&&e.complete();else{var t,r,a,c,l=i[0];if(S(e.before)){var u=e.before(l.file,l.inputElem);if(typeof u==`object`){if(u.action===`abort`)return t=`AbortError`,r=l.file,a=l.inputElem,c=u.reason,void(S(e.error)&&e.error({name:t},r,a,c));if(u.action===`skip`)return void o();typeof u.config==`object`&&(l.instanceConfig=n.extend(l.instanceConfig,u.config))}else if(u===`skip`)return void o()}var d=l.instanceConfig.complete;l.instanceConfig.complete=function(e){S(d)&&d(e,l.file,l.inputElem),o()},s.parse(l.file,l.instanceConfig)}}function o(){i.splice(0,1),a()}}),i&&(t.onmessage=function(e){e=e.data,s.WORKER_ID===void 0&&e&&(s.WORKER_ID=e.workerId),typeof e.input==`string`?t.postMessage({workerId:s.WORKER_ID,results:s.parse(e.input,e.config),finished:!0}):(t.File&&e.input instanceof File||e.input instanceof Object)&&(e=s.parse(e.input,e.config))&&t.postMessage({workerId:s.WORKER_ID,results:e,finished:!0})}),(u.prototype=Object.create(l.prototype)).constructor=u,(d.prototype=Object.create(l.prototype)).constructor=d,(f.prototype=Object.create(f.prototype)).constructor=f,(p.prototype=Object.create(l.prototype)).constructor=p,s})}))(),1),U3=nm.withProps({block:!0,variant:`wrapping`}),W3=dv.withProps({striped:!0,highlightOnHover:!0,withTableBorder:!0,withColumnBorders:!0});function G3(e){let t=H3.default.parse(e,{header:!0,skipEmptyLines:!0}),n=t.meta.fields??[];return n.length===0||t.data.length===0?null:{fields:n,rows:t.data.slice(0,100).map(e=>n.map(t=>e[t]??``)),total:t.data.length}}function K3({text:e}){let t=(0,D.useMemo)(()=>G3(e),[e]);if(!t)return(0,R.jsx)(U3,{children:e});let n=t.total>100;return(0,R.jsxs)(W3,{children:[n&&(0,R.jsx)(dv.Caption,{children:`Showing first 100 of ${t.total} rows`}),(0,R.jsx)(dv.Thead,{children:(0,R.jsx)(dv.Tr,{children:t.fields.map(e=>(0,R.jsx)(dv.Th,{children:e},e))})}),(0,R.jsx)(dv.Tbody,{children:t.rows.map((e,t)=>(0,R.jsx)(dv.Tr,{children:e.map((e,t)=>(0,R.jsx)(dv.Td,{children:e},t))},t))})]})}function q3(e){let t=(0,D.useMemo)(()=>URL.createObjectURL(e),[e]),n=(0,D.useRef)(null);return(0,D.useEffect)(()=>(n.current=t,()=>{n.current=null,queueMicrotask(()=>{n.current!==t&&URL.revokeObjectURL(t)})}),[t]),t}function J3({html:e}){let t=q3((0,D.useMemo)(()=>new Blob([I3(e)],{type:`text/html`}),[e]));return(0,R.jsx)(B,{component:`iframe`,title:`HTML preview`,src:t,sandbox:``,w:`100%`,h:400,bd:0,display:`block`})}function Y3({data:e}){let t=(0,D.useMemo)(()=>j3(e),[e]),n=q3((0,D.useMemo)(()=>t?new Blob([t],{type:`application/pdf`}):new Blob([]),[t]));return t?(0,R.jsx)(B,{component:`iframe`,title:`PDF preview`,src:`${n}#view=FitH`,w:`100%`,h:600,bd:0,display:`block`}):(0,R.jsx)(V3,{mimeType:`application/pdf`})}function X3(e,t){return`data:${e};base64,${t}`}var Z3=wd.withProps({pos:`relative`,direction:`column`}),Q3=wd.withProps({pos:`absolute`,top:4,right:4}),$3=wd.withProps({className:`markdown-content`,direction:`column`}),e6=dm.withProps({alt:`Content preview`,maw:400,radius:`md`}),t6=nm.withProps({block:!0,p:36}),n6={a:({href:e,children:t})=>R3(e)?(0,R.jsx)(`a`,{href:e,children:t}):(0,R.jsx)(`span`,{children:t})};function r6({copyable:e,copyValue:t,children:n}){return(0,R.jsx)(W,{gap:`xs`,children:(0,R.jsxs)(Z3,{children:[n,e&&(0,R.jsx)(Q3,{children:(0,R.jsx)(h3,{value:t})})]})})}function i6({text:e,copyable:t}){return(0,R.jsx)(r6,{copyable:t,copyValue:e,children:(0,R.jsx)($3,{children:(0,R.jsx)(Z1,{remarkPlugins:[t3],components:n6,children:e})})})}function a6({code:e,language:t,copyValue:n,copyable:r}){return(0,R.jsx)(r6,{copyable:r,copyValue:n,children:(0,R.jsx)(p3,{language:t,code:e})})}function o6({text:e,copyable:t,wrap:n}){let r=N3(e)?M3(e):e;return(0,R.jsx)(r6,{copyable:t,copyValue:e,children:(0,R.jsx)(t6,{tabIndex:0,variant:n?`wrapping`:`nowrap`,title:n?void 0:r,children:r})})}function s6({text:e,mimeType:t,copyable:n,wrap:r}){switch(t?T3(t):`text`){case`markdown`:return(0,R.jsx)(i6,{text:e,copyable:n});case`json`:return(0,R.jsx)(a6,{code:M3(e),language:`json`,copyValue:e,copyable:n});case`xml`:return(0,R.jsx)(a6,{code:P3(e),language:`xml`,copyValue:e,copyable:n});case`css`:return(0,R.jsx)(a6,{code:e,language:`css`,copyValue:e,copyable:n});case`csv`:return(0,R.jsx)(W,{gap:`xs`,children:(0,R.jsx)(K3,{text:e})});case`html`:return(0,R.jsx)(W,{gap:`xs`,children:(0,R.jsx)(J3,{html:e})});default:return(0,R.jsx)(o6,{text:e,copyable:n,wrap:r})}}function c6({data:e,mimeType:t}){return(0,R.jsx)(W,{gap:`xs`,children:(0,R.jsx)(e6,{src:X3(t,e)})})}function l6({data:e,mimeType:t}){return(0,R.jsx)(W,{gap:`xs`,children:(0,R.jsx)(`audio`,{controls:!0,children:(0,R.jsx)(`source`,{src:X3(t,e)})})})}function u6({contents:e,mimeType:t,copyable:n,wrap:r}){if(`text`in e)return(0,R.jsx)(s6,{text:e.text,mimeType:t,copyable:n,wrap:r});let i=T3(t);if(i===`image`)return(0,R.jsx)(c6,{data:e.blob,mimeType:t});if(i===`audio`)return(0,R.jsx)(l6,{data:e.blob,mimeType:t});if(i===`pdf`)return(0,R.jsx)(W,{gap:`xs`,children:(0,R.jsx)(Y3,{data:e.blob})});if(D3(i)){let i=A3(e.blob);return i===null?(0,R.jsx)(V3,{mimeType:t}):(0,R.jsx)(s6,{text:i,mimeType:t,copyable:n,wrap:r})}return(0,R.jsx)(V3,{mimeType:t})}function d6({block:e,mimeType:t,copyable:n,wrap:r}){switch(e.type){case`text`:return(0,R.jsx)(s6,{text:e.text,mimeType:t,copyable:n,wrap:r});case`image`:return(0,R.jsx)(c6,{data:e.data,mimeType:e.mimeType});case`audio`:return(0,R.jsx)(l6,{data:e.data,mimeType:e.mimeType});case`resource`:return(0,R.jsx)(W,{gap:`xs`,children:(0,R.jsx)(Z3,{children:(0,R.jsx)(t6,{children:`text`in e.resource?e.resource.text:`[blob: ${e.resource.uri}]`})})});case`resource_link`:return(0,R.jsx)(C3,{uri:e.uri,name:e.name,mimeType:e.mimeType});default:return null}}function f6({block:e,contents:t,copyable:n=!1,mimeType:r,wrap:i=!0}){if(t){let e=r??t.mimeType??`application/octet-stream`;return(0,R.jsx)(u6,{contents:t,mimeType:e,copyable:n,wrap:i})}return e?(0,R.jsx)(d6,{block:e,mimeType:r,copyable:n,wrap:i}):null}var p6=H.withProps({justify:`space-between`,wrap:`nowrap`}),m6=H.withProps({gap:`sm`,wrap:`nowrap`,miw:0,flex:1}),h6=H.withProps({gap:`sm`,mih:30}),g6=H.withProps({gap:`sm`,wrap:`nowrap`}),_6=H.withProps({gap:`xs`}),v6=U.withProps({fw:600,size:`lg`,truncate:`end`,miw:0,flex:1}),y6=U.withProps({size:`sm`,c:`dimmed`}),b6=U.withProps({size:`sm`,c:`dimmed`,ml:`auto`}),x6=qp.withProps({variant:`subtle`,size:`xs`}),S6={root:{"--inspector-code-surface":`var(--inspector-surface-code-oncard)`}},C6=qp.withProps({variant:`subtle`,size:`xs`,color:`red.6`,c:`var(--inspector-danger-text)`});function w6(e){return e.type??`stdio`}var Aie={stdio:`Standard I/O`,sse:`SSE (Server Sent Events) [deprecated]`,"streamable-http":`Streamable HTTP`};function jie(e){if(e.type===`sse`||e.type===`streamable-http`)return e.url;let t=e.args??[];return t.length>0?`${e.command} ${t.join(` `)}`:e.command}function T6({id:e,name:t,config:n,info:r,connection:i,activeServer:a,onToggleConnection:o,onConnectionInfo:s,onSettings:c,onEdit:l,onClone:u,onRemove:d,compact:f=!1,writable:p=!0,dragHandle:m,highlighted:h=!1,errored:g=!1,justConnected:_=!1,scrollOnHighlight:v=!0,onClearHighlight:y}){let b=a!==void 0&&a!==e,x=(0,D.useRef)(null);(0,D.useEffect)(()=>{h&&v&&x.current?.scrollIntoView({behavior:`smooth`,block:`center`})},[h,v]);let S=(0,D.useRef)(g);(0,D.useEffect)(()=>{let e=g&&!S.current;if(S.current=g,!e)return;let t=setTimeout(()=>{x.current?.scrollIntoView({behavior:`smooth`,block:`center`})},320);return()=>clearTimeout(t)},[g]);let C=(0,D.useRef)(_);(0,D.useEffect)(()=>{let e=_&&!C.current;if(C.current=_,!e)return;let t=setTimeout(()=>{x.current?.scrollIntoView({behavior:`smooth`,block:`center`})},320);return()=>clearTimeout(t)},[_]);let w=w6(n),T=jie(n),E=r?.version,O=i.status===`connected`?i.protocolVersion:void 0;return(0,R.jsx)($p,{ref:x,variant:b?`disabled`:g?`errored`:h||_?`highlighted`:void 0,styles:S6,onClick:h?y:void 0,...b?{"aria-disabled":!0,inert:!0}:{},children:(0,R.jsxs)(W,{gap:`sm`,children:[(0,R.jsxs)(p6,{children:[(0,R.jsxs)(m6,{children:[m,(0,R.jsx)(v6,{children:t})]}),(0,R.jsxs)(g6,{children:[(0,R.jsx)(dW,{status:i.status,retryCount:i.retryCount,failed:g,showLabel:!0}),(0,R.jsx)(fJ,{status:i.status,disabled:b,onToggle:()=>o(e),"aria-label":`Connect or disconnect "${t}"`})]})]}),!f&&(0,R.jsxs)(R.Fragment,{children:[(0,R.jsxs)(h6,{children:[E&&(0,R.jsx)(Rp,{variant:`outline`,children:E}),(0,R.jsx)(dJ,{transport:w}),(0,R.jsx)(y6,{children:Aie[w]}),O&&(0,R.jsxs)(b6,{children:[`MCP `,O]})]}),(0,R.jsx)(f6,{block:{type:`text`,text:T},copyable:!0,wrap:!1}),(0,R.jsxs)(H,{justify:`space-between`,children:[(0,R.jsx)(_6,{children:p&&(0,R.jsxs)(R.Fragment,{children:[(0,R.jsx)(x6,{onClick:()=>u(e),children:`Clone`}),(0,R.jsx)(x6,{onClick:()=>l(e),children:`Edit`}),(0,R.jsx)(C6,{onClick:()=>d(e),children:`Remove`})]})}),(0,R.jsxs)(_6,{children:[i.status===`connected`&&(0,R.jsx)(x6,{onClick:()=>s(e),children:`Connection Info`}),p&&(0,R.jsx)(x6,{onClick:()=>c(e),children:`Settings`})]})]})]})]})})}function E6(e){return YU({tag:`svg`,attr:{viewBox:`0 0 24 24`,fill:`currentColor`},child:[{tag:`path`,attr:{d:`M12 22C6.47715 22 2 17.5228 2 12C2 6.47715 6.47715 2 12 2C17.5228 2 22 6.47715 22 12C22 17.5228 17.5228 22 12 22ZM12 20C16.4183 20 20 16.4183 20 12C20 7.58172 16.4183 4 12 4C7.58172 4 4 7.58172 4 12C4 16.4183 7.58172 20 12 20ZM11 15H13V17H11V15ZM11 7H13V13H11V7Z`},child:[]}]})(e)}function Mie(e){return YU({tag:`svg`,attr:{viewBox:`0 0 24 24`,fill:`currentColor`},child:[{tag:`path`,attr:{d:`M8.5 7C9.32843 7 10 6.32843 10 5.5C10 4.67157 9.32843 4 8.5 4C7.67157 4 7 4.67157 7 5.5C7 6.32843 7.67157 7 8.5 7ZM8.5 13.5C9.32843 13.5 10 12.8284 10 12C10 11.1716 9.32843 10.5 8.5 10.5C7.67157 10.5 7 11.1716 7 12C7 12.8284 7.67157 13.5 8.5 13.5ZM10 18.5C10 19.3284 9.32843 20 8.5 20C7.67157 20 7 19.3284 7 18.5C7 17.6716 7.67157 17 8.5 17C9.32843 17 10 17.6716 10 18.5ZM15.5 7C16.3284 7 17 6.32843 17 5.5C17 4.67157 16.3284 4 15.5 4C14.6716 4 14 4.67157 14 5.5C14 6.32843 14.6716 7 15.5 7ZM17 12C17 12.8284 16.3284 13.5 15.5 13.5C14.6716 13.5 14 12.8284 14 12C14 11.1716 14.6716 10.5 15.5 10.5C16.3284 10.5 17 11.1716 17 12ZM15.5 20C16.3284 20 17 19.3284 17 18.5C17 17.6716 16.3284 17 15.5 17C14.6716 17 14 17.6716 14 18.5C14 19.3284 14.6716 20 15.5 20Z`},child:[]}]})(e)}function D6(e){return YU({tag:`svg`,attr:{viewBox:`0 0 24 24`,fill:`currentColor`},child:[{tag:`path`,attr:{d:`M11.9995 0.499512L16.9492 5.44926L15.535 6.86347L12.9995 4.32794V9.99951H10.9995L10.9995 4.32794L8.46643 6.86099L7.05222 5.44678L11.9995 0.499512ZM10.9995 13.9995L10.9995 19.6704L8.46448 17.1353L7.05026 18.5496L12 23.4995L16.9497 18.5498L15.5355 17.1356L12.9995 19.6716V13.9995H10.9995Z`},child:[]}]})(e)}function O6(e){return YU({tag:`svg`,attr:{viewBox:`0 0 24 24`,fill:`currentColor`},child:[{tag:`path`,attr:{d:`M11.9995 13.4995 16.9492 18.4493 15.535 19.8635 12.9995 17.3279 12.9995 22.9995H10.9995L10.9995 17.3279 8.46643 19.861 7.05222 18.4468 11.9995 13.4995ZM10.9995.999512 10.9995 6.67035 8.46448 4.13535 7.05026 5.54956 12 10.4995 16.9497 5.54977 15.5355 4.13555 12.9995 6.67157V.999512L10.9995.999512Z`},child:[]}]})(e)}function k6(e){return YU({tag:`svg`,attr:{viewBox:`0 0 24 24`,fill:`currentColor`},child:[{tag:`path`,attr:{d:`M13.1717 12.0007L8.22192 7.05093L9.63614 5.63672L16.0001 12.0007L9.63614 18.3646L8.22192 16.9504L13.1717 12.0007Z`},child:[]}]})(e)}function A6(e){return YU({tag:`svg`,attr:{viewBox:`0 0 24 24`,fill:`currentColor`},child:[{tag:`path`,attr:{d:`M11.9999 13.1714L16.9497 8.22168L18.3639 9.63589L11.9999 15.9999L5.63599 9.63589L7.0502 8.22168L11.9999 13.1714Z`},child:[]}]})(e)}var Nie=Cu.withProps({variant:`subtle`,color:`gray`,size:`md`}),Pie=Cu.withProps({variant:`subtle`,size:36});function j6({compact:e,onToggle:t,variant:n=`default`}){let r=e?D6:O6,i=e?`Expand all`:`Collapse all`;return n===`subtle`?(0,R.jsx)(k_,{label:i,children:(0,R.jsx)(Nie,{"aria-label":i,onClick:t,children:(0,R.jsx)(r,{size:16})})}):(0,R.jsx)(k_,{label:i,children:(0,R.jsx)(Pie,{"aria-label":i,onClick:t,children:(0,R.jsx)(r,{size:20})})})}function Fie({onAddManually:e,onImportConfig:t,onImportServerJson:n}){let r=A6;return(0,R.jsxs)(th,{children:[(0,R.jsx)(th.Target,{children:(0,R.jsx)(qp,{rightSection:(0,R.jsx)(r,{size:20}),children:`Add Servers`})}),(0,R.jsxs)(th.Dropdown,{children:[(0,R.jsx)(th.Item,{onClick:e,children:`+ Add manually`}),(0,R.jsx)(th.Item,{onClick:t,children:`Import from client config`}),(0,R.jsx)(th.Item,{onClick:n,children:`Import from registry config`})]})]})}var Iie=H.withProps({justify:`flex-end`,gap:`sm`});function Lie({compact:e,serverCount:t,onToggleList:n,onAddManually:r,onImportConfig:i,onImportServerJson:a,onExport:o,writable:s=!0}){return(0,R.jsxs)(Iie,{children:[(0,R.jsx)(qp,{variant:`default`,onClick:o,disabled:t===0,children:`Export`}),s&&(0,R.jsx)(Fie,{onAddManually:r,onImportConfig:i,onImportServerJson:a}),t>0&&(0,R.jsx)(j6,{compact:e,onToggle:n})]})}var Rie=Cu.withProps({variant:`subtle`,color:`gray`,size:`md`,className:`server-drag-handle`});function zie(e){let{attributes:t,listeners:n,setNodeRef:r,setActivatorNodeRef:i,transform:a,transition:o,isDragging:s}=nJ({id:e.id}),c=(0,R.jsx)(Rie,{ref:i,"aria-label":`Reorder ${e.name}`,...t,...n,children:(0,R.jsx)(Mie,{size:16})});return(0,R.jsx)(B,{ref:r,style:{transform:gG.Transform.toString(a),transition:o,zIndex:s?2:void 0,opacity:s?.85:void 0},children:(0,R.jsx)(T6,{...e,dragHandle:c})})}function Bie(e,t,n){if(t===n)return e;let r=e.indexOf(t),i=e.indexOf(n);return r===-1||i===-1?e:Bq(e,r,i)}function M6(e,t){return e.find(e=>e.id===t)?.name??t}function N6(e,t){return e.findIndex(e=>e.id===t)+1}function Vie(e){let t=e.length;return{onDragStart:({active:n})=>`Picked up server ${M6(e,String(n.id))}. It is in position ${N6(e,String(n.id))} of ${t}.`,onDragOver:({active:n,over:r})=>r?`Server ${M6(e,String(n.id))} moved to position ${N6(e,String(r.id))} of ${t}.`:void 0,onDragEnd:({active:n,over:r})=>r?`Server ${M6(e,String(n.id))} dropped at position ${N6(e,String(r.id))} of ${t}.`:`Server ${M6(e,String(n.id))} dropped.`,onDragCancel:({active:t})=>`Reorder cancelled. Server ${M6(e,String(t.id))} returned to its original position.`}}function Hie(e,t){return({active:n,over:r})=>{if(!r||n.id===r.id)return;let i=e.map(e=>e.id),a=Bie(i,String(n.id),String(r.id));a!==i&&t?.(a)}}var Uie=wd.withProps({variant:`screen`,direction:`column`,h:`calc(100dvh - var(--app-shell-header-height, 0px) - var(--app-shell-footer-height, 0px))`,gap:`md`,p:`xl`}),Wie=El.withProps({withBorder:!0,p:`lg`,flex:1,variant:`panel`,bg:`var(--mantine-color-body)`}),Gie=H.withProps({justify:`space-between`,mb:`sm`}),Kie=W.withProps({flex:1,mih:0,gap:0}),qie=W.withProps({flex:1,align:`center`,justify:`center`}),Jie=U.withProps({c:`dimmed`,ta:`center`}),Yie={root:{"--inspector-surface-card":`var(--inspector-surface-card-server)`,alignItems:`start`}},Xie=Gd.withProps({color:`gray`,variant:`light`,title:`Read-only session`}),Zie=Sv.withProps({order:3,size:`h4`}),Qie=L_.withProps({type:`container`,cols:{base:1,"1040px":2,"1560px":3},spacing:`lg`,styles:Yie}),$ie=_l.Autosize.withProps({mah:`100%`,type:`scroll`,offsetScrollbars:!0});function eae({servers:e,writable:t=!0,activeServer:n,erroredServerId:r,connectedServerId:i,onAddManually:a,onImportConfig:o,onImportServerJson:s,onExport:c,onToggleConnection:l,onConnectionInfo:u,onSettings:d,onEdit:f,onClone:p,onRemove:m,onReorder:h,highlightedServerIds:g,onClearHighlight:_,compact:v,onToggleCompact:y}){let b=MG(jG(PK),jG(kK,{coordinateGetter:oJ})),x=e.map(e=>e.id),S=h!==void 0&&t,C=S?Hie(e,h):void 0,w=S?Vie(e):void 0,T=e.find(e=>g?.includes(e.id))?.id,E=e=>({compact:v,writable:t,activeServer:n,onToggleConnection:l,onConnectionInfo:u,onSettings:d,onEdit:f,onClone:p,onRemove:m,highlighted:g?.includes(e.id)??!1,errored:e.id===r,justConnected:e.id===i,scrollOnHighlight:e.id===T,onClearHighlight:_?()=>_(e.id):void 0,...e}),D=(0,R.jsx)(Qie,{children:e.map(e=>S?(0,R.jsx)(zie,{...E(e)},e.id):(0,R.jsx)(T6,{...E(e)},e.id))});return(0,R.jsxs)(Uie,{children:[!t&&(0,R.jsxs)(Xie,{children:[`This server list was launched with `,(0,R.jsx)(nm,{children:`--config`}),` or an ad-hoc server and can't be edited here. Changes won't be saved. Use`,` `,(0,R.jsx)(nm,{children:`--catalog`}),` (or no flag) to manage a writable catalog.`]}),(0,R.jsxs)(Wie,{children:[(0,R.jsxs)(Gie,{children:[(0,R.jsx)(Zie,{children:`Servers`}),(0,R.jsx)(Lie,{serverCount:e.length,compact:v,writable:t,onToggleList:y,onAddManually:a,onImportConfig:o,onImportServerJson:s,onExport:c})]}),e.length===0?(0,R.jsx)(qie,{children:(0,R.jsx)(Jie,{children:`No servers configured. Add a server to get started.`})}):(0,R.jsx)(Kie,{children:(0,R.jsx)($ie,{children:S?(0,R.jsx)(jq,{sensors:b,collisionDetection:BG,onDragEnd:C,accessibility:{announcements:w},children:(0,R.jsx)(Jq,{items:x,strategy:Gq,children:D})}):D})})]})]})}var P6=Ou.withProps({"aria-label":`Clear`,tabIndex:-1}),tae=El.withProps({w:8,h:8,radius:`xl`,bg:`var(--inspector-status-connecting)`}),nae=U.withProps({size:`sm`,c:`dimmed`}),rae=qp.withProps({size:`sm`,variant:`subtle`});function F6({visible:e,onRefresh:t}){return e?(0,R.jsxs)(H,{gap:`xs`,children:[(0,R.jsx)(tae,{}),(0,R.jsx)(nae,{children:`List updated`}),(0,R.jsx)(rae,{onClick:t,children:`Refresh`})]}):null}var iae=Gd.withProps({color:`red`,variant:`light`}),aae=nm.withProps({block:!0,variant:`wrapping`}),oae=_l.withProps({mah:180,type:`auto`}),sae=qp.withProps({size:`xs`,variant:`light`,color:`red`,w:`fit-content`});function I6({error:e,what:t,onRetry:n}){return e?(0,R.jsx)(iae,{title:`Couldn't load ${t}`,children:(0,R.jsxs)(W,{gap:`xs`,children:[(0,R.jsx)(oae,{children:(0,R.jsx)(aae,{children:e.message})}),n&&(0,R.jsx)(sae,{onClick:n,children:`Retry`})]})}):null}var cae=H.withProps({gap:`sm`,align:`center`,justify:`space-between`,wrap:`nowrap`}),lae=K_.withProps({size:`sm`,"aria-label":`Fetch lists one page at a time`}),uae=qp.withProps({size:`compact-sm`,variant:`light`}),dae=U.withProps({size:`xs`,ta:`center`,c:`var(--inspector-text-secondary)`});function L6({paginated:e,onPaginatedChange:t,canLoadMore:n,loadedPages:r,onLoadMore:i}){return e&&!n&&r===1?null:(0,R.jsxs)(W,{gap:4,children:[(0,R.jsxs)(cae,{children:[(0,R.jsx)(lae,{label:`Paginated`,checked:e,onChange:e=>t(e.currentTarget.checked)}),e?(0,R.jsx)(uae,{disabled:!n,onClick:i,children:`Load next page`}):null]}),e?(0,R.jsxs)(dae,{children:[r,` `,r===1?`page`:`pages`,` loaded`,n?``:` · end`]}):null]})}function R6(e,t){return t??e}function z6(e){return Object.keys(e.inputSchema.properties??{}).length>0}var fae=U.withProps({fw:500,truncate:!0}),pae=U.withProps({size:`xs`,c:`dimmed`,truncate:!0}),mae=W.withProps({gap:2,flex:1,miw:0}),hae=H.withProps({gap:`sm`,wrap:`nowrap`,align:`flex-start`}),gae=dm.withProps({w:20,h:20,fit:`contain`}),_ae=xl.withProps({w:`100%`,p:`sm`,variant:`listItem`});function vae({tool:e,selected:t,onClick:n}){let{name:r,title:i,icons:a}=e,o=a?.[0]?.src;return(0,R.jsx)(_ae,{bg:t?`var(--mantine-primary-color-light)`:void 0,onClick:n,children:(0,R.jsxs)(hae,{children:[o&&(0,R.jsx)(gae,{src:o,alt:``}),(0,R.jsxs)(mae,{children:[(0,R.jsx)(fae,{children:R6(r,i)}),i&&(0,R.jsx)(pae,{children:r})]})]})})}var B6=new Map;function yae(){B6.clear()}function V6(e){let t=(0,D.useRef)(null);return(0,D.useLayoutEffect)(()=>{let n=t.current;if(!n)return;let r=B6.get(e);return r&&n.scrollTo({left:r.x,top:r.y}),()=>{B6.set(e,{x:n.scrollLeft,y:n.scrollTop})}},[e]),t}var bae=H.withProps({gap:`xs`,wrap:`nowrap`,align:`center`}),xae=hv.withProps({size:`sm`,variant:`transparent`,c:`var(--inspector-log-warning)`,"aria-hidden":!0}),Sae=U.withProps({size:`sm`,td:`line-through`,c:`var(--inspector-text-secondary)`,truncate:`end`}),Cae=W.withProps({gap:`sm`,flex:1,mih:0}),wae=Sv.withProps({order:3,size:`h4`}),Tae=fv.withProps({placeholder:`Search tools...`,rightSectionPointerEvents:`auto`}),Eae=_l.withProps({flex:1,mih:0}),Dae=cm.withProps({label:`Excluded (SEP-2243)`,labelPosition:`left`,mt:`sm`}),Oae=k_.withProps({multiline:!0,w:280,withArrow:!0,position:`right`}),H6=(e,t)=>`${t}:${e}`,U6=(e,t)=>e.name.toLowerCase().includes(t)||(e.title?.toLowerCase().includes(t)??!1);function kae({tools:e,excludedTools:t=[],selectedName:n,searchText:r=``,listChanged:i,onRefreshList:a,loadError:o,pagination:s,onSearchChange:c,onSelectTool:l}){let u=V6(`tools-sidebar`),d=r.toLowerCase(),f=e.map((e,t)=>({tool:e,key:H6(e.name,t)})).filter(({tool:e})=>!r||U6(e,d)),p=t.map((e,t)=>({...e,key:H6(e.tool.name,t)})).filter(({tool:e})=>!r||U6(e,d));return(0,R.jsxs)(Cae,{children:[(0,R.jsxs)(H,{justify:`space-between`,children:[(0,R.jsx)(wae,{children:`Tools`}),(0,R.jsx)(F6,{visible:i,onRefresh:a})]}),(0,R.jsx)(Tae,{value:r,onChange:e=>c(e.currentTarget.value),rightSection:r?(0,R.jsx)(P6,{onClick:()=>c(``)}):null}),(0,R.jsx)(L6,{...s}),(0,R.jsx)(I6,{error:o,what:`tools`,onRetry:a}),(0,R.jsx)(Eae,{viewportRef:u,children:(0,R.jsxs)(W,{gap:`xs`,children:[f.map(({tool:e,key:t})=>(0,R.jsx)(vae,{tool:e,selected:e.name===n,onClick:()=>{e.name!==n&&l(e.name)}},t)),p.length>0&&(0,R.jsxs)(R.Fragment,{children:[(0,R.jsx)(Dae,{}),p.map(({tool:e,reason:t,key:n})=>(0,R.jsx)(Oae,{label:t,children:(0,R.jsxs)(bae,{children:[(0,R.jsx)(xae,{children:(0,R.jsx)(E6,{})}),(0,R.jsx)(Sae,{children:e.name})]})},n))]})]})})]})}function W6(e){return typeof e!=`object`||!e||Array.isArray(e)?null:e}function G6(e){let t=e.properties??{},n={};for(let[e,r]of Object.entries(t))if(r.default!==void 0)n[e]=r.default;else if(r.type===`object`&&r.properties){let t=G6(r);Object.keys(t).length>0&&(n[e]=t)}return n}function K6(e,t){return(e.required??[]).some(e=>{let n=t[e];return n==null||n===``})}function q6(e){return e===`yellow`?`yellow.5`:e===`orange`?`orange.5`:e}var Aae={audience:`blue`,priority:`orange`,readOnlyHint:`green`,destructiveHint:`red`,idempotentHint:`teal`,openWorldHint:`grape`,longRunHint:`yellow`},jae=Rp.withProps({variant:`filled`,fw:500,autoContrast:!0});function Mae(e,t){switch(e){case`audience`:return`audience: ${t.join(`, `)}`;case`priority`:{let e=t;return e>=.7?`priority: high`:e>=.4?`priority: medium`:`priority: low`}case`readOnlyHint`:return`read-only`;case`destructiveHint`:return`destructive`;case`idempotentHint`:return`idempotent`;case`openWorldHint`:return`open-world`;case`longRunHint`:return`long-running`}}function J6({facet:e,value:t}){let n=q6(Aae[e]);return(0,R.jsx)(jae,{color:n,children:Mae(e,t)})}function Nae(e,t){return t!=null&&t>0?Math.round(e/t*100):e}function Pae(e){return`${e}%`}var Y6=U.withProps({size:`sm`,c:`dimmed`}),Fae=U.withProps({size:`xs`,c:`dimmed`});function X6({params:e,elapsed:t}){let n=Nae(e.progress,e.total);return(0,R.jsxs)(W,{gap:`xs`,children:[(0,R.jsxs)(H,{justify:`space-between`,children:[e.message&&(0,R.jsx)(Y6,{children:e.message}),(0,R.jsx)(Y6,{children:Pae(n)})]}),(0,R.jsx)(Yg,{value:n,size:`sm`,"aria-label":e.message?`${e.message} progress`:`Progress`}),t&&(0,R.jsx)(Fae,{children:t})]})}function Z6(e,t){let[n,r]=(0,D.useState)(e);Object.is(n,e)||(r(e),t(e))}var Iae=U.withProps({fw:500,size:`sm`}),Lae=U.withProps({size:`xs`,c:`dimmed`}),Rae=W.withProps({gap:`sm`,pl:`md`}),zae=Nm.withProps({formatOnBlur:!0,autosize:!0});function Bae(e){return JSON.stringify(e,null,2)}function Q6(e,t){return t&&t.length===e.length?e.map((e,n)=>({value:e,label:t[n]})):e}function $6(e){if(typeof e==`number`)return Number.isFinite(e)?e:void 0;if(e.trim()===``)return;let t=Number(e);if(Number.isFinite(t))return Number.isSafeInteger(Math.trunc(t))?t:void 0}function Vae({value:e,onChange:t,...n}){let[r,i]=(0,D.useState)(e??``);return Z6(e,e=>{Object.is($6(r),e)||i(e??``)}),(0,R.jsx)(Bg,{...n,value:r,onChange:e=>{i(e),t($6(e))}})}function Hae(e){if(e.default!==void 0)return e.default}function Uae(e,t){return e===void 0?Hae(t):e}function e8({schema:e,values:t,onChange:n,disabled:r=!1,resetKey:i}){let a=e.properties??{},o=e.required??[];function s(e,r){n({...t,[e]:r})}function c(e,n){let a=o.includes(e),c=n.title??e,l=n.description,u=Uae(t[e],n);if(n.type===`string`&&n.enum)return(0,R.jsx)(P_,{label:c,description:l,withAsterisk:a,disabled:r,data:Q6(n.enum,n.enumNames),value:u??null,onChange:t=>s(e,t)},e);if(n.type===`string`&&n.oneOf){let t=n.oneOf.map(e=>({value:String(e.const??``),label:e.title??String(e.const??``)}));return(0,R.jsx)(P_,{label:c,description:l,withAsterisk:a,disabled:r,data:t,value:u??null,onChange:t=>s(e,t)},e)}if(n.type===`string`)return(0,R.jsx)(fv,{label:c,description:l,withAsterisk:a,disabled:r,value:u??``,minLength:n.minLength,maxLength:n.maxLength,onChange:t=>s(e,t.currentTarget.value),rightSectionPointerEvents:`auto`,rightSection:u?(0,R.jsx)(P6,{onClick:()=>s(e,``)}):null},e);if(n.type===`number`||n.type===`integer`)return(0,R.jsx)(Vae,{label:c,description:l,withAsterisk:a,disabled:r,value:u,min:n.minimum,max:n.maximum,allowDecimal:n.type===`number`,onChange:t=>s(e,t)},i===void 0?e:`${i}:${e}`);if(n.type===`boolean`)return(0,R.jsx)(Dp,{label:c,description:l,disabled:r,checked:u??!1,onChange:t=>s(e,t.currentTarget.checked)},e);if(n.type===`array`&&n.items?.enum){let t=Q6(n.items.enum,n.items.enumNames);return(0,R.jsx)(Ih,{label:c,description:l,withAsterisk:a,disabled:r,data:t,value:u??[],onChange:t=>s(e,t)},e)}if(n.type===`array`&&n.items?.anyOf){let t=n.items.anyOf.map(e=>({value:String(e.const??``),label:e.title??String(e.const??``)}));return(0,R.jsx)(Ih,{label:c,description:l,withAsterisk:a,disabled:r,data:t,value:u??[],onChange:t=>s(e,t)},e)}return n.type===`object`&&n.properties?(0,R.jsxs)(W,{gap:`sm`,children:[(0,R.jsx)(Iae,{children:c}),l&&(0,R.jsx)(Lae,{children:l}),(0,R.jsx)(Rae,{children:(0,R.jsx)(e8,{schema:n,values:u??{},onChange:t=>s(e,t),disabled:r,resetKey:i})})]},e):(0,R.jsx)(zae,{label:c,description:l,withAsterisk:a,disabled:r,value:u===void 0?``:Bae(u),onChange:t=>{try{s(e,JSON.parse(t))}catch{s(e,t)}}},e)}return(0,R.jsx)(W,{gap:`sm`,children:Object.entries(a).map(([e,t])=>c(e,t))})}var Wae=W.withProps({gap:`md`,miw:0,mih:0}),Gae=W.withProps({gap:`md`,flex:`0 0 auto`}),Kae=_l.withProps({flex:`0 1 auto`,miw:0,mih:0,type:`auto`,scrollbars:`y`,offsetScrollbars:!0}),qae=W.withProps({gap:`md`}),Jae=H.withProps({justify:`flex-start`,flex:`0 0 auto`}),Yae=H.withProps({gap:`sm`,wrap:`nowrap`,align:`center`,miw:0}),Xae=dm.withProps({w:24,h:24,fit:`contain`}),Zae=U.withProps({fw:700,size:`lg`,truncate:`end`,flex:1}),Qae=Cu.withProps({variant:`subtle`,color:`gray`,size:`sm`}),$ae=U.withProps({size:`sm`,c:`dimmed`}),eoe=qp.withProps({variant:`subtle`,color:`red`}),toe=H.withProps({justify:`flex-start`,flex:`0 0 auto`}),noe=K_.withProps({size:`sm`,label:`Run as task`}),roe=W.withProps({gap:`xs`}),ioe=U.withProps({size:`sm`,fw:600}),aoe=U.withProps({size:`xs`,c:`var(--inspector-text-secondary)`}),ooe=H.withProps({gap:`xs`,wrap:`nowrap`}),soe=U.withProps({size:`sm`,c:`var(--inspector-text-secondary)`});function coe(e){return e.execution?.taskSupport??`forbidden`}function loe(e){return!!(e&&(e.readOnlyHint||e.destructiveHint||e.idempotentHint||e.openWorldHint))}function uoe({tool:e,formValues:t,isExecuting:n,progress:r,serverSupportsTaskToolCalls:i,modernTasks:a=!1,runAsTask:o,onRunAsTaskChange:s,onFormChange:c,onExecute:l,onCancel:u}){let{name:d,title:f,description:p,icons:m,annotations:h,inputSchema:g}=e,_=W6(g)??{},v=m?.[0]?.src,y=Wne(e),[b,x]=(0,D.useState)(!0),[S,C]=(0,D.useState)(d);d!==S&&(C(d),x(!0));let w=(0,D.useId)(),T=coe(e),E=i&&(a||T!==`forbidden`),O=E&&(T===`required`||(T===`optional`||a)&&o);return(0,R.jsxs)(Wae,{children:[(0,R.jsxs)(Gae,{children:[(0,R.jsxs)(Yae,{children:[v&&(0,R.jsx)(Xae,{src:v,alt:``}),(0,R.jsx)(Zae,{children:R6(d,f)}),p&&(0,R.jsx)(Qae,{"aria-label":b?`Hide description`:`Show description`,"aria-expanded":b,"aria-controls":w,onClick:()=>x(e=>!e),children:b?(0,R.jsx)(A6,{}):(0,R.jsx)(k6,{})})]}),loe(h)&&h&&(0,R.jsxs)(H,{gap:`xs`,children:[h.readOnlyHint&&(0,R.jsx)(J6,{facet:`readOnlyHint`,value:!0}),h.destructiveHint&&(0,R.jsx)(J6,{facet:`destructiveHint`,value:!0}),h.idempotentHint&&(0,R.jsx)(J6,{facet:`idempotentHint`,value:!0}),h.openWorldHint&&(0,R.jsx)(J6,{facet:`openWorldHint`,value:!0})]})]}),(0,R.jsx)(Kae,{children:(0,R.jsxs)(qae,{children:[p&&(0,R.jsx)(oa,{in:b,id:w,children:(0,R.jsx)($ae,{children:p})}),(0,R.jsx)(cm,{}),y.length>0&&(0,R.jsxs)(roe,{children:[(0,R.jsx)(ioe,{children:`Mirrored request headers (SEP-2243)`}),y.map(e=>(0,R.jsxs)(ooe,{children:[(0,R.jsx)(nm,{children:e.path}),(0,R.jsx)(soe,{children:`→`}),(0,R.jsx)(nm,{children:e.header})]},e.path)),(0,R.jsxs)(aoe,{children:[`These argument values are mirrored into HTTP headers on the call. In the web client the `,(0,R.jsx)(nm,{children:`Mcp-Param-*`}),` headers are applied by the Node backend that issues the upstream request.`]})]}),(0,R.jsx)(e8,{schema:_,values:t,onChange:c,disabled:n,resetKey:d}),r&&(0,R.jsx)(X6,{params:r})]})}),E&&(0,R.jsx)(toe,{children:(0,R.jsx)(noe,{checked:O,disabled:n||T===`required`,onChange:e=>s(e.currentTarget.checked)})}),(0,R.jsxs)(Jae,{children:[(0,R.jsx)(qp,{size:`md`,onClick:()=>l(O),disabled:n,loading:n,children:`Execute Tool`}),n&&(0,R.jsx)(eoe,{onClick:u,children:`Cancel`})]})]})}var doe=Cu.withProps({variant:`subtle`,color:`gray`,size:`md`});function t8({expanded:e,onToggle:t,ariaLabel:n}){let r=e?O6:D6,i=e?`Collapse`:`Expand`;return(0,R.jsx)(k_,{label:i,children:(0,R.jsx)(doe,{"aria-label":n??i,"aria-expanded":e,onClick:t,children:(0,R.jsx)(r,{size:16})})})}var foe=$p.withProps({withBorder:!0,padding:`sm`,radius:`md`,variant:`inset`}),poe=W.withProps({gap:`xs`,mt:`xs`}),moe=_l.Autosize.withProps({mah:400,type:`auto`,scrollbars:`y`,offsetScrollbars:!0}),hoe=U.withProps({size:`sm`,c:`dimmed`}),goe=Gd.withProps({color:`red`,variant:`light`,title:`Failed to read resource`});function _oe({uri:e,name:t,mimeType:n,onReadResource:r}){let[i,a]=(0,D.useState)(!1),[o,s]=(0,D.useState)(!1),[c,l]=(0,D.useState)(null),[u,d]=(0,D.useState)(null),f=!!r;async function p(){if(r){if(i){a(!1);return}if(a(!0),c===null&&!o){d(null),s(!0);try{l(await r(e))}catch(e){d(e instanceof Error?e.message:String(e))}finally{s(!1)}}}}let m=f?(0,R.jsx)(t8,{expanded:i,onToggle:()=>void p(),ariaLabel:`${i?`Collapse`:`Expand`} resource ${e}`}):void 0;return(0,R.jsxs)(foe,{children:[(0,R.jsx)(C3,{uri:e,name:t,mimeType:n,action:m}),f&&(0,R.jsx)(oa,{in:i,children:(0,R.jsx)(poe,{children:o?(0,R.jsx)(hoe,{children:`Loading resource…`}):u===null?c===null?null:(0,R.jsx)(moe,{children:(0,R.jsx)(f6,{block:{type:`text`,text:JSON.stringify(c,null,2)},copyable:!0})}):(0,R.jsx)(goe,{children:u})})})]})}var voe=El.withProps({withBorder:!0,radius:`md`,p:`md`,variant:`panel`}),yoe=W.withProps({gap:`sm`}),boe=H.withProps({justify:`space-between`,wrap:`nowrap`}),xoe=Sv.withProps({order:4,size:`h5`}),Soe=_l.Autosize.withProps({mah:400,type:`auto`,scrollbars:`y`,offsetScrollbars:!0});function Coe({structuredContent:e,defaultExpanded:t=!0}){let[n,r]=(0,D.useState)(t);return(0,R.jsx)(voe,{children:(0,R.jsxs)(yoe,{children:[(0,R.jsxs)(boe,{children:[(0,R.jsx)(xoe,{children:`Structured Output`}),(0,R.jsx)(t8,{expanded:n,onToggle:()=>r(e=>!e),ariaLabel:`${n?`Collapse`:`Expand`} structured output`})]}),(0,R.jsx)(oa,{in:n,children:(0,R.jsx)(Soe,{children:(0,R.jsx)(f6,{block:{type:`text`,text:JSON.stringify(e,null,2)},mimeType:`application/json`,copyable:!0})})})]})})}var woe=/\b(unknown tool|no such tool)\b|\btool\b[^.!?]*\b(not found|not recognized|does not exist|is unknown|unrecognized)\b/i;function Toe(e,t){return e===zk.InvalidParams?t&&woe.test(t)?`unknown-tool`:`invalid-params`:`generic`}function n8(e){return!e.isError&&e.content.some(e=>e.type===`resource_link`)}function Eoe(e){let t=[];return e.forEach((e,n)=>{if(e.type===`resource_link`){let r=t[t.length-1];r&&r.kind===`links`?r.links.push({block:e,index:n}):t.push({kind:`links`,links:[{block:e,index:n}]})}else t.push({kind:`block`,block:e,index:n})}),t}var Doe=W.withProps({gap:`md`,miw:0,mih:0,flex:1}),Ooe=H.withProps({justify:`space-between`,flex:`0 0 auto`}),koe=H.withProps({gap:`xs`,wrap:`nowrap`}),r8=_l.withProps({flex:1,miw:0,mih:0,type:`auto`,scrollbars:`y`,offsetScrollbars:!0}),i8=W.withProps({gap:`md`}),Aoe=_l.Autosize.withProps({mah:`50%`,flex:`0 1 auto`,mih:0,type:`auto`,scrollbars:`y`,offsetScrollbars:!0}),joe=W.withProps({gap:`md`,flex:1,mih:0}),Moe=El.withProps({withBorder:!0,radius:`md`,p:`md`,variant:`panel`,flex:1,mih:0}),Noe=W.withProps({gap:`sm`,flex:1,mih:0}),Poe=Sv.withProps({order:4,size:`h5`}),Foe=_l.withProps({flex:1,mih:0,type:`auto`,scrollbars:`y`,offsetScrollbars:!0}),Ioe=W.withProps({gap:`sm`}),Loe=Sv.withProps({order:3,size:`h4`}),Roe=Gd.withProps({color:`red`,variant:`light`,title:`Tool Error`});function zoe({links:e,onReadResource:t}){return(0,R.jsx)(Moe,{children:(0,R.jsxs)(Noe,{children:[(0,R.jsx)(Poe,{children:`Resource Links`}),(0,R.jsx)(Foe,{children:(0,R.jsx)(Ioe,{children:e.map(({block:e,index:n})=>(0,R.jsx)(_oe,{uri:e.uri,name:e.name,mimeType:e.mimeType,onReadResource:t},n))})})]})})}function Boe({result:e,onClear:t,onReadResource:n}){let r=e.isError||e.content.length===0?[]:Eoe(e.content),i=n8(e),a=e.structuredContent?(0,R.jsx)(Coe,{structuredContent:e.structuredContent},`structured-output`):null,o=r.map(e=>{if(e.kind===`links`)return(0,R.jsx)(zoe,{links:e.links,onReadResource:n},`links-${e.links[0].index}`);let t=(0,R.jsx)(f6,{block:e.block,copyable:e.block.type===`text`},e.index);return i?(0,R.jsx)(Aoe,{children:t},e.index):t});return(0,R.jsxs)(Doe,{children:[(0,R.jsx)(Ooe,{children:(0,R.jsxs)(koe,{children:[(0,R.jsx)(Ou,{"aria-label":`Close results`,onClick:t}),(0,R.jsx)(Loe,{children:`Results`})]})}),e.isError?(0,R.jsx)(r8,{children:(0,R.jsxs)(i8,{children:[(0,R.jsx)(Roe,{children:e.content.filter(e=>e.type===`text`).map(e=>e.text).join(`
235
- `)}),a]})}):e.content.length===0&&!a?(0,R.jsx)(r8,{children:(0,R.jsx)(U,{c:`dimmed`,children:`No results yet`})}):i?(0,R.jsxs)(joe,{children:[o,a]}):(0,R.jsx)(r8,{children:(0,R.jsxs)(i8,{children:[o,a]})})]})}var Voe=W.withProps({gap:`md`,miw:0,mih:0,flex:1}),Hoe=H.withProps({gap:`xs`,wrap:`nowrap`,flex:`0 0 auto`}),a8=U.withProps({size:`sm`,c:`var(--inspector-text-secondary)`}),Uoe=Sv.withProps({order:3,size:`h4`}),Woe=Gd.withProps({color:`red`,variant:`light`}),Goe={"unknown-tool":`Unknown Tool`,"invalid-params":`Invalid Parameters`,generic:`Tool Error`};function Koe({error:e,errorCode:t,onClear:n}){let r=Toe(t,e);return(0,R.jsxs)(Voe,{children:[(0,R.jsxs)(Hoe,{children:[(0,R.jsx)(Ou,{"aria-label":`Close error`,onClick:n}),(0,R.jsx)(Uoe,{children:`Tool Call Failed`})]}),(0,R.jsx)(Woe,{title:Goe[r],children:(0,R.jsxs)(W,{gap:`xs`,children:[(0,R.jsx)(U,{size:`sm`,children:e}),r===`unknown-tool`&&(0,R.jsxs)(a8,{children:[`The server rejected this call with `,(0,R.jsx)(nm,{children:`-32602`}),` (Invalid params) — it does not recognize this tool. It may have been excluded for an invalid `,(0,R.jsx)(nm,{children:`x-mcp-header`}),` annotation or removed since the list was last fetched. Try refreshing the tools list.`]}),r===`invalid-params`&&(0,R.jsxs)(a8,{children:[`The server rejected this call with `,(0,R.jsx)(nm,{children:`-32602`}),` (Invalid params). Check the argument values against the tool's schema.`]})]})})]})}var o8=`calc(100dvh - var(--app-shell-header-height, 0px) - var(--app-shell-footer-height, 0px) - var(--mantine-spacing-xl) * 2)`,qoe=wd.withProps({variant:`screen`,h:`calc(100dvh - var(--app-shell-header-height, 0px) - var(--app-shell-footer-height, 0px))`,gap:`md`,p:`xl`}),Joe=W.withProps({w:360,flex:`0 0 auto`}),Yoe=$p.withProps({withBorder:!0,padding:`lg`,variant:`sidebar`}),s8=wd.withProps({flex:1,miw:0,direction:`column`,align:`stretch`}),c8=$p.withProps({withBorder:!0,padding:`lg`,variant:`preview`}),Xoe=$p.withProps({withBorder:!0,padding:`lg`}),Zoe=U.withProps({c:`dimmed`,ta:`center`,py:`xl`});function Qoe({tools:e,excludedTools:t,callState:n,ui:r,listChanged:i,serverSupportsTaskToolCalls:a,modernTasks:o=!1,onUiChange:s,onRefreshList:c,loadError:l,pagination:u,onCallTool:d,onCancelCall:f,onClearResult:p,onReadResource:m}){let{selectedToolName:h,formValues:g,search:_}=r,v=h?e.find(e=>e.name===h):void 0,y=n?.status===`pending`;return(0,R.jsxs)(qoe,{children:[(0,R.jsx)(Joe,{children:(0,R.jsx)(Yoe,{children:(0,R.jsx)(kae,{tools:e,excludedTools:t,selectedName:h,searchText:_,listChanged:i,onRefreshList:c,loadError:l,pagination:u,onSearchChange:e=>s({...r,search:e}),onSelectTool:t=>{let n=e.find(e=>e.name===t),i={};n&&(i=G6(W6(n.inputSchema)??{})),s({...r,selectedToolName:t,formValues:i})}})})}),n?.result?(0,R.jsx)(s8,{mah:o8,children:(0,R.jsx)(c8,{flex:n8(n.result)?1:void 0,children:(0,R.jsx)(Boe,{result:n.result,onClear:()=>p?.(),onReadResource:m})})}):n?.status===`error`&&n.error?(0,R.jsx)(s8,{mah:o8,children:(0,R.jsx)(c8,{children:(0,R.jsx)(Koe,{error:n.error,errorCode:n.errorCode,onClear:()=>p?.()})})}):v?(0,R.jsx)(s8,{mah:o8,children:(0,R.jsx)(c8,{children:(0,R.jsx)(uoe,{tool:v,formValues:g,isExecuting:y,progress:n?.progress,serverSupportsTaskToolCalls:a,modernTasks:o,runAsTask:r.runAsTask,onRunAsTaskChange:e=>s({...r,runAsTask:e}),onFormChange:e=>s({...r,formValues:e}),onExecute:e=>d(v.name,g,e),onCancel:()=>f?.()})})}):(0,R.jsx)(Xoe,{flex:1,children:(0,R.jsx)(Zoe,{children:`Select a tool to view details`})})]})}function l8(){if(typeof document<`u`){let e=document.documentElement.getAttribute(`data-mantine-color-scheme`);if(e===`dark`||e===`light`)return e}return typeof window<`u`&&window.matchMedia?.(`(prefers-color-scheme: dark)`).matches?`dark`:`light`}var $oe=Object.entries({"--color-background-primary":`--mantine-color-body`,"--color-background-secondary":`--inspector-surface-card`,"--color-background-tertiary":`--inspector-surface-subtle`,"--color-text-primary":`--mantine-color-text`,"--color-text-secondary":`--inspector-text-secondary`,"--color-text-inverse":`--inspector-text-inverse`,"--color-text-info":`--inspector-log-info`,"--color-text-danger":`--inspector-log-error`,"--color-text-success":`--inspector-status-connected`,"--color-text-warning":`--inspector-log-warning`,"--color-border-primary":`--inspector-border-default`,"--color-border-secondary":`--inspector-border-subtle`,"--font-sans":`--mantine-font-family`,"--font-mono":`--mantine-font-family-monospace`,"--font-text-xs-size":`--mantine-font-size-xs`,"--font-text-sm-size":`--mantine-font-size-sm`,"--font-text-md-size":`--mantine-font-size-md`,"--font-text-lg-size":`--mantine-font-size-lg`,"--border-radius-xs":`--mantine-radius-xs`,"--border-radius-sm":`--mantine-radius-sm`,"--border-radius-md":`--mantine-radius-md`,"--border-radius-lg":`--mantine-radius-lg`,"--border-radius-xl":`--mantine-radius-xl`,"--shadow-sm":`--mantine-shadow-sm`,"--shadow-md":`--mantine-shadow-md`,"--shadow-lg":`--mantine-shadow-lg`});function u8(){if(typeof document>`u`||typeof window>`u`)return;let e=window.getComputedStyle(document.documentElement),t={},n=!1;for(let[r,i]of $oe){let a=e.getPropertyValue(i).trim();a&&(t[r]=a,n=!0)}return n?{variables:t}:void 0}function d8(e){if(typeof e.getBoundingClientRect!=`function`)return;let t=e.getBoundingClientRect(),n=Math.round(t.width),r=Math.round(t.height);if(!(n<=0||r<=0))return{width:n,height:r}}function ese(e,t){let n=u8(),r=e?d8(e):void 0;return{theme:l8(),displayMode:`inline`,availableDisplayModes:[...t],...n?{styles:n}:{},...r?{containerDimensions:r}:{}}}function f8(e){return e instanceof Error?e:Error(String(e))}async function p8(e){try{await e.teardownResource({})}catch{}try{await e.close()}catch{}}function tse({sandboxPath:e,tool:t,bridgeFactory:n,onError:r,onAppStatusChange:i,onSizeChange:a,displayMode:o,onRequestDisplayMode:s,onMessage:c,onLog:l,partialInputs:u,containerRef:d,ref:f}){let p=(0,D.useRef)(null),m=(0,D.useRef)(null),h=(0,D.useRef)(!1),g=(0,D.useRef)([]),_=(0,D.useRef)(null),v=(0,D.useRef)(null),y=(0,D.useRef)(!1),b=(0,D.useRef)(0),x=(0,D.useRef)(!1),S=(0,D.useRef)(null),C=(0,D.useRef)(r),w=(0,D.useRef)(i),T=(0,D.useRef)(a),E=(0,D.useRef)(o),O=(0,D.useRef)(s),k=(0,D.useRef)(c),A=(0,D.useRef)(l),j=(0,D.useRef)(u);(0,D.useEffect)(()=>{C.current=r,w.current=i,T.current=a,E.current=o,O.current=s,k.current=c,A.current=l,j.current=u});let M=(0,D.useCallback)(()=>{let e=m.current;if(!(!e||!h.current)){for(let t of g.current)e.sendToolInputPartial({arguments:t});if(g.current=[],_.current!==null){let t=_.current;_.current=null,e.sendToolInput({arguments:t})}if(v.current!==null){let t=v.current;v.current=null,e.sendToolResult(t)}}},[]),N=(0,D.useCallback)(()=>{x.current=!0,queueMicrotask(()=>{if(!x.current)return;x.current=!1,b.current++;let e=m.current;m.current=null,h.current=!1,S.current=null,g.current=[],e&&p8(e)})},[]);return(0,D.useEffect)(()=>{let r=p.current;if(!r)return;let i=S.current,a=i!==null&&i.bridgeFactory===n&&i.sandboxPath===e&&i.tool===t;if(x.current&&a)return x.current=!1,M(),N;if(x.current){x.current=!1,b.current++;let e=m.current;m.current=null,h.current=!1,e&&p8(e)}S.current={bridgeFactory:n,sandboxPath:e,tool:t};let o=++b.current;y.current=!1,h.current=!1,w.current?.(`loading`),g.current=[...j.current??[]];let s;try{s=Promise.resolve(n(r,t))}catch(e){return w.current?.(`error`),C.current?.(f8(e)),N}return s.then(e=>{if(b.current!==o){p8(e);return}m.current=e,e.addEventListener(`initialized`,()=>{h.current=!0,w.current?.(`ready`);let t=d?.current??p.current,n=t?d8(t):void 0;n&&e.sendHostContextChange({containerDimensions:n}),M()}),e.addEventListener(`sizechange`,e=>{T.current?.(e)}),e.addEventListener(`loggingmessage`,e=>{A.current?.(e)}),e.onrequestdisplaymode=async({mode:e})=>{let t=O.current;return{mode:t?t(e):E.current??`inline`}},e.onmessage=async e=>{let t=k.current;return t?(t(e),{}):{isError:!0}},M()}).catch(e=>{b.current===o&&(w.current?.(`error`),C.current?.(f8(e)))}),N},[n,e,t,d,M,N]),(0,D.useEffect)(()=>{if(typeof MutationObserver>`u`||typeof document>`u`)return;let e=new MutationObserver(()=>{if(!h.current)return;let e=u8();m.current?.sendHostContextChange({theme:l8(),...e?{styles:e}:{}})});return e.observe(document.documentElement,{attributes:!0,attributeFilter:[`data-mantine-color-scheme`]}),()=>e.disconnect()},[]),(0,D.useEffect)(()=>{let e=d?.current??p.current;if(typeof ResizeObserver>`u`||!e)return;let t,n=new ResizeObserver(()=>{if(!h.current)return;let n=d8(e);n&&(t&&t.width===n.width&&t.height===n.height||(t=n,m.current?.sendHostContextChange({containerDimensions:n})))});return n.observe(e),()=>n.disconnect()},[d]),(0,D.useEffect)(()=>{o!==void 0&&h.current&&m.current?.sendHostContextChange({displayMode:o})},[o]),(0,D.useImperativeHandle)(f,()=>({async sendToolInput(e){_.current=e,M()},async sendToolResult(e){v.current=e,M()},async sendToolCancelled(e){let t=m.current;t&&await t.sendToolCancelled({reason:e})},async teardown(){let e=m.current;!e||y.current||(y.current=!0,b.current++,x.current=!1,S.current=null,m.current=null,h.current=!1,_.current=null,v.current=null,await p8(e))}}),[M]),(0,R.jsx)(B,{component:`iframe`,ref:p,src:e,title:t.title??t.name,w:`100%`,h:`100%`,bd:0,display:`block`})}var nse=/^(?:\*|[a-zA-Z][a-zA-Z0-9+.-]*:(?:\/\/(?:\*\.)?[A-Za-z0-9._~%!$&'()*+,=@:-]+(?::\d+)?(?:\/[A-Za-z0-9._~%!$&'()*+,=@:/-]*)?)?|(?:\*\.)?[A-Za-z0-9](?:[A-Za-z0-9.-]*[A-Za-z0-9])?)$/;function rse(e){return e}var ise=rse([`connectDomains`,`resourceDomains`,`frameDomains`,`baseUriDomains`]);function ase(e){let t={};if(!e)return t;for(let n of ise){let r=e[n];if(!Array.isArray(r))continue;let i=[];for(let e of r)typeof e==`string`&&nse.test(e)?i.push(e):console.warn(`[mcp-app sandbox] dropping unsafe CSP source:`,e);i.length>0&&(t[n]=i)}return t}function m8(e,t){return e&&e.length>0?e.join(` `):t}function ose(e){let t=m8(e.resourceDomains,`'none'`),n=t===`'none'`?`'unsafe-inline'`:`'unsafe-inline' ${t}`;return[`default-src 'none'`,`connect-src ${m8(e.connectDomains,`'none'`)}`,`script-src ${n}`,`style-src ${n}`,`img-src ${t}`,`font-src ${t}`,`media-src ${t}`,`frame-src ${m8(e.frameDomains,`'none'`)}`,`base-uri ${m8(e.baseUriDomains,`'self'`)}`,`form-action 'none'`,`object-src 'none'`,`worker-src 'none'`].join(`; `)}function sse(e){return e.replace(/&/g,`&amp;`).replace(/"/g,`&quot;`).replace(/'/g,`&#39;`).replace(/</g,`&lt;`).replace(/>/g,`&gt;`)}function cse(e,t){return`<!DOCTYPE html><html><head>${`<meta http-equiv="Content-Security-Policy" content="${sse(t)}">`}<meta charset="utf-8"></head><body>${e}</body></html>`}function h8(e,t){let n=URL.createObjectURL(t),r=document.createElement(`a`);r.href=n,r.download=e,document.body.appendChild(r);try{r.click()}finally{document.body.removeChild(r),setTimeout(()=>URL.revokeObjectURL(n),0)}}function g8(e,t){h8(e,new Blob([t],{type:`application/json`}))}function _8(e){let t=(e.split(/[\\/]/).pop()??``).replace(/[\p{Cc}\p{Cf}]+/gu,``).replace(/[\\/:*?"<>|]+/g,`_`).trim();return t.length>0?t.slice(0,255):`download`}function lse(e){try{let t=new URL(e);return t.protocol===`https:`||t.protocol===`http:`?t:null}catch{return null}}function v8(e,t,n=new Date){let r=n.toISOString().replace(/:/g,`-`),i=t?encodeURIComponent(t):void 0;return`${[`inspector`,e,...i?[i]:[],r].join(`-`)}.json`}var use={name:`MCP Inspector`,version:`2.0.0`},dse={openLinks:{},downloadFile:{},serverTools:{listChanged:!0},serverResources:{listChanged:!0},logging:{}},y8=[`inline`,`fullscreen`];function fse(e){for(let t of e.contents){let e=t.text;if(typeof e==`string`)return{html:e,meta:t._meta}}throw Error(`UI resource has no text (HTML) content`)}function pse(e){let t=atob(e),n=new Uint8Array(new ArrayBuffer(t.length));for(let e=0;e<t.length;e++)n[e]=t.charCodeAt(e);return n}var b8=20;function mse(e){let t=e.replace(/[\p{Cc}\p{Cf}]+/gu,` `).trim();return t.length>80?t.slice(0,77)+`...`:t}function x8(e,t=!1){return e.type===`resource_link`?t?`↗ ${e.uri}`:e.uri:_8(e.resource.uri)}function hse(e){if(e.type===`resource_link`){let t=lse(e.uri);return t?(window.open(t.href,`_blank`,`noopener,noreferrer`),!0):!1}let t=e.resource;if(!(`blob`in t)&&typeof t.text!=`string`)return!1;let n=`blob`in t?new Blob([pse(t.blob)],{type:t.mimeType??`application/octet-stream`}):new Blob([t.text],{type:t.mimeType??`text/plain`});return h8(_8(t.uri),n),!0}function gse(e){return async(t,n)=>{let r=e.getClient();if(!r)throw Error(`Cannot render MCP App: no connected MCP client.`);let i=t.contentWindow;if(!i)throw Error(`Cannot render MCP App: sandbox iframe has no window.`);let a={...dse},o=new NU(r,use,a,{hostContext:ese(t,y8)});o.addEventListener(`sandboxready`,()=>{(async()=>{try{let t=jU(n);if(!t)return;let{html:r,meta:i}=fse(await e.readResource(t)),s=ase(i?.csp);a.sandbox={permissions:i?.permissions,csp:s},await o.sendSandboxResourceReady({html:cse(r,ose(s)),permissions:i?.permissions})}catch(t){let n=t instanceof Error?t:Error(String(t));console.error(`[mcp-app] failed to load UI resource into sandbox:`,n),e.onResourceError?.(n)}})()}),o.onopenlink=async({url:e})=>/^https?:\/\//i.test(e)?(window.open(e,`_blank`,`noopener,noreferrer`),{isError:!1}):{isError:!0},o.ondownloadfile=async({contents:e})=>{if(!Array.isArray(e)||e.length===0)return{isError:!0};if(e.length>b8)return console.warn(`[mcp-app] refusing download batch of ${e.length} items (max ${b8})`),{isError:!0};let t=e.map(e=>mse(x8(e,!0))).join(`
236
- `);if(!window.confirm(`This MCP App wants to download or open ${e.length} item(s):\n\n${t}`))return{isError:!0};let n=0,r=[];for(let t of e)try{hse(t)?n++:r.push(x8(t))}catch(e){r.push(x8(t)),console.error(`[mcp-app] download item failed:`,e)}return r.length>0&&console.warn(`[mcp-app] ${r.length} of ${e.length} download item(s) skipped:`,r),{isError:n===0}};let s=new kU(i,i);return await o.connect(s),o}}var _se=U.withProps({size:`sm`,c:`dimmed`}),vse=_l.withProps({flex:1,mih:0,type:`auto`,scrollbars:`y`,offsetScrollbars:!0}),yse=W.withProps({gap:`md`,miw:0}),bse=qp.withProps({size:`md`,fullWidth:!0,leftSection:(0,R.jsx)(aW,{"aria-hidden":!0,size:18})});function xse({tool:e,formValues:t,isOpening:n,onFormChange:r,onOpenApp:i}){let{description:a,inputSchema:o}=e,s=W6(o)??{},c=K6(s,t),l=n||c,u=z6(e);return(0,R.jsx)(vse,{children:(0,R.jsxs)(yse,{children:[a&&(0,R.jsx)(_se,{children:a}),u&&(0,R.jsx)(cm,{}),(0,R.jsx)(e8,{schema:s,values:t,onChange:r,disabled:n,resetKey:e.name}),(0,R.jsx)(bse,{onClick:i,disabled:l,loading:n,"data-testid":`open-app`,children:`Open App`})]})})}var Sse=U.withProps({fw:500,truncate:!0}),Cse=U.withProps({size:`xs`,c:`dimmed`,lineClamp:2}),wse=W.withProps({gap:2,flex:1,miw:0}),Tse=H.withProps({gap:`sm`,wrap:`nowrap`,align:`flex-start`}),Ese=dm.withProps({w:20,h:20,fit:`contain`}),Dse=xl.withProps({w:`100%`,p:`sm`,variant:`listItem`});function Ose({tool:e,selected:t,onClick:n}){let{name:r,title:i,description:a,icons:o}=e,s=o?.[0]?.src;return(0,R.jsx)(Dse,{bg:t?`var(--mantine-primary-color-light)`:void 0,onClick:n,children:(0,R.jsxs)(Tse,{children:[s&&(0,R.jsx)(Ese,{src:s,alt:``}),(0,R.jsxs)(wse,{children:[(0,R.jsx)(Sse,{children:R6(r,i)}),a&&(0,R.jsx)(Cse,{children:a})]}),(0,R.jsx)(eW,{"aria-hidden":!0,color:`var(--inspector-text-secondary)`,size:18})]})})}var kse=`calc(100vh - var(--app-shell-header-height, 0px) - var(--app-shell-footer-height, 0px) - var(--mantine-spacing-xl) * 2 - 220px)`,Ase=U.withProps({c:`dimmed`,ta:`center`,py:`xl`});function jse({tools:e,selectedName:t,searchText:n=``,listChanged:r,onRefreshList:i,onSearchChange:a,onSelectApp:o}){let s=V6(`apps-sidebar`),c=n.toLowerCase(),l=n?e.filter(e=>e.name.toLowerCase().includes(c)||(e.title?.toLowerCase().includes(c)??!1)):e;return(0,R.jsxs)(W,{gap:`sm`,children:[(0,R.jsxs)(H,{justify:`space-between`,children:[(0,R.jsxs)(Sv,{order:4,children:[`MCP Apps (`,e.length,`)`]}),(0,R.jsx)(F6,{visible:r,onRefresh:i})]}),(0,R.jsx)(fv,{placeholder:`Search apps...`,value:n,onChange:e=>a(e.currentTarget.value),rightSectionPointerEvents:`auto`,rightSection:n?(0,R.jsx)(P6,{onClick:()=>a(``)}):null}),(0,R.jsx)(_l.Autosize,{viewportRef:s,mah:kse,children:(0,R.jsx)(W,{gap:`xs`,children:l.length===0?(0,R.jsx)(Ase,{children:e.length===0?`No apps available`:`No matching apps`}):l.map(e=>(0,R.jsx)(Ose,{tool:e,selected:e.name===t,onClick:()=>{e.name!==t&&o(e.name)}},e.name))})})]})}var Mse={debug:`gray`,info:`blue`,notice:`teal`,warning:`yellow`,error:`red`,critical:`red`,alert:`red`,emergency:`red`},Nse=new Set([`alert`,`emergency`]),Pse=Rp.withProps({variant:`filled`,autoContrast:!0});function S8({level:e}){let t=Nse.has(e)?500:void 0;return(0,R.jsx)(Pse,{color:q6(Mse[e]),fw:t,children:e})}var C8=wd.withProps({variant:`screen`,h:`calc(100dvh - var(--app-shell-header-height, 0px) - var(--app-shell-footer-height, 0px))`,gap:`md`,p:`xl`,align:`flex-start`}),Fse=W.withProps({w:340,flex:`0 0 auto`}),Ise=$p.withProps({withBorder:!0,padding:`lg`}),w8=$p.withProps({withBorder:!0,padding:`lg`,variant:`preview`,flex:1,h:`100%`}),T8=U.withProps({c:`dimmed`,ta:`center`,py:`xl`}),Lse=H.withProps({justify:`space-between`,wrap:`nowrap`,gap:`sm`}),Rse=H.withProps({gap:`sm`,wrap:`nowrap`,align:`center`,flex:1,miw:0}),zse=dm.withProps({w:24,h:24,fit:`contain`}),Bse=U.withProps({fw:600,size:`lg`,truncate:!0,flex:1,miw:0}),Vse=H.withProps({gap:`xs`,wrap:`nowrap`}),Hse=qp.withProps({variant:`subtle`,size:`sm`,leftSection:(0,R.jsx)(tW,{"aria-hidden":!0,size:16})}),Use=Cu.withProps({variant:`subtle`,"aria-label":`Close`}),Wse=W.withProps({flex:1,miw:0,mih:0,gap:0}),Gse=W.withProps({miw:0,mih:0,gap:0}),Kse=W.withProps({gap:`md`,h:`100%`}),E8=W.withProps({gap:`xs`,flex:`0 0 auto`,mih:0}),D8=_l.withProps({mah:200,type:`auto`,scrollbars:`y`,offsetScrollbars:!0}),qse=W.withProps({gap:`sm`}),Jse=El.withProps({p:`md`,radius:`md`,withBorder:!0}),Yse=W.withProps({gap:`xs`}),O8=U.withProps({size:`xs`,c:`dimmed`,ff:`monospace`}),Xse=W.withProps({gap:`xs`}),Zse=H.withProps({gap:`sm`,wrap:`nowrap`,align:`flex-start`}),Qse=nm.withProps({block:!0,fz:`xs`}),k8=qp.withProps({variant:`subtle`,size:`compact-xs`}),$se=H.withProps({justify:`space-between`,wrap:`nowrap`,gap:`sm`}),ece=H.withProps({gap:`sm`,wrap:`nowrap`,align:`center`,flex:`0 0 auto`}),tce=qp.withProps({variant:`default`,size:`compact-xs`}),nce=U.withProps({size:`xs`,c:`dimmed`}),rce=El.withProps({p:`md`,radius:`md`,withBorder:!0,c:`var(--inspector-log-error)`}),ice=U.withProps({fw:600,size:`sm`}),ace=U.withProps({size:`sm`,ff:`monospace`});function oce(e){if(typeof e==`string`)return e;try{return JSON.stringify(e)??``}catch{return String(e)}}var A8=500;function j8(e,t){let n=[...e,t];return n.length>A8?n.slice(n.length-A8):n}function sce({tools:e,listChanged:t,sandboxPath:n,bridgeFactory:r,rendererRef:i,ui:a,onUiChange:o,onRefreshList:s,onSelectApp:c,onOpenApp:l,onCloseApp:u,onError:d,autoOpen:f=!1}){let{selectedAppName:p,formValues:m,search:h}=a,[g,_]=(0,D.useState)(!1),[v,y]=(0,D.useState)(!1),b=(0,D.useRef)(null),x=(0,D.useRef)(0),S=(0,D.useRef)(0),[C,w]=(0,D.useState)(void 0),[T,E]=(0,D.useState)([]),[O,k]=(0,D.useState)([]),[A,j]=(0,D.useState)(!0),[M,N]=(0,D.useState)([]),[ee,te]=(0,D.useState)(`idle`),[P,F]=(0,D.useState)(void 0),I=p?e.find(e=>e.name===p):void 0,ne=I?z6(I):!1;function re(e){e.height!=null&&e.height>0&&w(e.height)}function ie(e){E(t=>j8(t,{id:S.current++,...e}))}function ae(e){k(t=>j8(t,{id:x.current++,level:e.level,logger:e.logger,text:oce(e.data)}))}let oe=(0,D.useCallback)(e=>{w(void 0),E([]),k([]),j(!0),te(`idle`),F(void 0),e?.keepPartials||N([])},[]);function se(e){F(e),d?.(e)}function ce(){N(e=>[...e,{...m}])}let le=v?`fullscreen`:`inline`;function ue(e){return y8.includes(e)?(y(e===`fullscreen`),e):le}function de(t){if(t===p)return;let n=e.find(e=>e.name===t);n&&(o({...a,selectedAppName:t,formValues:G6(W6(n.inputSchema)??{})}),y(!1),oe(),c(t),z6(n)?_(!1):(_(!0),l(t,{})))}function fe(){I&&(oe({keepPartials:!0}),_(!0),l(I.name,m))}function pe(){_(!1),o({...a,selectedAppName:void 0,formValues:{}}),y(!1),oe(),u()}let me=(0,D.useRef)(!1);(0,D.useEffect)(()=>{!f||me.current||!I||g||(me.current=!0,Promise.resolve().then(()=>{oe({keepPartials:!0}),_(!0),l(I.name,m)}))},[f,I,g,m,l,oe]);function he(){_(!1),y(!1),oe()}if(!n)return(0,R.jsx)(C8,{children:(0,R.jsx)(w8,{children:(0,R.jsx)(T8,{children:`MCP Apps are unavailable — the sandbox could not be reached.`})})});let ge=v?void 0:C;return(0,R.jsxs)(C8,{children:[!v&&(0,R.jsx)(Fse,{children:(0,R.jsx)(Ise,{children:(0,R.jsx)(jse,{tools:e,selectedName:p,searchText:h,listChanged:t,onRefreshList:s,onSearchChange:e=>o({...a,search:e}),onSelectApp:de})})}),(0,R.jsx)(w8,{"data-testid":`apps-form`,"data-app-status":g?ee:`idle`,"data-app-error":g?P?.message:void 0,children:I?(0,R.jsxs)(Kse,{children:[(0,R.jsxs)(Lse,{children:[(0,R.jsxs)(Rse,{children:[I.icons?.[0]?.src&&(0,R.jsx)(zse,{src:I.icons[0].src,alt:``}),(0,R.jsx)(Bse,{children:R6(I.name,I.title)})]}),(0,R.jsxs)(Vse,{children:[g&&ne&&(0,R.jsx)(Hse,{onClick:he,children:`Back to Input`}),g&&(0,R.jsx)(k_,{label:v?`Restore`:`Maximize`,children:(0,R.jsx)(Cu,{variant:`subtle`,onClick:()=>y(e=>!e),"aria-label":v?`Restore`:`Maximize`,children:v?(0,R.jsx)(ZU,{"aria-hidden":!0,size:20}):(0,R.jsx)(QU,{"aria-hidden":!0,size:20})})}),(0,R.jsx)(k_,{label:`Close`,children:(0,R.jsx)(Use,{onClick:pe,children:(0,R.jsx)($U,{"aria-hidden":!0,size:20})})})]})]}),g?(0,R.jsxs)(Wse,{ref:b,children:[(0,R.jsx)(Gse,{flex:ge==null?1:`0 0 auto`,h:ge,mah:`100%`,children:(0,R.jsx)(tse,{sandboxPath:n,tool:I,bridgeFactory:r,onError:se,onAppStatusChange:te,onSizeChange:re,displayMode:le,onRequestDisplayMode:ue,onMessage:ie,onLog:ae,partialInputs:M,containerRef:b,ref:i},I.name)}),P&&(0,R.jsxs)(rce,{"data-testid":`apps-error`,children:[(0,R.jsx)(ice,{children:`App failed to load`}),(0,R.jsx)(ace,{children:P.message})]})]}):(0,R.jsxs)(R.Fragment,{children:[ne&&(0,R.jsxs)(ece,{children:[(0,R.jsx)(tce,{onClick:ce,"data-testid":`apps-stage`,children:`Stage partial input`}),M.length>0&&(0,R.jsxs)(R.Fragment,{children:[(0,R.jsxs)(nce,{children:[M.length,` staged`]}),(0,R.jsx)(k8,{onClick:()=>N([]),children:`Clear staged`})]})]}),(0,R.jsx)(xse,{tool:I,formValues:m,isOpening:!1,onFormChange:e=>o({...a,formValues:e}),onOpenApp:fe})]}),g&&T.length>0&&(0,R.jsxs)(E8,{"data-testid":`apps-messages`,children:[(0,R.jsxs)(Sv,{order:5,children:[`Messages from app (`,T.length,`)`]}),(0,R.jsx)(D8,{children:(0,R.jsx)(qse,{children:T.map((e,t)=>(0,R.jsx)(Jse,{children:(0,R.jsxs)(Yse,{children:[(0,R.jsxs)(O8,{children:[`[`,t,`] role: `,e.role]}),e.content.map((e,t)=>(0,R.jsx)(f6,{block:e,copyable:!0},t))]})},e.id))})})]}),g&&O.length>0&&(0,R.jsxs)(E8,{"data-testid":`apps-logs`,children:[(0,R.jsxs)($se,{children:[(0,R.jsxs)(k8,{onClick:()=>j(e=>!e),"aria-expanded":A,"aria-controls":`apps-logs-region`,children:[`App logs (`,O.length,`)`]}),(0,R.jsx)(k8,{onClick:()=>k([]),children:`Clear`})]}),(0,R.jsx)(oa,{in:A,id:`apps-logs-region`,children:(0,R.jsx)(D8,{children:(0,R.jsx)(Xse,{children:O.map(e=>(0,R.jsxs)(Zse,{children:[(0,R.jsx)(S8,{level:e.level}),e.logger&&(0,R.jsx)(O8,{children:e.logger}),(0,R.jsx)(Qse,{children:e.text})]},e.id))})})})]})]}):(0,R.jsx)(T8,{children:`Select an app to view details`})})]})}var cce=U.withProps({fw:500}),lce=U.withProps({size:`xs`,c:`dimmed`,lineClamp:1}),uce=xl.withProps({w:`100%`,p:`sm`,variant:`listItem`});function dce({prompt:e,selected:t,onClick:n}){let{name:r,title:i,description:a}=e;return(0,R.jsx)(uce,{bg:t?`var(--mantine-primary-color-light)`:void 0,onClick:n,children:(0,R.jsxs)(W,{gap:2,children:[(0,R.jsx)(cce,{children:i??r}),a&&(0,R.jsx)(lce,{children:a})]})})}var fce=W.withProps({gap:`sm`,flex:1,mih:0}),pce=fv.withProps({placeholder:`Search prompts...`,rightSectionPointerEvents:`auto`}),mce=_l.withProps({flex:1,mih:0});function hce({prompts:e,selectedName:t,searchText:n=``,listChanged:r,onRefreshList:i,loadError:a,pagination:o,onSearchChange:s,onSelectPrompt:c}){let l=V6(`prompts-sidebar`),u=n.toLowerCase(),d=e.filter(e=>e.name.toLowerCase().includes(u)||(e.title?.toLowerCase().includes(u)??!1)||(e.description?.toLowerCase().includes(u)??!1));return(0,R.jsxs)(fce,{children:[(0,R.jsxs)(H,{justify:`space-between`,children:[(0,R.jsx)(Sv,{order:4,children:`Prompts`}),(0,R.jsx)(F6,{visible:r,onRefresh:i})]}),(0,R.jsx)(pce,{value:n,onChange:e=>s(e.currentTarget.value),rightSection:n?(0,R.jsx)(P6,{onClick:()=>s(``)}):null}),(0,R.jsx)(L6,{...o}),(0,R.jsx)(I6,{error:a,what:`prompts`,onRetry:i}),(0,R.jsx)(mce,{viewportRef:l,children:(0,R.jsx)(W,{gap:`xs`,children:d.map(e=>(0,R.jsx)(dce,{prompt:e,selected:e.name===t,onClick:()=>{e.name!==t&&c(e.name)}},e.name))})})]})}var gce=300,_ce=U.withProps({fw:700,size:`lg`,truncate:`end`}),vce=U.withProps({size:`sm`,c:`dimmed`});function M8(e){return`Enter ${e}...`}function yce({prompt:e,argumentValues:t,onArgumentChange:n,onGetPrompt:r,onCompleteArgument:i,completionsSupported:a=!1}){let{name:o,title:s,description:c,arguments:l}=e,[u,d]=(0,D.useState)({});Z6(o,()=>{d({})});let f=(0,D.useRef)(new Map),p=(0,D.useRef)(new Map);(0,D.useEffect)(()=>{let e=p.current,t=f.current;return()=>{for(let t of e.values())clearTimeout(t);e.clear();for(let e of t.values())e.abort();t.clear()}},[]);let m=a&&!!i,h=(0,D.useCallback)(async(e,t,n)=>{if(!i)return;f.current.get(e)?.abort();let r=new AbortController;f.current.set(e,r);try{let a=await i(e,t,n);if(r.signal.aborted)return;d(t=>({...t,[e]:a}))}catch{r.signal.aborted||d(t=>({...t,[e]:[]}))}finally{f.current.get(e)===r&&f.current.delete(e)}},[i]),g=(0,D.useRef)(t);(0,D.useEffect)(()=>{g.current=t},[t]);let _=(0,D.useCallback)(e=>{let t={};for(let n of l??[])n.name!==e&&(t[n.name]=g.current[n.name]??``);return t},[l]);function v(e,t){if(n(e,t),!m)return;d(t=>{if(t[e]===void 0)return t;let n={...t};return delete n[e],n});let r=p.current.get(e);r&&clearTimeout(r);let i=setTimeout(()=>{p.current.delete(e),h(e,t,_(e))},gce);p.current.set(e,i)}function y(e){if(!m)return;let t=p.current.get(e);t&&(clearTimeout(t),p.current.delete(e));let n=g.current[e]??``;h(e,n,_(e))}let b=(l??[]).filter(e=>e.required===!0).every(e=>(t[e.name]??``).length>0);return(0,R.jsxs)(W,{gap:`md`,children:[(0,R.jsx)(_ce,{children:s??o}),c&&(0,R.jsx)(vce,{children:c}),l&&l.length>0&&(0,R.jsxs)(R.Fragment,{children:[(0,R.jsx)(Sv,{order:4,children:`Arguments`}),(0,R.jsx)(W,{gap:`sm`,children:l.map(e=>m?(0,R.jsx)(Fp,{label:e.name,withAsterisk:e.required===!0,description:e.description,placeholder:M8(e.name),value:t[e.name]||``,data:u[e.name]??[],filter:({options:e})=>e,onChange:t=>v(e.name,t),onFocus:()=>y(e.name)},e.name):(0,R.jsx)(fv,{label:e.name,withAsterisk:e.required===!0,description:e.description,placeholder:M8(e.name),value:t[e.name]||``,onChange:t=>v(e.name,t.currentTarget.value),rightSectionPointerEvents:`auto`,rightSection:t[e.name]?(0,R.jsx)(P6,{onClick:()=>v(e.name,``)}):null},e.name))})]}),(0,R.jsx)(H,{justify:`flex-start`,children:(0,R.jsx)(qp,{size:`sm`,disabled:!b,onClick:r,children:`Get Prompt`})})]})}function bce(e,t){return`[${e}] role: ${t}`}var xce=new Set([`text`,`image`,`audio`,`resource`,`resource_link`]);function Sce(e){if(typeof e!=`object`||!e)return!1;let t=e.type;return typeof t==`string`&&xce.has(t)}function Cce(e){if(e.type===`text`)return`text/markdown`}var wce=El.withProps({p:`md`,radius:`md`,withBorder:!0}),Tce=U.withProps({size:`xs`,c:`dimmed`,ff:`monospace`}),Ece=H.withProps({justify:`space-between`});function N8({index:e,message:t}){let n=t.content,r=(Array.isArray(n)?n:[n]).filter(Sce);return(0,R.jsx)(wce,{children:(0,R.jsxs)(W,{gap:`xs`,children:[(0,R.jsx)(Ece,{children:(0,R.jsx)(Tce,{children:bce(e,t.role)})}),r.map((e,t)=>(0,R.jsx)(f6,{block:e,mimeType:Cce(e),copyable:!0},t))]})})}var Dce=qp.withProps({variant:`subtle`,size:`sm`}),Oce=W.withProps({gap:`md`,miw:0,mih:0}),kce=H.withProps({justify:`space-between`,flex:`0 0 auto`}),Ace=H.withProps({gap:`xs`,wrap:`nowrap`}),jce=_l.withProps({flex:`0 1 auto`,miw:0,mih:0,type:`auto`,scrollbars:`y`,offsetScrollbars:!0}),Mce=W.withProps({gap:`md`});function Nce({messages:e,onCopyAll:t,onClose:n}){return(0,R.jsxs)(Oce,{children:[(0,R.jsxs)(kce,{children:[(0,R.jsxs)(Ace,{children:[n&&(0,R.jsx)(Ou,{"aria-label":`Close messages`,onClick:n}),(0,R.jsx)(Sv,{order:4,children:`Messages`})]}),t&&e.length>0&&(0,R.jsx)(Dce,{onClick:t,children:`Copy All`})]}),(0,R.jsx)(jce,{children:(0,R.jsx)(Mce,{children:e.length===0?(0,R.jsx)(U,{c:`dimmed`,children:`No messages to display`}):e.map((e,t)=>(0,R.jsx)(N8,{index:t,message:e},t))})})]})}var Pce=wd.withProps({variant:`screen`,h:`calc(100dvh - var(--app-shell-header-height, 0px) - var(--app-shell-footer-height, 0px))`,gap:`md`,p:`xl`}),Fce=W.withProps({w:360,flex:`0 0 auto`}),Ice=$p.withProps({withBorder:!0,padding:`lg`,variant:`sidebar`}),Lce=$p.withProps({withBorder:!0,padding:`lg`}),P8=$p.withProps({withBorder:!0,padding:`lg`,variant:`preview`}),F8=wd.withProps({flex:1,miw:0,direction:`column`,align:`stretch`}),Rce=U.withProps({c:`dimmed`,ta:`center`,py:`xl`}),zce=W.withProps({align:`center`,py:`xl`}),Bce=Gd.withProps({color:`red`,variant:`light`,title:`Prompt Error`}),I8=`calc(100dvh - var(--app-shell-header-height, 0px) - var(--app-shell-footer-height, 0px) - var(--mantine-spacing-xl) * 2)`;function L8(e){return!!e.arguments&&e.arguments.length>0}function Vce({prompts:e,getPromptState:t,ui:n,listChanged:r,completionsSupported:i,onUiChange:a,onRefreshList:o,loadError:s,pagination:c,onGetPrompt:l,onCopyMessages:u,onCompleteArgument:d}){let{selectedPromptName:f,argumentValues:p,submittedFor:m,search:h}=n,g=f?e.find(e=>e.name===f):void 0;function _(t){if(t===f)return;let r=e.find(e=>e.name===t),i=!!r&&!L8(r);a({...n,argumentValues:{},selectedPromptName:t,submittedFor:i?t:void 0}),i&&l(t,{})}function v(){g&&(a({...n,submittedFor:g.name}),l(g.name,p))}function y(){g&&L8(g)?a({...n,submittedFor:void 0}):a({...n,selectedPromptName:void 0,submittedFor:void 0})}let b=!!g&&!!t&&m===g.name&&t.promptName===g.name;function x(){return!b||!t?null:t.status===`pending`?(0,R.jsx)(P8,{children:(0,R.jsxs)(W,{gap:`md`,children:[(0,R.jsx)(H,{justify:`flex-start`,children:(0,R.jsx)(Ou,{"aria-label":`Close messages`,onClick:y})}),(0,R.jsxs)(zce,{children:[(0,R.jsx)(hu,{size:`sm`}),(0,R.jsx)(U,{c:`dimmed`,children:`Loading prompt...`})]})]})}):t.status===`error`?(0,R.jsx)(P8,{children:(0,R.jsxs)(W,{gap:`md`,children:[(0,R.jsx)(H,{justify:`flex-start`,children:(0,R.jsx)(Ou,{"aria-label":`Close messages`,onClick:y})}),(0,R.jsx)(Bce,{children:t.error??`Failed to get prompt`})]})}):t.result?(0,R.jsx)(P8,{children:(0,R.jsx)(Nce,{messages:t.result.messages,onCopyAll:u,onClose:y})}):null}return(0,R.jsxs)(Pce,{children:[(0,R.jsx)(Fce,{children:(0,R.jsx)(Ice,{children:(0,R.jsx)(hce,{prompts:e,selectedName:f,searchText:h,listChanged:r,onRefreshList:o,loadError:s,pagination:c,onSearchChange:e=>a({...n,search:e}),onSelectPrompt:_})})}),b?(0,R.jsx)(F8,{mah:I8,children:x()}):g&&L8(g)?(0,R.jsx)(F8,{mah:I8,children:(0,R.jsx)(P8,{children:(0,R.jsx)(yce,{prompt:g,argumentValues:p,onArgumentChange:(e,t)=>a({...n,argumentValues:{...p,[e]:t}}),onGetPrompt:v,completionsSupported:i,onCompleteArgument:d?(e,t,n)=>d({type:`ref/prompt`,name:g.name},e,t,n):void 0})})}):(0,R.jsx)(Lce,{flex:1,children:(0,R.jsx)(Rce,{children:`Select a prompt to view details`})})]})}function R8(e){return e===`modern`}function Hce(e){return R8(e)?`Modern`:`Legacy`}var z8=`On modern (2026-07-28) servers, resource subscriptions are a filter over one long-lived subscriptions/listen stream.`,Uce={connecting:{color:`blue`,label:`Connecting…`,tooltip:`${z8} Opening the stream — waiting for the server to acknowledge the subscription.`},acknowledged:{color:`green`,label:`Listening`,tooltip:`${z8} The server acknowledged the subscription and the stream is open, carrying resources/updated notifications.`},reconnecting:{color:`yellow`,label:`Reconnecting…`,tooltip:`${z8} The stream dropped unexpectedly; re-listening to re-establish it (there is no resumability, so the full filter is re-sent).`},ended:{color:`gray`,label:`Stream ended`,tooltip:`${z8} The stream is closed and won't reconnect on its own — either the server ended it (for example, on shutdown) or reconnection was abandoned after repeated failures. Re-subscribe to try again.`}};function Wce(e){return Uce[e]}var Gce=k_.withProps({multiline:!0,w:260,withArrow:!0});function Kce({status:e}){let{color:t,label:n,tooltip:r}=Wce(e);return(0,R.jsx)(Gce,{label:r,children:(0,R.jsx)(Rp,{variant:`dot`,color:t,children:n})})}var qce=xl.withProps({w:`100%`,p:`sm`,variant:`listItem`});function B8({resource:e,selected:t,onClick:n}){return(0,R.jsx)(qce,{bg:t?`var(--mantine-primary-color-light)`:void 0,onClick:n,children:(0,R.jsx)(U,{fw:500,children:e.title??e.name})})}var Jce=U.withProps({size:`sm`,fw:500,truncate:`end`}),Yce=U.withProps({size:`xs`,c:`dimmed`}),Xce=qp.withProps({variant:`subtle`,size:`xs`}),Zce=H.withProps({justify:`space-between`,wrap:`nowrap`,gap:`xs`}),Qce=W.withProps({gap:2,flex:1,miw:0});function $ce(e){return e.toLocaleString()}function ele(e){let t=e.split(`/`).filter(Boolean);return t[t.length-1]??e}function tle({subscription:e,onUnsubscribe:t}){let{resource:n,lastUpdated:r}=e;return(0,R.jsxs)(Zce,{children:[(0,R.jsxs)(Qce,{children:[(0,R.jsx)(k_,{label:n.uri,withinPortal:!0,children:(0,R.jsx)(Jce,{children:ele(n.uri)})}),r&&(0,R.jsx)(Yce,{children:$ce(r)})]}),(0,R.jsx)(Xce,{onClick:t,children:`Unsubscribe`})]})}var V8=H.withProps({gap:`xs`,wrap:`nowrap`}),nle=W.withProps({gap:`sm`,flex:1,mih:0}),rle=fv.withProps({flex:1,placeholder:`Search...`,rightSectionPointerEvents:`auto`});function H8(e,t){return`${e} (${t})`}function U8(e,t){return e&&t>0?`0 ${t} auto`:`0 0 auto`}function ile({resources:e,templates:t,subscriptions:n,subscriptionsSupported:r=!0,subscriptionStreamState:i,protocolEra:a,selectedUri:o,selectedTemplateUri:s,searchText:c=``,openSections:l,listChanged:u,onRefreshList:d,loadError:f,pagination:p,onSearchChange:m,onOpenSectionsChange:h,onSelectUri:g,onSelectTemplate:_,onUnsubscribeResource:v,compact:y,onCompactChange:b}){let x=c.toLowerCase(),S=e.filter(e=>e.name.toLowerCase().includes(x)||(e.title?.toLowerCase().includes(x)??!1)||e.uri.toLowerCase().includes(x)),C=t.filter(e=>e.name.toLowerCase().includes(x)||(e.title?.toLowerCase().includes(x)??!1)||e.uriTemplate.toLowerCase().includes(x)),w=n.filter(e=>e.resource.name.toLowerCase().includes(x)||(e.resource.title?.toLowerCase().includes(x)??!1)||e.resource.uri.toLowerCase().includes(x)),T=R8(a)&&i?.active===!0&&w.length>0?i.status:void 0,E=r?[`resources`,`templates`,`subscriptions`]:[`resources`,`templates`],D=l??(y?[]:[...E]),O=D.filter(e=>E.includes(e)).length===E.length,k={resources:S.length,templates:C.length,subscriptions:w.length},A=D.filter(e=>E.includes(e)&&(k[e]??0)>0),j=D.filter(e=>E.includes(e)&&!A.includes(e));function M(e){h([...e,...j])}function N(){let e=O;h(e?[]:[...E]),b(e)}return(0,R.jsxs)(nle,{children:[(0,R.jsxs)(H,{justify:`space-between`,children:[(0,R.jsx)(Sv,{order:4,children:`Resources`}),(0,R.jsx)(F6,{visible:u,onRefresh:d})]}),(0,R.jsxs)(V8,{children:[(0,R.jsx)(rle,{value:c,onChange:e=>m(e.currentTarget.value),rightSection:c?(0,R.jsx)(P6,{onClick:()=>m(``)}):null}),(0,R.jsx)(j6,{compact:!O,onToggle:N})]}),(0,R.jsx)(L6,{...p}),(0,R.jsx)(I6,{error:f,what:`resources`,onRetry:d}),(0,R.jsxs)(Hd,{multiple:!0,variant:`disclosure`,chevron:(0,R.jsx)(k6,{}),flex:1,mih:0,transitionDuration:0,value:A,onChange:M,children:[(0,R.jsxs)(Hd.Item,{value:`resources`,flex:U8(A.includes(`resources`),S.length),children:[(0,R.jsx)(Hd.Control,{disabled:S.length===0,children:H8(`URIs`,S.length)}),(0,R.jsx)(Hd.Panel,{children:(0,R.jsx)(W,{gap:`xs`,children:S.map(e=>(0,R.jsx)(B8,{resource:e,selected:e.uri===o,onClick:()=>{e.uri!==o&&g(e.uri)}},e.uri))})})]}),(0,R.jsxs)(Hd.Item,{value:`templates`,flex:U8(A.includes(`templates`),C.length),children:[(0,R.jsx)(Hd.Control,{disabled:C.length===0,children:H8(`Templates`,C.length)}),(0,R.jsx)(Hd.Panel,{children:(0,R.jsx)(W,{gap:`xs`,children:C.map(e=>(0,R.jsx)(B8,{resource:e,selected:e.uriTemplate===s,onClick:()=>{e.uriTemplate!==s&&_(e.uriTemplate)}},e.uriTemplate))})})]}),r&&(0,R.jsxs)(Hd.Item,{value:`subscriptions`,flex:U8(A.includes(`subscriptions`),w.length),children:[(0,R.jsx)(Hd.Control,{disabled:w.length===0,children:(0,R.jsxs)(V8,{children:[(0,R.jsx)(U,{span:!0,children:H8(`Subscriptions`,w.length)}),T&&(0,R.jsx)(Kce,{status:T})]})}),(0,R.jsx)(Hd.Panel,{children:(0,R.jsx)(W,{gap:`xs`,children:w.map(e=>(0,R.jsx)(tle,{subscription:e,onUnsubscribe:()=>v(e.resource.uri)},e.resource.uri))})})]})]})]})}function W8(e){return!e||e===`dimmed`?e:`var(--mantine-color-${e}-light-color)`}var ale=qp.withProps({variant:`filled`,size:`sm`});function ole({subscribed:e,onToggle:t}){return(0,R.jsx)(ale,{onClick:t,children:e?`Unsubscribe`:`Subscribe`})}function sle(e){return`Last updated: ${e.toLocaleString()}`}var cle=new Set([`markdown`,`csv`,`html`]),lle=`text/plain`;function G8(e){return cle.has(T3(e))}var ule=H.withProps({justify:`space-between`,wrap:`nowrap`,flex:`0 0 auto`}),dle=H.withProps({gap:`xs`,wrap:`nowrap`}),fle=H.withProps({gap:`xs`,wrap:`nowrap`}),ple=U.withProps({size:`sm`,c:W8(`blue`),truncate:`end`}),mle=H.withProps({justify:`space-between`,wrap:`nowrap`,flex:`0 0 auto`}),hle=U.withProps({size:`xs`,c:`dimmed`}),gle=U.withProps({size:`sm`,c:`dimmed`}),_le=H.withProps({justify:`flex-start`,flex:`0 0 auto`}),vle=H.withProps({gap:`xs`}),yle=H.withProps({gap:`xs`}),K8=qp.withProps({variant:`subtle`,size:`sm`}),ble=wd.withProps({}),xle=W.withProps({gap:`md`,miw:0,mih:0}),Sle=_l.withProps({flex:`0 1 auto`,miw:0,mih:0,type:`auto`,scrollbars:`y`,offsetScrollbars:!0}),Cle=W.withProps({gap:`md`}),wle=[[`.md`,`text/markdown`],[`.markdown`,`text/markdown`],[`.csv`,`text/csv`],[`.json`,`application/json`],[`.xml`,`application/xml`],[`.html`,`text/html`],[`.htm`,`text/html`],[`.css`,`text/css`],[`.pdf`,`application/pdf`]];function Tle(e){let t=e.split(`?`)[0].split(`#`)[0].toLowerCase();for(let[e,n]of wle)if(t.endsWith(e))return n}function q8(e,t){return e??t.mimeType??Tle(t.uri)??`application/octet-stream`}function Ele({resource:e,contents:t,lastUpdated:n,isSubscribed:r,subscriptionsSupported:i=!0,onRefresh:a,onSubscribe:o,onUnsubscribe:s,onClose:c}){let{uri:l,annotations:u}=e,d=q8(t[0]?.mimeType,e),[f,p]=(0,D.useState)(!1),[m,h]=(0,D.useState)(l);l!==m&&(h(l),p(!1));let g=G8(d);return(0,R.jsxs)(xle,{children:[(0,R.jsxs)(ule,{children:[(0,R.jsxs)(dle,{children:[c&&(0,R.jsx)(Ou,{"aria-label":`Close preview`,onClick:c}),(0,R.jsx)(Sv,{order:4,children:`Resource`})]}),(0,R.jsxs)(fle,{children:[(0,R.jsx)(ple,{children:l}),(0,R.jsx)(h3,{value:l})]})]}),(0,R.jsx)(Sle,{children:(0,R.jsx)(Cle,{children:t.map((t,n)=>{let r=q8(t.mimeType,e),i=f&&G8(r)?lle:r;return(0,R.jsx)(f6,{contents:t,mimeType:i,copyable:!0},n)})})}),(0,R.jsxs)(mle,{children:[n?(0,R.jsx)(hle,{children:sle(n)}):(0,R.jsx)(ble,{}),t.length<=1&&(0,R.jsx)(gle,{children:d})]}),(0,R.jsxs)(_le,{children:[(0,R.jsxs)(yle,{children:[i&&(0,R.jsx)(ole,{subscribed:r,onToggle:r?s:o}),(0,R.jsx)(K8,{onClick:a,children:`Refresh`}),g&&(0,R.jsx)(K8,{"aria-pressed":f,onClick:()=>p(e=>!e),children:f?`View Rendered`:`View Source`})]}),(0,R.jsxs)(vle,{children:[u?.audience&&(0,R.jsx)(J6,{facet:`audience`,value:u.audience}),u?.priority!==void 0&&(0,R.jsx)(J6,{facet:`priority`,value:u.priority})]})]})]})}var Dle=300;function Ole(e){let t=[],n=/\{(\w+)\}/g,r;for(;(r=n.exec(e))!==null;)t.push(r[1]);return t}function kle(e,t){return e.replace(/\{(\w+)\}/g,(e,n)=>t[n])}function Ale(e,t){return e.replace(/\{(\w+)\}/g,(e,n)=>t[n]?.length>0?t[n]:e)}var jle=H.withProps({justify:`space-between`,wrap:`nowrap`}),Mle=H.withProps({gap:`xs`,wrap:`nowrap`}),Nle=U.withProps({size:`sm`,c:W8(`blue`),truncate:`end`}),Ple=U.withProps({size:`sm`,c:`dimmed`}),Fle=H.withProps({justify:`flex-start`}),Ile=H.withProps({gap:`xs`});function Lle({template:e,onReadResource:t,onCompleteArgument:n,completionsSupported:r=!1}){let{name:i,title:a,uriTemplate:o,description:s,annotations:c}=e,l=(0,D.useMemo)(()=>Ole(o),[o]),[u,d]=(0,D.useState)(()=>Object.fromEntries(l.map(e=>[e,``]))),[f,p]=(0,D.useState)({});Z6(o,()=>{d(Object.fromEntries(l.map(e=>[e,``]))),p({})});let m=(0,D.useRef)(new Map),h=(0,D.useRef)(new Map);(0,D.useEffect)(()=>{let e=h.current,t=m.current;return()=>{for(let t of e.values())clearTimeout(t);e.clear();for(let e of t.values())e.abort();t.clear()}},[]);let g=r&&!!n,_=(0,D.useCallback)(async(e,t,r)=>{if(!n)return;m.current.get(e)?.abort();let i=new AbortController;m.current.set(e,i);try{let a=await n(e,t,r);if(i.signal.aborted)return;p(t=>({...t,[e]:a}))}catch{i.signal.aborted||p(t=>({...t,[e]:[]}))}finally{m.current.get(e)===i&&m.current.delete(e)}},[n]),v=(0,D.useRef)(u);(0,D.useEffect)(()=>{v.current=u},[u]);function y(e){let t={...v.current};return delete t[e],t}function b(e,t){if(d(n=>({...n,[e]:t})),!g)return;p(t=>{if(t[e]===void 0)return t;let n={...t};return delete n[e],n});let n=h.current.get(e);n&&clearTimeout(n);let r=setTimeout(()=>{h.current.delete(e),_(e,t,y(e))},Dle);h.current.set(e,r)}function x(e){if(!g)return;let t=h.current.get(e);t&&(clearTimeout(t),h.current.delete(e));let n=v.current[e]??``;_(e,n,y(e))}let S=l.every(e=>u[e]?.length>0);function C(){t(kle(o,u))}let w=Ale(o,u);return(0,R.jsxs)(W,{gap:`md`,children:[(0,R.jsxs)(jle,{children:[(0,R.jsxs)(Sv,{order:4,children:[a??i,` Template`]}),(0,R.jsxs)(Mle,{children:[(0,R.jsx)(Nle,{children:w}),(0,R.jsx)(h3,{value:w})]})]}),s&&(0,R.jsx)(Ple,{children:s}),(0,R.jsx)(W,{gap:`sm`,children:l.map(e=>{let t=u[e]??``;return g?(0,R.jsx)(Fp,{label:e,placeholder:`Enter ${e}`,value:t,data:f[e]??[],filter:({options:e})=>e,onChange:t=>b(e,t),onFocus:()=>x(e)},e):(0,R.jsx)(fv,{label:e,placeholder:`Enter ${e}`,value:t,onChange:t=>b(e,t.currentTarget.value),rightSectionPointerEvents:`auto`,rightSection:u[e]?(0,R.jsx)(P6,{onClick:()=>b(e,``)}):null},e)})}),(0,R.jsxs)(Fle,{children:[(0,R.jsx)(qp,{size:`sm`,disabled:!S,onClick:C,children:`Read Resource`}),(0,R.jsxs)(Ile,{children:[c?.audience&&(0,R.jsx)(J6,{facet:`audience`,value:c.audience}),c?.priority!==void 0&&(0,R.jsx)(J6,{facet:`priority`,value:c.priority})]})]})]})}var Rle=wd.withProps({variant:`screen`,h:`calc(100dvh - var(--app-shell-header-height, 0px) - var(--app-shell-footer-height, 0px))`,gap:`md`,p:`xl`}),zle=W.withProps({w:360,flex:`0 0 auto`}),Ble=$p.withProps({withBorder:!0,padding:`lg`,variant:`sidebar`}),Vle=$p.withProps({withBorder:!0,padding:`lg`}),J8=$p.withProps({withBorder:!0,padding:`lg`,variant:`preview`}),Y8=wd.withProps({flex:1,miw:0,direction:`column`,align:`stretch`}),Hle=U.withProps({c:`dimmed`,ta:`center`,py:`xl`}),Ule=W.withProps({align:`center`,py:`xl`}),Wle=Gd.withProps({color:`red`,variant:`light`,title:`Read Error`}),X8=`calc(100dvh - var(--app-shell-header-height, 0px) - var(--app-shell-footer-height, 0px) - var(--mantine-spacing-xl) * 2)`;function Gle({resources:e,templates:t,subscriptions:n,subscriptionStreamState:r,protocolEra:i,readState:a,ui:o,listChanged:s,completionsSupported:c,subscriptionsSupported:l=!0,onUiChange:u,onRefreshList:d,loadError:f,pagination:p,onReadResource:m,onSubscribeResource:h,onUnsubscribeResource:g,onCompleteArgument:_,compact:v,onCompactChange:y}){let{selectedResourceUri:b,selectedTemplateUri:x,originatingTemplateUri:S,search:C,openSections:w}=o,T=b?e.find(e=>e.uri===b):void 0,E=x?t.find(e=>e.uriTemplate===x):void 0,D=T??(a?.uri&&a.uri===b?{name:a.uri,uri:a.uri}:void 0);function O(e){u({...o,selectedTemplateUri:void 0,selectedResourceUri:e,originatingTemplateUri:void 0}),m(e)}function k(e){u({...o,selectedResourceUri:void 0,selectedTemplateUri:e,originatingTemplateUri:void 0})}function A(e){u({...o,originatingTemplateUri:x??S,selectedTemplateUri:void 0,selectedResourceUri:e}),m(e)}function j(){u(S?{...o,selectedResourceUri:void 0,selectedTemplateUri:S,originatingTemplateUri:void 0}:{...o,selectedResourceUri:void 0})}function M(){return a?a.status===`pending`?(0,R.jsx)(J8,{children:(0,R.jsxs)(W,{gap:`md`,children:[(0,R.jsx)(H,{justify:`flex-start`,children:(0,R.jsx)(Ou,{"aria-label":`Close preview`,onClick:j})}),(0,R.jsxs)(Ule,{children:[(0,R.jsx)(hu,{size:`sm`}),(0,R.jsx)(U,{c:`dimmed`,children:`Reading resource...`})]})]})}):a.status===`error`?(0,R.jsx)(J8,{children:(0,R.jsxs)(W,{gap:`md`,children:[(0,R.jsx)(H,{justify:`flex-start`,children:(0,R.jsx)(Ou,{"aria-label":`Close preview`,onClick:j})}),(0,R.jsx)(Wle,{children:a.error??`Failed to read resource`})]})}):a.result&&D?(0,R.jsx)(J8,{children:(0,R.jsx)(Ele,{resource:D,contents:a.result.contents,lastUpdated:a.lastUpdated,isSubscribed:a.isSubscribed??!1,subscriptionsSupported:l,onRefresh:()=>A(D.uri),onSubscribe:()=>h(D.uri),onUnsubscribe:()=>g(D.uri),onClose:j})}):null:null}return(0,R.jsxs)(Rle,{children:[(0,R.jsx)(zle,{children:(0,R.jsx)(Ble,{children:(0,R.jsx)(ile,{resources:e,templates:t,subscriptions:n,subscriptionsSupported:l,subscriptionStreamState:r,protocolEra:i,selectedUri:b,selectedTemplateUri:x,searchText:C,openSections:w,listChanged:s,onRefreshList:d,loadError:f,pagination:p,onSearchChange:e=>u({...o,search:e}),onOpenSectionsChange:e=>u({...o,openSections:e}),onSelectUri:O,onSelectTemplate:k,onUnsubscribeResource:g,compact:v,onCompactChange:y})})}),E?(0,R.jsx)(Y8,{mah:X8,children:(0,R.jsx)(J8,{children:(0,R.jsx)(Lle,{template:E,onReadResource:A,completionsSupported:c,onCompleteArgument:_?(e,t,n)=>_({type:`ref/resource`,uri:E.uriTemplate},e,t,n):void 0})})}):D?(0,R.jsx)(Y8,{mah:X8,children:M()}):(0,R.jsx)(Vle,{flex:1,children:(0,R.jsx)(Hle,{children:`Select a resource to preview`})})]})}var Kle=U.withProps({ta:`center`,fw:500}),qle=xl.withProps({w:`100%`,p:`sm`,variant:`filterToggle`});function Z8({label:e,color:t,active:n,onToggle:r}){return(0,R.jsx)(qle,{"aria-pressed":n,onClick:()=>r(!n),children:(0,R.jsx)(Kle,{c:W8(t),children:e})})}var Q8=[`debug`,`info`,`notice`,`warning`,`error`,`critical`,`alert`,`emergency`],Jle={debug:{c:`dimmed`},info:{c:`blue`},notice:{c:`teal`},warning:{c:`yellow`},error:{c:`red`},critical:{c:`red`},alert:{c:`red`},emergency:{c:`red`}},$8=`__off__`,Yle=qp.withProps({variant:`subtle`,size:`xs`}),Xle=U.withProps({size:`xs`,c:`var(--inspector-text-secondary)`}),Zle=P_.withProps({"aria-label":`Set Active Level`,flex:1}),Qle=P_.withProps({"aria-label":`Log Level per Request`,allowDeselect:!1}),e5=Q8.map(e=>({value:e,label:e})),$le=({currentLevel:e,onSetLevel:t})=>(0,R.jsxs)(R.Fragment,{children:[(0,R.jsx)(Sv,{order:5,children:`Set Active Level`}),(0,R.jsxs)(H,{wrap:`nowrap`,children:[(0,R.jsx)(Zle,{data:e5,value:e,onChange:e=>{e&&Q8.includes(e)&&t(e)}}),(0,R.jsx)(qp,{size:`sm`,onClick:()=>t(e),children:`Set`})]})]}),eue=({modernLogLevel:e,onSetModernLogLevel:t})=>(0,R.jsxs)(R.Fragment,{children:[(0,R.jsx)(Sv,{order:5,children:`Log Level per Request`}),(0,R.jsx)(Xle,{children:`Modern servers only emit logs for requests that opt in. The level you choose is stamped on every request, and logs arrive on the originating request's stream. Choose Off to stop requesting logs.`}),(0,R.jsx)(Qle,{data:[{value:$8,label:`Off (no logs)`},...e5],value:e??$8,onChange:e=>{e===$8?t?.(null):e&&Q8.includes(e)&&t?.(e)}})]});function tue({currentLevel:e,filterText:t,visibleLevels:n,onSetLevel:r,onFilterChange:i,onToggleLevel:a,onToggleAllLevels:o,protocolEra:s,modernLogLevel:c=null,onSetModernLogLevel:l}){return(0,R.jsxs)(W,{gap:`md`,children:[(0,R.jsx)(Sv,{order:4,children:`Logging`}),(0,R.jsx)(fv,{placeholder:`Search...`,value:t,onChange:e=>i(e.currentTarget.value),rightSectionPointerEvents:`auto`,rightSection:t?(0,R.jsx)(P6,{onClick:()=>i(``)}):null}),R8(s)?(0,R.jsx)(eue,{modernLogLevel:c,onSetModernLogLevel:l}):(0,R.jsx)($le,{currentLevel:e,onSetLevel:r}),(0,R.jsxs)(H,{justify:`space-between`,children:[(0,R.jsx)(Sv,{order:5,children:`Filter by Level`}),(0,R.jsx)(Yle,{onClick:o,children:Object.values(n).every(Boolean)?`Deselect All`:`Select All`})]}),(0,R.jsx)(W,{gap:`xs`,children:Q8.map(e=>(0,R.jsx)(Z8,{label:e,color:Jle[e].c,active:n[e],onToggle:t=>a(e,t)},e))})]})}var t5={debug:`dimmed`,info:`blue`,notice:void 0,warning:`yellow`,error:`red`,critical:`red`,alert:`red`,emergency:`red`};function n5(e){return e.toLocaleTimeString()}function nue(e){return`[${e}]`}function rue(e){return e==null?``:typeof e==`string`?e:JSON.stringify(e)}var r5=U.withProps({size:`sm`,ff:`monospace`,c:`dimmed`}),iue=U.withProps({size:`xs`,ff:`monospace`,c:`dimmed`}),aue=U.withProps({size:`sm`,ff:`monospace`}),oue=U.withProps({size:`sm`,ff:`monospace`,variant:`consoleLine`}),sue=H.withProps({gap:`xs`,wrap:`nowrap`,align:`center`}),cue=H.withProps({gap:`sm`,wrap:`nowrap`});function lue({entry:e,compact:t=!1}){let{receivedAt:n,params:r}=e,i=rue(r.data),a=r.logger?(0,R.jsx)(iue,{children:nue(r.logger)}):null;return t?(0,R.jsxs)(W,{gap:2,children:[(0,R.jsxs)(sue,{children:[(0,R.jsx)(r5,{children:n5(n)}),(0,R.jsx)(S8,{level:r.level}),a]}),(0,R.jsx)(oue,{c:W8(t5[r.level]),children:i})]}):(0,R.jsxs)(cue,{children:[(0,R.jsx)(r5,{children:n5(n)}),(0,R.jsx)(S8,{level:r.level}),a,(0,R.jsx)(aue,{c:W8(t5[r.level]),children:i})]})}var uue=[{value:`newest-first`,label:`Newest First`},{value:`oldest-first`,label:`Oldest First`}];function due(e){return e===`oldest-first`||e===`newest-first`}var fue=P_.withProps({size:`sm`,w:150,allowDeselect:!1,withCheckIcon:!1});function i5({value:e,onChange:t,"aria-label":n=`Sort direction`}){return(0,R.jsx)(fue,{data:uue,value:e,onChange:e=>{due(e)&&t(e)},rightSection:(0,R.jsx)(e===`newest-first`?fW:pW,{size:16}),"aria-label":n})}var pue=`calc(100vh - var(--app-shell-header-height, 0px) - var(--app-shell-footer-height, 0px) - 150px)`,mue={content:{minWidth:0}},a5=_l.Autosize.withProps({type:`scroll`,offsetScrollbars:!0,viewportProps:{tabIndex:0}}),hue=W.withProps({flex:1,mih:0,gap:0});function o5({embedded:e,viewportRef:t,children:n,constrainContentWidth:r=!1}){let i=r?mue:void 0;return e?(0,R.jsx)(hue,{children:(0,R.jsx)(a5,{viewportRef:t,mah:`100%`,styles:i,children:n})}):(0,R.jsx)(a5,{viewportRef:t,mah:pue,styles:i,children:n})}var gue=El.withProps({withBorder:!0,p:`lg`,flex:1,variant:`panel`}),_ue=W.withProps({flex:1,align:`center`,justify:`center`}),vue=H.withProps({justify:`space-between`,mb:`sm`});function yue(e){return e==null?``:typeof e==`string`?e:JSON.stringify(e)}function bue(e,t,n,r){if(!r&&!n[e.params.level])return!1;if(t){let n=t.toLowerCase();if(!`${yue(e.params.data)} ${e.params.logger??``} ${e.params.level}`.toLowerCase().includes(n))return!1}return!0}function xue({entries:e,filterText:t,visibleLevels:n,onClear:r,onExport:i,sortDirection:a,onSortChange:o,embedded:s=!1}){let c=V6(`logs-stream`),l=(0,D.useMemo)(()=>{let r=e.filter(e=>bue(e,t,n,s)).sort((e,t)=>e.receivedAt.getTime()-t.receivedAt.getTime());return a===`newest-first`&&r.reverse(),r},[e,t,n,a,s]);return(0,R.jsxs)(gue,{children:[(0,R.jsxs)(vue,{children:[(0,R.jsx)(Sv,{order:4,children:`Log Stream`}),(0,R.jsxs)(H,{children:[(0,R.jsx)(i5,{value:a,onChange:o,"aria-label":`Logs sort direction`}),(0,R.jsx)(qp,{variant:`default`,onClick:r,disabled:e.length===0,children:`Clear`}),(0,R.jsx)(qp,{variant:`default`,onClick:i,disabled:e.length===0,children:`Export`})]})]}),l.length>0?(0,R.jsx)(o5,{embedded:s,viewportRef:c,children:(0,R.jsx)(W,{gap:`xs`,children:l.map((e,t)=>(0,R.jsx)(lue,{entry:e,compact:s},t))})}):(0,R.jsx)(_ue,{children:(0,R.jsx)(U,{c:`dimmed`,children:`No log entries`})})]})}var s5={debug:!0,info:!0,notice:!0,warning:!0,error:!0,critical:!0,alert:!0,emergency:!0},Sue={debug:!1,info:!1,notice:!1,warning:!1,error:!1,critical:!1,alert:!1,emergency:!1},Cue=wd.withProps({variant:`screen`,h:`calc(100dvh - var(--app-shell-header-height, 0px) - var(--app-shell-footer-height, 0px))`,gap:`md`,p:`xl`}),wue=W.withProps({w:340,flex:`0 0 auto`}),Tue=$p.withProps({withBorder:!0,padding:`lg`});function c5({entries:e,currentLevel:t,ui:n,onUiChange:r,onSetLevel:i,protocolEra:a,modernLogLevel:o=null,onSetModernLogLevel:s,onClear:c,onExport:l,sortDirection:u,onSortChange:d,embedded:f=!1}){let{filterText:p,visibleLevels:m}=n;function h(e,t){r({...n,visibleLevels:{...m,[e]:t}})}function g(){let e=Object.values(m).every(Boolean);r({...n,visibleLevels:e?Sue:s5})}return(0,R.jsxs)(Cue,{...f?{h:`100%`,pt:`md`}:{},children:[f?null:(0,R.jsx)(wue,{children:(0,R.jsx)(Tue,{children:(0,R.jsx)(tue,{currentLevel:t,filterText:p,visibleLevels:m,onSetLevel:i,protocolEra:a,modernLogLevel:o,onSetModernLogLevel:s,onFilterChange:e=>r({...n,filterText:e}),onToggleLevel:h,onToggleAllLevels:g})})}),(0,R.jsx)(xue,{entries:e,filterText:p,visibleLevels:m,onClear:c,onExport:l,sortDirection:u,onSortChange:d,embedded:f})]})}var l5=[`working`,`input_required`,`completed`,`failed`,`cancelled`],Eue=qp.withProps({variant:`subtle`,size:`sm`}),Due=H.withProps({flex:1,justify:`space-between`}),Oue=fv.withProps({placeholder:`Search...`,rightSectionPointerEvents:`auto`}),kue=Sv.withProps({order:5,size:`h6`}),Aue=P_.withProps({placeholder:`All statuses`,clearable:!0});function jue({searchText:e,statusFilter:t,onSearchChange:n,onStatusFilterChange:r,onRefresh:i}){return(0,R.jsxs)(W,{gap:`md`,children:[(0,R.jsxs)(Due,{children:[(0,R.jsx)(Sv,{order:4,children:`Tasks`}),(0,R.jsx)(Eue,{onClick:i,children:`Refresh`})]}),(0,R.jsx)(Sv,{order:5,children:`Search`}),(0,R.jsx)(Oue,{value:e,onChange:e=>n(e.currentTarget.value),rightSection:e?(0,R.jsx)(P6,{onClick:()=>n(``)}):null}),(0,R.jsx)(kue,{children:`Filter by Status`}),(0,R.jsx)(Aue,{data:l5,value:t??null,onChange:e=>r(e&&l5.includes(e)?e:void 0)})]})}var Mue={working:`blue`,input_required:`yellow`,completed:`green`,failed:`red`,cancelled:`gray`},Nue={working:`working`,input_required:`input required`,completed:`completed`,failed:`failed`,cancelled:`cancelled`},Pue=Rp.withProps({variant:`filled`,autoContrast:!0});function Fue({status:e}){return(0,R.jsx)(Pue,{color:q6(Mue[e]),children:Nue[e]})}var Iue=$p.withProps({withBorder:!0,padding:`md`,variant:`inset`}),Lue=H.withProps({justify:`space-between`,wrap:`nowrap`}),u5=U.withProps({size:`sm`,ff:`monospace`,c:`dimmed`}),d5=U.withProps({size:`sm`,c:`dimmed`}),f5=U.withProps({size:`sm`,fw:500}),Rue=U.withProps({size:`sm`,fs:`italic`}),zue=qp.withProps({variant:`subtle`,color:`red`,size:`xs`}),Bue=H.withProps({gap:`xl`,wrap:`wrap`}),Vue=H.withProps({justify:`space-between`,wrap:`nowrap`}),Hue=H.withProps({gap:`sm`}),Uue=H.withProps({gap:`xs`,wrap:`nowrap`}),p5=U.withProps({size:`sm`,fw:600});function m5(e){return`ID: ${e}`}function Wue(e){return`${e}ms`}function h5({task:e,progress:t,isListExpanded:n,onCancel:r,embedded:i=!1}){let{taskId:a,status:o,ttl:s,createdAt:c,lastUpdatedAt:l,statusMessage:u}=e,[d,f]=(0,D.useState)(n),p=o===`working`||o===`input_required`;return Z6(n,f),(0,R.jsx)(Iue,{children:(0,R.jsxs)(W,{gap:`sm`,children:[(0,R.jsxs)(Lue,{children:[(0,R.jsxs)(Hue,{children:[(0,R.jsx)(p5,{children:`Task Details`}),!i&&(0,R.jsx)(u5,{children:m5(a)})]}),(0,R.jsxs)(Uue,{children:[p&&(0,R.jsx)(zue,{onClick:r,children:`Cancel Task`}),(0,R.jsx)(Fue,{status:o})]})]}),i&&(0,R.jsx)(u5,{truncate:`end`,children:m5(a)}),(0,R.jsxs)(Vue,{children:[(0,R.jsxs)(Bue,{children:[(0,R.jsxs)(W,{gap:2,children:[(0,R.jsx)(d5,{children:`Last Updated`}),(0,R.jsx)(f5,{children:l})]}),(0,R.jsxs)(W,{gap:2,children:[(0,R.jsx)(d5,{children:`Created At`}),(0,R.jsx)(f5,{children:c})]}),s!=null&&(0,R.jsxs)(W,{gap:2,children:[(0,R.jsx)(d5,{children:`TTL`}),(0,R.jsx)(f5,{children:Wue(s)})]})]}),(0,R.jsx)(t8,{expanded:d,onToggle:()=>f(e=>!e)})]}),t&&p?(0,R.jsx)(X6,{params:t}):u&&(0,R.jsx)(Rue,{children:u}),(0,R.jsx)(oa,{in:d,children:(0,R.jsxs)(W,{gap:`sm`,children:[(0,R.jsx)(cm,{}),(0,R.jsx)(p5,{children:`Full Task Object`}),(0,R.jsx)(f6,{block:{type:`text`,text:JSON.stringify(e)},copyable:!0})]})})]})})}var Gue=El.withProps({withBorder:!0,p:`lg`,flex:1,variant:`panel`}),Kue=qp.withProps({variant:`subtle`,size:`sm`}),que=H.withProps({justify:`space-between`,mb:`sm`}),Jue=U.withProps({c:`dimmed`,ta:`center`,py:`xl`});function Yue(e){return`Active (${e})`}function Xue(e){return`Completed (${e})`}function g5(e){return e===`working`||e===`input_required`}function Zue(e,t,n,r){if(!r&&n&&e.status!==n)return!1;if(t){let n=t.toLowerCase();if(!`${e.taskId} ${e.status} ${e.statusMessage??``}`.toLowerCase().includes(n))return!1}return!0}function Que({tasks:e,progressByTaskId:t,searchText:n,statusFilter:r,onCancel:i,onClearCompleted:a,embedded:o=!1}){let s=V6(`tasks-list`),[c,l]=(0,D.useState)(!1),u=(0,D.useMemo)(()=>e.filter(e=>Zue(e,n,r,o)),[e,n,r,o]),d=(0,D.useMemo)(()=>u.filter(e=>g5(e.status)),[u]),f=(0,D.useMemo)(()=>u.filter(e=>!g5(e.status)),[u]),p=u.length>0;return(0,R.jsxs)(Gue,{children:[(0,R.jsxs)(que,{children:[(0,R.jsx)(Sv,{order:4,children:`Tasks`}),p&&(0,R.jsx)(j6,{compact:c,onToggle:()=>l(e=>!e)})]}),p?(0,R.jsx)(o5,{embedded:o,viewportRef:s,children:(0,R.jsxs)(W,{gap:`md`,children:[d.length>0&&(0,R.jsxs)(R.Fragment,{children:[(0,R.jsx)(Sv,{order:5,children:Yue(d.length)}),d.map(e=>(0,R.jsx)(h5,{task:e,progress:t?.[e.taskId],isListExpanded:!c,onCancel:()=>i(e.taskId),embedded:o},e.taskId))]}),f.length>0&&(0,R.jsxs)(R.Fragment,{children:[(0,R.jsxs)(H,{justify:`space-between`,children:[(0,R.jsx)(Sv,{order:5,children:Xue(f.length)}),(0,R.jsx)(Kue,{onClick:a,children:`Clear`})]}),f.map(e=>(0,R.jsx)(h5,{task:e,progress:t?.[e.taskId],isListExpanded:!c,onCancel:()=>i(e.taskId),embedded:o},e.taskId))]})]})}):(0,R.jsx)(Jue,{children:`No tasks`})]})}var $ue=wd.withProps({variant:`screen`,h:`calc(100dvh - var(--app-shell-header-height, 0px) - var(--app-shell-footer-height, 0px))`,gap:`md`,p:`xl`}),ede=W.withProps({w:340,flex:`0 0 auto`}),tde=$p.withProps({withBorder:!0,padding:`lg`});function _5({tasks:e,progressByTaskId:t,ui:n,onUiChange:r,onRefresh:i,onClearCompleted:a,onCancel:o,embedded:s=!1}){let{search:c,statusFilter:l}=n;return(0,R.jsxs)($ue,{...s?{h:`100%`,pt:`md`}:{},children:[s?null:(0,R.jsx)(ede,{children:(0,R.jsx)(tde,{children:(0,R.jsx)(jue,{searchText:c,statusFilter:l,onSearchChange:e=>r({...n,search:e}),onStatusFilterChange:e=>r({...n,statusFilter:e}),onRefresh:i})})}),(0,R.jsx)(Que,{tasks:e,progressByTaskId:t,searchText:c,statusFilter:l,onCancel:o,onClearCompleted:a,embedded:s})]})}var nde=qp.withProps({variant:`subtle`,size:`xs`}),rde=Sv.withProps({order:5,size:`h6`}),ide=[{origin:`client`,label:`client → server`,color:`green`},{origin:`server`,label:`server → client`,color:`violet`}];function ade({visibleDirections:e,onToggleDirection:t,onToggleAllDirections:n}){return(0,R.jsxs)(R.Fragment,{children:[(0,R.jsxs)(H,{justify:`space-between`,children:[(0,R.jsx)(rde,{children:`Filter by Message Direction`}),(0,R.jsx)(nde,{onClick:n,children:Object.values(e).every(Boolean)?`Deselect All`:`Select All`})]}),(0,R.jsx)(W,{gap:`xs`,children:ide.map(({origin:n,label:r,color:i})=>(0,R.jsx)(Z8,{label:r,color:i,active:e[n],onToggle:e=>t(n,e)},n))})]})}var ode=fv.withProps({placeholder:`Search...`,rightSectionPointerEvents:`auto`}),sde=Sv.withProps({order:5,size:`h6`}),cde=P_.withProps({placeholder:`All methods`,clearable:!0});function lde({searchText:e,methodFilter:t,availableMethods:n,visibleDirections:r,onSearchChange:i,onMethodFilterChange:a,onToggleDirection:o,onToggleAllDirections:s}){return(0,R.jsxs)(W,{gap:`md`,children:[(0,R.jsx)(Sv,{order:4,children:`Protocol`}),(0,R.jsx)(ode,{value:e,onChange:e=>i(e.currentTarget.value),rightSection:e?(0,R.jsx)(P6,{onClick:()=>i(``)}):null}),(0,R.jsx)(sde,{children:`Filter by Method`}),(0,R.jsx)(cde,{data:n,value:t??null,onChange:e=>a(e??void 0)}),(0,R.jsx)(ade,{visibleDirections:r,onToggleDirection:o,onToggleAllDirections:s})]})}var ude={outgoing:`client → server`,incoming:`server → client`},dde={outgoing:`var(--inspector-badge-outgoing-bg)`,incoming:`var(--inspector-badge-incoming-bg)`},fde={outgoing:`var(--inspector-badge-outgoing-fg)`,incoming:`var(--inspector-badge-incoming-fg)`};function pde({direction:e}){return(0,R.jsx)(Rp,{autoContrast:!1,bg:dde[e],c:fde[e],children:ude[e]})}var mde=Rp.withProps({autoContrast:!1,bg:`var(--inspector-badge-method-bg)`,c:`var(--inspector-badge-method-fg)`});function v5({method:e}){return(0,R.jsx)(mde,{children:e})}var hde={[-32020]:`red`,[-32021]:`orange`,[-32022]:`grape`,[-32601]:`yellow`},gde=Rp.withProps({variant:`filled`,autoContrast:!0,tt:`none`}),_de=k_.withProps({multiline:!0,w:280,withArrow:!0});function vde({code:e,name:t,description:n}){let r=(0,R.jsxs)(gde,{color:q6(hde[e]??`red`),children:[e,` `,t]});return n?(0,R.jsx)(_de,{label:n,children:r}):r}function yde(e){return YU({tag:`svg`,attr:{version:`1.2`,baseProfile:`tiny`,viewBox:`0 0 24 24`},child:[{tag:`path`,attr:{d:`M16.729 4.271c-.389-.391-1.021-.393-1.414-.004-.104.104-.176.227-.225.355-.832 1.736-1.748 2.715-2.904 3.293-1.297.64-2.786 1.085-5.186 1.085-.13 0-.26.025-.382.076-.245.102-.439.297-.541.541-.101.244-.101.52 0 .764.051.123.124.234.217.326l3.243 3.243-4.537 6.05 6.05-4.537 3.242 3.242c.092.094.203.166.326.217.122.051.252.078.382.078s.26-.027.382-.078c.245-.102.44-.295.541-.541.051-.121.077-.252.077-.381 0-2.4.444-3.889 1.083-5.166.577-1.156 1.556-2.072 3.293-2.904.129-.049.251-.121.354-.225.389-.393.387-1.025-.004-1.414l-3.997-4.02z`},child:[]}]})(e)}function bde(e){return YU({tag:`svg`,attr:{version:`1.2`,baseProfile:`tiny`,viewBox:`0 0 24 24`},child:[{tag:`path`,attr:{d:`M21.436 7.586l-3.998-4.02c-.752-.756-2.063-.764-2.83-.006-.196.196-.35.436-.418.629-.653 1.362-1.354 2.215-2.254 2.727l-.217.105c-.968.485-2.285.979-4.719.979-.266 0-.521.052-.766.152-.484.202-.879.595-1.082 1.084-.199.484-.199 1.041 0 1.525.104.249.25.471.435.651l3.235 3.235-3.822 5.353 5.352-3.822 3.227 3.227c.186.189.406.339.656.441.247.103.503.154.766.154s.519-.052.765-.154c.498-.205.883-.592 1.08-1.078.103-.242.155-.507.155-.768 0-2.436.494-3.752.978-4.721.496-.992 1.369-1.748 2.754-2.414.271-.104.51-.256.711-.457.772-.782.768-2.051-.008-2.822zm-5.248 4.801c-.819 1.643-1.188 3.37-1.195 5.604l-7.993-7.991c2.139 0 3.814-.335 5.396-1.084l.235-.105c1.399-.699 2.468-1.893 3.388-3.834l3.924 4.051c-1.863.893-3.056 1.96-3.755 3.359z`},child:[]}]})(e)}var xde=Cu.withProps({variant:`subtle`,color:`gray`,size:`md`});function y5({pinned:e,onToggle:t}){let n=e?yde:bde,r=e?`Unpin`:`Pin`;return(0,R.jsx)(k_,{label:r,children:(0,R.jsx)(xde,{"aria-label":r,onClick:t,children:(0,R.jsx)(n,{size:18})})})}var Sde=Cu.withProps({variant:`subtle`,color:`gray`,size:`md`,"aria-label":`Replay`});function b5({onReplay:e}){return(0,R.jsx)(k_,{label:`Replay`,children:(0,R.jsx)(Sde,{onClick:e,children:(0,R.jsx)(iW,{size:18})})})}var Cde=-32020,wde=`=?base64?`,Tde=`?=`,Ede=new Set([`mcp-method`,`mcp-name`,`mcp-protocol-version`]),Dde=`mcp-param-`,Ode=`io.modelcontextprotocol/protocolVersion`;function kde(e){return Ede.has(e.toLowerCase())}function Ade(e){return e.toLowerCase().startsWith(Dde)}function x5(e){return kde(e)||Ade(e)}function S5(e){if(!(e.length>=11&&e.startsWith(wde)&&e.endsWith(Tde)))return{value:e,encoded:!1,raw:e};let t=e.slice(9,e.length-2);try{let n=atob(t),r=Uint8Array.from(n,e=>e.charCodeAt(0));return{value:new TextDecoder().decode(r),encoded:!0,raw:e}}catch{return{value:e,encoded:!0,raw:e}}}function jde(e){if(!e)return null;let t;try{t=JSON.parse(e)}catch{return null}let n=Array.isArray(t)?t:[t];for(let e of n){if(typeof e!=`object`||!e||!(`error`in e))continue;let t=e.error;if(typeof t!=`object`||!t)continue;let{code:n,message:r,data:i}=t;if(typeof n==`number`)return{code:n,message:typeof r==`string`?r:``,data:i}}return null}var Mde={[Cde]:{name:`HeaderMismatch`,description:`An Mcp-* header did not match the JSON-RPC body (SEP-2243). The server rejected the request pre-dispatch.`,expectedHttpStatus:400,httpRelevant:!0},[zk.MissingRequiredClientCapability]:{name:`MissingRequiredClientCapability`,description:`The server requires a client capability that was not declared (SEP-2575).`,expectedHttpStatus:400,httpRelevant:!1},[zk.UnsupportedProtocolVersion]:{name:`UnsupportedProtocolVersion`,description:`The requested protocol version is not supported (SEP-2575). The error body lists the supported versions.`,expectedHttpStatus:400,httpRelevant:!1},[zk.MethodNotFound]:{name:`MethodNotFound`,description:`Unknown method. A JSON-RPC error body on an HTTP 404 marks a modern server — a legacy HTTP+SSE server returns a bare 404 with no body.`,expectedHttpStatus:404,httpRelevant:!0}};function Nde(e){if(typeof e!=`object`||!e)return;let t=e.supported;if(!Array.isArray(t))return;let n=t.filter(e=>typeof e==`string`);return n.length>0?n:void 0}function Pde(e,t,n){let r=Mde[e];if(!r||e===zk.MethodNotFound&&n!==404)return null;let i={code:e,...r};if(e===zk.UnsupportedProtocolVersion){let e=Nde(t);e&&(i.supported=e)}return i}function Fde(e){if(!e)return null;try{let t=JSON.parse(e);return typeof t!=`object`||!t||Array.isArray(t)?null:t}catch{return null}}function C5(e,t){for(let[n,r]of Object.entries(e))if(n.toLowerCase()===t)return r}function Ide(e){let t=Fde(e.requestBody);if(!t)return[];let n=[],r=C5(e.requestHeaders,`mcp-method`);r!==void 0&&typeof t.method==`string`&&n.push({header:`mcp-method`,expected:t.method,actual:r,ok:r===t.method});let i=C5(e.requestHeaders,`mcp-name`),a=typeof t.params?.name==`string`?t.params.name:typeof t.params?.uri==`string`?t.params.uri:void 0;if(i!==void 0&&a!==void 0){let e=S5(i).value;n.push({header:`mcp-name`,expected:a,actual:e,ok:e===a})}let o=C5(e.requestHeaders,`mcp-protocol-version`),s=t.params?._meta?.[Ode];return o!==void 0&&typeof s==`string`&&n.push({header:`mcp-protocol-version`,expected:s,actual:o,ok:o===s}),n}function w5(e){if(!e.error)return!1;let t=e.error.toLowerCase();return t.includes(`abort`)||t.includes(`cancel`)}function T5(e){return`method`in e.message?e.message.method:`response`}var Lde=new Set([`tools/call`,`prompts/get`,`resources/read`,`tools/list`,`prompts/list`,`resources/list`,`resources/templates/list`,`tasks/list`,`ping`]);function E5(e){return Lde.has(e)}function D5(e){let t=e.response;if(!t||`error`in t)return;let n=t.result;return n&&typeof n==`object`?n:void 0}function O5(e){let t=e.message;if(!(!(`params`in t)||!t.params))return t.params}function k5(e){let t=D5(e);if(t)return PA(t)?`input_required`:t.resultType===`complete`?`complete`:void 0}function Rde(e){let t=D5(e)?.requestState;if(typeof t==`string`&&t.length>0)return t;let n=O5(e)?.requestState;if(typeof n==`string`&&n.length>0)return n}function zde(e){let t=O5(e)?._meta?.[kT];return typeof t==`string`?t:void 0}function Bde(e){let t=[];for(let n of e){let e=Rde(n);if(e){let r=t[t.length-1];if(r?.kind===`mrtr`&&r.requestState===e){r.rounds.push(n);continue}t.push({kind:`mrtr`,requestState:e,rounds:[n]});continue}t.push({kind:`single`,entry:n})}return t}var Vde=$p.withProps({withBorder:!0,padding:`md`,variant:`inset`}),A5=H.withProps({justify:`space-between`,wrap:`nowrap`}),j5=H.withProps({gap:`sm`,wrap:`nowrap`,miw:0}),M5=H.withProps({gap:`xs`,wrap:`nowrap`}),N5=U.withProps({size:`sm`,c:`dimmed`,ff:`monospace`}),Hde=U.withProps({size:`sm`,fw:500}),Ude=U.withProps({size:`sm`,fw:500,variant:`nowrap`}),Wde=U.withProps({size:`sm`,c:`dimmed`}),Gde=U.withProps({size:`sm`,c:`dimmed`}),Kde=U.withProps({size:`sm`,ff:`monospace`}),qde=H.withProps({gap:4,wrap:`nowrap`,miw:0}),Jde=Gd.withProps({variant:`light`,color:`red`,icon:(0,R.jsx)(E6,{})}),Yde=Gd.withProps({variant:`light`,color:`red`,icon:(0,R.jsx)(E6,{}),title:`Rejected by the Inspector`}),Xde=Qd.withProps({component:`button`,type:`button`,size:`xs`}),Zde=_l.withProps({scrollbarSize:6,flex:1,miw:0,viewportProps:{tabIndex:0}}),Qde=H.withProps({gap:`xs`,justify:`flex-end`});function $de(e){return e===`input_required`?`yellow`:`green`}function efe(e){return e===`input_required`?`input required`:`complete`}function tfe(e){return`${e}ms`}function nfe(e){return e.toISOString()}function rfe(e){return e.toISOString().slice(11,19)}function ife(e){let t=e.message;if(!(`params`in t)||!t.params)return;let n=t.params;if(typeof n.name==`string`)return n.name;if(typeof n.uri==`string`)return n.uri}function afe(e){let t=e.message;if(!(`params`in t)||!t.params)return;let n=t.params;return typeof n.uri==`string`?n.uri:void 0}function ofe(e){return e.clientError?`error`:e.direction===`request`?e.response?`error`in e.response?`error`:`success`:`pending`:`none`}function sfe(e){return e===`success`?`green`:e===`error`?`red`:`gray`}function cfe(e){return e===`success`?`OK`:e===`error`?`Error`:`Pending`}function P5(e){return JSON.stringify(e)}function lfe(e,t){let n=e.response&&`error`in e.response?e.response.error:`error`in e.message?e.message.error:void 0;return!n||typeof n.code!=`number`?null:Pde(n.code,n.data,t)}function ufe({error:e,onReveal:t}){return(0,R.jsx)(Jde,{title:`${e.code} ${e.name}`,children:(0,R.jsxs)(W,{gap:`xs`,children:[(0,R.jsx)(U,{size:`xs`,children:e.description}),e.supported&&(0,R.jsxs)(U,{size:`xs`,children:[`Server supports: `,e.supported.join(`, `)]}),t&&(0,R.jsx)(Xde,{onClick:t,children:`View the HTTP request in the Network tab →`})]})})}function F5({entry:e,isPinned:t,isListExpanded:n,onReplay:r,onTogglePin:i,embedded:a=!1,onRevealInNetwork:o,correlatedHttpStatus:s}){let[c,l]=(0,D.useState)(n),u=T5(e),d=ife(e),f=afe(e),p=ofe(e),m=E5(u),h=k5(e),g=zde(e);Z6(n,l);let _=e.origin&&(0,R.jsx)(pde,{direction:e.origin===`client`?`outgoing`:`incoming`}),v=lfe(e,s),y=v&&(0,R.jsx)(vde,{code:v.code,name:v.name,description:v.description}),b=h&&(0,R.jsx)(Rp,{color:$de(h),variant:`status`,children:efe(h)}),x=p!==`none`&&(!h||e.clientError)&&(0,R.jsx)(Rp,{color:sfe(p),variant:`status`,children:cfe(p)}),S=g&&(0,R.jsxs)(qde,{children:[(0,R.jsx)(Gde,{children:`sub`}),(0,R.jsx)(h3,{value:g}),(0,R.jsx)(Kde,{children:g})]}),C=e.duration!=null&&(0,R.jsx)(Wde,{children:tfe(e.duration)});return(0,R.jsx)(Vde,{children:(0,R.jsxs)(W,{gap:`sm`,children:[a?(0,R.jsxs)(W,{gap:`xs`,children:[(0,R.jsxs)(A5,{children:[(0,R.jsxs)(j5,{children:[(0,R.jsx)(N5,{children:rfe(e.timestamp)}),_]}),(0,R.jsxs)(M5,{children:[C,b,x,S]})]}),(0,R.jsxs)(A5,{children:[(0,R.jsxs)(j5,{flex:1,children:[(0,R.jsx)(v5,{method:u}),d&&(0,R.jsxs)(R.Fragment,{children:[f&&(0,R.jsx)(h3,{value:f}),(0,R.jsx)(Zde,{children:(0,R.jsx)(Ude,{children:d})})]})]}),(0,R.jsxs)(M5,{children:[m&&(0,R.jsx)(b5,{onReplay:r}),(0,R.jsx)(y5,{pinned:t,onToggle:i}),(0,R.jsx)(t8,{expanded:c,onToggle:()=>l(e=>!e)})]})]})]}):(0,R.jsxs)(R.Fragment,{children:[(0,R.jsxs)(A5,{children:[(0,R.jsxs)(H,{gap:`sm`,children:[(0,R.jsx)(N5,{children:nfe(e.timestamp)}),_,(0,R.jsx)(v5,{method:u}),y,S,d&&(0,R.jsxs)(R.Fragment,{children:[f&&(0,R.jsx)(h3,{value:f}),(0,R.jsx)(Hde,{children:d})]})]}),(0,R.jsxs)(H,{gap:`sm`,children:[C,b,x]})]}),(0,R.jsxs)(Qde,{children:[m&&(0,R.jsx)(b5,{onReplay:r}),(0,R.jsx)(y5,{pinned:t,onToggle:i}),(0,R.jsx)(t8,{expanded:c,onToggle:()=>l(e=>!e)})]})]}),(0,R.jsx)(oa,{in:c,children:(0,R.jsxs)(W,{gap:`sm`,children:[(0,R.jsx)(cm,{}),e.clientError&&(0,R.jsx)(Yde,{children:(0,R.jsx)(U,{size:`xs`,children:e.clientError})}),v&&(0,R.jsx)(ufe,{error:v,onReveal:v.httpRelevant?o:void 0}),`params`in e.message&&e.message.params&&(0,R.jsxs)(W,{gap:`xs`,children:[(0,R.jsx)(U,{size:`sm`,children:`Parameters:`}),(0,R.jsx)(f6,{block:{type:`text`,text:P5(e.message.params)},copyable:!0})]}),e.response&&(0,R.jsxs)(W,{gap:`xs`,children:[(0,R.jsx)(U,{size:`sm`,children:`Response:`}),(0,R.jsx)(f6,{block:{type:`text`,text:P5(e.response)},copyable:!0})]})]})})]})})}var dfe=El.withProps({withBorder:!0,p:`md`,radius:`md`}),ffe=H.withProps({justify:`space-between`,wrap:`nowrap`}),pfe=H.withProps({gap:`sm`,wrap:`nowrap`,miw:0}),mfe=H.withProps({gap:`sm`,wrap:`nowrap`}),hfe=U.withProps({size:`sm`,fw:600,c:`dimmed`}),gfe=U.withProps({size:`xs`,fw:600,c:`dimmed`}),_fe=Rp.withProps({color:`blue`,variant:`outline`});function vfe(e){return e.response?`error`in e.response?`error`:k5(e)===`input_required`?`awaiting`:`complete`:`pending`}function yfe(e){switch(e){case`complete`:return`green`;case`error`:return`red`;case`awaiting`:return`yellow`;default:return`gray`}}function bfe(e){switch(e){case`complete`:return`Complete`;case`error`:return`Error`;case`awaiting`:return`Awaiting input`;default:return`Pending`}}function xfe(e){return e===1?`1 round`:`${e} rounds`}function Sfe(e){return`Round ${e+1}`}function Cfe({requestState:e,rounds:t,pinnedIds:n,isListExpanded:r,embedded:i=!1,onReplay:a,onTogglePin:o}){let[s,c]=(0,D.useState)(r);Z6(r,c);let l=[...t].sort((e,t)=>e.timestamp.getTime()-t.timestamp.getTime()),u=T5(l[0]),d=vfe(l[l.length-1]);return(0,R.jsx)(dfe,{"aria-label":`MRTR conversation ${e}`,children:(0,R.jsxs)(W,{gap:`sm`,children:[(0,R.jsxs)(ffe,{children:[(0,R.jsxs)(pfe,{children:[(0,R.jsx)(v5,{method:u}),(0,R.jsx)(hfe,{children:`MRTR`}),(0,R.jsx)(_fe,{children:xfe(l.length)})]}),(0,R.jsxs)(mfe,{children:[(0,R.jsx)(Rp,{variant:`status`,color:yfe(d),"data-testid":`mrtr-status`,children:bfe(d)}),(0,R.jsx)(t8,{expanded:s,ariaLabel:`${s?`Collapse`:`Expand`} MRTR conversation`,onToggle:()=>c(e=>!e)})]})]}),(0,R.jsx)(oa,{in:s,children:(0,R.jsxs)(W,{gap:`sm`,children:[(0,R.jsx)(cm,{}),l.map((e,t)=>(0,R.jsxs)(W,{gap:`xs`,children:[(0,R.jsx)(gfe,{children:Sfe(t)}),(0,R.jsx)(F5,{entry:e,isPinned:n.has(e.id),isListExpanded:r,embedded:i,onReplay:()=>a(e.id),onTogglePin:()=>o(e.id)})]},e.id))]})})]})})}function I5({era:e}){return(0,R.jsx)(Rp,{variant:`outline`,color:R8(e)?`blue`:`gray`,children:Hce(e)})}var wfe=El.withProps({withBorder:!0,p:`lg`,flex:1,variant:`panel`}),Tfe=W.withProps({flex:1,align:`center`,justify:`center`}),Efe=U.withProps({c:`dimmed`,ta:`center`}),Dfe=H.withProps({justify:`space-between`,mb:`sm`}),Ofe=H.withProps({variant:`sectionHeader`,gap:`sm`,wrap:`nowrap`,p:`sm`}),kfe=xl.withProps({flex:1}),Afe=U.withProps({fw:600}),jfe=H.withProps({gap:`sm`,wrap:`nowrap`}),L5=qp.withProps({variant:`subtle`,size:`xs`});function Mfe(e){return`Pinned Messages (${e})`}function Nfe(e){return`History (${e})`}function R5({onClear:e,onExport:t}){return(0,R.jsxs)(jfe,{children:[(0,R.jsx)(L5,{onClick:e,children:`Clear`}),(0,R.jsx)(L5,{onClick:t,children:`Export`})]})}function z5({title:e,collapsible:t,hideHeaderWhenAlone:n=!1,open:r,onToggle:i,actions:a,children:o}){return t?(0,R.jsxs)(W,{gap:`md`,children:[(0,R.jsxs)(Ofe,{bg:r?`var(--mantine-primary-color-light)`:void 0,children:[(0,R.jsx)(kfe,{"aria-expanded":r,onClick:i,children:(0,R.jsx)(Afe,{children:e})}),a]}),(0,R.jsx)(oa,{in:r,children:(0,R.jsx)(W,{gap:`md`,children:o})})]}):(0,R.jsxs)(W,{gap:`md`,children:[n?null:(0,R.jsx)(Sv,{order:5,children:e}),(0,R.jsx)(W,{gap:`md`,children:o})]})}function Pfe(e,t,n,r,i){let a=T5(e);if(!i&&(e.origin&&!n[e.origin]||r&&a!==r))return!1;if(t){let n=t.toLowerCase(),r=e.response?JSON.stringify(e.response):``;if(!`${a} ${e.id} ${JSON.stringify(e.message)} ${r}`.toLowerCase().includes(n))return!1}return!0}function Ffe({entries:e,pinnedIds:t,searchText:n,methodFilter:r,visibleDirections:i,protocolEra:a,onClearAll:o,onExport:s,onClearSection:c,onExportSection:l,onReplay:u,onTogglePin:d,sortDirection:f,onSortChange:p,compact:m,onToggleCompact:h,embedded:g=!1,onRevealInNetwork:_,revealableIds:v,correlatedStatusById:y}){let b=V6(`protocol-list`),[x,S]=(0,D.useState)(!0),[C,w]=(0,D.useState)(!0),T=(0,D.useMemo)(()=>{let t=e.filter(e=>Pfe(e,n,i,r,g)).sort((e,t)=>e.timestamp.getTime()-t.timestamp.getTime());return f===`newest-first`&&t.reverse(),t},[e,n,i,r,f,g]),E=(0,D.useMemo)(()=>T.filter(e=>t.has(e.id)),[T,t]),O=(0,D.useMemo)(()=>T.filter(e=>!t.has(e.id)),[T,t]),k=T.length>0,A=E.length>0&&O.length>0,j=(e,n)=>Bde(e).map(e=>e.kind===`mrtr`?(0,R.jsx)(Cfe,{requestState:e.requestState,rounds:e.rounds,pinnedIds:t,isListExpanded:!m,embedded:g,onReplay:u,onTogglePin:d},`mrtr-${e.requestState}-${e.rounds[0].id}`):(0,R.jsx)(F5,{entry:e.entry,isPinned:n,isListExpanded:!m,embedded:g,onReplay:()=>u(e.entry.id),onTogglePin:()=>d(e.entry.id),onRevealInNetwork:_&&v?.has(e.entry.id)?()=>_(e.entry.id):void 0,correlatedHttpStatus:y?.get(e.entry.id)},e.entry.id));return(0,R.jsxs)(wfe,{children:[(0,R.jsxs)(Dfe,{children:[(0,R.jsxs)(H,{gap:`sm`,children:[(0,R.jsx)(Sv,{order:4,children:`Messages`}),a&&(0,R.jsx)(I5,{era:a})]}),(0,R.jsxs)(H,{gap:`xs`,children:[(0,R.jsx)(i5,{value:f,onChange:p,"aria-label":`History sort direction`}),(0,R.jsx)(qp,{variant:`default`,onClick:o,disabled:O.length===0,children:`Clear`}),(0,R.jsx)(qp,{variant:`default`,onClick:s,disabled:!k,children:`Export`}),k&&(0,R.jsx)(j6,{compact:m,onToggle:h})]})]}),k?(0,R.jsx)(o5,{embedded:g,viewportRef:b,children:(0,R.jsxs)(W,{gap:`md`,children:[E.length>0&&(0,R.jsx)(z5,{title:Mfe(E.length),collapsible:A,open:x,onToggle:()=>S(e=>!e),actions:A?(0,R.jsx)(R5,{onClear:()=>c(`pinned`),onExport:()=>l(`pinned`)}):void 0,children:j(E,!0)}),O.length>0&&(0,R.jsx)(z5,{title:Nfe(O.length),collapsible:A,hideHeaderWhenAlone:!0,open:C,onToggle:()=>w(e=>!e),actions:A?(0,R.jsx)(R5,{onClear:()=>c(`history`),onExport:()=>l(`history`)}):void 0,children:j(O,!1)})]})}):(0,R.jsx)(Tfe,{children:(0,R.jsx)(Efe,{children:`No request history`})})]})}var Ife=wd.withProps({variant:`screen`,h:`calc(100dvh - var(--app-shell-header-height, 0px) - var(--app-shell-footer-height, 0px))`,gap:`md`,p:`xl`}),Lfe=W.withProps({w:340,flex:`0 0 auto`}),Rfe=$p.withProps({withBorder:!0,padding:`lg`});function B5({entries:e,pinnedIds:t,protocolEra:n,ui:r,onUiChange:i,onClearAll:a,onExport:o,onClearSection:s,onExportSection:c,onReplay:l,onTogglePin:u,sortDirection:d,onSortChange:f,compact:p,onToggleCompact:m,embedded:h=!1,onRevealInNetwork:g,revealableIds:_,correlatedStatusById:v}){let{search:y,methodFilter:b,visibleDirections:x}=r,S=(0,D.useMemo)(()=>Array.from(new Set(e.map(T5))).sort(),[e]),C=(0,D.useCallback)(()=>{i({...r,methodFilter:void 0}),a()},[r,i,a]),w=(0,D.useCallback)((e,t)=>{i({...r,visibleDirections:{...x,[e]:t}})},[r,x,i]),T=(0,D.useCallback)(()=>{let e=!Object.values(x).every(Boolean);i({...r,visibleDirections:{client:e,server:e}})},[r,x,i]);return(0,R.jsxs)(Ife,{...h?{h:`100%`,pt:`md`}:{},children:[h?null:(0,R.jsx)(Lfe,{children:(0,R.jsx)(Rfe,{children:(0,R.jsx)(lde,{searchText:y,methodFilter:b,availableMethods:S,visibleDirections:x,onSearchChange:e=>i({...r,search:e}),onMethodFilterChange:e=>i({...r,methodFilter:e}),onToggleDirection:w,onToggleAllDirections:T})})}),(0,R.jsx)(Ffe,{entries:e,pinnedIds:t,protocolEra:n,searchText:y,methodFilter:b,visibleDirections:x,onClearAll:C,onExport:o,onClearSection:s,onExportSection:c,onReplay:l,onTogglePin:u,sortDirection:d,onSortChange:f,compact:p,onToggleCompact:m,embedded:h,onRevealInNetwork:g,revealableIds:_,correlatedStatusById:v})]})}var V5=[`auth`,`transport`],zfe={auth:`violet`,transport:`blue`},Bfe=qp.withProps({variant:`subtle`,size:`xs`});function Vfe({filterText:e,visibleCategories:t,onFilterChange:n,onToggleCategory:r,onToggleAllCategories:i}){let a=V5.every(e=>t[e]);return(0,R.jsxs)(W,{gap:`md`,children:[(0,R.jsx)(Sv,{order:4,children:`Network`}),(0,R.jsx)(fv,{placeholder:`Search...`,value:e,onChange:e=>n(e.currentTarget.value),rightSectionPointerEvents:`auto`,rightSection:e?(0,R.jsx)(P6,{onClick:()=>n(``)}):null}),(0,R.jsxs)(H,{justify:`space-between`,children:[(0,R.jsx)(Sv,{order:5,children:`Filter by Category`}),(0,R.jsx)(Bfe,{onClick:i,children:a?`Deselect All`:`Select All`})]}),(0,R.jsx)(W,{gap:`xs`,children:V5.map(e=>(0,R.jsx)(Z8,{label:e,color:zfe[e],active:t[e],onToggle:t=>r(e,t)},e))})]})}var Hfe={transport:`var(--inspector-badge-transport-bg)`,auth:`var(--inspector-badge-auth-bg)`},Ufe={transport:`var(--inspector-badge-transport-fg)`,auth:`var(--inspector-badge-auth-fg)`};function H5({category:e}){return(0,R.jsx)(Rp,{autoContrast:!1,bg:Hfe[e],c:Ufe[e],children:e})}var U5=new Set([`access_token`,`refresh_token`,`id_token`,`client_secret`,`registration_access_token`]),Wfe=new Set([...U5,`code`,`code_verifier`,`client_assertion`]),W5=`••••••••`;function G5(e,t){return e.has(t.toLowerCase())}function Gfe(e){return e==null?!1:typeof e!=`string`||e.length>0}function K5(e){if(Array.isArray(e)){let t=!1;return{node:e.map(e=>{let n=K5(e);return t||=n.masked,n.node}),masked:t}}if(typeof e==`object`&&e){let t=!1,n={};for(let[r,i]of Object.entries(e))if(G5(U5,r)&&Gfe(i))n[r]=W5,t=!0;else{let e=K5(i);n[r]=e.node,t||=e.masked}return{node:n,masked:t}}return{node:e,masked:!1}}function q5(e){let t;try{t=JSON.parse(e)}catch{return{masked:e,hasSecrets:!1}}let{node:n,masked:r}=K5(t);return{masked:JSON.stringify(n,null,2),hasSecrets:r}}function J5(e){let t=!1,n=e.split(`&`).map(e=>{let n=e.indexOf(`=`);if(n===-1)return e;let r=e.slice(0,n),i=e.slice(n+1),a;try{a=decodeURIComponent(r)}catch{a=r}return G5(Wfe,a)&&i.length>0?(t=!0,`${r}=${W5}`):e}).join(`&`);return{masked:t?n:e,hasSecrets:t}}function Kfe(e,t){let n=(t??``).toLowerCase();if(n)return n.includes(`json`)?q5(e):n.includes(`x-www-form-urlencoded`)?J5(e):{masked:e,hasSecrets:!1};try{JSON.parse(e)}catch{return J5(e)}return q5(e)}var qfe={discovery:`Discovery`,registration:`Registration`,authorize:`Authorize`,token:`Token`};function Jfe(e){let t;try{t=new URL(e).pathname.toLowerCase()}catch{t=e.toLowerCase().split(/[?#]/)[0]??``}if(t.includes(`/.well-known/oauth-protected-resource`)||t.includes(`/.well-known/oauth-authorization-server`)||t.includes(`/.well-known/openid-configuration`))return`discovery`;let n=t.replace(/\/+$/,``);if(n.endsWith(`/register`))return`registration`;if(n.endsWith(`/token`))return`token`;if(n.endsWith(`/authorize`))return`authorize`}function Yfe(e){return qfe[e]}var Xfe=$p.withProps({withBorder:!0,padding:`md`,variant:`inset`}),Y5=H.withProps({justify:`space-between`,wrap:`nowrap`}),X5=U.withProps({size:`sm`,c:`dimmed`,ff:`monospace`}),Zfe=U.withProps({size:`sm`,fw:500,truncate:`end`}),Qfe=U.withProps({size:`sm`,fw:500,variant:`nowrap`}),$fe=H.withProps({gap:`sm`,wrap:`nowrap`,miw:0}),Z5=H.withProps({gap:`sm`,wrap:`nowrap`}),epe=U.withProps({size:`sm`,c:`dimmed`}),Q5=U.withProps({size:`xs`,c:`dimmed`}),$5=U.withProps({size:`sm`,fw:500}),tpe=1e5;function npe(e){return`${e}ms`}function rpe(e){return e.toISOString()}function ipe(e){return e.toISOString().slice(11,19)}function ape(e){if(w5(e))return`gray`;if(e.error)return`red`;let t=e.responseStatus;return t===void 0?`gray`:t>=500?`red`:t>=400?`orange`:t>=300?`yellow`:t>=200?`green`:`gray`}function ope(e){return w5(e)?`Cancelled`:e.error?`Error`:e.responseStatus===void 0?`Pending`:e.responseStatusText?`${e.responseStatus} ${e.responseStatusText}`:`${e.responseStatus}`}function e7(e){return MI(e.method,e.responseHeaders?.[`content-type`])}var spe=U.withProps({size:`xs`,ff:`monospace`,fw:500}),cpe=U.withProps({size:`xs`,ff:`monospace`,fw:600,c:`var(--inspector-mcp-header-accent)`}),lpe=U.withProps({size:`xs`,ff:`monospace`,variant:`monoBreak`}),upe=U.withProps({size:`xs`,ff:`monospace`,variant:`monoBreak`,c:`var(--inspector-danger-text)`}),dpe=U.withProps({component:`span`,role:`img`,c:`var(--inspector-danger-text)`}),fpe=H.withProps({gap:`xs`,wrap:`nowrap`,align:`center`}),t7=k_.withProps({withArrow:!0,multiline:!0,w:280}),ppe=Rp.withProps({size:`xs`,color:`gray`,variant:`light`}),mpe=dv.withProps({striped:!0,withColumnBorders:!0,fz:`xs`}),hpe=Rp.withProps({color:`violet`,variant:`light`}),gpe=H.withProps({gap:`xs`,wrap:`nowrap`,justify:`space-between`}),_pe=_l.withProps({scrollbarSize:6,flex:1,miw:0,viewportProps:{tabIndex:0}}),vpe=H.withProps({gap:`sm`,wrap:`nowrap`,miw:0,flex:1}),ype=H.withProps({gap:`xs`,justify:`flex-end`}),bpe=U.withProps({span:!0,ff:`monospace`}),xpe=U.withProps({size:`xs`,ff:`monospace`,c:`red`});function Spe({name:e,value:t,consistency:n}){let r=x5(e)?S5(t):{value:t,encoded:!1,raw:t},i=n!==void 0&&!n.ok;return(0,R.jsxs)(fpe,{children:[i?(0,R.jsx)(upe,{children:r.value}):(0,R.jsx)(lpe,{children:r.value}),r.encoded&&(0,R.jsx)(t7,{label:`base64 sentinel — raw: ${r.raw}`,children:(0,R.jsx)(ppe,{children:`base64`})}),i&&(0,R.jsx)(t7,{label:`Expected: ${n.expected}`,children:(0,R.jsx)(dpe,{"aria-label":`Header does not match body; expected ${n.expected}`,children:(0,R.jsx)(E6,{})})})]})}function n7({headers:e,consistency:t}){let n=Object.entries(e);if(n.length===0)return(0,R.jsx)(Q5,{children:`(none)`});let r=new Map((t??[]).map(e=>[e.header,e]));return(0,R.jsx)(mpe,{children:(0,R.jsx)(dv.Tbody,{children:n.map(([e,t])=>(0,R.jsxs)(dv.Tr,{children:[(0,R.jsx)(dv.Td,{children:x5(e)?(0,R.jsx)(cpe,{children:e}):(0,R.jsx)(spe,{children:e})}),(0,R.jsx)(dv.Td,{children:(0,R.jsx)(Spe,{name:e,value:t,consistency:r.get(e.toLowerCase())})})]},e))})})}var Cpe=Gd.withProps({variant:`light`,color:`gray`,title:`Request cancelled`,icon:(0,R.jsx)(E6,{})}),wpe=qp.withProps({variant:`subtle`,size:`compact-xs`});function r7({body:e,contentType:t}){let[n,r]=(0,D.useState)(!1),i=e.length>tpe,{masked:a,hasSecrets:o}=(0,D.useMemo)(()=>i?{masked:e,hasSecrets:!1}:Kfe(e,t),[i,e,t]);return i?(0,R.jsxs)(Q5,{children:[`Body too large to preview (`,e.length,` characters)`]}):o?(0,R.jsxs)(W,{gap:`xs`,children:[(0,R.jsxs)(H,{gap:`xs`,children:[(0,R.jsx)(Q5,{"aria-live":`polite`,children:n?`Secrets revealed`:`Secrets hidden`}),(0,R.jsx)(wpe,{onClick:()=>r(e=>!e),"aria-label":n?`Hide secrets in body`:`Reveal secrets in body`,children:n?`Hide`:`Reveal`})]}),(0,R.jsx)(f6,{block:{type:`text`,text:n?e:a},copyable:!0})]}):(0,R.jsx)(f6,{block:{type:`text`,text:e},copyable:!0})}function Tpe({entry:e,isListExpanded:t,embedded:n=!1,revealed:r=!1,onRevealComplete:i}){let[a,o]=(0,D.useState)(t||r),s=(0,D.useRef)(null);Z6(t,o),Z6(r,e=>{e&&o(!0)}),(0,D.useEffect)(()=>{if(!r)return;let e=requestAnimationFrame(()=>{s.current?.scrollIntoView({behavior:`smooth`,block:`center`}),i?.()});return()=>cancelAnimationFrame(e)},[r,i]);let c=e.category===`auth`?Jfe(e.url):void 0,l=c?(0,R.jsx)(hpe,{children:Yfe(c)}):null,u=(0,D.useMemo)(()=>Ide(e),[e]),d=w5(e),f=(0,R.jsxs)(R.Fragment,{children:[e.duration!=null&&(0,R.jsx)(epe,{children:npe(e.duration)}),e7(e)&&(0,R.jsx)(Rp,{color:`orange`,children:`SSE`}),(0,R.jsx)(Rp,{color:ape(e),variant:`status`,children:ope(e)})]}),p=(0,R.jsx)(t8,{expanded:a,onToggle:()=>o(e=>!e)});return(0,R.jsx)(Xfe,{ref:s,children:(0,R.jsxs)(W,{gap:`sm`,children:[n?(0,R.jsxs)(W,{gap:`xs`,children:[(0,R.jsxs)(Y5,{children:[(0,R.jsxs)($fe,{children:[(0,R.jsx)(X5,{children:ipe(e.timestamp)}),(0,R.jsx)(v5,{method:e.method}),(0,R.jsx)(H5,{category:e.category}),l]}),(0,R.jsx)(Z5,{children:f})]}),(0,R.jsxs)(gpe,{children:[(0,R.jsx)(h3,{value:e.url}),(0,R.jsx)(_pe,{children:(0,R.jsx)(Qfe,{children:e.url})}),p]})]}):(0,R.jsxs)(R.Fragment,{children:[(0,R.jsxs)(Y5,{children:[(0,R.jsxs)(vpe,{children:[(0,R.jsx)(X5,{children:rpe(e.timestamp)}),(0,R.jsx)(v5,{method:e.method}),(0,R.jsx)(H5,{category:e.category}),l,(0,R.jsx)(h3,{value:e.url}),(0,R.jsx)(Zfe,{children:e.url})]}),(0,R.jsx)(Z5,{children:f})]}),(0,R.jsx)(ype,{children:p})]}),(0,R.jsx)(oa,{in:a,children:(0,R.jsxs)(W,{gap:`sm`,children:[(0,R.jsx)(cm,{}),d&&(0,R.jsx)(Cpe,{children:(0,R.jsxs)(U,{size:`xs`,children:[`Cancellation appears as a connection abort — the modern transport aborts the request stream instead of sending a`,` `,(0,R.jsx)(bpe,{children:`notifications/cancelled`}),` frame (SEP-2575).`]})}),(0,R.jsxs)(W,{gap:`xs`,children:[(0,R.jsx)($5,{children:`Request Headers`}),(0,R.jsx)(n7,{headers:e.requestHeaders,consistency:u})]}),e.requestBody&&(0,R.jsxs)(W,{gap:`xs`,children:[(0,R.jsx)($5,{children:`Request Body`}),(0,R.jsx)(r7,{body:e.requestBody,contentType:e.requestHeaders[`content-type`]},`${e.requestHeaders[`content-type`]??``}|${e.requestBody}`)]}),e.responseHeaders&&(0,R.jsxs)(W,{gap:`xs`,children:[(0,R.jsx)($5,{children:`Response Headers`}),(0,R.jsx)(n7,{headers:e.responseHeaders})]}),e.responseStatus!==void 0&&(0,R.jsxs)(W,{gap:`xs`,children:[(0,R.jsx)($5,{children:`Response Body`}),e.responseBody?(0,R.jsx)(r7,{body:e.responseBody,contentType:e.responseHeaders?.[`content-type`]},`${e.responseHeaders?.[`content-type`]??``}|${e.responseBody}`):(0,R.jsx)(Q5,{children:e7(e)?`Long-lived stream — body not captured`:`(empty)`})]}),e.error&&(0,R.jsxs)(W,{gap:`xs`,children:[(0,R.jsx)($5,{c:`red`,children:`Error`}),(0,R.jsx)(xpe,{children:e.error})]})]})})]})})}var Epe=El.withProps({withBorder:!0,p:`lg`,flex:1,variant:`panel`}),Dpe=W.withProps({flex:1,align:`center`,justify:`center`}),Ope=U.withProps({c:`dimmed`,ta:`center`}),kpe=H.withProps({justify:`space-between`,mb:`sm`});function Ape(e){return`Requests (${e})`}function i7(e){return e?Object.entries(e).map(([e,t])=>`${e}: ${t}`).join(`
237
- `):``}function jpe(e,t,n,r){if(!r&&!n[e.category])return!1;if(t){let n=t.toLowerCase(),r=e.responseStatus===void 0?``:String(e.responseStatus);if(![e.method,e.url,r,e.responseStatusText??``,i7(e.requestHeaders),i7(e.responseHeaders),e.requestBody??``,e.responseBody??``,e.error??``].some(e=>e.toLowerCase().includes(n)))return!1}return!0}function Mpe({entries:e,filterText:t,visibleCategories:n,onClear:r,onExport:i,sortDirection:a,onSortChange:o,compact:s,onToggleCompact:c,embedded:l=!1,revealId:u,onRevealComplete:d}){let f=V6(`network-stream`),p=(0,D.useMemo)(()=>{let r=e.filter(e=>jpe(e,t,n,l)).sort((e,t)=>e.timestamp.getTime()-t.timestamp.getTime());return a===`newest-first`&&r.reverse(),r},[e,t,n,a,l]),m=e.length>0,h=p.length>0;return(0,R.jsxs)(Epe,{children:[(0,R.jsxs)(kpe,{children:[(0,R.jsx)(Sv,{order:4,children:Ape(p.length)}),(0,R.jsxs)(H,{gap:`xs`,children:[(0,R.jsx)(i5,{value:a,onChange:o,"aria-label":`Network sort direction`}),(0,R.jsx)(qp,{variant:`default`,onClick:r,disabled:!m,children:`Clear`}),(0,R.jsx)(qp,{variant:`default`,onClick:i,disabled:!m,children:`Export`}),h&&(0,R.jsx)(j6,{compact:s,onToggle:c})]})]}),h?(0,R.jsx)(o5,{embedded:l,viewportRef:f,constrainContentWidth:!0,children:(0,R.jsx)(W,{gap:`md`,children:p.map(e=>(0,R.jsx)(Tpe,{entry:e,isListExpanded:!s,embedded:l,revealed:e.id===u,onRevealComplete:d},e.id))})}):(0,R.jsx)(Dpe,{children:(0,R.jsx)(Ope,{children:`No network requests`})})]})}var a7={auth:!0,transport:!0},Npe={auth:!1,transport:!1},Ppe=wd.withProps({variant:`screen`,h:`calc(100dvh - var(--app-shell-header-height, 0px) - var(--app-shell-footer-height, 0px))`,gap:`md`,p:`xl`}),Fpe=W.withProps({w:340,flex:`0 0 auto`}),Ipe=$p.withProps({withBorder:!0,padding:`lg`});function o7({entries:e,ui:t,onUiChange:n,onClear:r,onExport:i,sortDirection:a,onSortChange:o,compact:s,onToggleCompact:c,embedded:l=!1,revealId:u,onRevealComplete:d}){let{filterText:f,visibleCategories:p}=t;function m(e,r){n({...t,visibleCategories:{...p,[e]:r}})}function h(){let e=Object.values(p).every(Boolean);n({...t,visibleCategories:e?Npe:a7})}return(0,R.jsxs)(Ppe,{...l?{h:`100%`,pt:`md`}:{},children:[l?null:(0,R.jsx)(Fpe,{children:(0,R.jsx)(Ipe,{children:(0,R.jsx)(Vfe,{filterText:f,visibleCategories:p,onFilterChange:e=>n({...t,filterText:e}),onToggleCategory:m,onToggleAllCategories:h})})}),(0,R.jsx)(Mpe,{entries:e,filterText:f,visibleCategories:p,onClear:r,onExport:i,sortDirection:a,onSortChange:o,compact:s,onToggleCompact:c,embedded:l,revealId:u,onRevealComplete:d})]})}var Lpe=wd.withProps({variant:`screen`,h:`calc(100dvh - var(--app-shell-header-height, 0px) - var(--app-shell-footer-height, 0px))`,gap:`md`,p:`xl`}),Rpe=W.withProps({w:340,flex:`0 0 auto`}),zpe=$p.withProps({withBorder:!0,padding:`lg`}),Bpe=El.withProps({withBorder:!0,p:`lg`,flex:1,variant:`panel`}),Vpe=H.withProps({justify:`space-between`,mb:`sm`}),Hpe=fv.withProps({placeholder:`Search...`,rightSectionPointerEvents:`auto`}),Upe=W.withProps({flex:1,align:`center`,justify:`center`}),Wpe=H.withProps({gap:`sm`,wrap:`nowrap`,align:`flex-start`}),Gpe=U.withProps({size:`sm`,ff:`monospace`,c:`dimmed`,flex:`0 0 auto`}),Kpe=U.withProps({size:`sm`,ff:`monospace`,variant:`consoleLine`,flex:1});function qpe(e){return e.toLocaleTimeString()}function Jpe(e,t){return!t||e.message.toLowerCase().includes(t.toLowerCase())}function s7({entries:e,ui:t,onUiChange:n,onClear:r,onExport:i,sortDirection:a,onSortChange:o,embedded:s=!1}){let{filterText:c}=t,l=V6(`console-stream`),u=(0,D.useMemo)(()=>{let t=e.filter(e=>Jpe(e,c)).sort((e,t)=>e.timestamp.getTime()-t.timestamp.getTime());return a===`newest-first`&&t.reverse(),t},[e,c,a]);return(0,R.jsxs)(Lpe,{...s?{h:`100%`,pt:`md`}:{},children:[s?null:(0,R.jsx)(Rpe,{children:(0,R.jsx)(zpe,{children:(0,R.jsxs)(W,{gap:`md`,children:[(0,R.jsx)(Sv,{order:4,children:`Console`}),(0,R.jsx)(Hpe,{value:c,onChange:e=>n({filterText:e.currentTarget.value}),rightSection:c?(0,R.jsx)(P6,{onClick:()=>n({filterText:``})}):null})]})})}),(0,R.jsxs)(Bpe,{children:[(0,R.jsxs)(Vpe,{children:[(0,R.jsx)(Sv,{order:4,children:`Server Console`}),(0,R.jsxs)(H,{children:[(0,R.jsx)(i5,{value:a,onChange:o,"aria-label":`Console sort direction`}),(0,R.jsx)(qp,{variant:`default`,onClick:r,disabled:e.length===0,children:`Clear`}),(0,R.jsx)(qp,{variant:`default`,onClick:i,disabled:e.length===0,children:`Export`})]})]}),u.length>0?(0,R.jsx)(o5,{embedded:s,viewportRef:l,children:(0,R.jsx)(W,{gap:`xs`,children:u.map((e,t)=>(0,R.jsxs)(Wpe,{children:[(0,R.jsx)(Gpe,{children:qpe(e.timestamp)}),(0,R.jsx)(Kpe,{children:e.message})]},`${e.timestamp.getTime()}-${t}`))})}):(0,R.jsx)(Upe,{children:(0,R.jsx)(U,{c:`dimmed`,children:`No console output`})})]})]})}var Ype=wd.withProps({direction:`column`,pos:`absolute`,top:0,left:0,right:0});function c7({active:e,children:t,fill:n=!1}){return(0,R.jsx)(ql,{mounted:e,transition:`fade-up`,duration:350,exitDuration:250,timingFunction:`ease`,children:e=>(0,R.jsx)(Ype,{style:e,bottom:n?0:void 0,children:t})})}var Xpe=H.withProps({wrap:`nowrap`,gap:`sm`,px:`xl`,py:`sm`}),Zpe=fv.withProps({placeholder:`Search...`,size:`sm`,flex:1,miw:0,"aria-label":`Search`}),Qpe=N_.withProps({size:`sm`,"aria-label":`Monitoring screen`});function $pe({tabs:e,value:t,onChange:n,searchValue:r,onSearchChange:i}){return(0,R.jsxs)(Xpe,{children:[(0,R.jsx)(Qpe,{value:t,onChange:n,data:e}),(0,R.jsx)(Zpe,{value:r,onChange:e=>i(e.currentTarget.value),rightSectionPointerEvents:`auto`,rightSection:r?(0,R.jsx)(P6,{onClick:()=>i(``)}):null})]})}var eme=W.withProps({h:`100%`,gap:0,pt:`md`}),tme=W.withProps({pos:`relative`,flex:1,mih:0,gap:0});function nme({tabs:e,value:t,onChange:n,searchValue:r,onSearchChange:i,screens:a}){return(0,R.jsxs)(eme,{children:[(0,R.jsx)($pe,{tabs:e,value:t,onChange:n,searchValue:r,onSearchChange:i}),(0,R.jsx)(tme,{children:e.map(e=>(0,R.jsx)(c7,{active:e===t,fill:!0,children:a[e]},e))})]})}var rme=wd.withProps({role:`separator`,"aria-orientation":`vertical`,tabIndex:0,className:`resize-handle`});function l7(e,t,n){return Math.min(n,Math.max(t,e))}function ime({value:e,min:t,max:n,step:r=16,onChange:i,onCommit:a,"aria-label":o=`Resize panel`}){let s=(0,D.useRef)(null);(0,D.useEffect)(()=>()=>document.body.classList.remove(`resizing-col`),[]);function c(t){s.current={startX:t.clientX,startWidth:e},t.currentTarget.setPointerCapture?.(t.pointerId),document.body.classList.add(`resizing-col`)}function l(e){s.current&&i(l7(s.current.startWidth+(s.current.startX-e.clientX),t,n))}function u(e){if(!s.current)return;let r=l7(s.current.startWidth+(s.current.startX-e.clientX),t,n);s.current=null,e.currentTarget.releasePointerCapture?.(e.pointerId),document.body.classList.remove(`resizing-col`),a(r)}function d(o){let s=o.key===`ArrowLeft`?r:o.key===`ArrowRight`?-r:0;if(s===0)return;o.preventDefault();let c=l7(e+s,t,n);i(c),a(c)}return(0,R.jsx)(rme,{"aria-valuenow":e,"aria-valuemin":t,"aria-valuemax":n,"aria-label":o,onPointerDown:c,onPointerMove:l,onPointerUp:u,onPointerCancel:u,onKeyDown:d})}var u7=`Servers`,ame=[`Apps`,`Tools`,`Prompts`,`Resources`,`Tasks`,`Logs`,`Protocol`,`Network`];function d7(e){return ame.includes(e)}function f7(e){if(!e)return null;try{let t=JSON.parse(e);if(typeof t==`object`&&t&&!Array.isArray(t)&&`id`in t){let e=t.id;if(typeof e==`string`||typeof e==`number`)return e}}catch{}return null}function p7(e){let t=e.message;return`id`in t?t.id:void 0}function ome(e){let t=new Map;for(let n of e){if(n.category!==`transport`)continue;let e=f7(n.requestBody);if(e===null)continue;let r=jde(n.responseBody);r&&t.set(String(e),{jsonrpc:`2.0`,id:e,error:{code:r.code,message:r.message,...r.data===void 0?{}:{data:r.data}}})}return t}function sme(e,t){let n=p7(e);if(n===void 0)return;let r;for(let e of t){if(e.category!==`transport`)continue;let t=f7(e.requestBody);t!==null&&String(t)===String(n)&&(r=e)}return r}function cme(e,t){let n=new Set;for(let e of t){if(e.category!==`transport`)continue;let t=f7(e.requestBody);t!==null&&n.add(String(t))}let r=new Set;for(let t of e){let e=p7(t);e!==void 0&&n.has(String(e))&&r.add(t.id)}return r}function lme(e,t){let n=new Map;for(let e of t){if(e.category!==`transport`||e.responseStatus===void 0)continue;let t=f7(e.requestBody);t!==null&&n.set(String(t),e.responseStatus)}let r=new Map;for(let t of e){let e=p7(t);if(e===void 0)continue;let i=n.get(String(e));i!==void 0&&r.set(t.id,i)}return r}function ume(e,t){let n=ome(t);if(n.size===0)return e;let r=!1,i=e.map(e=>{if(e.direction!==`request`||e.response)return e;let t=p7(e);if(t===void 0)return e;let i=n.get(String(t));return i?(r=!0,{...e,response:i}):e});return r?i:e}var m7=`newest-first`;function dme(e){return e===`oldest-first`||e===`newest-first`?e:m7}function fme(e){return e}var h7=!0;function pme(e){return e===`true`||e!==`false`&&h7}function mme(e){return e?`true`:`false`}function g7(e){return dn({key:`inspector.sortDirection.${e}`,defaultValue:m7,deserialize:dme,serialize:fme,getInitialValueInEffect:!1})}function _7(e,t){return dn({key:`inspector.listCompact.${e}`,defaultValue:t,deserialize:pme,serialize:mme,getInitialValueInEffect:!1})}var v7=u7,y7=`Tasks`,b7=`Logs`,x7=`Protocol`,S7=`Network`,C7=`Console`;function hme(e,t,n){if(e.name?.trim())return e;let r=t.find(e=>e.id===n)?.name;return r?{...e,name:r}:e}var gme=[v7,`Apps`,`Tools`,`Prompts`,`Resources`,y7,b7,x7,S7,C7],w7=[y7,b7,x7,S7,C7];function T7(e){return e===y7||e===b7||e===x7||e===S7||e===C7}var E7=320,D7=720,O7=420,_me=16;function vme(e){return Math.min(D7,Math.max(E7,e))}var k7=!1;function yme(e){return e===`true`||e!==`false`&&k7}function bme(e){return e?`true`:`false`}var A7=b7;function xme(e){return e!==void 0&&T7(e)?e:A7}function Sme(e){return e}function Cme(e){let t=e===void 0?NaN:Number.parseInt(e,10);return Number.isFinite(t)?vme(t):O7}function wme(e){return String(e)}var Tme=W.withProps({pos:`relative`,gap:0,flex:1,mih:`100%`,miw:0}),Eme=wd.withProps({direction:`row`,gap:0,h:`100%`,w:`100%`}),Dme=32,Ome=H.withProps({h:`100%`,px:`xl`,justify:`space-between`,align:`center`,wrap:`nowrap`}),kme=W.withProps({flex:`0 0 auto`,h:`100%`,gap:0,miw:0}),j7=300,Ame={in:{opacity:1,transform:`translateX(0)`},out:{opacity:0,transform:`translateX(100%)`},common:{transformOrigin:`right center`},transitionProperty:`transform, opacity`},jme=H.withProps({wrap:`nowrap`,align:`stretch`,gap:0,h:`100%`,flex:`0 0 auto`});function Mme({deepLink:e,deepLinkStatus:t,servers:n,serverListWritable:r=!0,activeServer:i,erroredServerId:a,connectedServerId:o,version:s,connectionStatus:c,connectErrorMessage:l,initializeResult:u,latencyMs:d,tools:f,excludedTools:p=[],prompts:m,resources:h,resourceTemplates:g,toolsListChanged:_,promptsListChanged:v,resourcesListChanged:y,toolsLoadError:b,promptsLoadError:x,resourcesLoadError:S,subscriptions:C,subscriptionStreamState:w,logs:T,tasks:E,progressByTaskId:O,protocol:k,protocolEra:A,network:j,stderrLogs:M,toolCallState:N,getPromptState:ee,readResourceState:te,toolsUi:P,promptsUi:F,resourcesUi:I,appsUi:ne,tasksUi:re,logsUi:ie,protocolUi:ae,networkUi:oe,consoleUi:se,currentLogLevel:ce,sandboxPath:le,bridgeFactory:ue,appRendererRef:de,pinnedProtocolIds:fe,onToggleTheme:pe,onOpenClientSettings:me,onToggleConnection:he,onDisconnect:ge,onServerAdd:_e,onServerImportConfig:ve,onServerImportJson:ye,onServerExport:be,onConnectionInfo:xe,onServerSettings:Se,onServerEdit:Ce,onServerClone:we,onServerRemove:Te,onServerReorder:Ee,highlightedServerIds:De,onClearHighlight:Oe,serverSupportsTaskToolCalls:ke,onToolsUiChange:Ae,onCallTool:je,onCancelToolCall:Me,onClearToolResult:Ne,onReadResourceContents:Pe,onRefreshTools:Fe,toolsPagination:Ie,promptsPagination:Le,resourcesPagination:Re,onPromptsUiChange:ze,onGetPrompt:Be,onCopyPromptMessages:Ve,onRefreshPrompts:He,onResourcesUiChange:Ue,onReadResource:We,onSubscribeResource:Ge,onUnsubscribeResource:Ke,onRefreshResources:qe,onCompleteArgument:Je,completionsSupported:Ye,subscriptionsSupported:Xe,onTasksUiChange:Ze,onCancelTask:Qe,onClearCompletedTasks:$e,onRefreshTasks:L,onSetLogLevel:et,modernLogLevel:tt=null,onSetModernLogLevel:nt,onLogsUiChange:rt,onClearLogs:it,onExportLogs:at,onProtocolUiChange:ot,onClearProtocol:st,onExportProtocol:ct,onClearProtocolSection:lt,onExportProtocolSection:ut,onReplayProtocol:dt,onTogglePinProtocol:ft,onNetworkUiChange:pt,onClearNetwork:mt,onExportNetwork:ht,onConsoleUiChange:gt,onClearConsole:_t,onExportConsole:vt,onAppsUiChange:yt,onSelectApp:bt,onOpenApp:xt,onCloseApp:St,onAppError:Ct,onRefreshApps:wt,activeTab:Tt,onActiveTabChange:Et}){let[Dt,Ot]=g7(`logs`),[kt,At]=g7(`protocol`),[jt,Mt]=g7(`network`),[Nt,Pt]=g7(`console`),[Ft,It]=_7(`protocol`,h7),[Lt,Rt]=_7(`network`,h7),[zt,Bt]=_7(`servers`,!1),[Vt,Ht]=_7(`resources`,!1),[Ut,Wt]=dn({key:`inspector.monitor.pinned`,defaultValue:k7,deserialize:yme,serialize:bme,getInitialValueInEffect:!1}),[Gt,Kt]=dn({key:`inspector.monitor.tab`,defaultValue:A7,deserialize:xme,serialize:Sme,getInitialValueInEffect:!1}),[qt,Jt]=dn({key:`inspector.monitor.width`,defaultValue:O7,deserialize:Cme,serialize:wme,getInitialValueInEffect:!1}),[Yt,Xt]=(0,D.useState)(null),Zt=Yt??qt,Qt=(0,D.useRef)(c);(0,D.useEffect)(()=>{let e=Qt.current;Qt.current=c,(c===`connected`&&e!==`connected`||c===`error`&&e!==`error`&&e!==`connected`)&&Wt(!0)},[c,Wt]);let $t=(0,D.useMemo)(()=>f.filter(e=>{try{return IU(e)}catch{return!1}}),[f]),en=(0,D.useMemo)(()=>{if(c!==`connected`)return[v7];let e=n.find(e=>e.id===i),t=e?RP(e.config)===`stdio`:!1,r=u?.capabilities,a=r?.tools!==void 0,o=a&&$t.length>0,s=r?.prompts!==void 0,l=r?.resources!==void 0,d=r?.tasks!==void 0||r?.extensions?.[`io.modelcontextprotocol/tasks`]!==void 0,f=r?.logging!==void 0;return gme.filter(e=>!(e===S7&&t||e===C7&&!t||e===`Tools`&&!a||e===`Apps`&&!o||e===`Prompts`&&!s||e===`Resources`&&!l||e===`Tasks`&&!d||e===`Logs`&&!f))},[c,n,i,u,$t]),tn=c===`connected`,nn=c===`error`&&a!==void 0,rn=(0,D.useMemo)(()=>{if(tn)return en.filter(e=>w7.includes(e));if(nn){let e=[];return M.length>0&&e.push(C7),j.length>0&&e.push(S7),k.length>0&&e.push(x7),e}return[]},[tn,nn,en,M,j,k]),an=(tn||nn)&&rn.length>0,on=Ut&&an,sn=(0,D.useMemo)(()=>on?en.filter(e=>!w7.includes(e)):en,[on,en]),cn=sn.find(e=>e!==v7)??v7,ln=sn.includes(Tt)?Tt:on?cn:v7,un=(0,D.useRef)(!1);(0,D.useEffect)(()=>{if(!e?.openApp||un.current||c!==`connected`||!en.includes(`Apps`))return;let t=$t.find(t=>t.name===e.openApp);if(!t)return;un.current=!0;let n={...G6(W6(t.inputSchema)??{}),...e.appArgs};Et(`Apps`),yt({...ne,selectedAppName:t.name,formValues:n}),bt(t.name)},[e,c,en,$t,ne,Et,yt,bt]);let fn=rn.includes(Gt)&&T7(Gt)?Gt:rn.find(T7)??b7;function pn(e){Kt(e),Wt(!0)}function mn(e){let t=k.find(t=>t.id===e);if(!t)return;let n=sme(t,j);n&&(pt({filterText:``,visibleCategories:{...oe.visibleCategories,[n.category]:!0}}),xn(``),on?pn(S7):Et(S7),Cn(n.id))}function hn(e){T7(e)&&Kt(e)}function gn(){Et(ln),Wt(!1)}function _n(){on?gn():pn(fn)}let vn=an?{open:on,onToggle:_n}:void 0;function yn(e){Jt(e),Xt(null)}let[bn,xn]=(0,D.useState)(``),[Sn,Cn]=(0,D.useState)(void 0),wn=(0,D.useMemo)(()=>cme(k,j),[k,j]),Tn=(0,D.useMemo)(()=>lme(k,j),[k,j]),En=(0,D.useMemo)(()=>n.map(e=>e.id===i?{...e,connection:{status:c,...u?.protocolVersion?{protocolVersion:u.protocolVersion}:{}}}:{...e,connection:{status:`disconnected`}}),[n,i,c,u]),Dn=BP(c)?void 0:i,On={entries:T,currentLevel:ce,ui:ie,onUiChange:rt,onSetLevel:et,protocolEra:A,modernLogLevel:tt,onSetModernLogLevel:nt,onClear:it,onExport:at,sortDirection:Dt,onSortChange:Ot},kn={entries:k,protocolEra:A,pinnedIds:fe??new Set,ui:ae,onUiChange:ot,onClearAll:st,onExport:ct,onClearSection:lt,onExportSection:ut,onReplay:dt,onTogglePin:ft,sortDirection:kt,onSortChange:At,compact:Ft,onToggleCompact:()=>It(e=>!e),onRevealInNetwork:mn,revealableIds:wn,correlatedStatusById:Tn},An={entries:j,ui:oe,onUiChange:pt,onClear:mt,onExport:ht,sortDirection:jt,onSortChange:Mt,compact:Lt,onToggleCompact:()=>Rt(e=>!e),revealId:Sn,onRevealComplete:()=>Cn(void 0)},jn={entries:M,ui:se,onUiChange:gt,onClear:_t,onExport:vt,sortDirection:Nt,onSortChange:Pt},Mn={tasks:E,progressByTaskId:O,ui:re,onUiChange:Ze,onRefresh:L,onClearCompleted:$e,onCancel:Qe},Nn={[y7]:(0,R.jsx)(_5,{...Mn,ui:{...re,search:bn},embedded:!0}),[b7]:(0,R.jsx)(c5,{...On,ui:{...ie,filterText:bn},embedded:!0}),[x7]:(0,R.jsx)(B5,{...kn,ui:{...ae,search:bn},embedded:!0}),[S7]:(0,R.jsx)(o7,{...An,ui:{...oe,filterText:bn},embedded:!0}),[C7]:(0,R.jsx)(s7,{...jn,ui:{filterText:bn},embedded:!0})};return(0,R.jsxs)(Cf,{header:{height:60},footer:{height:Dme},padding:0,children:[(0,R.jsx)(Cf.Header,{"data-testid":`connection-status`,"data-status":c,"data-error-message":l,"data-deeplink":t,children:c===`connected`&&u?(0,R.jsx)(zW,{connected:!0,serverInfo:hme(u.serverInfo,n,i),status:c,latencyMs:d,activeTab:ln,availableTabs:sn,onTabChange:Et,onDisconnect:ge,onToggleTheme:pe,onOpenClientSettings:me,monitorToggle:vn}):(0,R.jsx)(zW,{connected:!1,onToggleTheme:pe,onOpenClientSettings:me,monitorToggle:vn})}),(0,R.jsx)(Cf.Main,{children:(0,R.jsxs)(Eme,{children:[(0,R.jsxs)(Tme,{children:[(0,R.jsx)(c7,{active:ln===v7,children:(0,R.jsx)(eae,{servers:En,writable:r,activeServer:Dn,erroredServerId:a,connectedServerId:o,onAddManually:_e,onImportConfig:ve,onImportServerJson:ye,onExport:be,onToggleConnection:he,onConnectionInfo:xe,onSettings:Se,onEdit:Ce,onClone:we,onRemove:Te,onReorder:Ee,highlightedServerIds:De,onClearHighlight:Oe,compact:zt,onToggleCompact:()=>Bt(e=>!e)})}),(0,R.jsx)(c7,{active:ln===`Tools`,children:(0,R.jsx)(Qoe,{tools:f,excludedTools:p,callState:N,ui:P,listChanged:_,loadError:b,serverSupportsTaskToolCalls:ke,modernTasks:A===`modern`&&u?.capabilities?.extensions?.[`io.modelcontextprotocol/tasks`]!==void 0,onUiChange:Ae,onRefreshList:Fe,pagination:Ie,onCallTool:je,onCancelCall:Me,onClearResult:Ne,onReadResource:Pe})}),(0,R.jsx)(c7,{active:ln===`Apps`,children:(0,R.jsx)(sce,{tools:$t,listChanged:_,sandboxPath:le,bridgeFactory:ue,rendererRef:de,ui:ne,onUiChange:yt,onRefreshList:wt,onSelectApp:bt,onOpenApp:xt,onCloseApp:St,onError:Ct,autoOpen:!!(e?.openApp&&e.autoOpen)})}),(0,R.jsx)(c7,{active:ln===`Prompts`,children:(0,R.jsx)(Vce,{prompts:m,getPromptState:ee,ui:F,listChanged:v,loadError:x,completionsSupported:Ye,onUiChange:ze,onRefreshList:He,pagination:Le,onGetPrompt:Be,onCopyMessages:Ve,onCompleteArgument:Je})}),(0,R.jsx)(c7,{active:ln===`Resources`,children:(0,R.jsx)(Gle,{resources:h,templates:g,subscriptions:C,subscriptionStreamState:w,protocolEra:A,readState:te,ui:I,listChanged:y,loadError:S,completionsSupported:Ye,subscriptionsSupported:Xe,onUiChange:Ue,onRefreshList:qe,pagination:Re,onReadResource:We,onSubscribeResource:Ge,onUnsubscribeResource:Ke,onCompleteArgument:Je,compact:Vt,onCompactChange:Ht})}),(0,R.jsx)(c7,{active:ln===y7,children:(0,R.jsx)(_5,{...Mn})}),(0,R.jsx)(c7,{active:ln===b7,children:(0,R.jsx)(c5,{...On})}),(0,R.jsx)(c7,{active:ln===x7,children:(0,R.jsx)(B5,{...kn})}),(0,R.jsx)(c7,{active:ln===S7,children:(0,R.jsx)(o7,{...An})}),(0,R.jsx)(c7,{active:ln===C7,children:(0,R.jsx)(s7,{...jn})})]}),(0,R.jsx)(ql,{mounted:on,transition:Ame,duration:j7,exitDuration:j7,timingFunction:`ease`,children:e=>(0,R.jsxs)(jme,{style:e,children:[(0,R.jsx)(ime,{value:Zt,min:E7,max:D7,step:_me,onChange:Xt,onCommit:yn,"aria-label":`Resize monitoring sidebar`}),(0,R.jsx)(kme,{w:Zt,children:(0,R.jsx)(nme,{tabs:rn,value:fn,onChange:hn,searchValue:bn,onSearchChange:xn,screens:Nn})})]})})]})}),(0,R.jsx)(Cf.Footer,{children:(0,R.jsxs)(Ome,{children:[(0,R.jsx)(VW,{version:s}),(0,R.jsx)(WW,{})]})})]})}var M7={selectedToolName:void 0,formValues:{},search:``,runAsTask:!1},N7={selectedPromptName:void 0,argumentValues:{},submittedFor:void 0,search:``},P7={selectedResourceUri:void 0,selectedTemplateUri:void 0,originatingTemplateUri:void 0,search:``,openSections:void 0},F7={selectedAppName:void 0,formValues:{},search:``},I7={search:``,statusFilter:void 0},L7={filterText:``,visibleLevels:s5},R7={search:``,methodFilter:void 0,visibleDirections:{client:!0,server:!0}},z7={filterText:``,visibleCategories:a7},B7={filterText:``},Nme=/^[a-zA-Z0-9_-]+$/,Pme=W.withProps({gap:`md`}),Fme=W.withProps({gap:`sm`}),Ime=H.withProps({justify:`flex-end`,gap:`sm`,mt:`md`}),Lme=U.withProps({fw:700,span:!0}),Rme=_h.withProps({size:`lg`,centered:!0}),zme=U.withProps({c:`red`,size:`sm`,role:`alert`}),V7=fv.withProps({required:!0,rightSectionPointerEvents:`auto`}),Bme=fv.withProps({rightSectionPointerEvents:`auto`}),Vme=jm.withProps({autosize:!0,minRows:3,rightSectionPointerEvents:`auto`}),Hme=jm.withProps({autosize:!0,minRows:2,rightSectionPointerEvents:`auto`}),Ume={add:`Add server`,edit:`Edit server`,clone:`Clone server`};function Wme(e,t,n){let r=n===`edit`?e??``:``,i=t?.type===void 0?`stdio`:t.type;if(!t)return{id:r,transport:`stdio`,command:``,argsText:``,envText:``,cwd:``,url:``};if(i===`stdio`){let e=t;return{id:r,transport:i,command:e.command??``,argsText:(e.args??[]).join(`
238
- `),envText:Object.entries(e.env??{}).map(([e,t])=>`${e}=${t}`).join(`
239
- `),cwd:e.cwd??``,url:``}}return{id:r,transport:i,command:``,argsText:``,envText:``,cwd:``,url:(t.type===`sse`||t.type===`streamable-http`?t.url:``)??``}}function Gme(e){return e.split(`
240
- `).map(e=>e.trim()).filter(e=>e.length>0)}function Kme(e){let t={},n=e.split(`
241
- `).map(e=>e.trim()).filter(e=>e.length>0);for(let e of n){let n=e.indexOf(`=`);if(n<=0)return{ok:!1,error:`Invalid env line "${e}". Use KEY=VALUE.`};let r=e.slice(0,n).trim(),i=e.slice(n+1);if(!r)return{ok:!1,error:`Invalid env line "${e}". Empty key.`};t[r]=i}return{ok:!0,value:t}}function qme({opened:e,mode:t,initialId:n,initialConfig:r,existingIds:i,onClose:a,onSubmit:o}){let s=(0,D.useMemo)(()=>Wme(n,r,t),[n,r,t]),[c,l]=(0,D.useState)(s),[u,d]=(0,D.useState)(void 0),[f,p]=(0,D.useState)(!1),m=e=>t=>{let n=t.currentTarget.value;l(t=>({...t,[e]:n}))},h=e=>()=>l(t=>({...t,[e]:``}));Z6(e?s:void 0,()=>{e&&(l(s),d(void 0),p(!1))});let g=c.id.trim(),_=Nme.test(g),v=g.length>0&&i.includes(g),y=g?_?v?`A server with this id already exists.`:void 0:`Use only letters, numbers, hyphens, and underscores.`:void 0;function b(){if(c.transport===`stdio`){if(!c.command.trim())return{ok:!1,error:`Command is required for stdio.`};let e=Kme(c.envText);if(!e.ok)return e;let t={type:`stdio`,command:c.command.trim()},n=Gme(c.argsText);n.length>0&&(t.args=n),Object.keys(e.value).length>0&&(t.env=e.value);let r=c.cwd.trim();return r&&(t.cwd=r),{ok:!0,config:t}}if(!c.url.trim())return{ok:!1,error:`URL is required for sse / streamable-http.`};let e={url:c.url.trim()};return{ok:!0,config:c.transport===`sse`?{type:`sse`,...e}:{type:`streamable-http`,...e}}}async function x(){if(d(void 0),!g){d(`Server id is required.`);return}if(y){d(y);return}let e=b();if(!e.ok){d(e.error);return}p(!0);try{await o(g,e.config),a()}catch(e){d(e instanceof Error?e.message:String(e))}finally{p(!1)}}let S=c.transport===`stdio`;return(0,R.jsx)(Rme,{opened:e,onClose:a,title:(0,R.jsx)(Lme,{children:Ume[t]}),children:(0,R.jsxs)(Pme,{children:[(0,R.jsxs)(Fme,{children:[(0,R.jsx)(V7,{label:`Server ID`,description:`Used as the key in mcp.json. Letters, numbers, hyphens, underscores.`,placeholder:`my-server`,value:c.id,onChange:m(`id`),error:y,"data-autofocus":!0,disabled:f,rightSection:c.id?(0,R.jsx)(P6,{disabled:f,onClick:h(`id`)}):null}),(0,R.jsx)(P_,{label:`Transport`,data:[{value:`stdio`,label:`stdio (local process)`},{value:`sse`,label:`sse (Server-Sent Events)`},{value:`streamable-http`,label:`streamable-http`}],value:c.transport,onChange:e=>l(t=>({...t,transport:e??`stdio`})),allowDeselect:!1,disabled:f}),S?(0,R.jsxs)(R.Fragment,{children:[(0,R.jsx)(V7,{label:`Command`,placeholder:`npx`,value:c.command,onChange:m(`command`),disabled:f,rightSection:c.command?(0,R.jsx)(P6,{disabled:f,onClick:h(`command`)}):null}),(0,R.jsx)(Vme,{label:`Arguments`,description:`One argument per line.`,placeholder:`-y
242
- @modelcontextprotocol/server-everything`,value:c.argsText,onChange:m(`argsText`),disabled:f,rightSection:c.argsText?(0,R.jsx)(P6,{disabled:f,onClick:h(`argsText`)}):null}),(0,R.jsx)(Hme,{label:`Environment`,description:`KEY=VALUE per line.`,placeholder:`DEBUG=1`,value:c.envText,onChange:m(`envText`),disabled:f,rightSection:c.envText?(0,R.jsx)(P6,{disabled:f,onClick:h(`envText`)}):null}),(0,R.jsx)(Bme,{label:`Working directory`,placeholder:`(inherit)`,value:c.cwd,onChange:m(`cwd`),disabled:f,rightSection:c.cwd?(0,R.jsx)(P6,{disabled:f,onClick:h(`cwd`)}):null})]}):(0,R.jsx)(V7,{label:`URL`,placeholder:`https://example.com/mcp`,value:c.url,onChange:m(`url`),disabled:f,rightSection:c.url?(0,R.jsx)(P6,{disabled:f,onClick:h(`url`)}):null})]}),u?(0,R.jsx)(zme,{children:u}):null,(0,R.jsxs)(Ime,{children:[(0,R.jsx)(qp,{variant:`default`,onClick:a,disabled:f,children:`Cancel`}),(0,R.jsx)(qp,{onClick:()=>{x()},loading:f,children:t===`edit`?`Save`:`Add`})]})]})})}function Jme(e,t,n){return e.advertisedExtensions?.[t]??n}var H7=[{value:`legacy`,label:`Legacy (2025-11-25 handshake)`},{value:`auto`,label:`Auto (probe, fall back to legacy)`},{value:`modern`,label:`Modern (2026-07-28, sessionless)`}],Yme=new Set(H7.map(e=>e.value));function Xme(e){return e!==null&&Yme.has(e)}var Zme=UP.map(e=>({value:e,label:e===`off`?`Off (no logs)`:e})),Qme=new Set(UP);function $me(e){return e!==null&&Qme.has(e)}var U7=fv.withProps({rightSectionPointerEvents:`auto`}),ehe=Bg.withProps({min:0,step:100}),W7=Bg.withProps({suffix:` ms`}),the=U.withProps({size:`xs`,c:`var(--inspector-text-secondary)`}),nhe=wd.withProps({align:`flex-start`,gap:`sm`,wrap:`wrap`}),G7=Cu.withProps({color:`red`,variant:`subtle`}),K7=qp.withProps({size:`xs`,variant:`light`}),q7=U.withProps({size:`sm`,c:`dimmed`}),J7=U.withProps({size:`sm`,c:`dimmed`,fs:`italic`}),rhe=qp.withProps({variant:`light`,color:`red`,size:`compact-sm`,flex:`0 0 auto`}),ihe=U.withProps({size:`sm`,c:`dimmed`,flex:1,miw:`12rem`});function Y7({items:e,onChange:t,onRemove:n}){return e.length===0?null:(0,R.jsx)(R.Fragment,{children:e.map((e,r)=>(0,R.jsxs)(H,{grow:!0,children:[(0,R.jsx)(U7,{placeholder:`Key`,value:e.key,onChange:n=>t(r,n.currentTarget.value,e.value),rightSection:e.key?(0,R.jsx)(P6,{onClick:()=>t(r,``,e.value)}):null}),(0,R.jsx)(U7,{placeholder:`Value`,value:e.value,onChange:n=>t(r,e.key,n.currentTarget.value),rightSection:e.value?(0,R.jsx)(P6,{onClick:()=>t(r,e.key,``)}):null}),(0,R.jsx)(G7,{onClick:()=>n(r),children:`X`})]},r))})}function ahe({roots:e,onChange:t,onRemove:n}){return e.length===0?null:(0,R.jsx)(R.Fragment,{children:e.map((e,r)=>(0,R.jsxs)(H,{grow:!0,children:[(0,R.jsx)(U7,{placeholder:`URI (e.g. file:///path)`,value:e.uri,onChange:n=>t(r,n.currentTarget.value,e.name??``),rightSection:e.uri?(0,R.jsx)(P6,{onClick:()=>t(r,``,e.name??``)}):null}),(0,R.jsx)(U7,{placeholder:`Name (optional)`,value:e.name??``,onChange:n=>t(r,e.uri,n.currentTarget.value),rightSection:e.name?(0,R.jsx)(P6,{onClick:()=>t(r,e.uri,``)}):null}),(0,R.jsx)(G7,{onClick:()=>n(r),children:`X`})]},r))})}function ohe({settings:e,serverType:t=`streamable-http`,isStdio:n,expandedSections:r,onExpandedSectionsChange:i,onAddHeader:a,onRemoveHeader:o,onHeaderChange:s,onAddEnv:c,onRemoveEnv:l,onEnvChange:u,onCwdChange:d,onAddMetadata:f,onRemoveMetadata:p,onMetadataChange:m,onTimeoutChange:h,onAutoRefreshChange:g,onPaginatedListsChange:_,onAdvertisedExtensionChange:v,onMaxFetchRequestsChange:y,onProtocolEraChange:b,onModernLogLevelChange:x,negotiatedEra:S,onOAuthChange:C,onClearStoredOAuth:w,onAddRoot:T,onRemoveRoot:E,onRootChange:D}){let O=zP(t),k=e.enterpriseManaged??!1,A=k?`Resource AS Client ID`:`Client ID`,j=k?`Resource AS Client Secret`:`Client Secret`,M=k?`The resource authorization server's registered client credential (EMA leg 3) — not the app client id/secret, which belong in Client Settings.`:void 0,N=e.protocolEra??`legacy`,ee=N===`modern`||N===`auto`&&S!==`legacy`,te=t=>{if(typeof t==`number`){y(t);return}let n=parseInt(t,10);y(Number.isNaN(n)?e.maxFetchRequests:n)},P=e=>t=>{h(e,typeof t==`string`?parseInt(t,10)||0:t)};function F(){return{clientId:e.oauthClientId??``,clientSecret:e.oauthClientSecret??``,scopes:e.oauthScopes??``,enterpriseManaged:e.enterpriseManaged??!1,onInsufficientScope:e.oauthOnInsufficientScope}}return(0,R.jsxs)(Hd,{multiple:!0,variant:`separated`,value:r,onChange:e=>i(e),children:[(0,R.jsxs)(Hd.Item,{value:`options`,children:[(0,R.jsx)(Hd.Control,{children:`Options`}),(0,R.jsx)(Hd.Panel,{children:(0,R.jsxs)(W,{gap:`md`,children:[(0,R.jsx)(P_,{label:`Protocol Era`,description:`Which MCP protocol era to negotiate with this server (independent of the transport). Legacy uses the 2025-11-25 initialize handshake; Auto probes server/discover and falls back to legacy; Modern pins the 2026-07-28 sessionless protocol. Defaults to Legacy — debugging tools should not auto-probe.`,data:H7,value:e.protocolEra??`legacy`,onChange:e=>{Xme(e)&&b(e)},allowDeselect:!1}),ee&&(0,R.jsx)(P_,{label:`Log Level per Request`,description:`Modern-era only. On 2026-07-28 servers there is no logging/setLevel — the client opts into logs per request by stamping this level in each request's _meta, and logs arrive on the originating request's stream. Off requests no logs. Defaults to Debug so a modern connection surfaces server logs out of the box. Legacy servers ignore this and use Set Active Level.`,data:Zme,value:e.modernLogLevel??`debug`,onChange:e=>{$me(e)&&x(e)},allowDeselect:!1}),(0,R.jsx)(Dp,{label:`Auto Refresh on List Changed Notifications`,description:`When checked, tool/prompt/resource lists refresh automatically when the server sends a */list_changed notification. When unchecked, the list-changed indicator appears and you refresh on demand.`,checked:e.autoRefreshOnListChanged??!1,onChange:e=>g(e.currentTarget.checked)}),(0,R.jsx)(Dp,{label:`Fetch Lists One Page at a Time`,description:`When checked, the Tools, Resources, and Prompts lists load a single page and reveal a “Load next page” control instead of auto-loading every page. Useful defensively for servers with very large lists. The per-list sidebar toggle sets this too.`,checked:e.paginatedLists??!1,onChange:e=>_(e.currentTarget.checked)}),(0,R.jsx)(ehe,{label:`Network Log Size`,description:`Maximum number of HTTP requests kept in the Network log for this server. Older entries rotate out past this limit; a response body that arrives after its entry rotated out is dropped. Use 0 for unlimited (not recommended). Applies immediately to the active connection.`,value:e.maxFetchRequests,onChange:te}),n?(0,R.jsx)(U7,{label:`Working Directory`,description:`Directory the stdio server process is launched in. Leave empty to inherit the Inspector's working directory.`,placeholder:`(inherit)`,value:e.cwd??``,onChange:e=>d(e.currentTarget.value),rightSection:e.cwd?(0,R.jsx)(P6,{onClick:()=>d(``)}):null}):null]})})]}),(0,R.jsxs)(Hd.Item,{value:`extensions`,children:[(0,R.jsx)(Hd.Control,{children:`Advertised Extensions`}),(0,R.jsx)(Hd.Panel,{children:(0,R.jsxs)(W,{gap:`xs`,children:[(0,R.jsx)(the,{children:`Which extensions the Inspector declares to this server in its client capabilities. A server may register different tools depending on what the client advertises — toggle these to debug that. Takes effect on the next connect.`}),ZP.map(t=>(0,R.jsx)(Dp,{label:t.label,checked:Jme(e,t.key,t.defaultAdvertised),onChange:e=>v(t.key,e.currentTarget.checked)},t.key))]})})]}),n?(0,R.jsxs)(Hd.Item,{value:`environment`,children:[(0,R.jsx)(Hd.Control,{children:`Environment Variables`}),(0,R.jsx)(Hd.Panel,{children:(0,R.jsxs)(W,{gap:`md`,children:[(0,R.jsxs)(H,{justify:`space-between`,children:[(0,R.jsx)(q7,{children:`Environment variables passed to the stdio server process.`}),(0,R.jsx)(K7,{onClick:c,children:`+ Add Environment Variable`})]}),e.env.length===0?(0,R.jsx)(J7,{children:`No environment variables configured`}):(0,R.jsx)(Y7,{items:e.env,onChange:u,onRemove:l})]})})]}):null,(0,R.jsxs)(Hd.Item,{value:`headers`,children:[(0,R.jsx)(Hd.Control,{children:`Custom Headers`}),(0,R.jsx)(Hd.Panel,{children:(0,R.jsxs)(W,{gap:`md`,children:[(0,R.jsxs)(H,{justify:`space-between`,children:[(0,R.jsx)(q7,{children:"Headers sent with every HTTP request to this server. If OAuth is configured below, the `Authorization` header is owned by the OAuth flow and any value set here is ignored."}),(0,R.jsx)(K7,{onClick:a,children:`+ Add Header`})]}),e.headers.length===0?(0,R.jsx)(J7,{children:`No custom headers configured`}):(0,R.jsx)(Y7,{items:e.headers,onChange:s,onRemove:o})]})})]}),(0,R.jsxs)(Hd.Item,{value:`metadata`,children:[(0,R.jsx)(Hd.Control,{children:`Request Metadata`}),(0,R.jsx)(Hd.Panel,{children:(0,R.jsxs)(W,{gap:`md`,children:[(0,R.jsxs)(H,{justify:`space-between`,children:[(0,R.jsx)(q7,{children:`Metadata sent with every MCP request (included in _meta field)`}),(0,R.jsx)(K7,{onClick:f,children:`+ Add Metadata`})]}),e.metadata.length===0?(0,R.jsx)(J7,{children:`No request metadata configured`}):(0,R.jsx)(Y7,{items:e.metadata,onChange:m,onRemove:p})]})})]}),(0,R.jsxs)(Hd.Item,{value:`timeouts`,children:[(0,R.jsx)(Hd.Control,{children:`Timeouts`}),(0,R.jsx)(Hd.Panel,{children:(0,R.jsxs)(H,{children:[(0,R.jsx)(W7,{label:`Connection Timeout`,value:e.connectionTimeout,onChange:P(`connectionTimeout`)}),(0,R.jsx)(W7,{label:`Request Timeout`,value:e.requestTimeout,onChange:P(`requestTimeout`)}),(0,R.jsx)(W7,{label:`Task TTL`,min:1,value:e.taskTtl,onChange:P(`taskTtl`)})]})})]}),(0,R.jsxs)(Hd.Item,{value:`roots`,children:[(0,R.jsx)(Hd.Control,{children:`Roots`}),(0,R.jsx)(Hd.Panel,{children:(0,R.jsxs)(W,{gap:`md`,children:[(0,R.jsxs)(H,{justify:`space-between`,children:[(0,R.jsx)(q7,{children:`Configure the root directories that the server can access. Each root needs a URI; the name is optional.`}),(0,R.jsx)(K7,{onClick:T,children:`+ Add Root`})]}),e.roots.length===0?(0,R.jsx)(J7,{children:`No roots configured`}):(0,R.jsx)(ahe,{roots:e.roots,onChange:D,onRemove:E})]})})]}),O?(0,R.jsxs)(Hd.Item,{value:`oauth`,children:[(0,R.jsx)(Hd.Control,{children:`OAuth Settings`}),(0,R.jsx)(Hd.Panel,{children:(0,R.jsxs)(W,{gap:`md`,children:[(0,R.jsx)(Dp,{label:`Enterprise-managed authorization`,description:`Connect via the configured enterprise IdP instead of interactive OAuth to the MCP authorization server. OAuth fields below are resource authorization server credentials.`,checked:k,onChange:e=>C({...F(),enterpriseManaged:e.currentTarget.checked})}),(0,R.jsx)(q7,{children:`Pre-configure OAuth credentials for servers requiring authentication`}),(0,R.jsx)(U7,{label:A,description:M,value:e.oauthClientId??``,onChange:e=>C({...F(),clientId:e.currentTarget.value}),rightSection:e.oauthClientId?(0,R.jsx)(P6,{onClick:()=>C({...F(),clientId:``})}):null}),(0,R.jsx)(U7,{label:j,description:M,value:e.oauthClientSecret??``,type:`password`,onChange:e=>C({...F(),clientSecret:e.currentTarget.value}),rightSection:e.oauthClientSecret?(0,R.jsx)(P6,{onClick:()=>C({...F(),clientSecret:``})}):null}),(0,R.jsx)(U7,{label:`Scopes`,description:`Space-separated OAuth scopes (RFC 6749). Do not use commas — a comma-separated entry is sent as one invalid token and rejected by the authorization server.`,placeholder:`mcp tools:read env:read`,value:e.oauthScopes??``,onChange:e=>C({...F(),scopes:e.currentTarget.value}),rightSection:e.oauthScopes?(0,R.jsx)(P6,{onClick:()=>C({...F(),scopes:``})}):null}),(0,R.jsx)(P_,{label:`Insufficient-scope response`,description:`On a 403 insufficient_scope challenge (SEP-2350): re-authorize with the accumulated scope union, or surface the error to you.`,data:[{value:`reauthorize`,label:`Re-authorize (union scopes)`},{value:`throw`,label:`Throw (surface the error)`}],value:e.oauthOnInsufficientScope??`reauthorize`,onChange:e=>C({...F(),onInsufficientScope:e===`throw`?`throw`:`reauthorize`}),allowDeselect:!1}),w?(0,R.jsxs)(nhe,{children:[(0,R.jsx)(rhe,{onClick:w,children:`Clear stored OAuth state`}),(0,R.jsx)(ihe,{children:`Removes stored tokens and client registration for this server. Disconnects if this server is currently connected.`})]}):null]})})]}):null]})}function she(e,t){return[`options`,`extensions`,...t?[`environment`]:[],`headers`,`metadata`,`timeouts`,...zP(e)?[`oauth`]:[],`roots`]}var che=_h.Root.withProps({size:`lg`,centered:!0,scrollAreaComponent:_l.Autosize}),lhe=H.withProps({justify:`space-between`,wrap:`nowrap`,w:`100%`}),uhe=_h.Title.withProps({ta:`center`,flex:1});function dhe({opened:e,settings:t,serverType:n,isStdio:r,negotiatedEra:i,onClose:a,onSettingsChange:o,onClearStoredOAuth:s}){let c=she(n,r),[l,u]=(0,D.useState)([`options`]),d=l.length===c.length;function f(){u(d?[]:c)}function p(){o({...t,headers:[...t.headers,{key:``,value:``}]})}function m(e){o({...t,headers:t.headers.filter((t,n)=>n!==e)})}function h(e,n,r){let i=t.headers.map((t,i)=>i===e?{key:n,value:r}:t);o({...t,headers:i})}function g(){o({...t,env:[...t.env,{key:``,value:``}]})}function _(e){o({...t,env:t.env.filter((t,n)=>n!==e)})}function v(e,n,r){let i=t.env.map((t,i)=>i===e?{key:n,value:r}:t);o({...t,env:i})}function y(e){o({...t,cwd:e})}function b(){o({...t,metadata:[...t.metadata,{key:``,value:``}]})}function x(e){o({...t,metadata:t.metadata.filter((t,n)=>n!==e)})}function S(e,n,r){let i=t.metadata.map((t,i)=>i===e?{key:n,value:r}:t);o({...t,metadata:i})}function C(e,n){o({...t,[e]:n})}function w(e){o({...t,oauthClientId:e.clientId,oauthClientSecret:e.clientSecret,oauthScopes:e.scopes,enterpriseManaged:e.enterpriseManaged?!0:void 0,oauthOnInsufficientScope:e.onInsufficientScope===`throw`?`throw`:void 0})}function T(e){o({...t,autoRefreshOnListChanged:e})}function E(e){o({...t,paginatedLists:e})}function O(e,n){let r={...t.advertisedExtensions},i=ZP.find(t=>t.key===e);i&&n===i.defaultAdvertised?delete r[e]:r[e]=n,o({...t,advertisedExtensions:Object.keys(r).length>0?r:void 0})}function k(e){o({...t,maxFetchRequests:e})}function A(e){o({...t,protocolEra:e})}function j(e){o({...t,modernLogLevel:e})}function M(){o({...t,roots:[...t.roots,{uri:``,name:``}]})}function N(e){o({...t,roots:t.roots.filter((t,n)=>n!==e)})}function ee(e,n,r){let i=t.roots.map((t,i)=>i===e?{...t,uri:n,name:r}:t);o({...t,roots:i})}return(0,R.jsxs)(che,{opened:e,onClose:a,children:[(0,R.jsx)(_h.Overlay,{}),(0,R.jsxs)(_h.Content,{children:[(0,R.jsx)(_h.Header,{children:(0,R.jsxs)(lhe,{children:[(0,R.jsx)(j6,{compact:!d,variant:`subtle`,onToggle:f}),(0,R.jsx)(uhe,{children:`Server Settings`}),(0,R.jsx)(Ou,{"aria-label":`Close`,onClick:a})]})}),(0,R.jsx)(_h.Body,{children:(0,R.jsx)(ohe,{settings:t,serverType:n,isStdio:r,expandedSections:l,onExpandedSectionsChange:u,onAddHeader:p,onRemoveHeader:m,onHeaderChange:h,onAddEnv:g,onRemoveEnv:_,onEnvChange:v,onCwdChange:y,onAddMetadata:b,onRemoveMetadata:x,onMetadataChange:S,onTimeoutChange:C,onAutoRefreshChange:T,onPaginatedListsChange:E,onAdvertisedExtensionChange:O,onMaxFetchRequestsChange:k,onProtocolEraChange:A,onModernLogLevelChange:j,negotiatedEra:i,onOAuthChange:w,onClearStoredOAuth:s,onAddRoot:M,onRemoveRoot:N,onRootChange:ee})})]})]})}var fhe=`Must be an http(s) URL, like https://idp.example.com`,phe=`Issuer is required when enterprise IdP configuration is enabled`,mhe=`Client ID is required when enterprise IdP configuration is enabled`,hhe=`Metadata document URL is required when CIMD is enabled`;function X7(e,t={}){let n={};if(e.emaEnabled&&(e.issuer.trim()===``?t.requireComplete&&(n.issuer=phe):qR(e.issuer)||(n.issuer=fhe),t.requireComplete&&e.clientId.trim()===``&&(n.clientId=mhe)),e.cimdEnabled)if(e.clientMetadataUrl.trim()===``)t.requireComplete&&(n.clientMetadataUrl=hhe);else{let t=$R(e.clientMetadataUrl);t&&(n.clientMetadataUrl=t)}return n}var ghe={emaEnabled:!1,issuer:``,clientId:``,clientSecret:``,cimdEnabled:!1,clientMetadataUrl:``};function _he(e){let t=e.enterpriseManagedAuth,n=t?.idp,r=e.cimd;return{emaEnabled:n?t.enabled!==!1:!1,issuer:n?.issuer??``,clientId:n?.clientId??``,clientSecret:n?.clientSecret??``,cimdEnabled:r?.enabled===!0,clientMetadataUrl:r?.clientMetadataUrl??``}}function vhe(e){return e.issuer.trim()!==``||e.clientId.trim()!==``||e.clientSecret!==``}function yhe(e){let t={cimd:{enabled:e.cimdEnabled,clientMetadataUrl:e.clientMetadataUrl.trim()}};return(vhe(e)||e.emaEnabled)&&(t.enterpriseManagedAuth={enabled:e.emaEnabled,idp:{issuer:e.issuer.trim(),clientId:e.clientId.trim(),clientSecret:e.clientSecret}}),t}function bhe(e){return Object.keys(X7(e,{requireComplete:!0})).length===0}var Z7=U.withProps({size:`sm`,c:`dimmed`}),xhe=Gd.withProps({color:`red`,variant:`light`,title:`Client registration was rejected`}),Q7=fv.withProps({rightSectionPointerEvents:`auto`}),She=H.withProps({justify:`space-between`,align:`flex-start`,wrap:`nowrap`}),Che=W.withProps({gap:4,flex:1}),whe=U.withProps({size:`sm`,fw:500}),$7=Rp.withProps({w:`fit-content`,variant:`light`}),The=qp.withProps({variant:`light`,color:`red`,size:`compact-sm`});function Ehe(e){let t=[e.error,e.errorDescription,e.status?`HTTP ${e.status}`:void 0].filter(Boolean);return t.length>0?t.join(` — `):`The authorization server rejected client registration.`}function Dhe({settings:e,expandedSections:t,onExpandedSectionsChange:n,onSettingsChange:r,emaIdpLoginState:i=`none`,onEmaIdpLogout:a,revealErrors:o=!1,registrationError:s}){function c(e){r(t=>({...t,...e}))}let[l,u]=(0,D.useState)(!1),[d,f]=(0,D.useState)(!1),p=X7(e),m=X7(e,{requireComplete:!0}),h=o?m.issuer:l?p.issuer:void 0,g=o?m.clientId:void 0,_=o?m.clientMetadataUrl:d?p.clientMetadataUrl:void 0,v=e.emaEnabled&&e.issuer.trim()!==``&&i!==`none`;return(0,R.jsxs)(W,{gap:`md`,children:[s&&(0,R.jsx)(xhe,{children:(0,R.jsxs)(W,{gap:4,children:[(0,R.jsx)(U,{size:`sm`,children:Ehe(s)}),(0,R.jsx)(Z7,{children:`Inspector registers as a native client (application_type "native") so authorization servers accept its localhost redirect URI (SEP-837). If the server still rejects Dynamic Client Registration, use a Client ID Metadata Document (below) or a preregistered client instead.`})]})}),(0,R.jsxs)(Hd,{multiple:!0,variant:`separated`,value:t,onChange:e=>n(e),children:[(0,R.jsxs)(Hd.Item,{value:`ema`,children:[(0,R.jsx)(Hd.Control,{children:`Enterprise-Managed Authorization`}),(0,R.jsx)(Hd.Panel,{children:(0,R.jsxs)(W,{gap:`md`,children:[(0,R.jsx)(Dp,{label:`Enable enterprise IdP configuration`,description:`Enterprise-managed authorization signs you in through your organization's IdP instead of each MCP server's own OAuth login. Enable enterprise-managed authorization on participating MCP server's settings.`,checked:e.emaEnabled,onChange:e=>c({emaEnabled:e.currentTarget.checked})}),e.emaEnabled&&(0,R.jsxs)(R.Fragment,{children:[(0,R.jsxs)(Z7,{children:[`Register this redirect URI with your IdP:`,` `,typeof window<`u`?`${window.location.origin}/oauth/callback`:`http://localhost:6274/oauth/callback`]}),(0,R.jsx)(Q7,{label:`Issuer`,description:`Your enterprise IdP issuer URL.`,value:e.issuer,onChange:e=>c({issuer:e.currentTarget.value}),onBlur:()=>u(!0),error:h,rightSection:e.issuer?(0,R.jsx)(P6,{onClick:()=>c({issuer:``})}):null}),(0,R.jsx)(Q7,{label:`IdP Client ID`,description:`Client id registered with your enterprise IdP (EMA legs 1–2) — not the per-server resource authorization server credentials, which go in Server Settings → OAuth Settings.`,value:e.clientId,onChange:e=>c({clientId:e.currentTarget.value}),error:g,rightSection:e.clientId?(0,R.jsx)(P6,{onClick:()=>c({clientId:``})}):null}),(0,R.jsx)(Q7,{label:`IdP Client Secret`,description:`Client secret for your enterprise IdP, if required (EMA legs 1–2) — not the per-server resource authorization server credentials, which go in Server Settings → OAuth Settings.`,type:`password`,value:e.clientSecret,onChange:e=>c({clientSecret:e.currentTarget.value}),rightSection:e.clientSecret?(0,R.jsx)(P6,{onClick:()=>c({clientSecret:``})}):null}),e.issuer.trim()!==``&&(0,R.jsxs)(She,{children:[(0,R.jsxs)(Che,{children:[(0,R.jsx)(whe,{children:`IdP sign-in`}),i===`logged_in`?(0,R.jsxs)(R.Fragment,{children:[(0,R.jsx)($7,{color:`green`,children:`Signed in`}),(0,R.jsx)(Z7,{children:`Your enterprise IdP session is active. Connecting to EMA-enabled MCP servers will not prompt for IdP login until you sign out or the session expires.`})]}):i===`expired`?(0,R.jsxs)(R.Fragment,{children:[(0,R.jsx)($7,{color:`yellow`,children:`Session expired`}),(0,R.jsx)(Z7,{children:`Your cached IdP session has expired. The next connect to an EMA-enabled server will prompt for IdP login.`})]}):(0,R.jsx)(Z7,{children:`Not signed in to your enterprise IdP. Connecting to an EMA-enabled MCP server will open IdP login.`})]}),v&&a?(0,R.jsx)(The,{onClick:a,children:`Sign out`}):null]})]})]})})]}),(0,R.jsxs)(Hd.Item,{value:`cimd`,children:[(0,R.jsx)(Hd.Control,{children:`OAuth Client ID Metadata Document`}),(0,R.jsx)(Hd.Panel,{children:(0,R.jsxs)(W,{gap:`md`,children:[(0,R.jsx)(Z7,{children:`CIMD is the preferred client-identity mechanism in the 2026-07-28 spec. Dynamic Client Registration still works and is used by default when CIMD is off, but it is now deprecated in favor of CIMD (SEP-991).`}),(0,R.jsx)(Dp,{label:`Use Client ID Metadata Document`,description:`When the authorization server supports CIMD, Inspector uses this metadata document URL as the client id. The server fetches and verifies the document during OAuth.`,checked:e.cimdEnabled,onChange:e=>c({cimdEnabled:e.currentTarget.checked})}),e.cimdEnabled&&(0,R.jsxs)(R.Fragment,{children:[(0,R.jsxs)(Z7,{children:[`The metadata document must be served over HTTPS and list this redirect URI:`,` `,typeof window<`u`?`${window.location.origin}/oauth/callback`:`http://localhost:6274/oauth/callback`]}),(0,R.jsx)(Q7,{label:`Client ID metadata document URL`,description:`Public HTTPS URL of your OAuth client metadata JSON document.`,value:e.clientMetadataUrl,onChange:e=>c({clientMetadataUrl:e.currentTarget.value}),onBlur:()=>f(!0),error:_,rightSection:e.clientMetadataUrl?(0,R.jsx)(P6,{onClick:()=>c({clientMetadataUrl:``})}):null})]})]})})]})]})]})}var e9=[`ema`,`cimd`],Ohe=_h.Root.withProps({size:`lg`,centered:!0,scrollAreaComponent:_l.Autosize}),khe=H.withProps({justify:`space-between`,wrap:`nowrap`,w:`100%`}),Ahe=_h.Title.withProps({ta:`center`,flex:1});function jhe({opened:e,settings:t,onClose:n,onSettingsChange:r,emaIdpLoginState:i,onEmaIdpLogout:a}){let[o,s]=(0,D.useState)([`ema`]),[c,l]=(0,D.useState)(!1),u=o.length===e9.length;function d(){s(u?[]:e9)}function f(){let e=X7(t,{requireComplete:!0});if(Object.keys(e).length>0){l(!0);return}n()}return(0,R.jsxs)(Ohe,{opened:e,onClose:f,children:[(0,R.jsx)(_h.Overlay,{}),(0,R.jsxs)(_h.Content,{children:[(0,R.jsx)(_h.Header,{children:(0,R.jsxs)(khe,{children:[(0,R.jsx)(j6,{compact:!u,variant:`subtle`,onToggle:d}),(0,R.jsx)(Ahe,{children:`Client Settings`}),(0,R.jsx)(Ou,{"aria-label":`Close`,onClick:f})]})}),(0,R.jsx)(_h.Body,{children:(0,R.jsx)(Dhe,{settings:t,expandedSections:o,onExpandedSectionsChange:s,onSettingsChange:r,emaIdpLoginState:i,onEmaIdpLogout:a,revealErrors:c})})]})]})}function t9(e){let t;try{t=JSON.parse(e)}catch(e){let t=e instanceof Error?e.message:String(e);throw Error(`Invalid JSON: ${t}`,{cause:e})}if(!t||typeof t!=`object`||Array.isArray(t))throw Error(`Expected a JSON object at the top level`);return t}function n9(e){let t={};for(let[n,r]of Object.entries(e))!r||typeof r!=`object`||Array.isArray(r)||(t[n]=GP(r));return t}function r9(e){let t=t9(e).mcpServers;if(!t||typeof t!=`object`||Array.isArray(t))throw Error(`No 'mcpServers' object found in config file`);return{mcpServers:n9(t)}}function i9(e){let t=t9(e).servers;if(!t||typeof t!=`object`||Array.isArray(t))throw Error(`No 'servers' object found in VS Code config file`);return{mcpServers:n9(t)}}function Mhe(e){try{return r9(e)}catch(t){try{return i9(e)}catch{throw t instanceof Error?t:Error(String(t))}}}function a9(e){return/^[a-zA-Z0-9_-]+$/.test(e)&&e.length>0}function o9(e,t,n){return e[t]===void 0?e[n]:e[t]}function s9(e){return typeof e==`string`?e:void 0}function c9(e){return e&&typeof e==`object`&&!Array.isArray(e)?e:void 0}function l9(e){return Array.isArray(e)?e:[]}function Nhe(e){return(e.split(`/`).pop()??e).replace(/[^A-Za-z0-9_-]/g,`-`).replace(/^-+|-+$/g,``)||`server`}function Phe(e){let t=[];for(let n of e){let e=c9(n);if(!e)continue;let r=s9(e.name);if(!r)continue;let i=!!o9(e,`isRequired`,`is_required`),a=!!o9(e,`isSecret`,`is_secret`),o=s9(e.default)??s9(e.value);t.push({name:r,description:s9(e.description),required:i,...o===void 0?{}:{default:o},...a?{isSecret:!0}:{}})}return t}function u9(e){let t=[];for(let n of e){let e=c9(n);if(!e)continue;let r=s9(e.type)??`positional`,i=s9(e.value)??s9(e.default);if(r===`named`){let n=s9(e.name);if(!n)continue;t.push(n),i!==void 0&&t.push(i)}else i!==void 0&&t.push(i)}return t}function Fhe(e){let t={};for(let n of e)n.default!==void 0&&(t[n.name]=n.default);return t}function Ihe(e,t,n){let r=e=>n?`${t}${e}${n}`:t;switch(e){case`npm`:return{command:`npx`,runtimeHint:`npx`,ref:r(`@`)};case`pypi`:return{command:`uvx`,runtimeHint:`uvx`,ref:t};case`oci`:return{command:`docker`,runtimeHint:`docker`,ref:t};case`nuget`:return{command:`dnx`,runtimeHint:`dnx`,ref:r(`@`)};default:return null}}function Lhe(e){let t=s9(o9(e,`registryType`,`registry_type`))??``,n=s9(e.identifier)??``;if(!t||!n)return null;let r=Ihe(t,n,s9(e.version));if(!r)return null;let i=Phe(l9(o9(e,`environmentVariables`,`environment_variables`))),a=u9(l9(o9(e,`runtimeArguments`,`runtime_arguments`))),o=u9(l9(o9(e,`packageArguments`,`package_arguments`))),s=Fhe(i),c=i.flatMap(e=>[`-e`,e.name]),l=r.command===`docker`?[`run`,`-i`,`--rm`,...a,...c,r.ref,...o]:t===`npm`?[...a,`-y`,r.ref,...o]:[...a,r.ref,...o],u={type:`stdio`,command:r.command,...l.length>0?{args:l}:{},...Object.keys(s).length>0?{env:s}:{}};return{registryType:t,identifier:n,runtimeHint:r.runtimeHint,baseConfig:u,envVars:i}}function Rhe(e,t){return t?e.replace(/\{([^}]+)\}/g,(e,n)=>{let r=c9(t[n]);return(r?s9(r.default):void 0)??e}):e}function zhe(e){let t=s9(e.type),n=s9(e.url);if(!n)return null;let r=t===`sse`?`sse`:`streamable-http`,i=Rhe(n,c9(e.variables));return{registryType:`remote`,identifier:i,runtimeHint:r,baseConfig:r===`sse`?{type:`sse`,url:i}:{type:`streamable-http`,url:i},envVars:[]}}function Bhe(e){let t;try{t=JSON.parse(e)}catch(e){let t=e instanceof Error?e.message:String(e);throw Error(`Invalid JSON: ${t}`,{cause:e})}let n=c9(t);if(!n)throw Error(`Expected a JSON object at the top level`);let r=c9(n.server)??n,i=s9(r.name);if(!i)throw Error(`server.json is missing a 'name' field`);let a=[];for(let e of l9(r.packages)){let t=c9(e);if(!t)continue;let n=Lhe(t);n&&a.push(n)}for(let e of l9(r.remotes)){let t=c9(e);if(!t)continue;let n=zhe(t);n&&a.push(n)}if(a.length===0)throw Error(`No runnable package or remote found in server.json (mcpb-only or unsupported registry types are not importable)`);return{serverName:Nhe(i),fullName:i,options:a}}function Vhe(e,t){if(e.baseConfig.type!==`stdio`)return{...e.baseConfig};let n={...e.baseConfig.env??{}};for(let[e,r]of Object.entries(t))r===``?delete n[e]:n[e]=r;let{env:r,...i}=e.baseConfig;return{...i,...Object.keys(n).length>0?{env:n}:{}}}function Hhe(e,t){return(t??``).trim()||e.serverName}function d9(e,t={}){let n=Math.min(t.selectedIndex??0,Math.max(e.options.length-1,0)),r=Hhe(e,t.idOverride);return{selectedIndex:n,selectedOption:e.options[n],serverId:r,idIsValid:a9(r),idIsDuplicate:(t.existingIds??[]).includes(r)}}function Uhe(e,t){let n={};for(let r of e.envVars){let e=t[r.name];e!==void 0&&(n[r.name]=e)}return Vhe(e,n)}function f9(...e){return e.map((e,t)=>t===0?e.replace(/\/+$/,``):e.replace(/^\/+|\/+$/g,``)).filter(e=>e.length>0).join(`/`)}function Whe(e){return f9(e,`AppData`,`Roaming`)}function p9(e,t,n){return e===`darwin`?f9(t,`Library`,`Application Support`,n):e===`win32`?f9(Whe(t),n):f9(t,`.config`,n)}var m9=[{id:`claude-desktop`,label:`Claude Desktop`,defaultPaths:(e,t)=>[f9(p9(e,t,`Claude`),`claude_desktop_config.json`)],parse:r9},{id:`cursor`,label:`Cursor`,defaultPaths:(e,t)=>[f9(t,`.cursor`,`mcp.json`)],parse:r9},{id:`cline`,label:`Cline`,defaultPaths:(e,t)=>[f9(p9(e,t,`Code`),`User`,`globalStorage`,`saoudrizwan.claude-dev`,`settings`,`cline_mcp_settings.json`),f9(t,`Documents`,`Cline`,`MCP`,`cline_mcp_settings.json`)],parse:r9},{id:`vscode`,label:`VS Code`,defaultPaths:(e,t)=>[f9(p9(e,t,`Code`),`User`,`mcp.json`)],parse:i9}];Object.fromEntries(m9.map(e=>[e.id,e]));function h9(e,t){let n=new Set(t),r=[],i=[];for(let[t,a]of Object.entries(e.mcpServers))n.has(t)?i.push({id:t,config:a}):r.push({id:t,config:a});return{additions:r,conflicts:i}}function Ghe(e,t){let n=new Set(t),r=e.replace(/[^A-Za-z0-9_-]/g,`-`).replace(/^-+|-+$/g,``)||`server`;if(!n.has(r))return r;for(let e=2;;e++){let t=`${r}-${e}`;if(!n.has(t))return t}}function Khe({opened:e,existingIds:t,onFetchSource:n,onAddServer:r,onUpdateServer:i}){let[a,o]=(0,D.useState)(`select`),[s,c]=(0,D.useState)(void 0),[l,u]=(0,D.useState)(void 0),[d,f]=(0,D.useState)(null),[p,m]=(0,D.useState)({}),[h,g]=(0,D.useState)({}),[_,v]=(0,D.useState)([]),[y,b]=(0,D.useState)(null),[x,S]=(0,D.useState)(e);e!==x&&(S(e),e&&(o(`select`),c(void 0),u(void 0),f(null),m({}),g({}),v([]),b(null)));let C=(0,D.useMemo)(()=>d?h9(d,t):null,[d,t]);function w(e){let n=h9(e,t);if(n.additions.length===0&&n.conflicts.length===0){c(`No servers found in the selected source.`),o(`select`);return}let r=[...t,...n.additions.map(e=>e.id)],i={};for(let e of n.conflicts)i[e.id]={action:`skip`,renameTo:Ghe(e.id,r)};let a={};for(let e of n.additions)a[e.id]=`import`;f(e),m(i),g(a),c(void 0),o(`review`)}async function T(e){o(`loading`),c(void 0),u(void 0);try{let t=await n(e);if(t.error){c(t.error),o(`select`);return}if(!t.found||!t.config){u(`No config found. Searched: ${t.searched.join(`, `)}. Try uploading a file instead.`),o(`select`);return}w(t.config)}catch(e){c(e instanceof Error?e.message:String(e)),o(`select`)}}async function E(e){if(e){c(void 0),u(void 0);try{w(Mhe(await e.text()))}catch(e){c(e instanceof Error?e.message:String(e))}}}function O(e,t){m(n=>({...n,[e]:{...n[e],action:t}}))}function k(e,t){m(n=>({...n,[e]:{...n[e],renameTo:t}}))}function A(e,t){g(n=>({...n,[e]:t}))}async function j(e,t,n){try{return await n(),{id:e,status:t}}catch(t){return{id:e,status:`failed`,detail:t instanceof Error?t.message:String(t)}}}async function M(){if(!C)return;o(`loading`);let e=[];for(let t of C.additions){if((h[t.id]??`import`)===`skip`){e.push({id:t.id,status:`skipped`});continue}e.push(await j(t.id,`added`,()=>Promise.resolve(r(t.id,t.config))))}for(let t of C.conflicts){let n=p[t.id]??{action:`skip`,renameTo:t.id};if(n.action===`skip`)e.push({id:t.id,status:`skipped`});else if(n.action===`overwrite`)e.push(await j(t.id,`overwritten`,()=>i(t.id,t.id,t.config)));else{let i=n.renameTo.trim()||t.id;e.push(await j(i,`renamed`,()=>Promise.resolve(r(i,t.config))))}}v(e),o(`summary`)}let N=C?C.additions.filter(e=>(h[e.id]??`import`)===`import`).length+C.conflicts.filter(e=>(p[e.id]?.action??`skip`)!==`skip`).length:0,ee=(0,D.useMemo)(()=>{if(!C)return{};let e={};for(let n of C.conflicts){let r=p[n.id];if(r?.action!==`rename`)continue;let i=r.renameTo.trim();if(!i){e[n.id]=`A new id is required.`;continue}if(!a9(i)){e[n.id]=`Use only letters, numbers, hyphens, underscores.`;continue}let a=new Set(t);for(let e of C.additions)(h[e.id]??`import`)===`import`&&a.add(e.id);for(let e of C.conflicts){if(e.id===n.id)continue;let t=p[e.id];t?.action===`rename`&&a.add(t.renameTo.trim())}a.has(i)&&(e[n.id]=`"${i}" is already in use.`)}return e},[C,p,h,t]);return{phase:a,error:s,notice:l,plan:C,resolutions:p,additionActions:h,outcomes:_,selectedType:y,importCount:N,renameErrors:ee,canImport:N>0&&Object.keys(ee).length===0,setSelectedType:b,pickSource:T,pickFile:E,setResolution:O,setRenameTo:k,setAdditionAction:A,runImport:M,back:()=>o(`select`)}}var g9=W.withProps({gap:`md`}),qhe=H.withProps({gap:`sm`,align:`flex-end`,wrap:`nowrap`}),_9=H.withProps({justify:`flex-end`,gap:`sm`,mt:`md`}),v9=H.withProps({justify:`space-between`,wrap:`nowrap`,gap:`sm`}),Jhe=U.withProps({size:`sm`,c:`dimmed`}),Yhe=U.withProps({fw:700,span:!0}),y9=U.withProps({fw:600,size:`sm`}),Xhe=_h.withProps({size:`lg`,centered:!0}),Zhe=U.withProps({size:`xs`,c:`var(--inspector-status-error)`}),Qhe=Gd.withProps({color:`red`,title:`Import error`}),$he=Bh.withProps({label:`Client`,flex:1}),ege=[{value:``,label:`Select a client…`},...m9.map(e=>({value:e.id,label:e.label}))],tge=[{value:`overwrite`,label:`Overwrite`},{value:`skip`,label:`Skip`},{value:`rename`,label:`Rename`}],nge=[{value:`import`,label:`Import`},{value:`skip`,label:`Skip`}],rge={added:{label:`Imported`,color:`green`},overwritten:{label:`Overwritten`,color:`blue`},renamed:{label:`Renamed`,color:`blue`},skipped:{label:`Skipped`,color:`gray`},failed:{label:`Failed`,color:`red`}};function ige({opened:e,existingIds:t,onClose:n,onFetchSource:r,onAddServer:i,onUpdateServer:a}){let o=Khe({opened:e,existingIds:t,onFetchSource:r,onAddServer:i,onUpdateServer:a}),{plan:s}=o;return(0,R.jsx)(Xhe,{opened:e,onClose:n,title:(0,R.jsx)(Yhe,{children:`Import from client config`}),children:(0,R.jsxs)(g9,{children:[o.error?(0,R.jsx)(Qhe,{children:o.error}):null,o.notice?(0,R.jsx)(Gd,{variant:`warning`,children:o.notice}):null,o.phase===`select`?(0,R.jsxs)(g9,{children:[(0,R.jsx)(Jhe,{children:`Import MCP servers from another client. Choose a known client (read on this machine) or upload its config file.`}),(0,R.jsxs)(qhe,{children:[(0,R.jsx)($he,{data:ege,value:o.selectedType??``,onChange:e=>o.setSelectedType(e.currentTarget.value||null)}),(0,R.jsx)(qp,{disabled:!o.selectedType,onClick:()=>{o.selectedType&&o.pickSource(o.selectedType)},children:`Import`}),(0,R.jsx)(lm,{accept:`application/json,.json`,onChange:e=>void o.pickFile(e),children:e=>(0,R.jsx)(qp,{...e,variant:`default`,children:`From file…`})})]})]}):null,o.phase===`loading`?(0,R.jsxs)(H,{gap:`sm`,children:[(0,R.jsx)(hu,{size:`sm`}),(0,R.jsx)(U,{size:`sm`,children:`Working…`})]}):null,o.phase===`review`&&s?(0,R.jsxs)(g9,{children:[s.additions.length>0?(0,R.jsxs)(W,{gap:`xs`,children:[(0,R.jsxs)(y9,{children:[`New servers (`,s.additions.length,`)`]}),s.additions.map(e=>(0,R.jsxs)(v9,{children:[(0,R.jsx)(U,{size:`sm`,children:e.id}),(0,R.jsx)(N_,{size:`xs`,data:nge,value:o.additionActions[e.id]??`import`,onChange:t=>o.setAdditionAction(e.id,t)})]},e.id))]}):null,s.conflicts.length>0?(0,R.jsxs)(W,{gap:`xs`,children:[(0,R.jsxs)(y9,{children:[`Already exists (`,s.conflicts.length,`)`]}),s.conflicts.map(e=>{let t=o.resolutions[e.id];return(0,R.jsxs)(W,{gap:`xs`,children:[(0,R.jsxs)(v9,{children:[(0,R.jsx)(U,{size:`sm`,children:e.id}),(0,R.jsx)(N_,{size:`xs`,data:tge,value:t?.action??`skip`,onChange:t=>o.setResolution(e.id,t)})]}),t?.action===`rename`?(0,R.jsx)(fv,{size:`xs`,"aria-label":`New id for ${e.id}`,value:t.renameTo,error:o.renameErrors[e.id],onChange:t=>o.setRenameTo(e.id,t.currentTarget.value)}):null]},e.id)})]}):null,(0,R.jsxs)(_9,{children:[(0,R.jsx)(qp,{variant:`default`,onClick:o.back,children:`Back`}),(0,R.jsxs)(qp,{onClick:()=>void o.runImport(),disabled:!o.canImport,children:[`Import `,o.importCount,` server`,o.importCount===1?``:`s`]})]})]}):null,o.phase===`summary`?(0,R.jsxs)(g9,{children:[(0,R.jsx)(y9,{children:`Import complete`}),o.outcomes.map(e=>{let t=rge[e.status];return(0,R.jsxs)(W,{gap:2,children:[(0,R.jsxs)(v9,{children:[(0,R.jsx)(U,{size:`sm`,children:e.id}),(0,R.jsx)(Rp,{color:t.color,variant:`light`,children:t.label})]}),e.detail?(0,R.jsx)(Zhe,{children:e.detail}):null]},`${e.id}-${e.status}`)}),(0,R.jsx)(_9,{children:(0,R.jsx)(qp,{onClick:n,children:`Done`})})]}):null]})})}var age=1e3,b9={rawText:``,envOverrides:{}};function x9(e){if(!e.trim())return{ok:null};try{return{ok:!0,parsed:Bhe(e)}}catch(e){return{ok:!1,error:e instanceof Error?e.message:String(e)}}}function oge({opened:e,existingIds:t,onAddServer:n}){let[r,i]=(0,D.useState)(b9),[a,o]=(0,D.useState)(void 0),[s,c]=(0,D.useState)(b9.rawText),[l,u]=(0,D.useState)(!0),[d,f]=(0,D.useState)(!1),[p,m]=(0,D.useState)(e);e!==p&&(m(e),e&&(i(b9),o(void 0),c(b9.rawText),u(!0),f(!1))),(0,D.useEffect)(()=>{let e=setTimeout(()=>c(r.rawText),300);return()=>clearTimeout(e)},[r.rawText]),(0,D.useEffect)(()=>{if(!r.rawText.trim())return;let e,t=setTimeout(()=>{f(!0),e=setTimeout(()=>{f(!1),u(!1)},250)},age);return()=>{clearTimeout(t),e&&clearTimeout(e)}},[r.rawText]);let h=(0,D.useMemo)(()=>x9(s),[s]),g=(0,D.useMemo)(()=>{if(h.ok===!0)return d9(h.parsed,{selectedIndex:r.selectedPackageIndex,idOverride:r.nameOverride,existingIds:t})},[h,r.selectedPackageIndex,r.nameOverride,t]),_=g?.selectedIndex??0,v=g?.selectedOption,y=h.ok===!0?h.parsed:void 0,b=g!==void 0&&g.idIsValid&&!g.idIsDuplicate,x=y?.options.map(e=>({registryType:e.registryType,identifier:e.identifier,runtimeHint:e.runtimeHint})),S=(v?.envVars??[]).map(e=>({name:e.name,description:e.description,required:e.required,value:r.envOverrides[e.name]??e.default??``})),C=(0,D.useMemo)(()=>{if(h.ok===null)return[{type:`info`,message:`Paste server.json content to validate.`}];if(h.ok===!1)return[{type:`error`,message:h.error}];let e=[{type:`success`,message:`Valid server.json for "${h.parsed.fullName}".`},{type:`info`,message:`${h.parsed.options.length} runnable option(s) found.`}];return g&&!g.idIsValid?e.push({type:`error`,message:`Server id must use only letters, numbers, hyphens, underscores.`}):g?.idIsDuplicate&&e.push({type:`warning`,message:`A server with id "${g.serverId}" already exists.`}),e},[h,g]),w=a?[...C,{type:`error`,message:a}]:C;function T(e){o(void 0),i(t=>({...t,rawText:e})),f(!1),e.trim()||u(!0)}function E(e){i(t=>({...t,selectedPackageIndex:e}))}function O(e,t){i(n=>({...n,envOverrides:{...n.envOverrides,[e]:t}}))}function k(e){i(t=>({...t,nameOverride:e}))}async function A(e){if(e){o(void 0),f(!1);try{let t=await e.text();i(e=>({...e,rawText:t}))}catch(e){o(e instanceof Error?e.message:String(e))}}}async function j(){o(void 0);let e=x9(r.rawText);if(e.ok!==!0)return o(`Fix the validation errors before adding the server.`),!1;let i=d9(e.parsed,{selectedIndex:r.selectedPackageIndex,idOverride:r.nameOverride,existingIds:t});if(!i.idIsValid||i.idIsDuplicate)return o(`Fix the validation errors before adding the server.`),!1;let a=Uhe(i.selectedOption,r.envOverrides);try{return await n(i.serverId,a),!0}catch(e){return o(e instanceof Error?e.message:String(e)),!1}}return{draft:{...r,selectedPackageIndex:_},validation:w,packages:x,envVars:S,canAdd:b,defaultServerName:y?.serverName??``,fileContentsOpen:l,fileContentsHighlight:d,setRawText:T,selectPackage:E,setEnvVar:O,setServerName:k,pickFile:A,setFileContentsOpen:u,submit:j}}var sge={success:{icon:`✓`,color:`green`},warning:{icon:`⚠`,color:`yellow`},info:{icon:`ℹ`,color:`blue`},error:{icon:`✗`,color:`red`}},cge=U.withProps({size:`sm`,c:`dimmed`}),lge=H.withProps({justify:`space-between`,align:`center`,wrap:`nowrap`}),uge=qp.withProps({variant:`default`,size:`xs`}),dge=jm.withProps({"aria-label":`File Contents`,ff:`monospace`,autosize:!0,minRows:8,maxRows:15,rightSectionPointerEvents:`auto`}),fge=fv.withProps({label:`From configuration`,description:`The id derived from the server.json name.`,readOnly:!0}),pge=fv.withProps({label:`Override`,description:`Optional. Used instead of the name above.`,rightSectionPointerEvents:`auto`});function mge(e){return`${e.registryType}: ${e.identifier} (${e.runtimeHint})`}function hge({draft:e,validation:t,packages:n,envVars:r,onJsonChange:i,onSelectPackage:a,onEnvVarChange:o,onServerNameChange:s,defaultServerName:c,onAddServer:l,addDisabled:u,fileContentsOpen:d,onFileContentsChange:f,fileContentsHighlight:p,onPickFile:m}){let h=e.rawText.trim().length>0;return(0,R.jsxs)(W,{gap:`md`,children:[(0,R.jsxs)(lge,{children:[(0,R.jsx)(cge,{children:`Paste server.json content, or load it from a file:`}),m?(0,R.jsx)(lm,{accept:`application/json,.json`,onChange:m,children:e=>(0,R.jsx)(uge,{...e,children:`Choose file…`})}):null]}),(0,R.jsx)(Hd,{variant:`separated`,transitionDuration:325,...f?{value:d?`file-contents`:null,onChange:e=>f(e===`file-contents`)}:{defaultValue:`file-contents`},children:(0,R.jsxs)(Hd.Item,{value:`file-contents`,children:[(0,R.jsx)(Hd.Control,{bg:p?`var(--mantine-color-default-hover)`:void 0,children:`File Contents`}),(0,R.jsx)(Hd.Panel,{children:(0,R.jsx)(dge,{value:e.rawText,onChange:e=>i(e.currentTarget.value),rightSection:e.rawText?(0,R.jsx)(P6,{onClick:()=>i(``)}):null})})]})}),h&&(0,R.jsxs)(R.Fragment,{children:[(0,R.jsx)(Hd,{variant:`separated`,defaultValue:`validation`,children:(0,R.jsxs)(Hd.Item,{value:`validation`,children:[(0,R.jsx)(Hd.Control,{children:`Validation Results`}),(0,R.jsx)(Hd.Panel,{children:(0,R.jsx)(W,{gap:`xs`,children:t.map((e,t)=>{let{icon:n,color:r}=sge[e.type];return(0,R.jsxs)(H,{gap:`xs`,children:[(0,R.jsx)(U,{c:r,children:n}),(0,R.jsx)(U,{size:`sm`,children:e.message})]},t)})})})]})}),n&&n.length>1&&(0,R.jsxs)(R.Fragment,{children:[(0,R.jsx)(cm,{}),(0,R.jsx)(Sv,{order:5,children:`Package Selection:`}),(0,R.jsx)(d_.Group,{value:String(e.selectedPackageIndex??0),onChange:e=>a(Number(e)),children:(0,R.jsx)(W,{gap:`xs`,children:n.map((e,t)=>(0,R.jsx)(d_,{value:String(t),label:mge(e)},t))})})]}),r.length>0&&(0,R.jsxs)(R.Fragment,{children:[(0,R.jsx)(cm,{}),(0,R.jsx)(Sv,{order:5,children:`Environment Variables:`}),r.map(e=>(0,R.jsx)(fv,{label:e.name,description:e.description,withAsterisk:e.required,value:e.value,onChange:t=>o(e.name,t.currentTarget.value),rightSectionPointerEvents:`auto`,rightSection:e.value?(0,R.jsx)(P6,{onClick:()=>o(e.name,``)}):null},e.name))]}),(0,R.jsx)(Hd,{variant:`separated`,defaultValue:`server-name`,children:(0,R.jsxs)(Hd.Item,{value:`server-name`,children:[(0,R.jsx)(Hd.Control,{children:`Server Name`}),(0,R.jsx)(Hd.Panel,{children:(0,R.jsxs)(W,{gap:`sm`,children:[(0,R.jsx)(fge,{value:c??``}),(0,R.jsx)(pge,{value:e.nameOverride??``,onChange:e=>s(e.currentTarget.value),rightSection:e.nameOverride?(0,R.jsx)(P6,{onClick:()=>s(``)}):null})]})})]})})]}),(0,R.jsx)(H,{justify:`flex-end`,children:(0,R.jsx)(qp,{onClick:l,disabled:u,children:`Add Server`})})]})}var gge=U.withProps({fw:700,span:!0}),_ge=_h.withProps({size:`lg`,centered:!0});function vge({opened:e,existingIds:t,onClose:n,onAddServer:r}){let i=oge({opened:e,existingIds:t,onAddServer:r});return(0,R.jsx)(_ge,{opened:e,onClose:n,title:(0,R.jsx)(gge,{children:`Import from registry config`}),children:(0,R.jsx)(hge,{draft:i.draft,validation:i.validation,packages:i.packages,envVars:i.envVars,addDisabled:!i.canAdd,fileContentsOpen:i.fileContentsOpen,onFileContentsChange:i.setFileContentsOpen,fileContentsHighlight:i.fileContentsHighlight,onJsonChange:i.setRawText,onSelectPackage:i.selectPackage,onEnvVarChange:i.setEnvVar,onServerNameChange:i.setServerName,defaultServerName:i.defaultServerName,onAddServer:()=>{i.submit().then(e=>{e&&n()})},onPickFile:e=>void i.pickFile(e)})})}var yge={tools:`Tools`,resources:`Resources`,prompts:`Prompts`,logging:`Logging`,completions:`Completions`,tasks:`Tasks`,experimental:`Experimental`,roots:`Roots`,sampling:`Sampling`,elicitation:`Elicitation`};function S9({capability:e,supported:t,count:n}){let r=yge[e]??String(e),i=n==null?r:`${r} (${n})`;return(0,R.jsxs)(H,{gap:`xs`,children:[(0,R.jsx)(U,{c:t?`green`:`red`,children:t?`✓`:`✗`}),(0,R.jsx)(U,{children:i})]})}var bge=wd.withProps({justify:`space-between`,align:`center`,gap:`sm`,wrap:`nowrap`}),xge=U.withProps({size:`sm`}),Sge=wd.withProps({gap:4,align:`center`,wrap:`nowrap`}),C9=qp.withProps({variant:`subtle`,size:`compact-xs`}),Cge=wd.withProps({align:`flex-start`,gap:4,wrap:`nowrap`}),wge=wd.withProps({flex:1,miw:0,direction:`column`}),Tge=nm.withProps({block:!0,py:`xs`,ps:`xs`,pe:0,variant:`wrapping`});function Ege({token:e}){let t=e.split(`.`);return(0,R.jsx)(R.Fragment,{children:t.map((e,t)=>(0,R.jsxs)(D.Fragment,{children:[t>0&&`.`,e]},t))})}function Dge({accessToken:e,onClear:t,clearLabel:n=`Clear`}){let[r,i]=(0,D.useState)(!1),a=qI(e),o=(0,D.useMemo)(()=>a?JI(e):void 0,[e,a]),s=(0,D.useMemo)(()=>{if(o)return JSON.stringify({header:o.header,payload:o.payload},null,2)},[o]);return(0,R.jsxs)(W,{gap:`xs`,children:[(0,R.jsxs)(bge,{children:[(0,R.jsx)(xge,{children:`Access Token`}),(0,R.jsxs)(Sge,{children:[o&&(0,R.jsx)(C9,{onClick:()=>i(e=>!e),"aria-pressed":r,children:r?`Show token`:`Decode JWT`}),t&&(0,R.jsx)(C9,{color:`red`,onClick:t,children:n})]})]}),(0,R.jsxs)(Cge,{children:[(0,R.jsx)(wge,{children:(0,R.jsx)(Tge,{children:r&&s?s:a?(0,R.jsx)(Ege,{token:e}):e})}),(0,R.jsx)(h3,{value:r&&s?s:e,flush:!0})]})]})}var w9=U.withProps({size:`sm`,fw:600}),T9=`— (not reported by server)`,E9=Sv.withProps({order:3,size:`h5`,variant:`section`}),D9=nm.withProps({variant:`wrapping`}),Oge=qp.withProps({variant:`subtle`,color:`red`,size:`compact-xs`});function kge(e){return e.join(`, `)}function Age(e){return e===`ema`?`Enterprise-managed`:`Standard`}function jge(e){switch(e){case`logged_in`:return`Signed in`;case`expired`:return`Session expired`;default:return`Not signed in`}}function Mge(e){switch(e){case`static`:return`Static (preregistered)`;case`dcr`:return`Dynamic (DCR)`;case`cimd`:return`Client ID Metadata (CIMD)`}}function Nge(e,t){return t===`stdio`?`N/A (stdio)`:R8(e)?`Sessionless`:`Session-based`}function O9(e){let t=e?Object.keys(e):[];return t.length>0?t.join(`, `):`—`}var Pge=[`tools`,`resources`,`prompts`,`logging`,`completions`,`tasks`,`experimental`],Fge=[`roots`,`sampling`,`elicitation`,`experimental`];function k9(e,t){return t.map(t=>({capability:t,supported:t in e&&e[t]!=null}))}function Ige({initializeResult:e,serverInfoReported:t=!0,clientCapabilities:n,transport:r,protocolEra:i,discoverResult:a,oauth:o,onClearOAuth:s}){let{serverInfo:c,protocolVersion:l,capabilities:u,instructions:d}=e,f=t?c.name?.trim()||`—`:T9,p=t?c.version?.trim()||`—`:T9,m=k9(u,Pge),h=k9(n,Fge);return(0,R.jsxs)(W,{gap:`md`,children:[(0,R.jsxs)(W,{gap:`xs`,children:[(0,R.jsx)(E9,{children:`Server Implementation`}),(0,R.jsxs)(L_,{cols:2,children:[(0,R.jsx)(U,{size:`sm`,children:`Name`}),(0,R.jsx)(w9,{children:f}),(0,R.jsx)(U,{size:`sm`,children:`Version`}),(0,R.jsx)(w9,{children:p}),(0,R.jsx)(U,{size:`sm`,children:`Protocol`}),(0,R.jsx)(w9,{children:l||`—`}),(0,R.jsx)(U,{size:`sm`,children:`Transport`}),(0,R.jsx)(Rp,{variant:`outline`,children:r}),(0,R.jsx)(U,{size:`sm`,children:`Era`}),(0,R.jsx)(I5,{era:i}),(0,R.jsx)(U,{size:`sm`,children:`Session`}),(0,R.jsx)(w9,{children:Nge(i,r)})]})]}),a&&(0,R.jsxs)(W,{gap:`xs`,children:[(0,R.jsx)(E9,{children:`Discovery`}),(0,R.jsxs)(L_,{cols:2,children:[(0,R.jsx)(U,{size:`sm`,children:`Supported versions`}),(0,R.jsx)(w9,{children:a.supportedVersions.length>0?a.supportedVersions.join(`, `):`—`})]})]}),(0,R.jsxs)(L_,{cols:2,children:[(0,R.jsxs)(W,{gap:`xs`,children:[(0,R.jsx)(E9,{children:`Server Capabilities`}),m.map(e=>(0,R.jsx)(S9,{capability:e.capability,supported:e.supported},e.capability))]}),(0,R.jsxs)(W,{gap:`xs`,children:[(0,R.jsx)(E9,{children:`Client Capabilities`}),h.map(e=>(0,R.jsx)(S9,{capability:e.capability,supported:e.supported},e.capability))]})]}),(0,R.jsxs)(L_,{cols:2,children:[(0,R.jsxs)(W,{gap:`xs`,children:[(0,R.jsx)(E9,{children:`Server Extensions`}),(0,R.jsx)(w9,{children:O9(u.extensions)})]}),(0,R.jsxs)(W,{gap:`xs`,children:[(0,R.jsx)(E9,{children:`Client Advertised Extensions`}),(0,R.jsx)(w9,{children:O9(n.extensions)})]})]}),d&&(0,R.jsxs)(W,{gap:`xs`,children:[(0,R.jsx)(E9,{children:`Server Instructions`}),(0,R.jsx)(_l.Autosize,{mah:280,children:(0,R.jsx)(f6,{block:{type:`text`,text:d},copyable:!0})})]}),o&&(0,R.jsxs)(W,{gap:`xs`,children:[(0,R.jsx)(E9,{children:`OAuth Details`}),(0,R.jsxs)(W,{gap:`xs`,children:[(0,R.jsxs)(L_,{cols:2,children:[(0,R.jsx)(U,{size:`sm`,children:`Protocol`}),(0,R.jsx)(w9,{children:Age(o.protocol)}),(0,R.jsx)(U,{size:`sm`,children:`Status`}),(0,R.jsx)(Rp,{variant:`outline`,color:o.authorized?`green`:`gray`,children:o.authorized?`Authorized`:`Not authorized`})]}),o.clientId&&(0,R.jsxs)(L_,{cols:2,children:[(0,R.jsx)(U,{size:`sm`,children:`Client ID`}),(0,R.jsx)(D9,{children:o.clientId})]}),o.clientRegistrationKind&&(0,R.jsxs)(L_,{cols:2,children:[(0,R.jsx)(U,{size:`sm`,children:`Client registration`}),(0,R.jsx)(w9,{children:Mge(o.clientRegistrationKind)})]}),o.protocol===`ema`&&o.idpSession&&(0,R.jsxs)(L_,{cols:2,children:[(0,R.jsx)(U,{size:`sm`,children:`IdP session`}),(0,R.jsx)(w9,{children:jge(o.idpSession)})]}),o.authUrl&&(0,R.jsxs)(L_,{cols:2,children:[(0,R.jsx)(U,{size:`sm`,children:`Auth URL`}),(0,R.jsx)(D9,{children:o.authUrl})]}),o.scopes&&o.scopes.length>0&&(0,R.jsxs)(L_,{cols:2,children:[(0,R.jsx)(U,{size:`sm`,children:`Scopes`}),(0,R.jsx)(w9,{children:kge(o.scopes)})]}),o.accessToken?(0,R.jsx)(Dge,{accessToken:o.accessToken,onClear:s,clearLabel:`Clear OAuth state and disconnect`}):s&&(0,R.jsx)(wd,{justify:`flex-end`,children:(0,R.jsx)(Oge,{onClick:s,children:`Clear OAuth state and disconnect`})})]})]})]})}var Lge=_h.Root.withProps({size:`lg`,centered:!0,scrollAreaComponent:_l.Autosize}),Rge=H.withProps({justify:`space-between`,wrap:`nowrap`,w:`100%`});function zge({opened:e,onClose:t,initializeResult:n,serverInfoReported:r,clientCapabilities:i,transport:a,protocolEra:o,discoverResult:s,oauth:c,onClearOAuth:l}){return(0,R.jsxs)(Lge,{opened:e,onClose:t,children:[(0,R.jsx)(_h.Overlay,{}),(0,R.jsxs)(_h.Content,{children:[(0,R.jsx)(_h.Header,{children:(0,R.jsxs)(Rge,{children:[(0,R.jsx)(_h.Title,{flex:1,children:`Connection Info`}),(0,R.jsx)(Ou,{"aria-label":`Close`,onClick:t})]})}),(0,R.jsx)(_h.Body,{children:(0,R.jsx)(Ige,{initializeResult:n,serverInfoReported:r,clientCapabilities:i,transport:a,protocolEra:o,discoverResult:s,oauth:c,onClearOAuth:l})})]})]})}function Bge(e){let t=(e.grantedScope??e.configuredScope)?.split(` `).filter(Boolean);return{protocol:e.protocol,authorized:e.authorized,...e.client?.clientId&&{clientId:e.client.clientId},...e.client?.registrationKind&&{clientRegistrationKind:e.client.registrationKind},...e.authorizationServerMetadata?.authorization_endpoint&&{authUrl:e.authorizationServerMetadata.authorization_endpoint},...t&&t.length>0&&{scopes:t},...e.tokens?.access_token&&{accessToken:e.tokens.access_token},...e.protocol===`ema`&&e.ema?.idpSession&&{idpSession:e.ema.idpSession}}}var Vge=_h.withProps({withCloseButton:!1,size:`lg`,centered:!0}),Hge=H.withProps({justify:`space-between`,wrap:`nowrap`}),Uge=U.withProps({size:`sm`,c:`dimmed`}),Wge=jm.withProps({"aria-label":`Validation details`,readOnly:!0,autosize:!0,minRows:6,maxRows:18});function Gge({opened:e,onClose:t,toolName:n,message:r}){return(0,R.jsx)(Vge,{opened:e,onClose:t,children:(0,R.jsxs)(W,{gap:`md`,children:[(0,R.jsxs)(Hge,{children:[(0,R.jsx)(_h.Title,{flex:1,children:`Output schema validation`}),(0,R.jsx)(Ou,{"aria-label":`Close`,onClick:t})]}),(0,R.jsx)(Uge,{children:n?`"${n}" returned structuredContent that does not match its declared outputSchema. The inspector renders the app anyway, but strict MCP clients may refuse to display it.`:`The tool result's structuredContent does not match the declared outputSchema. The inspector renders the app anyway, but strict MCP clients may refuse to display it.`}),(0,R.jsx)(Wge,{value:r??``})]})})}var Kge=_h.withProps({withCloseButton:!1,size:`lg`,centered:!0}),qge=H.withProps({justify:`space-between`,wrap:`nowrap`}),Jge=U.withProps({size:`sm`,c:`dimmed`}),Yge=jm.withProps({"aria-label":`Error details`,readOnly:!0,autosize:!0,minRows:6,maxRows:18});function Xge({opened:e,onClose:t,toolName:n,details:r}){return(0,R.jsx)(Kge,{opened:e,onClose:t,children:(0,R.jsxs)(W,{gap:`md`,children:[(0,R.jsxs)(qge,{children:[(0,R.jsx)(_h.Title,{flex:1,children:`URL elicitation required`}),(0,R.jsx)(Ou,{"aria-label":`Close`,onClick:t})]}),(0,R.jsx)(Jge,{children:n?`"${n}" returned a URLElicitationRequired (-32042) error with no required elicitations. Per the MCP spec the error must list the URL elicitations to complete before retrying, so the inspector has nothing to open.`:`The server returned a URLElicitationRequired (-32042) error with no required elicitations. Per the MCP spec the error must list the URL elicitations to complete before retrying, so the inspector has nothing to open.`}),(0,R.jsx)(Yge,{value:r??``})]})})}var Zge=H.withProps({justify:`flex-end`,gap:`sm`,mt:`md`}),Qge=El.withProps({p:`sm`,radius:`sm`,bg:`var(--inspector-surface-subtle)`,withBorder:!0}),$ge=_h.withProps({size:`md`,centered:!0,title:`Remove server?`}),e_e=U.withProps({component:`span`,fw:600}),t_e=U.withProps({size:`sm`,fw:600}),n_e=U.withProps({size:`xs`,c:`dimmed`}),r_e=U.withProps({c:`red`,size:`sm`,role:`alert`});function i_e(e){return e?`url`in e?e.url:[e.command,...e.args??[]].join(` `):``}function a_e({opened:e,target:t,onConfirm:n,onCancel:r}){let[i,a]=(0,D.useState)(!1),[o,s]=(0,D.useState)(void 0);async function c(){if(t){s(void 0),a(!0);try{await n()}catch(e){s(e instanceof Error?e.message:String(e))}finally{a(!1)}}}return(0,R.jsx)($ge,{opened:e,onClose:r,children:(0,R.jsxs)(W,{gap:`md`,children:[(0,R.jsxs)(U,{size:`sm`,children:[`The entry will be removed from`,` `,(0,R.jsx)(e_e,{children:`~/.mcp-inspector/mcp.json`}),`. You can add it back at any time.`]}),t?(0,R.jsx)(Qge,{children:(0,R.jsxs)(W,{gap:4,children:[(0,R.jsx)(t_e,{children:t.id}),(0,R.jsxs)(n_e,{children:[t.config.type??`stdio`,` · `,i_e(t.config)]})]})}):null,o?(0,R.jsx)(r_e,{children:o}):null,(0,R.jsxs)(Zge,{children:[(0,R.jsx)(qp,{variant:`default`,onClick:r,disabled:i,children:`Cancel`}),(0,R.jsx)(qp,{color:`red`,onClick:()=>{c()},loading:i,children:`Remove`})]})]})})}var o_e=H.withProps({justify:`flex-end`,gap:`sm`,mt:`md`}),A9=U.withProps({component:`span`,ff:`monospace`,size:`sm`}),s_e=_h.withProps({size:`md`,centered:!0}),j9=U.withProps({size:`sm`,fw:600}),c_e=U.withProps({size:`xs`,c:`dimmed`}),l_e=Bm.withProps({size:`sm`,spacing:`xs`,listStyleType:`none`}),u_e=Bm.withProps({size:`sm`,spacing:`xs`}),d_e=H.withProps({gap:`xs`,wrap:`nowrap`}),f_e=Rp.withProps({size:`xs`,variant:`light`});function p_e({opened:e,challenge:t,authorizationScopes:n,enterpriseManaged:r,onAuthorize:i,onCancel:a}){let o=t?JL(t):[],s=r===!0,c=()=>void i(),l=new Set(o),u=n??o,d=u.filter(e=>!l.has(e)),f=!s&&d.length>0;return(0,R.jsx)(s_e,{opened:e,onClose:a,title:WL({enterpriseManaged:s}),children:(0,R.jsxs)(W,{gap:`md`,children:[(0,R.jsxs)(U,{size:`sm`,children:[HL(t||{reason:`insufficient_scope`},{enterpriseManaged:s}),` `,UL({enterpriseManaged:s})]}),f?(0,R.jsxs)(W,{gap:`xs`,children:[(0,R.jsx)(j9,{children:`Scopes to authorize`}),(0,R.jsx)(c_e,{children:`Re-authorizing with the union of your previously granted scopes and the ones this operation requires, so the new token keeps every grant (SEP-2350).`}),(0,R.jsx)(l_e,{children:u.map(e=>(0,R.jsx)(Bm.Item,{children:(0,R.jsxs)(d_e,{children:[(0,R.jsx)(A9,{children:e}),(0,R.jsx)(f_e,{color:l.has(e)?`blue`:`gray`,children:l.has(e)?`new`:`already granted`})]})},e))})]}):o.length>0?(0,R.jsxs)(W,{gap:`xs`,children:[(0,R.jsx)(j9,{children:s?`Additional permissions needed`:`Additional scopes needed`}),(0,R.jsx)(u_e,{children:o.map(e=>(0,R.jsx)(Bm.Item,{children:(0,R.jsx)(A9,{children:e})},e))})]}):null,(0,R.jsxs)(o_e,{children:[(0,R.jsx)(qp,{variant:`default`,onClick:a,children:`Cancel`}),(0,R.jsx)(qp,{onClick:c,children:`Authorize`})]})]})})}var m_e=`Re-authentication required`,h_e=`Re-authenticate`,g_e=Gd.withProps({color:`red`,variant:`reauth`,withCloseButton:!0,closeButtonLabel:`Dismiss`}),__e=H.withProps({justify:`space-between`,align:`center`,wrap:`nowrap`,gap:`md`}),v_e=U.withProps({component:`span`,size:`sm`}),y_e=qp.withProps({size:`xs`,variant:`filled`});function b_e({message:e,title:t=m_e,actionLabel:n=h_e,onReauthenticate:r,onDismiss:i}){return(0,R.jsx)(g_e,{title:t,onClose:i,children:(0,R.jsxs)(__e,{children:[(0,R.jsx)(v_e,{children:e}),(0,R.jsx)(y_e,{onClick:r,children:n})]})})}var x_e=H.withProps({gap:`xs`,align:`center`,wrap:`nowrap`}),S_e=U.withProps({size:`xs`,c:`dimmed`}),C_e=Rp.withProps({variant:`outline`,color:`blue`}),w_e={"input-required":`The server returned input_required; your answer is sent back as a retry of the original request (MRTR).`,"task-input-required":`This task reached input_required; your answer is submitted via a tasks/update request (SEP-2663), not a retry.`};function M9({origin:e=`server-request`}){let t=w_e[e];return t?(0,R.jsxs)(x_e,{children:[(0,R.jsx)(C_e,{children:`input_required`}),(0,R.jsx)(S_e,{children:t})]}):null}function N9(e){return e<.4?`low (${e})`:e<=.7?`medium (${e})`:`high (${e})`}function P9(e,t){return e===void 0?t:String(e)}function T_e(e){return JSON.stringify(e)}var F9=Sv.withProps({order:3,size:`h5`}),E_e=U.withProps({size:`sm`,c:`dimmed`}),D_e=_l.Autosize.withProps({mah:`calc(90dvh - 10rem)`,scrollbars:`y`,offsetScrollbars:!0}),O_e=W.withProps({gap:`md`}),k_e=El.withProps({p:`sm`,withBorder:!0}),A_e=qp.withProps({variant:`light`,color:`red`}),j_e=jm.withProps({"aria-label":`Response`,autosize:!0,minRows:3,rightSectionPointerEvents:`auto`}),M_e=fv.withProps({label:`Model Used`,rightSectionPointerEvents:`auto`}),N_e=P_.withProps({label:`Stop Reason`,data:[`endTurn`,`stopSequence`,`maxTokens`]});function P_e({request:e,draftResult:t,onResultChange:n,onSend:r,onReject:i,origin:a=`server-request`,busy:o=!1}){let{messages:s,modelPreferences:c,maxTokens:l,stopSequences:u,temperature:d,includeContext:f}=e,p=c?.hints?.map(e=>e.name).filter(Boolean)??[];return(0,R.jsxs)(W,{gap:`md`,children:[(0,R.jsx)(D_e,{children:(0,R.jsxs)(O_e,{children:[(0,R.jsx)(E_e,{children:`The server is requesting an LLM completion.`}),(0,R.jsx)(M9,{origin:a}),(0,R.jsx)(F9,{children:`Messages:`}),s.map((e,t)=>(0,R.jsx)(N8,{index:t,message:e},t)),c&&(0,R.jsx)(k_e,{children:(0,R.jsxs)(W,{gap:`xs`,children:[(0,R.jsx)(F9,{children:`Model Preferences:`}),p.length>0&&(0,R.jsxs)(H,{gap:`xs`,children:[(0,R.jsx)(U,{size:`sm`,children:`Hints:`}),p.map(e=>(0,R.jsx)(Rp,{children:e},e))]}),c?.costPriority!==void 0&&(0,R.jsxs)(U,{size:`sm`,children:[`Cost Priority:`,` `,N9(c.costPriority)]}),c?.speedPriority!==void 0&&(0,R.jsxs)(U,{size:`sm`,children:[`Speed Priority:`,` `,N9(c.speedPriority)]}),c?.intelligencePriority!==void 0&&(0,R.jsxs)(U,{size:`sm`,children:[`Intelligence Priority:`,` `,N9(c.intelligencePriority)]})]})}),(0,R.jsx)(F9,{children:`Parameters:`}),(0,R.jsxs)(U,{size:`sm`,children:[`Max Tokens: `,P9(l,`not specified`)]}),(0,R.jsxs)(U,{size:`sm`,children:[`Stop Sequences:`,` `,u?T_e(u):`not specified`]}),(0,R.jsxs)(U,{size:`sm`,children:[`Temperature: `,P9(d,`not specified`)]}),f&&(0,R.jsxs)(H,{gap:`xs`,children:[(0,R.jsx)(U,{size:`sm`,children:`Include Context:`}),(0,R.jsx)(Rp,{children:f})]}),(0,R.jsx)(cm,{}),(0,R.jsx)(F9,{children:`Response:`}),(0,R.jsx)(j_e,{value:t.content.type===`text`?t.content.text:``,onChange:e=>n({...t,content:{type:`text`,text:e.currentTarget.value}}),rightSection:t.content.type===`text`&&t.content.text?(0,R.jsx)(P6,{onClick:()=>n({...t,content:{type:`text`,text:``}})}):null}),(0,R.jsxs)(H,{children:[(0,R.jsx)(M_e,{value:t.model,onChange:e=>n({...t,model:e.currentTarget.value}),rightSection:t.model?(0,R.jsx)(P6,{onClick:()=>n({...t,model:``})}):null}),(0,R.jsx)(N_e,{value:t.stopReason??null,onChange:e=>n({...t,stopReason:e??void 0})})]})]})}),(0,R.jsxs)(H,{justify:`flex-end`,children:[(0,R.jsx)(A_e,{onClick:i,disabled:o,children:`Reject`}),(0,R.jsx)(qp,{onClick:r,disabled:o,children:`Send Response`})]})]})}var F_e=U.withProps({size:`md`,fs:`italic`}),I_e=_l.Autosize.withProps({mah:`calc(90dvh - 22rem)`,scrollbars:`y`,offsetScrollbars:!0}),L_e=Gd.withProps({variant:`warning`,title:`Warning`}),R_e=qp.withProps({variant:`light`,color:`red`});function z_e(e){return`\u201C${e}\u201D`}function B_e(e){return`Only provide information you trust this server with. The server \u201C${e}\u201D is requesting this data.`}function V_e({request:e,serverName:t,values:n,onChange:r,onSubmit:i,onDecline:a,onCancel:o,origin:s=`server-request`,busy:c=!1}){let l=e.requestedSchema,u=c||K6(l,n);return(0,R.jsxs)(W,{gap:`md`,children:[(0,R.jsx)(F_e,{children:z_e(e.message)}),(0,R.jsx)(M9,{origin:s}),(0,R.jsx)(cm,{}),(0,R.jsx)(I_e,{children:(0,R.jsx)(e8,{schema:l,values:n,onChange:r,disabled:c})}),(0,R.jsx)(L_e,{children:B_e(t)}),(0,R.jsxs)(H,{justify:`flex-end`,children:[(0,R.jsx)(qp,{variant:`light`,onClick:o,disabled:c,children:`Cancel`}),(0,R.jsx)(R_e,{onClick:a,disabled:c,children:`Decline`}),(0,R.jsx)(qp,{onClick:i,disabled:u,children:`Submit`})]})]})}var H_e=U.withProps({size:`md`,fs:`italic`}),U_e=nm.withProps({block:!0,variant:`wrapping`}),W_e=U.withProps({size:`sm`,c:`dimmed`}),G_e=U.withProps({size:`xs`,c:`dimmed`}),K_e=Gd.withProps({variant:`warning`,title:`Warning`});function q_e(e){return`Request ID: ${e}`}function J_e({message:e,url:t,requestId:n,isWaiting:r,onCopyUrl:i,onOpenInBrowser:a,onComplete:o,onCancel:s,origin:c=`server-request`,busy:l=!1}){return(0,R.jsxs)(W,{gap:`md`,children:[(0,R.jsx)(H_e,{children:e}),(0,R.jsx)(M9,{origin:c}),(0,R.jsx)(cm,{}),(0,R.jsx)(U,{size:`sm`,children:`The server is requesting you visit:`}),(0,R.jsx)(U_e,{children:t}),(0,R.jsxs)(H,{children:[(0,R.jsx)(qp,{variant:`light`,onClick:i,children:`Copy URL`}),(0,R.jsx)(qp,{variant:`light`,onClick:a,disabled:l,children:r?`Reopen in Browser`:`Open in Browser`})]}),(0,R.jsx)(cm,{}),r&&(0,R.jsxs)(H,{children:[(0,R.jsx)(hu,{size:`sm`}),(0,R.jsx)(W_e,{children:`Waiting for completion...`})]}),(0,R.jsx)(G_e,{children:q_e(n)}),(0,R.jsx)(K_e,{children:`This will open an external URL. Verify the domain before proceeding.`}),(0,R.jsxs)(H,{justify:`flex-end`,children:[(0,R.jsx)(qp,{variant:`light`,onClick:s,disabled:l,children:`Cancel`}),r&&(0,R.jsx)(qp,{onClick:o,disabled:l,children:`I've completed it`})]})]})}var Y_e=H.withProps({justify:`space-between`,gap:`md`,w:`100%`,wrap:`nowrap`}),X_e=U.withProps({fw:600}),Z_e=U.withProps({size:`xs`,c:`dimmed`}),Q_e=_h.withProps({withCloseButton:!1,closeOnClickOutside:!1,closeOnEscape:!1,size:`lg`});function $_e(){return{model:`stub-model`,stopReason:`endTurn`,role:`assistant`,content:{type:`text`,text:``}}}function eve(e){return e.kind===`sampling`?`Sampling Request`:`Elicitation Request`}function tve(){}function I9(){let[e,t]=(0,D.useState)(!1),n=(0,D.useRef)(!1);return{responded:e,once:e=>()=>{n.current||(n.current=!0,t(!0),e())}}}function nve({request:e,origin:t,onRespond:n,onReject:r}){let[i,a]=(0,D.useState)($_e),{responded:o,once:s}=I9();return(0,R.jsx)(P_e,{request:e,origin:t,draftResult:i,onResultChange:a,onSend:s(()=>n(i)),onReject:s(r),busy:o})}function rve({request:e,serverName:t,origin:n,onRespond:r}){let[i,a]=(0,D.useState)(()=>G6(e.requestedSchema)),{responded:o,once:s}=I9();return(0,R.jsx)(V_e,{request:e,serverName:t,origin:n,values:i,onChange:a,onSubmit:s(()=>r({action:`accept`,content:i})),onDecline:s(()=>r({action:`decline`})),onCancel:s(()=>r({action:`cancel`})),busy:o})}function ive({id:e,message:t,url:n,origin:r,onRespond:i}){let[a,o]=(0,D.useState)(!1),{responded:s,once:c}=I9();return(0,R.jsx)(J_e,{message:t,url:n,origin:r,requestId:e,isWaiting:a,onCopyUrl:()=>{navigator.clipboard?.writeText(n),o(!0)},onOpenInBrowser:()=>{window.open(n,`_blank`,`noopener,noreferrer`),o(!0)},onComplete:c(()=>i({action:`accept`})),onCancel:c(()=>i({action:`cancel`})),busy:s})}function ave({request:e,serverName:t,queuePosition:n,onSamplingRespond:r,onSamplingReject:i,onElicitationRespond:a}){return(0,R.jsxs)(Q_e,{opened:e!==null,onClose:tve,title:e&&(0,R.jsxs)(Y_e,{children:[(0,R.jsx)(X_e,{children:eve(e)}),n&&(0,R.jsx)(Z_e,{children:n})]}),children:[e?.kind===`sampling`&&(0,R.jsx)(nve,{request:e.request,origin:e.origin,onRespond:r,onReject:i},e.id),e?.kind===`elicitation-form`&&(0,R.jsx)(rve,{request:e.request,serverName:t,origin:e.origin,onRespond:a},e.id),e?.kind===`elicitation-url`&&(0,R.jsx)(ive,{id:e.id,message:e.message,url:e.url,origin:e.origin,onRespond:a},e.id)]})}var ove=`deep-link`,sve=new Set([`http`,`sse`]);function cve(e){if(!e)return{};let t=e.replace(/-/g,`+`).replace(/_/g,`/`),n=t+`=`.repeat((4-t.length%4)%4),r;try{r=atob(n)}catch{return{}}try{let e=JSON.parse(r);return typeof e==`object`&&e&&!Array.isArray(e)?e:{}}catch{return{}}}function lve(e){let t;try{t=new URL(e)}catch{return}if(t.protocol===`http:`||t.protocol===`https:`)return t.href}function uve(e,t){return e.type===t.type&&(`url`in e?e.url:void 0)===(`url`in t?t.url:void 0)}function dve(e,t){if(t)return`parsed`;let n=new URLSearchParams(e);return n.has(`serverUrl`)||n.has(`autoConnect`)?`rejected`:`none`}function fve(e,t){let n=new URLSearchParams(e),r=n.get(`serverUrl`),i=n.get(`autoConnect`);if(!r||!i||!t||i!==t)return;let a=lve(r);if(!a)return;let o=n.get(`transport`)??`http`;return{serverId:ove,serverConfig:(sve.has(o)?o:`http`)===`sse`?{type:`sse`,url:a}:{type:`streamable-http`,url:a},openApp:n.get(`openApp`)??void 0,appArgs:cve(n.get(`appArgs`)),autoOpen:n.get(`autoOpen`)===t}}var pve=`/oauth/callback`,L9=`mcp-inspector:oauth-pending-server-id`,R9=`mcp-inspector:oauth-resume`;function mve(e){return{Apps:e.appsUi,Tools:e.toolsUi,Prompts:e.promptsUi,Resources:e.resourcesUi,Tasks:e.tasksUi,Logs:e.logsUi,Protocol:e.protocolUi,Network:e.networkUi}}function hve(e,t){if(e)for(let n of Object.keys(e)){if(!d7(n))continue;let r=e[n];switch(n){case`Tools`:t.setToolsUi(r??M7);break;case`Prompts`:t.setPromptsUi(r??N7);break;case`Resources`:t.setResourcesUi(r??P7);break;case`Apps`:t.setAppsUi(r??F7);break;case`Tasks`:t.setTasksUi(r??I7);break;case`Logs`:t.setLogsUi(r??L7);break;case`Protocol`:t.setProtocolUi(r??R7);break;case`Network`:t.setNetworkUi(r??z7)}}}function gve(e){if(!(typeof window>`u`))try{window.sessionStorage.setItem(R9,JSON.stringify(e))}catch{}}function _ve(){if(!(typeof window>`u`))try{let e=window.sessionStorage.getItem(R9);if(!e)return vve();let t=JSON.parse(e);return t?.version!==1||typeof t.serverId!=`string`||!bve(t.authKind)||typeof t.activeTab!=`string`||!xve(t.tabUi)?void 0:t}catch{return}}function z9(){let e=_ve();return e&&B9(),e}function vve(){try{let e=window.sessionStorage.getItem(L9);return e?{version:1,serverId:e,activeTab:u7,authKind:`reauth`,tabUi:{}}:void 0}catch{return}}function B9(){if(!(typeof window>`u`))try{window.sessionStorage.removeItem(R9),window.sessionStorage.removeItem(L9)}catch{}}function yve(e,t){return IL(e,t)}function V9(e){return YL(e)}function bve(e){return e===`step_up`||e===`reauth`}function xve(e){return e===void 0?!0:typeof e!=`object`||!e||Array.isArray(e)?!1:Object.keys(e).every(e=>d7(e))}function Sve(e,t){hve(e.tabUi,t),t.setActiveTab(e.activeTab),t.clearToolCallState(),t.clearGetPromptState(),t.clearReadResourceState()}var Cve=class extends PI{constructor(e,t){super(n=>{if(typeof window>`u`)throw Error(`BrowserNavigation requires browser environment`);return t?.(n),window.location.href=n.href,e?.(n)})}};function wve(e,t,n){let r=`${window.location.protocol}//${window.location.host}`,i=(...e)=>globalThis.fetch(...e),a=wz({baseUrl:r,authToken:e,fetchFn:i});return{environment:{transport:vz({baseUrl:r,authToken:e,fetchFn:i}),fetch:xz({baseUrl:r,authToken:e,fetchFn:i}),logger:a,oauth:{storage:Xz(e),navigation:new Cve(void 0,n),redirectUrlProvider:t}},logger:a}}async function H9(e){let t=Gne(e.config);return t?(e.isActiveConnection&&e.inspectorClient?await e.inspectorClient.clearOAuthTokens():await e.oauthStorage.clear(t),!0):!1}function U9(){return typeof document<`u`&&document.visibilityState===`visible`}function Tve(e){if(typeof document>`u`)return()=>{};let t=()=>{document.visibilityState===`visible`&&e()};return document.addEventListener(`visibilitychange`,t),()=>document.removeEventListener(`visibilitychange`,t)}var Eve={getRedirectUrl:()=>`${window.location.origin}${pve}`};function W9(){if(typeof window>`u`)return;let e=DR.AUTH_TOKEN,t=t=>{try{window.sessionStorage.setItem(e,t)}catch{}},n=WP(window)[OR];if(typeof n==`string`&&n)return t(n),n;let r=new URLSearchParams(window.location.search).get(DR.AUTH_TOKEN);if(r)return t(r),r;try{return window.sessionStorage.getItem(e)??void 0}catch{return}}function Dve(e){let t=[];for(let n of e){if(n.direction!==`notification`||!(`method`in n.message)||n.message.method!==`notifications/message`)continue;let e=n.message.params;t.push({receivedAt:n.timestamp,params:e})}return t}async function Ove(e,t,n,r){if(!E5(t))return`Replay isn't supported for "${t}".`;let i=typeof n?.cursor==`string`?n.cursor:void 0;switch(t){case`tools/call`:{let t=typeof n?.name==`string`?n.name:void 0,i=r.find(e=>e.name===t);return i?(await e.callTool(i,n?.arguments??{}),null):`Tool "${t??`?`}" is no longer available to replay.`}case`prompts/get`:{let t=typeof n?.name==`string`?n.name:void 0;return t?(await e.getPrompt(t,n?.arguments??{}),null):`Prompt name is missing; cannot replay.`}case`resources/read`:{let t=typeof n?.uri==`string`?n.uri:void 0;return t?(await e.readResource(t),null):`Resource URI is missing; cannot replay.`}case`tools/list`:return await e.listTools(i),null;case`prompts/list`:return await e.listPrompts(i),null;case`resources/list`:return await e.listResources(i),null;case`resources/templates/list`:return await e.listResourceTemplates(i),null;case`tasks/list`:return await e.listRequestorTasks(i),null;case`ping`:return await e.ping(),null;default:return`Replay isn't supported for "${t}".`}}var G9={headers:[],env:[],metadata:[],connectionTimeout:0,requestTimeout:0,taskTtl:Kne,autoRefreshOnListChanged:!1,paginatedLists:!1,maxFetchRequests:qne,roots:[]};function K9(e){return`fetch-body-dropped-${e}`}var kve=`client-config-load-error`,Ave=Bm.withProps({size:`sm`,spacing:2}),q9=Qd.withProps({component:`button`,type:`button`,size:`sm`}),jve=El.withProps({px:`md`,pt:`xs`,pos:`sticky`,top:60,bg:`var(--mantine-color-body)`,shadow:`sm`,styles:{root:{zIndex:200}},radius:0}),Mve=({maxFetchRequests:e,onAdjust:t})=>(0,R.jsxs)(W,{gap:4,children:[(0,R.jsxs)(U,{size:`sm`,children:[`A response body arrived after its Network log entry had already rotated out (the log hit its `,e,`-request limit), so the body couldn't be shown. This usually indicates:`]}),(0,R.jsxs)(Ave,{children:[(0,R.jsx)(Bm.Item,{children:`a chatty or misbehaving server (notification storms, rapid polling)`}),(0,R.jsx)(Bm.Item,{children:`an SSE/transport reconnect or retry storm`}),(0,R.jsx)(Bm.Item,{children:`a slow streaming call racing against high request volume`}),(0,R.jsx)(Bm.Item,{children:`the Network Log Size set too low for this server's traffic`})]}),(0,R.jsx)(q9,{onClick:t,children:`Adjust Network Log Size for this server`})]}),Nve=({onViewDetails:e})=>(0,R.jsxs)(W,{gap:4,children:[(0,R.jsx)(U,{size:`sm`,children:`The tool result's structuredContent doesn't match the tool's outputSchema. The inspector renders it anyway, but strict MCP clients may not.`}),(0,R.jsx)(q9,{onClick:e,children:`View validation details`})]}),Pve=({onViewDetails:e})=>(0,R.jsxs)(W,{gap:4,children:[(0,R.jsx)(U,{size:`sm`,children:`The server reported a URLElicitationRequired error but listed no required elicitations, so there's nothing to open.`}),(0,R.jsx)(q9,{onClick:e,children:`View error details`})]});function J9(e){return e instanceof Error?e.message:String(e)}function Fve(e){if(e&&typeof e==`object`){let t=e.code;if(typeof t==`number`)return t}}function Ive(e){if(e&&typeof e==`object`){let t=e;if(t.code!==void 0||t.data!==void 0)return JSON.stringify({code:t.code,message:t.message,data:t.data},null,2)}return J9(e)}var Y9=5e3,Lve=5e3;function Rve(e){return`progress-${String(e??`default`)}`}function zve(e){let{progress:t,total:n,message:r}=e,i=n!==void 0&&n>0?`${t} / ${n} (${Math.round(t/n*100)}%)`:`${t}`;return r?`${r} — ${i}`:i}var Bve=new Set([`completed`,`failed`,`cancelled`]);function Vve(e){return Bve.has(e)}function X9(e){return`task-${e}`}function Z9(e){switch(e){case`completed`:return`green`;case`failed`:return`red`;case`cancelled`:return`gray`;case`input_required`:return`yellow`;default:return`blue`}}function Hve(e){return e.statusMessage??`Task ${e.status}`}function Q9(e,t){return BL(e,{enterpriseManaged:t?.settings?.enterpriseManaged})}function $9(e,t){return VL(e,{enterpriseManaged:t?.settings?.enterpriseManaged})}function Uve(){let{setColorScheme:e}=li(),t=ui(`light`)===`dark`,n=(0,D.useCallback)(()=>{e(t?`light`:`dark`)},[t,e]),{servers:r,addServer:i,updateServer:a,updateServerSettings:o,removeServer:s,reorderServers:c,importSource:l}=jz({baseUrl:typeof window<`u`?window.location.origin:`http://localhost`,authToken:W9()}),[u,d]=(0,D.useState)(null),[f,p]=(0,D.useState)(!1),[m,h]=(0,D.useState)(!1),[g,_]=(0,D.useState)([]),v=(0,D.useCallback)(e=>_(t=>t.filter(t=>t!==e)),[]),[y,b]=(0,D.useState)(void 0),[x,S]=(0,D.useState)(!1),[C,w]=(0,D.useState)(!1),[T,E]=(0,D.useState)(null),[O,k]=(0,D.useState)(null),[A,j]=(0,D.useState)(null),[M,N]=(0,D.useState)(void 0),[ee,te]=(0,D.useState)(void 0),[P,F]=(0,D.useState)(void 0),[I,ne]=(0,D.useState)(null),re=(0,D.useRef)(null),ie=typeof window<`u`?window.location.origin:`http://localhost`,{sandboxUrl:ae,writable:oe,version:se}=fB({baseUrl:ie,authToken:W9()}),[ce,le]=(0,D.useState)({});(0,D.useEffect)(()=>{typeof window>`u`||sz({baseUrl:ie,authToken:W9()}).then(le).catch(e=>{le({}),Pv.show({id:kve,title:`Could not load Client Settings`,message:`${oz(e)}\n\nCheck ~/.mcp-inspector/storage/client.json or re-enter settings in Client Settings.`,color:`red`,autoClose:!1})})},[ie]);let ue=(0,D.useMemo)(()=>gse({getClient:()=>I?.getAppRendererClient()??null,readResource:async e=>{if(!I)throw Error(`No MCP client connected.`);return(await I.readResource(e)).result},onResourceError:e=>{Pv.show({title:`App resource failed to load`,message:e.message,color:`red`})}}),[I]),[de,fe]=(0,D.useState)(null),[pe,me]=(0,D.useState)(null),[he,ge]=(0,D.useState)(null),[_e,ve]=(0,D.useState)(null),[ye,be]=(0,D.useState)(null),[xe,Se]=(0,D.useState)(null),[Ce,we]=(0,D.useState)(null),[Te,Ee]=(0,D.useState)(null),[De,Oe]=(0,D.useState)(null),[ke,Ae]=(0,D.useState)(null),[je,Me]=(0,D.useState)(null),[Ne,Pe]=(0,D.useState)(null),[Fe,Ie]=(0,D.useState)(`info`),[Le,Re]=(0,D.useState)(null),[ze,Be]=(0,D.useState)(void 0),[Ve,He]=(0,D.useState)(void 0),[Ue,We]=(0,D.useState)(void 0),[Ge,Ke]=(0,D.useState)(M7),[qe,Je]=(0,D.useState)(N7),[Ye,Xe]=(0,D.useState)(P7),[Ze,Qe]=(0,D.useState)(F7),[$e,L]=(0,D.useState)(I7),[et,tt]=(0,D.useState)(L7),[nt,rt]=(0,D.useState)(R7),[it,at]=(0,D.useState)(()=>new Set),[ot,st]=(0,D.useState)(z7),[ct,lt]=(0,D.useState)(B7),[ut,dt]=(0,D.useState)(u7),[ft,pt]=(0,D.useState)(null),mt=(0,D.useRef)(ft),ht=(0,D.useRef)(null);(0,D.useEffect)(()=>{mt.current=ft},[ft]);let[gt,_t]=(0,D.useState)(null),[vt,yt]=(0,D.useState)(null),bt=(0,D.useRef)(vt);(0,D.useEffect)(()=>{bt.current=vt},[vt]);let xt=(0,D.useRef)(!1),St=(0,D.useRef)(!1);(0,D.useEffect)(()=>{let e=bt.current;e&&e.serverId!==M&&yt(null);let t=mt.current;t&&t.serverId!==M&&pt(null)},[M]);let Ct=(0,D.useCallback)(e=>mt.current===null?(pt(e),!0):(Pv.show({title:`Step-up authorization in progress`,message:`Complete or cancel the current step-up prompt before starting another.`,color:`yellow`,autoClose:5e3}),!1),[]),wt=(0,D.useRef)(void 0),[Tt,Et]=(0,D.useState)(void 0),Dt=(0,D.useRef)(!1),Ot=(0,D.useRef)(!1),kt=(0,D.useRef)(!1),At=(0,D.useRef)(new Set),jt=(0,D.useRef)(new Set),Mt=(0,D.useRef)(void 0),[Nt,Pt]=(0,D.useState)({}),{status:Ft,capabilities:It,clientCapabilities:Lt,serverInfo:Rt,instructions:zt,protocolVersion:Bt,protocolEra:Vt,discoverResult:Ht,excludedTools:Ut,lastError:Wt}=Dz(I),{tools:Gt,error:Kt,listChanged:qt,refresh:Jt,clearListChanged:Yt}=Qz(I,de),{prompts:Xt,error:Zt,listChanged:Qt,refresh:$t,clearListChanged:en}=$z(I,pe),{resources:tn,error:nn,listChanged:rn,refresh:an,clearListChanged:on}=eB(I,he),{resourceTemplates:sn,error:cn,refresh:ln}=aB(I,Ce),{tools:un,nextCursor:dn,pageCount:fn,loadPage:pn}=tB(I,_e),{prompts:mn,nextCursor:hn,pageCount:gn,loadPage:_n}=nB(I,ye),{resources:vn,nextCursor:yn,pageCount:bn,loadPage:xn}=rB(I,xe),Sn=r.find(e=>e.id===M)?.settings?.paginatedLists??!1,[Cn,wn]=(0,D.useState)(null);(0,D.useEffect)(()=>{wn(null)},[Sn,M]);let Tn=Cn??Sn,En=Ft===`connected`,Dn=iB({connected:En,paginated:Tn,managedItems:Gt,managedRefresh:Jt,pagedItems:un,pagedNextCursor:dn,pagedPageCount:fn,loadPage:pn}),On=iB({connected:En,paginated:Tn,managedItems:Xt,managedRefresh:$t,pagedItems:mn,pagedNextCursor:hn,pagedPageCount:gn,loadPage:_n}),kn=iB({connected:En,paginated:Tn,managedItems:tn,managedRefresh:an,pagedItems:vn,pagedNextCursor:yn,pagedPageCount:bn,loadPage:xn}),An=Dn.items,jn=On.items,Mn=kn.items,{tasks:Nn,refresh:Pn,clearCompleted:Fn}=oB(I,Te),{subscriptions:In,streamState:Ln}=sB(De),{messages:Rn}=cB(ke),{fetchRequests:zn}=lB(je),{stderrLogs:Bn}=uB(Ne),Vn=(0,D.useMemo)(()=>ume(Rn,zn),[Rn,zn]);(0,D.useEffect)(()=>{if(!je||M===void 0)return;let e=e=>{Pv.show({id:K9(M),title:`Network log: response body dropped`,color:`yellow`,autoClose:!1,message:(0,R.jsx)(Mve,{maxFetchRequests:e.detail.maxFetchRequests,onAdjust:()=>{Pv.hide(K9(M)),b(M)}})})};return je.addEventListener(`fetchRequestBodyDropped`,e),()=>{je.removeEventListener(`fetchRequestBodyDropped`,e)}},[je,M]);let{pendingSamples:Hn,pendingElicitations:Un}=pB(I);(0,D.useEffect)(()=>{Ft===`connected`&&wt.current!==void 0?(Et(Date.now()-wt.current),wt.current=void 0):Ft!==`connected`&&Et(void 0)},[Ft]),(0,D.useEffect)(()=>{F(Ft===`connected`?M:void 0)},[Ft,M]),(0,D.useEffect)(()=>()=>{I&&I.disconnect()},[I]);let Wn=(0,D.useCallback)(()=>{B9(),kt.current=!1},[]),Gn=(0,D.useCallback)(()=>{Wn(),dt(u7)},[Wn]),Kn=(0,D.useCallback)(()=>{Be(void 0),He(void 0),We(void 0),Ke(M7),Je(N7),Xe(P7),Qe(F7),L(I7),tt(L7),rt(R7),at(new Set),st(z7),lt(B7),Pt({}),Ie(`info`);let e=Qn.current.find(e=>e.id===Zn.current);Re(e?HP(e.settings)??null:null),pt(null),yt(null),_t(null),yae()},[]);(0,D.useEffect)(()=>{if(!I)return;let e=()=>{N(void 0),w(!1),Kn()};return I.addEventListener(`disconnect`,e),()=>{I.removeEventListener(`disconnect`,e)}},[I,Kn]),(0,D.useEffect)(()=>{if(!I)return;let e=At.current,t=t=>{let n=t.detail,r=Rve(n.progressToken),i=zve(n);if(e.has(r)){Pv.update({id:r,title:`Tool progress`,message:i,color:`blue`,autoClose:Y9});return}e.add(r),Pv.show({id:r,title:`Tool progress`,message:i,color:`blue`,autoClose:Y9,onClose:()=>e.delete(r)})};return I.addEventListener(`progressNotification`,t),()=>{I.removeEventListener(`progressNotification`,t),e.forEach(e=>Pv.hide(e)),e.clear()}},[I]),(0,D.useEffect)(()=>{if(!I)return;let e=e=>{let{taskId:t,progress:n}=e.detail;Pt(e=>({...e,[t]:{progress:n.progress,total:n.total,message:n.message}}))};return I.addEventListener(`requestorTaskProgress`,e),()=>{I.removeEventListener(`requestorTaskProgress`,e)}},[I]),(0,D.useEffect)(()=>{if(!I)return;let e=e=>{Mt.current=e.detail.taskId};return I.addEventListener(`toolCallTaskUpdated`,e),()=>{I.removeEventListener(`toolCallTaskUpdated`,e)}},[I]),(0,D.useEffect)(()=>{if(!I)return;let e=jt.current,t=(t,n)=>{let r=X9(t),i=Vve(n.status),a=`Task ${n.status}`,o=Hve(n),s=Z9(n.status);if(i&&Pt(e=>{if(!(t in e))return e;let n={...e};return delete n[t],n}),e.has(r)){Pv.update({id:r,title:a,message:o,color:s}),i&&(Pv.hide(r),e.delete(r));return}i||(e.add(r),Pv.show({id:r,title:a,message:o,color:s,autoClose:!1,onClose:()=>e.delete(r)}))},n=e=>{t(e.detail.taskId,e.detail.task)},r=e=>{t(e.detail.taskId,e.detail.task)},i=t=>{let{taskId:n}=t.detail;Pt(e=>{if(!(n in e))return e;let t={...e};return delete t[n],t});let r=X9(n),i={id:r,title:`Task cancelled`,message:`The task was cancelled.`,color:Z9(`cancelled`),autoClose:Lve};e.has(r)?(Pv.update(i),e.delete(r)):Pv.show(i)};return I.addEventListener(`taskStatusChange`,n),I.addEventListener(`requestorTaskUpdated`,r),I.addEventListener(`taskCancelled`,i),()=>{I.removeEventListener(`taskStatusChange`,n),I.removeEventListener(`requestorTaskUpdated`,r),I.removeEventListener(`taskCancelled`,i),e.forEach(e=>Pv.hide(e)),e.clear()}},[I]);let qn=(0,D.useMemo)(()=>r.find(e=>e.id===M),[r,M]),Jn=Rt!==void 0,Yn=(0,D.useMemo)(()=>{if(Ft!==`connected`)return;let e=Rt??{name:qn?.name??``,version:``};return{protocolVersion:Bt??``,capabilities:It??{},serverInfo:e,...zt?{instructions:zt}:{}}},[Ft,It,Rt,zt,Bt,qn]),Xn=(0,D.useRef)(void 0),Zn=(0,D.useRef)(M),Qn=(0,D.useRef)(r);(0,D.useEffect)(()=>{qn&&(Xn.current=qn.name),Zn.current=M,Qn.current=r},[qn,M,r]);let[$n,er]=(0,D.useState)(void 0),tr=(0,D.useCallback)(e=>{er(e)},[]),[nr,rr]=(0,D.useMemo)(()=>{if(typeof window>`u`)return[void 0,`none`];let e=window.location.search,t=fve(e,W9());return[t,dve(e,t)]},[]),ir=(0,D.useRef)(!1),ar=(0,D.useRef)(!1),or=(0,D.useRef)(!1),sr=(0,D.useCallback)((e,t,n)=>{let r=oR({serverName:Qn.current.find(t=>t.id===e)?.name,detail:t===void 0?void 0:$F(t)}),i=n?.reason;if(i!==void 0&&!ZL(i)){Pv.show({title:`Authorization required`,message:r,color:`yellow`,autoClose:!1});return}_t({serverId:e,message:r})},[]);(0,D.useEffect)(()=>{if(!Wt)return;let e=Xn.current;Pv.show({title:e?`Connection to "${e}" lost`:`Connection lost`,message:Wt,color:`red`})},[Wt]);let cr=qn?.config.type??`stdio`,[lr,ur]=(0,D.useState)(void 0),dr=Ft===`connected`&&I?lr:void 0;(0,D.useEffect)(()=>{if(Ft!==`connected`||!I)return;let e=!1,t=()=>{I.getOAuthState().then(t=>{e||ur(t?Bge(t):void 0)})},n=()=>{let e=Xn.current;Pv.show({title:e?`Refreshing authorization for "${e}"`:`Refreshing authorization`,message:`Refreshing authorization…`,color:`blue`,autoClose:4e3})};return t(),I.addEventListener(`oauthComplete`,t),I.addEventListener(`authChallengeAmbient`,n),()=>{e=!0,I.removeEventListener(`oauthComplete`,t),I.removeEventListener(`authChallengeAmbient`,n)}},[Ft,I]);let fr=Ft===`connected`&&!!I&&(cr===`streamable-http`||cr===`sse`),pr=(0,D.useMemo)(()=>Dve(Rn),[Rn]),mr=(0,D.useMemo)(()=>Xz(W9()),[]),hr=(0,D.useMemo)(()=>new Tz({baseUrl:typeof window<`u`?window.location.origin:`http://localhost`,authToken:W9()}),[]),gr=(0,D.useRef)(null),_r=(0,D.useCallback)(e=>{let t=e.searchParams.get(`state`),n=t?rI(t)?.authId??void 0:void 0;if(!n)return;let r=gr.current?.getFetchRequests()??[];if(r.length===0)return;let i=Date.now();hr.saveSession(n,{fetchRequests:r,createdAt:i,updatedAt:i}).catch(()=>{})},[hr]),vr=(0,D.useCallback)(({serverId:e,authKind:t,authorizationUrl:n,authChallenge:r,recoverySource:i,preRedirectContext:a,client:o})=>{_t(null);let s=Qn.current.find(t=>t.id===e),c=XL(t,{serverName:s?.name,enterpriseManaged:s?.settings?.enterpriseManaged,context:a});c&&Pv.show({title:c.title,message:c.message,color:`blue`,autoClose:4e3});let l=o??I,u=l?.getRemoteBackendSessionId();_r(n),gve({version:1,serverId:e,activeTab:ut,authKind:t,tabUi:mve({toolsUi:Ge,promptsUi:qe,resourcesUi:Ye,appsUi:Ze,tasksUi:$e,logsUi:et,protocolUi:nt,networkUi:ot}),...u&&{remoteSessionId:u},...t===`step_up`&&r&&{authChallenge:r},...i&&{recoverySource:i}}),l?.beginInteractiveAuthorization(n)},[I,ut,Ge,qe,Ye,Ze,$e,et,nt,ot,_r]),yr=(0,D.useCallback)(async(e,t,n)=>await e.checkAuthChallengeSatisfied(t)?(await e.pushRemoteAuthState(),Pv.show({title:`Authorization restored`,message:LL({recoverySource:n}),color:`green`,autoClose:4e3}),!0):!1,[]),br=(0,D.useCallback)(({serverId:e,challenge:t,authorizationUrl:n,source:r=`ambient`})=>{let i=Qn.current.find(t=>t.id===e);if($9(t,i)){Ct({challenge:t,authorizationUrl:n,serverId:e,source:r,enterpriseManaged:Q9(t,i)});return}vr({serverId:e,authKind:`reauth`,authorizationUrl:n,recoverySource:r})},[vr,Ct]),xr=(0,D.useCallback)(e=>{bt.current?Pv.show({title:`Authorization update pending`,message:`A new authorization request replaced the previous deferred recovery.`,color:`yellow`,autoClose:5e3}):Pv.show({title:`Authorization pending`,message:`Return to this tab to continue authorization.`,color:`blue`,autoClose:5e3}),yt(e)},[]),Sr=(0,D.useCallback)(async(e,t)=>{if(!I)return!1;let n=Qn.current.find(e=>e.id===t.serverId);return e.emaStepUpConfirm||$9(e.authChallenge,n)?await yr(I,e.authChallenge,t.source)?!0:(ht.current=t.retryOperation??null,Ct({challenge:e.authChallenge,authorizationUrl:e.authorizationUrl,serverId:t.serverId,source:t.source,enterpriseManaged:Q9(e.authChallenge,n)}),!1):await yr(I,e.authChallenge,t.source)?!0:(vr({serverId:t.serverId,authKind:`reauth`,authorizationUrl:e.authorizationUrl,recoverySource:t.source}),!1)},[I,vr,yr,Ct]),Cr=(0,D.useCallback)(async(e,t)=>{if(!I||!M)return e();try{return await e()}catch(n){if(n instanceof lI)return await Sr(n,{serverId:M,source:t,retryOperation:e})?e():void 0;throw n}},[I,M,Sr]),wr=(0,D.useCallback)(async e=>{if(xt.current)return;let t=I;if(t&&Ft===`connected`&&e.serverId===Zn.current){xt.current=!0,yt(null);try{if(await yr(t,e.challenge,e.source))return;if(e.authKind===`step_up`){br({serverId:e.serverId,challenge:e.challenge,authorizationUrl:e.authorizationUrl,source:e.source});return}let n=await t.handleAuthChallenge(e.challenge);if(n.kind===`satisfied`){await t.pushRemoteAuthState(),Pv.show({title:`Authorization restored`,message:LL({recoverySource:e.source}),color:`green`,autoClose:4e3});return}if(n.kind===`interactive`){br({serverId:e.serverId,challenge:n.challenge,authorizationUrl:n.authorizationUrl,source:e.source});return}n.kind===`failed`&&sr(e.serverId,n.error,{reason:e.challenge.reason})}finally{xt.current=!1}}},[I,Ft,yr,br,sr]);(0,D.useEffect)(()=>{if(Ft!==`connected`||!I)return;let e=e=>{(async()=>{let{challenge:t,authorizationUrl:n}=e.detail,r=Zn.current;if(!r)return;let i=$9(t,Qn.current.find(e=>e.id===r))?`step_up`:`reauth`;if(!U9()){xr({serverId:r,challenge:t,authorizationUrl:n,authKind:i,source:`ambient`});return}await yr(I,t)||br({serverId:r,challenge:t,authorizationUrl:n,source:`ambient`})})()};return I.addEventListener(`authChallengeInteractive`,e),()=>{I.removeEventListener(`authChallengeInteractive`,e)}},[Ft,I,yr,br,xr]),(0,D.useEffect)(()=>Tve(()=>{let e=bt.current;e&&wr(e)}),[wr]),(0,D.useEffect)(()=>{if(Ft!==`connected`||!I||!U9())return;let e=bt.current;e&&wr(e)},[Ft,I,wr]),(0,D.useEffect)(()=>{if(Ft!==`connected`||!I)return;let e=e=>{let t=Zn.current;t&&sr(t,e.detail.error)};return I.addEventListener(`oauthError`,e),()=>{I.removeEventListener(`oauthError`,e)}},[Ft,I,sr]),(0,D.useEffect)(()=>{if(Ot.current||typeof window>`u`||window.location.pathname===`/oauth/callback`||r.length===0)return;Ot.current=!0;let e=z9();e&&queueMicrotask(()=>{if(e.authKind===`reauth`){sr(e.serverId,RL(e.authKind));return}e.authKind===`step_up`&&sr(e.serverId,RL(e.authKind,{recoverySource:e.recoverySource}))})},[r,sr]);let Tr=(0,D.useCallback)((e,t)=>{de?.destroy(),pe?.destroy(),he?.destroy(),_e?.destroy(),ye?.destroy(),xe?.destroy(),Ce?.destroy(),Te?.destroy(),De?.destroy(),ke?.destroy(),je?.destroy(),Ne?.destroy();let{environment:n,logger:r}=wve(W9(),Eve,_r),i=e.settings,a=WR(ce),o=KR(ce),s=i?.metadata?Object.fromEntries(i.metadata.filter(e=>e.key.trim()!==``).map(e=>[e.key,e.value])):void 0,c=i&&(i.oauthClientId||i.oauthClientSecret||i.oauthScopes||i.enterpriseManaged)?{...i.oauthClientId&&{clientId:i.oauthClientId},...i.oauthClientSecret&&{clientSecret:i.oauthClientSecret},...i.oauthScopes&&{scope:i.oauthScopes},...i.enterpriseManaged&&{enterpriseManaged:!0}}:void 0,l=c||o?{...c??{},...o&&{clientMetadataUrl:o}}:void 0,u=new ER(e.config,{environment:n,receiverTasks:!0,elicit:{form:!0,url:!0},roots:KP(i?.roots??[]),...i&&i.requestTimeout>0&&{timeout:i.requestTimeout},...s&&Object.keys(s).length>0&&{defaultMetadata:s},...l&&{oauth:l},...a&&{enterpriseManagedAuth:{idp:a}},...ce.enterpriseManagedAuth&&{installEnterpriseManagedAuth:ce.enterpriseManagedAuth},...i&&{serverSettings:i},...i?.protocolEra&&{versionNegotiation:Xne(i.protocolEra)},...i?.advertisedExtensions&&Object.keys(i.advertisedExtensions).length>0&&{advertisedExtensions:i.advertisedExtensions},...t&&{sessionId:t}});ne(u),Re(HP(i)??null),fe(new jR(u)),ve(new PR(u)),be(new FR(u)),Se(new IR(u)),me(new MR(u));let d=new NR(u);ge(d),we(new LR(u)),Ee(new VR(u)),Oe(new HR(u,d)),Ae(new lz(u));let f=new uz(u,{sessionStorage:hr,logger:r,maxFetchRequests:i?.maxFetchRequests??1e3,...t&&{sessionId:t}});return gr.current=f,Me(f),Pe(new dz(u)),u},[de,pe,he,_e,ye,xe,Ce,Te,De,ke,je,Ne,hr,_r,ce]);(0,D.useEffect)(()=>{if(typeof window>`u`||window.location.pathname!==`/oauth/callback`||Dt.current||r.length===0)return;Dt.current=!0;let e=tI(window.location.search),t=new URLSearchParams(window.location.search).get(`state`),n=t?rI(t):null,i=t!==null&&n===null,a=n?.authId??void 0,o=z9();if(window.history.replaceState({},``,`/`),i){Pv.show({title:`OAuth callback rejected`,message:`OAuth callback carried an unrecognized state parameter that did not originate from this session. Please try connecting again.`,color:`red`});return}if(o&&e.successful&&(e=>{kt.current||=(Sve(e,{setToolsUi:Ke,setPromptsUi:Je,setResourcesUi:Xe,setAppsUi:Qe,setTasksUi:L,setLogsUi:tt,setProtocolUi:rt,setNetworkUi:st,setActiveTab:dt,clearToolCallState:()=>Be(void 0),clearGetPromptState:()=>He(void 0),clearReadResourceState:()=>We(void 0)}),!0)})(o),!e.successful){let t=o?.serverId;t?queueMicrotask(()=>{sr(t,iI(e))}):Pv.show({title:`OAuth authorization failed`,message:iI(e),color:`red`});return}let s=o?.serverId,c=s?r.find(e=>e.id===s):void 0;if(!c){Pv.show({title:`OAuth callback could not be matched`,message:`Could not determine which server started the OAuth flow. Please try connecting again.`,color:`red`});return}(async()=>{try{await mr.load()}catch(e){wt.current=void 0,queueMicrotask(()=>{sr(c.id,e instanceof Error?e:String(e))});return}let t=Tr(c,a);N(c.id);try{wt.current=Date.now(),await t.resumeAfterOAuth(e.code,{remoteSessionId:o?.remoteSessionId,iss:e.iss})}catch(e){if(wt.current=void 0,VI(e)){Pv.show({title:`Cannot connect to "${c.name}"`,message:e.message,color:`red`,autoClose:!1});return}let t=hz(e);if(t){let e=aR(t,{serverName:c.name});t.kind===`lost_authorization_state`?_t({serverId:c.id,message:e.message,kind:`lost_authorization_state`,title:e.title,actionLabel:eR()}):Pv.show({title:e.title,message:e.message,color:`red`,autoClose:!1});return}queueMicrotask(()=>{sr(c.id,e instanceof Error?e:String(e))});return}if(_t(null),o){let e=o.authKind===`step_up`?o.authChallenge:void 0,n=!e||await t.checkAuthChallengeSatisfied(e);if(e&&!n){Pv.show({title:`Additional permissions not granted`,message:V9(e),color:`yellow`,autoClose:!1});return}Pv.show({title:`Authorization complete`,message:yve(o.authKind,{recoverySource:o.recoverySource}),color:`green`,autoClose:6e3})}})()},[r,Tr,sr,mr]);let Er=(0,D.useCallback)(async e=>{if(e===M&&Ft===`connected`&&I){try{await I.disconnect()}finally{Gn()}return}let t=Qn.current.find(t=>t.id===e);if(!t)return;let n=Tr(t);e!==M&&N(e),te(void 0),er(void 0),wt.current=Date.now();try{await n.connect()}catch(r){if(wt.current=void 0,VI(r)){Pv.show({title:`Cannot connect to "${t.name}"`,message:r.message,color:`red`,autoClose:!1});return}if(r instanceof lI){if(await n.checkAuthChallengeSatisfied(r.authChallenge)){wt.current=Date.now(),await n.connect();return}vr({serverId:e,authKind:`reauth`,authorizationUrl:r.authorizationUrl,preRedirectContext:`connect`,client:n});return}if(aI(r))try{let t=await n.authenticate();t===void 0?(wt.current=Date.now(),await n.connect()):vr({serverId:e,authKind:`reauth`,authorizationUrl:t,preRedirectContext:`connect`,client:n});return}catch(e){if(B9(),await n.disconnect().catch(()=>{}),VI(e)){Pv.show({title:`Cannot connect to "${t.name}"`,message:e.message,color:`red`,autoClose:!1});return}let r=e instanceof Error?e.message:String(e);er(r),Pv.show({title:`OAuth authorization failed for "${t.name}"`,message:r,color:`red`});return}te(e);let i=r instanceof Error?r.message:String(r);er(i),Pv.show({title:`Failed to connect to "${t.name}"`,message:i,color:`red`})}},[M,Ft,I,Tr,vr,Gn]),Dr=(0,D.useCallback)(async()=>{if(I)try{await I.disconnect()}finally{Gn()}},[I,Gn]);(0,D.useEffect)(()=>{if(!nr||window.location.pathname===`/oauth/callback`)return;let e=r.find(e=>e.id===nr.serverId);if(!e){if(ir.current)return;ir.current=!0,i(nr.serverId,nr.serverConfig).catch(e=>{let t=e instanceof Error?e.message:String(e);t.includes(`already exists`)||tr(t)});return}if(!uve(e.config,nr.serverConfig)){if(ar.current)return;ar.current=!0,a(nr.serverId,nr.serverId,nr.serverConfig).catch(e=>{let t=e instanceof Error?e.message:String(e);tr(t)});return}or.current||(or.current=!0,(M!==nr.serverId||Ft!==`connected`)&&Er(nr.serverId).catch(e=>{let t=e instanceof Error?e.message:String(e);tr(t)}))},[nr,r,M,Ft,i,a,Er,tr]);let Or=(0,D.useCallback)(()=>{if(!gt)return;let e=gt.serverId,t=gt.kind;if(_t(null),t===`lost_authorization_state`){(async()=>{let t=Qn.current.find(t=>t.id===e);if(t)try{await H9({config:t.config,inspectorClient:e===M?I:null,isActiveConnection:e===M,oauthStorage:mr})}catch(e){Pv.show({title:`Could not clear the stored authorization state`,message:e instanceof Error?e.message:String(e),color:`red`,autoClose:!1});return}await Er(e)})();return}if(e===M&&Ft===`connected`&&I){(async()=>{let t=r.find(t=>t.id===e);try{let t=await I.authenticate();if(t===void 0){await I.pushRemoteAuthState(),Pv.show({title:`Authorization restored`,message:LL(),color:`green`,autoClose:4e3});return}vr({serverId:e,authKind:`reauth`,authorizationUrl:t})}catch(e){let n=e instanceof Error?e.message:String(e);Pv.show({title:t?`OAuth authorization failed for "${t.name}"`:`OAuth authorization failed`,message:n,color:`red`})}})();return}Er(e)},[gt,M,Ft,I,r,vr,Er,mr]),kr=(0,D.useCallback)(async(e,t,n)=>{if(!I)return;let r=An.find(t=>t.name===e);if(!r)return;let i=(!!It?.tasks?.requests?.tools?.call||I.isTasksExtensionNegotiated())&&(n||r.execution?.taskSupport===`required`);Mt.current=void 0,Be({status:`pending`});try{let e=i?await I.callToolStream(r,t,void 0,void 0,{ttl:qn?.settings?.taskTtl||6e4}):await I.callTool(r,t);Be({status:e.success?`ok`:`error`,result:e.result??void 0,error:e.error})}catch(t){if(t instanceof lI){Be(void 0),M&&await Sr(t,{serverId:M,source:`tool`});return}if(t instanceof XF){Be(void 0),Pv.show({title:`Tool call cancelled`,message:`A cancellation request was sent to the server.`,color:`gray`,autoClose:3e3});return}if(t instanceof JF){Be({status:`error`,error:t.message}),Pv.show({autoClose:!1,title:`URL elicitation loop`,color:`yellow`,message:(0,R.jsxs)(U,{size:`sm`,children:[`The server requested the same URL again after you completed it (`,t.url,`), so the call was cancelled to avoid an endless loop.`]})});return}let n=YF(t);if(n!==null&&n.length===0){let n={toolName:e,details:Ive(t)};Be({status:`error`,error:J9(t)}),Pv.show({autoClose:!1,title:`URL elicitation required`,color:`yellow`,message:(0,R.jsx)(Pve,{onViewDetails:()=>j(n)})});return}Be({status:`error`,error:J9(t),errorCode:Fve(t)})}},[I,An,qn,It,M,Sr]),Ar=(0,D.useCallback)(()=>{Be(void 0)},[]),jr=(0,D.useCallback)(e=>{e.selectedToolName!==Ge.selectedToolName&&Be(void 0),Ke(e)},[Ge.selectedToolName]),Mr=(0,D.useCallback)(e=>{Pv.show({title:`MCP App error`,message:e.message,color:`red`})},[]),Nr=(0,D.useCallback)(()=>{},[]),Pr=(0,D.useCallback)(async(e,t)=>{if(!I)return;let n=An.find(t=>t.name===e);if(n){await Promise.resolve(),re.current?.sendToolInput(t);try{let e=await I.callTool(n,t,void 0,void 0,void 0,{skipOutputValidation:!0});if(e.success&&e.result&&re.current?.sendToolResult(e.result),e.outputValidationError){let t={toolName:n.name,message:e.outputValidationError};Pv.show({autoClose:!1,title:`App output doesn't match its schema`,color:`yellow`,message:(0,R.jsx)(Nve,{onViewDetails:()=>k(t)})})}}catch(e){if(e instanceof lI){M&&(await Sr(e,{serverId:M,source:`app`})||Mr(Error(`Authorization required. Complete sign-in, then reopen the app.`)));return}Mr(e instanceof Error?e:Error(String(e)))}}},[I,An,Mr,M,Sr]),Fr=(0,D.useCallback)(()=>{re.current?.teardown()},[]),Ir=(0,D.useCallback)(async(e,t)=>{if(I){He({status:`pending`,promptName:e});try{let n=await I.getPrompt(e,t);He({status:`ok`,promptName:e,result:n.result})}catch(t){if(t instanceof lI){He(void 0),M&&await Sr(t,{serverId:M,source:`prompt`});return}He({status:`error`,promptName:e,error:t instanceof Error?t.message:String(t)})}}},[I,M,Sr]),Lr=(0,D.useCallback)(async e=>{if(I){We({status:`pending`,uri:e});try{let t=await I.readResource(e);We({status:`ok`,uri:e,result:t.result,lastUpdated:t.timestamp})}catch(t){if(t instanceof lI){We(void 0),M&&await Sr(t,{serverId:M,source:`resource`});return}We({status:`error`,uri:e,error:t instanceof Error?t.message:String(t)})}}},[I,M,Sr]),Rr=(0,D.useCallback)(async e=>{if(!I)throw Error(`Client is not connected`);let t=()=>I.readResource(e);try{return(await t()).result}catch(e){if(e instanceof lI&&M&&await Sr(e,{serverId:M,source:`resource`}))return(await t()).result;throw e}},[I,M,Sr]),zr=(0,D.useCallback)(e=>{I&&I.subscribeToResource(e)},[I]),Br=(0,D.useCallback)(e=>{I&&I.unsubscribeFromResource(e)},[I]),Vr=(0,D.useCallback)(async(e,t,n,r)=>I?(await Cr(()=>I.getCompletions(e,t,n,r),`tool`))?.values??[]:[],[I,Cr]),Hr=(0,D.useCallback)(async e=>{if(I)try{await Cr(()=>I.cancelRequestorTask(e),`tool`)}catch(e){if(e instanceof lI)return;Pv.show({title:`Failed to cancel task`,message:e instanceof Error?e.message:String(e),color:`red`})}},[I,Cr]),Ur=(0,D.useCallback)(()=>{if(!I)return;let e=Mt.current;if(e){Mt.current=void 0,Hr(e);return}I.cancelToolCall()},[I,Hr]),Wr=(0,D.useCallback)(()=>{Fn()},[Fn]),Gr=(0,D.useCallback)(e=>{Ie(e),I&&Cr(()=>I.setLoggingLevel(e),`ambient`)},[I,Cr]),Kr=(0,D.useCallback)(e=>{Re(e),I?.setModernLogLevel(e??void 0)},[I]),qr=(0,D.useCallback)(()=>{Tn?(Yt(),Cr(()=>Dn.onRefresh(),`ambient`)):Cr(()=>Jt(),`ambient`)},[Tn,Dn,Jt,Yt,Cr]),Jr=(0,D.useCallback)(()=>{Tn?(en(),Cr(()=>On.onRefresh(),`ambient`)):Cr(()=>$t(),`ambient`)},[Tn,On,$t,en,Cr]),Yr=(0,D.useCallback)(()=>{Tn?(on(),Cr(()=>kn.onRefresh(),`ambient`),Cr(()=>ln(),`ambient`)):Cr(async()=>{await an(),await ln()},`ambient`)},[Tn,kn,an,ln,on,Cr]),Xr=(0,D.useCallback)(e=>{wn(e);let t=r.find(e=>e.id===M);if(!t||M===void 0)return;let n=t.settings??G9,i={...n,paginatedLists:e};I?.setServerSettings(i),En&&(e?(Cr(()=>pn(void 0),`ambient`),Cr(()=>_n(void 0),`ambient`),Cr(()=>xn(void 0),`ambient`)):(Cr(()=>Jt(),`ambient`),Cr(()=>$t(),`ambient`),Cr(()=>an(),`ambient`))),o(M,i).catch(e=>{wn(null),I?.setServerSettings(n),Pv.show({title:`Failed to save pagination setting`,message:e instanceof Error?e.message:String(e),color:`red`})})},[r,M,I,o,En,pn,_n,xn,Jt,$t,an,Cr]),Zr=(0,D.useCallback)(()=>void Cr(()=>Dn.onLoadMore(),`ambient`),[Dn,Cr]),Qr=(0,D.useCallback)(()=>void Cr(()=>On.onLoadMore(),`ambient`),[On,Cr]),$r=(0,D.useCallback)(()=>void Cr(()=>kn.onLoadMore(),`ambient`),[kn,Cr]),ei={paginated:Dn.paginated,onPaginatedChange:Xr,canLoadMore:Dn.canLoadMore,loadedPages:Dn.loadedPages,onLoadMore:Zr},ti={paginated:On.paginated,onPaginatedChange:Xr,canLoadMore:On.canLoadMore,loadedPages:On.loadedPages,onLoadMore:Qr},ni={paginated:kn.paginated,onPaginatedChange:Xr,canLoadMore:kn.canLoadMore,loadedPages:kn.loadedPages,onLoadMore:$r},ri=(0,D.useCallback)(()=>{Cr(()=>Pn(),`ambient`)?.catch(e=>{Pv.show({title:`Failed to refresh tasks`,message:e instanceof Error?e.message:String(e),color:`red`})})},[Pn,Cr]),ii=(0,D.useCallback)(()=>{ke&&ke.clearMessages(e=>e.direction===`notification`&&`method`in e.message&&e.message.method===`notifications/message`)},[ke]),ai=(0,D.useCallback)(()=>{ke?.clearMessages(e=>!it.has(e.id))},[ke,it]),oi=(0,D.useCallback)(()=>{je?.clearFetchRequests()},[je]),si=(0,D.useCallback)(()=>{zn.length!==0&&g8(v8(`network`,M),JSON.stringify(zn,null,2))},[zn,M]),ci=(0,D.useCallback)(()=>{Rn.length!==0&&g8(v8(`protocol`,M),JSON.stringify(Rn,null,2))},[Rn,M]),z=(0,D.useCallback)(e=>{let t=e===`pinned`;ke?.clearMessages(e=>t?it.has(e.id):!it.has(e.id)),t&&at(new Set)},[ke,it]),di=(0,D.useCallback)(e=>{let t=e===`pinned`,n=Rn.filter(e=>t?it.has(e.id):!it.has(e.id));n.length!==0&&g8(v8(t?`protocol-pinned`:`protocol-unpinned`,M),JSON.stringify(n,null,2))},[Rn,it,M]),fi=(0,D.useCallback)(e=>{at(t=>{let n=new Set(t);return n.has(e)?n.delete(e):n.add(e),n})},[]),pi=(0,D.useCallback)(e=>{if(!I)return;let t=Rn.find(t=>t.id===e);if(!t||!(`method`in t.message))return;let{method:n}=t.message,r=`params`in t.message?t.message.params:void 0;Ove(I,n,r,An).then(e=>{e&&Pv.show({title:`Can't replay`,message:e,color:`yellow`})}).catch(e=>{Pv.show({title:`Replay failed`,message:e instanceof Error?e.message:String(e),color:`red`})})},[I,Rn,An]),mi=(0,D.useCallback)(()=>{pr.length!==0&&g8(v8(`logs`,M),JSON.stringify(pr,null,2))},[pr,M]),hi=(0,D.useCallback)(()=>{Ne?.clearStderrLogs()},[Ne]),gi=(0,D.useCallback)(()=>{Bn.length!==0&&g8(v8(`console`,M),JSON.stringify(Bn,null,2))},[Bn,M]),_i=(0,D.useCallback)(()=>{r.length!==0&&g8(`mcp.json`,lre(r))},[r]),vi=(0,D.useCallback)(async()=>{if(!T)return;let e=T.id;e===M&&(I&&await I.disconnect(),de?.destroy(),pe?.destroy(),he?.destroy(),_e?.destroy(),ye?.destroy(),xe?.destroy(),Ce?.destroy(),Te?.destroy(),De?.destroy(),ke?.destroy(),je?.destroy(),Ne?.destroy(),ne(null),fe(null),me(null),ge(null),ve(null),be(null),Se(null),we(null),Ee(null),Oe(null),Ae(null),Me(null),Pe(null),N(void 0)),await s(e),E(null)},[T,M,I,de,pe,he,_e,ye,xe,Ce,Te,De,ke,je,Ne,s]),yi=(0,D.useCallback)(async(e,t)=>{await i(e,t),_(t=>t.includes(e)?t:[...t,e])},[i]),bi=(0,D.useCallback)(async(e,t)=>{if(u?.mode===`edit`&&u.targetId){let n=u.targetId;await a(n,e,t),n===M&&e!==n&&N(e);return}await yi(e,t)},[u,yi,a,M]),xi=(0,D.useMemo)(()=>{let e=r.map(e=>e.id);return u?.mode===`edit`&&u.targetId?e.filter(e=>e!==u.targetId):e},[r,u]),Si=(0,D.useMemo)(()=>{if(u?.targetId)return r.find(e=>e.id===u.targetId)},[u,r]),Ci=(0,D.useMemo)(()=>{if(y)return r.find(e=>e.id===y)},[y,r]),wi=Ci?RP(Ci.config):`stdio`,{draft:Ti,onChange:Ei,flush:Di}=Mz({targetId:y,resolveInitial:e=>r.find(t=>t.id===e)?.settings??G9,onPersist:o,onError:(e,t)=>{Pv.show({title:`Failed to save settings for "${e}"`,message:t instanceof Error?t.message:String(t),color:`red`})}}),Oi=Ti??G9,{draft:ki,onChange:Ai,flush:ji}=Nz({opened:x,resolveInitial:()=>_he(ce),onPersist:async e=>{if(!bhe(e))return;let t=yhe(e);await cz(t,{baseUrl:ie,authToken:W9()}),le(t)},onError:e=>{Pv.show({title:`Failed to save client settings`,message:oz(e),color:`red`})}}),Mi=ki??ghe,{loginState:Ni,logout:Pi}=Pz(mr,Mi.emaEnabled?Mi.issuer:void 0,x),Fi=(0,D.useCallback)(()=>{ji(),S(!1)},[ji]),Ii=wi===`stdio`,Li=(0,D.useCallback)(async e=>{let t=e.id===M;if(await H9({config:e.config,inspectorClient:t?I:null,isActiveConnection:t,oauthStorage:mr})){if(t&&I)try{await I.disconnect()}finally{ur(void 0),Gn()}else Wn();Pv.show({title:`OAuth state cleared`,message:t?`Stored tokens and client registration were removed. Reconnect to run a fresh authorization flow.`:`Stored OAuth state was removed for "${e.name}". Connect to authorize again.`,color:`blue`})}},[M,I,mr,Gn,Wn]),Ri=(0,D.useCallback)(()=>{qn&&Li(qn)},[qn,Li]),zi=(0,D.useCallback)(()=>{Ci&&Li(Ci)},[Ci,Li]),Bi=(0,D.useCallback)(()=>{if(Di(),I&&y!==void 0&&y===M&&Ti){I.setServerSettings(Ti),gr.current?.setMaxFetchRequests(Ti.maxFetchRequests);let e=KP(Ti.roots),t=KP(I.getRoots());JSON.stringify(e)!==JSON.stringify(t)&&I.setRoots(e).catch(()=>{})}b(void 0)},[Di,I,y,M,Ti]),Vi=(0,D.useMemo)(()=>{if(!Ue)return;if(!Ue.uri)return Ue;let e=In.some(e=>e.resource.uri===Ue.uri);return{...Ue,isSubscribed:e}},[Ue,In]),Hi=Hn.length+Un.length,Ui=(0,D.useMemo)(()=>{let e=Hn[0];if(e)return{kind:`sampling`,id:e.id,request:e.request.params,origin:e.origin};let t=Un[0];if(t){let e=t.request.params;return`url`in e?{kind:`elicitation-url`,id:t.id,message:e.message,url:e.url,origin:t.origin}:{kind:`elicitation-form`,id:t.id,request:e,origin:t.origin}}return null},[Hn,Un]),Wi=Hi>1?`${Hi} pending`:``,Gi=(0,D.useCallback)(e=>{Hn[0]?.respond(e)},[Hn]),Ki=(0,D.useCallback)(()=>{Hn[0]?.reject(Error(`Sampling request rejected by user.`))},[Hn]),qi=(0,D.useCallback)(e=>{let t=Un[0];if(t){if(e.action===`cancel`&&t.origin===`task-input-required`&&t.taskId&&I){I.cancelRequestorTask(t.taskId);return}t.respond(e)}},[Un,I]);return(0,R.jsxs)(R.Fragment,{children:[(0,R.jsxs)(B,{children:[gt?(0,R.jsx)(jve,{children:(0,R.jsx)(b_e,{message:gt.message,title:gt.title,actionLabel:gt.actionLabel,onReauthenticate:Or,onDismiss:()=>_t(null)})}):null,(0,R.jsx)(Mme,{deepLink:nr,deepLinkStatus:rr,servers:r,serverListWritable:oe,activeServer:M,erroredServerId:ee,connectedServerId:P,version:se,connectionStatus:Ft,connectErrorMessage:$n,initializeResult:Yn,latencyMs:Tt,tools:An,excludedTools:Ut,prompts:jn,resources:Mn,resourceTemplates:sn,toolsListChanged:qt,promptsListChanged:Qt,resourcesListChanged:rn,toolsLoadError:Kt,promptsLoadError:Zt,resourcesLoadError:nn??cn,subscriptions:In,subscriptionStreamState:Ln,logs:pr,tasks:Nn,progressByTaskId:Nt,protocol:Vn,protocolEra:Vt,network:zn,stderrLogs:Bn,toolCallState:ze,getPromptState:Ve,readResourceState:Vi,toolsUi:Ge,promptsUi:qe,resourcesUi:Ye,appsUi:Ze,tasksUi:$e,logsUi:et,protocolUi:nt,networkUi:ot,consoleUi:ct,activeTab:ut,onActiveTabChange:dt,currentLogLevel:Fe,sandboxPath:ae,bridgeFactory:ue,appRendererRef:re,onToggleTheme:n,onOpenClientSettings:()=>S(!0),onToggleConnection:e=>{Er(e)},onDisconnect:()=>{Dr()},onServerAdd:()=>{_([]),d({mode:`add`})},onServerImportConfig:()=>{_([]),p(!0)},onServerImportJson:()=>{_([]),h(!0)},onServerExport:_i,onConnectionInfo:()=>w(!0),onServerSettings:e=>b(e),onServerEdit:e=>d({mode:`edit`,targetId:e}),onServerClone:e=>{_([]),d({mode:`clone`,targetId:e})},onServerRemove:e=>{let t=r.find(t=>t.id===e);t&&E(t)},onServerReorder:e=>{c(e).catch(e=>{Pv.show({title:`Failed to reorder servers`,message:e instanceof Error?e.message:String(e),color:`red`})})},highlightedServerIds:g,onClearHighlight:v,serverSupportsTaskToolCalls:!!It?.tasks?.requests?.tools?.call||(I?.isTasksExtensionNegotiated()??!1),onToolsUiChange:jr,onCallTool:(e,t,n)=>{kr(e,t,n)},onCancelToolCall:Ur,onClearToolResult:Ar,onReadResourceContents:Rr,onRefreshTools:qr,toolsPagination:ei,promptsPagination:ti,resourcesPagination:ni,onPromptsUiChange:Je,onGetPrompt:(e,t)=>{Ir(e,t)},onRefreshPrompts:Jr,onResourcesUiChange:Xe,onReadResource:e=>{Lr(e)},onSubscribeResource:zr,onUnsubscribeResource:Br,onRefreshResources:Yr,onCompleteArgument:Vr,completionsSupported:It?.completions!==void 0,subscriptionsSupported:It?.resources?.subscribe===!0,onTasksUiChange:L,onCancelTask:e=>{Hr(e)},onClearCompletedTasks:Wr,onRefreshTasks:ri,onSetLogLevel:Gr,modernLogLevel:Le,onSetModernLogLevel:Kr,onLogsUiChange:tt,onClearLogs:ii,onExportLogs:mi,onProtocolUiChange:rt,onClearProtocol:ai,onExportProtocol:ci,onClearProtocolSection:z,onExportProtocolSection:di,onReplayProtocol:pi,onTogglePinProtocol:fi,pinnedProtocolIds:it,onNetworkUiChange:st,onClearNetwork:oi,onExportNetwork:si,onConsoleUiChange:lt,onClearConsole:hi,onExportConsole:gi,onAppsUiChange:Qe,onSelectApp:Nr,onOpenApp:(e,t)=>{Pr(e,t)},onCloseApp:Fr,onAppError:Mr,onRefreshApps:qr})]}),(0,R.jsx)(qme,{opened:u!==null,mode:u?.mode??`add`,initialId:Si?.id,initialConfig:Si?.config,existingIds:xi,onClose:()=>d(null),onSubmit:bi}),(0,R.jsx)(ige,{opened:f,existingIds:xi,onClose:()=>p(!1),onFetchSource:l,onAddServer:yi,onUpdateServer:a}),(0,R.jsx)(vge,{opened:m,existingIds:xi,onClose:()=>h(!1),onAddServer:yi}),(0,R.jsx)(dhe,{opened:y!==void 0,settings:Oi,serverType:wi,isStdio:Ii,negotiatedEra:Ft===`connected`&&y===M?Vt:void 0,onClose:Bi,onSettingsChange:Ei,onClearStoredOAuth:Ii?void 0:zi},y??`server-settings-closed`),(0,R.jsx)(jhe,{opened:x,settings:Mi,onClose:Fi,onSettingsChange:Ai,emaIdpLoginState:Ni,onEmaIdpLogout:Pi},x?`client-settings-open`:`client-settings-closed`),Yn&&qn&&(0,R.jsx)(zge,{opened:C,onClose:()=>w(!1),initializeResult:Yn,serverInfoReported:Jn,clientCapabilities:Lt,transport:cr,protocolEra:Vt,discoverResult:Ht,oauth:dr,onClearOAuth:fr?Ri:void 0}),(0,R.jsx)(a_e,{opened:T!==null,target:T,onCancel:()=>E(null),onConfirm:vi}),(0,R.jsx)(Gge,{opened:O!==null,toolName:O?.toolName,message:O?.message,onClose:()=>k(null)}),(0,R.jsx)(Xge,{opened:A!==null,toolName:A?.toolName,details:A?.details,onClose:()=>j(null)}),(0,R.jsx)(ave,{request:Ui,serverName:qn?.name??`this server`,queuePosition:Wi,onSamplingRespond:Gi,onSamplingReject:Ki,onElicitationRespond:qi}),(0,R.jsx)(p_e,{opened:ft!==null&&ft.serverId===M,challenge:ft?.challenge??null,authorizationScopes:ft?.challenge?.authorizationScopes,enterpriseManaged:ft?.enterpriseManaged,onAuthorize:async()=>{if(!ft||St.current)return;let e=ft,t=I;if(t){if(e.enterpriseManaged){St.current=!0,pt(null),Pv.show({title:`Organization permissions`,message:GL(),color:`blue`,autoClose:4e3});try{let n=await t.handleAuthChallenge(e.challenge,{confirmedStepUp:!0});if(n.kind===`satisfied`){await t.pushRemoteAuthState(),Pv.show({title:`Permissions updated`,message:KL({recoverySource:e.source}),color:`green`,autoClose:5e3});let n=ht.current;ht.current=null,n&&await n();return}if(n.kind===`interactive`){vr({serverId:e.serverId,authKind:`step_up`,authorizationUrl:n.authorizationUrl,authChallenge:n.challenge,recoverySource:e.source});return}if(n.kind===`failed`){let t=qL(n.error.message);switch(Pv.show({title:`Organization permissions`,message:t,color:`red`,autoClose:6e3}),e.source){case`tool`:Be({status:`error`,error:t});break;case`prompt`:He(e=>e&&{...e,status:`error`,error:t});break;case`resource`:We(e=>e&&{...e,status:`error`,error:t})}}}finally{St.current=!1}return}St.current=!0,vr({serverId:e.serverId,authKind:`step_up`,authorizationUrl:e.authorizationUrl,authChallenge:e.challenge,recoverySource:e.source}),pt(null),ht.current=null,St.current=!1}},onCancel:()=>{let e=mt.current;if(pt(null),ht.current=null,!e)return;let t=`Authorization cancelled.`;switch(e.source){case`tool`:Be({status:`error`,error:t});break;case`prompt`:He(e=>e&&{...e,status:`error`,error:t});break;case`resource`:We(e=>e&&{...e,status:`error`,error:t});break;case`app`:Pv.show({title:`Authorization cancelled`,message:t,color:`gray`,autoClose:4e3})}}})]})}(0,Hee.createRoot)(document.getElementById(`root`)).render((0,R.jsx)(D.StrictMode,{children:(0,R.jsxs)(Hr,{theme:Uee,defaultColorScheme:`auto`,cssVariablesResolver:()=>({variables:{},light:{},dark:{"--mantine-color-body":`var(--mantine-color-dark-9)`}}),children:[(0,R.jsx)(ey,{position:`bottom-right`}),(0,R.jsx)(Uve,{})]})}));export{QJ as a,pm as c,l as d,nY as i,fm as l,rY as n,wJ as o,tY as r,pJ as s,$Y as t,f as u};