@agent-deck/backend 1.7.3 → 1.7.4

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -0,0 +1,499 @@
1
+ var RP=Object.defineProperty;var x1=e=>{throw TypeError(e)};var $P=(e,t,n)=>t in e?RP(e,t,{enumerable:!0,configurable:!0,writable:!0,value:n}):e[t]=n;var Ta=(e,t,n)=>$P(e,typeof t!="symbol"?t+"":t,n),Pp=(e,t,n)=>t.has(e)||x1("Cannot "+n);var U=(e,t,n)=>(Pp(e,t,"read from private field"),n?n.call(e):t.get(e)),_e=(e,t,n)=>t.has(e)?x1("Cannot add the same private member more than once"):t instanceof WeakSet?t.add(e):t.set(e,n),pe=(e,t,n,r)=>(Pp(e,t,"write to private field"),r?r.call(e,n):t.set(e,n),n),Le=(e,t,n)=>(Pp(e,t,"access private method"),n);var Fd=(e,t,n,r)=>({set _(a){pe(e,t,a,n)},get _(){return U(e,t,r)}});function OP(e,t){for(var n=0;n<t.length;n++){const r=t[n];if(typeof r!="string"&&!Array.isArray(r)){for(const a in r)if(a!=="default"&&!(a in e)){const i=Object.getOwnPropertyDescriptor(r,a);i&&Object.defineProperty(e,a,i.get?i:{enumerable:!0,get:()=>r[a]})}}}return Object.freeze(Object.defineProperty(e,Symbol.toStringTag,{value:"Module"}))}(function(){const t=document.createElement("link").relList;if(t&&t.supports&&t.supports("modulepreload"))return;for(const a of document.querySelectorAll('link[rel="modulepreload"]'))r(a);new MutationObserver(a=>{for(const i of a)if(i.type==="childList")for(const s of i.addedNodes)s.tagName==="LINK"&&s.rel==="modulepreload"&&r(s)}).observe(document,{childList:!0,subtree:!0});function n(a){const i={};return a.integrity&&(i.integrity=a.integrity),a.referrerPolicy&&(i.referrerPolicy=a.referrerPolicy),a.crossOrigin==="use-credentials"?i.credentials="include":a.crossOrigin==="anonymous"?i.credentials="omit":i.credentials="same-origin",i}function r(a){if(a.ep)return;a.ep=!0;const i=n(a);fetch(a.href,i)}})();var hh=typeof globalThis<"u"?globalThis:typeof window<"u"?window:typeof global<"u"?global:typeof self<"u"?self:{};function ic(e){return e&&e.__esModule&&Object.prototype.hasOwnProperty.call(e,"default")?e.default:e}var lC={exports:{}},jm={};/**
2
+ * @license React
3
+ * react-jsx-runtime.production.js
4
+ *
5
+ * Copyright (c) Meta Platforms, Inc. and affiliates.
6
+ *
7
+ * This source code is licensed under the MIT license found in the
8
+ * LICENSE file in the root directory of this source tree.
9
+ */var MP=Symbol.for("react.transitional.element"),PP=Symbol.for("react.fragment");function cC(e,t,n){var r=null;if(n!==void 0&&(r=""+n),t.key!==void 0&&(r=""+t.key),"key"in t){n={};for(var a in t)a!=="key"&&(n[a]=t[a])}else n=t;return t=n.ref,{$$typeof:MP,type:e,key:r,ref:t!==void 0?t:null,props:n}}jm.Fragment=PP;jm.jsx=cC;jm.jsxs=cC;lC.exports=jm;var c=lC.exports,uC={exports:{}},Tm={},dC={exports:{}},fC={};/**
10
+ * @license React
11
+ * scheduler.production.js
12
+ *
13
+ * Copyright (c) Meta Platforms, Inc. and affiliates.
14
+ *
15
+ * This source code is licensed under the MIT license found in the
16
+ * LICENSE file in the root directory of this source tree.
17
+ */(function(e){function t(B,Z){var F=B.length;B.push(Z);e:for(;0<F;){var J=F-1>>>1,N=B[J];if(0<a(N,Z))B[J]=Z,B[F]=N,F=J;else break e}}function n(B){return B.length===0?null:B[0]}function r(B){if(B.length===0)return null;var Z=B[0],F=B.pop();if(F!==Z){B[0]=F;e:for(var J=0,N=B.length,q=N>>>1;J<q;){var G=2*(J+1)-1,_=B[G],k=G+1,M=B[k];if(0>a(_,F))k<N&&0>a(M,_)?(B[J]=M,B[k]=F,J=k):(B[J]=_,B[G]=F,J=G);else if(k<N&&0>a(M,F))B[J]=M,B[k]=F,J=k;else break e}}return Z}function a(B,Z){var F=B.sortIndex-Z.sortIndex;return F!==0?F:B.id-Z.id}if(e.unstable_now=void 0,typeof performance=="object"&&typeof performance.now=="function"){var i=performance;e.unstable_now=function(){return i.now()}}else{var s=Date,o=s.now();e.unstable_now=function(){return s.now()-o}}var l=[],u=[],d=1,f=null,m=3,h=!1,y=!1,p=!1,b=!1,g=typeof setTimeout=="function"?setTimeout:null,v=typeof clearTimeout=="function"?clearTimeout:null,w=typeof setImmediate<"u"?setImmediate:null;function S(B){for(var Z=n(u);Z!==null;){if(Z.callback===null)r(u);else if(Z.startTime<=B)r(u),Z.sortIndex=Z.expirationTime,t(l,Z);else break;Z=n(u)}}function E(B){if(p=!1,S(B),!y)if(n(l)!==null)y=!0,C||(C=!0,O());else{var Z=n(u);Z!==null&&A(E,Z.startTime-B)}}var C=!1,T=-1,P=5,R=-1;function $(){return b?!0:!(e.unstable_now()-R<P)}function j(){if(b=!1,C){var B=e.unstable_now();R=B;var Z=!0;try{e:{y=!1,p&&(p=!1,v(T),T=-1),h=!0;var F=m;try{t:{for(S(B),f=n(l);f!==null&&!(f.expirationTime>B&&$());){var J=f.callback;if(typeof J=="function"){f.callback=null,m=f.priorityLevel;var N=J(f.expirationTime<=B);if(B=e.unstable_now(),typeof N=="function"){f.callback=N,S(B),Z=!0;break t}f===n(l)&&r(l),S(B)}else r(l);f=n(l)}if(f!==null)Z=!0;else{var q=n(u);q!==null&&A(E,q.startTime-B),Z=!1}}break e}finally{f=null,m=F,h=!1}Z=void 0}}finally{Z?O():C=!1}}}var O;if(typeof w=="function")O=function(){w(j)};else if(typeof MessageChannel<"u"){var z=new MessageChannel,D=z.port2;z.port1.onmessage=j,O=function(){D.postMessage(null)}}else O=function(){g(j,0)};function A(B,Z){T=g(function(){B(e.unstable_now())},Z)}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(B){B.callback=null},e.unstable_forceFrameRate=function(B){0>B||125<B?console.error("forceFrameRate takes a positive int between 0 and 125, forcing frame rates higher than 125 fps is not supported"):P=0<B?Math.floor(1e3/B):5},e.unstable_getCurrentPriorityLevel=function(){return m},e.unstable_next=function(B){switch(m){case 1:case 2:case 3:var Z=3;break;default:Z=m}var F=m;m=Z;try{return B()}finally{m=F}},e.unstable_requestPaint=function(){b=!0},e.unstable_runWithPriority=function(B,Z){switch(B){case 1:case 2:case 3:case 4:case 5:break;default:B=3}var F=m;m=B;try{return Z()}finally{m=F}},e.unstable_scheduleCallback=function(B,Z,F){var J=e.unstable_now();switch(typeof F=="object"&&F!==null?(F=F.delay,F=typeof F=="number"&&0<F?J+F:J):F=J,B){case 1:var N=-1;break;case 2:N=250;break;case 5:N=1073741823;break;case 4:N=1e4;break;default:N=5e3}return N=F+N,B={id:d++,callback:Z,priorityLevel:B,startTime:F,expirationTime:N,sortIndex:-1},F>J?(B.sortIndex=F,t(u,B),n(l)===null&&B===n(u)&&(p?(v(T),T=-1):p=!0,A(E,F-J))):(B.sortIndex=N,t(l,B),y||h||(y=!0,C||(C=!0,O()))),B},e.unstable_shouldYield=$,e.unstable_wrapCallback=function(B){var Z=m;return function(){var F=m;m=Z;try{return B.apply(this,arguments)}finally{m=F}}}})(fC);dC.exports=fC;var DP=dC.exports,hC={exports:{}},Me={};/**
18
+ * @license React
19
+ * react.production.js
20
+ *
21
+ * Copyright (c) Meta Platforms, Inc. and affiliates.
22
+ *
23
+ * This source code is licensed under the MIT license found in the
24
+ * LICENSE file in the root directory of this source tree.
25
+ */var D0=Symbol.for("react.transitional.element"),zP=Symbol.for("react.portal"),IP=Symbol.for("react.fragment"),LP=Symbol.for("react.strict_mode"),UP=Symbol.for("react.profiler"),FP=Symbol.for("react.consumer"),qP=Symbol.for("react.context"),HP=Symbol.for("react.forward_ref"),BP=Symbol.for("react.suspense"),VP=Symbol.for("react.memo"),mC=Symbol.for("react.lazy"),KP=Symbol.for("react.activity"),w1=Symbol.iterator;function ZP(e){return e===null||typeof e!="object"?null:(e=w1&&e[w1]||e["@@iterator"],typeof e=="function"?e:null)}var pC={isMounted:function(){return!1},enqueueForceUpdate:function(){},enqueueReplaceState:function(){},enqueueSetState:function(){}},gC=Object.assign,yC={};function sc(e,t,n){this.props=e,this.context=t,this.refs=yC,this.updater=n||pC}sc.prototype.isReactComponent={};sc.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")};sc.prototype.forceUpdate=function(e){this.updater.enqueueForceUpdate(this,e,"forceUpdate")};function vC(){}vC.prototype=sc.prototype;function z0(e,t,n){this.props=e,this.context=t,this.refs=yC,this.updater=n||pC}var I0=z0.prototype=new vC;I0.constructor=z0;gC(I0,sc.prototype);I0.isPureReactComponent=!0;var S1=Array.isArray;function hy(){}var Et={H:null,A:null,T:null,S:null},bC=Object.prototype.hasOwnProperty;function L0(e,t,n){var r=n.ref;return{$$typeof:D0,type:e,key:t,ref:r!==void 0?r:null,props:n}}function GP(e,t){return L0(e.type,t,e.props)}function U0(e){return typeof e=="object"&&e!==null&&e.$$typeof===D0}function QP(e){var t={"=":"=0",":":"=2"};return"$"+e.replace(/[=:]/g,function(n){return t[n]})}var _1=/\/+/g;function Dp(e,t){return typeof e=="object"&&e!==null&&e.key!=null?QP(""+e.key):t.toString(36)}function YP(e){switch(e.status){case"fulfilled":return e.value;case"rejected":throw e.reason;default:switch(typeof e.status=="string"?e.then(hy,hy):(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 Lo(e,t,n,r,a){var i=typeof e;(i==="undefined"||i==="boolean")&&(e=null);var s=!1;if(e===null)s=!0;else switch(i){case"bigint":case"string":case"number":s=!0;break;case"object":switch(e.$$typeof){case D0:case zP:s=!0;break;case mC:return s=e._init,Lo(s(e._payload),t,n,r,a)}}if(s)return a=a(e),s=r===""?"."+Dp(e,0):r,S1(a)?(n="",s!=null&&(n=s.replace(_1,"$&/")+"/"),Lo(a,t,n,"",function(u){return u})):a!=null&&(U0(a)&&(a=GP(a,n+(a.key==null||e&&e.key===a.key?"":(""+a.key).replace(_1,"$&/")+"/")+s)),t.push(a)),1;s=0;var o=r===""?".":r+":";if(S1(e))for(var l=0;l<e.length;l++)r=e[l],i=o+Dp(r,l),s+=Lo(r,t,n,i,a);else if(l=ZP(e),typeof l=="function")for(e=l.call(e),l=0;!(r=e.next()).done;)r=r.value,i=o+Dp(r,l++),s+=Lo(r,t,n,i,a);else if(i==="object"){if(typeof e.then=="function")return Lo(YP(e),t,n,r,a);throw t=String(e),Error("Objects are not valid as a React child (found: "+(t==="[object Object]"?"object with keys {"+Object.keys(e).join(", ")+"}":t)+"). If you meant to render a collection of children, use an array instead.")}return s}function qd(e,t,n){if(e==null)return e;var r=[],a=0;return Lo(e,r,"","",function(i){return t.call(n,i,a++)}),r}function XP(e){if(e._status===-1){var t=e._result;t=t(),t.then(function(n){(e._status===0||e._status===-1)&&(e._status=1,e._result=n)},function(n){(e._status===0||e._status===-1)&&(e._status=2,e._result=n)}),e._status===-1&&(e._status=0,e._result=t)}if(e._status===1)return e._result.default;throw e._result}var k1=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!==null&&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)},WP={map:qd,forEach:function(e,t,n){qd(e,function(){t.apply(this,arguments)},n)},count:function(e){var t=0;return qd(e,function(){t++}),t},toArray:function(e){return qd(e,function(t){return t})||[]},only:function(e){if(!U0(e))throw Error("React.Children.only expected to receive a single React element child.");return e}};Me.Activity=KP;Me.Children=WP;Me.Component=sc;Me.Fragment=IP;Me.Profiler=UP;Me.PureComponent=z0;Me.StrictMode=LP;Me.Suspense=BP;Me.__CLIENT_INTERNALS_DO_NOT_USE_OR_WARN_USERS_THEY_CANNOT_UPGRADE=Et;Me.__COMPILER_RUNTIME={__proto__:null,c:function(e){return Et.H.useMemoCache(e)}};Me.cache=function(e){return function(){return e.apply(null,arguments)}};Me.cacheSignal=function(){return null};Me.cloneElement=function(e,t,n){if(e==null)throw Error("The argument must be a React element, but you passed "+e+".");var r=gC({},e.props),a=e.key;if(t!=null)for(i in t.key!==void 0&&(a=""+t.key),t)!bC.call(t,i)||i==="key"||i==="__self"||i==="__source"||i==="ref"&&t.ref===void 0||(r[i]=t[i]);var i=arguments.length-2;if(i===1)r.children=n;else if(1<i){for(var s=Array(i),o=0;o<i;o++)s[o]=arguments[o+2];r.children=s}return L0(e.type,a,r)};Me.createContext=function(e){return e={$$typeof:qP,_currentValue:e,_currentValue2:e,_threadCount:0,Provider:null,Consumer:null},e.Provider=e,e.Consumer={$$typeof:FP,_context:e},e};Me.createElement=function(e,t,n){var r,a={},i=null;if(t!=null)for(r in t.key!==void 0&&(i=""+t.key),t)bC.call(t,r)&&r!=="key"&&r!=="__self"&&r!=="__source"&&(a[r]=t[r]);var s=arguments.length-2;if(s===1)a.children=n;else if(1<s){for(var o=Array(s),l=0;l<s;l++)o[l]=arguments[l+2];a.children=o}if(e&&e.defaultProps)for(r in s=e.defaultProps,s)a[r]===void 0&&(a[r]=s[r]);return L0(e,i,a)};Me.createRef=function(){return{current:null}};Me.forwardRef=function(e){return{$$typeof:HP,render:e}};Me.isValidElement=U0;Me.lazy=function(e){return{$$typeof:mC,_payload:{_status:-1,_result:e},_init:XP}};Me.memo=function(e,t){return{$$typeof:VP,type:e,compare:t===void 0?null:t}};Me.startTransition=function(e){var t=Et.T,n={};Et.T=n;try{var r=e(),a=Et.S;a!==null&&a(n,r),typeof r=="object"&&r!==null&&typeof r.then=="function"&&r.then(hy,k1)}catch(i){k1(i)}finally{t!==null&&n.types!==null&&(t.types=n.types),Et.T=t}};Me.unstable_useCacheRefresh=function(){return Et.H.useCacheRefresh()};Me.use=function(e){return Et.H.use(e)};Me.useActionState=function(e,t,n){return Et.H.useActionState(e,t,n)};Me.useCallback=function(e,t){return Et.H.useCallback(e,t)};Me.useContext=function(e){return Et.H.useContext(e)};Me.useDebugValue=function(){};Me.useDeferredValue=function(e,t){return Et.H.useDeferredValue(e,t)};Me.useEffect=function(e,t){return Et.H.useEffect(e,t)};Me.useEffectEvent=function(e){return Et.H.useEffectEvent(e)};Me.useId=function(){return Et.H.useId()};Me.useImperativeHandle=function(e,t,n){return Et.H.useImperativeHandle(e,t,n)};Me.useInsertionEffect=function(e,t){return Et.H.useInsertionEffect(e,t)};Me.useLayoutEffect=function(e,t){return Et.H.useLayoutEffect(e,t)};Me.useMemo=function(e,t){return Et.H.useMemo(e,t)};Me.useOptimistic=function(e,t){return Et.H.useOptimistic(e,t)};Me.useReducer=function(e,t,n){return Et.H.useReducer(e,t,n)};Me.useRef=function(e){return Et.H.useRef(e)};Me.useState=function(e){return Et.H.useState(e)};Me.useSyncExternalStore=function(e,t,n){return Et.H.useSyncExternalStore(e,t,n)};Me.useTransition=function(){return Et.H.useTransition()};Me.version="19.2.8";hC.exports=Me;var x=hC.exports;const ca=ic(x),id=OP({__proto__:null,default:ca},[x]);var xC={exports:{}},Ln={};/**
26
+ * @license React
27
+ * react-dom.production.js
28
+ *
29
+ * Copyright (c) Meta Platforms, Inc. and affiliates.
30
+ *
31
+ * This source code is licensed under the MIT license found in the
32
+ * LICENSE file in the root directory of this source tree.
33
+ */var JP=x;function wC(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 vi(){}var In={d:{f:vi,r:function(){throw Error(wC(522))},D:vi,C:vi,L:vi,m:vi,X:vi,S:vi,M:vi},p:0,findDOMNode:null},eD=Symbol.for("react.portal");function tD(e,t,n){var r=3<arguments.length&&arguments[3]!==void 0?arguments[3]:null;return{$$typeof:eD,key:r==null?null:""+r,children:e,containerInfo:t,implementation:n}}var ru=JP.__CLIENT_INTERNALS_DO_NOT_USE_OR_WARN_USERS_THEY_CANNOT_UPGRADE;function Am(e,t){if(e==="font")return"";if(typeof t=="string")return t==="use-credentials"?t:""}Ln.__DOM_INTERNALS_DO_NOT_USE_OR_WARN_USERS_THEY_CANNOT_UPGRADE=In;Ln.createPortal=function(e,t){var n=2<arguments.length&&arguments[2]!==void 0?arguments[2]:null;if(!t||t.nodeType!==1&&t.nodeType!==9&&t.nodeType!==11)throw Error(wC(299));return tD(e,t,null,n)};Ln.flushSync=function(e){var t=ru.T,n=In.p;try{if(ru.T=null,In.p=2,e)return e()}finally{ru.T=t,In.p=n,In.d.f()}};Ln.preconnect=function(e,t){typeof e=="string"&&(t?(t=t.crossOrigin,t=typeof t=="string"?t==="use-credentials"?t:"":void 0):t=null,In.d.C(e,t))};Ln.prefetchDNS=function(e){typeof e=="string"&&In.d.D(e)};Ln.preinit=function(e,t){if(typeof e=="string"&&t&&typeof t.as=="string"){var n=t.as,r=Am(n,t.crossOrigin),a=typeof t.integrity=="string"?t.integrity:void 0,i=typeof t.fetchPriority=="string"?t.fetchPriority:void 0;n==="style"?In.d.S(e,typeof t.precedence=="string"?t.precedence:void 0,{crossOrigin:r,integrity:a,fetchPriority:i}):n==="script"&&In.d.X(e,{crossOrigin:r,integrity:a,fetchPriority:i,nonce:typeof t.nonce=="string"?t.nonce:void 0})}};Ln.preinitModule=function(e,t){if(typeof e=="string")if(typeof t=="object"&&t!==null){if(t.as==null||t.as==="script"){var n=Am(t.as,t.crossOrigin);In.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==null&&In.d.M(e)};Ln.preload=function(e,t){if(typeof e=="string"&&typeof t=="object"&&t!==null&&typeof t.as=="string"){var n=t.as,r=Am(n,t.crossOrigin);In.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})}};Ln.preloadModule=function(e,t){if(typeof e=="string")if(t){var n=Am(t.as,t.crossOrigin);In.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 In.d.m(e)};Ln.requestFormReset=function(e){In.d.r(e)};Ln.unstable_batchedUpdates=function(e,t){return e(t)};Ln.useFormState=function(e,t,n){return ru.H.useFormState(e,t,n)};Ln.useFormStatus=function(){return ru.H.useHostTransitionStatus()};Ln.version="19.2.8";function SC(){if(!(typeof __REACT_DEVTOOLS_GLOBAL_HOOK__>"u"||typeof __REACT_DEVTOOLS_GLOBAL_HOOK__.checkDCE!="function"))try{__REACT_DEVTOOLS_GLOBAL_HOOK__.checkDCE(SC)}catch(e){console.error(e)}}SC(),xC.exports=Ln;var So=xC.exports;const nD=ic(So);/**
34
+ * @license React
35
+ * react-dom-client.production.js
36
+ *
37
+ * Copyright (c) Meta Platforms, Inc. and affiliates.
38
+ *
39
+ * This source code is licensed under the MIT license found in the
40
+ * LICENSE file in the root directory of this source tree.
41
+ */var tn=DP,_C=x,rD=So;function te(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 kC(e){return!(!e||e.nodeType!==1&&e.nodeType!==9&&e.nodeType!==11)}function sd(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 EC(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 CC(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 E1(e){if(sd(e)!==e)throw Error(te(188))}function aD(e){var t=e.alternate;if(!t){if(t=sd(e),t===null)throw Error(te(188));return t!==e?null:e}for(var n=e,r=t;;){var a=n.return;if(a===null)break;var i=a.alternate;if(i===null){if(r=a.return,r!==null){n=r;continue}break}if(a.child===i.child){for(i=a.child;i;){if(i===n)return E1(a),e;if(i===r)return E1(a),t;i=i.sibling}throw Error(te(188))}if(n.return!==r.return)n=a,r=i;else{for(var s=!1,o=a.child;o;){if(o===n){s=!0,n=a,r=i;break}if(o===r){s=!0,r=a,n=i;break}o=o.sibling}if(!s){for(o=i.child;o;){if(o===n){s=!0,n=i,r=a;break}if(o===r){s=!0,r=i,n=a;break}o=o.sibling}if(!s)throw Error(te(189))}}if(n.alternate!==r)throw Error(te(190))}if(n.tag!==3)throw Error(te(188));return n.stateNode.current===n?e:t}function NC(e){var t=e.tag;if(t===5||t===26||t===27||t===6)return e;for(e=e.child;e!==null;){if(t=NC(e),t!==null)return t;e=e.sibling}return null}var jt=Object.assign,iD=Symbol.for("react.element"),Hd=Symbol.for("react.transitional.element"),Vc=Symbol.for("react.portal"),Qo=Symbol.for("react.fragment"),jC=Symbol.for("react.strict_mode"),my=Symbol.for("react.profiler"),TC=Symbol.for("react.consumer"),Ga=Symbol.for("react.context"),F0=Symbol.for("react.forward_ref"),py=Symbol.for("react.suspense"),gy=Symbol.for("react.suspense_list"),q0=Symbol.for("react.memo"),Ci=Symbol.for("react.lazy"),yy=Symbol.for("react.activity"),sD=Symbol.for("react.memo_cache_sentinel"),C1=Symbol.iterator;function jc(e){return e===null||typeof e!="object"?null:(e=C1&&e[C1]||e["@@iterator"],typeof e=="function"?e:null)}var oD=Symbol.for("react.client.reference");function vy(e){if(e==null)return null;if(typeof e=="function")return e.$$typeof===oD?null:e.displayName||e.name||null;if(typeof e=="string")return e;switch(e){case Qo:return"Fragment";case my:return"Profiler";case jC:return"StrictMode";case py:return"Suspense";case gy:return"SuspenseList";case yy:return"Activity"}if(typeof e=="object")switch(e.$$typeof){case Vc:return"Portal";case Ga:return e.displayName||"Context";case TC:return(e._context.displayName||"Context")+".Consumer";case F0:var t=e.render;return e=e.displayName,e||(e=t.displayName||t.name||"",e=e!==""?"ForwardRef("+e+")":"ForwardRef"),e;case q0:return t=e.displayName||null,t!==null?t:vy(e.type)||"Memo";case Ci:t=e._payload,e=e._init;try{return vy(e(t))}catch{}}return null}var Kc=Array.isArray,Re=_C.__CLIENT_INTERNALS_DO_NOT_USE_OR_WARN_USERS_THEY_CANNOT_UPGRADE,et=rD.__DOM_INTERNALS_DO_NOT_USE_OR_WARN_USERS_THEY_CANNOT_UPGRADE,Ws={pending:!1,data:null,method:null,action:null},by=[],Yo=-1;function _a(e){return{current:e}}function ln(e){0>Yo||(e.current=by[Yo],by[Yo]=null,Yo--)}function mt(e,t){Yo++,by[Yo]=e.current,e.current=t}var xa=_a(null),Ru=_a(null),Xi=_a(null),mh=_a(null);function ph(e,t){switch(mt(Xi,t),mt(Ru,e),mt(xa,null),t.nodeType){case 9:case 11:e=(e=t.documentElement)&&(e=e.namespaceURI)?$S(e):0;break;default:if(e=t.tagName,t=t.namespaceURI)t=$S(t),e=Qj(t,e);else switch(e){case"svg":e=1;break;case"math":e=2;break;default:e=0}}ln(xa),mt(xa,e)}function Il(){ln(xa),ln(Ru),ln(Xi)}function xy(e){e.memoizedState!==null&&mt(mh,e);var t=xa.current,n=Qj(t,e.type);t!==n&&(mt(Ru,e),mt(xa,n))}function gh(e){Ru.current===e&&(ln(xa),ln(Ru)),mh.current===e&&(ln(mh),qu._currentValue=Ws)}var zp,N1;function Rs(e){if(zp===void 0)try{throw Error()}catch(n){var t=n.stack.trim().match(/\n( *(at )?)/);zp=t&&t[1]||"",N1=-1<n.stack.indexOf(`
42
+ at`)?" (<anonymous>)":-1<n.stack.indexOf("@")?"@unknown:0:0":""}return`
43
+ `+zp+e+N1}var Ip=!1;function Lp(e,t){if(!e||Ip)return"";Ip=!0;var n=Error.prepareStackTrace;Error.prepareStackTrace=void 0;try{var r={DetermineComponentFrameRoot:function(){try{if(t){var f=function(){throw Error()};if(Object.defineProperty(f.prototype,"props",{set:function(){throw Error()}}),typeof Reflect=="object"&&Reflect.construct){try{Reflect.construct(f,[])}catch(h){var m=h}Reflect.construct(e,[],f)}else{try{f.call()}catch(h){m=h}e.call(f.prototype)}}else{try{throw Error()}catch(h){m=h}(f=e())&&typeof f.catch=="function"&&f.catch(function(){})}}catch(h){if(h&&m&&typeof h.stack=="string")return[h.stack,m.stack]}return[null,null]}};r.DetermineComponentFrameRoot.displayName="DetermineComponentFrameRoot";var a=Object.getOwnPropertyDescriptor(r.DetermineComponentFrameRoot,"name");a&&a.configurable&&Object.defineProperty(r.DetermineComponentFrameRoot,"name",{value:"DetermineComponentFrameRoot"});var i=r.DetermineComponentFrameRoot(),s=i[0],o=i[1];if(s&&o){var l=s.split(`
44
+ `),u=o.split(`
45
+ `);for(a=r=0;r<l.length&&!l[r].includes("DetermineComponentFrameRoot");)r++;for(;a<u.length&&!u[a].includes("DetermineComponentFrameRoot");)a++;if(r===l.length||a===u.length)for(r=l.length-1,a=u.length-1;1<=r&&0<=a&&l[r]!==u[a];)a--;for(;1<=r&&0<=a;r--,a--)if(l[r]!==u[a]){if(r!==1||a!==1)do if(r--,a--,0>a||l[r]!==u[a]){var d=`
46
+ `+l[r].replace(" at new "," at ");return e.displayName&&d.includes("<anonymous>")&&(d=d.replace("<anonymous>",e.displayName)),d}while(1<=r&&0<=a);break}}}finally{Ip=!1,Error.prepareStackTrace=n}return(n=e?e.displayName||e.name:"")?Rs(n):""}function lD(e,t){switch(e.tag){case 26:case 27:case 5:return Rs(e.type);case 16:return Rs("Lazy");case 13:return e.child!==t&&t!==null?Rs("Suspense Fallback"):Rs("Suspense");case 19:return Rs("SuspenseList");case 0:case 15:return Lp(e.type,!1);case 11:return Lp(e.type.render,!1);case 1:return Lp(e.type,!0);case 31:return Rs("Activity");default:return""}}function j1(e){try{var t="",n=null;do t+=lD(e,n),n=e,e=e.return;while(e);return t}catch(r){return`
47
+ Error generating stack: `+r.message+`
48
+ `+r.stack}}var wy=Object.prototype.hasOwnProperty,H0=tn.unstable_scheduleCallback,Up=tn.unstable_cancelCallback,cD=tn.unstable_shouldYield,uD=tn.unstable_requestPaint,fr=tn.unstable_now,dD=tn.unstable_getCurrentPriorityLevel,AC=tn.unstable_ImmediatePriority,RC=tn.unstable_UserBlockingPriority,yh=tn.unstable_NormalPriority,fD=tn.unstable_LowPriority,$C=tn.unstable_IdlePriority,hD=tn.log,mD=tn.unstable_setDisableYieldValue,od=null,hr=null;function Vi(e){if(typeof hD=="function"&&mD(e),hr&&typeof hr.setStrictMode=="function")try{hr.setStrictMode(od,e)}catch{}}var mr=Math.clz32?Math.clz32:yD,pD=Math.log,gD=Math.LN2;function yD(e){return e>>>=0,e===0?32:31-(pD(e)/gD|0)|0}var Bd=256,Vd=262144,Kd=4194304;function $s(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 Rm(e,t,n){var r=e.pendingLanes;if(r===0)return 0;var a=0,i=e.suspendedLanes,s=e.pingedLanes;e=e.warmLanes;var o=r&134217727;return o!==0?(r=o&~i,r!==0?a=$s(r):(s&=o,s!==0?a=$s(s):n||(n=o&~e,n!==0&&(a=$s(n))))):(o=r&~i,o!==0?a=$s(o):s!==0?a=$s(s):n||(n=r&~e,n!==0&&(a=$s(n)))),a===0?0:t!==0&&t!==a&&!(t&i)&&(i=a&-a,n=t&-t,i>=n||i===32&&(n&4194048)!==0)?t:a}function ld(e,t){return(e.pendingLanes&~(e.suspendedLanes&~e.pingedLanes)&t)===0}function vD(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 OC(){var e=Kd;return Kd<<=1,!(Kd&62914560)&&(Kd=4194304),e}function Fp(e){for(var t=[],n=0;31>n;n++)t.push(e);return t}function cd(e,t){e.pendingLanes|=t,t!==268435456&&(e.suspendedLanes=0,e.pingedLanes=0,e.warmLanes=0)}function bD(e,t,n,r,a,i){var s=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 o=e.entanglements,l=e.expirationTimes,u=e.hiddenUpdates;for(n=s&~n;0<n;){var d=31-mr(n),f=1<<d;o[d]=0,l[d]=-1;var m=u[d];if(m!==null)for(u[d]=null,d=0;d<m.length;d++){var h=m[d];h!==null&&(h.lane&=-536870913)}n&=~f}r!==0&&MC(e,r,0),i!==0&&a===0&&e.tag!==0&&(e.suspendedLanes|=i&~(s&~t))}function MC(e,t,n){e.pendingLanes|=t,e.suspendedLanes&=~t;var r=31-mr(t);e.entangledLanes|=t,e.entanglements[r]=e.entanglements[r]|1073741824|n&261930}function PC(e,t){var n=e.entangledLanes|=t;for(e=e.entanglements;n;){var r=31-mr(n),a=1<<r;a&t|e[r]&t&&(e[r]|=t),n&=~a}}function DC(e,t){var n=t&-t;return n=n&42?1:B0(n),n&(e.suspendedLanes|t)?0:n}function B0(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 V0(e){return e&=-e,2<e?8<e?e&134217727?32:268435456:8:2}function zC(){var e=et.p;return e!==0?e:(e=window.event,e===void 0?32:s2(e.type))}function T1(e,t){var n=et.p;try{return et.p=e,t()}finally{et.p=n}}var gs=Math.random().toString(36).slice(2),yn="__reactFiber$"+gs,er="__reactProps$"+gs,oc="__reactContainer$"+gs,Sy="__reactEvents$"+gs,xD="__reactListeners$"+gs,wD="__reactHandles$"+gs,A1="__reactResources$"+gs,ud="__reactMarker$"+gs;function K0(e){delete e[yn],delete e[er],delete e[Sy],delete e[xD],delete e[wD]}function Xo(e){var t=e[yn];if(t)return t;for(var n=e.parentNode;n;){if(t=n[oc]||n[yn]){if(n=t.alternate,t.child!==null||n!==null&&n.child!==null)for(e=zS(e);e!==null;){if(n=e[yn])return n;e=zS(e)}return t}e=n,n=e.parentNode}return null}function lc(e){if(e=e[yn]||e[oc]){var t=e.tag;if(t===5||t===6||t===13||t===31||t===26||t===27||t===3)return e}return null}function Zc(e){var t=e.tag;if(t===5||t===26||t===27||t===6)return e.stateNode;throw Error(te(33))}function dl(e){var t=e[A1];return t||(t=e[A1]={hoistableStyles:new Map,hoistableScripts:new Map}),t}function on(e){e[ud]=!0}var IC=new Set,LC={};function _o(e,t){Ll(e,t),Ll(e+"Capture",t)}function Ll(e,t){for(LC[e]=t,e=0;e<t.length;e++)IC.add(t[e])}var SD=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]*$"),R1={},$1={};function _D(e){return wy.call($1,e)?!0:wy.call(R1,e)?!1:SD.test(e)?$1[e]=!0:(R1[e]=!0,!1)}function Of(e,t,n){if(_D(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 Zd(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 Aa(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 jr(e){switch(typeof e){case"bigint":case"boolean":case"number":case"string":case"undefined":return e;case"object":return e;default:return""}}function UC(e){var t=e.type;return(e=e.nodeName)&&e.toLowerCase()==="input"&&(t==="checkbox"||t==="radio")}function kD(e,t,n){var r=Object.getOwnPropertyDescriptor(e.constructor.prototype,t);if(!e.hasOwnProperty(t)&&typeof r<"u"&&typeof r.get=="function"&&typeof r.set=="function"){var a=r.get,i=r.set;return Object.defineProperty(e,t,{configurable:!0,get:function(){return a.call(this)},set:function(s){n=""+s,i.call(this,s)}}),Object.defineProperty(e,t,{enumerable:r.enumerable}),{getValue:function(){return n},setValue:function(s){n=""+s},stopTracking:function(){e._valueTracker=null,delete e[t]}}}}function _y(e){if(!e._valueTracker){var t=UC(e)?"checked":"value";e._valueTracker=kD(e,t,""+e[t])}}function FC(e){if(!e)return!1;var t=e._valueTracker;if(!t)return!0;var n=t.getValue(),r="";return e&&(r=UC(e)?e.checked?"true":"false":e.value),e=r,e!==n?(t.setValue(e),!0):!1}function vh(e){if(e=e||(typeof document<"u"?document:void 0),typeof e>"u")return null;try{return e.activeElement||e.body}catch{return e.body}}var ED=/[\n"\\]/g;function Or(e){return e.replace(ED,function(t){return"\\"+t.charCodeAt(0).toString(16)+" "})}function ky(e,t,n,r,a,i,s,o){e.name="",s!=null&&typeof s!="function"&&typeof s!="symbol"&&typeof s!="boolean"?e.type=s:e.removeAttribute("type"),t!=null?s==="number"?(t===0&&e.value===""||e.value!=t)&&(e.value=""+jr(t)):e.value!==""+jr(t)&&(e.value=""+jr(t)):s!=="submit"&&s!=="reset"||e.removeAttribute("value"),t!=null?Ey(e,s,jr(t)):n!=null?Ey(e,s,jr(n)):r!=null&&e.removeAttribute("value"),a==null&&i!=null&&(e.defaultChecked=!!i),a!=null&&(e.checked=a&&typeof a!="function"&&typeof a!="symbol"),o!=null&&typeof o!="function"&&typeof o!="symbol"&&typeof o!="boolean"?e.name=""+jr(o):e.removeAttribute("name")}function qC(e,t,n,r,a,i,s,o){if(i!=null&&typeof i!="function"&&typeof i!="symbol"&&typeof i!="boolean"&&(e.type=i),t!=null||n!=null){if(!(i!=="submit"&&i!=="reset"||t!=null)){_y(e);return}n=n!=null?""+jr(n):"",t=t!=null?""+jr(t):n,o||t===e.value||(e.value=t),e.defaultValue=t}r=r??a,r=typeof r!="function"&&typeof r!="symbol"&&!!r,e.checked=o?e.checked:!!r,e.defaultChecked=!!r,s!=null&&typeof s!="function"&&typeof s!="symbol"&&typeof s!="boolean"&&(e.name=s),_y(e)}function Ey(e,t,n){t==="number"&&vh(e.ownerDocument)===e||e.defaultValue===""+n||(e.defaultValue=""+n)}function fl(e,t,n,r){if(e=e.options,t){t={};for(var a=0;a<n.length;a++)t["$"+n[a]]=!0;for(n=0;n<e.length;n++)a=t.hasOwnProperty("$"+e[n].value),e[n].selected!==a&&(e[n].selected=a),a&&r&&(e[n].defaultSelected=!0)}else{for(n=""+jr(n),t=null,a=0;a<e.length;a++){if(e[a].value===n){e[a].selected=!0,r&&(e[a].defaultSelected=!0);return}t!==null||e[a].disabled||(t=e[a])}t!==null&&(t.selected=!0)}}function HC(e,t,n){if(t!=null&&(t=""+jr(t),t!==e.value&&(e.value=t),n==null)){e.defaultValue!==t&&(e.defaultValue=t);return}e.defaultValue=n!=null?""+jr(n):""}function BC(e,t,n,r){if(t==null){if(r!=null){if(n!=null)throw Error(te(92));if(Kc(r)){if(1<r.length)throw Error(te(93));r=r[0]}n=r}n==null&&(n=""),t=n}n=jr(t),e.defaultValue=n,r=e.textContent,r===n&&r!==""&&r!==null&&(e.value=r),_y(e)}function Ul(e,t){if(t){var n=e.firstChild;if(n&&n===e.lastChild&&n.nodeType===3){n.nodeValue=t;return}}e.textContent=t}var CD=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 O1(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||CD.has(t)?t==="float"?e.cssFloat=n:e[t]=(""+n).trim():e[t]=n+"px"}function VC(e,t,n){if(t!=null&&typeof t!="object")throw Error(te(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&&O1(e,a,r)}else for(var i in t)t.hasOwnProperty(i)&&O1(e,i,t[i])}function Z0(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 ND=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"]]),jD=/^[\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 Mf(e){return jD.test(""+e)?"javascript:throw new Error('React has blocked a javascript: URL as a security precaution.')":e}function Qa(){}var Cy=null;function G0(e){return e=e.target||e.srcElement||window,e.correspondingUseElement&&(e=e.correspondingUseElement),e.nodeType===3?e.parentNode:e}var Wo=null,hl=null;function M1(e){var t=lc(e);if(t&&(e=t.stateNode)){var n=e[er]||null;e:switch(e=t.stateNode,t.type){case"input":if(ky(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="'+Or(""+t)+'"][type="radio"]'),t=0;t<n.length;t++){var r=n[t];if(r!==e&&r.form===e.form){var a=r[er]||null;if(!a)throw Error(te(90));ky(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&&FC(r)}break e;case"textarea":HC(e,n.value,n.defaultValue);break e;case"select":t=n.value,t!=null&&fl(e,!!n.multiple,t,!1)}}}var qp=!1;function KC(e,t,n){if(qp)return e(t,n);qp=!0;try{var r=e(t);return r}finally{if(qp=!1,(Wo!==null||hl!==null)&&(Hm(),Wo&&(t=Wo,e=hl,hl=Wo=null,M1(t),e)))for(t=0;t<e.length;t++)M1(e[t])}}function $u(e,t){var n=e.stateNode;if(n===null)return null;var r=n[er]||null;if(r===null)return null;n=r[t];e: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 e;default:e=!1}if(e)return null;if(n&&typeof n!="function")throw Error(te(231,t,typeof n));return n}var ai=!(typeof window>"u"||typeof window.document>"u"||typeof window.document.createElement>"u"),Ny=!1;if(ai)try{var Tc={};Object.defineProperty(Tc,"passive",{get:function(){Ny=!0}}),window.addEventListener("test",Tc,Tc),window.removeEventListener("test",Tc,Tc)}catch{Ny=!1}var Ki=null,Q0=null,Pf=null;function ZC(){if(Pf)return Pf;var e,t=Q0,n=t.length,r,a="value"in Ki?Ki.value:Ki.textContent,i=a.length;for(e=0;e<n&&t[e]===a[e];e++);var s=n-e;for(r=1;r<=s&&t[n-r]===a[i-r];r++);return Pf=a.slice(e,1<r?1-r:void 0)}function Df(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 Gd(){return!0}function P1(){return!1}function tr(e){function t(n,r,a,i,s){this._reactName=n,this._targetInst=a,this.type=r,this.nativeEvent=i,this.target=s,this.currentTarget=null;for(var o in e)e.hasOwnProperty(o)&&(n=e[o],this[o]=n?n(i):i[o]);return this.isDefaultPrevented=(i.defaultPrevented!=null?i.defaultPrevented:i.returnValue===!1)?Gd:P1,this.isPropagationStopped=P1,this}return jt(t.prototype,{preventDefault:function(){this.defaultPrevented=!0;var n=this.nativeEvent;n&&(n.preventDefault?n.preventDefault():typeof n.returnValue!="unknown"&&(n.returnValue=!1),this.isDefaultPrevented=Gd)},stopPropagation:function(){var n=this.nativeEvent;n&&(n.stopPropagation?n.stopPropagation():typeof n.cancelBubble!="unknown"&&(n.cancelBubble=!0),this.isPropagationStopped=Gd)},persist:function(){},isPersistent:Gd}),t}var ko={eventPhase:0,bubbles:0,cancelable:0,timeStamp:function(e){return e.timeStamp||Date.now()},defaultPrevented:0,isTrusted:0},$m=tr(ko),dd=jt({},ko,{view:0,detail:0}),TD=tr(dd),Hp,Bp,Ac,Om=jt({},dd,{screenX:0,screenY:0,clientX:0,clientY:0,pageX:0,pageY:0,ctrlKey:0,shiftKey:0,altKey:0,metaKey:0,getModifierState:Y0,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!==Ac&&(Ac&&e.type==="mousemove"?(Hp=e.screenX-Ac.screenX,Bp=e.screenY-Ac.screenY):Bp=Hp=0,Ac=e),Hp)},movementY:function(e){return"movementY"in e?e.movementY:Bp}}),D1=tr(Om),AD=jt({},Om,{dataTransfer:0}),RD=tr(AD),$D=jt({},dd,{relatedTarget:0}),Vp=tr($D),OD=jt({},ko,{animationName:0,elapsedTime:0,pseudoElement:0}),MD=tr(OD),PD=jt({},ko,{clipboardData:function(e){return"clipboardData"in e?e.clipboardData:window.clipboardData}}),DD=tr(PD),zD=jt({},ko,{data:0}),z1=tr(zD),ID={Esc:"Escape",Spacebar:" ",Left:"ArrowLeft",Up:"ArrowUp",Right:"ArrowRight",Down:"ArrowDown",Del:"Delete",Win:"OS",Menu:"ContextMenu",Apps:"ContextMenu",Scroll:"ScrollLock",MozPrintableKey:"Unidentified"},LD={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"},UD={Alt:"altKey",Control:"ctrlKey",Meta:"metaKey",Shift:"shiftKey"};function FD(e){var t=this.nativeEvent;return t.getModifierState?t.getModifierState(e):(e=UD[e])?!!t[e]:!1}function Y0(){return FD}var qD=jt({},dd,{key:function(e){if(e.key){var t=ID[e.key]||e.key;if(t!=="Unidentified")return t}return e.type==="keypress"?(e=Df(e),e===13?"Enter":String.fromCharCode(e)):e.type==="keydown"||e.type==="keyup"?LD[e.keyCode]||"Unidentified":""},code:0,location:0,ctrlKey:0,shiftKey:0,altKey:0,metaKey:0,repeat:0,locale:0,getModifierState:Y0,charCode:function(e){return e.type==="keypress"?Df(e):0},keyCode:function(e){return e.type==="keydown"||e.type==="keyup"?e.keyCode:0},which:function(e){return e.type==="keypress"?Df(e):e.type==="keydown"||e.type==="keyup"?e.keyCode:0}}),HD=tr(qD),BD=jt({},Om,{pointerId:0,width:0,height:0,pressure:0,tangentialPressure:0,tiltX:0,tiltY:0,twist:0,pointerType:0,isPrimary:0}),I1=tr(BD),VD=jt({},dd,{touches:0,targetTouches:0,changedTouches:0,altKey:0,metaKey:0,ctrlKey:0,shiftKey:0,getModifierState:Y0}),KD=tr(VD),ZD=jt({},ko,{propertyName:0,elapsedTime:0,pseudoElement:0}),GD=tr(ZD),QD=jt({},Om,{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}),YD=tr(QD),XD=jt({},ko,{newState:0,oldState:0}),WD=tr(XD),JD=[9,13,27,32],X0=ai&&"CompositionEvent"in window,au=null;ai&&"documentMode"in document&&(au=document.documentMode);var e4=ai&&"TextEvent"in window&&!au,GC=ai&&(!X0||au&&8<au&&11>=au),L1=" ",U1=!1;function QC(e,t){switch(e){case"keyup":return JD.indexOf(t.keyCode)!==-1;case"keydown":return t.keyCode!==229;case"keypress":case"mousedown":case"focusout":return!0;default:return!1}}function YC(e){return e=e.detail,typeof e=="object"&&"data"in e?e.data:null}var Jo=!1;function t4(e,t){switch(e){case"compositionend":return YC(t);case"keypress":return t.which!==32?null:(U1=!0,L1);case"textInput":return e=t.data,e===L1&&U1?null:e;default:return null}}function n4(e,t){if(Jo)return e==="compositionend"||!X0&&QC(e,t)?(e=ZC(),Pf=Q0=Ki=null,Jo=!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 GC&&t.locale!=="ko"?null:t.data;default:return null}}var r4={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 F1(e){var t=e&&e.nodeName&&e.nodeName.toLowerCase();return t==="input"?!!r4[e.type]:t==="textarea"}function XC(e,t,n,r){Wo?hl?hl.push(r):hl=[r]:Wo=r,t=Dh(t,"onChange"),0<t.length&&(n=new $m("onChange","change",null,n,r),e.push({event:n,listeners:t}))}var iu=null,Ou=null;function a4(e){Kj(e,0)}function Mm(e){var t=Zc(e);if(FC(t))return e}function q1(e,t){if(e==="change")return t}var WC=!1;if(ai){var Kp;if(ai){var Zp="oninput"in document;if(!Zp){var H1=document.createElement("div");H1.setAttribute("oninput","return;"),Zp=typeof H1.oninput=="function"}Kp=Zp}else Kp=!1;WC=Kp&&(!document.documentMode||9<document.documentMode)}function B1(){iu&&(iu.detachEvent("onpropertychange",JC),Ou=iu=null)}function JC(e){if(e.propertyName==="value"&&Mm(Ou)){var t=[];XC(t,Ou,e,G0(e)),KC(a4,t)}}function i4(e,t,n){e==="focusin"?(B1(),iu=t,Ou=n,iu.attachEvent("onpropertychange",JC)):e==="focusout"&&B1()}function s4(e){if(e==="selectionchange"||e==="keyup"||e==="keydown")return Mm(Ou)}function o4(e,t){if(e==="click")return Mm(t)}function l4(e,t){if(e==="input"||e==="change")return Mm(t)}function c4(e,t){return e===t&&(e!==0||1/e===1/t)||e!==e&&t!==t}var vr=typeof Object.is=="function"?Object.is:c4;function Mu(e,t){if(vr(e,t))return!0;if(typeof e!="object"||e===null||typeof t!="object"||t===null)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 a=n[r];if(!wy.call(t,a)||!vr(e[a],t[a]))return!1}return!0}function V1(e){for(;e&&e.firstChild;)e=e.firstChild;return e}function K1(e,t){var n=V1(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}e:{for(;n;){if(n.nextSibling){n=n.nextSibling;break e}n=n.parentNode}n=void 0}n=V1(n)}}function eN(e,t){return e&&t?e===t?!0:e&&e.nodeType===3?!1:t&&t.nodeType===3?eN(e,t.parentNode):"contains"in e?e.contains(t):e.compareDocumentPosition?!!(e.compareDocumentPosition(t)&16):!1:!1}function tN(e){e=e!=null&&e.ownerDocument!=null&&e.ownerDocument.defaultView!=null?e.ownerDocument.defaultView:window;for(var t=vh(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=vh(e.document)}return t}function W0(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 u4=ai&&"documentMode"in document&&11>=document.documentMode,el=null,jy=null,su=null,Ty=!1;function Z1(e,t,n){var r=n.window===n?n.document:n.nodeType===9?n:n.ownerDocument;Ty||el==null||el!==vh(r)||(r=el,"selectionStart"in r&&W0(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}),su&&Mu(su,r)||(su=r,r=Dh(jy,"onSelect"),0<r.length&&(t=new $m("onSelect","select",null,t,n),e.push({event:t,listeners:r}),t.target=el)))}function Es(e,t){var n={};return n[e.toLowerCase()]=t.toLowerCase(),n["Webkit"+e]="webkit"+t,n["Moz"+e]="moz"+t,n}var tl={animationend:Es("Animation","AnimationEnd"),animationiteration:Es("Animation","AnimationIteration"),animationstart:Es("Animation","AnimationStart"),transitionrun:Es("Transition","TransitionRun"),transitionstart:Es("Transition","TransitionStart"),transitioncancel:Es("Transition","TransitionCancel"),transitionend:Es("Transition","TransitionEnd")},Gp={},nN={};ai&&(nN=document.createElement("div").style,"AnimationEvent"in window||(delete tl.animationend.animation,delete tl.animationiteration.animation,delete tl.animationstart.animation),"TransitionEvent"in window||delete tl.transitionend.transition);function Eo(e){if(Gp[e])return Gp[e];if(!tl[e])return e;var t=tl[e],n;for(n in t)if(t.hasOwnProperty(n)&&n in nN)return Gp[e]=t[n];return e}var rN=Eo("animationend"),aN=Eo("animationiteration"),iN=Eo("animationstart"),d4=Eo("transitionrun"),f4=Eo("transitionstart"),h4=Eo("transitioncancel"),sN=Eo("transitionend"),oN=new Map,Ay="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(" ");Ay.push("scrollEnd");function ra(e,t){oN.set(e,t),_o(t,[e])}var bh=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!==null&&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)},Er=[],nl=0,J0=0;function Pm(){for(var e=nl,t=J0=nl=0;t<e;){var n=Er[t];Er[t++]=null;var r=Er[t];Er[t++]=null;var a=Er[t];Er[t++]=null;var i=Er[t];if(Er[t++]=null,r!==null&&a!==null){var s=r.pending;s===null?a.next=a:(a.next=s.next,s.next=a),r.pending=a}i!==0&&lN(n,a,i)}}function Dm(e,t,n,r){Er[nl++]=e,Er[nl++]=t,Er[nl++]=n,Er[nl++]=r,J0|=r,e.lanes|=r,e=e.alternate,e!==null&&(e.lanes|=r)}function eb(e,t,n,r){return Dm(e,t,n,r),xh(e)}function Co(e,t){return Dm(e,null,null,t),xh(e)}function lN(e,t,n){e.lanes|=n;var r=e.alternate;r!==null&&(r.lanes|=n);for(var a=!1,i=e.return;i!==null;)i.childLanes|=n,r=i.alternate,r!==null&&(r.childLanes|=n),i.tag===22&&(e=i.stateNode,e===null||e._visibility&1||(a=!0)),e=i,i=i.return;return e.tag===3?(i=e.stateNode,a&&t!==null&&(a=31-mr(n),e=i.hiddenUpdates,r=e[a],r===null?e[a]=[t]:r.push(t),t.lane=n|536870912),i):null}function xh(e){if(50<pu)throw pu=0,Xy=null,Error(te(185));for(var t=e.return;t!==null;)e=t,t=e.return;return e.tag===3?e.stateNode:null}var rl={};function m4(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 ur(e,t,n,r){return new m4(e,t,n,r)}function tb(e){return e=e.prototype,!(!e||!e.isReactComponent)}function Wa(e,t){var n=e.alternate;return n===null?(n=ur(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 cN(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 zf(e,t,n,r,a,i){var s=0;if(r=e,typeof e=="function")tb(e)&&(s=1);else if(typeof e=="string")s=bz(e,n,xa.current)?26:e==="html"||e==="head"||e==="body"?27:5;else e:switch(e){case yy:return e=ur(31,n,t,a),e.elementType=yy,e.lanes=i,e;case Qo:return Js(n.children,a,i,t);case jC:s=8,a|=24;break;case my:return e=ur(12,n,t,a|2),e.elementType=my,e.lanes=i,e;case py:return e=ur(13,n,t,a),e.elementType=py,e.lanes=i,e;case gy:return e=ur(19,n,t,a),e.elementType=gy,e.lanes=i,e;default:if(typeof e=="object"&&e!==null)switch(e.$$typeof){case Ga:s=10;break e;case TC:s=9;break e;case F0:s=11;break e;case q0:s=14;break e;case Ci:s=16,r=null;break e}s=29,n=Error(te(130,e===null?"null":typeof e,"")),r=null}return t=ur(s,n,t,a),t.elementType=e,t.type=r,t.lanes=i,t}function Js(e,t,n,r){return e=ur(7,e,r,t),e.lanes=n,e}function Qp(e,t,n){return e=ur(6,e,null,t),e.lanes=n,e}function uN(e){var t=ur(18,null,null,0);return t.stateNode=e,t}function Yp(e,t,n){return t=ur(4,e.children!==null?e.children:[],e.key,t),t.lanes=n,t.stateNode={containerInfo:e.containerInfo,pendingChildren:null,implementation:e.implementation},t}var G1=new WeakMap;function Mr(e,t){if(typeof e=="object"&&e!==null){var n=G1.get(e);return n!==void 0?n:(t={value:e,source:t,stack:j1(t)},G1.set(e,t),t)}return{value:e,source:t,stack:j1(t)}}var al=[],il=0,wh=null,Pu=0,Tr=[],Ar=0,ls=null,ga=1,ya="";function Ua(e,t){al[il++]=Pu,al[il++]=wh,wh=e,Pu=t}function dN(e,t,n){Tr[Ar++]=ga,Tr[Ar++]=ya,Tr[Ar++]=ls,ls=e;var r=ga;e=ya;var a=32-mr(r)-1;r&=~(1<<a),n+=1;var i=32-mr(t)+a;if(30<i){var s=a-a%5;i=(r&(1<<s)-1).toString(32),r>>=s,a-=s,ga=1<<32-mr(t)+a|n<<a|r,ya=i+e}else ga=1<<i|n<<a|r,ya=e}function nb(e){e.return!==null&&(Ua(e,1),dN(e,1,0))}function rb(e){for(;e===wh;)wh=al[--il],al[il]=null,Pu=al[--il],al[il]=null;for(;e===ls;)ls=Tr[--Ar],Tr[Ar]=null,ya=Tr[--Ar],Tr[Ar]=null,ga=Tr[--Ar],Tr[Ar]=null}function fN(e,t){Tr[Ar++]=ga,Tr[Ar++]=ya,Tr[Ar++]=ls,ga=t.id,ya=t.overflow,ls=e}var vn=null,xt=null,Ye=!1,Wi=null,Pr=!1,Ry=Error(te(519));function cs(e){var t=Error(te(418,1<arguments.length&&arguments[1]!==void 0&&arguments[1]?"text":"HTML",""));throw Du(Mr(t,e)),Ry}function Q1(e){var t=e.stateNode,n=e.type,r=e.memoizedProps;switch(t[yn]=e,t[er]=r,n){case"dialog":Be("cancel",t),Be("close",t);break;case"iframe":case"object":case"embed":Be("load",t);break;case"video":case"audio":for(n=0;n<Uu.length;n++)Be(Uu[n],t);break;case"source":Be("error",t);break;case"img":case"image":case"link":Be("error",t),Be("load",t);break;case"details":Be("toggle",t);break;case"input":Be("invalid",t),qC(t,r.value,r.defaultValue,r.checked,r.defaultChecked,r.type,r.name,!0);break;case"select":Be("invalid",t);break;case"textarea":Be("invalid",t),BC(t,r.value,r.defaultValue,r.children)}n=r.children,typeof n!="string"&&typeof n!="number"&&typeof n!="bigint"||t.textContent===""+n||r.suppressHydrationWarning===!0||Gj(t.textContent,n)?(r.popover!=null&&(Be("beforetoggle",t),Be("toggle",t)),r.onScroll!=null&&Be("scroll",t),r.onScrollEnd!=null&&Be("scrollend",t),r.onClick!=null&&(t.onclick=Qa),t=!0):t=!1,t||cs(e,!0)}function Y1(e){for(vn=e.return;vn;)switch(vn.tag){case 5:case 31:case 13:Pr=!1;return;case 27:case 3:Pr=!0;return;default:vn=vn.return}}function Ro(e){if(e!==vn)return!1;if(!Ye)return Y1(e),Ye=!0,!1;var t=e.tag,n;if((n=t!==3&&t!==27)&&((n=t===5)&&(n=e.type,n=!(n!=="form"&&n!=="button")||nv(e.type,e.memoizedProps)),n=!n),n&&xt&&cs(e),Y1(e),t===13){if(e=e.memoizedState,e=e!==null?e.dehydrated:null,!e)throw Error(te(317));xt=DS(e)}else if(t===31){if(e=e.memoizedState,e=e!==null?e.dehydrated:null,!e)throw Error(te(317));xt=DS(e)}else t===27?(t=xt,ys(e.type)?(e=sv,sv=null,xt=e):xt=t):xt=vn?zr(e.stateNode.nextSibling):null;return!0}function ao(){xt=vn=null,Ye=!1}function Xp(){var e=Wi;return e!==null&&(Gn===null?Gn=e:Gn.push.apply(Gn,e),Wi=null),e}function Du(e){Wi===null?Wi=[e]:Wi.push(e)}var $y=_a(null),No=null,Ya=null;function Ri(e,t,n){mt($y,t._currentValue),t._currentValue=n}function Ja(e){e._currentValue=$y.current,ln($y)}function Oy(e,t,n){for(;e!==null;){var r=e.alternate;if((e.childLanes&t)!==t?(e.childLanes|=t,r!==null&&(r.childLanes|=t)):r!==null&&(r.childLanes&t)!==t&&(r.childLanes|=t),e===n)break;e=e.return}}function My(e,t,n,r){var a=e.child;for(a!==null&&(a.return=e);a!==null;){var i=a.dependencies;if(i!==null){var s=a.child;i=i.firstContext;e:for(;i!==null;){var o=i;i=a;for(var l=0;l<t.length;l++)if(o.context===t[l]){i.lanes|=n,o=i.alternate,o!==null&&(o.lanes|=n),Oy(i.return,n,e),r||(s=null);break e}i=o.next}}else if(a.tag===18){if(s=a.return,s===null)throw Error(te(341));s.lanes|=n,i=s.alternate,i!==null&&(i.lanes|=n),Oy(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 cc(e,t,n,r){e=null;for(var a=t,i=!1;a!==null;){if(!i){if(a.flags&524288)i=!0;else if(a.flags&262144)break}if(a.tag===10){var s=a.alternate;if(s===null)throw Error(te(387));if(s=s.memoizedProps,s!==null){var o=a.type;vr(a.pendingProps.value,s.value)||(e!==null?e.push(o):e=[o])}}else if(a===mh.current){if(s=a.alternate,s===null)throw Error(te(387));s.memoizedState.memoizedState!==a.memoizedState.memoizedState&&(e!==null?e.push(qu):e=[qu])}a=a.return}e!==null&&My(t,e,n,r),t.flags|=262144}function Sh(e){for(e=e.firstContext;e!==null;){if(!vr(e.context._currentValue,e.memoizedValue))return!0;e=e.next}return!1}function io(e){No=e,Ya=null,e=e.dependencies,e!==null&&(e.firstContext=null)}function bn(e){return hN(No,e)}function Qd(e,t){return No===null&&io(e),hN(e,t)}function hN(e,t){var n=t._currentValue;if(t={context:t,memoizedValue:n,next:null},Ya===null){if(e===null)throw Error(te(308));Ya=t,e.dependencies={lanes:0,firstContext:t},e.flags|=524288}else Ya=Ya.next=t;return n}var p4=typeof AbortController<"u"?AbortController:function(){var e=[],t=this.signal={aborted:!1,addEventListener:function(n,r){e.push(r)}};this.abort=function(){t.aborted=!0,e.forEach(function(n){return n()})}},g4=tn.unstable_scheduleCallback,y4=tn.unstable_NormalPriority,Zt={$$typeof:Ga,Consumer:null,Provider:null,_currentValue:null,_currentValue2:null,_threadCount:0};function ab(){return{controller:new p4,data:new Map,refCount:0}}function fd(e){e.refCount--,e.refCount===0&&g4(y4,function(){e.controller.abort()})}var ou=null,Py=0,Fl=0,ml=null;function v4(e,t){if(ou===null){var n=ou=[];Py=0,Fl=Tb(),ml={status:"pending",value:void 0,then:function(r){n.push(r)}}}return Py++,t.then(X1,X1),t}function X1(){if(--Py===0&&ou!==null){ml!==null&&(ml.status="fulfilled");var e=ou;ou=null,Fl=0,ml=null;for(var t=0;t<e.length;t++)(0,e[t])()}}function b4(e,t){var n=[],r={status:"pending",value:null,reason:null,then:function(a){n.push(a)}};return e.then(function(){r.status="fulfilled",r.value=t;for(var a=0;a<n.length;a++)(0,n[a])(t)},function(a){for(r.status="rejected",r.reason=a,a=0;a<n.length;a++)(0,n[a])(void 0)}),r}var W1=Re.S;Re.S=function(e,t){Nj=fr(),typeof t=="object"&&t!==null&&typeof t.then=="function"&&v4(e,t),W1!==null&&W1(e,t)};var eo=_a(null);function ib(){var e=eo.current;return e!==null?e:dt.pooledCache}function If(e,t){t===null?mt(eo,eo.current):mt(eo,t.pool)}function mN(){var e=ib();return e===null?null:{parent:Zt._currentValue,pool:e}}var uc=Error(te(460)),sb=Error(te(474)),zm=Error(te(542)),_h={then:function(){}};function J1(e){return e=e.status,e==="fulfilled"||e==="rejected"}function pN(e,t,n){switch(n=e[n],n===void 0?e.push(t):n!==t&&(t.then(Qa,Qa),t=n),t.status){case"fulfilled":return t.value;case"rejected":throw e=t.reason,tS(e),e;default:if(typeof t.status=="string")t.then(Qa,Qa);else{if(e=dt,e!==null&&100<e.shellSuspendCounter)throw Error(te(482));e=t,e.status="pending",e.then(function(r){if(t.status==="pending"){var a=t;a.status="fulfilled",a.value=r}},function(r){if(t.status==="pending"){var a=t;a.status="rejected",a.reason=r}})}switch(t.status){case"fulfilled":return t.value;case"rejected":throw e=t.reason,tS(e),e}throw to=t,uc}}function Os(e){try{var t=e._init;return t(e._payload)}catch(n){throw n!==null&&typeof n=="object"&&typeof n.then=="function"?(to=n,uc):n}}var to=null;function eS(){if(to===null)throw Error(te(459));var e=to;return to=null,e}function tS(e){if(e===uc||e===zm)throw Error(te(483))}var pl=null,zu=0;function Yd(e){var t=zu;return zu+=1,pl===null&&(pl=[]),pN(pl,e,t)}function Rc(e,t){t=t.props.ref,e.ref=t!==void 0?t:null}function Xd(e,t){throw t.$$typeof===iD?Error(te(525)):(e=Object.prototype.toString.call(t),Error(te(31,e==="[object Object]"?"object with keys {"+Object.keys(t).join(", ")+"}":e)))}function gN(e){function t(g,v){if(e){var w=g.deletions;w===null?(g.deletions=[v],g.flags|=16):w.push(v)}}function n(g,v){if(!e)return null;for(;v!==null;)t(g,v),v=v.sibling;return null}function r(g){for(var v=new Map;g!==null;)g.key!==null?v.set(g.key,g):v.set(g.index,g),g=g.sibling;return v}function a(g,v){return g=Wa(g,v),g.index=0,g.sibling=null,g}function i(g,v,w){return g.index=w,e?(w=g.alternate,w!==null?(w=w.index,w<v?(g.flags|=67108866,v):w):(g.flags|=67108866,v)):(g.flags|=1048576,v)}function s(g){return e&&g.alternate===null&&(g.flags|=67108866),g}function o(g,v,w,S){return v===null||v.tag!==6?(v=Qp(w,g.mode,S),v.return=g,v):(v=a(v,w),v.return=g,v)}function l(g,v,w,S){var E=w.type;return E===Qo?d(g,v,w.props.children,S,w.key):v!==null&&(v.elementType===E||typeof E=="object"&&E!==null&&E.$$typeof===Ci&&Os(E)===v.type)?(v=a(v,w.props),Rc(v,w),v.return=g,v):(v=zf(w.type,w.key,w.props,null,g.mode,S),Rc(v,w),v.return=g,v)}function u(g,v,w,S){return v===null||v.tag!==4||v.stateNode.containerInfo!==w.containerInfo||v.stateNode.implementation!==w.implementation?(v=Yp(w,g.mode,S),v.return=g,v):(v=a(v,w.children||[]),v.return=g,v)}function d(g,v,w,S,E){return v===null||v.tag!==7?(v=Js(w,g.mode,S,E),v.return=g,v):(v=a(v,w),v.return=g,v)}function f(g,v,w){if(typeof v=="string"&&v!==""||typeof v=="number"||typeof v=="bigint")return v=Qp(""+v,g.mode,w),v.return=g,v;if(typeof v=="object"&&v!==null){switch(v.$$typeof){case Hd:return w=zf(v.type,v.key,v.props,null,g.mode,w),Rc(w,v),w.return=g,w;case Vc:return v=Yp(v,g.mode,w),v.return=g,v;case Ci:return v=Os(v),f(g,v,w)}if(Kc(v)||jc(v))return v=Js(v,g.mode,w,null),v.return=g,v;if(typeof v.then=="function")return f(g,Yd(v),w);if(v.$$typeof===Ga)return f(g,Qd(g,v),w);Xd(g,v)}return null}function m(g,v,w,S){var E=v!==null?v.key:null;if(typeof w=="string"&&w!==""||typeof w=="number"||typeof w=="bigint")return E!==null?null:o(g,v,""+w,S);if(typeof w=="object"&&w!==null){switch(w.$$typeof){case Hd:return w.key===E?l(g,v,w,S):null;case Vc:return w.key===E?u(g,v,w,S):null;case Ci:return w=Os(w),m(g,v,w,S)}if(Kc(w)||jc(w))return E!==null?null:d(g,v,w,S,null);if(typeof w.then=="function")return m(g,v,Yd(w),S);if(w.$$typeof===Ga)return m(g,v,Qd(g,w),S);Xd(g,w)}return null}function h(g,v,w,S,E){if(typeof S=="string"&&S!==""||typeof S=="number"||typeof S=="bigint")return g=g.get(w)||null,o(v,g,""+S,E);if(typeof S=="object"&&S!==null){switch(S.$$typeof){case Hd:return g=g.get(S.key===null?w:S.key)||null,l(v,g,S,E);case Vc:return g=g.get(S.key===null?w:S.key)||null,u(v,g,S,E);case Ci:return S=Os(S),h(g,v,w,S,E)}if(Kc(S)||jc(S))return g=g.get(w)||null,d(v,g,S,E,null);if(typeof S.then=="function")return h(g,v,w,Yd(S),E);if(S.$$typeof===Ga)return h(g,v,w,Qd(v,S),E);Xd(v,S)}return null}function y(g,v,w,S){for(var E=null,C=null,T=v,P=v=0,R=null;T!==null&&P<w.length;P++){T.index>P?(R=T,T=null):R=T.sibling;var $=m(g,T,w[P],S);if($===null){T===null&&(T=R);break}e&&T&&$.alternate===null&&t(g,T),v=i($,v,P),C===null?E=$:C.sibling=$,C=$,T=R}if(P===w.length)return n(g,T),Ye&&Ua(g,P),E;if(T===null){for(;P<w.length;P++)T=f(g,w[P],S),T!==null&&(v=i(T,v,P),C===null?E=T:C.sibling=T,C=T);return Ye&&Ua(g,P),E}for(T=r(T);P<w.length;P++)R=h(T,g,P,w[P],S),R!==null&&(e&&R.alternate!==null&&T.delete(R.key===null?P:R.key),v=i(R,v,P),C===null?E=R:C.sibling=R,C=R);return e&&T.forEach(function(j){return t(g,j)}),Ye&&Ua(g,P),E}function p(g,v,w,S){if(w==null)throw Error(te(151));for(var E=null,C=null,T=v,P=v=0,R=null,$=w.next();T!==null&&!$.done;P++,$=w.next()){T.index>P?(R=T,T=null):R=T.sibling;var j=m(g,T,$.value,S);if(j===null){T===null&&(T=R);break}e&&T&&j.alternate===null&&t(g,T),v=i(j,v,P),C===null?E=j:C.sibling=j,C=j,T=R}if($.done)return n(g,T),Ye&&Ua(g,P),E;if(T===null){for(;!$.done;P++,$=w.next())$=f(g,$.value,S),$!==null&&(v=i($,v,P),C===null?E=$:C.sibling=$,C=$);return Ye&&Ua(g,P),E}for(T=r(T);!$.done;P++,$=w.next())$=h(T,g,P,$.value,S),$!==null&&(e&&$.alternate!==null&&T.delete($.key===null?P:$.key),v=i($,v,P),C===null?E=$:C.sibling=$,C=$);return e&&T.forEach(function(O){return t(g,O)}),Ye&&Ua(g,P),E}function b(g,v,w,S){if(typeof w=="object"&&w!==null&&w.type===Qo&&w.key===null&&(w=w.props.children),typeof w=="object"&&w!==null){switch(w.$$typeof){case Hd:e:{for(var E=w.key;v!==null;){if(v.key===E){if(E=w.type,E===Qo){if(v.tag===7){n(g,v.sibling),S=a(v,w.props.children),S.return=g,g=S;break e}}else if(v.elementType===E||typeof E=="object"&&E!==null&&E.$$typeof===Ci&&Os(E)===v.type){n(g,v.sibling),S=a(v,w.props),Rc(S,w),S.return=g,g=S;break e}n(g,v);break}else t(g,v);v=v.sibling}w.type===Qo?(S=Js(w.props.children,g.mode,S,w.key),S.return=g,g=S):(S=zf(w.type,w.key,w.props,null,g.mode,S),Rc(S,w),S.return=g,g=S)}return s(g);case Vc:e:{for(E=w.key;v!==null;){if(v.key===E)if(v.tag===4&&v.stateNode.containerInfo===w.containerInfo&&v.stateNode.implementation===w.implementation){n(g,v.sibling),S=a(v,w.children||[]),S.return=g,g=S;break e}else{n(g,v);break}else t(g,v);v=v.sibling}S=Yp(w,g.mode,S),S.return=g,g=S}return s(g);case Ci:return w=Os(w),b(g,v,w,S)}if(Kc(w))return y(g,v,w,S);if(jc(w)){if(E=jc(w),typeof E!="function")throw Error(te(150));return w=E.call(w),p(g,v,w,S)}if(typeof w.then=="function")return b(g,v,Yd(w),S);if(w.$$typeof===Ga)return b(g,v,Qd(g,w),S);Xd(g,w)}return typeof w=="string"&&w!==""||typeof w=="number"||typeof w=="bigint"?(w=""+w,v!==null&&v.tag===6?(n(g,v.sibling),S=a(v,w),S.return=g,g=S):(n(g,v),S=Qp(w,g.mode,S),S.return=g,g=S),s(g)):n(g,v)}return function(g,v,w,S){try{zu=0;var E=b(g,v,w,S);return pl=null,E}catch(T){if(T===uc||T===zm)throw T;var C=ur(29,T,null,g.mode);return C.lanes=S,C.return=g,C}finally{}}}var so=gN(!0),yN=gN(!1),Ni=!1;function ob(e){e.updateQueue={baseState:e.memoizedState,firstBaseUpdate:null,lastBaseUpdate:null,shared:{pending:null,lanes:0,hiddenCallbacks:null},callbacks:null}}function Dy(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 Ji(e){return{lane:e,tag:0,payload:null,callback:null,next:null}}function es(e,t,n){var r=e.updateQueue;if(r===null)return null;if(r=r.shared,Je&2){var a=r.pending;return a===null?t.next=t:(t.next=a.next,a.next=t),r.pending=t,t=xh(e),lN(e,null,n),t}return Dm(e,r,t,n),xh(e)}function lu(e,t,n){if(t=t.updateQueue,t!==null&&(t=t.shared,(n&4194048)!==0)){var r=t.lanes;r&=e.pendingLanes,n|=r,t.lanes=n,PC(e,n)}}function Wp(e,t){var n=e.updateQueue,r=e.alternate;if(r!==null&&(r=r.updateQueue,n===r)){var a=null,i=null;if(n=n.firstBaseUpdate,n!==null){do{var s={lane:n.lane,tag:n.tag,payload:n.payload,callback:null,next:null};i===null?a=i=s:i=i.next=s,n=n.next}while(n!==null);i===null?a=i=t:i=i.next=t}else a=i=t;n={baseState:r.baseState,firstBaseUpdate:a,lastBaseUpdate:i,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 zy=!1;function cu(){if(zy){var e=ml;if(e!==null)throw e}}function uu(e,t,n,r){zy=!1;var a=e.updateQueue;Ni=!1;var i=a.firstBaseUpdate,s=a.lastBaseUpdate,o=a.shared.pending;if(o!==null){a.shared.pending=null;var l=o,u=l.next;l.next=null,s===null?i=u:s.next=u,s=l;var d=e.alternate;d!==null&&(d=d.updateQueue,o=d.lastBaseUpdate,o!==s&&(o===null?d.firstBaseUpdate=u:o.next=u,d.lastBaseUpdate=l))}if(i!==null){var f=a.baseState;s=0,d=u=l=null,o=i;do{var m=o.lane&-536870913,h=m!==o.lane;if(h?(Ze&m)===m:(r&m)===m){m!==0&&m===Fl&&(zy=!0),d!==null&&(d=d.next={lane:0,tag:o.tag,payload:o.payload,callback:null,next:null});e:{var y=e,p=o;m=t;var b=n;switch(p.tag){case 1:if(y=p.payload,typeof y=="function"){f=y.call(b,f,m);break e}f=y;break e;case 3:y.flags=y.flags&-65537|128;case 0:if(y=p.payload,m=typeof y=="function"?y.call(b,f,m):y,m==null)break e;f=jt({},f,m);break e;case 2:Ni=!0}}m=o.callback,m!==null&&(e.flags|=64,h&&(e.flags|=8192),h=a.callbacks,h===null?a.callbacks=[m]:h.push(m))}else h={lane:m,tag:o.tag,payload:o.payload,callback:o.callback,next:null},d===null?(u=d=h,l=f):d=d.next=h,s|=m;if(o=o.next,o===null){if(o=a.shared.pending,o===null)break;h=o,o=h.next,h.next=null,a.lastBaseUpdate=h,a.shared.pending=null}}while(!0);d===null&&(l=f),a.baseState=l,a.firstBaseUpdate=u,a.lastBaseUpdate=d,i===null&&(a.shared.lanes=0),ds|=s,e.lanes=s,e.memoizedState=f}}function vN(e,t){if(typeof e!="function")throw Error(te(191,e));e.call(t)}function bN(e,t){var n=e.callbacks;if(n!==null)for(e.callbacks=null,e=0;e<n.length;e++)vN(n[e],t)}var ql=_a(null),kh=_a(0);function nS(e,t){e=li,mt(kh,e),mt(ql,t),li=e|t.baseLanes}function Iy(){mt(kh,li),mt(ql,ql.current)}function lb(){li=kh.current,ln(ql),ln(kh)}var br=_a(null),Dr=null;function $i(e){var t=e.alternate;mt(qt,qt.current&1),mt(br,e),Dr===null&&(t===null||ql.current!==null||t.memoizedState!==null)&&(Dr=e)}function Ly(e){mt(qt,qt.current),mt(br,e),Dr===null&&(Dr=e)}function xN(e){e.tag===22?(mt(qt,qt.current),mt(br,e),Dr===null&&(Dr=e)):Oi()}function Oi(){mt(qt,qt.current),mt(br,br.current)}function or(e){ln(br),Dr===e&&(Dr=null),ln(qt)}var qt=_a(0);function Eh(e){for(var t=e;t!==null;){if(t.tag===13){var n=t.memoizedState;if(n!==null&&(n=n.dehydrated,n===null||av(n)||iv(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 ii=0,Pe=null,ot=null,Vt=null,Ch=!1,gl=!1,oo=!1,Nh=0,Iu=0,yl=null,x4=0;function zt(){throw Error(te(321))}function cb(e,t){if(t===null)return!1;for(var n=0;n<t.length&&n<e.length;n++)if(!vr(e[n],t[n]))return!1;return!0}function ub(e,t,n,r,a,i){return ii=i,Pe=t,t.memoizedState=null,t.updateQueue=null,t.lanes=0,Re.H=e===null||e.memoizedState===null?XN:wb,oo=!1,i=n(r,a),oo=!1,gl&&(i=SN(t,n,r,a)),wN(e),i}function wN(e){Re.H=Lu;var t=ot!==null&&ot.next!==null;if(ii=0,Vt=ot=Pe=null,Ch=!1,Iu=0,yl=null,t)throw Error(te(300));e===null||Gt||(e=e.dependencies,e!==null&&Sh(e)&&(Gt=!0))}function SN(e,t,n,r){Pe=e;var a=0;do{if(gl&&(yl=null),Iu=0,gl=!1,25<=a)throw Error(te(301));if(a+=1,Vt=ot=null,e.updateQueue!=null){var i=e.updateQueue;i.lastEffect=null,i.events=null,i.stores=null,i.memoCache!=null&&(i.memoCache.index=0)}Re.H=WN,i=t(n,r)}while(gl);return i}function w4(){var e=Re.H,t=e.useState()[0];return t=typeof t.then=="function"?hd(t):t,e=e.useState()[0],(ot!==null?ot.memoizedState:null)!==e&&(Pe.flags|=1024),t}function db(){var e=Nh!==0;return Nh=0,e}function fb(e,t,n){t.updateQueue=e.updateQueue,t.flags&=-2053,e.lanes&=~n}function hb(e){if(Ch){for(e=e.memoizedState;e!==null;){var t=e.queue;t!==null&&(t.pending=null),e=e.next}Ch=!1}ii=0,Vt=ot=Pe=null,gl=!1,Iu=Nh=0,yl=null}function Mn(){var e={memoizedState:null,baseState:null,baseQueue:null,queue:null,next:null};return Vt===null?Pe.memoizedState=Vt=e:Vt=Vt.next=e,Vt}function Ht(){if(ot===null){var e=Pe.alternate;e=e!==null?e.memoizedState:null}else e=ot.next;var t=Vt===null?Pe.memoizedState:Vt.next;if(t!==null)Vt=t,ot=e;else{if(e===null)throw Pe.alternate===null?Error(te(467)):Error(te(310));ot=e,e={memoizedState:ot.memoizedState,baseState:ot.baseState,baseQueue:ot.baseQueue,queue:ot.queue,next:null},Vt===null?Pe.memoizedState=Vt=e:Vt=Vt.next=e}return Vt}function Im(){return{lastEffect:null,events:null,stores:null,memoCache:null}}function hd(e){var t=Iu;return Iu+=1,yl===null&&(yl=[]),e=pN(yl,e,t),t=Pe,(Vt===null?t.memoizedState:Vt.next)===null&&(t=t.alternate,Re.H=t===null||t.memoizedState===null?XN:wb),e}function Lm(e){if(e!==null&&typeof e=="object"){if(typeof e.then=="function")return hd(e);if(e.$$typeof===Ga)return bn(e)}throw Error(te(438,String(e)))}function mb(e){var t=null,n=Pe.updateQueue;if(n!==null&&(t=n.memoCache),t==null){var r=Pe.alternate;r!==null&&(r=r.updateQueue,r!==null&&(r=r.memoCache,r!=null&&(t={data:r.data.map(function(a){return a.slice()}),index:0})))}if(t==null&&(t={data:[],index:0}),n===null&&(n=Im(),Pe.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]=sD;return t.index++,n}function si(e,t){return typeof t=="function"?t(e):t}function Lf(e){var t=Ht();return pb(t,ot,e)}function pb(e,t,n){var r=e.queue;if(r===null)throw Error(te(311));r.lastRenderedReducer=n;var a=e.baseQueue,i=r.pending;if(i!==null){if(a!==null){var s=a.next;a.next=i.next,i.next=s}t.baseQueue=a=i,r.pending=null}if(i=e.baseState,a===null)e.memoizedState=i;else{t=a.next;var o=s=null,l=null,u=t,d=!1;do{var f=u.lane&-536870913;if(f!==u.lane?(Ze&f)===f:(ii&f)===f){var m=u.revertLane;if(m===0)l!==null&&(l=l.next={lane:0,revertLane:0,gesture:null,action:u.action,hasEagerState:u.hasEagerState,eagerState:u.eagerState,next:null}),f===Fl&&(d=!0);else if((ii&m)===m){u=u.next,m===Fl&&(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?(o=l=f,s=i):l=l.next=f,Pe.lanes|=m,ds|=m;f=u.action,oo&&n(i,f),i=u.hasEagerState?u.eagerState:n(i,f)}else m={lane:f,revertLane:u.revertLane,gesture:u.gesture,action:u.action,hasEagerState:u.hasEagerState,eagerState:u.eagerState,next:null},l===null?(o=l=m,s=i):l=l.next=m,Pe.lanes|=f,ds|=f;u=u.next}while(u!==null&&u!==t);if(l===null?s=i:l.next=o,!vr(i,e.memoizedState)&&(Gt=!0,d&&(n=ml,n!==null)))throw n;e.memoizedState=i,e.baseState=s,e.baseQueue=l,r.lastRenderedState=i}return a===null&&(r.lanes=0),[e.memoizedState,r.dispatch]}function Jp(e){var t=Ht(),n=t.queue;if(n===null)throw Error(te(311));n.lastRenderedReducer=e;var r=n.dispatch,a=n.pending,i=t.memoizedState;if(a!==null){n.pending=null;var s=a=a.next;do i=e(i,s.action),s=s.next;while(s!==a);vr(i,t.memoizedState)||(Gt=!0),t.memoizedState=i,t.baseQueue===null&&(t.baseState=i),n.lastRenderedState=i}return[i,r]}function _N(e,t,n){var r=Pe,a=Ht(),i=Ye;if(i){if(n===void 0)throw Error(te(407));n=n()}else n=t();var s=!vr((ot||a).memoizedState,n);if(s&&(a.memoizedState=n,Gt=!0),a=a.queue,gb(CN.bind(null,r,a,e),[e]),a.getSnapshot!==t||s||Vt!==null&&Vt.memoizedState.tag&1){if(r.flags|=2048,Hl(9,{destroy:void 0},EN.bind(null,r,a,n,t),null),dt===null)throw Error(te(349));i||ii&127||kN(r,t,n)}return n}function kN(e,t,n){e.flags|=16384,e={getSnapshot:t,value:n},t=Pe.updateQueue,t===null?(t=Im(),Pe.updateQueue=t,t.stores=[e]):(n=t.stores,n===null?t.stores=[e]:n.push(e))}function EN(e,t,n,r){t.value=n,t.getSnapshot=r,NN(t)&&jN(e)}function CN(e,t,n){return n(function(){NN(t)&&jN(e)})}function NN(e){var t=e.getSnapshot;e=e.value;try{var n=t();return!vr(e,n)}catch{return!0}}function jN(e){var t=Co(e,2);t!==null&&Jn(t,e,2)}function Uy(e){var t=Mn();if(typeof e=="function"){var n=e;if(e=n(),oo){Vi(!0);try{n()}finally{Vi(!1)}}}return t.memoizedState=t.baseState=e,t.queue={pending:null,lanes:0,dispatch:null,lastRenderedReducer:si,lastRenderedState:e},t}function TN(e,t,n,r){return e.baseState=n,pb(e,ot,typeof r=="function"?r:si)}function S4(e,t,n,r,a){if(Fm(e))throw Error(te(485));if(e=t.action,e!==null){var i={payload:a,action:e,next:null,isTransition:!0,status:"pending",value:null,reason:null,listeners:[],then:function(s){i.listeners.push(s)}};Re.T!==null?n(!0):i.isTransition=!1,r(i),n=t.pending,n===null?(i.next=t.pending=i,AN(t,i)):(i.next=n.next,t.pending=n.next=i)}}function AN(e,t){var n=t.action,r=t.payload,a=e.state;if(t.isTransition){var i=Re.T,s={};Re.T=s;try{var o=n(a,r),l=Re.S;l!==null&&l(s,o),rS(e,t,o)}catch(u){Fy(e,t,u)}finally{i!==null&&s.types!==null&&(i.types=s.types),Re.T=i}}else try{i=n(a,r),rS(e,t,i)}catch(u){Fy(e,t,u)}}function rS(e,t,n){n!==null&&typeof n=="object"&&typeof n.then=="function"?n.then(function(r){aS(e,t,r)},function(r){return Fy(e,t,r)}):aS(e,t,n)}function aS(e,t,n){t.status="fulfilled",t.value=n,RN(t),e.state=n,t=e.pending,t!==null&&(n=t.next,n===t?e.pending=null:(n=n.next,t.next=n,AN(e,n)))}function Fy(e,t,n){var r=e.pending;if(e.pending=null,r!==null){r=r.next;do t.status="rejected",t.reason=n,RN(t),t=t.next;while(t!==r)}e.action=null}function RN(e){e=e.listeners;for(var t=0;t<e.length;t++)(0,e[t])()}function $N(e,t){return t}function iS(e,t){if(Ye){var n=dt.formState;if(n!==null){e:{var r=Pe;if(Ye){if(xt){t:{for(var a=xt,i=Pr;a.nodeType!==8;){if(!i){a=null;break t}if(a=zr(a.nextSibling),a===null){a=null;break t}}i=a.data,a=i==="F!"||i==="F"?a:null}if(a){xt=zr(a.nextSibling),r=a.data==="F!";break e}}cs(r)}r=!1}r&&(t=n[0])}}return n=Mn(),n.memoizedState=n.baseState=t,r={pending:null,lanes:0,dispatch:null,lastRenderedReducer:$N,lastRenderedState:t},n.queue=r,n=GN.bind(null,Pe,r),r.dispatch=n,r=Uy(!1),i=xb.bind(null,Pe,!1,r.queue),r=Mn(),a={state:t,dispatch:null,action:e,pending:null},r.queue=a,n=S4.bind(null,Pe,a,i,n),a.dispatch=n,r.memoizedState=e,[t,n,!1]}function sS(e){var t=Ht();return ON(t,ot,e)}function ON(e,t,n){if(t=pb(e,t,$N)[0],e=Lf(si)[0],typeof t=="object"&&t!==null&&typeof t.then=="function")try{var r=hd(t)}catch(s){throw s===uc?zm:s}else r=t;t=Ht();var a=t.queue,i=a.dispatch;return n!==t.memoizedState&&(Pe.flags|=2048,Hl(9,{destroy:void 0},_4.bind(null,a,n),null)),[r,i,e]}function _4(e,t){e.action=t}function oS(e){var t=Ht(),n=ot;if(n!==null)return ON(t,n,e);Ht(),t=t.memoizedState,n=Ht();var r=n.queue.dispatch;return n.memoizedState=e,[t,r,!1]}function Hl(e,t,n,r){return e={tag:e,create:n,deps:r,inst:t,next:null},t=Pe.updateQueue,t===null&&(t=Im(),Pe.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 MN(){return Ht().memoizedState}function Uf(e,t,n,r){var a=Mn();Pe.flags|=e,a.memoizedState=Hl(1|t,{destroy:void 0},n,r===void 0?null:r)}function Um(e,t,n,r){var a=Ht();r=r===void 0?null:r;var i=a.memoizedState.inst;ot!==null&&r!==null&&cb(r,ot.memoizedState.deps)?a.memoizedState=Hl(t,i,n,r):(Pe.flags|=e,a.memoizedState=Hl(1|t,i,n,r))}function lS(e,t){Uf(8390656,8,e,t)}function gb(e,t){Um(2048,8,e,t)}function k4(e){Pe.flags|=4;var t=Pe.updateQueue;if(t===null)t=Im(),Pe.updateQueue=t,t.events=[e];else{var n=t.events;n===null?t.events=[e]:n.push(e)}}function PN(e){var t=Ht().memoizedState;return k4({ref:t,nextImpl:e}),function(){if(Je&2)throw Error(te(440));return t.impl.apply(void 0,arguments)}}function DN(e,t){return Um(4,2,e,t)}function zN(e,t){return Um(4,4,e,t)}function IN(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 LN(e,t,n){n=n!=null?n.concat([e]):null,Um(4,4,IN.bind(null,t,e),n)}function yb(){}function UN(e,t){var n=Ht();t=t===void 0?null:t;var r=n.memoizedState;return t!==null&&cb(t,r[1])?r[0]:(n.memoizedState=[e,t],e)}function FN(e,t){var n=Ht();t=t===void 0?null:t;var r=n.memoizedState;if(t!==null&&cb(t,r[1]))return r[0];if(r=e(),oo){Vi(!0);try{e()}finally{Vi(!1)}}return n.memoizedState=[r,t],r}function vb(e,t,n){return n===void 0||ii&1073741824&&!(Ze&261930)?e.memoizedState=t:(e.memoizedState=n,e=Tj(),Pe.lanes|=e,ds|=e,n)}function qN(e,t,n,r){return vr(n,t)?n:ql.current!==null?(e=vb(e,n,r),vr(e,t)||(Gt=!0),e):!(ii&42)||ii&1073741824&&!(Ze&261930)?(Gt=!0,e.memoizedState=n):(e=Tj(),Pe.lanes|=e,ds|=e,t)}function HN(e,t,n,r,a){var i=et.p;et.p=i!==0&&8>i?i:8;var s=Re.T,o={};Re.T=o,xb(e,!1,t,n);try{var l=a(),u=Re.S;if(u!==null&&u(o,l),l!==null&&typeof l=="object"&&typeof l.then=="function"){var d=b4(l,r);du(e,t,d,pr(e))}else du(e,t,r,pr(e))}catch(f){du(e,t,{then:function(){},status:"rejected",reason:f},pr())}finally{et.p=i,s!==null&&o.types!==null&&(s.types=o.types),Re.T=s}}function E4(){}function qy(e,t,n,r){if(e.tag!==5)throw Error(te(476));var a=BN(e).queue;HN(e,a,t,Ws,n===null?E4:function(){return VN(e),n(r)})}function BN(e){var t=e.memoizedState;if(t!==null)return t;t={memoizedState:Ws,baseState:Ws,baseQueue:null,queue:{pending:null,lanes:0,dispatch:null,lastRenderedReducer:si,lastRenderedState:Ws},next:null};var n={};return t.next={memoizedState:n,baseState:n,baseQueue:null,queue:{pending:null,lanes:0,dispatch:null,lastRenderedReducer:si,lastRenderedState:n},next:null},e.memoizedState=t,e=e.alternate,e!==null&&(e.memoizedState=t),t}function VN(e){var t=BN(e);t.next===null&&(t=e.alternate.memoizedState),du(e,t.next.queue,{},pr())}function bb(){return bn(qu)}function KN(){return Ht().memoizedState}function ZN(){return Ht().memoizedState}function C4(e){for(var t=e.return;t!==null;){switch(t.tag){case 24:case 3:var n=pr();e=Ji(n);var r=es(t,e,n);r!==null&&(Jn(r,t,n),lu(r,t,n)),t={cache:ab()},e.payload=t;return}t=t.return}}function N4(e,t,n){var r=pr();n={lane:r,revertLane:0,gesture:null,action:n,hasEagerState:!1,eagerState:null,next:null},Fm(e)?QN(t,n):(n=eb(e,t,n,r),n!==null&&(Jn(n,e,r),YN(n,t,r)))}function GN(e,t,n){var r=pr();du(e,t,n,r)}function du(e,t,n,r){var a={lane:r,revertLane:0,gesture:null,action:n,hasEagerState:!1,eagerState:null,next:null};if(Fm(e))QN(t,a);else{var i=e.alternate;if(e.lanes===0&&(i===null||i.lanes===0)&&(i=t.lastRenderedReducer,i!==null))try{var s=t.lastRenderedState,o=i(s,n);if(a.hasEagerState=!0,a.eagerState=o,vr(o,s))return Dm(e,t,a,0),dt===null&&Pm(),!1}catch{}finally{}if(n=eb(e,t,a,r),n!==null)return Jn(n,e,r),YN(n,t,r),!0}return!1}function xb(e,t,n,r){if(r={lane:2,revertLane:Tb(),gesture:null,action:r,hasEagerState:!1,eagerState:null,next:null},Fm(e)){if(t)throw Error(te(479))}else t=eb(e,n,r,2),t!==null&&Jn(t,e,2)}function Fm(e){var t=e.alternate;return e===Pe||t!==null&&t===Pe}function QN(e,t){gl=Ch=!0;var n=e.pending;n===null?t.next=t:(t.next=n.next,n.next=t),e.pending=t}function YN(e,t,n){if(n&4194048){var r=t.lanes;r&=e.pendingLanes,n|=r,t.lanes=n,PC(e,n)}}var Lu={readContext:bn,use:Lm,useCallback:zt,useContext:zt,useEffect:zt,useImperativeHandle:zt,useLayoutEffect:zt,useInsertionEffect:zt,useMemo:zt,useReducer:zt,useRef:zt,useState:zt,useDebugValue:zt,useDeferredValue:zt,useTransition:zt,useSyncExternalStore:zt,useId:zt,useHostTransitionStatus:zt,useFormState:zt,useActionState:zt,useOptimistic:zt,useMemoCache:zt,useCacheRefresh:zt};Lu.useEffectEvent=zt;var XN={readContext:bn,use:Lm,useCallback:function(e,t){return Mn().memoizedState=[e,t===void 0?null:t],e},useContext:bn,useEffect:lS,useImperativeHandle:function(e,t,n){n=n!=null?n.concat([e]):null,Uf(4194308,4,IN.bind(null,t,e),n)},useLayoutEffect:function(e,t){return Uf(4194308,4,e,t)},useInsertionEffect:function(e,t){Uf(4,2,e,t)},useMemo:function(e,t){var n=Mn();t=t===void 0?null:t;var r=e();if(oo){Vi(!0);try{e()}finally{Vi(!1)}}return n.memoizedState=[r,t],r},useReducer:function(e,t,n){var r=Mn();if(n!==void 0){var a=n(t);if(oo){Vi(!0);try{n(t)}finally{Vi(!1)}}}else a=t;return r.memoizedState=r.baseState=a,e={pending:null,lanes:0,dispatch:null,lastRenderedReducer:e,lastRenderedState:a},r.queue=e,e=e.dispatch=N4.bind(null,Pe,e),[r.memoizedState,e]},useRef:function(e){var t=Mn();return e={current:e},t.memoizedState=e},useState:function(e){e=Uy(e);var t=e.queue,n=GN.bind(null,Pe,t);return t.dispatch=n,[e.memoizedState,n]},useDebugValue:yb,useDeferredValue:function(e,t){var n=Mn();return vb(n,e,t)},useTransition:function(){var e=Uy(!1);return e=HN.bind(null,Pe,e.queue,!0,!1),Mn().memoizedState=e,[!1,e]},useSyncExternalStore:function(e,t,n){var r=Pe,a=Mn();if(Ye){if(n===void 0)throw Error(te(407));n=n()}else{if(n=t(),dt===null)throw Error(te(349));Ze&127||kN(r,t,n)}a.memoizedState=n;var i={value:n,getSnapshot:t};return a.queue=i,lS(CN.bind(null,r,i,e),[e]),r.flags|=2048,Hl(9,{destroy:void 0},EN.bind(null,r,i,n,t),null),n},useId:function(){var e=Mn(),t=dt.identifierPrefix;if(Ye){var n=ya,r=ga;n=(r&~(1<<32-mr(r)-1)).toString(32)+n,t="_"+t+"R_"+n,n=Nh++,0<n&&(t+="H"+n.toString(32)),t+="_"}else n=x4++,t="_"+t+"r_"+n.toString(32)+"_";return e.memoizedState=t},useHostTransitionStatus:bb,useFormState:iS,useActionState:iS,useOptimistic:function(e){var t=Mn();t.memoizedState=t.baseState=e;var n={pending:null,lanes:0,dispatch:null,lastRenderedReducer:null,lastRenderedState:null};return t.queue=n,t=xb.bind(null,Pe,!0,n),n.dispatch=t,[e,t]},useMemoCache:mb,useCacheRefresh:function(){return Mn().memoizedState=C4.bind(null,Pe)},useEffectEvent:function(e){var t=Mn(),n={impl:e};return t.memoizedState=n,function(){if(Je&2)throw Error(te(440));return n.impl.apply(void 0,arguments)}}},wb={readContext:bn,use:Lm,useCallback:UN,useContext:bn,useEffect:gb,useImperativeHandle:LN,useInsertionEffect:DN,useLayoutEffect:zN,useMemo:FN,useReducer:Lf,useRef:MN,useState:function(){return Lf(si)},useDebugValue:yb,useDeferredValue:function(e,t){var n=Ht();return qN(n,ot.memoizedState,e,t)},useTransition:function(){var e=Lf(si)[0],t=Ht().memoizedState;return[typeof e=="boolean"?e:hd(e),t]},useSyncExternalStore:_N,useId:KN,useHostTransitionStatus:bb,useFormState:sS,useActionState:sS,useOptimistic:function(e,t){var n=Ht();return TN(n,ot,e,t)},useMemoCache:mb,useCacheRefresh:ZN};wb.useEffectEvent=PN;var WN={readContext:bn,use:Lm,useCallback:UN,useContext:bn,useEffect:gb,useImperativeHandle:LN,useInsertionEffect:DN,useLayoutEffect:zN,useMemo:FN,useReducer:Jp,useRef:MN,useState:function(){return Jp(si)},useDebugValue:yb,useDeferredValue:function(e,t){var n=Ht();return ot===null?vb(n,e,t):qN(n,ot.memoizedState,e,t)},useTransition:function(){var e=Jp(si)[0],t=Ht().memoizedState;return[typeof e=="boolean"?e:hd(e),t]},useSyncExternalStore:_N,useId:KN,useHostTransitionStatus:bb,useFormState:oS,useActionState:oS,useOptimistic:function(e,t){var n=Ht();return ot!==null?TN(n,ot,e,t):(n.baseState=e,[e,n.queue.dispatch])},useMemoCache:mb,useCacheRefresh:ZN};WN.useEffectEvent=PN;function eg(e,t,n,r){t=e.memoizedState,n=n(r,t),n=n==null?t:jt({},t,n),e.memoizedState=n,e.lanes===0&&(e.updateQueue.baseState=n)}var Hy={enqueueSetState:function(e,t,n){e=e._reactInternals;var r=pr(),a=Ji(r);a.payload=t,n!=null&&(a.callback=n),t=es(e,a,r),t!==null&&(Jn(t,e,r),lu(t,e,r))},enqueueReplaceState:function(e,t,n){e=e._reactInternals;var r=pr(),a=Ji(r);a.tag=1,a.payload=t,n!=null&&(a.callback=n),t=es(e,a,r),t!==null&&(Jn(t,e,r),lu(t,e,r))},enqueueForceUpdate:function(e,t){e=e._reactInternals;var n=pr(),r=Ji(n);r.tag=2,t!=null&&(r.callback=t),t=es(e,r,n),t!==null&&(Jn(t,e,n),lu(t,e,n))}};function cS(e,t,n,r,a,i,s){return e=e.stateNode,typeof e.shouldComponentUpdate=="function"?e.shouldComponentUpdate(r,i,s):t.prototype&&t.prototype.isPureReactComponent?!Mu(n,r)||!Mu(a,i):!0}function uS(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&&Hy.enqueueReplaceState(t,t.state,null)}function lo(e,t){var n=t;if("ref"in t){n={};for(var r in t)r!=="ref"&&(n[r]=t[r])}if(e=e.defaultProps){n===t&&(n=jt({},n));for(var a in e)n[a]===void 0&&(n[a]=e[a])}return n}function JN(e){bh(e)}function ej(e){console.error(e)}function tj(e){bh(e)}function jh(e,t){try{var n=e.onUncaughtError;n(t.value,{componentStack:t.stack})}catch(r){setTimeout(function(){throw r})}}function dS(e,t,n){try{var r=e.onCaughtError;r(n.value,{componentStack:n.stack,errorBoundary:t.tag===1?t.stateNode:null})}catch(a){setTimeout(function(){throw a})}}function By(e,t,n){return n=Ji(n),n.tag=3,n.payload={element:null},n.callback=function(){jh(e,t)},n}function nj(e){return e=Ji(e),e.tag=3,e}function rj(e,t,n,r){var a=n.type.getDerivedStateFromError;if(typeof a=="function"){var i=r.value;e.payload=function(){return a(i)},e.callback=function(){dS(t,n,r)}}var s=n.stateNode;s!==null&&typeof s.componentDidCatch=="function"&&(e.callback=function(){dS(t,n,r),typeof a!="function"&&(ts===null?ts=new Set([this]):ts.add(this));var o=r.stack;this.componentDidCatch(r.value,{componentStack:o!==null?o:""})})}function j4(e,t,n,r,a){if(n.flags|=32768,r!==null&&typeof r=="object"&&typeof r.then=="function"){if(t=n.alternate,t!==null&&cc(t,n,a,!0),n=br.current,n!==null){switch(n.tag){case 31:case 13:return Dr===null?Oh():n.alternate===null&&Lt===0&&(Lt=3),n.flags&=-257,n.flags|=65536,n.lanes=a,r===_h?n.flags|=16384:(t=n.updateQueue,t===null?n.updateQueue=new Set([r]):t.add(r),dg(e,r,a)),!1;case 22:return n.flags|=65536,r===_h?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)),dg(e,r,a)),!1}throw Error(te(435,n.tag))}return dg(e,r,a),Oh(),!1}if(Ye)return t=br.current,t!==null?(!(t.flags&65536)&&(t.flags|=256),t.flags|=65536,t.lanes=a,r!==Ry&&(e=Error(te(422),{cause:r}),Du(Mr(e,n)))):(r!==Ry&&(t=Error(te(423),{cause:r}),Du(Mr(t,n))),e=e.current.alternate,e.flags|=65536,a&=-a,e.lanes|=a,r=Mr(r,n),a=By(e.stateNode,r,a),Wp(e,a),Lt!==4&&(Lt=2)),!1;var i=Error(te(520),{cause:r});if(i=Mr(i,n),mu===null?mu=[i]:mu.push(i),Lt!==4&&(Lt=2),t===null)return!0;r=Mr(r,n),n=t;do{switch(n.tag){case 3:return n.flags|=65536,e=a&-a,n.lanes|=e,e=By(n.stateNode,r,e),Wp(n,e),!1;case 1:if(t=n.type,i=n.stateNode,(n.flags&128)===0&&(typeof t.getDerivedStateFromError=="function"||i!==null&&typeof i.componentDidCatch=="function"&&(ts===null||!ts.has(i))))return n.flags|=65536,a&=-a,n.lanes|=a,a=nj(a),rj(a,e,n,r),Wp(n,a),!1}n=n.return}while(n!==null);return!1}var Sb=Error(te(461)),Gt=!1;function hn(e,t,n,r){t.child=e===null?yN(t,null,n,r):so(t,e.child,n,r)}function fS(e,t,n,r,a){n=n.render;var i=t.ref;if("ref"in r){var s={};for(var o in r)o!=="ref"&&(s[o]=r[o])}else s=r;return io(t),r=ub(e,t,n,s,i,a),o=db(),e!==null&&!Gt?(fb(e,t,a),oi(e,t,a)):(Ye&&o&&nb(t),t.flags|=1,hn(e,t,r,a),t.child)}function hS(e,t,n,r,a){if(e===null){var i=n.type;return typeof i=="function"&&!tb(i)&&i.defaultProps===void 0&&n.compare===null?(t.tag=15,t.type=i,aj(e,t,i,r,a)):(e=zf(n.type,null,r,t,t.mode,a),e.ref=t.ref,e.return=t,t.child=e)}if(i=e.child,!_b(e,a)){var s=i.memoizedProps;if(n=n.compare,n=n!==null?n:Mu,n(s,r)&&e.ref===t.ref)return oi(e,t,a)}return t.flags|=1,e=Wa(i,r),e.ref=t.ref,e.return=t,t.child=e}function aj(e,t,n,r,a){if(e!==null){var i=e.memoizedProps;if(Mu(i,r)&&e.ref===t.ref)if(Gt=!1,t.pendingProps=r=i,_b(e,a))e.flags&131072&&(Gt=!0);else return t.lanes=e.lanes,oi(e,t,a)}return Vy(e,t,n,r,a)}function ij(e,t,n,r){var a=r.children,i=e!==null?e.memoizedState:null;if(e===null&&t.stateNode===null&&(t.stateNode={_visibility:1,_pendingMarkers:null,_retryCache:null,_transitions:null}),r.mode==="hidden"){if(t.flags&128){if(i=i!==null?i.baseLanes|n:n,e!==null){for(r=t.child=e.child,a=0;r!==null;)a=a|r.lanes|r.childLanes,r=r.sibling;r=a&~i}else r=0,t.child=null;return mS(e,t,i,n,r)}if(n&536870912)t.memoizedState={baseLanes:0,cachePool:null},e!==null&&If(t,i!==null?i.cachePool:null),i!==null?nS(t,i):Iy(),xN(t);else return r=t.lanes=536870912,mS(e,t,i!==null?i.baseLanes|n:n,n,r)}else i!==null?(If(t,i.cachePool),nS(t,i),Oi(),t.memoizedState=null):(e!==null&&If(t,null),Iy(),Oi());return hn(e,t,a,n),t.child}function Gc(e,t){return e!==null&&e.tag===22||t.stateNode!==null||(t.stateNode={_visibility:1,_pendingMarkers:null,_retryCache:null,_transitions:null}),t.sibling}function mS(e,t,n,r,a){var i=ib();return i=i===null?null:{parent:Zt._currentValue,pool:i},t.memoizedState={baseLanes:n,cachePool:i},e!==null&&If(t,null),Iy(),xN(t),e!==null&&cc(e,t,r,!0),t.childLanes=a,null}function Ff(e,t){return t=Th({mode:t.mode,children:t.children},e.mode),t.ref=e.ref,e.child=t,t.return=e,t}function pS(e,t,n){return so(t,e.child,null,n),e=Ff(t,t.pendingProps),e.flags|=2,or(t),t.memoizedState=null,e}function T4(e,t,n){var r=t.pendingProps,a=(t.flags&128)!==0;if(t.flags&=-129,e===null){if(Ye){if(r.mode==="hidden")return e=Ff(t,r),t.lanes=536870912,Gc(null,e);if(Ly(t),(e=xt)?(e=Xj(e,Pr),e=e!==null&&e.data==="&"?e:null,e!==null&&(t.memoizedState={dehydrated:e,treeContext:ls!==null?{id:ga,overflow:ya}:null,retryLane:536870912,hydrationErrors:null},n=uN(e),n.return=t,t.child=n,vn=t,xt=null)):e=null,e===null)throw cs(t);return t.lanes=536870912,null}return Ff(t,r)}var i=e.memoizedState;if(i!==null){var s=i.dehydrated;if(Ly(t),a)if(t.flags&256)t.flags&=-257,t=pS(e,t,n);else if(t.memoizedState!==null)t.child=e.child,t.flags|=128,t=null;else throw Error(te(558));else if(Gt||cc(e,t,n,!1),a=(n&e.childLanes)!==0,Gt||a){if(r=dt,r!==null&&(s=DC(r,n),s!==0&&s!==i.retryLane))throw i.retryLane=s,Co(e,s),Jn(r,e,s),Sb;Oh(),t=pS(e,t,n)}else e=i.treeContext,xt=zr(s.nextSibling),vn=t,Ye=!0,Wi=null,Pr=!1,e!==null&&fN(t,e),t=Ff(t,r),t.flags|=4096;return t}return e=Wa(e.child,{mode:r.mode,children:r.children}),e.ref=t.ref,t.child=e,e.return=t,e}function qf(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(te(284));(e===null||e.ref!==n)&&(t.flags|=4194816)}}function Vy(e,t,n,r,a){return io(t),n=ub(e,t,n,r,void 0,a),r=db(),e!==null&&!Gt?(fb(e,t,a),oi(e,t,a)):(Ye&&r&&nb(t),t.flags|=1,hn(e,t,n,a),t.child)}function gS(e,t,n,r,a,i){return io(t),t.updateQueue=null,n=SN(t,r,n,a),wN(e),r=db(),e!==null&&!Gt?(fb(e,t,i),oi(e,t,i)):(Ye&&r&&nb(t),t.flags|=1,hn(e,t,n,i),t.child)}function yS(e,t,n,r,a){if(io(t),t.stateNode===null){var i=rl,s=n.contextType;typeof s=="object"&&s!==null&&(i=bn(s)),i=new n(r,i),t.memoizedState=i.state!==null&&i.state!==void 0?i.state:null,i.updater=Hy,t.stateNode=i,i._reactInternals=t,i=t.stateNode,i.props=r,i.state=t.memoizedState,i.refs={},ob(t),s=n.contextType,i.context=typeof s=="object"&&s!==null?bn(s):rl,i.state=t.memoizedState,s=n.getDerivedStateFromProps,typeof s=="function"&&(eg(t,n,s,r),i.state=t.memoizedState),typeof n.getDerivedStateFromProps=="function"||typeof i.getSnapshotBeforeUpdate=="function"||typeof i.UNSAFE_componentWillMount!="function"&&typeof i.componentWillMount!="function"||(s=i.state,typeof i.componentWillMount=="function"&&i.componentWillMount(),typeof i.UNSAFE_componentWillMount=="function"&&i.UNSAFE_componentWillMount(),s!==i.state&&Hy.enqueueReplaceState(i,i.state,null),uu(t,r,i,a),cu(),i.state=t.memoizedState),typeof i.componentDidMount=="function"&&(t.flags|=4194308),r=!0}else if(e===null){i=t.stateNode;var o=t.memoizedProps,l=lo(n,o);i.props=l;var u=i.context,d=n.contextType;s=rl,typeof d=="object"&&d!==null&&(s=bn(d));var f=n.getDerivedStateFromProps;d=typeof f=="function"||typeof i.getSnapshotBeforeUpdate=="function",o=t.pendingProps!==o,d||typeof i.UNSAFE_componentWillReceiveProps!="function"&&typeof i.componentWillReceiveProps!="function"||(o||u!==s)&&uS(t,i,r,s),Ni=!1;var m=t.memoizedState;i.state=m,uu(t,r,i,a),cu(),u=t.memoizedState,o||m!==u||Ni?(typeof f=="function"&&(eg(t,n,f,r),u=t.memoizedState),(l=Ni||cS(t,n,l,r,m,u,s))?(d||typeof i.UNSAFE_componentWillMount!="function"&&typeof i.componentWillMount!="function"||(typeof i.componentWillMount=="function"&&i.componentWillMount(),typeof i.UNSAFE_componentWillMount=="function"&&i.UNSAFE_componentWillMount()),typeof i.componentDidMount=="function"&&(t.flags|=4194308)):(typeof i.componentDidMount=="function"&&(t.flags|=4194308),t.memoizedProps=r,t.memoizedState=u),i.props=r,i.state=u,i.context=s,r=l):(typeof i.componentDidMount=="function"&&(t.flags|=4194308),r=!1)}else{i=t.stateNode,Dy(e,t),s=t.memoizedProps,d=lo(n,s),i.props=d,f=t.pendingProps,m=i.context,u=n.contextType,l=rl,typeof u=="object"&&u!==null&&(l=bn(u)),o=n.getDerivedStateFromProps,(u=typeof o=="function"||typeof i.getSnapshotBeforeUpdate=="function")||typeof i.UNSAFE_componentWillReceiveProps!="function"&&typeof i.componentWillReceiveProps!="function"||(s!==f||m!==l)&&uS(t,i,r,l),Ni=!1,m=t.memoizedState,i.state=m,uu(t,r,i,a),cu();var h=t.memoizedState;s!==f||m!==h||Ni||e!==null&&e.dependencies!==null&&Sh(e.dependencies)?(typeof o=="function"&&(eg(t,n,o,r),h=t.memoizedState),(d=Ni||cS(t,n,d,r,m,h,l)||e!==null&&e.dependencies!==null&&Sh(e.dependencies))?(u||typeof i.UNSAFE_componentWillUpdate!="function"&&typeof i.componentWillUpdate!="function"||(typeof i.componentWillUpdate=="function"&&i.componentWillUpdate(r,h,l),typeof i.UNSAFE_componentWillUpdate=="function"&&i.UNSAFE_componentWillUpdate(r,h,l)),typeof i.componentDidUpdate=="function"&&(t.flags|=4),typeof i.getSnapshotBeforeUpdate=="function"&&(t.flags|=1024)):(typeof i.componentDidUpdate!="function"||s===e.memoizedProps&&m===e.memoizedState||(t.flags|=4),typeof i.getSnapshotBeforeUpdate!="function"||s===e.memoizedProps&&m===e.memoizedState||(t.flags|=1024),t.memoizedProps=r,t.memoizedState=h),i.props=r,i.state=h,i.context=l,r=d):(typeof i.componentDidUpdate!="function"||s===e.memoizedProps&&m===e.memoizedState||(t.flags|=4),typeof i.getSnapshotBeforeUpdate!="function"||s===e.memoizedProps&&m===e.memoizedState||(t.flags|=1024),r=!1)}return i=r,qf(e,t),r=(t.flags&128)!==0,i||r?(i=t.stateNode,n=r&&typeof n.getDerivedStateFromError!="function"?null:i.render(),t.flags|=1,e!==null&&r?(t.child=so(t,e.child,null,a),t.child=so(t,null,n,a)):hn(e,t,n,a),t.memoizedState=i.state,e=t.child):e=oi(e,t,a),e}function vS(e,t,n,r){return ao(),t.flags|=256,hn(e,t,n,r),t.child}var tg={dehydrated:null,treeContext:null,retryLane:0,hydrationErrors:null};function ng(e){return{baseLanes:e,cachePool:mN()}}function rg(e,t,n){return e=e!==null?e.childLanes&~n:0,t&&(e|=dr),e}function sj(e,t,n){var r=t.pendingProps,a=!1,i=(t.flags&128)!==0,s;if((s=i)||(s=e!==null&&e.memoizedState===null?!1:(qt.current&2)!==0),s&&(a=!0,t.flags&=-129),s=(t.flags&32)!==0,t.flags&=-33,e===null){if(Ye){if(a?$i(t):Oi(),(e=xt)?(e=Xj(e,Pr),e=e!==null&&e.data!=="&"?e:null,e!==null&&(t.memoizedState={dehydrated:e,treeContext:ls!==null?{id:ga,overflow:ya}:null,retryLane:536870912,hydrationErrors:null},n=uN(e),n.return=t,t.child=n,vn=t,xt=null)):e=null,e===null)throw cs(t);return iv(e)?t.lanes=32:t.lanes=536870912,null}var o=r.children;return r=r.fallback,a?(Oi(),a=t.mode,o=Th({mode:"hidden",children:o},a),r=Js(r,a,n,null),o.return=t,r.return=t,o.sibling=r,t.child=o,r=t.child,r.memoizedState=ng(n),r.childLanes=rg(e,s,n),t.memoizedState=tg,Gc(null,r)):($i(t),Ky(t,o))}var l=e.memoizedState;if(l!==null&&(o=l.dehydrated,o!==null)){if(i)t.flags&256?($i(t),t.flags&=-257,t=ag(e,t,n)):t.memoizedState!==null?(Oi(),t.child=e.child,t.flags|=128,t=null):(Oi(),o=r.fallback,a=t.mode,r=Th({mode:"visible",children:r.children},a),o=Js(o,a,n,null),o.flags|=2,r.return=t,o.return=t,r.sibling=o,t.child=r,so(t,e.child,null,n),r=t.child,r.memoizedState=ng(n),r.childLanes=rg(e,s,n),t.memoizedState=tg,t=Gc(null,r));else if($i(t),iv(o)){if(s=o.nextSibling&&o.nextSibling.dataset,s)var u=s.dgst;s=u,r=Error(te(419)),r.stack="",r.digest=s,Du({value:r,source:null,stack:null}),t=ag(e,t,n)}else if(Gt||cc(e,t,n,!1),s=(n&e.childLanes)!==0,Gt||s){if(s=dt,s!==null&&(r=DC(s,n),r!==0&&r!==l.retryLane))throw l.retryLane=r,Co(e,r),Jn(s,e,r),Sb;av(o)||Oh(),t=ag(e,t,n)}else av(o)?(t.flags|=192,t.child=e.child,t=null):(e=l.treeContext,xt=zr(o.nextSibling),vn=t,Ye=!0,Wi=null,Pr=!1,e!==null&&fN(t,e),t=Ky(t,r.children),t.flags|=4096);return t}return a?(Oi(),o=r.fallback,a=t.mode,l=e.child,u=l.sibling,r=Wa(l,{mode:"hidden",children:r.children}),r.subtreeFlags=l.subtreeFlags&65011712,u!==null?o=Wa(u,o):(o=Js(o,a,n,null),o.flags|=2),o.return=t,r.return=t,r.sibling=o,t.child=r,Gc(null,r),r=t.child,o=e.child.memoizedState,o===null?o=ng(n):(a=o.cachePool,a!==null?(l=Zt._currentValue,a=a.parent!==l?{parent:l,pool:l}:a):a=mN(),o={baseLanes:o.baseLanes|n,cachePool:a}),r.memoizedState=o,r.childLanes=rg(e,s,n),t.memoizedState=tg,Gc(e.child,r)):($i(t),n=e.child,e=n.sibling,n=Wa(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 Ky(e,t){return t=Th({mode:"visible",children:t},e.mode),t.return=e,e.child=t}function Th(e,t){return e=ur(22,e,null,t),e.lanes=0,e}function ag(e,t,n){return so(t,e.child,null,n),e=Ky(t,t.pendingProps.children),e.flags|=2,t.memoizedState=null,e}function bS(e,t,n){e.lanes|=t;var r=e.alternate;r!==null&&(r.lanes|=t),Oy(e.return,t,n)}function ig(e,t,n,r,a,i){var s=e.memoizedState;s===null?e.memoizedState={isBackwards:t,rendering:null,renderingStartTime:0,last:r,tail:n,tailMode:a,treeForkCount:i}:(s.isBackwards=t,s.rendering=null,s.renderingStartTime=0,s.last=r,s.tail=n,s.tailMode=a,s.treeForkCount=i)}function oj(e,t,n){var r=t.pendingProps,a=r.revealOrder,i=r.tail;r=r.children;var s=qt.current,o=(s&2)!==0;if(o?(s=s&1|2,t.flags|=128):s&=1,mt(qt,s),hn(e,t,r,n),r=Ye?Pu:0,!o&&e!==null&&e.flags&128)e:for(e=t.child;e!==null;){if(e.tag===13)e.memoizedState!==null&&bS(e,n,t);else if(e.tag===19)bS(e,n,t);else if(e.child!==null){e.child.return=e,e=e.child;continue}if(e===t)break e;for(;e.sibling===null;){if(e.return===null||e.return===t)break e;e=e.return}e.sibling.return=e.return,e=e.sibling}switch(a){case"forwards":for(n=t.child,a=null;n!==null;)e=n.alternate,e!==null&&Eh(e)===null&&(a=n),n=n.sibling;n=a,n===null?(a=t.child,t.child=null):(a=n.sibling,n.sibling=null),ig(t,!1,a,n,i,r);break;case"backwards":case"unstable_legacy-backwards":for(n=null,a=t.child,t.child=null;a!==null;){if(e=a.alternate,e!==null&&Eh(e)===null){t.child=a;break}e=a.sibling,a.sibling=n,n=a,a=e}ig(t,!0,n,null,i,r);break;case"together":ig(t,!1,null,null,void 0,r);break;default:t.memoizedState=null}return t.child}function oi(e,t,n){if(e!==null&&(t.dependencies=e.dependencies),ds|=t.lanes,!(n&t.childLanes))if(e!==null){if(cc(e,t,n,!1),(n&t.childLanes)===0)return null}else return null;if(e!==null&&t.child!==e.child)throw Error(te(153));if(t.child!==null){for(e=t.child,n=Wa(e,e.pendingProps),t.child=n,n.return=t;e.sibling!==null;)e=e.sibling,n=n.sibling=Wa(e,e.pendingProps),n.return=t;n.sibling=null}return t.child}function _b(e,t){return e.lanes&t?!0:(e=e.dependencies,!!(e!==null&&Sh(e)))}function A4(e,t,n){switch(t.tag){case 3:ph(t,t.stateNode.containerInfo),Ri(t,Zt,e.memoizedState.cache),ao();break;case 27:case 5:xy(t);break;case 4:ph(t,t.stateNode.containerInfo);break;case 10:Ri(t,t.type,t.memoizedProps.value);break;case 31:if(t.memoizedState!==null)return t.flags|=128,Ly(t),null;break;case 13:var r=t.memoizedState;if(r!==null)return r.dehydrated!==null?($i(t),t.flags|=128,null):n&t.child.childLanes?sj(e,t,n):($i(t),e=oi(e,t,n),e!==null?e.sibling:null);$i(t);break;case 19:var a=(e.flags&128)!==0;if(r=(n&t.childLanes)!==0,r||(cc(e,t,n,!1),r=(n&t.childLanes)!==0),a){if(r)return oj(e,t,n);t.flags|=128}if(a=t.memoizedState,a!==null&&(a.rendering=null,a.tail=null,a.lastEffect=null),mt(qt,qt.current),r)break;return null;case 22:return t.lanes=0,ij(e,t,n,t.pendingProps);case 24:Ri(t,Zt,e.memoizedState.cache)}return oi(e,t,n)}function lj(e,t,n){if(e!==null)if(e.memoizedProps!==t.pendingProps)Gt=!0;else{if(!_b(e,n)&&!(t.flags&128))return Gt=!1,A4(e,t,n);Gt=!!(e.flags&131072)}else Gt=!1,Ye&&t.flags&1048576&&dN(t,Pu,t.index);switch(t.lanes=0,t.tag){case 16:e:{var r=t.pendingProps;if(e=Os(t.elementType),t.type=e,typeof e=="function")tb(e)?(r=lo(e,r),t.tag=1,t=yS(null,t,e,r,n)):(t.tag=0,t=Vy(null,t,e,r,n));else{if(e!=null){var a=e.$$typeof;if(a===F0){t.tag=11,t=fS(null,t,e,r,n);break e}else if(a===q0){t.tag=14,t=hS(null,t,e,r,n);break e}}throw t=vy(e)||e,Error(te(306,t,""))}}return t;case 0:return Vy(e,t,t.type,t.pendingProps,n);case 1:return r=t.type,a=lo(r,t.pendingProps),yS(e,t,r,a,n);case 3:e:{if(ph(t,t.stateNode.containerInfo),e===null)throw Error(te(387));r=t.pendingProps;var i=t.memoizedState;a=i.element,Dy(e,t),uu(t,r,null,n);var s=t.memoizedState;if(r=s.cache,Ri(t,Zt,r),r!==i.cache&&My(t,[Zt],n,!0),cu(),r=s.element,i.isDehydrated)if(i={element:r,isDehydrated:!1,cache:s.cache},t.updateQueue.baseState=i,t.memoizedState=i,t.flags&256){t=vS(e,t,r,n);break e}else if(r!==a){a=Mr(Error(te(424)),t),Du(a),t=vS(e,t,r,n);break e}else{switch(e=t.stateNode.containerInfo,e.nodeType){case 9:e=e.body;break;default:e=e.nodeName==="HTML"?e.ownerDocument.body:e}for(xt=zr(e.firstChild),vn=t,Ye=!0,Wi=null,Pr=!0,n=yN(t,null,r,n),t.child=n;n;)n.flags=n.flags&-3|4096,n=n.sibling}else{if(ao(),r===a){t=oi(e,t,n);break e}hn(e,t,r,n)}t=t.child}return t;case 26:return qf(e,t),e===null?(n=LS(t.type,null,t.pendingProps,null))?t.memoizedState=n:Ye||(n=t.type,e=t.pendingProps,r=zh(Xi.current).createElement(n),r[yn]=t,r[er]=e,wn(r,n,e),on(r),t.stateNode=r):t.memoizedState=LS(t.type,e.memoizedProps,t.pendingProps,e.memoizedState),null;case 27:return xy(t),e===null&&Ye&&(r=t.stateNode=Wj(t.type,t.pendingProps,Xi.current),vn=t,Pr=!0,a=xt,ys(t.type)?(sv=a,xt=zr(r.firstChild)):xt=a),hn(e,t,t.pendingProps.children,n),qf(e,t),e===null&&(t.flags|=4194304),t.child;case 5:return e===null&&Ye&&((a=r=xt)&&(r=sz(r,t.type,t.pendingProps,Pr),r!==null?(t.stateNode=r,vn=t,xt=zr(r.firstChild),Pr=!1,a=!0):a=!1),a||cs(t)),xy(t),a=t.type,i=t.pendingProps,s=e!==null?e.memoizedProps:null,r=i.children,nv(a,i)?r=null:s!==null&&nv(a,s)&&(t.flags|=32),t.memoizedState!==null&&(a=ub(e,t,w4,null,null,n),qu._currentValue=a),qf(e,t),hn(e,t,r,n),t.child;case 6:return e===null&&Ye&&((e=n=xt)&&(n=oz(n,t.pendingProps,Pr),n!==null?(t.stateNode=n,vn=t,xt=null,e=!0):e=!1),e||cs(t)),null;case 13:return sj(e,t,n);case 4:return ph(t,t.stateNode.containerInfo),r=t.pendingProps,e===null?t.child=so(t,null,r,n):hn(e,t,r,n),t.child;case 11:return fS(e,t,t.type,t.pendingProps,n);case 7:return hn(e,t,t.pendingProps,n),t.child;case 8:return hn(e,t,t.pendingProps.children,n),t.child;case 12:return hn(e,t,t.pendingProps.children,n),t.child;case 10:return r=t.pendingProps,Ri(t,t.type,r.value),hn(e,t,r.children,n),t.child;case 9:return a=t.type._context,r=t.pendingProps.children,io(t),a=bn(a),r=r(a),t.flags|=1,hn(e,t,r,n),t.child;case 14:return hS(e,t,t.type,t.pendingProps,n);case 15:return aj(e,t,t.type,t.pendingProps,n);case 19:return oj(e,t,n);case 31:return T4(e,t,n);case 22:return ij(e,t,n,t.pendingProps);case 24:return io(t),r=bn(Zt),e===null?(a=ib(),a===null&&(a=dt,i=ab(),a.pooledCache=i,i.refCount++,i!==null&&(a.pooledCacheLanes|=n),a=i),t.memoizedState={parent:r,cache:a},ob(t),Ri(t,Zt,a)):(e.lanes&n&&(Dy(e,t),uu(t,null,null,n),cu()),a=e.memoizedState,i=t.memoizedState,a.parent!==r?(a={parent:r,cache:r},t.memoizedState=a,t.lanes===0&&(t.memoizedState=t.updateQueue.baseState=a),Ri(t,Zt,r)):(r=i.cache,Ri(t,Zt,r),r!==a.cache&&My(t,[Zt],n,!0))),hn(e,t,t.pendingProps.children,n),t.child;case 29:throw t.pendingProps}throw Error(te(156,t.tag))}function Ra(e){e.flags|=4}function sg(e,t,n,r,a){if((t=(e.mode&32)!==0)&&(t=!1),t){if(e.flags|=16777216,(a&335544128)===a)if(e.stateNode.complete)e.flags|=8192;else if($j())e.flags|=8192;else throw to=_h,sb}else e.flags&=-16777217}function xS(e,t){if(t.type!=="stylesheet"||t.state.loading&4)e.flags&=-16777217;else if(e.flags|=16777216,!t2(t))if($j())e.flags|=8192;else throw to=_h,sb}function Wd(e,t){t!==null&&(e.flags|=4),e.flags&16384&&(t=e.tag!==22?OC():536870912,e.lanes|=t,Bl|=t)}function $c(e,t){if(!Ye)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 vt(e){var t=e.alternate!==null&&e.alternate.child===e.child,n=0,r=0;if(t)for(var a=e.child;a!==null;)n|=a.lanes|a.childLanes,r|=a.subtreeFlags&65011712,r|=a.flags&65011712,a.return=e,a=a.sibling;else for(a=e.child;a!==null;)n|=a.lanes|a.childLanes,r|=a.subtreeFlags,r|=a.flags,a.return=e,a=a.sibling;return e.subtreeFlags|=r,e.childLanes=n,t}function R4(e,t,n){var r=t.pendingProps;switch(rb(t),t.tag){case 16:case 15:case 0:case 11:case 7:case 8:case 12:case 9:case 14:return vt(t),null;case 1:return vt(t),null;case 3:return n=t.stateNode,r=null,e!==null&&(r=e.memoizedState.cache),t.memoizedState.cache!==r&&(t.flags|=2048),Ja(Zt),Il(),n.pendingContext&&(n.context=n.pendingContext,n.pendingContext=null),(e===null||e.child===null)&&(Ro(t)?Ra(t):e===null||e.memoizedState.isDehydrated&&!(t.flags&256)||(t.flags|=1024,Xp())),vt(t),null;case 26:var a=t.type,i=t.memoizedState;return e===null?(Ra(t),i!==null?(vt(t),xS(t,i)):(vt(t),sg(t,a,null,r,n))):i?i!==e.memoizedState?(Ra(t),vt(t),xS(t,i)):(vt(t),t.flags&=-16777217):(e=e.memoizedProps,e!==r&&Ra(t),vt(t),sg(t,a,e,r,n)),null;case 27:if(gh(t),n=Xi.current,a=t.type,e!==null&&t.stateNode!=null)e.memoizedProps!==r&&Ra(t);else{if(!r){if(t.stateNode===null)throw Error(te(166));return vt(t),null}e=xa.current,Ro(t)?Q1(t):(e=Wj(a,r,n),t.stateNode=e,Ra(t))}return vt(t),null;case 5:if(gh(t),a=t.type,e!==null&&t.stateNode!=null)e.memoizedProps!==r&&Ra(t);else{if(!r){if(t.stateNode===null)throw Error(te(166));return vt(t),null}if(i=xa.current,Ro(t))Q1(t);else{var s=zh(Xi.current);switch(i){case 1:i=s.createElementNS("http://www.w3.org/2000/svg",a);break;case 2:i=s.createElementNS("http://www.w3.org/1998/Math/MathML",a);break;default:switch(a){case"svg":i=s.createElementNS("http://www.w3.org/2000/svg",a);break;case"math":i=s.createElementNS("http://www.w3.org/1998/Math/MathML",a);break;case"script":i=s.createElement("div"),i.innerHTML="<script><\/script>",i=i.removeChild(i.firstChild);break;case"select":i=typeof r.is=="string"?s.createElement("select",{is:r.is}):s.createElement("select"),r.multiple?i.multiple=!0:r.size&&(i.size=r.size);break;default:i=typeof r.is=="string"?s.createElement(a,{is:r.is}):s.createElement(a)}}i[yn]=t,i[er]=r;e:for(s=t.child;s!==null;){if(s.tag===5||s.tag===6)i.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 e;for(;s.sibling===null;){if(s.return===null||s.return===t)break e;s=s.return}s.sibling.return=s.return,s=s.sibling}t.stateNode=i;e:switch(wn(i,a,r),a){case"button":case"input":case"select":case"textarea":r=!!r.autoFocus;break e;case"img":r=!0;break e;default:r=!1}r&&Ra(t)}}return vt(t),sg(t,t.type,e===null?null:e.memoizedProps,t.pendingProps,n),null;case 6:if(e&&t.stateNode!=null)e.memoizedProps!==r&&Ra(t);else{if(typeof r!="string"&&t.stateNode===null)throw Error(te(166));if(e=Xi.current,Ro(t)){if(e=t.stateNode,n=t.memoizedProps,r=null,a=vn,a!==null)switch(a.tag){case 27:case 5:r=a.memoizedProps}e[yn]=t,e=!!(e.nodeValue===n||r!==null&&r.suppressHydrationWarning===!0||Gj(e.nodeValue,n)),e||cs(t,!0)}else e=zh(e).createTextNode(r),e[yn]=t,t.stateNode=e}return vt(t),null;case 31:if(n=t.memoizedState,e===null||e.memoizedState!==null){if(r=Ro(t),n!==null){if(e===null){if(!r)throw Error(te(318));if(e=t.memoizedState,e=e!==null?e.dehydrated:null,!e)throw Error(te(557));e[yn]=t}else ao(),!(t.flags&128)&&(t.memoizedState=null),t.flags|=4;vt(t),e=!1}else n=Xp(),e!==null&&e.memoizedState!==null&&(e.memoizedState.hydrationErrors=n),e=!0;if(!e)return t.flags&256?(or(t),t):(or(t),null);if(t.flags&128)throw Error(te(558))}return vt(t),null;case 13:if(r=t.memoizedState,e===null||e.memoizedState!==null&&e.memoizedState.dehydrated!==null){if(a=Ro(t),r!==null&&r.dehydrated!==null){if(e===null){if(!a)throw Error(te(318));if(a=t.memoizedState,a=a!==null?a.dehydrated:null,!a)throw Error(te(317));a[yn]=t}else ao(),!(t.flags&128)&&(t.memoizedState=null),t.flags|=4;vt(t),a=!1}else a=Xp(),e!==null&&e.memoizedState!==null&&(e.memoizedState.hydrationErrors=a),a=!0;if(!a)return t.flags&256?(or(t),t):(or(t),null)}return or(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),i=null,r.memoizedState!==null&&r.memoizedState.cachePool!==null&&(i=r.memoizedState.cachePool.pool),i!==a&&(r.flags|=2048)),n!==e&&n&&(t.child.flags|=8192),Wd(t,t.updateQueue),vt(t),null);case 4:return Il(),e===null&&Ab(t.stateNode.containerInfo),vt(t),null;case 10:return Ja(t.type),vt(t),null;case 19:if(ln(qt),r=t.memoizedState,r===null)return vt(t),null;if(a=(t.flags&128)!==0,i=r.rendering,i===null)if(a)$c(r,!1);else{if(Lt!==0||e!==null&&e.flags&128)for(e=t.child;e!==null;){if(i=Eh(e),i!==null){for(t.flags|=128,$c(r,!1),e=i.updateQueue,t.updateQueue=e,Wd(t,e),t.subtreeFlags=0,e=n,n=t.child;n!==null;)cN(n,e),n=n.sibling;return mt(qt,qt.current&1|2),Ye&&Ua(t,r.treeForkCount),t.child}e=e.sibling}r.tail!==null&&fr()>Rh&&(t.flags|=128,a=!0,$c(r,!1),t.lanes=4194304)}else{if(!a)if(e=Eh(i),e!==null){if(t.flags|=128,a=!0,e=e.updateQueue,t.updateQueue=e,Wd(t,e),$c(r,!0),r.tail===null&&r.tailMode==="hidden"&&!i.alternate&&!Ye)return vt(t),null}else 2*fr()-r.renderingStartTime>Rh&&n!==536870912&&(t.flags|=128,a=!0,$c(r,!1),t.lanes=4194304);r.isBackwards?(i.sibling=t.child,t.child=i):(e=r.last,e!==null?e.sibling=i:t.child=i,r.last=i)}return r.tail!==null?(e=r.tail,r.rendering=e,r.tail=e.sibling,r.renderingStartTime=fr(),e.sibling=null,n=qt.current,mt(qt,a?n&1|2:n&1),Ye&&Ua(t,r.treeForkCount),e):(vt(t),null);case 22:case 23:return or(t),lb(),r=t.memoizedState!==null,e!==null?e.memoizedState!==null!==r&&(t.flags|=8192):r&&(t.flags|=8192),r?n&536870912&&!(t.flags&128)&&(vt(t),t.subtreeFlags&6&&(t.flags|=8192)):vt(t),n=t.updateQueue,n!==null&&Wd(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&&ln(eo),null;case 24:return n=null,e!==null&&(n=e.memoizedState.cache),t.memoizedState.cache!==n&&(t.flags|=2048),Ja(Zt),vt(t),null;case 25:return null;case 30:return null}throw Error(te(156,t.tag))}function $4(e,t){switch(rb(t),t.tag){case 1:return e=t.flags,e&65536?(t.flags=e&-65537|128,t):null;case 3:return Ja(Zt),Il(),e=t.flags,e&65536&&!(e&128)?(t.flags=e&-65537|128,t):null;case 26:case 27:case 5:return gh(t),null;case 31:if(t.memoizedState!==null){if(or(t),t.alternate===null)throw Error(te(340));ao()}return e=t.flags,e&65536?(t.flags=e&-65537|128,t):null;case 13:if(or(t),e=t.memoizedState,e!==null&&e.dehydrated!==null){if(t.alternate===null)throw Error(te(340));ao()}return e=t.flags,e&65536?(t.flags=e&-65537|128,t):null;case 19:return ln(qt),null;case 4:return Il(),null;case 10:return Ja(t.type),null;case 22:case 23:return or(t),lb(),e!==null&&ln(eo),e=t.flags,e&65536?(t.flags=e&-65537|128,t):null;case 24:return Ja(Zt),null;case 25:return null;default:return null}}function cj(e,t){switch(rb(t),t.tag){case 3:Ja(Zt),Il();break;case 26:case 27:case 5:gh(t);break;case 4:Il();break;case 31:t.memoizedState!==null&&or(t);break;case 13:or(t);break;case 19:ln(qt);break;case 10:Ja(t.type);break;case 22:case 23:or(t),lb(),e!==null&&ln(eo);break;case 24:Ja(Zt)}}function md(e,t){try{var n=t.updateQueue,r=n!==null?n.lastEffect:null;if(r!==null){var a=r.next;n=a;do{if((n.tag&e)===e){r=void 0;var i=n.create,s=n.inst;r=i(),s.destroy=r}n=n.next}while(n!==a)}}catch(o){it(t,t.return,o)}}function us(e,t,n){try{var r=t.updateQueue,a=r!==null?r.lastEffect:null;if(a!==null){var i=a.next;r=i;do{if((r.tag&e)===e){var s=r.inst,o=s.destroy;if(o!==void 0){s.destroy=void 0,a=t;var l=n,u=o;try{u()}catch(d){it(a,l,d)}}}r=r.next}while(r!==i)}}catch(d){it(t,t.return,d)}}function uj(e){var t=e.updateQueue;if(t!==null){var n=e.stateNode;try{bN(t,n)}catch(r){it(e,e.return,r)}}}function dj(e,t,n){n.props=lo(e.type,e.memoizedProps),n.state=e.memoizedState;try{n.componentWillUnmount()}catch(r){it(e,t,r)}}function fu(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(a){it(e,t,a)}}function va(e,t){var n=e.ref,r=e.refCleanup;if(n!==null)if(typeof r=="function")try{r()}catch(a){it(e,t,a)}finally{e.refCleanup=null,e=e.alternate,e!=null&&(e.refCleanup=null)}else if(typeof n=="function")try{n(null)}catch(a){it(e,t,a)}else n.current=null}function fj(e){var t=e.type,n=e.memoizedProps,r=e.stateNode;try{e:switch(t){case"button":case"input":case"select":case"textarea":n.autoFocus&&r.focus();break e;case"img":n.src?r.src=n.src:n.srcSet&&(r.srcset=n.srcSet)}}catch(a){it(e,e.return,a)}}function og(e,t,n){try{var r=e.stateNode;ez(r,e.type,n,t),r[er]=t}catch(a){it(e,e.return,a)}}function hj(e){return e.tag===5||e.tag===3||e.tag===26||e.tag===27&&ys(e.type)||e.tag===4}function lg(e){e:for(;;){for(;e.sibling===null;){if(e.return===null||hj(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&&ys(e.type)||e.flags&2||e.child===null||e.tag===4)continue e;e.child.return=e,e=e.child}if(!(e.flags&2))return e.stateNode}}function Zy(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=Qa));else if(r!==4&&(r===27&&ys(e.type)&&(n=e.stateNode,t=null),e=e.child,e!==null))for(Zy(e,t,n),e=e.sibling;e!==null;)Zy(e,t,n),e=e.sibling}function Ah(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&&ys(e.type)&&(n=e.stateNode),e=e.child,e!==null))for(Ah(e,t,n),e=e.sibling;e!==null;)Ah(e,t,n),e=e.sibling}function mj(e){var t=e.stateNode,n=e.memoizedProps;try{for(var r=e.type,a=t.attributes;a.length;)t.removeAttributeNode(a[0]);wn(t,r,n),t[yn]=e,t[er]=n}catch(i){it(e,e.return,i)}}var Ka=!1,Kt=!1,cg=!1,wS=typeof WeakSet=="function"?WeakSet:Set,sn=null;function O4(e,t){if(e=e.containerInfo,ev=Fh,e=tN(e),W0(e)){if("selectionStart"in e)var n={start:e.selectionStart,end:e.selectionEnd};else e:{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,i=r.focusNode;r=r.focusOffset;try{n.nodeType,i.nodeType}catch{n=null;break e}var s=0,o=-1,l=-1,u=0,d=0,f=e,m=null;t:for(;;){for(var h;f!==n||a!==0&&f.nodeType!==3||(o=s+a),f!==i||r!==0&&f.nodeType!==3||(l=s+r),f.nodeType===3&&(s+=f.nodeValue.length),(h=f.firstChild)!==null;)m=f,f=h;for(;;){if(f===e)break t;if(m===n&&++u===a&&(o=s),m===i&&++d===r&&(l=s),(h=f.nextSibling)!==null)break;f=m,m=f.parentNode}f=h}n=o===-1||l===-1?null:{start:o,end:l}}else n=null}n=n||{start:0,end:0}}else n=null;for(tv={focusedElem:e,selectionRange:n},Fh=!1,sn=t;sn!==null;)if(t=sn,e=t.child,(t.subtreeFlags&1028)!==0&&e!==null)e.return=t,sn=e;else for(;sn!==null;){switch(t=sn,i=t.alternate,e=t.flags,t.tag){case 0:if(e&4&&(e=t.updateQueue,e=e!==null?e.events:null,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&&i!==null){e=void 0,n=t,a=i.memoizedProps,i=i.memoizedState,r=n.stateNode;try{var y=lo(n.type,a);e=r.getSnapshotBeforeUpdate(y,i),r.__reactInternalSnapshotBeforeUpdate=e}catch(p){it(n,n.return,p)}}break;case 3:if(e&1024){if(e=t.stateNode.containerInfo,n=e.nodeType,n===9)rv(e);else if(n===1)switch(e.nodeName){case"HEAD":case"HTML":case"BODY":rv(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(te(163))}if(e=t.sibling,e!==null){e.return=t.return,sn=e;break}sn=t.return}}function pj(e,t,n){var r=n.flags;switch(n.tag){case 0:case 11:case 15:Oa(e,n),r&4&&md(5,n);break;case 1:if(Oa(e,n),r&4)if(e=n.stateNode,t===null)try{e.componentDidMount()}catch(s){it(n,n.return,s)}else{var a=lo(n.type,t.memoizedProps);t=t.memoizedState;try{e.componentDidUpdate(a,t,e.__reactInternalSnapshotBeforeUpdate)}catch(s){it(n,n.return,s)}}r&64&&uj(n),r&512&&fu(n,n.return);break;case 3:if(Oa(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{bN(e,t)}catch(s){it(n,n.return,s)}}break;case 27:t===null&&r&4&&mj(n);case 26:case 5:Oa(e,n),t===null&&r&4&&fj(n),r&512&&fu(n,n.return);break;case 12:Oa(e,n);break;case 31:Oa(e,n),r&4&&vj(e,n);break;case 13:Oa(e,n),r&4&&bj(e,n),r&64&&(e=n.memoizedState,e!==null&&(e=e.dehydrated,e!==null&&(n=q4.bind(null,n),lz(e,n))));break;case 22:if(r=n.memoizedState!==null||Ka,!r){t=t!==null&&t.memoizedState!==null||Kt,a=Ka;var i=Kt;Ka=r,(Kt=t)&&!i?za(e,n,(n.subtreeFlags&8772)!==0):Oa(e,n),Ka=a,Kt=i}break;case 30:break;default:Oa(e,n)}}function gj(e){var t=e.alternate;t!==null&&(e.alternate=null,gj(t)),e.child=null,e.deletions=null,e.sibling=null,e.tag===5&&(t=e.stateNode,t!==null&&K0(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 Tt=null,Kn=!1;function $a(e,t,n){for(n=n.child;n!==null;)yj(e,t,n),n=n.sibling}function yj(e,t,n){if(hr&&typeof hr.onCommitFiberUnmount=="function")try{hr.onCommitFiberUnmount(od,n)}catch{}switch(n.tag){case 26:Kt||va(n,t),$a(e,t,n),n.memoizedState?n.memoizedState.count--:n.stateNode&&(n=n.stateNode,n.parentNode.removeChild(n));break;case 27:Kt||va(n,t);var r=Tt,a=Kn;ys(n.type)&&(Tt=n.stateNode,Kn=!1),$a(e,t,n),gu(n.stateNode),Tt=r,Kn=a;break;case 5:Kt||va(n,t);case 6:if(r=Tt,a=Kn,Tt=null,$a(e,t,n),Tt=r,Kn=a,Tt!==null)if(Kn)try{(Tt.nodeType===9?Tt.body:Tt.nodeName==="HTML"?Tt.ownerDocument.body:Tt).removeChild(n.stateNode)}catch(i){it(n,t,i)}else try{Tt.removeChild(n.stateNode)}catch(i){it(n,t,i)}break;case 18:Tt!==null&&(Kn?(e=Tt,MS(e.nodeType===9?e.body:e.nodeName==="HTML"?e.ownerDocument.body:e,n.stateNode),Gl(e)):MS(Tt,n.stateNode));break;case 4:r=Tt,a=Kn,Tt=n.stateNode.containerInfo,Kn=!0,$a(e,t,n),Tt=r,Kn=a;break;case 0:case 11:case 14:case 15:us(2,n,t),Kt||us(4,n,t),$a(e,t,n);break;case 1:Kt||(va(n,t),r=n.stateNode,typeof r.componentWillUnmount=="function"&&dj(n,t,r)),$a(e,t,n);break;case 21:$a(e,t,n);break;case 22:Kt=(r=Kt)||n.memoizedState!==null,$a(e,t,n),Kt=r;break;default:$a(e,t,n)}}function vj(e,t){if(t.memoizedState===null&&(e=t.alternate,e!==null&&(e=e.memoizedState,e!==null))){e=e.dehydrated;try{Gl(e)}catch(n){it(t,t.return,n)}}}function bj(e,t){if(t.memoizedState===null&&(e=t.alternate,e!==null&&(e=e.memoizedState,e!==null&&(e=e.dehydrated,e!==null))))try{Gl(e)}catch(n){it(t,t.return,n)}}function M4(e){switch(e.tag){case 31:case 13:case 19:var t=e.stateNode;return t===null&&(t=e.stateNode=new wS),t;case 22:return e=e.stateNode,t=e._retryCache,t===null&&(t=e._retryCache=new wS),t;default:throw Error(te(435,e.tag))}}function Jd(e,t){var n=M4(e);t.forEach(function(r){if(!n.has(r)){n.add(r);var a=H4.bind(null,e,r);r.then(a,a)}})}function Fn(e,t){var n=t.deletions;if(n!==null)for(var r=0;r<n.length;r++){var a=n[r],i=e,s=t,o=s;e:for(;o!==null;){switch(o.tag){case 27:if(ys(o.type)){Tt=o.stateNode,Kn=!1;break e}break;case 5:Tt=o.stateNode,Kn=!1;break e;case 3:case 4:Tt=o.stateNode.containerInfo,Kn=!0;break e}o=o.return}if(Tt===null)throw Error(te(160));yj(i,s,a),Tt=null,Kn=!1,i=a.alternate,i!==null&&(i.return=null),a.return=null}if(t.subtreeFlags&13886)for(t=t.child;t!==null;)xj(t,e),t=t.sibling}var Xr=null;function xj(e,t){var n=e.alternate,r=e.flags;switch(e.tag){case 0:case 11:case 14:case 15:Fn(t,e),qn(e),r&4&&(us(3,e,e.return),md(3,e),us(5,e,e.return));break;case 1:Fn(t,e),qn(e),r&512&&(Kt||n===null||va(n,n.return)),r&64&&Ka&&(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=Xr;if(Fn(t,e),qn(e),r&512&&(Kt||n===null||va(n,n.return)),r&4){var i=n!==null?n.memoizedState:null;if(r=e.memoizedState,n===null)if(r===null)if(e.stateNode===null){e:{r=e.type,n=e.memoizedProps,a=a.ownerDocument||a;t:switch(r){case"title":i=a.getElementsByTagName("title")[0],(!i||i[ud]||i[yn]||i.namespaceURI==="http://www.w3.org/2000/svg"||i.hasAttribute("itemprop"))&&(i=a.createElement(r),a.head.insertBefore(i,a.querySelector("head > title"))),wn(i,r,n),i[yn]=e,on(i),r=i;break e;case"link":var s=FS("link","href",a).get(r+(n.href||""));if(s){for(var o=0;o<s.length;o++)if(i=s[o],i.getAttribute("href")===(n.href==null||n.href===""?null:n.href)&&i.getAttribute("rel")===(n.rel==null?null:n.rel)&&i.getAttribute("title")===(n.title==null?null:n.title)&&i.getAttribute("crossorigin")===(n.crossOrigin==null?null:n.crossOrigin)){s.splice(o,1);break t}}i=a.createElement(r),wn(i,r,n),a.head.appendChild(i);break;case"meta":if(s=FS("meta","content",a).get(r+(n.content||""))){for(o=0;o<s.length;o++)if(i=s[o],i.getAttribute("content")===(n.content==null?null:""+n.content)&&i.getAttribute("name")===(n.name==null?null:n.name)&&i.getAttribute("property")===(n.property==null?null:n.property)&&i.getAttribute("http-equiv")===(n.httpEquiv==null?null:n.httpEquiv)&&i.getAttribute("charset")===(n.charSet==null?null:n.charSet)){s.splice(o,1);break t}}i=a.createElement(r),wn(i,r,n),a.head.appendChild(i);break;default:throw Error(te(468,r))}i[yn]=e,on(i),r=i}e.stateNode=r}else qS(a,e.type,e.stateNode);else e.stateNode=US(a,r,e.memoizedProps);else i!==r?(i===null?n.stateNode!==null&&(n=n.stateNode,n.parentNode.removeChild(n)):i.count--,r===null?qS(a,e.type,e.stateNode):US(a,r,e.memoizedProps)):r===null&&e.stateNode!==null&&og(e,e.memoizedProps,n.memoizedProps)}break;case 27:Fn(t,e),qn(e),r&512&&(Kt||n===null||va(n,n.return)),n!==null&&r&4&&og(e,e.memoizedProps,n.memoizedProps);break;case 5:if(Fn(t,e),qn(e),r&512&&(Kt||n===null||va(n,n.return)),e.flags&32){a=e.stateNode;try{Ul(a,"")}catch(y){it(e,e.return,y)}}r&4&&e.stateNode!=null&&(a=e.memoizedProps,og(e,a,n!==null?n.memoizedProps:a)),r&1024&&(cg=!0);break;case 6:if(Fn(t,e),qn(e),r&4){if(e.stateNode===null)throw Error(te(162));r=e.memoizedProps,n=e.stateNode;try{n.nodeValue=r}catch(y){it(e,e.return,y)}}break;case 3:if(Vf=null,a=Xr,Xr=Ih(t.containerInfo),Fn(t,e),Xr=a,qn(e),r&4&&n!==null&&n.memoizedState.isDehydrated)try{Gl(t.containerInfo)}catch(y){it(e,e.return,y)}cg&&(cg=!1,wj(e));break;case 4:r=Xr,Xr=Ih(e.stateNode.containerInfo),Fn(t,e),qn(e),Xr=r;break;case 12:Fn(t,e),qn(e);break;case 31:Fn(t,e),qn(e),r&4&&(r=e.updateQueue,r!==null&&(e.updateQueue=null,Jd(e,r)));break;case 13:Fn(t,e),qn(e),e.child.flags&8192&&e.memoizedState!==null!=(n!==null&&n.memoizedState!==null)&&(qm=fr()),r&4&&(r=e.updateQueue,r!==null&&(e.updateQueue=null,Jd(e,r)));break;case 22:a=e.memoizedState!==null;var l=n!==null&&n.memoizedState!==null,u=Ka,d=Kt;if(Ka=u||a,Kt=d||l,Fn(t,e),Kt=d,Ka=u,qn(e),r&8192)e:for(t=e.stateNode,t._visibility=a?t._visibility&-2:t._visibility|1,a&&(n===null||l||Ka||Kt||Ms(e)),n=null,t=e;;){if(t.tag===5||t.tag===26){if(n===null){l=n=t;try{if(i=l.stateNode,a)s=i.style,typeof s.setProperty=="function"?s.setProperty("display","none","important"):s.display="none";else{o=l.stateNode;var f=l.memoizedProps.style,m=f!=null&&f.hasOwnProperty("display")?f.display:null;o.style.display=m==null||typeof m=="boolean"?"":(""+m).trim()}}catch(y){it(l,l.return,y)}}}else if(t.tag===6){if(n===null){l=t;try{l.stateNode.nodeValue=a?"":l.memoizedProps}catch(y){it(l,l.return,y)}}}else if(t.tag===18){if(n===null){l=t;try{var h=l.stateNode;a?PS(h,!0):PS(l.stateNode,!1)}catch(y){it(l,l.return,y)}}}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 e;for(;t.sibling===null;){if(t.return===null||t.return===e)break e;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,Jd(e,n))));break;case 19:Fn(t,e),qn(e),r&4&&(r=e.updateQueue,r!==null&&(e.updateQueue=null,Jd(e,r)));break;case 30:break;case 21:break;default:Fn(t,e),qn(e)}}function qn(e){var t=e.flags;if(t&2){try{for(var n,r=e.return;r!==null;){if(hj(r)){n=r;break}r=r.return}if(n==null)throw Error(te(160));switch(n.tag){case 27:var a=n.stateNode,i=lg(e);Ah(e,i,a);break;case 5:var s=n.stateNode;n.flags&32&&(Ul(s,""),n.flags&=-33);var o=lg(e);Ah(e,o,s);break;case 3:case 4:var l=n.stateNode.containerInfo,u=lg(e);Zy(e,u,l);break;default:throw Error(te(161))}}catch(d){it(e,e.return,d)}e.flags&=-3}t&4096&&(e.flags&=-4097)}function wj(e){if(e.subtreeFlags&1024)for(e=e.child;e!==null;){var t=e;wj(t),t.tag===5&&t.flags&1024&&t.stateNode.reset(),e=e.sibling}}function Oa(e,t){if(t.subtreeFlags&8772)for(t=t.child;t!==null;)pj(e,t.alternate,t),t=t.sibling}function Ms(e){for(e=e.child;e!==null;){var t=e;switch(t.tag){case 0:case 11:case 14:case 15:us(4,t,t.return),Ms(t);break;case 1:va(t,t.return);var n=t.stateNode;typeof n.componentWillUnmount=="function"&&dj(t,t.return,n),Ms(t);break;case 27:gu(t.stateNode);case 26:case 5:va(t,t.return),Ms(t);break;case 22:t.memoizedState===null&&Ms(t);break;case 30:Ms(t);break;default:Ms(t)}e=e.sibling}}function za(e,t,n){for(n=n&&(t.subtreeFlags&8772)!==0,t=t.child;t!==null;){var r=t.alternate,a=e,i=t,s=i.flags;switch(i.tag){case 0:case 11:case 15:za(a,i,n),md(4,i);break;case 1:if(za(a,i,n),r=i,a=r.stateNode,typeof a.componentDidMount=="function")try{a.componentDidMount()}catch(u){it(r,r.return,u)}if(r=i,a=r.updateQueue,a!==null){var o=r.stateNode;try{var l=a.shared.hiddenCallbacks;if(l!==null)for(a.shared.hiddenCallbacks=null,a=0;a<l.length;a++)vN(l[a],o)}catch(u){it(r,r.return,u)}}n&&s&64&&uj(i),fu(i,i.return);break;case 27:mj(i);case 26:case 5:za(a,i,n),n&&r===null&&s&4&&fj(i),fu(i,i.return);break;case 12:za(a,i,n);break;case 31:za(a,i,n),n&&s&4&&vj(a,i);break;case 13:za(a,i,n),n&&s&4&&bj(a,i);break;case 22:i.memoizedState===null&&za(a,i,n),fu(i,i.return);break;case 30:break;default:za(a,i,n)}t=t.sibling}}function kb(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&&fd(n))}function Eb(e,t){e=null,t.alternate!==null&&(e=t.alternate.memoizedState.cache),t=t.memoizedState.cache,t!==e&&(t.refCount++,e!=null&&fd(e))}function qr(e,t,n,r){if(t.subtreeFlags&10256)for(t=t.child;t!==null;)Sj(e,t,n,r),t=t.sibling}function Sj(e,t,n,r){var a=t.flags;switch(t.tag){case 0:case 11:case 15:qr(e,t,n,r),a&2048&&md(9,t);break;case 1:qr(e,t,n,r);break;case 3:qr(e,t,n,r),a&2048&&(e=null,t.alternate!==null&&(e=t.alternate.memoizedState.cache),t=t.memoizedState.cache,t!==e&&(t.refCount++,e!=null&&fd(e)));break;case 12:if(a&2048){qr(e,t,n,r),e=t.stateNode;try{var i=t.memoizedProps,s=i.id,o=i.onPostCommit;typeof o=="function"&&o(s,t.alternate===null?"mount":"update",e.passiveEffectDuration,-0)}catch(l){it(t,t.return,l)}}else qr(e,t,n,r);break;case 31:qr(e,t,n,r);break;case 13:qr(e,t,n,r);break;case 23:break;case 22:i=t.stateNode,s=t.alternate,t.memoizedState!==null?i._visibility&2?qr(e,t,n,r):hu(e,t):i._visibility&2?qr(e,t,n,r):(i._visibility|=2,Uo(e,t,n,r,(t.subtreeFlags&10256)!==0||!1)),a&2048&&kb(s,t);break;case 24:qr(e,t,n,r),a&2048&&Eb(t.alternate,t);break;default:qr(e,t,n,r)}}function Uo(e,t,n,r,a){for(a=a&&((t.subtreeFlags&10256)!==0||!1),t=t.child;t!==null;){var i=e,s=t,o=n,l=r,u=s.flags;switch(s.tag){case 0:case 11:case 15:Uo(i,s,o,l,a),md(8,s);break;case 23:break;case 22:var d=s.stateNode;s.memoizedState!==null?d._visibility&2?Uo(i,s,o,l,a):hu(i,s):(d._visibility|=2,Uo(i,s,o,l,a)),a&&u&2048&&kb(s.alternate,s);break;case 24:Uo(i,s,o,l,a),a&&u&2048&&Eb(s.alternate,s);break;default:Uo(i,s,o,l,a)}t=t.sibling}}function hu(e,t){if(t.subtreeFlags&10256)for(t=t.child;t!==null;){var n=e,r=t,a=r.flags;switch(r.tag){case 22:hu(n,r),a&2048&&kb(r.alternate,r);break;case 24:hu(n,r),a&2048&&Eb(r.alternate,r);break;default:hu(n,r)}t=t.sibling}}var Qc=8192;function $o(e,t,n){if(e.subtreeFlags&Qc)for(e=e.child;e!==null;)_j(e,t,n),e=e.sibling}function _j(e,t,n){switch(e.tag){case 26:$o(e,t,n),e.flags&Qc&&e.memoizedState!==null&&xz(n,Xr,e.memoizedState,e.memoizedProps);break;case 5:$o(e,t,n);break;case 3:case 4:var r=Xr;Xr=Ih(e.stateNode.containerInfo),$o(e,t,n),Xr=r;break;case 22:e.memoizedState===null&&(r=e.alternate,r!==null&&r.memoizedState!==null?(r=Qc,Qc=16777216,$o(e,t,n),Qc=r):$o(e,t,n));break;default:$o(e,t,n)}}function kj(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 Oc(e){var t=e.deletions;if(e.flags&16){if(t!==null)for(var n=0;n<t.length;n++){var r=t[n];sn=r,Cj(r,e)}kj(e)}if(e.subtreeFlags&10256)for(e=e.child;e!==null;)Ej(e),e=e.sibling}function Ej(e){switch(e.tag){case 0:case 11:case 15:Oc(e),e.flags&2048&&us(9,e,e.return);break;case 3:Oc(e);break;case 12:Oc(e);break;case 22:var t=e.stateNode;e.memoizedState!==null&&t._visibility&2&&(e.return===null||e.return.tag!==13)?(t._visibility&=-3,Hf(e)):Oc(e);break;default:Oc(e)}}function Hf(e){var t=e.deletions;if(e.flags&16){if(t!==null)for(var n=0;n<t.length;n++){var r=t[n];sn=r,Cj(r,e)}kj(e)}for(e=e.child;e!==null;){switch(t=e,t.tag){case 0:case 11:case 15:us(8,t,t.return),Hf(t);break;case 22:n=t.stateNode,n._visibility&2&&(n._visibility&=-3,Hf(t));break;default:Hf(t)}e=e.sibling}}function Cj(e,t){for(;sn!==null;){var n=sn;switch(n.tag){case 0:case 11:case 15:us(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:fd(n.memoizedState.cache)}if(r=n.child,r!==null)r.return=n,sn=r;else e:for(n=e;sn!==null;){r=sn;var a=r.sibling,i=r.return;if(gj(r),r===n){sn=null;break e}if(a!==null){a.return=i,sn=a;break e}sn=i}}}var P4={getCacheForType:function(e){var t=bn(Zt),n=t.data.get(e);return n===void 0&&(n=e(),t.data.set(e,n)),n},cacheSignal:function(){return bn(Zt).controller.signal}},D4=typeof WeakMap=="function"?WeakMap:Map,Je=0,dt=null,Ve=null,Ze=0,rt=0,sr=null,Zi=!1,dc=!1,Cb=!1,li=0,Lt=0,ds=0,no=0,Nb=0,dr=0,Bl=0,mu=null,Gn=null,Gy=!1,qm=0,Nj=0,Rh=1/0,$h=null,ts=null,Jt=0,ns=null,Vl=null,ei=0,Qy=0,Yy=null,jj=null,pu=0,Xy=null;function pr(){return Je&2&&Ze!==0?Ze&-Ze:Re.T!==null?Tb():zC()}function Tj(){if(dr===0)if(!(Ze&536870912)||Ye){var e=Vd;Vd<<=1,!(Vd&3932160)&&(Vd=262144),dr=e}else dr=536870912;return e=br.current,e!==null&&(e.flags|=32),dr}function Jn(e,t,n){(e===dt&&(rt===2||rt===9)||e.cancelPendingCommit!==null)&&(Kl(e,0),Gi(e,Ze,dr,!1)),cd(e,n),(!(Je&2)||e!==dt)&&(e===dt&&(!(Je&2)&&(no|=n),Lt===4&&Gi(e,Ze,dr,!1)),ka(e))}function Aj(e,t,n){if(Je&6)throw Error(te(327));var r=!n&&(t&127)===0&&(t&e.expiredLanes)===0||ld(e,t),a=r?L4(e,t):ug(e,t,!0),i=r;do{if(a===0){dc&&!r&&Gi(e,t,0,!1);break}else{if(n=e.current.alternate,i&&!z4(n)){a=ug(e,t,!1),i=!1;continue}if(a===2){if(i=t,e.errorRecoveryDisabledLanes&i)var s=0;else s=e.pendingLanes&-536870913,s=s!==0?s:s&536870912?536870912:0;if(s!==0){t=s;e:{var o=e;a=mu;var l=o.current.memoizedState.isDehydrated;if(l&&(Kl(o,s).flags|=256),s=ug(o,s,!1),s!==2){if(Cb&&!l){o.errorRecoveryDisabledLanes|=i,no|=i,a=4;break e}i=Gn,Gn=a,i!==null&&(Gn===null?Gn=i:Gn.push.apply(Gn,i))}a=s}if(i=!1,a!==2)continue}}if(a===1){Kl(e,0),Gi(e,t,0,!0);break}e:{switch(r=e,i=a,i){case 0:case 1:throw Error(te(345));case 4:if((t&4194048)!==t)break;case 6:Gi(r,t,dr,!Zi);break e;case 2:Gn=null;break;case 3:case 5:break;default:throw Error(te(329))}if((t&62914560)===t&&(a=qm+300-fr(),10<a)){if(Gi(r,t,dr,!Zi),Rm(r,0,!0)!==0)break e;ei=t,r.timeoutHandle=Yj(SS.bind(null,r,n,Gn,$h,Gy,t,dr,no,Bl,Zi,i,"Throttled",-0,0),a);break e}SS(r,n,Gn,$h,Gy,t,dr,no,Bl,Zi,i,null,-0,0)}}break}while(!0);ka(e)}function SS(e,t,n,r,a,i,s,o,l,u,d,f,m,h){if(e.timeoutHandle=-1,f=t.subtreeFlags,f&8192||(f&16785408)===16785408){f={stylesheets:null,count:0,imgCount:0,imgBytes:0,suspenseyImages:[],waitingForImages:!0,waitingForViewTransition:!1,unsuspend:Qa},_j(t,i,f);var y=(i&62914560)===i?qm-fr():(i&4194048)===i?Nj-fr():0;if(y=wz(f,y),y!==null){ei=i,e.cancelPendingCommit=y(kS.bind(null,e,t,i,n,r,a,s,o,l,d,f,null,m,h)),Gi(e,i,s,!u);return}}kS(e,t,i,n,r,a,s,o,l)}function z4(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 a=n[r],i=a.getSnapshot;a=a.value;try{if(!vr(i(),a))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 Gi(e,t,n,r){t&=~Nb,t&=~no,e.suspendedLanes|=t,e.pingedLanes&=~t,r&&(e.warmLanes|=t),r=e.expirationTimes;for(var a=t;0<a;){var i=31-mr(a),s=1<<i;r[i]=-1,a&=~s}n!==0&&MC(e,n,t)}function Hm(){return Je&6?!0:(pd(0),!1)}function jb(){if(Ve!==null){if(rt===0)var e=Ve.return;else e=Ve,Ya=No=null,hb(e),pl=null,zu=0,e=Ve;for(;e!==null;)cj(e.alternate,e),e=e.return;Ve=null}}function Kl(e,t){var n=e.timeoutHandle;n!==-1&&(e.timeoutHandle=-1,rz(n)),n=e.cancelPendingCommit,n!==null&&(e.cancelPendingCommit=null,n()),ei=0,jb(),dt=e,Ve=n=Wa(e.current,null),Ze=t,rt=0,sr=null,Zi=!1,dc=ld(e,t),Cb=!1,Bl=dr=Nb=no=ds=Lt=0,Gn=mu=null,Gy=!1,t&8&&(t|=t&32);var r=e.entangledLanes;if(r!==0)for(e=e.entanglements,r&=t;0<r;){var a=31-mr(r),i=1<<a;t|=e[a],r&=~i}return li=t,Pm(),n}function Rj(e,t){Pe=null,Re.H=Lu,t===uc||t===zm?(t=eS(),rt=3):t===sb?(t=eS(),rt=4):rt=t===Sb?8:t!==null&&typeof t=="object"&&typeof t.then=="function"?6:1,sr=t,Ve===null&&(Lt=1,jh(e,Mr(t,e.current)))}function $j(){var e=br.current;return e===null?!0:(Ze&4194048)===Ze?Dr===null:(Ze&62914560)===Ze||Ze&536870912?e===Dr:!1}function Oj(){var e=Re.H;return Re.H=Lu,e===null?Lu:e}function Mj(){var e=Re.A;return Re.A=P4,e}function Oh(){Lt=4,Zi||(Ze&4194048)!==Ze&&br.current!==null||(dc=!0),!(ds&134217727)&&!(no&134217727)||dt===null||Gi(dt,Ze,dr,!1)}function ug(e,t,n){var r=Je;Je|=2;var a=Oj(),i=Mj();(dt!==e||Ze!==t)&&($h=null,Kl(e,t)),t=!1;var s=Lt;e:do try{if(rt!==0&&Ve!==null){var o=Ve,l=sr;switch(rt){case 8:jb(),s=6;break e;case 3:case 2:case 9:case 6:br.current===null&&(t=!0);var u=rt;if(rt=0,sr=null,sl(e,o,l,u),n&&dc){s=0;break e}break;default:u=rt,rt=0,sr=null,sl(e,o,l,u)}}I4(),s=Lt;break}catch(d){Rj(e,d)}while(!0);return t&&e.shellSuspendCounter++,Ya=No=null,Je=r,Re.H=a,Re.A=i,Ve===null&&(dt=null,Ze=0,Pm()),s}function I4(){for(;Ve!==null;)Pj(Ve)}function L4(e,t){var n=Je;Je|=2;var r=Oj(),a=Mj();dt!==e||Ze!==t?($h=null,Rh=fr()+500,Kl(e,t)):dc=ld(e,t);e:do try{if(rt!==0&&Ve!==null){t=Ve;var i=sr;t:switch(rt){case 1:rt=0,sr=null,sl(e,t,i,1);break;case 2:case 9:if(J1(i)){rt=0,sr=null,_S(t);break}t=function(){rt!==2&&rt!==9||dt!==e||(rt=7),ka(e)},i.then(t,t);break e;case 3:rt=7;break e;case 4:rt=5;break e;case 7:J1(i)?(rt=0,sr=null,_S(t)):(rt=0,sr=null,sl(e,t,i,7));break;case 5:var s=null;switch(Ve.tag){case 26:s=Ve.memoizedState;case 5:case 27:var o=Ve;if(s?t2(s):o.stateNode.complete){rt=0,sr=null;var l=o.sibling;if(l!==null)Ve=l;else{var u=o.return;u!==null?(Ve=u,Bm(u)):Ve=null}break t}}rt=0,sr=null,sl(e,t,i,5);break;case 6:rt=0,sr=null,sl(e,t,i,6);break;case 8:jb(),Lt=6;break e;default:throw Error(te(462))}}U4();break}catch(d){Rj(e,d)}while(!0);return Ya=No=null,Re.H=r,Re.A=a,Je=n,Ve!==null?0:(dt=null,Ze=0,Pm(),Lt)}function U4(){for(;Ve!==null&&!cD();)Pj(Ve)}function Pj(e){var t=lj(e.alternate,e,li);e.memoizedProps=e.pendingProps,t===null?Bm(e):Ve=t}function _S(e){var t=e,n=t.alternate;switch(t.tag){case 15:case 0:t=gS(n,t,t.pendingProps,t.type,void 0,Ze);break;case 11:t=gS(n,t,t.pendingProps,t.type.render,t.ref,Ze);break;case 5:hb(t);default:cj(n,t),t=Ve=cN(t,li),t=lj(n,t,li)}e.memoizedProps=e.pendingProps,t===null?Bm(e):Ve=t}function sl(e,t,n,r){Ya=No=null,hb(t),pl=null,zu=0;var a=t.return;try{if(j4(e,a,t,n,Ze)){Lt=1,jh(e,Mr(n,e.current)),Ve=null;return}}catch(i){if(a!==null)throw Ve=a,i;Lt=1,jh(e,Mr(n,e.current)),Ve=null;return}t.flags&32768?(Ye||r===1?e=!0:dc||Ze&536870912?e=!1:(Zi=e=!0,(r===2||r===9||r===3||r===6)&&(r=br.current,r!==null&&r.tag===13&&(r.flags|=16384))),Dj(t,e)):Bm(t)}function Bm(e){var t=e;do{if(t.flags&32768){Dj(t,Zi);return}e=t.return;var n=R4(t.alternate,t,li);if(n!==null){Ve=n;return}if(t=t.sibling,t!==null){Ve=t;return}Ve=t=e}while(t!==null);Lt===0&&(Lt=5)}function Dj(e,t){do{var n=$4(e.alternate,e);if(n!==null){n.flags&=32767,Ve=n;return}if(n=e.return,n!==null&&(n.flags|=32768,n.subtreeFlags=0,n.deletions=null),!t&&(e=e.sibling,e!==null)){Ve=e;return}Ve=e=n}while(e!==null);Lt=6,Ve=null}function kS(e,t,n,r,a,i,s,o,l){e.cancelPendingCommit=null;do Vm();while(Jt!==0);if(Je&6)throw Error(te(327));if(t!==null){if(t===e.current)throw Error(te(177));if(i=t.lanes|t.childLanes,i|=J0,bD(e,n,i,s,o,l),e===dt&&(Ve=dt=null,Ze=0),Vl=t,ns=e,ei=n,Qy=i,Yy=a,jj=r,t.subtreeFlags&10256||t.flags&10256?(e.callbackNode=null,e.callbackPriority=0,B4(yh,function(){return Fj(),null})):(e.callbackNode=null,e.callbackPriority=0),r=(t.flags&13878)!==0,t.subtreeFlags&13878||r){r=Re.T,Re.T=null,a=et.p,et.p=2,s=Je,Je|=4;try{O4(e,t,n)}finally{Je=s,et.p=a,Re.T=r}}Jt=1,zj(),Ij(),Lj()}}function zj(){if(Jt===1){Jt=0;var e=ns,t=Vl,n=(t.flags&13878)!==0;if(t.subtreeFlags&13878||n){n=Re.T,Re.T=null;var r=et.p;et.p=2;var a=Je;Je|=4;try{xj(t,e);var i=tv,s=tN(e.containerInfo),o=i.focusedElem,l=i.selectionRange;if(s!==o&&o&&o.ownerDocument&&eN(o.ownerDocument.documentElement,o)){if(l!==null&&W0(o)){var u=l.start,d=l.end;if(d===void 0&&(d=u),"selectionStart"in o)o.selectionStart=u,o.selectionEnd=Math.min(d,o.value.length);else{var f=o.ownerDocument||document,m=f&&f.defaultView||window;if(m.getSelection){var h=m.getSelection(),y=o.textContent.length,p=Math.min(l.start,y),b=l.end===void 0?p:Math.min(l.end,y);!h.extend&&p>b&&(s=b,b=p,p=s);var g=K1(o,p),v=K1(o,b);if(g&&v&&(h.rangeCount!==1||h.anchorNode!==g.node||h.anchorOffset!==g.offset||h.focusNode!==v.node||h.focusOffset!==v.offset)){var w=f.createRange();w.setStart(g.node,g.offset),h.removeAllRanges(),p>b?(h.addRange(w),h.extend(v.node,v.offset)):(w.setEnd(v.node,v.offset),h.addRange(w))}}}}for(f=[],h=o;h=h.parentNode;)h.nodeType===1&&f.push({element:h,left:h.scrollLeft,top:h.scrollTop});for(typeof o.focus=="function"&&o.focus(),o=0;o<f.length;o++){var S=f[o];S.element.scrollLeft=S.left,S.element.scrollTop=S.top}}Fh=!!ev,tv=ev=null}finally{Je=a,et.p=r,Re.T=n}}e.current=t,Jt=2}}function Ij(){if(Jt===2){Jt=0;var e=ns,t=Vl,n=(t.flags&8772)!==0;if(t.subtreeFlags&8772||n){n=Re.T,Re.T=null;var r=et.p;et.p=2;var a=Je;Je|=4;try{pj(e,t.alternate,t)}finally{Je=a,et.p=r,Re.T=n}}Jt=3}}function Lj(){if(Jt===4||Jt===3){Jt=0,uD();var e=ns,t=Vl,n=ei,r=jj;t.subtreeFlags&10256||t.flags&10256?Jt=5:(Jt=0,Vl=ns=null,Uj(e,e.pendingLanes));var a=e.pendingLanes;if(a===0&&(ts=null),V0(n),t=t.stateNode,hr&&typeof hr.onCommitFiberRoot=="function")try{hr.onCommitFiberRoot(od,t,void 0,(t.current.flags&128)===128)}catch{}if(r!==null){t=Re.T,a=et.p,et.p=2,Re.T=null;try{for(var i=e.onRecoverableError,s=0;s<r.length;s++){var o=r[s];i(o.value,{componentStack:o.stack})}}finally{Re.T=t,et.p=a}}ei&3&&Vm(),ka(e),a=e.pendingLanes,n&261930&&a&42?e===Xy?pu++:(pu=0,Xy=e):pu=0,pd(0)}}function Uj(e,t){(e.pooledCacheLanes&=t)===0&&(t=e.pooledCache,t!=null&&(e.pooledCache=null,fd(t)))}function Vm(){return zj(),Ij(),Lj(),Fj()}function Fj(){if(Jt!==5)return!1;var e=ns,t=Qy;Qy=0;var n=V0(ei),r=Re.T,a=et.p;try{et.p=32>n?32:n,Re.T=null,n=Yy,Yy=null;var i=ns,s=ei;if(Jt=0,Vl=ns=null,ei=0,Je&6)throw Error(te(331));var o=Je;if(Je|=4,Ej(i.current),Sj(i,i.current,s,n),Je=o,pd(0,!1),hr&&typeof hr.onPostCommitFiberRoot=="function")try{hr.onPostCommitFiberRoot(od,i)}catch{}return!0}finally{et.p=a,Re.T=r,Uj(e,t)}}function ES(e,t,n){t=Mr(n,t),t=By(e.stateNode,t,2),e=es(e,t,2),e!==null&&(cd(e,2),ka(e))}function it(e,t,n){if(e.tag===3)ES(e,e,n);else for(;t!==null;){if(t.tag===3){ES(t,e,n);break}else if(t.tag===1){var r=t.stateNode;if(typeof t.type.getDerivedStateFromError=="function"||typeof r.componentDidCatch=="function"&&(ts===null||!ts.has(r))){e=Mr(n,e),n=nj(2),r=es(t,n,2),r!==null&&(rj(n,r,t,e),cd(r,2),ka(r));break}}t=t.return}}function dg(e,t,n){var r=e.pingCache;if(r===null){r=e.pingCache=new D4;var a=new Set;r.set(t,a)}else a=r.get(t),a===void 0&&(a=new Set,r.set(t,a));a.has(n)||(Cb=!0,a.add(n),e=F4.bind(null,e,t,n),t.then(e,e))}function F4(e,t,n){var r=e.pingCache;r!==null&&r.delete(t),e.pingedLanes|=e.suspendedLanes&n,e.warmLanes&=~n,dt===e&&(Ze&n)===n&&(Lt===4||Lt===3&&(Ze&62914560)===Ze&&300>fr()-qm?!(Je&2)&&Kl(e,0):Nb|=n,Bl===Ze&&(Bl=0)),ka(e)}function qj(e,t){t===0&&(t=OC()),e=Co(e,t),e!==null&&(cd(e,t),ka(e))}function q4(e){var t=e.memoizedState,n=0;t!==null&&(n=t.retryLane),qj(e,n)}function H4(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(te(314))}r!==null&&r.delete(t),qj(e,n)}function B4(e,t){return H0(e,t)}var Mh=null,Fo=null,Wy=!1,Ph=!1,fg=!1,Qi=0;function ka(e){e!==Fo&&e.next===null&&(Fo===null?Mh=Fo=e:Fo=Fo.next=e),Ph=!0,Wy||(Wy=!0,K4())}function pd(e,t){if(!fg&&Ph){fg=!0;do for(var n=!1,r=Mh;r!==null;){if(e!==0){var a=r.pendingLanes;if(a===0)var i=0;else{var s=r.suspendedLanes,o=r.pingedLanes;i=(1<<31-mr(42|e)+1)-1,i&=a&~(s&~o),i=i&201326741?i&201326741|1:i?i|2:0}i!==0&&(n=!0,CS(r,i))}else i=Ze,i=Rm(r,r===dt?i:0,r.cancelPendingCommit!==null||r.timeoutHandle!==-1),!(i&3)||ld(r,i)||(n=!0,CS(r,i));r=r.next}while(n);fg=!1}}function V4(){Hj()}function Hj(){Ph=Wy=!1;var e=0;Qi!==0&&nz()&&(e=Qi);for(var t=fr(),n=null,r=Mh;r!==null;){var a=r.next,i=Bj(r,t);i===0?(r.next=null,n===null?Mh=a:n.next=a,a===null&&(Fo=n)):(n=r,(e!==0||i&3)&&(Ph=!0)),r=a}Jt!==0&&Jt!==5||pd(e),Qi!==0&&(Qi=0)}function Bj(e,t){for(var n=e.suspendedLanes,r=e.pingedLanes,a=e.expirationTimes,i=e.pendingLanes&-62914561;0<i;){var s=31-mr(i),o=1<<s,l=a[s];l===-1?(!(o&n)||o&r)&&(a[s]=vD(o,t)):l<=t&&(e.expiredLanes|=o),i&=~o}if(t=dt,n=Ze,n=Rm(e,e===t?n:0,e.cancelPendingCommit!==null||e.timeoutHandle!==-1),r=e.callbackNode,n===0||e===t&&(rt===2||rt===9)||e.cancelPendingCommit!==null)return r!==null&&r!==null&&Up(r),e.callbackNode=null,e.callbackPriority=0;if(!(n&3)||ld(e,n)){if(t=n&-n,t===e.callbackPriority)return t;switch(r!==null&&Up(r),V0(n)){case 2:case 8:n=RC;break;case 32:n=yh;break;case 268435456:n=$C;break;default:n=yh}return r=Vj.bind(null,e),n=H0(n,r),e.callbackPriority=t,e.callbackNode=n,t}return r!==null&&r!==null&&Up(r),e.callbackPriority=2,e.callbackNode=null,2}function Vj(e,t){if(Jt!==0&&Jt!==5)return e.callbackNode=null,e.callbackPriority=0,null;var n=e.callbackNode;if(Vm()&&e.callbackNode!==n)return null;var r=Ze;return r=Rm(e,e===dt?r:0,e.cancelPendingCommit!==null||e.timeoutHandle!==-1),r===0?null:(Aj(e,r,t),Bj(e,fr()),e.callbackNode!=null&&e.callbackNode===n?Vj.bind(null,e):null)}function CS(e,t){if(Vm())return null;Aj(e,t,!0)}function K4(){az(function(){Je&6?H0(AC,V4):Hj()})}function Tb(){if(Qi===0){var e=Fl;e===0&&(e=Bd,Bd<<=1,!(Bd&261888)&&(Bd=256)),Qi=e}return Qi}function NS(e){return e==null||typeof e=="symbol"||typeof e=="boolean"?null:typeof e=="function"?e:Mf(""+e)}function jS(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 Z4(e,t,n,r,a){if(t==="submit"&&n&&n.stateNode===a){var i=NS((a[er]||null).action),s=r.submitter;s&&(t=(t=s[er]||null)?NS(t.formAction):s.getAttribute("formAction"),t!==null&&(i=t,s=null));var o=new $m("action","action",null,r,a);e.push({event:o,listeners:[{instance:null,listener:function(){if(r.defaultPrevented){if(Qi!==0){var l=s?jS(a,s):new FormData(a);qy(n,{pending:!0,data:l,method:a.method,action:i},null,l)}}else typeof i=="function"&&(o.preventDefault(),l=s?jS(a,s):new FormData(a),qy(n,{pending:!0,data:l,method:a.method,action:i},i,l))},currentTarget:a}]})}}for(var hg=0;hg<Ay.length;hg++){var mg=Ay[hg],G4=mg.toLowerCase(),Q4=mg[0].toUpperCase()+mg.slice(1);ra(G4,"on"+Q4)}ra(rN,"onAnimationEnd");ra(aN,"onAnimationIteration");ra(iN,"onAnimationStart");ra("dblclick","onDoubleClick");ra("focusin","onFocus");ra("focusout","onBlur");ra(d4,"onTransitionRun");ra(f4,"onTransitionStart");ra(h4,"onTransitionCancel");ra(sN,"onTransitionEnd");Ll("onMouseEnter",["mouseout","mouseover"]);Ll("onMouseLeave",["mouseout","mouseover"]);Ll("onPointerEnter",["pointerout","pointerover"]);Ll("onPointerLeave",["pointerout","pointerover"]);_o("onChange","change click focusin focusout input keydown keyup selectionchange".split(" "));_o("onSelect","focusout contextmenu dragend focusin keydown keyup mousedown mouseup selectionchange".split(" "));_o("onBeforeInput",["compositionend","keypress","textInput","paste"]);_o("onCompositionEnd","compositionend focusout keydown keypress keyup mousedown".split(" "));_o("onCompositionStart","compositionstart focusout keydown keypress keyup mousedown".split(" "));_o("onCompositionUpdate","compositionupdate focusout keydown keypress keyup mousedown".split(" "));var Uu="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(" "),Y4=new Set("beforetoggle cancel close invalid load scroll scrollend toggle".split(" ").concat(Uu));function Kj(e,t){t=(t&4)!==0;for(var n=0;n<e.length;n++){var r=e[n],a=r.event;r=r.listeners;e:{var i=void 0;if(t)for(var s=r.length-1;0<=s;s--){var o=r[s],l=o.instance,u=o.currentTarget;if(o=o.listener,l!==i&&a.isPropagationStopped())break e;i=o,a.currentTarget=u;try{i(a)}catch(d){bh(d)}a.currentTarget=null,i=l}else for(s=0;s<r.length;s++){if(o=r[s],l=o.instance,u=o.currentTarget,o=o.listener,l!==i&&a.isPropagationStopped())break e;i=o,a.currentTarget=u;try{i(a)}catch(d){bh(d)}a.currentTarget=null,i=l}}}}function Be(e,t){var n=t[Sy];n===void 0&&(n=t[Sy]=new Set);var r=e+"__bubble";n.has(r)||(Zj(t,e,2,!1),n.add(r))}function pg(e,t,n){var r=0;t&&(r|=4),Zj(n,e,r,t)}var ef="_reactListening"+Math.random().toString(36).slice(2);function Ab(e){if(!e[ef]){e[ef]=!0,IC.forEach(function(n){n!=="selectionchange"&&(Y4.has(n)||pg(n,!1,e),pg(n,!0,e))});var t=e.nodeType===9?e:e.ownerDocument;t===null||t[ef]||(t[ef]=!0,pg("selectionchange",!1,t))}}function Zj(e,t,n,r){switch(s2(t)){case 2:var a=kz;break;case 8:a=Ez;break;default:a=Mb}n=a.bind(null,t,n,e),a=void 0,!Ny||t!=="touchstart"&&t!=="touchmove"&&t!=="wheel"||(a=!0),r?a!==void 0?e.addEventListener(t,n,{capture:!0,passive:a}):e.addEventListener(t,n,!0):a!==void 0?e.addEventListener(t,n,{passive:a}):e.addEventListener(t,n,!1)}function gg(e,t,n,r,a){var i=r;if(!(t&1)&&!(t&2)&&r!==null)e:for(;;){if(r===null)return;var s=r.tag;if(s===3||s===4){var o=r.stateNode.containerInfo;if(o===a)break;if(s===4)for(s=r.return;s!==null;){var l=s.tag;if((l===3||l===4)&&s.stateNode.containerInfo===a)return;s=s.return}for(;o!==null;){if(s=Xo(o),s===null)return;if(l=s.tag,l===5||l===6||l===26||l===27){r=i=s;continue e}o=o.parentNode}}r=r.return}KC(function(){var u=i,d=G0(n),f=[];e:{var m=oN.get(e);if(m!==void 0){var h=$m,y=e;switch(e){case"keypress":if(Df(n)===0)break e;case"keydown":case"keyup":h=HD;break;case"focusin":y="focus",h=Vp;break;case"focusout":y="blur",h=Vp;break;case"beforeblur":case"afterblur":h=Vp;break;case"click":if(n.button===2)break e;case"auxclick":case"dblclick":case"mousedown":case"mousemove":case"mouseup":case"mouseout":case"mouseover":case"contextmenu":h=D1;break;case"drag":case"dragend":case"dragenter":case"dragexit":case"dragleave":case"dragover":case"dragstart":case"drop":h=RD;break;case"touchcancel":case"touchend":case"touchmove":case"touchstart":h=KD;break;case rN:case aN:case iN:h=MD;break;case sN:h=GD;break;case"scroll":case"scrollend":h=TD;break;case"wheel":h=YD;break;case"copy":case"cut":case"paste":h=DD;break;case"gotpointercapture":case"lostpointercapture":case"pointercancel":case"pointerdown":case"pointermove":case"pointerout":case"pointerover":case"pointerup":h=I1;break;case"toggle":case"beforetoggle":h=WD}var p=(t&4)!==0,b=!p&&(e==="scroll"||e==="scrollend"),g=p?m!==null?m+"Capture":null:m;p=[];for(var v=u,w;v!==null;){var S=v;if(w=S.stateNode,S=S.tag,S!==5&&S!==26&&S!==27||w===null||g===null||(S=$u(v,g),S!=null&&p.push(Fu(v,S,w))),b)break;v=v.return}0<p.length&&(m=new h(m,y,null,n,d),f.push({event:m,listeners:p}))}}if(!(t&7)){e:{if(m=e==="mouseover"||e==="pointerover",h=e==="mouseout"||e==="pointerout",m&&n!==Cy&&(y=n.relatedTarget||n.fromElement)&&(Xo(y)||y[oc]))break e;if((h||m)&&(m=d.window===d?d:(m=d.ownerDocument)?m.defaultView||m.parentWindow:window,h?(y=n.relatedTarget||n.toElement,h=u,y=y?Xo(y):null,y!==null&&(b=sd(y),p=y.tag,y!==b||p!==5&&p!==27&&p!==6)&&(y=null)):(h=null,y=u),h!==y)){if(p=D1,S="onMouseLeave",g="onMouseEnter",v="mouse",(e==="pointerout"||e==="pointerover")&&(p=I1,S="onPointerLeave",g="onPointerEnter",v="pointer"),b=h==null?m:Zc(h),w=y==null?m:Zc(y),m=new p(S,v+"leave",h,n,d),m.target=b,m.relatedTarget=w,S=null,Xo(d)===u&&(p=new p(g,v+"enter",y,n,d),p.target=w,p.relatedTarget=b,S=p),b=S,h&&y)t:{for(p=X4,g=h,v=y,w=0,S=g;S;S=p(S))w++;S=0;for(var E=v;E;E=p(E))S++;for(;0<w-S;)g=p(g),w--;for(;0<S-w;)v=p(v),S--;for(;w--;){if(g===v||v!==null&&g===v.alternate){p=g;break t}g=p(g),v=p(v)}p=null}else p=null;h!==null&&TS(f,m,h,p,!1),y!==null&&b!==null&&TS(f,b,y,p,!0)}}e:{if(m=u?Zc(u):window,h=m.nodeName&&m.nodeName.toLowerCase(),h==="select"||h==="input"&&m.type==="file")var C=q1;else if(F1(m))if(WC)C=l4;else{C=s4;var T=i4}else h=m.nodeName,!h||h.toLowerCase()!=="input"||m.type!=="checkbox"&&m.type!=="radio"?u&&Z0(u.elementType)&&(C=q1):C=o4;if(C&&(C=C(e,u))){XC(f,C,n,d);break e}T&&T(e,m,u),e==="focusout"&&u&&m.type==="number"&&u.memoizedProps.value!=null&&Ey(m,"number",m.value)}switch(T=u?Zc(u):window,e){case"focusin":(F1(T)||T.contentEditable==="true")&&(el=T,jy=u,su=null);break;case"focusout":su=jy=el=null;break;case"mousedown":Ty=!0;break;case"contextmenu":case"mouseup":case"dragend":Ty=!1,Z1(f,n,d);break;case"selectionchange":if(u4)break;case"keydown":case"keyup":Z1(f,n,d)}var P;if(X0)e:{switch(e){case"compositionstart":var R="onCompositionStart";break e;case"compositionend":R="onCompositionEnd";break e;case"compositionupdate":R="onCompositionUpdate";break e}R=void 0}else Jo?QC(e,n)&&(R="onCompositionEnd"):e==="keydown"&&n.keyCode===229&&(R="onCompositionStart");R&&(GC&&n.locale!=="ko"&&(Jo||R!=="onCompositionStart"?R==="onCompositionEnd"&&Jo&&(P=ZC()):(Ki=d,Q0="value"in Ki?Ki.value:Ki.textContent,Jo=!0)),T=Dh(u,R),0<T.length&&(R=new z1(R,e,null,n,d),f.push({event:R,listeners:T}),P?R.data=P:(P=YC(n),P!==null&&(R.data=P)))),(P=e4?t4(e,n):n4(e,n))&&(R=Dh(u,"onBeforeInput"),0<R.length&&(T=new z1("onBeforeInput","beforeinput",null,n,d),f.push({event:T,listeners:R}),T.data=P)),Z4(f,e,u,n,d)}Kj(f,t)})}function Fu(e,t,n){return{instance:e,listener:t,currentTarget:n}}function Dh(e,t){for(var n=t+"Capture",r=[];e!==null;){var a=e,i=a.stateNode;if(a=a.tag,a!==5&&a!==26&&a!==27||i===null||(a=$u(e,n),a!=null&&r.unshift(Fu(e,a,i)),a=$u(e,t),a!=null&&r.push(Fu(e,a,i))),e.tag===3)return r;e=e.return}return[]}function X4(e){if(e===null)return null;do e=e.return;while(e&&e.tag!==5&&e.tag!==27);return e||null}function TS(e,t,n,r,a){for(var i=t._reactName,s=[];n!==null&&n!==r;){var o=n,l=o.alternate,u=o.stateNode;if(o=o.tag,l!==null&&l===r)break;o!==5&&o!==26&&o!==27||u===null||(l=u,a?(u=$u(n,i),u!=null&&s.unshift(Fu(n,u,l))):a||(u=$u(n,i),u!=null&&s.push(Fu(n,u,l)))),n=n.return}s.length!==0&&e.push({event:t,listeners:s})}var W4=/\r\n?/g,J4=/\u0000|\uFFFD/g;function AS(e){return(typeof e=="string"?e:""+e).replace(W4,`
49
+ `).replace(J4,"")}function Gj(e,t){return t=AS(t),AS(e)===t}function st(e,t,n,r,a,i){switch(n){case"children":typeof r=="string"?t==="body"||t==="textarea"&&r===""||Ul(e,r):(typeof r=="number"||typeof r=="bigint")&&t!=="body"&&Ul(e,""+r);break;case"className":Zd(e,"class",r);break;case"tabIndex":Zd(e,"tabindex",r);break;case"dir":case"role":case"viewBox":case"width":case"height":Zd(e,n,r);break;case"style":VC(e,r,i);break;case"data":if(t!=="object"){Zd(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=Mf(""+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}else typeof i=="function"&&(n==="formAction"?(t!=="input"&&st(e,t,"name",a.name,a,null),st(e,t,"formEncType",a.formEncType,a,null),st(e,t,"formMethod",a.formMethod,a,null),st(e,t,"formTarget",a.formTarget,a,null)):(st(e,t,"encType",a.encType,a,null),st(e,t,"method",a.method,a,null),st(e,t,"target",a.target,a,null)));if(r==null||typeof r=="symbol"||typeof r=="boolean"){e.removeAttribute(n);break}r=Mf(""+r),e.setAttribute(n,r);break;case"onClick":r!=null&&(e.onclick=Qa);break;case"onScroll":r!=null&&Be("scroll",e);break;case"onScrollEnd":r!=null&&Be("scrollend",e);break;case"dangerouslySetInnerHTML":if(r!=null){if(typeof r!="object"||!("__html"in r))throw Error(te(61));if(n=r.__html,n!=null){if(a.children!=null)throw Error(te(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=Mf(""+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":r===!0?e.setAttribute(n,""):r!==!1&&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":Be("beforetoggle",e),Be("toggle",e),Of(e,"popover",r);break;case"xlinkActuate":Aa(e,"http://www.w3.org/1999/xlink","xlink:actuate",r);break;case"xlinkArcrole":Aa(e,"http://www.w3.org/1999/xlink","xlink:arcrole",r);break;case"xlinkRole":Aa(e,"http://www.w3.org/1999/xlink","xlink:role",r);break;case"xlinkShow":Aa(e,"http://www.w3.org/1999/xlink","xlink:show",r);break;case"xlinkTitle":Aa(e,"http://www.w3.org/1999/xlink","xlink:title",r);break;case"xlinkType":Aa(e,"http://www.w3.org/1999/xlink","xlink:type",r);break;case"xmlBase":Aa(e,"http://www.w3.org/XML/1998/namespace","xml:base",r);break;case"xmlLang":Aa(e,"http://www.w3.org/XML/1998/namespace","xml:lang",r);break;case"xmlSpace":Aa(e,"http://www.w3.org/XML/1998/namespace","xml:space",r);break;case"is":Of(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=ND.get(n)||n,Of(e,n,r))}}function Jy(e,t,n,r,a,i){switch(n){case"style":VC(e,r,i);break;case"dangerouslySetInnerHTML":if(r!=null){if(typeof r!="object"||!("__html"in r))throw Error(te(61));if(n=r.__html,n!=null){if(a.children!=null)throw Error(te(60));e.innerHTML=n}}break;case"children":typeof r=="string"?Ul(e,r):(typeof r=="number"||typeof r=="bigint")&&Ul(e,""+r);break;case"onScroll":r!=null&&Be("scroll",e);break;case"onScrollEnd":r!=null&&Be("scrollend",e);break;case"onClick":r!=null&&(e.onclick=Qa);break;case"suppressContentEditableWarning":case"suppressHydrationWarning":case"innerHTML":case"ref":break;case"innerText":case"textContent":break;default:if(!LC.hasOwnProperty(n))e:{if(n[0]==="o"&&n[1]==="n"&&(a=n.endsWith("Capture"),t=n.slice(2,a?n.length-7:void 0),i=e[er]||null,i=i!=null?i[n]:null,typeof i=="function"&&e.removeEventListener(t,i,a),typeof r=="function")){typeof i!="function"&&i!==null&&(n in e?e[n]=null:e.hasAttribute(n)&&e.removeAttribute(n)),e.addEventListener(t,r,a);break e}n in e?e[n]=r:r===!0?e.setAttribute(n,""):Of(e,n,r)}}}function wn(e,t,n){switch(t){case"div":case"span":case"svg":case"path":case"a":case"g":case"p":case"li":break;case"img":Be("error",e),Be("load",e);var r=!1,a=!1,i;for(i in n)if(n.hasOwnProperty(i)){var s=n[i];if(s!=null)switch(i){case"src":r=!0;break;case"srcSet":a=!0;break;case"children":case"dangerouslySetInnerHTML":throw Error(te(137,t));default:st(e,t,i,s,n,null)}}a&&st(e,t,"srcSet",n.srcSet,n,null),r&&st(e,t,"src",n.src,n,null);return;case"input":Be("invalid",e);var o=i=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":i=d;break;case"defaultValue":o=d;break;case"children":case"dangerouslySetInnerHTML":if(d!=null)throw Error(te(137,t));break;default:st(e,t,r,d,n,null)}}qC(e,i,o,l,u,s,a,!1);return;case"select":Be("invalid",e),r=s=i=null;for(a in n)if(n.hasOwnProperty(a)&&(o=n[a],o!=null))switch(a){case"value":i=o;break;case"defaultValue":s=o;break;case"multiple":r=o;default:st(e,t,a,o,n,null)}t=i,n=s,e.multiple=!!r,t!=null?fl(e,!!r,t,!1):n!=null&&fl(e,!!r,n,!0);return;case"textarea":Be("invalid",e),i=a=r=null;for(s in n)if(n.hasOwnProperty(s)&&(o=n[s],o!=null))switch(s){case"value":r=o;break;case"defaultValue":a=o;break;case"children":i=o;break;case"dangerouslySetInnerHTML":if(o!=null)throw Error(te(91));break;default:st(e,t,s,o,n,null)}BC(e,r,a,i);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:st(e,t,l,r,n,null)}return;case"dialog":Be("beforetoggle",e),Be("toggle",e),Be("cancel",e),Be("close",e);break;case"iframe":case"object":Be("load",e);break;case"video":case"audio":for(r=0;r<Uu.length;r++)Be(Uu[r],e);break;case"image":Be("error",e),Be("load",e);break;case"details":Be("toggle",e);break;case"embed":case"source":case"link":Be("error",e),Be("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(te(137,t));default:st(e,t,u,r,n,null)}return;default:if(Z0(t)){for(d in n)n.hasOwnProperty(d)&&(r=n[d],r!==void 0&&Jy(e,t,d,r,n,void 0));return}}for(o in n)n.hasOwnProperty(o)&&(r=n[o],r!=null&&st(e,t,o,r,n,null))}function ez(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,i=null,s=null,o=null,l=null,u=null,d=null;for(h in n){var f=n[h];if(n.hasOwnProperty(h)&&f!=null)switch(h){case"checked":break;case"value":break;case"defaultValue":l=f;default:r.hasOwnProperty(h)||st(e,t,h,null,r,f)}}for(var m in r){var h=r[m];if(f=n[m],r.hasOwnProperty(m)&&(h!=null||f!=null))switch(m){case"type":i=h;break;case"name":a=h;break;case"checked":u=h;break;case"defaultChecked":d=h;break;case"value":s=h;break;case"defaultValue":o=h;break;case"children":case"dangerouslySetInnerHTML":if(h!=null)throw Error(te(137,t));break;default:h!==f&&st(e,t,m,h,r,f)}}ky(e,s,o,l,u,d,i,a);return;case"select":h=s=o=m=null;for(i in n)if(l=n[i],n.hasOwnProperty(i)&&l!=null)switch(i){case"value":break;case"multiple":h=l;default:r.hasOwnProperty(i)||st(e,t,i,null,r,l)}for(a in r)if(i=r[a],l=n[a],r.hasOwnProperty(a)&&(i!=null||l!=null))switch(a){case"value":m=i;break;case"defaultValue":o=i;break;case"multiple":s=i;default:i!==l&&st(e,t,a,i,r,l)}t=o,n=s,r=h,m!=null?fl(e,!!n,m,!1):!!r!=!!n&&(t!=null?fl(e,!!n,t,!0):fl(e,!!n,n?[]:"",!1));return;case"textarea":h=m=null;for(o in n)if(a=n[o],n.hasOwnProperty(o)&&a!=null&&!r.hasOwnProperty(o))switch(o){case"value":break;case"children":break;default:st(e,t,o,null,r,a)}for(s in r)if(a=r[s],i=n[s],r.hasOwnProperty(s)&&(a!=null||i!=null))switch(s){case"value":m=a;break;case"defaultValue":h=a;break;case"children":break;case"dangerouslySetInnerHTML":if(a!=null)throw Error(te(91));break;default:a!==i&&st(e,t,s,a,r,i)}HC(e,m,h);return;case"option":for(var y in n)if(m=n[y],n.hasOwnProperty(y)&&m!=null&&!r.hasOwnProperty(y))switch(y){case"selected":e.selected=!1;break;default:st(e,t,y,null,r,m)}for(l in r)if(m=r[l],h=n[l],r.hasOwnProperty(l)&&m!==h&&(m!=null||h!=null))switch(l){case"selected":e.selected=m&&typeof m!="function"&&typeof m!="symbol";break;default:st(e,t,l,m,r,h)}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 p in n)m=n[p],n.hasOwnProperty(p)&&m!=null&&!r.hasOwnProperty(p)&&st(e,t,p,null,r,m);for(u in r)if(m=r[u],h=n[u],r.hasOwnProperty(u)&&m!==h&&(m!=null||h!=null))switch(u){case"children":case"dangerouslySetInnerHTML":if(m!=null)throw Error(te(137,t));break;default:st(e,t,u,m,r,h)}return;default:if(Z0(t)){for(var b in n)m=n[b],n.hasOwnProperty(b)&&m!==void 0&&!r.hasOwnProperty(b)&&Jy(e,t,b,void 0,r,m);for(d in r)m=r[d],h=n[d],!r.hasOwnProperty(d)||m===h||m===void 0&&h===void 0||Jy(e,t,d,m,r,h);return}}for(var g in n)m=n[g],n.hasOwnProperty(g)&&m!=null&&!r.hasOwnProperty(g)&&st(e,t,g,null,r,m);for(f in r)m=r[f],h=n[f],!r.hasOwnProperty(f)||m===h||m==null&&h==null||st(e,t,f,m,r,h)}function RS(e){switch(e){case"css":case"script":case"font":case"img":case"image":case"input":case"link":return!0;default:return!1}}function tz(){if(typeof performance.getEntriesByType=="function"){for(var e=0,t=0,n=performance.getEntriesByType("resource"),r=0;r<n.length;r++){var a=n[r],i=a.transferSize,s=a.initiatorType,o=a.duration;if(i&&o&&RS(s)){for(s=0,o=a.responseEnd,r+=1;r<n.length;r++){var l=n[r],u=l.startTime;if(u>o)break;var d=l.transferSize,f=l.initiatorType;d&&RS(f)&&(l=l.responseEnd,s+=d*(l<o?1:(o-u)/(l-u)))}if(--r,t+=8*(i+s)/(a.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 ev=null,tv=null;function zh(e){return e.nodeType===9?e:e.ownerDocument}function $S(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 Qj(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 nv(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 yg=null;function nz(){var e=window.event;return e&&e.type==="popstate"?e===yg?!1:(yg=e,!0):(yg=null,!1)}var Yj=typeof setTimeout=="function"?setTimeout:void 0,rz=typeof clearTimeout=="function"?clearTimeout:void 0,OS=typeof Promise=="function"?Promise:void 0,az=typeof queueMicrotask=="function"?queueMicrotask:typeof OS<"u"?function(e){return OS.resolve(null).then(e).catch(iz)}:Yj;function iz(e){setTimeout(function(){throw e})}function ys(e){return e==="head"}function MS(e,t){var n=t,r=0;do{var a=n.nextSibling;if(e.removeChild(n),a&&a.nodeType===8)if(n=a.data,n==="/$"||n==="/&"){if(r===0){e.removeChild(a),Gl(t);return}r--}else if(n==="$"||n==="$?"||n==="$~"||n==="$!"||n==="&")r++;else if(n==="html")gu(e.ownerDocument.documentElement);else if(n==="head"){n=e.ownerDocument.head,gu(n);for(var i=n.firstChild;i;){var s=i.nextSibling,o=i.nodeName;i[ud]||o==="SCRIPT"||o==="STYLE"||o==="LINK"&&i.rel.toLowerCase()==="stylesheet"||n.removeChild(i),i=s}}else n==="body"&&gu(e.ownerDocument.body);n=a}while(n);Gl(t)}function PS(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 rv(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":rv(n),K0(n);continue;case"SCRIPT":case"STYLE":continue;case"LINK":if(n.rel.toLowerCase()==="stylesheet")continue}e.removeChild(n)}}function sz(e,t,n,r){for(;e.nodeType===1;){var a=n;if(e.nodeName.toLowerCase()!==t.toLowerCase()){if(!r&&(e.nodeName!=="INPUT"||e.type!=="hidden"))break}else if(r){if(!e[ud])switch(t){case"meta":if(!e.hasAttribute("itemprop"))break;return e;case"link":if(i=e.getAttribute("rel"),i==="stylesheet"&&e.hasAttribute("data-precedence"))break;if(i!==a.rel||e.getAttribute("href")!==(a.href==null||a.href===""?null:a.href)||e.getAttribute("crossorigin")!==(a.crossOrigin==null?null:a.crossOrigin)||e.getAttribute("title")!==(a.title==null?null:a.title))break;return e;case"style":if(e.hasAttribute("data-precedence"))break;return e;case"script":if(i=e.getAttribute("src"),(i!==(a.src==null?null:a.src)||e.getAttribute("type")!==(a.type==null?null:a.type)||e.getAttribute("crossorigin")!==(a.crossOrigin==null?null:a.crossOrigin))&&i&&e.hasAttribute("async")&&!e.hasAttribute("itemprop"))break;return e;default:return e}}else if(t==="input"&&e.type==="hidden"){var i=a.name==null?null:""+a.name;if(a.type==="hidden"&&e.getAttribute("name")===i)return e}else return e;if(e=zr(e.nextSibling),e===null)break}return null}function oz(e,t,n){if(t==="")return null;for(;e.nodeType!==3;)if((e.nodeType!==1||e.nodeName!=="INPUT"||e.type!=="hidden")&&!n||(e=zr(e.nextSibling),e===null))return null;return e}function Xj(e,t){for(;e.nodeType!==8;)if((e.nodeType!==1||e.nodeName!=="INPUT"||e.type!=="hidden")&&!t||(e=zr(e.nextSibling),e===null))return null;return e}function av(e){return e.data==="$?"||e.data==="$~"}function iv(e){return e.data==="$!"||e.data==="$?"&&e.ownerDocument.readyState!=="loading"}function lz(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 zr(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 sv=null;function DS(e){e=e.nextSibling;for(var t=0;e;){if(e.nodeType===8){var n=e.data;if(n==="/$"||n==="/&"){if(t===0)return zr(e.nextSibling);t--}else n!=="$"&&n!=="$!"&&n!=="$?"&&n!=="$~"&&n!=="&"||t++}e=e.nextSibling}return null}function zS(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 Wj(e,t,n){switch(t=zh(n),e){case"html":if(e=t.documentElement,!e)throw Error(te(452));return e;case"head":if(e=t.head,!e)throw Error(te(453));return e;case"body":if(e=t.body,!e)throw Error(te(454));return e;default:throw Error(te(451))}}function gu(e){for(var t=e.attributes;t.length;)e.removeAttributeNode(t[0]);K0(e)}var Ir=new Map,IS=new Set;function Ih(e){return typeof e.getRootNode=="function"?e.getRootNode():e.nodeType===9?e:e.ownerDocument}var di=et.d;et.d={f:cz,r:uz,D:dz,C:fz,L:hz,m:mz,X:gz,S:pz,M:yz};function cz(){var e=di.f(),t=Hm();return e||t}function uz(e){var t=lc(e);t!==null&&t.tag===5&&t.type==="form"?VN(t):di.r(e)}var fc=typeof document>"u"?null:document;function Jj(e,t,n){var r=fc;if(r&&typeof t=="string"&&t){var a=Or(t);a='link[rel="'+e+'"][href="'+a+'"]',typeof n=="string"&&(a+='[crossorigin="'+n+'"]'),IS.has(a)||(IS.add(a),e={rel:e,crossOrigin:n,href:t},r.querySelector(a)===null&&(t=r.createElement("link"),wn(t,"link",e),on(t),r.head.appendChild(t)))}}function dz(e){di.D(e),Jj("dns-prefetch",e,null)}function fz(e,t){di.C(e,t),Jj("preconnect",e,t)}function hz(e,t,n){di.L(e,t,n);var r=fc;if(r&&e&&t){var a='link[rel="preload"][as="'+Or(t)+'"]';t==="image"&&n&&n.imageSrcSet?(a+='[imagesrcset="'+Or(n.imageSrcSet)+'"]',typeof n.imageSizes=="string"&&(a+='[imagesizes="'+Or(n.imageSizes)+'"]')):a+='[href="'+Or(e)+'"]';var i=a;switch(t){case"style":i=Zl(e);break;case"script":i=hc(e)}Ir.has(i)||(e=jt({rel:"preload",href:t==="image"&&n&&n.imageSrcSet?void 0:e,as:t},n),Ir.set(i,e),r.querySelector(a)!==null||t==="style"&&r.querySelector(gd(i))||t==="script"&&r.querySelector(yd(i))||(t=r.createElement("link"),wn(t,"link",e),on(t),r.head.appendChild(t)))}}function mz(e,t){di.m(e,t);var n=fc;if(n&&e){var r=t&&typeof t.as=="string"?t.as:"script",a='link[rel="modulepreload"][as="'+Or(r)+'"][href="'+Or(e)+'"]',i=a;switch(r){case"audioworklet":case"paintworklet":case"serviceworker":case"sharedworker":case"worker":case"script":i=hc(e)}if(!Ir.has(i)&&(e=jt({rel:"modulepreload",href:e},t),Ir.set(i,e),n.querySelector(a)===null)){switch(r){case"audioworklet":case"paintworklet":case"serviceworker":case"sharedworker":case"worker":case"script":if(n.querySelector(yd(i)))return}r=n.createElement("link"),wn(r,"link",e),on(r),n.head.appendChild(r)}}}function pz(e,t,n){di.S(e,t,n);var r=fc;if(r&&e){var a=dl(r).hoistableStyles,i=Zl(e);t=t||"default";var s=a.get(i);if(!s){var o={loading:0,preload:null};if(s=r.querySelector(gd(i)))o.loading=5;else{e=jt({rel:"stylesheet",href:e,"data-precedence":t},n),(n=Ir.get(i))&&Rb(e,n);var l=s=r.createElement("link");on(l),wn(l,"link",e),l._p=new Promise(function(u,d){l.onload=u,l.onerror=d}),l.addEventListener("load",function(){o.loading|=1}),l.addEventListener("error",function(){o.loading|=2}),o.loading|=4,Bf(s,t,r)}s={type:"stylesheet",instance:s,count:1,state:o},a.set(i,s)}}}function gz(e,t){di.X(e,t);var n=fc;if(n&&e){var r=dl(n).hoistableScripts,a=hc(e),i=r.get(a);i||(i=n.querySelector(yd(a)),i||(e=jt({src:e,async:!0},t),(t=Ir.get(a))&&$b(e,t),i=n.createElement("script"),on(i),wn(i,"link",e),n.head.appendChild(i)),i={type:"script",instance:i,count:1,state:null},r.set(a,i))}}function yz(e,t){di.M(e,t);var n=fc;if(n&&e){var r=dl(n).hoistableScripts,a=hc(e),i=r.get(a);i||(i=n.querySelector(yd(a)),i||(e=jt({src:e,async:!0,type:"module"},t),(t=Ir.get(a))&&$b(e,t),i=n.createElement("script"),on(i),wn(i,"link",e),n.head.appendChild(i)),i={type:"script",instance:i,count:1,state:null},r.set(a,i))}}function LS(e,t,n,r){var a=(a=Xi.current)?Ih(a):null;if(!a)throw Error(te(446));switch(e){case"meta":case"title":return null;case"style":return typeof n.precedence=="string"&&typeof n.href=="string"?(t=Zl(n.href),n=dl(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=Zl(n.href);var i=dl(a).hoistableStyles,s=i.get(e);if(s||(a=a.ownerDocument||a,s={type:"stylesheet",instance:null,count:0,state:{loading:0,preload:null}},i.set(e,s),(i=a.querySelector(gd(e)))&&!i._p&&(s.instance=i,s.state.loading=5),Ir.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},Ir.set(e,n),i||vz(a,e,n,s.state))),t&&r===null)throw Error(te(528,""));return s}if(t&&r!==null)throw Error(te(529,""));return null;case"script":return t=n.async,n=n.src,typeof n=="string"&&t&&typeof t!="function"&&typeof t!="symbol"?(t=hc(n),n=dl(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(te(444,e))}}function Zl(e){return'href="'+Or(e)+'"'}function gd(e){return'link[rel="stylesheet"]['+e+"]"}function e2(e){return jt({},e,{"data-precedence":e.precedence,precedence:null})}function vz(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}),wn(t,"link",n),on(t),e.head.appendChild(t))}function hc(e){return'[src="'+Or(e)+'"]'}function yd(e){return"script[async]"+e}function US(e,t,n){if(t.count++,t.instance===null)switch(t.type){case"style":var r=e.querySelector('style[data-href~="'+Or(n.href)+'"]');if(r)return t.instance=r,on(r),r;var a=jt({},n,{"data-href":n.href,"data-precedence":n.precedence,href:null,precedence:null});return r=(e.ownerDocument||e).createElement("style"),on(r),wn(r,"style",a),Bf(r,n.precedence,e),t.instance=r;case"stylesheet":a=Zl(n.href);var i=e.querySelector(gd(a));if(i)return t.state.loading|=4,t.instance=i,on(i),i;r=e2(n),(a=Ir.get(a))&&Rb(r,a),i=(e.ownerDocument||e).createElement("link"),on(i);var s=i;return s._p=new Promise(function(o,l){s.onload=o,s.onerror=l}),wn(i,"link",r),t.state.loading|=4,Bf(i,n.precedence,e),t.instance=i;case"script":return i=hc(n.src),(a=e.querySelector(yd(i)))?(t.instance=a,on(a),a):(r=n,(a=Ir.get(i))&&(r=jt({},n),$b(r,a)),e=e.ownerDocument||e,a=e.createElement("script"),on(a),wn(a,"link",r),e.head.appendChild(a),t.instance=a);case"void":return null;default:throw Error(te(443,t.type))}else t.type==="stylesheet"&&!(t.state.loading&4)&&(r=t.instance,t.state.loading|=4,Bf(r,n.precedence,e));return t.instance}function Bf(e,t,n){for(var r=n.querySelectorAll('link[rel="stylesheet"][data-precedence],style[data-precedence]'),a=r.length?r[r.length-1]:null,i=a,s=0;s<r.length;s++){var o=r[s];if(o.dataset.precedence===t)i=o;else if(i!==a)break}i?i.parentNode.insertBefore(e,i.nextSibling):(t=n.nodeType===9?n.head:n,t.insertBefore(e,t.firstChild))}function Rb(e,t){e.crossOrigin==null&&(e.crossOrigin=t.crossOrigin),e.referrerPolicy==null&&(e.referrerPolicy=t.referrerPolicy),e.title==null&&(e.title=t.title)}function $b(e,t){e.crossOrigin==null&&(e.crossOrigin=t.crossOrigin),e.referrerPolicy==null&&(e.referrerPolicy=t.referrerPolicy),e.integrity==null&&(e.integrity=t.integrity)}var Vf=null;function FS(e,t,n){if(Vf===null){var r=new Map,a=Vf=new Map;a.set(n,r)}else a=Vf,r=a.get(n),r||(r=new Map,a.set(n,r));if(r.has(e))return r;for(r.set(e,null),n=n.getElementsByTagName(e),a=0;a<n.length;a++){var i=n[a];if(!(i[ud]||i[yn]||e==="link"&&i.getAttribute("rel")==="stylesheet")&&i.namespaceURI!=="http://www.w3.org/2000/svg"){var s=i.getAttribute(t)||"";s=e+s;var o=r.get(s);o?o.push(i):r.set(s,[i])}}return r}function qS(e,t,n){e=e.ownerDocument||e,e.head.insertBefore(n,t==="title"?e.querySelector("head > title"):null)}function bz(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 t2(e){return!(e.type==="stylesheet"&&!(e.state.loading&3))}function xz(e,t,n,r){if(n.type==="stylesheet"&&(typeof r.media!="string"||matchMedia(r.media).matches!==!1)&&!(n.state.loading&4)){if(n.instance===null){var a=Zl(r.href),i=t.querySelector(gd(a));if(i){t=i._p,t!==null&&typeof t=="object"&&typeof t.then=="function"&&(e.count++,e=Lh.bind(e),t.then(e,e)),n.state.loading|=4,n.instance=i,on(i);return}i=t.ownerDocument||t,r=e2(r),(a=Ir.get(a))&&Rb(r,a),i=i.createElement("link"),on(i);var s=i;s._p=new Promise(function(o,l){s.onload=o,s.onerror=l}),wn(i,"link",r),n.instance=i}e.stylesheets===null&&(e.stylesheets=new Map),e.stylesheets.set(n,t),(t=n.state.preload)&&!(n.state.loading&3)&&(e.count++,n=Lh.bind(e),t.addEventListener("load",n),t.addEventListener("error",n))}}var vg=0;function wz(e,t){return e.stylesheets&&e.count===0&&Kf(e,e.stylesheets),0<e.count||0<e.imgCount?function(n){var r=setTimeout(function(){if(e.stylesheets&&Kf(e,e.stylesheets),e.unsuspend){var i=e.unsuspend;e.unsuspend=null,i()}},6e4+t);0<e.imgBytes&&vg===0&&(vg=62500*tz());var a=setTimeout(function(){if(e.waitingForImages=!1,e.count===0&&(e.stylesheets&&Kf(e,e.stylesheets),e.unsuspend)){var i=e.unsuspend;e.unsuspend=null,i()}},(e.imgBytes>vg?50:800)+t);return e.unsuspend=n,function(){e.unsuspend=null,clearTimeout(r),clearTimeout(a)}}:null}function Lh(){if(this.count--,this.count===0&&(this.imgCount===0||!this.waitingForImages)){if(this.stylesheets)Kf(this,this.stylesheets);else if(this.unsuspend){var e=this.unsuspend;this.unsuspend=null,e()}}}var Uh=null;function Kf(e,t){e.stylesheets=null,e.unsuspend!==null&&(e.count++,Uh=new Map,t.forEach(Sz,e),Uh=null,Lh.call(e))}function Sz(e,t){if(!(t.state.loading&4)){var n=Uh.get(e);if(n)var r=n.get(null);else{n=new Map,Uh.set(e,n);for(var a=e.querySelectorAll("link[data-precedence],style[data-precedence]"),i=0;i<a.length;i++){var s=a[i];(s.nodeName==="LINK"||s.getAttribute("media")!=="not all")&&(n.set(s.dataset.precedence,s),r=s)}r&&n.set(null,r)}a=t.instance,s=a.getAttribute("data-precedence"),i=n.get(s)||r,i===r&&n.set(null,a),n.set(s,a),this.count++,r=Lh.bind(this),a.addEventListener("load",r),a.addEventListener("error",r),i?i.parentNode.insertBefore(a,i.nextSibling):(e=e.nodeType===9?e.head:e,e.insertBefore(a,e.firstChild)),t.state.loading|=4}}var qu={$$typeof:Ga,Provider:null,Consumer:null,_currentValue:Ws,_currentValue2:Ws,_threadCount:0};function _z(e,t,n,r,a,i,s,o,l){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=Fp(-1),this.entangledLanes=this.shellSuspendCounter=this.errorRecoveryDisabledLanes=this.expiredLanes=this.warmLanes=this.pingedLanes=this.suspendedLanes=this.pendingLanes=0,this.entanglements=Fp(0),this.hiddenUpdates=Fp(null),this.identifierPrefix=r,this.onUncaughtError=a,this.onCaughtError=i,this.onRecoverableError=s,this.pooledCache=null,this.pooledCacheLanes=0,this.formState=l,this.incompleteTransitions=new Map}function n2(e,t,n,r,a,i,s,o,l,u,d,f){return e=new _z(e,t,n,s,l,u,d,f,o),t=1,i===!0&&(t|=24),i=ur(3,null,null,t),e.current=i,i.stateNode=e,t=ab(),t.refCount++,e.pooledCache=t,t.refCount++,i.memoizedState={element:r,isDehydrated:n,cache:t},ob(i),e}function r2(e){return e?(e=rl,e):rl}function a2(e,t,n,r,a,i){a=r2(a),r.context===null?r.context=a:r.pendingContext=a,r=Ji(t),r.payload={element:n},i=i===void 0?null:i,i!==null&&(r.callback=i),n=es(e,r,t),n!==null&&(Jn(n,e,t),lu(n,e,t))}function HS(e,t){if(e=e.memoizedState,e!==null&&e.dehydrated!==null){var n=e.retryLane;e.retryLane=n!==0&&n<t?n:t}}function Ob(e,t){HS(e,t),(e=e.alternate)&&HS(e,t)}function i2(e){if(e.tag===13||e.tag===31){var t=Co(e,67108864);t!==null&&Jn(t,e,67108864),Ob(e,67108864)}}function BS(e){if(e.tag===13||e.tag===31){var t=pr();t=B0(t);var n=Co(e,t);n!==null&&Jn(n,e,t),Ob(e,t)}}var Fh=!0;function kz(e,t,n,r){var a=Re.T;Re.T=null;var i=et.p;try{et.p=2,Mb(e,t,n,r)}finally{et.p=i,Re.T=a}}function Ez(e,t,n,r){var a=Re.T;Re.T=null;var i=et.p;try{et.p=8,Mb(e,t,n,r)}finally{et.p=i,Re.T=a}}function Mb(e,t,n,r){if(Fh){var a=ov(r);if(a===null)gg(e,t,r,qh,n),VS(e,r);else if(Nz(a,e,t,n,r))r.stopPropagation();else if(VS(e,r),t&4&&-1<Cz.indexOf(e)){for(;a!==null;){var i=lc(a);if(i!==null)switch(i.tag){case 3:if(i=i.stateNode,i.current.memoizedState.isDehydrated){var s=$s(i.pendingLanes);if(s!==0){var o=i;for(o.pendingLanes|=2,o.entangledLanes|=2;s;){var l=1<<31-mr(s);o.entanglements[1]|=l,s&=~l}ka(i),!(Je&6)&&(Rh=fr()+500,pd(0))}}break;case 31:case 13:o=Co(i,2),o!==null&&Jn(o,i,2),Hm(),Ob(i,2)}if(i=ov(r),i===null&&gg(e,t,r,qh,n),i===a)break;a=i}a!==null&&r.stopPropagation()}else gg(e,t,r,null,n)}}function ov(e){return e=G0(e),Pb(e)}var qh=null;function Pb(e){if(qh=null,e=Xo(e),e!==null){var t=sd(e);if(t===null)e=null;else{var n=t.tag;if(n===13){if(e=EC(t),e!==null)return e;e=null}else if(n===31){if(e=CC(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 qh=e,null}function s2(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(dD()){case AC:return 2;case RC:return 8;case yh:case fD:return 32;case $C:return 268435456;default:return 32}default:return 32}}var lv=!1,rs=null,as=null,is=null,Hu=new Map,Bu=new Map,Mi=[],Cz="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 VS(e,t){switch(e){case"focusin":case"focusout":rs=null;break;case"dragenter":case"dragleave":as=null;break;case"mouseover":case"mouseout":is=null;break;case"pointerover":case"pointerout":Hu.delete(t.pointerId);break;case"gotpointercapture":case"lostpointercapture":Bu.delete(t.pointerId)}}function Mc(e,t,n,r,a,i){return e===null||e.nativeEvent!==i?(e={blockedOn:t,domEventName:n,eventSystemFlags:r,nativeEvent:i,targetContainers:[a]},t!==null&&(t=lc(t),t!==null&&i2(t)),e):(e.eventSystemFlags|=r,t=e.targetContainers,a!==null&&t.indexOf(a)===-1&&t.push(a),e)}function Nz(e,t,n,r,a){switch(t){case"focusin":return rs=Mc(rs,e,t,n,r,a),!0;case"dragenter":return as=Mc(as,e,t,n,r,a),!0;case"mouseover":return is=Mc(is,e,t,n,r,a),!0;case"pointerover":var i=a.pointerId;return Hu.set(i,Mc(Hu.get(i)||null,e,t,n,r,a)),!0;case"gotpointercapture":return i=a.pointerId,Bu.set(i,Mc(Bu.get(i)||null,e,t,n,r,a)),!0}return!1}function o2(e){var t=Xo(e.target);if(t!==null){var n=sd(t);if(n!==null){if(t=n.tag,t===13){if(t=EC(n),t!==null){e.blockedOn=t,T1(e.priority,function(){BS(n)});return}}else if(t===31){if(t=CC(n),t!==null){e.blockedOn=t,T1(e.priority,function(){BS(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 Zf(e){if(e.blockedOn!==null)return!1;for(var t=e.targetContainers;0<t.length;){var n=ov(e.nativeEvent);if(n===null){n=e.nativeEvent;var r=new n.constructor(n.type,n);Cy=r,n.target.dispatchEvent(r),Cy=null}else return t=lc(n),t!==null&&i2(t),e.blockedOn=n,!1;t.shift()}return!0}function KS(e,t,n){Zf(e)&&n.delete(t)}function jz(){lv=!1,rs!==null&&Zf(rs)&&(rs=null),as!==null&&Zf(as)&&(as=null),is!==null&&Zf(is)&&(is=null),Hu.forEach(KS),Bu.forEach(KS)}function tf(e,t){e.blockedOn===t&&(e.blockedOn=null,lv||(lv=!0,tn.unstable_scheduleCallback(tn.unstable_NormalPriority,jz)))}var nf=null;function ZS(e){nf!==e&&(nf=e,tn.unstable_scheduleCallback(tn.unstable_NormalPriority,function(){nf===e&&(nf=null);for(var t=0;t<e.length;t+=3){var n=e[t],r=e[t+1],a=e[t+2];if(typeof r!="function"){if(Pb(r||n)===null)continue;break}var i=lc(n);i!==null&&(e.splice(t,3),t-=3,qy(i,{pending:!0,data:a,method:n.method,action:r},r,a))}}))}function Gl(e){function t(l){return tf(l,e)}rs!==null&&tf(rs,e),as!==null&&tf(as,e),is!==null&&tf(is,e),Hu.forEach(t),Bu.forEach(t);for(var n=0;n<Mi.length;n++){var r=Mi[n];r.blockedOn===e&&(r.blockedOn=null)}for(;0<Mi.length&&(n=Mi[0],n.blockedOn===null);)o2(n),n.blockedOn===null&&Mi.shift();if(n=(e.ownerDocument||e).$$reactFormReplay,n!=null)for(r=0;r<n.length;r+=3){var a=n[r],i=n[r+1],s=a[er]||null;if(typeof i=="function")s||ZS(n);else if(s){var o=null;if(i&&i.hasAttribute("formAction")){if(a=i,s=i[er]||null)o=s.formAction;else if(Pb(a)!==null)continue}else o=s.action;typeof o=="function"?n[r+1]=o:(n.splice(r,3),r-=3),ZS(n)}}}function l2(){function e(i){i.canIntercept&&i.info==="react-transition"&&i.intercept({handler:function(){return new Promise(function(s){return a=s})},focusReset:"manual",scroll:"manual"})}function t(){a!==null&&(a(),a=null),r||setTimeout(n,20)}function n(){if(!r&&!navigation.transition){var i=navigation.currentEntry;i&&i.url!=null&&navigation.navigate(i.url,{state:i.getState(),info:"react-transition",history:"replace"})}}if(typeof navigation=="object"){var r=!1,a=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),a!==null&&(a(),a=null)}}}function Db(e){this._internalRoot=e}Km.prototype.render=Db.prototype.render=function(e){var t=this._internalRoot;if(t===null)throw Error(te(409));var n=t.current,r=pr();a2(n,r,e,t,null,null)};Km.prototype.unmount=Db.prototype.unmount=function(){var e=this._internalRoot;if(e!==null){this._internalRoot=null;var t=e.containerInfo;a2(e.current,2,null,e,null,null),Hm(),t[oc]=null}};function Km(e){this._internalRoot=e}Km.prototype.unstable_scheduleHydration=function(e){if(e){var t=zC();e={blockedOn:null,target:e,priority:t};for(var n=0;n<Mi.length&&t!==0&&t<Mi[n].priority;n++);Mi.splice(n,0,e),n===0&&o2(e)}};var GS=_C.version;if(GS!=="19.2.8")throw Error(te(527,GS,"19.2.8"));et.findDOMNode=function(e){var t=e._reactInternals;if(t===void 0)throw typeof e.render=="function"?Error(te(188)):(e=Object.keys(e).join(","),Error(te(268,e)));return e=aD(t),e=e!==null?NC(e):null,e=e===null?null:e.stateNode,e};var Tz={bundleType:0,version:"19.2.8",rendererPackageName:"react-dom",currentDispatcherRef:Re,reconcilerVersion:"19.2.8"};if(typeof __REACT_DEVTOOLS_GLOBAL_HOOK__<"u"){var rf=__REACT_DEVTOOLS_GLOBAL_HOOK__;if(!rf.isDisabled&&rf.supportsFiber)try{od=rf.inject(Tz),hr=rf}catch{}}Tm.createRoot=function(e,t){if(!kC(e))throw Error(te(299));var n=!1,r="",a=JN,i=ej,s=tj;return t!=null&&(t.unstable_strictMode===!0&&(n=!0),t.identifierPrefix!==void 0&&(r=t.identifierPrefix),t.onUncaughtError!==void 0&&(a=t.onUncaughtError),t.onCaughtError!==void 0&&(i=t.onCaughtError),t.onRecoverableError!==void 0&&(s=t.onRecoverableError)),t=n2(e,1,!1,null,null,n,r,null,a,i,s,l2),e[oc]=t.current,Ab(e),new Db(t)};Tm.hydrateRoot=function(e,t,n){if(!kC(e))throw Error(te(299));var r=!1,a="",i=JN,s=ej,o=tj,l=null;return n!=null&&(n.unstable_strictMode===!0&&(r=!0),n.identifierPrefix!==void 0&&(a=n.identifierPrefix),n.onUncaughtError!==void 0&&(i=n.onUncaughtError),n.onCaughtError!==void 0&&(s=n.onCaughtError),n.onRecoverableError!==void 0&&(o=n.onRecoverableError),n.formState!==void 0&&(l=n.formState)),t=n2(e,1,!0,t,n??null,r,a,l,i,s,o,l2),t.context=r2(null),n=t.current,r=pr(),r=B0(r),a=Ji(r),a.callback=null,es(n,a,r),n=r,t.current.lanes=n,cd(t,n),ka(t),e[oc]=t.current,Ab(e),new Km(t)};Tm.version="19.2.8";function c2(){if(!(typeof __REACT_DEVTOOLS_GLOBAL_HOOK__>"u"||typeof __REACT_DEVTOOLS_GLOBAL_HOOK__.checkDCE!="function"))try{__REACT_DEVTOOLS_GLOBAL_HOOK__.checkDCE(c2)}catch(e){console.error(e)}}c2(),uC.exports=Tm;var Az=uC.exports;function Rz(e,t){if(e instanceof RegExp)return{keys:!1,pattern:e};var n,r,a,i,s=[],o="",l=e.split("/");for(l[0]||l.shift();a=l.shift();)n=a[0],n==="*"?(s.push(n),o+=a[1]==="?"?"(?:/(.*))?":"/(.*)"):n===":"?(r=a.indexOf("?",1),i=a.indexOf(".",1),s.push(a.substring(1,~r?r:~i?i:a.length)),o+=~r&&!~i?"(?:/([^/]+?))?":"/([^/]+?)",~i&&(o+=(~r?"?":"")+"\\"+a.substring(i))):o+="/"+a;return{keys:s,pattern:new RegExp("^"+o+(t?"(?=$|/)":"/?$"),"i")}}var u2={exports:{}},d2={};/**
50
+ * @license React
51
+ * use-sync-external-store-shim.production.js
52
+ *
53
+ * Copyright (c) Meta Platforms, Inc. and affiliates.
54
+ *
55
+ * This source code is licensed under the MIT license found in the
56
+ * LICENSE file in the root directory of this source tree.
57
+ */var Ql=x;function $z(e,t){return e===t&&(e!==0||1/e===1/t)||e!==e&&t!==t}var Oz=typeof Object.is=="function"?Object.is:$z,Mz=Ql.useState,Pz=Ql.useEffect,Dz=Ql.useLayoutEffect,zz=Ql.useDebugValue;function Iz(e,t){var n=t(),r=Mz({inst:{value:n,getSnapshot:t}}),a=r[0].inst,i=r[1];return Dz(function(){a.value=n,a.getSnapshot=t,bg(a)&&i({inst:a})},[e,n,t]),Pz(function(){return bg(a)&&i({inst:a}),e(function(){bg(a)&&i({inst:a})})},[e]),zz(n),n}function bg(e){var t=e.getSnapshot;e=e.value;try{var n=t();return!Oz(e,n)}catch{return!0}}function Lz(e,t){return t()}var Uz=typeof window>"u"||typeof window.document>"u"||typeof window.document.createElement>"u"?Lz:Iz;d2.useSyncExternalStore=Ql.useSyncExternalStore!==void 0?Ql.useSyncExternalStore:Uz;u2.exports=d2;var Fz=u2.exports;const qz=id.useInsertionEffect,Hz=typeof window<"u"&&typeof window.document<"u"&&typeof window.document.createElement<"u",Bz=Hz?x.useLayoutEffect:x.useEffect,Vz=qz||Bz,f2=e=>{const t=x.useRef([e,(...n)=>t[0](...n)]).current;return Vz(()=>{t[0]=e}),t[1]},Kz="popstate",zb="pushState",Ib="replaceState",Zz="hashchange",QS=[Kz,zb,Ib,Zz],Gz=e=>{for(const t of QS)addEventListener(t,e);return()=>{for(const t of QS)removeEventListener(t,e)}},h2=(e,t)=>Fz.useSyncExternalStore(Gz,e,t),Qz=()=>location.search,Yz=({ssrSearch:e=""}={})=>h2(Qz,()=>e),YS=()=>location.pathname,Xz=({ssrPath:e}={})=>h2(YS,e?()=>e:YS),Wz=(e,{replace:t=!1,state:n=null}={})=>history[t?Ib:zb](n,"",e),Jz=(e={})=>[Xz(e),Wz],XS=Symbol.for("wouter_v3");if(typeof history<"u"&&typeof window[XS]>"u"){for(const e of[zb,Ib]){const t=history[e];history[e]=function(){const n=t.apply(this,arguments),r=new Event(e);return r.arguments=arguments,dispatchEvent(r),n}}Object.defineProperty(window,XS,{value:!0})}const e3=(e,t)=>t.toLowerCase().indexOf(e.toLowerCase())?"~"+t:t.slice(e.length)||"/",m2=(e="")=>e==="/"?"":e,t3=(e,t)=>e[0]==="~"?e.slice(1):m2(t)+e,n3=(e="",t)=>e3(WS(m2(e)),WS(t)),WS=e=>{try{return decodeURI(e)}catch{return e}},p2={hook:Jz,searchHook:Yz,parser:Rz,base:"",ssrPath:void 0,ssrSearch:void 0,ssrContext:void 0,hrefs:e=>e},g2=x.createContext(p2),vd=()=>x.useContext(g2),y2={},v2=x.createContext(y2),r3=()=>x.useContext(v2),Zm=e=>{const[t,n]=e.hook(e);return[n3(e.base,t),f2((r,a)=>n(t3(r,e.base),a))]},a3=()=>Zm(vd()),b2=(e,t,n,r)=>{const{pattern:a,keys:i}=t instanceof RegExp?{keys:!1,pattern:t}:e(t||"*",r),s=a.exec(n)||[],[o,...l]=s;return o!==void 0?[!0,(()=>{const u=i!==!1?Object.fromEntries(i.map((f,m)=>[f,l[m]])):s.groups;let d={...l};return u&&Object.assign(d,u),d})(),...r?[o]:[]]:[!1,null]},i3=({children:e,...t})=>{var d,f;const n=vd(),r=t.hook?p2:n;let a=r;const[i,s]=((d=t.ssrPath)==null?void 0:d.split("?"))??[];s&&(t.ssrSearch=s,t.ssrPath=i),t.hrefs=t.hrefs??((f=t.hook)==null?void 0:f.hrefs);let o=x.useRef({}),l=o.current,u=l;for(let m in r){const h=m==="base"?r[m]+(t[m]||""):t[m]||r[m];l===u&&h!==u[m]&&(o.current=u={...u}),u[m]=h,(h!==r[m]||h!==a[m])&&(a=u)}return x.createElement(g2.Provider,{value:a,children:e})},JS=({children:e,component:t},n)=>t?x.createElement(t,{params:n}):typeof e=="function"?e(n):e,s3=e=>{let t=x.useRef(y2);const n=t.current;return t.current=Object.keys(e).length!==Object.keys(n).length||Object.entries(e).some(([r,a])=>a!==n[r])?e:n},Cs=({path:e,nest:t,match:n,...r})=>{const a=vd(),[i]=Zm(a),[s,o,l]=n??b2(a.parser,e,i,t),u=s3({...r3(),...o});if(!s)return null;const d=l?x.createElement(i3,{base:l},JS(r,u)):JS(r,u);return x.createElement(v2.Provider,{value:u,children:d})},Yl=x.forwardRef((e,t)=>{const n=vd(),[r,a]=Zm(n),{to:i="",href:s=i,onClick:o,asChild:l,children:u,className:d,replace:f,state:m,...h}=e,y=f2(b=>{b.ctrlKey||b.metaKey||b.altKey||b.shiftKey||b.button!==0||(o==null||o(b),b.defaultPrevented||(b.preventDefault(),a(s,e)))}),p=n.hrefs(s[0]==="~"?s.slice(1):n.base+s,n);return l&&x.isValidElement(u)?x.cloneElement(u,{onClick:y,href:p}):x.createElement("a",{...h,onClick:y,href:p,className:d!=null&&d.call?d(r===s):d,children:u,ref:t})}),x2=e=>Array.isArray(e)?e.flatMap(t=>x2(t&&t.type===x.Fragment?t.props.children:t)):[e],o3=({children:e,location:t})=>{const n=vd(),[r]=Zm(n);for(const a of x2(e)){let i=0;if(x.isValidElement(a)&&(i=b2(n.parser,a.props.path,t||r,a.props.nest))[0])return x.cloneElement(a,{match:i})}return null};var mc=class{constructor(){this.listeners=new Set,this.subscribe=this.subscribe.bind(this)}subscribe(e){return this.listeners.add(e),this.onSubscribe(),()=>{this.listeners.delete(e),this.onUnsubscribe()}}hasListeners(){return this.listeners.size>0}onSubscribe(){}onUnsubscribe(){}},co=typeof window>"u"||"Deno"in globalThis;function Dn(){}function l3(e,t){return typeof e=="function"?e(t):e}function cv(e){return typeof e=="number"&&e>=0&&e!==1/0}function w2(e,t){return Math.max(e+(t||0)-Date.now(),0)}function ss(e,t){return typeof e=="function"?e(t):e}function Nr(e,t){return typeof e=="function"?e(t):e}function e_(e,t){const{type:n="all",exact:r,fetchStatus:a,predicate:i,queryKey:s,stale:o}=e;if(s){if(r){if(t.queryHash!==Lb(s,t.options))return!1}else if(!Vu(t.queryKey,s))return!1}if(n!=="all"){const l=t.isActive();if(n==="active"&&!l||n==="inactive"&&l)return!1}return!(typeof o=="boolean"&&t.isStale()!==o||a&&a!==t.state.fetchStatus||i&&!i(t))}function t_(e,t){const{exact:n,status:r,predicate:a,mutationKey:i}=e;if(i){if(!t.options.mutationKey)return!1;if(n){if(uo(t.options.mutationKey)!==uo(i))return!1}else if(!Vu(t.options.mutationKey,i))return!1}return!(r&&t.state.status!==r||a&&!a(t))}function Lb(e,t){return((t==null?void 0:t.queryKeyHashFn)||uo)(e)}function uo(e){return JSON.stringify(e,(t,n)=>uv(n)?Object.keys(n).sort().reduce((r,a)=>(r[a]=n[a],r),{}):n)}function Vu(e,t){return e===t?!0:typeof e!=typeof t?!1:e&&t&&typeof e=="object"&&typeof t=="object"?Object.keys(t).every(n=>Vu(e[n],t[n])):!1}function S2(e,t){if(e===t)return e;const n=n_(e)&&n_(t);if(n||uv(e)&&uv(t)){const r=n?e:Object.keys(e),a=r.length,i=n?t:Object.keys(t),s=i.length,o=n?[]:{},l=new Set(r);let u=0;for(let d=0;d<s;d++){const f=n?d:i[d];(!n&&l.has(f)||n)&&e[f]===void 0&&t[f]===void 0?(o[f]=void 0,u++):(o[f]=S2(e[f],t[f]),o[f]===e[f]&&e[f]!==void 0&&u++)}return a===s&&u===a?e:o}return t}function Hh(e,t){if(!t||Object.keys(e).length!==Object.keys(t).length)return!1;for(const n in e)if(e[n]!==t[n])return!1;return!0}function n_(e){return Array.isArray(e)&&e.length===Object.keys(e).length}function uv(e){if(!r_(e))return!1;const t=e.constructor;if(t===void 0)return!0;const n=t.prototype;return!(!r_(n)||!n.hasOwnProperty("isPrototypeOf")||Object.getPrototypeOf(e)!==Object.prototype)}function r_(e){return Object.prototype.toString.call(e)==="[object Object]"}function c3(e){return new Promise(t=>{setTimeout(t,e)})}function dv(e,t,n){return typeof n.structuralSharing=="function"?n.structuralSharing(e,t):n.structuralSharing!==!1?S2(e,t):t}function u3(e,t,n=0){const r=[...e,t];return n&&r.length>n?r.slice(1):r}function d3(e,t,n=0){const r=[t,...e];return n&&r.length>n?r.slice(0,-1):r}var Ub=Symbol();function _2(e,t){return!e.queryFn&&(t!=null&&t.initialPromise)?()=>t.initialPromise:!e.queryFn||e.queryFn===Ub?()=>Promise.reject(new Error(`Missing queryFn: '${e.queryHash}'`)):e.queryFn}function k2(e,t){return typeof e=="function"?e(...t):!!e}var Bs,Di,El,WE,f3=(WE=class extends mc{constructor(){super();_e(this,Bs);_e(this,Di);_e(this,El);pe(this,El,t=>{if(!co&&window.addEventListener){const n=()=>t();return window.addEventListener("visibilitychange",n,!1),()=>{window.removeEventListener("visibilitychange",n)}}})}onSubscribe(){U(this,Di)||this.setEventListener(U(this,El))}onUnsubscribe(){var t;this.hasListeners()||((t=U(this,Di))==null||t.call(this),pe(this,Di,void 0))}setEventListener(t){var n;pe(this,El,t),(n=U(this,Di))==null||n.call(this),pe(this,Di,t(r=>{typeof r=="boolean"?this.setFocused(r):this.onFocus()}))}setFocused(t){U(this,Bs)!==t&&(pe(this,Bs,t),this.onFocus())}onFocus(){const t=this.isFocused();this.listeners.forEach(n=>{n(t)})}isFocused(){var t;return typeof U(this,Bs)=="boolean"?U(this,Bs):((t=globalThis.document)==null?void 0:t.visibilityState)!=="hidden"}},Bs=new WeakMap,Di=new WeakMap,El=new WeakMap,WE),Fb=new f3,Cl,zi,Nl,JE,h3=(JE=class extends mc{constructor(){super();_e(this,Cl,!0);_e(this,zi);_e(this,Nl);pe(this,Nl,t=>{if(!co&&window.addEventListener){const n=()=>t(!0),r=()=>t(!1);return window.addEventListener("online",n,!1),window.addEventListener("offline",r,!1),()=>{window.removeEventListener("online",n),window.removeEventListener("offline",r)}}})}onSubscribe(){U(this,zi)||this.setEventListener(U(this,Nl))}onUnsubscribe(){var t;this.hasListeners()||((t=U(this,zi))==null||t.call(this),pe(this,zi,void 0))}setEventListener(t){var n;pe(this,Nl,t),(n=U(this,zi))==null||n.call(this),pe(this,zi,t(this.setOnline.bind(this)))}setOnline(t){U(this,Cl)!==t&&(pe(this,Cl,t),this.listeners.forEach(r=>{r(t)}))}isOnline(){return U(this,Cl)}},Cl=new WeakMap,zi=new WeakMap,Nl=new WeakMap,JE),Bh=new h3;function fv(){let e,t;const n=new Promise((a,i)=>{e=a,t=i});n.status="pending",n.catch(()=>{});function r(a){Object.assign(n,a),delete n.resolve,delete n.reject}return n.resolve=a=>{r({status:"fulfilled",value:a}),e(a)},n.reject=a=>{r({status:"rejected",reason:a}),t(a)},n}function m3(e){return Math.min(1e3*2**e,3e4)}function E2(e){return(e??"online")==="online"?Bh.isOnline():!0}var C2=class extends Error{constructor(e){super("CancelledError"),this.revert=e==null?void 0:e.revert,this.silent=e==null?void 0:e.silent}};function N2(e){let t=!1,n=0,r;const a=fv(),i=()=>a.status!=="pending",s=p=>{var b;i()||(m(new C2(p)),(b=e.abort)==null||b.call(e))},o=()=>{t=!0},l=()=>{t=!1},u=()=>Fb.isFocused()&&(e.networkMode==="always"||Bh.isOnline())&&e.canRun(),d=()=>E2(e.networkMode)&&e.canRun(),f=p=>{i()||(r==null||r(),a.resolve(p))},m=p=>{i()||(r==null||r(),a.reject(p))},h=()=>new Promise(p=>{var b;r=g=>{(i()||u())&&p(g)},(b=e.onPause)==null||b.call(e)}).then(()=>{var p;r=void 0,i()||(p=e.onContinue)==null||p.call(e)}),y=()=>{if(i())return;let p;const b=n===0?e.initialPromise:void 0;try{p=b??e.fn()}catch(g){p=Promise.reject(g)}Promise.resolve(p).then(f).catch(g=>{var C;if(i())return;const v=e.retry??(co?0:3),w=e.retryDelay??m3,S=typeof w=="function"?w(n,g):w,E=v===!0||typeof v=="number"&&n<v||typeof v=="function"&&v(n,g);if(t||!E){m(g);return}n++,(C=e.onFail)==null||C.call(e,n,g),c3(S).then(()=>u()?void 0:h()).then(()=>{t?m(g):y()})})};return{promise:a,status:()=>a.status,cancel:s,continue:()=>(r==null||r(),a),cancelRetry:o,continueRetry:l,canStart:d,start:()=>(d()?y():h().then(y),a)}}var p3=e=>setTimeout(e,0);function g3(){let e=[],t=0,n=o=>{o()},r=o=>{o()},a=p3;const i=o=>{t?e.push(o):a(()=>{n(o)})},s=()=>{const o=e;e=[],o.length&&a(()=>{r(()=>{o.forEach(l=>{n(l)})})})};return{batch:o=>{let l;t++;try{l=o()}finally{t--,t||s()}return l},batchCalls:o=>(...l)=>{i(()=>{o(...l)})},schedule:i,setNotifyFunction:o=>{n=o},setBatchNotifyFunction:o=>{r=o},setScheduler:o=>{a=o}}}var Wt=g3(),Vs,eC,j2=(eC=class{constructor(){_e(this,Vs)}destroy(){this.clearGcTimeout()}scheduleGc(){this.clearGcTimeout(),cv(this.gcTime)&&pe(this,Vs,setTimeout(()=>{this.optionalRemove()},this.gcTime))}updateGcTime(e){this.gcTime=Math.max(this.gcTime||0,e??(co?1/0:5*60*1e3))}clearGcTimeout(){U(this,Vs)&&(clearTimeout(U(this,Vs)),pe(this,Vs,void 0))}},Vs=new WeakMap,eC),jl,Tl,kr,Ks,an,td,Zs,Qr,Ia,tC,y3=(tC=class extends j2{constructor(t){super();_e(this,Qr);_e(this,jl);_e(this,Tl);_e(this,kr);_e(this,Ks);_e(this,an);_e(this,td);_e(this,Zs);pe(this,Zs,!1),pe(this,td,t.defaultOptions),this.setOptions(t.options),this.observers=[],pe(this,Ks,t.client),pe(this,kr,U(this,Ks).getQueryCache()),this.queryKey=t.queryKey,this.queryHash=t.queryHash,pe(this,jl,v3(this.options)),this.state=t.state??U(this,jl),this.scheduleGc()}get meta(){return this.options.meta}get promise(){var t;return(t=U(this,an))==null?void 0:t.promise}setOptions(t){this.options={...U(this,td),...t},this.updateGcTime(this.options.gcTime)}optionalRemove(){!this.observers.length&&this.state.fetchStatus==="idle"&&U(this,kr).remove(this)}setData(t,n){const r=dv(this.state.data,t,this.options);return Le(this,Qr,Ia).call(this,{data:r,type:"success",dataUpdatedAt:n==null?void 0:n.updatedAt,manual:n==null?void 0:n.manual}),r}setState(t,n){Le(this,Qr,Ia).call(this,{type:"setState",state:t,setStateOptions:n})}cancel(t){var r,a;const n=(r=U(this,an))==null?void 0:r.promise;return(a=U(this,an))==null||a.cancel(t),n?n.then(Dn).catch(Dn):Promise.resolve()}destroy(){super.destroy(),this.cancel({silent:!0})}reset(){this.destroy(),this.setState(U(this,jl))}isActive(){return this.observers.some(t=>Nr(t.options.enabled,this)!==!1)}isDisabled(){return this.getObserversCount()>0?!this.isActive():this.options.queryFn===Ub||this.state.dataUpdateCount+this.state.errorUpdateCount===0}isStatic(){return this.getObserversCount()>0?this.observers.some(t=>ss(t.options.staleTime,this)==="static"):!1}isStale(){return this.getObserversCount()>0?this.observers.some(t=>t.getCurrentResult().isStale):this.state.data===void 0||this.state.isInvalidated}isStaleByTime(t=0){return this.state.data===void 0?!0:t==="static"?!1:this.state.isInvalidated?!0:!w2(this.state.dataUpdatedAt,t)}onFocus(){var n;const t=this.observers.find(r=>r.shouldFetchOnWindowFocus());t==null||t.refetch({cancelRefetch:!1}),(n=U(this,an))==null||n.continue()}onOnline(){var n;const t=this.observers.find(r=>r.shouldFetchOnReconnect());t==null||t.refetch({cancelRefetch:!1}),(n=U(this,an))==null||n.continue()}addObserver(t){this.observers.includes(t)||(this.observers.push(t),this.clearGcTimeout(),U(this,kr).notify({type:"observerAdded",query:this,observer:t}))}removeObserver(t){this.observers.includes(t)&&(this.observers=this.observers.filter(n=>n!==t),this.observers.length||(U(this,an)&&(U(this,Zs)?U(this,an).cancel({revert:!0}):U(this,an).cancelRetry()),this.scheduleGc()),U(this,kr).notify({type:"observerRemoved",query:this,observer:t}))}getObserversCount(){return this.observers.length}invalidate(){this.state.isInvalidated||Le(this,Qr,Ia).call(this,{type:"invalidate"})}async fetch(t,n){var l,u,d,f,m,h,y,p,b,g,v,w;if(this.state.fetchStatus!=="idle"&&((l=U(this,an))==null?void 0:l.status())!=="rejected"){if(this.state.data!==void 0&&(n!=null&&n.cancelRefetch))this.cancel({silent:!0});else if(U(this,an))return U(this,an).continueRetry(),U(this,an).promise}if(t&&this.setOptions(t),!this.options.queryFn){const S=this.observers.find(E=>E.options.queryFn);S&&this.setOptions(S.options)}const r=new AbortController,a=S=>{Object.defineProperty(S,"signal",{enumerable:!0,get:()=>(pe(this,Zs,!0),r.signal)})},i=()=>{const S=_2(this.options,n),C=(()=>{const T={client:U(this,Ks),queryKey:this.queryKey,meta:this.meta};return a(T),T})();return pe(this,Zs,!1),this.options.persister?this.options.persister(S,C,this):S(C)},o=(()=>{const S={fetchOptions:n,options:this.options,queryKey:this.queryKey,client:U(this,Ks),state:this.state,fetchFn:i};return a(S),S})();(u=this.options.behavior)==null||u.onFetch(o,this),pe(this,Tl,this.state),(this.state.fetchStatus==="idle"||this.state.fetchMeta!==((d=o.fetchOptions)==null?void 0:d.meta))&&Le(this,Qr,Ia).call(this,{type:"fetch",meta:(f=o.fetchOptions)==null?void 0:f.meta}),pe(this,an,N2({initialPromise:n==null?void 0:n.initialPromise,fn:o.fetchFn,abort:r.abort.bind(r),onFail:(S,E)=>{Le(this,Qr,Ia).call(this,{type:"failed",failureCount:S,error:E})},onPause:()=>{Le(this,Qr,Ia).call(this,{type:"pause"})},onContinue:()=>{Le(this,Qr,Ia).call(this,{type:"continue"})},retry:o.options.retry,retryDelay:o.options.retryDelay,networkMode:o.options.networkMode,canRun:()=>!0}));try{const S=await U(this,an).start();if(S===void 0)throw new Error(`${this.queryHash} data is undefined`);return this.setData(S),(h=(m=U(this,kr).config).onSuccess)==null||h.call(m,S,this),(p=(y=U(this,kr).config).onSettled)==null||p.call(y,S,this.state.error,this),S}catch(S){if(S instanceof C2){if(S.silent)return U(this,an).promise;if(S.revert){if(this.setState({...U(this,Tl),fetchStatus:"idle"}),this.state.data===void 0)throw S;return this.state.data}}throw Le(this,Qr,Ia).call(this,{type:"error",error:S}),(g=(b=U(this,kr).config).onError)==null||g.call(b,S,this),(w=(v=U(this,kr).config).onSettled)==null||w.call(v,this.state.data,S,this),S}finally{this.scheduleGc()}}},jl=new WeakMap,Tl=new WeakMap,kr=new WeakMap,Ks=new WeakMap,an=new WeakMap,td=new WeakMap,Zs=new WeakMap,Qr=new WeakSet,Ia=function(t){const n=r=>{switch(t.type){case"failed":return{...r,fetchFailureCount:t.failureCount,fetchFailureReason:t.error};case"pause":return{...r,fetchStatus:"paused"};case"continue":return{...r,fetchStatus:"fetching"};case"fetch":return{...r,...T2(r.data,this.options),fetchMeta:t.meta??null};case"success":const a={...r,data:t.data,dataUpdateCount:r.dataUpdateCount+1,dataUpdatedAt:t.dataUpdatedAt??Date.now(),error:null,isInvalidated:!1,status:"success",...!t.manual&&{fetchStatus:"idle",fetchFailureCount:0,fetchFailureReason:null}};return pe(this,Tl,t.manual?a:void 0),a;case"error":const i=t.error;return{...r,error:i,errorUpdateCount:r.errorUpdateCount+1,errorUpdatedAt:Date.now(),fetchFailureCount:r.fetchFailureCount+1,fetchFailureReason:i,fetchStatus:"idle",status:"error"};case"invalidate":return{...r,isInvalidated:!0};case"setState":return{...r,...t.state}}};this.state=n(this.state),Wt.batch(()=>{this.observers.forEach(r=>{r.onQueryUpdate()}),U(this,kr).notify({query:this,type:"updated",action:t})})},tC);function T2(e,t){return{fetchFailureCount:0,fetchFailureReason:null,fetchStatus:E2(t.networkMode)?"fetching":"paused",...e===void 0&&{error:null,status:"pending"}}}function v3(e){const t=typeof e.initialData=="function"?e.initialData():e.initialData,n=t!==void 0,r=n?typeof e.initialDataUpdatedAt=="function"?e.initialDataUpdatedAt():e.initialDataUpdatedAt:0;return{data:t,dataUpdateCount:0,dataUpdatedAt:n?r??Date.now():0,error:null,errorUpdateCount:0,errorUpdatedAt:0,fetchFailureCount:0,fetchFailureReason:null,fetchMeta:null,isInvalidated:!1,status:n?"success":"pending",fetchStatus:"idle"}}var ua,nC,b3=(nC=class extends mc{constructor(t={}){super();_e(this,ua);this.config=t,pe(this,ua,new Map)}build(t,n,r){const a=n.queryKey,i=n.queryHash??Lb(a,n);let s=this.get(i);return s||(s=new y3({client:t,queryKey:a,queryHash:i,options:t.defaultQueryOptions(n),state:r,defaultOptions:t.getQueryDefaults(a)}),this.add(s)),s}add(t){U(this,ua).has(t.queryHash)||(U(this,ua).set(t.queryHash,t),this.notify({type:"added",query:t}))}remove(t){const n=U(this,ua).get(t.queryHash);n&&(t.destroy(),n===t&&U(this,ua).delete(t.queryHash),this.notify({type:"removed",query:t}))}clear(){Wt.batch(()=>{this.getAll().forEach(t=>{this.remove(t)})})}get(t){return U(this,ua).get(t)}getAll(){return[...U(this,ua).values()]}find(t){const n={exact:!0,...t};return this.getAll().find(r=>e_(n,r))}findAll(t={}){const n=this.getAll();return Object.keys(t).length>0?n.filter(r=>e_(t,r)):n}notify(t){Wt.batch(()=>{this.listeners.forEach(n=>{n(t)})})}onFocus(){Wt.batch(()=>{this.getAll().forEach(t=>{t.onFocus()})})}onOnline(){Wt.batch(()=>{this.getAll().forEach(t=>{t.onOnline()})})}},ua=new WeakMap,nC),da,$n,Gs,fa,ki,rC,x3=(rC=class extends j2{constructor(t){super();_e(this,fa);_e(this,da);_e(this,$n);_e(this,Gs);this.mutationId=t.mutationId,pe(this,$n,t.mutationCache),pe(this,da,[]),this.state=t.state||A2(),this.setOptions(t.options),this.scheduleGc()}setOptions(t){this.options=t,this.updateGcTime(this.options.gcTime)}get meta(){return this.options.meta}addObserver(t){U(this,da).includes(t)||(U(this,da).push(t),this.clearGcTimeout(),U(this,$n).notify({type:"observerAdded",mutation:this,observer:t}))}removeObserver(t){pe(this,da,U(this,da).filter(n=>n!==t)),this.scheduleGc(),U(this,$n).notify({type:"observerRemoved",mutation:this,observer:t})}optionalRemove(){U(this,da).length||(this.state.status==="pending"?this.scheduleGc():U(this,$n).remove(this))}continue(){var t;return((t=U(this,Gs))==null?void 0:t.continue())??this.execute(this.state.variables)}async execute(t){var i,s,o,l,u,d,f,m,h,y,p,b,g,v,w,S,E,C,T,P;const n=()=>{Le(this,fa,ki).call(this,{type:"continue"})};pe(this,Gs,N2({fn:()=>this.options.mutationFn?this.options.mutationFn(t):Promise.reject(new Error("No mutationFn found")),onFail:(R,$)=>{Le(this,fa,ki).call(this,{type:"failed",failureCount:R,error:$})},onPause:()=>{Le(this,fa,ki).call(this,{type:"pause"})},onContinue:n,retry:this.options.retry??0,retryDelay:this.options.retryDelay,networkMode:this.options.networkMode,canRun:()=>U(this,$n).canRun(this)}));const r=this.state.status==="pending",a=!U(this,Gs).canStart();try{if(r)n();else{Le(this,fa,ki).call(this,{type:"pending",variables:t,isPaused:a}),await((s=(i=U(this,$n).config).onMutate)==null?void 0:s.call(i,t,this));const $=await((l=(o=this.options).onMutate)==null?void 0:l.call(o,t));$!==this.state.context&&Le(this,fa,ki).call(this,{type:"pending",context:$,variables:t,isPaused:a})}const R=await U(this,Gs).start();return await((d=(u=U(this,$n).config).onSuccess)==null?void 0:d.call(u,R,t,this.state.context,this)),await((m=(f=this.options).onSuccess)==null?void 0:m.call(f,R,t,this.state.context)),await((y=(h=U(this,$n).config).onSettled)==null?void 0:y.call(h,R,null,this.state.variables,this.state.context,this)),await((b=(p=this.options).onSettled)==null?void 0:b.call(p,R,null,t,this.state.context)),Le(this,fa,ki).call(this,{type:"success",data:R}),R}catch(R){try{throw await((v=(g=U(this,$n).config).onError)==null?void 0:v.call(g,R,t,this.state.context,this)),await((S=(w=this.options).onError)==null?void 0:S.call(w,R,t,this.state.context)),await((C=(E=U(this,$n).config).onSettled)==null?void 0:C.call(E,void 0,R,this.state.variables,this.state.context,this)),await((P=(T=this.options).onSettled)==null?void 0:P.call(T,void 0,R,t,this.state.context)),R}finally{Le(this,fa,ki).call(this,{type:"error",error:R})}}finally{U(this,$n).runNext(this)}}},da=new WeakMap,$n=new WeakMap,Gs=new WeakMap,fa=new WeakSet,ki=function(t){const n=r=>{switch(t.type){case"failed":return{...r,failureCount:t.failureCount,failureReason:t.error};case"pause":return{...r,isPaused:!0};case"continue":return{...r,isPaused:!1};case"pending":return{...r,context:t.context,data:void 0,failureCount:0,failureReason:null,error:null,isPaused:t.isPaused,status:"pending",variables:t.variables,submittedAt:Date.now()};case"success":return{...r,data:t.data,failureCount:0,failureReason:null,error:null,status:"success",isPaused:!1};case"error":return{...r,data:void 0,error:t.error,failureCount:r.failureCount+1,failureReason:t.error,isPaused:!1,status:"error"}}};this.state=n(this.state),Wt.batch(()=>{U(this,da).forEach(r=>{r.onMutationUpdate(t)}),U(this,$n).notify({mutation:this,type:"updated",action:t})})},rC);function A2(){return{context:void 0,data:void 0,error:null,failureCount:0,failureReason:null,isPaused:!1,status:"idle",variables:void 0,submittedAt:0}}var Ha,Yr,nd,aC,w3=(aC=class extends mc{constructor(t={}){super();_e(this,Ha);_e(this,Yr);_e(this,nd);this.config=t,pe(this,Ha,new Set),pe(this,Yr,new Map),pe(this,nd,0)}build(t,n,r){const a=new x3({mutationCache:this,mutationId:++Fd(this,nd)._,options:t.defaultMutationOptions(n),state:r});return this.add(a),a}add(t){U(this,Ha).add(t);const n=af(t);if(typeof n=="string"){const r=U(this,Yr).get(n);r?r.push(t):U(this,Yr).set(n,[t])}this.notify({type:"added",mutation:t})}remove(t){if(U(this,Ha).delete(t)){const n=af(t);if(typeof n=="string"){const r=U(this,Yr).get(n);if(r)if(r.length>1){const a=r.indexOf(t);a!==-1&&r.splice(a,1)}else r[0]===t&&U(this,Yr).delete(n)}}this.notify({type:"removed",mutation:t})}canRun(t){const n=af(t);if(typeof n=="string"){const r=U(this,Yr).get(n),a=r==null?void 0:r.find(i=>i.state.status==="pending");return!a||a===t}else return!0}runNext(t){var r;const n=af(t);if(typeof n=="string"){const a=(r=U(this,Yr).get(n))==null?void 0:r.find(i=>i!==t&&i.state.isPaused);return(a==null?void 0:a.continue())??Promise.resolve()}else return Promise.resolve()}clear(){Wt.batch(()=>{U(this,Ha).forEach(t=>{this.notify({type:"removed",mutation:t})}),U(this,Ha).clear(),U(this,Yr).clear()})}getAll(){return Array.from(U(this,Ha))}find(t){const n={exact:!0,...t};return this.getAll().find(r=>t_(n,r))}findAll(t={}){return this.getAll().filter(n=>t_(t,n))}notify(t){Wt.batch(()=>{this.listeners.forEach(n=>{n(t)})})}resumePausedMutations(){const t=this.getAll().filter(n=>n.state.isPaused);return Wt.batch(()=>Promise.all(t.map(n=>n.continue().catch(Dn))))}},Ha=new WeakMap,Yr=new WeakMap,nd=new WeakMap,aC);function af(e){var t;return(t=e.options.scope)==null?void 0:t.id}function a_(e){return{onFetch:(t,n)=>{var d,f,m,h,y;const r=t.options,a=(m=(f=(d=t.fetchOptions)==null?void 0:d.meta)==null?void 0:f.fetchMore)==null?void 0:m.direction,i=((h=t.state.data)==null?void 0:h.pages)||[],s=((y=t.state.data)==null?void 0:y.pageParams)||[];let o={pages:[],pageParams:[]},l=0;const u=async()=>{let p=!1;const b=w=>{Object.defineProperty(w,"signal",{enumerable:!0,get:()=>(t.signal.aborted?p=!0:t.signal.addEventListener("abort",()=>{p=!0}),t.signal)})},g=_2(t.options,t.fetchOptions),v=async(w,S,E)=>{if(p)return Promise.reject();if(S==null&&w.pages.length)return Promise.resolve(w);const T=(()=>{const j={client:t.client,queryKey:t.queryKey,pageParam:S,direction:E?"backward":"forward",meta:t.options.meta};return b(j),j})(),P=await g(T),{maxPages:R}=t.options,$=E?d3:u3;return{pages:$(w.pages,P,R),pageParams:$(w.pageParams,S,R)}};if(a&&i.length){const w=a==="backward",S=w?S3:i_,E={pages:i,pageParams:s},C=S(r,E);o=await v(E,C,w)}else{const w=e??i.length;do{const S=l===0?s[0]??r.initialPageParam:i_(r,o);if(l>0&&S==null)break;o=await v(o,S),l++}while(l<w)}return o};t.options.persister?t.fetchFn=()=>{var p,b;return(b=(p=t.options).persister)==null?void 0:b.call(p,u,{client:t.client,queryKey:t.queryKey,meta:t.options.meta,signal:t.signal},n)}:t.fetchFn=u}}}function i_(e,{pages:t,pageParams:n}){const r=t.length-1;return t.length>0?e.getNextPageParam(t[r],t,n[r],n):void 0}function S3(e,{pages:t,pageParams:n}){var r;return t.length>0?(r=e.getPreviousPageParam)==null?void 0:r.call(e,t[0],t,n[0],n):void 0}var It,Ii,Li,Al,Rl,Ui,$l,Ol,iC,_3=(iC=class{constructor(e={}){_e(this,It);_e(this,Ii);_e(this,Li);_e(this,Al);_e(this,Rl);_e(this,Ui);_e(this,$l);_e(this,Ol);pe(this,It,e.queryCache||new b3),pe(this,Ii,e.mutationCache||new w3),pe(this,Li,e.defaultOptions||{}),pe(this,Al,new Map),pe(this,Rl,new Map),pe(this,Ui,0)}mount(){Fd(this,Ui)._++,U(this,Ui)===1&&(pe(this,$l,Fb.subscribe(async e=>{e&&(await this.resumePausedMutations(),U(this,It).onFocus())})),pe(this,Ol,Bh.subscribe(async e=>{e&&(await this.resumePausedMutations(),U(this,It).onOnline())})))}unmount(){var e,t;Fd(this,Ui)._--,U(this,Ui)===0&&((e=U(this,$l))==null||e.call(this),pe(this,$l,void 0),(t=U(this,Ol))==null||t.call(this),pe(this,Ol,void 0))}isFetching(e){return U(this,It).findAll({...e,fetchStatus:"fetching"}).length}isMutating(e){return U(this,Ii).findAll({...e,status:"pending"}).length}getQueryData(e){var n;const t=this.defaultQueryOptions({queryKey:e});return(n=U(this,It).get(t.queryHash))==null?void 0:n.state.data}ensureQueryData(e){const t=this.defaultQueryOptions(e),n=U(this,It).build(this,t),r=n.state.data;return r===void 0?this.fetchQuery(e):(e.revalidateIfStale&&n.isStaleByTime(ss(t.staleTime,n))&&this.prefetchQuery(t),Promise.resolve(r))}getQueriesData(e){return U(this,It).findAll(e).map(({queryKey:t,state:n})=>{const r=n.data;return[t,r]})}setQueryData(e,t,n){const r=this.defaultQueryOptions({queryKey:e}),a=U(this,It).get(r.queryHash),i=a==null?void 0:a.state.data,s=l3(t,i);if(s!==void 0)return U(this,It).build(this,r).setData(s,{...n,manual:!0})}setQueriesData(e,t,n){return Wt.batch(()=>U(this,It).findAll(e).map(({queryKey:r})=>[r,this.setQueryData(r,t,n)]))}getQueryState(e){var n;const t=this.defaultQueryOptions({queryKey:e});return(n=U(this,It).get(t.queryHash))==null?void 0:n.state}removeQueries(e){const t=U(this,It);Wt.batch(()=>{t.findAll(e).forEach(n=>{t.remove(n)})})}resetQueries(e,t){const n=U(this,It);return Wt.batch(()=>(n.findAll(e).forEach(r=>{r.reset()}),this.refetchQueries({type:"active",...e},t)))}cancelQueries(e,t={}){const n={revert:!0,...t},r=Wt.batch(()=>U(this,It).findAll(e).map(a=>a.cancel(n)));return Promise.all(r).then(Dn).catch(Dn)}invalidateQueries(e,t={}){return Wt.batch(()=>(U(this,It).findAll(e).forEach(n=>{n.invalidate()}),(e==null?void 0:e.refetchType)==="none"?Promise.resolve():this.refetchQueries({...e,type:(e==null?void 0:e.refetchType)??(e==null?void 0:e.type)??"active"},t)))}refetchQueries(e,t={}){const n={...t,cancelRefetch:t.cancelRefetch??!0},r=Wt.batch(()=>U(this,It).findAll(e).filter(a=>!a.isDisabled()&&!a.isStatic()).map(a=>{let i=a.fetch(void 0,n);return n.throwOnError||(i=i.catch(Dn)),a.state.fetchStatus==="paused"?Promise.resolve():i}));return Promise.all(r).then(Dn)}fetchQuery(e){const t=this.defaultQueryOptions(e);t.retry===void 0&&(t.retry=!1);const n=U(this,It).build(this,t);return n.isStaleByTime(ss(t.staleTime,n))?n.fetch(t):Promise.resolve(n.state.data)}prefetchQuery(e){return this.fetchQuery(e).then(Dn).catch(Dn)}fetchInfiniteQuery(e){return e.behavior=a_(e.pages),this.fetchQuery(e)}prefetchInfiniteQuery(e){return this.fetchInfiniteQuery(e).then(Dn).catch(Dn)}ensureInfiniteQueryData(e){return e.behavior=a_(e.pages),this.ensureQueryData(e)}resumePausedMutations(){return Bh.isOnline()?U(this,Ii).resumePausedMutations():Promise.resolve()}getQueryCache(){return U(this,It)}getMutationCache(){return U(this,Ii)}getDefaultOptions(){return U(this,Li)}setDefaultOptions(e){pe(this,Li,e)}setQueryDefaults(e,t){U(this,Al).set(uo(e),{queryKey:e,defaultOptions:t})}getQueryDefaults(e){const t=[...U(this,Al).values()],n={};return t.forEach(r=>{Vu(e,r.queryKey)&&Object.assign(n,r.defaultOptions)}),n}setMutationDefaults(e,t){U(this,Rl).set(uo(e),{mutationKey:e,defaultOptions:t})}getMutationDefaults(e){const t=[...U(this,Rl).values()],n={};return t.forEach(r=>{Vu(e,r.mutationKey)&&Object.assign(n,r.defaultOptions)}),n}defaultQueryOptions(e){if(e._defaulted)return e;const t={...U(this,Li).queries,...this.getQueryDefaults(e.queryKey),...e,_defaulted:!0};return t.queryHash||(t.queryHash=Lb(t.queryKey,t)),t.refetchOnReconnect===void 0&&(t.refetchOnReconnect=t.networkMode!=="always"),t.throwOnError===void 0&&(t.throwOnError=!!t.suspense),!t.networkMode&&t.persister&&(t.networkMode="offlineFirst"),t.queryFn===Ub&&(t.enabled=!1),t}defaultMutationOptions(e){return e!=null&&e._defaulted?e:{...U(this,Li).mutations,...(e==null?void 0:e.mutationKey)&&this.getMutationDefaults(e.mutationKey),...e,_defaulted:!0}}clear(){U(this,It).clear(),U(this,Ii).clear()}},It=new WeakMap,Ii=new WeakMap,Li=new WeakMap,Al=new WeakMap,Rl=new WeakMap,Ui=new WeakMap,$l=new WeakMap,Ol=new WeakMap,iC),Bn,Ge,rd,On,Qs,Ml,Ba,Fi,ad,Pl,Dl,Ys,Xs,qi,zl,nt,Yc,hv,mv,pv,gv,yv,vv,bv,R2,sC,k3=(sC=class extends mc{constructor(t,n){super();_e(this,nt);_e(this,Bn);_e(this,Ge);_e(this,rd);_e(this,On);_e(this,Qs);_e(this,Ml);_e(this,Ba);_e(this,Fi);_e(this,ad);_e(this,Pl);_e(this,Dl);_e(this,Ys);_e(this,Xs);_e(this,qi);_e(this,zl,new Set);this.options=n,pe(this,Bn,t),pe(this,Fi,null),pe(this,Ba,fv()),this.bindMethods(),this.setOptions(n)}bindMethods(){this.refetch=this.refetch.bind(this)}onSubscribe(){this.listeners.size===1&&(U(this,Ge).addObserver(this),s_(U(this,Ge),this.options)?Le(this,nt,Yc).call(this):this.updateResult(),Le(this,nt,gv).call(this))}onUnsubscribe(){this.hasListeners()||this.destroy()}shouldFetchOnReconnect(){return xv(U(this,Ge),this.options,this.options.refetchOnReconnect)}shouldFetchOnWindowFocus(){return xv(U(this,Ge),this.options,this.options.refetchOnWindowFocus)}destroy(){this.listeners=new Set,Le(this,nt,yv).call(this),Le(this,nt,vv).call(this),U(this,Ge).removeObserver(this)}setOptions(t){const n=this.options,r=U(this,Ge);if(this.options=U(this,Bn).defaultQueryOptions(t),this.options.enabled!==void 0&&typeof this.options.enabled!="boolean"&&typeof this.options.enabled!="function"&&typeof Nr(this.options.enabled,U(this,Ge))!="boolean")throw new Error("Expected enabled to be a boolean or a callback that returns a boolean");Le(this,nt,bv).call(this),U(this,Ge).setOptions(this.options),n._defaulted&&!Hh(this.options,n)&&U(this,Bn).getQueryCache().notify({type:"observerOptionsUpdated",query:U(this,Ge),observer:this});const a=this.hasListeners();a&&o_(U(this,Ge),r,this.options,n)&&Le(this,nt,Yc).call(this),this.updateResult(),a&&(U(this,Ge)!==r||Nr(this.options.enabled,U(this,Ge))!==Nr(n.enabled,U(this,Ge))||ss(this.options.staleTime,U(this,Ge))!==ss(n.staleTime,U(this,Ge)))&&Le(this,nt,hv).call(this);const i=Le(this,nt,mv).call(this);a&&(U(this,Ge)!==r||Nr(this.options.enabled,U(this,Ge))!==Nr(n.enabled,U(this,Ge))||i!==U(this,qi))&&Le(this,nt,pv).call(this,i)}getOptimisticResult(t){const n=U(this,Bn).getQueryCache().build(U(this,Bn),t),r=this.createResult(n,t);return C3(this,r)&&(pe(this,On,r),pe(this,Ml,this.options),pe(this,Qs,U(this,Ge).state)),r}getCurrentResult(){return U(this,On)}trackResult(t,n){return new Proxy(t,{get:(r,a)=>(this.trackProp(a),n==null||n(a),a==="promise"&&!this.options.experimental_prefetchInRender&&U(this,Ba).status==="pending"&&U(this,Ba).reject(new Error("experimental_prefetchInRender feature flag is not enabled")),Reflect.get(r,a))})}trackProp(t){U(this,zl).add(t)}getCurrentQuery(){return U(this,Ge)}refetch({...t}={}){return this.fetch({...t})}fetchOptimistic(t){const n=U(this,Bn).defaultQueryOptions(t),r=U(this,Bn).getQueryCache().build(U(this,Bn),n);return r.fetch().then(()=>this.createResult(r,n))}fetch(t){return Le(this,nt,Yc).call(this,{...t,cancelRefetch:t.cancelRefetch??!0}).then(()=>(this.updateResult(),U(this,On)))}createResult(t,n){var R;const r=U(this,Ge),a=this.options,i=U(this,On),s=U(this,Qs),o=U(this,Ml),u=t!==r?t.state:U(this,rd),{state:d}=t;let f={...d},m=!1,h;if(n._optimisticResults){const $=this.hasListeners(),j=!$&&s_(t,n),O=$&&o_(t,r,n,a);(j||O)&&(f={...f,...T2(d.data,t.options)}),n._optimisticResults==="isRestoring"&&(f.fetchStatus="idle")}let{error:y,errorUpdatedAt:p,status:b}=f;h=f.data;let g=!1;if(n.placeholderData!==void 0&&h===void 0&&b==="pending"){let $;i!=null&&i.isPlaceholderData&&n.placeholderData===(o==null?void 0:o.placeholderData)?($=i.data,g=!0):$=typeof n.placeholderData=="function"?n.placeholderData((R=U(this,Dl))==null?void 0:R.state.data,U(this,Dl)):n.placeholderData,$!==void 0&&(b="success",h=dv(i==null?void 0:i.data,$,n),m=!0)}if(n.select&&h!==void 0&&!g)if(i&&h===(s==null?void 0:s.data)&&n.select===U(this,ad))h=U(this,Pl);else try{pe(this,ad,n.select),h=n.select(h),h=dv(i==null?void 0:i.data,h,n),pe(this,Pl,h),pe(this,Fi,null)}catch($){pe(this,Fi,$)}U(this,Fi)&&(y=U(this,Fi),h=U(this,Pl),p=Date.now(),b="error");const v=f.fetchStatus==="fetching",w=b==="pending",S=b==="error",E=w&&v,C=h!==void 0,P={status:b,fetchStatus:f.fetchStatus,isPending:w,isSuccess:b==="success",isError:S,isInitialLoading:E,isLoading:E,data:h,dataUpdatedAt:f.dataUpdatedAt,error:y,errorUpdatedAt:p,failureCount:f.fetchFailureCount,failureReason:f.fetchFailureReason,errorUpdateCount:f.errorUpdateCount,isFetched:f.dataUpdateCount>0||f.errorUpdateCount>0,isFetchedAfterMount:f.dataUpdateCount>u.dataUpdateCount||f.errorUpdateCount>u.errorUpdateCount,isFetching:v,isRefetching:v&&!w,isLoadingError:S&&!C,isPaused:f.fetchStatus==="paused",isPlaceholderData:m,isRefetchError:S&&C,isStale:qb(t,n),refetch:this.refetch,promise:U(this,Ba),isEnabled:Nr(n.enabled,t)!==!1};if(this.options.experimental_prefetchInRender){const $=z=>{P.status==="error"?z.reject(P.error):P.data!==void 0&&z.resolve(P.data)},j=()=>{const z=pe(this,Ba,P.promise=fv());$(z)},O=U(this,Ba);switch(O.status){case"pending":t.queryHash===r.queryHash&&$(O);break;case"fulfilled":(P.status==="error"||P.data!==O.value)&&j();break;case"rejected":(P.status!=="error"||P.error!==O.reason)&&j();break}}return P}updateResult(){const t=U(this,On),n=this.createResult(U(this,Ge),this.options);if(pe(this,Qs,U(this,Ge).state),pe(this,Ml,this.options),U(this,Qs).data!==void 0&&pe(this,Dl,U(this,Ge)),Hh(n,t))return;pe(this,On,n);const r=()=>{if(!t)return!0;const{notifyOnChangeProps:a}=this.options,i=typeof a=="function"?a():a;if(i==="all"||!i&&!U(this,zl).size)return!0;const s=new Set(i??U(this,zl));return this.options.throwOnError&&s.add("error"),Object.keys(U(this,On)).some(o=>{const l=o;return U(this,On)[l]!==t[l]&&s.has(l)})};Le(this,nt,R2).call(this,{listeners:r()})}onQueryUpdate(){this.updateResult(),this.hasListeners()&&Le(this,nt,gv).call(this)}},Bn=new WeakMap,Ge=new WeakMap,rd=new WeakMap,On=new WeakMap,Qs=new WeakMap,Ml=new WeakMap,Ba=new WeakMap,Fi=new WeakMap,ad=new WeakMap,Pl=new WeakMap,Dl=new WeakMap,Ys=new WeakMap,Xs=new WeakMap,qi=new WeakMap,zl=new WeakMap,nt=new WeakSet,Yc=function(t){Le(this,nt,bv).call(this);let n=U(this,Ge).fetch(this.options,t);return t!=null&&t.throwOnError||(n=n.catch(Dn)),n},hv=function(){Le(this,nt,yv).call(this);const t=ss(this.options.staleTime,U(this,Ge));if(co||U(this,On).isStale||!cv(t))return;const r=w2(U(this,On).dataUpdatedAt,t)+1;pe(this,Ys,setTimeout(()=>{U(this,On).isStale||this.updateResult()},r))},mv=function(){return(typeof this.options.refetchInterval=="function"?this.options.refetchInterval(U(this,Ge)):this.options.refetchInterval)??!1},pv=function(t){Le(this,nt,vv).call(this),pe(this,qi,t),!(co||Nr(this.options.enabled,U(this,Ge))===!1||!cv(U(this,qi))||U(this,qi)===0)&&pe(this,Xs,setInterval(()=>{(this.options.refetchIntervalInBackground||Fb.isFocused())&&Le(this,nt,Yc).call(this)},U(this,qi)))},gv=function(){Le(this,nt,hv).call(this),Le(this,nt,pv).call(this,Le(this,nt,mv).call(this))},yv=function(){U(this,Ys)&&(clearTimeout(U(this,Ys)),pe(this,Ys,void 0))},vv=function(){U(this,Xs)&&(clearInterval(U(this,Xs)),pe(this,Xs,void 0))},bv=function(){const t=U(this,Bn).getQueryCache().build(U(this,Bn),this.options);if(t===U(this,Ge))return;const n=U(this,Ge);pe(this,Ge,t),pe(this,rd,t.state),this.hasListeners()&&(n==null||n.removeObserver(this),t.addObserver(this))},R2=function(t){Wt.batch(()=>{t.listeners&&this.listeners.forEach(n=>{n(U(this,On))}),U(this,Bn).getQueryCache().notify({query:U(this,Ge),type:"observerResultsUpdated"})})},sC);function E3(e,t){return Nr(t.enabled,e)!==!1&&e.state.data===void 0&&!(e.state.status==="error"&&t.retryOnMount===!1)}function s_(e,t){return E3(e,t)||e.state.data!==void 0&&xv(e,t,t.refetchOnMount)}function xv(e,t,n){if(Nr(t.enabled,e)!==!1&&ss(t.staleTime,e)!=="static"){const r=typeof n=="function"?n(e):n;return r==="always"||r!==!1&&qb(e,t)}return!1}function o_(e,t,n,r){return(e!==t||Nr(r.enabled,e)===!1)&&(!n.suspense||e.state.status!=="error")&&qb(e,n)}function qb(e,t){return Nr(t.enabled,e)!==!1&&e.isStaleByTime(ss(t.staleTime,e))}function C3(e,t){return!Hh(e.getCurrentResult(),t)}var Hi,Bi,Vn,Va,ri,Gf,wv,oC,N3=(oC=class extends mc{constructor(n,r){super();_e(this,ri);_e(this,Hi);_e(this,Bi);_e(this,Vn);_e(this,Va);pe(this,Hi,n),this.setOptions(r),this.bindMethods(),Le(this,ri,Gf).call(this)}bindMethods(){this.mutate=this.mutate.bind(this),this.reset=this.reset.bind(this)}setOptions(n){var a;const r=this.options;this.options=U(this,Hi).defaultMutationOptions(n),Hh(this.options,r)||U(this,Hi).getMutationCache().notify({type:"observerOptionsUpdated",mutation:U(this,Vn),observer:this}),r!=null&&r.mutationKey&&this.options.mutationKey&&uo(r.mutationKey)!==uo(this.options.mutationKey)?this.reset():((a=U(this,Vn))==null?void 0:a.state.status)==="pending"&&U(this,Vn).setOptions(this.options)}onUnsubscribe(){var n;this.hasListeners()||(n=U(this,Vn))==null||n.removeObserver(this)}onMutationUpdate(n){Le(this,ri,Gf).call(this),Le(this,ri,wv).call(this,n)}getCurrentResult(){return U(this,Bi)}reset(){var n;(n=U(this,Vn))==null||n.removeObserver(this),pe(this,Vn,void 0),Le(this,ri,Gf).call(this),Le(this,ri,wv).call(this)}mutate(n,r){var a;return pe(this,Va,r),(a=U(this,Vn))==null||a.removeObserver(this),pe(this,Vn,U(this,Hi).getMutationCache().build(U(this,Hi),this.options)),U(this,Vn).addObserver(this),U(this,Vn).execute(n)}},Hi=new WeakMap,Bi=new WeakMap,Vn=new WeakMap,Va=new WeakMap,ri=new WeakSet,Gf=function(){var r;const n=((r=U(this,Vn))==null?void 0:r.state)??A2();pe(this,Bi,{...n,isPending:n.status==="pending",isSuccess:n.status==="success",isError:n.status==="error",isIdle:n.status==="idle",mutate:this.mutate,reset:this.reset})},wv=function(n){Wt.batch(()=>{var r,a,i,s,o,l,u,d;if(U(this,Va)&&this.hasListeners()){const f=U(this,Bi).variables,m=U(this,Bi).context;(n==null?void 0:n.type)==="success"?((a=(r=U(this,Va)).onSuccess)==null||a.call(r,n.data,f,m),(s=(i=U(this,Va)).onSettled)==null||s.call(i,n.data,null,f,m)):(n==null?void 0:n.type)==="error"&&((l=(o=U(this,Va)).onError)==null||l.call(o,n.error,f,m),(d=(u=U(this,Va)).onSettled)==null||d.call(u,void 0,n.error,f,m))}this.listeners.forEach(f=>{f(U(this,Bi))})})},oC),$2=x.createContext(void 0),cn=e=>{const t=x.useContext($2);if(!t)throw new Error("No QueryClient set, use QueryClientProvider to set one");return t},j3=({client:e,children:t})=>(x.useEffect(()=>(e.mount(),()=>{e.unmount()}),[e]),c.jsx($2.Provider,{value:e,children:t})),O2=x.createContext(!1),T3=()=>x.useContext(O2);O2.Provider;function A3(){let e=!1;return{clearReset:()=>{e=!1},reset:()=>{e=!0},isReset:()=>e}}var R3=x.createContext(A3()),$3=()=>x.useContext(R3),O3=(e,t)=>{(e.suspense||e.throwOnError||e.experimental_prefetchInRender)&&(t.isReset()||(e.retryOnMount=!1))},M3=e=>{x.useEffect(()=>{e.clearReset()},[e])},P3=({result:e,errorResetBoundary:t,throwOnError:n,query:r,suspense:a})=>e.isError&&!t.isReset()&&!e.isFetching&&r&&(a&&e.data===void 0||k2(n,[e.error,r])),D3=e=>{if(e.suspense){const t=r=>r==="static"?r:Math.max(r??1e3,1e3),n=e.staleTime;e.staleTime=typeof n=="function"?(...r)=>t(n(...r)):t(n),typeof e.gcTime=="number"&&(e.gcTime=Math.max(e.gcTime,1e3))}},z3=(e,t)=>e.isLoading&&e.isFetching&&!t,I3=(e,t)=>(e==null?void 0:e.suspense)&&t.isPending,l_=(e,t,n)=>t.fetchOptimistic(e).catch(()=>{n.clearReset()});function L3(e,t,n){var f,m,h,y,p;const r=T3(),a=$3(),i=cn(),s=i.defaultQueryOptions(e);(m=(f=i.getDefaultOptions().queries)==null?void 0:f._experimental_beforeQuery)==null||m.call(f,s),s._optimisticResults=r?"isRestoring":"optimistic",D3(s),O3(s,a),M3(a);const o=!i.getQueryCache().get(s.queryHash),[l]=x.useState(()=>new t(i,s)),u=l.getOptimisticResult(s),d=!r&&e.subscribed!==!1;if(x.useSyncExternalStore(x.useCallback(b=>{const g=d?l.subscribe(Wt.batchCalls(b)):Dn;return l.updateResult(),g},[l,d]),()=>l.getCurrentResult(),()=>l.getCurrentResult()),x.useEffect(()=>{l.setOptions(s)},[s,l]),I3(s,u))throw l_(s,l,a);if(P3({result:u,errorResetBoundary:a,throwOnError:s.throwOnError,query:i.getQueryCache().get(s.queryHash),suspense:s.suspense}))throw u.error;if((y=(h=i.getDefaultOptions().queries)==null?void 0:h._experimental_afterQuery)==null||y.call(h,s,u),s.experimental_prefetchInRender&&!co&&z3(u,r)){const b=o?l_(s,l,a):(p=i.getQueryCache().get(s.queryHash))==null?void 0:p.promise;b==null||b.catch(Dn).finally(()=>{l.updateResult()})}return s.notifyOnChangeProps?u:l.trackResult(u)}function wt(e,t){return L3(e,k3)}function St(e,t){const n=cn(),[r]=x.useState(()=>new N3(n,e));x.useEffect(()=>{r.setOptions(e)},[r,e]);const a=x.useSyncExternalStore(x.useCallback(s=>r.subscribe(Wt.batchCalls(s)),[r]),()=>r.getCurrentResult(),()=>r.getCurrentResult()),i=x.useCallback((s,o)=>{r.mutate(s,o).catch(Dn)},[r]);if(a.error&&k2(r.options.throwOnError,[a.error]))throw a.error;return{...a,mutate:i,mutateAsync:a.mutate}}async function M2(e){if(e.ok)return;let t=e.statusText;try{const n=await e.text();try{const r=JSON.parse(n);t=r.error||r.message||t}catch{n.trim()&&(t=`${e.status}: ${n}`)}}catch(n){console.warn("Response body parsing failed:",n)}throw new Error(t)}async function ke(e,t,n){const r=await fetch(t,{method:e,credentials:"include",headers:{...n?{"Content-Type":"application/json"}:{}},body:n?JSON.stringify(n):void 0});return await M2(r),r}const U3=({on401:e})=>async({queryKey:t})=>{const n=t.join("/"),r=await fetch(n,{credentials:"include"});return await M2(r),await r.json()},F3=new _3({defaultOptions:{queries:{queryFn:U3({on401:"throw"}),refetchInterval:!1,refetchOnWindowFocus:!0,staleTime:0,gcTime:10*60*1e3,retry:!1},mutations:{retry:!1}}});async function q3(){const e=new URLSearchParams(window.location.search),t=e.get("bootstrap");if(!t)return;const n=await fetch("/api/dashboard-auth/bootstrap/session",{method:"POST",credentials:"include",headers:{"Content-Type":"application/json"},body:JSON.stringify({nonce:t})});if(!n.ok){console.warn("[agent-deck] Dashboard bootstrap failed:",n.status);return}e.delete("bootstrap");const r=`${window.location.pathname}${e.toString()?`?${e}`:""}${window.location.hash}`;window.history.replaceState({},"",r)}const H3=1,B3=1e6;let xg=0;function V3(){return xg=(xg+1)%Number.MAX_SAFE_INTEGER,xg.toString()}const wg=new Map,c_=e=>{if(wg.has(e))return;const t=setTimeout(()=>{wg.delete(e),yu({type:"REMOVE_TOAST",toastId:e})},B3);wg.set(e,t)},K3=(e,t)=>{switch(t.type){case"ADD_TOAST":return{...e,toasts:[t.toast,...e.toasts].slice(0,H3)};case"UPDATE_TOAST":return{...e,toasts:e.toasts.map(n=>n.id===t.toast.id?{...n,...t.toast}:n)};case"DISMISS_TOAST":{const{toastId:n}=t;return n?c_(n):e.toasts.forEach(r=>{c_(r.id)}),{...e,toasts:e.toasts.map(r=>r.id===n||n===void 0?{...r,open:!1}:r)}}case"REMOVE_TOAST":return t.toastId===void 0?{...e,toasts:[]}:{...e,toasts:e.toasts.filter(n=>n.id!==t.toastId)}}},Qf=[];let Yf={toasts:[]};function yu(e){Yf=K3(Yf,e),Qf.forEach(t=>{t(Yf)})}function Z3({...e}){const t=V3(),n=a=>yu({type:"UPDATE_TOAST",toast:{...a,id:t}}),r=()=>yu({type:"DISMISS_TOAST",toastId:t});return yu({type:"ADD_TOAST",toast:{...e,id:t,open:!0,onOpenChange:a=>{a||r()}}}),{id:t,dismiss:r,update:n}}function nn(){const[e,t]=x.useState(Yf);return x.useEffect(()=>(Qf.push(t),()=>{const n=Qf.indexOf(t);n>-1&&Qf.splice(n,1)}),[e]),{...e,toast:Z3,dismiss:n=>yu({type:"DISMISS_TOAST",toastId:n})}}function xe(e,t,{checkForDefaultPrevented:n=!0}={}){return function(a){if(e==null||e(a),n===!1||!a.defaultPrevented)return t==null?void 0:t(a)}}function u_(e,t){if(typeof e=="function")return e(t);e!=null&&(e.current=t)}function P2(...e){return t=>{let n=!1;const r=e.map(a=>{const i=u_(a,t);return!n&&typeof i=="function"&&(n=!0),i});if(n)return()=>{for(let a=0;a<r.length;a++){const i=r[a];typeof i=="function"?i():u_(e[a],null)}}}}function lt(...e){return x.useCallback(P2(...e),e)}function G3(e,t){const n=x.createContext(t),r=i=>{const{children:s,...o}=i,l=x.useMemo(()=>o,Object.values(o));return c.jsx(n.Provider,{value:l,children:s})};r.displayName=e+"Provider";function a(i){const s=x.useContext(n);if(s)return s;if(t!==void 0)return t;throw new Error(`\`${i}\` must be used within \`${e}\``)}return[r,a]}function fi(e,t=[]){let n=[];function r(i,s){const o=x.createContext(s),l=n.length;n=[...n,s];const u=f=>{var g;const{scope:m,children:h,...y}=f,p=((g=m==null?void 0:m[e])==null?void 0:g[l])||o,b=x.useMemo(()=>y,Object.values(y));return c.jsx(p.Provider,{value:b,children:h})};u.displayName=i+"Provider";function d(f,m){var p;const h=((p=m==null?void 0:m[e])==null?void 0:p[l])||o,y=x.useContext(h);if(y)return y;if(s!==void 0)return s;throw new Error(`\`${f}\` must be used within \`${i}\``)}return[u,d]}const a=()=>{const i=n.map(s=>x.createContext(s));return function(o){const l=(o==null?void 0:o[e])||i;return x.useMemo(()=>({[`__scope${e}`]:{...o,[e]:l}}),[o,l])}};return a.scopeName=e,[r,Q3(a,...t)]}function Q3(...e){const t=e[0];if(e.length===1)return t;const n=()=>{const r=e.map(a=>({useScope:a(),scopeName:a.scopeName}));return function(i){const s=r.reduce((o,{useScope:l,scopeName:u})=>{const f=l(i)[`__scope${u}`];return{...o,...f}},{});return x.useMemo(()=>({[`__scope${t.scopeName}`]:s}),[s])}};return n.scopeName=t.scopeName,n}function fo(e){const t=X3(e),n=x.forwardRef((r,a)=>{const{children:i,...s}=r,o=x.Children.toArray(i),l=o.find(J3);if(l){const u=l.props.children,d=o.map(f=>f===l?x.Children.count(u)>1?x.Children.only(null):x.isValidElement(u)?u.props.children:null:f);return c.jsx(t,{...s,ref:a,children:x.isValidElement(u)?x.cloneElement(u,void 0,d):null})}return c.jsx(t,{...s,ref:a,children:i})});return n.displayName=`${e}.Slot`,n}var Y3=fo("Slot");function X3(e){const t=x.forwardRef((n,r)=>{const{children:a,...i}=n;if(x.isValidElement(a)){const s=tI(a),o=eI(i,a.props);return a.type!==x.Fragment&&(o.ref=r?P2(r,s):s),x.cloneElement(a,o)}return x.Children.count(a)>1?x.Children.only(null):null});return t.displayName=`${e}.SlotClone`,t}var D2=Symbol("radix.slottable");function W3(e){const t=({children:n})=>c.jsx(c.Fragment,{children:n});return t.displayName=`${e}.Slottable`,t.__radixId=D2,t}function J3(e){return x.isValidElement(e)&&typeof e.type=="function"&&"__radixId"in e.type&&e.type.__radixId===D2}function eI(e,t){const n={...t};for(const r in t){const a=e[r],i=t[r];/^on[A-Z]/.test(r)?a&&i?n[r]=(...o)=>{const l=i(...o);return a(...o),l}:a&&(n[r]=a):r==="style"?n[r]={...a,...i}:r==="className"&&(n[r]=[a,i].filter(Boolean).join(" "))}return{...e,...n}}function tI(e){var r,a;let t=(r=Object.getOwnPropertyDescriptor(e.props,"ref"))==null?void 0:r.get,n=t&&"isReactWarning"in t&&t.isReactWarning;return n?e.ref:(t=(a=Object.getOwnPropertyDescriptor(e,"ref"))==null?void 0:a.get,n=t&&"isReactWarning"in t&&t.isReactWarning,n?e.props.ref:e.props.ref||e.ref)}function Hb(e){const t=e+"CollectionProvider",[n,r]=fi(t),[a,i]=n(t,{collectionRef:{current:null},itemMap:new Map}),s=p=>{const{scope:b,children:g}=p,v=ca.useRef(null),w=ca.useRef(new Map).current;return c.jsx(a,{scope:b,itemMap:w,collectionRef:v,children:g})};s.displayName=t;const o=e+"CollectionSlot",l=fo(o),u=ca.forwardRef((p,b)=>{const{scope:g,children:v}=p,w=i(o,g),S=lt(b,w.collectionRef);return c.jsx(l,{ref:S,children:v})});u.displayName=o;const d=e+"CollectionItemSlot",f="data-radix-collection-item",m=fo(d),h=ca.forwardRef((p,b)=>{const{scope:g,children:v,...w}=p,S=ca.useRef(null),E=lt(b,S),C=i(d,g);return ca.useEffect(()=>(C.itemMap.set(S,{ref:S,...w}),()=>void C.itemMap.delete(S))),c.jsx(m,{[f]:"",ref:E,children:v})});h.displayName=d;function y(p){const b=i(e+"CollectionConsumer",p);return ca.useCallback(()=>{const v=b.collectionRef.current;if(!v)return[];const w=Array.from(v.querySelectorAll(`[${f}]`));return Array.from(b.itemMap.values()).sort((C,T)=>w.indexOf(C.ref.current)-w.indexOf(T.ref.current))},[b.collectionRef,b.itemMap])}return[{Provider:s,Slot:u,ItemSlot:h},y,r]}var nI=["a","button","div","form","h2","h3","img","input","label","li","nav","ol","p","select","span","svg","ul"],De=nI.reduce((e,t)=>{const n=fo(`Primitive.${t}`),r=x.forwardRef((a,i)=>{const{asChild:s,...o}=a,l=s?n:t;return typeof window<"u"&&(window[Symbol.for("radix-ui")]=!0),c.jsx(l,{...o,ref:i})});return r.displayName=`Primitive.${t}`,{...e,[t]:r}},{});function z2(e,t){e&&So.flushSync(()=>e.dispatchEvent(t))}function Lr(e){const t=x.useRef(e);return x.useEffect(()=>{t.current=e}),x.useMemo(()=>(...n)=>{var r;return(r=t.current)==null?void 0:r.call(t,...n)},[])}function rI(e,t=globalThis==null?void 0:globalThis.document){const n=Lr(e);x.useEffect(()=>{const r=a=>{a.key==="Escape"&&n(a)};return t.addEventListener("keydown",r,{capture:!0}),()=>t.removeEventListener("keydown",r,{capture:!0})},[n,t])}var aI="DismissableLayer",Sv="dismissableLayer.update",iI="dismissableLayer.pointerDownOutside",sI="dismissableLayer.focusOutside",d_,I2=x.createContext({layers:new Set,layersWithOutsidePointerEventsDisabled:new Set,branches:new Set}),pc=x.forwardRef((e,t)=>{const{disableOutsidePointerEvents:n=!1,onEscapeKeyDown:r,onPointerDownOutside:a,onFocusOutside:i,onInteractOutside:s,onDismiss:o,...l}=e,u=x.useContext(I2),[d,f]=x.useState(null),m=(d==null?void 0:d.ownerDocument)??(globalThis==null?void 0:globalThis.document),[,h]=x.useState({}),y=lt(t,T=>f(T)),p=Array.from(u.layers),[b]=[...u.layersWithOutsidePointerEventsDisabled].slice(-1),g=p.indexOf(b),v=d?p.indexOf(d):-1,w=u.layersWithOutsidePointerEventsDisabled.size>0,S=v>=g,E=lI(T=>{const P=T.target,R=[...u.branches].some($=>$.contains(P));!S||R||(a==null||a(T),s==null||s(T),T.defaultPrevented||o==null||o())},m),C=cI(T=>{const P=T.target;[...u.branches].some($=>$.contains(P))||(i==null||i(T),s==null||s(T),T.defaultPrevented||o==null||o())},m);return rI(T=>{v===u.layers.size-1&&(r==null||r(T),!T.defaultPrevented&&o&&(T.preventDefault(),o()))},m),x.useEffect(()=>{if(d)return n&&(u.layersWithOutsidePointerEventsDisabled.size===0&&(d_=m.body.style.pointerEvents,m.body.style.pointerEvents="none"),u.layersWithOutsidePointerEventsDisabled.add(d)),u.layers.add(d),f_(),()=>{n&&u.layersWithOutsidePointerEventsDisabled.size===1&&(m.body.style.pointerEvents=d_)}},[d,m,n,u]),x.useEffect(()=>()=>{d&&(u.layers.delete(d),u.layersWithOutsidePointerEventsDisabled.delete(d),f_())},[d,u]),x.useEffect(()=>{const T=()=>h({});return document.addEventListener(Sv,T),()=>document.removeEventListener(Sv,T)},[]),c.jsx(De.div,{...l,ref:y,style:{pointerEvents:w?S?"auto":"none":void 0,...e.style},onFocusCapture:xe(e.onFocusCapture,C.onFocusCapture),onBlurCapture:xe(e.onBlurCapture,C.onBlurCapture),onPointerDownCapture:xe(e.onPointerDownCapture,E.onPointerDownCapture)})});pc.displayName=aI;var oI="DismissableLayerBranch",L2=x.forwardRef((e,t)=>{const n=x.useContext(I2),r=x.useRef(null),a=lt(t,r);return x.useEffect(()=>{const i=r.current;if(i)return n.branches.add(i),()=>{n.branches.delete(i)}},[n.branches]),c.jsx(De.div,{...e,ref:a})});L2.displayName=oI;function lI(e,t=globalThis==null?void 0:globalThis.document){const n=Lr(e),r=x.useRef(!1),a=x.useRef(()=>{});return x.useEffect(()=>{const i=o=>{if(o.target&&!r.current){let l=function(){U2(iI,n,u,{discrete:!0})};const u={originalEvent:o};o.pointerType==="touch"?(t.removeEventListener("click",a.current),a.current=l,t.addEventListener("click",a.current,{once:!0})):l()}else t.removeEventListener("click",a.current);r.current=!1},s=window.setTimeout(()=>{t.addEventListener("pointerdown",i)},0);return()=>{window.clearTimeout(s),t.removeEventListener("pointerdown",i),t.removeEventListener("click",a.current)}},[t,n]),{onPointerDownCapture:()=>r.current=!0}}function cI(e,t=globalThis==null?void 0:globalThis.document){const n=Lr(e),r=x.useRef(!1);return x.useEffect(()=>{const a=i=>{i.target&&!r.current&&U2(sI,n,{originalEvent:i},{discrete:!1})};return t.addEventListener("focusin",a),()=>t.removeEventListener("focusin",a)},[t,n]),{onFocusCapture:()=>r.current=!0,onBlurCapture:()=>r.current=!1}}function f_(){const e=new CustomEvent(Sv);document.dispatchEvent(e)}function U2(e,t,n,{discrete:r}){const a=n.originalEvent.target,i=new CustomEvent(e,{bubbles:!1,cancelable:!0,detail:n});t&&a.addEventListener(e,t,{once:!0}),r?z2(a,i):a.dispatchEvent(i)}var uI=pc,dI=L2,Sn=globalThis!=null&&globalThis.document?x.useLayoutEffect:()=>{},fI="Portal",bd=x.forwardRef((e,t)=>{var o;const{container:n,...r}=e,[a,i]=x.useState(!1);Sn(()=>i(!0),[]);const s=n||a&&((o=globalThis==null?void 0:globalThis.document)==null?void 0:o.body);return s?nD.createPortal(c.jsx(De.div,{...r,ref:t}),s):null});bd.displayName=fI;function hI(e,t){return x.useReducer((n,r)=>t[n][r]??n,e)}var hi=e=>{const{present:t,children:n}=e,r=mI(t),a=typeof n=="function"?n({present:r.isPresent}):x.Children.only(n),i=lt(r.ref,pI(a));return typeof n=="function"||r.isPresent?x.cloneElement(a,{ref:i}):null};hi.displayName="Presence";function mI(e){const[t,n]=x.useState(),r=x.useRef(null),a=x.useRef(e),i=x.useRef("none"),s=e?"mounted":"unmounted",[o,l]=hI(s,{mounted:{UNMOUNT:"unmounted",ANIMATION_OUT:"unmountSuspended"},unmountSuspended:{MOUNT:"mounted",ANIMATION_END:"unmounted"},unmounted:{MOUNT:"mounted"}});return x.useEffect(()=>{const u=sf(r.current);i.current=o==="mounted"?u:"none"},[o]),Sn(()=>{const u=r.current,d=a.current;if(d!==e){const m=i.current,h=sf(u);e?l("MOUNT"):h==="none"||(u==null?void 0:u.display)==="none"?l("UNMOUNT"):l(d&&m!==h?"ANIMATION_OUT":"UNMOUNT"),a.current=e}},[e,l]),Sn(()=>{if(t){let u;const d=t.ownerDocument.defaultView??window,f=h=>{const p=sf(r.current).includes(CSS.escape(h.animationName));if(h.target===t&&p&&(l("ANIMATION_END"),!a.current)){const b=t.style.animationFillMode;t.style.animationFillMode="forwards",u=d.setTimeout(()=>{t.style.animationFillMode==="forwards"&&(t.style.animationFillMode=b)})}},m=h=>{h.target===t&&(i.current=sf(r.current))};return t.addEventListener("animationstart",m),t.addEventListener("animationcancel",f),t.addEventListener("animationend",f),()=>{d.clearTimeout(u),t.removeEventListener("animationstart",m),t.removeEventListener("animationcancel",f),t.removeEventListener("animationend",f)}}else l("ANIMATION_END")},[t,l]),{isPresent:["mounted","unmountSuspended"].includes(o),ref:x.useCallback(u=>{r.current=u?getComputedStyle(u):null,n(u)},[])}}function sf(e){return(e==null?void 0:e.animationName)||"none"}function pI(e){var r,a;let t=(r=Object.getOwnPropertyDescriptor(e.props,"ref"))==null?void 0:r.get,n=t&&"isReactWarning"in t&&t.isReactWarning;return n?e.ref:(t=(a=Object.getOwnPropertyDescriptor(e,"ref"))==null?void 0:a.get,n=t&&"isReactWarning"in t&&t.isReactWarning,n?e.props.ref:e.props.ref||e.ref)}var gI=id[" useInsertionEffect ".trim().toString()]||Sn;function ho({prop:e,defaultProp:t,onChange:n=()=>{},caller:r}){const[a,i,s]=yI({defaultProp:t,onChange:n}),o=e!==void 0,l=o?e:a;{const d=x.useRef(e!==void 0);x.useEffect(()=>{const f=d.current;f!==o&&console.warn(`${r} is changing from ${f?"controlled":"uncontrolled"} to ${o?"controlled":"uncontrolled"}. Components should not switch from controlled to uncontrolled (or vice versa). Decide between using a controlled or uncontrolled value for the lifetime of the component.`),d.current=o},[o,r])}const u=x.useCallback(d=>{var f;if(o){const m=vI(d)?d(e):d;m!==e&&((f=s.current)==null||f.call(s,m))}else i(d)},[o,e,i,s]);return[l,u]}function yI({defaultProp:e,onChange:t}){const[n,r]=x.useState(e),a=x.useRef(n),i=x.useRef(t);return gI(()=>{i.current=t},[t]),x.useEffect(()=>{var s;a.current!==n&&((s=i.current)==null||s.call(i,n),a.current=n)},[n,a]),[n,r,i]}function vI(e){return typeof e=="function"}var F2=Object.freeze({position:"absolute",border:0,width:1,height:1,padding:0,margin:-1,overflow:"hidden",clip:"rect(0, 0, 0, 0)",whiteSpace:"nowrap",wordWrap:"normal"}),bI="VisuallyHidden",Gm=x.forwardRef((e,t)=>c.jsx(De.span,{...e,ref:t,style:{...F2,...e.style}}));Gm.displayName=bI;var xI=Gm,Bb="ToastProvider",[Vb,wI,SI]=Hb("Toast"),[q2,die]=fi("Toast",[SI]),[_I,Qm]=q2(Bb),H2=e=>{const{__scopeToast:t,label:n="Notification",duration:r=5e3,swipeDirection:a="right",swipeThreshold:i=50,children:s}=e,[o,l]=x.useState(null),[u,d]=x.useState(0),f=x.useRef(!1),m=x.useRef(!1);return n.trim()||console.error(`Invalid prop \`label\` supplied to \`${Bb}\`. Expected non-empty \`string\`.`),c.jsx(Vb.Provider,{scope:t,children:c.jsx(_I,{scope:t,label:n,duration:r,swipeDirection:a,swipeThreshold:i,toastCount:u,viewport:o,onViewportChange:l,onToastAdd:x.useCallback(()=>d(h=>h+1),[]),onToastRemove:x.useCallback(()=>d(h=>h-1),[]),isFocusedToastEscapeKeyDownRef:f,isClosePausedRef:m,children:s})})};H2.displayName=Bb;var B2="ToastViewport",kI=["F8"],_v="toast.viewportPause",kv="toast.viewportResume",V2=x.forwardRef((e,t)=>{const{__scopeToast:n,hotkey:r=kI,label:a="Notifications ({hotkey})",...i}=e,s=Qm(B2,n),o=wI(n),l=x.useRef(null),u=x.useRef(null),d=x.useRef(null),f=x.useRef(null),m=lt(t,f,s.onViewportChange),h=r.join("+").replace(/Key/g,"").replace(/Digit/g,""),y=s.toastCount>0;x.useEffect(()=>{const b=g=>{var w;r.length!==0&&r.every(S=>g[S]||g.code===S)&&((w=f.current)==null||w.focus())};return document.addEventListener("keydown",b),()=>document.removeEventListener("keydown",b)},[r]),x.useEffect(()=>{const b=l.current,g=f.current;if(y&&b&&g){const v=()=>{if(!s.isClosePausedRef.current){const C=new CustomEvent(_v);g.dispatchEvent(C),s.isClosePausedRef.current=!0}},w=()=>{if(s.isClosePausedRef.current){const C=new CustomEvent(kv);g.dispatchEvent(C),s.isClosePausedRef.current=!1}},S=C=>{!b.contains(C.relatedTarget)&&w()},E=()=>{b.contains(document.activeElement)||w()};return b.addEventListener("focusin",v),b.addEventListener("focusout",S),b.addEventListener("pointermove",v),b.addEventListener("pointerleave",E),window.addEventListener("blur",v),window.addEventListener("focus",w),()=>{b.removeEventListener("focusin",v),b.removeEventListener("focusout",S),b.removeEventListener("pointermove",v),b.removeEventListener("pointerleave",E),window.removeEventListener("blur",v),window.removeEventListener("focus",w)}}},[y,s.isClosePausedRef]);const p=x.useCallback(({tabbingDirection:b})=>{const v=o().map(w=>{const S=w.ref.current,E=[S,...zI(S)];return b==="forwards"?E:E.reverse()});return(b==="forwards"?v.reverse():v).flat()},[o]);return x.useEffect(()=>{const b=f.current;if(b){const g=v=>{var E,C,T;const w=v.altKey||v.ctrlKey||v.metaKey;if(v.key==="Tab"&&!w){const P=document.activeElement,R=v.shiftKey;if(v.target===b&&R){(E=u.current)==null||E.focus();return}const O=p({tabbingDirection:R?"backwards":"forwards"}),z=O.findIndex(D=>D===P);Sg(O.slice(z+1))?v.preventDefault():R?(C=u.current)==null||C.focus():(T=d.current)==null||T.focus()}};return b.addEventListener("keydown",g),()=>b.removeEventListener("keydown",g)}},[o,p]),c.jsxs(dI,{ref:l,role:"region","aria-label":a.replace("{hotkey}",h),tabIndex:-1,style:{pointerEvents:y?void 0:"none"},children:[y&&c.jsx(Ev,{ref:u,onFocusFromOutsideViewport:()=>{const b=p({tabbingDirection:"forwards"});Sg(b)}}),c.jsx(Vb.Slot,{scope:n,children:c.jsx(De.ol,{tabIndex:-1,...i,ref:m})}),y&&c.jsx(Ev,{ref:d,onFocusFromOutsideViewport:()=>{const b=p({tabbingDirection:"backwards"});Sg(b)}})]})});V2.displayName=B2;var K2="ToastFocusProxy",Ev=x.forwardRef((e,t)=>{const{__scopeToast:n,onFocusFromOutsideViewport:r,...a}=e,i=Qm(K2,n);return c.jsx(Gm,{tabIndex:0,...a,ref:t,style:{position:"fixed"},onFocus:s=>{var u;const o=s.relatedTarget;!((u=i.viewport)!=null&&u.contains(o))&&r()}})});Ev.displayName=K2;var xd="Toast",EI="toast.swipeStart",CI="toast.swipeMove",NI="toast.swipeCancel",jI="toast.swipeEnd",Z2=x.forwardRef((e,t)=>{const{forceMount:n,open:r,defaultOpen:a,onOpenChange:i,...s}=e,[o,l]=ho({prop:r,defaultProp:a??!0,onChange:i,caller:xd});return c.jsx(hi,{present:n||o,children:c.jsx(RI,{open:o,...s,ref:t,onClose:()=>l(!1),onPause:Lr(e.onPause),onResume:Lr(e.onResume),onSwipeStart:xe(e.onSwipeStart,u=>{u.currentTarget.setAttribute("data-swipe","start")}),onSwipeMove:xe(e.onSwipeMove,u=>{const{x:d,y:f}=u.detail.delta;u.currentTarget.setAttribute("data-swipe","move"),u.currentTarget.style.setProperty("--radix-toast-swipe-move-x",`${d}px`),u.currentTarget.style.setProperty("--radix-toast-swipe-move-y",`${f}px`)}),onSwipeCancel:xe(e.onSwipeCancel,u=>{u.currentTarget.setAttribute("data-swipe","cancel"),u.currentTarget.style.removeProperty("--radix-toast-swipe-move-x"),u.currentTarget.style.removeProperty("--radix-toast-swipe-move-y"),u.currentTarget.style.removeProperty("--radix-toast-swipe-end-x"),u.currentTarget.style.removeProperty("--radix-toast-swipe-end-y")}),onSwipeEnd:xe(e.onSwipeEnd,u=>{const{x:d,y:f}=u.detail.delta;u.currentTarget.setAttribute("data-swipe","end"),u.currentTarget.style.removeProperty("--radix-toast-swipe-move-x"),u.currentTarget.style.removeProperty("--radix-toast-swipe-move-y"),u.currentTarget.style.setProperty("--radix-toast-swipe-end-x",`${d}px`),u.currentTarget.style.setProperty("--radix-toast-swipe-end-y",`${f}px`),l(!1)})})})});Z2.displayName=xd;var[TI,AI]=q2(xd,{onClose(){}}),RI=x.forwardRef((e,t)=>{const{__scopeToast:n,type:r="foreground",duration:a,open:i,onClose:s,onEscapeKeyDown:o,onPause:l,onResume:u,onSwipeStart:d,onSwipeMove:f,onSwipeCancel:m,onSwipeEnd:h,...y}=e,p=Qm(xd,n),[b,g]=x.useState(null),v=lt(t,D=>g(D)),w=x.useRef(null),S=x.useRef(null),E=a||p.duration,C=x.useRef(0),T=x.useRef(E),P=x.useRef(0),{onToastAdd:R,onToastRemove:$}=p,j=Lr(()=>{var A;(b==null?void 0:b.contains(document.activeElement))&&((A=p.viewport)==null||A.focus()),s()}),O=x.useCallback(D=>{!D||D===1/0||(window.clearTimeout(P.current),C.current=new Date().getTime(),P.current=window.setTimeout(j,D))},[j]);x.useEffect(()=>{const D=p.viewport;if(D){const A=()=>{O(T.current),u==null||u()},B=()=>{const Z=new Date().getTime()-C.current;T.current=T.current-Z,window.clearTimeout(P.current),l==null||l()};return D.addEventListener(_v,B),D.addEventListener(kv,A),()=>{D.removeEventListener(_v,B),D.removeEventListener(kv,A)}}},[p.viewport,E,l,u,O]),x.useEffect(()=>{i&&!p.isClosePausedRef.current&&O(E)},[i,E,p.isClosePausedRef,O]),x.useEffect(()=>(R(),()=>$()),[R,$]);const z=x.useMemo(()=>b?eT(b):null,[b]);return p.viewport?c.jsxs(c.Fragment,{children:[z&&c.jsx($I,{__scopeToast:n,role:"status","aria-live":r==="foreground"?"assertive":"polite",children:z}),c.jsx(TI,{scope:n,onClose:j,children:So.createPortal(c.jsx(Vb.ItemSlot,{scope:n,children:c.jsx(uI,{asChild:!0,onEscapeKeyDown:xe(o,()=>{p.isFocusedToastEscapeKeyDownRef.current||j(),p.isFocusedToastEscapeKeyDownRef.current=!1}),children:c.jsx(De.li,{tabIndex:0,"data-state":i?"open":"closed","data-swipe-direction":p.swipeDirection,...y,ref:v,style:{userSelect:"none",touchAction:"none",...e.style},onKeyDown:xe(e.onKeyDown,D=>{D.key==="Escape"&&(o==null||o(D.nativeEvent),D.nativeEvent.defaultPrevented||(p.isFocusedToastEscapeKeyDownRef.current=!0,j()))}),onPointerDown:xe(e.onPointerDown,D=>{D.button===0&&(w.current={x:D.clientX,y:D.clientY})}),onPointerMove:xe(e.onPointerMove,D=>{if(!w.current)return;const A=D.clientX-w.current.x,B=D.clientY-w.current.y,Z=!!S.current,F=["left","right"].includes(p.swipeDirection),J=["left","up"].includes(p.swipeDirection)?Math.min:Math.max,N=F?J(0,A):0,q=F?0:J(0,B),G=D.pointerType==="touch"?10:2,_={x:N,y:q},k={originalEvent:D,delta:_};Z?(S.current=_,of(CI,f,k,{discrete:!1})):h_(_,p.swipeDirection,G)?(S.current=_,of(EI,d,k,{discrete:!1}),D.target.setPointerCapture(D.pointerId)):(Math.abs(A)>G||Math.abs(B)>G)&&(w.current=null)}),onPointerUp:xe(e.onPointerUp,D=>{const A=S.current,B=D.target;if(B.hasPointerCapture(D.pointerId)&&B.releasePointerCapture(D.pointerId),S.current=null,w.current=null,A){const Z=D.currentTarget,F={originalEvent:D,delta:A};h_(A,p.swipeDirection,p.swipeThreshold)?of(jI,h,F,{discrete:!0}):of(NI,m,F,{discrete:!0}),Z.addEventListener("click",J=>J.preventDefault(),{once:!0})}})})})}),p.viewport)})]}):null}),$I=e=>{const{__scopeToast:t,children:n,...r}=e,a=Qm(xd,t),[i,s]=x.useState(!1),[o,l]=x.useState(!1);return PI(()=>s(!0)),x.useEffect(()=>{const u=window.setTimeout(()=>l(!0),1e3);return()=>window.clearTimeout(u)},[]),o?null:c.jsx(bd,{asChild:!0,children:c.jsx(Gm,{...r,children:i&&c.jsxs(c.Fragment,{children:[a.label," ",n]})})})},OI="ToastTitle",G2=x.forwardRef((e,t)=>{const{__scopeToast:n,...r}=e;return c.jsx(De.div,{...r,ref:t})});G2.displayName=OI;var MI="ToastDescription",Q2=x.forwardRef((e,t)=>{const{__scopeToast:n,...r}=e;return c.jsx(De.div,{...r,ref:t})});Q2.displayName=MI;var Y2="ToastAction",X2=x.forwardRef((e,t)=>{const{altText:n,...r}=e;return n.trim()?c.jsx(J2,{altText:n,asChild:!0,children:c.jsx(Kb,{...r,ref:t})}):(console.error(`Invalid prop \`altText\` supplied to \`${Y2}\`. Expected non-empty \`string\`.`),null)});X2.displayName=Y2;var W2="ToastClose",Kb=x.forwardRef((e,t)=>{const{__scopeToast:n,...r}=e,a=AI(W2,n);return c.jsx(J2,{asChild:!0,children:c.jsx(De.button,{type:"button",...r,ref:t,onClick:xe(e.onClick,a.onClose)})})});Kb.displayName=W2;var J2=x.forwardRef((e,t)=>{const{__scopeToast:n,altText:r,...a}=e;return c.jsx(De.div,{"data-radix-toast-announce-exclude":"","data-radix-toast-announce-alt":r||void 0,...a,ref:t})});function eT(e){const t=[];return Array.from(e.childNodes).forEach(r=>{if(r.nodeType===r.TEXT_NODE&&r.textContent&&t.push(r.textContent),DI(r)){const a=r.ariaHidden||r.hidden||r.style.display==="none",i=r.dataset.radixToastAnnounceExclude==="";if(!a)if(i){const s=r.dataset.radixToastAnnounceAlt;s&&t.push(s)}else t.push(...eT(r))}}),t}function of(e,t,n,{discrete:r}){const a=n.originalEvent.currentTarget,i=new CustomEvent(e,{bubbles:!0,cancelable:!0,detail:n});t&&a.addEventListener(e,t,{once:!0}),r?z2(a,i):a.dispatchEvent(i)}var h_=(e,t,n=0)=>{const r=Math.abs(e.x),a=Math.abs(e.y),i=r>a;return t==="left"||t==="right"?i&&r>n:!i&&a>n};function PI(e=()=>{}){const t=Lr(e);Sn(()=>{let n=0,r=0;return n=window.requestAnimationFrame(()=>r=window.requestAnimationFrame(t)),()=>{window.cancelAnimationFrame(n),window.cancelAnimationFrame(r)}},[t])}function DI(e){return e.nodeType===e.ELEMENT_NODE}function zI(e){const t=[],n=document.createTreeWalker(e,NodeFilter.SHOW_ELEMENT,{acceptNode:r=>{const a=r.tagName==="INPUT"&&r.type==="hidden";return r.disabled||r.hidden||a?NodeFilter.FILTER_SKIP:r.tabIndex>=0?NodeFilter.FILTER_ACCEPT:NodeFilter.FILTER_SKIP}});for(;n.nextNode();)t.push(n.currentNode);return t}function Sg(e){const t=document.activeElement;return e.some(n=>n===t?!0:(n.focus(),document.activeElement!==t))}var II=H2,tT=V2,nT=Z2,rT=G2,aT=Q2,iT=X2,sT=Kb;function oT(e){var t,n,r="";if(typeof e=="string"||typeof e=="number")r+=e;else if(typeof e=="object")if(Array.isArray(e)){var a=e.length;for(t=0;t<a;t++)e[t]&&(n=oT(e[t]))&&(r&&(r+=" "),r+=n)}else for(n in e)e[n]&&(r&&(r+=" "),r+=n);return r}function lT(){for(var e,t,n=0,r="",a=arguments.length;n<a;n++)(e=arguments[n])&&(t=oT(e))&&(r&&(r+=" "),r+=t);return r}const m_=e=>typeof e=="boolean"?`${e}`:e===0?"0":e,p_=lT,Ym=(e,t)=>n=>{var r;if((t==null?void 0:t.variants)==null)return p_(e,n==null?void 0:n.class,n==null?void 0:n.className);const{variants:a,defaultVariants:i}=t,s=Object.keys(a).map(u=>{const d=n==null?void 0:n[u],f=i==null?void 0:i[u];if(d===null)return null;const m=m_(d)||m_(f);return a[u][m]}),o=n&&Object.entries(n).reduce((u,d)=>{let[f,m]=d;return m===void 0||(u[f]=m),u},{}),l=t==null||(r=t.compoundVariants)===null||r===void 0?void 0:r.reduce((u,d)=>{let{class:f,className:m,...h}=d;return Object.entries(h).every(y=>{let[p,b]=y;return Array.isArray(b)?b.includes({...i,...o}[p]):{...i,...o}[p]===b})?[...u,f,m]:u},[]);return p_(e,s,l,n==null?void 0:n.class,n==null?void 0:n.className)};/**
58
+ * @license lucide-react v0.453.0 - ISC
59
+ *
60
+ * This source code is licensed under the ISC license.
61
+ * See the LICENSE file in the root directory of this source tree.
62
+ */const LI=e=>e.replace(/([a-z0-9])([A-Z])/g,"$1-$2").toLowerCase(),cT=(...e)=>e.filter((t,n,r)=>!!t&&r.indexOf(t)===n).join(" ");/**
63
+ * @license lucide-react v0.453.0 - ISC
64
+ *
65
+ * This source code is licensed under the ISC license.
66
+ * See the LICENSE file in the root directory of this source tree.
67
+ */var UI={xmlns:"http://www.w3.org/2000/svg",width:24,height:24,viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:2,strokeLinecap:"round",strokeLinejoin:"round"};/**
68
+ * @license lucide-react v0.453.0 - ISC
69
+ *
70
+ * This source code is licensed under the ISC license.
71
+ * See the LICENSE file in the root directory of this source tree.
72
+ */const FI=x.forwardRef(({color:e="currentColor",size:t=24,strokeWidth:n=2,absoluteStrokeWidth:r,className:a="",children:i,iconNode:s,...o},l)=>x.createElement("svg",{ref:l,...UI,width:t,height:t,stroke:e,strokeWidth:r?Number(n)*24/Number(t):n,className:cT("lucide",a),...o},[...s.map(([u,d])=>x.createElement(u,d)),...Array.isArray(i)?i:[i]]));/**
73
+ * @license lucide-react v0.453.0 - ISC
74
+ *
75
+ * This source code is licensed under the ISC license.
76
+ * See the LICENSE file in the root directory of this source tree.
77
+ */const Fe=(e,t)=>{const n=x.forwardRef(({className:r,...a},i)=>x.createElement(FI,{ref:i,iconNode:t,className:cT(`lucide-${LI(e)}`,r),...a}));return n.displayName=`${e}`,n};/**
78
+ * @license lucide-react v0.453.0 - ISC
79
+ *
80
+ * This source code is licensed under the ISC license.
81
+ * See the LICENSE file in the root directory of this source tree.
82
+ */const qI=Fe("Activity",[["path",{d:"M22 12h-2.48a2 2 0 0 0-1.93 1.46l-2.35 8.36a.25.25 0 0 1-.48 0L9.24 2.18a.25.25 0 0 0-.48 0l-2.35 8.36A2 2 0 0 1 4.49 12H2",key:"169zse"}]]);/**
83
+ * @license lucide-react v0.453.0 - ISC
84
+ *
85
+ * This source code is licensed under the ISC license.
86
+ * See the LICENSE file in the root directory of this source tree.
87
+ */const uT=Fe("ArrowLeft",[["path",{d:"m12 19-7-7 7-7",key:"1l729n"}],["path",{d:"M19 12H5",key:"x3x0zl"}]]);/**
88
+ * @license lucide-react v0.453.0 - ISC
89
+ *
90
+ * This source code is licensed under the ISC license.
91
+ * See the LICENSE file in the root directory of this source tree.
92
+ */const dT=Fe("Bolt",[["path",{d:"M21 16V8a2 2 0 0 0-1-1.73l-7-4a2 2 0 0 0-2 0l-7 4A2 2 0 0 0 3 8v8a2 2 0 0 0 1 1.73l7 4a2 2 0 0 0 2 0l7-4A2 2 0 0 0 21 16z",key:"yt0hxn"}],["circle",{cx:"12",cy:"12",r:"4",key:"4exip2"}]]);/**
93
+ * @license lucide-react v0.453.0 - ISC
94
+ *
95
+ * This source code is licensed under the ISC license.
96
+ * See the LICENSE file in the root directory of this source tree.
97
+ */const Zb=Fe("BookOpen",[["path",{d:"M12 7v14",key:"1akyts"}],["path",{d:"M3 18a1 1 0 0 1-1-1V4a1 1 0 0 1 1-1h5a4 4 0 0 1 4 4 4 4 0 0 1 4-4h5a1 1 0 0 1 1 1v13a1 1 0 0 1-1 1h-6a3 3 0 0 0-3 3 3 3 0 0 0-3-3z",key:"ruj8y"}]]);/**
98
+ * @license lucide-react v0.453.0 - ISC
99
+ *
100
+ * This source code is licensed under the ISC license.
101
+ * See the LICENSE file in the root directory of this source tree.
102
+ */const HI=Fe("Bot",[["path",{d:"M12 8V4H8",key:"hb8ula"}],["rect",{width:"16",height:"12",x:"4",y:"8",rx:"2",key:"enze0r"}],["path",{d:"M2 14h2",key:"vft8re"}],["path",{d:"M20 14h2",key:"4cs60a"}],["path",{d:"M15 13v2",key:"1xurst"}],["path",{d:"M9 13v2",key:"rq6x2g"}]]);/**
103
+ * @license lucide-react v0.453.0 - ISC
104
+ *
105
+ * This source code is licensed under the ISC license.
106
+ * See the LICENSE file in the root directory of this source tree.
107
+ */const _g=Fe("Brain",[["path",{d:"M12 5a3 3 0 1 0-5.997.125 4 4 0 0 0-2.526 5.77 4 4 0 0 0 .556 6.588A4 4 0 1 0 12 18Z",key:"l5xja"}],["path",{d:"M12 5a3 3 0 1 1 5.997.125 4 4 0 0 1 2.526 5.77 4 4 0 0 1-.556 6.588A4 4 0 1 1 12 18Z",key:"ep3f8r"}],["path",{d:"M15 13a4.5 4.5 0 0 1-3-4 4.5 4.5 0 0 1-3 4",key:"1p4c4q"}],["path",{d:"M17.599 6.5a3 3 0 0 0 .399-1.375",key:"tmeiqw"}],["path",{d:"M6.003 5.125A3 3 0 0 0 6.401 6.5",key:"105sqy"}],["path",{d:"M3.477 10.896a4 4 0 0 1 .585-.396",key:"ql3yin"}],["path",{d:"M19.938 10.5a4 4 0 0 1 .585.396",key:"1qfode"}],["path",{d:"M6 18a4 4 0 0 1-1.967-.516",key:"2e4loj"}],["path",{d:"M19.967 17.484A4 4 0 0 1 18 18",key:"159ez6"}]]);/**
108
+ * @license lucide-react v0.453.0 - ISC
109
+ *
110
+ * This source code is licensed under the ISC license.
111
+ * See the LICENSE file in the root directory of this source tree.
112
+ */const fT=Fe("Check",[["path",{d:"M20 6 9 17l-5-5",key:"1gmf2c"}]]);/**
113
+ * @license lucide-react v0.453.0 - ISC
114
+ *
115
+ * This source code is licensed under the ISC license.
116
+ * See the LICENSE file in the root directory of this source tree.
117
+ */const Xm=Fe("ChevronDown",[["path",{d:"m6 9 6 6 6-6",key:"qrunsl"}]]);/**
118
+ * @license lucide-react v0.453.0 - ISC
119
+ *
120
+ * This source code is licensed under the ISC license.
121
+ * See the LICENSE file in the root directory of this source tree.
122
+ */const hT=Fe("ChevronLeft",[["path",{d:"m15 18-6-6 6-6",key:"1wnfg3"}]]);/**
123
+ * @license lucide-react v0.453.0 - ISC
124
+ *
125
+ * This source code is licensed under the ISC license.
126
+ * See the LICENSE file in the root directory of this source tree.
127
+ */const mT=Fe("ChevronRight",[["path",{d:"m9 18 6-6-6-6",key:"mthhwq"}]]);/**
128
+ * @license lucide-react v0.453.0 - ISC
129
+ *
130
+ * This source code is licensed under the ISC license.
131
+ * See the LICENSE file in the root directory of this source tree.
132
+ */const BI=Fe("ChevronUp",[["path",{d:"m18 15-6-6-6 6",key:"153udz"}]]);/**
133
+ * @license lucide-react v0.453.0 - ISC
134
+ *
135
+ * This source code is licensed under the ISC license.
136
+ * See the LICENSE file in the root directory of this source tree.
137
+ */const pT=Fe("CircleAlert",[["circle",{cx:"12",cy:"12",r:"10",key:"1mglay"}],["line",{x1:"12",x2:"12",y1:"8",y2:"12",key:"1pkeuh"}],["line",{x1:"12",x2:"12.01",y1:"16",y2:"16",key:"4dfq90"}]]);/**
138
+ * @license lucide-react v0.453.0 - ISC
139
+ *
140
+ * This source code is licensed under the ISC license.
141
+ * See the LICENSE file in the root directory of this source tree.
142
+ */const Cv=Fe("CircleCheckBig",[["path",{d:"M21.801 10A10 10 0 1 1 17 3.335",key:"yps3ct"}],["path",{d:"m9 11 3 3L22 4",key:"1pflzl"}]]);/**
143
+ * @license lucide-react v0.453.0 - ISC
144
+ *
145
+ * This source code is licensed under the ISC license.
146
+ * See the LICENSE file in the root directory of this source tree.
147
+ */const g_=Fe("CircleX",[["circle",{cx:"12",cy:"12",r:"10",key:"1mglay"}],["path",{d:"m15 9-6 6",key:"1uzhvr"}],["path",{d:"m9 9 6 6",key:"z0biqf"}]]);/**
148
+ * @license lucide-react v0.453.0 - ISC
149
+ *
150
+ * This source code is licensed under the ISC license.
151
+ * See the LICENSE file in the root directory of this source tree.
152
+ */const VI=Fe("ClipboardPaste",[["path",{d:"M15 2H9a1 1 0 0 0-1 1v2c0 .6.4 1 1 1h6c.6 0 1-.4 1-1V3c0-.6-.4-1-1-1Z",key:"1pp7kr"}],["path",{d:"M8 4H6a2 2 0 0 0-2 2v14a2 2 0 0 0 2 2h12a2 2 0 0 0 2-2M16 4h2a2 2 0 0 1 2 2v2M11 14h10",key:"2ik1ml"}],["path",{d:"m17 10 4 4-4 4",key:"vp2hj1"}]]);/**
153
+ * @license lucide-react v0.453.0 - ISC
154
+ *
155
+ * This source code is licensed under the ISC license.
156
+ * See the LICENSE file in the root directory of this source tree.
157
+ */const Gb=Fe("Copy",[["rect",{width:"14",height:"14",x:"8",y:"8",rx:"2",ry:"2",key:"17jyea"}],["path",{d:"M4 16c-1.1 0-2-.9-2-2V4c0-1.1.9-2 2-2h10c1.1 0 2 .9 2 2",key:"zix9uf"}]]);/**
158
+ * @license lucide-react v0.453.0 - ISC
159
+ *
160
+ * This source code is licensed under the ISC license.
161
+ * See the LICENSE file in the root directory of this source tree.
162
+ */const y_=Fe("Database",[["ellipse",{cx:"12",cy:"5",rx:"9",ry:"3",key:"msslwz"}],["path",{d:"M3 5V19A9 3 0 0 0 21 19V5",key:"1wlel7"}],["path",{d:"M3 12A9 3 0 0 0 21 12",key:"mv7ke4"}]]);/**
163
+ * @license lucide-react v0.453.0 - ISC
164
+ *
165
+ * This source code is licensed under the ISC license.
166
+ * See the LICENSE file in the root directory of this source tree.
167
+ */const gT=Fe("Download",[["path",{d:"M21 15v4a2 2 0 0 1-2 2H5a2 2 0 0 1-2-2v-4",key:"ih7n3h"}],["polyline",{points:"7 10 12 15 17 10",key:"2ggqvy"}],["line",{x1:"12",x2:"12",y1:"15",y2:"3",key:"1vk2je"}]]);/**
168
+ * @license lucide-react v0.453.0 - ISC
169
+ *
170
+ * This source code is licensed under the ISC license.
171
+ * See the LICENSE file in the root directory of this source tree.
172
+ */const Xa=Fe("ExternalLink",[["path",{d:"M15 3h6v6",key:"1q9fwt"}],["path",{d:"M10 14 21 3",key:"gplh6r"}],["path",{d:"M18 13v6a2 2 0 0 1-2 2H5a2 2 0 0 1-2-2V8a2 2 0 0 1 2-2h6",key:"a6xqqp"}]]);/**
173
+ * @license lucide-react v0.453.0 - ISC
174
+ *
175
+ * This source code is licensed under the ISC license.
176
+ * See the LICENSE file in the root directory of this source tree.
177
+ */const KI=Fe("Filter",[["polygon",{points:"22 3 2 3 10 12.46 10 19 14 21 14 12.46 22 3",key:"1yg77f"}]]);/**
178
+ * @license lucide-react v0.453.0 - ISC
179
+ *
180
+ * This source code is licensed under the ISC license.
181
+ * See the LICENSE file in the root directory of this source tree.
182
+ */const ZI=Fe("GitPullRequest",[["circle",{cx:"18",cy:"18",r:"3",key:"1xkwt0"}],["circle",{cx:"6",cy:"6",r:"3",key:"1lh9wr"}],["path",{d:"M13 6h3a2 2 0 0 1 2 2v7",key:"1yeb86"}],["line",{x1:"6",x2:"6",y1:"9",y2:"21",key:"rroup"}]]);/**
183
+ * @license lucide-react v0.453.0 - ISC
184
+ *
185
+ * This source code is licensed under the ISC license.
186
+ * See the LICENSE file in the root directory of this source tree.
187
+ */const Nv=Fe("KeyRound",[["path",{d:"M2.586 17.414A2 2 0 0 0 2 18.828V21a1 1 0 0 0 1 1h3a1 1 0 0 0 1-1v-1a1 1 0 0 1 1-1h1a1 1 0 0 0 1-1v-1a1 1 0 0 1 1-1h.172a2 2 0 0 0 1.414-.586l.814-.814a6.5 6.5 0 1 0-4-4z",key:"1s6t7t"}],["circle",{cx:"16.5",cy:"7.5",r:".5",fill:"currentColor",key:"w0ekpg"}]]);/**
188
+ * @license lucide-react v0.453.0 - ISC
189
+ *
190
+ * This source code is licensed under the ISC license.
191
+ * See the LICENSE file in the root directory of this source tree.
192
+ */const lf=Fe("Key",[["path",{d:"m15.5 7.5 2.3 2.3a1 1 0 0 0 1.4 0l2.1-2.1a1 1 0 0 0 0-1.4L19 4",key:"g0fldk"}],["path",{d:"m21 2-9.6 9.6",key:"1j0ho8"}],["circle",{cx:"7.5",cy:"15.5",r:"5.5",key:"yqb3hr"}]]);/**
193
+ * @license lucide-react v0.453.0 - ISC
194
+ *
195
+ * This source code is licensed under the ISC license.
196
+ * See the LICENSE file in the root directory of this source tree.
197
+ */const Vh=Fe("Layers",[["path",{d:"m12.83 2.18a2 2 0 0 0-1.66 0L2.6 6.08a1 1 0 0 0 0 1.83l8.58 3.91a2 2 0 0 0 1.66 0l8.58-3.9a1 1 0 0 0 0-1.83Z",key:"8b97xw"}],["path",{d:"m22 17.65-9.17 4.16a2 2 0 0 1-1.66 0L2 17.65",key:"dd6zsq"}],["path",{d:"m22 12.65-9.17 4.16a2 2 0 0 1-1.66 0L2 12.65",key:"ep9fru"}]]);/**
198
+ * @license lucide-react v0.453.0 - ISC
199
+ *
200
+ * This source code is licensed under the ISC license.
201
+ * See the LICENSE file in the root directory of this source tree.
202
+ */const GI=Fe("LayoutGrid",[["rect",{width:"7",height:"7",x:"3",y:"3",rx:"1",key:"1g98yp"}],["rect",{width:"7",height:"7",x:"14",y:"3",rx:"1",key:"6d4xhi"}],["rect",{width:"7",height:"7",x:"14",y:"14",rx:"1",key:"nxv5o0"}],["rect",{width:"7",height:"7",x:"3",y:"14",rx:"1",key:"1bb6yr"}]]);/**
203
+ * @license lucide-react v0.453.0 - ISC
204
+ *
205
+ * This source code is licensed under the ISC license.
206
+ * See the LICENSE file in the root directory of this source tree.
207
+ */const v_=Fe("LoaderCircle",[["path",{d:"M21 12a9 9 0 1 1-6.219-8.56",key:"13zald"}]]);/**
208
+ * @license lucide-react v0.453.0 - ISC
209
+ *
210
+ * This source code is licensed under the ISC license.
211
+ * See the LICENSE file in the root directory of this source tree.
212
+ */const QI=Fe("Play",[["polygon",{points:"6 3 20 12 6 21 6 3",key:"1oa8hb"}]]);/**
213
+ * @license lucide-react v0.453.0 - ISC
214
+ *
215
+ * This source code is licensed under the ISC license.
216
+ * See the LICENSE file in the root directory of this source tree.
217
+ */const qs=Fe("Plus",[["path",{d:"M5 12h14",key:"1ays0h"}],["path",{d:"M12 5v14",key:"s699le"}]]);/**
218
+ * @license lucide-react v0.453.0 - ISC
219
+ *
220
+ * This source code is licensed under the ISC license.
221
+ * See the LICENSE file in the root directory of this source tree.
222
+ */const YI=Fe("Radio",[["path",{d:"M4.9 19.1C1 15.2 1 8.8 4.9 4.9",key:"1vaf9d"}],["path",{d:"M7.8 16.2c-2.3-2.3-2.3-6.1 0-8.5",key:"u1ii0m"}],["circle",{cx:"12",cy:"12",r:"2",key:"1c9p78"}],["path",{d:"M16.2 7.8c2.3 2.3 2.3 6.1 0 8.5",key:"1j5fej"}],["path",{d:"M19.1 4.9C23 8.8 23 15.1 19.1 19",key:"10b0cb"}]]);/**
223
+ * @license lucide-react v0.453.0 - ISC
224
+ *
225
+ * This source code is licensed under the ISC license.
226
+ * See the LICENSE file in the root directory of this source tree.
227
+ */const yT=Fe("Search",[["circle",{cx:"11",cy:"11",r:"8",key:"4ej97u"}],["path",{d:"m21 21-4.3-4.3",key:"1qie3q"}]]);/**
228
+ * @license lucide-react v0.453.0 - ISC
229
+ *
230
+ * This source code is licensed under the ISC license.
231
+ * See the LICENSE file in the root directory of this source tree.
232
+ */const Kh=Fe("Server",[["rect",{width:"20",height:"8",x:"2",y:"2",rx:"2",ry:"2",key:"ngkwjq"}],["rect",{width:"20",height:"8",x:"2",y:"14",rx:"2",ry:"2",key:"iecqi9"}],["line",{x1:"6",x2:"6.01",y1:"6",y2:"6",key:"16zg32"}],["line",{x1:"6",x2:"6.01",y1:"18",y2:"18",key:"nzw8ys"}]]);/**
233
+ * @license lucide-react v0.453.0 - ISC
234
+ *
235
+ * This source code is licensed under the ISC license.
236
+ * See the LICENSE file in the root directory of this source tree.
237
+ */const XI=Fe("Shield",[["path",{d:"M20 13c0 5-3.5 7.5-7.66 8.95a1 1 0 0 1-.67-.01C7.5 20.5 4 18 4 13V6a1 1 0 0 1 1-1c2 0 4.5-1.2 6.24-2.72a1.17 1.17 0 0 1 1.52 0C14.51 3.81 17 5 19 5a1 1 0 0 1 1 1z",key:"oel41y"}]]);/**
238
+ * @license lucide-react v0.453.0 - ISC
239
+ *
240
+ * This source code is licensed under the ISC license.
241
+ * See the LICENSE file in the root directory of this source tree.
242
+ */const WI=Fe("Terminal",[["polyline",{points:"4 17 10 11 4 5",key:"akl6gq"}],["line",{x1:"12",x2:"20",y1:"19",y2:"19",key:"q2wloq"}]]);/**
243
+ * @license lucide-react v0.453.0 - ISC
244
+ *
245
+ * This source code is licensed under the ISC license.
246
+ * See the LICENSE file in the root directory of this source tree.
247
+ */const wd=Fe("Trash2",[["path",{d:"M3 6h18",key:"d0wm0j"}],["path",{d:"M19 6v14c0 1-1 2-2 2H7c-1 0-2-1-2-2V6",key:"4alrt4"}],["path",{d:"M8 6V4c0-1 1-2 2-2h4c1 0 2 1 2 2v2",key:"v07s0e"}],["line",{x1:"10",x2:"10",y1:"11",y2:"17",key:"1uufr5"}],["line",{x1:"14",x2:"14",y1:"11",y2:"17",key:"xtxkd"}]]);/**
248
+ * @license lucide-react v0.453.0 - ISC
249
+ *
250
+ * This source code is licensed under the ISC license.
251
+ * See the LICENSE file in the root directory of this source tree.
252
+ */const Rr=Fe("TriangleAlert",[["path",{d:"m21.73 18-8-14a2 2 0 0 0-3.48 0l-8 14A2 2 0 0 0 4 21h16a2 2 0 0 0 1.73-3",key:"wmoenq"}],["path",{d:"M12 9v4",key:"juzpu7"}],["path",{d:"M12 17h.01",key:"p32p05"}]]);/**
253
+ * @license lucide-react v0.453.0 - ISC
254
+ *
255
+ * This source code is licensed under the ISC license.
256
+ * See the LICENSE file in the root directory of this source tree.
257
+ */const JI=Fe("Upload",[["path",{d:"M21 15v4a2 2 0 0 1-2 2H5a2 2 0 0 1-2-2v-4",key:"ih7n3h"}],["polyline",{points:"17 8 12 3 7 8",key:"t8dd8p"}],["line",{x1:"12",x2:"12",y1:"3",y2:"15",key:"widbto"}]]);/**
258
+ * @license lucide-react v0.453.0 - ISC
259
+ *
260
+ * This source code is licensed under the ISC license.
261
+ * See the LICENSE file in the root directory of this source tree.
262
+ */const eL=Fe("User",[["path",{d:"M19 21v-2a4 4 0 0 0-4-4H9a4 4 0 0 0-4 4v2",key:"975kel"}],["circle",{cx:"12",cy:"7",r:"4",key:"17ys0d"}]]);/**
263
+ * @license lucide-react v0.453.0 - ISC
264
+ *
265
+ * This source code is licensed under the ISC license.
266
+ * See the LICENSE file in the root directory of this source tree.
267
+ */const Qb=Fe("Wrench",[["path",{d:"M14.7 6.3a1 1 0 0 0 0 1.4l1.6 1.6a1 1 0 0 0 1.4 0l3.77-3.77a6 6 0 0 1-7.94 7.94l-6.91 6.91a2.12 2.12 0 0 1-3-3l6.91-6.91a6 6 0 0 1 7.94-7.94l-3.76 3.76z",key:"cbrjhi"}]]);/**
268
+ * @license lucide-react v0.453.0 - ISC
269
+ *
270
+ * This source code is licensed under the ISC license.
271
+ * See the LICENSE file in the root directory of this source tree.
272
+ */const Zh=Fe("X",[["path",{d:"M18 6 6 18",key:"1bl5f8"}],["path",{d:"m6 6 12 12",key:"d8bk6v"}]]),Yb="-",tL=e=>{const t=rL(e),{conflictingClassGroups:n,conflictingClassGroupModifiers:r}=e;return{getClassGroupId:s=>{const o=s.split(Yb);return o[0]===""&&o.length!==1&&o.shift(),vT(o,t)||nL(s)},getConflictingClassGroupIds:(s,o)=>{const l=n[s]||[];return o&&r[s]?[...l,...r[s]]:l}}},vT=(e,t)=>{var s;if(e.length===0)return t.classGroupId;const n=e[0],r=t.nextPart.get(n),a=r?vT(e.slice(1),r):void 0;if(a)return a;if(t.validators.length===0)return;const i=e.join(Yb);return(s=t.validators.find(({validator:o})=>o(i)))==null?void 0:s.classGroupId},b_=/^\[(.+)\]$/,nL=e=>{if(b_.test(e)){const t=b_.exec(e)[1],n=t==null?void 0:t.substring(0,t.indexOf(":"));if(n)return"arbitrary.."+n}},rL=e=>{const{theme:t,prefix:n}=e,r={nextPart:new Map,validators:[]};return iL(Object.entries(e.classGroups),n).forEach(([i,s])=>{jv(s,r,i,t)}),r},jv=(e,t,n,r)=>{e.forEach(a=>{if(typeof a=="string"){const i=a===""?t:x_(t,a);i.classGroupId=n;return}if(typeof a=="function"){if(aL(a)){jv(a(r),t,n,r);return}t.validators.push({validator:a,classGroupId:n});return}Object.entries(a).forEach(([i,s])=>{jv(s,x_(t,i),n,r)})})},x_=(e,t)=>{let n=e;return t.split(Yb).forEach(r=>{n.nextPart.has(r)||n.nextPart.set(r,{nextPart:new Map,validators:[]}),n=n.nextPart.get(r)}),n},aL=e=>e.isThemeGetter,iL=(e,t)=>t?e.map(([n,r])=>{const a=r.map(i=>typeof i=="string"?t+i:typeof i=="object"?Object.fromEntries(Object.entries(i).map(([s,o])=>[t+s,o])):i);return[n,a]}):e,sL=e=>{if(e<1)return{get:()=>{},set:()=>{}};let t=0,n=new Map,r=new Map;const a=(i,s)=>{n.set(i,s),t++,t>e&&(t=0,r=n,n=new Map)};return{get(i){let s=n.get(i);if(s!==void 0)return s;if((s=r.get(i))!==void 0)return a(i,s),s},set(i,s){n.has(i)?n.set(i,s):a(i,s)}}},bT="!",oL=e=>{const{separator:t,experimentalParseClassName:n}=e,r=t.length===1,a=t[0],i=t.length,s=o=>{const l=[];let u=0,d=0,f;for(let b=0;b<o.length;b++){let g=o[b];if(u===0){if(g===a&&(r||o.slice(b,b+i)===t)){l.push(o.slice(d,b)),d=b+i;continue}if(g==="/"){f=b;continue}}g==="["?u++:g==="]"&&u--}const m=l.length===0?o:o.substring(d),h=m.startsWith(bT),y=h?m.substring(1):m,p=f&&f>d?f-d:void 0;return{modifiers:l,hasImportantModifier:h,baseClassName:y,maybePostfixModifierPosition:p}};return n?o=>n({className:o,parseClassName:s}):s},lL=e=>{if(e.length<=1)return e;const t=[];let n=[];return e.forEach(r=>{r[0]==="["?(t.push(...n.sort(),r),n=[]):n.push(r)}),t.push(...n.sort()),t},cL=e=>({cache:sL(e.cacheSize),parseClassName:oL(e),...tL(e)}),uL=/\s+/,dL=(e,t)=>{const{parseClassName:n,getClassGroupId:r,getConflictingClassGroupIds:a}=t,i=[],s=e.trim().split(uL);let o="";for(let l=s.length-1;l>=0;l-=1){const u=s[l],{modifiers:d,hasImportantModifier:f,baseClassName:m,maybePostfixModifierPosition:h}=n(u);let y=!!h,p=r(y?m.substring(0,h):m);if(!p){if(!y){o=u+(o.length>0?" "+o:o);continue}if(p=r(m),!p){o=u+(o.length>0?" "+o:o);continue}y=!1}const b=lL(d).join(":"),g=f?b+bT:b,v=g+p;if(i.includes(v))continue;i.push(v);const w=a(p,y);for(let S=0;S<w.length;++S){const E=w[S];i.push(g+E)}o=u+(o.length>0?" "+o:o)}return o};function fL(){let e=0,t,n,r="";for(;e<arguments.length;)(t=arguments[e++])&&(n=xT(t))&&(r&&(r+=" "),r+=n);return r}const xT=e=>{if(typeof e=="string")return e;let t,n="";for(let r=0;r<e.length;r++)e[r]&&(t=xT(e[r]))&&(n&&(n+=" "),n+=t);return n};function hL(e,...t){let n,r,a,i=s;function s(l){const u=t.reduce((d,f)=>f(d),e());return n=cL(u),r=n.cache.get,a=n.cache.set,i=o,o(l)}function o(l){const u=r(l);if(u)return u;const d=dL(l,n);return a(l,d),d}return function(){return i(fL.apply(null,arguments))}}const bt=e=>{const t=n=>n[e]||[];return t.isThemeGetter=!0,t},wT=/^\[(?:([a-z-]+):)?(.+)\]$/i,mL=/^\d+\/\d+$/,pL=new Set(["px","full","screen"]),gL=/^(\d+(\.\d+)?)?(xs|sm|md|lg|xl)$/,yL=/\d+(%|px|r?em|[sdl]?v([hwib]|min|max)|pt|pc|in|cm|mm|cap|ch|ex|r?lh|cq(w|h|i|b|min|max))|\b(calc|min|max|clamp)\(.+\)|^0$/,vL=/^(rgba?|hsla?|hwb|(ok)?(lab|lch))\(.+\)$/,bL=/^(inset_)?-?((\d+)?\.?(\d+)[a-z]+|0)_-?((\d+)?\.?(\d+)[a-z]+|0)/,xL=/^(url|image|image-set|cross-fade|element|(repeating-)?(linear|radial|conic)-gradient)\(.+\)$/,Ma=e=>vl(e)||pL.has(e)||mL.test(e),bi=e=>gc(e,"length",jL),vl=e=>!!e&&!Number.isNaN(Number(e)),kg=e=>gc(e,"number",vl),Pc=e=>!!e&&Number.isInteger(Number(e)),wL=e=>e.endsWith("%")&&vl(e.slice(0,-1)),ze=e=>wT.test(e),xi=e=>gL.test(e),SL=new Set(["length","size","percentage"]),_L=e=>gc(e,SL,ST),kL=e=>gc(e,"position",ST),EL=new Set(["image","url"]),CL=e=>gc(e,EL,AL),NL=e=>gc(e,"",TL),Dc=()=>!0,gc=(e,t,n)=>{const r=wT.exec(e);return r?r[1]?typeof t=="string"?r[1]===t:t.has(r[1]):n(r[2]):!1},jL=e=>yL.test(e)&&!vL.test(e),ST=()=>!1,TL=e=>bL.test(e),AL=e=>xL.test(e),RL=()=>{const e=bt("colors"),t=bt("spacing"),n=bt("blur"),r=bt("brightness"),a=bt("borderColor"),i=bt("borderRadius"),s=bt("borderSpacing"),o=bt("borderWidth"),l=bt("contrast"),u=bt("grayscale"),d=bt("hueRotate"),f=bt("invert"),m=bt("gap"),h=bt("gradientColorStops"),y=bt("gradientColorStopPositions"),p=bt("inset"),b=bt("margin"),g=bt("opacity"),v=bt("padding"),w=bt("saturate"),S=bt("scale"),E=bt("sepia"),C=bt("skew"),T=bt("space"),P=bt("translate"),R=()=>["auto","contain","none"],$=()=>["auto","hidden","clip","visible","scroll"],j=()=>["auto",ze,t],O=()=>[ze,t],z=()=>["",Ma,bi],D=()=>["auto",vl,ze],A=()=>["bottom","center","left","left-bottom","left-top","right","right-bottom","right-top","top"],B=()=>["solid","dashed","dotted","double","none"],Z=()=>["normal","multiply","screen","overlay","darken","lighten","color-dodge","color-burn","hard-light","soft-light","difference","exclusion","hue","saturation","color","luminosity"],F=()=>["start","end","center","between","around","evenly","stretch"],J=()=>["","0",ze],N=()=>["auto","avoid","all","avoid-page","page","left","right","column"],q=()=>[vl,ze];return{cacheSize:500,separator:":",theme:{colors:[Dc],spacing:[Ma,bi],blur:["none","",xi,ze],brightness:q(),borderColor:[e],borderRadius:["none","","full",xi,ze],borderSpacing:O(),borderWidth:z(),contrast:q(),grayscale:J(),hueRotate:q(),invert:J(),gap:O(),gradientColorStops:[e],gradientColorStopPositions:[wL,bi],inset:j(),margin:j(),opacity:q(),padding:O(),saturate:q(),scale:q(),sepia:J(),skew:q(),space:O(),translate:O()},classGroups:{aspect:[{aspect:["auto","square","video",ze]}],container:["container"],columns:[{columns:[xi]}],"break-after":[{"break-after":N()}],"break-before":[{"break-before":N()}],"break-inside":[{"break-inside":["auto","avoid","avoid-page","avoid-column"]}],"box-decoration":[{"box-decoration":["slice","clone"]}],box:[{box:["border","content"]}],display:["block","inline-block","inline","flex","inline-flex","table","inline-table","table-caption","table-cell","table-column","table-column-group","table-footer-group","table-header-group","table-row-group","table-row","flow-root","grid","inline-grid","contents","list-item","hidden"],float:[{float:["right","left","none","start","end"]}],clear:[{clear:["left","right","both","none","start","end"]}],isolation:["isolate","isolation-auto"],"object-fit":[{object:["contain","cover","fill","none","scale-down"]}],"object-position":[{object:[...A(),ze]}],overflow:[{overflow:$()}],"overflow-x":[{"overflow-x":$()}],"overflow-y":[{"overflow-y":$()}],overscroll:[{overscroll:R()}],"overscroll-x":[{"overscroll-x":R()}],"overscroll-y":[{"overscroll-y":R()}],position:["static","fixed","absolute","relative","sticky"],inset:[{inset:[p]}],"inset-x":[{"inset-x":[p]}],"inset-y":[{"inset-y":[p]}],start:[{start:[p]}],end:[{end:[p]}],top:[{top:[p]}],right:[{right:[p]}],bottom:[{bottom:[p]}],left:[{left:[p]}],visibility:["visible","invisible","collapse"],z:[{z:["auto",Pc,ze]}],basis:[{basis:j()}],"flex-direction":[{flex:["row","row-reverse","col","col-reverse"]}],"flex-wrap":[{flex:["wrap","wrap-reverse","nowrap"]}],flex:[{flex:["1","auto","initial","none",ze]}],grow:[{grow:J()}],shrink:[{shrink:J()}],order:[{order:["first","last","none",Pc,ze]}],"grid-cols":[{"grid-cols":[Dc]}],"col-start-end":[{col:["auto",{span:["full",Pc,ze]},ze]}],"col-start":[{"col-start":D()}],"col-end":[{"col-end":D()}],"grid-rows":[{"grid-rows":[Dc]}],"row-start-end":[{row:["auto",{span:[Pc,ze]},ze]}],"row-start":[{"row-start":D()}],"row-end":[{"row-end":D()}],"grid-flow":[{"grid-flow":["row","col","dense","row-dense","col-dense"]}],"auto-cols":[{"auto-cols":["auto","min","max","fr",ze]}],"auto-rows":[{"auto-rows":["auto","min","max","fr",ze]}],gap:[{gap:[m]}],"gap-x":[{"gap-x":[m]}],"gap-y":[{"gap-y":[m]}],"justify-content":[{justify:["normal",...F()]}],"justify-items":[{"justify-items":["start","end","center","stretch"]}],"justify-self":[{"justify-self":["auto","start","end","center","stretch"]}],"align-content":[{content:["normal",...F(),"baseline"]}],"align-items":[{items:["start","end","center","baseline","stretch"]}],"align-self":[{self:["auto","start","end","center","stretch","baseline"]}],"place-content":[{"place-content":[...F(),"baseline"]}],"place-items":[{"place-items":["start","end","center","baseline","stretch"]}],"place-self":[{"place-self":["auto","start","end","center","stretch"]}],p:[{p:[v]}],px:[{px:[v]}],py:[{py:[v]}],ps:[{ps:[v]}],pe:[{pe:[v]}],pt:[{pt:[v]}],pr:[{pr:[v]}],pb:[{pb:[v]}],pl:[{pl:[v]}],m:[{m:[b]}],mx:[{mx:[b]}],my:[{my:[b]}],ms:[{ms:[b]}],me:[{me:[b]}],mt:[{mt:[b]}],mr:[{mr:[b]}],mb:[{mb:[b]}],ml:[{ml:[b]}],"space-x":[{"space-x":[T]}],"space-x-reverse":["space-x-reverse"],"space-y":[{"space-y":[T]}],"space-y-reverse":["space-y-reverse"],w:[{w:["auto","min","max","fit","svw","lvw","dvw",ze,t]}],"min-w":[{"min-w":[ze,t,"min","max","fit"]}],"max-w":[{"max-w":[ze,t,"none","full","min","max","fit","prose",{screen:[xi]},xi]}],h:[{h:[ze,t,"auto","min","max","fit","svh","lvh","dvh"]}],"min-h":[{"min-h":[ze,t,"min","max","fit","svh","lvh","dvh"]}],"max-h":[{"max-h":[ze,t,"min","max","fit","svh","lvh","dvh"]}],size:[{size:[ze,t,"auto","min","max","fit"]}],"font-size":[{text:["base",xi,bi]}],"font-smoothing":["antialiased","subpixel-antialiased"],"font-style":["italic","not-italic"],"font-weight":[{font:["thin","extralight","light","normal","medium","semibold","bold","extrabold","black",kg]}],"font-family":[{font:[Dc]}],"fvn-normal":["normal-nums"],"fvn-ordinal":["ordinal"],"fvn-slashed-zero":["slashed-zero"],"fvn-figure":["lining-nums","oldstyle-nums"],"fvn-spacing":["proportional-nums","tabular-nums"],"fvn-fraction":["diagonal-fractions","stacked-fractions"],tracking:[{tracking:["tighter","tight","normal","wide","wider","widest",ze]}],"line-clamp":[{"line-clamp":["none",vl,kg]}],leading:[{leading:["none","tight","snug","normal","relaxed","loose",Ma,ze]}],"list-image":[{"list-image":["none",ze]}],"list-style-type":[{list:["none","disc","decimal",ze]}],"list-style-position":[{list:["inside","outside"]}],"placeholder-color":[{placeholder:[e]}],"placeholder-opacity":[{"placeholder-opacity":[g]}],"text-alignment":[{text:["left","center","right","justify","start","end"]}],"text-color":[{text:[e]}],"text-opacity":[{"text-opacity":[g]}],"text-decoration":["underline","overline","line-through","no-underline"],"text-decoration-style":[{decoration:[...B(),"wavy"]}],"text-decoration-thickness":[{decoration:["auto","from-font",Ma,bi]}],"underline-offset":[{"underline-offset":["auto",Ma,ze]}],"text-decoration-color":[{decoration:[e]}],"text-transform":["uppercase","lowercase","capitalize","normal-case"],"text-overflow":["truncate","text-ellipsis","text-clip"],"text-wrap":[{text:["wrap","nowrap","balance","pretty"]}],indent:[{indent:O()}],"vertical-align":[{align:["baseline","top","middle","bottom","text-top","text-bottom","sub","super",ze]}],whitespace:[{whitespace:["normal","nowrap","pre","pre-line","pre-wrap","break-spaces"]}],break:[{break:["normal","words","all","keep"]}],hyphens:[{hyphens:["none","manual","auto"]}],content:[{content:["none",ze]}],"bg-attachment":[{bg:["fixed","local","scroll"]}],"bg-clip":[{"bg-clip":["border","padding","content","text"]}],"bg-opacity":[{"bg-opacity":[g]}],"bg-origin":[{"bg-origin":["border","padding","content"]}],"bg-position":[{bg:[...A(),kL]}],"bg-repeat":[{bg:["no-repeat",{repeat:["","x","y","round","space"]}]}],"bg-size":[{bg:["auto","cover","contain",_L]}],"bg-image":[{bg:["none",{"gradient-to":["t","tr","r","br","b","bl","l","tl"]},CL]}],"bg-color":[{bg:[e]}],"gradient-from-pos":[{from:[y]}],"gradient-via-pos":[{via:[y]}],"gradient-to-pos":[{to:[y]}],"gradient-from":[{from:[h]}],"gradient-via":[{via:[h]}],"gradient-to":[{to:[h]}],rounded:[{rounded:[i]}],"rounded-s":[{"rounded-s":[i]}],"rounded-e":[{"rounded-e":[i]}],"rounded-t":[{"rounded-t":[i]}],"rounded-r":[{"rounded-r":[i]}],"rounded-b":[{"rounded-b":[i]}],"rounded-l":[{"rounded-l":[i]}],"rounded-ss":[{"rounded-ss":[i]}],"rounded-se":[{"rounded-se":[i]}],"rounded-ee":[{"rounded-ee":[i]}],"rounded-es":[{"rounded-es":[i]}],"rounded-tl":[{"rounded-tl":[i]}],"rounded-tr":[{"rounded-tr":[i]}],"rounded-br":[{"rounded-br":[i]}],"rounded-bl":[{"rounded-bl":[i]}],"border-w":[{border:[o]}],"border-w-x":[{"border-x":[o]}],"border-w-y":[{"border-y":[o]}],"border-w-s":[{"border-s":[o]}],"border-w-e":[{"border-e":[o]}],"border-w-t":[{"border-t":[o]}],"border-w-r":[{"border-r":[o]}],"border-w-b":[{"border-b":[o]}],"border-w-l":[{"border-l":[o]}],"border-opacity":[{"border-opacity":[g]}],"border-style":[{border:[...B(),"hidden"]}],"divide-x":[{"divide-x":[o]}],"divide-x-reverse":["divide-x-reverse"],"divide-y":[{"divide-y":[o]}],"divide-y-reverse":["divide-y-reverse"],"divide-opacity":[{"divide-opacity":[g]}],"divide-style":[{divide:B()}],"border-color":[{border:[a]}],"border-color-x":[{"border-x":[a]}],"border-color-y":[{"border-y":[a]}],"border-color-s":[{"border-s":[a]}],"border-color-e":[{"border-e":[a]}],"border-color-t":[{"border-t":[a]}],"border-color-r":[{"border-r":[a]}],"border-color-b":[{"border-b":[a]}],"border-color-l":[{"border-l":[a]}],"divide-color":[{divide:[a]}],"outline-style":[{outline:["",...B()]}],"outline-offset":[{"outline-offset":[Ma,ze]}],"outline-w":[{outline:[Ma,bi]}],"outline-color":[{outline:[e]}],"ring-w":[{ring:z()}],"ring-w-inset":["ring-inset"],"ring-color":[{ring:[e]}],"ring-opacity":[{"ring-opacity":[g]}],"ring-offset-w":[{"ring-offset":[Ma,bi]}],"ring-offset-color":[{"ring-offset":[e]}],shadow:[{shadow:["","inner","none",xi,NL]}],"shadow-color":[{shadow:[Dc]}],opacity:[{opacity:[g]}],"mix-blend":[{"mix-blend":[...Z(),"plus-lighter","plus-darker"]}],"bg-blend":[{"bg-blend":Z()}],filter:[{filter:["","none"]}],blur:[{blur:[n]}],brightness:[{brightness:[r]}],contrast:[{contrast:[l]}],"drop-shadow":[{"drop-shadow":["","none",xi,ze]}],grayscale:[{grayscale:[u]}],"hue-rotate":[{"hue-rotate":[d]}],invert:[{invert:[f]}],saturate:[{saturate:[w]}],sepia:[{sepia:[E]}],"backdrop-filter":[{"backdrop-filter":["","none"]}],"backdrop-blur":[{"backdrop-blur":[n]}],"backdrop-brightness":[{"backdrop-brightness":[r]}],"backdrop-contrast":[{"backdrop-contrast":[l]}],"backdrop-grayscale":[{"backdrop-grayscale":[u]}],"backdrop-hue-rotate":[{"backdrop-hue-rotate":[d]}],"backdrop-invert":[{"backdrop-invert":[f]}],"backdrop-opacity":[{"backdrop-opacity":[g]}],"backdrop-saturate":[{"backdrop-saturate":[w]}],"backdrop-sepia":[{"backdrop-sepia":[E]}],"border-collapse":[{border:["collapse","separate"]}],"border-spacing":[{"border-spacing":[s]}],"border-spacing-x":[{"border-spacing-x":[s]}],"border-spacing-y":[{"border-spacing-y":[s]}],"table-layout":[{table:["auto","fixed"]}],caption:[{caption:["top","bottom"]}],transition:[{transition:["none","all","","colors","opacity","shadow","transform",ze]}],duration:[{duration:q()}],ease:[{ease:["linear","in","out","in-out",ze]}],delay:[{delay:q()}],animate:[{animate:["none","spin","ping","pulse","bounce",ze]}],transform:[{transform:["","gpu","none"]}],scale:[{scale:[S]}],"scale-x":[{"scale-x":[S]}],"scale-y":[{"scale-y":[S]}],rotate:[{rotate:[Pc,ze]}],"translate-x":[{"translate-x":[P]}],"translate-y":[{"translate-y":[P]}],"skew-x":[{"skew-x":[C]}],"skew-y":[{"skew-y":[C]}],"transform-origin":[{origin:["center","top","top-right","right","bottom-right","bottom","bottom-left","left","top-left",ze]}],accent:[{accent:["auto",e]}],appearance:[{appearance:["none","auto"]}],cursor:[{cursor:["auto","default","pointer","wait","text","move","help","not-allowed","none","context-menu","progress","cell","crosshair","vertical-text","alias","copy","no-drop","grab","grabbing","all-scroll","col-resize","row-resize","n-resize","e-resize","s-resize","w-resize","ne-resize","nw-resize","se-resize","sw-resize","ew-resize","ns-resize","nesw-resize","nwse-resize","zoom-in","zoom-out",ze]}],"caret-color":[{caret:[e]}],"pointer-events":[{"pointer-events":["none","auto"]}],resize:[{resize:["none","y","x",""]}],"scroll-behavior":[{scroll:["auto","smooth"]}],"scroll-m":[{"scroll-m":O()}],"scroll-mx":[{"scroll-mx":O()}],"scroll-my":[{"scroll-my":O()}],"scroll-ms":[{"scroll-ms":O()}],"scroll-me":[{"scroll-me":O()}],"scroll-mt":[{"scroll-mt":O()}],"scroll-mr":[{"scroll-mr":O()}],"scroll-mb":[{"scroll-mb":O()}],"scroll-ml":[{"scroll-ml":O()}],"scroll-p":[{"scroll-p":O()}],"scroll-px":[{"scroll-px":O()}],"scroll-py":[{"scroll-py":O()}],"scroll-ps":[{"scroll-ps":O()}],"scroll-pe":[{"scroll-pe":O()}],"scroll-pt":[{"scroll-pt":O()}],"scroll-pr":[{"scroll-pr":O()}],"scroll-pb":[{"scroll-pb":O()}],"scroll-pl":[{"scroll-pl":O()}],"snap-align":[{snap:["start","end","center","align-none"]}],"snap-stop":[{snap:["normal","always"]}],"snap-type":[{snap:["none","x","y","both"]}],"snap-strictness":[{snap:["mandatory","proximity"]}],touch:[{touch:["auto","none","manipulation"]}],"touch-x":[{"touch-pan":["x","left","right"]}],"touch-y":[{"touch-pan":["y","up","down"]}],"touch-pz":["touch-pinch-zoom"],select:[{select:["none","text","all","auto"]}],"will-change":[{"will-change":["auto","scroll","contents","transform",ze]}],fill:[{fill:[e,"none"]}],"stroke-w":[{stroke:[Ma,bi,kg]}],stroke:[{stroke:[e,"none"]}],sr:["sr-only","not-sr-only"],"forced-color-adjust":[{"forced-color-adjust":["auto","none"]}]},conflictingClassGroups:{overflow:["overflow-x","overflow-y"],overscroll:["overscroll-x","overscroll-y"],inset:["inset-x","inset-y","start","end","top","right","bottom","left"],"inset-x":["right","left"],"inset-y":["top","bottom"],flex:["basis","grow","shrink"],gap:["gap-x","gap-y"],p:["px","py","ps","pe","pt","pr","pb","pl"],px:["pr","pl"],py:["pt","pb"],m:["mx","my","ms","me","mt","mr","mb","ml"],mx:["mr","ml"],my:["mt","mb"],size:["w","h"],"font-size":["leading"],"fvn-normal":["fvn-ordinal","fvn-slashed-zero","fvn-figure","fvn-spacing","fvn-fraction"],"fvn-ordinal":["fvn-normal"],"fvn-slashed-zero":["fvn-normal"],"fvn-figure":["fvn-normal"],"fvn-spacing":["fvn-normal"],"fvn-fraction":["fvn-normal"],"line-clamp":["display","overflow"],rounded:["rounded-s","rounded-e","rounded-t","rounded-r","rounded-b","rounded-l","rounded-ss","rounded-se","rounded-ee","rounded-es","rounded-tl","rounded-tr","rounded-br","rounded-bl"],"rounded-s":["rounded-ss","rounded-es"],"rounded-e":["rounded-se","rounded-ee"],"rounded-t":["rounded-tl","rounded-tr"],"rounded-r":["rounded-tr","rounded-br"],"rounded-b":["rounded-br","rounded-bl"],"rounded-l":["rounded-tl","rounded-bl"],"border-spacing":["border-spacing-x","border-spacing-y"],"border-w":["border-w-s","border-w-e","border-w-t","border-w-r","border-w-b","border-w-l"],"border-w-x":["border-w-r","border-w-l"],"border-w-y":["border-w-t","border-w-b"],"border-color":["border-color-s","border-color-e","border-color-t","border-color-r","border-color-b","border-color-l"],"border-color-x":["border-color-r","border-color-l"],"border-color-y":["border-color-t","border-color-b"],"scroll-m":["scroll-mx","scroll-my","scroll-ms","scroll-me","scroll-mt","scroll-mr","scroll-mb","scroll-ml"],"scroll-mx":["scroll-mr","scroll-ml"],"scroll-my":["scroll-mt","scroll-mb"],"scroll-p":["scroll-px","scroll-py","scroll-ps","scroll-pe","scroll-pt","scroll-pr","scroll-pb","scroll-pl"],"scroll-px":["scroll-pr","scroll-pl"],"scroll-py":["scroll-pt","scroll-pb"],touch:["touch-x","touch-y","touch-pz"],"touch-x":["touch"],"touch-y":["touch"],"touch-pz":["touch"]},conflictingClassGroupModifiers:{"font-size":["leading"]}}},$L=hL(RL);function Te(...e){return $L(lT(e))}const OL=II,_T=x.forwardRef(({className:e,...t},n)=>c.jsx(tT,{ref:n,className:Te("fixed top-0 z-[100] flex max-h-screen w-full flex-col-reverse p-4 sm:bottom-0 sm:right-0 sm:top-auto sm:flex-col md:max-w-[420px]",e),...t}));_T.displayName=tT.displayName;const ML=Ym("group pointer-events-auto relative flex w-full items-center justify-between space-x-4 overflow-hidden rounded-md border p-6 pr-8 shadow-lg transition-all data-[swipe=cancel]:translate-x-0 data-[swipe=end]:translate-x-[var(--radix-toast-swipe-end-x)] data-[swipe=move]:translate-x-[var(--radix-toast-swipe-move-x)] data-[swipe=move]:transition-none data-[state=open]:animate-in data-[state=closed]:animate-out data-[swipe=end]:animate-out data-[state=closed]:fade-out-80 data-[state=closed]:slide-out-to-right-full data-[state=open]:slide-in-from-top-full data-[state=open]:sm:slide-in-from-bottom-full",{variants:{variant:{default:"border bg-background text-foreground",destructive:"destructive group border-destructive bg-destructive text-destructive-foreground"}},defaultVariants:{variant:"default"}}),kT=x.forwardRef(({className:e,variant:t,...n},r)=>c.jsx(nT,{ref:r,className:Te(ML({variant:t}),e),...n}));kT.displayName=nT.displayName;const PL=x.forwardRef(({className:e,...t},n)=>c.jsx(iT,{ref:n,className:Te("inline-flex h-8 shrink-0 items-center justify-center rounded-md border bg-transparent px-3 text-sm font-medium ring-offset-background transition-colors hover:bg-secondary focus:outline-none focus:ring-2 focus:ring-ring focus:ring-offset-2 disabled:pointer-events-none disabled:opacity-50 group-[.destructive]:border-muted/40 group-[.destructive]:hover:border-destructive/30 group-[.destructive]:hover:bg-destructive group-[.destructive]:hover:text-destructive-foreground group-[.destructive]:focus:ring-destructive",e),...t}));PL.displayName=iT.displayName;const ET=x.forwardRef(({className:e,...t},n)=>c.jsx(sT,{ref:n,className:Te("absolute right-2 top-2 rounded-md p-1 text-foreground/50 opacity-0 transition-opacity hover:text-foreground focus:opacity-100 focus:outline-none focus:ring-2 group-hover:opacity-100 group-[.destructive]:text-red-300 group-[.destructive]:hover:text-red-50 group-[.destructive]:focus:ring-red-400 group-[.destructive]:focus:ring-offset-red-600",e),"toast-close":"",...t,children:c.jsx(Zh,{className:"h-4 w-4"})}));ET.displayName=sT.displayName;const CT=x.forwardRef(({className:e,...t},n)=>c.jsx(rT,{ref:n,className:Te("text-sm font-semibold",e),...t}));CT.displayName=rT.displayName;const NT=x.forwardRef(({className:e,...t},n)=>c.jsx(aT,{ref:n,className:Te("text-sm opacity-90",e),...t}));NT.displayName=aT.displayName;function DL(){const{toasts:e}=nn();return c.jsxs(OL,{children:[e.map(function({id:t,title:n,description:r,action:a,...i}){return c.jsxs(kT,{...i,children:[c.jsxs("div",{className:"grid gap-1",children:[n&&c.jsx(CT,{children:n}),r&&c.jsx(NT,{children:r})]}),a,c.jsx(ET,{})]},t)}),c.jsx(_T,{})]})}var zL=id[" useId ".trim().toString()]||(()=>{}),IL=0;function ti(e){const[t,n]=x.useState(zL());return Sn(()=>{n(r=>r??String(IL++))},[e]),t?`radix-${t}`:""}const LL=["top","right","bottom","left"],fs=Math.min,lr=Math.max,Gh=Math.round,cf=Math.floor,wa=e=>({x:e,y:e}),UL={left:"right",right:"left",bottom:"top",top:"bottom"},FL={start:"end",end:"start"};function Tv(e,t,n){return lr(e,fs(t,n))}function ci(e,t){return typeof e=="function"?e(t):e}function ui(e){return e.split("-")[0]}function yc(e){return e.split("-")[1]}function Xb(e){return e==="x"?"y":"x"}function Wb(e){return e==="y"?"height":"width"}const qL=new Set(["top","bottom"]);function ba(e){return qL.has(ui(e))?"y":"x"}function Jb(e){return Xb(ba(e))}function HL(e,t,n){n===void 0&&(n=!1);const r=yc(e),a=Jb(e),i=Wb(a);let s=a==="x"?r===(n?"end":"start")?"right":"left":r==="start"?"bottom":"top";return t.reference[i]>t.floating[i]&&(s=Qh(s)),[s,Qh(s)]}function BL(e){const t=Qh(e);return[Av(e),t,Av(t)]}function Av(e){return e.replace(/start|end/g,t=>FL[t])}const w_=["left","right"],S_=["right","left"],VL=["top","bottom"],KL=["bottom","top"];function ZL(e,t,n){switch(e){case"top":case"bottom":return n?t?S_:w_:t?w_:S_;case"left":case"right":return t?VL:KL;default:return[]}}function GL(e,t,n,r){const a=yc(e);let i=ZL(ui(e),n==="start",r);return a&&(i=i.map(s=>s+"-"+a),t&&(i=i.concat(i.map(Av)))),i}function Qh(e){return e.replace(/left|right|bottom|top/g,t=>UL[t])}function QL(e){return{top:0,right:0,bottom:0,left:0,...e}}function jT(e){return typeof e!="number"?QL(e):{top:e,right:e,bottom:e,left:e}}function Yh(e){const{x:t,y:n,width:r,height:a}=e;return{width:r,height:a,top:n,left:t,right:t+r,bottom:n+a,x:t,y:n}}function __(e,t,n){let{reference:r,floating:a}=e;const i=ba(t),s=Jb(t),o=Wb(s),l=ui(t),u=i==="y",d=r.x+r.width/2-a.width/2,f=r.y+r.height/2-a.height/2,m=r[o]/2-a[o]/2;let h;switch(l){case"top":h={x:d,y:r.y-a.height};break;case"bottom":h={x:d,y:r.y+r.height};break;case"right":h={x:r.x+r.width,y:f};break;case"left":h={x:r.x-a.width,y:f};break;default:h={x:r.x,y:r.y}}switch(yc(t)){case"start":h[s]-=m*(n&&u?-1:1);break;case"end":h[s]+=m*(n&&u?-1:1);break}return h}const YL=async(e,t,n)=>{const{placement:r="bottom",strategy:a="absolute",middleware:i=[],platform:s}=n,o=i.filter(Boolean),l=await(s.isRTL==null?void 0:s.isRTL(t));let u=await s.getElementRects({reference:e,floating:t,strategy:a}),{x:d,y:f}=__(u,r,l),m=r,h={},y=0;for(let p=0;p<o.length;p++){const{name:b,fn:g}=o[p],{x:v,y:w,data:S,reset:E}=await g({x:d,y:f,initialPlacement:r,placement:m,strategy:a,middlewareData:h,rects:u,platform:s,elements:{reference:e,floating:t}});d=v??d,f=w??f,h={...h,[b]:{...h[b],...S}},E&&y<=50&&(y++,typeof E=="object"&&(E.placement&&(m=E.placement),E.rects&&(u=E.rects===!0?await s.getElementRects({reference:e,floating:t,strategy:a}):E.rects),{x:d,y:f}=__(u,m,l)),p=-1)}return{x:d,y:f,placement:m,strategy:a,middlewareData:h}};async function Ku(e,t){var n;t===void 0&&(t={});const{x:r,y:a,platform:i,rects:s,elements:o,strategy:l}=e,{boundary:u="clippingAncestors",rootBoundary:d="viewport",elementContext:f="floating",altBoundary:m=!1,padding:h=0}=ci(t,e),y=jT(h),b=o[m?f==="floating"?"reference":"floating":f],g=Yh(await i.getClippingRect({element:(n=await(i.isElement==null?void 0:i.isElement(b)))==null||n?b:b.contextElement||await(i.getDocumentElement==null?void 0:i.getDocumentElement(o.floating)),boundary:u,rootBoundary:d,strategy:l})),v=f==="floating"?{x:r,y:a,width:s.floating.width,height:s.floating.height}:s.reference,w=await(i.getOffsetParent==null?void 0:i.getOffsetParent(o.floating)),S=await(i.isElement==null?void 0:i.isElement(w))?await(i.getScale==null?void 0:i.getScale(w))||{x:1,y:1}:{x:1,y:1},E=Yh(i.convertOffsetParentRelativeRectToViewportRelativeRect?await i.convertOffsetParentRelativeRectToViewportRelativeRect({elements:o,rect:v,offsetParent:w,strategy:l}):v);return{top:(g.top-E.top+y.top)/S.y,bottom:(E.bottom-g.bottom+y.bottom)/S.y,left:(g.left-E.left+y.left)/S.x,right:(E.right-g.right+y.right)/S.x}}const XL=e=>({name:"arrow",options:e,async fn(t){const{x:n,y:r,placement:a,rects:i,platform:s,elements:o,middlewareData:l}=t,{element:u,padding:d=0}=ci(e,t)||{};if(u==null)return{};const f=jT(d),m={x:n,y:r},h=Jb(a),y=Wb(h),p=await s.getDimensions(u),b=h==="y",g=b?"top":"left",v=b?"bottom":"right",w=b?"clientHeight":"clientWidth",S=i.reference[y]+i.reference[h]-m[h]-i.floating[y],E=m[h]-i.reference[h],C=await(s.getOffsetParent==null?void 0:s.getOffsetParent(u));let T=C?C[w]:0;(!T||!await(s.isElement==null?void 0:s.isElement(C)))&&(T=o.floating[w]||i.floating[y]);const P=S/2-E/2,R=T/2-p[y]/2-1,$=fs(f[g],R),j=fs(f[v],R),O=$,z=T-p[y]-j,D=T/2-p[y]/2+P,A=Tv(O,D,z),B=!l.arrow&&yc(a)!=null&&D!==A&&i.reference[y]/2-(D<O?$:j)-p[y]/2<0,Z=B?D<O?D-O:D-z:0;return{[h]:m[h]+Z,data:{[h]:A,centerOffset:D-A-Z,...B&&{alignmentOffset:Z}},reset:B}}}),WL=function(e){return e===void 0&&(e={}),{name:"flip",options:e,async fn(t){var n,r;const{placement:a,middlewareData:i,rects:s,initialPlacement:o,platform:l,elements:u}=t,{mainAxis:d=!0,crossAxis:f=!0,fallbackPlacements:m,fallbackStrategy:h="bestFit",fallbackAxisSideDirection:y="none",flipAlignment:p=!0,...b}=ci(e,t);if((n=i.arrow)!=null&&n.alignmentOffset)return{};const g=ui(a),v=ba(o),w=ui(o)===o,S=await(l.isRTL==null?void 0:l.isRTL(u.floating)),E=m||(w||!p?[Qh(o)]:BL(o)),C=y!=="none";!m&&C&&E.push(...GL(o,p,y,S));const T=[o,...E],P=await Ku(t,b),R=[];let $=((r=i.flip)==null?void 0:r.overflows)||[];if(d&&R.push(P[g]),f){const D=HL(a,s,S);R.push(P[D[0]],P[D[1]])}if($=[...$,{placement:a,overflows:R}],!R.every(D=>D<=0)){var j,O;const D=(((j=i.flip)==null?void 0:j.index)||0)+1,A=T[D];if(A&&(!(f==="alignment"?v!==ba(A):!1)||$.every(F=>ba(F.placement)===v?F.overflows[0]>0:!0)))return{data:{index:D,overflows:$},reset:{placement:A}};let B=(O=$.filter(Z=>Z.overflows[0]<=0).sort((Z,F)=>Z.overflows[1]-F.overflows[1])[0])==null?void 0:O.placement;if(!B)switch(h){case"bestFit":{var z;const Z=(z=$.filter(F=>{if(C){const J=ba(F.placement);return J===v||J==="y"}return!0}).map(F=>[F.placement,F.overflows.filter(J=>J>0).reduce((J,N)=>J+N,0)]).sort((F,J)=>F[1]-J[1])[0])==null?void 0:z[0];Z&&(B=Z);break}case"initialPlacement":B=o;break}if(a!==B)return{reset:{placement:B}}}return{}}}};function k_(e,t){return{top:e.top-t.height,right:e.right-t.width,bottom:e.bottom-t.height,left:e.left-t.width}}function E_(e){return LL.some(t=>e[t]>=0)}const JL=function(e){return e===void 0&&(e={}),{name:"hide",options:e,async fn(t){const{rects:n}=t,{strategy:r="referenceHidden",...a}=ci(e,t);switch(r){case"referenceHidden":{const i=await Ku(t,{...a,elementContext:"reference"}),s=k_(i,n.reference);return{data:{referenceHiddenOffsets:s,referenceHidden:E_(s)}}}case"escaped":{const i=await Ku(t,{...a,altBoundary:!0}),s=k_(i,n.floating);return{data:{escapedOffsets:s,escaped:E_(s)}}}default:return{}}}}},TT=new Set(["left","top"]);async function e5(e,t){const{placement:n,platform:r,elements:a}=e,i=await(r.isRTL==null?void 0:r.isRTL(a.floating)),s=ui(n),o=yc(n),l=ba(n)==="y",u=TT.has(s)?-1:1,d=i&&l?-1:1,f=ci(t,e);let{mainAxis:m,crossAxis:h,alignmentAxis:y}=typeof f=="number"?{mainAxis:f,crossAxis:0,alignmentAxis:null}:{mainAxis:f.mainAxis||0,crossAxis:f.crossAxis||0,alignmentAxis:f.alignmentAxis};return o&&typeof y=="number"&&(h=o==="end"?y*-1:y),l?{x:h*d,y:m*u}:{x:m*u,y:h*d}}const t5=function(e){return e===void 0&&(e=0),{name:"offset",options:e,async fn(t){var n,r;const{x:a,y:i,placement:s,middlewareData:o}=t,l=await e5(t,e);return s===((n=o.offset)==null?void 0:n.placement)&&(r=o.arrow)!=null&&r.alignmentOffset?{}:{x:a+l.x,y:i+l.y,data:{...l,placement:s}}}}},n5=function(e){return e===void 0&&(e={}),{name:"shift",options:e,async fn(t){const{x:n,y:r,placement:a}=t,{mainAxis:i=!0,crossAxis:s=!1,limiter:o={fn:b=>{let{x:g,y:v}=b;return{x:g,y:v}}},...l}=ci(e,t),u={x:n,y:r},d=await Ku(t,l),f=ba(ui(a)),m=Xb(f);let h=u[m],y=u[f];if(i){const b=m==="y"?"top":"left",g=m==="y"?"bottom":"right",v=h+d[b],w=h-d[g];h=Tv(v,h,w)}if(s){const b=f==="y"?"top":"left",g=f==="y"?"bottom":"right",v=y+d[b],w=y-d[g];y=Tv(v,y,w)}const p=o.fn({...t,[m]:h,[f]:y});return{...p,data:{x:p.x-n,y:p.y-r,enabled:{[m]:i,[f]:s}}}}}},r5=function(e){return e===void 0&&(e={}),{options:e,fn(t){const{x:n,y:r,placement:a,rects:i,middlewareData:s}=t,{offset:o=0,mainAxis:l=!0,crossAxis:u=!0}=ci(e,t),d={x:n,y:r},f=ba(a),m=Xb(f);let h=d[m],y=d[f];const p=ci(o,t),b=typeof p=="number"?{mainAxis:p,crossAxis:0}:{mainAxis:0,crossAxis:0,...p};if(l){const w=m==="y"?"height":"width",S=i.reference[m]-i.floating[w]+b.mainAxis,E=i.reference[m]+i.reference[w]-b.mainAxis;h<S?h=S:h>E&&(h=E)}if(u){var g,v;const w=m==="y"?"width":"height",S=TT.has(ui(a)),E=i.reference[f]-i.floating[w]+(S&&((g=s.offset)==null?void 0:g[f])||0)+(S?0:b.crossAxis),C=i.reference[f]+i.reference[w]+(S?0:((v=s.offset)==null?void 0:v[f])||0)-(S?b.crossAxis:0);y<E?y=E:y>C&&(y=C)}return{[m]:h,[f]:y}}}},a5=function(e){return e===void 0&&(e={}),{name:"size",options:e,async fn(t){var n,r;const{placement:a,rects:i,platform:s,elements:o}=t,{apply:l=()=>{},...u}=ci(e,t),d=await Ku(t,u),f=ui(a),m=yc(a),h=ba(a)==="y",{width:y,height:p}=i.floating;let b,g;f==="top"||f==="bottom"?(b=f,g=m===(await(s.isRTL==null?void 0:s.isRTL(o.floating))?"start":"end")?"left":"right"):(g=f,b=m==="end"?"top":"bottom");const v=p-d.top-d.bottom,w=y-d.left-d.right,S=fs(p-d[b],v),E=fs(y-d[g],w),C=!t.middlewareData.shift;let T=S,P=E;if((n=t.middlewareData.shift)!=null&&n.enabled.x&&(P=w),(r=t.middlewareData.shift)!=null&&r.enabled.y&&(T=v),C&&!m){const $=lr(d.left,0),j=lr(d.right,0),O=lr(d.top,0),z=lr(d.bottom,0);h?P=y-2*($!==0||j!==0?$+j:lr(d.left,d.right)):T=p-2*(O!==0||z!==0?O+z:lr(d.top,d.bottom))}await l({...t,availableWidth:P,availableHeight:T});const R=await s.getDimensions(o.floating);return y!==R.width||p!==R.height?{reset:{rects:!0}}:{}}}};function Wm(){return typeof window<"u"}function vc(e){return AT(e)?(e.nodeName||"").toLowerCase():"#document"}function gr(e){var t;return(e==null||(t=e.ownerDocument)==null?void 0:t.defaultView)||window}function Ea(e){var t;return(t=(AT(e)?e.ownerDocument:e.document)||window.document)==null?void 0:t.documentElement}function AT(e){return Wm()?e instanceof Node||e instanceof gr(e).Node:!1}function ta(e){return Wm()?e instanceof Element||e instanceof gr(e).Element:!1}function Sa(e){return Wm()?e instanceof HTMLElement||e instanceof gr(e).HTMLElement:!1}function C_(e){return!Wm()||typeof ShadowRoot>"u"?!1:e instanceof ShadowRoot||e instanceof gr(e).ShadowRoot}const i5=new Set(["inline","contents"]);function Sd(e){const{overflow:t,overflowX:n,overflowY:r,display:a}=na(e);return/auto|scroll|overlay|hidden|clip/.test(t+r+n)&&!i5.has(a)}const s5=new Set(["table","td","th"]);function o5(e){return s5.has(vc(e))}const l5=[":popover-open",":modal"];function Jm(e){return l5.some(t=>{try{return e.matches(t)}catch{return!1}})}const c5=["transform","translate","scale","rotate","perspective"],u5=["transform","translate","scale","rotate","perspective","filter"],d5=["paint","layout","strict","content"];function ex(e){const t=tx(),n=ta(e)?na(e):e;return c5.some(r=>n[r]?n[r]!=="none":!1)||(n.containerType?n.containerType!=="normal":!1)||!t&&(n.backdropFilter?n.backdropFilter!=="none":!1)||!t&&(n.filter?n.filter!=="none":!1)||u5.some(r=>(n.willChange||"").includes(r))||d5.some(r=>(n.contain||"").includes(r))}function f5(e){let t=hs(e);for(;Sa(t)&&!Xl(t);){if(ex(t))return t;if(Jm(t))return null;t=hs(t)}return null}function tx(){return typeof CSS>"u"||!CSS.supports?!1:CSS.supports("-webkit-backdrop-filter","none")}const h5=new Set(["html","body","#document"]);function Xl(e){return h5.has(vc(e))}function na(e){return gr(e).getComputedStyle(e)}function ep(e){return ta(e)?{scrollLeft:e.scrollLeft,scrollTop:e.scrollTop}:{scrollLeft:e.scrollX,scrollTop:e.scrollY}}function hs(e){if(vc(e)==="html")return e;const t=e.assignedSlot||e.parentNode||C_(e)&&e.host||Ea(e);return C_(t)?t.host:t}function RT(e){const t=hs(e);return Xl(t)?e.ownerDocument?e.ownerDocument.body:e.body:Sa(t)&&Sd(t)?t:RT(t)}function Zu(e,t,n){var r;t===void 0&&(t=[]),n===void 0&&(n=!0);const a=RT(e),i=a===((r=e.ownerDocument)==null?void 0:r.body),s=gr(a);if(i){const o=Rv(s);return t.concat(s,s.visualViewport||[],Sd(a)?a:[],o&&n?Zu(o):[])}return t.concat(a,Zu(a,[],n))}function Rv(e){return e.parent&&Object.getPrototypeOf(e.parent)?e.frameElement:null}function $T(e){const t=na(e);let n=parseFloat(t.width)||0,r=parseFloat(t.height)||0;const a=Sa(e),i=a?e.offsetWidth:n,s=a?e.offsetHeight:r,o=Gh(n)!==i||Gh(r)!==s;return o&&(n=i,r=s),{width:n,height:r,$:o}}function nx(e){return ta(e)?e:e.contextElement}function bl(e){const t=nx(e);if(!Sa(t))return wa(1);const n=t.getBoundingClientRect(),{width:r,height:a,$:i}=$T(t);let s=(i?Gh(n.width):n.width)/r,o=(i?Gh(n.height):n.height)/a;return(!s||!Number.isFinite(s))&&(s=1),(!o||!Number.isFinite(o))&&(o=1),{x:s,y:o}}const m5=wa(0);function OT(e){const t=gr(e);return!tx()||!t.visualViewport?m5:{x:t.visualViewport.offsetLeft,y:t.visualViewport.offsetTop}}function p5(e,t,n){return t===void 0&&(t=!1),!n||t&&n!==gr(e)?!1:t}function mo(e,t,n,r){t===void 0&&(t=!1),n===void 0&&(n=!1);const a=e.getBoundingClientRect(),i=nx(e);let s=wa(1);t&&(r?ta(r)&&(s=bl(r)):s=bl(e));const o=p5(i,n,r)?OT(i):wa(0);let l=(a.left+o.x)/s.x,u=(a.top+o.y)/s.y,d=a.width/s.x,f=a.height/s.y;if(i){const m=gr(i),h=r&&ta(r)?gr(r):r;let y=m,p=Rv(y);for(;p&&r&&h!==y;){const b=bl(p),g=p.getBoundingClientRect(),v=na(p),w=g.left+(p.clientLeft+parseFloat(v.paddingLeft))*b.x,S=g.top+(p.clientTop+parseFloat(v.paddingTop))*b.y;l*=b.x,u*=b.y,d*=b.x,f*=b.y,l+=w,u+=S,y=gr(p),p=Rv(y)}}return Yh({width:d,height:f,x:l,y:u})}function tp(e,t){const n=ep(e).scrollLeft;return t?t.left+n:mo(Ea(e)).left+n}function MT(e,t){const n=e.getBoundingClientRect(),r=n.left+t.scrollLeft-tp(e,n),a=n.top+t.scrollTop;return{x:r,y:a}}function g5(e){let{elements:t,rect:n,offsetParent:r,strategy:a}=e;const i=a==="fixed",s=Ea(r),o=t?Jm(t.floating):!1;if(r===s||o&&i)return n;let l={scrollLeft:0,scrollTop:0},u=wa(1);const d=wa(0),f=Sa(r);if((f||!f&&!i)&&((vc(r)!=="body"||Sd(s))&&(l=ep(r)),Sa(r))){const h=mo(r);u=bl(r),d.x=h.x+r.clientLeft,d.y=h.y+r.clientTop}const m=s&&!f&&!i?MT(s,l):wa(0);return{width:n.width*u.x,height:n.height*u.y,x:n.x*u.x-l.scrollLeft*u.x+d.x+m.x,y:n.y*u.y-l.scrollTop*u.y+d.y+m.y}}function y5(e){return Array.from(e.getClientRects())}function v5(e){const t=Ea(e),n=ep(e),r=e.ownerDocument.body,a=lr(t.scrollWidth,t.clientWidth,r.scrollWidth,r.clientWidth),i=lr(t.scrollHeight,t.clientHeight,r.scrollHeight,r.clientHeight);let s=-n.scrollLeft+tp(e);const o=-n.scrollTop;return na(r).direction==="rtl"&&(s+=lr(t.clientWidth,r.clientWidth)-a),{width:a,height:i,x:s,y:o}}const N_=25;function b5(e,t){const n=gr(e),r=Ea(e),a=n.visualViewport;let i=r.clientWidth,s=r.clientHeight,o=0,l=0;if(a){i=a.width,s=a.height;const d=tx();(!d||d&&t==="fixed")&&(o=a.offsetLeft,l=a.offsetTop)}const u=tp(r);if(u<=0){const d=r.ownerDocument,f=d.body,m=getComputedStyle(f),h=d.compatMode==="CSS1Compat"&&parseFloat(m.marginLeft)+parseFloat(m.marginRight)||0,y=Math.abs(r.clientWidth-f.clientWidth-h);y<=N_&&(i-=y)}else u<=N_&&(i+=u);return{width:i,height:s,x:o,y:l}}const x5=new Set(["absolute","fixed"]);function w5(e,t){const n=mo(e,!0,t==="fixed"),r=n.top+e.clientTop,a=n.left+e.clientLeft,i=Sa(e)?bl(e):wa(1),s=e.clientWidth*i.x,o=e.clientHeight*i.y,l=a*i.x,u=r*i.y;return{width:s,height:o,x:l,y:u}}function j_(e,t,n){let r;if(t==="viewport")r=b5(e,n);else if(t==="document")r=v5(Ea(e));else if(ta(t))r=w5(t,n);else{const a=OT(e);r={x:t.x-a.x,y:t.y-a.y,width:t.width,height:t.height}}return Yh(r)}function PT(e,t){const n=hs(e);return n===t||!ta(n)||Xl(n)?!1:na(n).position==="fixed"||PT(n,t)}function S5(e,t){const n=t.get(e);if(n)return n;let r=Zu(e,[],!1).filter(o=>ta(o)&&vc(o)!=="body"),a=null;const i=na(e).position==="fixed";let s=i?hs(e):e;for(;ta(s)&&!Xl(s);){const o=na(s),l=ex(s);!l&&o.position==="fixed"&&(a=null),(i?!l&&!a:!l&&o.position==="static"&&!!a&&x5.has(a.position)||Sd(s)&&!l&&PT(e,s))?r=r.filter(d=>d!==s):a=o,s=hs(s)}return t.set(e,r),r}function _5(e){let{element:t,boundary:n,rootBoundary:r,strategy:a}=e;const s=[...n==="clippingAncestors"?Jm(t)?[]:S5(t,this._c):[].concat(n),r],o=s[0],l=s.reduce((u,d)=>{const f=j_(t,d,a);return u.top=lr(f.top,u.top),u.right=fs(f.right,u.right),u.bottom=fs(f.bottom,u.bottom),u.left=lr(f.left,u.left),u},j_(t,o,a));return{width:l.right-l.left,height:l.bottom-l.top,x:l.left,y:l.top}}function k5(e){const{width:t,height:n}=$T(e);return{width:t,height:n}}function E5(e,t,n){const r=Sa(t),a=Ea(t),i=n==="fixed",s=mo(e,!0,i,t);let o={scrollLeft:0,scrollTop:0};const l=wa(0);function u(){l.x=tp(a)}if(r||!r&&!i)if((vc(t)!=="body"||Sd(a))&&(o=ep(t)),r){const h=mo(t,!0,i,t);l.x=h.x+t.clientLeft,l.y=h.y+t.clientTop}else a&&u();i&&!r&&a&&u();const d=a&&!r&&!i?MT(a,o):wa(0),f=s.left+o.scrollLeft-l.x-d.x,m=s.top+o.scrollTop-l.y-d.y;return{x:f,y:m,width:s.width,height:s.height}}function Eg(e){return na(e).position==="static"}function T_(e,t){if(!Sa(e)||na(e).position==="fixed")return null;if(t)return t(e);let n=e.offsetParent;return Ea(e)===n&&(n=n.ownerDocument.body),n}function DT(e,t){const n=gr(e);if(Jm(e))return n;if(!Sa(e)){let a=hs(e);for(;a&&!Xl(a);){if(ta(a)&&!Eg(a))return a;a=hs(a)}return n}let r=T_(e,t);for(;r&&o5(r)&&Eg(r);)r=T_(r,t);return r&&Xl(r)&&Eg(r)&&!ex(r)?n:r||f5(e)||n}const C5=async function(e){const t=this.getOffsetParent||DT,n=this.getDimensions,r=await n(e.floating);return{reference:E5(e.reference,await t(e.floating),e.strategy),floating:{x:0,y:0,width:r.width,height:r.height}}};function N5(e){return na(e).direction==="rtl"}const j5={convertOffsetParentRelativeRectToViewportRelativeRect:g5,getDocumentElement:Ea,getClippingRect:_5,getOffsetParent:DT,getElementRects:C5,getClientRects:y5,getDimensions:k5,getScale:bl,isElement:ta,isRTL:N5};function zT(e,t){return e.x===t.x&&e.y===t.y&&e.width===t.width&&e.height===t.height}function T5(e,t){let n=null,r;const a=Ea(e);function i(){var o;clearTimeout(r),(o=n)==null||o.disconnect(),n=null}function s(o,l){o===void 0&&(o=!1),l===void 0&&(l=1),i();const u=e.getBoundingClientRect(),{left:d,top:f,width:m,height:h}=u;if(o||t(),!m||!h)return;const y=cf(f),p=cf(a.clientWidth-(d+m)),b=cf(a.clientHeight-(f+h)),g=cf(d),w={rootMargin:-y+"px "+-p+"px "+-b+"px "+-g+"px",threshold:lr(0,fs(1,l))||1};let S=!0;function E(C){const T=C[0].intersectionRatio;if(T!==l){if(!S)return s();T?s(!1,T):r=setTimeout(()=>{s(!1,1e-7)},1e3)}T===1&&!zT(u,e.getBoundingClientRect())&&s(),S=!1}try{n=new IntersectionObserver(E,{...w,root:a.ownerDocument})}catch{n=new IntersectionObserver(E,w)}n.observe(e)}return s(!0),i}function A5(e,t,n,r){r===void 0&&(r={});const{ancestorScroll:a=!0,ancestorResize:i=!0,elementResize:s=typeof ResizeObserver=="function",layoutShift:o=typeof IntersectionObserver=="function",animationFrame:l=!1}=r,u=nx(e),d=a||i?[...u?Zu(u):[],...Zu(t)]:[];d.forEach(g=>{a&&g.addEventListener("scroll",n,{passive:!0}),i&&g.addEventListener("resize",n)});const f=u&&o?T5(u,n):null;let m=-1,h=null;s&&(h=new ResizeObserver(g=>{let[v]=g;v&&v.target===u&&h&&(h.unobserve(t),cancelAnimationFrame(m),m=requestAnimationFrame(()=>{var w;(w=h)==null||w.observe(t)})),n()}),u&&!l&&h.observe(u),h.observe(t));let y,p=l?mo(e):null;l&&b();function b(){const g=mo(e);p&&!zT(p,g)&&n(),p=g,y=requestAnimationFrame(b)}return n(),()=>{var g;d.forEach(v=>{a&&v.removeEventListener("scroll",n),i&&v.removeEventListener("resize",n)}),f==null||f(),(g=h)==null||g.disconnect(),h=null,l&&cancelAnimationFrame(y)}}const R5=t5,$5=n5,O5=WL,M5=a5,P5=JL,A_=XL,D5=r5,z5=(e,t,n)=>{const r=new Map,a={platform:j5,...n},i={...a.platform,_c:r};return YL(e,t,{...a,platform:i})};var I5=typeof document<"u",L5=function(){},Xf=I5?x.useLayoutEffect:L5;function Xh(e,t){if(e===t)return!0;if(typeof e!=typeof t)return!1;if(typeof e=="function"&&e.toString()===t.toString())return!0;let n,r,a;if(e&&t&&typeof e=="object"){if(Array.isArray(e)){if(n=e.length,n!==t.length)return!1;for(r=n;r--!==0;)if(!Xh(e[r],t[r]))return!1;return!0}if(a=Object.keys(e),n=a.length,n!==Object.keys(t).length)return!1;for(r=n;r--!==0;)if(!{}.hasOwnProperty.call(t,a[r]))return!1;for(r=n;r--!==0;){const i=a[r];if(!(i==="_owner"&&e.$$typeof)&&!Xh(e[i],t[i]))return!1}return!0}return e!==e&&t!==t}function IT(e){return typeof window>"u"?1:(e.ownerDocument.defaultView||window).devicePixelRatio||1}function R_(e,t){const n=IT(e);return Math.round(t*n)/n}function Cg(e){const t=x.useRef(e);return Xf(()=>{t.current=e}),t}function U5(e){e===void 0&&(e={});const{placement:t="bottom",strategy:n="absolute",middleware:r=[],platform:a,elements:{reference:i,floating:s}={},transform:o=!0,whileElementsMounted:l,open:u}=e,[d,f]=x.useState({x:0,y:0,strategy:n,placement:t,middlewareData:{},isPositioned:!1}),[m,h]=x.useState(r);Xh(m,r)||h(r);const[y,p]=x.useState(null),[b,g]=x.useState(null),v=x.useCallback(F=>{F!==C.current&&(C.current=F,p(F))},[]),w=x.useCallback(F=>{F!==T.current&&(T.current=F,g(F))},[]),S=i||y,E=s||b,C=x.useRef(null),T=x.useRef(null),P=x.useRef(d),R=l!=null,$=Cg(l),j=Cg(a),O=Cg(u),z=x.useCallback(()=>{if(!C.current||!T.current)return;const F={placement:t,strategy:n,middleware:m};j.current&&(F.platform=j.current),z5(C.current,T.current,F).then(J=>{const N={...J,isPositioned:O.current!==!1};D.current&&!Xh(P.current,N)&&(P.current=N,So.flushSync(()=>{f(N)}))})},[m,t,n,j,O]);Xf(()=>{u===!1&&P.current.isPositioned&&(P.current.isPositioned=!1,f(F=>({...F,isPositioned:!1})))},[u]);const D=x.useRef(!1);Xf(()=>(D.current=!0,()=>{D.current=!1}),[]),Xf(()=>{if(S&&(C.current=S),E&&(T.current=E),S&&E){if($.current)return $.current(S,E,z);z()}},[S,E,z,$,R]);const A=x.useMemo(()=>({reference:C,floating:T,setReference:v,setFloating:w}),[v,w]),B=x.useMemo(()=>({reference:S,floating:E}),[S,E]),Z=x.useMemo(()=>{const F={position:n,left:0,top:0};if(!B.floating)return F;const J=R_(B.floating,d.x),N=R_(B.floating,d.y);return o?{...F,transform:"translate("+J+"px, "+N+"px)",...IT(B.floating)>=1.5&&{willChange:"transform"}}:{position:n,left:J,top:N}},[n,o,B.floating,d.x,d.y]);return x.useMemo(()=>({...d,update:z,refs:A,elements:B,floatingStyles:Z}),[d,z,A,B,Z])}const F5=e=>{function t(n){return{}.hasOwnProperty.call(n,"current")}return{name:"arrow",options:e,fn(n){const{element:r,padding:a}=typeof e=="function"?e(n):e;return r&&t(r)?r.current!=null?A_({element:r.current,padding:a}).fn(n):{}:r?A_({element:r,padding:a}).fn(n):{}}}},q5=(e,t)=>({...R5(e),options:[e,t]}),H5=(e,t)=>({...$5(e),options:[e,t]}),B5=(e,t)=>({...D5(e),options:[e,t]}),V5=(e,t)=>({...O5(e),options:[e,t]}),K5=(e,t)=>({...M5(e),options:[e,t]}),Z5=(e,t)=>({...P5(e),options:[e,t]}),G5=(e,t)=>({...F5(e),options:[e,t]});var Q5="Arrow",LT=x.forwardRef((e,t)=>{const{children:n,width:r=10,height:a=5,...i}=e;return c.jsx(De.svg,{...i,ref:t,width:r,height:a,viewBox:"0 0 30 10",preserveAspectRatio:"none",children:e.asChild?n:c.jsx("polygon",{points:"0,0 30,0 15,10"})})});LT.displayName=Q5;var Y5=LT;function X5(e){const[t,n]=x.useState(void 0);return Sn(()=>{if(e){n({width:e.offsetWidth,height:e.offsetHeight});const r=new ResizeObserver(a=>{if(!Array.isArray(a)||!a.length)return;const i=a[0];let s,o;if("borderBoxSize"in i){const l=i.borderBoxSize,u=Array.isArray(l)?l[0]:l;s=u.inlineSize,o=u.blockSize}else s=e.offsetWidth,o=e.offsetHeight;n({width:s,height:o})});return r.observe(e,{box:"border-box"}),()=>r.unobserve(e)}else n(void 0)},[e]),t}var rx="Popper",[UT,bc]=fi(rx),[W5,FT]=UT(rx),qT=e=>{const{__scopePopper:t,children:n}=e,[r,a]=x.useState(null);return c.jsx(W5,{scope:t,anchor:r,onAnchorChange:a,children:n})};qT.displayName=rx;var HT="PopperAnchor",BT=x.forwardRef((e,t)=>{const{__scopePopper:n,virtualRef:r,...a}=e,i=FT(HT,n),s=x.useRef(null),o=lt(t,s),l=x.useRef(null);return x.useEffect(()=>{const u=l.current;l.current=(r==null?void 0:r.current)||s.current,u!==l.current&&i.onAnchorChange(l.current)}),r?null:c.jsx(De.div,{...a,ref:o})});BT.displayName=HT;var ax="PopperContent",[J5,eU]=UT(ax),VT=x.forwardRef((e,t)=>{var Q,W,oe,de,L,V;const{__scopePopper:n,side:r="bottom",sideOffset:a=0,align:i="center",alignOffset:s=0,arrowPadding:o=0,avoidCollisions:l=!0,collisionBoundary:u=[],collisionPadding:d=0,sticky:f="partial",hideWhenDetached:m=!1,updatePositionStrategy:h="optimized",onPlaced:y,...p}=e,b=FT(ax,n),[g,v]=x.useState(null),w=lt(t,X=>v(X)),[S,E]=x.useState(null),C=X5(S),T=(C==null?void 0:C.width)??0,P=(C==null?void 0:C.height)??0,R=r+(i!=="center"?"-"+i:""),$=typeof d=="number"?d:{top:0,right:0,bottom:0,left:0,...d},j=Array.isArray(u)?u:[u],O=j.length>0,z={padding:$,boundary:j.filter(nU),altBoundary:O},{refs:D,floatingStyles:A,placement:B,isPositioned:Z,middlewareData:F}=U5({strategy:"fixed",placement:R,whileElementsMounted:(...X)=>A5(...X,{animationFrame:h==="always"}),elements:{reference:b.anchor},middleware:[q5({mainAxis:a+P,alignmentAxis:s}),l&&H5({mainAxis:!0,crossAxis:!1,limiter:f==="partial"?B5():void 0,...z}),l&&V5({...z}),K5({...z,apply:({elements:X,rects:ne,availableWidth:K,availableHeight:re})=>{const{width:ae,height:Ae}=ne.reference,ce=X.floating.style;ce.setProperty("--radix-popper-available-width",`${K}px`),ce.setProperty("--radix-popper-available-height",`${re}px`),ce.setProperty("--radix-popper-anchor-width",`${ae}px`),ce.setProperty("--radix-popper-anchor-height",`${Ae}px`)}}),S&&G5({element:S,padding:o}),rU({arrowWidth:T,arrowHeight:P}),m&&Z5({strategy:"referenceHidden",...z})]}),[J,N]=GT(B),q=Lr(y);Sn(()=>{Z&&(q==null||q())},[Z,q]);const G=(Q=F.arrow)==null?void 0:Q.x,_=(W=F.arrow)==null?void 0:W.y,k=((oe=F.arrow)==null?void 0:oe.centerOffset)!==0,[M,I]=x.useState();return Sn(()=>{g&&I(window.getComputedStyle(g).zIndex)},[g]),c.jsx("div",{ref:D.setFloating,"data-radix-popper-content-wrapper":"",style:{...A,transform:Z?A.transform:"translate(0, -200%)",minWidth:"max-content",zIndex:M,"--radix-popper-transform-origin":[(de=F.transformOrigin)==null?void 0:de.x,(L=F.transformOrigin)==null?void 0:L.y].join(" "),...((V=F.hide)==null?void 0:V.referenceHidden)&&{visibility:"hidden",pointerEvents:"none"}},dir:e.dir,children:c.jsx(J5,{scope:n,placedSide:J,onArrowChange:E,arrowX:G,arrowY:_,shouldHideArrow:k,children:c.jsx(De.div,{"data-side":J,"data-align":N,...p,ref:w,style:{...p.style,animation:Z?void 0:"none"}})})})});VT.displayName=ax;var KT="PopperArrow",tU={top:"bottom",right:"left",bottom:"top",left:"right"},ZT=x.forwardRef(function(t,n){const{__scopePopper:r,...a}=t,i=eU(KT,r),s=tU[i.placedSide];return c.jsx("span",{ref:i.onArrowChange,style:{position:"absolute",left:i.arrowX,top:i.arrowY,[s]:0,transformOrigin:{top:"",right:"0 0",bottom:"center 0",left:"100% 0"}[i.placedSide],transform:{top:"translateY(100%)",right:"translateY(50%) rotate(90deg) translateX(-50%)",bottom:"rotate(180deg)",left:"translateY(50%) rotate(-90deg) translateX(50%)"}[i.placedSide],visibility:i.shouldHideArrow?"hidden":void 0},children:c.jsx(Y5,{...a,ref:n,style:{...a.style,display:"block"}})})});ZT.displayName=KT;function nU(e){return e!==null}var rU=e=>({name:"transformOrigin",options:e,fn(t){var b,g,v;const{placement:n,rects:r,middlewareData:a}=t,s=((b=a.arrow)==null?void 0:b.centerOffset)!==0,o=s?0:e.arrowWidth,l=s?0:e.arrowHeight,[u,d]=GT(n),f={start:"0%",center:"50%",end:"100%"}[d],m=(((g=a.arrow)==null?void 0:g.x)??0)+o/2,h=(((v=a.arrow)==null?void 0:v.y)??0)+l/2;let y="",p="";return u==="bottom"?(y=s?f:`${m}px`,p=`${-l}px`):u==="top"?(y=s?f:`${m}px`,p=`${r.floating.height+l}px`):u==="right"?(y=`${-l}px`,p=s?f:`${h}px`):u==="left"&&(y=`${r.floating.width+l}px`,p=s?f:`${h}px`),{data:{x:y,y:p}}}});function GT(e){const[t,n="center"]=e.split("-");return[t,n]}var QT=qT,np=BT,ix=VT,sx=ZT,[rp,fie]=fi("Tooltip",[bc]),ox=bc(),YT="TooltipProvider",aU=700,$_="tooltip.open",[iU,XT]=rp(YT),WT=e=>{const{__scopeTooltip:t,delayDuration:n=aU,skipDelayDuration:r=300,disableHoverableContent:a=!1,children:i}=e,s=x.useRef(!0),o=x.useRef(!1),l=x.useRef(0);return x.useEffect(()=>{const u=l.current;return()=>window.clearTimeout(u)},[]),c.jsx(iU,{scope:t,isOpenDelayedRef:s,delayDuration:n,onOpen:x.useCallback(()=>{window.clearTimeout(l.current),s.current=!1},[]),onClose:x.useCallback(()=>{window.clearTimeout(l.current),l.current=window.setTimeout(()=>s.current=!0,r)},[r]),isPointerInTransitRef:o,onPointerInTransitChange:x.useCallback(u=>{o.current=u},[]),disableHoverableContent:a,children:i})};WT.displayName=YT;var JT="Tooltip",[hie,ap]=rp(JT),$v="TooltipTrigger",sU=x.forwardRef((e,t)=>{const{__scopeTooltip:n,...r}=e,a=ap($v,n),i=XT($v,n),s=ox(n),o=x.useRef(null),l=lt(t,o,a.onTriggerChange),u=x.useRef(!1),d=x.useRef(!1),f=x.useCallback(()=>u.current=!1,[]);return x.useEffect(()=>()=>document.removeEventListener("pointerup",f),[f]),c.jsx(np,{asChild:!0,...s,children:c.jsx(De.button,{"aria-describedby":a.open?a.contentId:void 0,"data-state":a.stateAttribute,...r,ref:l,onPointerMove:xe(e.onPointerMove,m=>{m.pointerType!=="touch"&&!d.current&&!i.isPointerInTransitRef.current&&(a.onTriggerEnter(),d.current=!0)}),onPointerLeave:xe(e.onPointerLeave,()=>{a.onTriggerLeave(),d.current=!1}),onPointerDown:xe(e.onPointerDown,()=>{a.open&&a.onClose(),u.current=!0,document.addEventListener("pointerup",f,{once:!0})}),onFocus:xe(e.onFocus,()=>{u.current||a.onOpen()}),onBlur:xe(e.onBlur,a.onClose),onClick:xe(e.onClick,a.onClose)})})});sU.displayName=$v;var oU="TooltipPortal",[mie,lU]=rp(oU,{forceMount:void 0}),Wl="TooltipContent",eA=x.forwardRef((e,t)=>{const n=lU(Wl,e.__scopeTooltip),{forceMount:r=n.forceMount,side:a="top",...i}=e,s=ap(Wl,e.__scopeTooltip);return c.jsx(hi,{present:r||s.open,children:s.disableHoverableContent?c.jsx(tA,{side:a,...i,ref:t}):c.jsx(cU,{side:a,...i,ref:t})})}),cU=x.forwardRef((e,t)=>{const n=ap(Wl,e.__scopeTooltip),r=XT(Wl,e.__scopeTooltip),a=x.useRef(null),i=lt(t,a),[s,o]=x.useState(null),{trigger:l,onClose:u}=n,d=a.current,{onPointerInTransitChange:f}=r,m=x.useCallback(()=>{o(null),f(!1)},[f]),h=x.useCallback((y,p)=>{const b=y.currentTarget,g={x:y.clientX,y:y.clientY},v=mU(g,b.getBoundingClientRect()),w=pU(g,v),S=gU(p.getBoundingClientRect()),E=vU([...w,...S]);o(E),f(!0)},[f]);return x.useEffect(()=>()=>m(),[m]),x.useEffect(()=>{if(l&&d){const y=b=>h(b,d),p=b=>h(b,l);return l.addEventListener("pointerleave",y),d.addEventListener("pointerleave",p),()=>{l.removeEventListener("pointerleave",y),d.removeEventListener("pointerleave",p)}}},[l,d,h,m]),x.useEffect(()=>{if(s){const y=p=>{const b=p.target,g={x:p.clientX,y:p.clientY},v=(l==null?void 0:l.contains(b))||(d==null?void 0:d.contains(b)),w=!yU(g,s);v?m():w&&(m(),u())};return document.addEventListener("pointermove",y),()=>document.removeEventListener("pointermove",y)}},[l,d,s,u,m]),c.jsx(tA,{...e,ref:i})}),[uU,dU]=rp(JT,{isInside:!1}),fU=W3("TooltipContent"),tA=x.forwardRef((e,t)=>{const{__scopeTooltip:n,children:r,"aria-label":a,onEscapeKeyDown:i,onPointerDownOutside:s,...o}=e,l=ap(Wl,n),u=ox(n),{onClose:d}=l;return x.useEffect(()=>(document.addEventListener($_,d),()=>document.removeEventListener($_,d)),[d]),x.useEffect(()=>{if(l.trigger){const f=m=>{const h=m.target;h!=null&&h.contains(l.trigger)&&d()};return window.addEventListener("scroll",f,{capture:!0}),()=>window.removeEventListener("scroll",f,{capture:!0})}},[l.trigger,d]),c.jsx(pc,{asChild:!0,disableOutsidePointerEvents:!1,onEscapeKeyDown:i,onPointerDownOutside:s,onFocusOutside:f=>f.preventDefault(),onDismiss:d,children:c.jsxs(ix,{"data-state":l.stateAttribute,...u,...o,ref:t,style:{...o.style,"--radix-tooltip-content-transform-origin":"var(--radix-popper-transform-origin)","--radix-tooltip-content-available-width":"var(--radix-popper-available-width)","--radix-tooltip-content-available-height":"var(--radix-popper-available-height)","--radix-tooltip-trigger-width":"var(--radix-popper-anchor-width)","--radix-tooltip-trigger-height":"var(--radix-popper-anchor-height)"},children:[c.jsx(fU,{children:r}),c.jsx(uU,{scope:n,isInside:!0,children:c.jsx(xI,{id:l.contentId,role:"tooltip",children:a||r})})]})})});eA.displayName=Wl;var nA="TooltipArrow",hU=x.forwardRef((e,t)=>{const{__scopeTooltip:n,...r}=e,a=ox(n);return dU(nA,n).isInside?null:c.jsx(sx,{...a,...r,ref:t})});hU.displayName=nA;function mU(e,t){const n=Math.abs(t.top-e.y),r=Math.abs(t.bottom-e.y),a=Math.abs(t.right-e.x),i=Math.abs(t.left-e.x);switch(Math.min(n,r,a,i)){case i:return"left";case a:return"right";case n:return"top";case r:return"bottom";default:throw new Error("unreachable")}}function pU(e,t,n=5){const r=[];switch(t){case"top":r.push({x:e.x-n,y:e.y+n},{x:e.x+n,y:e.y+n});break;case"bottom":r.push({x:e.x-n,y:e.y-n},{x:e.x+n,y:e.y-n});break;case"left":r.push({x:e.x+n,y:e.y-n},{x:e.x+n,y:e.y+n});break;case"right":r.push({x:e.x-n,y:e.y-n},{x:e.x-n,y:e.y+n});break}return r}function gU(e){const{top:t,right:n,bottom:r,left:a}=e;return[{x:a,y:t},{x:n,y:t},{x:n,y:r},{x:a,y:r}]}function yU(e,t){const{x:n,y:r}=e;let a=!1;for(let i=0,s=t.length-1;i<t.length;s=i++){const o=t[i],l=t[s],u=o.x,d=o.y,f=l.x,m=l.y;d>r!=m>r&&n<(f-u)*(r-d)/(m-d)+u&&(a=!a)}return a}function vU(e){const t=e.slice();return t.sort((n,r)=>n.x<r.x?-1:n.x>r.x?1:n.y<r.y?-1:n.y>r.y?1:0),bU(t)}function bU(e){if(e.length<=1)return e.slice();const t=[];for(let r=0;r<e.length;r++){const a=e[r];for(;t.length>=2;){const i=t[t.length-1],s=t[t.length-2];if((i.x-s.x)*(a.y-s.y)>=(i.y-s.y)*(a.x-s.x))t.pop();else break}t.push(a)}t.pop();const n=[];for(let r=e.length-1;r>=0;r--){const a=e[r];for(;n.length>=2;){const i=n[n.length-1],s=n[n.length-2];if((i.x-s.x)*(a.y-s.y)>=(i.y-s.y)*(a.x-s.x))n.pop();else break}n.push(a)}return n.pop(),t.length===1&&n.length===1&&t[0].x===n[0].x&&t[0].y===n[0].y?t:t.concat(n)}var xU=WT,rA=eA;const wU=xU,SU=x.forwardRef(({className:e,sideOffset:t=4,...n},r)=>c.jsx(rA,{ref:r,sideOffset:t,className:Te("z-50 overflow-hidden rounded-md border bg-popover px-3 py-1.5 text-sm text-popover-foreground shadow-md animate-in fade-in-0 zoom-in-95 data-[state=closed]:animate-out data-[state=closed]:fade-out-0 data-[state=closed]:zoom-out-95 data-[side=bottom]:slide-in-from-top-2 data-[side=left]:slide-in-from-right-2 data-[side=right]:slide-in-from-left-2 data-[side=top]:slide-in-from-bottom-2 origin-[--radix-tooltip-content-transform-origin]",e),...n}));SU.displayName=rA.displayName;const _U={total:0,byKind:{oauth_required:0,oauth_expired:0,service_unhealthy:0,credential_missing_secret:0,playbook_missing_deps:0},serviceWarnings:new Map,credentialWarnings:new Map,playbookWarnings:new Map};function kU(e){return e?{total:e.total,byKind:e.byKind,serviceWarnings:new Map(Object.entries(e.services)),credentialWarnings:new Map(Object.entries(e.credentials)),playbookWarnings:new Map(Object.entries(e.playbooks))}:_U}const Pn="#92E4DD",Qn="#F9386D",Gr="#FFFFFF",ha="bg-gradient-to-b from-gray-900 via-gray-800 to-gray-900";function oa(e){return Pn}function ma(e){return{borderColor:e,color:e,boxShadow:`0 0 20px ${e}20`}}const EU=Ym("inline-flex items-center justify-center gap-2 whitespace-nowrap rounded-md text-sm font-medium ring-offset-background transition-colors focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-ring focus-visible:ring-offset-2 disabled:pointer-events-none disabled:opacity-50 [&_svg]:pointer-events-none [&_svg]:size-4 [&_svg]:shrink-0",{variants:{variant:{gold:"bg-[#C4B643] text-[#0A0A07] hover:bg-[#D4C760] border border-[#C4B643] font-medium",default:"bg-primary text-primary-foreground hover:bg-primary/90",destructive:"bg-destructive text-destructive-foreground hover:bg-destructive/90",outline:"border border-input bg-background hover:bg-accent hover:text-accent-foreground",secondary:"bg-secondary text-secondary-foreground hover:bg-secondary/80",ghost:"hover:bg-accent hover:text-accent-foreground",link:"text-primary underline-offset-4 hover:underline"},size:{default:"h-10 px-4 py-2",sm:"h-9 rounded-md px-3",lg:"h-11 rounded-md px-8",icon:"h-10 w-10"}},defaultVariants:{variant:"default",size:"default"}}),le=x.forwardRef(({className:e,variant:t,size:n,asChild:r=!1,...a},i)=>{const s=r?Y3:"button";return c.jsx(s,{className:Te(EU({variant:t,size:n,className:e})),ref:i,...a})});le.displayName="Button";function xl({warnings:e}){if(!(e!=null&&e.length))return null;const t=e.find(r=>r.severity==="error")??e[0],n=t.severity==="error";return c.jsxs("div",{className:`absolute left-1/2 -translate-x-1/2 top-8 z-20 flex items-center gap-1 rounded-full px-1.5 py-0.5 text-[7px] font-semibold uppercase tracking-wide shadow-lg ${n?"bg-red-500/90 text-white border border-red-300/60":"bg-amber-500/90 text-black border border-amber-200/60"}`,title:e.map(r=>r.message).join(" · "),"data-testid":"card-warning-badge",children:[c.jsx(Rr,{className:"h-2.5 w-2.5 shrink-0"}),c.jsx("span",{className:"max-w-[72px] truncate",children:t.message})]})}const O_="data:image/svg+xml,%3csvg%20id='eSEM9z84vJh1'%20xmlns='http://www.w3.org/2000/svg'%20xmlns:xlink='http://www.w3.org/1999/xlink'%20viewBox='0%200%20300%20300'%20shape-rendering='geometricPrecision'%20text-rendering='geometricPrecision'%20project-id='c9405aa1bbb44eb388e44d7178ee1932'%20export-id='327eb6bfd5a543cb88b86ffe07ce0c92'%20cached='false'%3e%3crect%20width='63.894524'%20height='34.989858'%20rx='0'%20ry='0'%20transform='translate(71.928217%20125.25355)'%20stroke-width='0'/%3e%3crect%20width='63.894524'%20height='34.989858'%20rx='0'%20ry='0'%20transform='matrix(2.570356%200%200%202.449277%2067.884163%2017.275854)'%20stroke-width='0'/%3e%3crect%20width='63.894524'%20height='34.989858'%20rx='0'%20ry='0'%20transform='translate(163.184592%20125.25355)'%20stroke-width='0'/%3e%3crect%20width='63.894524'%20height='34.989858'%20rx='0'%20ry='0'%20transform='matrix(3.42849%200%200%200.403818%2040.469132%20102.975708)'%20stroke-width='0'/%3e%3cpolygon%20points='0,-42.01893%2030.924539,20.531677%2024.698107,33.994028%20-24.698107,33.994028%20-33.20748,20.12246%200,-42.01893'%20transform='matrix(-.687913%200.002106-.00101-.33%20149.995947%20212.592699)'%20stroke-width='0'/%3e%3cpolygon%20points='0,-42.01893%2036.327051,-24.945112%2016.852287,34.058016%20-19.029679,34.002758%20-36.534138,-25.057317%200,-42.01893'%20transform='matrix(-.466366%200.001428-.002837-.926983%20149.84238%20249.643929)'%20stroke-width='0'/%3e%3c/svg%3e";function CU(e){return e.iconUrl?e.iconUrl:null}function aA({service:e}){const t=oa(),n=CU(e),[r,a]=x.useState(!1);return n&&!r?c.jsx("img",{src:n,alt:"",className:"w-7 h-7 object-contain rounded-sm",draggable:!1,onError:()=>a(!0)}):c.jsx("div",{style:{width:28,height:28,backgroundColor:t,WebkitMask:`url(${O_}) no-repeat center / contain`,mask:`url(${O_}) no-repeat center / contain`},"aria-hidden":!0})}function lx(e){return e?"ring-2 ring-inset ring-yellow-400/90 shadow-[0_0_10px_rgba(250,204,21,0.2)]":""}function cx(){return c.jsx("span",{className:"absolute top-1.5 left-1/2 z-20 -translate-x-1/2 rounded bg-yellow-500 px-1 py-px text-[7px] font-bold uppercase tracking-wide text-black shadow",children:"In deck"})}function NU({service:e,onDragStart:t,onDragEnd:n,isInActiveDeck:r,onCardClick:a,isInCollection:i=!1,onMouseEnter:s,onMouseLeave:o,activeDeck:l,warnings:u}){const d=cn(),{toast:f}=nn(),m=oa(),h=St({mutationFn:async()=>{if(!l)throw new Error("No active deck found");return ke("POST",`/api/decks/${l.id}/services`,{serviceId:e.id,position:0})},onSuccess:()=>{d.invalidateQueries({queryKey:["/api/decks"]}),f({title:"Service added to deck",description:`${e.name} has been added to your active deck.`})},onError:g=>{f({title:"Failed to add service",description:g.message,variant:"destructive"})}}),y=St({mutationFn:async()=>ke("DELETE",`/api/services/${e.id}`,{}),onSuccess:()=>{d.invalidateQueries({queryKey:["/api/services"]}),d.invalidateQueries({queryKey:["/api/collection/warnings"]}),d.invalidateQueries({queryKey:["/api/decks"]}),f({title:"Service deleted",description:`${e.name} has been deleted successfully.`})},onError:g=>{f({title:"Failed to delete service",description:g.message,variant:"destructive"})}}),p=g=>{g.stopPropagation(),h.mutate()},b=g=>{g.stopPropagation(),window.confirm(`Are you sure you want to delete ${e.name}? This action cannot be undone.`)&&y.mutate()};return c.jsx("div",{className:"relative group cursor-pointer",draggable:!r,onDragStart:g=>t(g,e),onDragEnd:n,onClick:()=>a==null?void 0:a(e),"data-testid":`card-${e.id}`,onMouseEnter:s,onMouseLeave:o,children:c.jsxs("div",{className:`
273
+ w-32 h-48 aspect-[2/3] rounded-lg border-2 p-3
274
+ transform transition-all duration-300 shadow-lg hover:shadow-2xl
275
+ bg-gradient-to-b from-gray-900 via-gray-800 to-gray-900
276
+ relative overflow-hidden
277
+ ${lx(r)}
278
+ ${i?"hover:scale-110 hover:rotate-0":"hover:scale-105"}
279
+ `,style:{borderColor:m,boxShadow:`0 0 20px ${m}20`},children:[c.jsx(xl,{warnings:u}),r&&c.jsx(cx,{}),c.jsx("div",{className:"absolute top-1 left-1 text-xs font-bold",children:c.jsx("div",{className:"leading-none",style:{color:m},children:e.type==="mcp"?"RM":e.type==="local-mcp"?"LM":"A"})}),c.jsx("div",{className:"absolute bottom-1 right-1 text-xs font-bold rotate-180",children:c.jsx("div",{className:"leading-none",style:{color:m},children:e.type==="mcp"?"RM":e.type==="local-mcp"?"LM":"A"})}),c.jsx("div",{className:"absolute top-1 right-1 opacity-0 group-hover:opacity-100 transition-opacity duration-200 z-10",children:c.jsx(le,{size:"sm",variant:"destructive",className:"h-5 w-5 p-0 bg-red-500/80 hover:bg-red-500 border-red-400",onClick:b,title:`Delete ${e.name}`,children:c.jsx(wd,{className:"w-3 h-3"})})}),c.jsxs("div",{className:"absolute inset-x-2 top-6 bottom-8 flex flex-col items-center justify-center text-center",children:[c.jsx("div",{className:"mb-2",style:{color:m},children:c.jsx(aA,{service:e})}),c.jsx("h3",{className:"font-bold text-xs mb-1 line-clamp-2","data-testid":`text-service-name-${e.id}`,style:{color:m},children:e.name}),c.jsx("div",{className:"text-[8px] px-1 py-0.5 rounded border opacity-70",style:{color:m,borderColor:m},children:e.type==="mcp"?"Remote MCP":e.type==="local-mcp"?"Local MCP":"A2A"})]}),c.jsx("div",{className:"absolute bottom-6 inset-x-1",children:c.jsx(le,{size:"sm",className:"w-full text-[8px] px-1 py-1 h-5 bg-black/20 hover:bg-black/40 border",style:{color:m,borderColor:m},onClick:p,disabled:r||h.isPending,"data-testid":`button-add-to-deck-${e.id}`,children:r?"IN DECK":"ADD"})}),c.jsx("div",{className:"absolute inset-0 rounded-lg bg-gradient-to-br from-transparent via-white/5 to-transparent opacity-0 group-hover:opacity-100 transition-all duration-500 pointer-events-none"})]})})}const jU=x.memo(NU);function TU(e){return e.iconUrl?e.iconUrl:null}function iA({credential:e,color:t}){const n=TU(e);return n?c.jsx("img",{src:n,alt:"",className:"h-7 w-7 object-contain rounded-sm",draggable:!1}):c.jsx(Nv,{className:"h-7 w-7",strokeWidth:2.25,style:{color:t}})}function AU({credential:e,isInActiveDeck:t,activeDeck:n,isInCollection:r=!0,onDragStart:a,onDragEnd:i,onMouseEnter:s,onMouseLeave:o,onCardClick:l,warnings:u}){const d=cn(),{toast:f}=nn(),m=Qn,h=St({mutationFn:async()=>{if(!n)throw new Error("No active deck found");return ke("POST",`/api/decks/${n.id}/credentials`,{credentialId:e.id})},onSuccess:()=>{d.invalidateQueries({queryKey:["/api/decks"]}),d.invalidateQueries({queryKey:["/api/decks"]}),f({title:"Added to deck",description:`${e.label} is in your active deck.`})},onError:p=>{f({title:"Failed to add to deck",description:p.message,variant:"destructive"})}}),y=St({mutationFn:async()=>ke("DELETE",`/api/credentials/${e.id}`),onSuccess:()=>{d.invalidateQueries({queryKey:["/api/credentials/vault"]}),d.invalidateQueries({queryKey:["/api/decks"]}),d.invalidateQueries({queryKey:["/api/decks"]}),f({title:"API key removed",description:`${e.label} was deleted from your vault.`})},onError:p=>{f({title:"Failed to remove API key",description:p.message,variant:"destructive"})}});return c.jsx("div",{className:"relative group cursor-pointer",draggable:!t&&!!a,onDragStart:a?p=>a(p,e):void 0,onDragEnd:i,onClick:()=>l==null?void 0:l(e),"data-testid":`card-${e.id}`,onMouseEnter:s,onMouseLeave:o,children:c.jsxs("div",{className:`
280
+ w-32 h-48 aspect-[2/3] rounded-lg border-2 p-3
281
+ transform transition-all duration-300 shadow-lg hover:shadow-2xl
282
+ bg-gradient-to-b from-gray-900 via-gray-800 to-gray-900
283
+ relative overflow-hidden
284
+ ${lx(t)}
285
+ ${r?"hover:scale-110 hover:rotate-0":"hover:scale-105"}
286
+ `,style:{borderColor:m,boxShadow:`0 0 20px ${m}20`},children:[c.jsx(xl,{warnings:u}),t&&c.jsx(cx,{}),c.jsx("div",{className:"absolute top-1 left-1 text-xs font-bold",children:c.jsx("div",{className:"leading-none",style:{color:m},children:"AK"})}),c.jsx("div",{className:"absolute bottom-1 right-1 text-xs font-bold rotate-180",children:c.jsx("div",{className:"leading-none",style:{color:m},children:"AK"})}),c.jsx("div",{className:"absolute top-1 right-1 opacity-0 group-hover:opacity-100 transition-opacity duration-200 z-10",children:c.jsx(le,{size:"sm",variant:"destructive",className:"h-5 w-5 p-0 bg-red-500/80 hover:bg-red-500 border-red-400",onClick:p=>{p.stopPropagation(),window.confirm(`Remove ${e.label} from your vault?`)&&y.mutate()},title:`Remove ${e.label}`,children:c.jsx(wd,{className:"w-3 h-3"})})}),c.jsxs("div",{className:"absolute inset-x-2 top-6 bottom-8 flex flex-col items-center justify-center text-center",children:[c.jsx("div",{className:"mb-2",style:{color:m},children:c.jsx(iA,{credential:e,color:m})}),c.jsx("h3",{className:"font-bold text-xs mb-1 line-clamp-2","data-testid":`text-credential-name-${e.id}`,style:{color:m},children:e.label}),c.jsx("div",{className:"text-[8px] px-1 py-0.5 rounded border opacity-70",style:{color:m,borderColor:m},children:e.hasSecret?"API Key":"Missing key"})]}),c.jsx("div",{className:"absolute bottom-6 inset-x-1",children:c.jsx(le,{size:"sm",className:"w-full text-[8px] px-1 py-1 h-5 bg-black/20 hover:bg-black/40 border",style:{color:m,borderColor:m},onClick:p=>{p.stopPropagation(),h.mutate()},disabled:t||h.isPending||!n,"data-testid":`button-add-to-deck-${e.id}`,children:t?"IN DECK":"ADD"})}),c.jsx("div",{className:"absolute inset-0 rounded-lg bg-gradient-to-br from-transparent via-white/5 to-transparent opacity-0 group-hover:opacity-100 transition-all duration-500 pointer-events-none"})]})})}const RU=x.memo(AU);function $U({playbook:e,isInActiveDeck:t,activeDeck:n,isInCollection:r=!0,onDragStart:a,onDragEnd:i,onMouseEnter:s,onMouseLeave:o,onCardClick:l,warnings:u}){const d=cn(),{toast:f}=nn(),m=Gr,h=e.dependsOnCredentialIds.length+e.dependsOnServiceIds.length,y=St({mutationFn:async()=>{if(!n)throw new Error("No deck selected");return ke("POST",`/api/decks/${n.id}/playbooks`,{playbookId:e.id})},onSuccess:()=>{d.invalidateQueries({queryKey:["/api/decks"]}),f({title:"Playbook added to deck",description:`${e.title} is on this deck.`})},onError:b=>{f({title:"Failed to add playbook",description:b.message,variant:"destructive"})}}),p=St({mutationFn:async()=>ke("DELETE",`/api/playbooks/${e.id}`),onSuccess:()=>{d.invalidateQueries({queryKey:["/api/playbooks/vault"]}),d.invalidateQueries({queryKey:["/api/decks"]}),f({title:"Playbook deleted",description:`${e.title} was removed from your collection.`})},onError:b=>{f({title:"Failed to delete playbook",description:b.message,variant:"destructive"})}});return c.jsx("div",{className:"relative group cursor-pointer",draggable:!t&&!!a,onDragStart:a?b=>a(b,e):void 0,onDragEnd:i,onClick:()=>l==null?void 0:l(e),"data-testid":`card-${e.id}`,onMouseEnter:s,onMouseLeave:o,children:c.jsxs("div",{className:`
287
+ w-32 h-48 aspect-[2/3] rounded-lg border-2 p-3
288
+ transform transition-all duration-300 shadow-lg hover:shadow-2xl
289
+ bg-gradient-to-b from-gray-900 via-gray-800 to-gray-900
290
+ relative overflow-hidden
291
+ ${lx(t)}
292
+ ${r?"hover:scale-110 hover:rotate-0":"hover:scale-105"}
293
+ `,style:{borderColor:m,boxShadow:`0 0 20px ${m}20`},children:[c.jsx(xl,{warnings:u}),t&&c.jsx(cx,{}),c.jsx("div",{className:"absolute top-1 left-1 text-xs font-bold",children:c.jsx("div",{className:"leading-none",style:{color:m},children:"PB"})}),c.jsx("div",{className:"absolute bottom-1 right-1 text-xs font-bold rotate-180",children:c.jsx("div",{className:"leading-none",style:{color:m},children:"PB"})}),c.jsx("div",{className:"absolute top-1 right-1 opacity-0 group-hover:opacity-100 transition-opacity duration-200 z-10",children:c.jsx(le,{size:"sm",variant:"destructive",className:"h-5 w-5 p-0 bg-red-500/80 hover:bg-red-500 border-red-400",onClick:b=>{b.stopPropagation(),window.confirm(`Delete playbook "${e.title}"?`)&&p.mutate()},title:`Delete ${e.title}`,children:c.jsx(wd,{className:"w-3 h-3"})})}),c.jsxs("div",{className:"absolute inset-x-2 top-6 bottom-8 flex flex-col items-center justify-center text-center",children:[c.jsx("div",{className:"mb-2",style:{color:m},children:c.jsx(Zb,{className:"h-7 w-7",strokeWidth:2.25})}),c.jsx("h3",{className:"font-bold text-xs mb-1 line-clamp-2",style:{color:m},children:e.title}),c.jsxs("div",{className:"text-[8px] px-1 py-0.5 rounded border opacity-70",style:{color:m,borderColor:m},children:["Playbook",h>0?` · ${h} deps`:""]})]}),c.jsx("div",{className:"absolute bottom-6 inset-x-1",children:c.jsx(le,{size:"sm",className:"w-full text-[8px] px-1 py-1 h-5 bg-black/20 hover:bg-black/40 border",style:{color:m,borderColor:m},onClick:b=>{b.stopPropagation(),y.mutate()},disabled:t||y.isPending||!n,children:t?"IN DECK":"ADD"})}),c.jsx("div",{className:"absolute inset-0 rounded-lg bg-gradient-to-br from-transparent via-white/5 to-transparent opacity-0 group-hover:opacity-100 transition-all duration-500 pointer-events-none"})]})})}const OU=x.memo($U),Gu=128,sA=192,Jl=48,MU=10,Wh=12,uf=64,df=4,M_=14,oA=12,lA=1.08;function PU(e=oA,t=lA){const n=e*Math.PI/180,r=Gu*Math.sin(n)+sA*Math.cos(n);return Math.ceil(r*t)+8}const Ov=PU();function cA(e,t=Jl){return e===0?0:Gu+Math.max(0,e-1)*(Gu-t)}function DU(e=MU,t=Jl,n=Wh){return cA(e,t)+2*n}function zU(e,t=Jl){return cA(e,t)+2*Wh}const IU=DU();function LU(e,t,n,r=oA){const a=t+n/2,i=n/2;if(i<=0)return 0;const s=(e-a)/i;return Math.max(-r,Math.min(r,s*r))}function UU(e){return{flexShrink:0,marginLeft:e===0?0:`-${Jl}px`}}function FU(e,t,n){return n===e?999999:t-e}function qU({cardCount:e,children:t}){const n=x.useRef(null),r=x.useRef([]),a=x.useRef(0),i=x.useRef(void 0),[s,o]=x.useState(!1),[l,u]=x.useState(!1),[d,f]=x.useState(!1),[m,h]=x.useState(!1),[y,p]=x.useState(!1),b=x.useRef(!1),g=x.useRef(!1),[v,w]=x.useState(null),S=x.useRef(null);S.current=v;const E=x.useCallback(()=>{const j=n.current;if(!j)return;const O=j.getBoundingClientRect(),z=S.current;r.current.forEach((D,A)=>{if(!D)return;const B=D.getBoundingClientRect(),Z=B.left+B.width/2,F=z===A?0:LU(Z,O.left,O.width),J=z===A?lA:1;D.style.transform=`rotate(${F}deg) scale(${J})`,D.style.transformOrigin="center center",D.style.zIndex=String(FU(A,e,z))})},[e]),C=x.useCallback(j=>{const O=n.current;if(!O)return;const z=Gu-Jl;O.scrollBy({left:j==="left"?-z:z,behavior:"smooth"})},[]),T=x.useCallback(()=>{const j=n.current;if(!j)return;const z=zU(e,Jl)>j.clientWidth+2;o(z),u(z&&j.scrollLeft>4),f(z&&j.scrollLeft+j.clientWidth<j.scrollWidth-4),E()},[e,E]);x.useLayoutEffect(()=>{const j=n.current;if(!j)return;T();const O=new ResizeObserver(T);return O.observe(j),j.addEventListener("scroll",T,{passive:!0}),()=>{O.disconnect(),j.removeEventListener("scroll",T)}},[e,T]),x.useEffect(()=>{const j=()=>{const O=n.current,z=a.current;if(O&&z!==0){O.scrollLeft+=z,E();const B=O.scrollLeft>4,Z=O.scrollLeft+O.clientWidth<O.scrollWidth-4;u(B),f(Z)}const D=z<0,A=z>0;D!==b.current&&(b.current=D,h(D)),A!==g.current&&(g.current=A,p(A)),i.current=requestAnimationFrame(j)};return i.current=requestAnimationFrame(j),()=>{i.current!==void 0&&cancelAnimationFrame(i.current)}},[E]);const P=j=>{const O=n.current;if(!O||!s){a.current=0;return}const z=O.getBoundingClientRect(),D=j.clientX-z.left;if(D<uf&&l){const A=1-D/uf;a.current=-(df+A*(M_-df))}else if(D>z.width-uf&&d){const A=1-(z.width-D)/uf;a.current=df+A*(M_-df)}else a.current=0;E()},R=()=>{a.current=0,b.current=!1,g.current=!1,h(!1),p(!1)};if(x.useLayoutEffect(()=>{r.current.length=e,E()},[e,v,E]),e===0)return c.jsx(c.Fragment,{children:t});const $=(j,O)=>`absolute ${j==="left"?"left-2":"right-2"} top-1/2 z-30 -translate-y-1/2 rounded-full bg-gray-950/90 p-1.5 text-yellow-300 shadow-lg ring-1 ring-black/50 transition-all duration-150 hover:bg-gray-950 hover:ring-yellow-300/40 ${O?"scale-110":"scale-100"}`;return c.jsxs("div",{className:"relative flex h-full w-full min-w-0 max-w-full items-center justify-center overflow-hidden","data-testid":"deck-fan",onMouseMove:P,onMouseLeave:R,children:[s&&l&&c.jsx("button",{type:"button",className:$("left",m),"aria-label":"Scroll deck left","data-testid":"deck-scroll-left",onClick:()=>C("left"),children:c.jsx(hT,{className:"h-6 w-6",strokeWidth:2.5})}),s&&d&&c.jsx("button",{type:"button",className:$("right",y),"aria-label":"Scroll deck right","data-testid":"deck-scroll-right",onClick:()=>C("right"),children:c.jsx(mT,{className:"h-6 w-6",strokeWidth:2.5})}),c.jsx("div",{ref:n,className:"max-w-full overflow-x-auto overflow-y-visible [-ms-overflow-style:none] [scrollbar-width:none] [&::-webkit-scrollbar]:hidden",style:{width:IU,maxWidth:"100%"},children:c.jsx("div",{className:"flex items-center justify-start isolate group/fan",style:{minHeight:Ov,paddingLeft:Wh,paddingRight:Wh},children:x.Children.map(t,(j,O)=>c.jsx("div",{ref:z=>{r.current[O]=z},className:"relative flex items-center justify-center transition-[transform,box-shadow] duration-500 will-change-transform",style:{...UU(O),minHeight:Ov},onMouseEnter:()=>w(O),onMouseLeave:()=>w(null),children:j},j&&typeof j=="object"&&"key"in j?j.key:O))})})]})}const at=x.forwardRef(({className:e,type:t,...n},r)=>c.jsx("input",{type:t,className:Te("flex h-10 w-full rounded-md border border-input bg-background px-3 py-2 text-base ring-offset-background file:border-0 file:bg-transparent file:text-sm file:font-medium file:text-foreground placeholder:text-muted-foreground focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-ring focus-visible:ring-offset-2 disabled:cursor-not-allowed disabled:opacity-50 md:text-sm",e),ref:r,...n}));at.displayName="Input";function HU({deck:e,services:t,credentials:n=[],playbooks:r=[],collectionWarnings:a,onDrop:i,onDragStart:s,onCredentialDragStart:o,onPlaybookDragStart:l,onDragEnd:u,onCardClick:d,onPlaybookClick:f,onCredentialClick:m}){const[h,y]=x.useState(!1),[p,b]=x.useState(e.name),g=x.useRef(null),v=cn(),{toast:w}=nn();x.useEffect(()=>{b(e.name),y(!1)},[e.id,e.name]),x.useEffect(()=>{var R,$;h&&((R=g.current)==null||R.focus(),($=g.current)==null||$.select())},[h]);const S=St({mutationFn:async R=>(await ke("PUT",`/api/decks/${e.id}`,{name:R})).json(),onSuccess:R=>{if(!R.success)throw new Error(R.error||"Rename failed");v.invalidateQueries({queryKey:["/api/decks"]}),y(!1)},onError:R=>{b(e.name),y(!1),w({title:"Could not rename deck",description:R.message,variant:"destructive"})}}),E=()=>{const R=p.trim();if(!R||R===e.name){b(e.name),y(!1);return}S.mutate(R)},C=R=>{R.preventDefault(),i(R)},T=R=>{R.preventDefault()},P=t.length+n.length+r.length;return c.jsxs("div",{className:"flex h-full min-w-0 flex-col overflow-hidden",children:[c.jsxs("h3",{className:"mb-4 flex min-w-0 shrink-0 items-center text-lg font-bold",children:[c.jsx("i",{className:"fas fa-layer-group mr-2 text-blue-400"}),"Deck",h?c.jsx(at,{ref:g,value:p,disabled:S.isPending,onChange:R=>b(R.target.value),onBlur:E,onKeyDown:R=>{R.key==="Enter"?(R.preventDefault(),E()):R.key==="Escape"&&(R.preventDefault(),b(e.name),y(!1))},className:"ml-2 h-7 max-w-[12rem] border-white/20 bg-white/10 px-2 text-sm font-normal text-white sm:max-w-[16rem]","data-testid":"input-deck-name","aria-label":"Deck name"}):c.jsx("button",{type:"button",className:"ml-2 min-w-0 truncate text-left text-sm font-normal text-gray-400 hover:text-white hover:underline",title:"Click to rename",onClick:()=>y(!0),"data-testid":"button-rename-deck",children:e.name}),c.jsxs("span",{className:"ml-2 shrink-0 text-sm font-normal text-gray-400",children:["(",P," cards)"]})]}),c.jsx("div",{className:"relative flex min-h-0 flex-1 items-center justify-center overflow-hidden rounded-xl border-2 border-dashed px-4 py-2 min-w-0",onDrop:C,onDragOver:T,style:{background:"linear-gradient(135deg, rgba(196, 182, 67, 0.1), rgba(212, 199, 96, 0.1))",borderColor:"rgba(196, 182, 67, 0.3)"},"data-testid":"deck-drop-zone",children:c.jsx("div",{className:"relative flex min-h-0 flex-1 items-center justify-center overflow-hidden min-w-0",children:P===0?c.jsx("div",{className:"flex items-center justify-center",style:{minHeight:Ov},children:c.jsx("div",{className:"flex items-center justify-center rounded-lg border-2 border-dashed border-gray-500 opacity-50 transition-opacity hover:opacity-75",style:{width:Gu,height:sA},"data-testid":"deck-empty-placeholder",children:c.jsx(qs,{className:"h-8 w-8 text-gray-500"})})}):c.jsxs(qU,{cardCount:P,children:[n.map((R,$)=>c.jsxs("div",{className:"w-32 h-48 aspect-[2/3] rounded-lg border-2 p-3 transition-shadow duration-500 shadow-lg hover:shadow-2xl bg-gradient-to-b from-gray-900 via-gray-800 to-gray-900 relative overflow-hidden cursor-pointer",style:{borderColor:Qn,boxShadow:`0 0 20px ${Qn}20`},draggable:!0,onDragStart:j=>o(j,R,!0),onDragEnd:u,onClick:()=>m==null?void 0:m(R),"data-testid":`deck-card-${R.id}`,children:[c.jsx(xl,{warnings:a==null?void 0:a.credentialWarnings.get(R.id)}),c.jsx("div",{className:"absolute top-1 left-1 text-xs font-bold",children:c.jsx("div",{className:"leading-none",style:{color:Qn},children:"AK"})}),c.jsx("div",{className:"absolute bottom-1 right-1 text-xs font-bold rotate-180",children:c.jsx("div",{className:"leading-none",style:{color:Qn},children:"AK"})}),c.jsxs("div",{className:"absolute inset-x-2 top-6 bottom-8 flex flex-col items-center justify-center text-center",children:[c.jsx("div",{className:"mb-2",style:{color:Qn},children:c.jsx(iA,{credential:R,color:Qn})}),c.jsx("h3",{className:"font-bold text-xs mb-1 line-clamp-2",style:{color:Qn},children:R.label}),c.jsx("div",{className:"text-[8px] px-1 py-0.5 rounded border opacity-70",style:{color:Qn,borderColor:Qn},children:R.hasSecret?"API Key":"Missing key"})]})]},R.id)),r.map((R,$)=>c.jsxs("div",{className:"w-32 h-48 aspect-[2/3] rounded-lg border-2 p-3 transition-shadow duration-500 shadow-lg hover:shadow-2xl bg-gradient-to-b from-gray-900 via-gray-800 to-gray-900 relative overflow-hidden cursor-pointer",style:{borderColor:Gr,boxShadow:`0 0 20px ${Gr}20`},draggable:!0,onDragStart:j=>l(j,R,!0),onDragEnd:u,onClick:()=>f==null?void 0:f(R),"data-testid":`deck-card-${R.id}`,children:[c.jsx(xl,{warnings:a==null?void 0:a.playbookWarnings.get(R.id)}),c.jsx("div",{className:"absolute top-1 left-1 text-xs font-bold",children:c.jsx("div",{className:"leading-none",style:{color:Gr},children:"PB"})}),c.jsx("div",{className:"absolute bottom-1 right-1 text-xs font-bold rotate-180",children:c.jsx("div",{className:"leading-none",style:{color:Gr},children:"PB"})}),c.jsxs("div",{className:"absolute inset-x-2 top-6 bottom-8 flex flex-col items-center justify-center text-center",children:[c.jsx("div",{className:"mb-2",style:{color:Gr},children:c.jsx(Zb,{className:"h-7 w-7",strokeWidth:2.25})}),c.jsx("h3",{className:"font-bold text-xs mb-1 line-clamp-2",style:{color:Gr},children:R.title}),c.jsx("div",{className:"text-[8px] px-1 py-0.5 rounded border opacity-70",style:{color:Gr,borderColor:Gr},children:"Playbook"})]})]},R.id)),t.map(R=>c.jsxs("div",{className:"w-32 h-48 aspect-[2/3] rounded-lg border-2 p-3 transition-shadow duration-500 shadow-lg hover:shadow-2xl bg-gradient-to-b from-gray-900 via-gray-800 to-gray-900 relative overflow-hidden cursor-pointer",style:{borderColor:oa(),boxShadow:`0 0 20px ${oa()}20`},draggable:!0,onDragStart:$=>s($,R,!0),onDragEnd:u,onClick:()=>d==null?void 0:d(R),"data-testid":`deck-card-${R.id}`,children:[c.jsx(xl,{warnings:a==null?void 0:a.serviceWarnings.get(R.id)}),c.jsx("div",{className:"absolute top-1 left-1 text-xs font-bold",children:c.jsx("div",{className:"leading-none",style:{color:oa()},children:R.type==="mcp"?"RM":R.type==="local-mcp"?"LM":"A"})}),c.jsx("div",{className:"absolute bottom-1 right-1 text-xs font-bold rotate-180",children:c.jsx("div",{className:"leading-none",style:{color:oa()},children:R.type==="mcp"?"RM":R.type==="local-mcp"?"LM":"A"})}),c.jsxs("div",{className:"absolute inset-x-2 top-6 bottom-8 flex flex-col items-center justify-center text-center",children:[c.jsx("div",{className:"mb-2",style:{color:oa()},children:c.jsx(aA,{service:R})}),c.jsx("h3",{className:"font-bold text-xs mb-1 line-clamp-2",style:{color:oa()},children:R.name}),c.jsx("div",{className:"text-[8px] px-1 py-0.5 rounded border opacity-70",style:{color:oa(),borderColor:oa()},children:R.type==="mcp"?"Remote MCP":R.type==="local-mcp"?"Local MCP":"A2A"})]})]},R.id))]})})})]})}var Ng=0;function ux(){x.useEffect(()=>{const e=document.querySelectorAll("[data-radix-focus-guard]");return document.body.insertAdjacentElement("afterbegin",e[0]??P_()),document.body.insertAdjacentElement("beforeend",e[1]??P_()),Ng++,()=>{Ng===1&&document.querySelectorAll("[data-radix-focus-guard]").forEach(t=>t.remove()),Ng--}},[])}function P_(){const e=document.createElement("span");return e.setAttribute("data-radix-focus-guard",""),e.tabIndex=0,e.style.outline="none",e.style.opacity="0",e.style.position="fixed",e.style.pointerEvents="none",e}var jg="focusScope.autoFocusOnMount",Tg="focusScope.autoFocusOnUnmount",D_={bubbles:!1,cancelable:!0},BU="FocusScope",ip=x.forwardRef((e,t)=>{const{loop:n=!1,trapped:r=!1,onMountAutoFocus:a,onUnmountAutoFocus:i,...s}=e,[o,l]=x.useState(null),u=Lr(a),d=Lr(i),f=x.useRef(null),m=lt(t,p=>l(p)),h=x.useRef({paused:!1,pause(){this.paused=!0},resume(){this.paused=!1}}).current;x.useEffect(()=>{if(r){let p=function(w){if(h.paused||!o)return;const S=w.target;o.contains(S)?f.current=S:Ei(f.current,{select:!0})},b=function(w){if(h.paused||!o)return;const S=w.relatedTarget;S!==null&&(o.contains(S)||Ei(f.current,{select:!0}))},g=function(w){if(document.activeElement===document.body)for(const E of w)E.removedNodes.length>0&&Ei(o)};document.addEventListener("focusin",p),document.addEventListener("focusout",b);const v=new MutationObserver(g);return o&&v.observe(o,{childList:!0,subtree:!0}),()=>{document.removeEventListener("focusin",p),document.removeEventListener("focusout",b),v.disconnect()}}},[r,o,h.paused]),x.useEffect(()=>{if(o){I_.add(h);const p=document.activeElement;if(!o.contains(p)){const g=new CustomEvent(jg,D_);o.addEventListener(jg,u),o.dispatchEvent(g),g.defaultPrevented||(VU(YU(uA(o)),{select:!0}),document.activeElement===p&&Ei(o))}return()=>{o.removeEventListener(jg,u),setTimeout(()=>{const g=new CustomEvent(Tg,D_);o.addEventListener(Tg,d),o.dispatchEvent(g),g.defaultPrevented||Ei(p??document.body,{select:!0}),o.removeEventListener(Tg,d),I_.remove(h)},0)}}},[o,u,d,h]);const y=x.useCallback(p=>{if(!n&&!r||h.paused)return;const b=p.key==="Tab"&&!p.altKey&&!p.ctrlKey&&!p.metaKey,g=document.activeElement;if(b&&g){const v=p.currentTarget,[w,S]=KU(v);w&&S?!p.shiftKey&&g===S?(p.preventDefault(),n&&Ei(w,{select:!0})):p.shiftKey&&g===w&&(p.preventDefault(),n&&Ei(S,{select:!0})):g===v&&p.preventDefault()}},[n,r,h.paused]);return c.jsx(De.div,{tabIndex:-1,...s,ref:m,onKeyDown:y})});ip.displayName=BU;function VU(e,{select:t=!1}={}){const n=document.activeElement;for(const r of e)if(Ei(r,{select:t}),document.activeElement!==n)return}function KU(e){const t=uA(e),n=z_(t,e),r=z_(t.reverse(),e);return[n,r]}function uA(e){const t=[],n=document.createTreeWalker(e,NodeFilter.SHOW_ELEMENT,{acceptNode:r=>{const a=r.tagName==="INPUT"&&r.type==="hidden";return r.disabled||r.hidden||a?NodeFilter.FILTER_SKIP:r.tabIndex>=0?NodeFilter.FILTER_ACCEPT:NodeFilter.FILTER_SKIP}});for(;n.nextNode();)t.push(n.currentNode);return t}function z_(e,t){for(const n of e)if(!ZU(n,{upTo:t}))return n}function ZU(e,{upTo:t}){if(getComputedStyle(e).visibility==="hidden")return!0;for(;e;){if(t!==void 0&&e===t)return!1;if(getComputedStyle(e).display==="none")return!0;e=e.parentElement}return!1}function GU(e){return e instanceof HTMLInputElement&&"select"in e}function Ei(e,{select:t=!1}={}){if(e&&e.focus){const n=document.activeElement;e.focus({preventScroll:!0}),e!==n&&GU(e)&&t&&e.select()}}var I_=QU();function QU(){let e=[];return{add(t){const n=e[0];t!==n&&(n==null||n.pause()),e=L_(e,t),e.unshift(t)},remove(t){var n;e=L_(e,t),(n=e[0])==null||n.resume()}}}function L_(e,t){const n=[...e],r=n.indexOf(t);return r!==-1&&n.splice(r,1),n}function YU(e){return e.filter(t=>t.tagName!=="A")}var XU=function(e){if(typeof document>"u")return null;var t=Array.isArray(e)?e[0]:e;return t.ownerDocument.body},Oo=new WeakMap,ff=new WeakMap,hf={},Ag=0,dA=function(e){return e&&(e.host||dA(e.parentNode))},WU=function(e,t){return t.map(function(n){if(e.contains(n))return n;var r=dA(n);return r&&e.contains(r)?r:(console.error("aria-hidden",n,"in not contained inside",e,". Doing nothing"),null)}).filter(function(n){return!!n})},JU=function(e,t,n,r){var a=WU(t,Array.isArray(e)?e:[e]);hf[n]||(hf[n]=new WeakMap);var i=hf[n],s=[],o=new Set,l=new Set(a),u=function(f){!f||o.has(f)||(o.add(f),u(f.parentNode))};a.forEach(u);var d=function(f){!f||l.has(f)||Array.prototype.forEach.call(f.children,function(m){if(o.has(m))d(m);else try{var h=m.getAttribute(r),y=h!==null&&h!=="false",p=(Oo.get(m)||0)+1,b=(i.get(m)||0)+1;Oo.set(m,p),i.set(m,b),s.push(m),p===1&&y&&ff.set(m,!0),b===1&&m.setAttribute(n,"true"),y||m.setAttribute(r,"true")}catch(g){console.error("aria-hidden: cannot operate on ",m,g)}})};return d(t),o.clear(),Ag++,function(){s.forEach(function(f){var m=Oo.get(f)-1,h=i.get(f)-1;Oo.set(f,m),i.set(f,h),m||(ff.has(f)||f.removeAttribute(r),ff.delete(f)),h||f.removeAttribute(n)}),Ag--,Ag||(Oo=new WeakMap,Oo=new WeakMap,ff=new WeakMap,hf={})}},dx=function(e,t,n){n===void 0&&(n="data-aria-hidden");var r=Array.from(Array.isArray(e)?e:[e]),a=XU(e);return a?(r.push.apply(r,Array.from(a.querySelectorAll("[aria-live], script"))),JU(r,a,n,"aria-hidden")):function(){return null}},pa=function(){return pa=Object.assign||function(t){for(var n,r=1,a=arguments.length;r<a;r++){n=arguments[r];for(var i in n)Object.prototype.hasOwnProperty.call(n,i)&&(t[i]=n[i])}return t},pa.apply(this,arguments)};function fA(e,t){var n={};for(var r in e)Object.prototype.hasOwnProperty.call(e,r)&&t.indexOf(r)<0&&(n[r]=e[r]);if(e!=null&&typeof Object.getOwnPropertySymbols=="function")for(var a=0,r=Object.getOwnPropertySymbols(e);a<r.length;a++)t.indexOf(r[a])<0&&Object.prototype.propertyIsEnumerable.call(e,r[a])&&(n[r[a]]=e[r[a]]);return n}function e6(e,t,n){if(n||arguments.length===2)for(var r=0,a=t.length,i;r<a;r++)(i||!(r in t))&&(i||(i=Array.prototype.slice.call(t,0,r)),i[r]=t[r]);return e.concat(i||Array.prototype.slice.call(t))}var Wf="right-scroll-bar-position",Jf="width-before-scroll-bar",t6="with-scroll-bars-hidden",n6="--removed-body-scroll-bar-size";function Rg(e,t){return typeof e=="function"?e(t):e&&(e.current=t),e}function r6(e,t){var n=x.useState(function(){return{value:e,callback:t,facade:{get current(){return n.value},set current(r){var a=n.value;a!==r&&(n.value=r,n.callback(r,a))}}}})[0];return n.callback=t,n.facade}var a6=typeof window<"u"?x.useLayoutEffect:x.useEffect,U_=new WeakMap;function i6(e,t){var n=r6(null,function(r){return e.forEach(function(a){return Rg(a,r)})});return a6(function(){var r=U_.get(n);if(r){var a=new Set(r),i=new Set(e),s=n.current;a.forEach(function(o){i.has(o)||Rg(o,null)}),i.forEach(function(o){a.has(o)||Rg(o,s)})}U_.set(n,e)},[e]),n}function s6(e){return e}function o6(e,t){t===void 0&&(t=s6);var n=[],r=!1,a={read:function(){if(r)throw new Error("Sidecar: could not `read` from an `assigned` medium. `read` could be used only with `useMedium`.");return n.length?n[n.length-1]:e},useMedium:function(i){var s=t(i,r);return n.push(s),function(){n=n.filter(function(o){return o!==s})}},assignSyncMedium:function(i){for(r=!0;n.length;){var s=n;n=[],s.forEach(i)}n={push:function(o){return i(o)},filter:function(){return n}}},assignMedium:function(i){r=!0;var s=[];if(n.length){var o=n;n=[],o.forEach(i),s=n}var l=function(){var d=s;s=[],d.forEach(i)},u=function(){return Promise.resolve().then(l)};u(),n={push:function(d){s.push(d),u()},filter:function(d){return s=s.filter(d),n}}}};return a}function l6(e){e===void 0&&(e={});var t=o6(null);return t.options=pa({async:!0,ssr:!1},e),t}var hA=function(e){var t=e.sideCar,n=fA(e,["sideCar"]);if(!t)throw new Error("Sidecar: please provide `sideCar` property to import the right car");var r=t.read();if(!r)throw new Error("Sidecar medium not found");return x.createElement(r,pa({},n))};hA.isSideCarExport=!0;function c6(e,t){return e.useMedium(t),hA}var mA=l6(),$g=function(){},sp=x.forwardRef(function(e,t){var n=x.useRef(null),r=x.useState({onScrollCapture:$g,onWheelCapture:$g,onTouchMoveCapture:$g}),a=r[0],i=r[1],s=e.forwardProps,o=e.children,l=e.className,u=e.removeScrollBar,d=e.enabled,f=e.shards,m=e.sideCar,h=e.noRelative,y=e.noIsolation,p=e.inert,b=e.allowPinchZoom,g=e.as,v=g===void 0?"div":g,w=e.gapMode,S=fA(e,["forwardProps","children","className","removeScrollBar","enabled","shards","sideCar","noRelative","noIsolation","inert","allowPinchZoom","as","gapMode"]),E=m,C=i6([n,t]),T=pa(pa({},S),a);return x.createElement(x.Fragment,null,d&&x.createElement(E,{sideCar:mA,removeScrollBar:u,shards:f,noRelative:h,noIsolation:y,inert:p,setCallbacks:i,allowPinchZoom:!!b,lockRef:n,gapMode:w}),s?x.cloneElement(x.Children.only(o),pa(pa({},T),{ref:C})):x.createElement(v,pa({},T,{className:l,ref:C}),o))});sp.defaultProps={enabled:!0,removeScrollBar:!0,inert:!1};sp.classNames={fullWidth:Jf,zeroRight:Wf};var u6=function(){if(typeof __webpack_nonce__<"u")return __webpack_nonce__};function d6(){if(!document)return null;var e=document.createElement("style");e.type="text/css";var t=u6();return t&&e.setAttribute("nonce",t),e}function f6(e,t){e.styleSheet?e.styleSheet.cssText=t:e.appendChild(document.createTextNode(t))}function h6(e){var t=document.head||document.getElementsByTagName("head")[0];t.appendChild(e)}var m6=function(){var e=0,t=null;return{add:function(n){e==0&&(t=d6())&&(f6(t,n),h6(t)),e++},remove:function(){e--,!e&&t&&(t.parentNode&&t.parentNode.removeChild(t),t=null)}}},p6=function(){var e=m6();return function(t,n){x.useEffect(function(){return e.add(t),function(){e.remove()}},[t&&n])}},pA=function(){var e=p6(),t=function(n){var r=n.styles,a=n.dynamic;return e(r,a),null};return t},g6={left:0,top:0,right:0,gap:0},Og=function(e){return parseInt(e||"",10)||0},y6=function(e){var t=window.getComputedStyle(document.body),n=t[e==="padding"?"paddingLeft":"marginLeft"],r=t[e==="padding"?"paddingTop":"marginTop"],a=t[e==="padding"?"paddingRight":"marginRight"];return[Og(n),Og(r),Og(a)]},v6=function(e){if(e===void 0&&(e="margin"),typeof window>"u")return g6;var t=y6(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])}},b6=pA(),wl="data-scroll-locked",x6=function(e,t,n,r){var a=e.left,i=e.top,s=e.right,o=e.gap;return n===void 0&&(n="margin"),`
294
+ .`.concat(t6,` {
295
+ overflow: hidden `).concat(r,`;
296
+ padding-right: `).concat(o,"px ").concat(r,`;
297
+ }
298
+ body[`).concat(wl,`] {
299
+ overflow: hidden `).concat(r,`;
300
+ overscroll-behavior: contain;
301
+ `).concat([t&&"position: relative ".concat(r,";"),n==="margin"&&`
302
+ padding-left: `.concat(a,`px;
303
+ padding-top: `).concat(i,`px;
304
+ padding-right: `).concat(s,`px;
305
+ margin-left:0;
306
+ margin-top:0;
307
+ margin-right: `).concat(o,"px ").concat(r,`;
308
+ `),n==="padding"&&"padding-right: ".concat(o,"px ").concat(r,";")].filter(Boolean).join(""),`
309
+ }
310
+
311
+ .`).concat(Wf,` {
312
+ right: `).concat(o,"px ").concat(r,`;
313
+ }
314
+
315
+ .`).concat(Jf,` {
316
+ margin-right: `).concat(o,"px ").concat(r,`;
317
+ }
318
+
319
+ .`).concat(Wf," .").concat(Wf,` {
320
+ right: 0 `).concat(r,`;
321
+ }
322
+
323
+ .`).concat(Jf," .").concat(Jf,` {
324
+ margin-right: 0 `).concat(r,`;
325
+ }
326
+
327
+ body[`).concat(wl,`] {
328
+ `).concat(n6,": ").concat(o,`px;
329
+ }
330
+ `)},F_=function(){var e=parseInt(document.body.getAttribute(wl)||"0",10);return isFinite(e)?e:0},w6=function(){x.useEffect(function(){return document.body.setAttribute(wl,(F_()+1).toString()),function(){var e=F_()-1;e<=0?document.body.removeAttribute(wl):document.body.setAttribute(wl,e.toString())}},[])},S6=function(e){var t=e.noRelative,n=e.noImportant,r=e.gapMode,a=r===void 0?"margin":r;w6();var i=x.useMemo(function(){return v6(a)},[a]);return x.createElement(b6,{styles:x6(i,!t,a,n?"":"!important")})},Mv=!1;if(typeof window<"u")try{var mf=Object.defineProperty({},"passive",{get:function(){return Mv=!0,!0}});window.addEventListener("test",mf,mf),window.removeEventListener("test",mf,mf)}catch{Mv=!1}var Mo=Mv?{passive:!1}:!1,_6=function(e){return e.tagName==="TEXTAREA"},gA=function(e,t){if(!(e instanceof Element))return!1;var n=window.getComputedStyle(e);return n[t]!=="hidden"&&!(n.overflowY===n.overflowX&&!_6(e)&&n[t]==="visible")},k6=function(e){return gA(e,"overflowY")},E6=function(e){return gA(e,"overflowX")},q_=function(e,t){var n=t.ownerDocument,r=t;do{typeof ShadowRoot<"u"&&r instanceof ShadowRoot&&(r=r.host);var a=yA(e,r);if(a){var i=vA(e,r),s=i[1],o=i[2];if(s>o)return!0}r=r.parentNode}while(r&&r!==n.body);return!1},C6=function(e){var t=e.scrollTop,n=e.scrollHeight,r=e.clientHeight;return[t,n,r]},N6=function(e){var t=e.scrollLeft,n=e.scrollWidth,r=e.clientWidth;return[t,n,r]},yA=function(e,t){return e==="v"?k6(t):E6(t)},vA=function(e,t){return e==="v"?C6(t):N6(t)},j6=function(e,t){return e==="h"&&t==="rtl"?-1:1},T6=function(e,t,n,r,a){var i=j6(e,window.getComputedStyle(t).direction),s=i*r,o=n.target,l=t.contains(o),u=!1,d=s>0,f=0,m=0;do{if(!o)break;var h=vA(e,o),y=h[0],p=h[1],b=h[2],g=p-b-i*y;(y||g)&&yA(e,o)&&(f+=g,m+=y);var v=o.parentNode;o=v&&v.nodeType===Node.DOCUMENT_FRAGMENT_NODE?v.host:v}while(!l&&o!==document.body||l&&(t.contains(o)||t===o));return(d&&Math.abs(f)<1||!d&&Math.abs(m)<1)&&(u=!0),u},pf=function(e){return"changedTouches"in e?[e.changedTouches[0].clientX,e.changedTouches[0].clientY]:[0,0]},H_=function(e){return[e.deltaX,e.deltaY]},B_=function(e){return e&&"current"in e?e.current:e},A6=function(e,t){return e[0]===t[0]&&e[1]===t[1]},R6=function(e){return`
331
+ .block-interactivity-`.concat(e,` {pointer-events: none;}
332
+ .allow-interactivity-`).concat(e,` {pointer-events: all;}
333
+ `)},$6=0,Po=[];function O6(e){var t=x.useRef([]),n=x.useRef([0,0]),r=x.useRef(),a=x.useState($6++)[0],i=x.useState(pA)[0],s=x.useRef(e);x.useEffect(function(){s.current=e},[e]),x.useEffect(function(){if(e.inert){document.body.classList.add("block-interactivity-".concat(a));var p=e6([e.lockRef.current],(e.shards||[]).map(B_),!0).filter(Boolean);return p.forEach(function(b){return b.classList.add("allow-interactivity-".concat(a))}),function(){document.body.classList.remove("block-interactivity-".concat(a)),p.forEach(function(b){return b.classList.remove("allow-interactivity-".concat(a))})}}},[e.inert,e.lockRef.current,e.shards]);var o=x.useCallback(function(p,b){if("touches"in p&&p.touches.length===2||p.type==="wheel"&&p.ctrlKey)return!s.current.allowPinchZoom;var g=pf(p),v=n.current,w="deltaX"in p?p.deltaX:v[0]-g[0],S="deltaY"in p?p.deltaY:v[1]-g[1],E,C=p.target,T=Math.abs(w)>Math.abs(S)?"h":"v";if("touches"in p&&T==="h"&&C.type==="range")return!1;var P=q_(T,C);if(!P)return!0;if(P?E=T:(E=T==="v"?"h":"v",P=q_(T,C)),!P)return!1;if(!r.current&&"changedTouches"in p&&(w||S)&&(r.current=E),!E)return!0;var R=r.current||E;return T6(R,b,p,R==="h"?w:S)},[]),l=x.useCallback(function(p){var b=p;if(!(!Po.length||Po[Po.length-1]!==i)){var g="deltaY"in b?H_(b):pf(b),v=t.current.filter(function(E){return E.name===b.type&&(E.target===b.target||b.target===E.shadowParent)&&A6(E.delta,g)})[0];if(v&&v.should){b.cancelable&&b.preventDefault();return}if(!v){var w=(s.current.shards||[]).map(B_).filter(Boolean).filter(function(E){return E.contains(b.target)}),S=w.length>0?o(b,w[0]):!s.current.noIsolation;S&&b.cancelable&&b.preventDefault()}}},[]),u=x.useCallback(function(p,b,g,v){var w={name:p,delta:b,target:g,should:v,shadowParent:M6(g)};t.current.push(w),setTimeout(function(){t.current=t.current.filter(function(S){return S!==w})},1)},[]),d=x.useCallback(function(p){n.current=pf(p),r.current=void 0},[]),f=x.useCallback(function(p){u(p.type,H_(p),p.target,o(p,e.lockRef.current))},[]),m=x.useCallback(function(p){u(p.type,pf(p),p.target,o(p,e.lockRef.current))},[]);x.useEffect(function(){return Po.push(i),e.setCallbacks({onScrollCapture:f,onWheelCapture:f,onTouchMoveCapture:m}),document.addEventListener("wheel",l,Mo),document.addEventListener("touchmove",l,Mo),document.addEventListener("touchstart",d,Mo),function(){Po=Po.filter(function(p){return p!==i}),document.removeEventListener("wheel",l,Mo),document.removeEventListener("touchmove",l,Mo),document.removeEventListener("touchstart",d,Mo)}},[]);var h=e.removeScrollBar,y=e.inert;return x.createElement(x.Fragment,null,y?x.createElement(i,{styles:R6(a)}):null,h?x.createElement(S6,{noRelative:e.noRelative,gapMode:e.gapMode}):null)}function M6(e){for(var t=null;e!==null;)e instanceof ShadowRoot&&(t=e.host,e=e.host),e=e.parentNode;return t}const P6=c6(mA,O6);var op=x.forwardRef(function(e,t){return x.createElement(sp,pa({},e,{ref:t,sideCar:P6}))});op.classNames=sp.classNames;var lp="Popover",[bA,pie]=fi(lp,[bc]),_d=bc(),[D6,vs]=bA(lp),xA=e=>{const{__scopePopover:t,children:n,open:r,defaultOpen:a,onOpenChange:i,modal:s=!1}=e,o=_d(t),l=x.useRef(null),[u,d]=x.useState(!1),[f,m]=ho({prop:r,defaultProp:a??!1,onChange:i,caller:lp});return c.jsx(QT,{...o,children:c.jsx(D6,{scope:t,contentId:ti(),triggerRef:l,open:f,onOpenChange:m,onOpenToggle:x.useCallback(()=>m(h=>!h),[m]),hasCustomAnchor:u,onCustomAnchorAdd:x.useCallback(()=>d(!0),[]),onCustomAnchorRemove:x.useCallback(()=>d(!1),[]),modal:s,children:n})})};xA.displayName=lp;var wA="PopoverAnchor",z6=x.forwardRef((e,t)=>{const{__scopePopover:n,...r}=e,a=vs(wA,n),i=_d(n),{onCustomAnchorAdd:s,onCustomAnchorRemove:o}=a;return x.useEffect(()=>(s(),()=>o()),[s,o]),c.jsx(np,{...i,...r,ref:t})});z6.displayName=wA;var SA="PopoverTrigger",_A=x.forwardRef((e,t)=>{const{__scopePopover:n,...r}=e,a=vs(SA,n),i=_d(n),s=lt(t,a.triggerRef),o=c.jsx(De.button,{type:"button","aria-haspopup":"dialog","aria-expanded":a.open,"aria-controls":a.contentId,"data-state":jA(a.open),...r,ref:s,onClick:xe(e.onClick,a.onOpenToggle)});return a.hasCustomAnchor?o:c.jsx(np,{asChild:!0,...i,children:o})});_A.displayName=SA;var fx="PopoverPortal",[I6,L6]=bA(fx,{forceMount:void 0}),kA=e=>{const{__scopePopover:t,forceMount:n,children:r,container:a}=e,i=vs(fx,t);return c.jsx(I6,{scope:t,forceMount:n,children:c.jsx(hi,{present:n||i.open,children:c.jsx(bd,{asChild:!0,container:a,children:r})})})};kA.displayName=fx;var ec="PopoverContent",EA=x.forwardRef((e,t)=>{const n=L6(ec,e.__scopePopover),{forceMount:r=n.forceMount,...a}=e,i=vs(ec,e.__scopePopover);return c.jsx(hi,{present:r||i.open,children:i.modal?c.jsx(F6,{...a,ref:t}):c.jsx(q6,{...a,ref:t})})});EA.displayName=ec;var U6=fo("PopoverContent.RemoveScroll"),F6=x.forwardRef((e,t)=>{const n=vs(ec,e.__scopePopover),r=x.useRef(null),a=lt(t,r),i=x.useRef(!1);return x.useEffect(()=>{const s=r.current;if(s)return dx(s)},[]),c.jsx(op,{as:U6,allowPinchZoom:!0,children:c.jsx(CA,{...e,ref:a,trapFocus:n.open,disableOutsidePointerEvents:!0,onCloseAutoFocus:xe(e.onCloseAutoFocus,s=>{var o;s.preventDefault(),i.current||(o=n.triggerRef.current)==null||o.focus()}),onPointerDownOutside:xe(e.onPointerDownOutside,s=>{const o=s.detail.originalEvent,l=o.button===0&&o.ctrlKey===!0,u=o.button===2||l;i.current=u},{checkForDefaultPrevented:!1}),onFocusOutside:xe(e.onFocusOutside,s=>s.preventDefault(),{checkForDefaultPrevented:!1})})})}),q6=x.forwardRef((e,t)=>{const n=vs(ec,e.__scopePopover),r=x.useRef(!1),a=x.useRef(!1);return c.jsx(CA,{...e,ref:t,trapFocus:!1,disableOutsidePointerEvents:!1,onCloseAutoFocus:i=>{var s,o;(s=e.onCloseAutoFocus)==null||s.call(e,i),i.defaultPrevented||(r.current||(o=n.triggerRef.current)==null||o.focus(),i.preventDefault()),r.current=!1,a.current=!1},onInteractOutside:i=>{var l,u;(l=e.onInteractOutside)==null||l.call(e,i),i.defaultPrevented||(r.current=!0,i.detail.originalEvent.type==="pointerdown"&&(a.current=!0));const s=i.target;((u=n.triggerRef.current)==null?void 0:u.contains(s))&&i.preventDefault(),i.detail.originalEvent.type==="focusin"&&a.current&&i.preventDefault()}})}),CA=x.forwardRef((e,t)=>{const{__scopePopover:n,trapFocus:r,onOpenAutoFocus:a,onCloseAutoFocus:i,disableOutsidePointerEvents:s,onEscapeKeyDown:o,onPointerDownOutside:l,onFocusOutside:u,onInteractOutside:d,...f}=e,m=vs(ec,n),h=_d(n);return ux(),c.jsx(ip,{asChild:!0,loop:!0,trapped:r,onMountAutoFocus:a,onUnmountAutoFocus:i,children:c.jsx(pc,{asChild:!0,disableOutsidePointerEvents:s,onInteractOutside:d,onEscapeKeyDown:o,onPointerDownOutside:l,onFocusOutside:u,onDismiss:()=>m.onOpenChange(!1),children:c.jsx(ix,{"data-state":jA(m.open),role:"dialog",id:m.contentId,...h,...f,ref:t,style:{...f.style,"--radix-popover-content-transform-origin":"var(--radix-popper-transform-origin)","--radix-popover-content-available-width":"var(--radix-popper-available-width)","--radix-popover-content-available-height":"var(--radix-popper-available-height)","--radix-popover-trigger-width":"var(--radix-popper-anchor-width)","--radix-popover-trigger-height":"var(--radix-popper-anchor-height)"}})})})}),NA="PopoverClose",H6=x.forwardRef((e,t)=>{const{__scopePopover:n,...r}=e,a=vs(NA,n);return c.jsx(De.button,{type:"button",...r,ref:t,onClick:xe(e.onClick,()=>a.onOpenChange(!1))})});H6.displayName=NA;var B6="PopoverArrow",V6=x.forwardRef((e,t)=>{const{__scopePopover:n,...r}=e,a=_d(n);return c.jsx(sx,{...a,...r,ref:t})});V6.displayName=B6;function jA(e){return e?"open":"closed"}var K6=xA,Z6=_A,G6=kA,TA=EA;const Q6=K6,Y6=Z6,AA=x.forwardRef(({className:e,align:t="center",sideOffset:n=4,...r},a)=>c.jsx(G6,{children:c.jsx(TA,{ref:a,align:t,sideOffset:n,className:Te("z-50 w-72 rounded-md border bg-popover p-4 text-popover-foreground shadow-md outline-none data-[state=open]:animate-in data-[state=closed]:animate-out data-[state=closed]:fade-out-0 data-[state=open]:fade-in-0 data-[state=closed]:zoom-out-95 data-[state=open]:zoom-in-95 data-[side=bottom]:slide-in-from-top-2 data-[side=left]:slide-in-from-right-2 data-[side=right]:slide-in-from-left-2 data-[side=top]:slide-in-from-bottom-2 origin-[--radix-popover-content-transform-origin]",e),...r})}));AA.displayName=TA.displayName;function X6(e,t){const n=new Date(e).getTime();if(Number.isNaN(n))return"";const r=Math.max(0,Math.floor((t.getTime()-n)/1e3));if(r<60)return`${r}s`;const a=Math.floor(r/60);if(a<60)return`${a}m`;const i=Math.floor(a/60);return i<24?`${i}h`:`${Math.floor(i/24)}d`}function RA(e,t=24){return e.length>t?`${e.slice(0,t-1)}…`:e}function W6(e){const t=e.replace(/\/+$/,""),n=t.lastIndexOf("/");return n>=0?t.slice(n+1):t}function J6(e){const t=new Map;for(const n of e)t.set(n.deckId,(t.get(n.deckId)??0)+1);return t}function e9(e,t){const n=e>0?`${e} cards`:"Empty";if(t<=0)return n;const r=t===1?"1 session":`${t} sessions`;return`${n}, ${r}`}function t9(e){return e==="agent-admin"?"admin":e==="normal"?"normal":"unknown"}function n9(e){return e==="agent-admin"?"bg-amber-500/20 text-amber-200 ring-1 ring-amber-400/40":e==="normal"?"bg-white/10 text-gray-300 ring-1 ring-white/10":"bg-white/10 text-gray-300"}function r9(e){const t=new Map,n=[],r=new Map;for(const i of e){if(i.workspaceRoot){const s=i.workspaceRoot,o=`${W6(i.workspaceRoot)}/`,l=t.get(s)??{label:o,rows:[],deckIds:new Set};l.rows.push(i),l.deckIds.add(i.deckId),t.set(s,l);continue}n.push(i)}for(const i of n){let s=!1;for(const d of t.values())if(d.deckIds.has(i.deckId)){d.rows.push(i),s=!0;break}if(s)continue;const o=`deck:${i.deckId}`,l=`◆ ${RA(i.deckName)}`,u=r.get(o)??{label:l,rows:[]};u.rows.push(i),r.set(o,u)}return[...[...t.entries()].map(([i,{label:s,rows:o}])=>({key:i,label:s,isWorkspaceGroup:!0,rows:[...o].sort((l,u)=>l.lastActivityAt<u.lastActivityAt?1:-1)})),...[...r.entries()].map(([i,{label:s,rows:o}])=>({key:i,label:s,isWorkspaceGroup:!1,rows:[...o].sort((l,u)=>l.lastActivityAt<u.lastActivityAt?1:-1)}))].sort((i,s)=>i.label.localeCompare(s.label))}function a9(e,t){const{isWorkspaceGroup:n,highlighted:r,clientMeta:a}=t;return!e.workspaceRoot&&n?`no folder · ${a}`:n&&r?a:n?`${RA(e.deckName)} · ${a}`:a}const i9="w-[min(22rem,calc(100vw-2rem))]";function s9({bindings:e,now:t=new Date,highlightDeckId:n,showContainmentNote:r=!1,scrollClassName:a="max-h-64 overflow-y-auto"}){const i=n?e.filter(o=>o.deckId===n).length:0,s=x.useMemo(()=>r9(e),[e]);return c.jsxs(c.Fragment,{children:[c.jsx("div",{className:"border-b border-white/10 px-3 py-2.5",children:c.jsxs("p",{className:"text-sm font-semibold leading-snug",style:{color:Pn},children:["Live sessions",c.jsx("span",{className:"ml-1 font-normal text-gray-400",children:"· match ⌘badge to chat opener"})]})}),r?c.jsx("div",{className:"border-b border-white/10 px-3 py-2 text-xs text-gray-400",children:c.jsxs("div",{className:"flex items-start gap-2",children:[c.jsx(XI,{className:"mt-0.5 h-3.5 w-3.5 shrink-0 text-gray-400","aria-hidden":!0}),c.jsxs("p",{children:["Agents are bound to one deck per workspace. Cross-deck service calls return"," ",c.jsx("span",{className:"font-mono text-gray-300",children:"RESOURCE_OUT_OF_SCOPE"}),"."]})]})}):null,n&&i>1?c.jsxs("div",{className:"border-b border-[#92E4DD]/20 bg-[#92E4DD]/5 px-3 py-1.5 text-xs text-gray-300",children:[i," sessions on this deck"]}):null,c.jsx("div",{className:Te(a,"p-2"),children:s.map(({key:o,label:l,isWorkspaceGroup:u,rows:d})=>c.jsxs("div",{className:"mb-2 last:mb-0",children:[c.jsx("p",{className:"px-1 pb-1 text-[10px] uppercase tracking-wide text-gray-500",children:l}),c.jsx("ul",{className:"space-y-1",children:d.map(f=>{const m=f.clientName??"agent",h=X6(f.lastActivityAt,t),y=h?`${m} · ${h}`:m,p=n===f.deckId,b=a9(f,{isWorkspaceGroup:u,highlighted:p,clientMeta:y});return c.jsxs("li",{className:Te("rounded-md border-l-2 py-1.5 pl-2 pr-2 font-mono text-xs",p?"border-[#92E4DD] bg-[#92E4DD]/5":"border-transparent bg-white/5"),"data-testid":`live-session-row-${f.badge}`,children:[c.jsxs("div",{className:"flex items-center justify-between gap-2",children:[c.jsxs("span",{style:{color:Pn},children:["⌘",f.badge]}),c.jsx("span",{className:Te("rounded px-1.5 py-0.5 font-sans text-[10px] uppercase tracking-wide",n9(f.mode)),children:t9(f.mode)})]}),c.jsx("span",{className:"mt-0.5 block font-sans text-[10px] text-gray-400",children:b})]},f.badge)})})]},o))})]})}function o9({highlightDeckId:e}){const{data:t}=wt({queryKey:["/api/scope/bindings"],refetchInterval:3e3}),n=(t==null?void 0:t.data)??[];if(n.length===0)return null;const r=e?n.filter(a=>a.deckId===e).length:0;return c.jsxs(Q6,{children:[c.jsx(Y6,{asChild:!0,children:c.jsxs(le,{type:"button",variant:"outline",size:"sm",className:"h-7 shrink-0 border-white/20 bg-black/30 px-2 text-xs text-gray-200 hover:bg-white/10 hover:text-white","data-testid":"live-session-badges-trigger",title:"Live MCP session binds — click for badges",children:[c.jsx(YI,{className:"mr-1 h-3 w-3",style:{color:Pn},"aria-hidden":!0}),c.jsxs("span",{className:"font-mono",children:["⌘",n.length]}),r>0&&r<n.length?c.jsxs("span",{className:"ml-1 text-gray-400",children:["(",r," here)"]}):null]})}),c.jsx(AA,{align:"end",className:Te(i9,"border-white/10 bg-gray-950/95 p-0 text-gray-100"),"data-testid":"live-session-badges-panel",children:c.jsx(s9,{bindings:n,highlightDeckId:e})})]})}var cp="Dialog",[$A,gie]=fi(cp),[l9,aa]=$A(cp),OA=e=>{const{__scopeDialog:t,children:n,open:r,defaultOpen:a,onOpenChange:i,modal:s=!0}=e,o=x.useRef(null),l=x.useRef(null),[u,d]=ho({prop:r,defaultProp:a??!1,onChange:i,caller:cp});return c.jsx(l9,{scope:t,triggerRef:o,contentRef:l,contentId:ti(),titleId:ti(),descriptionId:ti(),open:u,onOpenChange:d,onOpenToggle:x.useCallback(()=>d(f=>!f),[d]),modal:s,children:n})};OA.displayName=cp;var MA="DialogTrigger",c9=x.forwardRef((e,t)=>{const{__scopeDialog:n,...r}=e,a=aa(MA,n),i=lt(t,a.triggerRef);return c.jsx(De.button,{type:"button","aria-haspopup":"dialog","aria-expanded":a.open,"aria-controls":a.contentId,"data-state":px(a.open),...r,ref:i,onClick:xe(e.onClick,a.onOpenToggle)})});c9.displayName=MA;var hx="DialogPortal",[u9,PA]=$A(hx,{forceMount:void 0}),DA=e=>{const{__scopeDialog:t,forceMount:n,children:r,container:a}=e,i=aa(hx,t);return c.jsx(u9,{scope:t,forceMount:n,children:x.Children.map(r,s=>c.jsx(hi,{present:n||i.open,children:c.jsx(bd,{asChild:!0,container:a,children:s})}))})};DA.displayName=hx;var Jh="DialogOverlay",zA=x.forwardRef((e,t)=>{const n=PA(Jh,e.__scopeDialog),{forceMount:r=n.forceMount,...a}=e,i=aa(Jh,e.__scopeDialog);return i.modal?c.jsx(hi,{present:r||i.open,children:c.jsx(f9,{...a,ref:t})}):null});zA.displayName=Jh;var d9=fo("DialogOverlay.RemoveScroll"),f9=x.forwardRef((e,t)=>{const{__scopeDialog:n,...r}=e,a=aa(Jh,n);return c.jsx(op,{as:d9,allowPinchZoom:!0,shards:[a.contentRef],children:c.jsx(De.div,{"data-state":px(a.open),...r,ref:t,style:{pointerEvents:"auto",...r.style}})})}),po="DialogContent",IA=x.forwardRef((e,t)=>{const n=PA(po,e.__scopeDialog),{forceMount:r=n.forceMount,...a}=e,i=aa(po,e.__scopeDialog);return c.jsx(hi,{present:r||i.open,children:i.modal?c.jsx(h9,{...a,ref:t}):c.jsx(m9,{...a,ref:t})})});IA.displayName=po;var h9=x.forwardRef((e,t)=>{const n=aa(po,e.__scopeDialog),r=x.useRef(null),a=lt(t,n.contentRef,r);return x.useEffect(()=>{const i=r.current;if(i)return dx(i)},[]),c.jsx(LA,{...e,ref:a,trapFocus:n.open,disableOutsidePointerEvents:!0,onCloseAutoFocus:xe(e.onCloseAutoFocus,i=>{var s;i.preventDefault(),(s=n.triggerRef.current)==null||s.focus()}),onPointerDownOutside:xe(e.onPointerDownOutside,i=>{const s=i.detail.originalEvent,o=s.button===0&&s.ctrlKey===!0;(s.button===2||o)&&i.preventDefault()}),onFocusOutside:xe(e.onFocusOutside,i=>i.preventDefault())})}),m9=x.forwardRef((e,t)=>{const n=aa(po,e.__scopeDialog),r=x.useRef(!1),a=x.useRef(!1);return c.jsx(LA,{...e,ref:t,trapFocus:!1,disableOutsidePointerEvents:!1,onCloseAutoFocus:i=>{var s,o;(s=e.onCloseAutoFocus)==null||s.call(e,i),i.defaultPrevented||(r.current||(o=n.triggerRef.current)==null||o.focus(),i.preventDefault()),r.current=!1,a.current=!1},onInteractOutside:i=>{var l,u;(l=e.onInteractOutside)==null||l.call(e,i),i.defaultPrevented||(r.current=!0,i.detail.originalEvent.type==="pointerdown"&&(a.current=!0));const s=i.target;((u=n.triggerRef.current)==null?void 0:u.contains(s))&&i.preventDefault(),i.detail.originalEvent.type==="focusin"&&a.current&&i.preventDefault()}})}),LA=x.forwardRef((e,t)=>{const{__scopeDialog:n,trapFocus:r,onOpenAutoFocus:a,onCloseAutoFocus:i,...s}=e,o=aa(po,n),l=x.useRef(null),u=lt(t,l);return ux(),c.jsxs(c.Fragment,{children:[c.jsx(ip,{asChild:!0,loop:!0,trapped:r,onMountAutoFocus:a,onUnmountAutoFocus:i,children:c.jsx(pc,{role:"dialog",id:o.contentId,"aria-describedby":o.descriptionId,"aria-labelledby":o.titleId,"data-state":px(o.open),...s,ref:u,onDismiss:()=>o.onOpenChange(!1)})}),c.jsxs(c.Fragment,{children:[c.jsx(p9,{titleId:o.titleId}),c.jsx(y9,{contentRef:l,descriptionId:o.descriptionId})]})]})}),mx="DialogTitle",UA=x.forwardRef((e,t)=>{const{__scopeDialog:n,...r}=e,a=aa(mx,n);return c.jsx(De.h2,{id:a.titleId,...r,ref:t})});UA.displayName=mx;var FA="DialogDescription",qA=x.forwardRef((e,t)=>{const{__scopeDialog:n,...r}=e,a=aa(FA,n);return c.jsx(De.p,{id:a.descriptionId,...r,ref:t})});qA.displayName=FA;var HA="DialogClose",BA=x.forwardRef((e,t)=>{const{__scopeDialog:n,...r}=e,a=aa(HA,n);return c.jsx(De.button,{type:"button",...r,ref:t,onClick:xe(e.onClick,()=>a.onOpenChange(!1))})});BA.displayName=HA;function px(e){return e?"open":"closed"}var VA="DialogTitleWarning",[yie,KA]=G3(VA,{contentName:po,titleName:mx,docsSlug:"dialog"}),p9=({titleId:e})=>{const t=KA(VA),n=`\`${t.contentName}\` requires a \`${t.titleName}\` for the component to be accessible for screen reader users.
334
+
335
+ If you want to hide the \`${t.titleName}\`, you can wrap it with our VisuallyHidden component.
336
+
337
+ For more information, see https://radix-ui.com/primitives/docs/components/${t.docsSlug}`;return x.useEffect(()=>{e&&(document.getElementById(e)||console.error(n))},[n,e]),null},g9="DialogDescriptionWarning",y9=({contentRef:e,descriptionId:t})=>{const r=`Warning: Missing \`Description\` or \`aria-describedby={undefined}\` for {${KA(g9).contentName}}.`;return x.useEffect(()=>{var i;const a=(i=e.current)==null?void 0:i.getAttribute("aria-describedby");t&&a&&(document.getElementById(t)||console.warn(r))},[r,e,t]),null},v9=OA,b9=DA,ZA=zA,GA=IA,QA=UA,YA=qA,x9=BA;const bs=v9,w9=b9,XA=x.forwardRef(({className:e,...t},n)=>c.jsx(ZA,{ref:n,className:Te("fixed inset-0 z-50 bg-black/80 data-[state=open]:animate-in data-[state=closed]:animate-out data-[state=closed]:fade-out-0 data-[state=open]:fade-in-0",e),...t}));XA.displayName=ZA.displayName;const mi=x.forwardRef(({className:e,children:t,...n},r)=>c.jsxs(w9,{children:[c.jsx(XA,{}),c.jsxs(GA,{ref:r,className:Te("fixed left-[50%] top-[50%] z-50 grid w-full max-w-lg translate-x-[-50%] translate-y-[-50%] gap-4 border bg-background p-6 shadow-lg duration-200 data-[state=open]:animate-in data-[state=closed]:animate-out data-[state=closed]:fade-out-0 data-[state=open]:fade-in-0 data-[state=closed]:zoom-out-95 data-[state=open]:zoom-in-95 data-[state=closed]:slide-out-to-left-1/2 data-[state=closed]:slide-out-to-top-[48%] data-[state=open]:slide-in-from-left-1/2 data-[state=open]:slide-in-from-top-[48%] sm:rounded-lg",e),...n,children:[t,c.jsxs(x9,{className:"absolute right-4 top-4 rounded-sm opacity-70 ring-offset-background transition-opacity hover:opacity-100 focus:outline-none focus:ring-2 focus:ring-ring focus:ring-offset-2 disabled:pointer-events-none data-[state=open]:bg-accent data-[state=open]:text-muted-foreground",children:[c.jsx(Zh,{className:"h-4 w-4"}),c.jsx("span",{className:"sr-only",children:"Close"})]})]})]}));mi.displayName=GA.displayName;const pi=({className:e,...t})=>c.jsx("div",{className:Te("flex flex-col space-y-1.5 text-center sm:text-left",e),...t});pi.displayName="DialogHeader";const gi=x.forwardRef(({className:e,...t},n)=>c.jsx(QA,{ref:n,className:Te("text-lg font-semibold leading-none tracking-tight",e),...t}));gi.displayName=QA.displayName;const jo=x.forwardRef(({className:e,...t},n)=>c.jsx(YA,{ref:n,className:Te("text-sm text-muted-foreground",e),...t}));jo.displayName=YA.displayName;const Za=x.forwardRef(({className:e,...t},n)=>c.jsx("textarea",{className:Te("flex min-h-[80px] w-full rounded-md border border-input bg-background px-3 py-2 text-base ring-offset-background placeholder:text-muted-foreground focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-ring focus-visible:ring-offset-2 disabled:cursor-not-allowed disabled:opacity-50 md:text-sm",e),ref:n,...t}));Za.displayName="Textarea";var S9="Label",WA=x.forwardRef((e,t)=>c.jsx(De.label,{...e,ref:t,onMouseDown:n=>{var a;n.target.closest("button, input, select, textarea")||((a=e.onMouseDown)==null||a.call(e,n),!n.defaultPrevented&&n.detail>1&&n.preventDefault())}}));WA.displayName=S9;var JA=WA;const _9=Ym("text-sm font-medium leading-none peer-disabled:cursor-not-allowed peer-disabled:opacity-70"),Qe=x.forwardRef(({className:e,...t},n)=>c.jsx(JA,{ref:n,className:Te(_9(),e),...t}));Qe.displayName=JA.displayName;var k9=x.createContext(void 0);function gx(e){const t=x.useContext(k9);return e||t||"ltr"}var Mg="rovingFocusGroup.onEntryFocus",E9={bubbles:!1,cancelable:!0},kd="RovingFocusGroup",[Pv,eR,C9]=Hb(kd),[N9,tR]=fi(kd,[C9]),[j9,T9]=N9(kd),nR=x.forwardRef((e,t)=>c.jsx(Pv.Provider,{scope:e.__scopeRovingFocusGroup,children:c.jsx(Pv.Slot,{scope:e.__scopeRovingFocusGroup,children:c.jsx(A9,{...e,ref:t})})}));nR.displayName=kd;var A9=x.forwardRef((e,t)=>{const{__scopeRovingFocusGroup:n,orientation:r,loop:a=!1,dir:i,currentTabStopId:s,defaultCurrentTabStopId:o,onCurrentTabStopIdChange:l,onEntryFocus:u,preventScrollOnEntryFocus:d=!1,...f}=e,m=x.useRef(null),h=lt(t,m),y=gx(i),[p,b]=ho({prop:s,defaultProp:o??null,onChange:l,caller:kd}),[g,v]=x.useState(!1),w=Lr(u),S=eR(n),E=x.useRef(!1),[C,T]=x.useState(0);return x.useEffect(()=>{const P=m.current;if(P)return P.addEventListener(Mg,w),()=>P.removeEventListener(Mg,w)},[w]),c.jsx(j9,{scope:n,orientation:r,dir:y,loop:a,currentTabStopId:p,onItemFocus:x.useCallback(P=>b(P),[b]),onItemShiftTab:x.useCallback(()=>v(!0),[]),onFocusableItemAdd:x.useCallback(()=>T(P=>P+1),[]),onFocusableItemRemove:x.useCallback(()=>T(P=>P-1),[]),children:c.jsx(De.div,{tabIndex:g||C===0?-1:0,"data-orientation":r,...f,ref:h,style:{outline:"none",...e.style},onMouseDown:xe(e.onMouseDown,()=>{E.current=!0}),onFocus:xe(e.onFocus,P=>{const R=!E.current;if(P.target===P.currentTarget&&R&&!g){const $=new CustomEvent(Mg,E9);if(P.currentTarget.dispatchEvent($),!$.defaultPrevented){const j=S().filter(B=>B.focusable),O=j.find(B=>B.active),z=j.find(B=>B.id===p),A=[O,z,...j].filter(Boolean).map(B=>B.ref.current);iR(A,d)}}E.current=!1}),onBlur:xe(e.onBlur,()=>v(!1))})})}),rR="RovingFocusGroupItem",aR=x.forwardRef((e,t)=>{const{__scopeRovingFocusGroup:n,focusable:r=!0,active:a=!1,tabStopId:i,children:s,...o}=e,l=ti(),u=i||l,d=T9(rR,n),f=d.currentTabStopId===u,m=eR(n),{onFocusableItemAdd:h,onFocusableItemRemove:y,currentTabStopId:p}=d;return x.useEffect(()=>{if(r)return h(),()=>y()},[r,h,y]),c.jsx(Pv.ItemSlot,{scope:n,id:u,focusable:r,active:a,children:c.jsx(De.span,{tabIndex:f?0:-1,"data-orientation":d.orientation,...o,ref:t,onMouseDown:xe(e.onMouseDown,b=>{r?d.onItemFocus(u):b.preventDefault()}),onFocus:xe(e.onFocus,()=>d.onItemFocus(u)),onKeyDown:xe(e.onKeyDown,b=>{if(b.key==="Tab"&&b.shiftKey){d.onItemShiftTab();return}if(b.target!==b.currentTarget)return;const g=O9(b,d.orientation,d.dir);if(g!==void 0){if(b.metaKey||b.ctrlKey||b.altKey||b.shiftKey)return;b.preventDefault();let w=m().filter(S=>S.focusable).map(S=>S.ref.current);if(g==="last")w.reverse();else if(g==="prev"||g==="next"){g==="prev"&&w.reverse();const S=w.indexOf(b.currentTarget);w=d.loop?M9(w,S+1):w.slice(S+1)}setTimeout(()=>iR(w))}}),children:typeof s=="function"?s({isCurrentTabStop:f,hasTabStop:p!=null}):s})})});aR.displayName=rR;var R9={ArrowLeft:"prev",ArrowUp:"prev",ArrowRight:"next",ArrowDown:"next",PageUp:"first",Home:"first",PageDown:"last",End:"last"};function $9(e,t){return t!=="rtl"?e:e==="ArrowLeft"?"ArrowRight":e==="ArrowRight"?"ArrowLeft":e}function O9(e,t,n){const r=$9(e.key,n);if(!(t==="vertical"&&["ArrowLeft","ArrowRight"].includes(r))&&!(t==="horizontal"&&["ArrowUp","ArrowDown"].includes(r)))return R9[r]}function iR(e,t=!1){const n=document.activeElement;for(const r of e)if(r===n||(r.focus({preventScroll:t}),document.activeElement!==n))return}function M9(e,t){return e.map((n,r)=>e[(t+r)%e.length])}var P9=nR,D9=aR,up="Tabs",[z9,vie]=fi(up,[tR]),sR=tR(),[I9,yx]=z9(up),oR=x.forwardRef((e,t)=>{const{__scopeTabs:n,value:r,onValueChange:a,defaultValue:i,orientation:s="horizontal",dir:o,activationMode:l="automatic",...u}=e,d=gx(o),[f,m]=ho({prop:r,onChange:a,defaultProp:i??"",caller:up});return c.jsx(I9,{scope:n,baseId:ti(),value:f,onValueChange:m,orientation:s,dir:d,activationMode:l,children:c.jsx(De.div,{dir:d,"data-orientation":s,...u,ref:t})})});oR.displayName=up;var lR="TabsList",cR=x.forwardRef((e,t)=>{const{__scopeTabs:n,loop:r=!0,...a}=e,i=yx(lR,n),s=sR(n);return c.jsx(P9,{asChild:!0,...s,orientation:i.orientation,dir:i.dir,loop:r,children:c.jsx(De.div,{role:"tablist","aria-orientation":i.orientation,...a,ref:t})})});cR.displayName=lR;var uR="TabsTrigger",dR=x.forwardRef((e,t)=>{const{__scopeTabs:n,value:r,disabled:a=!1,...i}=e,s=yx(uR,n),o=sR(n),l=mR(s.baseId,r),u=pR(s.baseId,r),d=r===s.value;return c.jsx(D9,{asChild:!0,...o,focusable:!a,active:d,children:c.jsx(De.button,{type:"button",role:"tab","aria-selected":d,"aria-controls":u,"data-state":d?"active":"inactive","data-disabled":a?"":void 0,disabled:a,id:l,...i,ref:t,onMouseDown:xe(e.onMouseDown,f=>{!a&&f.button===0&&f.ctrlKey===!1?s.onValueChange(r):f.preventDefault()}),onKeyDown:xe(e.onKeyDown,f=>{[" ","Enter"].includes(f.key)&&s.onValueChange(r)}),onFocus:xe(e.onFocus,()=>{const f=s.activationMode!=="manual";!d&&!a&&f&&s.onValueChange(r)})})})});dR.displayName=uR;var fR="TabsContent",hR=x.forwardRef((e,t)=>{const{__scopeTabs:n,value:r,forceMount:a,children:i,...s}=e,o=yx(fR,n),l=mR(o.baseId,r),u=pR(o.baseId,r),d=r===o.value,f=x.useRef(d);return x.useEffect(()=>{const m=requestAnimationFrame(()=>f.current=!1);return()=>cancelAnimationFrame(m)},[]),c.jsx(hi,{present:a||d,children:({present:m})=>c.jsx(De.div,{"data-state":d?"active":"inactive","data-orientation":o.orientation,role:"tabpanel","aria-labelledby":l,hidden:!m,id:u,tabIndex:0,...s,ref:t,style:{...e.style,animationDuration:f.current?"0s":void 0},children:m&&i})})});hR.displayName=fR;function mR(e,t){return`${e}-trigger-${t}`}function pR(e,t){return`${e}-content-${t}`}var L9=oR,gR=cR,yR=dR,vR=hR;const U9=L9,bR=x.forwardRef(({className:e,...t},n)=>c.jsx(gR,{ref:n,className:Te("inline-flex h-10 items-center justify-center rounded-md bg-muted p-1 text-muted-foreground",e),...t}));bR.displayName=gR.displayName;const Dv=x.forwardRef(({className:e,...t},n)=>c.jsx(yR,{ref:n,className:Te("inline-flex items-center justify-center whitespace-nowrap rounded-sm px-3 py-1.5 text-sm font-medium ring-offset-background transition-all focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-ring focus-visible:ring-offset-2 disabled:pointer-events-none disabled:opacity-50 data-[state=active]:bg-background data-[state=active]:text-foreground data-[state=active]:shadow-sm",e),...t}));Dv.displayName=yR.displayName;const zv=x.forwardRef(({className:e,...t},n)=>c.jsx(vR,{ref:n,className:Te("mt-2 ring-offset-background focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-ring focus-visible:ring-offset-2",e),...t}));zv.displayName=vR.displayName;function vu(e){return typeof e=="object"&&e!==null&&!Array.isArray(e)}function xR(e){return vu(e)&&typeof e.command=="string"}function Pg(e){return!vu(e)||Object.keys(e).length===0?!1:Object.values(e).every(xR)}function F9(e){let t=e.trim();return t.startsWith("```")?t.replace(/^```(?:json)?\s*\n?/i,"").replace(/\n?```\s*$/,"").trim():t}function q9(e){if(!vu(e))throw new Error("Configuration must be a JSON object");if(vu(e.config)&&Pg(e.config.mcpServers))return{mcpServers:e.config.mcpServers};if(Pg(e.mcpServers))return{mcpServers:e.mcpServers};if(vu(e)&&typeof e.command=="string"){const t=typeof e.name=="string"&&e.name.trim()?e.name.trim():"local-server",{name:n,...r}=e;if(!xR(r))throw new Error("Missing or invalid command");return{mcpServers:{[t]:r}}}if(Pg(e))return{mcpServers:e};throw new Error(`Invalid configuration: expected a top-level "mcpServers" object. Example:
338
+ {
339
+ "mcpServers": {
340
+ "google-drive": {
341
+ "command": "npx",
342
+ "args": ["-y", "@piotr-agier/google-drive-mcp"]
343
+ }
344
+ }
345
+ }`)}function H9(e){let t;try{t=JSON.parse(F9(e))}catch(n){throw new Error(`Failed to parse JSON: ${n instanceof Error?n.message:"Unknown error"}`)}return q9(t)}function B9({type:e,open:t,onOpenChange:n}){const[r,a]=x.useState("remote"),[i,s]=x.useState("json"),[o,l]=x.useState(`{
346
+ "mcpServers": {
347
+ "memory": {
348
+ "command": "npx",
349
+ "args": ["-y", "@modelcontextprotocol/server-memory"],
350
+ "env": {
351
+ "MEMORY_FILE_PATH": "/path/to/custom/memory.json"
352
+ }
353
+ }
354
+ }
355
+ }`),[u,d]=x.useState(null),[f,m]=x.useState(null),[h,y]=x.useState(null),[p,b]=x.useState({name:"",type:"mcp",url:"http://localhost:8000/mcp",description:"",headers_enabled:!1,headers:{},cardColor:Pn}),[g,v]=x.useState(`{
356
+
357
+ }`),[w,S]=x.useState(null),[E,C]=x.useState({name:"",type:"local-mcp",command:"",args:[""],env:{},description:"",cardColor:Pn}),[T,P]=x.useState({name:"",type:"a2a",manifest_url:"http://localhost:8001/.well-known/a2a/manifest.json",description:"",cardColor:Pn}),R=cn(),{toast:$}=nn(),j=()=>{try{m(null);const k=H9(o),M=Object.entries(k.mcpServers);if(M.length===0)throw new Error("No MCP servers found in configuration");if(M.length>1)throw new Error("Multiple servers not supported. Please configure one server at a time.");const[I,Q]=M[0],{command:W,args:oe,env:de,description:L}=Q;if(!W||typeof W!="string")throw new Error("Missing or invalid command");if(!oe||!Array.isArray(oe))throw new Error("Missing or invalid args array");const V={name:I,command:W,args:oe.map(String),env:de&&typeof de=="object"?de:void 0,description:L&&typeof L=="string"?L:void 0};d(V),s("review"),C({name:V.name,type:"local-mcp",command:V.command,args:V.args,env:V.env||{},description:V.description||"",cardColor:Pn}),O(I)}catch(k){m(k instanceof Error?k.message:"Failed to parse JSON"),d(null)}},O=async k=>{try{const Q=((await ke("GET","/api/services")).data||[]).find(W=>W.name===k);y(Q?k:null)}catch(M){console.error("Failed to check name conflict:",M)}},z=async k=>{await O(k)},D=St({mutationFn:async k=>{if(e==="mcp"&&r==="local"){const M={mcpServers:{[k.name]:{command:k.command,args:k.args.filter(I=>I.trim()!==""),...Object.keys(k.env).length>0&&{env:k.env}}}};return console.log("Importing local MCP server:",M),ke("POST","/api/local-mcp/import",{config:JSON.stringify(M)})}else{const M={name:k.name,type:e,url:e==="mcp"?k.url:k.manifest_url,description:k.description,cardColor:k.cardColor,...k.headers_enabled&&{headers:k.headers}};return console.log("Sending service data:",M),ke("POST","/api/services",M)}},onSuccess:()=>{R.invalidateQueries({queryKey:["/api/services"]}),R.invalidateQueries({queryKey:["/api/collection/warnings"]}),$({title:"Service registered successfully!",description:`${(e==="mcp"?r==="remote"?p:E:T).name} has been added to your collection.`}),B()},onError:k=>{var M;console.error("Registration failed:",k),console.error("Error details:",{message:k==null?void 0:k.message,name:k==null?void 0:k.name,stack:k==null?void 0:k.stack,toString:k==null?void 0:k.toString(),constructor:(M=k==null?void 0:k.constructor)==null?void 0:M.name}),$({title:"Registration failed",description:(k==null?void 0:k.message)||"Failed to register service. Please try again.",variant:"destructive"})}}),A=async()=>{if(e==="mcp"&&r==="local"){if(i==="json")j();else if(i==="review"){if(await z(E.name),h){$({title:"Name Conflict",description:`A service with the name "${E.name}" already exists. Please choose a different name.`,variant:"destructive"});return}D.mutate(E)}}else{const k=e==="mcp"?r==="remote"?p:E:T;if(await z(k.name),h){$({title:"Name Conflict",description:`A service with the name "${k.name}" already exists. Please choose a different name.`,variant:"destructive"});return}if(e==="mcp"&&r==="remote"&&p.headers_enabled){const M=J();if(M===null)return;D.mutate({...p,headers:M});return}D.mutate(k)}},B=()=>{s("json"),l(`{
358
+ "mcpServers": {
359
+ "memory": {
360
+ "command": "npx",
361
+ "args": ["-y", "@modelcontextprotocol/server-memory"],
362
+ "env": {
363
+ "MEMORY_FILE_PATH": "/path/to/custom/memory.json"
364
+ }
365
+ }
366
+ }
367
+ }`),d(null),m(null),y(null),b({name:"",type:"mcp",url:"http://localhost:8000/mcp",description:"",headers_enabled:!1,headers:{},cardColor:Pn}),v(`{
368
+
369
+ }`),S(null),C({name:"",type:"local-mcp",command:"",args:[""],env:{},description:"",cardColor:Pn}),P({name:"",type:"a2a",manifest_url:"http://localhost:8001/.well-known/a2a/manifest.json",description:"",cardColor:Pn}),n(!1)},Z=(k,M)=>{b(I=>({...I,[k]:M}))},F=k=>{Z("headers_enabled",k),k&&g.trim()===`{
370
+
371
+ }`&&v(`{
372
+ "Authorization": "Bearer "
373
+ }`),k||S(null)},J=()=>{const k=g.trim();if(!k||k==="{}")return{};try{const M=JSON.parse(k);if(typeof M!="object"||M===null||Array.isArray(M))return S('Headers must be a JSON object (e.g. {"Authorization": "Bearer token"})'),null;for(const[I,Q]of Object.entries(M))if(typeof Q!="string")return S(`Header "${I}" must be a string value`),null;return S(null),M}catch{return S("Invalid JSON — fix syntax before registering"),null}},N=(k,M)=>{C(I=>({...I,[k]:M}))},q=(k,M)=>{P(I=>({...I,[k]:M}))},G=()=>{if(e==="mcp"&&r==="local"){if(i==="json")return"Parse Configuration";if(i==="review")return h?"Register Anyway":"Register Service"}return"Register Service"},_=()=>{var k,M;if(e==="mcp"&&r==="local"){if(i==="json")return!o.trim();if(i==="review")return!E.name.trim()||!E.command.trim()}else{const I=e==="mcp"?r==="remote"?p:E:T;return!I.name.trim()||e==="mcp"&&r==="remote"&&!((k=I.url)!=null&&k.trim())||e==="a2a"&&!((M=I.manifest_url)!=null&&M.trim())}return!1};return c.jsx(bs,{open:t,onOpenChange:n,children:c.jsxs(mi,{className:"sm:max-w-2xl max-h-[90vh] overflow-y-auto bg-black/40 backdrop-blur-md border border-white/10 text-white shadow-2xl",children:[c.jsxs(pi,{children:[c.jsxs(gi,{className:"text-2xl font-bold flex items-center",style:{background:"linear-gradient(to right, #C4B643, #D4C760)",WebkitBackgroundClip:"text",WebkitTextFillColor:"transparent",backgroundClip:"text"},children:[e==="mcp"?c.jsx(Kh,{className:"w-6 h-6 mr-3",style:{color:"#92E4DD"}}):c.jsx(HI,{className:"w-6 h-6 mr-3",style:{color:"#92E4DD"}}),"Register ",e==="mcp"?"MCP Server":"A2A Agent"]}),c.jsx(jo,{className:"mt-2",style:{color:"#92E4DD",opacity:.8},children:e==="mcp"?"Add a new Model Context Protocol (MCP) server to your service deck. Configure the server URL and provide details for registration.":"Register a new A2A agent with your service deck. Provide the agent manifest and configuration details."})]}),e==="mcp"?c.jsxs(U9,{value:r,onValueChange:k=>a(k),className:"w-full",children:[c.jsxs(bR,{className:"grid w-full grid-cols-2 bg-white/10 border border-white/20",children:[c.jsxs(Dv,{value:"remote",className:"data-[state=active]:bg-white/20 data-[state=active]:text-white text-gray-400",children:[c.jsx(Kh,{className:"w-4 h-4 mr-2"}),"Remote MCP"]}),c.jsxs(Dv,{value:"local",className:"data-[state=active]:bg-white/20 data-[state=active]:text-white text-gray-400",children:[c.jsx(WI,{className:"w-4 h-4 mr-2"}),"Local MCP"]})]}),c.jsxs(zv,{value:"remote",className:"space-y-4 mt-4",children:[c.jsxs("div",{children:[c.jsx(Qe,{htmlFor:"name",className:"text-sm font-semibold",style:{color:"#92E4DD"},children:"Server Name"}),c.jsx(at,{id:"name",placeholder:"e.g., Database Tools",value:p.name,onChange:k=>{Z("name",k.target.value),k.target.value.trim()?z(k.target.value):y(null)},className:"bg-white/10 border-white/20 text-white placeholder-gray-400",required:!0,"data-testid":"input-service-name"}),h&&c.jsxs("div",{className:"flex items-center gap-2 mt-1 text-red-400 text-sm",children:[c.jsx(Rr,{className:"w-4 h-4"}),c.jsx("span",{children:"A service with this name already exists"})]})]}),c.jsxs("div",{children:[c.jsx(Qe,{htmlFor:"url",className:"text-sm font-semibold",style:{color:"#92E4DD"},children:"MCP URL"}),c.jsx(at,{id:"url",type:"url",placeholder:"http://localhost:8080/mcp or https://mcp.notion.com/mcp",value:p.url,onChange:k=>Z("url",k.target.value),className:"bg-white/10 border-white/20 text-white placeholder-gray-400",required:!0,"data-testid":"input-mcp-url"}),c.jsxs("div",{className:"mt-1 text-xs text-gray-400",children:[c.jsx("p",{children:"Supported formats:"}),c.jsxs("ul",{className:"list-disc list-inside ml-2 space-y-1",children:[c.jsxs("li",{children:["HTTP MCP: ",c.jsx("code",{children:"http://localhost:8080/mcp"})]}),c.jsxs("li",{children:["SSE MCP: ",c.jsx("code",{children:"https://be.omnimcp.ai/api/v1/mcp/.../sse"})]}),c.jsxs("li",{children:["Notion MCP: ",c.jsx("code",{children:"https://mcp.notion.com/mcp"})]})]})]})]}),c.jsxs("div",{children:[c.jsx(Qe,{htmlFor:"description",className:"text-sm font-semibold",style:{color:"#92E4DD"},children:"Description"}),c.jsx(Za,{id:"description",placeholder:"Brief description of capabilities...",value:p.description,onChange:k=>Z("description",k.target.value),rows:3,className:"bg-white/10 border-white/20 text-white placeholder-gray-400 resize-none","data-testid":"textarea-description"})]})]}),c.jsxs(zv,{value:"local",className:"space-y-4 mt-4",children:[i==="json"&&c.jsxs("div",{className:"space-y-4",children:[c.jsxs("div",{children:[c.jsx(Qe,{htmlFor:"local-json",className:"text-sm font-semibold",style:{color:"#92E4DD"},children:"Local MCP Configuration (JSON)"}),c.jsx(Za,{id:"local-json",placeholder:`{
374
+ "mcpServers": {
375
+ "memory": {
376
+ "command": "npx",
377
+ "args": ["-y", "@modelcontextprotocol/server-memory"]
378
+ }
379
+ }
380
+ }`,value:o,onChange:k=>l(k.target.value),rows:12,className:"bg-white/10 border-white/20 text-white placeholder-gray-400 resize-none font-mono text-xs","data-testid":"textarea-local-json"}),c.jsxs("div",{className:"mt-2 text-xs text-gray-400",children:[c.jsx("p",{children:"Enter your local MCP server configuration in JSON format."}),c.jsx("p",{children:"Example:"}),c.jsx("pre",{className:"bg-white/10 p-2 rounded-md text-xs text-gray-300",children:`{
381
+ "mcpServers": {
382
+ "memory": {
383
+ "command": "npx",
384
+ "args": ["-y", "@modelcontextprotocol/server-memory"],
385
+ "env": {
386
+ "MEMORY_FILE_PATH": "/path/to/custom/memory.json"
387
+ }
388
+ }
389
+ }
390
+ }`})]})]}),c.jsxs(le,{type:"button",className:"flex-1 border",style:{background:"linear-gradient(135deg, #C4B643, #D4C760)",borderColor:"#C4B643",color:"#0A0A07"},onClick:j,disabled:!o.trim()||o.trim().length<10,"data-testid":"button-parse-json",children:[c.jsx(Cv,{className:"w-4 h-4 mr-2",style:{color:"#0A0A07"}}),"Parse Configuration"]})]}),i==="review"&&c.jsxs("div",{className:"space-y-4",children:[c.jsxs("div",{children:[c.jsx(Qe,{htmlFor:"local-name",className:"text-sm font-semibold",style:{color:"#92E4DD"},children:"Server Name"}),c.jsx(at,{id:"local-name",placeholder:"e.g., Memory Server",value:E.name,onChange:k=>{N("name",k.target.value),k.target.value.trim()?z(k.target.value):y(null)},className:"bg-white/10 border-white/20 text-white placeholder-gray-400",required:!0,"data-testid":"input-local-service-name"}),h&&c.jsxs("div",{className:"mt-2 text-xs text-red-400 flex items-center",children:[c.jsx(Rr,{className:"w-4 h-4 mr-1"}),'A service with the name "',h,'" already exists.']})]}),c.jsxs("div",{children:[c.jsx(Qe,{htmlFor:"command",className:"text-sm font-semibold",style:{color:"#92E4DD"},children:"Command"}),c.jsx(at,{id:"command",placeholder:"e.g., npx, python, node",value:E.command,onChange:k=>N("command",k.target.value),className:"bg-white/10 border-white/20 text-white placeholder-gray-400",required:!0,"data-testid":"input-command"}),c.jsx("div",{className:"mt-1 text-xs text-gray-400",children:"The command to execute (e.g., npx, python, node)"})]}),c.jsxs("div",{children:[c.jsx(Qe,{className:"text-sm font-semibold",style:{color:"#92E4DD"},children:"Arguments"}),E.args.map((k,M)=>c.jsxs("div",{className:"flex gap-2 mb-2",children:[c.jsx(at,{placeholder:`Argument ${M+1}`,value:k,onChange:I=>{const Q=[...E.args];Q[M]=I.target.value,N("args",Q)},className:"bg-white/10 border-white/20 text-white placeholder-gray-400","data-testid":`input-arg-${M}`}),M===E.args.length-1&&c.jsx(le,{type:"button",size:"sm",onClick:()=>N("args",[...E.args,""]),className:"bg-white/20 hover:bg-white/30 text-white",children:c.jsx(qs,{className:"w-4 h-4"})}),E.args.length>1&&c.jsx(le,{type:"button",size:"sm",variant:"destructive",onClick:()=>{const I=E.args.filter((Q,W)=>W!==M);N("args",I)},className:"bg-red-500/80 hover:bg-red-500 text-white",children:c.jsx(Zh,{className:"w-4 h-4"})})]},M)),c.jsx("div",{className:"mt-1 text-xs text-gray-400",children:"Command arguments (e.g., -y, @modelcontextprotocol/server-memory)"})]}),c.jsxs("div",{children:[c.jsx(Qe,{className:"text-sm font-semibold",style:{color:"#92E4DD"},children:"Environment Variables"}),Object.entries(E.env).length===0?c.jsx("div",{className:"text-gray-400 text-sm italic",children:"No environment variables configured"}):c.jsx("div",{className:"space-y-2",children:Object.entries(E.env).map(([k,M],I)=>c.jsxs("div",{className:"flex gap-2",children:[c.jsx(at,{placeholder:"Variable name",value:k,onChange:Q=>{const W={...E.env};delete W[k],W[Q.target.value]=M,N("env",W)},className:"bg-white/10 border-white/20 text-white placeholder-gray-400","data-testid":`input-env-key-${I}`}),c.jsx(at,{placeholder:"Value",value:M,onChange:Q=>{const W={...E.env};W[k]=Q.target.value,N("env",W)},className:"bg-white/10 border-white/20 text-white placeholder-gray-400","data-testid":`input-env-value-${I}`}),c.jsx(le,{type:"button",size:"sm",variant:"destructive",onClick:()=>{const Q={...E.env};delete Q[k],N("env",Q)},className:"bg-red-500/80 hover:bg-red-500 text-white",children:c.jsx(Zh,{className:"w-4 h-4"})})]},I))}),c.jsxs(le,{type:"button",size:"sm",onClick:()=>{const k={...E.env};k[""]="",N("env",k)},className:"mt-2 bg-white/20 hover:bg-white/30 text-white",children:[c.jsx(qs,{className:"w-4 h-4 mr-2"}),"Add Environment Variable"]}),c.jsx("div",{className:"mt-1 text-xs text-gray-400",children:"Environment variables for the MCP server process"})]}),c.jsxs("div",{children:[c.jsx(Qe,{htmlFor:"local-description",className:"text-sm font-semibold",style:{color:"#92E4DD"},children:"Description"}),c.jsx(Za,{id:"local-description",placeholder:"Brief description of capabilities...",value:E.description,onChange:k=>N("description",k.target.value),rows:3,className:"bg-white/10 border-white/20 text-white placeholder-gray-400 resize-none","data-testid":"textarea-local-description"})]}),c.jsxs("div",{className:"flex gap-3",children:[c.jsx(le,{type:"button",variant:"outline",className:"flex-1 border-white/20 text-white hover:bg-white/10",onClick:()=>s("json"),"data-testid":"button-back-to-json",children:"← Back to JSON"}),c.jsxs(le,{type:"button",variant:"ghost",className:`flex-1 border-2 hover:opacity-90 ${ha}`,style:ma(Pn),onClick:A,disabled:_(),"data-testid":"button-register",children:[c.jsx(qs,{className:"w-4 h-4 mr-2"}),D.isPending?"Registering...":G()]})]})]}),i==="complete"&&c.jsxs("div",{className:"text-center py-8",children:[c.jsx(Cv,{className:"w-16 h-16 text-green-500 mx-auto mb-4"}),c.jsx("h3",{className:"text-xl font-bold mb-2",style:{color:"#92E4DD"},children:"Local MCP Registered!"}),c.jsx("p",{className:"text-gray-400 mb-4",children:"Your local MCP server has been successfully registered."}),c.jsx(le,{type:"button",className:"flex-1 border",style:{background:"linear-gradient(135deg, #C4B643, #D4C760)",borderColor:"#C4B643",color:"#0A0A07"},onClick:B,"data-testid":"button-close",children:"Close"})]})]})]}):c.jsxs("div",{className:"space-y-4",children:[c.jsxs("div",{children:[c.jsx(Qe,{htmlFor:"name",className:"text-sm font-semibold",style:{color:"#92E4DD"},children:"Agent Name"}),c.jsx(at,{id:"name",placeholder:"e.g., Code Assistant",value:T.name,onChange:k=>{q("name",k.target.value),k.target.value.trim()?z(k.target.value):y(null)},className:"bg-white/10 border-white/20 text-white placeholder-gray-400",required:!0,"data-testid":"input-service-name"}),h&&c.jsxs("div",{className:"flex items-center gap-2 mt-1 text-red-400 text-sm",children:[c.jsx(Rr,{className:"w-4 h-4"}),c.jsx("span",{children:"A service with this name already exists"})]})]}),c.jsxs("div",{children:[c.jsx(Qe,{htmlFor:"manifest_url",className:"text-sm font-semibold",style:{color:"#92E4DD"},children:"Manifest URL"}),c.jsx(at,{id:"manifest_url",type:"url",placeholder:"http://localhost:8001/.well-known/a2a/manifest.json",value:T.manifest_url,onChange:k=>q("manifest_url",k.target.value),className:"bg-white/10 border-white/20 text-white placeholder-gray-400",required:!0,"data-testid":"input-manifest-url"})]}),c.jsxs("div",{children:[c.jsx(Qe,{htmlFor:"description",className:"text-sm font-semibold",style:{color:"#92E4DD"},children:"Description"}),c.jsx(Za,{id:"description",placeholder:"Brief description of capabilities...",value:T.description,onChange:k=>q("description",k.target.value),rows:3,className:"bg-white/10 border-white/20 text-white placeholder-gray-400 resize-none","data-testid":"textarea-description"})]})]}),e==="mcp"&&r==="remote"&&c.jsxs("div",{className:"space-y-4 border border-white/10 rounded-lg p-4",children:[c.jsxs("div",{className:"flex items-center space-x-2",children:[c.jsx("input",{type:"checkbox",id:"headers_enabled",checked:p.headers_enabled,onChange:k=>F(k.target.checked),className:"rounded border-white/20 bg-white/10"}),c.jsx(Qe,{htmlFor:"headers_enabled",className:"text-sm font-semibold",style:{color:"#92E4DD"},children:"🔐 Authentication Required"})]}),c.jsx("div",{className:"text-xs text-gray-400",children:c.jsx("p",{children:"Enable this if your MCP server requires authentication (API keys, tokens, etc.)."})}),p.headers_enabled&&c.jsxs("div",{className:"space-y-3 pl-6",children:[c.jsxs("div",{className:"text-xs text-gray-400 mb-2",children:[c.jsx("p",{children:"Configure HTTP headers for authentication. Common examples:"}),c.jsxs("ul",{className:"list-disc list-inside ml-2 mt-1 space-y-1",children:[c.jsxs("li",{children:[c.jsx("code",{children:"Authorization: Bearer YOUR_TOKEN"})," - For API tokens"]}),c.jsxs("li",{children:[c.jsx("code",{children:"X-API-Key: YOUR_API_KEY"})," - For API keys"]}),c.jsxs("li",{children:[c.jsx("code",{children:"X-Custom-Header: value"})," - For custom headers"]})]})]}),c.jsxs("div",{children:[c.jsx(Qe,{htmlFor:"headers",className:"text-sm font-semibold",style:{color:"#92E4DD"},children:"HTTP Headers (JSON)"}),c.jsx(Za,{id:"headers",placeholder:`{
391
+ "Authorization": "Bearer YOUR_TOKEN_HERE",
392
+ "X-API-Key": "YOUR_API_KEY_HERE"
393
+ }`,value:g,onChange:k=>{v(k.target.value),w&&S(null)},onBlur:()=>{g.trim()&&J()},rows:6,className:"bg-white/10 border-white/20 text-white placeholder-gray-400 resize-none font-mono text-xs","data-testid":"textarea-headers"}),w&&c.jsxs("p",{className:"text-red-400 text-xs mt-1 flex items-center gap-1",children:[c.jsx(Rr,{className:"w-3 h-3 shrink-0"}),w]}),c.jsx("div",{className:"text-xs text-gray-400 mt-1",children:c.jsx("p",{children:"Enter headers as JSON. Keys are header names, values are header values."})})]})]})]}),f&&c.jsxs("div",{className:"text-red-400 text-sm mt-2",children:[c.jsx(Rr,{className:"w-4 h-4 mr-1"}),f]}),h&&c.jsxs("div",{className:"text-red-400 text-sm mt-2",children:[c.jsx(Rr,{className:"w-4 h-4 mr-1"}),'A service with the name "',h,'" already exists. You can register it anyway, but it might overwrite the existing one.']}),c.jsxs("div",{className:"flex space-x-3 pt-4",children:[c.jsx(le,{type:"button",variant:"secondary",className:"flex-1 border text-white",style:{background:"#ad095e",borderColor:"#ad095e"},onClick:B,"data-testid":"button-cancel",children:"Cancel"}),!(e==="mcp"&&r==="local")&&c.jsxs(le,{type:"button",variant:"ghost",className:`flex-1 border-2 hover:opacity-90 ${ha}`,style:ma(Pn),disabled:D.isPending||_(),"data-testid":"button-register",onClick:A,children:[c.jsx(qs,{className:"w-4 h-4 mr-2"}),D.isPending?"Registering...":"Register Service"]})]})]})})}async function wR(e){return(await(await ke("POST","/api/export",{scope:e.scope??"collection",...e.deckId?{deckId:e.deckId}:{}})).json()).data}async function V9(e){return(await(await ke("POST","/api/import",e)).json()).data}function SR(e,t){const n=new Blob([`${JSON.stringify(e,null,2)}
394
+ `],{type:"application/json"}),r=URL.createObjectURL(n),a=document.createElement("a");a.href=r,a.download=t,a.click(),URL.revokeObjectURL(r)}function K9(e){return e.trim().toLowerCase().replace(/[^a-z0-9]+/g,"-").replace(/^-+|-+$/g,"").slice(0,48)||"deck"}function V_(e){const{services:t,playbooks:n,decks:r}=e.counts;return`Decks +${r.created} / skipped ${r.reused}. Services +${t.created} / skipped ${t.reused}. Playbooks +${n.created} / skipped ${n.reused}.`}function Z9({decks:e,editingDeckId:t,onSelectDeck:n,isLoading:r}){const[a,i]=x.useState(!1),[s,o]=x.useState(""),l=cn(),{toast:u}=nn(),{data:d}=wt({queryKey:["/api/scope/bindings"],refetchInterval:3e3}),f=x.useMemo(()=>J6((d==null?void 0:d.data)??[]),[d]),m=St({mutationFn:async S=>ke("POST","/api/decks",{name:S,isActive:!1}),onSuccess:async(S,E)=>{var T;const C=await S.json();l.invalidateQueries({queryKey:["/api/decks"]}),(T=C.data)!=null&&T.id&&n(C.data.id),u({title:"Deck created",description:`${E} has been created successfully.`}),i(!1),o("")},onError:S=>{u({title:"Failed to create deck",description:S.message,variant:"destructive"})}}),h=St({mutationFn:async S=>{const E=await wR({scope:"deck",deckId:S.id});return SR(E,`${K9(S.name)}.agent-deck.json`),E},onSuccess:(S,E)=>{u({title:"Deck exported",description:`${E.name}: ${S.services.length} services, ${S.playbooks.length} playbooks`})},onError:S=>{u({title:"Export failed",description:S.message,variant:"destructive"})}}),y=(S,E)=>{S.stopPropagation(),h.mutate(E)},p=St({mutationFn:async S=>ke("DELETE",`/api/decks/${S}`,{}),onSuccess:()=>{l.invalidateQueries({queryKey:["/api/decks"]}),u({title:"Deck deleted",description:"Your deck has been deleted successfully."})},onError:S=>{S.message.includes("Cannot delete the last deck")?u({title:"Cannot delete deck",description:"You cannot delete the last deck. Please create another deck first.",variant:"destructive"}):u({title:"Failed to delete deck",description:S.message,variant:"destructive"})}}),b=async(S,E)=>{S.stopPropagation();try{await navigator.clipboard.writeText(E.id),u({title:"Copied deck id",description:"Use with bind_workspace({ workspaceRoot, deckId }) in your agent."})}catch(C){u({title:"Failed to copy deck id",description:C instanceof Error?C.message:"Unknown error",variant:"destructive"})}},g=(S,E)=>{S.stopPropagation(),window.confirm("Are you sure you want to delete this deck? This action cannot be undone.")&&p.mutate(E)},v=S=>{S.preventDefault();const E=s.trim();E&&m.mutate(E)},w=S=>{var E,C,T;return(((E=S.services)==null?void 0:E.length)??0)+(((C=S.credentials)==null?void 0:C.length)??0)+(((T=S.playbooks)==null?void 0:T.length)??0)};return r?c.jsx("div",{className:"bg-black/40 backdrop-blur-md rounded-2xl border border-white/10 p-6 shadow-2xl",children:c.jsxs("div",{className:"animate-pulse space-y-4",children:[c.jsx("div",{className:"h-6 bg-white/10 rounded"}),c.jsx("div",{className:"space-y-3",children:Array.from({length:3}).map((S,E)=>c.jsx("div",{className:"h-16 bg-white/5 rounded-lg"},E))})]})}):c.jsxs(c.Fragment,{children:[c.jsxs("div",{className:"h-full flex flex-col","data-testid":"deck-management-panel",children:[c.jsxs("h2",{className:"text-lg font-bold mb-3 flex items-center",children:[c.jsx(Vh,{className:"w-4 h-4 mr-2",style:{color:"#92E4DD"}}),c.jsx("span",{style:{color:"#92E4DD"},children:"My Decks"})]}),c.jsx("div",{className:"mb-3",children:c.jsxs(le,{onClick:()=>i(!0),className:"w-full border text-sm py-2",style:{background:"#C4B643",borderColor:"#C4B643",color:"black"},"data-testid":"create-deck-button",children:[c.jsx(qs,{className:"w-3 h-3 mr-2"}),"Add Deck"]})}),c.jsx("div",{className:"flex-1 overflow-y-auto",children:c.jsx("div",{className:"space-y-2",children:e.map(S=>{const E=S.id===t,C=w(S),T=f.get(S.id)??0,P=e9(C,T);return c.jsxs("div",{className:`p-2 rounded-lg border cursor-pointer transition-all relative group ${E?"bg-gradient-to-r from-yellow-500/20 to-yellow-600/20 border-2 border-yellow-500/40 hover:border-yellow-400/60":"bg-white/5 border border-white/10 hover:border-white/20"}`,onClick:()=>n(S.id),"data-testid":`deck-item-${S.id}`,children:[c.jsxs("div",{className:"absolute top-1 right-1 flex gap-1 opacity-0 group-hover:opacity-100 transition-opacity duration-200",children:[c.jsx(le,{size:"sm",variant:"secondary",className:"h-5 w-5 p-0",onClick:R=>y(R,S),title:"Export this deck","data-testid":`export-deck-${S.id}`,children:c.jsx(gT,{className:"w-2 h-2"})}),c.jsx(le,{size:"sm",variant:"secondary",className:"h-5 w-5 p-0",onClick:R=>b(R,S),title:"Copy deck id for bind_workspace",children:c.jsx(Gb,{className:"w-2 h-2"})}),c.jsx(le,{size:"sm",variant:"destructive",className:"h-5 w-5 p-0 bg-red-500/80 hover:bg-red-500 border-red-400",onClick:R=>g(R,S.id),title:"Delete deck",children:c.jsx(wd,{className:"w-2 h-2"})})]}),c.jsxs("div",{children:[c.jsx("h3",{className:`font-semibold text-sm pr-16 ${E?"text-yellow-300":"text-white"}`,children:S.name}),c.jsx("p",{className:"text-xs text-gray-400 select-none pointer-events-none",children:P})]})]},S.id)})})})]}),c.jsx(bs,{open:a,onOpenChange:i,children:c.jsxs(mi,{className:"sm:max-w-md border-border bg-[#161612] text-[#E8F6F4]",children:[c.jsx(pi,{children:c.jsxs(gi,{className:"flex items-center text-xl font-bold",children:[c.jsx(Vh,{className:"mr-2 h-5 w-5",style:{color:"#92E4DD"}}),"Create New Deck"]})}),c.jsxs("form",{onSubmit:v,className:"space-y-4","data-testid":"form-create-deck",children:[c.jsxs("div",{className:"space-y-2",children:[c.jsx(Qe,{htmlFor:"deckName",children:"Deck Name"}),c.jsx(at,{id:"deckName",placeholder:"e.g., Hiring stack",value:s,onChange:S=>o(S.target.value),className:"border-white/15 bg-[#0F0F0C] text-[#E8F6F4] placeholder:text-[#A8C4C0]/60",required:!0,"data-testid":"input-deck-name"})]}),c.jsxs("div",{className:"flex gap-3 pt-2",children:[c.jsx(le,{type:"button",variant:"outline",className:"flex-1 rounded-full border-white/20 text-[#E8F6F4] hover:bg-white/10",onClick:()=>i(!1),"data-testid":"button-cancel-create",children:"Cancel"}),c.jsx(le,{type:"submit",className:"flex-1 rounded-full border px-6 text-sm font-semibold hover:opacity-90",style:{background:"#C4B643",borderColor:"#C4B643",color:"black"},disabled:m.isPending,"data-testid":"button-submit-create",children:m.isPending?"Creating…":"Create Deck"})]})]})]})})]})}function G9({open:e,onOpenChange:t}){const[n,r]=x.useState(""),[a,i]=x.useState(""),s=cn(),{toast:o}=nn(),l=St({mutationFn:async()=>ke("POST","/api/credentials",{label:n.trim(),value:a}),onSuccess:()=>{s.invalidateQueries({queryKey:["/api/credentials/vault"]}),s.invalidateQueries({queryKey:["/api/decks"]}),o({title:"API key saved",description:`${n.trim()} is stored securely. Your agent can use it from the active deck.`}),t(!1),r(""),i("")},onError:d=>{o({title:"Could not save API key",description:d.message,variant:"destructive"})}}),u=n.trim().length>0&&a.trim().length>0;return c.jsx(bs,{open:e,onOpenChange:t,children:c.jsxs(mi,{className:"sm:max-w-md border-border bg-[#161612] text-[#E8F6F4]",children:[c.jsxs(pi,{children:[c.jsx(gi,{className:"text-[#E8F6F4]",children:"Register API key"}),c.jsx(jo,{className:"text-[#A8C4C0]",children:"Name the service and paste the key. Agent Deck handles the rest — stored in your vault, never shown again."})]}),c.jsxs("div",{className:"space-y-4",children:[c.jsxs("div",{className:"space-y-2",children:[c.jsx(Qe,{htmlFor:"credential-name",className:"text-[#CFEAE6]",children:"Service name"}),c.jsx(at,{id:"credential-name",placeholder:"OpenAI, Linear, Slack…",value:n,onChange:d=>r(d.target.value),className:"border-white/15 bg-[#0F0F0C] text-[#E8F6F4] placeholder:text-[#6B8581]"})]}),c.jsxs("div",{className:"space-y-2",children:[c.jsx(Qe,{htmlFor:"credential-value",className:"text-[#CFEAE6]",children:"API key"}),c.jsx(at,{id:"credential-value",type:"password",placeholder:"Paste key from the service dashboard",value:a,onChange:d=>i(d.target.value),className:"border-white/15 bg-[#0F0F0C] text-[#E8F6F4] placeholder:text-[#6B8581]"})]}),c.jsx(le,{variant:"ghost",className:`w-full border-2 hover:opacity-90 ${ha}`,style:ma(Qn),onClick:()=>l.mutate(),disabled:!u||l.isPending,children:"Save to vault"})]})]})})}function Q9({open:e,onOpenChange:t}){const[n,r]=x.useState(""),[a,i]=x.useState(""),[s,o]=x.useState(""),[l,u]=x.useState(""),[d,f]=x.useState(""),[m,h]=x.useState([]),[y,p]=x.useState([]),b=cn(),{toast:g}=nn(),{data:v}=wt({queryKey:["/api/credentials/vault"],enabled:e}),{data:w}=wt({queryKey:["/api/services"],enabled:e}),S=(v==null?void 0:v.data)??[],E=(w==null?void 0:w.data)??[],C=St({mutationFn:async()=>ke("POST","/api/playbooks",{title:n.trim(),body:a,triggers:s.split(",").map(R=>R.trim()).filter(Boolean),dependsOnCredentialIds:m,dependsOnServiceIds:y,exec:l.trim()||void 0,skill:d.trim()||void 0,autoDetectDependencies:!0}),onSuccess:()=>{b.invalidateQueries({queryKey:["/api/playbooks/vault"]}),g({title:"Playbook saved",description:`${n.trim()} is in your collection.`}),t(!1),r(""),i(""),o(""),u(""),f(""),h([]),p([])},onError:R=>{g({title:"Could not save playbook",description:R.message,variant:"destructive"})}}),T=(R,$,j)=>{j(R.includes($)?R.filter(O=>O!==$):[...R,$])},P=n.trim().length>0&&a.trim().length>0;return c.jsx(bs,{open:e,onOpenChange:t,children:c.jsxs(mi,{className:"sm:max-w-2xl max-h-[90vh] overflow-y-auto border-border bg-[#161612] text-[#E8F6F4]",children:[c.jsxs(pi,{children:[c.jsx(gi,{children:"Register Playbook"}),c.jsxs(jo,{className:"text-[#A8C4C0]",children:["Prefer"," ",c.jsx("span",{className:"font-mono text-xs",children:"register_playbook"})," /"," ",c.jsx("span",{className:"font-mono text-xs",children:"update_playbook"})," from your AI agent. This form also auto-detects API key and MCP dependencies from the content on save."]})]}),c.jsxs("div",{className:"space-y-4",children:[c.jsxs("div",{className:"space-y-2",children:[c.jsx(Qe,{htmlFor:"playbook-title",children:"Title"}),c.jsx(at,{id:"playbook-title",placeholder:"Hiring inbox, Ashby API guide…",value:n,onChange:R=>r(R.target.value),className:"border-white/15 bg-[#0F0F0C] text-[#E8F6F4]"})]}),c.jsxs("div",{className:"space-y-2",children:[c.jsx(Qe,{htmlFor:"playbook-triggers",children:"Triggers (comma-separated, max 16)"}),c.jsx(at,{id:"playbook-triggers",placeholder:"check inbox, review applicants",value:s,onChange:R=>o(R.target.value),className:"border-white/15 bg-[#0F0F0C] text-[#E8F6F4]"})]}),c.jsxs("div",{className:"space-y-2",children:[c.jsx(Qe,{htmlFor:"playbook-body",children:"Instructions (markdown)"}),c.jsx(Za,{id:"playbook-body",rows:8,placeholder:`# Steps
395
+ 1. …
396
+ 2. …`,value:a,onChange:R=>i(R.target.value),className:"border-white/15 bg-[#0F0F0C] text-[#E8F6F4] font-mono text-sm"})]}),c.jsxs("div",{className:"grid grid-cols-2 gap-4",children:[c.jsxs("div",{className:"space-y-2",children:[c.jsx(Qe,{children:"Extra API key deps (optional)"}),c.jsx("p",{className:"text-xs text-gray-500",children:"Merged with auto-detected refs from content."}),c.jsx("div",{className:"max-h-28 overflow-y-auto rounded border border-white/10 p-2 space-y-1",children:S.length===0?c.jsx("p",{className:"text-xs text-gray-500",children:"No API keys registered yet."}):S.map(R=>c.jsxs("label",{className:"flex items-center gap-2 text-xs cursor-pointer",children:[c.jsx("input",{type:"checkbox",checked:m.includes(R.id),onChange:()=>T(m,R.id,h)}),R.label]},R.id))})]}),c.jsxs("div",{className:"space-y-2",children:[c.jsx(Qe,{children:"Extra MCP deps (optional)"}),c.jsx("p",{className:"text-xs text-gray-500",children:"Merged with auto-detected refs from content."}),c.jsx("div",{className:"max-h-28 overflow-y-auto rounded border border-white/10 p-2 space-y-1",children:E.length===0?c.jsx("p",{className:"text-xs text-gray-500",children:"No MCP services registered yet."}):E.map(R=>c.jsxs("label",{className:"flex items-center gap-2 text-xs cursor-pointer",children:[c.jsx("input",{type:"checkbox",checked:y.includes(R.id),onChange:()=>T(y,R.id,p)}),R.name]},R.id))})]})]}),c.jsxs("div",{className:"space-y-2",children:[c.jsx(Qe,{htmlFor:"playbook-exec",children:"Suggested exec (optional)"}),c.jsx(at,{id:"playbook-exec",placeholder:"agent-deck exec --connections … -- uv run …",value:l,onChange:R=>u(R.target.value),className:"border-white/15 bg-[#0F0F0C] text-[#E8F6F4] font-mono text-xs"})]}),c.jsxs("div",{className:"space-y-2",children:[c.jsx(Qe,{htmlFor:"playbook-skill",children:"Skill path hint (optional)"}),c.jsx(at,{id:"playbook-skill",placeholder:".cursor/skills/…/SKILL.md",value:d,onChange:R=>f(R.target.value),className:"border-white/15 bg-[#0F0F0C] text-[#E8F6F4] font-mono text-xs"})]}),c.jsx(le,{variant:"ghost",className:`w-full border-2 hover:opacity-90 ${ha}`,style:ma(Gr),onClick:()=>C.mutate(),disabled:!P||C.isPending,children:"Save to collection"})]})]})})}async function Ed(e){const t=await e.json();if(!t.success)throw new Error(t.error??"Request failed");return t.data}function K_(e){return e.length===0?null:e.length<=3?e.join(", "):`${e.slice(0,3).join(", ")} and ${e.length-3} more`}async function Iv(e){const t=e?`?status=${encodeURIComponent(e)}`:"",n=await ke("GET",`/api/playbook-patches${t}`);return Ed(n)}async function Y9(e){const t=await ke("GET",`/api/playbook-patches/${e}/preview`);return Ed(t)}async function X9(e){const t=await ke("POST",`/api/playbook-patches/${e}/accept`);return Ed(t)}async function W9(e,t){const n=await ke("POST",`/api/playbook-patches/${e}/reject`,{});return Ed(n)}async function J9(e){const t=await ke("GET",`/api/playbooks/${e}/events/count`);return Ed(t)}async function vx(e){const t=await e.json();if(!t.success)throw new Error(t.error??"Request failed");return t.data}async function _R(e){const t=new URLSearchParams({available:"1"});e&&t.set("playbookId",e);const n=await ke("GET",`/api/feedback-signals/count?${t.toString()}`);return(await vx(n)).open}async function eF(e){const t=new URLSearchParams;e!=null&&e.status&&t.set("status",e.status),e!=null&&e.playbookId&&t.set("playbookId",e.playbookId),e!=null&&e.deckId&&t.set("deckId",e.deckId),(e==null?void 0:e.excludeInProposal)!==void 0&&t.set("excludeInProposal",e.excludeInProposal?"true":"false");const n=t.toString()?`?${t.toString()}`:"",r=await ke("GET",`/api/feedback-signals${n}`);return vx(r)}async function tF(e){const t=await ke("POST","/api/feedback-signals/discard",{signalIds:e});return vx(t)}function nF(e){return!!e.linkedPatchId&&e.status==="open"}function eh(e){return`"${e.replace(/\\/g,"\\\\").replace(/"/g,'\\"').replace(/\n/g,"\\n")}"`}function rF(e){return e==null||e===""?"null":eh(e)}function aF(e){return`Propose playbook updates from these Agent Deck feedback signals (copied from the Feedback table).
397
+
398
+ For each coherent pattern:
399
+ 1. Call \`propose_playbook_patch\` with consolidated item ops (prefer \`add_item\`) — or kind \`create\` when there is no playbook.
400
+ 2. Pass **every** consumed row \`id\` in \`signal_ids\` so we can track which feedback is parked / solved.
401
+ 3. Do not invent a list-feedback MCP tool. Discard noise in the dashboard.
402
+
403
+ Signals (\`id\` required for tracking):
404
+
405
+ \`\`\`yaml
406
+ ${e.map(n=>{const r=[`- id: ${n.id}`,` playbook: ${rF(n.candidatePlaybookId)}`,` feedback: ${eh(n.userFeedbackExcerpt)}`,` failure: ${eh(n.failureSummary)}`];return n.correctedOutputHint&&r.push(` hint: ${eh(n.correctedOutputHint)}`),n.candidateDeckId&&r.push(` deck: ${n.candidateDeckId}`),r.join(`
407
+ `)}).join(`
408
+ `)}
409
+ \`\`\``}function iF({playbookId:e,open:t,onOpenChange:n}){const{data:r,isLoading:a}=wt({queryKey:e?[`/api/playbooks/${e}`]:["playbook-detail-disabled"],enabled:t&&!!e}),{data:i}=wt({queryKey:[`/api/playbooks/${e}/events/count`],queryFn:()=>J9(e),enabled:t&&!!e}),{data:s}=wt({queryKey:["/api/feedback-signals/count","available",e],queryFn:()=>_R(e),enabled:t&&!!e}),o=r==null?void 0:r.data,l=((o==null?void 0:o.dependencies.missingCredentialIds.length)??0)+((o==null?void 0:o.dependencies.missingServiceIds.length)??0);return c.jsx(bs,{open:t,onOpenChange:n,children:c.jsxs(mi,{className:"sm:max-w-6xl max-h-[90vh] overflow-y-auto border-border bg-[#161612] text-[#E8F6F4]",children:[c.jsxs(pi,{children:[c.jsx(gi,{children:(o==null?void 0:o.title)??"Playbook"}),c.jsx(jo,{className:"text-[#A8C4C0]",children:(o==null?void 0:o.id)??e})]}),a||!o?c.jsx("p",{className:"text-sm text-gray-400",children:"Loading…"}):c.jsxs("div",{className:"space-y-4 text-sm",children:[c.jsxs("p",{className:"rounded-md border border-white/10 bg-white/5 px-3 py-2 text-[#A8C4C0]",children:["Agent corrections file as"," ",c.jsx("span",{className:"font-mono text-xs",children:"propose_playbook_patch"})," proposals — review in the queue. Direct"," ",c.jsx("span",{className:"font-mono text-xs",children:"update_playbook"})," is for explicit edits only."]}),typeof i=="number"&&c.jsxs("p",{className:"text-xs text-gray-500",children:["Fetched ",i," time",i===1?"":"s"," (undertriggering signal)",typeof s=="number"&&s>0?` · ${s} open feedback signal${s===1?"":"s"}`:null]}),typeof i!="number"&&typeof s=="number"&&s>0&&c.jsxs("p",{className:"text-xs text-gray-500",children:[s," open feedback signal",s===1?"":"s"]}),o.triggers.length>0&&c.jsxs("div",{children:[c.jsx("h4",{className:"font-semibold text-amber-200 mb-1",children:"Triggers"}),c.jsx("p",{className:"text-gray-300",children:o.triggers.join(", ")})]}),c.jsxs("div",{children:[c.jsx("h4",{className:"font-semibold text-amber-200 mb-1",children:"Dependencies"}),o.dependencies.credentials.length===0&&o.dependencies.services.length===0&&l===0?c.jsx("p",{className:"text-gray-400",children:"None declared."}):c.jsxs("ul",{className:"space-y-1 text-gray-300",children:[o.dependencies.credentials.map(u=>c.jsxs("li",{children:["API key: ",u.label]},u.id)),o.dependencies.services.map(u=>c.jsxs("li",{children:["MCP: ",u.label]},u.id)),o.dependencies.missingCredentialIds.map(u=>c.jsxs("li",{className:"text-amber-300 flex items-center gap-1",children:[c.jsx(Rr,{className:"w-3 h-3"})," Missing API key: ",u]},u)),o.dependencies.missingServiceIds.map(u=>c.jsxs("li",{className:"text-amber-300 flex items-center gap-1",children:[c.jsx(Rr,{className:"w-3 h-3"})," Missing MCP: ",u]},u))]})]}),o.exec&&c.jsxs("div",{children:[c.jsx("h4",{className:"font-semibold text-amber-200 mb-1",children:"Suggested exec"}),c.jsx("pre",{className:"rounded bg-black/40 p-2 text-xs overflow-x-auto",children:o.exec})]}),o.skill&&c.jsxs("div",{children:[c.jsx("h4",{className:"font-semibold text-amber-200 mb-1",children:"Skill hint"}),c.jsx("p",{className:"font-mono text-xs text-gray-300",children:o.skill})]}),c.jsxs("div",{children:[c.jsx("h4",{className:"font-semibold text-amber-200 mb-1",children:"Instructions"}),c.jsx("div",{className:"rounded bg-black/30 p-3 whitespace-pre-wrap text-gray-200",children:o.body})]})]})]})})}function sF({credentialId:e,open:t,onOpenChange:n}){const r=cn(),{toast:a}=nn(),[i,s]=x.useState(""),[o,l]=x.useState(""),[u,d]=x.useState(""),{data:f,isLoading:m}=wt({queryKey:e?[`/api/credentials/${e}`]:["credential-detail-disabled"],enabled:t&&!!e}),h=f==null?void 0:f.data;x.useEffect(()=>{h&&(s(h.label),l(h.docsUrl??""),d(""))},[h==null?void 0:h.id,h==null?void 0:h.label,h==null?void 0:h.docsUrl]);const y=St({mutationFn:async()=>{if(!e)throw new Error("No credential selected");const b=i.trim();if(!b)throw new Error("Name is required");const g=o.trim();if(g)try{new URL(g)}catch{throw new Error("Documentation link must be a valid URL")}await ke("PUT",`/api/credentials/${e}`,{label:b,docsUrl:g}),u.trim()&&await ke("POST",`/api/credentials/${e}/rotate`,{value:u.trim()})},onSuccess:()=>{r.invalidateQueries({queryKey:["/api/credentials/vault"]}),e&&r.invalidateQueries({queryKey:[`/api/credentials/${e}`]}),r.invalidateQueries({queryKey:["/api/collection/warnings"]}),r.invalidateQueries({queryKey:["/api/decks"]}),a({title:u.trim()?"API key updated":"API key saved",description:u.trim()?"Name, docs link, and key value were updated.":"Name and docs link were updated."}),d(""),n(!1)},onError:b=>{a({title:"Could not save API key",description:b.message,variant:"destructive"})}}),p=i.trim().length>0&&(i.trim()!==(h==null?void 0:h.label)||o.trim()!==((h==null?void 0:h.docsUrl)??"")||u.trim().length>0);return c.jsx(bs,{open:t,onOpenChange:n,children:c.jsxs(mi,{className:"sm:max-w-md border-border bg-[#161612] text-[#E8F6F4]",children:[c.jsxs(pi,{children:[c.jsx(gi,{className:"text-[#E8F6F4]",children:(h==null?void 0:h.label)??"API key"}),c.jsx(jo,{className:"font-mono text-xs text-[#A8C4C0]",children:(h==null?void 0:h.id)??e})]}),m||!h?c.jsx("p",{className:"text-sm text-gray-400",children:"Loading…"}):c.jsxs("div",{className:"space-y-4",children:[!h.hasSecret&&c.jsxs("div",{className:"flex items-start gap-2 rounded-md border border-amber-500/40 bg-amber-500/10 px-3 py-2 text-sm text-amber-200",children:[c.jsx(Rr,{className:"mt-0.5 h-4 w-4 shrink-0"}),c.jsx("p",{children:"No key is stored in your vault for this credential. Paste a key below to save it — the value is never shown after saving."})]}),c.jsxs("div",{className:"space-y-2",children:[c.jsx(Qe,{htmlFor:"credential-detail-name",className:"text-[#CFEAE6]",children:"Name"}),c.jsx(at,{id:"credential-detail-name",value:i,onChange:b=>s(b.target.value),className:"border-white/15 bg-[#0F0F0C] text-[#E8F6F4] placeholder:text-[#6B8581]"})]}),c.jsxs("div",{className:"space-y-2",children:[c.jsx(Qe,{htmlFor:"credential-detail-key",className:"text-[#CFEAE6]",children:h.hasSecret?"Rotate API key":"API key"}),c.jsx(at,{id:"credential-detail-key",type:"password",placeholder:h.hasSecret?"Leave blank to keep current key":"Paste key from the service dashboard",value:u,onChange:b=>d(b.target.value),className:"border-white/15 bg-[#0F0F0C] text-[#E8F6F4] placeholder:text-[#6B8581]"}),h.hasSecret&&c.jsx("p",{className:"text-xs text-[#6B8581]",children:"Stored securely in Keychain. Enter a new value only when rotating."})]}),c.jsxs("div",{className:"space-y-2",children:[c.jsx(Qe,{htmlFor:"credential-detail-docs",className:"text-[#CFEAE6]",children:"Documentation link"}),c.jsxs("div",{className:"flex gap-2",children:[c.jsx(at,{id:"credential-detail-docs",type:"url",placeholder:"https://…",value:o,onChange:b=>l(b.target.value),className:"border-white/15 bg-[#0F0F0C] text-[#E8F6F4] placeholder:text-[#6B8581]"}),o.trim()&&c.jsx(le,{type:"button",variant:"outline",size:"icon",className:"shrink-0 border-white/15 bg-[#0F0F0C] text-[#A8C4C0] hover:bg-white/5",onClick:()=>window.open(o.trim(),"_blank","noopener,noreferrer"),title:"Open documentation",children:c.jsx(Xa,{className:"h-4 w-4"})})]})]}),c.jsx(le,{variant:"ghost",className:`w-full border-2 hover:opacity-90 ${ha}`,style:ma(Qn),onClick:()=>y.mutate(),disabled:!p||y.isPending,children:y.isPending?"Saving…":"Save changes"})]})]})})}const oF=Ym("inline-flex items-center rounded-full border px-2.5 py-0.5 text-xs font-semibold transition-colors focus:outline-none focus:ring-2 focus:ring-ring focus:ring-offset-2",{variants:{variant:{default:"border-transparent bg-primary text-primary-foreground hover:bg-primary/80",secondary:"border-transparent bg-secondary text-secondary-foreground hover:bg-secondary/80",destructive:"border-transparent bg-destructive text-destructive-foreground hover:bg-destructive/80",outline:"text-foreground"}},defaultVariants:{variant:"default"}});function mn({className:e,variant:t,...n}){return c.jsx("div",{className:Te(oF({variant:t}),e),...n})}function Z_(e,t){if(typeof e=="function")return e(t);e!=null&&(e.current=t)}function lF(...e){return t=>{let n=!1;const r=e.map(a=>{const i=Z_(a,t);return!n&&typeof i=="function"&&(n=!0),i});if(n)return()=>{for(let a=0;a<r.length;a++){const i=r[a];typeof i=="function"?i():Z_(e[a],null)}}}}function bx(...e){return x.useCallback(lF(...e),e)}function cF(e,t=[]){let n=[];function r(i,s){const o=x.createContext(s);o.displayName=i+"Context";const l=n.length;n=[...n,s];const u=f=>{var g;const{scope:m,children:h,...y}=f,p=((g=m==null?void 0:m[e])==null?void 0:g[l])||o,b=x.useMemo(()=>y,Object.values(y));return c.jsx(p.Provider,{value:b,children:h})};u.displayName=i+"Provider";function d(f,m,h={}){var g;const{optional:y=!1}=h,p=((g=m==null?void 0:m[e])==null?void 0:g[l])||o,b=x.useContext(p);if(b)return b;if(s!==void 0)return s;if(!y)throw new Error(`\`${f}\` must be used within \`${i}\``)}return[u,d]}const a=()=>{const i=n.map(s=>x.createContext(s));return function(o){const l=(o==null?void 0:o[e])||i;return x.useMemo(()=>({[`__scope${e}`]:{...o,[e]:l}}),[o,l])}};return a.scopeName=e,[r,uF(a,...t)]}function uF(...e){const t=e[0];if(e.length===1)return t;const n=()=>{const r=e.map(a=>({useScope:a(),scopeName:a.scopeName}));return function(i){const s=r.reduce((o,{useScope:l,scopeName:u})=>{const f=l(i)[`__scope${u}`];return{...o,...f}},{});return x.useMemo(()=>({[`__scope${t.scopeName}`]:s}),[s])}};return n.scopeName=t.scopeName,n}function G_(e,t,{checkForDefaultPrevented:n=!0}={}){return function(a){if(e==null||e(a),n===!1||!a||!a.defaultPrevented)return t==null?void 0:t(a)}}var em=globalThis!=null&&globalThis.document?x.useLayoutEffect:()=>{},dF=id[" useInsertionEffect ".trim().toString()]||em;function fF({prop:e,defaultProp:t,onChange:n=()=>{},caller:r}){const[a,i,s]=hF({defaultProp:t,onChange:n}),o=e!==void 0,l=o?e:a;{const d=x.useRef(e!==void 0);x.useEffect(()=>{const f=d.current;f!==o&&console.warn(`${r} is changing from ${f?"controlled":"uncontrolled"} to ${o?"controlled":"uncontrolled"}. Components should not switch from controlled to uncontrolled (or vice versa). Decide between using a controlled or uncontrolled value for the lifetime of the component.`),d.current=o},[o,r])}const u=x.useCallback(d=>{var f;if(o){const m=mF(d)?d(e):d;m!==e&&((f=s.current)==null||f.call(s,m))}else i(d)},[o,e,i,s]);return[l,u]}function hF({defaultProp:e,onChange:t}){const[n,r]=x.useState(e),a=x.useRef(n),i=x.useRef(t);return dF(()=>{i.current=t},[t]),x.useEffect(()=>{var s;a.current!==n&&((s=i.current)==null||s.call(i,n),a.current=n)},[n,a]),[n,r,i]}function mF(e){return typeof e=="function"}function pF(e){const t=x.useRef({value:e,previous:e});return x.useMemo(()=>(t.current.value!==e&&(t.current.previous=t.current.value,t.current.value=e),t.current.previous),[e])}function gF(e){const[t,n]=x.useState(void 0);return em(()=>{if(e){n({width:e.offsetWidth,height:e.offsetHeight});const r=new ResizeObserver(a=>{if(!Array.isArray(a)||!a.length)return;const i=a[0];let s,o;if("borderBoxSize"in i){const l=i.borderBoxSize,u=Array.isArray(l)?l[0]:l;s=u.inlineSize,o=u.blockSize}else s=e.offsetWidth,o=e.offsetHeight;n({width:s,height:o})});return r.observe(e,{box:"border-box"}),()=>r.unobserve(e)}else n(void 0)},[e]),t}function yF(e,t){return x.useReducer((n,r)=>t[n][r]??n,e)}var kR=e=>{const{present:t,children:n}=e,r=vF(t),a=typeof n=="function"?n({present:r.isPresent}):x.Children.only(n),i=bF(r.ref,xF(a));return typeof n=="function"||r.isPresent?x.cloneElement(a,{ref:i}):null};kR.displayName="Presence";function vF(e){const[t,n]=x.useState(),r=x.useRef(null),a=x.useRef(e),i=x.useRef("none"),s=x.useRef(void 0),o=e?"mounted":"unmounted",[l,u]=yF(o,{mounted:{UNMOUNT:"unmounted",ANIMATION_OUT:"unmountSuspended"},unmountSuspended:{MOUNT:"mounted",ANIMATION_END:"unmounted"},unmounted:{MOUNT:"mounted"}});return x.useEffect(()=>{l==="mounted"?(i.current=s.current??zc(r.current),s.current=void 0):i.current="none"},[l]),em(()=>{const d=r.current,f=a.current;if(f!==e){const h=i.current,y=zc(d);e?(s.current=y,u("MOUNT")):y==="none"||(d==null?void 0:d.display)==="none"?u("UNMOUNT"):u(f&&h!==y?"ANIMATION_OUT":"UNMOUNT"),a.current=e}},[e,u]),em(()=>{if(t){let d;const f=t.ownerDocument.defaultView??window,m=y=>{const b=zc(r.current).includes(CSS.escape(y.animationName));if(y.target===t&&b&&(u("ANIMATION_END"),!a.current)){const g=t.style.animationFillMode;t.style.animationFillMode="forwards",d=f.setTimeout(()=>{t.style.animationFillMode==="forwards"&&(t.style.animationFillMode=g)})}},h=y=>{y.target===t&&(i.current=zc(r.current))};return t.addEventListener("animationstart",h),t.addEventListener("animationcancel",m),t.addEventListener("animationend",m),()=>{f.clearTimeout(d),t.removeEventListener("animationstart",h),t.removeEventListener("animationcancel",m),t.removeEventListener("animationend",m)}}else u("ANIMATION_END")},[t,u]),{isPresent:["mounted","unmountSuspended"].includes(l),ref:x.useCallback(d=>{if(d){const f=getComputedStyle(d);r.current=f,s.current=zc(f)}else r.current=null;n(d)},[])}}function Q_(e,t){if(typeof e=="function")return e(t);e!=null&&(e.current=t)}function bF(...e){const t=x.useRef(e);return t.current=e,x.useCallback(n=>{const r=t.current;let a=!1;const i=r.map(s=>{const o=Q_(s,n);return!a&&typeof o=="function"&&(a=!0),o});if(a)return()=>{for(let s=0;s<i.length;s++){const o=i[s];typeof o=="function"?o():Q_(r[s],null)}}},[])}function zc(e){return(e==null?void 0:e.animationName)||"none"}function xF(e){var r,a;let t=(r=Object.getOwnPropertyDescriptor(e.props,"ref"))==null?void 0:r.get,n=t&&"isReactWarning"in t&&t.isReactWarning;return n?e.ref:(t=(a=Object.getOwnPropertyDescriptor(e,"ref"))==null?void 0:a.get,n=t&&"isReactWarning"in t&&t.isReactWarning,n?e.props.ref:e.props.ref||e.ref)}function wF(e){const t=x.forwardRef((n,r)=>{let{children:a,...i}=n,s=null,o=!1;const l=[];Y_(a)&&typeof gf=="function"&&(a=gf(a._payload)),x.Children.forEach(a,m=>{var h;if(CF(m)){o=!0;const y=m;let p="child"in y.props?y.props.child:y.props.children;Y_(p)&&typeof gf=="function"&&(p=gf(p._payload)),s=_F(y,p),l.push((h=s==null?void 0:s.props)==null?void 0:h.children)}else l.push(m)}),s?s=x.cloneElement(s,void 0,l):!o&&x.Children.count(a)===1&&x.isValidElement(a)&&(s=a);const u=s?EF(s):void 0,d=bx(r,u);if(!s){if(a||a===0)throw new Error(o?AF(e):TF(e));return a}const f=kF(i,s.props??{});return s.type!==x.Fragment&&(f.ref=r?d:u),x.cloneElement(s,f)});return t.displayName=`${e}.Slot`,t}var SF=Symbol.for("radix.slottable"),_F=(e,t)=>{if("child"in e.props){const n=e.props.child;return x.isValidElement(n)?x.cloneElement(n,void 0,e.props.children(n.props.children)):null}return x.isValidElement(t)?t:null};function kF(e,t){const n={...t};for(const r in t){const a=e[r],i=t[r];/^on[A-Z]/.test(r)?a&&i?n[r]=(...o)=>{const l=i(...o);return a(...o),l}:a&&(n[r]=a):r==="style"?n[r]={...a,...i}:r==="className"&&(n[r]=[a,i].filter(Boolean).join(" "))}return{...e,...n}}function EF(e){var r,a;let t=(r=Object.getOwnPropertyDescriptor(e.props,"ref"))==null?void 0:r.get,n=t&&"isReactWarning"in t&&t.isReactWarning;return n?e.ref:(t=(a=Object.getOwnPropertyDescriptor(e,"ref"))==null?void 0:a.get,n=t&&"isReactWarning"in t&&t.isReactWarning,n?e.props.ref:e.props.ref||e.ref)}function CF(e){return x.isValidElement(e)&&typeof e.type=="function"&&"__radixId"in e.type&&e.type.__radixId===SF}var NF=Symbol.for("react.lazy");function Y_(e){return e!=null&&typeof e=="object"&&"$$typeof"in e&&e.$$typeof===NF&&"_payload"in e&&jF(e._payload)}function jF(e){return typeof e=="object"&&e!==null&&"then"in e}var TF=e=>`${e} failed to slot onto its children. Expected a single React element child or \`Slottable\`.`,AF=e=>`${e} failed to slot onto its \`Slottable\`. Expected \`Slottable\` to receive a single React element child.`,gf=id[" use ".trim().toString()],RF=["a","button","div","form","h2","h3","img","input","label","li","nav","ol","p","select","span","svg","ul"],xx=RF.reduce((e,t)=>{const n=wF(`Primitive.${t}`),r=x.forwardRef((a,i)=>{const{asChild:s,...o}=a,l=s?n:t;return typeof window<"u"&&(window[Symbol.for("radix-ui")]=!0),c.jsx(l,{...o,ref:i})});return r.displayName=`Primitive.${t}`,{...e,[t]:r}},{}),dp="Checkbox",[$F,bie]=cF(dp),[OF,wx]=$F(dp);function MF(e){const{__scopeCheckbox:t,checked:n,children:r,defaultChecked:a,disabled:i,form:s,name:o,onCheckedChange:l,required:u,value:d="on",internal_do_not_use_render:f}=e,[m,h]=fF({prop:n,defaultProp:a??!1,onChange:l,caller:dp}),[y,p]=x.useState(null),[b,g]=x.useState(null),v=x.useRef(!1),w=y?!!s||!!y.closest("form"):!0,S={checked:m,disabled:i,setChecked:h,control:y,setControl:p,name:o,form:s,value:d,hasConsumerStoppedPropagationRef:v,required:u,defaultChecked:os(a)?!1:a,isFormControl:w,bubbleInput:b,setBubbleInput:g};return c.jsx(OF,{scope:t,...S,children:PF(f)?f(S):r})}var ER="CheckboxTrigger",CR=x.forwardRef(({__scopeCheckbox:e,onKeyDown:t,onClick:n,...r},a)=>{const{control:i,value:s,disabled:o,checked:l,required:u,setControl:d,setChecked:f,hasConsumerStoppedPropagationRef:m,isFormControl:h,bubbleInput:y}=wx(ER,e),p=bx(a,d),b=x.useRef(l);return x.useEffect(()=>{const g=i==null?void 0:i.form;if(g){const v=()=>f(b.current);return g.addEventListener("reset",v),()=>g.removeEventListener("reset",v)}},[i,f]),c.jsx(xx.button,{type:"button",role:"checkbox","aria-checked":os(l)?"mixed":l,"aria-required":u,"data-state":RR(l),"data-disabled":o?"":void 0,disabled:o,value:s,...r,ref:p,onKeyDown:G_(t,g=>{g.key==="Enter"&&g.preventDefault()}),onClick:G_(n,g=>{f(v=>os(v)?!0:!v),y&&h&&(m.current=g.isPropagationStopped(),m.current||g.stopPropagation())})})});CR.displayName=ER;var Sx=x.forwardRef((e,t)=>{const{__scopeCheckbox:n,name:r,checked:a,defaultChecked:i,required:s,disabled:o,value:l,onCheckedChange:u,form:d,...f}=e;return c.jsx(MF,{__scopeCheckbox:n,checked:a,defaultChecked:i,disabled:o,required:s,onCheckedChange:u,name:r,form:d,value:l,internal_do_not_use_render:({isFormControl:m})=>c.jsxs(c.Fragment,{children:[c.jsx(CR,{...f,ref:t,__scopeCheckbox:n}),m&&c.jsx(AR,{__scopeCheckbox:n})]})})});Sx.displayName=dp;var NR="CheckboxIndicator",jR=x.forwardRef((e,t)=>{const{__scopeCheckbox:n,forceMount:r,...a}=e,i=wx(NR,n);return c.jsx(kR,{present:r||os(i.checked)||i.checked===!0,children:c.jsx(xx.span,{"data-state":RR(i.checked),"data-disabled":i.disabled?"":void 0,...a,ref:t,style:{pointerEvents:"none",...e.style}})})});jR.displayName=NR;var TR="CheckboxBubbleInput",AR=x.forwardRef(({__scopeCheckbox:e,...t},n)=>{const{control:r,hasConsumerStoppedPropagationRef:a,checked:i,defaultChecked:s,required:o,disabled:l,name:u,value:d,form:f,bubbleInput:m,setBubbleInput:h}=wx(TR,e),y=bx(n,h),p=pF(i),b=gF(r);x.useEffect(()=>{const v=m;if(!v)return;const w=window.HTMLInputElement.prototype,E=Object.getOwnPropertyDescriptor(w,"checked").set,C=!a.current;if(p!==i&&E){const T=new Event("click",{bubbles:C});v.indeterminate=os(i),E.call(v,os(i)?!1:i),v.dispatchEvent(T)}},[m,p,i,a]);const g=x.useRef(os(i)?!1:i);return c.jsx(xx.input,{type:"checkbox","aria-hidden":!0,defaultChecked:s??g.current,required:o,disabled:l,name:u,value:d,form:f,...t,tabIndex:-1,ref:y,style:{...t.style,...b,position:"absolute",pointerEvents:"none",opacity:0,margin:0,transform:"translateX(-100%)"}})});AR.displayName=TR;function PF(e){return typeof e=="function"}function os(e){return e==="indeterminate"}function RR(e){return os(e)?"indeterminate":e?"checked":"unchecked"}const tm=x.forwardRef(({className:e,...t},n)=>c.jsx(Sx,{ref:n,className:Te("peer h-4 w-4 shrink-0 rounded-sm border border-primary ring-offset-background focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-ring focus-visible:ring-offset-2 disabled:cursor-not-allowed disabled:opacity-50 data-[state=checked]:bg-primary data-[state=checked]:text-primary-foreground",e),...t,children:c.jsx(jR,{className:Te("flex items-center justify-center text-current"),children:c.jsx(fT,{className:"h-4 w-4"})})}));tm.displayName=Sx.displayName;const $R=x.forwardRef(({className:e,...t},n)=>c.jsx("div",{className:"relative w-full overflow-auto",children:c.jsx("table",{ref:n,className:Te("w-full caption-bottom text-sm",e),...t})}));$R.displayName="Table";const OR=x.forwardRef(({className:e,...t},n)=>c.jsx("thead",{ref:n,className:Te("[&_tr]:border-b",e),...t}));OR.displayName="TableHeader";const MR=x.forwardRef(({className:e,...t},n)=>c.jsx("tbody",{ref:n,className:Te("[&_tr:last-child]:border-0",e),...t}));MR.displayName="TableBody";const DF=x.forwardRef(({className:e,...t},n)=>c.jsx("tfoot",{ref:n,className:Te("border-t bg-muted/50 font-medium [&>tr]:last:border-b-0",e),...t}));DF.displayName="TableFooter";const qo=x.forwardRef(({className:e,...t},n)=>c.jsx("tr",{ref:n,className:Te("border-b transition-colors hover:bg-muted/50 data-[state=selected]:bg-muted",e),...t}));qo.displayName="TableRow";const th=x.forwardRef(({className:e,...t},n)=>c.jsx("th",{ref:n,className:Te("h-12 px-4 text-left align-middle font-medium text-muted-foreground [&:has([role=checkbox])]:pr-0",e),...t}));th.displayName="TableHead";const Ps=x.forwardRef(({className:e,...t},n)=>c.jsx("td",{ref:n,className:Te("p-4 align-middle [&:has([role=checkbox])]:pr-0",e),...t}));Ps.displayName="TableCell";const zF=x.forwardRef(({className:e,...t},n)=>c.jsx("caption",{ref:n,className:Te("mt-4 text-sm text-muted-foreground",e),...t}));zF.displayName="TableCaption";function IF(e,t){const n={};return(e[e.length-1]===""?[...e,""]:e).join((n.padRight?" ":"")+","+(n.padLeft===!1?"":" ")).trim()}const LF=/^[$_\p{ID_Start}][$_\u{200C}\u{200D}\p{ID_Continue}]*$/u,UF=/^[$_\p{ID_Start}][-$_\u{200C}\u{200D}\p{ID_Continue}]*$/u,FF={};function X_(e,t){return(FF.jsx?UF:LF).test(e)}const qF=/[ \t\n\f\r]/g;function HF(e){return typeof e=="object"?e.type==="text"?W_(e.value):!1:W_(e)}function W_(e){return e.replace(qF,"")===""}class Cd{constructor(t,n,r){this.normal=n,this.property=t,r&&(this.space=r)}}Cd.prototype.normal={};Cd.prototype.property={};Cd.prototype.space=void 0;function PR(e,t){const n={},r={};for(const a of e)Object.assign(n,a.property),Object.assign(r,a.normal);return new Cd(n,r,t)}function Lv(e){return e.toLowerCase()}class nr{constructor(t,n){this.attribute=n,this.property=t}}nr.prototype.attribute="";nr.prototype.booleanish=!1;nr.prototype.boolean=!1;nr.prototype.commaOrSpaceSeparated=!1;nr.prototype.commaSeparated=!1;nr.prototype.defined=!1;nr.prototype.mustUseProperty=!1;nr.prototype.number=!1;nr.prototype.overloadedBoolean=!1;nr.prototype.property="";nr.prototype.spaceSeparated=!1;nr.prototype.space=void 0;let BF=0;const $e=To(),Bt=To(),Uv=To(),ie=To(),ct=To(),ro=To(),ir=To();function To(){return 2**++BF}const Fv=Object.freeze(Object.defineProperty({__proto__:null,boolean:$e,booleanish:Bt,commaOrSpaceSeparated:ir,commaSeparated:ro,number:ie,overloadedBoolean:Uv,spaceSeparated:ct},Symbol.toStringTag,{value:"Module"})),Dg=Object.keys(Fv);class _x extends nr{constructor(t,n,r,a){let i=-1;if(super(t,n),J_(this,"space",a),typeof r=="number")for(;++i<Dg.length;){const s=Dg[i];J_(this,Dg[i],(r&Fv[s])===Fv[s])}}}_x.prototype.defined=!0;function J_(e,t,n){n&&(e[t]=n)}function xc(e){const t={},n={};for(const[r,a]of Object.entries(e.properties)){const i=new _x(r,e.transform(e.attributes||{},r),a,e.space);e.mustUseProperty&&e.mustUseProperty.includes(r)&&(i.mustUseProperty=!0),t[r]=i,n[Lv(r)]=r,n[Lv(i.attribute)]=r}return new Cd(t,n,e.space)}const DR=xc({properties:{ariaActiveDescendant:null,ariaAtomic:Bt,ariaAutoComplete:null,ariaBusy:Bt,ariaChecked:Bt,ariaColCount:ie,ariaColIndex:ie,ariaColSpan:ie,ariaControls:ct,ariaCurrent:null,ariaDescribedBy:ct,ariaDetails:null,ariaDisabled:Bt,ariaDropEffect:ct,ariaErrorMessage:null,ariaExpanded:Bt,ariaFlowTo:ct,ariaGrabbed:Bt,ariaHasPopup:null,ariaHidden:Bt,ariaInvalid:null,ariaKeyShortcuts:null,ariaLabel:null,ariaLabelledBy:ct,ariaLevel:ie,ariaLive:null,ariaModal:Bt,ariaMultiLine:Bt,ariaMultiSelectable:Bt,ariaOrientation:null,ariaOwns:ct,ariaPlaceholder:null,ariaPosInSet:ie,ariaPressed:Bt,ariaReadOnly:Bt,ariaRelevant:null,ariaRequired:Bt,ariaRoleDescription:ct,ariaRowCount:ie,ariaRowIndex:ie,ariaRowSpan:ie,ariaSelected:Bt,ariaSetSize:ie,ariaSort:null,ariaValueMax:ie,ariaValueMin:ie,ariaValueNow:ie,ariaValueText:null,role:null},transform(e,t){return t==="role"?t:"aria-"+t.slice(4).toLowerCase()}});function zR(e,t){return t in e?e[t]:t}function IR(e,t){return zR(e,t.toLowerCase())}const VF=xc({attributes:{acceptcharset:"accept-charset",classname:"class",htmlfor:"for",httpequiv:"http-equiv"},mustUseProperty:["checked","multiple","muted","selected"],properties:{abbr:null,accept:ro,acceptCharset:ct,accessKey:ct,action:null,allow:null,allowFullScreen:$e,allowPaymentRequest:$e,allowUserMedia:$e,alpha:$e,alt:null,as:null,async:$e,autoCapitalize:null,autoComplete:ct,autoFocus:$e,autoPlay:$e,blocking:ct,capture:null,charSet:null,checked:$e,cite:null,className:ct,closedBy:null,colorSpace:null,cols:ie,colSpan:ie,command:null,commandFor:null,content:null,contentEditable:Bt,controls:$e,controlsList:ct,coords:ie|ro,crossOrigin:null,data:null,dateTime:null,decoding:null,default:$e,defer:$e,dir:null,dirName:null,disabled:$e,download:Uv,draggable:Bt,encType:null,enterKeyHint:null,fetchPriority:null,form:null,formAction:null,formEncType:null,formMethod:null,formNoValidate:$e,formTarget:null,headers:ct,height:ie,hidden:Uv,high:ie,href:null,hrefLang:null,htmlFor:ct,httpEquiv:ct,id:null,imageSizes:null,imageSrcSet:null,inert:$e,inputMode:null,integrity:null,is:null,isMap:$e,itemId:null,itemProp:ct,itemRef:ct,itemScope:$e,itemType:ct,kind:null,label:null,lang:null,language:null,list:null,loading:null,loop:$e,low:ie,manifest:null,max:null,maxLength:ie,media:null,method:null,min:null,minLength:ie,multiple:$e,muted:$e,name:null,nonce:null,noModule:$e,noValidate:$e,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:$e,optimum:ie,pattern:null,ping:ct,placeholder:null,playsInline:$e,popover:null,popoverTarget:null,popoverTargetAction:null,poster:null,preload:null,readOnly:$e,referrerPolicy:null,rel:ct,required:$e,reversed:$e,rows:ie,rowSpan:ie,sandbox:ct,scope:null,scoped:$e,seamless:$e,selected:$e,shadowRootClonable:$e,shadowRootCustomElementRegistry:$e,shadowRootDelegatesFocus:$e,shadowRootMode:null,shadowRootSerializable:$e,shape:null,size:ie,sizes:null,slot:null,span:ie,spellCheck:Bt,src:null,srcDoc:null,srcLang:null,srcSet:null,start:ie,step:null,style:null,tabIndex:ie,target:null,title:null,translate:null,type:null,typeMustMatch:$e,useMap:null,value:Bt,width:ie,wrap:null,writingSuggestions:null,align:null,aLink:null,archive:ct,axis:null,background:null,bgColor:null,border:ie,borderColor:null,bottomMargin:ie,cellPadding:null,cellSpacing:null,char:null,charOff:null,classId:null,clear:null,code:null,codeBase:null,codeType:null,color:null,compact:$e,declare:$e,event:null,face:null,frame:null,frameBorder:null,hSpace:ie,leftMargin:ie,link:null,longDesc:null,lowSrc:null,marginHeight:ie,marginWidth:ie,noResize:$e,noHref:$e,noShade:$e,noWrap:$e,object:null,profile:null,prompt:null,rev:null,rightMargin:ie,rules:null,scheme:null,scrolling:Bt,standby:null,summary:null,text:null,topMargin:ie,valueType:null,version:null,vAlign:null,vLink:null,vSpace:ie,allowTransparency:null,autoCorrect:null,autoSave:null,credentialless:$e,disablePictureInPicture:$e,disableRemotePlayback:$e,exportParts:ro,part:ct,prefix:null,property:null,results:ie,security:null,unselectable:null},space:"html",transform:IR}),KF=xc({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:ir,accentHeight:ie,accumulate:null,additive:null,alignmentBaseline:null,alphabetic:ie,amplitude:ie,arabicForm:null,ascent:ie,attributeName:null,attributeType:null,azimuth:ie,bandwidth:null,baselineShift:null,baseFrequency:null,baseProfile:null,bbox:null,begin:null,bias:ie,by:null,calcMode:null,capHeight:ie,className:ct,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:ie,diffuseConstant:ie,direction:null,display:null,dur:null,divisor:ie,dominantBaseline:null,download:$e,dx:null,dy:null,edgeMode:null,editable:null,elevation:ie,enableBackground:null,end:null,event:null,exponent:ie,externalResourcesRequired:null,fill:null,fillOpacity:ie,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:ro,g2:ro,glyphName:ro,glyphOrientationHorizontal:null,glyphOrientationVertical:null,glyphRef:null,gradientTransform:null,gradientUnits:null,handler:null,hanging:ie,hatchContentUnits:null,hatchUnits:null,height:null,href:null,hrefLang:null,horizAdvX:ie,horizOriginX:ie,horizOriginY:ie,id:null,ideographic:ie,imageRendering:null,initialVisibility:null,in:null,in2:null,intercept:ie,k:ie,k1:ie,k2:ie,k3:ie,k4:ie,kernelMatrix:ir,kernelUnitLength:null,keyPoints:null,keySplines:null,keyTimes:null,kerning:null,lang:null,lengthAdjust:null,letterSpacing:null,lightingColor:null,limitingConeAngle:ie,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:ie,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:ie,overlineThickness:ie,paintOrder:null,panose1:null,path:null,pathLength:ie,patternContentUnits:null,patternTransform:null,patternUnits:null,phase:null,ping:ct,pitch:null,playbackOrder:null,pointerEvents:null,points:null,pointsAtX:ie,pointsAtY:ie,pointsAtZ:ie,preserveAlpha:null,preserveAspectRatio:null,primitiveUnits:null,propagate:null,property:ir,r:null,radius:null,referrerPolicy:null,refX:null,refY:null,rel:ir,rev:ir,renderingIntent:null,repeatCount:null,repeatDur:null,requiredExtensions:ir,requiredFeatures:ir,requiredFonts:ir,requiredFormats:ir,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:ie,specularExponent:ie,spreadMethod:null,spacing:null,startOffset:null,stdDeviation:null,stemh:null,stemv:null,stitchTiles:null,stopColor:null,stopOpacity:null,strikethroughPosition:ie,strikethroughThickness:ie,string:null,stroke:null,strokeDashArray:ir,strokeDashOffset:null,strokeLineCap:null,strokeLineJoin:null,strokeMiterLimit:ie,strokeOpacity:ie,strokeWidth:null,style:null,surfaceScale:ie,syncBehavior:null,syncBehaviorDefault:null,syncMaster:null,syncTolerance:null,syncToleranceDefault:null,systemLanguage:ir,tabIndex:ie,tableValues:null,target:null,targetX:ie,targetY:ie,textAnchor:null,textDecoration:null,textRendering:null,textLength:null,timelineBegin:null,title:null,transformBehavior:null,type:null,typeOf:ir,to:null,transform:null,transformOrigin:null,u1:null,u2:null,underlinePosition:ie,underlineThickness:ie,unicode:null,unicodeBidi:null,unicodeRange:null,unitsPerEm:ie,values:null,vAlphabetic:ie,vMathematical:ie,vectorEffect:null,vHanging:ie,vIdeographic:ie,version:null,vertAdvY:ie,vertOriginX:ie,vertOriginY:ie,viewBox:null,viewTarget:null,visibility:null,width:null,widths:null,wordSpacing:null,writingMode:null,x:null,x1:null,x2:null,xChannelSelector:null,xHeight:ie,y:null,y1:null,y2:null,yChannelSelector:null,z:null,zoomAndPan:null},space:"svg",transform:zR}),LR=xc({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()}}),UR=xc({attributes:{xmlnsxlink:"xmlns:xlink"},properties:{xmlnsXLink:null,xmlns:null},space:"xmlns",transform:IR}),FR=xc({properties:{xmlBase:null,xmlLang:null,xmlSpace:null},space:"xml",transform(e,t){return"xml:"+t.slice(3).toLowerCase()}}),ZF={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"},GF=/[A-Z]/g,ek=/-[a-z]/g,QF=/^data[-\w.:]+$/i;function YF(e,t){const n=Lv(t);let r=t,a=nr;if(n in e.normal)return e.property[e.normal[n]];if(n.length>4&&n.slice(0,4)==="data"&&QF.test(t)){if(t.charAt(4)==="-"){const i=t.slice(5).replace(ek,WF);r="data"+i.charAt(0).toUpperCase()+i.slice(1)}else{const i=t.slice(4);if(!ek.test(i)){let s=i.replace(GF,XF);s.charAt(0)!=="-"&&(s="-"+s),t="data"+s}}a=_x}return new a(r,t)}function XF(e){return"-"+e.toLowerCase()}function WF(e){return e.charAt(1).toUpperCase()}const JF=PR([DR,VF,LR,UR,FR],"html"),kx=PR([DR,KF,LR,UR,FR],"svg");function e8(e){return e.join(" ").trim()}var Ex={},tk=/\/\*[^*]*\*+([^/*][^*]*\*+)*\//g,t8=/\n/g,n8=/^\s*/,r8=/^(\*?[-#/*\\\w]+(\[[0-9a-z_-]+\])?)\s*/,a8=/^:\s*/,i8=/^((?:'(?:\\'|.)*?'|"(?:\\"|.)*?"|\([^)]*?\)|[^};])+)/,s8=/^[;\s]*/,o8=/^\s+|\s+$/g,l8=`
410
+ `,nk="/",rk="*",zs="",c8="comment",u8="declaration";function d8(e,t){if(typeof e!="string")throw new TypeError("First argument must be a string");if(!e)return[];t=t||{};var n=1,r=1;function a(y){var p=y.match(t8);p&&(n+=p.length);var b=y.lastIndexOf(l8);r=~b?y.length-b:r+y.length}function i(){var y={line:n,column:r};return function(p){return p.position=new s(y),u(),p}}function s(y){this.start=y,this.end={line:n,column:r},this.source=t.source}s.prototype.content=e;function o(y){var p=new Error(t.source+":"+n+":"+r+": "+y);if(p.reason=y,p.filename=t.source,p.line=n,p.column=r,p.source=e,!t.silent)throw p}function l(y){var p=y.exec(e);if(p){var b=p[0];return a(b),e=e.slice(b.length),p}}function u(){l(n8)}function d(y){var p;for(y=y||[];p=f();)p!==!1&&y.push(p);return y}function f(){var y=i();if(!(nk!=e.charAt(0)||rk!=e.charAt(1))){for(var p=2;zs!=e.charAt(p)&&(rk!=e.charAt(p)||nk!=e.charAt(p+1));)++p;if(p+=2,zs===e.charAt(p-1))return o("End of comment missing");var b=e.slice(2,p-2);return r+=2,a(b),e=e.slice(p),r+=2,y({type:c8,comment:b})}}function m(){var y=i(),p=l(r8);if(p){if(f(),!l(a8))return o("property missing ':'");var b=l(i8),g=y({type:u8,property:ak(p[0].replace(tk,zs)),value:b?ak(b[0].replace(tk,zs)):zs});return l(s8),g}}function h(){var y=[];d(y);for(var p;p=m();)p!==!1&&(y.push(p),d(y));return y}return u(),h()}function ak(e){return e?e.replace(o8,zs):zs}var f8=d8,h8=hh&&hh.__importDefault||function(e){return e&&e.__esModule?e:{default:e}};Object.defineProperty(Ex,"__esModule",{value:!0});Ex.default=p8;const m8=h8(f8);function p8(e,t){let n=null;if(!e||typeof e!="string")return n;const r=(0,m8.default)(e),a=typeof t=="function";return r.forEach(i=>{if(i.type!=="declaration")return;const{property:s,value:o}=i;a?t(s,o,i):o&&(n=n||{},n[s]=o)}),n}var fp={};Object.defineProperty(fp,"__esModule",{value:!0});fp.camelCase=void 0;var g8=/^--[a-zA-Z0-9_-]+$/,y8=/-([a-z])/g,v8=/^[^-]+$/,b8=/^-(webkit|moz|ms|o|khtml)-/,x8=/^-(ms)-/,w8=function(e){return!e||v8.test(e)||g8.test(e)},S8=function(e,t){return t.toUpperCase()},ik=function(e,t){return"".concat(t,"-")},_8=function(e,t){return t===void 0&&(t={}),w8(e)?e:(e=e.toLowerCase(),t.reactCompat?e=e.replace(x8,ik):e=e.replace(b8,ik),e.replace(y8,S8))};fp.camelCase=_8;var k8=hh&&hh.__importDefault||function(e){return e&&e.__esModule?e:{default:e}},E8=k8(Ex),C8=fp;function qv(e,t){var n={};return!e||typeof e!="string"||(0,E8.default)(e,function(r,a){r&&a&&(n[(0,C8.camelCase)(r,t)]=a)}),n}qv.default=qv;var N8=qv;const j8=ic(N8),qR=HR("end"),Cx=HR("start");function HR(e){return t;function t(n){const r=n&&n.position&&n.position[e]||{};if(typeof r.line=="number"&&r.line>0&&typeof r.column=="number"&&r.column>0)return{line:r.line,column:r.column,offset:typeof r.offset=="number"&&r.offset>-1?r.offset:void 0}}}function T8(e){const t=Cx(e),n=qR(e);if(t&&n)return{start:t,end:n}}function bu(e){return!e||typeof e!="object"?"":"position"in e||"type"in e?sk(e.position):"start"in e||"end"in e?sk(e):"line"in e||"column"in e?Hv(e):""}function Hv(e){return ok(e&&e.line)+":"+ok(e&&e.column)}function sk(e){return Hv(e&&e.start)+"-"+Hv(e&&e.end)}function ok(e){return e&&typeof e=="number"?e:1}class Tn extends Error{constructor(t,n,r){super(),typeof n=="string"&&(r=n,n=void 0);let a="",i={},s=!1;if(n&&("line"in n&&"column"in n?i={place:n}:"start"in n&&"end"in n?i={place:n}:"type"in n?i={ancestors:[n],place:n.position}:i={...n}),typeof t=="string"?a=t:!i.cause&&t&&(s=!0,a=t.message,i.cause=t),!i.ruleId&&!i.source&&typeof r=="string"){const l=r.indexOf(":");l===-1?i.ruleId=r:(i.source=r.slice(0,l),i.ruleId=r.slice(l+1))}if(!i.place&&i.ancestors&&i.ancestors){const l=i.ancestors[i.ancestors.length-1];l&&(i.place=l.position)}const 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=a,this.line=o?o.line:void 0,this.name=bu(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=s&&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}}Tn.prototype.file="";Tn.prototype.name="";Tn.prototype.reason="";Tn.prototype.message="";Tn.prototype.stack="";Tn.prototype.column=void 0;Tn.prototype.line=void 0;Tn.prototype.ancestors=void 0;Tn.prototype.cause=void 0;Tn.prototype.fatal=void 0;Tn.prototype.place=void 0;Tn.prototype.ruleId=void 0;Tn.prototype.source=void 0;const Nx={}.hasOwnProperty,A8=new Map,R8=/[A-Z]/g,$8=new Set(["table","tbody","thead","tfoot","tr"]),O8=new Set(["td","th"]),BR="https://github.com/syntax-tree/hast-util-to-jsx-runtime";function M8(e,t){if(!t||t.Fragment===void 0)throw new TypeError("Expected `Fragment` in options");const n=t.filePath||void 0;let r;if(t.development){if(typeof t.jsxDEV!="function")throw new TypeError("Expected `jsxDEV` in options when `development: true`");r=q8(n,t.jsxDEV)}else{if(typeof t.jsx!="function")throw new TypeError("Expected `jsx` in production options");if(typeof t.jsxs!="function")throw new TypeError("Expected `jsxs` in production options");r=F8(n,t.jsx,t.jsxs)}const a={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"?kx:JF,stylePropertyNameCase:t.stylePropertyNameCase||"dom",tableCellAlignToStyle:t.tableCellAlignToStyle!==!1},i=VR(a,e,void 0);return i&&typeof i!="string"?i:a.create(e,a.Fragment,{children:i||void 0},void 0)}function VR(e,t,n){if(t.type==="element")return P8(e,t,n);if(t.type==="mdxFlowExpression"||t.type==="mdxTextExpression")return D8(e,t);if(t.type==="mdxJsxFlowElement"||t.type==="mdxJsxTextElement")return I8(e,t,n);if(t.type==="mdxjsEsm")return z8(e,t);if(t.type==="root")return L8(e,t,n);if(t.type==="text")return U8(e,t)}function P8(e,t,n){const r=e.schema;let a=r;t.tagName.toLowerCase()==="svg"&&r.space==="html"&&(a=kx,e.schema=a),e.ancestors.push(t);const i=ZR(e,t.tagName,!1),s=H8(e,t);let o=Tx(e,t);return $8.has(t.tagName)&&(o=o.filter(function(l){return typeof l=="string"?!HF(l):!0})),KR(e,s,i,t),jx(s,o),e.ancestors.pop(),e.schema=r,e.create(t,i,s,n)}function D8(e,t){if(t.data&&t.data.estree&&e.evaluater){const r=t.data.estree.body[0];return r.type,e.evaluater.evaluateExpression(r.expression)}Qu(e,t.position)}function z8(e,t){if(t.data&&t.data.estree&&e.evaluater)return e.evaluater.evaluateProgram(t.data.estree);Qu(e,t.position)}function I8(e,t,n){const r=e.schema;let a=r;t.name==="svg"&&r.space==="html"&&(a=kx,e.schema=a),e.ancestors.push(t);const i=t.name===null?e.Fragment:ZR(e,t.name,!0),s=B8(e,t),o=Tx(e,t);return KR(e,s,i,t),jx(s,o),e.ancestors.pop(),e.schema=r,e.create(t,i,s,n)}function L8(e,t,n){const r={};return jx(r,Tx(e,t)),e.create(t,e.Fragment,r,n)}function U8(e,t){return t.value}function KR(e,t,n,r){typeof n!="string"&&n!==e.Fragment&&e.passNode&&(t.node=r)}function jx(e,t){if(t.length>0){const n=t.length>1?t:t[0];n&&(e.children=n)}}function F8(e,t,n){return r;function r(a,i,s,o){const u=Array.isArray(s.children)?n:t;return o?u(i,s,o):u(i,s)}}function q8(e,t){return n;function n(r,a,i,s){const o=Array.isArray(i.children),l=Cx(r);return t(a,i,s,o,{columnNumber:l?l.column-1:void 0,fileName:e,lineNumber:l?l.line:void 0},void 0)}}function H8(e,t){const n={};let r,a;for(a in t.properties)if(a!=="children"&&Nx.call(t.properties,a)){const i=V8(e,a,t.properties[a]);if(i){const[s,o]=i;e.tableCellAlignToStyle&&s==="align"&&typeof o=="string"&&O8.has(t.tagName)?r=o:n[s]=o}}if(r){const i=n.style||(n.style={});i[e.stylePropertyNameCase==="css"?"text-align":"textAlign"]=r}return n}function B8(e,t){const n={};for(const r of t.attributes)if(r.type==="mdxJsxExpressionAttribute")if(r.data&&r.data.estree&&e.evaluater){const i=r.data.estree.body[0];i.type;const s=i.expression;s.type;const o=s.properties[0];o.type,Object.assign(n,e.evaluater.evaluateExpression(o.argument))}else Qu(e,t.position);else{const a=r.name;let i;if(r.value&&typeof r.value=="object")if(r.value.data&&r.value.data.estree&&e.evaluater){const o=r.value.data.estree.body[0];o.type,i=e.evaluater.evaluateExpression(o.expression)}else Qu(e,t.position);else i=r.value===null?!0:r.value;n[a]=i}return n}function Tx(e,t){const n=[];let r=-1;const a=e.passKeys?new Map:A8;for(;++r<t.children.length;){const i=t.children[r];let s;if(e.passKeys){const l=i.type==="element"?i.tagName:i.type==="mdxJsxFlowElement"||i.type==="mdxJsxTextElement"?i.name:void 0;if(l){const u=a.get(l)||0;s=l+"-"+u,a.set(l,u+1)}}const o=VR(e,i,s);o!==void 0&&n.push(o)}return n}function V8(e,t,n){const r=YF(e.schema,t);if(!(n==null||typeof n=="number"&&Number.isNaN(n))){if(Array.isArray(n)&&(n=r.commaSeparated?IF(n):e8(n)),r.property==="style"){let a=typeof n=="object"?n:K8(e,String(n));return e.stylePropertyNameCase==="css"&&(a=Z8(a)),["style",a]}return[e.elementAttributeNameCase==="react"&&r.space?ZF[r.property]||r.property:r.attribute,n]}}function K8(e,t){try{return j8(t,{reactCompat:!0})}catch(n){if(e.ignoreInvalidStyle)return{};const r=n,a=new Tn("Cannot parse `style` attribute",{ancestors:e.ancestors,cause:r,ruleId:"style",source:"hast-util-to-jsx-runtime"});throw a.file=e.filePath||void 0,a.url=BR+"#cannot-parse-style-attribute",a}}function ZR(e,t,n){let r;if(!n)r={type:"Literal",value:t};else if(t.includes(".")){const a=t.split(".");let i=-1,s;for(;++i<a.length;){const o=X_(a[i])?{type:"Identifier",name:a[i]}:{type:"Literal",value:a[i]};s=s?{type:"MemberExpression",object:s,property:o,computed:!!(i&&o.type==="Literal"),optional:!1}:o}r=s}else r=X_(t)&&!/^[a-z]/.test(t)?{type:"Identifier",name:t}:{type:"Literal",value:t};if(r.type==="Literal"){const a=r.value;return Nx.call(e.components,a)?e.components[a]:a}if(e.evaluater)return e.evaluater.evaluateExpression(r);Qu(e)}function Qu(e,t){const n=new Tn("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=BR+"#cannot-handle-mdx-estrees-without-createevaluater",n}function Z8(e){const t={};let n;for(n in e)Nx.call(e,n)&&(t[G8(n)]=e[n]);return t}function G8(e){let t=e.replace(R8,Q8);return t.slice(0,3)==="ms-"&&(t="-"+t),t}function Q8(e){return"-"+e.toLowerCase()}const zg={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"]},Y8={};function Ax(e,t){const n=Y8,r=typeof n.includeImageAlt=="boolean"?n.includeImageAlt:!0,a=typeof n.includeHtml=="boolean"?n.includeHtml:!0;return GR(e,r,a)}function GR(e,t,n){if(X8(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 lk(e.children,t,n)}return Array.isArray(e)?lk(e,t,n):""}function lk(e,t,n){const r=[];let a=-1;for(;++a<e.length;)r[a]=GR(e[a],t,n);return r.join("")}function X8(e){return!!(e&&typeof e=="object")}const ck=document.createElement("i");function Rx(e){const t="&"+e+";";ck.innerHTML=t;const n=ck.textContent;return n.charCodeAt(n.length-1)===59&&e!=="semi"||n===t?!1:n}function yr(e,t,n,r){const a=e.length;let i=0,s;if(t<0?t=-t>a?0:a+t:t=t>a?a:t,n=n>0?n:0,r.length<1e4)s=Array.from(r),s.unshift(t,n),e.splice(...s);else for(n&&e.splice(t,n);i<r.length;)s=r.slice(i,i+1e4),s.unshift(t,0),e.splice(...s),i+=1e4,t+=1e4}function $r(e,t){return e.length>0?(yr(e,e.length,0,t),e):t}const uk={}.hasOwnProperty;function QR(e){const t={};let n=-1;for(;++n<e.length;)W8(t,e[n]);return t}function W8(e,t){let n;for(n in t){const a=(uk.call(e,n)?e[n]:void 0)||(e[n]={}),i=t[n];let s;if(i)for(s in i){uk.call(a,s)||(a[s]=[]);const o=i[s];J8(a[s],Array.isArray(o)?o:o?[o]:[])}}}function J8(e,t){let n=-1;const r=[];for(;++n<t.length;)(t[n].add==="after"?e:r).push(t[n]);yr(e,0,0,r)}function YR(e,t){const 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 ea(e){return e.replace(/[\t\n\r ]+/g," ").replace(/^ | $/g,"").toLowerCase().toUpperCase()}const zn=xs(/[A-Za-z]/),Nn=xs(/[\dA-Za-z]/),eq=xs(/[#-'*+\--9=?A-Z^-~]/);function nm(e){return e!==null&&(e<32||e===127)}const Bv=xs(/\d/),tq=xs(/[\dA-Fa-f]/),nq=xs(/[!-/:-@[-`{-~]/);function Ee(e){return e!==null&&e<-2}function ft(e){return e!==null&&(e<0||e===32)}function Ke(e){return e===-2||e===-1||e===32}const hp=xs(new RegExp("\\p{P}|\\p{S}","u")),go=xs(/\s/);function xs(e){return t;function t(n){return n!==null&&n>-1&&e.test(String.fromCharCode(n))}}function wc(e){const t=[];let n=-1,r=0,a=0;for(;++n<e.length;){const i=e.charCodeAt(n);let s="";if(i===37&&Nn(e.charCodeAt(n+1))&&Nn(e.charCodeAt(n+2)))a=2;else if(i<128)/[!#$&-;=?-Z_a-z~]/.test(String.fromCharCode(i))||(s=String.fromCharCode(i));else if(i>55295&&i<57344){const o=e.charCodeAt(n+1);i<56320&&o>56319&&o<57344?(s=String.fromCharCode(i,o),a=1):s="�"}else s=String.fromCharCode(i);s&&(t.push(e.slice(r,n),encodeURIComponent(s)),r=n+a+1,s=""),a&&(n+=a,a=0)}return t.join("")+e.slice(r)}function We(e,t,n,r){const a=r?r-1:Number.POSITIVE_INFINITY;let i=0;return s;function s(l){return Ke(l)?(e.enter(n),o(l)):t(l)}function o(l){return Ke(l)&&i++<a?(e.consume(l),o):(e.exit(n),t(l))}}const rq={tokenize:aq};function aq(e){const t=e.attempt(this.parser.constructs.contentInitial,r,a);let n;return t;function r(o){if(o===null){e.consume(o);return}return e.enter("lineEnding"),e.consume(o),e.exit("lineEnding"),We(e,t,"linePrefix")}function a(o){return e.enter("paragraph"),i(o)}function i(o){const l=e.enter("chunkText",{contentType:"text",previous:n});return n&&(n.next=l),n=l,s(o)}function s(o){if(o===null){e.exit("chunkText"),e.exit("paragraph"),e.consume(o);return}return Ee(o)?(e.consume(o),e.exit("chunkText"),i):(e.consume(o),s)}}const iq={tokenize:sq},dk={tokenize:oq};function sq(e){const t=this,n=[];let r=0,a,i,s;return o;function o(w){if(r<n.length){const S=n[r];return t.containerState=S[1],e.attempt(S[0].continuation,l,u)(w)}return u(w)}function l(w){if(r++,t.containerState._closeFlow){t.containerState._closeFlow=void 0,a&&v();const S=t.events.length;let E=S,C;for(;E--;)if(t.events[E][0]==="exit"&&t.events[E][1].type==="chunkFlow"){C=t.events[E][1].end;break}g(r);let T=S;for(;T<t.events.length;)t.events[T][1].end={...C},T++;return yr(t.events,E+1,0,t.events.slice(S)),t.events.length=T,u(w)}return o(w)}function u(w){if(r===n.length){if(!a)return m(w);if(a.currentConstruct&&a.currentConstruct.concrete)return y(w);t.interrupt=!!(a.currentConstruct&&!a._gfmTableDynamicInterruptHack)}return t.containerState={},e.check(dk,d,f)(w)}function d(w){return a&&v(),g(r),m(w)}function f(w){return t.parser.lazy[t.now().line]=r!==n.length,s=t.now().offset,y(w)}function m(w){return t.containerState={},e.attempt(dk,h,y)(w)}function h(w){return r++,n.push([t.currentConstruct,t.containerState]),m(w)}function y(w){if(w===null){a&&v(),g(0),e.consume(w);return}return a=a||t.parser.flow(t.now()),e.enter("chunkFlow",{_tokenizer:a,contentType:"flow",previous:i}),p(w)}function p(w){if(w===null){b(e.exit("chunkFlow"),!0),g(0),e.consume(w);return}return Ee(w)?(e.consume(w),b(e.exit("chunkFlow")),r=0,t.interrupt=void 0,o):(e.consume(w),p)}function b(w,S){const E=t.sliceStream(w);if(S&&E.push(null),w.previous=i,i&&(i.next=w),i=w,a.defineSkip(w.start),a.write(E),t.parser.lazy[w.start.line]){let C=a.events.length;for(;C--;)if(a.events[C][1].start.offset<s&&(!a.events[C][1].end||a.events[C][1].end.offset>s))return;const T=t.events.length;let P=T,R,$;for(;P--;)if(t.events[P][0]==="exit"&&t.events[P][1].type==="chunkFlow"){if(R){$=t.events[P][1].end;break}R=!0}for(g(r),C=T;C<t.events.length;)t.events[C][1].end={...$},C++;yr(t.events,P+1,0,t.events.slice(T)),t.events.length=C}}function g(w){let S=n.length;for(;S-- >w;){const E=n[S];t.containerState=E[1],E[0].exit.call(t,e)}n.length=w}function v(){a.write([null]),i=void 0,a=void 0,t.containerState._closeFlow=void 0}}function oq(e,t,n){return We(e,e.attempt(this.parser.constructs.document,t,n),"linePrefix",this.parser.constructs.disable.null.includes("codeIndented")?void 0:4)}function tc(e){if(e===null||ft(e)||go(e))return 1;if(hp(e))return 2}function mp(e,t,n){const r=[];let a=-1;for(;++a<e.length;){const i=e[a].resolveAll;i&&!r.includes(i)&&(t=i(t,n),r.push(i))}return t}const Vv={name:"attention",resolveAll:lq,tokenize:cq};function lq(e,t){let n=-1,r,a,i,s,o,l,u,d;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;l=e[r][1].end.offset-e[r][1].start.offset>1&&e[n][1].end.offset-e[n][1].start.offset>1?2:1;const f={...e[r][1].end},m={...e[n][1].start};fk(f,-l),fk(m,l),s={type:l>1?"strongSequence":"emphasisSequence",start:f,end:{...e[r][1].end}},o={type:l>1?"strongSequence":"emphasisSequence",start:{...e[n][1].start},end:m},i={type:l>1?"strongText":"emphasisText",start:{...e[r][1].end},end:{...e[n][1].start}},a={type:l>1?"strong":"emphasis",start:{...s.start},end:{...o.end}},e[r][1].end={...s.start},e[n][1].start={...o.end},u=[],e[r][1].end.offset-e[r][1].start.offset&&(u=$r(u,[["enter",e[r][1],t],["exit",e[r][1],t]])),u=$r(u,[["enter",a,t],["enter",s,t],["exit",s,t],["enter",i,t]]),u=$r(u,mp(t.parser.constructs.insideSpan.null,e.slice(r+1,n),t)),u=$r(u,[["exit",i,t],["enter",o,t],["exit",o,t],["exit",a,t]]),e[n][1].end.offset-e[n][1].start.offset?(d=2,u=$r(u,[["enter",e[n][1],t],["exit",e[n][1],t]])):d=0,yr(e,r-1,n-r+3,u),n=r+u.length-d-2;break}}for(n=-1;++n<e.length;)e[n][1].type==="attentionSequence"&&(e[n][1].type="data");return e}function cq(e,t){const n=this.parser.constructs.attentionMarkers.null,r=this.previous,a=tc(r);let i;return s;function s(l){return i=l,e.enter("attentionSequence"),o(l)}function o(l){if(l===i)return e.consume(l),o;const u=e.exit("attentionSequence"),d=tc(l),f=!d||d===2&&a||n.includes(l),m=!a||a===2&&d||n.includes(r);return u._open=!!(i===42?f:f&&(a||!m)),u._close=!!(i===42?m:m&&(d||!f)),t(l)}}function fk(e,t){e.column+=t,e.offset+=t,e._bufferIndex+=t}const uq={name:"autolink",tokenize:dq};function dq(e,t,n){let r=0;return a;function a(h){return e.enter("autolink"),e.enter("autolinkMarker"),e.consume(h),e.exit("autolinkMarker"),e.enter("autolinkProtocol"),i}function i(h){return zn(h)?(e.consume(h),s):h===64?n(h):u(h)}function s(h){return h===43||h===45||h===46||Nn(h)?(r=1,o(h)):u(h)}function o(h){return h===58?(e.consume(h),r=0,l):(h===43||h===45||h===46||Nn(h))&&r++<32?(e.consume(h),o):(r=0,u(h))}function l(h){return h===62?(e.exit("autolinkProtocol"),e.enter("autolinkMarker"),e.consume(h),e.exit("autolinkMarker"),e.exit("autolink"),t):h===null||h===32||h===60||nm(h)?n(h):(e.consume(h),l)}function u(h){return h===64?(e.consume(h),d):eq(h)?(e.consume(h),u):n(h)}function d(h){return Nn(h)?f(h):n(h)}function f(h){return h===46?(e.consume(h),r=0,d):h===62?(e.exit("autolinkProtocol").type="autolinkEmail",e.enter("autolinkMarker"),e.consume(h),e.exit("autolinkMarker"),e.exit("autolink"),t):m(h)}function m(h){if((h===45||Nn(h))&&r++<63){const y=h===45?m:f;return e.consume(h),y}return n(h)}}const Nd={partial:!0,tokenize:fq};function fq(e,t,n){return r;function r(i){return Ke(i)?We(e,a,"linePrefix")(i):a(i)}function a(i){return i===null||Ee(i)?t(i):n(i)}}const XR={continuation:{tokenize:mq},exit:pq,name:"blockQuote",tokenize:hq};function hq(e,t,n){const r=this;return a;function a(s){if(s===62){const o=r.containerState;return o.open||(e.enter("blockQuote",{_container:!0}),o.open=!0),e.enter("blockQuotePrefix"),e.enter("blockQuoteMarker"),e.consume(s),e.exit("blockQuoteMarker"),i}return n(s)}function i(s){return Ke(s)?(e.enter("blockQuotePrefixWhitespace"),e.consume(s),e.exit("blockQuotePrefixWhitespace"),e.exit("blockQuotePrefix"),t):(e.exit("blockQuotePrefix"),t(s))}}function mq(e,t,n){const r=this;return a;function a(s){return Ke(s)?We(e,i,"linePrefix",r.parser.constructs.disable.null.includes("codeIndented")?void 0:4)(s):i(s)}function i(s){return e.attempt(XR,t,n)(s)}}function pq(e){e.exit("blockQuote")}const WR={name:"characterEscape",tokenize:gq};function gq(e,t,n){return r;function r(i){return e.enter("characterEscape"),e.enter("escapeMarker"),e.consume(i),e.exit("escapeMarker"),a}function a(i){return nq(i)?(e.enter("characterEscapeValue"),e.consume(i),e.exit("characterEscapeValue"),e.exit("characterEscape"),t):n(i)}}const JR={name:"characterReference",tokenize:yq};function yq(e,t,n){const r=this;let a=0,i,s;return o;function o(f){return e.enter("characterReference"),e.enter("characterReferenceMarker"),e.consume(f),e.exit("characterReferenceMarker"),l}function l(f){return f===35?(e.enter("characterReferenceMarkerNumeric"),e.consume(f),e.exit("characterReferenceMarkerNumeric"),u):(e.enter("characterReferenceValue"),i=31,s=Nn,d(f))}function u(f){return f===88||f===120?(e.enter("characterReferenceMarkerHexadecimal"),e.consume(f),e.exit("characterReferenceMarkerHexadecimal"),e.enter("characterReferenceValue"),i=6,s=tq,d):(e.enter("characterReferenceValue"),i=7,s=Bv,d(f))}function d(f){if(f===59&&a){const m=e.exit("characterReferenceValue");return s===Nn&&!Rx(r.sliceSerialize(m))?n(f):(e.enter("characterReferenceMarker"),e.consume(f),e.exit("characterReferenceMarker"),e.exit("characterReference"),t)}return s(f)&&a++<i?(e.consume(f),d):n(f)}}const hk={partial:!0,tokenize:bq},mk={concrete:!0,name:"codeFenced",tokenize:vq};function vq(e,t,n){const r=this,a={partial:!0,tokenize:E};let i=0,s=0,o;return l;function l(C){return u(C)}function u(C){const T=r.events[r.events.length-1];return i=T&&T[1].type==="linePrefix"?T[2].sliceSerialize(T[1],!0).length:0,o=C,e.enter("codeFenced"),e.enter("codeFencedFence"),e.enter("codeFencedFenceSequence"),d(C)}function d(C){return C===o?(s++,e.consume(C),d):s<3?n(C):(e.exit("codeFencedFenceSequence"),Ke(C)?We(e,f,"whitespace")(C):f(C))}function f(C){return C===null||Ee(C)?(e.exit("codeFencedFence"),r.interrupt?t(C):e.check(hk,p,S)(C)):(e.enter("codeFencedFenceInfo"),e.enter("chunkString",{contentType:"string"}),m(C))}function m(C){return C===null||Ee(C)?(e.exit("chunkString"),e.exit("codeFencedFenceInfo"),f(C)):Ke(C)?(e.exit("chunkString"),e.exit("codeFencedFenceInfo"),We(e,h,"whitespace")(C)):C===96&&C===o?n(C):(e.consume(C),m)}function h(C){return C===null||Ee(C)?f(C):(e.enter("codeFencedFenceMeta"),e.enter("chunkString",{contentType:"string"}),y(C))}function y(C){return C===null||Ee(C)?(e.exit("chunkString"),e.exit("codeFencedFenceMeta"),f(C)):C===96&&C===o?n(C):(e.consume(C),y)}function p(C){return e.attempt(a,S,b)(C)}function b(C){return e.enter("lineEnding"),e.consume(C),e.exit("lineEnding"),g}function g(C){return i>0&&Ke(C)?We(e,v,"linePrefix",i+1)(C):v(C)}function v(C){return C===null||Ee(C)?e.check(hk,p,S)(C):(e.enter("codeFlowValue"),w(C))}function w(C){return C===null||Ee(C)?(e.exit("codeFlowValue"),v(C)):(e.consume(C),w)}function S(C){return e.exit("codeFenced"),t(C)}function E(C,T,P){let R=0;return $;function $(A){return C.enter("lineEnding"),C.consume(A),C.exit("lineEnding"),j}function j(A){return C.enter("codeFencedFence"),Ke(A)?We(C,O,"linePrefix",r.parser.constructs.disable.null.includes("codeIndented")?void 0:4)(A):O(A)}function O(A){return A===o?(C.enter("codeFencedFenceSequence"),z(A)):P(A)}function z(A){return A===o?(R++,C.consume(A),z):R>=s?(C.exit("codeFencedFenceSequence"),Ke(A)?We(C,D,"whitespace")(A):D(A)):P(A)}function D(A){return A===null||Ee(A)?(C.exit("codeFencedFence"),T(A)):P(A)}}}function bq(e,t,n){const r=this;return a;function a(s){return s===null?n(s):(e.enter("lineEnding"),e.consume(s),e.exit("lineEnding"),i)}function i(s){return r.parser.lazy[r.now().line]?n(s):t(s)}}const Ig={name:"codeIndented",tokenize:wq},xq={partial:!0,tokenize:Sq};function wq(e,t,n){const r=this;return a;function a(u){return e.enter("codeIndented"),We(e,i,"linePrefix",5)(u)}function i(u){const d=r.events[r.events.length-1];return d&&d[1].type==="linePrefix"&&d[2].sliceSerialize(d[1],!0).length>=4?s(u):n(u)}function s(u){return u===null?l(u):Ee(u)?e.attempt(xq,s,l)(u):(e.enter("codeFlowValue"),o(u))}function o(u){return u===null||Ee(u)?(e.exit("codeFlowValue"),s(u)):(e.consume(u),o)}function l(u){return e.exit("codeIndented"),t(u)}}function Sq(e,t,n){const r=this;return a;function a(s){return r.parser.lazy[r.now().line]?n(s):Ee(s)?(e.enter("lineEnding"),e.consume(s),e.exit("lineEnding"),a):We(e,i,"linePrefix",5)(s)}function i(s){const o=r.events[r.events.length-1];return o&&o[1].type==="linePrefix"&&o[2].sliceSerialize(o[1],!0).length>=4?t(s):Ee(s)?a(s):n(s)}}const _q={name:"codeText",previous:Eq,resolve:kq,tokenize:Cq};function kq(e){let t=e.length-4,n=3,r,a;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;)a===void 0?r!==t&&e[r][1].type!=="lineEnding"&&(a=r):(r===t||e[r][1].type==="lineEnding")&&(e[a][1].type="codeTextData",r!==a+2&&(e[a][1].end=e[r-1][1].end,e.splice(a+2,r-a-2),t-=r-a-2,r=a+2),a=void 0);return e}function Eq(e){return e!==96||this.events[this.events.length-1][1].type==="characterEscape"}function Cq(e,t,n){let r=0,a,i;return s;function s(f){return e.enter("codeText"),e.enter("codeTextSequence"),o(f)}function o(f){return f===96?(e.consume(f),r++,o):(e.exit("codeTextSequence"),l(f))}function l(f){return f===null?n(f):f===32?(e.enter("space"),e.consume(f),e.exit("space"),l):f===96?(i=e.enter("codeTextSequence"),a=0,d(f)):Ee(f)?(e.enter("lineEnding"),e.consume(f),e.exit("lineEnding"),l):(e.enter("codeTextData"),u(f))}function u(f){return f===null||f===32||f===96||Ee(f)?(e.exit("codeTextData"),l(f)):(e.consume(f),u)}function d(f){return f===96?(e.consume(f),a++,d):a===r?(e.exit("codeTextSequence"),e.exit("codeText"),t(f)):(i.type="codeTextData",u(f))}}class Nq{constructor(t){this.left=t?[...t]:[],this.right=[]}get(t){if(t<0||t>=this.left.length+this.right.length)throw new RangeError("Cannot access index `"+t+"` in a splice buffer of size `"+(this.left.length+this.right.length)+"`");return t<this.left.length?this.left[t]:this.right[this.right.length-t+this.left.length-1]}get length(){return this.left.length+this.right.length}shift(){return this.setCursor(0),this.right.pop()}slice(t,n){const r=n??Number.POSITIVE_INFINITY;return r<this.left.length?this.left.slice(t,r):t>this.left.length?this.right.slice(this.right.length-r+this.left.length,this.right.length-t+this.left.length).reverse():this.left.slice(t).concat(this.right.slice(this.right.length-r+this.left.length).reverse())}splice(t,n,r){const a=n||0;this.setCursor(Math.trunc(t));const i=this.right.splice(this.right.length-a,Number.POSITIVE_INFINITY);return r&&Ic(this.left,r),i.reverse()}pop(){return this.setCursor(Number.POSITIVE_INFINITY),this.left.pop()}push(t){this.setCursor(Number.POSITIVE_INFINITY),this.left.push(t)}pushMany(t){this.setCursor(Number.POSITIVE_INFINITY),Ic(this.left,t)}unshift(t){this.setCursor(0),this.right.push(t)}unshiftMany(t){this.setCursor(0),Ic(this.right,t.reverse())}setCursor(t){if(!(t===this.left.length||t>this.left.length&&this.right.length===0||t<0&&this.left.length===0))if(t<this.left.length){const n=this.left.splice(t,Number.POSITIVE_INFINITY);Ic(this.right,n.reverse())}else{const n=this.right.splice(this.left.length+this.right.length-t,Number.POSITIVE_INFINITY);Ic(this.left,n.reverse())}}}function Ic(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 e$(e){const t={};let n=-1,r,a,i,s,o,l,u;const d=new Nq(e);for(;++n<d.length;){for(;n in t;)n=t[n];if(r=d.get(n),n&&r[1].type==="chunkFlow"&&d.get(n-1)[1].type==="listItemPrefix"&&(l=r[1]._tokenizer.events,i=0,i<l.length&&l[i][1].type==="lineEndingBlank"&&(i+=2),i<l.length&&l[i][1].type==="content"))for(;++i<l.length&&l[i][1].type!=="content";)l[i][1].type==="chunkText"&&(l[i][1]._isInFirstContentOfListItem=!0,i++);if(r[0]==="enter")r[1].contentType&&(Object.assign(t,jq(d,n)),n=t[n],u=!0);else if(r[1]._container){for(i=n,a=void 0;i--;)if(s=d.get(i),s[1].type==="lineEnding"||s[1].type==="lineEndingBlank")s[0]==="enter"&&(a&&(d.get(a)[1].type="lineEndingBlank"),s[1].type="lineEnding",a=i);else if(!(s[1].type==="linePrefix"||s[1].type==="listItemIndent"))break;a&&(r[1].end={...d.get(a)[1].start},o=d.slice(a,n),o.unshift(r),d.splice(a,n-a+1,o))}}return yr(e,0,Number.POSITIVE_INFINITY,d.slice(0)),!u}function jq(e,t){const n=e.get(t)[1],r=e.get(t)[2];let a=t-1;const i=[];let s=n._tokenizer;s||(s=r.parser[n.contentType](n.start),n._contentTypeTextTrailing&&(s._contentTypeTextTrailing=!0));const o=s.events,l=[],u={};let d,f,m=-1,h=n,y=0,p=0;const b=[p];for(;h;){for(;e.get(++a)[1]!==h;);i.push(a),h._tokenizer||(d=r.sliceStream(h),h.next||d.push(null),f&&s.defineSkip(h.start),h._isInFirstContentOfListItem&&(s._gfmTasklistFirstContentOfListItem=!0),s.write(d),h._isInFirstContentOfListItem&&(s._gfmTasklistFirstContentOfListItem=void 0)),f=h,h=h.next}for(h=n;++m<o.length;)o[m][0]==="exit"&&o[m-1][0]==="enter"&&o[m][1].type===o[m-1][1].type&&o[m][1].start.line!==o[m][1].end.line&&(p=m+1,b.push(p),h._tokenizer=void 0,h.previous=void 0,h=h.next);for(s.events=[],h?(h._tokenizer=void 0,h.previous=void 0):b.pop(),m=b.length;m--;){const g=o.slice(b[m],b[m+1]),v=i.pop();l.push([v,v+g.length-1]),e.splice(v,2,g)}for(l.reverse(),m=-1;++m<l.length;)u[y+l[m][0]]=y+l[m][1],y+=l[m][1]-l[m][0]-1;return u}const Tq={resolve:Rq,tokenize:$q},Aq={partial:!0,tokenize:Oq};function Rq(e){return e$(e),e}function $q(e,t){let n;return r;function r(o){return e.enter("content"),n=e.enter("chunkContent",{contentType:"content"}),a(o)}function a(o){return o===null?i(o):Ee(o)?e.check(Aq,s,i)(o):(e.consume(o),a)}function i(o){return e.exit("chunkContent"),e.exit("content"),t(o)}function s(o){return e.consume(o),e.exit("chunkContent"),n.next=e.enter("chunkContent",{contentType:"content",previous:n}),n=n.next,a}}function Oq(e,t,n){const r=this;return a;function a(s){return e.exit("chunkContent"),e.enter("lineEnding"),e.consume(s),e.exit("lineEnding"),We(e,i,"linePrefix")}function i(s){if(s===null||Ee(s))return n(s);const o=r.events[r.events.length-1];return!r.parser.constructs.disable.null.includes("codeIndented")&&o&&o[1].type==="linePrefix"&&o[2].sliceSerialize(o[1],!0).length>=4?t(s):e.interrupt(r.parser.constructs.flow,n,t)(s)}}function t$(e,t,n,r,a,i,s,o,l){const u=l||Number.POSITIVE_INFINITY;let d=0;return f;function f(g){return g===60?(e.enter(r),e.enter(a),e.enter(i),e.consume(g),e.exit(i),m):g===null||g===32||g===41||nm(g)?n(g):(e.enter(r),e.enter(s),e.enter(o),e.enter("chunkString",{contentType:"string"}),p(g))}function m(g){return g===62?(e.enter(i),e.consume(g),e.exit(i),e.exit(a),e.exit(r),t):(e.enter(o),e.enter("chunkString",{contentType:"string"}),h(g))}function h(g){return g===62?(e.exit("chunkString"),e.exit(o),m(g)):g===null||g===60||Ee(g)?n(g):(e.consume(g),g===92?y:h)}function y(g){return g===60||g===62||g===92?(e.consume(g),h):h(g)}function p(g){return!d&&(g===null||g===41||ft(g))?(e.exit("chunkString"),e.exit(o),e.exit(s),e.exit(r),t(g)):d<u&&g===40?(e.consume(g),d++,p):g===41?(e.consume(g),d--,p):g===null||g===32||g===40||nm(g)?n(g):(e.consume(g),g===92?b:p)}function b(g){return g===40||g===41||g===92?(e.consume(g),p):p(g)}}function n$(e,t,n,r,a,i){const s=this;let o=0,l;return u;function u(h){return e.enter(r),e.enter(a),e.consume(h),e.exit(a),e.enter(i),d}function d(h){return o>999||h===null||h===91||h===93&&!l||h===94&&!o&&"_hiddenFootnoteSupport"in s.parser.constructs?n(h):h===93?(e.exit(i),e.enter(a),e.consume(h),e.exit(a),e.exit(r),t):Ee(h)?(e.enter("lineEnding"),e.consume(h),e.exit("lineEnding"),d):(e.enter("chunkString",{contentType:"string"}),f(h))}function f(h){return h===null||h===91||h===93||Ee(h)||o++>999?(e.exit("chunkString"),d(h)):(e.consume(h),l||(l=!Ke(h)),h===92?m:f)}function m(h){return h===91||h===92||h===93?(e.consume(h),o++,f):f(h)}}function r$(e,t,n,r,a,i){let s;return o;function o(m){return m===34||m===39||m===40?(e.enter(r),e.enter(a),e.consume(m),e.exit(a),s=m===40?41:m,l):n(m)}function l(m){return m===s?(e.enter(a),e.consume(m),e.exit(a),e.exit(r),t):(e.enter(i),u(m))}function u(m){return m===s?(e.exit(i),l(s)):m===null?n(m):Ee(m)?(e.enter("lineEnding"),e.consume(m),e.exit("lineEnding"),We(e,u,"linePrefix")):(e.enter("chunkString",{contentType:"string"}),d(m))}function d(m){return m===s||m===null||Ee(m)?(e.exit("chunkString"),u(m)):(e.consume(m),m===92?f:d)}function f(m){return m===s||m===92?(e.consume(m),d):d(m)}}function xu(e,t){let n;return r;function r(a){return Ee(a)?(e.enter("lineEnding"),e.consume(a),e.exit("lineEnding"),n=!0,r):Ke(a)?We(e,r,n?"linePrefix":"lineSuffix")(a):t(a)}}const Mq={name:"definition",tokenize:Dq},Pq={partial:!0,tokenize:zq};function Dq(e,t,n){const r=this;let a;return i;function i(h){return e.enter("definition"),s(h)}function s(h){return n$.call(r,e,o,n,"definitionLabel","definitionLabelMarker","definitionLabelString")(h)}function o(h){return a=ea(r.sliceSerialize(r.events[r.events.length-1][1]).slice(1,-1)),h===58?(e.enter("definitionMarker"),e.consume(h),e.exit("definitionMarker"),l):n(h)}function l(h){return ft(h)?xu(e,u)(h):u(h)}function u(h){return t$(e,d,n,"definitionDestination","definitionDestinationLiteral","definitionDestinationLiteralMarker","definitionDestinationRaw","definitionDestinationString")(h)}function d(h){return e.attempt(Pq,f,f)(h)}function f(h){return Ke(h)?We(e,m,"whitespace")(h):m(h)}function m(h){return h===null||Ee(h)?(e.exit("definition"),r.parser.defined.push(a),t(h)):n(h)}}function zq(e,t,n){return r;function r(o){return ft(o)?xu(e,a)(o):n(o)}function a(o){return r$(e,i,n,"definitionTitle","definitionTitleMarker","definitionTitleString")(o)}function i(o){return Ke(o)?We(e,s,"whitespace")(o):s(o)}function s(o){return o===null||Ee(o)?t(o):n(o)}}const Iq={name:"hardBreakEscape",tokenize:Lq};function Lq(e,t,n){return r;function r(i){return e.enter("hardBreakEscape"),e.consume(i),a}function a(i){return Ee(i)?(e.exit("hardBreakEscape"),t(i)):n(i)}}const Uq={name:"headingAtx",resolve:Fq,tokenize:qq};function Fq(e,t){let n=e.length-2,r=3,a,i;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&&(a={type:"atxHeadingText",start:e[r][1].start,end:e[n][1].end},i={type:"chunkText",start:e[r][1].start,end:e[n][1].end,contentType:"text"},yr(e,r,n-r+1,[["enter",a,t],["enter",i,t],["exit",i,t],["exit",a,t]])),e}function qq(e,t,n){let r=0;return a;function a(d){return e.enter("atxHeading"),i(d)}function i(d){return e.enter("atxHeadingSequence"),s(d)}function s(d){return d===35&&r++<6?(e.consume(d),s):d===null||ft(d)?(e.exit("atxHeadingSequence"),o(d)):n(d)}function o(d){return d===35?(e.enter("atxHeadingSequence"),l(d)):d===null||Ee(d)?(e.exit("atxHeading"),t(d)):Ke(d)?We(e,o,"whitespace")(d):(e.enter("atxHeadingText"),u(d))}function l(d){return d===35?(e.consume(d),l):(e.exit("atxHeadingSequence"),o(d))}function u(d){return d===null||d===35||ft(d)?(e.exit("atxHeadingText"),o(d)):(e.consume(d),u)}}const Hq=["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"],pk=["pre","script","style","textarea"],Bq={concrete:!0,name:"htmlFlow",resolveTo:Zq,tokenize:Gq},Vq={partial:!0,tokenize:Yq},Kq={partial:!0,tokenize:Qq};function Zq(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 Gq(e,t,n){const r=this;let a,i,s,o,l;return u;function u(_){return d(_)}function d(_){return e.enter("htmlFlow"),e.enter("htmlFlowData"),e.consume(_),f}function f(_){return _===33?(e.consume(_),m):_===47?(e.consume(_),i=!0,p):_===63?(e.consume(_),a=3,r.interrupt?t:N):zn(_)?(e.consume(_),s=String.fromCharCode(_),b):n(_)}function m(_){return _===45?(e.consume(_),a=2,h):_===91?(e.consume(_),a=5,o=0,y):zn(_)?(e.consume(_),a=4,r.interrupt?t:N):n(_)}function h(_){return _===45?(e.consume(_),r.interrupt?t:N):n(_)}function y(_){const k="CDATA[";return _===k.charCodeAt(o++)?(e.consume(_),o===k.length?r.interrupt?t:O:y):n(_)}function p(_){return zn(_)?(e.consume(_),s=String.fromCharCode(_),b):n(_)}function b(_){if(_===null||_===47||_===62||ft(_)){const k=_===47,M=s.toLowerCase();return!k&&!i&&pk.includes(M)?(a=1,r.interrupt?t(_):O(_)):Hq.includes(s.toLowerCase())?(a=6,k?(e.consume(_),g):r.interrupt?t(_):O(_)):(a=7,r.interrupt&&!r.parser.lazy[r.now().line]?n(_):i?v(_):w(_))}return _===45||Nn(_)?(e.consume(_),s+=String.fromCharCode(_),b):n(_)}function g(_){return _===62?(e.consume(_),r.interrupt?t:O):n(_)}function v(_){return Ke(_)?(e.consume(_),v):$(_)}function w(_){return _===47?(e.consume(_),$):_===58||_===95||zn(_)?(e.consume(_),S):Ke(_)?(e.consume(_),w):$(_)}function S(_){return _===45||_===46||_===58||_===95||Nn(_)?(e.consume(_),S):E(_)}function E(_){return _===61?(e.consume(_),C):Ke(_)?(e.consume(_),E):w(_)}function C(_){return _===null||_===60||_===61||_===62||_===96?n(_):_===34||_===39?(e.consume(_),l=_,T):Ke(_)?(e.consume(_),C):P(_)}function T(_){return _===l?(e.consume(_),l=null,R):_===null||Ee(_)?n(_):(e.consume(_),T)}function P(_){return _===null||_===34||_===39||_===47||_===60||_===61||_===62||_===96||ft(_)?E(_):(e.consume(_),P)}function R(_){return _===47||_===62||Ke(_)?w(_):n(_)}function $(_){return _===62?(e.consume(_),j):n(_)}function j(_){return _===null||Ee(_)?O(_):Ke(_)?(e.consume(_),j):n(_)}function O(_){return _===45&&a===2?(e.consume(_),B):_===60&&a===1?(e.consume(_),Z):_===62&&a===4?(e.consume(_),q):_===63&&a===3?(e.consume(_),N):_===93&&a===5?(e.consume(_),J):Ee(_)&&(a===6||a===7)?(e.exit("htmlFlowData"),e.check(Vq,G,z)(_)):_===null||Ee(_)?(e.exit("htmlFlowData"),z(_)):(e.consume(_),O)}function z(_){return e.check(Kq,D,G)(_)}function D(_){return e.enter("lineEnding"),e.consume(_),e.exit("lineEnding"),A}function A(_){return _===null||Ee(_)?z(_):(e.enter("htmlFlowData"),O(_))}function B(_){return _===45?(e.consume(_),N):O(_)}function Z(_){return _===47?(e.consume(_),s="",F):O(_)}function F(_){if(_===62){const k=s.toLowerCase();return pk.includes(k)?(e.consume(_),q):O(_)}return zn(_)&&s.length<8?(e.consume(_),s+=String.fromCharCode(_),F):O(_)}function J(_){return _===93?(e.consume(_),N):O(_)}function N(_){return _===62?(e.consume(_),q):_===45&&a===2?(e.consume(_),N):O(_)}function q(_){return _===null||Ee(_)?(e.exit("htmlFlowData"),G(_)):(e.consume(_),q)}function G(_){return e.exit("htmlFlow"),t(_)}}function Qq(e,t,n){const r=this;return a;function a(s){return Ee(s)?(e.enter("lineEnding"),e.consume(s),e.exit("lineEnding"),i):n(s)}function i(s){return r.parser.lazy[r.now().line]?n(s):t(s)}}function Yq(e,t,n){return r;function r(a){return e.enter("lineEnding"),e.consume(a),e.exit("lineEnding"),e.attempt(Nd,t,n)}}const Xq={name:"htmlText",tokenize:Wq};function Wq(e,t,n){const r=this;let a,i,s;return o;function o(N){return e.enter("htmlText"),e.enter("htmlTextData"),e.consume(N),l}function l(N){return N===33?(e.consume(N),u):N===47?(e.consume(N),E):N===63?(e.consume(N),w):zn(N)?(e.consume(N),P):n(N)}function u(N){return N===45?(e.consume(N),d):N===91?(e.consume(N),i=0,y):zn(N)?(e.consume(N),v):n(N)}function d(N){return N===45?(e.consume(N),h):n(N)}function f(N){return N===null?n(N):N===45?(e.consume(N),m):Ee(N)?(s=f,Z(N)):(e.consume(N),f)}function m(N){return N===45?(e.consume(N),h):f(N)}function h(N){return N===62?B(N):N===45?m(N):f(N)}function y(N){const q="CDATA[";return N===q.charCodeAt(i++)?(e.consume(N),i===q.length?p:y):n(N)}function p(N){return N===null?n(N):N===93?(e.consume(N),b):Ee(N)?(s=p,Z(N)):(e.consume(N),p)}function b(N){return N===93?(e.consume(N),g):p(N)}function g(N){return N===62?B(N):N===93?(e.consume(N),g):p(N)}function v(N){return N===null||N===62?B(N):Ee(N)?(s=v,Z(N)):(e.consume(N),v)}function w(N){return N===null?n(N):N===63?(e.consume(N),S):Ee(N)?(s=w,Z(N)):(e.consume(N),w)}function S(N){return N===62?B(N):w(N)}function E(N){return zn(N)?(e.consume(N),C):n(N)}function C(N){return N===45||Nn(N)?(e.consume(N),C):T(N)}function T(N){return Ee(N)?(s=T,Z(N)):Ke(N)?(e.consume(N),T):B(N)}function P(N){return N===45||Nn(N)?(e.consume(N),P):N===47||N===62||ft(N)?R(N):n(N)}function R(N){return N===47?(e.consume(N),B):N===58||N===95||zn(N)?(e.consume(N),$):Ee(N)?(s=R,Z(N)):Ke(N)?(e.consume(N),R):B(N)}function $(N){return N===45||N===46||N===58||N===95||Nn(N)?(e.consume(N),$):j(N)}function j(N){return N===61?(e.consume(N),O):Ee(N)?(s=j,Z(N)):Ke(N)?(e.consume(N),j):R(N)}function O(N){return N===null||N===60||N===61||N===62||N===96?n(N):N===34||N===39?(e.consume(N),a=N,z):Ee(N)?(s=O,Z(N)):Ke(N)?(e.consume(N),O):(e.consume(N),D)}function z(N){return N===a?(e.consume(N),a=void 0,A):N===null?n(N):Ee(N)?(s=z,Z(N)):(e.consume(N),z)}function D(N){return N===null||N===34||N===39||N===60||N===61||N===96?n(N):N===47||N===62||ft(N)?R(N):(e.consume(N),D)}function A(N){return N===47||N===62||ft(N)?R(N):n(N)}function B(N){return N===62?(e.consume(N),e.exit("htmlTextData"),e.exit("htmlText"),t):n(N)}function Z(N){return e.exit("htmlTextData"),e.enter("lineEnding"),e.consume(N),e.exit("lineEnding"),F}function F(N){return Ke(N)?We(e,J,"linePrefix",r.parser.constructs.disable.null.includes("codeIndented")?void 0:4)(N):J(N)}function J(N){return e.enter("htmlTextData"),s(N)}}const $x={name:"labelEnd",resolveAll:nH,resolveTo:rH,tokenize:aH},Jq={tokenize:iH},eH={tokenize:sH},tH={tokenize:oH};function nH(e){let t=-1;const n=[];for(;++t<e.length;){const r=e[t][1];if(n.push(e[t]),r.type==="labelImage"||r.type==="labelLink"||r.type==="labelEnd"){const a=r.type==="labelImage"?4:2;r.type="data",t+=a}}return e.length!==n.length&&yr(e,0,e.length,n),e}function rH(e,t){let n=e.length,r=0,a,i,s,o;for(;n--;)if(a=e[n][1],i){if(a.type==="link"||a.type==="labelLink"&&a._inactive)break;e[n][0]==="enter"&&a.type==="labelLink"&&(a._inactive=!0)}else if(s){if(e[n][0]==="enter"&&(a.type==="labelImage"||a.type==="labelLink")&&!a._balanced&&(i=n,a.type!=="labelLink")){r=2;break}}else a.type==="labelEnd"&&(s=n);const l={type:e[i][1].type==="labelLink"?"link":"image",start:{...e[i][1].start},end:{...e[e.length-1][1].end}},u={type:"label",start:{...e[i][1].start},end:{...e[s][1].end}},d={type:"labelText",start:{...e[i+r+2][1].end},end:{...e[s-2][1].start}};return o=[["enter",l,t],["enter",u,t]],o=$r(o,e.slice(i+1,i+r+3)),o=$r(o,[["enter",d,t]]),o=$r(o,mp(t.parser.constructs.insideSpan.null,e.slice(i+r+4,s-3),t)),o=$r(o,[["exit",d,t],e[s-2],e[s-1],["exit",u,t]]),o=$r(o,e.slice(s+1)),o=$r(o,[["exit",l,t]]),yr(e,i,e.length,o),e}function aH(e,t,n){const r=this;let a=r.events.length,i,s;for(;a--;)if((r.events[a][1].type==="labelImage"||r.events[a][1].type==="labelLink")&&!r.events[a][1]._balanced){i=r.events[a][1];break}return o;function o(m){return i?i._inactive?f(m):(s=r.parser.defined.includes(ea(r.sliceSerialize({start:i.end,end:r.now()}))),e.enter("labelEnd"),e.enter("labelMarker"),e.consume(m),e.exit("labelMarker"),e.exit("labelEnd"),l):n(m)}function l(m){return m===40?e.attempt(Jq,d,s?d:f)(m):m===91?e.attempt(eH,d,s?u:f)(m):s?d(m):f(m)}function u(m){return e.attempt(tH,d,f)(m)}function d(m){return t(m)}function f(m){return i._balanced=!0,n(m)}}function iH(e,t,n){return r;function r(f){return e.enter("resource"),e.enter("resourceMarker"),e.consume(f),e.exit("resourceMarker"),a}function a(f){return ft(f)?xu(e,i)(f):i(f)}function i(f){return f===41?d(f):t$(e,s,o,"resourceDestination","resourceDestinationLiteral","resourceDestinationLiteralMarker","resourceDestinationRaw","resourceDestinationString",32)(f)}function s(f){return ft(f)?xu(e,l)(f):d(f)}function o(f){return n(f)}function l(f){return f===34||f===39||f===40?r$(e,u,n,"resourceTitle","resourceTitleMarker","resourceTitleString")(f):d(f)}function u(f){return ft(f)?xu(e,d)(f):d(f)}function d(f){return f===41?(e.enter("resourceMarker"),e.consume(f),e.exit("resourceMarker"),e.exit("resource"),t):n(f)}}function sH(e,t,n){const r=this;return a;function a(o){return n$.call(r,e,i,s,"reference","referenceMarker","referenceString")(o)}function i(o){return r.parser.defined.includes(ea(r.sliceSerialize(r.events[r.events.length-1][1]).slice(1,-1)))?t(o):n(o)}function s(o){return n(o)}}function oH(e,t,n){return r;function r(i){return e.enter("reference"),e.enter("referenceMarker"),e.consume(i),e.exit("referenceMarker"),a}function a(i){return i===93?(e.enter("referenceMarker"),e.consume(i),e.exit("referenceMarker"),e.exit("reference"),t):n(i)}}const lH={name:"labelStartImage",resolveAll:$x.resolveAll,tokenize:cH};function cH(e,t,n){const r=this;return a;function a(o){return e.enter("labelImage"),e.enter("labelImageMarker"),e.consume(o),e.exit("labelImageMarker"),i}function i(o){return o===91?(e.enter("labelMarker"),e.consume(o),e.exit("labelMarker"),e.exit("labelImage"),s):n(o)}function s(o){return o===94&&"_hiddenFootnoteSupport"in r.parser.constructs?n(o):t(o)}}const uH={name:"labelStartLink",resolveAll:$x.resolveAll,tokenize:dH};function dH(e,t,n){const r=this;return a;function a(s){return e.enter("labelLink"),e.enter("labelMarker"),e.consume(s),e.exit("labelMarker"),e.exit("labelLink"),i}function i(s){return s===94&&"_hiddenFootnoteSupport"in r.parser.constructs?n(s):t(s)}}const Lg={name:"lineEnding",tokenize:fH};function fH(e,t){return n;function n(r){return e.enter("lineEnding"),e.consume(r),e.exit("lineEnding"),We(e,t,"linePrefix")}}const nh={name:"thematicBreak",tokenize:hH};function hH(e,t,n){let r=0,a;return i;function i(u){return e.enter("thematicBreak"),s(u)}function s(u){return a=u,o(u)}function o(u){return u===a?(e.enter("thematicBreakSequence"),l(u)):r>=3&&(u===null||Ee(u))?(e.exit("thematicBreak"),t(u)):n(u)}function l(u){return u===a?(e.consume(u),r++,l):(e.exit("thematicBreakSequence"),Ke(u)?We(e,o,"whitespace")(u):o(u))}}const Hn={continuation:{tokenize:yH},exit:bH,name:"list",tokenize:gH},mH={partial:!0,tokenize:xH},pH={partial:!0,tokenize:vH};function gH(e,t,n){const r=this,a=r.events[r.events.length-1];let i=a&&a[1].type==="linePrefix"?a[2].sliceSerialize(a[1],!0).length:0,s=0;return o;function o(h){const y=r.containerState.type||(h===42||h===43||h===45?"listUnordered":"listOrdered");if(y==="listUnordered"?!r.containerState.marker||h===r.containerState.marker:Bv(h)){if(r.containerState.type||(r.containerState.type=y,e.enter(y,{_container:!0})),y==="listUnordered")return e.enter("listItemPrefix"),h===42||h===45?e.check(nh,n,u)(h):u(h);if(!r.interrupt||h===49)return e.enter("listItemPrefix"),e.enter("listItemValue"),l(h)}return n(h)}function l(h){return Bv(h)&&++s<10?(e.consume(h),l):(!r.interrupt||s<2)&&(r.containerState.marker?h===r.containerState.marker:h===41||h===46)?(e.exit("listItemValue"),u(h)):n(h)}function u(h){return e.enter("listItemMarker"),e.consume(h),e.exit("listItemMarker"),r.containerState.marker=r.containerState.marker||h,e.check(Nd,r.interrupt?n:d,e.attempt(mH,m,f))}function d(h){return r.containerState.initialBlankLine=!0,i++,m(h)}function f(h){return Ke(h)?(e.enter("listItemPrefixWhitespace"),e.consume(h),e.exit("listItemPrefixWhitespace"),m):n(h)}function m(h){return r.containerState.size=i+r.sliceSerialize(e.exit("listItemPrefix"),!0).length,t(h)}}function yH(e,t,n){const r=this;return r.containerState._closeFlow=void 0,e.check(Nd,a,i);function a(o){return r.containerState.furtherBlankLines=r.containerState.furtherBlankLines||r.containerState.initialBlankLine,We(e,t,"listItemIndent",r.containerState.size+1)(o)}function i(o){return r.containerState.furtherBlankLines||!Ke(o)?(r.containerState.furtherBlankLines=void 0,r.containerState.initialBlankLine=void 0,s(o)):(r.containerState.furtherBlankLines=void 0,r.containerState.initialBlankLine=void 0,e.attempt(pH,t,s)(o))}function s(o){return r.containerState._closeFlow=!0,r.interrupt=void 0,We(e,e.attempt(Hn,t,n),"linePrefix",r.parser.constructs.disable.null.includes("codeIndented")?void 0:4)(o)}}function vH(e,t,n){const r=this;return We(e,a,"listItemIndent",r.containerState.size+1);function a(i){const s=r.events[r.events.length-1];return s&&s[1].type==="listItemIndent"&&s[2].sliceSerialize(s[1],!0).length===r.containerState.size?t(i):n(i)}}function bH(e){e.exit(this.containerState.type)}function xH(e,t,n){const r=this;return We(e,a,"listItemPrefixWhitespace",r.parser.constructs.disable.null.includes("codeIndented")?void 0:5);function a(i){const s=r.events[r.events.length-1];return!Ke(i)&&s&&s[1].type==="listItemPrefixWhitespace"?t(i):n(i)}}const gk={name:"setextUnderline",resolveTo:wH,tokenize:SH};function wH(e,t){let n=e.length,r,a,i;for(;n--;)if(e[n][0]==="enter"){if(e[n][1].type==="content"){r=n;break}e[n][1].type==="paragraph"&&(a=n)}else e[n][1].type==="content"&&e.splice(n,1),!i&&e[n][1].type==="definition"&&(i=n);const s={type:"setextHeading",start:{...e[r][1].start},end:{...e[e.length-1][1].end}};return e[a][1].type="setextHeadingText",i?(e.splice(a,0,["enter",s,t]),e.splice(i+1,0,["exit",e[r][1],t]),e[r][1].end={...e[i][1].end}):e[r][1]=s,e.push(["exit",s,t]),e}function SH(e,t,n){const r=this;let a;return i;function i(u){let d=r.events.length,f;for(;d--;)if(r.events[d][1].type!=="lineEnding"&&r.events[d][1].type!=="linePrefix"&&r.events[d][1].type!=="content"){f=r.events[d][1].type==="paragraph";break}return!r.parser.lazy[r.now().line]&&(r.interrupt||f)?(e.enter("setextHeadingLine"),a=u,s(u)):n(u)}function s(u){return e.enter("setextHeadingLineSequence"),o(u)}function o(u){return u===a?(e.consume(u),o):(e.exit("setextHeadingLineSequence"),Ke(u)?We(e,l,"lineSuffix")(u):l(u))}function l(u){return u===null||Ee(u)?(e.exit("setextHeadingLine"),t(u)):n(u)}}const _H={tokenize:kH};function kH(e){const t=this,n=e.attempt(Nd,r,e.attempt(this.parser.constructs.flowInitial,a,We(e,e.attempt(this.parser.constructs.flow,a,e.attempt(Tq,a)),"linePrefix")));return n;function r(i){if(i===null){e.consume(i);return}return e.enter("lineEndingBlank"),e.consume(i),e.exit("lineEndingBlank"),t.currentConstruct=void 0,n}function a(i){if(i===null){e.consume(i);return}return e.enter("lineEnding"),e.consume(i),e.exit("lineEnding"),t.currentConstruct=void 0,n}}const EH={resolveAll:i$()},CH=a$("string"),NH=a$("text");function a$(e){return{resolveAll:i$(e==="text"?jH:void 0),tokenize:t};function t(n){const r=this,a=this.parser.constructs[e],i=n.attempt(a,s,o);return s;function s(d){return u(d)?i(d):o(d)}function o(d){if(d===null){n.consume(d);return}return n.enter("data"),n.consume(d),l}function l(d){return u(d)?(n.exit("data"),i(d)):(n.consume(d),l)}function u(d){if(d===null)return!0;const f=a[d];let m=-1;if(f)for(;++m<f.length;){const h=f[m];if(!h.previous||h.previous.call(r,r.previous))return!0}return!1}}}function i$(e){return t;function t(n,r){let a=-1,i;for(;++a<=n.length;)i===void 0?n[a]&&n[a][1].type==="data"&&(i=a,a++):(!n[a]||n[a][1].type!=="data")&&(a!==i+2&&(n[i][1].end=n[a-1][1].end,n.splice(i+2,a-i-2),a=i+2),i=void 0);return e?e(n,r):n}}function jH(e,t){let n=0;for(;++n<=e.length;)if((n===e.length||e[n][1].type==="lineEnding")&&e[n-1][1].type==="data"){const r=e[n-1][1],a=t.sliceStream(r);let i=a.length,s=-1,o=0,l;for(;i--;){const u=a[i];if(typeof u=="string"){for(s=u.length;u.charCodeAt(s-1)===32;)o++,s--;if(s)break;s=-1}else if(u===-2)l=!0,o++;else if(u!==-1){i++;break}}if(t._contentTypeTextTrailing&&n===e.length&&(o=0),o){const u={type:n===e.length||l||o<2?"lineSuffix":"hardBreakTrailing",start:{_bufferIndex:i?s:r.start._bufferIndex+s,_index:r.start._index+i,line:r.end.line,column:r.end.column-o,offset:r.end.offset-o},end:{...r.end}};r.end={...u.start},r.start.offset===r.end.offset?Object.assign(r,u):(e.splice(n,0,["enter",u,t],["exit",u,t]),n+=2)}n++}return e}const TH={42:Hn,43:Hn,45:Hn,48:Hn,49:Hn,50:Hn,51:Hn,52:Hn,53:Hn,54:Hn,55:Hn,56:Hn,57:Hn,62:XR},AH={91:Mq},RH={[-2]:Ig,[-1]:Ig,32:Ig},$H={35:Uq,42:nh,45:[gk,nh],60:Bq,61:gk,95:nh,96:mk,126:mk},OH={38:JR,92:WR},MH={[-5]:Lg,[-4]:Lg,[-3]:Lg,33:lH,38:JR,42:Vv,60:[uq,Xq],91:uH,92:[Iq,WR],93:$x,95:Vv,96:_q},PH={null:[Vv,EH]},DH={null:[42,95]},zH={null:[]},IH=Object.freeze(Object.defineProperty({__proto__:null,attentionMarkers:DH,contentInitial:AH,disable:zH,document:TH,flow:$H,flowInitial:RH,insideSpan:PH,string:OH,text:MH},Symbol.toStringTag,{value:"Module"}));function LH(e,t,n){let r={_bufferIndex:-1,_index:0,line:n&&n.line||1,column:n&&n.column||1,offset:n&&n.offset||0};const a={},i=[];let s=[],o=[];const l={attempt:T(E),check:T(C),consume:v,enter:w,exit:S,interrupt:T(C,{interrupt:!0})},u={code:null,containerState:{},defineSkip:p,events:[],now:y,parser:e,previous:null,sliceSerialize:m,sliceStream:h,write:f};let d=t.tokenize.call(u,l);return t.resolveAll&&i.push(t),u;function f(j){return s=$r(s,j),b(),s[s.length-1]!==null?[]:(P(t,0),u.events=mp(i,u.events,u),u.events)}function m(j,O){return FH(h(j),O)}function h(j){return UH(s,j)}function y(){const{_bufferIndex:j,_index:O,line:z,column:D,offset:A}=r;return{_bufferIndex:j,_index:O,line:z,column:D,offset:A}}function p(j){a[j.line]=j.column,$()}function b(){let j;for(;r._index<s.length;){const O=s[r._index];if(typeof O=="string")for(j=r._index,r._bufferIndex<0&&(r._bufferIndex=0);r._index===j&&r._bufferIndex<O.length;)g(O.charCodeAt(r._bufferIndex));else g(O)}}function g(j){d=d(j)}function v(j){Ee(j)?(r.line++,r.column=1,r.offset+=j===-3?2:1,$()):j!==-1&&(r.column++,r.offset++),r._bufferIndex<0?r._index++:(r._bufferIndex++,r._bufferIndex===s[r._index].length&&(r._bufferIndex=-1,r._index++)),u.previous=j}function w(j,O){const z=O||{};return z.type=j,z.start=y(),u.events.push(["enter",z,u]),o.push(z),z}function S(j){const O=o.pop();return O.end=y(),u.events.push(["exit",O,u]),O}function E(j,O){P(j,O.from)}function C(j,O){O.restore()}function T(j,O){return z;function z(D,A,B){let Z,F,J,N;return Array.isArray(D)?G(D):"tokenize"in D?G([D]):q(D);function q(I){return Q;function Q(W){const oe=W!==null&&I[W],de=W!==null&&I.null,L=[...Array.isArray(oe)?oe:oe?[oe]:[],...Array.isArray(de)?de:de?[de]:[]];return G(L)(W)}}function G(I){return Z=I,F=0,I.length===0?B:_(I[F])}function _(I){return Q;function Q(W){return N=R(),J=I,I.partial||(u.currentConstruct=I),I.name&&u.parser.constructs.disable.null.includes(I.name)?M():I.tokenize.call(O?Object.assign(Object.create(u),O):u,l,k,M)(W)}}function k(I){return j(J,N),A}function M(I){return N.restore(),++F<Z.length?_(Z[F]):B}}}function P(j,O){j.resolveAll&&!i.includes(j)&&i.push(j),j.resolve&&yr(u.events,O,u.events.length-O,j.resolve(u.events.slice(O),u)),j.resolveTo&&(u.events=j.resolveTo(u.events,u))}function R(){const j=y(),O=u.previous,z=u.currentConstruct,D=u.events.length,A=Array.from(o);return{from:D,restore:B};function B(){r=j,u.previous=O,u.currentConstruct=z,u.events.length=D,o=A,$()}}function $(){r.line in a&&r.column<2&&(r.column=a[r.line],r.offset+=a[r.line]-1)}}function UH(e,t){const n=t.start._index,r=t.start._bufferIndex,a=t.end._index,i=t.end._bufferIndex;let s;if(n===a)s=[e[n].slice(r,i)];else{if(s=e.slice(n,a),r>-1){const o=s[0];typeof o=="string"?s[0]=o.slice(r):s.shift()}i>0&&s.push(e[a].slice(0,i))}return s}function FH(e,t){let n=-1;const r=[];let a;for(;++n<e.length;){const i=e[n];let s;if(typeof i=="string")s=i;else switch(i){case-5:{s="\r";break}case-4:{s=`
411
+ `;break}case-3:{s=`\r
412
+ `;break}case-2:{s=t?" ":" ";break}case-1:{if(!t&&a)continue;s=" ";break}default:s=String.fromCharCode(i)}a=i===-2,r.push(s)}return r.join("")}function qH(e){const r={constructs:QR([IH,...(e||{}).extensions||[]]),content:a(rq),defined:[],document:a(iq),flow:a(_H),lazy:{},string:a(CH),text:a(NH)};return r;function a(i){return s;function s(o){return LH(r,i,o)}}}function HH(e){for(;!e$(e););return e}const yk=/[\0\t\n\r]/g;function BH(){let e=1,t="",n=!0,r;return a;function a(i,s,o){const l=[];let u,d,f,m,h;for(i=t+(typeof i=="string"?i.toString():new TextDecoder(s||void 0).decode(i)),f=0,t="",n&&(i.charCodeAt(0)===65279&&f++,n=void 0);f<i.length;){if(yk.lastIndex=f,u=yk.exec(i),m=u&&u.index!==void 0?u.index:i.length,h=i.charCodeAt(m),!u){t=i.slice(f);break}if(h===10&&f===m&&r)l.push(-3),r=void 0;else switch(r&&(l.push(-5),r=void 0),f<m&&(l.push(i.slice(f,m)),e+=m-f),h){case 0:{l.push(65533),e++;break}case 9:{for(d=Math.ceil(e/4)*4,l.push(-2);e++<d;)l.push(-1);break}case 10:{l.push(-4),e=1;break}default:r=!0,e=1}f=m+1}return o&&(r&&l.push(-5),t&&l.push(t),l.push(null)),l}}const VH=/\\([!-/:-@[-`{-~])|&(#(?:\d{1,7}|x[\da-f]{1,6})|[\da-z]{1,31});/gi;function KH(e){return e.replace(VH,ZH)}function ZH(e,t,n){if(t)return t;if(n.charCodeAt(0)===35){const a=n.charCodeAt(1),i=a===120||a===88;return YR(n.slice(i?2:1),i?16:10)}return Rx(n)||e}const s$={}.hasOwnProperty;function GH(e,t,n){return t&&typeof t=="object"&&(n=t,t=void 0),QH(n)(HH(qH(n).document().write(BH()(e,t,!0))))}function QH(e){const t={transforms:[],canContainEols:["emphasis","fragment","heading","paragraph","strong"],enter:{autolink:i(ce),autolinkProtocol:R,autolinkEmail:R,atxHeading:i(K),blockQuote:i(de),characterEscape:R,characterReference:R,codeFenced:i(L),codeFencedFenceInfo:s,codeFencedFenceMeta:s,codeIndented:i(L,s),codeText:i(V,s),codeTextData:R,data:R,codeFlowValue:R,definition:i(X),definitionDestinationString:s,definitionLabelString:s,definitionTitleString:s,emphasis:i(ne),hardBreakEscape:i(re),hardBreakTrailing:i(re),htmlFlow:i(ae,s),htmlFlowData:R,htmlText:i(ae,s),htmlTextData:R,image:i(Ae),label:s,link:i(ce),listItem:i(Ce),listItemValue:m,listOrdered:i(we,f),listUnordered:i(we),paragraph:i(ht),reference:_,referenceString:s,resourceDestinationString:s,resourceTitleString:s,setextHeading:i(K),strong:i(Ut),thematicBreak:i(ar)},exit:{atxHeading:l(),atxHeadingSequence:E,autolink:l(),autolinkEmail:oe,autolinkProtocol:W,blockQuote:l(),characterEscapeValue:$,characterReferenceMarkerHexadecimal:M,characterReferenceMarkerNumeric:M,characterReferenceValue:I,characterReference:Q,codeFenced:l(b),codeFencedFence:p,codeFencedFenceInfo:h,codeFencedFenceMeta:y,codeFlowValue:$,codeIndented:l(g),codeText:l(A),codeTextData:$,data:$,definition:l(),definitionDestinationString:S,definitionLabelString:v,definitionTitleString:w,emphasis:l(),hardBreakEscape:l(O),hardBreakTrailing:l(O),htmlFlow:l(z),htmlFlowData:$,htmlText:l(D),htmlTextData:$,image:l(Z),label:J,labelText:F,lineEnding:j,link:l(B),listItem:l(),listOrdered:l(),listUnordered:l(),paragraph:l(),referenceString:k,resourceDestinationString:N,resourceTitleString:q,resource:G,setextHeading:l(P),setextHeadingLineSequence:T,setextHeadingText:C,strong:l(),thematicBreak:l()}};o$(t,(e||{}).mdastExtensions||[]);const n={};return r;function r(Y){let se={type:"root",children:[]};const Se={stack:[se],tokenStack:[],config:t,enter:o,exit:u,buffer:s,resume:d,data:n},je=[];let Xe=-1;for(;++Xe<Y.length;)if(Y[Xe][1].type==="listOrdered"||Y[Xe][1].type==="listUnordered")if(Y[Xe][0]==="enter")je.push(Xe);else{const dn=je.pop();Xe=a(Y,dn,Xe)}for(Xe=-1;++Xe<Y.length;){const dn=t[Y[Xe][0]];s$.call(dn,Y[Xe][1].type)&&dn[Y[Xe][1].type].call(Object.assign({sliceSerialize:Y[Xe][2].sliceSerialize},Se),Y[Xe][1])}if(Se.tokenStack.length>0){const dn=Se.tokenStack[Se.tokenStack.length-1];(dn[1]||vk).call(Se,void 0,dn[0])}for(se.position={start:wi(Y.length>0?Y[0][1].start:{line:1,column:1,offset:0}),end:wi(Y.length>0?Y[Y.length-2][1].end:{line:1,column:1,offset:0})},Xe=-1;++Xe<t.transforms.length;)se=t.transforms[Xe](se)||se;return se}function a(Y,se,Se){let je=se-1,Xe=-1,dn=!1,Sr,Un,ia,sa;for(;++je<=Se;){const Qt=Y[je];switch(Qt[1].type){case"listUnordered":case"listOrdered":case"blockQuote":{Qt[0]==="enter"?Xe++:Xe--,sa=void 0;break}case"lineEndingBlank":{Qt[0]==="enter"&&(Sr&&!sa&&!Xe&&!ia&&(ia=je),sa=void 0);break}case"linePrefix":case"listItemValue":case"listItemMarker":case"listItemPrefix":case"listItemPrefixWhitespace":break;default:sa=void 0}if(!Xe&&Qt[0]==="enter"&&Qt[1].type==="listItemPrefix"||Xe===-1&&Qt[0]==="exit"&&(Qt[1].type==="listUnordered"||Qt[1].type==="listOrdered")){if(Sr){let _r=je;for(Un=void 0;_r--;){const An=Y[_r];if(An[1].type==="lineEnding"||An[1].type==="lineEndingBlank"){if(An[0]==="exit")continue;Un&&(Y[Un][1].type="lineEndingBlank",dn=!0),An[1].type="lineEnding",Un=_r}else if(!(An[1].type==="linePrefix"||An[1].type==="blockQuotePrefix"||An[1].type==="blockQuotePrefixWhitespace"||An[1].type==="blockQuoteMarker"||An[1].type==="listItemIndent"))break}ia&&(!Un||ia<Un)&&(Sr._spread=!0),Sr.end=Object.assign({},Un?Y[Un][1].start:Qt[1].end),Y.splice(Un||je,0,["exit",Sr,Qt[2]]),je++,Se++}if(Qt[1].type==="listItemPrefix"){const _r={type:"listItem",_spread:!1,start:Object.assign({},Qt[1].start),end:void 0};Sr=_r,Y.splice(je,0,["enter",_r,Qt[2]]),je++,Se++,ia=void 0,sa=!0}}}return Y[se][1]._spread=dn,Se}function i(Y,se){return Se;function Se(je){o.call(this,Y(je),je),se&&se.call(this,je)}}function s(){this.stack.push({type:"fragment",children:[]})}function o(Y,se,Se){this.stack[this.stack.length-1].children.push(Y),this.stack.push(Y),this.tokenStack.push([se,Se||void 0]),Y.position={start:wi(se.start),end:void 0}}function l(Y){return se;function se(Se){Y&&Y.call(this,Se),u.call(this,Se)}}function u(Y,se){const Se=this.stack.pop(),je=this.tokenStack.pop();if(je)je[0].type!==Y.type&&(se?se.call(this,Y,je[0]):(je[1]||vk).call(this,Y,je[0]));else throw new Error("Cannot close `"+Y.type+"` ("+bu({start:Y.start,end:Y.end})+"): it’s not open");Se.position.end=wi(Y.end)}function d(){return Ax(this.stack.pop())}function f(){this.data.expectingFirstListItemValue=!0}function m(Y){if(this.data.expectingFirstListItemValue){const se=this.stack[this.stack.length-2];se.start=Number.parseInt(this.sliceSerialize(Y),10),this.data.expectingFirstListItemValue=void 0}}function h(){const Y=this.resume(),se=this.stack[this.stack.length-1];se.lang=Y}function y(){const Y=this.resume(),se=this.stack[this.stack.length-1];se.meta=Y}function p(){this.data.flowCodeInside||(this.buffer(),this.data.flowCodeInside=!0)}function b(){const Y=this.resume(),se=this.stack[this.stack.length-1];se.value=Y.replace(/^(\r?\n|\r)|(\r?\n|\r)$/g,""),this.data.flowCodeInside=void 0}function g(){const Y=this.resume(),se=this.stack[this.stack.length-1];se.value=Y.replace(/(\r?\n|\r)$/g,"")}function v(Y){const se=this.resume(),Se=this.stack[this.stack.length-1];Se.label=se,Se.identifier=ea(this.sliceSerialize(Y)).toLowerCase()}function w(){const Y=this.resume(),se=this.stack[this.stack.length-1];se.title=Y}function S(){const Y=this.resume(),se=this.stack[this.stack.length-1];se.url=Y}function E(Y){const se=this.stack[this.stack.length-1];if(!se.depth){const Se=this.sliceSerialize(Y).length;se.depth=Se}}function C(){this.data.setextHeadingSlurpLineEnding=!0}function T(Y){const se=this.stack[this.stack.length-1];se.depth=this.sliceSerialize(Y).codePointAt(0)===61?1:2}function P(){this.data.setextHeadingSlurpLineEnding=void 0}function R(Y){const Se=this.stack[this.stack.length-1].children;let je=Se[Se.length-1];(!je||je.type!=="text")&&(je=gt(),je.position={start:wi(Y.start),end:void 0},Se.push(je)),this.stack.push(je)}function $(Y){const se=this.stack.pop();se.value+=this.sliceSerialize(Y),se.position.end=wi(Y.end)}function j(Y){const se=this.stack[this.stack.length-1];if(this.data.atHardBreak){const Se=se.children[se.children.length-1];Se.position.end=wi(Y.end),this.data.atHardBreak=void 0;return}!this.data.setextHeadingSlurpLineEnding&&t.canContainEols.includes(se.type)&&(R.call(this,Y),$.call(this,Y))}function O(){this.data.atHardBreak=!0}function z(){const Y=this.resume(),se=this.stack[this.stack.length-1];se.value=Y}function D(){const Y=this.resume(),se=this.stack[this.stack.length-1];se.value=Y}function A(){const Y=this.resume(),se=this.stack[this.stack.length-1];se.value=Y}function B(){const Y=this.stack[this.stack.length-1];if(this.data.inReference){const se=this.data.referenceType||"shortcut";Y.type+="Reference",Y.referenceType=se,delete Y.url,delete Y.title}else delete Y.identifier,delete Y.label;this.data.referenceType=void 0}function Z(){const Y=this.stack[this.stack.length-1];if(this.data.inReference){const se=this.data.referenceType||"shortcut";Y.type+="Reference",Y.referenceType=se,delete Y.url,delete Y.title}else delete Y.identifier,delete Y.label;this.data.referenceType=void 0}function F(Y){const se=this.sliceSerialize(Y),Se=this.stack[this.stack.length-2];Se.label=KH(se),Se.identifier=ea(se).toLowerCase()}function J(){const Y=this.stack[this.stack.length-1],se=this.resume(),Se=this.stack[this.stack.length-1];if(this.data.inReference=!0,Se.type==="link"){const je=Y.children;Se.children=je}else Se.alt=se}function N(){const Y=this.resume(),se=this.stack[this.stack.length-1];se.url=Y}function q(){const Y=this.resume(),se=this.stack[this.stack.length-1];se.title=Y}function G(){this.data.inReference=void 0}function _(){this.data.referenceType="collapsed"}function k(Y){const se=this.resume(),Se=this.stack[this.stack.length-1];Se.label=se,Se.identifier=ea(this.sliceSerialize(Y)).toLowerCase(),this.data.referenceType="full"}function M(Y){this.data.characterReferenceType=Y.type}function I(Y){const se=this.sliceSerialize(Y),Se=this.data.characterReferenceType;let je;Se?(je=YR(se,Se==="characterReferenceMarkerNumeric"?10:16),this.data.characterReferenceType=void 0):je=Rx(se);const Xe=this.stack[this.stack.length-1];Xe.value+=je}function Q(Y){const se=this.stack.pop();se.position.end=wi(Y.end)}function W(Y){$.call(this,Y);const se=this.stack[this.stack.length-1];se.url=this.sliceSerialize(Y)}function oe(Y){$.call(this,Y);const se=this.stack[this.stack.length-1];se.url="mailto:"+this.sliceSerialize(Y)}function de(){return{type:"blockquote",children:[]}}function L(){return{type:"code",lang:null,meta:null,value:""}}function V(){return{type:"inlineCode",value:""}}function X(){return{type:"definition",identifier:"",label:null,title:null,url:""}}function ne(){return{type:"emphasis",children:[]}}function K(){return{type:"heading",depth:0,children:[]}}function re(){return{type:"break"}}function ae(){return{type:"html",value:""}}function Ae(){return{type:"image",title:null,url:"",alt:null}}function ce(){return{type:"link",title:null,url:"",children:[]}}function we(Y){return{type:"list",ordered:Y.type==="listOrdered",start:null,spread:Y._spread,children:[]}}function Ce(Y){return{type:"listItem",spread:Y._spread,checked:null,children:[]}}function ht(){return{type:"paragraph",children:[]}}function Ut(){return{type:"strong",children:[]}}function gt(){return{type:"text",value:""}}function ar(){return{type:"thematicBreak"}}}function wi(e){return{line:e.line,column:e.column,offset:e.offset}}function o$(e,t){let n=-1;for(;++n<t.length;){const r=t[n];Array.isArray(r)?o$(e,r):YH(e,r)}}function YH(e,t){let n;for(n in t)if(s$.call(t,n))switch(n){case"canContainEols":{const r=t[n];r&&e[n].push(...r);break}case"transforms":{const r=t[n];r&&e[n].push(...r);break}case"enter":case"exit":{const r=t[n];r&&Object.assign(e[n],r);break}}}function vk(e,t){throw e?new Error("Cannot close `"+e.type+"` ("+bu({start:e.start,end:e.end})+"): a different token (`"+t.type+"`, "+bu({start:t.start,end:t.end})+") is open"):new Error("Cannot close document, a token (`"+t.type+"`, "+bu({start:t.start,end:t.end})+") is still open")}function XH(e){const t=this;t.parser=n;function n(r){return GH(r,{...t.data("settings"),...e,extensions:t.data("micromarkExtensions")||[],mdastExtensions:t.data("fromMarkdownExtensions")||[]})}}function WH(e,t){const n={type:"element",tagName:"blockquote",properties:{},children:e.wrap(e.all(t),!0)};return e.patch(t,n),e.applyData(t,n)}function JH(e,t){const n={type:"element",tagName:"br",properties:{},children:[]};return e.patch(t,n),[e.applyData(t,n),{type:"text",value:`
413
+ `}]}function eB(e,t){const n=t.value?t.value+`
414
+ `:"",r={},a=t.lang?t.lang.split(/\s+/):[];a.length>0&&(r.className=["language-"+a[0]]);let i={type:"element",tagName:"code",properties:r,children:[{type:"text",value:n}]};return t.meta&&(i.data={meta:t.meta}),e.patch(t,i),i=e.applyData(t,i),i={type:"element",tagName:"pre",properties:{},children:[i]},e.patch(t,i),i}function tB(e,t){const n={type:"element",tagName:"del",properties:{},children:e.all(t)};return e.patch(t,n),e.applyData(t,n)}function nB(e,t){const n={type:"element",tagName:"em",properties:{},children:e.all(t)};return e.patch(t,n),e.applyData(t,n)}function rB(e,t){const n=typeof e.options.clobberPrefix=="string"?e.options.clobberPrefix:"user-content-",r=String(t.identifier).toUpperCase(),a=wc(r.toLowerCase()),i=e.footnoteOrder.indexOf(r);let s,o=e.footnoteCounts.get(r);o===void 0?(o=0,e.footnoteOrder.push(r),s=e.footnoteOrder.length):s=i+1,o+=1,e.footnoteCounts.set(r,o);const l={type:"element",tagName:"a",properties:{href:"#"+n+"fn-"+a,id:n+"fnref-"+a+(o>1?"-"+o:""),dataFootnoteRef:!0,ariaDescribedBy:["footnote-label"]},children:[{type:"text",value:String(s)}]};e.patch(t,l);const u={type:"element",tagName:"sup",properties:{},children:[l]};return e.patch(t,u),e.applyData(t,u)}function aB(e,t){const n={type:"element",tagName:"h"+t.depth,properties:{},children:e.all(t)};return e.patch(t,n),e.applyData(t,n)}function iB(e,t){if(e.options.allowDangerousHtml){const n={type:"raw",value:t.value};return e.patch(t,n),e.applyData(t,n)}}function l$(e,t){const n=t.referenceType;let r="]";if(n==="collapsed"?r+="[]":n==="full"&&(r+="["+(t.label||t.identifier)+"]"),t.type==="imageReference")return[{type:"text",value:"!["+t.alt+r}];const a=e.all(t),i=a[0];i&&i.type==="text"?i.value="["+i.value:a.unshift({type:"text",value:"["});const s=a[a.length-1];return s&&s.type==="text"?s.value+=r:a.push({type:"text",value:r}),a}function sB(e,t){const n=String(t.identifier).toUpperCase(),r=e.definitionById.get(n);if(!r)return l$(e,t);const a={src:wc(r.url||""),alt:t.alt};r.title!==null&&r.title!==void 0&&(a.title=r.title);const i={type:"element",tagName:"img",properties:a,children:[]};return e.patch(t,i),e.applyData(t,i)}function oB(e,t){const n={src:wc(t.url)};t.alt!==null&&t.alt!==void 0&&(n.alt=t.alt),t.title!==null&&t.title!==void 0&&(n.title=t.title);const r={type:"element",tagName:"img",properties:n,children:[]};return e.patch(t,r),e.applyData(t,r)}function lB(e,t){const n={type:"text",value:t.value.replace(/\r?\n|\r/g," ")};e.patch(t,n);const r={type:"element",tagName:"code",properties:{},children:[n]};return e.patch(t,r),e.applyData(t,r)}function cB(e,t){const n=String(t.identifier).toUpperCase(),r=e.definitionById.get(n);if(!r)return l$(e,t);const a={href:wc(r.url||"")};r.title!==null&&r.title!==void 0&&(a.title=r.title);const i={type:"element",tagName:"a",properties:a,children:e.all(t)};return e.patch(t,i),e.applyData(t,i)}function uB(e,t){const n={href:wc(t.url)};t.title!==null&&t.title!==void 0&&(n.title=t.title);const r={type:"element",tagName:"a",properties:n,children:e.all(t)};return e.patch(t,r),e.applyData(t,r)}function dB(e,t,n){const r=e.all(t),a=n?fB(n):c$(t),i={},s=[];if(typeof t.checked=="boolean"){const d=r[0];let f;d&&d.type==="element"&&d.tagName==="p"?f=d:(f={type:"element",tagName:"p",properties:{},children:[]},r.unshift(f)),f.children.length>0&&f.children.unshift({type:"text",value:" "}),f.children.unshift({type:"element",tagName:"input",properties:{type:"checkbox",checked:t.checked,disabled:!0},children:[]}),i.className=["task-list-item"]}let o=-1;for(;++o<r.length;){const d=r[o];(a||o!==0||d.type!=="element"||d.tagName!=="p")&&s.push({type:"text",value:`
415
+ `}),d.type==="element"&&d.tagName==="p"&&!a?s.push(...d.children):s.push(d)}const l=r[r.length-1];l&&(a||l.type!=="element"||l.tagName!=="p")&&s.push({type:"text",value:`
416
+ `});const u={type:"element",tagName:"li",properties:i,children:s};return e.patch(t,u),e.applyData(t,u)}function fB(e){let t=!1;if(e.type==="list"){t=e.spread||!1;const n=e.children;let r=-1;for(;!t&&++r<n.length;)t=c$(n[r])}return t}function c$(e){const t=e.spread;return t??e.children.length>1}function hB(e,t){const n={},r=e.all(t);let a=-1;for(typeof t.start=="number"&&t.start!==1&&(n.start=t.start);++a<r.length;){const s=r[a];if(s.type==="element"&&s.tagName==="li"&&s.properties&&Array.isArray(s.properties.className)&&s.properties.className.includes("task-list-item")){n.className=["contains-task-list"];break}}const i={type:"element",tagName:t.ordered?"ol":"ul",properties:n,children:e.wrap(r,!0)};return e.patch(t,i),e.applyData(t,i)}function mB(e,t){const n={type:"element",tagName:"p",properties:{},children:e.all(t)};return e.patch(t,n),e.applyData(t,n)}function pB(e,t){const n={type:"root",children:e.wrap(e.all(t))};return e.patch(t,n),e.applyData(t,n)}function gB(e,t){const n={type:"element",tagName:"strong",properties:{},children:e.all(t)};return e.patch(t,n),e.applyData(t,n)}function yB(e,t){const n=e.all(t),r=n.shift(),a=[];if(r){const s={type:"element",tagName:"thead",properties:{},children:e.wrap([r],!0)};e.patch(t.children[0],s),a.push(s)}if(n.length>0){const s={type:"element",tagName:"tbody",properties:{},children:e.wrap(n,!0)},o=Cx(t.children[1]),l=qR(t.children[t.children.length-1]);o&&l&&(s.position={start:o,end:l}),a.push(s)}const i={type:"element",tagName:"table",properties:{},children:e.wrap(a,!0)};return e.patch(t,i),e.applyData(t,i)}function vB(e,t,n){const r=n?n.children:void 0,i=(r?r.indexOf(t):1)===0?"th":"td",s=n&&n.type==="table"?n.align:void 0,o=s?s.length:t.children.length;let l=-1;const u=[];for(;++l<o;){const f=t.children[l],m={},h=s?s[l]:void 0;h&&(m.align=h);let y={type:"element",tagName:i,properties:m,children:[]};f&&(y.children=e.all(f),e.patch(f,y),y=e.applyData(f,y)),u.push(y)}const d={type:"element",tagName:"tr",properties:{},children:e.wrap(u,!0)};return e.patch(t,d),e.applyData(t,d)}function bB(e,t){const n={type:"element",tagName:"td",properties:{},children:e.all(t)};return e.patch(t,n),e.applyData(t,n)}const bk=9,xk=32;function xB(e){const t=String(e),n=/\r?\n|\r/g;let r=n.exec(t),a=0;const i=[];for(;r;)i.push(wk(t.slice(a,r.index),a>0,!0),r[0]),a=r.index+r[0].length,r=n.exec(t);return i.push(wk(t.slice(a),a>0,!1)),i.join("")}function wk(e,t,n){let r=0,a=e.length;if(t){let i=e.codePointAt(r);for(;i===bk||i===xk;)r++,i=e.codePointAt(r)}if(n){let i=e.codePointAt(a-1);for(;i===bk||i===xk;)a--,i=e.codePointAt(a-1)}return a>r?e.slice(r,a):""}function wB(e,t){const n={type:"text",value:xB(String(t.value))};return e.patch(t,n),e.applyData(t,n)}function SB(e,t){const n={type:"element",tagName:"hr",properties:{},children:[]};return e.patch(t,n),e.applyData(t,n)}const _B={blockquote:WH,break:JH,code:eB,delete:tB,emphasis:nB,footnoteReference:rB,heading:aB,html:iB,imageReference:sB,image:oB,inlineCode:lB,linkReference:cB,link:uB,listItem:dB,list:hB,paragraph:mB,root:pB,strong:gB,table:yB,tableCell:bB,tableRow:vB,text:wB,thematicBreak:SB,toml:yf,yaml:yf,definition:yf,footnoteDefinition:yf};function yf(){}const u$=-1,pp=0,wu=1,rm=2,Ox=3,Mx=4,Px=5,Dx=6,d$=7,f$=8,Sk=typeof self=="object"?self:globalThis,kB=(e,t)=>{const n=(a,i)=>(e.set(i,a),a),r=a=>{if(e.has(a))return e.get(a);const[i,s]=t[a];switch(i){case pp:case u$:return n(s,a);case wu:{const o=n([],a);for(const l of s)o.push(r(l));return o}case rm:{const o=n({},a);for(const[l,u]of s)o[r(l)]=r(u);return o}case Ox:return n(new Date(s),a);case Mx:{const{source:o,flags:l}=s;return n(new RegExp(o,l),a)}case Px:{const o=n(new Map,a);for(const[l,u]of s)o.set(r(l),r(u));return o}case Dx:{const o=n(new Set,a);for(const l of s)o.add(r(l));return o}case d$:{const{name:o,message:l}=s;return n(new Sk[o](l),a)}case f$:return n(BigInt(s),a);case"BigInt":return n(Object(BigInt(s)),a);case"ArrayBuffer":return n(new Uint8Array(s).buffer,s);case"DataView":{const{buffer:o}=new Uint8Array(s);return n(new DataView(o),s)}}return n(new Sk[i](s),a)};return r},_k=e=>kB(new Map,e)(0),Do="",{toString:EB}={},{keys:CB}=Object,Lc=e=>{const t=typeof e;if(t!=="object"||!e)return[pp,t];const n=EB.call(e).slice(8,-1);switch(n){case"Array":return[wu,Do];case"Object":return[rm,Do];case"Date":return[Ox,Do];case"RegExp":return[Mx,Do];case"Map":return[Px,Do];case"Set":return[Dx,Do];case"DataView":return[wu,n]}return n.includes("Array")?[wu,n]:n.includes("Error")?[d$,n]:[rm,n]},vf=([e,t])=>e===pp&&(t==="function"||t==="symbol"),NB=(e,t,n,r)=>{const a=(s,o)=>{const l=r.push(s)-1;return n.set(o,l),l},i=s=>{if(n.has(s))return n.get(s);let[o,l]=Lc(s);switch(o){case pp:{let d=s;switch(l){case"bigint":o=f$,d=s.toString();break;case"function":case"symbol":if(e)throw new TypeError("unable to serialize "+l);d=null;break;case"undefined":return a([u$],s)}return a([o,d],s)}case wu:{if(l){let m=s;return l==="DataView"?m=new Uint8Array(s.buffer):l==="ArrayBuffer"&&(m=new Uint8Array(s)),a([l,[...m]],s)}const d=[],f=a([o,d],s);for(const m of s)d.push(i(m));return f}case rm:{if(l)switch(l){case"BigInt":return a([l,s.toString()],s);case"Boolean":case"Number":case"String":return a([l,s.valueOf()],s)}if(t&&"toJSON"in s)return i(s.toJSON());const d=[],f=a([o,d],s);for(const m of CB(s))(e||!vf(Lc(s[m])))&&d.push([i(m),i(s[m])]);return f}case Ox:return a([o,s.toISOString()],s);case Mx:{const{source:d,flags:f}=s;return a([o,{source:d,flags:f}],s)}case Px:{const d=[],f=a([o,d],s);for(const[m,h]of s)(e||!(vf(Lc(m))||vf(Lc(h))))&&d.push([i(m),i(h)]);return f}case Dx:{const d=[],f=a([o,d],s);for(const m of s)(e||!vf(Lc(m)))&&d.push(i(m));return f}}const{message:u}=s;return a([o,{name:l,message:u}],s)};return i},kk=(e,{json:t,lossy:n}={})=>{const r=[];return NB(!(t||n),!!t,new Map,r)(e),r},am=typeof structuredClone=="function"?(e,t)=>t&&("json"in t||"lossy"in t)?_k(kk(e,t)):structuredClone(e):(e,t)=>_k(kk(e,t));function jB(e,t){const n=[{type:"text",value:"↩"}];return t>1&&n.push({type:"element",tagName:"sup",properties:{},children:[{type:"text",value:String(t)}]}),n}function TB(e,t){return"Back to reference "+(e+1)+(t>1?"-"+t:"")}function AB(e){const t=typeof e.options.clobberPrefix=="string"?e.options.clobberPrefix:"user-content-",n=e.options.footnoteBackContent||jB,r=e.options.footnoteBackLabel||TB,a=e.options.footnoteLabel||"Footnotes",i=e.options.footnoteLabelTagName||"h2",s=e.options.footnoteLabelProperties||{className:["sr-only"]},o=[];let l=-1;for(;++l<e.footnoteOrder.length;){const u=e.footnoteById.get(e.footnoteOrder[l]);if(!u)continue;const d=e.all(u),f=String(u.identifier).toUpperCase(),m=wc(f.toLowerCase());let h=0;const y=[],p=e.footnoteCounts.get(f);for(;p!==void 0&&++h<=p;){y.length>0&&y.push({type:"text",value:" "});let v=typeof n=="string"?n:n(l,h);typeof v=="string"&&(v={type:"text",value:v}),y.push({type:"element",tagName:"a",properties:{href:"#"+t+"fnref-"+m+(h>1?"-"+h:""),dataFootnoteBackref:"",ariaLabel:typeof r=="string"?r:r(l,h),className:["data-footnote-backref"]},children:Array.isArray(v)?v:[v]})}const b=d[d.length-1];if(b&&b.type==="element"&&b.tagName==="p"){const v=b.children[b.children.length-1];v&&v.type==="text"?v.value+=" ":b.children.push({type:"text",value:" "}),b.children.push(...y)}else d.push(...y);const g={type:"element",tagName:"li",properties:{id:t+"fn-"+m},children:e.wrap(d,!0)};e.patch(u,g),o.push(g)}if(o.length!==0)return{type:"element",tagName:"section",properties:{dataFootnotes:!0,className:["footnotes"]},children:[{type:"element",tagName:i,properties:{...am(s),id:"footnote-label"},children:[{type:"text",value:a}]},{type:"text",value:`
417
+ `},{type:"element",tagName:"ol",properties:{},children:e.wrap(o,!0)},{type:"text",value:`
418
+ `}]}}const gp=function(e){if(e==null)return MB;if(typeof e=="function")return yp(e);if(typeof e=="object")return Array.isArray(e)?RB(e):$B(e);if(typeof e=="string")return OB(e);throw new Error("Expected function, string, or object as test")};function RB(e){const t=[];let n=-1;for(;++n<e.length;)t[n]=gp(e[n]);return yp(r);function r(...a){let i=-1;for(;++i<t.length;)if(t[i].apply(this,a))return!0;return!1}}function $B(e){const t=e;return yp(n);function n(r){const a=r;let i;for(i in e)if(a[i]!==t[i])return!1;return!0}}function OB(e){return yp(t);function t(n){return n&&n.type===e}}function yp(e){return t;function t(n,r,a){return!!(PB(n)&&e.call(this,n,typeof r=="number"?r:void 0,a||void 0))}}function MB(){return!0}function PB(e){return e!==null&&typeof e=="object"&&"type"in e}const h$=[],DB=!0,Kv=!1,zB="skip";function m$(e,t,n,r){let a;typeof t=="function"&&typeof n!="function"?(r=n,n=t):a=t;const i=gp(a),s=r?-1:1;o(e,void 0,[])();function o(l,u,d){const f=l&&typeof l=="object"?l:{};if(typeof f.type=="string"){const h=typeof f.tagName=="string"?f.tagName:typeof f.name=="string"?f.name:void 0;Object.defineProperty(m,"name",{value:"node ("+(l.type+(h?"<"+h+">":""))+")"})}return m;function m(){let h=h$,y,p,b;if((!t||i(l,u,d[d.length-1]||void 0))&&(h=IB(n(l,d)),h[0]===Kv))return h;if("children"in l&&l.children){const g=l;if(g.children&&h[0]!==zB)for(p=(r?g.children.length:-1)+s,b=d.concat(g);p>-1&&p<g.children.length;){const v=g.children[p];if(y=o(v,p,b)(),y[0]===Kv)return y;p=typeof y[1]=="number"?y[1]:p+s}}return h}}}function IB(e){return Array.isArray(e)?e:typeof e=="number"?[DB,e]:e==null?h$:[e]}function zx(e,t,n,r){let a,i,s;typeof t=="function"&&typeof n!="function"?(i=void 0,s=t,a=n):(i=t,s=n,a=r),m$(e,i,o,a);function o(l,u){const d=u[u.length-1],f=d?d.children.indexOf(l):void 0;return s(l,f,d)}}const Zv={}.hasOwnProperty,LB={};function UB(e,t){const n=t||LB,r=new Map,a=new Map,i=new Map,s={..._B,...n.handlers},o={all:u,applyData:qB,definitionById:r,footnoteById:a,footnoteCounts:i,footnoteOrder:[],handlers:s,one:l,options:n,patch:FB,wrap:BB};return zx(e,function(d){if(d.type==="definition"||d.type==="footnoteDefinition"){const f=d.type==="definition"?r:a,m=String(d.identifier).toUpperCase();f.has(m)||f.set(m,d)}}),o;function l(d,f){const m=d.type,h=o.handlers[m];if(Zv.call(o.handlers,m)&&h)return h(o,d,f);if(o.options.passThrough&&o.options.passThrough.includes(m)){if("children"in d){const{children:p,...b}=d,g=am(b);return g.children=o.all(d),g}return am(d)}return(o.options.unknownHandler||HB)(o,d,f)}function u(d){const f=[];if("children"in d){const m=d.children;let h=-1;for(;++h<m.length;){const y=o.one(m[h],d);if(y){if(h&&m[h-1].type==="break"&&(!Array.isArray(y)&&y.type==="text"&&(y.value=Ek(y.value)),!Array.isArray(y)&&y.type==="element")){const p=y.children[0];p&&p.type==="text"&&(p.value=Ek(p.value))}Array.isArray(y)?f.push(...y):f.push(y)}}}return f}}function FB(e,t){e.position&&(t.position=T8(e))}function qB(e,t){let n=t;if(e&&e.data){const r=e.data.hName,a=e.data.hChildren,i=e.data.hProperties;if(typeof r=="string")if(n.type==="element")n.tagName=r;else{const s="children"in n?n.children:[n];n={type:"element",tagName:r,properties:{},children:s}}n.type==="element"&&i&&Object.assign(n.properties,am(i)),"children"in n&&n.children&&a!==null&&a!==void 0&&(n.children=a)}return n}function HB(e,t){const n=t.data||{},r="value"in t&&!(Zv.call(n,"hProperties")||Zv.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 BB(e,t){const n=[];let r=-1;for(t&&n.push({type:"text",value:`
419
+ `});++r<e.length;)r&&n.push({type:"text",value:`
420
+ `}),n.push(e[r]);return t&&e.length>0&&n.push({type:"text",value:`
421
+ `}),n}function Ek(e){let t=0,n=e.charCodeAt(t);for(;n===9||n===32;)t++,n=e.charCodeAt(t);return e.slice(t)}function Ck(e,t){const n=UB(e,t),r=n.one(e,void 0),a=AB(n),i=Array.isArray(r)?{type:"root",children:r}:r||{type:"root",children:[]};return a&&i.children.push({type:"text",value:`
422
+ `},a),i}function VB(e,t){return e&&"run"in e?async function(n,r){const a=Ck(n,{file:r,...t});await e.run(a,r)}:function(n,r){return Ck(n,{file:r,...e||t})}}function Nk(e){if(e)throw e}var rh=Object.prototype.hasOwnProperty,p$=Object.prototype.toString,jk=Object.defineProperty,Tk=Object.getOwnPropertyDescriptor,Ak=function(t){return typeof Array.isArray=="function"?Array.isArray(t):p$.call(t)==="[object Array]"},Rk=function(t){if(!t||p$.call(t)!=="[object Object]")return!1;var n=rh.call(t,"constructor"),r=t.constructor&&t.constructor.prototype&&rh.call(t.constructor.prototype,"isPrototypeOf");if(t.constructor&&!n&&!r)return!1;var a;for(a in t);return typeof a>"u"||rh.call(t,a)},$k=function(t,n){jk&&n.name==="__proto__"?jk(t,n.name,{enumerable:!0,configurable:!0,value:n.newValue,writable:!0}):t[n.name]=n.newValue},Ok=function(t,n){if(n==="__proto__")if(rh.call(t,n)){if(Tk)return Tk(t,n).value}else return;return t[n]},KB=function e(){var t,n,r,a,i,s,o=arguments[0],l=1,u=arguments.length,d=!1;for(typeof o=="boolean"&&(d=o,o=arguments[1]||{},l=2),(o==null||typeof o!="object"&&typeof o!="function")&&(o={});l<u;++l)if(t=arguments[l],t!=null)for(n in t)r=Ok(o,n),a=Ok(t,n),o!==a&&(d&&a&&(Rk(a)||(i=Ak(a)))?(i?(i=!1,s=r&&Ak(r)?r:[]):s=r&&Rk(r)?r:{},$k(o,{name:n,newValue:e(d,s,a)})):typeof a<"u"&&$k(o,{name:n,newValue:a}));return o};const Ug=ic(KB);function Gv(e){if(typeof e!="object"||e===null)return!1;const t=Object.getPrototypeOf(e);return(t===null||t===Object.prototype||Object.getPrototypeOf(t)===null)&&!(Symbol.toStringTag in e)&&!(Symbol.iterator in e)}function ZB(){const e=[],t={run:n,use:r};return t;function n(...a){let i=-1;const s=a.pop();if(typeof s!="function")throw new TypeError("Expected function as last argument, not "+s);o(null,...a);function o(l,...u){const d=e[++i];let f=-1;if(l){s(l);return}for(;++f<a.length;)(u[f]===null||u[f]===void 0)&&(u[f]=a[f]);a=u,d?GB(d,o)(...u):s(null,...u)}}function r(a){if(typeof a!="function")throw new TypeError("Expected `middelware` to be a function, not "+a);return e.push(a),t}}function GB(e,t){let n;return r;function r(...s){const o=e.length>s.length;let l;o&&s.push(a);try{l=e.apply(this,s)}catch(u){const d=u;if(o&&n)throw d;return a(d)}o||(l&&l.then&&typeof l.then=="function"?l.then(i,a):l instanceof Error?a(l):i(l))}function a(s,...o){n||(n=!0,t(s,...o))}function i(s){a(null,s)}}const la={basename:QB,dirname:YB,extname:XB,join:WB,sep:"/"};function QB(e,t){if(t!==void 0&&typeof t!="string")throw new TypeError('"ext" argument must be a string');jd(e);let n=0,r=-1,a=e.length,i;if(t===void 0||t.length===0||t.length>e.length){for(;a--;)if(e.codePointAt(a)===47){if(i){n=a+1;break}}else r<0&&(i=!0,r=a+1);return r<0?"":e.slice(n,r)}if(t===e)return"";let s=-1,o=t.length-1;for(;a--;)if(e.codePointAt(a)===47){if(i){n=a+1;break}}else s<0&&(i=!0,s=a+1),o>-1&&(e.codePointAt(a)===t.codePointAt(o--)?o<0&&(r=a):(o=-1,r=s));return n===r?r=s:r<0&&(r=e.length),e.slice(n,r)}function YB(e){if(jd(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||(r=!0);return t<0?e.codePointAt(0)===47?"/":".":t===1&&e.codePointAt(0)===47?"//":e.slice(0,t)}function XB(e){jd(e);let t=e.length,n=-1,r=0,a=-1,i=0,s;for(;t--;){const o=e.codePointAt(t);if(o===47){if(s){r=t+1;break}continue}n<0&&(s=!0,n=t+1),o===46?a<0?a=t:i!==1&&(i=1):a>-1&&(i=-1)}return a<0||n<0||i===0||i===1&&a===n-1&&a===r+1?"":e.slice(a,n)}function WB(...e){let t=-1,n;for(;++t<e.length;)jd(e[t]),e[t]&&(n=n===void 0?e[t]:n+"/"+e[t]);return n===void 0?".":JB(n)}function JB(e){jd(e);const t=e.codePointAt(0)===47;let n=eV(e,!t);return n.length===0&&!t&&(n="."),n.length>0&&e.codePointAt(e.length-1)===47&&(n+="/"),t?"/"+n:n}function eV(e,t){let n="",r=0,a=-1,i=0,s=-1,o,l;for(;++s<=e.length;){if(s<e.length)o=e.codePointAt(s);else{if(o===47)break;o=47}if(o===47){if(!(a===s-1||i===1))if(a!==s-1&&i===2){if(n.length<2||r!==2||n.codePointAt(n.length-1)!==46||n.codePointAt(n.length-2)!==46){if(n.length>2){if(l=n.lastIndexOf("/"),l!==n.length-1){l<0?(n="",r=0):(n=n.slice(0,l),r=n.length-1-n.lastIndexOf("/")),a=s,i=0;continue}}else if(n.length>0){n="",r=0,a=s,i=0;continue}}t&&(n=n.length>0?n+"/..":"..",r=2)}else n.length>0?n+="/"+e.slice(a+1,s):n=e.slice(a+1,s),r=s-a-1;a=s,i=0}else o===46&&i>-1?i++:i=-1}return n}function jd(e){if(typeof e!="string")throw new TypeError("Path must be a string. Received "+JSON.stringify(e))}const tV={cwd:nV};function nV(){return"/"}function Qv(e){return!!(e!==null&&typeof e=="object"&&"href"in e&&e.href&&"protocol"in e&&e.protocol&&e.auth===void 0)}function rV(e){if(typeof e=="string")e=new URL(e);else if(!Qv(e)){const t=new 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:"){const t=new TypeError("The URL must be of scheme file");throw t.code="ERR_INVALID_URL_SCHEME",t}return aV(e)}function aV(e){if(e.hostname!==""){const r=new TypeError('File URL host must be "localhost" or empty on darwin');throw r.code="ERR_INVALID_FILE_URL_HOST",r}const t=e.pathname;let n=-1;for(;++n<t.length;)if(t.codePointAt(n)===37&&t.codePointAt(n+1)===50){const r=t.codePointAt(n+2);if(r===70||r===102){const a=new TypeError("File URL path must not include encoded / characters");throw a.code="ERR_INVALID_FILE_URL_PATH",a}}return decodeURIComponent(t)}const Fg=["history","path","basename","stem","extname","dirname"];class g${constructor(t){let n;t?Qv(t)?n={path:t}:typeof t=="string"||iV(t)?n={value:t}:n=t:n={},this.cwd="cwd"in n?"":tV.cwd(),this.data={},this.history=[],this.messages=[],this.value,this.map,this.result,this.stored;let r=-1;for(;++r<Fg.length;){const i=Fg[r];i in n&&n[i]!==void 0&&n[i]!==null&&(this[i]=i==="history"?[...n[i]]:n[i])}let a;for(a in n)Fg.includes(a)||(this[a]=n[a])}get basename(){return typeof this.path=="string"?la.basename(this.path):void 0}set basename(t){Hg(t,"basename"),qg(t,"basename"),this.path=la.join(this.dirname||"",t)}get dirname(){return typeof this.path=="string"?la.dirname(this.path):void 0}set dirname(t){Mk(this.basename,"dirname"),this.path=la.join(t||"",this.basename)}get extname(){return typeof this.path=="string"?la.extname(this.path):void 0}set extname(t){if(qg(t,"extname"),Mk(this.dirname,"extname"),t){if(t.codePointAt(0)!==46)throw new Error("`extname` must start with `.`");if(t.includes(".",1))throw new Error("`extname` cannot contain multiple dots")}this.path=la.join(this.dirname,this.stem+(t||""))}get path(){return this.history[this.history.length-1]}set path(t){Qv(t)&&(t=rV(t)),Hg(t,"path"),this.path!==t&&this.history.push(t)}get stem(){return typeof this.path=="string"?la.basename(this.path,this.extname):void 0}set stem(t){Hg(t,"stem"),qg(t,"stem"),this.path=la.join(this.dirname||"",t+(this.extname||""))}fail(t,n,r){const a=this.message(t,n,r);throw a.fatal=!0,a}info(t,n,r){const a=this.message(t,n,r);return a.fatal=void 0,a}message(t,n,r){const a=new Tn(t,n,r);return this.path&&(a.name=this.path+":"+a.name,a.file=this.path),a.fatal=!1,this.messages.push(a),a}toString(t){return this.value===void 0?"":typeof this.value=="string"?this.value:new TextDecoder(t||void 0).decode(this.value)}}function qg(e,t){if(e&&e.includes(la.sep))throw new Error("`"+t+"` cannot be a path: did not expect `"+la.sep+"`")}function Hg(e,t){if(!e)throw new Error("`"+t+"` cannot be empty")}function Mk(e,t){if(!e)throw new Error("Setting `"+t+"` requires `path` to be set too")}function iV(e){return!!(e&&typeof e=="object"&&"byteLength"in e&&"byteOffset"in e)}const sV=function(e){const r=this.constructor.prototype,a=r[e],i=function(){return a.apply(i,arguments)};return Object.setPrototypeOf(i,r),i},oV={}.hasOwnProperty;class Ix extends sV{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=ZB()}copy(){const t=new Ix;let n=-1;for(;++n<this.attachers.length;){const r=this.attachers[n];t.use(...r)}return t.data(Ug(!0,{},this.namespace)),t}data(t,n){return typeof t=="string"?arguments.length===2?(Kg("data",this.frozen),this.namespace[t]=n,this):oV.call(this.namespace,t)&&this.namespace[t]||void 0:t?(Kg("data",this.frozen),this.namespace=t,this):this.namespace}freeze(){if(this.frozen)return this;const t=this;for(;++this.freezeIndex<this.attachers.length;){const[n,...r]=this.attachers[this.freezeIndex];if(r[0]===!1)continue;r[0]===!0&&(r[0]=void 0);const a=n.call(t,...r);typeof a=="function"&&this.transformers.use(a)}return this.frozen=!0,this.freezeIndex=Number.POSITIVE_INFINITY,this}parse(t){this.freeze();const n=bf(t),r=this.parser||this.Parser;return Bg("parse",r),r(String(n),n)}process(t,n){const r=this;return this.freeze(),Bg("process",this.parser||this.Parser),Vg("process",this.compiler||this.Compiler),n?a(void 0,n):new Promise(a);function a(i,s){const o=bf(t),l=r.parse(o);r.run(l,o,function(d,f,m){if(d||!f||!m)return u(d);const h=f,y=r.stringify(h,m);uV(y)?m.value=y:m.result=y,u(d,m)});function u(d,f){d||!f?s(d):i?i(f):n(void 0,f)}}}processSync(t){let n=!1,r;return this.freeze(),Bg("processSync",this.parser||this.Parser),Vg("processSync",this.compiler||this.Compiler),this.process(t,a),Dk("processSync","process",n),r;function a(i,s){n=!0,Nk(i),r=s}}run(t,n,r){Pk(t),this.freeze();const a=this.transformers;return!r&&typeof n=="function"&&(r=n,n=void 0),r?i(void 0,r):new Promise(i);function i(s,o){const l=bf(n);a.run(t,l,u);function u(d,f,m){const h=f||t;d?o(d):s?s(h):r(void 0,h,m)}}}runSync(t,n){let r=!1,a;return this.run(t,n,i),Dk("runSync","run",r),a;function i(s,o){Nk(s),a=o,r=!0}}stringify(t,n){this.freeze();const r=bf(n),a=this.compiler||this.Compiler;return Vg("stringify",a),Pk(t),a(t,r)}use(t,...n){const r=this.attachers,a=this.namespace;if(Kg("use",this.frozen),t!=null)if(typeof t=="function")l(t,n);else if(typeof t=="object")Array.isArray(t)?o(t):s(t);else throw new TypeError("Expected usable value, not `"+t+"`");return this;function i(u){if(typeof u=="function")l(u,[]);else if(typeof u=="object")if(Array.isArray(u)){const[d,...f]=u;l(d,f)}else s(u);else throw new TypeError("Expected usable value, not `"+u+"`")}function s(u){if(!("plugins"in u)&&!("settings"in u))throw new 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(u.plugins),u.settings&&(a.settings=Ug(!0,a.settings,u.settings))}function o(u){let d=-1;if(u!=null)if(Array.isArray(u))for(;++d<u.length;){const f=u[d];i(f)}else throw new TypeError("Expected a list of plugins, not `"+u+"`")}function l(u,d){let f=-1,m=-1;for(;++f<r.length;)if(r[f][0]===u){m=f;break}if(m===-1)r.push([u,...d]);else if(d.length>0){let[h,...y]=d;const p=r[m][1];Gv(p)&&Gv(h)&&(h=Ug(!0,p,h)),r[m]=[u,h,...y]}}}}const lV=new Ix().freeze();function Bg(e,t){if(typeof t!="function")throw new TypeError("Cannot `"+e+"` without `parser`")}function Vg(e,t){if(typeof t!="function")throw new TypeError("Cannot `"+e+"` without `compiler`")}function Kg(e,t){if(t)throw new Error("Cannot call `"+e+"` on a frozen processor.\nCreate a new processor first, by calling it: use `processor()` instead of `processor`.")}function Pk(e){if(!Gv(e)||typeof e.type!="string")throw new TypeError("Expected node, got `"+e+"`")}function Dk(e,t,n){if(!n)throw new Error("`"+e+"` finished async. Use `"+t+"` instead")}function bf(e){return cV(e)?e:new g$(e)}function cV(e){return!!(e&&typeof e=="object"&&"message"in e&&"messages"in e)}function uV(e){return typeof e=="string"||dV(e)}function dV(e){return!!(e&&typeof e=="object"&&"byteLength"in e&&"byteOffset"in e)}const fV="https://github.com/remarkjs/react-markdown/blob/main/changelog.md",zk=[],Ik={allowDangerousHtml:!0},hV=/^(https?|ircs?|mailto|xmpp)$/i,mV=[{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 pV(e){const t=gV(e),n=yV(e);return vV(t.runSync(t.parse(n),n),e)}function gV(e){const t=e.rehypePlugins||zk,n=e.remarkPlugins||zk,r=e.remarkRehypeOptions?{...e.remarkRehypeOptions,...Ik}:Ik;return lV().use(XH).use(n).use(VB,r).use(t)}function yV(e){const t=e.children||"",n=new g$;return typeof t=="string"&&(n.value=t),n}function vV(e,t){const n=t.allowedElements,r=t.allowElement,a=t.components,i=t.disallowedElements,s=t.skipHtml,o=t.unwrapDisallowed,l=t.urlTransform||bV;for(const d of mV)Object.hasOwn(t,d.from)&&(""+d.from+(d.to?"use `"+d.to+"` instead":"remove it")+fV+d.id,void 0);return zx(e,u),M8(e,{Fragment:c.Fragment,components:a,ignoreInvalidStyle:!0,jsx:c.jsx,jsxs:c.jsxs,passKeys:!0,passNode:!0});function u(d,f,m){if(d.type==="raw"&&m&&typeof f=="number")return s?m.children.splice(f,1):m.children[f]={type:"text",value:d.value},f;if(d.type==="element"){let h;for(h in zg)if(Object.hasOwn(zg,h)&&Object.hasOwn(d.properties,h)){const y=d.properties[h],p=zg[h];(p===null||p.includes(d.tagName))&&(d.properties[h]=l(String(y||""),h,d))}}if(d.type==="element"){let h=n?!n.includes(d.tagName):i?i.includes(d.tagName):!1;if(!h&&r&&typeof f=="number"&&(h=!r(d,f,m)),h&&m&&typeof f=="number")return o&&d.children?m.children.splice(f,1,...d.children):m.children.splice(f,1),f}}}function bV(e){const t=e.indexOf(":"),n=e.indexOf("?"),r=e.indexOf("#"),a=e.indexOf("/");return t===-1||a!==-1&&t>a||n!==-1&&t>n||r!==-1&&t>r||hV.test(e.slice(0,t))?e:""}function Lk(e,t){const n=String(e);if(typeof t!="string")throw new TypeError("Expected character");let r=0,a=n.indexOf(t);for(;a!==-1;)r++,a=n.indexOf(t,a+t.length);return r}function xV(e){if(typeof e!="string")throw new TypeError("Expected a string");return e.replace(/[|\\{}()[\]^$+*?.]/g,"\\$&").replace(/-/g,"\\x2d")}function wV(e,t,n){const a=gp((n||{}).ignore||[]),i=SV(t);let s=-1;for(;++s<i.length;)m$(e,"text",o);function o(u,d){let f=-1,m;for(;++f<d.length;){const h=d[f],y=m?m.children:void 0;if(a(h,y?y.indexOf(h):void 0,m))return;m=h}if(m)return l(u,d)}function l(u,d){const f=d[d.length-1],m=i[s][0],h=i[s][1];let y=0;const b=f.children.indexOf(u);let g=!1,v=[];m.lastIndex=0;let w=m.exec(u.value);for(;w;){const S=w.index,E={index:w.index,input:w.input,stack:[...d,u]};let C=h(...w,E);if(typeof C=="string"&&(C=C.length>0?{type:"text",value:C}:void 0),C===!1?m.lastIndex=S+1:(y!==S&&v.push({type:"text",value:u.value.slice(y,S)}),Array.isArray(C)?v.push(...C):C&&v.push(C),y=S+w[0].length,g=!0),!m.global)break;w=m.exec(u.value)}return g?(y<u.value.length&&v.push({type:"text",value:u.value.slice(y)}),f.children.splice(b,1,...v)):v=[u],b+v.length}}function SV(e){const t=[];if(!Array.isArray(e))throw new TypeError("Expected find and replace tuple or list of tuples");const n=!e[0]||Array.isArray(e[0])?e:[e];let r=-1;for(;++r<n.length;){const a=n[r];t.push([_V(a[0]),kV(a[1])])}return t}function _V(e){return typeof e=="string"?new RegExp(xV(e),"g"):e}function kV(e){return typeof e=="function"?e:function(){return e}}const Zg="phrasing",Gg=["autolink","link","image","label"];function EV(){return{transforms:[$V],enter:{literalAutolink:NV,literalAutolinkEmail:Qg,literalAutolinkHttp:Qg,literalAutolinkWww:Qg},exit:{literalAutolink:RV,literalAutolinkEmail:AV,literalAutolinkHttp:jV,literalAutolinkWww:TV}}}function CV(){return{unsafe:[{character:"@",before:"[+\\-.\\w]",after:"[\\-.\\w]",inConstruct:Zg,notInConstruct:Gg},{character:".",before:"[Ww]",after:"[\\-.\\w]",inConstruct:Zg,notInConstruct:Gg},{character:":",before:"[ps]",after:"\\/",inConstruct:Zg,notInConstruct:Gg}]}}function NV(e){this.enter({type:"link",title:null,url:"",children:[]},e)}function Qg(e){this.config.enter.autolinkProtocol.call(this,e)}function jV(e){this.config.exit.autolinkProtocol.call(this,e)}function TV(e){this.config.exit.data.call(this,e);const t=this.stack[this.stack.length-1];t.type,t.url="http://"+this.sliceSerialize(e)}function AV(e){this.config.exit.autolinkEmail.call(this,e)}function RV(e){this.exit(e)}function $V(e){wV(e,[[/(https?:\/\/|www(?=\.))([-.\w]+)([^ \t\r\n]*)/gi,OV],[new RegExp("(?<=^|\\s|\\p{P}|\\p{S})([-.\\w+]+)@([-\\w]+(?:\\.[-\\w]+)+)","gu"),MV]],{ignore:["link","linkReference"]})}function OV(e,t,n,r,a){let i="";if(!y$(a)||(/^w/i.test(t)&&(n=t+n,t="",i="http://"),!PV(n)))return!1;const s=DV(n+r);if(!s[0])return!1;const o={type:"link",title:null,url:i+t+s[0],children:[{type:"text",value:t+s[0]}]};return s[1]?[o,{type:"text",value:s[1]}]:o}function MV(e,t,n,r){return!y$(r,!0)||/[-\d_]$/.test(n)?!1:{type:"link",title:null,url:"mailto:"+t+"@"+n,children:[{type:"text",value:t+"@"+n}]}}function PV(e){const 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 DV(e){const t=/[!"&'),.:;<>?\]}]+$/.exec(e);if(!t)return[e,void 0];e=e.slice(0,t.index);let n=t[0],r=n.indexOf(")");const a=Lk(e,"(");let i=Lk(e,")");for(;r!==-1&&a>i;)e+=n.slice(0,r+1),n=n.slice(r+1),r=n.indexOf(")"),i++;return[e,n]}function y$(e,t){const n=e.input.charCodeAt(e.index-1);return(e.index===0||go(n)||hp(n))&&(!t||n!==47)}v$.peek=VV;function zV(){this.buffer()}function IV(e){this.enter({type:"footnoteReference",identifier:"",label:""},e)}function LV(){this.buffer()}function UV(e){this.enter({type:"footnoteDefinition",identifier:"",label:"",children:[]},e)}function FV(e){const t=this.resume(),n=this.stack[this.stack.length-1];n.type,n.identifier=ea(this.sliceSerialize(e)).toLowerCase(),n.label=t}function qV(e){this.exit(e)}function HV(e){const t=this.resume(),n=this.stack[this.stack.length-1];n.type,n.identifier=ea(this.sliceSerialize(e)).toLowerCase(),n.label=t}function BV(e){this.exit(e)}function VV(){return"["}function v$(e,t,n,r){const a=n.createTracker(r);let i=a.move("[^");const s=n.enter("footnoteReference"),o=n.enter("reference");return i+=a.move(n.safe(n.associationId(e),{after:"]",before:i})),o(),s(),i+=a.move("]"),i}function KV(){return{enter:{gfmFootnoteCallString:zV,gfmFootnoteCall:IV,gfmFootnoteDefinitionLabelString:LV,gfmFootnoteDefinition:UV},exit:{gfmFootnoteCallString:FV,gfmFootnoteCall:qV,gfmFootnoteDefinitionLabelString:HV,gfmFootnoteDefinition:BV}}}function ZV(e){let t=!1;return e&&e.firstLineBlank&&(t=!0),{handlers:{footnoteDefinition:n,footnoteReference:v$},unsafe:[{character:"[",inConstruct:["label","phrasing","reference"]}]};function n(r,a,i,s){const o=i.createTracker(s);let l=o.move("[^");const u=i.enter("footnoteDefinition"),d=i.enter("label");return l+=o.move(i.safe(i.associationId(r),{before:l,after:"]"})),d(),l+=o.move("]:"),r.children&&r.children.length>0&&(o.shift(4),l+=o.move((t?`
423
+ `:" ")+i.indentLines(i.containerFlow(r,o.current()),t?b$:GV))),u(),l}}function GV(e,t,n){return t===0?e:b$(e,t,n)}function b$(e,t,n){return(n?"":" ")+e}const QV=["autolink","destinationLiteral","destinationRaw","reference","titleQuote","titleApostrophe"];x$.peek=e7;function YV(){return{canContainEols:["delete"],enter:{strikethrough:WV},exit:{strikethrough:JV}}}function XV(){return{unsafe:[{character:"~",inConstruct:"phrasing",notInConstruct:QV}],handlers:{delete:x$}}}function WV(e){this.enter({type:"delete",children:[]},e)}function JV(e){this.exit(e)}function x$(e,t,n,r){const a=n.createTracker(r),i=n.enter("strikethrough");let s=a.move("~~");return s+=n.containerPhrasing(e,{...a.current(),before:s,after:"~"}),s+=a.move("~~"),i(),s}function e7(){return"~"}function t7(e){return e.length}function n7(e,t){const n=t||{},r=(n.align||[]).concat(),a=n.stringLength||t7,i=[],s=[],o=[],l=[];let u=0,d=-1;for(;++d<e.length;){const p=[],b=[];let g=-1;for(e[d].length>u&&(u=e[d].length);++g<e[d].length;){const v=r7(e[d][g]);if(n.alignDelimiters!==!1){const w=a(v);b[g]=w,(l[g]===void 0||w>l[g])&&(l[g]=w)}p.push(v)}s[d]=p,o[d]=b}let f=-1;if(typeof r=="object"&&"length"in r)for(;++f<u;)i[f]=Uk(r[f]);else{const p=Uk(r);for(;++f<u;)i[f]=p}f=-1;const m=[],h=[];for(;++f<u;){const p=i[f];let b="",g="";p===99?(b=":",g=":"):p===108?b=":":p===114&&(g=":");let v=n.alignDelimiters===!1?1:Math.max(1,l[f]-b.length-g.length);const w=b+"-".repeat(v)+g;n.alignDelimiters!==!1&&(v=b.length+v+g.length,v>l[f]&&(l[f]=v),h[f]=v),m[f]=w}s.splice(1,0,m),o.splice(1,0,h),d=-1;const y=[];for(;++d<s.length;){const p=s[d],b=o[d];f=-1;const g=[];for(;++f<u;){const v=p[f]||"";let w="",S="";if(n.alignDelimiters!==!1){const E=l[f]-(b[f]||0),C=i[f];C===114?w=" ".repeat(E):C===99?E%2?(w=" ".repeat(E/2+.5),S=" ".repeat(E/2-.5)):(w=" ".repeat(E/2),S=w):S=" ".repeat(E)}n.delimiterStart!==!1&&!f&&g.push("|"),n.padding!==!1&&!(n.alignDelimiters===!1&&v==="")&&(n.delimiterStart!==!1||f)&&g.push(" "),n.alignDelimiters!==!1&&g.push(w),g.push(v),n.alignDelimiters!==!1&&g.push(S),n.padding!==!1&&g.push(" "),(n.delimiterEnd!==!1||f!==u-1)&&g.push("|")}y.push(n.delimiterEnd===!1?g.join("").replace(/ +$/,""):g.join(""))}return y.join(`
424
+ `)}function r7(e){return e==null?"":String(e)}function Uk(e){const 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 a7(e,t,n,r){const a=n.enter("blockquote"),i=n.createTracker(r);i.move("> "),i.shift(2);const s=n.indentLines(n.containerFlow(e,i.current()),i7);return a(),s}function i7(e,t,n){return">"+(n?"":" ")+e}function s7(e,t){return Fk(e,t.inConstruct,!0)&&!Fk(e,t.notInConstruct,!1)}function Fk(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 qk(e,t,n,r){let a=-1;for(;++a<n.unsafe.length;)if(n.unsafe[a].character===`
425
+ `&&s7(n.stack,n.unsafe[a]))return/[ \t]/.test(r.before)?"":" ";return`\\
426
+ `}function o7(e,t){const n=String(e);let r=n.indexOf(t),a=r,i=0,s=0;if(typeof t!="string")throw new TypeError("Expected substring");for(;r!==-1;)r===a?++i>s&&(s=i):i=1,a=r+t.length,r=n.indexOf(t,a);return s}function l7(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 c7(e){const t=e.options.fence||"`";if(t!=="`"&&t!=="~")throw new Error("Cannot serialize code with `"+t+"` for `options.fence`, expected `` ` `` or `~`");return t}function u7(e,t,n,r){const a=c7(n),i=e.value||"",s=a==="`"?"GraveAccent":"Tilde";if(l7(e,n)){const f=n.enter("codeIndented"),m=n.indentLines(i,d7);return f(),m}const o=n.createTracker(r),l=a.repeat(Math.max(o7(i,a)+1,3)),u=n.enter("codeFenced");let d=o.move(l);if(e.lang){const f=n.enter(`codeFencedLang${s}`);d+=o.move(n.safe(e.lang,{before:d,after:" ",encode:["`"],...o.current()})),f()}if(e.lang&&e.meta){const f=n.enter(`codeFencedMeta${s}`);d+=o.move(" "),d+=o.move(n.safe(e.meta,{before:d,after:`
427
+ `,encode:["`"],...o.current()})),f()}return d+=o.move(`
428
+ `),i&&(d+=o.move(i+`
429
+ `)),d+=o.move(l),u(),d}function d7(e,t,n){return(n?"":" ")+e}function Lx(e){const t=e.options.quote||'"';if(t!=='"'&&t!=="'")throw new Error("Cannot serialize title with `"+t+"` for `options.quote`, expected `\"`, or `'`");return t}function f7(e,t,n,r){const a=Lx(n),i=a==='"'?"Quote":"Apostrophe",s=n.enter("definition");let o=n.enter("label");const l=n.createTracker(r);let u=l.move("[");return u+=l.move(n.safe(n.associationId(e),{before:u,after:"]",...l.current()})),u+=l.move("]: "),o(),!e.url||/[\0- \u007F]/.test(e.url)?(o=n.enter("destinationLiteral"),u+=l.move("<"),u+=l.move(n.safe(e.url,{before:u,after:">",...l.current()})),u+=l.move(">")):(o=n.enter("destinationRaw"),u+=l.move(n.safe(e.url,{before:u,after:e.title?" ":`
430
+ `,...l.current()}))),o(),e.title&&(o=n.enter(`title${i}`),u+=l.move(" "+a),u+=l.move(n.safe(e.title,{before:u,after:a,...l.current()})),u+=l.move(a),o()),s(),u}function h7(e){const t=e.options.emphasis||"*";if(t!=="*"&&t!=="_")throw new Error("Cannot serialize emphasis with `"+t+"` for `options.emphasis`, expected `*`, or `_`");return t}function Yu(e){return"&#x"+e.toString(16).toUpperCase()+";"}function im(e,t,n){const r=tc(e),a=tc(t);return r===void 0?a===void 0?n==="_"?{inside:!0,outside:!0}:{inside:!1,outside:!1}:a===1?{inside:!0,outside:!0}:{inside:!1,outside:!0}:r===1?a===void 0?{inside:!1,outside:!1}:a===1?{inside:!0,outside:!0}:{inside:!1,outside:!1}:a===void 0?{inside:!1,outside:!1}:a===1?{inside:!0,outside:!1}:{inside:!1,outside:!1}}w$.peek=m7;function w$(e,t,n,r){const a=h7(n),i=n.enter("emphasis"),s=n.createTracker(r),o=s.move(a);let l=s.move(n.containerPhrasing(e,{after:a,before:o,...s.current()}));const u=l.charCodeAt(0),d=im(r.before.charCodeAt(r.before.length-1),u,a);d.inside&&(l=Yu(u)+l.slice(1));const f=l.charCodeAt(l.length-1),m=im(r.after.charCodeAt(0),f,a);m.inside&&(l=l.slice(0,-1)+Yu(f));const h=s.move(a);return i(),n.attentionEncodeSurroundingInfo={after:m.outside,before:d.outside},o+l+h}function m7(e,t,n){return n.options.emphasis||"*"}function p7(e,t){let n=!1;return zx(e,function(r){if("value"in r&&/\r?\n|\r/.test(r.value)||r.type==="break")return n=!0,Kv}),!!((!e.depth||e.depth<3)&&Ax(e)&&(t.options.setext||n))}function g7(e,t,n,r){const a=Math.max(Math.min(6,e.depth||1),1),i=n.createTracker(r);if(p7(e,n)){const d=n.enter("headingSetext"),f=n.enter("phrasing"),m=n.containerPhrasing(e,{...i.current(),before:`
431
+ `,after:`
432
+ `});return f(),d(),m+`
433
+ `+(a===1?"=":"-").repeat(m.length-(Math.max(m.lastIndexOf("\r"),m.lastIndexOf(`
434
+ `))+1))}const s="#".repeat(a),o=n.enter("headingAtx"),l=n.enter("phrasing");i.move(s+" ");let u=n.containerPhrasing(e,{before:"# ",after:`
435
+ `,...i.current()});return/^[\t ]/.test(u)&&(u=Yu(u.charCodeAt(0))+u.slice(1)),u=u?s+" "+u:s,n.options.closeAtx&&(u+=" "+s),l(),o(),u}S$.peek=y7;function S$(e){return e.value||""}function y7(){return"<"}_$.peek=v7;function _$(e,t,n,r){const a=Lx(n),i=a==='"'?"Quote":"Apostrophe",s=n.enter("image");let o=n.enter("label");const l=n.createTracker(r);let u=l.move("![");return u+=l.move(n.safe(e.alt,{before:u,after:"]",...l.current()})),u+=l.move("]("),o(),!e.url&&e.title||/[\0- \u007F]/.test(e.url)?(o=n.enter("destinationLiteral"),u+=l.move("<"),u+=l.move(n.safe(e.url,{before:u,after:">",...l.current()})),u+=l.move(">")):(o=n.enter("destinationRaw"),u+=l.move(n.safe(e.url,{before:u,after:e.title?" ":")",...l.current()}))),o(),e.title&&(o=n.enter(`title${i}`),u+=l.move(" "+a),u+=l.move(n.safe(e.title,{before:u,after:a,...l.current()})),u+=l.move(a),o()),u+=l.move(")"),s(),u}function v7(){return"!"}k$.peek=b7;function k$(e,t,n,r){const a=e.referenceType,i=n.enter("imageReference");let s=n.enter("label");const o=n.createTracker(r);let l=o.move("![");const u=n.safe(e.alt,{before:l,after:"]",...o.current()});l+=o.move(u+"]["),s();const d=n.stack;n.stack=[],s=n.enter("reference");const f=n.safe(n.associationId(e),{before:l,after:"]",...o.current()});return s(),n.stack=d,i(),a==="full"||!u||u!==f?l+=o.move(f+"]"):a==="shortcut"?l=l.slice(0,-1):l+=o.move("]"),l}function b7(){return"!"}E$.peek=x7;function E$(e,t,n){let r=e.value||"",a="`",i=-1;for(;new RegExp("(^|[^`])"+a+"([^`]|$)").test(r);)a+="`";for(/[^ \r\n]/.test(r)&&(/^[ \r\n]/.test(r)&&/[ \r\n]$/.test(r)||/^`|`$/.test(r))&&(r=" "+r+" ");++i<n.unsafe.length;){const s=n.unsafe[i],o=n.compilePattern(s);let l;if(s.atBreak)for(;l=o.exec(r);){let u=l.index;r.charCodeAt(u)===10&&r.charCodeAt(u-1)===13&&u--,r=r.slice(0,u)+" "+r.slice(l.index+1)}}return a+r+a}function x7(){return"`"}function C$(e,t){const n=Ax(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))}N$.peek=w7;function N$(e,t,n,r){const a=Lx(n),i=a==='"'?"Quote":"Apostrophe",s=n.createTracker(r);let o,l;if(C$(e,n)){const d=n.stack;n.stack=[],o=n.enter("autolink");let f=s.move("<");return f+=s.move(n.containerPhrasing(e,{before:f,after:">",...s.current()})),f+=s.move(">"),o(),n.stack=d,f}o=n.enter("link"),l=n.enter("label");let u=s.move("[");return u+=s.move(n.containerPhrasing(e,{before:u,after:"](",...s.current()})),u+=s.move("]("),l(),!e.url&&e.title||/[\0- \u007F]/.test(e.url)?(l=n.enter("destinationLiteral"),u+=s.move("<"),u+=s.move(n.safe(e.url,{before:u,after:">",...s.current()})),u+=s.move(">")):(l=n.enter("destinationRaw"),u+=s.move(n.safe(e.url,{before:u,after:e.title?" ":")",...s.current()}))),l(),e.title&&(l=n.enter(`title${i}`),u+=s.move(" "+a),u+=s.move(n.safe(e.title,{before:u,after:a,...s.current()})),u+=s.move(a),l()),u+=s.move(")"),o(),u}function w7(e,t,n){return C$(e,n)?"<":"["}j$.peek=S7;function j$(e,t,n,r){const a=e.referenceType,i=n.enter("linkReference");let s=n.enter("label");const o=n.createTracker(r);let l=o.move("[");const u=n.containerPhrasing(e,{before:l,after:"]",...o.current()});l+=o.move(u+"]["),s();const d=n.stack;n.stack=[],s=n.enter("reference");const f=n.safe(n.associationId(e),{before:l,after:"]",...o.current()});return s(),n.stack=d,i(),a==="full"||!u||u!==f?l+=o.move(f+"]"):a==="shortcut"?l=l.slice(0,-1):l+=o.move("]"),l}function S7(){return"["}function Ux(e){const t=e.options.bullet||"*";if(t!=="*"&&t!=="+"&&t!=="-")throw new Error("Cannot serialize items with `"+t+"` for `options.bullet`, expected `*`, `+`, or `-`");return t}function _7(e){const t=Ux(e),n=e.options.bulletOther;if(!n)return t==="*"?"-":"*";if(n!=="*"&&n!=="+"&&n!=="-")throw new Error("Cannot serialize items with `"+n+"` for `options.bulletOther`, expected `*`, `+`, or `-`");if(n===t)throw new Error("Expected `bullet` (`"+t+"`) and `bulletOther` (`"+n+"`) to be different");return n}function k7(e){const t=e.options.bulletOrdered||".";if(t!=="."&&t!==")")throw new Error("Cannot serialize items with `"+t+"` for `options.bulletOrdered`, expected `.` or `)`");return t}function T$(e){const t=e.options.rule||"*";if(t!=="*"&&t!=="-"&&t!=="_")throw new Error("Cannot serialize rules with `"+t+"` for `options.rule`, expected `*`, `-`, or `_`");return t}function E7(e,t,n,r){const a=n.enter("list"),i=n.bulletCurrent;let s=e.ordered?k7(n):Ux(n);const o=e.ordered?s==="."?")":".":_7(n);let l=t&&n.bulletLastUsed?s===n.bulletLastUsed:!1;if(!e.ordered){const d=e.children?e.children[0]:void 0;if((s==="*"||s==="-")&&d&&(!d.children||!d.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&&(l=!0),T$(n)===s&&d){let f=-1;for(;++f<e.children.length;){const m=e.children[f];if(m&&m.type==="listItem"&&m.children&&m.children[0]&&m.children[0].type==="thematicBreak"){l=!0;break}}}}l&&(s=o),n.bulletCurrent=s;const u=n.containerFlow(e,r);return n.bulletLastUsed=s,n.bulletCurrent=i,a(),u}function C7(e){const t=e.options.listItemIndent||"one";if(t!=="tab"&&t!=="one"&&t!=="mixed")throw new Error("Cannot serialize items with `"+t+"` for `options.listItemIndent`, expected `tab`, `one`, or `mixed`");return t}function N7(e,t,n,r){const a=C7(n);let i=n.bulletCurrent||Ux(n);t&&t.type==="list"&&t.ordered&&(i=(typeof t.start=="number"&&t.start>-1?t.start:1)+(n.options.incrementListMarker===!1?0:t.children.indexOf(e))+i);let s=i.length+1;(a==="tab"||a==="mixed"&&(t&&t.type==="list"&&t.spread||e.spread))&&(s=Math.ceil(s/4)*4);const o=n.createTracker(r);o.move(i+" ".repeat(s-i.length)),o.shift(s);const l=n.enter("listItem"),u=n.indentLines(n.containerFlow(e,o.current()),d);return l(),u;function d(f,m,h){return m?(h?"":" ".repeat(s))+f:(h?i:i+" ".repeat(s-i.length))+f}}function j7(e,t,n,r){const a=n.enter("paragraph"),i=n.enter("phrasing"),s=n.containerPhrasing(e,r);return i(),a(),s}const T7=gp(["break","delete","emphasis","footnote","footnoteReference","image","imageReference","inlineCode","inlineMath","link","linkReference","mdxJsxTextElement","mdxTextExpression","strong","text","textDirective"]);function A7(e,t,n,r){return(e.children.some(function(s){return T7(s)})?n.containerPhrasing:n.containerFlow).call(n,e,r)}function R7(e){const t=e.options.strong||"*";if(t!=="*"&&t!=="_")throw new Error("Cannot serialize strong with `"+t+"` for `options.strong`, expected `*`, or `_`");return t}A$.peek=$7;function A$(e,t,n,r){const a=R7(n),i=n.enter("strong"),s=n.createTracker(r),o=s.move(a+a);let l=s.move(n.containerPhrasing(e,{after:a,before:o,...s.current()}));const u=l.charCodeAt(0),d=im(r.before.charCodeAt(r.before.length-1),u,a);d.inside&&(l=Yu(u)+l.slice(1));const f=l.charCodeAt(l.length-1),m=im(r.after.charCodeAt(0),f,a);m.inside&&(l=l.slice(0,-1)+Yu(f));const h=s.move(a+a);return i(),n.attentionEncodeSurroundingInfo={after:m.outside,before:d.outside},o+l+h}function $7(e,t,n){return n.options.strong||"*"}function O7(e,t,n,r){return n.safe(e.value,r)}function M7(e){const t=e.options.ruleRepetition||3;if(t<3)throw new Error("Cannot serialize rules with repetition `"+t+"` for `options.ruleRepetition`, expected `3` or more");return t}function P7(e,t,n){const r=(T$(n)+(n.options.ruleSpaces?" ":"")).repeat(M7(n));return n.options.ruleSpaces?r.slice(0,-1):r}const R$={blockquote:a7,break:qk,code:u7,definition:f7,emphasis:w$,hardBreak:qk,heading:g7,html:S$,image:_$,imageReference:k$,inlineCode:E$,link:N$,linkReference:j$,list:E7,listItem:N7,paragraph:j7,root:A7,strong:A$,text:O7,thematicBreak:P7};function D7(){return{enter:{table:z7,tableData:Hk,tableHeader:Hk,tableRow:L7},exit:{codeText:U7,table:I7,tableData:Yg,tableHeader:Yg,tableRow:Yg}}}function z7(e){const t=e._align;this.enter({type:"table",align:t.map(function(n){return n==="none"?null:n}),children:[]},e),this.data.inTable=!0}function I7(e){this.exit(e),this.data.inTable=void 0}function L7(e){this.enter({type:"tableRow",children:[]},e)}function Yg(e){this.exit(e)}function Hk(e){this.enter({type:"tableCell",children:[]},e)}function U7(e){let t=this.resume();this.data.inTable&&(t=t.replace(/\\([\\|])/g,F7));const n=this.stack[this.stack.length-1];n.type,n.value=t,this.exit(e)}function F7(e,t){return t==="|"?t:e}function q7(e){const t=e||{},n=t.tableCellPadding,r=t.tablePipeAlign,a=t.stringLength,i=n?" ":"|";return{unsafe:[{character:"\r",inConstruct:"tableCell"},{character:`
436
+ `,inConstruct:"tableCell"},{atBreak:!0,character:"|",after:"[ :-]"},{character:"|",inConstruct:"tableCell"},{atBreak:!0,character:":",after:"-"},{atBreak:!0,character:"-",after:"[:|-]"}],handlers:{inlineCode:m,table:s,tableCell:l,tableRow:o}};function s(h,y,p,b){return u(d(h,p,b),h.align)}function o(h,y,p,b){const g=f(h,p,b),v=u([g]);return v.slice(0,v.indexOf(`
437
+ `))}function l(h,y,p,b){const g=p.enter("tableCell"),v=p.enter("phrasing"),w=p.containerPhrasing(h,{...b,before:i,after:i});return v(),g(),w}function u(h,y){return n7(h,{align:y,alignDelimiters:r,padding:n,stringLength:a})}function d(h,y,p){const b=h.children;let g=-1;const v=[],w=y.enter("table");for(;++g<b.length;)v[g]=f(b[g],y,p);return w(),v}function f(h,y,p){const b=h.children;let g=-1;const v=[],w=y.enter("tableRow");for(;++g<b.length;)v[g]=l(b[g],h,y,p);return w(),v}function m(h,y,p){let b=R$.inlineCode(h,y,p);return p.stack.includes("tableCell")&&(b=b.replace(/\|/g,"\\$&")),b}}function H7(){return{exit:{taskListCheckValueChecked:Bk,taskListCheckValueUnchecked:Bk,paragraph:V7}}}function B7(){return{unsafe:[{atBreak:!0,character:"-",after:"[:|-]"}],handlers:{listItem:K7}}}function Bk(e){const t=this.stack[this.stack.length-2];t.type,t.checked=e.type==="taskListCheckValueChecked"}function V7(e){const t=this.stack[this.stack.length-2];if(t&&t.type==="listItem"&&typeof t.checked=="boolean"){const n=this.stack[this.stack.length-1];n.type;const r=n.children[0];if(r&&r.type==="text"){const a=t.children;let i=-1,s;for(;++i<a.length;){const o=a[i];if(o.type==="paragraph"){s=o;break}}s===n&&(r.value=r.value.slice(1),r.value.length===0?n.children.shift():n.position&&r.position&&typeof r.position.start.offset=="number"&&(r.position.start.column++,r.position.start.offset++,n.position.start=Object.assign({},r.position.start)))}}this.exit(e)}function K7(e,t,n,r){const a=e.children[0],i=typeof e.checked=="boolean"&&a&&a.type==="paragraph",s="["+(e.checked?"x":" ")+"] ",o=n.createTracker(r);i&&o.move(s);let l=R$.listItem(e,t,n,{...r,...o.current()});return i&&(l=l.replace(/^(?:[*+-]|\d+\.)([\r\n]| {1,3})/,u)),l;function u(d){return d+s}}function Z7(){return[EV(),KV(),YV(),D7(),H7()]}function G7(e){return{extensions:[CV(),ZV(e),XV(),q7(e),B7()]}}const Q7={tokenize:tK,partial:!0},$$={tokenize:nK,partial:!0},O$={tokenize:rK,partial:!0},M$={tokenize:aK,partial:!0},Y7={tokenize:iK,partial:!0},P$={name:"wwwAutolink",tokenize:J7,previous:z$},D$={name:"protocolAutolink",tokenize:eK,previous:I$},yi={name:"emailAutolink",tokenize:W7,previous:L$},Ca={};function X7(){return{text:Ca}}let Ns=48;for(;Ns<123;)Ca[Ns]=yi,Ns++,Ns===58?Ns=65:Ns===91&&(Ns=97);Ca[43]=yi;Ca[45]=yi;Ca[46]=yi;Ca[95]=yi;Ca[72]=[yi,D$];Ca[104]=[yi,D$];Ca[87]=[yi,P$];Ca[119]=[yi,P$];function W7(e,t,n){const r=this;let a,i;return s;function s(f){return!Yv(f)||!L$.call(r,r.previous)||Fx(r.events)?n(f):(e.enter("literalAutolink"),e.enter("literalAutolinkEmail"),o(f))}function o(f){return Yv(f)?(e.consume(f),o):f===64?(e.consume(f),l):n(f)}function l(f){return f===46?e.check(Y7,d,u)(f):f===45||f===95||Nn(f)?(i=!0,e.consume(f),l):d(f)}function u(f){return e.consume(f),a=!0,l}function d(f){return i&&a&&zn(r.previous)?(e.exit("literalAutolinkEmail"),e.exit("literalAutolink"),t(f)):n(f)}}function J7(e,t,n){const r=this;return a;function a(s){return s!==87&&s!==119||!z$.call(r,r.previous)||Fx(r.events)?n(s):(e.enter("literalAutolink"),e.enter("literalAutolinkWww"),e.check(Q7,e.attempt($$,e.attempt(O$,i),n),n)(s))}function i(s){return e.exit("literalAutolinkWww"),e.exit("literalAutolink"),t(s)}}function eK(e,t,n){const r=this;let a="",i=!1;return s;function s(f){return(f===72||f===104)&&I$.call(r,r.previous)&&!Fx(r.events)?(e.enter("literalAutolink"),e.enter("literalAutolinkHttp"),a+=String.fromCodePoint(f),e.consume(f),o):n(f)}function o(f){if(zn(f)&&a.length<5)return a+=String.fromCodePoint(f),e.consume(f),o;if(f===58){const m=a.toLowerCase();if(m==="http"||m==="https")return e.consume(f),l}return n(f)}function l(f){return f===47?(e.consume(f),i?u:(i=!0,l)):n(f)}function u(f){return f===null||nm(f)||ft(f)||go(f)||hp(f)?n(f):e.attempt($$,e.attempt(O$,d),n)(f)}function d(f){return e.exit("literalAutolinkHttp"),e.exit("literalAutolink"),t(f)}}function tK(e,t,n){let r=0;return a;function a(s){return(s===87||s===119)&&r<3?(r++,e.consume(s),a):s===46&&r===3?(e.consume(s),i):n(s)}function i(s){return s===null?n(s):t(s)}}function nK(e,t,n){let r,a,i;return s;function s(u){return u===46||u===95?e.check(M$,l,o)(u):u===null||ft(u)||go(u)||u!==45&&hp(u)?l(u):(i=!0,e.consume(u),s)}function o(u){return u===95?r=!0:(a=r,r=void 0),e.consume(u),s}function l(u){return a||r||!i?n(u):t(u)}}function rK(e,t){let n=0,r=0;return a;function a(s){return s===40?(n++,e.consume(s),a):s===41&&r<n?i(s):s===33||s===34||s===38||s===39||s===41||s===42||s===44||s===46||s===58||s===59||s===60||s===63||s===93||s===95||s===126?e.check(M$,t,i)(s):s===null||ft(s)||go(s)?t(s):(e.consume(s),a)}function i(s){return s===41&&r++,e.consume(s),a}}function aK(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),i):o===93?(e.consume(o),a):o===60||o===null||ft(o)||go(o)?t(o):n(o)}function a(o){return o===null||o===40||o===91||ft(o)||go(o)?t(o):r(o)}function i(o){return zn(o)?s(o):n(o)}function s(o){return o===59?(e.consume(o),r):zn(o)?(e.consume(o),s):n(o)}}function iK(e,t,n){return r;function r(i){return e.consume(i),a}function a(i){return Nn(i)?n(i):t(i)}}function z$(e){return e===null||e===40||e===42||e===95||e===91||e===93||e===126||ft(e)}function I$(e){return!zn(e)}function L$(e){return!(e===47||Yv(e))}function Yv(e){return e===43||e===45||e===46||e===95||Nn(e)}function Fx(e){let t=e.length,n=!1;for(;t--;){const 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}const sK={tokenize:mK,partial:!0};function oK(){return{document:{91:{name:"gfmFootnoteDefinition",tokenize:dK,continuation:{tokenize:fK},exit:hK}},text:{91:{name:"gfmFootnoteCall",tokenize:uK},93:{name:"gfmPotentialFootnoteCall",add:"after",tokenize:lK,resolveTo:cK}}}}function lK(e,t,n){const r=this;let a=r.events.length;const i=r.parser.gfmFootnotes||(r.parser.gfmFootnotes=[]);let s;for(;a--;){const l=r.events[a][1];if(l.type==="labelImage"){s=l;break}if(l.type==="gfmFootnoteCall"||l.type==="labelLink"||l.type==="label"||l.type==="image"||l.type==="link")break}return o;function o(l){if(!s||!s._balanced)return n(l);const u=ea(r.sliceSerialize({start:s.end,end:r.now()}));return u.codePointAt(0)!==94||!i.includes(u.slice(1))?n(l):(e.enter("gfmFootnoteCallLabelMarker"),e.consume(l),e.exit("gfmFootnoteCallLabelMarker"),t(l))}}function cK(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";const r={type:"gfmFootnoteCall",start:Object.assign({},e[n+3][1].start),end:Object.assign({},e[e.length-1][1].end)},a={type:"gfmFootnoteCallMarker",start:Object.assign({},e[n+3][1].end),end:Object.assign({},e[n+3][1].end)};a.end.column++,a.end.offset++,a.end._bufferIndex++;const i={type:"gfmFootnoteCallString",start:Object.assign({},a.end),end:Object.assign({},e[e.length-1][1].start)},s={type:"chunkString",contentType:"string",start:Object.assign({},i.start),end:Object.assign({},i.end)},o=[e[n+1],e[n+2],["enter",r,t],e[n+3],e[n+4],["enter",a,t],["exit",a,t],["enter",i,t],["enter",s,t],["exit",s,t],["exit",i,t],e[e.length-2],e[e.length-1],["exit",r,t]];return e.splice(n,e.length-n+1,...o),e}function uK(e,t,n){const r=this,a=r.parser.gfmFootnotes||(r.parser.gfmFootnotes=[]);let i=0,s;return o;function o(f){return e.enter("gfmFootnoteCall"),e.enter("gfmFootnoteCallLabelMarker"),e.consume(f),e.exit("gfmFootnoteCallLabelMarker"),l}function l(f){return f!==94?n(f):(e.enter("gfmFootnoteCallMarker"),e.consume(f),e.exit("gfmFootnoteCallMarker"),e.enter("gfmFootnoteCallString"),e.enter("chunkString").contentType="string",u)}function u(f){if(i>999||f===93&&!s||f===null||f===91||ft(f))return n(f);if(f===93){e.exit("chunkString");const m=e.exit("gfmFootnoteCallString");return a.includes(ea(r.sliceSerialize(m)))?(e.enter("gfmFootnoteCallLabelMarker"),e.consume(f),e.exit("gfmFootnoteCallLabelMarker"),e.exit("gfmFootnoteCall"),t):n(f)}return ft(f)||(s=!0),i++,e.consume(f),f===92?d:u}function d(f){return f===91||f===92||f===93?(e.consume(f),i++,u):u(f)}}function dK(e,t,n){const r=this,a=r.parser.gfmFootnotes||(r.parser.gfmFootnotes=[]);let i,s=0,o;return l;function l(y){return e.enter("gfmFootnoteDefinition")._container=!0,e.enter("gfmFootnoteDefinitionLabel"),e.enter("gfmFootnoteDefinitionLabelMarker"),e.consume(y),e.exit("gfmFootnoteDefinitionLabelMarker"),u}function u(y){return y===94?(e.enter("gfmFootnoteDefinitionMarker"),e.consume(y),e.exit("gfmFootnoteDefinitionMarker"),e.enter("gfmFootnoteDefinitionLabelString"),e.enter("chunkString").contentType="string",d):n(y)}function d(y){if(s>999||y===93&&!o||y===null||y===91||ft(y))return n(y);if(y===93){e.exit("chunkString");const p=e.exit("gfmFootnoteDefinitionLabelString");return i=ea(r.sliceSerialize(p)),e.enter("gfmFootnoteDefinitionLabelMarker"),e.consume(y),e.exit("gfmFootnoteDefinitionLabelMarker"),e.exit("gfmFootnoteDefinitionLabel"),m}return ft(y)||(o=!0),s++,e.consume(y),y===92?f:d}function f(y){return y===91||y===92||y===93?(e.consume(y),s++,d):d(y)}function m(y){return y===58?(e.enter("definitionMarker"),e.consume(y),e.exit("definitionMarker"),a.includes(i)||a.push(i),We(e,h,"gfmFootnoteDefinitionWhitespace")):n(y)}function h(y){return t(y)}}function fK(e,t,n){return e.check(Nd,t,e.attempt(sK,t,n))}function hK(e){e.exit("gfmFootnoteDefinition")}function mK(e,t,n){const r=this;return We(e,a,"gfmFootnoteDefinitionIndent",5);function a(i){const s=r.events[r.events.length-1];return s&&s[1].type==="gfmFootnoteDefinitionIndent"&&s[2].sliceSerialize(s[1],!0).length===4?t(i):n(i)}}function pK(e){let n=(e||{}).singleTilde;const r={name:"strikethrough",tokenize:i,resolveAll:a};return n==null&&(n=!0),{text:{126:r},insideSpan:{null:[r]},attentionMarkers:{null:[126]}};function a(s,o){let l=-1;for(;++l<s.length;)if(s[l][0]==="enter"&&s[l][1].type==="strikethroughSequenceTemporary"&&s[l][1]._close){let u=l;for(;u--;)if(s[u][0]==="exit"&&s[u][1].type==="strikethroughSequenceTemporary"&&s[u][1]._open&&s[l][1].end.offset-s[l][1].start.offset===s[u][1].end.offset-s[u][1].start.offset){s[l][1].type="strikethroughSequence",s[u][1].type="strikethroughSequence";const d={type:"strikethrough",start:Object.assign({},s[u][1].start),end:Object.assign({},s[l][1].end)},f={type:"strikethroughText",start:Object.assign({},s[u][1].end),end:Object.assign({},s[l][1].start)},m=[["enter",d,o],["enter",s[u][1],o],["exit",s[u][1],o],["enter",f,o]],h=o.parser.constructs.insideSpan.null;h&&yr(m,m.length,0,mp(h,s.slice(u+1,l),o)),yr(m,m.length,0,[["exit",f,o],["enter",s[l][1],o],["exit",s[l][1],o],["exit",d,o]]),yr(s,u-1,l-u+3,m),l=u+m.length-2;break}}for(l=-1;++l<s.length;)s[l][1].type==="strikethroughSequenceTemporary"&&(s[l][1].type="data");return s}function i(s,o,l){const u=this.previous,d=this.events;let f=0;return m;function m(y){return u===126&&d[d.length-1][1].type!=="characterEscape"?l(y):(s.enter("strikethroughSequenceTemporary"),h(y))}function h(y){const p=tc(u);if(y===126)return f>1?l(y):(s.consume(y),f++,h);if(f<2&&!n)return l(y);const b=s.exit("strikethroughSequenceTemporary"),g=tc(y);return b._open=!g||g===2&&!!p,b._close=!p||p===2&&!!g,o(y)}}}class gK{constructor(){this.map=[]}add(t,n,r){yK(this,t,n,r)}consume(t){if(this.map.sort(function(i,s){return i[0]-s[0]}),this.map.length===0)return;let n=this.map.length;const r=[];for(;n>0;)n-=1,r.push(t.slice(this.map[n][0]+this.map[n][1]),this.map[n][2]),t.length=this.map[n][0];r.push(t.slice()),t.length=0;let a=r.pop();for(;a;){for(const i of a)t.push(i);a=r.pop()}this.map.length=0}}function yK(e,t,n,r){let a=0;if(!(n===0&&r.length===0)){for(;a<e.map.length;){if(e.map[a][0]===t){e.map[a][1]+=n,e.map[a][2].push(...r);return}a+=1}e.map.push([t,n,r])}}function vK(e,t){let n=!1;const r=[];for(;t<e.length;){const a=e[t];if(n){if(a[0]==="enter")a[1].type==="tableContent"&&r.push(e[t+1][1].type==="tableDelimiterMarker"?"left":"none");else if(a[1].type==="tableContent"){if(e[t-1][1].type==="tableDelimiterMarker"){const i=r.length-1;r[i]=r[i]==="left"?"center":"right"}}else if(a[1].type==="tableDelimiterRow")break}else a[0]==="enter"&&a[1].type==="tableDelimiterRow"&&(n=!0);t+=1}return r}function bK(){return{flow:{null:{name:"table",tokenize:xK,resolveAll:wK}}}}function xK(e,t,n){const r=this;let a=0,i=0,s;return o;function o($){let j=r.events.length-1;for(;j>-1;){const D=r.events[j][1].type;if(D==="lineEnding"||D==="linePrefix")j--;else break}const O=j>-1?r.events[j][1].type:null,z=O==="tableHead"||O==="tableRow"?C:l;return z===C&&r.parser.lazy[r.now().line]?n($):z($)}function l($){return e.enter("tableHead"),e.enter("tableRow"),u($)}function u($){return $===124||(s=!0,i+=1),d($)}function d($){return $===null?n($):Ee($)?i>1?(i=0,r.interrupt=!0,e.exit("tableRow"),e.enter("lineEnding"),e.consume($),e.exit("lineEnding"),h):n($):Ke($)?We(e,d,"whitespace")($):(i+=1,s&&(s=!1,a+=1),$===124?(e.enter("tableCellDivider"),e.consume($),e.exit("tableCellDivider"),s=!0,d):(e.enter("data"),f($)))}function f($){return $===null||$===124||ft($)?(e.exit("data"),d($)):(e.consume($),$===92?m:f)}function m($){return $===92||$===124?(e.consume($),f):f($)}function h($){return r.interrupt=!1,r.parser.lazy[r.now().line]?n($):(e.enter("tableDelimiterRow"),s=!1,Ke($)?We(e,y,"linePrefix",r.parser.constructs.disable.null.includes("codeIndented")?void 0:4)($):y($))}function y($){return $===45||$===58?b($):$===124?(s=!0,e.enter("tableCellDivider"),e.consume($),e.exit("tableCellDivider"),p):E($)}function p($){return Ke($)?We(e,b,"whitespace")($):b($)}function b($){return $===58?(i+=1,s=!0,e.enter("tableDelimiterMarker"),e.consume($),e.exit("tableDelimiterMarker"),g):$===45?(i+=1,g($)):$===null||Ee($)?S($):E($)}function g($){return $===45?(e.enter("tableDelimiterFiller"),v($)):E($)}function v($){return $===45?(e.consume($),v):$===58?(s=!0,e.exit("tableDelimiterFiller"),e.enter("tableDelimiterMarker"),e.consume($),e.exit("tableDelimiterMarker"),w):(e.exit("tableDelimiterFiller"),w($))}function w($){return Ke($)?We(e,S,"whitespace")($):S($)}function S($){return $===124?y($):$===null||Ee($)?!s||a!==i?E($):(e.exit("tableDelimiterRow"),e.exit("tableHead"),t($)):E($)}function E($){return n($)}function C($){return e.enter("tableRow"),T($)}function T($){return $===124?(e.enter("tableCellDivider"),e.consume($),e.exit("tableCellDivider"),T):$===null||Ee($)?(e.exit("tableRow"),t($)):Ke($)?We(e,T,"whitespace")($):(e.enter("data"),P($))}function P($){return $===null||$===124||ft($)?(e.exit("data"),T($)):(e.consume($),$===92?R:P)}function R($){return $===92||$===124?(e.consume($),P):P($)}}function wK(e,t){let n=-1,r=!0,a=0,i=[0,0,0,0],s=[0,0,0,0],o=!1,l=0,u,d,f;const m=new gK;for(;++n<e.length;){const h=e[n],y=h[1];h[0]==="enter"?y.type==="tableHead"?(o=!1,l!==0&&(Vk(m,t,l,u,d),d=void 0,l=0),u={type:"table",start:Object.assign({},y.start),end:Object.assign({},y.end)},m.add(n,0,[["enter",u,t]])):y.type==="tableRow"||y.type==="tableDelimiterRow"?(r=!0,f=void 0,i=[0,0,0,0],s=[0,n+1,0,0],o&&(o=!1,d={type:"tableBody",start:Object.assign({},y.start),end:Object.assign({},y.end)},m.add(n,0,[["enter",d,t]])),a=y.type==="tableDelimiterRow"?2:d?3:1):a&&(y.type==="data"||y.type==="tableDelimiterMarker"||y.type==="tableDelimiterFiller")?(r=!1,s[2]===0&&(i[1]!==0&&(s[0]=s[1],f=xf(m,t,i,a,void 0,f),i=[0,0,0,0]),s[2]=n)):y.type==="tableCellDivider"&&(r?r=!1:(i[1]!==0&&(s[0]=s[1],f=xf(m,t,i,a,void 0,f)),i=s,s=[i[1],n,0,0])):y.type==="tableHead"?(o=!0,l=n):y.type==="tableRow"||y.type==="tableDelimiterRow"?(l=n,i[1]!==0?(s[0]=s[1],f=xf(m,t,i,a,n,f)):s[1]!==0&&(f=xf(m,t,s,a,n,f)),a=0):a&&(y.type==="data"||y.type==="tableDelimiterMarker"||y.type==="tableDelimiterFiller")&&(s[3]=n)}for(l!==0&&Vk(m,t,l,u,d),m.consume(t.events),n=-1;++n<t.events.length;){const h=t.events[n];h[0]==="enter"&&h[1].type==="table"&&(h[1]._align=vK(t.events,n))}return e}function xf(e,t,n,r,a,i){const s=r===1?"tableHeader":r===2?"tableDelimiter":"tableData",o="tableContent";n[0]!==0&&(i.end=Object.assign({},Ho(t.events,n[0])),e.add(n[0],0,[["exit",i,t]]));const l=Ho(t.events,n[1]);if(i={type:s,start:Object.assign({},l),end:Object.assign({},l)},e.add(n[1],0,[["enter",i,t]]),n[2]!==0){const u=Ho(t.events,n[2]),d=Ho(t.events,n[3]),f={type:o,start:Object.assign({},u),end:Object.assign({},d)};if(e.add(n[2],0,[["enter",f,t]]),r!==2){const m=t.events[n[2]],h=t.events[n[3]];if(m[1].end=Object.assign({},h[1].end),m[1].type="chunkText",m[1].contentType="text",n[3]>n[2]+1){const y=n[2]+1,p=n[3]-n[2]-1;e.add(y,p,[])}}e.add(n[3]+1,0,[["exit",f,t]])}return a!==void 0&&(i.end=Object.assign({},Ho(t.events,a)),e.add(a,0,[["exit",i,t]]),i=void 0),i}function Vk(e,t,n,r,a){const i=[],s=Ho(t.events,n);a&&(a.end=Object.assign({},s),i.push(["exit",a,t])),r.end=Object.assign({},s),i.push(["exit",r,t]),e.add(n+1,0,i)}function Ho(e,t){const n=e[t],r=n[0]==="enter"?"start":"end";return n[1][r]}const SK={name:"tasklistCheck",tokenize:kK};function _K(){return{text:{91:SK}}}function kK(e,t,n){const r=this;return a;function a(l){return r.previous!==null||!r._gfmTasklistFirstContentOfListItem?n(l):(e.enter("taskListCheck"),e.enter("taskListCheckMarker"),e.consume(l),e.exit("taskListCheckMarker"),i)}function i(l){return ft(l)?(e.enter("taskListCheckValueUnchecked"),e.consume(l),e.exit("taskListCheckValueUnchecked"),s):l===88||l===120?(e.enter("taskListCheckValueChecked"),e.consume(l),e.exit("taskListCheckValueChecked"),s):n(l)}function s(l){return l===93?(e.enter("taskListCheckMarker"),e.consume(l),e.exit("taskListCheckMarker"),e.exit("taskListCheck"),o):n(l)}function o(l){return Ee(l)?t(l):Ke(l)?e.check({tokenize:EK},t,n)(l):n(l)}}function EK(e,t,n){return We(e,r,"whitespace");function r(a){return a===null?n(a):t(a)}}function CK(e){return QR([X7(),oK(),pK(e),bK(),_K()])}const NK={};function jK(e){const t=this,n=e||NK,r=t.data(),a=r.micromarkExtensions||(r.micromarkExtensions=[]),i=r.fromMarkdownExtensions||(r.fromMarkdownExtensions=[]),s=r.toMarkdownExtensions||(r.toMarkdownExtensions=[]);a.push(CK(n)),i.push(Z7()),s.push(G7(n))}const sm=180;function TK(e){return e.replace(/\*\*([^*]+)\*\*/g,"$1").replace(/`([^`]+)`/g,"$1").replace(/^#+\s+/gm,"").replace(/\s+/g," ").trim()}function AK(e,t){var a;if(t!=null&&t.trim())return t.trim();const n=((a=e.split(/\n\n+/)[0])==null?void 0:a.replace(/\n/g," "))??e,r=TK(n);return r.length<=sm?r:`${r.slice(0,sm-1).trimEnd()}…`}function RK(e,t){return t!=null&&t.trim()&&e.length>sm?!0:e.length>sm||/\n/.test(e)}function $K({description:e,title:t,expanded:n,onToggle:r}){const a=AK(e,t),i=RK(e,t);return e?i?c.jsxs("div",{className:"space-y-1",children:[c.jsx("p",{className:"line-clamp-3 text-sm leading-relaxed",children:a}),c.jsxs("button",{type:"button",onClick:r,className:"inline-flex items-center gap-1 text-xs text-[#92E4DD] hover:text-white",children:[c.jsx(Xm,{className:`h-3.5 w-3.5 transition-transform ${n?"rotate-180":""}`}),n?"Hide full description":"Show full description"]})]}):c.jsx("span",{children:a}):c.jsx("span",{className:"text-gray-500",children:"—"})}function OK({description:e}){return c.jsx("div",{className:"max-h-64 overflow-auto rounded border border-white/10 bg-[#0F0F0C] p-3",children:c.jsx("div",{className:"prose prose-sm prose-invert max-w-none prose-headings:text-gray-100 prose-p:text-gray-300 prose-li:text-gray-300 prose-strong:text-gray-100 prose-code:text-[#92E4DD] prose-code:before:content-none prose-code:after:content-none",children:c.jsx(pV,{remarkPlugins:[jK],children:e})})})}function MK(){const[e,t]=x.useState(null);return{expandedDescription:e,toggleDescription:r=>{t(a=>a===r?null:r)}}}function Xg(e){return new Set(e.filter(t=>t.enabled===!1).map(t=>t.name))}function PK({serviceId:e,tools:t,isLoading:n}){const[r,a]=x.useState(""),[i,s]=x.useState(null),{expandedDescription:o,toggleDescription:l}=MK(),[u,d]=x.useState(()=>Xg(t)),f=cn(),{toast:m}=nn(),h=x.useMemo(()=>t.map(S=>`${S.name}:${S.enabled===!1?"0":"1"}`).sort().join("\0"),[t]);x.useEffect(()=>{d(Xg(t))},[e,h]);const y=St({mutationFn:async S=>{await ke("PUT",`/api/services/${e}/tool-settings`,{disabledTools:S})},onSuccess:()=>{f.invalidateQueries({queryKey:["/api/services",e,"tools"]}),f.invalidateQueries({queryKey:["/api/services"]})},onError:S=>{m({title:"Could not save tool settings",description:S.message,variant:"destructive"}),d(Xg(t))}}),p=S=>{d(S),y.mutate([...S])},b=(S,E)=>{const C=new Set(u);E?C.delete(S):C.add(S),p(C)},g=S=>{if(S){p(new Set);return}p(new Set(t.map(E=>E.name)))},v=x.useMemo(()=>{const S=r.trim().toLowerCase();return S?t.filter(E=>{var C;return E.name.toLowerCase().includes(S)||(((C=E.title)==null?void 0:C.toLowerCase().includes(S))??!1)||E.description.toLowerCase().includes(S)}):t},[t,r]),w=t.length-u.size;return n?c.jsx("div",{className:"bg-black/20 rounded-lg p-4 border border-white/10",children:c.jsx("p",{className:"text-sm text-gray-400",children:"Loading tools…"})}):t.length===0?null:c.jsxs("div",{className:"bg-black/20 rounded-lg p-4 border border-white/10",children:[c.jsxs("div",{className:"mb-4 flex flex-col gap-3 sm:flex-row sm:items-center sm:justify-between",children:[c.jsxs("h3",{className:"text-lg font-semibold flex items-center",children:[c.jsx(Qb,{className:"w-5 h-5 mr-2"}),"Tools",c.jsxs("span",{className:"ml-2 text-sm font-normal text-gray-400",children:[w," of ",t.length," enabled"]})]}),c.jsxs("div",{className:"flex flex-wrap items-center gap-2",children:[c.jsx(le,{type:"button",size:"sm",variant:"ghost",className:"h-8 text-xs text-[#A8C4C0] hover:text-white hover:bg-white/10",onClick:()=>g(!0),disabled:u.size===0||y.isPending,children:"Enable all"}),c.jsx(le,{type:"button",size:"sm",variant:"ghost",className:"h-8 text-xs text-[#A8C4C0] hover:text-white hover:bg-white/10",onClick:()=>g(!1),disabled:w===0||y.isPending,children:"Disable all"})]})]}),c.jsx("p",{className:"mb-3 text-xs text-[#A8C4C0]",children:"Choose which tools your agent can use from this MCP. Disabled tools are hidden from the agent but stay registered on the server."}),c.jsxs("div",{className:"relative mb-3",children:[c.jsx(yT,{className:"absolute left-3 top-1/2 h-4 w-4 -translate-y-1/2 text-gray-500"}),c.jsx(at,{value:r,onChange:S=>a(S.target.value),placeholder:"Search tools…",className:"border-white/15 bg-[#0F0F0C] pl-9 text-[#E8F6F4] placeholder:text-[#6B8581]"})]}),c.jsx("div",{className:"rounded-md border border-white/10 overflow-hidden",children:c.jsxs($R,{children:[c.jsx(OR,{children:c.jsxs(qo,{className:"border-white/10 hover:bg-transparent",children:[c.jsx(th,{className:"w-[72px] text-center text-[#A8C4C0]",children:"Enabled"}),c.jsx(th,{className:"w-[220px] text-[#A8C4C0]",children:"Tool"}),c.jsx(th,{className:"text-[#A8C4C0]",children:"Description"})]})}),c.jsx(MR,{children:v.length===0?c.jsx(qo,{className:"border-white/10 hover:bg-transparent",children:c.jsx(Ps,{colSpan:3,className:"py-8 text-center text-sm text-gray-400",children:"No tools match your search."})}):v.map(S=>{const E=!u.has(S.name),C=i===S.name,T=o===S.name,P=S.inputSchema&&Object.keys(S.inputSchema).length>0;return c.jsxs(x.Fragment,{children:[c.jsxs(qo,{className:`border-white/10 ${E?"hover:bg-white/5":"opacity-60 hover:bg-white/5"}`,children:[c.jsx(Ps,{className:"text-center",children:c.jsx("div",{className:"flex justify-center",children:c.jsx(tm,{checked:E,onCheckedChange:R=>b(S.name,R===!0),disabled:y.isPending,"aria-label":`${E?"Disable":"Enable"} ${S.name}`,className:"h-[18px] w-[18px] border-white/40 bg-[#0F0F0C] data-[state=checked]:border-[#92E4DD] data-[state=checked]:bg-[#92E4DD] data-[state=checked]:text-[#0F0F0C]"})})}),c.jsx(Ps,{children:P?c.jsxs("button",{type:"button",onClick:()=>s(C?null:S.name),className:"flex w-full items-center gap-1 text-left font-mono text-sm text-[#92E4DD] hover:text-white",children:[c.jsx(Xm,{className:`h-4 w-4 shrink-0 transition-transform ${C?"rotate-180":""}`}),S.name]}):c.jsx("span",{className:"font-mono text-sm text-[#92E4DD]",children:S.name})}),c.jsx(Ps,{className:"max-w-0 text-sm text-gray-300",children:c.jsx($K,{description:S.description,title:S.title,expanded:T,onToggle:()=>l(S.name)})})]}),T&&c.jsx(qo,{className:"border-white/10 bg-black/30 hover:bg-black/30",children:c.jsx(Ps,{colSpan:3,className:"py-3",children:c.jsx(OK,{description:S.description})})}),P&&C&&c.jsx(qo,{className:"border-white/10 bg-black/30 hover:bg-black/30",children:c.jsx(Ps,{colSpan:3,className:"py-3",children:c.jsx("pre",{className:"max-h-48 overflow-auto rounded border border-white/10 bg-[#0F0F0C] p-3 text-xs text-gray-300",children:JSON.stringify(S.inputSchema,null,2)})})})]},S.name)})})]})})]})}function Wg({items:e,className:t}){return e.length===0?null:c.jsx("ol",{className:`list-decimal list-inside space-y-1 text-xs ${t??""}`,children:e.map((n,r)=>c.jsx("li",{children:n},`${r}-${n.slice(0,24)}`))})}function Kk({serviceId:e,onConnected:t}){const{toast:n}=nn(),[r,a]=x.useState(""),[i,s]=x.useState(""),[o,l]=x.useState(!1),[u,d]=x.useState(!1),[f,m]=x.useState(!1),{data:h,isLoading:y}=wt({queryKey:["/api/oauth",e,"setup"],queryFn:async()=>{const E=await ke("GET",`/api/oauth/${e}/setup`),C=await E.json();if(!E.ok||!C.success)throw new Error(C.error||"Failed to load OAuth setup");return C.data},enabled:!!e}),p=h==null?void 0:h.guide,b=!!(h!=null&&h.hasSavedCredentials),g=()=>{if(!u||(p==null?void 0:p.setupMode)!=="manual")return;const E={};return r.trim()&&(E.clientId=r.trim()),i.trim()&&(E.clientSecret=i.trim()),E},v=async(E,C)=>{try{await navigator.clipboard.writeText(C),n({title:"Copied",description:`${E} copied to clipboard.`})}catch{n({title:"Copy failed",description:"Select and copy manually.",variant:"destructive"})}};x.useEffect(()=>{(p==null?void 0:p.setupMode)==="manual"?d(!0):d(!1),m(!b)},[p==null?void 0:p.setupMode,b]),x.useEffect(()=>{h!=null&&h.savedOAuthClientId&&!r&&a(h.savedOAuthClientId)},[h==null?void 0:h.savedOAuthClientId,r]);const w=async E=>{var C,T,P;l(!0);try{const R=await ke("POST",`/api/oauth/${e}/connect`,E??{}),$=await R.json();if(!R.ok||!$.success){((C=$.data)!=null&&C.needsCredentials||((T=$.data)==null?void 0:T.setupMode)==="manual")&&d(!0),n({title:"OAuth setup",description:$.error||"Could not start OAuth flow.",variant:"destructive"});return}(P=$.data)!=null&&P.authorizationUrl&&(window.open($.data.authorizationUrl,"_blank"),n({title:"Continue in browser",description:"Complete sign-in in the new tab, then return here."}),t==null||t())}catch(R){n({title:"OAuth setup failed",description:R instanceof Error?R.message:"Unknown error",variant:"destructive"})}finally{l(!1)}};if(y)return c.jsx("p",{className:"text-sm text-orange-200",children:"Loading setup guide…"});if(!p)return null;if(p.setupMode==="unavailable")return c.jsxs("div",{className:"space-y-3 text-sm text-orange-100",children:[c.jsx("p",{children:p.unavailableReason}),p.docsUrl&&c.jsxs(le,{size:"sm",variant:"outline",className:"border-orange-500/30 text-orange-200",onClick:()=>window.open(p.docsUrl,"_blank"),children:[c.jsx(Xa,{className:"w-4 h-4 mr-1"}),"Provider docs"]})]});const S=p.setupMode==="dynamic"||p.setupMode==="managed"||p.setupMode==="manual";return c.jsxs("div",{className:"space-y-4 text-sm text-orange-100",children:[c.jsxs("div",{children:[c.jsx("p",{className:"font-medium text-orange-200",children:p.title}),p.summary&&c.jsx("p",{className:"mt-1 text-xs text-orange-100/90",children:p.summary}),S&&c.jsxs("p",{className:"mt-2 text-xs text-orange-100/80",children:["Redirect URI:"," ",c.jsx("code",{className:"text-orange-50",children:p.redirectUri})]}),p.easierAlternative&&c.jsx("p",{className:"mt-2 text-xs text-orange-100/70 border-l-2 border-orange-500/30 pl-2",children:p.easierAlternative})]}),b&&p.setupMode==="manual"&&c.jsxs("div",{className:"rounded-lg border border-green-500/30 bg-green-500/10 p-3 text-xs text-green-100",children:[c.jsx("p",{className:"font-medium text-green-200",children:"OAuth credentials saved"}),c.jsx("p",{className:"mt-1 text-green-100/90",children:"Client ID is prefilled and your secret is remembered. Click Reconnect — no need to paste the secret again unless Slack rejects the flow."})]}),p.prerequisites&&p.prerequisites.length>0&&!b&&c.jsxs("div",{children:[c.jsx("p",{className:"text-xs font-medium text-orange-200 mb-1",children:"Before you start"}),c.jsx("ul",{className:"list-disc list-inside space-y-1 text-xs text-orange-100/90",children:p.prerequisites.map(E=>c.jsx("li",{children:E},E))})]}),(p.manifestJson||p.createAppUrl||S)&&c.jsxs("div",{className:"flex flex-wrap gap-2",children:[p.manifestJson&&c.jsxs(le,{size:"sm",variant:"outline",className:"border-orange-500/30 text-orange-200",onClick:()=>void v("App manifest",p.manifestJson),children:[c.jsx(VI,{className:"w-4 h-4 mr-1"}),"Copy manifest"]}),S&&c.jsxs(le,{size:"sm",variant:"outline",className:"border-orange-500/30 text-orange-200",onClick:()=>void v("Redirect URI",p.redirectUri),children:[c.jsx(Gb,{className:"w-4 h-4 mr-1"}),"Copy redirect URI"]}),p.createAppUrl&&c.jsxs(le,{size:"sm",variant:"outline",className:"border-orange-500/30 text-orange-200",onClick:()=>window.open(p.createAppUrl,"_blank"),children:[c.jsx(Xa,{className:"w-4 h-4 mr-1"}),p.createAppLabel??"Open app creator"]})]}),p.steps.length>0&&c.jsx("div",{children:b&&p.setupMode==="manual"?c.jsxs("details",{className:"rounded-lg border border-orange-500/20 bg-orange-500/5 p-3",children:[c.jsx("summary",{className:"cursor-pointer text-xs font-medium text-orange-200",children:"First-time Slack app setup"}),c.jsx("div",{className:"mt-2",children:c.jsx(Wg,{items:p.steps})})]}):c.jsxs(c.Fragment,{children:[p.setupMode==="informational"?c.jsx("p",{className:"text-xs font-medium text-orange-200 mb-1",children:"What to do"}):null,c.jsx(Wg,{items:p.steps})]})}),p.tokenAlternative&&c.jsxs("p",{className:"text-xs text-orange-100/80 border-l-2 border-orange-500/30 pl-2",children:[c.jsx("span",{className:"font-medium text-orange-200",children:"Alternative: "}),p.tokenAlternative]}),u&&p.setupMode==="manual"&&c.jsxs("div",{className:"space-y-3 rounded-lg border border-orange-500/20 bg-orange-500/5 p-3",children:[c.jsxs("div",{className:"space-y-1",children:[c.jsx(Qe,{htmlFor:`oauth-client-id-${e}`,className:"text-orange-200",children:"Client ID"}),c.jsx(at,{id:`oauth-client-id-${e}`,value:r,onChange:E=>a(E.target.value),placeholder:"OAuth Client ID",className:"bg-black/20 border-orange-500/30"})]}),f?c.jsxs("div",{className:"space-y-1",children:[c.jsx(Qe,{htmlFor:`oauth-client-secret-${e}`,className:"text-orange-200",children:"Client Secret"}),c.jsx(at,{id:`oauth-client-secret-${e}`,type:"password",value:i,onChange:E=>s(E.target.value),placeholder:"OAuth Client Secret",className:"bg-black/20 border-orange-500/30"})]}):c.jsx("p",{className:"text-xs text-orange-200/80",children:"Client secret is saved locally for this service."}),b&&c.jsx(le,{type:"button",size:"sm",variant:"outline",className:"border-orange-500/30 text-orange-200",onClick:()=>m(E=>!E),children:f?"Hide client secret field":"Update client secret"}),(h==null?void 0:h.hasStoredClientSecret)&&f&&c.jsx("p",{className:"text-xs text-orange-200/80",children:"Leave blank to keep the saved secret. Enter a new value only if Slack rejected the last connect attempt."})]}),p.afterConnect&&p.afterConnect.length>0&&c.jsxs("div",{children:[c.jsx("p",{className:"text-xs font-medium text-orange-200 mb-1",children:"After connect"}),c.jsx(Wg,{items:p.afterConnect,className:"text-orange-100/80"})]}),S&&c.jsxs("div",{className:"flex flex-wrap gap-2",children:[c.jsx(le,{size:"sm",className:"bg-orange-600 hover:bg-orange-700",disabled:o||u&&p.setupMode==="manual"&&!b&&(!r.trim()||!i.trim()),onClick:()=>w(g()),children:o?"Connecting…":b&&p.setupMode==="manual"?"Reconnect":p.setupMode==="dynamic"||p.setupMode==="managed"?"Connect":"Connect with credentials"}),p.docsUrl&&c.jsxs(le,{size:"sm",variant:"outline",className:"border-orange-500/30 text-orange-200",onClick:()=>window.open(p.docsUrl,"_blank"),children:[c.jsx(Xa,{className:"w-4 h-4 mr-1"}),"Docs"]})]}),p.setupMode==="informational"&&p.docsUrl&&c.jsxs(le,{size:"sm",variant:"outline",className:"border-orange-500/30 text-orange-200",onClick:()=>window.open(p.docsUrl,"_blank"),children:[c.jsx(Xa,{className:"w-4 h-4 mr-1"}),"Docs"]})]})}function Su(e,t){e.invalidateQueries({queryKey:["/api/services"]}),e.invalidateQueries({queryKey:["/api/collection/warnings"]}),t&&(e.invalidateQueries({queryKey:["/api/services",t]}),e.invalidateQueries({queryKey:["/api/services",t,"tools"]}))}const U$="agent-deck:oauth-complete";function DK(e){return typeof e=="object"&&e!==null&&e.type===U$}function Is(e){return!!(e&&typeof e=="object"&&Object.keys(e).length>0)}function Zk(e){return Is(e)?JSON.stringify(e,null,2):`{
438
+
439
+ }`}function zK(e){const t=e.trim();if(!t||t==="{}")return{ok:!0,headers:{}};try{const n=JSON.parse(t);if(typeof n!="object"||n===null||Array.isArray(n))return{ok:!1,error:'Headers must be a JSON object (e.g. {"Authorization": "Bearer token"})'};for(const[r,a]of Object.entries(n))if(typeof a!="string")return{ok:!1,error:`Header "${r}" must be a string value`};return{ok:!0,headers:n}}catch{return{ok:!1,error:"Invalid JSON — fix syntax before saving"}}}function IK(e){return/^bearer\s+/i.test(e)?"Bearer ••••":e.length>0?"••••":""}function wf(e){return Is(e)?Object.entries(e).map(([t,n])=>({name:t,masked:IK(n)})):[]}function Sf(e){return e==="not_required"||e==="authenticated"||e==="authenticated_refreshable"}function LK(e){if(!e)return"unknown";const t=new Date(e).getTime()-Date.now();if(t<=0)return"soon";const n=Math.round(t/6e4);if(n<60)return`in ${n} minute${n===1?"":"s"}`;const r=Math.round(n/60);if(r<48)return`in ${r} hour${r===1?"":"s"}`;const a=Math.round(r/24);return`in ${a} day${a===1?"":"s"}`}function UK(e){if(!e||e.type!=="local-mcp")return!1;const t=[e.localCommand,...e.localArgs??[],e.url,e.name].filter(Boolean).join(" ").toLowerCase();return t.includes("google-drive")||t.includes("google_drive")}function FK({service:e,isOpen:t,onClose:n}){var je,Xe,dn,Sr,Un,ia,sa,Qt,_r,An,ja,Mp,fe,rn,_s,ks,m1,p1,g1,y1,v1,b1;const[r,a]=x.useState(null),[i,s]=x.useState(!1),[o,l]=x.useState(!1),[u,d]=x.useState(""),[f,m]=x.useState(""),[h,y]=x.useState(!1),[p,b]=x.useState(!1),[g,v]=x.useState(!1),[w,S]=x.useState(`{
440
+
441
+ }`),[E,C]=x.useState(null),[T,P]=x.useState(!1),[R,$]=x.useState(null),j=x.useRef(null),O=cn(),{toast:z}=nn(),D=e&&(R==null?void 0:R.id)===e.id?R:e,A=D,B=A!=null&&A.headers&&typeof A.headers=="object"?A.headers:null,Z=!!(A&&A.id&&A.url),{data:F,isLoading:J,error:N,refetch:q}=wt({queryKey:["/api/mcp/discover",A==null?void 0:A.url],queryFn:async()=>{if(!A||A.type!=="mcp")return null;console.log(`🔍 Attempting MCP discovery for: ${A.url}`);try{const ve=await(await ke("POST","/api/mcp/discover",{url:A.url})).json();return console.log(`✅ MCP discovery successful for ${A.url}:`,ve),ve}catch(ue){throw console.log(`❌ MCP discovery failed for ${A.url}:`,ue),ue}},enabled:Z&&A.type==="mcp"&&t,staleTime:0,gcTime:2*60*1e3}),G=((Xe=(je=F==null?void 0:F.data)==null?void 0:je.oauth)==null?void 0:Xe.required)===!0,{data:_,refetch:k}=wt({queryKey:["/api/oauth",A==null?void 0:A.id,"status"],queryFn:async()=>{const ue=await ke("GET",`/api/oauth/${A.id}/status`),ve=await ue.json();if(!ue.ok||!ve.success)throw new Error(ve.error||"Failed to load OAuth status");return ve.data},enabled:Z&&A.type==="mcp"&&t&&G,refetchInterval:ue=>{const ve=ue.state.data;return ve!=null&&ve.authenticated||ve!=null&&ve.refreshFailed?!1:2e3}}),I=G?_!=null&&_.refreshFailed?{status:"refresh_failed",message:"OAuth renewal failed — please re-authenticate"}:_!=null&&_.authenticated?_.hasRefreshToken&&_.expiresAt?{status:"authenticated_refreshable",message:`Access expires ${LK(_.expiresAt)} · renews automatically`}:{status:"authenticated",message:null}:_!=null&&_.hasToken&&(_!=null&&_.isExpired)?{status:"expired",message:"OAuth Token Expired - Please re-authenticate"}:{status:"required",message:"OAuth 2.0 Authentication Required"}:{status:"not_required",message:null};console.log("MCP Discovery Query Debug:",{apiService:A==null?void 0:A.id,apiServiceType:A==null?void 0:A.type,apiServiceUrl:A==null?void 0:A.url,isOpen:t,hasValidService:Z,enabled:Z&&A.type==="mcp"&&t,mcpDiscoveryLoading:J,mcpDiscoveryData:F?JSON.stringify(F,null,2):null,mcpDiscoveryDataKeys:F?Object.keys(F):null,oauthRequired:(Sr=(dn=F==null?void 0:F.data)==null?void 0:dn.oauth)==null?void 0:Sr.required,oauthData:(Un=F==null?void 0:F.data)!=null&&Un.oauth?JSON.stringify(F.data.oauth,null,2):null,toolsQueryEnabled:Z&&A.type==="mcp"&&t&&!((sa=(ia=F==null?void 0:F.data)==null?void 0:ia.oauth)!=null&&sa.required)});const{data:Q,isLoading:W,error:oe,refetch:de}=wt({queryKey:["/api/services",A==null?void 0:A.id,"tools"],queryFn:async()=>{if(!A||A.type!=="mcp"&&A.type!=="local-mcp")return{data:[]};console.log(`🔍 Attempting to discover tools for MCP service: ${A.id} at ${A.url}`);try{const ve=await(await ke("GET",`/api/services/${A.id}/tools`)).json();return console.log(`✅ MCP tools discovery successful for ${A.id}:`,ve),ve}catch(ue){throw console.log(`❌ MCP tools discovery failed for ${A.id}:`,ue),ue}},enabled:Z&&(A.type==="mcp"||A.type==="local-mcp")&&t&&(A.type==="local-mcp"||Sf(I.status)),staleTime:0,gcTime:2*60*1e3});x.useEffect(()=>{if(!t||!(A!=null&&A.id)||A.type!=="mcp"&&A.type!=="local-mcp"||!(A.type==="local-mcp"||Sf(I.status)||I.status==="not_required")||W||oe)return;let ve=!1;return(async()=>{try{const Rn=await(await ke("GET",`/api/services/${A.id}`)).json();!ve&&(Rn!=null&&Rn.success)&&Rn.data&&$(Rn.data),O.invalidateQueries({queryKey:["/api/services"]})}catch{}})(),()=>{ve=!0}},[t,A==null?void 0:A.id,A==null?void 0:A.type,W,oe,I.status,O]),x.useEffect(()=>{if(!t||!(A!=null&&A.id)||A.type!=="a2a")return;let ue=!1;return(async()=>{try{await ke("GET",`/api/services/${A.id}/health`);const En=await(await ke("GET",`/api/services/${A.id}`)).json();!ue&&(En!=null&&En.success)&&En.data&&$(En.data),O.invalidateQueries({queryKey:["/api/services"]})}catch{}})(),()=>{ue=!0}},[t,A==null?void 0:A.id,A==null?void 0:A.type,O]),console.log("MCP Tools Query Debug:",{hasValidService:Z,apiServiceType:A==null?void 0:A.type,isOpen:t,oauthRequired:(_r=(Qt=F==null?void 0:F.data)==null?void 0:Qt.oauth)==null?void 0:_r.required,oauthStatus:I.status,toolsQueryEnabled:Z&&(A.type==="mcp"||A.type==="local-mcp")&&t&&(A.type==="local-mcp"||Sf(I.status)),mcpToolsLoading:W});const{data:L,isLoading:V,error:X}=wt({queryKey:["/api/proxy/a2a",A==null?void 0:A.id,"manifest"],queryFn:async()=>{if(!A||A.type!=="a2a")return null;const ve=await(await ke("GET",`/api/proxy/a2a/${A.id}/manifest`)).text();return JSON.parse(ve)},enabled:Z&&A.type==="a2a"&&t,staleTime:0,gcTime:2*60*1e3}),ne=(Q==null?void 0:Q.data)||[],K=L,re=W||V;console.log("ServiceDetailsModal Debug:",{service:e==null?void 0:e.id,serviceType:e==null?void 0:e.type,isOpen:t,mcpDiscoveryLoading:J,mcpDiscoveryData:F,mcpDiscoveryError:N?String(N):null,mcpToolsLoading:W,a2aManifestLoading:V,mcpToolsError:oe?String(oe):null,a2aManifestError:X?String(X):null,mcpToolsCount:ne.length,mcpToolsData:Q,hasA2aManifest:!!K,isLoading:re,oauthRequired:(ja=(An=F==null?void 0:F.data)==null?void 0:An.oauth)==null?void 0:ja.required,oauthStatus:I.status,oauthMessage:I.message,oauthAuthenticated:_==null?void 0:_.authenticated,expiresAt:_==null?void 0:_.expiresAt}),x.useEffect(()=>{if(!t){$(null),v(!1),C(null),Ae.current=!1,ae.current=!1;return}e&&($(e),d(e.name||""),m(e.description||""),v(!1),C(null))},[e,t]);const ae=x.useRef(!1),Ae=x.useRef(!1);x.useEffect(()=>{if(!t||!(A!=null&&A.id)){ae.current=!1;return}if(!(_!=null&&_.authenticated)){ae.current=!1;return}if(ae.current)return;ae.current=!0,Ae.current=!0,(async()=>{z({title:"OAuth completed",description:"Authentication successful! Refreshing service status..."}),Su(O,A.id),O.invalidateQueries({queryKey:["/api/mcp/discover",A.url]});try{const ve=await ke("GET",`/api/services/${A.id}`);if(ve.ok){const yt=await ve.json();$(yt.data??yt)}}catch{}await q(),O.invalidateQueries({queryKey:["/api/services",A.id,"tools"]}),await de(),Ae.current=!1})()},[_==null?void 0:_.authenticated,t,A==null?void 0:A.id]);const ce=()=>(e==null?void 0:e.type)==="mcp"?c.jsx(y_,{className:"w-6 h-6"}):c.jsx(_g,{className:"w-6 h-6"}),we=()=>(e==null?void 0:e.type)==="mcp"?"text-blue-400":"text-purple-400",Ce=()=>(e==null?void 0:e.type)==="mcp"?"bg-blue-500/20":"bg-purple-500/20",ht=ue=>new Date(ue).toLocaleDateString("en-US",{year:"numeric",month:"short",day:"numeric",hour:"2-digit",minute:"2-digit"});x.useEffect(()=>{var ue,ve;i&&((ue=j.current)==null||ue.focus(),(ve=j.current)==null||ve.select())},[i]);const Ut=async()=>{const ue=(D==null?void 0:D.name)||"",ve=u.trim();if(!D||!ve||ve===ue){d(ue),s(!1);return}y(!0);try{await ke("PUT",`/api/services/${D.id}`,{name:ve}),$({...D,name:ve}),O.invalidateQueries({queryKey:["/api/services"]}),O.invalidateQueries({queryKey:["/api/collection/warnings"]}),O.invalidateQueries({queryKey:["/api/decks"]}),s(!1)}catch(yt){d(ue),s(!1),z({title:"Could not rename service",description:yt instanceof Error?yt.message:"Failed to update name",variant:"destructive"})}finally{y(!1)}},gt=async()=>{if(e){b(!0);try{if((await ke("PUT",`/api/services/${e.id}`,{description:f.trim()})).ok){if(R){const ve={...R,description:f.trim()};$(ve)}O.invalidateQueries({queryKey:["/api/services"]}),O.invalidateQueries({queryKey:["/api/collection/warnings"]}),O.invalidateQueries({queryKey:["/api/decks"]}),O.invalidateQueries({queryKey:["/api/decks"]}),z({title:"Description updated",description:"Service description has been updated successfully."}),l(!1)}else throw new Error("Failed to update description")}catch{z({title:"Update failed",description:"Failed to update service description. Please try again.",variant:"destructive"})}finally{b(!1)}}},ar=()=>{S(Zk(B)),C(null),v(!0)},Y=()=>{v(!1),C(null),S(Zk(B))},se=async()=>{if(!D)return;const ue=zK(w);if(!ue.ok){C(ue.error);return}P(!0);try{if(!(await ke("PUT",`/api/services/${D.id}`,{headers:ue.headers})).ok)throw new Error("Failed to update headers");const yt=Object.keys(ue.headers).length>0?ue.headers:void 0;$({...D,headers:yt}),v(!1),C(null),Su(O,D.id),O.invalidateQueries({queryKey:["/api/decks"]}),z({title:"Headers updated",description:"Custom headers saved. Reconnecting with the new values."})}catch(ve){z({title:"Update failed",description:ve instanceof Error?ve.message:"Failed to update headers. Please try again.",variant:"destructive"})}finally{P(!1)}},Se=ue=>{ue||(Ae.current&&(Su(O,(A==null?void 0:A.id)??(e==null?void 0:e.id)),Ae.current=!1),ae.current=!1,n())};return c.jsx(bs,{open:t,onOpenChange:Se,children:c.jsxs(mi,{className:"sm:max-w-6xl bg-gradient-to-br from-cosmic-900 to-cosmic-800 border border-white/20 text-white max-h-[90vh] overflow-y-auto",children:[c.jsx(pi,{children:c.jsxs(gi,{className:"text-2xl font-bold flex items-center",children:[ce(),c.jsx("div",{className:"ml-3 flex min-w-0 items-center",children:i?c.jsx("input",{ref:j,type:"text",value:u,disabled:h,onChange:ue=>d(ue.target.value),onBlur:()=>{Ut()},onKeyDown:ue=>{ue.key==="Enter"?(ue.preventDefault(),Ut()):ue.key==="Escape"&&(ue.preventDefault(),d((D==null?void 0:D.name)||""),s(!1))},className:"max-w-[16rem] rounded border border-white/20 bg-white/10 px-2 py-1 text-2xl font-bold text-white focus:border-white/40 focus:outline-none sm:max-w-[20rem]","aria-label":"Service name","data-testid":"input-service-name"}):c.jsx("button",{type:"button",className:"min-w-0 truncate text-left hover:underline",title:"Click to rename",onClick:()=>{d((D==null?void 0:D.name)||""),s(!0)},"data-testid":"button-rename-service",children:D==null?void 0:D.name})}),c.jsx(mn,{className:`ml-3 ${Ce()} ${we()}`,children:(Mp=e==null?void 0:e.type)==null?void 0:Mp.toUpperCase()})]})}),e&&c.jsxs("div",{className:"space-y-6",children:[c.jsxs("div",{className:"bg-black/20 rounded-lg p-4 border border-white/10",children:[c.jsx("div",{className:"mb-3",children:c.jsxs("h3",{className:"text-lg font-semibold flex items-center",children:[c.jsx(qI,{className:"w-5 h-5 mr-2"}),"Service Overview"]})}),c.jsxs("div",{className:"grid grid-cols-1 md:grid-cols-2 gap-4",children:[c.jsxs("div",{children:[c.jsxs("div",{className:"flex items-center justify-between mb-1",children:[c.jsx("p",{className:"text-gray-300 text-sm",children:"Description"}),!o&&c.jsx(le,{size:"sm",variant:"ghost",onClick:()=>l(!0),className:"h-6 w-6 p-0 opacity-0 hover:opacity-100 transition-opacity",title:"Edit description",children:c.jsx(Qb,{className:"w-3 h-3"})})]}),o?c.jsxs("div",{className:"space-y-2",children:[c.jsx("textarea",{value:f,onChange:ue=>m(ue.target.value),className:"w-full bg-black/30 border border-white/20 rounded px-2 py-1 text-white focus:outline-none focus:border-white/40 resize-none",rows:3,placeholder:"Enter description...",autoFocus:!0}),c.jsxs("div",{className:"flex gap-2",children:[c.jsx(le,{size:"sm",onClick:gt,disabled:p,className:"h-6 px-2 text-xs",children:p?"Saving...":"Save"}),c.jsx(le,{size:"sm",variant:"outline",onClick:()=>{l(!1),m((D==null?void 0:D.description)||"")},className:"h-6 px-2 text-xs",children:"Cancel"})]})]}):c.jsx("p",{className:"text-white cursor-pointer hover:bg-white/10 px-2 py-1 rounded transition-colors",onClick:()=>l(!0),title:"Click to edit description",children:(D==null?void 0:D.description)||"No description"})]}),c.jsxs("div",{children:[c.jsx("p",{className:"text-gray-300 text-sm mb-1",children:"Endpoint"}),c.jsxs("div",{className:"space-y-2",children:[c.jsxs("div",{className:"flex items-center justify-between",children:[c.jsxs("div",{className:"flex items-center space-x-2",children:[c.jsx(mn,{variant:"outline",className:"border-blue-500/30 text-blue-300",children:A.type.toUpperCase()}),Is(B)&&c.jsx(mn,{variant:"outline",className:"border-green-500/30 text-green-300",children:"Custom Headers"})]}),c.jsx(le,{size:"sm",variant:"ghost",onClick:()=>window.open(A.url,"_blank"),className:"p-1 h-auto",children:c.jsx(Xa,{className:"w-4 h-4"})})]}),c.jsx("div",{className:"text-xs text-gray-400 break-all bg-black/20 p-2 rounded border border-white/10",children:A.url||"No URL available"}),A.type==="mcp"?c.jsxs("div",{className:"text-xs text-gray-400 bg-black/20 p-2 rounded border border-white/10","data-testid":"custom-headers-section",children:[c.jsxs("div",{className:"flex items-center justify-between gap-2 mb-1",children:[c.jsx("p",{className:"font-semibold text-gray-300",children:"Custom Headers"}),!g&&c.jsx(le,{size:"sm",variant:"ghost",className:"h-6 px-2 text-xs text-teal-300 hover:text-teal-200",onClick:ar,"data-testid":"button-edit-headers",children:"Edit"})]}),g?c.jsxs("div",{className:"space-y-2",children:[c.jsx(Za,{value:w,onChange:ue=>{S(ue.target.value),E&&C(null)},rows:6,className:"bg-white/10 border-white/20 text-white placeholder-gray-400 resize-none font-mono text-xs","data-testid":"textarea-edit-headers",disabled:T}),E&&c.jsxs("p",{className:"text-red-400 text-xs flex items-center gap-1","data-testid":"headers-json-error",children:[c.jsx(Rr,{className:"w-3 h-3 shrink-0"}),E]}),c.jsxs("div",{className:"flex justify-end gap-2",children:[c.jsx(le,{size:"sm",variant:"ghost",className:"h-7 px-2 text-xs",onClick:Y,disabled:T,"data-testid":"button-cancel-headers",children:"Cancel"}),c.jsx(le,{size:"sm",className:"h-7 px-3 text-xs bg-teal-600 hover:bg-teal-500",onClick:se,disabled:T,"data-testid":"button-save-headers",children:T?"Saving…":"Save"})]})]}):Is(B)?c.jsx("ul",{className:"space-y-1 font-mono","data-testid":"headers-masked-list",children:wf(B).map(({name:ue,masked:ve})=>c.jsxs("li",{children:[c.jsx("span",{className:"text-gray-300",children:ue}),c.jsx("span",{className:"text-gray-500",children:": "}),c.jsx("span",{children:ve})]},ue))}):c.jsx("p",{className:"text-gray-500","data-testid":"headers-empty-state",children:"No custom headers. Add Bearer or API key headers to authenticate."})]}):Is(B)&&c.jsxs("div",{className:"text-xs text-gray-400 bg-black/20 p-2 rounded border border-white/10",children:[c.jsx("p",{className:"font-semibold mb-1",children:"Custom Headers:"}),c.jsx("ul",{className:"space-y-1 font-mono",children:wf(B).map(({name:ue,masked:ve})=>c.jsxs("li",{children:[c.jsx("span",{className:"text-gray-300",children:ue}),c.jsx("span",{className:"text-gray-500",children:": "}),c.jsx("span",{children:ve})]},ue))})]})]})]}),c.jsxs("div",{children:[c.jsx("p",{className:"text-gray-300 text-sm mb-1",children:"Health Status"}),c.jsx(mn,{className:A.health==="healthy"?"bg-green-500/20 text-green-300":A.health==="unhealthy"?"bg-red-500/20 text-red-300":"bg-amber-500/20 text-amber-200",children:A.health==="healthy"?"Healthy":A.health==="unhealthy"?"Unreachable":I.status==="required"||I.status==="expired"||I.status==="refresh_failed"?"Auth required":"Unknown"})]}),c.jsxs("div",{children:[c.jsx("p",{className:"text-gray-300 text-sm mb-1",children:"Registered"}),c.jsx("p",{className:"text-white text-sm",children:ht(A.registeredAt)})]})]})]}),re&&c.jsxs("div",{className:"text-center py-8",children:[c.jsx("div",{className:"animate-spin rounded-full h-8 w-8 border-b-2 border-white mx-auto mb-4"}),c.jsx("p",{className:"text-gray-400",children:"Fetching service details..."})]}),r&&c.jsx("div",{className:"bg-red-500/20 border border-red-500/30 rounded-lg p-4",children:c.jsx("p",{className:"text-red-300",children:r})}),(e.type==="mcp"||e.type==="local-mcp")&&c.jsxs(c.Fragment,{children:[e.type==="local-mcp"&&c.jsxs("div",{className:"bg-cyan-500/15 border border-cyan-500/30 rounded-lg p-4 mb-4",children:[c.jsx("h3",{className:"text-cyan-200 font-semibold mb-2",children:"Local MCP — auth happens outside Agent Deck"}),c.jsx("div",{className:"text-cyan-100/90 text-sm space-y-2",children:UK(A)?c.jsxs(c.Fragment,{children:[c.jsxs("p",{children:["This card runs ",c.jsx("code",{className:"text-xs",children:"@piotr-agier/google-drive-mcp"})," on your machine. Agent Deck does ",c.jsx("strong",{children:"not"}),' handle Google OAuth for it. If Google shows "app not verified", that is ',c.jsx("strong",{children:"your Google Cloud project"}),", not Agent Deck."]}),c.jsxs("ol",{className:"list-decimal list-inside space-y-1 ml-1",children:[c.jsxs("li",{children:["Create a GCP OAuth client type ",c.jsx("strong",{children:"Desktop app"})," (not Web)."]}),c.jsxs("li",{children:["Add yourself as a ",c.jsx("strong",{children:"Test user"})," on the consent screen."]}),c.jsxs("li",{children:["Run in terminal first:"," ",c.jsx("code",{className:"text-xs block mt-1 bg-black/30 p-2 rounded whitespace-pre-wrap",children:`export GOOGLE_DRIVE_OAUTH_CREDENTIALS="/path/to/gcp-oauth.keys.json"
442
+ export GOOGLE_DRIVE_MCP_AUTH_PORT=3100
443
+ npx @piotr-agier/google-drive-mcp auth`})]}),c.jsxs("li",{children:["Set ",c.jsx("code",{className:"text-xs",children:"GOOGLE_DRIVE_MCP_TOKEN_PATH"})," in the card env to the same token file (",c.jsx("code",{className:"text-xs",children:"~/.config/google-drive-mcp/tokens.json"}),")."]})]}),c.jsxs("p",{className:"text-xs text-cyan-200/80",children:["Full steps: ",c.jsx("code",{className:"text-xs",children:"docs/GOOGLE_DRIVE_WORKAROUND.md"})," in the repo."]})]}):c.jsx("p",{children:"Local servers manage their own credentials (API keys, OAuth, etc.) in the spawned process. Complete any login in the terminal or config for that package before expecting tools here."})})]}),c.jsx(PK,{serviceId:A.id,tools:ne,isLoading:W})]}),e.type==="a2a"&&K&&c.jsxs("div",{className:"space-y-6",children:[c.jsxs("div",{className:"bg-black/20 rounded-lg p-4 border border-white/10",children:[c.jsxs("h3",{className:"text-lg font-semibold mb-4 flex items-center",children:[c.jsx(eL,{className:"w-5 h-5 mr-2"}),"Agent Overview"]}),c.jsxs("div",{className:"grid grid-cols-1 md:grid-cols-2 gap-4",children:[c.jsxs("div",{children:[c.jsx("p",{className:"text-gray-300 text-sm mb-1",children:"Agent Name"}),c.jsx("p",{className:"text-white font-semibold",children:K.name})]}),c.jsxs("div",{children:[c.jsx("p",{className:"text-gray-300 text-sm mb-1",children:"Version"}),c.jsx("p",{className:"text-white",children:K.version})]}),c.jsxs("div",{className:"md:col-span-2",children:[c.jsx("p",{className:"text-gray-300 text-sm mb-1",children:"Description"}),c.jsx("p",{className:"text-white",children:K.description})]}),K.provider&&c.jsxs("div",{children:[c.jsx("p",{className:"text-gray-300 text-sm mb-1",children:"Provider"}),c.jsx("p",{className:"text-white",children:K.provider.organization})]}),K.documentationUrl&&c.jsxs("div",{children:[c.jsx("p",{className:"text-gray-300 text-sm mb-1",children:"Documentation"}),c.jsxs(le,{size:"sm",variant:"ghost",onClick:()=>window.open(K.documentationUrl,"_blank"),className:"p-1 h-auto text-purple-300",children:[c.jsx(Xa,{className:"w-4 h-4 mr-1"}),"View Docs"]})]})]})]}),K.capabilities&&c.jsxs("div",{className:"bg-black/20 rounded-lg p-4 border border-white/10",children:[c.jsxs("h3",{className:"text-lg font-semibold mb-4 flex items-center",children:[c.jsx(dT,{className:"w-5 h-5 mr-2"}),"Capabilities"]}),c.jsxs("div",{className:"grid grid-cols-1 md:grid-cols-3 gap-3",children:[K.capabilities.streaming&&c.jsx(mn,{className:"bg-green-500/20 text-green-300",children:"Streaming"}),K.capabilities.pushNotifications&&c.jsx(mn,{className:"bg-blue-500/20 text-blue-300",children:"Push Notifications"}),K.capabilities.stateTransitionHistory&&c.jsx(mn,{className:"bg-purple-500/20 text-purple-300",children:"State History"})]})]}),K.skills&&K.skills.length>0&&c.jsxs("div",{className:"bg-black/20 rounded-lg p-4 border border-white/10",children:[c.jsxs("h3",{className:"text-lg font-semibold mb-4 flex items-center",children:[c.jsx(_g,{className:"w-5 h-5 mr-2"}),"Skills (",K.skills.length,")"]}),c.jsx("div",{className:"grid grid-cols-2 sm:grid-cols-3 md:grid-cols-4 lg:grid-cols-5 xl:grid-cols-6 gap-4",children:K.skills.map((ue,ve)=>c.jsxs("div",{className:"relative group cursor-pointer transform hover:scale-105 transition-all duration-300",style:{aspectRatio:"2/3",background:"linear-gradient(135deg, rgba(147, 51, 234, 0.1), rgba(196, 181, 253, 0.1))",border:"2px solid rgba(147, 51, 234, 0.3)",borderRadius:"12px",boxShadow:"0 4px 20px rgba(147, 51, 234, 0.2)",minWidth:"120px",maxWidth:"160px"},children:[c.jsx("div",{className:"absolute top-2 left-2 text-xs font-bold",children:c.jsx("div",{className:"text-purple-300 leading-none",children:"S"})}),c.jsx("div",{className:"absolute bottom-2 right-2 text-xs font-bold rotate-180",children:c.jsx("div",{className:"text-purple-300 leading-none",children:"S"})}),c.jsxs("div",{className:"absolute inset-x-3 top-8 bottom-8 flex flex-col items-center justify-center text-center",children:[c.jsx("div",{className:"text-purple-300 mb-2",children:c.jsx(_g,{className:"w-6 h-6"})}),c.jsx("h4",{className:"font-bold text-sm mb-2 line-clamp-2 text-white",children:ue.name}),c.jsx("p",{className:"text-gray-300 text-xs line-clamp-4 mb-2",children:ue.description}),ue.tags&&ue.tags.length>0&&c.jsx("div",{className:"flex flex-wrap gap-1 justify-center",children:ue.tags.slice(0,2).map((yt,En)=>c.jsx("span",{className:"text-purple-300 text-xs bg-purple-500/20 px-1 py-0.5 rounded",children:yt},En))})]}),c.jsx("div",{className:"absolute inset-0 rounded-lg bg-gradient-to-br from-transparent via-purple-500/5 to-transparent opacity-0 group-hover:opacity-100 transition-all duration-500 pointer-events-none"})]},ve))})]}),(K.defaultInputModes||K.defaultOutputModes)&&c.jsxs("div",{className:"bg-black/20 rounded-lg p-4 border border-white/10",children:[c.jsxs("h3",{className:"text-lg font-semibold mb-3 flex items-center",children:[c.jsx(y_,{className:"w-5 h-5 mr-2"}),"Data Modes"]}),c.jsxs("div",{className:"grid grid-cols-1 md:grid-cols-2 gap-4",children:[K.defaultInputModes&&c.jsxs("div",{children:[c.jsx("p",{className:"text-gray-300 text-sm mb-2",children:"Input Modes"}),c.jsx("div",{className:"flex flex-wrap gap-2",children:K.defaultInputModes.map((ue,ve)=>c.jsx(mn,{className:"bg-blue-500/20 text-blue-300 text-xs",children:ue},ve))})]}),K.defaultOutputModes&&c.jsxs("div",{children:[c.jsx("p",{className:"text-gray-300 text-sm mb-2",children:"Output Modes"}),c.jsx("div",{className:"flex flex-wrap gap-2",children:K.defaultOutputModes.map((ue,ve)=>c.jsx(mn,{className:"bg-green-500/20 text-green-300 text-xs",children:ue},ve))})]})]})]})]}),(e==null?void 0:e.type)==="mcp"&&I.status==="not_required"&&(A==null?void 0:A.id)&&c.jsxs("div",{className:"bg-blue-500/20 border border-blue-500/30 rounded-lg p-4 mb-4",children:[c.jsx("h3",{className:"text-blue-300 font-semibold mb-2",children:"How to connect"}),c.jsx(Kk,{serviceId:A.id})]}),(e==null?void 0:e.type)==="mcp"&&I.status==="authenticated_refreshable"&&c.jsxs("div",{className:"bg-green-500/15 border border-green-500/30 rounded-lg p-4 mb-4",children:[c.jsx("h3",{className:"text-green-300 font-semibold mb-2",children:"✓ OAuth connected"}),c.jsx("p",{className:"text-green-100 text-sm",children:I.message})]}),(e==null?void 0:e.type)==="mcp"&&!Sf(I.status)&&I.status!=="not_required"&&c.jsxs("div",{className:`${I.status==="expired"||I.status==="refresh_failed"?"bg-red-500/20 border-red-500/30":"bg-orange-500/20 border-orange-500/30"} rounded-lg p-4 mb-4`,children:[c.jsx("h3",{className:`${I.status==="expired"||I.status==="refresh_failed"?"text-red-300":"text-orange-300"} font-semibold mb-2`,children:I.status==="expired"||I.status==="refresh_failed"?"⏰ Token Expired":"🔐 Authentication Required"}),c.jsxs("div",{className:`${I.status==="expired"||I.status==="refresh_failed"?"text-red-200":"text-orange-200"} text-sm space-y-2`,children:[c.jsx("p",{children:c.jsx("strong",{children:I.message})}),c.jsx("p",{children:I.status==="expired"||I.status==="refresh_failed"?"Your OAuth token has expired or could not be renewed. Please re-authenticate to continue using this service.":"This MCP server requires OAuth authentication to access its tools. Please authenticate to continue."}),(A==null?void 0:A.id)&&c.jsx(Kk,{serviceId:A.id,onConnected:()=>void k()}),((rn=(fe=F==null?void 0:F.data)==null?void 0:fe.oauth)==null?void 0:rn.resourceName)&&c.jsx("div",{className:"mt-3 p-2 bg-orange-500/10 rounded border border-orange-500/20 text-xs text-orange-100",children:c.jsxs("p",{children:[c.jsx("strong",{children:"Resource:"})," ",F.data.oauth.resourceName]})})]})]}),(e==null?void 0:e.type)==="mcp"&&c.jsxs("div",{className:"bg-gray-800/50 border border-gray-600/30 rounded-lg p-4 mb-4",children:[c.jsx("h3",{className:"text-gray-300 font-semibold mb-2",children:"Connection Logs"}),c.jsxs("div",{className:"text-gray-200 text-sm space-y-2",children:[c.jsxs("div",{className:"bg-black/30 p-2 rounded text-xs",children:[c.jsx("p",{children:c.jsx("strong",{children:"🔍 Attempting to discover tools for MCP service:"})}),c.jsxs("p",{children:["Service ID: ",e==null?void 0:e.id]}),c.jsxs("p",{children:["Service URL: ",A==null?void 0:A.url]}),c.jsxs("p",{children:["Status: ",W?"🔄 Loading...":oe?"❌ Failed":"✅ Complete"]})]}),W&&c.jsxs("div",{className:"bg-yellow-500/20 p-2 rounded text-xs",children:[c.jsxs("p",{children:["🔄 Making HTTP request to: ",c.jsxs("code",{children:["GET /api/services/",e==null?void 0:e.id,"/tools"]})]}),c.jsxs("p",{children:["Target MCP server: ",c.jsx("code",{children:A==null?void 0:A.url})]})]}),oe&&c.jsxs("div",{className:"bg-red-500/20 p-2 rounded text-xs",children:[c.jsx("p",{children:"❌ Request failed:"}),c.jsx("pre",{className:"whitespace-pre-wrap overflow-x-auto",children:oe instanceof Error?oe.message:String(oe)}),c.jsxs("div",{className:"mt-2 p-2 bg-black/30 rounded",children:[c.jsx("p",{children:c.jsx("strong",{children:"🔍 What we tried:"})}),c.jsxs("p",{children:["• Service ID: ",e==null?void 0:e.id]}),c.jsxs("p",{children:["• Target URL: ",A==null?void 0:A.url]}),c.jsxs("p",{children:["• Request: GET /api/services/",e==null?void 0:e.id,"/tools"]}),Is(B)&&c.jsxs("div",{children:[c.jsx("p",{children:c.jsx("strong",{children:"📋 Headers sent:"})}),c.jsx("ul",{className:"text-xs font-mono",children:wf(B).map(({name:ue,masked:ve})=>c.jsxs("li",{children:[ue,": ",ve]},ue))})]}),c.jsxs("div",{className:"mt-2",children:[c.jsx("p",{children:c.jsx("strong",{children:"💡 What this means:"})}),c.jsxs("p",{children:["• The MCP server at ",A==null?void 0:A.url," returned an error"]}),c.jsx("p",{children:"• This could be due to authentication issues, server being down, or invalid configuration"}),c.jsx("p",{children:"• Check the error message above for specific details from the MCP server"})]})]})]}),!W&&!oe&&ne.length>0&&c.jsx("div",{className:"bg-green-500/20 p-2 rounded text-xs",children:c.jsxs("p",{children:["✅ Successfully discovered ",ne.length," tools from MCP server"]})}),!W&&!oe&&ne.length===0&&c.jsxs("div",{className:"bg-yellow-500/20 p-2 rounded text-xs",children:[c.jsx("p",{children:"⚠️ Connected to MCP server but no tools were found"}),c.jsx("p",{children:"This could mean the server has no tools or requires specific authentication"})]})]})]}),oe&&(e.type==="mcp"||e.type==="local-mcp")&&c.jsxs("div",{className:"bg-red-500/20 border border-red-500/30 rounded-lg p-4",children:[c.jsx("h3",{className:"text-red-300 font-semibold mb-2",children:"MCP Tool Discovery Failed"}),c.jsxs("div",{className:"text-red-200 text-sm space-y-2",children:[c.jsx("p",{children:c.jsx("strong",{children:"Raw Error:"})}),c.jsx("pre",{className:"bg-black/30 p-2 rounded text-xs overflow-x-auto whitespace-pre-wrap",children:oe instanceof Error?oe.message:String(oe)}),c.jsxs("p",{children:[c.jsx("strong",{children:"Service URL:"})," ",A==null?void 0:A.url]}),c.jsxs("p",{children:[c.jsx("strong",{children:"Service ID:"})," ",A==null?void 0:A.id]}),Is(B)&&c.jsxs("div",{children:[c.jsx("p",{children:c.jsx("strong",{children:"Custom Headers:"})}),c.jsx("ul",{className:"bg-black/30 p-2 rounded text-xs font-mono",children:wf(B).map(({name:ue,masked:ve})=>c.jsxs("li",{children:[ue,": ",ve]},ue))})]})]})]}),X&&e.type==="a2a"&&c.jsxs("div",{className:"bg-red-500/20 border border-red-500/30 rounded-lg p-4",children:[c.jsx("h3",{className:"text-red-300 font-semibold mb-2",children:"A2A Manifest Discovery Failed"}),c.jsxs("div",{className:"text-red-200 text-sm space-y-2",children:[c.jsx("p",{children:c.jsx("strong",{children:"Raw Error:"})}),c.jsx("pre",{className:"bg-black/30 p-2 rounded text-xs overflow-x-auto whitespace-pre-wrap",children:X instanceof Error?X.message:String(X)}),c.jsxs("p",{children:[c.jsx("strong",{children:"Service URL:"})," ",A==null?void 0:A.url]}),c.jsxs("p",{children:[c.jsx("strong",{children:"Service ID:"})," ",A==null?void 0:A.id]})]})]}),!re&&!oe&&!X&&(e.type==="mcp"||e.type==="local-mcp")&&ne.length===0&&(e.type==="local-mcp"||!((ks=(_s=F==null?void 0:F.data)==null?void 0:_s.oauth)!=null&&ks.required))&&c.jsxs("div",{className:"bg-yellow-500/20 border border-yellow-500/30 rounded-lg p-4",children:[c.jsx("h3",{className:"text-yellow-300 font-semibold mb-2",children:"No Tools Available"}),c.jsxs("p",{className:"text-yellow-200 text-sm",children:["Successfully connected to MCP server at ",A==null?void 0:A.url,", but no tools were discovered."]}),c.jsxs("div",{className:"text-yellow-200 text-xs mt-2",children:[c.jsx("p",{children:c.jsx("strong",{children:"This could mean:"})}),c.jsxs("ul",{className:"list-disc list-inside ml-2 space-y-1",children:[c.jsx("li",{children:"The MCP server has no tools registered"}),c.jsx("li",{children:"Tools require specific authentication"}),c.jsx("li",{children:"Tools are only available after certain operations"})]})]})]}),(e.type==="mcp"||e.type==="local-mcp")&&c.jsxs("div",{className:"bg-blue-500/20 border border-blue-500/30 rounded-lg p-4",children:[c.jsx("h3",{className:"text-blue-300 font-semibold mb-2",children:"🔍 MCP Server Analysis"}),c.jsxs("div",{className:"text-blue-200 text-sm space-y-2",children:[c.jsxs("p",{children:[c.jsx("strong",{children:"Server URL:"})," ",A==null?void 0:A.url]}),J&&c.jsx("div",{className:"mt-3 p-3 bg-black/30 rounded",children:c.jsx("p",{children:"🔍 Analyzing MCP server configuration..."})}),F&&c.jsxs("div",{className:"mt-3 p-3 bg-black/30 rounded",children:[c.jsx("p",{children:c.jsx("strong",{children:"🔍 What we discovered:"})}),F.error&&F.analysis&&c.jsxs("div",{className:"text-yellow-200",children:[F.analysis.auth_type==="oauth2"&&c.jsxs("div",{children:[c.jsxs("p",{children:["• ",c.jsx("strong",{children:"OAuth 2.0 Authentication Required"})]}),c.jsx("p",{children:"• This MCP server requires OAuth 2.0 Bearer token authentication"}),c.jsx("p",{children:"• You'll need to provide OAuth credentials (client ID, client secret, authorization URL, token URL)"}),c.jsx("p",{children:"• Check the service provider's documentation for OAuth setup instructions"})]}),F.analysis.protocol==="sse"&&c.jsxs("div",{children:[c.jsxs("p",{children:["• ",c.jsx("strong",{children:"SSE Protocol Required"})]}),c.jsx("p",{children:"• This MCP server uses Server-Sent Events (SSE) protocol"}),c.jsx("p",{children:"• We'll need to connect using event streaming instead of HTTP"})]}),F.analysis.issue==="not_found"&&c.jsxs("div",{children:[c.jsxs("p",{children:["• ",c.jsx("strong",{children:"Server Not Found"})]}),c.jsx("p",{children:"• The MCP server URL might be incorrect"}),c.jsx("p",{children:"• Check if the server is running and the URL is correct"})]}),F.analysis.issue==="server_error"&&c.jsxs("div",{children:[c.jsxs("p",{children:["• ",c.jsx("strong",{children:"Server Error"})]}),c.jsx("p",{children:"• The MCP server is experiencing internal errors"}),c.jsx("p",{children:"• Try again later or contact the service provider"})]}),F.analysis.message&&c.jsxs("p",{children:["• ",c.jsx("strong",{children:"Analysis:"})," ",F.analysis.message]})]}),((p1=(m1=F==null?void 0:F.data)==null?void 0:m1.oauth)==null?void 0:p1.required)&&c.jsxs("div",{className:"text-yellow-200",children:[c.jsxs("p",{children:["• ",c.jsx("strong",{children:"OAuth 2.0 Authentication Required"})]}),F.data.oauth.authorizationUrl&&c.jsxs("div",{className:"mt-2 flex items-center gap-2",children:[c.jsx(le,{size:"sm",variant:"default",className:"h-7",onClick:async()=>{var ue,ve;if(A!=null&&A.id)try{z({title:"Setting up OAuth...",description:"Automatically registering OAuth application and starting authorization flow..."});const yt=await ke("POST",`/api/oauth/${A.id}/auto-setup`,{});if(!yt.ok){const Rn=await yt.json();(ue=Rn.data)!=null&&ue.registrationUrl?(window.open(Rn.data.registrationUrl,"_blank"),z({title:"OAuth Registration Required",description:`${Rn.error} I've opened the registration page for you. Please create an OAuth app and then come back to add your credentials.`,duration:15e3})):z({title:"OAuth Setup Failed",description:Rn.error||"Failed to setup OAuth automatically. Please configure manually.",variant:"destructive"});return}const En=await yt.json();En.success&&((ve=En.data)!=null&&ve.authorizationUrl)?(window.open(En.data.authorizationUrl,"_blank"),z({title:"OAuth Setup Successful",description:"OAuth application registered automatically! Please complete the authorization in the new window.",duration:1e4}),k()):z({title:"OAuth Setup Failed",description:"Failed to get authorization URL. Please try again.",variant:"destructive"})}catch(yt){z({title:"OAuth Setup Failed",description:yt instanceof Error?yt.message:"Unknown error occurred",variant:"destructive"})}},children:"🔧 Auto-Setup OAuth"}),c.jsxs(le,{size:"sm",variant:"ghost",className:"p-1 h-auto text-blue-300",onClick:()=>window.open(F.data.oauth.authorizationUrl,"_blank"),children:[c.jsx(Xa,{className:"w-4 h-4 mr-1"}),"Open Raw Authorization URL"]})]}),!F.data.oauth.authorizationUrl&&F.data.oauth.protectedResourceConfigUrl&&c.jsx("div",{className:"mt-2",children:c.jsxs(le,{size:"sm",variant:"ghost",className:"p-1 h-auto text-blue-300",onClick:()=>window.open(F.data.oauth.protectedResourceConfigUrl,"_blank"),children:[c.jsx(Xa,{className:"w-4 h-4 mr-1"}),"View OAuth Configuration"]})}),F.data.oauth.authorizationServerMetadataUrl&&c.jsxs("div",{className:"mt-2 text-xs text-gray-300",children:[c.jsx("span",{className:"mr-1",children:"Auth Server Metadata:"}),c.jsx("button",{className:"underline text-blue-300",onClick:()=>window.open(F.data.oauth.authorizationServerMetadataUrl,"_blank"),children:F.data.oauth.authorizationServerMetadataUrl})]})]}),(F==null?void 0:F.success)&&!((y1=(g1=F==null?void 0:F.data)==null?void 0:g1.oauth)!=null&&y1.required)&&c.jsxs("div",{className:"text-green-200",children:[c.jsxs("p",{children:["• ",c.jsx("strong",{children:"✅ Server Analysis Complete"})]}),c.jsx("p",{children:"• MCP server is accessible and responding"}),c.jsx("p",{children:"• No authentication issues detected"}),c.jsx("p",{children:"• Protocol compatibility confirmed"})]}),((b1=(v1=F==null?void 0:F.data)==null?void 0:v1.oauth)==null?void 0:b1.required)&&c.jsxs("div",{className:"text-orange-200",children:[c.jsxs("p",{children:["• ",c.jsx("strong",{children:"🔐 OAuth 2.0 Authentication Required"})]}),c.jsx("p",{children:"• This MCP server requires OAuth authentication"}),F.data.oauth.resourceName&&c.jsxs("p",{children:["• Service: ",F.data.oauth.resourceName]}),F.data.oauth.authorizationUrl&&c.jsxs("p",{children:["• Authorization URL: ",F.data.oauth.authorizationUrl]}),F.data.oauth.tokenUrl&&c.jsxs("p",{children:["• Token URL: ",F.data.oauth.tokenUrl]}),c.jsxs("div",{className:"mt-3 flex flex-wrap gap-2",children:[c.jsx(le,{size:"sm",variant:"default",className:"bg-orange-600 hover:bg-orange-700",onClick:async()=>{var ue,ve;if(A!=null&&A.id)try{z({title:"Setting up OAuth...",description:"Automatically registering OAuth application and starting authorization flow..."});const yt=await ke("POST",`/api/oauth/${A.id}/auto-setup`,{});if(!yt.ok){const Rn=await yt.json();(ue=Rn.data)!=null&&ue.registrationUrl?(window.open(Rn.data.registrationUrl,"_blank"),z({title:"OAuth Registration Required",description:`${Rn.error} I've opened the registration page for you. Please create an OAuth app and then come back to add your credentials.`,duration:15e3})):z({title:"OAuth Setup Failed",description:Rn.error||"Failed to setup OAuth automatically. Please configure manually.",variant:"destructive"});return}const En=await yt.json();En.success&&((ve=En.data)!=null&&ve.authorizationUrl)?(window.open(En.data.authorizationUrl,"_blank"),z({title:"OAuth Setup Successful",description:"OAuth application registered automatically! Please complete the authorization in the new window.",duration:1e4}),k()):z({title:"OAuth Setup Failed",description:"Failed to get authorization URL. Please try again.",variant:"destructive"})}catch(yt){z({title:"OAuth Setup Failed",description:yt instanceof Error?yt.message:"Unknown error occurred",variant:"destructive"})}},children:"🔧 Auto-Setup OAuth"}),c.jsx(le,{size:"sm",variant:"outline",className:"border-orange-500/30 text-orange-300 hover:bg-orange-500/10",onClick:()=>{const ue=`OAuth Setup Instructions:
444
+
445
+ 1. Go to the service provider's OAuth/Developer settings
446
+ 2. Create a new OAuth application
447
+ 3. Set Redirect URL: http://localhost:8000/api/oauth/${A==null?void 0:A.id}/callback
448
+ 4. Copy the Client ID and Client Secret
449
+ 5. Edit this service and add the credentials
450
+
451
+ ${F.data.oauth.authorizationUrl?`Authorization URL: ${F.data.oauth.authorizationUrl}`:""}
452
+ ${F.data.oauth.tokenUrl?`Token URL: ${F.data.oauth.tokenUrl}`:""}
453
+ ${F.data.oauth.issuer?`Issuer: ${F.data.oauth.issuer}`:""}`;z({title:"OAuth Setup Instructions",description:ue,duration:1e4})},children:"📋 Setup Instructions"})]})]}),c.jsxs("div",{className:"mt-2 text-xs",children:[c.jsx("p",{children:c.jsx("strong",{children:"💡 Next Steps:"})}),c.jsxs("ul",{className:"list-disc list-inside ml-2 space-y-1",children:[c.jsx("li",{children:"For OAuth servers: Provide OAuth credentials in service settings"}),c.jsx("li",{children:"For SSE servers: We'll automatically use the correct protocol"}),c.jsx("li",{children:"For connection issues: Verify the server URL and status"})]})]})]}),N&&c.jsxs("div",{className:"mt-3 p-3 bg-red-500/20 rounded",children:[c.jsx("p",{children:c.jsx("strong",{children:"❌ Discovery Failed"})}),c.jsx("p",{children:"Could not analyze MCP server configuration"}),c.jsx("pre",{className:"text-xs overflow-x-auto",children:N instanceof Error?N.message:String(N)})]})]})]}),!re&&!oe&&!X&&e.type==="a2a"&&!K&&c.jsxs("div",{className:"bg-yellow-500/20 border border-yellow-500/30 rounded-lg p-4",children:[c.jsx("h3",{className:"text-yellow-300 font-semibold mb-2",children:"Agent Details Not Available"}),c.jsxs("p",{className:"text-yellow-200 text-sm",children:["Successfully connected to A2A agent at ",A==null?void 0:A.url,", but no manifest was found."]}),c.jsxs("div",{className:"text-yellow-200 text-xs mt-2",children:[c.jsx("p",{children:c.jsx("strong",{children:"This could mean:"})}),c.jsxs("ul",{className:"list-disc list-inside ml-2 space-y-1",children:[c.jsx("li",{children:"The agent doesn't provide a manifest"}),c.jsx("li",{children:"Manifest endpoint is not implemented"}),c.jsx("li",{children:"Agent requires specific authentication"})]})]})]})]})]})})}function qK({open:e,onOpenChange:t}){const[n,r]=x.useState(null),[a,i]=x.useState(null),[s,o]=x.useState(null),[l,u]=x.useState(!1),d=cn(),{toast:f}=nn(),m=()=>{r(null),i(null),o(null),u(!1)},h=St({mutationFn:async()=>{if(!n)throw new Error("Choose a bundle file first");const p=await n.text();let b;try{b=JSON.parse(p)}catch{throw new Error("File is not valid JSON")}return V9(b)},onSuccess:p=>{o(p),d.invalidateQueries({queryKey:["/api/decks"]}),d.invalidateQueries({queryKey:["/api/services"]}),d.invalidateQueries({queryKey:["/api/playbooks"]}),d.invalidateQueries({queryKey:["/api/playbooks/collection"]}),d.invalidateQueries({queryKey:["/api/credentials/collection"]}),d.invalidateQueries({queryKey:["/api/collection/warnings"]}),f({title:"Import complete",description:V_(p)})},onError:p=>{f({title:"Import failed",description:p.message,variant:"destructive"})}}),y=async p=>{var b,g,v;if(r(p),o(null),!p){i(null);return}try{const w=await p.text(),S=JSON.parse(w);i(`${((b=S.services)==null?void 0:b.length)??0} services · ${((g=S.playbooks)==null?void 0:g.length)??0} playbooks · ${((v=S.decks)==null?void 0:v.length)??0} decks`)}catch{i("Invalid JSON")}};return c.jsx(bs,{open:e,onOpenChange:p=>{p||m(),t(p)},children:c.jsxs(mi,{className:"sm:max-w-lg border-border bg-[#161612] text-[#E8F6F4]",children:[c.jsxs(pi,{children:[c.jsx(gi,{children:"Import bundle"}),c.jsx(jo,{asChild:!0,children:c.jsxs("div",{className:"space-y-2 text-left text-sm text-[#A8C4C0]",children:[c.jsx("p",{children:"Adds MCP, playbooks, and decks from a JSON file."}),c.jsxs("div",{children:[c.jsx("p",{className:"font-medium text-amber-200/90",children:"Notes"}),c.jsxs("ul",{className:"mt-1 list-disc space-y-0.5 pl-4",children:[c.jsx("li",{children:"Same name as an existing card or deck is skipped (linked only)."}),c.jsx("li",{children:"No credentials or secrets — re-enter keys and reconnect OAuth."})]})]})]})})]}),c.jsxs("div",{className:"space-y-4",children:[c.jsxs("div",{className:"space-y-2",children:[c.jsx(Qe,{htmlFor:"bundle-file",children:"Bundle file"}),c.jsx(at,{id:"bundle-file",type:"file",accept:".json,.agent-deck.json,application/json",className:"cursor-pointer bg-white/5 border-white/20",onChange:p=>{var b;return y(((b=p.target.files)==null?void 0:b[0])??null)},"data-testid":"input-import-bundle"}),a&&c.jsx("p",{className:"text-xs text-[#A8C4C0]","data-testid":"import-preview",children:a})]}),!s&&c.jsx(le,{onClick:()=>h.mutate(),disabled:!n||h.isPending||a==="Invalid JSON",className:"rounded-full border px-6 text-sm font-semibold hover:opacity-90",style:{background:"#C4B643",borderColor:"#C4B643",color:"black"},"data-testid":"button-import-apply",children:h.isPending?"Importing…":"Import"}),s&&c.jsxs("div",{className:"space-y-2 rounded-lg border border-white/10 bg-white/5 p-3 text-sm","data-testid":"import-report",children:[c.jsx("p",{className:"font-medium",children:V_(s)}),s.servicesNeedingOauth.length>0&&c.jsxs("div",{children:[c.jsx("p",{className:"text-amber-200",children:"Needs OAuth reconnect:"}),c.jsx("ul",{className:"list-disc pl-5 text-[#A8C4C0]",children:s.servicesNeedingOauth.map(p=>c.jsx("li",{children:p},p))})]}),s.warnings.length>0&&c.jsxs("div",{children:[c.jsx("p",{className:"text-amber-200",children:"Warnings:"}),c.jsx("ul",{className:"list-disc pl-5 text-[#A8C4C0]",children:s.warnings.map(p=>c.jsx("li",{children:p},p))})]}),c.jsx(le,{variant:"outline",size:"sm",className:"rounded-full border border-white/20 text-white hover:bg-white/10",onClick:()=>u(p=>!p),children:l?"Hide id map":"Show id map"}),l&&c.jsx("pre",{className:"max-h-40 overflow-auto rounded bg-black/40 p-2 text-xs",children:JSON.stringify(s.idMap,null,2)}),c.jsx(le,{className:"rounded-full border px-6 text-sm font-semibold hover:opacity-90",style:{background:"#C4B643",borderColor:"#C4B643",color:"black"},onClick:()=>{m(),t(!1)},children:"Done"})]})]})]})})}function HK(){const[e,t]=x.useState("connecting"),[n,r]=x.useState(null),a=x.useRef(null),i=x.useRef(null),s=cn();return x.useEffect(()=>{const l=`${window.location.protocol==="https:"?"wss:":"ws:"}//${window.location.host}/api/ws/events`,u=()=>{try{const f=new WebSocket(l);a.current=f,f.onopen=()=>{console.log("WebSocket connected"),t("connected")},f.onmessage=m=>{var h;try{const y=JSON.parse(m.data);r(y),y.type==="deck_update"?(console.log("Received deck update:",y),s.invalidateQueries({queryKey:["/api/decks"]})):y.type==="service_update"?(console.log("Received service update:",y),Su(s,typeof((h=y.data)==null?void 0:h.serviceId)=="string"?y.data.serviceId:void 0)):y.type==="connection_status"&&t(y.status==="connected"?"connected":"disconnected")}catch(y){console.error("Failed to parse WebSocket message:",y)}},f.onclose=()=>{console.log("WebSocket disconnected"),t("disconnected"),i.current=setTimeout(()=>{console.log("Attempting to reconnect WebSocket..."),t("connecting"),u()},3e3)},f.onerror=m=>{console.error("WebSocket error:",m),t("disconnected")}}catch(f){console.error("Failed to connect WebSocket:",f),t("disconnected")}};u();const d=f=>{f.origin===window.location.origin&&DK(f.data)&&Su(s,f.data.serviceId)};return window.addEventListener("message",d),()=>{window.removeEventListener("message",d),i.current&&clearTimeout(i.current),a.current&&a.current.readyState===WebSocket.OPEN&&a.current.close()}},[s]),{connectionStatus:e,lastMessage:n}}async function Gk(e,t){const n=e==="credential"?`credentialId=${encodeURIComponent(t)}`:`serviceId=${encodeURIComponent(t)}`;return(await(await ke("GET",`/api/playbooks/dependents/check?${n}`)).json()).data??[]}function BK(e){const[t,n]=x.useState(null),[r,a]=x.useState(null),[i,s]=x.useState(null),[o,l]=x.useState(!1),u=cn(),{toast:d}=nn(),f=()=>{if(!e)throw new Error("Select a deck to edit first");return e},m=St({mutationFn:async j=>{var Z,F,J;const O=f(),A=(Z=(await(await ke("GET","/api/decks")).json()).data)==null?void 0:Z.find(N=>N.id===O);if(!A)throw new Error("Selected deck not found");if((F=A.services)!=null&&F.some(N=>N.id===j))throw new Error("Service is already in the deck");const B=((J=A.services)==null?void 0:J.length)??0;return ke("POST",`/api/decks/${O}/services`,{serviceId:j,position:B})},onSuccess:()=>{u.invalidateQueries({queryKey:["/api/decks"]}),d({title:"Service added to deck",description:`${(t==null?void 0:t.name)||"Service"} has been added to the deck.`})},onError:j=>{d({title:"Failed to add service",description:j.message,variant:"destructive"})}}),h=St({mutationFn:async j=>{var B,Z;const O=f(),A=(B=(await(await ke("GET","/api/decks")).json()).data)==null?void 0:B.find(F=>F.id===O);if((Z=A==null?void 0:A.credentials)!=null&&Z.some(F=>F.id===j))throw new Error("API key is already in the deck");return ke("POST",`/api/decks/${O}/credentials`,{credentialId:j})},onSuccess:()=>{u.invalidateQueries({queryKey:["/api/decks"]}),d({title:"API key added to deck",description:`${(r==null?void 0:r.label)||"API key"} is scoped to this deck.`})},onError:j=>{d({title:"Failed to add API key",description:j.message,variant:"destructive"})}}),y=St({mutationFn:async j=>{var B,Z;const O=f(),A=(B=(await(await ke("GET","/api/decks")).json()).data)==null?void 0:B.find(F=>F.id===O);if((Z=A==null?void 0:A.playbooks)!=null&&Z.some(F=>F.id===j))throw new Error("Playbook is already in the deck");return ke("POST",`/api/decks/${O}/playbooks`,{playbookId:j})},onSuccess:()=>{u.invalidateQueries({queryKey:["/api/decks"]}),d({title:"Playbook added to deck",description:`${(i==null?void 0:i.title)||"Playbook"} is on this deck.`})},onError:j=>{d({title:"Failed to add playbook",description:j.message,variant:"destructive"})}}),p=St({mutationFn:async j=>{const O=await Gk("service",j);if(O.length>0){const D=O.map(B=>B.title).join(", ");if(!window.confirm(`Warning: ${O.length} playbook(s) depend on this MCP (${D}). Remove from deck anyway?`))throw new Error("Cancelled")}const z=f();return ke("DELETE",`/api/decks/${z}/services`,{serviceId:j})},onSuccess:()=>{u.invalidateQueries({queryKey:["/api/decks"]}),d({title:"Service removed from deck",description:`${(t==null?void 0:t.name)||"Service"} has been removed from the deck.`})},onError:j=>{j.message!=="Cancelled"&&d({title:"Failed to remove service",description:j.message,variant:"destructive"})}}),b=St({mutationFn:async j=>{const O=await Gk("credential",j);if(O.length>0){const D=O.map(B=>B.title).join(", ");if(!window.confirm(`Warning: ${O.length} playbook(s) depend on this API key (${D}). Remove from deck anyway?`))throw new Error("Cancelled")}const z=f();return ke("DELETE",`/api/decks/${z}/credentials`,{credentialId:j})},onSuccess:()=>{u.invalidateQueries({queryKey:["/api/decks"]}),d({title:"API key removed from deck",description:`${(r==null?void 0:r.label)||"API key"} is no longer on this deck.`})},onError:j=>{j.message!=="Cancelled"&&d({title:"Failed to remove API key",description:j.message,variant:"destructive"})}}),g=St({mutationFn:async j=>{const O=f();return ke("DELETE",`/api/decks/${O}/playbooks`,{playbookId:j})},onSuccess:()=>{u.invalidateQueries({queryKey:["/api/decks"]}),d({title:"Playbook removed from deck",description:`${(i==null?void 0:i.title)||"Playbook"} is no longer on this deck.`})},onError:j=>{d({title:"Failed to remove playbook",description:j.message,variant:"destructive"})}}),v=(j,O)=>{j.currentTarget instanceof HTMLElement&&(j.currentTarget.style.opacity=O)},w=(j,O)=>{j.dataTransfer.setData("text/plain",O.id),j.dataTransfer.setData("application/json",JSON.stringify(O)),j.dataTransfer.effectAllowed=O.fromDeck?"move":"copy"},S=(j,O,z=!1)=>{n(O),a(null),s(null),l(z),w(j,{kind:"service",id:O.id,fromDeck:z}),v(j,"0.5")},E=(j,O,z=!1)=>{a(O),n(null),s(null),l(z),w(j,{kind:"credential",id:O.id,fromDeck:z}),v(j,"0.5")},C=(j,O,z=!1)=>{s(O),n(null),a(null),l(z),w(j,{kind:"playbook",id:O.id,fromDeck:z}),v(j,"0.5")},T=j=>{n(null),a(null),s(null),v(j,"1")},P=j=>{if(j.kind==="service"){j.fromDeck?p.mutate(j.id):m.mutate(j.id);return}if(j.kind==="credential"){j.fromDeck?b.mutate(j.id):h.mutate(j.id);return}j.fromDeck?g.mutate(j.id):y.mutate(j.id)};return{draggedService:t,draggedCredential:r,draggedPlaybook:i,isDraggingFromDeck:o,handleDragStart:S,handleCredentialDragStart:E,handlePlaybookDragStart:C,handleDragEnd:T,handleDrop:j=>{j.preventDefault();const O=j.dataTransfer.getData("application/json");if(O){try{P(JSON.parse(O))}catch{const z=j.dataTransfer.getData("text/plain");z&&t&&m.mutate(z)}n(null),a(null),s(null),l(!1)}},handleGlobalDrop:j=>{j.preventDefault();const O=j.dataTransfer.getData("application/json");if(O){try{const z=JSON.parse(O);z.fromDeck&&P(z)}catch{}n(null),a(null),s(null),l(!1)}},isDropping:m.isPending||h.isPending||y.isPending||p.isPending||b.isPending||g.isPending}}const Jg="agent-deck-editing-deck-id";function VK(e){const[t,n]=x.useState(()=>typeof window>"u"?null:localStorage.getItem(Jg));x.useEffect(()=>{if(e.length===0)return;if(!(t&&e.some(s=>s.id===t))){const s=e[0].id;n(s),localStorage.setItem(Jg,s)}},[e,t]);const r=i=>{n(i),localStorage.setItem(Jg,i)};return{editingDeck:e.find(i=>i.id===t)??null,editingDeckId:t,setEditingDeckId:r}}function Qk(e,[t,n]){return Math.min(n,Math.max(t,e))}function KK(e){const t=x.useRef({value:e,previous:e});return x.useMemo(()=>(t.current.value!==e&&(t.current.previous=t.current.value,t.current.value=e),t.current.previous),[e])}var ZK=[" ","Enter","ArrowUp","ArrowDown"],GK=[" ","Enter"],yo="Select",[vp,bp,QK]=Hb(yo),[Sc,xie]=fi(yo,[QK,bc]),xp=bc(),[YK,ws]=Sc(yo),[XK,WK]=Sc(yo),F$=e=>{const{__scopeSelect:t,children:n,open:r,defaultOpen:a,onOpenChange:i,value:s,defaultValue:o,onValueChange:l,dir:u,name:d,autoComplete:f,disabled:m,required:h,form:y}=e,p=xp(t),[b,g]=x.useState(null),[v,w]=x.useState(null),[S,E]=x.useState(!1),C=gx(u),[T,P]=ho({prop:r,defaultProp:a??!1,onChange:i,caller:yo}),[R,$]=ho({prop:s,defaultProp:o,onChange:l,caller:yo}),j=x.useRef(null),O=b?y||!!b.closest("form"):!0,[z,D]=x.useState(new Set),A=Array.from(z).map(B=>B.props.value).join(";");return c.jsx(QT,{...p,children:c.jsxs(YK,{required:h,scope:t,trigger:b,onTriggerChange:g,valueNode:v,onValueNodeChange:w,valueNodeHasChildren:S,onValueNodeHasChildrenChange:E,contentId:ti(),value:R,onValueChange:$,open:T,onOpenChange:P,dir:C,triggerPointerDownPosRef:j,disabled:m,children:[c.jsx(vp.Provider,{scope:t,children:c.jsx(XK,{scope:e.__scopeSelect,onNativeOptionAdd:x.useCallback(B=>{D(Z=>new Set(Z).add(B))},[]),onNativeOptionRemove:x.useCallback(B=>{D(Z=>{const F=new Set(Z);return F.delete(B),F})},[]),children:n})}),O?c.jsxs(dO,{"aria-hidden":!0,required:h,tabIndex:-1,name:d,autoComplete:f,value:R,onChange:B=>$(B.target.value),disabled:m,form:y,children:[R===void 0?c.jsx("option",{value:""}):null,Array.from(z)]},A):null]})})};F$.displayName=yo;var q$="SelectTrigger",H$=x.forwardRef((e,t)=>{const{__scopeSelect:n,disabled:r=!1,...a}=e,i=xp(n),s=ws(q$,n),o=s.disabled||r,l=lt(t,s.onTriggerChange),u=bp(n),d=x.useRef("touch"),[f,m,h]=hO(p=>{const b=u().filter(w=>!w.disabled),g=b.find(w=>w.value===s.value),v=mO(b,p,g);v!==void 0&&s.onValueChange(v.value)}),y=p=>{o||(s.onOpenChange(!0),h()),p&&(s.triggerPointerDownPosRef.current={x:Math.round(p.pageX),y:Math.round(p.pageY)})};return c.jsx(np,{asChild:!0,...i,children:c.jsx(De.button,{type:"button",role:"combobox","aria-controls":s.contentId,"aria-expanded":s.open,"aria-required":s.required,"aria-autocomplete":"none",dir:s.dir,"data-state":s.open?"open":"closed",disabled:o,"data-disabled":o?"":void 0,"data-placeholder":fO(s.value)?"":void 0,...a,ref:l,onClick:xe(a.onClick,p=>{p.currentTarget.focus(),d.current!=="mouse"&&y(p)}),onPointerDown:xe(a.onPointerDown,p=>{d.current=p.pointerType;const b=p.target;b.hasPointerCapture(p.pointerId)&&b.releasePointerCapture(p.pointerId),p.button===0&&p.ctrlKey===!1&&p.pointerType==="mouse"&&(y(p),p.preventDefault())}),onKeyDown:xe(a.onKeyDown,p=>{const b=f.current!=="";!(p.ctrlKey||p.altKey||p.metaKey)&&p.key.length===1&&m(p.key),!(b&&p.key===" ")&&ZK.includes(p.key)&&(y(),p.preventDefault())})})})});H$.displayName=q$;var B$="SelectValue",V$=x.forwardRef((e,t)=>{const{__scopeSelect:n,className:r,style:a,children:i,placeholder:s="",...o}=e,l=ws(B$,n),{onValueNodeHasChildrenChange:u}=l,d=i!==void 0,f=lt(t,l.onValueNodeChange);return Sn(()=>{u(d)},[u,d]),c.jsx(De.span,{...o,ref:f,style:{pointerEvents:"none"},children:fO(l.value)?c.jsx(c.Fragment,{children:s}):i})});V$.displayName=B$;var JK="SelectIcon",K$=x.forwardRef((e,t)=>{const{__scopeSelect:n,children:r,...a}=e;return c.jsx(De.span,{"aria-hidden":!0,...a,ref:t,children:r||"▼"})});K$.displayName=JK;var eZ="SelectPortal",Z$=e=>c.jsx(bd,{asChild:!0,...e});Z$.displayName=eZ;var vo="SelectContent",G$=x.forwardRef((e,t)=>{const n=ws(vo,e.__scopeSelect),[r,a]=x.useState();if(Sn(()=>{a(new DocumentFragment)},[]),!n.open){const i=r;return i?So.createPortal(c.jsx(Q$,{scope:e.__scopeSelect,children:c.jsx(vp.Slot,{scope:e.__scopeSelect,children:c.jsx("div",{children:e.children})})}),i):null}return c.jsx(Y$,{...e,ref:t})});G$.displayName=vo;var Kr=10,[Q$,Ss]=Sc(vo),tZ="SelectContentImpl",nZ=fo("SelectContent.RemoveScroll"),Y$=x.forwardRef((e,t)=>{const{__scopeSelect:n,position:r="item-aligned",onCloseAutoFocus:a,onEscapeKeyDown:i,onPointerDownOutside:s,side:o,sideOffset:l,align:u,alignOffset:d,arrowPadding:f,collisionBoundary:m,collisionPadding:h,sticky:y,hideWhenDetached:p,avoidCollisions:b,...g}=e,v=ws(vo,n),[w,S]=x.useState(null),[E,C]=x.useState(null),T=lt(t,Q=>S(Q)),[P,R]=x.useState(null),[$,j]=x.useState(null),O=bp(n),[z,D]=x.useState(!1),A=x.useRef(!1);x.useEffect(()=>{if(w)return dx(w)},[w]),ux();const B=x.useCallback(Q=>{const[W,...oe]=O().map(V=>V.ref.current),[de]=oe.slice(-1),L=document.activeElement;for(const V of Q)if(V===L||(V==null||V.scrollIntoView({block:"nearest"}),V===W&&E&&(E.scrollTop=0),V===de&&E&&(E.scrollTop=E.scrollHeight),V==null||V.focus(),document.activeElement!==L))return},[O,E]),Z=x.useCallback(()=>B([P,w]),[B,P,w]);x.useEffect(()=>{z&&Z()},[z,Z]);const{onOpenChange:F,triggerPointerDownPosRef:J}=v;x.useEffect(()=>{if(w){let Q={x:0,y:0};const W=de=>{var L,V;Q={x:Math.abs(Math.round(de.pageX)-(((L=J.current)==null?void 0:L.x)??0)),y:Math.abs(Math.round(de.pageY)-(((V=J.current)==null?void 0:V.y)??0))}},oe=de=>{Q.x<=10&&Q.y<=10?de.preventDefault():w.contains(de.target)||F(!1),document.removeEventListener("pointermove",W),J.current=null};return J.current!==null&&(document.addEventListener("pointermove",W),document.addEventListener("pointerup",oe,{capture:!0,once:!0})),()=>{document.removeEventListener("pointermove",W),document.removeEventListener("pointerup",oe,{capture:!0})}}},[w,F,J]),x.useEffect(()=>{const Q=()=>F(!1);return window.addEventListener("blur",Q),window.addEventListener("resize",Q),()=>{window.removeEventListener("blur",Q),window.removeEventListener("resize",Q)}},[F]);const[N,q]=hO(Q=>{const W=O().filter(L=>!L.disabled),oe=W.find(L=>L.ref.current===document.activeElement),de=mO(W,Q,oe);de&&setTimeout(()=>de.ref.current.focus())}),G=x.useCallback((Q,W,oe)=>{const de=!A.current&&!oe;(v.value!==void 0&&v.value===W||de)&&(R(Q),de&&(A.current=!0))},[v.value]),_=x.useCallback(()=>w==null?void 0:w.focus(),[w]),k=x.useCallback((Q,W,oe)=>{const de=!A.current&&!oe;(v.value!==void 0&&v.value===W||de)&&j(Q)},[v.value]),M=r==="popper"?Xv:X$,I=M===Xv?{side:o,sideOffset:l,align:u,alignOffset:d,arrowPadding:f,collisionBoundary:m,collisionPadding:h,sticky:y,hideWhenDetached:p,avoidCollisions:b}:{};return c.jsx(Q$,{scope:n,content:w,viewport:E,onViewportChange:C,itemRefCallback:G,selectedItem:P,onItemLeave:_,itemTextRefCallback:k,focusSelectedItem:Z,selectedItemText:$,position:r,isPositioned:z,searchRef:N,children:c.jsx(op,{as:nZ,allowPinchZoom:!0,children:c.jsx(ip,{asChild:!0,trapped:v.open,onMountAutoFocus:Q=>{Q.preventDefault()},onUnmountAutoFocus:xe(a,Q=>{var W;(W=v.trigger)==null||W.focus({preventScroll:!0}),Q.preventDefault()}),children:c.jsx(pc,{asChild:!0,disableOutsidePointerEvents:!0,onEscapeKeyDown:i,onPointerDownOutside:s,onFocusOutside:Q=>Q.preventDefault(),onDismiss:()=>v.onOpenChange(!1),children:c.jsx(M,{role:"listbox",id:v.contentId,"data-state":v.open?"open":"closed",dir:v.dir,onContextMenu:Q=>Q.preventDefault(),...g,...I,onPlaced:()=>D(!0),ref:T,style:{display:"flex",flexDirection:"column",outline:"none",...g.style},onKeyDown:xe(g.onKeyDown,Q=>{const W=Q.ctrlKey||Q.altKey||Q.metaKey;if(Q.key==="Tab"&&Q.preventDefault(),!W&&Q.key.length===1&&q(Q.key),["ArrowUp","ArrowDown","Home","End"].includes(Q.key)){let de=O().filter(L=>!L.disabled).map(L=>L.ref.current);if(["ArrowUp","End"].includes(Q.key)&&(de=de.slice().reverse()),["ArrowUp","ArrowDown"].includes(Q.key)){const L=Q.target,V=de.indexOf(L);de=de.slice(V+1)}setTimeout(()=>B(de)),Q.preventDefault()}})})})})})})});Y$.displayName=tZ;var rZ="SelectItemAlignedPosition",X$=x.forwardRef((e,t)=>{const{__scopeSelect:n,onPlaced:r,...a}=e,i=ws(vo,n),s=Ss(vo,n),[o,l]=x.useState(null),[u,d]=x.useState(null),f=lt(t,T=>d(T)),m=bp(n),h=x.useRef(!1),y=x.useRef(!0),{viewport:p,selectedItem:b,selectedItemText:g,focusSelectedItem:v}=s,w=x.useCallback(()=>{if(i.trigger&&i.valueNode&&o&&u&&p&&b&&g){const T=i.trigger.getBoundingClientRect(),P=u.getBoundingClientRect(),R=i.valueNode.getBoundingClientRect(),$=g.getBoundingClientRect();if(i.dir!=="rtl"){const L=$.left-P.left,V=R.left-L,X=T.left-V,ne=T.width+X,K=Math.max(ne,P.width),re=window.innerWidth-Kr,ae=Qk(V,[Kr,Math.max(Kr,re-K)]);o.style.minWidth=ne+"px",o.style.left=ae+"px"}else{const L=P.right-$.right,V=window.innerWidth-R.right-L,X=window.innerWidth-T.right-V,ne=T.width+X,K=Math.max(ne,P.width),re=window.innerWidth-Kr,ae=Qk(V,[Kr,Math.max(Kr,re-K)]);o.style.minWidth=ne+"px",o.style.right=ae+"px"}const j=m(),O=window.innerHeight-Kr*2,z=p.scrollHeight,D=window.getComputedStyle(u),A=parseInt(D.borderTopWidth,10),B=parseInt(D.paddingTop,10),Z=parseInt(D.borderBottomWidth,10),F=parseInt(D.paddingBottom,10),J=A+B+z+F+Z,N=Math.min(b.offsetHeight*5,J),q=window.getComputedStyle(p),G=parseInt(q.paddingTop,10),_=parseInt(q.paddingBottom,10),k=T.top+T.height/2-Kr,M=O-k,I=b.offsetHeight/2,Q=b.offsetTop+I,W=A+B+Q,oe=J-W;if(W<=k){const L=j.length>0&&b===j[j.length-1].ref.current;o.style.bottom="0px";const V=u.clientHeight-p.offsetTop-p.offsetHeight,X=Math.max(M,I+(L?_:0)+V+Z),ne=W+X;o.style.height=ne+"px"}else{const L=j.length>0&&b===j[0].ref.current;o.style.top="0px";const X=Math.max(k,A+p.offsetTop+(L?G:0)+I)+oe;o.style.height=X+"px",p.scrollTop=W-k+p.offsetTop}o.style.margin=`${Kr}px 0`,o.style.minHeight=N+"px",o.style.maxHeight=O+"px",r==null||r(),requestAnimationFrame(()=>h.current=!0)}},[m,i.trigger,i.valueNode,o,u,p,b,g,i.dir,r]);Sn(()=>w(),[w]);const[S,E]=x.useState();Sn(()=>{u&&E(window.getComputedStyle(u).zIndex)},[u]);const C=x.useCallback(T=>{T&&y.current===!0&&(w(),v==null||v(),y.current=!1)},[w,v]);return c.jsx(iZ,{scope:n,contentWrapper:o,shouldExpandOnScrollRef:h,onScrollButtonChange:C,children:c.jsx("div",{ref:l,style:{display:"flex",flexDirection:"column",position:"fixed",zIndex:S},children:c.jsx(De.div,{...a,ref:f,style:{boxSizing:"border-box",maxHeight:"100%",...a.style}})})})});X$.displayName=rZ;var aZ="SelectPopperPosition",Xv=x.forwardRef((e,t)=>{const{__scopeSelect:n,align:r="start",collisionPadding:a=Kr,...i}=e,s=xp(n);return c.jsx(ix,{...s,...i,ref:t,align:r,collisionPadding:a,style:{boxSizing:"border-box",...i.style,"--radix-select-content-transform-origin":"var(--radix-popper-transform-origin)","--radix-select-content-available-width":"var(--radix-popper-available-width)","--radix-select-content-available-height":"var(--radix-popper-available-height)","--radix-select-trigger-width":"var(--radix-popper-anchor-width)","--radix-select-trigger-height":"var(--radix-popper-anchor-height)"}})});Xv.displayName=aZ;var[iZ,qx]=Sc(vo,{}),Wv="SelectViewport",W$=x.forwardRef((e,t)=>{const{__scopeSelect:n,nonce:r,...a}=e,i=Ss(Wv,n),s=qx(Wv,n),o=lt(t,i.onViewportChange),l=x.useRef(0);return c.jsxs(c.Fragment,{children:[c.jsx("style",{dangerouslySetInnerHTML:{__html:"[data-radix-select-viewport]{scrollbar-width:none;-ms-overflow-style:none;-webkit-overflow-scrolling:touch;}[data-radix-select-viewport]::-webkit-scrollbar{display:none}"},nonce:r}),c.jsx(vp.Slot,{scope:n,children:c.jsx(De.div,{"data-radix-select-viewport":"",role:"presentation",...a,ref:o,style:{position:"relative",flex:1,overflow:"hidden auto",...a.style},onScroll:xe(a.onScroll,u=>{const d=u.currentTarget,{contentWrapper:f,shouldExpandOnScrollRef:m}=s;if(m!=null&&m.current&&f){const h=Math.abs(l.current-d.scrollTop);if(h>0){const y=window.innerHeight-Kr*2,p=parseFloat(f.style.minHeight),b=parseFloat(f.style.height),g=Math.max(p,b);if(g<y){const v=g+h,w=Math.min(y,v),S=v-w;f.style.height=w+"px",f.style.bottom==="0px"&&(d.scrollTop=S>0?S:0,f.style.justifyContent="flex-end")}}}l.current=d.scrollTop})})})]})});W$.displayName=Wv;var J$="SelectGroup",[sZ,oZ]=Sc(J$),lZ=x.forwardRef((e,t)=>{const{__scopeSelect:n,...r}=e,a=ti();return c.jsx(sZ,{scope:n,id:a,children:c.jsx(De.div,{role:"group","aria-labelledby":a,...r,ref:t})})});lZ.displayName=J$;var eO="SelectLabel",tO=x.forwardRef((e,t)=>{const{__scopeSelect:n,...r}=e,a=oZ(eO,n);return c.jsx(De.div,{id:a.id,...r,ref:t})});tO.displayName=eO;var om="SelectItem",[cZ,nO]=Sc(om),rO=x.forwardRef((e,t)=>{const{__scopeSelect:n,value:r,disabled:a=!1,textValue:i,...s}=e,o=ws(om,n),l=Ss(om,n),u=o.value===r,[d,f]=x.useState(i??""),[m,h]=x.useState(!1),y=lt(t,v=>{var w;return(w=l.itemRefCallback)==null?void 0:w.call(l,v,r,a)}),p=ti(),b=x.useRef("touch"),g=()=>{a||(o.onValueChange(r),o.onOpenChange(!1))};if(r==="")throw new Error("A <Select.Item /> must have a value prop that is not an empty string. This is because the Select value can be set to an empty string to clear the selection and show the placeholder.");return c.jsx(cZ,{scope:n,value:r,disabled:a,textId:p,isSelected:u,onItemTextChange:x.useCallback(v=>{f(w=>w||((v==null?void 0:v.textContent)??"").trim())},[]),children:c.jsx(vp.ItemSlot,{scope:n,value:r,disabled:a,textValue:d,children:c.jsx(De.div,{role:"option","aria-labelledby":p,"data-highlighted":m?"":void 0,"aria-selected":u&&m,"data-state":u?"checked":"unchecked","aria-disabled":a||void 0,"data-disabled":a?"":void 0,tabIndex:a?void 0:-1,...s,ref:y,onFocus:xe(s.onFocus,()=>h(!0)),onBlur:xe(s.onBlur,()=>h(!1)),onClick:xe(s.onClick,()=>{b.current!=="mouse"&&g()}),onPointerUp:xe(s.onPointerUp,()=>{b.current==="mouse"&&g()}),onPointerDown:xe(s.onPointerDown,v=>{b.current=v.pointerType}),onPointerMove:xe(s.onPointerMove,v=>{var w;b.current=v.pointerType,a?(w=l.onItemLeave)==null||w.call(l):b.current==="mouse"&&v.currentTarget.focus({preventScroll:!0})}),onPointerLeave:xe(s.onPointerLeave,v=>{var w;v.currentTarget===document.activeElement&&((w=l.onItemLeave)==null||w.call(l))}),onKeyDown:xe(s.onKeyDown,v=>{var S;((S=l.searchRef)==null?void 0:S.current)!==""&&v.key===" "||(GK.includes(v.key)&&g(),v.key===" "&&v.preventDefault())})})})})});rO.displayName=om;var Xc="SelectItemText",aO=x.forwardRef((e,t)=>{const{__scopeSelect:n,className:r,style:a,...i}=e,s=ws(Xc,n),o=Ss(Xc,n),l=nO(Xc,n),u=WK(Xc,n),[d,f]=x.useState(null),m=lt(t,g=>f(g),l.onItemTextChange,g=>{var v;return(v=o.itemTextRefCallback)==null?void 0:v.call(o,g,l.value,l.disabled)}),h=d==null?void 0:d.textContent,y=x.useMemo(()=>c.jsx("option",{value:l.value,disabled:l.disabled,children:h},l.value),[l.disabled,l.value,h]),{onNativeOptionAdd:p,onNativeOptionRemove:b}=u;return Sn(()=>(p(y),()=>b(y)),[p,b,y]),c.jsxs(c.Fragment,{children:[c.jsx(De.span,{id:l.textId,...i,ref:m}),l.isSelected&&s.valueNode&&!s.valueNodeHasChildren?So.createPortal(i.children,s.valueNode):null]})});aO.displayName=Xc;var iO="SelectItemIndicator",sO=x.forwardRef((e,t)=>{const{__scopeSelect:n,...r}=e;return nO(iO,n).isSelected?c.jsx(De.span,{"aria-hidden":!0,...r,ref:t}):null});sO.displayName=iO;var Jv="SelectScrollUpButton",oO=x.forwardRef((e,t)=>{const n=Ss(Jv,e.__scopeSelect),r=qx(Jv,e.__scopeSelect),[a,i]=x.useState(!1),s=lt(t,r.onScrollButtonChange);return Sn(()=>{if(n.viewport&&n.isPositioned){let o=function(){const u=l.scrollTop>0;i(u)};const l=n.viewport;return o(),l.addEventListener("scroll",o),()=>l.removeEventListener("scroll",o)}},[n.viewport,n.isPositioned]),a?c.jsx(cO,{...e,ref:s,onAutoScroll:()=>{const{viewport:o,selectedItem:l}=n;o&&l&&(o.scrollTop=o.scrollTop-l.offsetHeight)}}):null});oO.displayName=Jv;var e0="SelectScrollDownButton",lO=x.forwardRef((e,t)=>{const n=Ss(e0,e.__scopeSelect),r=qx(e0,e.__scopeSelect),[a,i]=x.useState(!1),s=lt(t,r.onScrollButtonChange);return Sn(()=>{if(n.viewport&&n.isPositioned){let o=function(){const u=l.scrollHeight-l.clientHeight,d=Math.ceil(l.scrollTop)<u;i(d)};const l=n.viewport;return o(),l.addEventListener("scroll",o),()=>l.removeEventListener("scroll",o)}},[n.viewport,n.isPositioned]),a?c.jsx(cO,{...e,ref:s,onAutoScroll:()=>{const{viewport:o,selectedItem:l}=n;o&&l&&(o.scrollTop=o.scrollTop+l.offsetHeight)}}):null});lO.displayName=e0;var cO=x.forwardRef((e,t)=>{const{__scopeSelect:n,onAutoScroll:r,...a}=e,i=Ss("SelectScrollButton",n),s=x.useRef(null),o=bp(n),l=x.useCallback(()=>{s.current!==null&&(window.clearInterval(s.current),s.current=null)},[]);return x.useEffect(()=>()=>l(),[l]),Sn(()=>{var d;const u=o().find(f=>f.ref.current===document.activeElement);(d=u==null?void 0:u.ref.current)==null||d.scrollIntoView({block:"nearest"})},[o]),c.jsx(De.div,{"aria-hidden":!0,...a,ref:t,style:{flexShrink:0,...a.style},onPointerDown:xe(a.onPointerDown,()=>{s.current===null&&(s.current=window.setInterval(r,50))}),onPointerMove:xe(a.onPointerMove,()=>{var u;(u=i.onItemLeave)==null||u.call(i),s.current===null&&(s.current=window.setInterval(r,50))}),onPointerLeave:xe(a.onPointerLeave,()=>{l()})})}),uZ="SelectSeparator",uO=x.forwardRef((e,t)=>{const{__scopeSelect:n,...r}=e;return c.jsx(De.div,{"aria-hidden":!0,...r,ref:t})});uO.displayName=uZ;var t0="SelectArrow",dZ=x.forwardRef((e,t)=>{const{__scopeSelect:n,...r}=e,a=xp(n),i=ws(t0,n),s=Ss(t0,n);return i.open&&s.position==="popper"?c.jsx(sx,{...a,...r,ref:t}):null});dZ.displayName=t0;var fZ="SelectBubbleInput",dO=x.forwardRef(({__scopeSelect:e,value:t,...n},r)=>{const a=x.useRef(null),i=lt(r,a),s=KK(t);return x.useEffect(()=>{const o=a.current;if(!o)return;const l=window.HTMLSelectElement.prototype,d=Object.getOwnPropertyDescriptor(l,"value").set;if(s!==t&&d){const f=new Event("change",{bubbles:!0});d.call(o,t),o.dispatchEvent(f)}},[s,t]),c.jsx(De.select,{...n,style:{...F2,...n.style},ref:i,defaultValue:t})});dO.displayName=fZ;function fO(e){return e===""||e===void 0}function hO(e){const t=Lr(e),n=x.useRef(""),r=x.useRef(0),a=x.useCallback(s=>{const o=n.current+s;t(o),function l(u){n.current=u,window.clearTimeout(r.current),u!==""&&(r.current=window.setTimeout(()=>l(""),1e3))}(o)},[t]),i=x.useCallback(()=>{n.current="",window.clearTimeout(r.current)},[]);return x.useEffect(()=>()=>window.clearTimeout(r.current),[]),[n,a,i]}function mO(e,t,n){const a=t.length>1&&Array.from(t).every(u=>u===t[0])?t[0]:t,i=n?e.indexOf(n):-1;let s=hZ(e,Math.max(i,0));a.length===1&&(s=s.filter(u=>u!==n));const l=s.find(u=>u.textValue.toLowerCase().startsWith(a.toLowerCase()));return l!==n?l:void 0}function hZ(e,t){return e.map((n,r)=>e[(t+r)%e.length])}var mZ=F$,pO=H$,pZ=V$,gZ=K$,yZ=Z$,gO=G$,vZ=W$,yO=tO,vO=rO,bZ=aO,xZ=sO,bO=oO,xO=lO,wO=uO;const wZ=mZ,SZ=pZ,SO=x.forwardRef(({className:e,children:t,...n},r)=>c.jsxs(pO,{ref:r,className:Te("flex h-10 w-full items-center justify-between rounded-md border border-input bg-background px-3 py-2 text-sm ring-offset-background data-[placeholder]:text-muted-foreground focus:outline-none focus:ring-2 focus:ring-ring focus:ring-offset-2 disabled:cursor-not-allowed disabled:opacity-50 [&>span]:line-clamp-1",e),...n,children:[t,c.jsx(gZ,{asChild:!0,children:c.jsx(Xm,{className:"h-4 w-4 opacity-50"})})]}));SO.displayName=pO.displayName;const _O=x.forwardRef(({className:e,...t},n)=>c.jsx(bO,{ref:n,className:Te("flex cursor-default items-center justify-center py-1",e),...t,children:c.jsx(BI,{className:"h-4 w-4"})}));_O.displayName=bO.displayName;const kO=x.forwardRef(({className:e,...t},n)=>c.jsx(xO,{ref:n,className:Te("flex cursor-default items-center justify-center py-1",e),...t,children:c.jsx(Xm,{className:"h-4 w-4"})}));kO.displayName=xO.displayName;const EO=x.forwardRef(({className:e,children:t,position:n="popper",...r},a)=>c.jsx(yZ,{children:c.jsxs(gO,{ref:a,className:Te("relative z-50 max-h-[--radix-select-content-available-height] min-w-[8rem] overflow-y-auto overflow-x-hidden rounded-md border bg-popover text-popover-foreground shadow-md data-[state=open]:animate-in data-[state=closed]:animate-out data-[state=closed]:fade-out-0 data-[state=open]:fade-in-0 data-[state=closed]:zoom-out-95 data-[state=open]:zoom-in-95 data-[side=bottom]:slide-in-from-top-2 data-[side=left]:slide-in-from-right-2 data-[side=right]:slide-in-from-left-2 data-[side=top]:slide-in-from-bottom-2 origin-[--radix-select-content-transform-origin]",n==="popper"&&"data-[side=bottom]:translate-y-1 data-[side=left]:-translate-x-1 data-[side=right]:translate-x-1 data-[side=top]:-translate-y-1",e),position:n,...r,children:[c.jsx(_O,{}),c.jsx(vZ,{className:Te("p-1",n==="popper"&&"h-[var(--radix-select-trigger-height)] w-full min-w-[var(--radix-select-trigger-width)]"),children:t}),c.jsx(kO,{})]})}));EO.displayName=gO.displayName;const _Z=x.forwardRef(({className:e,...t},n)=>c.jsx(yO,{ref:n,className:Te("py-1.5 pl-8 pr-2 text-sm font-semibold",e),...t}));_Z.displayName=yO.displayName;const Bo=x.forwardRef(({className:e,children:t,...n},r)=>c.jsxs(vO,{ref:r,className:Te("relative flex w-full cursor-default select-none items-center rounded-sm py-1.5 pl-8 pr-2 text-sm outline-none focus:bg-accent focus:text-accent-foreground data-[disabled]:pointer-events-none data-[disabled]:opacity-50",e),...n,children:[c.jsx("span",{className:"absolute left-2 flex h-3.5 w-3.5 items-center justify-center",children:c.jsx(xZ,{children:c.jsx(fT,{className:"h-4 w-4"})})}),c.jsx(bZ,{children:t})]}));Bo.displayName=vO.displayName;const kZ=x.forwardRef(({className:e,...t},n)=>c.jsx(wO,{ref:n,className:Te("-mx-1 my-1 h-px bg-muted",e),...t}));kZ.displayName=wO.displayName;const EZ="/assets/AgentDeckLogo3-X5qCXS2A.png";function CZ(){const[e,t]=x.useState(""),[n,r]=x.useState(""),[a,i]=x.useState(!1),[s,o]=x.useState(!1),[l,u]=x.useState(null),[d,f]=x.useState(!1),[m,h]=x.useState(!1),[y,p]=x.useState(null),[b,g]=x.useState(!1),[v,w]=x.useState(!1),[S,E]=x.useState(null),[C,T]=x.useState(!1),[P,R]=x.useState(!1),[$,j]=x.useState(!1),[O,z]=x.useState(null),{toast:D}=nn(),{data:A=[]}=wt({queryKey:["/api/playbook-patches","proposed"],queryFn:()=>Iv("proposed")}),{data:B=0}=wt({queryKey:["/api/feedback-signals/count","available"],queryFn:()=>_R()}),Z=async()=>{j(!0);try{const fe=await wR({scope:"collection"});SR(fe,"backup.agent-deck.json"),D({title:"Exported collection",description:`${fe.services.length} services, ${fe.playbooks.length} playbooks, ${fe.decks.length} decks`})}catch(fe){D({title:"Export failed",description:fe instanceof Error?fe.message:"Unknown error",variant:"destructive"})}finally{j(!1)}},{connectionStatus:F}=HK(),{data:J,isLoading:N,error:q}=wt({queryKey:["/api/decks"]}),G=(J==null?void 0:J.data)||[],{editingDeck:_,editingDeckId:k,setEditingDeckId:M}=VK(G),{handleDragStart:I,handleCredentialDragStart:Q,handlePlaybookDragStart:W,handleDragEnd:oe,handleDrop:de,handleGlobalDrop:L,isDraggingFromDeck:V}=BK(k),{data:X,isLoading:ne,error:K}=wt({queryKey:["/api/services"]}),{data:re,isLoading:ae}=wt({queryKey:["/api/credentials/vault"]}),{data:Ae,isLoading:ce}=wt({queryKey:["/api/playbooks/vault"]}),{data:we}=wt({queryKey:["/api/collection/warnings"],staleTime:6e4}),Ce=(X==null?void 0:X.data)||[],ht=(re==null?void 0:re.data)||[],Ut=(Ae==null?void 0:Ae.data)||[],gt=x.useMemo(()=>kU(we==null?void 0:we.data),[we==null?void 0:we.data]),ar=(fe,rn)=>a?fe==="service"?gt.serviceWarnings.has(rn):fe==="credential"?gt.credentialWarnings.has(rn):gt.playbookWarnings.has(rn):!0,Y=Ce.filter(fe=>{var ks;if(!ar("service",fe.id)||n==="api-key"||n==="playbook")return!1;const rn=fe.name.toLowerCase().includes(e.toLowerCase())||((ks=fe.description)==null?void 0:ks.toLowerCase().includes(e.toLowerCase())),_s=!n||n==="all"||fe.type===n;return rn&&_s}),se=ht.filter(fe=>!ar("credential",fe.id)||n&&n!=="all"&&n!=="api-key"?!1:fe.label.toLowerCase().includes(e.toLowerCase())),Se=Ut.filter(fe=>!ar("playbook",fe.id)||n&&n!=="all"&&n!=="playbook"?!1:fe.title.toLowerCase().includes(e.toLowerCase())||fe.body.toLowerCase().includes(e.toLowerCase())),je=Y.length+se.length+Se.length;K&&console.error("Services error:",K),q&&console.error("Decks error:",q);const Xe=()=>{t(""),r(""),i(!1)},dn=!!(e||n||a),Sr=new Set(((_==null?void 0:_.credentials)??[]).map(fe=>fe.id)),Un=new Set(((_==null?void 0:_.playbooks)??[]).map(fe=>fe.id)),ia=(_==null?void 0:_.services)||[],sa=(_==null?void 0:_.playbooks)||[],Qt=fe=>{u(fe),f(!0)},_r=fe=>{E(fe.id),T(!0)},An=fe=>{p(fe.id),g(!0)},ja=fe=>{z(fe)};if(K||q){const fe=(q instanceof Error?q.message:null)??(K instanceof Error?K.message:null)??"There was an error loading the application data.";return c.jsx("div",{className:"min-h-screen flex items-center justify-center bg-gray-900",children:c.jsxs("div",{className:"text-center max-w-lg px-4",children:[c.jsx("h2",{className:"text-2xl font-bold text-red-400 mb-4",children:"Error Loading Data"}),c.jsx("p",{className:"text-gray-300 mb-2",children:"There was an error loading the application data."}),c.jsx("p",{className:"text-gray-400 text-sm mb-4",children:fe}),c.jsxs("p",{className:"text-gray-500 text-xs mb-6",children:["Is the API running? Try ",c.jsx("code",{className:"text-gray-300",children:"agent-deck stop && agent-deck start"})]}),c.jsx("button",{onClick:()=>window.location.reload(),className:"px-4 py-2 bg-blue-600 text-white rounded hover:bg-blue-700",children:"Reload Page"})]})})}return ne||N||ae||ce?c.jsx("div",{className:"min-h-screen flex items-center justify-center bg-gray-900",children:c.jsxs("div",{className:"text-center",children:[c.jsx("div",{className:"animate-spin rounded-full h-12 w-12 border-b-2 border-yellow-400 mx-auto mb-4"}),c.jsx("p",{className:"text-gray-300",children:"Loading AgentDeck..."})]})}):c.jsxs("div",{className:"flex min-h-dvh flex-col overflow-x-hidden",onDrop:L,onDragOver:fe=>fe.preventDefault(),style:{position:"relative",...V&&{background:"linear-gradient(to bottom right, #1a1a2e, #16213e, #0f3460)"}},children:[c.jsx("header",{className:"relative z-20 shrink-0 bg-black/30 backdrop-blur-md border-b border-white/10",children:c.jsx("div",{className:"container mx-auto px-4 py-3 sm:py-4",children:c.jsxs("div",{className:"flex flex-wrap items-center justify-between gap-3",children:[c.jsxs("div",{className:"flex min-w-0 items-center gap-3 sm:gap-4",children:[c.jsx("img",{src:EZ,alt:"Agent Deck Logo",className:"h-12 w-12 shrink-0 object-contain sm:h-16 sm:w-16"}),c.jsxs("div",{className:"min-w-0",children:[c.jsx("h1",{className:"text-xl font-bold bg-gradient-to-r from-yellow-400 to-yellow-600 bg-clip-text text-transparent sm:text-2xl",style:{background:"linear-gradient(to right, #C4B643, #D4C760)",WebkitBackgroundClip:"text",WebkitTextFillColor:"transparent",backgroundClip:"text"},children:"AgentDeck"}),c.jsx("p",{className:"text-xs sm:text-sm",style:{color:"#92E4DD"},children:"Build tool deck for your agent"})]})]}),c.jsxs("div",{className:"flex flex-wrap items-center gap-3 sm:gap-6",children:[c.jsxs("div",{className:`flex items-center space-x-2 px-3 py-1 rounded-full border ${F==="connected"?"bg-emerald-500/20 border-emerald-500/30":"bg-red-500/20 border-red-500/30"}`,children:[c.jsx("div",{className:`w-2 h-2 rounded-full animate-pulse ${F==="connected"?"bg-emerald-400":"bg-red-400"}`}),c.jsx("button",{className:`text-sm hover:underline cursor-pointer ${F==="connected"?"text-emerald-300":"text-red-300"}`,"data-testid":"button-copy-mcp-url",onClick:()=>{navigator.clipboard.writeText("http://localhost:3001/mcp").then(()=>{D({title:"MCP URL copied!",description:"The MCP server URL has been copied to your clipboard."})})},title:"Click to copy MCP URL",children:"Get MCP URL"})]}),c.jsx(o9,{highlightDeckId:k??void 0}),c.jsx(Yl,{href:"/feedback-signals",children:c.jsxs(le,{variant:"outline",size:"sm",className:"relative border-white/20 bg-white/5 text-[#E8F6F4]",children:["Feedback",B>0&&c.jsx("span",{className:"ml-2 rounded-full px-2 py-0.5 text-xs font-semibold",style:{background:"#C4B643",color:"#0A0A07"},title:"Open feedback available for curation",children:B})]})}),c.jsx(Yl,{href:"/playbook-patches",children:c.jsxs(le,{variant:"outline",size:"sm",className:"relative border-white/20 bg-white/5 text-[#E8F6F4]",children:[c.jsx(ZI,{className:"mr-2 h-4 w-4"}),"Review",A.length>0&&c.jsx("span",{className:"ml-2 rounded-full px-2 py-0.5 text-xs font-semibold",style:{background:"#C4B643",color:"#0A0A07"},title:"Proposed playbook patches",children:A.length})]})})]})]})})}),V&&c.jsx("div",{className:"fixed inset-0 pointer-events-none z-50 flex items-center justify-center",children:c.jsxs("div",{className:"bg-red-500/20 border-2 border-dashed border-red-500/50 rounded-lg p-8 text-center",children:[c.jsx("div",{className:"text-red-400 text-lg font-bold mb-2",children:"Drop to Remove"}),c.jsx("div",{className:"text-red-300 text-sm",children:"Release to remove card from deck"})]})}),c.jsx("main",{className:"container mx-auto flex min-h-0 flex-1 flex-col px-4 py-4 sm:py-6",children:c.jsxs("div",{className:"grid min-w-0 grid-cols-1 gap-4 sm:gap-6 xl:min-h-0 xl:flex-1 xl:grid-cols-4 xl:overflow-hidden",children:[c.jsxs("div",{className:"min-w-0 space-y-4 sm:space-y-6 xl:col-span-1 xl:min-h-0 xl:overflow-y-auto",children:[c.jsx("div",{className:"panel-surface h-64 overflow-hidden p-4 min-w-0 sm:h-72 xl:h-80",children:c.jsx(Z9,{decks:G,editingDeckId:k,onSelectDeck:M,isLoading:N})}),c.jsxs("div",{className:"panel-surface p-4",children:[c.jsxs("h2",{className:"text-lg font-bold mb-3 flex items-center",children:[c.jsx(dT,{className:"w-4 h-4 mr-2",style:{color:"#92E4DD"}}),c.jsx("span",{style:{color:"#92E4DD"},children:"Add Cards"})]}),c.jsxs("div",{className:"space-y-2",children:[c.jsxs(le,{variant:"ghost",className:`w-full border-2 text-sm py-2 hover:opacity-90 ${ha}`,style:ma(Pn),onClick:()=>o(!0),"data-testid":"button-register-mcp",children:[c.jsx(Kh,{className:"w-3 h-3 mr-2"}),"Register MCP"]}),c.jsxs(le,{variant:"ghost",className:`w-full border-2 text-sm py-2 hover:opacity-90 ${ha}`,style:ma(Qn),onClick:()=>h(!0),"data-testid":"button-register-api-key",children:[c.jsx(Nv,{className:"w-3 h-3 mr-2"}),"Register API key"]}),c.jsxs(le,{variant:"ghost",className:`w-full border-2 text-sm py-2 hover:opacity-90 ${ha}`,style:ma(Gr),onClick:()=>w(!0),"data-testid":"button-register-playbook",children:[c.jsx(Zb,{className:"w-3 h-3 mr-2"}),"Register Playbook"]})]})]})]}),c.jsxs("div",{className:"flex min-w-0 flex-col gap-4 sm:gap-6 xl:col-span-3 xl:h-full xl:min-h-0",children:[c.jsx("div",{className:"panel-surface h-64 shrink-0 overflow-hidden p-4 min-w-0 sm:h-72 xl:h-80",children:_?c.jsx("div",{className:"h-full",children:c.jsx(HU,{deck:_,services:ia,credentials:_.credentials??[],playbooks:sa,allServices:Ce,collectionWarnings:gt,onDrop:de,onDragStart:I,onCredentialDragStart:Q,onPlaybookDragStart:W,onDragEnd:oe,onCardClick:Qt,onPlaybookClick:_r,onCredentialClick:An})}):c.jsxs("div",{className:"text-center h-full flex flex-col justify-center",children:[c.jsx("div",{className:"w-12 h-12 rounded-full bg-yellow-500/20 border border-yellow-500/30 flex items-center justify-center mx-auto mb-3",children:c.jsx(Vh,{className:"w-6 h-6 text-yellow-400"})}),c.jsx("h3",{className:"text-lg font-bold mb-2",style:{color:"#92E4DD"},children:"No deck selected"}),c.jsx("p",{className:"text-gray-300 mb-4 text-sm",children:"Create a deck or select one from the sidebar to edit its cards."}),c.jsxs("div",{className:"flex flex-col gap-2",children:[c.jsxs(le,{onClick:()=>{const fe=document.querySelector('[data-testid="create-deck-button"]');fe&&fe.click()},className:"border text-sm py-2",style:{background:"#C4B643",borderColor:"#C4B643",color:"black"},children:[c.jsx(qs,{className:"w-4 h-4 mr-2"}),"Create New Deck"]}),c.jsxs(le,{variant:"outline",className:"border-white/20 text-white hover:bg-white/10 text-sm py-2",onClick:()=>{const fe=document.querySelector('[data-testid="deck-management-panel"]');fe&&fe.scrollIntoView({behavior:"smooth"})},children:[c.jsx(Vh,{className:"w-4 h-4 mr-2"}),"Manage Decks"]})]})]})}),c.jsxs("div",{className:"panel-surface flex min-h-[20rem] flex-col overflow-hidden p-4 min-w-0 sm:min-h-[24rem] xl:min-h-0 xl:flex-1","data-testid":"collection-panel",children:[c.jsxs("div",{className:"mb-3 flex shrink-0 flex-wrap items-center justify-between gap-2",children:[c.jsxs("h2",{className:"text-lg font-bold flex items-center",children:[c.jsx(GI,{className:"w-4 h-4 mr-2",style:{color:"#92E4DD"}}),c.jsx("span",{style:{color:"#92E4DD"},children:"My Collection"}),c.jsxs("span",{className:"ml-3 text-sm font-normal text-gray-400",children:["(",je," cards)"]})]}),c.jsxs("div",{className:"flex flex-wrap items-center gap-2",children:[c.jsxs(le,{size:"sm",variant:"outline",className:"h-8 px-2 text-xs border-white/20 text-white hover:bg-white/10",onClick:Z,disabled:$,title:"Export all MCP, playbooks, and decks","data-testid":"button-export-all",children:[c.jsx(gT,{className:"w-3 h-3 mr-1"}),$?"Exporting…":"Export all"]}),c.jsxs(le,{size:"sm",variant:"outline",className:"h-8 px-2 text-xs border-white/20 text-white hover:bg-white/10",onClick:()=>R(!0),title:"Import a bundle file","data-testid":"button-import-bundle",children:[c.jsx(JI,{className:"w-3 h-3 mr-1"}),"Import"]}),c.jsxs("div",{className:"relative",children:[c.jsx(yT,{className:"absolute left-2 top-1/2 transform -translate-y-1/2 text-gray-400 w-4 h-4"}),c.jsx(at,{placeholder:"Search...",value:e,onChange:fe=>t(fe.target.value),className:"h-8 w-36 pl-8 text-sm bg-white/10 border-white/20 text-white placeholder-gray-400 sm:w-48","data-testid":"input-search"})]}),c.jsxs(wZ,{value:n||"all",onValueChange:fe=>r(fe==="all"?"":fe),children:[c.jsxs(SO,{className:"w-[7.5rem] h-8 bg-white/10 border-white/20 text-white text-xs shrink-0","data-testid":"select-type",children:[c.jsx(KI,{className:"w-3 h-3 mr-1 shrink-0"}),c.jsx(SZ,{placeholder:"Type"})]}),c.jsxs(EO,{children:[c.jsx(Bo,{value:"all",children:"All"}),c.jsx(Bo,{value:"mcp",children:"MCP"}),c.jsx(Bo,{value:"local-mcp",children:"Local MCP"}),c.jsx(Bo,{value:"api-key",children:"API Key"}),c.jsx(Bo,{value:"playbook",children:"Playbook"})]})]}),(e||n||a)&&c.jsx(le,{size:"sm",variant:"outline",className:"h-8 px-2 text-xs border-white/20 text-white hover:bg-white/10",onClick:Xe,title:"Clear all filters",children:"Clear"})]})]}),gt.total>0&&c.jsx("button",{type:"button",onClick:()=>i(fe=>!fe),className:`mb-3 w-full shrink-0 rounded-lg border px-3 py-2 text-left text-sm transition-colors ${a?"border-amber-300/60 bg-amber-500/15 text-amber-100":"border-amber-400/30 bg-amber-500/10 text-amber-100 hover:bg-amber-500/15"}`,"data-testid":"button-collection-warnings",children:c.jsxs("span",{className:"flex items-start gap-2",children:[c.jsx(Rr,{className:"mt-0.5 h-4 w-4 shrink-0 text-amber-300"}),c.jsx("span",{children:a?c.jsxs(c.Fragment,{children:["Showing ",c.jsx("strong",{children:je})," card",je===1?"":"s"," needing attention.",c.jsx("span",{className:"text-amber-200/80",children:" Click to show all cards."})]}):c.jsxs(c.Fragment,{children:[c.jsx("strong",{children:gt.total})," card",gt.total===1?"":"s"," need attention",gt.byKind.oauth_expired+gt.byKind.oauth_required>0&&c.jsxs(c.Fragment,{children:[" ","(",gt.byKind.oauth_expired+gt.byKind.oauth_required," ","OAuth)"]}),". ",c.jsx("span",{className:"text-amber-200/80",children:"Click to filter."})]})})]})}),c.jsx("div",{className:"min-h-0 flex-1 overflow-x-hidden overflow-y-auto px-1 py-2",children:ne||ae||ce?c.jsx("div",{className:"grid grid-cols-[repeat(auto-fill,5rem)] gap-y-2 pr-12",children:Array.from({length:10}).map((fe,rn)=>c.jsx("div",{className:"animate-pulse",children:c.jsx("div",{className:"bg-white/10 rounded-lg w-32 h-48 aspect-[2/3]"})},rn))}):je===0?c.jsxs("div",{className:"text-center py-12",children:[c.jsx("div",{className:"text-gray-400 mb-4",children:c.jsx("i",{className:"fas fa-layer-group text-4xl"})}),c.jsx("h3",{className:"text-lg font-semibold text-gray-300 mb-2",children:"No cards yet"}),c.jsx("p",{className:"text-gray-400 text-sm mb-4",children:dn?a?"No cards with warnings match your current filters":"Try adjusting your search or filters":"Register an MCP server, API key, or playbook to get started"}),!dn&&c.jsxs("div",{className:"flex gap-3 justify-center",children:[c.jsxs(le,{variant:"ghost",size:"sm",className:`border-2 hover:opacity-90 ${ha}`,style:ma(Pn),onClick:()=>o(!0),"data-testid":"button-register-mcp-empty",children:[c.jsx(Kh,{className:"w-3 h-3 mr-1"}),"Register MCP"]}),c.jsxs(le,{variant:"ghost",size:"sm",className:`border-2 hover:opacity-90 ${ha}`,style:ma(Qn),onClick:()=>h(!0),"data-testid":"button-register-api-key-empty",children:[c.jsx(Nv,{className:"w-3 h-3 mr-1"}),"Register API key"]})]})]}):c.jsxs("div",{className:"relative isolate grid grid-cols-[repeat(auto-fill,5rem)] gap-y-2 pr-12",style:{isolation:"isolate"},"data-testid":"collection-card-grid",children:[Se.map((fe,rn)=>c.jsx("div",{className:"relative group",style:{zIndex:O===fe.id?999999:je-rn},children:c.jsx(OU,{playbook:fe,isInActiveDeck:Un.has(fe.id),activeDeck:_??void 0,isInCollection:!0,onDragStart:W,onDragEnd:oe,onCardClick:_r,onMouseEnter:()=>ja(fe.id),onMouseLeave:()=>ja(null),warnings:gt.playbookWarnings.get(fe.id)})},fe.id)),se.map((fe,rn)=>c.jsx("div",{className:"relative group",style:{zIndex:O===fe.id?999999:je-Se.length-rn},children:c.jsx(RU,{credential:fe,isInActiveDeck:Sr.has(fe.id),activeDeck:_??void 0,isInCollection:!0,onDragStart:Q,onDragEnd:oe,onMouseEnter:()=>ja(fe.id),onMouseLeave:()=>ja(null),onCardClick:An,warnings:gt.credentialWarnings.get(fe.id)})},fe.id)),Y.map((fe,rn)=>{var _s;return c.jsx("div",{className:"relative group",style:{zIndex:O===fe.id?999999:je-Se.length-se.length-rn},children:c.jsx(jU,{service:fe,onDragStart:I,onDragEnd:oe,isInActiveDeck:((_s=_==null?void 0:_.services)==null?void 0:_s.some(ks=>ks.id===fe.id))||!1,onCardClick:Qt,isInCollection:!0,onMouseEnter:()=>ja(fe.id),onMouseLeave:()=>ja(null),activeDeck:_??void 0,warnings:gt.serviceWarnings.get(fe.id)})},fe.id)})]})})]})]})]})}),c.jsxs("div",{className:"fixed inset-0 pointer-events-none z-0 overflow-hidden",children:[c.jsx("div",{className:"absolute top-20 left-20",children:c.jsx("div",{className:"h-96 w-96 rounded-full bg-cyan-500/10 blur-3xl animate-orb-drift-1"})}),c.jsx("div",{className:"absolute bottom-20 right-20",children:c.jsx("div",{className:"h-96 w-96 rounded-full bg-pink-500/10 blur-3xl animate-orb-drift-2"})}),c.jsx("div",{className:"absolute left-1/2 top-1/2 -translate-x-1/2 -translate-y-1/2",children:c.jsx("div",{className:"h-96 w-96 rounded-full bg-purple-500/5 blur-3xl animate-orb-drift-3"})})]}),c.jsx(B9,{type:"mcp",open:s,onOpenChange:o}),c.jsx(FK,{service:l,isOpen:d,onClose:()=>f(!1)}),c.jsx(G9,{open:m,onOpenChange:h}),c.jsx(sF,{credentialId:y,open:b,onOpenChange:g}),c.jsx(Q9,{open:v,onOpenChange:w}),c.jsx(iF,{playbookId:S,open:C,onOpenChange:T}),c.jsx(qK,{open:P,onOpenChange:R})]})}const Fa=x.forwardRef(({className:e,...t},n)=>c.jsx("div",{ref:n,className:Te("rounded-lg border bg-card text-card-foreground shadow-sm",e),...t}));Fa.displayName="Card";const ji=x.forwardRef(({className:e,...t},n)=>c.jsx("div",{ref:n,className:Te("flex flex-col space-y-1.5 p-6",e),...t}));ji.displayName="CardHeader";const Ti=x.forwardRef(({className:e,...t},n)=>c.jsx("div",{ref:n,className:Te("text-2xl font-semibold leading-none tracking-tight",e),...t}));Ti.displayName="CardTitle";const _u=x.forwardRef(({className:e,...t},n)=>c.jsx("div",{ref:n,className:Te("text-sm text-muted-foreground",e),...t}));_u.displayName="CardDescription";const qa=x.forwardRef(({className:e,...t},n)=>c.jsx("div",{ref:n,className:Te("p-6 pt-0",e),...t}));qa.displayName="CardContent";const NZ=x.forwardRef(({className:e,...t},n)=>c.jsx("div",{ref:n,className:Te("flex items-center p-6 pt-0",e),...t}));NZ.displayName="CardFooter";function jZ(){return c.jsx("div",{className:"min-h-screen w-full flex items-center justify-center bg-gray-50",children:c.jsx(Fa,{className:"w-full max-w-md mx-4",children:c.jsxs(qa,{className:"pt-6",children:[c.jsxs("div",{className:"flex mb-4 gap-2",children:[c.jsx(pT,{className:"h-8 w-8 text-red-500"}),c.jsx("h1",{className:"text-2xl font-bold text-gray-900",children:"404 Page Not Found"})]}),c.jsx("p",{className:"mt-4 text-sm text-gray-600",children:"Did you forget to add the page to the router?"})]})})})}function TZ(){const[e]=a3(),[t,n]=x.useState("loading"),[r,a]=x.useState("Authenticating...");return x.useEffect(()=>{(async()=>{try{const s=new URL(window.location.href),o=s.searchParams.get("success"),l=s.searchParams.get("error"),u=s.searchParams.get("serviceId");o==="true"?(n("success"),a("Authentication successful! This window will close automatically."),window.opener&&!window.opener.closed&&window.opener.postMessage({type:U$,serviceId:u??void 0},window.location.origin),setTimeout(()=>{window.close()},2e3)):o==="false"?(n("error"),a(`OAuth Error: ${l||"Authentication failed"}`)):(n("error"),a("Invalid OAuth callback - please try again"))}catch(s){n("error"),a(s instanceof Error?s.message:"Authentication failed")}})()},[e]),c.jsx("div",{className:"flex items-center justify-center min-h-screen bg-background",children:c.jsxs("div",{className:"text-center space-y-4",children:[t==="loading"&&c.jsx("div",{className:"animate-spin rounded-full h-8 w-8 border-b-2 border-primary mx-auto"}),t==="success"&&c.jsx("div",{className:"text-green-500 text-4xl",children:"✓"}),t==="error"&&c.jsx("div",{className:"text-red-500 text-4xl",children:"✗"}),c.jsx("h1",{className:"text-xl font-semibold",children:r}),t==="error"&&c.jsx("button",{onClick:()=>window.close(),className:"px-4 py-2 bg-primary text-primary-foreground rounded hover:bg-primary/90",children:"Close Window"})]})})}function ol(e){const t=()=>{throw new Error(`Invalid url to pass to open(): ${e}`)};let n;try{n=new URL(e)}catch{t()}return n.protocol!=="https:"&&n.protocol!=="http:"&&t(),n.hostname!==encodeURIComponent(n.hostname)&&t(),n.username&&(n.username=encodeURIComponent(n.username)),n.password&&(n.password=encodeURIComponent(n.password)),n.pathname=n.pathname.slice(0,1)+encodeURIComponent(n.pathname.slice(1)).replace(/%2f/ig,"/"),n.search=n.search.slice(0,1)+Array.from(n.searchParams.entries()).map(AZ).join("&"),n.hash=n.hash.slice(0,1)+encodeURIComponent(n.hash.slice(1)),n.href}function AZ([e,t]){return`${encodeURIComponent(e)}${t.length>0?`=${encodeURIComponent(t)}`:""}`}var Yk=class{constructor(e,t={}){Ta(this,"serverUrl");Ta(this,"storageKeyPrefix");Ta(this,"serverUrlHash");Ta(this,"clientName");Ta(this,"clientUri");Ta(this,"callbackUrl");Ta(this,"preventAutoAuth");Ta(this,"onPopupWindow");this.serverUrl=e,this.storageKeyPrefix=t.storageKeyPrefix||"mcp:auth",this.serverUrlHash=this.hashString(e),this.clientName=t.clientName||"MCP Browser Client",this.clientUri=t.clientUri||(typeof window<"u"?window.location.origin:""),this.callbackUrl=ol(t.callbackUrl||(typeof window<"u"?new URL("/oauth/callback",window.location.origin).toString():"/oauth/callback")),this.preventAutoAuth=t.preventAutoAuth,this.onPopupWindow=t.onPopupWindow}get redirectUrl(){return ol(this.callbackUrl)}get clientMetadata(){return{redirect_uris:[this.redirectUrl],token_endpoint_auth_method:"none",grant_types:["authorization_code","refresh_token"],response_types:["code"],client_name:this.clientName,client_uri:this.clientUri}}async clientInformation(){const e=this.getKey("client_info"),t=localStorage.getItem(e);if(t)try{return JSON.parse(t)}catch(n){console.warn(`[${this.storageKeyPrefix}] Failed to parse client information:`,n),localStorage.removeItem(e);return}}async saveClientInformation(e){const t=this.getKey("client_info");localStorage.setItem(t,JSON.stringify(e))}async tokens(){const e=this.getKey("tokens"),t=localStorage.getItem(e);if(t)try{return JSON.parse(t)}catch(n){console.warn(`[${this.storageKeyPrefix}] Failed to parse tokens:`,n),localStorage.removeItem(e);return}}async saveTokens(e){const t=this.getKey("tokens");localStorage.setItem(t,JSON.stringify(e)),localStorage.removeItem(this.getKey("code_verifier")),localStorage.removeItem(this.getKey("last_auth_url"))}async saveCodeVerifier(e){const t=this.getKey("code_verifier");localStorage.setItem(t,e)}async codeVerifier(){const e=this.getKey("code_verifier"),t=localStorage.getItem(e);if(!t)throw new Error(`[${this.storageKeyPrefix}] Code verifier not found in storage for key ${e}. Auth flow likely corrupted or timed out.`);return t}async prepareAuthorizationUrl(e){const t=crypto.randomUUID(),n=`${this.storageKeyPrefix}:state_${t}`,r={serverUrlHash:this.serverUrlHash,expiry:Date.now()+1e3*60*10,providerOptions:{serverUrl:this.serverUrl,storageKeyPrefix:this.storageKeyPrefix,clientName:this.clientName,clientUri:this.clientUri,callbackUrl:this.callbackUrl}};localStorage.setItem(n,JSON.stringify(r)),e.searchParams.set("state",t);const a=e.toString(),i=ol(a);return localStorage.setItem(this.getKey("last_auth_url"),i),i}async redirectToAuthorization(e){if(this.preventAutoAuth)return;const t=await this.prepareAuthorizationUrl(e),n="width=600,height=700,resizable=yes,scrollbars=yes,status=yes";try{const r=window.open(t,`mcp_auth_${this.serverUrlHash}`,n);this.onPopupWindow&&this.onPopupWindow(t,n,r),!r||r.closed||typeof r.closed>"u"?console.warn(`[${this.storageKeyPrefix}] Popup likely blocked by browser. Manual navigation might be required using the stored URL.`):(r.focus(),console.info(`[${this.storageKeyPrefix}] Redirecting to authorization URL in popup.`))}catch(r){console.error(`[${this.storageKeyPrefix}] Error opening popup window:`,r)}}getLastAttemptedAuthUrl(){const e=localStorage.getItem(this.getKey("last_auth_url"));return e?ol(e):null}clearStorage(){const e=`${this.storageKeyPrefix}_${this.serverUrlHash}_`,t=`${this.storageKeyPrefix}:state_`,n=[];let r=0;for(let i=0;i<localStorage.length;i++){const s=localStorage.key(i);if(s){if(s.startsWith(e))n.push(s);else if(s.startsWith(t))try{const o=localStorage.getItem(s);o&&JSON.parse(o).serverUrlHash===this.serverUrlHash&&n.push(s)}catch(o){console.warn(`[${this.storageKeyPrefix}] Error parsing state key ${s} during clearStorage:`,o)}}}return[...new Set(n)].forEach(i=>{localStorage.removeItem(i),r++}),r}hashString(e){let t=0;for(let n=0;n<e.length;n++){const r=e.charCodeAt(n);t=(t<<5)-t+r,t=t&t}return Math.abs(t).toString(16)}getKey(e){return`${this.storageKeyPrefix}_${this.serverUrlHash}_${e}`}};const RZ=Object.freeze({status:"aborted"});function ee(e,t,n){function r(o,l){var u;Object.defineProperty(o,"_zod",{value:o._zod??{},enumerable:!1}),(u=o._zod).traits??(u.traits=new Set),o._zod.traits.add(e),t(o,l);for(const d in s.prototype)d in o||Object.defineProperty(o,d,{value:s.prototype[d].bind(o)});o._zod.constr=s,o._zod.def=l}const a=(n==null?void 0:n.Parent)??Object;class i extends a{}Object.defineProperty(i,"name",{value:e});function s(o){var l;const u=n!=null&&n.Parent?new i:this;r(u,o),(l=u._zod).deferred??(l.deferred=[]);for(const d of u._zod.deferred)d();return u}return Object.defineProperty(s,"init",{value:r}),Object.defineProperty(s,Symbol.hasInstance,{value:o=>{var l,u;return n!=null&&n.Parent&&o instanceof n.Parent?!0:(u=(l=o==null?void 0:o._zod)==null?void 0:l.traits)==null?void 0:u.has(e)}}),Object.defineProperty(s,"name",{value:e}),s}class Xu extends Error{constructor(){super("Encountered Promise during synchronous parse. Use .parseAsync() instead.")}}const CO={};function ms(e){return CO}function $Z(e){const t=Object.values(e).filter(r=>typeof r=="number");return Object.entries(e).filter(([r,a])=>t.indexOf(+r)===-1).map(([r,a])=>a)}function OZ(e,t){return typeof t=="bigint"?t.toString():t}function Hx(e){return{get value(){{const t=e();return Object.defineProperty(this,"value",{value:t}),t}}}}function Bx(e){return e==null}function Vx(e){const t=e.startsWith("^")?1:0,n=e.endsWith("$")?e.length-1:e.length;return e.slice(t,n)}function MZ(e,t){const n=(e.toString().split(".")[1]||"").length,r=(t.toString().split(".")[1]||"").length,a=n>r?n:r,i=Number.parseInt(e.toFixed(a).replace(".","")),s=Number.parseInt(t.toFixed(a).replace(".",""));return i%s/10**a}function Ct(e,t,n){Object.defineProperty(e,t,{get(){{const r=n();return e[t]=r,r}},set(r){Object.defineProperty(e,t,{value:r})},configurable:!0})}function wp(e,t,n){Object.defineProperty(e,t,{value:n,writable:!0,enumerable:!0,configurable:!0})}function Uc(e){return JSON.stringify(e)}const NO=Error.captureStackTrace?Error.captureStackTrace:(...e)=>{};function lm(e){return typeof e=="object"&&e!==null&&!Array.isArray(e)}const PZ=Hx(()=>{var e;if(typeof navigator<"u"&&((e=navigator==null?void 0:navigator.userAgent)!=null&&e.includes("Cloudflare")))return!1;try{const t=Function;return new t(""),!0}catch{return!1}});function cm(e){if(lm(e)===!1)return!1;const t=e.constructor;if(t===void 0)return!0;const n=t.prototype;return!(lm(n)===!1||Object.prototype.hasOwnProperty.call(n,"isPrototypeOf")===!1)}const DZ=new Set(["string","number","symbol"]);function Td(e){return e.replace(/[.*+?^${}()|[\]\\]/g,"\\$&")}function Ao(e,t,n){const r=new e._zod.constr(t??e._zod.def);return(!t||n!=null&&n.parent)&&(r._zod.parent=e),r}function ye(e){const t=e;if(!t)return{};if(typeof t=="string")return{error:()=>t};if((t==null?void 0:t.message)!==void 0){if((t==null?void 0:t.error)!==void 0)throw new 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 zZ(e){return Object.keys(e).filter(t=>e[t]._zod.optin==="optional"&&e[t]._zod.optout==="optional")}const IZ={safeint:[Number.MIN_SAFE_INTEGER,Number.MAX_SAFE_INTEGER],int32:[-2147483648,2147483647],uint32:[0,4294967295],float32:[-34028234663852886e22,34028234663852886e22],float64:[-Number.MAX_VALUE,Number.MAX_VALUE]};function LZ(e,t){const n={},r=e._zod.def;for(const a in t){if(!(a in r.shape))throw new Error(`Unrecognized key: "${a}"`);t[a]&&(n[a]=r.shape[a])}return Ao(e,{...e._zod.def,shape:n,checks:[]})}function UZ(e,t){const n={...e._zod.def.shape},r=e._zod.def;for(const a in t){if(!(a in r.shape))throw new Error(`Unrecognized key: "${a}"`);t[a]&&delete n[a]}return Ao(e,{...e._zod.def,shape:n,checks:[]})}function FZ(e,t){if(!cm(t))throw new Error("Invalid input to extend: expected a plain object");const n={...e._zod.def,get shape(){const r={...e._zod.def.shape,...t};return wp(this,"shape",r),r},checks:[]};return Ao(e,n)}function qZ(e,t){return Ao(e,{...e._zod.def,get shape(){const n={...e._zod.def.shape,...t._zod.def.shape};return wp(this,"shape",n),n},catchall:t._zod.def.catchall,checks:[]})}function HZ(e,t,n){const r=t._zod.def.shape,a={...r};if(n)for(const i in n){if(!(i in r))throw new Error(`Unrecognized key: "${i}"`);n[i]&&(a[i]=e?new e({type:"optional",innerType:r[i]}):r[i])}else for(const i in r)a[i]=e?new e({type:"optional",innerType:r[i]}):r[i];return Ao(t,{...t._zod.def,shape:a,checks:[]})}function BZ(e,t,n){const r=t._zod.def.shape,a={...r};if(n)for(const i in n){if(!(i in a))throw new Error(`Unrecognized key: "${i}"`);n[i]&&(a[i]=new e({type:"nonoptional",innerType:r[i]}))}else for(const i in r)a[i]=new e({type:"nonoptional",innerType:r[i]});return Ao(t,{...t._zod.def,shape:a,checks:[]})}function ku(e,t=0){var n;for(let r=t;r<e.issues.length;r++)if(((n=e.issues[r])==null?void 0:n.continue)!==!0)return!0;return!1}function Hs(e,t){return t.map(n=>{var r;return(r=n).path??(r.path=[]),n.path.unshift(e),n})}function _f(e){return typeof e=="string"?e:e==null?void 0:e.message}function ps(e,t,n){var a,i,s,o,l,u;const r={...e,path:e.path??[]};if(!e.message){const d=_f((s=(i=(a=e.inst)==null?void 0:a._zod.def)==null?void 0:i.error)==null?void 0:s.call(i,e))??_f((o=t==null?void 0:t.error)==null?void 0:o.call(t,e))??_f((l=n.customError)==null?void 0:l.call(n,e))??_f((u=n.localeError)==null?void 0:u.call(n,e))??"Invalid input";r.message=d}return delete r.inst,delete r.continue,t!=null&&t.reportInput||delete r.input,r}function Kx(e){return Array.isArray(e)?"array":typeof e=="string"?"string":"unknown"}function Wu(...e){const[t,n,r]=e;return typeof t=="string"?{message:t,code:"custom",input:n,inst:r}:{...t}}const jO=(e,t)=>{e.name="$ZodError",Object.defineProperty(e,"_zod",{value:e._zod,enumerable:!1}),Object.defineProperty(e,"issues",{value:t,enumerable:!1}),Object.defineProperty(e,"message",{get(){return JSON.stringify(t,OZ,2)},enumerable:!0}),Object.defineProperty(e,"toString",{value:()=>e.message,enumerable:!1})},TO=ee("$ZodError",jO),AO=ee("$ZodError",jO,{Parent:Error});function VZ(e,t=n=>n.message){const n={},r=[];for(const a of e.issues)a.path.length>0?(n[a.path[0]]=n[a.path[0]]||[],n[a.path[0]].push(t(a))):r.push(t(a));return{formErrors:r,fieldErrors:n}}function KZ(e,t){const n=t||function(i){return i.message},r={_errors:[]},a=i=>{for(const s of i.issues)if(s.code==="invalid_union"&&s.errors.length)s.errors.map(o=>a({issues:o}));else if(s.code==="invalid_key")a({issues:s.issues});else if(s.code==="invalid_element")a({issues:s.issues});else if(s.path.length===0)r._errors.push(n(s));else{let o=r,l=0;for(;l<s.path.length;){const u=s.path[l];l===s.path.length-1?(o[u]=o[u]||{_errors:[]},o[u]._errors.push(n(s))):o[u]=o[u]||{_errors:[]},o=o[u],l++}}};return a(e),r}const ZZ=e=>(t,n,r,a)=>{const i=r?Object.assign(r,{async:!1}):{async:!1},s=t._zod.run({value:n,issues:[]},i);if(s instanceof Promise)throw new Xu;if(s.issues.length){const o=new((a==null?void 0:a.Err)??e)(s.issues.map(l=>ps(l,i,ms())));throw NO(o,a==null?void 0:a.callee),o}return s.value},GZ=e=>async(t,n,r,a)=>{const i=r?Object.assign(r,{async:!0}):{async:!0};let s=t._zod.run({value:n,issues:[]},i);if(s instanceof Promise&&(s=await s),s.issues.length){const o=new((a==null?void 0:a.Err)??e)(s.issues.map(l=>ps(l,i,ms())));throw NO(o,a==null?void 0:a.callee),o}return s.value},RO=e=>(t,n,r)=>{const a=r?{...r,async:!1}:{async:!1},i=t._zod.run({value:n,issues:[]},a);if(i instanceof Promise)throw new Xu;return i.issues.length?{success:!1,error:new(e??TO)(i.issues.map(s=>ps(s,a,ms())))}:{success:!0,data:i.value}},$O=RO(AO),OO=e=>async(t,n,r)=>{const a=r?Object.assign(r,{async:!0}):{async:!0};let i=t._zod.run({value:n,issues:[]},a);return i instanceof Promise&&(i=await i),i.issues.length?{success:!1,error:new e(i.issues.map(s=>ps(s,a,ms())))}:{success:!0,data:i.value}},QZ=OO(AO),YZ=/^[cC][^\s-]{8,}$/,XZ=/^[0-9a-z]+$/,WZ=/^[0-9A-HJKMNP-TV-Za-hjkmnp-tv-z]{26}$/,JZ=/^[0-9a-vA-V]{20}$/,eG=/^[A-Za-z0-9]{27}$/,tG=/^[a-zA-Z0-9_-]{21}$/,nG=/^P(?:(\d+W)|(?!.*W)(?=\d|T\d)(\d+Y)?(\d+M)?(\d+D)?(T(?=\d)(\d+H)?(\d+M)?(\d+([.,]\d+)?S)?)?)$/,rG=/^([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})$/,Xk=e=>e?new 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)$/,aG=/^(?!\.)(?!.*\.\.)([A-Za-z0-9_'+\-\.]*)[A-Za-z0-9_+-]@([A-Za-z0-9][A-Za-z0-9\-]*\.)+[A-Za-z]{2,}$/,iG="^(\\p{Extended_Pictographic}|\\p{Emoji_Component})+$";function sG(){return new RegExp(iG,"u")}const oG=/^(?:(?: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])$/,lG=/^(([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})$/,cG=/^((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])$/,uG=/^(([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])$/,dG=/^$|^(?:[0-9a-zA-Z+/]{4})*(?:(?:[0-9a-zA-Z+/]{2}==)|(?:[0-9a-zA-Z+/]{3}=))?$/,MO=/^[A-Za-z0-9_-]*$/,fG=/^([a-zA-Z0-9-]+\.)*[a-zA-Z0-9-]+$/,hG=/^\+(?:[0-9]){6,14}[0-9]$/,PO="(?:(?:\\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])))",mG=new RegExp(`^${PO}$`);function DO(e){const 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 pG(e){return new RegExp(`^${DO(e)}$`)}function gG(e){const t=DO({precision:e.precision}),n=["Z"];e.local&&n.push(""),e.offset&&n.push("([+-]\\d{2}:\\d{2})");const r=`${t}(?:${n.join("|")})`;return new RegExp(`^${PO}T(?:${r})$`)}const yG=e=>{const t=e?`[\\s\\S]{${(e==null?void 0:e.minimum)??0},${(e==null?void 0:e.maximum)??""}}`:"[\\s\\S]*";return new RegExp(`^${t}$`)},vG=/^\d+$/,bG=/^-?\d+(?:\.\d+)?/i,xG=/true|false/i,wG=/null/i,SG=/^[^A-Z]*$/,_G=/^[^a-z]*$/,rr=ee("$ZodCheck",(e,t)=>{var n;e._zod??(e._zod={}),e._zod.def=t,(n=e._zod).onattach??(n.onattach=[])}),zO={number:"number",bigint:"bigint",object:"date"},IO=ee("$ZodCheckLessThan",(e,t)=>{rr.init(e,t);const n=zO[typeof t.value];e._zod.onattach.push(r=>{const a=r._zod.bag,i=(t.inclusive?a.maximum:a.exclusiveMaximum)??Number.POSITIVE_INFINITY;t.value<i&&(t.inclusive?a.maximum=t.value:a.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:t.value,input:r.value,inclusive:t.inclusive,inst:e,continue:!t.abort})}}),LO=ee("$ZodCheckGreaterThan",(e,t)=>{rr.init(e,t);const n=zO[typeof t.value];e._zod.onattach.push(r=>{const a=r._zod.bag,i=(t.inclusive?a.minimum:a.exclusiveMinimum)??Number.NEGATIVE_INFINITY;t.value>i&&(t.inclusive?a.minimum=t.value:a.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:t.value,input:r.value,inclusive:t.inclusive,inst:e,continue:!t.abort})}}),kG=ee("$ZodCheckMultipleOf",(e,t)=>{rr.init(e,t),e._zod.onattach.push(n=>{var r;(r=n._zod.bag).multipleOf??(r.multipleOf=t.value)}),e._zod.check=n=>{if(typeof n.value!=typeof t.value)throw new Error("Cannot mix number and bigint in multiple_of check.");(typeof n.value=="bigint"?n.value%t.value===BigInt(0):MZ(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})}}),EG=ee("$ZodCheckNumberFormat",(e,t)=>{var s;rr.init(e,t),t.format=t.format||"float64";const n=(s=t.format)==null?void 0:s.includes("int"),r=n?"int":"number",[a,i]=IZ[t.format];e._zod.onattach.push(o=>{const l=o._zod.bag;l.format=t.format,l.minimum=a,l.maximum=i,n&&(l.pattern=vG)}),e._zod.check=o=>{const l=o.value;if(n){if(!Number.isInteger(l)){o.issues.push({expected:r,format:t.format,code:"invalid_type",input:l,inst:e});return}if(!Number.isSafeInteger(l)){l>0?o.issues.push({input:l,code:"too_big",maximum:Number.MAX_SAFE_INTEGER,note:"Integers must be within the safe integer range.",inst:e,origin:r,continue:!t.abort}):o.issues.push({input:l,code:"too_small",minimum:Number.MIN_SAFE_INTEGER,note:"Integers must be within the safe integer range.",inst:e,origin:r,continue:!t.abort});return}}l<a&&o.issues.push({origin:"number",input:l,code:"too_small",minimum:a,inclusive:!0,inst:e,continue:!t.abort}),l>i&&o.issues.push({origin:"number",input:l,code:"too_big",maximum:i,inst:e})}}),CG=ee("$ZodCheckMaxLength",(e,t)=>{var n;rr.init(e,t),(n=e._zod.def).when??(n.when=r=>{const a=r.value;return!Bx(a)&&a.length!==void 0}),e._zod.onattach.push(r=>{const a=r._zod.bag.maximum??Number.POSITIVE_INFINITY;t.maximum<a&&(r._zod.bag.maximum=t.maximum)}),e._zod.check=r=>{const a=r.value;if(a.length<=t.maximum)return;const s=Kx(a);r.issues.push({origin:s,code:"too_big",maximum:t.maximum,inclusive:!0,input:a,inst:e,continue:!t.abort})}}),NG=ee("$ZodCheckMinLength",(e,t)=>{var n;rr.init(e,t),(n=e._zod.def).when??(n.when=r=>{const a=r.value;return!Bx(a)&&a.length!==void 0}),e._zod.onattach.push(r=>{const a=r._zod.bag.minimum??Number.NEGATIVE_INFINITY;t.minimum>a&&(r._zod.bag.minimum=t.minimum)}),e._zod.check=r=>{const a=r.value;if(a.length>=t.minimum)return;const s=Kx(a);r.issues.push({origin:s,code:"too_small",minimum:t.minimum,inclusive:!0,input:a,inst:e,continue:!t.abort})}}),jG=ee("$ZodCheckLengthEquals",(e,t)=>{var n;rr.init(e,t),(n=e._zod.def).when??(n.when=r=>{const a=r.value;return!Bx(a)&&a.length!==void 0}),e._zod.onattach.push(r=>{const a=r._zod.bag;a.minimum=t.length,a.maximum=t.length,a.length=t.length}),e._zod.check=r=>{const a=r.value,i=a.length;if(i===t.length)return;const s=Kx(a),o=i>t.length;r.issues.push({origin:s,...o?{code:"too_big",maximum:t.length}:{code:"too_small",minimum:t.length},inclusive:!0,exact:!0,input:r.value,inst:e,continue:!t.abort})}}),Sp=ee("$ZodCheckStringFormat",(e,t)=>{var n,r;rr.init(e,t),e._zod.onattach.push(a=>{const i=a._zod.bag;i.format=t.format,t.pattern&&(i.patterns??(i.patterns=new Set),i.patterns.add(t.pattern))}),t.pattern?(n=e._zod).check??(n.check=a=>{t.pattern.lastIndex=0,!t.pattern.test(a.value)&&a.issues.push({origin:"string",code:"invalid_format",format:t.format,input:a.value,...t.pattern?{pattern:t.pattern.toString()}:{},inst:e,continue:!t.abort})}):(r=e._zod).check??(r.check=()=>{})}),TG=ee("$ZodCheckRegex",(e,t)=>{Sp.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})}}),AG=ee("$ZodCheckLowerCase",(e,t)=>{t.pattern??(t.pattern=SG),Sp.init(e,t)}),RG=ee("$ZodCheckUpperCase",(e,t)=>{t.pattern??(t.pattern=_G),Sp.init(e,t)}),$G=ee("$ZodCheckIncludes",(e,t)=>{rr.init(e,t);const n=Td(t.includes),r=new RegExp(typeof t.position=="number"?`^.{${t.position}}${n}`:n);t.pattern=r,e._zod.onattach.push(a=>{const i=a._zod.bag;i.patterns??(i.patterns=new Set),i.patterns.add(r)}),e._zod.check=a=>{a.value.includes(t.includes,t.position)||a.issues.push({origin:"string",code:"invalid_format",format:"includes",includes:t.includes,input:a.value,inst:e,continue:!t.abort})}}),OG=ee("$ZodCheckStartsWith",(e,t)=>{rr.init(e,t);const n=new RegExp(`^${Td(t.prefix)}.*`);t.pattern??(t.pattern=n),e._zod.onattach.push(r=>{const a=r._zod.bag;a.patterns??(a.patterns=new Set),a.patterns.add(n)}),e._zod.check=r=>{r.value.startsWith(t.prefix)||r.issues.push({origin:"string",code:"invalid_format",format:"starts_with",prefix:t.prefix,input:r.value,inst:e,continue:!t.abort})}}),MG=ee("$ZodCheckEndsWith",(e,t)=>{rr.init(e,t);const n=new RegExp(`.*${Td(t.suffix)}$`);t.pattern??(t.pattern=n),e._zod.onattach.push(r=>{const a=r._zod.bag;a.patterns??(a.patterns=new Set),a.patterns.add(n)}),e._zod.check=r=>{r.value.endsWith(t.suffix)||r.issues.push({origin:"string",code:"invalid_format",format:"ends_with",suffix:t.suffix,input:r.value,inst:e,continue:!t.abort})}}),PG=ee("$ZodCheckOverwrite",(e,t)=>{rr.init(e,t),e._zod.check=n=>{n.value=t.tx(n.value)}});class DG{constructor(t=[]){this.content=[],this.indent=0,this&&(this.args=t)}indented(t){this.indent+=1,t(this),this.indent-=1}write(t){if(typeof t=="function"){t(this,{execution:"sync"}),t(this,{execution:"async"});return}const r=t.split(`
454
+ `).filter(s=>s),a=Math.min(...r.map(s=>s.length-s.trimStart().length)),i=r.map(s=>s.slice(a)).map(s=>" ".repeat(this.indent*2)+s);for(const s of i)this.content.push(s)}compile(){const t=Function,n=this==null?void 0:this.args,a=[...((this==null?void 0:this.content)??[""]).map(i=>` ${i}`)];return new t(...n,a.join(`
455
+ `))}}const zG={major:4,minor:0,patch:0},pt=ee("$ZodType",(e,t)=>{var a;var n;e??(e={}),e._zod.def=t,e._zod.bag=e._zod.bag||{},e._zod.version=zG;const r=[...e._zod.def.checks??[]];e._zod.traits.has("$ZodCheck")&&r.unshift(e);for(const i of r)for(const s of i._zod.onattach)s(e);if(r.length===0)(n=e._zod).deferred??(n.deferred=[]),(a=e._zod.deferred)==null||a.push(()=>{e._zod.run=e._zod.parse});else{const i=(s,o,l)=>{let u=ku(s),d;for(const f of o){if(f._zod.def.when){if(!f._zod.def.when(s))continue}else if(u)continue;const m=s.issues.length,h=f._zod.check(s);if(h instanceof Promise&&(l==null?void 0:l.async)===!1)throw new Xu;if(d||h instanceof Promise)d=(d??Promise.resolve()).then(async()=>{await h,s.issues.length!==m&&(u||(u=ku(s,m)))});else{if(s.issues.length===m)continue;u||(u=ku(s,m))}}return d?d.then(()=>s):s};e._zod.run=(s,o)=>{const l=e._zod.parse(s,o);if(l instanceof Promise){if(o.async===!1)throw new Xu;return l.then(u=>i(u,r,o))}return i(l,r,o)}}e["~standard"]={validate:i=>{var s;try{const o=$O(e,i);return o.success?{value:o.data}:{issues:(s=o.error)==null?void 0:s.issues}}catch{return QZ(e,i).then(l=>{var u;return l.success?{value:l.data}:{issues:(u=l.error)==null?void 0:u.issues}})}},vendor:"zod",version:1}}),Zx=ee("$ZodString",(e,t)=>{var n;pt.init(e,t),e._zod.pattern=[...((n=e==null?void 0:e._zod.bag)==null?void 0:n.patterns)??[]].pop()??yG(e._zod.bag),e._zod.parse=(r,a)=>{if(t.coerce)try{r.value=String(r.value)}catch{}return typeof r.value=="string"||r.issues.push({expected:"string",code:"invalid_type",input:r.value,inst:e}),r}}),Rt=ee("$ZodStringFormat",(e,t)=>{Sp.init(e,t),Zx.init(e,t)}),IG=ee("$ZodGUID",(e,t)=>{t.pattern??(t.pattern=rG),Rt.init(e,t)}),LG=ee("$ZodUUID",(e,t)=>{if(t.version){const r={v1:1,v2:2,v3:3,v4:4,v5:5,v6:6,v7:7,v8:8}[t.version];if(r===void 0)throw new Error(`Invalid UUID version: "${t.version}"`);t.pattern??(t.pattern=Xk(r))}else t.pattern??(t.pattern=Xk());Rt.init(e,t)}),UG=ee("$ZodEmail",(e,t)=>{t.pattern??(t.pattern=aG),Rt.init(e,t)}),FG=ee("$ZodURL",(e,t)=>{Rt.init(e,t),e._zod.check=n=>{try{const r=n.value,a=new URL(r),i=a.href;t.hostname&&(t.hostname.lastIndex=0,t.hostname.test(a.hostname)||n.issues.push({code:"invalid_format",format:"url",note:"Invalid hostname",pattern:fG.source,input:n.value,inst:e,continue:!t.abort})),t.protocol&&(t.protocol.lastIndex=0,t.protocol.test(a.protocol.endsWith(":")?a.protocol.slice(0,-1):a.protocol)||n.issues.push({code:"invalid_format",format:"url",note:"Invalid protocol",pattern:t.protocol.source,input:n.value,inst:e,continue:!t.abort})),!r.endsWith("/")&&i.endsWith("/")?n.value=i.slice(0,-1):n.value=i;return}catch{n.issues.push({code:"invalid_format",format:"url",input:n.value,inst:e,continue:!t.abort})}}}),qG=ee("$ZodEmoji",(e,t)=>{t.pattern??(t.pattern=sG()),Rt.init(e,t)}),HG=ee("$ZodNanoID",(e,t)=>{t.pattern??(t.pattern=tG),Rt.init(e,t)}),BG=ee("$ZodCUID",(e,t)=>{t.pattern??(t.pattern=YZ),Rt.init(e,t)}),VG=ee("$ZodCUID2",(e,t)=>{t.pattern??(t.pattern=XZ),Rt.init(e,t)}),KG=ee("$ZodULID",(e,t)=>{t.pattern??(t.pattern=WZ),Rt.init(e,t)}),ZG=ee("$ZodXID",(e,t)=>{t.pattern??(t.pattern=JZ),Rt.init(e,t)}),GG=ee("$ZodKSUID",(e,t)=>{t.pattern??(t.pattern=eG),Rt.init(e,t)}),QG=ee("$ZodISODateTime",(e,t)=>{t.pattern??(t.pattern=gG(t)),Rt.init(e,t)}),YG=ee("$ZodISODate",(e,t)=>{t.pattern??(t.pattern=mG),Rt.init(e,t)}),XG=ee("$ZodISOTime",(e,t)=>{t.pattern??(t.pattern=pG(t)),Rt.init(e,t)}),WG=ee("$ZodISODuration",(e,t)=>{t.pattern??(t.pattern=nG),Rt.init(e,t)}),JG=ee("$ZodIPv4",(e,t)=>{t.pattern??(t.pattern=oG),Rt.init(e,t),e._zod.onattach.push(n=>{const r=n._zod.bag;r.format="ipv4"})}),eQ=ee("$ZodIPv6",(e,t)=>{t.pattern??(t.pattern=lG),Rt.init(e,t),e._zod.onattach.push(n=>{const r=n._zod.bag;r.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})}}}),tQ=ee("$ZodCIDRv4",(e,t)=>{t.pattern??(t.pattern=cG),Rt.init(e,t)}),nQ=ee("$ZodCIDRv6",(e,t)=>{t.pattern??(t.pattern=uG),Rt.init(e,t),e._zod.check=n=>{const[r,a]=n.value.split("/");try{if(!a)throw new Error;const i=Number(a);if(`${i}`!==a)throw new Error;if(i<0||i>128)throw new Error;new URL(`http://[${r}]`)}catch{n.issues.push({code:"invalid_format",format:"cidrv6",input:n.value,inst:e,continue:!t.abort})}}});function UO(e){if(e==="")return!0;if(e.length%4!==0)return!1;try{return atob(e),!0}catch{return!1}}const rQ=ee("$ZodBase64",(e,t)=>{t.pattern??(t.pattern=dG),Rt.init(e,t),e._zod.onattach.push(n=>{n._zod.bag.contentEncoding="base64"}),e._zod.check=n=>{UO(n.value)||n.issues.push({code:"invalid_format",format:"base64",input:n.value,inst:e,continue:!t.abort})}});function aQ(e){if(!MO.test(e))return!1;const t=e.replace(/[-_]/g,r=>r==="-"?"+":"/"),n=t.padEnd(Math.ceil(t.length/4)*4,"=");return UO(n)}const iQ=ee("$ZodBase64URL",(e,t)=>{t.pattern??(t.pattern=MO),Rt.init(e,t),e._zod.onattach.push(n=>{n._zod.bag.contentEncoding="base64url"}),e._zod.check=n=>{aQ(n.value)||n.issues.push({code:"invalid_format",format:"base64url",input:n.value,inst:e,continue:!t.abort})}}),sQ=ee("$ZodE164",(e,t)=>{t.pattern??(t.pattern=hG),Rt.init(e,t)});function oQ(e,t=null){try{const n=e.split(".");if(n.length!==3)return!1;const[r]=n;if(!r)return!1;const a=JSON.parse(atob(r));return!("typ"in a&&(a==null?void 0:a.typ)!=="JWT"||!a.alg||t&&(!("alg"in a)||a.alg!==t))}catch{return!1}}const lQ=ee("$ZodJWT",(e,t)=>{Rt.init(e,t),e._zod.check=n=>{oQ(n.value,t.alg)||n.issues.push({code:"invalid_format",format:"jwt",input:n.value,inst:e,continue:!t.abort})}}),FO=ee("$ZodNumber",(e,t)=>{pt.init(e,t),e._zod.pattern=e._zod.bag.pattern??bG,e._zod.parse=(n,r)=>{if(t.coerce)try{n.value=Number(n.value)}catch{}const a=n.value;if(typeof a=="number"&&!Number.isNaN(a)&&Number.isFinite(a))return n;const i=typeof a=="number"?Number.isNaN(a)?"NaN":Number.isFinite(a)?void 0:"Infinity":void 0;return n.issues.push({expected:"number",code:"invalid_type",input:a,inst:e,...i?{received:i}:{}}),n}}),cQ=ee("$ZodNumber",(e,t)=>{EG.init(e,t),FO.init(e,t)}),uQ=ee("$ZodBoolean",(e,t)=>{pt.init(e,t),e._zod.pattern=xG,e._zod.parse=(n,r)=>{if(t.coerce)try{n.value=!!n.value}catch{}const a=n.value;return typeof a=="boolean"||n.issues.push({expected:"boolean",code:"invalid_type",input:a,inst:e}),n}}),dQ=ee("$ZodNull",(e,t)=>{pt.init(e,t),e._zod.pattern=wG,e._zod.values=new Set([null]),e._zod.parse=(n,r)=>{const a=n.value;return a===null||n.issues.push({expected:"null",code:"invalid_type",input:a,inst:e}),n}}),fQ=ee("$ZodAny",(e,t)=>{pt.init(e,t),e._zod.parse=n=>n}),hQ=ee("$ZodUnknown",(e,t)=>{pt.init(e,t),e._zod.parse=n=>n}),mQ=ee("$ZodNever",(e,t)=>{pt.init(e,t),e._zod.parse=(n,r)=>(n.issues.push({expected:"never",code:"invalid_type",input:n.value,inst:e}),n)});function Wk(e,t,n){e.issues.length&&t.issues.push(...Hs(n,e.issues)),t.value[n]=e.value}const pQ=ee("$ZodArray",(e,t)=>{pt.init(e,t),e._zod.parse=(n,r)=>{const a=n.value;if(!Array.isArray(a))return n.issues.push({expected:"array",code:"invalid_type",input:a,inst:e}),n;n.value=Array(a.length);const i=[];for(let s=0;s<a.length;s++){const o=a[s],l=t.element._zod.run({value:o,issues:[]},r);l instanceof Promise?i.push(l.then(u=>Wk(u,n,s))):Wk(l,n,s)}return i.length?Promise.all(i).then(()=>n):n}});function kf(e,t,n){e.issues.length&&t.issues.push(...Hs(n,e.issues)),t.value[n]=e.value}function Jk(e,t,n,r){e.issues.length?r[n]===void 0?n in r?t.value[n]=void 0:t.value[n]=e.value:t.issues.push(...Hs(n,e.issues)):e.value===void 0?n in r&&(t.value[n]=void 0):t.value[n]=e.value}const gQ=ee("$ZodObject",(e,t)=>{pt.init(e,t);const n=Hx(()=>{const f=Object.keys(t.shape);for(const h of f)if(!(t.shape[h]instanceof pt))throw new Error(`Invalid element at key "${h}": expected a Zod schema`);const m=zZ(t.shape);return{shape:t.shape,keys:f,keySet:new Set(f),numKeys:f.length,optionalKeys:new Set(m)}});Ct(e._zod,"propValues",()=>{const f=t.shape,m={};for(const h in f){const y=f[h]._zod;if(y.values){m[h]??(m[h]=new Set);for(const p of y.values)m[h].add(p)}}return m});const r=f=>{const m=new DG(["shape","payload","ctx"]),h=n.value,y=v=>{const w=Uc(v);return`shape[${w}]._zod.run({ value: input[${w}], issues: [] }, ctx)`};m.write("const input = payload.value;");const p=Object.create(null);let b=0;for(const v of h.keys)p[v]=`key_${b++}`;m.write("const newResult = {}");for(const v of h.keys)if(h.optionalKeys.has(v)){const w=p[v];m.write(`const ${w} = ${y(v)};`);const S=Uc(v);m.write(`
456
+ if (${w}.issues.length) {
457
+ if (input[${S}] === undefined) {
458
+ if (${S} in input) {
459
+ newResult[${S}] = undefined;
460
+ }
461
+ } else {
462
+ payload.issues = payload.issues.concat(
463
+ ${w}.issues.map((iss) => ({
464
+ ...iss,
465
+ path: iss.path ? [${S}, ...iss.path] : [${S}],
466
+ }))
467
+ );
468
+ }
469
+ } else if (${w}.value === undefined) {
470
+ if (${S} in input) newResult[${S}] = undefined;
471
+ } else {
472
+ newResult[${S}] = ${w}.value;
473
+ }
474
+ `)}else{const w=p[v];m.write(`const ${w} = ${y(v)};`),m.write(`
475
+ if (${w}.issues.length) payload.issues = payload.issues.concat(${w}.issues.map(iss => ({
476
+ ...iss,
477
+ path: iss.path ? [${Uc(v)}, ...iss.path] : [${Uc(v)}]
478
+ })));`),m.write(`newResult[${Uc(v)}] = ${w}.value`)}m.write("payload.value = newResult;"),m.write("return payload;");const g=m.compile();return(v,w)=>g(f,v,w)};let a;const i=lm,s=!CO.jitless,l=s&&PZ.value,u=t.catchall;let d;e._zod.parse=(f,m)=>{d??(d=n.value);const h=f.value;if(!i(h))return f.issues.push({expected:"object",code:"invalid_type",input:h,inst:e}),f;const y=[];if(s&&l&&(m==null?void 0:m.async)===!1&&m.jitless!==!0)a||(a=r(t.shape)),f=a(f,m);else{f.value={};const w=d.shape;for(const S of d.keys){const E=w[S],C=E._zod.run({value:h[S],issues:[]},m),T=E._zod.optin==="optional"&&E._zod.optout==="optional";C instanceof Promise?y.push(C.then(P=>T?Jk(P,f,S,h):kf(P,f,S))):T?Jk(C,f,S,h):kf(C,f,S)}}if(!u)return y.length?Promise.all(y).then(()=>f):f;const p=[],b=d.keySet,g=u._zod,v=g.def.type;for(const w of Object.keys(h)){if(b.has(w))continue;if(v==="never"){p.push(w);continue}const S=g.run({value:h[w],issues:[]},m);S instanceof Promise?y.push(S.then(E=>kf(E,f,w))):kf(S,f,w)}return p.length&&f.issues.push({code:"unrecognized_keys",keys:p,input:h,inst:e}),y.length?Promise.all(y).then(()=>f):f}});function eE(e,t,n,r){for(const a of e)if(a.issues.length===0)return t.value=a.value,t;return t.issues.push({code:"invalid_union",input:t.value,inst:n,errors:e.map(a=>a.issues.map(i=>ps(i,r,ms())))}),t}const qO=ee("$ZodUnion",(e,t)=>{pt.init(e,t),Ct(e._zod,"optin",()=>t.options.some(n=>n._zod.optin==="optional")?"optional":void 0),Ct(e._zod,"optout",()=>t.options.some(n=>n._zod.optout==="optional")?"optional":void 0),Ct(e._zod,"values",()=>{if(t.options.every(n=>n._zod.values))return new Set(t.options.flatMap(n=>Array.from(n._zod.values)))}),Ct(e._zod,"pattern",()=>{if(t.options.every(n=>n._zod.pattern)){const n=t.options.map(r=>r._zod.pattern);return new RegExp(`^(${n.map(r=>Vx(r.source)).join("|")})$`)}}),e._zod.parse=(n,r)=>{let a=!1;const i=[];for(const s of t.options){const o=s._zod.run({value:n.value,issues:[]},r);if(o instanceof Promise)i.push(o),a=!0;else{if(o.issues.length===0)return o;i.push(o)}}return a?Promise.all(i).then(s=>eE(s,n,e,r)):eE(i,n,e,r)}}),yQ=ee("$ZodDiscriminatedUnion",(e,t)=>{qO.init(e,t);const n=e._zod.parse;Ct(e._zod,"propValues",()=>{const a={};for(const i of t.options){const s=i._zod.propValues;if(!s||Object.keys(s).length===0)throw new Error(`Invalid discriminated union option at index "${t.options.indexOf(i)}"`);for(const[o,l]of Object.entries(s)){a[o]||(a[o]=new Set);for(const u of l)a[o].add(u)}}return a});const r=Hx(()=>{const a=t.options,i=new Map;for(const s of a){const o=s._zod.propValues[t.discriminator];if(!o||o.size===0)throw new Error(`Invalid discriminated union option at index "${t.options.indexOf(s)}"`);for(const l of o){if(i.has(l))throw new Error(`Duplicate discriminator value "${String(l)}"`);i.set(l,s)}}return i});e._zod.parse=(a,i)=>{const s=a.value;if(!lm(s))return a.issues.push({code:"invalid_type",expected:"object",input:s,inst:e}),a;const o=r.value.get(s==null?void 0:s[t.discriminator]);return o?o._zod.run(a,i):t.unionFallback?n(a,i):(a.issues.push({code:"invalid_union",errors:[],note:"No matching discriminator",input:s,path:[t.discriminator],inst:e}),a)}}),vQ=ee("$ZodIntersection",(e,t)=>{pt.init(e,t),e._zod.parse=(n,r)=>{const a=n.value,i=t.left._zod.run({value:a,issues:[]},r),s=t.right._zod.run({value:a,issues:[]},r);return i instanceof Promise||s instanceof Promise?Promise.all([i,s]).then(([l,u])=>tE(n,l,u)):tE(n,i,s)}});function n0(e,t){if(e===t)return{valid:!0,data:e};if(e instanceof Date&&t instanceof Date&&+e==+t)return{valid:!0,data:e};if(cm(e)&&cm(t)){const n=Object.keys(t),r=Object.keys(e).filter(i=>n.indexOf(i)!==-1),a={...e,...t};for(const i of r){const s=n0(e[i],t[i]);if(!s.valid)return{valid:!1,mergeErrorPath:[i,...s.mergeErrorPath]};a[i]=s.data}return{valid:!0,data:a}}if(Array.isArray(e)&&Array.isArray(t)){if(e.length!==t.length)return{valid:!1,mergeErrorPath:[]};const n=[];for(let r=0;r<e.length;r++){const a=e[r],i=t[r],s=n0(a,i);if(!s.valid)return{valid:!1,mergeErrorPath:[r,...s.mergeErrorPath]};n.push(s.data)}return{valid:!0,data:n}}return{valid:!1,mergeErrorPath:[]}}function tE(e,t,n){if(t.issues.length&&e.issues.push(...t.issues),n.issues.length&&e.issues.push(...n.issues),ku(e))return e;const r=n0(t.value,n.value);if(!r.valid)throw new Error(`Unmergable intersection. Error path: ${JSON.stringify(r.mergeErrorPath)}`);return e.value=r.data,e}const bQ=ee("$ZodRecord",(e,t)=>{pt.init(e,t),e._zod.parse=(n,r)=>{const a=n.value;if(!cm(a))return n.issues.push({expected:"record",code:"invalid_type",input:a,inst:e}),n;const i=[];if(t.keyType._zod.values){const s=t.keyType._zod.values;n.value={};for(const l of s)if(typeof l=="string"||typeof l=="number"||typeof l=="symbol"){const u=t.valueType._zod.run({value:a[l],issues:[]},r);u instanceof Promise?i.push(u.then(d=>{d.issues.length&&n.issues.push(...Hs(l,d.issues)),n.value[l]=d.value})):(u.issues.length&&n.issues.push(...Hs(l,u.issues)),n.value[l]=u.value)}let o;for(const l in a)s.has(l)||(o=o??[],o.push(l));o&&o.length>0&&n.issues.push({code:"unrecognized_keys",input:a,inst:e,keys:o})}else{n.value={};for(const s of Reflect.ownKeys(a)){if(s==="__proto__")continue;const o=t.keyType._zod.run({value:s,issues:[]},r);if(o instanceof Promise)throw new Error("Async schemas not supported in object keys currently");if(o.issues.length){n.issues.push({origin:"record",code:"invalid_key",issues:o.issues.map(u=>ps(u,r,ms())),input:s,path:[s],inst:e}),n.value[o.value]=o.value;continue}const l=t.valueType._zod.run({value:a[s],issues:[]},r);l instanceof Promise?i.push(l.then(u=>{u.issues.length&&n.issues.push(...Hs(s,u.issues)),n.value[o.value]=u.value})):(l.issues.length&&n.issues.push(...Hs(s,l.issues)),n.value[o.value]=l.value)}}return i.length?Promise.all(i).then(()=>n):n}}),xQ=ee("$ZodEnum",(e,t)=>{pt.init(e,t);const n=$Z(t.entries);e._zod.values=new Set(n),e._zod.pattern=new RegExp(`^(${n.filter(r=>DZ.has(typeof r)).map(r=>typeof r=="string"?Td(r):r.toString()).join("|")})$`),e._zod.parse=(r,a)=>{const i=r.value;return e._zod.values.has(i)||r.issues.push({code:"invalid_value",values:n,input:i,inst:e}),r}}),wQ=ee("$ZodLiteral",(e,t)=>{pt.init(e,t),e._zod.values=new Set(t.values),e._zod.pattern=new RegExp(`^(${t.values.map(n=>typeof n=="string"?Td(n):n?n.toString():String(n)).join("|")})$`),e._zod.parse=(n,r)=>{const a=n.value;return e._zod.values.has(a)||n.issues.push({code:"invalid_value",values:t.values,input:a,inst:e}),n}}),SQ=ee("$ZodTransform",(e,t)=>{pt.init(e,t),e._zod.parse=(n,r)=>{const a=t.transform(n.value,n);if(r.async)return(a instanceof Promise?a:Promise.resolve(a)).then(s=>(n.value=s,n));if(a instanceof Promise)throw new Xu;return n.value=a,n}}),_Q=ee("$ZodOptional",(e,t)=>{pt.init(e,t),e._zod.optin="optional",e._zod.optout="optional",Ct(e._zod,"values",()=>t.innerType._zod.values?new Set([...t.innerType._zod.values,void 0]):void 0),Ct(e._zod,"pattern",()=>{const n=t.innerType._zod.pattern;return n?new RegExp(`^(${Vx(n.source)})?$`):void 0}),e._zod.parse=(n,r)=>t.innerType._zod.optin==="optional"?t.innerType._zod.run(n,r):n.value===void 0?n:t.innerType._zod.run(n,r)}),kQ=ee("$ZodNullable",(e,t)=>{pt.init(e,t),Ct(e._zod,"optin",()=>t.innerType._zod.optin),Ct(e._zod,"optout",()=>t.innerType._zod.optout),Ct(e._zod,"pattern",()=>{const n=t.innerType._zod.pattern;return n?new RegExp(`^(${Vx(n.source)}|null)$`):void 0}),Ct(e._zod,"values",()=>t.innerType._zod.values?new Set([...t.innerType._zod.values,null]):void 0),e._zod.parse=(n,r)=>n.value===null?n:t.innerType._zod.run(n,r)}),EQ=ee("$ZodDefault",(e,t)=>{pt.init(e,t),e._zod.optin="optional",Ct(e._zod,"values",()=>t.innerType._zod.values),e._zod.parse=(n,r)=>{if(n.value===void 0)return n.value=t.defaultValue,n;const a=t.innerType._zod.run(n,r);return a instanceof Promise?a.then(i=>nE(i,t)):nE(a,t)}});function nE(e,t){return e.value===void 0&&(e.value=t.defaultValue),e}const CQ=ee("$ZodPrefault",(e,t)=>{pt.init(e,t),e._zod.optin="optional",Ct(e._zod,"values",()=>t.innerType._zod.values),e._zod.parse=(n,r)=>(n.value===void 0&&(n.value=t.defaultValue),t.innerType._zod.run(n,r))}),NQ=ee("$ZodNonOptional",(e,t)=>{pt.init(e,t),Ct(e._zod,"values",()=>{const n=t.innerType._zod.values;return n?new Set([...n].filter(r=>r!==void 0)):void 0}),e._zod.parse=(n,r)=>{const a=t.innerType._zod.run(n,r);return a instanceof Promise?a.then(i=>rE(i,e)):rE(a,e)}});function rE(e,t){return!e.issues.length&&e.value===void 0&&e.issues.push({code:"invalid_type",expected:"nonoptional",input:e.value,inst:t}),e}const jQ=ee("$ZodCatch",(e,t)=>{pt.init(e,t),e._zod.optin="optional",Ct(e._zod,"optout",()=>t.innerType._zod.optout),Ct(e._zod,"values",()=>t.innerType._zod.values),e._zod.parse=(n,r)=>{const a=t.innerType._zod.run(n,r);return a instanceof Promise?a.then(i=>(n.value=i.value,i.issues.length&&(n.value=t.catchValue({...n,error:{issues:i.issues.map(s=>ps(s,r,ms()))},input:n.value}),n.issues=[]),n)):(n.value=a.value,a.issues.length&&(n.value=t.catchValue({...n,error:{issues:a.issues.map(i=>ps(i,r,ms()))},input:n.value}),n.issues=[]),n)}}),TQ=ee("$ZodPipe",(e,t)=>{pt.init(e,t),Ct(e._zod,"values",()=>t.in._zod.values),Ct(e._zod,"optin",()=>t.in._zod.optin),Ct(e._zod,"optout",()=>t.out._zod.optout),e._zod.parse=(n,r)=>{const a=t.in._zod.run(n,r);return a instanceof Promise?a.then(i=>aE(i,t,r)):aE(a,t,r)}});function aE(e,t,n){return ku(e)?e:t.out._zod.run({value:e.value,issues:e.issues},n)}const AQ=ee("$ZodReadonly",(e,t)=>{pt.init(e,t),Ct(e._zod,"propValues",()=>t.innerType._zod.propValues),Ct(e._zod,"values",()=>t.innerType._zod.values),Ct(e._zod,"optin",()=>t.innerType._zod.optin),Ct(e._zod,"optout",()=>t.innerType._zod.optout),e._zod.parse=(n,r)=>{const a=t.innerType._zod.run(n,r);return a instanceof Promise?a.then(iE):iE(a)}});function iE(e){return e.value=Object.freeze(e.value),e}const RQ=ee("$ZodCustom",(e,t)=>{rr.init(e,t),pt.init(e,t),e._zod.parse=(n,r)=>n,e._zod.check=n=>{const r=n.value,a=t.fn(r);if(a instanceof Promise)return a.then(i=>sE(i,n,r,e));sE(a,n,r,e)}});function sE(e,t,n,r){if(!e){const a={code:"custom",input:n,inst:r,path:[...r._zod.def.path??[]],continue:!r._zod.def.abort};r._zod.def.params&&(a.params=r._zod.def.params),t.issues.push(Wu(a))}}class $Q{constructor(){this._map=new Map,this._idmap=new Map}add(t,...n){const r=n[0];if(this._map.set(t,r),r&&typeof r=="object"&&"id"in r){if(this._idmap.has(r.id))throw new Error(`ID ${r.id} already exists in the registry`);this._idmap.set(r.id,t)}return this}clear(){return this._map=new Map,this._idmap=new Map,this}remove(t){const n=this._map.get(t);return n&&typeof n=="object"&&"id"in n&&this._idmap.delete(n.id),this._map.delete(t),this}get(t){const n=t._zod.parent;if(n){const r={...this.get(n)??{}};return delete r.id,{...r,...this._map.get(t)}}return this._map.get(t)}has(t){return this._map.has(t)}}function OQ(){return new $Q}const Ef=OQ();function MQ(e,t){return new e({type:"string",...ye(t)})}function PQ(e,t){return new e({type:"string",format:"email",check:"string_format",abort:!1,...ye(t)})}function oE(e,t){return new e({type:"string",format:"guid",check:"string_format",abort:!1,...ye(t)})}function DQ(e,t){return new e({type:"string",format:"uuid",check:"string_format",abort:!1,...ye(t)})}function zQ(e,t){return new e({type:"string",format:"uuid",check:"string_format",abort:!1,version:"v4",...ye(t)})}function IQ(e,t){return new e({type:"string",format:"uuid",check:"string_format",abort:!1,version:"v6",...ye(t)})}function LQ(e,t){return new e({type:"string",format:"uuid",check:"string_format",abort:!1,version:"v7",...ye(t)})}function HO(e,t){return new e({type:"string",format:"url",check:"string_format",abort:!1,...ye(t)})}function UQ(e,t){return new e({type:"string",format:"emoji",check:"string_format",abort:!1,...ye(t)})}function FQ(e,t){return new e({type:"string",format:"nanoid",check:"string_format",abort:!1,...ye(t)})}function qQ(e,t){return new e({type:"string",format:"cuid",check:"string_format",abort:!1,...ye(t)})}function HQ(e,t){return new e({type:"string",format:"cuid2",check:"string_format",abort:!1,...ye(t)})}function BQ(e,t){return new e({type:"string",format:"ulid",check:"string_format",abort:!1,...ye(t)})}function VQ(e,t){return new e({type:"string",format:"xid",check:"string_format",abort:!1,...ye(t)})}function KQ(e,t){return new e({type:"string",format:"ksuid",check:"string_format",abort:!1,...ye(t)})}function ZQ(e,t){return new e({type:"string",format:"ipv4",check:"string_format",abort:!1,...ye(t)})}function GQ(e,t){return new e({type:"string",format:"ipv6",check:"string_format",abort:!1,...ye(t)})}function QQ(e,t){return new e({type:"string",format:"cidrv4",check:"string_format",abort:!1,...ye(t)})}function YQ(e,t){return new e({type:"string",format:"cidrv6",check:"string_format",abort:!1,...ye(t)})}function XQ(e,t){return new e({type:"string",format:"base64",check:"string_format",abort:!1,...ye(t)})}function WQ(e,t){return new e({type:"string",format:"base64url",check:"string_format",abort:!1,...ye(t)})}function JQ(e,t){return new e({type:"string",format:"e164",check:"string_format",abort:!1,...ye(t)})}function eY(e,t){return new e({type:"string",format:"jwt",check:"string_format",abort:!1,...ye(t)})}function tY(e,t){return new e({type:"string",format:"datetime",check:"string_format",offset:!1,local:!1,precision:null,...ye(t)})}function nY(e,t){return new e({type:"string",format:"date",check:"string_format",...ye(t)})}function rY(e,t){return new e({type:"string",format:"time",check:"string_format",precision:null,...ye(t)})}function aY(e,t){return new e({type:"string",format:"duration",check:"string_format",...ye(t)})}function iY(e,t){return new e({type:"number",checks:[],...ye(t)})}function sY(e,t){return new e({type:"number",coerce:!0,checks:[],...ye(t)})}function oY(e,t){return new e({type:"number",check:"number_format",abort:!1,format:"safeint",...ye(t)})}function lY(e,t){return new e({type:"boolean",...ye(t)})}function cY(e,t){return new e({type:"null",...ye(t)})}function uY(e){return new e({type:"any"})}function dY(e){return new e({type:"unknown"})}function fY(e,t){return new e({type:"never",...ye(t)})}function lE(e,t){return new IO({check:"less_than",...ye(t),value:e,inclusive:!1})}function ey(e,t){return new IO({check:"less_than",...ye(t),value:e,inclusive:!0})}function cE(e,t){return new LO({check:"greater_than",...ye(t),value:e,inclusive:!1})}function ty(e,t){return new LO({check:"greater_than",...ye(t),value:e,inclusive:!0})}function uE(e,t){return new kG({check:"multiple_of",...ye(t),value:e})}function BO(e,t){return new CG({check:"max_length",...ye(t),maximum:e})}function um(e,t){return new NG({check:"min_length",...ye(t),minimum:e})}function VO(e,t){return new jG({check:"length_equals",...ye(t),length:e})}function hY(e,t){return new TG({check:"string_format",format:"regex",...ye(t),pattern:e})}function mY(e){return new AG({check:"string_format",format:"lowercase",...ye(e)})}function pY(e){return new RG({check:"string_format",format:"uppercase",...ye(e)})}function gY(e,t){return new $G({check:"string_format",format:"includes",...ye(t),includes:e})}function yY(e,t){return new OG({check:"string_format",format:"starts_with",...ye(t),prefix:e})}function vY(e,t){return new MG({check:"string_format",format:"ends_with",...ye(t),suffix:e})}function Ad(e){return new PG({check:"overwrite",tx:e})}function bY(e){return Ad(t=>t.normalize(e))}function xY(){return Ad(e=>e.trim())}function wY(){return Ad(e=>e.toLowerCase())}function SY(){return Ad(e=>e.toUpperCase())}function _Y(e,t,n){return new e({type:"array",element:t,...ye(n)})}function kY(e,t,n){const r=ye(n);return r.abort??(r.abort=!0),new e({type:"custom",check:"custom",fn:t,...r})}function EY(e,t,n){return new e({type:"custom",check:"custom",fn:t,...ye(n)})}const CY=ee("ZodISODateTime",(e,t)=>{QG.init(e,t),Dt.init(e,t)});function KO(e){return tY(CY,e)}const NY=ee("ZodISODate",(e,t)=>{YG.init(e,t),Dt.init(e,t)});function jY(e){return nY(NY,e)}const TY=ee("ZodISOTime",(e,t)=>{XG.init(e,t),Dt.init(e,t)});function AY(e){return rY(TY,e)}const RY=ee("ZodISODuration",(e,t)=>{WG.init(e,t),Dt.init(e,t)});function $Y(e){return aY(RY,e)}const OY=(e,t)=>{TO.init(e,t),e.name="ZodError",Object.defineProperties(e,{format:{value:n=>KZ(e,n)},flatten:{value:n=>VZ(e,n)},addIssue:{value:n=>e.issues.push(n)},addIssues:{value:n=>e.issues.push(...n)},isEmpty:{get(){return e.issues.length===0}}})},_p=ee("ZodError",OY,{Parent:Error}),MY=ZZ(_p),PY=GZ(_p),DY=RO(_p),zY=OO(_p),$t=ee("ZodType",(e,t)=>(pt.init(e,t),e.def=t,Object.defineProperty(e,"_def",{value:t}),e.check=(...n)=>e.clone({...t,checks:[...t.checks??[],...n.map(r=>typeof r=="function"?{_zod:{check:r,def:{check:"custom"},onattach:[]}}:r)]}),e.clone=(n,r)=>Ao(e,n,r),e.brand=()=>e,e.register=(n,r)=>(n.add(e,r),e),e.parse=(n,r)=>MY(e,n,r,{callee:e.parse}),e.safeParse=(n,r)=>DY(e,n,r),e.parseAsync=async(n,r)=>PY(e,n,r,{callee:e.parseAsync}),e.safeParseAsync=async(n,r)=>zY(e,n,r),e.spa=e.safeParseAsync,e.refine=(n,r)=>e.check(AX(n,r)),e.superRefine=n=>e.check(RX(n)),e.overwrite=n=>e.check(Ad(n)),e.optional=()=>Mt(e),e.nullable=()=>hE(e),e.nullish=()=>Mt(hE(e)),e.nonoptional=n=>SX(e,n),e.array=()=>he(e),e.or=n=>Ot([e,n]),e.and=n=>Qx(e,n),e.transform=n=>a0(e,WO(n)),e.default=n=>bX(e,n),e.prefault=n=>wX(e,n),e.catch=n=>kX(e,n),e.pipe=n=>a0(e,n),e.readonly=()=>NX(e),e.describe=n=>{const r=e.clone();return Ef.add(r,{description:n}),r},Object.defineProperty(e,"description",{get(){var n;return(n=Ef.get(e))==null?void 0:n.description},configurable:!0}),e.meta=(...n)=>{if(n.length===0)return Ef.get(e);const r=e.clone();return Ef.add(r,n[0]),r},e.isOptional=()=>e.safeParse(void 0).success,e.isNullable=()=>e.safeParse(null).success,e)),ZO=ee("_ZodString",(e,t)=>{Zx.init(e,t),$t.init(e,t);const n=e._zod.bag;e.format=n.format??null,e.minLength=n.minimum??null,e.maxLength=n.maximum??null,e.regex=(...r)=>e.check(hY(...r)),e.includes=(...r)=>e.check(gY(...r)),e.startsWith=(...r)=>e.check(yY(...r)),e.endsWith=(...r)=>e.check(vY(...r)),e.min=(...r)=>e.check(um(...r)),e.max=(...r)=>e.check(BO(...r)),e.length=(...r)=>e.check(VO(...r)),e.nonempty=(...r)=>e.check(um(1,...r)),e.lowercase=r=>e.check(mY(r)),e.uppercase=r=>e.check(pY(r)),e.trim=()=>e.check(xY()),e.normalize=(...r)=>e.check(bY(...r)),e.toLowerCase=()=>e.check(wY()),e.toUpperCase=()=>e.check(SY())}),IY=ee("ZodString",(e,t)=>{Zx.init(e,t),ZO.init(e,t),e.email=n=>e.check(PQ(LY,n)),e.url=n=>e.check(HO(GO,n)),e.jwt=n=>e.check(eY(tX,n)),e.emoji=n=>e.check(UQ(FY,n)),e.guid=n=>e.check(oE(dE,n)),e.uuid=n=>e.check(DQ(Cf,n)),e.uuidv4=n=>e.check(zQ(Cf,n)),e.uuidv6=n=>e.check(IQ(Cf,n)),e.uuidv7=n=>e.check(LQ(Cf,n)),e.nanoid=n=>e.check(FQ(qY,n)),e.guid=n=>e.check(oE(dE,n)),e.cuid=n=>e.check(qQ(HY,n)),e.cuid2=n=>e.check(HQ(BY,n)),e.ulid=n=>e.check(BQ(VY,n)),e.base64=n=>e.check(XQ(WY,n)),e.base64url=n=>e.check(WQ(JY,n)),e.xid=n=>e.check(VQ(KY,n)),e.ksuid=n=>e.check(KQ(ZY,n)),e.ipv4=n=>e.check(ZQ(GY,n)),e.ipv6=n=>e.check(GQ(QY,n)),e.cidrv4=n=>e.check(QQ(YY,n)),e.cidrv6=n=>e.check(YQ(XY,n)),e.e164=n=>e.check(JQ(eX,n)),e.datetime=n=>e.check(KO(n)),e.date=n=>e.check(jY(n)),e.time=n=>e.check(AY(n)),e.duration=n=>e.check($Y(n))});function H(e){return MQ(IY,e)}const Dt=ee("ZodStringFormat",(e,t)=>{Rt.init(e,t),ZO.init(e,t)}),LY=ee("ZodEmail",(e,t)=>{UG.init(e,t),Dt.init(e,t)}),dE=ee("ZodGUID",(e,t)=>{IG.init(e,t),Dt.init(e,t)}),Cf=ee("ZodUUID",(e,t)=>{LG.init(e,t),Dt.init(e,t)}),GO=ee("ZodURL",(e,t)=>{FG.init(e,t),Dt.init(e,t)});function UY(e){return HO(GO,e)}const FY=ee("ZodEmoji",(e,t)=>{qG.init(e,t),Dt.init(e,t)}),qY=ee("ZodNanoID",(e,t)=>{HG.init(e,t),Dt.init(e,t)}),HY=ee("ZodCUID",(e,t)=>{BG.init(e,t),Dt.init(e,t)}),BY=ee("ZodCUID2",(e,t)=>{VG.init(e,t),Dt.init(e,t)}),VY=ee("ZodULID",(e,t)=>{KG.init(e,t),Dt.init(e,t)}),KY=ee("ZodXID",(e,t)=>{ZG.init(e,t),Dt.init(e,t)}),ZY=ee("ZodKSUID",(e,t)=>{GG.init(e,t),Dt.init(e,t)}),GY=ee("ZodIPv4",(e,t)=>{JG.init(e,t),Dt.init(e,t)}),QY=ee("ZodIPv6",(e,t)=>{eQ.init(e,t),Dt.init(e,t)}),YY=ee("ZodCIDRv4",(e,t)=>{tQ.init(e,t),Dt.init(e,t)}),XY=ee("ZodCIDRv6",(e,t)=>{nQ.init(e,t),Dt.init(e,t)}),WY=ee("ZodBase64",(e,t)=>{rQ.init(e,t),Dt.init(e,t)}),JY=ee("ZodBase64URL",(e,t)=>{iQ.init(e,t),Dt.init(e,t)}),eX=ee("ZodE164",(e,t)=>{sQ.init(e,t),Dt.init(e,t)}),tX=ee("ZodJWT",(e,t)=>{lQ.init(e,t),Dt.init(e,t)}),Gx=ee("ZodNumber",(e,t)=>{FO.init(e,t),$t.init(e,t),e.gt=(r,a)=>e.check(cE(r,a)),e.gte=(r,a)=>e.check(ty(r,a)),e.min=(r,a)=>e.check(ty(r,a)),e.lt=(r,a)=>e.check(lE(r,a)),e.lte=(r,a)=>e.check(ey(r,a)),e.max=(r,a)=>e.check(ey(r,a)),e.int=r=>e.check(fE(r)),e.safe=r=>e.check(fE(r)),e.positive=r=>e.check(cE(0,r)),e.nonnegative=r=>e.check(ty(0,r)),e.negative=r=>e.check(lE(0,r)),e.nonpositive=r=>e.check(ey(0,r)),e.multipleOf=(r,a)=>e.check(uE(r,a)),e.step=(r,a)=>e.check(uE(r,a)),e.finite=()=>e;const n=e._zod.bag;e.minValue=Math.max(n.minimum??Number.NEGATIVE_INFINITY,n.exclusiveMinimum??Number.NEGATIVE_INFINITY)??null,e.maxValue=Math.min(n.maximum??Number.POSITIVE_INFINITY,n.exclusiveMaximum??Number.POSITIVE_INFINITY)??null,e.isInt=(n.format??"").includes("int")||Number.isSafeInteger(n.multipleOf??.5),e.isFinite=!0,e.format=n.format??null});function tt(e){return iY(Gx,e)}const nX=ee("ZodNumberFormat",(e,t)=>{cQ.init(e,t),Gx.init(e,t)});function fE(e){return oY(nX,e)}const rX=ee("ZodBoolean",(e,t)=>{uQ.init(e,t),$t.init(e,t)});function kt(e){return lY(rX,e)}const aX=ee("ZodNull",(e,t)=>{dQ.init(e,t),$t.init(e,t)});function iX(e){return cY(aX,e)}const sX=ee("ZodAny",(e,t)=>{fQ.init(e,t),$t.init(e,t)});function oX(){return uY(sX)}const lX=ee("ZodUnknown",(e,t)=>{hQ.init(e,t),$t.init(e,t)});function Pt(){return dY(lX)}const cX=ee("ZodNever",(e,t)=>{mQ.init(e,t),$t.init(e,t)});function uX(e){return fY(cX,e)}const dX=ee("ZodArray",(e,t)=>{pQ.init(e,t),$t.init(e,t),e.element=t.element,e.min=(n,r)=>e.check(um(n,r)),e.nonempty=n=>e.check(um(1,n)),e.max=(n,r)=>e.check(BO(n,r)),e.length=(n,r)=>e.check(VO(n,r)),e.unwrap=()=>e.element});function he(e,t){return _Y(dX,e,t)}const QO=ee("ZodObject",(e,t)=>{gQ.init(e,t),$t.init(e,t),Ct(e,"shape",()=>t.shape),e.keyof=()=>xr(Object.keys(e._zod.def.shape)),e.catchall=n=>e.clone({...e._zod.def,catchall:n}),e.passthrough=()=>e.clone({...e._zod.def,catchall:Pt()}),e.loose=()=>e.clone({...e._zod.def,catchall:Pt()}),e.strict=()=>e.clone({...e._zod.def,catchall:uX()}),e.strip=()=>e.clone({...e._zod.def,catchall:void 0}),e.extend=n=>FZ(e,n),e.merge=n=>qZ(e,n),e.pick=n=>LZ(e,n),e.omit=n=>UZ(e,n),e.partial=(...n)=>HZ(JO,e,n[0]),e.required=(...n)=>BZ(eM,e,n[0])});function me(e,t){const n={type:"object",get shape(){return wp(this,"shape",{...e}),this.shape},...ye(t)};return new QO(n)}function xn(e,t){return new QO({type:"object",get shape(){return wp(this,"shape",{...e}),this.shape},catchall:Pt(),...ye(t)})}const YO=ee("ZodUnion",(e,t)=>{qO.init(e,t),$t.init(e,t),e.options=t.options});function Ot(e,t){return new YO({type:"union",options:e,...ye(t)})}const fX=ee("ZodDiscriminatedUnion",(e,t)=>{YO.init(e,t),yQ.init(e,t)});function XO(e,t,n){return new fX({type:"union",options:t,discriminator:e,...ye(n)})}const hX=ee("ZodIntersection",(e,t)=>{vQ.init(e,t),$t.init(e,t)});function Qx(e,t){return new hX({type:"intersection",left:e,right:t})}const mX=ee("ZodRecord",(e,t)=>{bQ.init(e,t),$t.init(e,t),e.keyType=t.keyType,e.valueType=t.valueType});function Nt(e,t,n){return new mX({type:"record",keyType:e,valueType:t,...ye(n)})}const r0=ee("ZodEnum",(e,t)=>{xQ.init(e,t),$t.init(e,t),e.enum=t.entries,e.options=Object.values(t.entries);const n=new Set(Object.keys(t.entries));e.extract=(r,a)=>{const i={};for(const s of r)if(n.has(s))i[s]=t.entries[s];else throw new Error(`Key ${s} not found in enum`);return new r0({...t,checks:[],...ye(a),entries:i})},e.exclude=(r,a)=>{const i={...t.entries};for(const s of r)if(n.has(s))delete i[s];else throw new Error(`Key ${s} not found in enum`);return new r0({...t,checks:[],...ye(a),entries:i})}});function xr(e,t){const n=Array.isArray(e)?Object.fromEntries(e.map(r=>[r,r])):e;return new r0({type:"enum",entries:n,...ye(t)})}const pX=ee("ZodLiteral",(e,t)=>{wQ.init(e,t),$t.init(e,t),e.values=new Set(t.values),Object.defineProperty(e,"value",{get(){if(t.values.length>1)throw new Error("This schema contains multiple valid literal values. Use `.values` instead.");return t.values[0]}})});function be(e,t){return new pX({type:"literal",values:Array.isArray(e)?e:[e],...ye(t)})}const gX=ee("ZodTransform",(e,t)=>{SQ.init(e,t),$t.init(e,t),e._zod.parse=(n,r)=>{n.addIssue=i=>{if(typeof i=="string")n.issues.push(Wu(i,n.value,t));else{const s=i;s.fatal&&(s.continue=!1),s.code??(s.code="custom"),s.input??(s.input=n.value),s.inst??(s.inst=e),s.continue??(s.continue=!0),n.issues.push(Wu(s))}};const a=t.transform(n.value,n);return a instanceof Promise?a.then(i=>(n.value=i,n)):(n.value=a,n)}});function WO(e){return new gX({type:"transform",transform:e})}const JO=ee("ZodOptional",(e,t)=>{_Q.init(e,t),$t.init(e,t),e.unwrap=()=>e._zod.def.innerType});function Mt(e){return new JO({type:"optional",innerType:e})}const yX=ee("ZodNullable",(e,t)=>{kQ.init(e,t),$t.init(e,t),e.unwrap=()=>e._zod.def.innerType});function hE(e){return new yX({type:"nullable",innerType:e})}const vX=ee("ZodDefault",(e,t)=>{EQ.init(e,t),$t.init(e,t),e.unwrap=()=>e._zod.def.innerType,e.removeDefault=e.unwrap});function bX(e,t){return new vX({type:"default",innerType:e,get defaultValue(){return typeof t=="function"?t():t}})}const xX=ee("ZodPrefault",(e,t)=>{CQ.init(e,t),$t.init(e,t),e.unwrap=()=>e._zod.def.innerType});function wX(e,t){return new xX({type:"prefault",innerType:e,get defaultValue(){return typeof t=="function"?t():t}})}const eM=ee("ZodNonOptional",(e,t)=>{NQ.init(e,t),$t.init(e,t),e.unwrap=()=>e._zod.def.innerType});function SX(e,t){return new eM({type:"nonoptional",innerType:e,...ye(t)})}const _X=ee("ZodCatch",(e,t)=>{jQ.init(e,t),$t.init(e,t),e.unwrap=()=>e._zod.def.innerType,e.removeCatch=e.unwrap});function kX(e,t){return new _X({type:"catch",innerType:e,catchValue:typeof t=="function"?t:()=>t})}const EX=ee("ZodPipe",(e,t)=>{TQ.init(e,t),$t.init(e,t),e.in=t.in,e.out=t.out});function a0(e,t){return new EX({type:"pipe",in:e,out:t})}const CX=ee("ZodReadonly",(e,t)=>{AQ.init(e,t),$t.init(e,t)});function NX(e){return new CX({type:"readonly",innerType:e})}const tM=ee("ZodCustom",(e,t)=>{RQ.init(e,t),$t.init(e,t)});function jX(e){const t=new rr({check:"custom"});return t._zod.check=e,t}function TX(e,t){return kY(tM,e??(()=>!0),t)}function AX(e,t={}){return EY(tM,e,t)}function RX(e){const t=jX(n=>(n.addIssue=r=>{if(typeof r=="string")n.issues.push(Wu(r,n.value,t._zod.def));else{const a=r;a.fatal&&(a.continue=!1),a.code??(a.code="custom"),a.input??(a.input=n.value),a.inst??(a.inst=t),a.continue??(a.continue=!t._zod.def.abort),n.issues.push(Wu(a))}},e(n.value,n)));return t}function nM(e,t){return a0(WO(e),t)}const $X={custom:"custom"};function OX(e){return sY(Gx,e)}const kp="2025-11-25",MX=[kp,"2025-06-18","2025-03-26","2024-11-05","2024-10-07"],Ds="io.modelcontextprotocol/related-task",Ep="2.0",en=TX(e=>e!==null&&(typeof e=="object"||typeof e=="function")),rM=Ot([H(),tt().int()]),aM=H();xn({ttl:tt().optional(),pollInterval:tt().optional()});const PX=me({ttl:tt().optional()}),DX=me({taskId:H()}),Yx=xn({progressToken:rM.optional(),[Ds]:DX.optional()}),wr=me({_meta:Yx.optional()}),Rd=wr.extend({task:PX.optional()}),zX=e=>Rd.safeParse(e).success,_n=me({method:H(),params:wr.loose().optional()}),Ur=me({_meta:Yx.optional()}),Fr=me({method:H(),params:Ur.loose().optional()}),kn=xn({_meta:Yx.optional()}),Cp=Ot([H(),tt().int()]),iM=me({jsonrpc:be(Ep),id:Cp,..._n.shape}).strict(),i0=e=>iM.safeParse(e).success,sM=me({jsonrpc:be(Ep),...Fr.shape}).strict(),IX=e=>sM.safeParse(e).success,Xx=me({jsonrpc:be(Ep),id:Cp,result:kn}).strict(),Wc=e=>Xx.safeParse(e).success;var Oe;(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"})(Oe||(Oe={}));const Wx=me({jsonrpc:be(Ep),id:Cp.optional(),error:me({code:tt().int(),message:H(),data:Pt().optional()})}).strict(),LX=e=>Wx.safeParse(e).success,ah=Ot([iM,sM,Xx,Wx]);Ot([Xx,Wx]);const ll=kn.strict(),UX=Ur.extend({requestId:Cp.optional(),reason:H().optional()}),Jx=Fr.extend({method:be("notifications/cancelled"),params:UX}),FX=me({src:H(),mimeType:H().optional(),sizes:he(H()).optional(),theme:xr(["light","dark"]).optional()}),$d=me({icons:he(FX).optional()}),nc=me({name:H(),title:H().optional()}),oM=nc.extend({...nc.shape,...$d.shape,version:H(),websiteUrl:H().optional(),description:H().optional()}),qX=Qx(me({applyDefaults:kt().optional()}),Nt(H(),Pt())),HX=nM(e=>e&&typeof e=="object"&&!Array.isArray(e)&&Object.keys(e).length===0?{form:{}}:e,Qx(me({form:qX.optional(),url:en.optional()}),Nt(H(),Pt()).optional())),BX=xn({list:en.optional(),cancel:en.optional(),requests:xn({sampling:xn({createMessage:en.optional()}).optional(),elicitation:xn({create:en.optional()}).optional()}).optional()}),VX=xn({list:en.optional(),cancel:en.optional(),requests:xn({tools:xn({call:en.optional()}).optional()}).optional()}),KX=me({experimental:Nt(H(),en).optional(),sampling:me({context:en.optional(),tools:en.optional()}).optional(),elicitation:HX.optional(),roots:me({listChanged:kt().optional()}).optional(),tasks:BX.optional(),extensions:Nt(H(),en).optional()}),ZX=wr.extend({protocolVersion:H(),capabilities:KX,clientInfo:oM}),GX=_n.extend({method:be("initialize"),params:ZX}),QX=me({experimental:Nt(H(),en).optional(),logging:en.optional(),completions:en.optional(),prompts:me({listChanged:kt().optional()}).optional(),resources:me({subscribe:kt().optional(),listChanged:kt().optional()}).optional(),tools:me({listChanged:kt().optional()}).optional(),tasks:VX.optional(),extensions:Nt(H(),en).optional()}),lM=kn.extend({protocolVersion:H(),capabilities:QX,serverInfo:oM,instructions:H().optional()}),cM=Fr.extend({method:be("notifications/initialized"),params:Ur.optional()}),YX=e=>cM.safeParse(e).success,ew=_n.extend({method:be("ping"),params:wr.optional()}),XX=me({progress:tt(),total:Mt(tt()),message:Mt(H())}),WX=me({...Ur.shape,...XX.shape,progressToken:rM}),tw=Fr.extend({method:be("notifications/progress"),params:WX}),JX=wr.extend({cursor:aM.optional()}),Od=_n.extend({params:JX.optional()}),Md=kn.extend({nextCursor:aM.optional()}),eW=xr(["working","input_required","completed","failed","cancelled"]),Pd=me({taskId:H(),status:eW,ttl:Ot([tt(),iX()]),createdAt:H(),lastUpdatedAt:H(),pollInterval:Mt(tt()),statusMessage:Mt(H())}),Ju=kn.extend({task:Pd}),tW=Ur.merge(Pd),dm=Fr.extend({method:be("notifications/tasks/status"),params:tW}),nw=_n.extend({method:be("tasks/get"),params:wr.extend({taskId:H()})}),rw=kn.merge(Pd),aw=_n.extend({method:be("tasks/result"),params:wr.extend({taskId:H()})});kn.loose();const iw=Od.extend({method:be("tasks/list")}),sw=Md.extend({tasks:he(Pd)}),ow=_n.extend({method:be("tasks/cancel"),params:wr.extend({taskId:H()})}),nW=kn.merge(Pd),uM=me({uri:H(),mimeType:Mt(H()),_meta:Nt(H(),Pt()).optional()}),dM=uM.extend({text:H()}),lw=H().refine(e=>{try{return atob(e),!0}catch{return!1}},{message:"Invalid Base64 string"}),fM=uM.extend({blob:lw}),Dd=xr(["user","assistant"]),_c=me({audience:he(Dd).optional(),priority:tt().min(0).max(1).optional(),lastModified:KO({offset:!0}).optional()}),hM=me({...nc.shape,...$d.shape,uri:H(),description:Mt(H()),mimeType:Mt(H()),size:Mt(tt()),annotations:_c.optional(),_meta:Mt(xn({}))}),rW=me({...nc.shape,...$d.shape,uriTemplate:H(),description:Mt(H()),mimeType:Mt(H()),annotations:_c.optional(),_meta:Mt(xn({}))}),aW=Od.extend({method:be("resources/list")}),fm=Md.extend({resources:he(hM)}),iW=Od.extend({method:be("resources/templates/list")}),mM=Md.extend({resourceTemplates:he(rW)}),cw=wr.extend({uri:H()}),sW=cw,oW=_n.extend({method:be("resources/read"),params:sW}),uw=kn.extend({contents:he(Ot([dM,fM]))}),pM=Fr.extend({method:be("notifications/resources/list_changed"),params:Ur.optional()}),lW=cw,cW=_n.extend({method:be("resources/subscribe"),params:lW}),uW=cw,dW=_n.extend({method:be("resources/unsubscribe"),params:uW}),fW=Ur.extend({uri:H()}),hW=Fr.extend({method:be("notifications/resources/updated"),params:fW}),mW=me({name:H(),description:Mt(H()),required:Mt(kt())}),pW=me({...nc.shape,...$d.shape,description:Mt(H()),arguments:Mt(he(mW)),_meta:Mt(xn({}))}),gW=Od.extend({method:be("prompts/list")}),hm=Md.extend({prompts:he(pW)}),yW=wr.extend({name:H(),arguments:Nt(H(),H()).optional()}),vW=_n.extend({method:be("prompts/get"),params:yW}),dw=me({type:be("text"),text:H(),annotations:_c.optional(),_meta:Nt(H(),Pt()).optional()}),fw=me({type:be("image"),data:lw,mimeType:H(),annotations:_c.optional(),_meta:Nt(H(),Pt()).optional()}),hw=me({type:be("audio"),data:lw,mimeType:H(),annotations:_c.optional(),_meta:Nt(H(),Pt()).optional()}),bW=me({type:be("tool_use"),name:H(),id:H(),input:Nt(H(),Pt()),_meta:Nt(H(),Pt()).optional()}),xW=me({type:be("resource"),resource:Ot([dM,fM]),annotations:_c.optional(),_meta:Nt(H(),Pt()).optional()}),wW=hM.extend({type:be("resource_link")}),mw=Ot([dw,fw,hw,wW,xW]),SW=me({role:Dd,content:mw}),pw=kn.extend({description:H().optional(),messages:he(SW)}),gM=Fr.extend({method:be("notifications/prompts/list_changed"),params:Ur.optional()}),_W=me({title:H().optional(),readOnlyHint:kt().optional(),destructiveHint:kt().optional(),idempotentHint:kt().optional(),openWorldHint:kt().optional()}),kW=me({taskSupport:xr(["required","optional","forbidden"]).optional()}),yM=me({...nc.shape,...$d.shape,description:H().optional(),inputSchema:me({type:be("object"),properties:Nt(H(),en).optional(),required:he(H()).optional()}).catchall(Pt()),outputSchema:me({type:be("object"),properties:Nt(H(),en).optional(),required:he(H()).optional()}).catchall(Pt()).optional(),annotations:_W.optional(),execution:kW.optional(),_meta:Nt(H(),Pt()).optional()}),EW=Od.extend({method:be("tools/list")}),gw=Md.extend({tools:he(yM)}),zd=kn.extend({content:he(mw).default([]),structuredContent:Nt(H(),Pt()).optional(),isError:kt().optional()});zd.or(kn.extend({toolResult:Pt()}));const CW=Rd.extend({name:H(),arguments:Nt(H(),Pt()).optional()}),NW=_n.extend({method:be("tools/call"),params:CW}),vM=Fr.extend({method:be("notifications/tools/list_changed"),params:Ur.optional()}),jW=me({autoRefresh:kt().default(!0),debounceMs:tt().int().nonnegative().default(300)}),bM=xr(["debug","info","notice","warning","error","critical","alert","emergency"]),TW=wr.extend({level:bM}),AW=_n.extend({method:be("logging/setLevel"),params:TW}),RW=Ur.extend({level:bM,logger:H().optional(),data:Pt()}),$W=Fr.extend({method:be("notifications/message"),params:RW}),OW=me({name:H().optional()}),MW=me({hints:he(OW).optional(),costPriority:tt().min(0).max(1).optional(),speedPriority:tt().min(0).max(1).optional(),intelligencePriority:tt().min(0).max(1).optional()}),PW=me({mode:xr(["auto","required","none"]).optional()}),DW=me({type:be("tool_result"),toolUseId:H().describe("The unique identifier for the corresponding tool call."),content:he(mw).default([]),structuredContent:me({}).loose().optional(),isError:kt().optional(),_meta:Nt(H(),Pt()).optional()}),zW=XO("type",[dw,fw,hw]),mm=XO("type",[dw,fw,hw,bW,DW]),IW=me({role:Dd,content:Ot([mm,he(mm)]),_meta:Nt(H(),Pt()).optional()}),LW=Rd.extend({messages:he(IW),modelPreferences:MW.optional(),systemPrompt:H().optional(),includeContext:xr(["none","thisServer","allServers"]).optional(),temperature:tt().optional(),maxTokens:tt().int(),stopSequences:he(H()).optional(),metadata:en.optional(),tools:he(yM).optional(),toolChoice:PW.optional()}),xM=_n.extend({method:be("sampling/createMessage"),params:LW}),wM=kn.extend({model:H(),stopReason:Mt(xr(["endTurn","stopSequence","maxTokens"]).or(H())),role:Dd,content:zW}),SM=kn.extend({model:H(),stopReason:Mt(xr(["endTurn","stopSequence","maxTokens","toolUse"]).or(H())),role:Dd,content:Ot([mm,he(mm)])}),UW=me({type:be("boolean"),title:H().optional(),description:H().optional(),default:kt().optional()}),FW=me({type:be("string"),title:H().optional(),description:H().optional(),minLength:tt().optional(),maxLength:tt().optional(),format:xr(["email","uri","date","date-time"]).optional(),default:H().optional()}),qW=me({type:xr(["number","integer"]),title:H().optional(),description:H().optional(),minimum:tt().optional(),maximum:tt().optional(),default:tt().optional()}),HW=me({type:be("string"),title:H().optional(),description:H().optional(),enum:he(H()),default:H().optional()}),BW=me({type:be("string"),title:H().optional(),description:H().optional(),oneOf:he(me({const:H(),title:H()})),default:H().optional()}),VW=me({type:be("string"),title:H().optional(),description:H().optional(),enum:he(H()),enumNames:he(H()).optional(),default:H().optional()}),KW=Ot([HW,BW]),ZW=me({type:be("array"),title:H().optional(),description:H().optional(),minItems:tt().optional(),maxItems:tt().optional(),items:me({type:be("string"),enum:he(H())}),default:he(H()).optional()}),GW=me({type:be("array"),title:H().optional(),description:H().optional(),minItems:tt().optional(),maxItems:tt().optional(),items:me({anyOf:he(me({const:H(),title:H()}))}),default:he(H()).optional()}),QW=Ot([ZW,GW]),YW=Ot([VW,KW,QW]),XW=Ot([YW,UW,FW,qW]),WW=Rd.extend({mode:be("form").optional(),message:H(),requestedSchema:me({type:be("object"),properties:Nt(H(),XW),required:he(H()).optional()})}),JW=Rd.extend({mode:be("url"),message:H(),elicitationId:H(),url:H().url()}),eJ=Ot([WW,JW]),_M=_n.extend({method:be("elicitation/create"),params:eJ}),tJ=Ur.extend({elicitationId:H()}),nJ=Fr.extend({method:be("notifications/elicitation/complete"),params:tJ}),kM=kn.extend({action:xr(["accept","decline","cancel"]),content:nM(e=>e===null?void 0:e,Nt(H(),Ot([H(),tt(),kt(),he(H())])).optional())}),rJ=me({type:be("ref/resource"),uri:H()}),aJ=me({type:be("ref/prompt"),name:H()}),iJ=wr.extend({ref:Ot([aJ,rJ]),argument:me({name:H(),value:H()}),context:me({arguments:Nt(H(),H()).optional()}).optional()}),sJ=_n.extend({method:be("completion/complete"),params:iJ}),EM=kn.extend({completion:xn({values:he(H()).max(100),total:Mt(tt().int()),hasMore:Mt(kt())})}),oJ=me({uri:H().startsWith("file://"),name:H().optional(),_meta:Nt(H(),Pt()).optional()}),lJ=_n.extend({method:be("roots/list"),params:wr.optional()}),cJ=kn.extend({roots:he(oJ)}),uJ=Fr.extend({method:be("notifications/roots/list_changed"),params:Ur.optional()});Ot([ew,GX,sJ,AW,vW,gW,aW,iW,oW,cW,dW,NW,EW,nw,aw,iw,ow]);Ot([Jx,tw,cM,uJ,dm]);Ot([ll,wM,SM,kM,cJ,rw,sw,Ju]);Ot([ew,xM,_M,lJ,nw,aw,iw,ow]);Ot([Jx,tw,$W,hW,pM,vM,gM,dm,nJ]);Ot([ll,lM,EM,pw,hm,fm,mM,uw,zd,gw,rw,sw,Ju]);class Ne extends Error{constructor(t,n,r){super(`MCP error ${t}: ${n}`),this.code=t,this.data=r,this.name="McpError"}static fromError(t,n,r){if(t===Oe.UrlElicitationRequired&&r){const a=r;if(a.elicitations)return new dJ(a.elicitations,n)}return new Ne(t,n,r)}}class dJ extends Ne{constructor(t,n=`URL elicitation${t.length>1?"s":""} required`){super(Oe.UrlElicitationRequired,n,{elicitations:t})}get elicitations(){var t;return((t=this.data)==null?void 0:t.elicitations)??[]}}class mE extends Error{constructor(t,n){super(t),this.name="ParseError",this.type=n.type,this.field=n.field,this.value=n.value,this.line=n.line}}function ny(e){}function CM(e){if(typeof e=="function")throw new TypeError("`callbacks` must be an object, got a function instead. Did you mean `{onEvent: fn}`?");const{onEvent:t=ny,onError:n=ny,onRetry:r=ny,onComment:a}=e;let i="",s=!0,o,l="",u="";function d(p){const b=s?p.replace(/^\xEF\xBB\xBF/,""):p,[g,v]=fJ(`${i}${b}`);for(const w of g)f(w);i=v,s=!1}function f(p){if(p===""){h();return}if(p.startsWith(":")){a&&a(p.slice(p.startsWith(": ")?2:1));return}const b=p.indexOf(":");if(b!==-1){const g=p.slice(0,b),v=p[b+1]===" "?2:1,w=p.slice(b+v);m(g,w,p);return}m(p,"",p)}function m(p,b,g){switch(p){case"event":u=b;break;case"data":l=`${l}${b}
479
+ `;break;case"id":o=b.includes("\0")?void 0:b;break;case"retry":/^\d+$/.test(b)?r(parseInt(b,10)):n(new mE(`Invalid \`retry\` value: "${b}"`,{type:"invalid-retry",value:b,line:g}));break;default:n(new mE(`Unknown field "${p.length>20?`${p.slice(0,20)}…`:p}"`,{type:"unknown-field",field:p,value:b,line:g}));break}}function h(){l.length>0&&t({id:o,event:u||void 0,data:l.endsWith(`
480
+ `)?l.slice(0,-1):l}),o=void 0,l="",u=""}function y(p={}){i&&p.consume&&f(i),s=!0,o=void 0,l="",u="",i=""}return{feed:d,reset:y}}function fJ(e){const t=[];let n="",r=0;for(;r<e.length;){const a=e.indexOf("\r",r),i=e.indexOf(`
481
+ `,r);let s=-1;if(a!==-1&&i!==-1?s=Math.min(a,i):a!==-1?a===e.length-1?s=-1:s=a:i!==-1&&(s=i),s===-1){n=e.slice(r);break}else{const o=e.slice(r,s);t.push(o),r=s+1,e[r-1]==="\r"&&e[r]===`
482
+ `&&r++}}return[t,n]}class pE extends Event{constructor(t,n){var r,a;super(t),this.code=(r=n==null?void 0:n.code)!=null?r:void 0,this.message=(a=n==null?void 0:n.message)!=null?a:void 0}[Symbol.for("nodejs.util.inspect.custom")](t,n,r){return r(gE(this),n)}[Symbol.for("Deno.customInspect")](t,n){return t(gE(this),n)}}function hJ(e){const t=globalThis.DOMException;return typeof t=="function"?new t(e,"SyntaxError"):new SyntaxError(e)}function s0(e){return e instanceof Error?"errors"in e&&Array.isArray(e.errors)?e.errors.map(s0).join(", "):"cause"in e&&e.cause instanceof Error?`${e}: ${s0(e.cause)}`:e.message:`${e}`}function gE(e){return{type:e.type,message:e.message,code:e.code,defaultPrevented:e.defaultPrevented,cancelable:e.cancelable,timeStamp:e.timeStamp}}var NM=e=>{throw TypeError(e)},yw=(e,t,n)=>t.has(e)||NM("Cannot "+n),He=(e,t,n)=>(yw(e,t,"read from private field"),n?n.call(e):t.get(e)),Yt=(e,t,n)=>t.has(e)?NM("Cannot add the same private member more than once"):t instanceof WeakSet?t.add(e):t.set(e,n),At=(e,t,n,r)=>(yw(e,t,"write to private field"),t.set(e,n),n),La=(e,t,n)=>(yw(e,t,"access private method"),n),Xn,Ls,Vo,ih,pm,Eu,cl,Cu,Pi,Ko,Sl,Zo,Jc,Zr,o0,l0,c0,yE,u0,d0,eu,f0,h0;class sh extends EventTarget{constructor(t,n){var r,a;super(),Yt(this,Zr),this.CONNECTING=0,this.OPEN=1,this.CLOSED=2,Yt(this,Xn),Yt(this,Ls),Yt(this,Vo),Yt(this,ih),Yt(this,pm),Yt(this,Eu),Yt(this,cl),Yt(this,Cu,null),Yt(this,Pi),Yt(this,Ko),Yt(this,Sl,null),Yt(this,Zo,null),Yt(this,Jc,null),Yt(this,l0,async i=>{var s;He(this,Ko).reset();const{body:o,redirected:l,status:u,headers:d}=i;if(u===204){La(this,Zr,eu).call(this,"Server sent HTTP 204, not reconnecting",204),this.close();return}if(l?At(this,Vo,new URL(i.url)):At(this,Vo,void 0),u!==200){La(this,Zr,eu).call(this,`Non-200 status code (${u})`,u);return}if(!(d.get("content-type")||"").startsWith("text/event-stream")){La(this,Zr,eu).call(this,'Invalid content type, expected "text/event-stream"',u);return}if(He(this,Xn)===this.CLOSED)return;At(this,Xn,this.OPEN);const f=new Event("open");if((s=He(this,Jc))==null||s.call(this,f),this.dispatchEvent(f),typeof o!="object"||!o||!("getReader"in o)){La(this,Zr,eu).call(this,"Invalid response body, expected a web ReadableStream",u),this.close();return}const m=new TextDecoder,h=o.getReader();let y=!0;do{const{done:p,value:b}=await h.read();b&&He(this,Ko).feed(m.decode(b,{stream:!p})),p&&(y=!1,He(this,Ko).reset(),La(this,Zr,f0).call(this))}while(y)}),Yt(this,c0,i=>{At(this,Pi,void 0),!(i.name==="AbortError"||i.type==="aborted")&&La(this,Zr,f0).call(this,s0(i))}),Yt(this,u0,i=>{typeof i.id=="string"&&At(this,Cu,i.id);const s=new MessageEvent(i.event||"message",{data:i.data,origin:He(this,Vo)?He(this,Vo).origin:He(this,Ls).origin,lastEventId:i.id||""});He(this,Zo)&&(!i.event||i.event==="message")&&He(this,Zo).call(this,s),this.dispatchEvent(s)}),Yt(this,d0,i=>{At(this,Eu,i)}),Yt(this,h0,()=>{At(this,cl,void 0),He(this,Xn)===this.CONNECTING&&La(this,Zr,o0).call(this)});try{if(t instanceof URL)At(this,Ls,t);else if(typeof t=="string")At(this,Ls,new URL(t,mJ()));else throw new Error("Invalid URL")}catch{throw hJ("An invalid or illegal string was specified")}At(this,Ko,CM({onEvent:He(this,u0),onRetry:He(this,d0)})),At(this,Xn,this.CONNECTING),At(this,Eu,3e3),At(this,pm,(r=n==null?void 0:n.fetch)!=null?r:globalThis.fetch),At(this,ih,(a=n==null?void 0:n.withCredentials)!=null?a:!1),La(this,Zr,o0).call(this)}get readyState(){return He(this,Xn)}get url(){return He(this,Ls).href}get withCredentials(){return He(this,ih)}get onerror(){return He(this,Sl)}set onerror(t){At(this,Sl,t)}get onmessage(){return He(this,Zo)}set onmessage(t){At(this,Zo,t)}get onopen(){return He(this,Jc)}set onopen(t){At(this,Jc,t)}addEventListener(t,n,r){const a=n;super.addEventListener(t,a,r)}removeEventListener(t,n,r){const a=n;super.removeEventListener(t,a,r)}close(){He(this,cl)&&clearTimeout(He(this,cl)),He(this,Xn)!==this.CLOSED&&(He(this,Pi)&&He(this,Pi).abort(),At(this,Xn,this.CLOSED),At(this,Pi,void 0))}}Xn=new WeakMap,Ls=new WeakMap,Vo=new WeakMap,ih=new WeakMap,pm=new WeakMap,Eu=new WeakMap,cl=new WeakMap,Cu=new WeakMap,Pi=new WeakMap,Ko=new WeakMap,Sl=new WeakMap,Zo=new WeakMap,Jc=new WeakMap,Zr=new WeakSet,o0=function(){At(this,Xn,this.CONNECTING),At(this,Pi,new AbortController),He(this,pm)(He(this,Ls),La(this,Zr,yE).call(this)).then(He(this,l0)).catch(He(this,c0))},l0=new WeakMap,c0=new WeakMap,yE=function(){var e;const t={mode:"cors",redirect:"follow",headers:{Accept:"text/event-stream",...He(this,Cu)?{"Last-Event-ID":He(this,Cu)}:void 0},cache:"no-store",signal:(e=He(this,Pi))==null?void 0:e.signal};return"window"in globalThis&&(t.credentials=this.withCredentials?"include":"same-origin"),t},u0=new WeakMap,d0=new WeakMap,eu=function(e,t){var n;He(this,Xn)!==this.CLOSED&&At(this,Xn,this.CLOSED);const r=new pE("error",{code:t,message:e});(n=He(this,Sl))==null||n.call(this,r),this.dispatchEvent(r)},f0=function(e,t){var n;if(He(this,Xn)===this.CLOSED)return;At(this,Xn,this.CONNECTING);const r=new pE("error",{code:t,message:e});(n=He(this,Sl))==null||n.call(this,r),this.dispatchEvent(r),At(this,cl,setTimeout(He(this,h0),He(this,Eu)))},h0=new WeakMap,sh.CONNECTING=0,sh.OPEN=1,sh.CLOSED=2;function mJ(){const e="document"in globalThis?globalThis.document:void 0;return e&&typeof e=="object"&&"baseURI"in e&&typeof e.baseURI=="string"?e.baseURI:void 0}function gm(e){return e?e instanceof Headers?Object.fromEntries(e.entries()):Array.isArray(e)?Object.fromEntries(e):{...e}:{}}function jM(e=fetch,t){return t?async(n,r)=>{const a={...t,...r,headers:r!=null&&r.headers?{...gm(t.headers),...gm(r.headers)}:t.headers};return e(n,a)}:e}let vw;vw=globalThis.crypto;async function pJ(e){return(await vw).getRandomValues(new Uint8Array(e))}async function gJ(e){const t="abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ0123456789-._~";let n="";const r=await pJ(e);for(let a=0;a<e;a++){const i=r[a]%t.length;n+=t[i]}return n}async function yJ(e){return await gJ(e)}async function vJ(e){const t=await(await vw).subtle.digest("SHA-256",new TextEncoder().encode(e));return btoa(String.fromCharCode(...new Uint8Array(t))).replace(/\//g,"_").replace(/\+/g,"-").replace(/=/g,"")}async function bJ(e){if(e||(e=43),e<43||e>128)throw`Expected a length between 43 and 128. Received ${e}.`;const t=await yJ(e),n=await vJ(t);return{code_verifier:t,code_challenge:n}}const pn=UY().superRefine((e,t)=>{if(!URL.canParse(e))return t.addIssue({code:$X.custom,message:"URL must be parseable",fatal:!0}),RZ}).refine(e=>{const t=new URL(e);return t.protocol!=="javascript:"&&t.protocol!=="data:"&&t.protocol!=="vbscript:"},{message:"URL cannot use javascript:, data:, or vbscript: scheme"}),xJ=xn({resource:H().url(),authorization_servers:he(pn).optional(),jwks_uri:H().url().optional(),scopes_supported:he(H()).optional(),bearer_methods_supported:he(H()).optional(),resource_signing_alg_values_supported:he(H()).optional(),resource_name:H().optional(),resource_documentation:H().optional(),resource_policy_uri:H().url().optional(),resource_tos_uri:H().url().optional(),tls_client_certificate_bound_access_tokens:kt().optional(),authorization_details_types_supported:he(H()).optional(),dpop_signing_alg_values_supported:he(H()).optional(),dpop_bound_access_tokens_required:kt().optional()}),TM=xn({issuer:H(),authorization_endpoint:pn,token_endpoint:pn,registration_endpoint:pn.optional(),scopes_supported:he(H()).optional(),response_types_supported:he(H()),response_modes_supported:he(H()).optional(),grant_types_supported:he(H()).optional(),token_endpoint_auth_methods_supported:he(H()).optional(),token_endpoint_auth_signing_alg_values_supported:he(H()).optional(),service_documentation:pn.optional(),revocation_endpoint:pn.optional(),revocation_endpoint_auth_methods_supported:he(H()).optional(),revocation_endpoint_auth_signing_alg_values_supported:he(H()).optional(),introspection_endpoint:H().optional(),introspection_endpoint_auth_methods_supported:he(H()).optional(),introspection_endpoint_auth_signing_alg_values_supported:he(H()).optional(),code_challenge_methods_supported:he(H()).optional(),client_id_metadata_document_supported:kt().optional()}),wJ=xn({issuer:H(),authorization_endpoint:pn,token_endpoint:pn,userinfo_endpoint:pn.optional(),jwks_uri:pn,registration_endpoint:pn.optional(),scopes_supported:he(H()).optional(),response_types_supported:he(H()),response_modes_supported:he(H()).optional(),grant_types_supported:he(H()).optional(),acr_values_supported:he(H()).optional(),subject_types_supported:he(H()),id_token_signing_alg_values_supported:he(H()),id_token_encryption_alg_values_supported:he(H()).optional(),id_token_encryption_enc_values_supported:he(H()).optional(),userinfo_signing_alg_values_supported:he(H()).optional(),userinfo_encryption_alg_values_supported:he(H()).optional(),userinfo_encryption_enc_values_supported:he(H()).optional(),request_object_signing_alg_values_supported:he(H()).optional(),request_object_encryption_alg_values_supported:he(H()).optional(),request_object_encryption_enc_values_supported:he(H()).optional(),token_endpoint_auth_methods_supported:he(H()).optional(),token_endpoint_auth_signing_alg_values_supported:he(H()).optional(),display_values_supported:he(H()).optional(),claim_types_supported:he(H()).optional(),claims_supported:he(H()).optional(),service_documentation:H().optional(),claims_locales_supported:he(H()).optional(),ui_locales_supported:he(H()).optional(),claims_parameter_supported:kt().optional(),request_parameter_supported:kt().optional(),request_uri_parameter_supported:kt().optional(),require_request_uri_registration:kt().optional(),op_policy_uri:pn.optional(),op_tos_uri:pn.optional(),client_id_metadata_document_supported:kt().optional()}),SJ=me({...wJ.shape,...TM.pick({code_challenge_methods_supported:!0}).shape}),_J=me({access_token:H(),id_token:H().optional(),token_type:H(),expires_in:OX().optional(),scope:H().optional(),refresh_token:H().optional()}).strip(),kJ=me({error:H(),error_description:H().optional(),error_uri:H().optional()}),vE=pn.optional().or(be("").transform(()=>{})),EJ=me({redirect_uris:he(pn),token_endpoint_auth_method:H().optional(),grant_types:he(H()).optional(),response_types:he(H()).optional(),client_name:H().optional(),client_uri:pn.optional(),logo_uri:vE,scope:H().optional(),contacts:he(H()).optional(),tos_uri:vE,policy_uri:H().optional(),jwks_uri:pn.optional(),jwks:oX().optional(),software_id:H().optional(),software_version:H().optional(),software_statement:H().optional()}).strip(),CJ=me({client_id:H(),client_secret:H().optional(),client_id_issued_at:tt().optional(),client_secret_expires_at:tt().optional()}).strip(),NJ=EJ.merge(CJ);me({error:H(),error_description:H().optional()}).strip();me({token:H(),token_type_hint:H().optional()}).strip();function jJ(e){const t=typeof e=="string"?new URL(e):new URL(e.href);return t.hash="",t}function TJ({requestedResource:e,configuredResource:t}){const 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;const a=n.pathname.endsWith("/")?n.pathname:n.pathname+"/",i=r.pathname.endsWith("/")?r.pathname:r.pathname+"/";return a.startsWith(i)}class un extends Error{constructor(t,n){super(t),this.errorUri=n,this.name=this.constructor.name}toResponseObject(){const t={error:this.errorCode,error_description:this.message};return this.errorUri&&(t.error_uri=this.errorUri),t}get errorCode(){return this.constructor.errorCode}}class m0 extends un{}m0.errorCode="invalid_request";class ym extends un{}ym.errorCode="invalid_client";class vm extends un{}vm.errorCode="invalid_grant";class bm extends un{}bm.errorCode="unauthorized_client";class p0 extends un{}p0.errorCode="unsupported_grant_type";class g0 extends un{}g0.errorCode="invalid_scope";class y0 extends un{}y0.errorCode="access_denied";class rc extends un{}rc.errorCode="server_error";class v0 extends un{}v0.errorCode="temporarily_unavailable";class b0 extends un{}b0.errorCode="unsupported_response_type";class x0 extends un{}x0.errorCode="unsupported_token_type";class w0 extends un{}w0.errorCode="invalid_token";class S0 extends un{}S0.errorCode="method_not_allowed";class _0 extends un{}_0.errorCode="too_many_requests";class xm extends un{}xm.errorCode="invalid_client_metadata";class k0 extends un{}k0.errorCode="insufficient_scope";class E0 extends un{}E0.errorCode="invalid_target";const AJ={[m0.errorCode]:m0,[ym.errorCode]:ym,[vm.errorCode]:vm,[bm.errorCode]:bm,[p0.errorCode]:p0,[g0.errorCode]:g0,[y0.errorCode]:y0,[rc.errorCode]:rc,[v0.errorCode]:v0,[b0.errorCode]:b0,[x0.errorCode]:x0,[w0.errorCode]:w0,[S0.errorCode]:S0,[_0.errorCode]:_0,[xm.errorCode]:xm,[k0.errorCode]:k0,[E0.errorCode]:E0};class cr extends Error{constructor(t){super(t??"Unauthorized")}}function RJ(e){return["client_secret_basic","client_secret_post","none"].includes(e)}const ry="code",ay="S256";function $J(e,t){const n=e.client_secret!==void 0;return"token_endpoint_auth_method"in e&&e.token_endpoint_auth_method&&RJ(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 OJ(e,t,n,r){const{client_id:a,client_secret:i}=t;switch(e){case"client_secret_basic":MJ(a,i,n);return;case"client_secret_post":PJ(a,i,r);return;case"none":DJ(a,r);return;default:throw new Error(`Unsupported client authentication method: ${e}`)}}function MJ(e,t,n){if(!t)throw new Error("client_secret_basic authentication requires a client_secret");const r=btoa(`${e}:${t}`);n.set("Authorization",`Basic ${r}`)}function PJ(e,t,n){n.set("client_id",e),t&&n.set("client_secret",t)}function DJ(e,t){t.set("client_id",e)}async function AM(e){const t=e instanceof Response?e.status:void 0,n=e instanceof Response?await e.text():e;try{const r=kJ.parse(JSON.parse(n)),{error:a,error_description:i,error_uri:s}=r,o=AJ[a]||rc;return new o(i||"",s)}catch(r){const a=`${t?`HTTP ${t}: `:""}Invalid OAuth error response: ${r}. Raw body: ${n}`;return new rc(a)}}async function Jr(e,t){var n,r;try{return await iy(e,t)}catch(a){if(a instanceof ym||a instanceof bm)return await((n=e.invalidateCredentials)==null?void 0:n.call(e,"all")),await iy(e,t);if(a instanceof vm)return await((r=e.invalidateCredentials)==null?void 0:r.call(e,"tokens")),await iy(e,t);throw a}}async function iy(e,{serverUrl:t,authorizationCode:n,scope:r,resourceMetadataUrl:a,fetchFn:i}){var w,S,E,C,T;const s=await((w=e.discoveryState)==null?void 0:w.call(e));let o,l,u,d=a;if(!d&&(s!=null&&s.resourceMetadataUrl)&&(d=new URL(s.resourceMetadataUrl)),s!=null&&s.authorizationServerUrl){if(l=s.authorizationServerUrl,o=s.resourceMetadata,u=s.authorizationServerMetadata??await $M(l,{fetchFn:i}),!o)try{o=await RM(t,{resourceMetadataUrl:d},i)}catch{}(u!==s.authorizationServerMetadata||o!==s.resourceMetadata)&&await((S=e.saveDiscoveryState)==null?void 0:S.call(e,{authorizationServerUrl:String(l),resourceMetadataUrl:d==null?void 0:d.toString(),resourceMetadata:o,authorizationServerMetadata:u}))}else{const P=await HJ(t,{resourceMetadataUrl:d,fetchFn:i});l=P.authorizationServerUrl,u=P.authorizationServerMetadata,o=P.resourceMetadata,await((E=e.saveDiscoveryState)==null?void 0:E.call(e,{authorizationServerUrl:String(l),resourceMetadataUrl:d==null?void 0:d.toString(),resourceMetadata:o,authorizationServerMetadata:u}))}const f=await IJ(t,e,o),m=r||((C=o==null?void 0:o.scopes_supported)==null?void 0:C.join(" "))||e.clientMetadata.scope;let h=await Promise.resolve(e.clientInformation());if(!h){if(n!==void 0)throw new Error("Existing OAuth client information is required when exchanging an authorization code");const P=(u==null?void 0:u.client_id_metadata_document_supported)===!0,R=e.clientMetadataUrl;if(R&&!zJ(R))throw new xm(`clientMetadataUrl must be a valid HTTPS URL with a non-root pathname, got: ${R}`);if(P&&R)h={client_id:R},await((T=e.saveClientInformation)==null?void 0:T.call(e,h));else{if(!e.saveClientInformation)throw new Error("OAuth client information must be saveable for dynamic registration");const j=await GJ(l,{metadata:u,clientMetadata:e.clientMetadata,scope:m,fetchFn:i});await e.saveClientInformation(j),h=j}}const y=!e.redirectUrl;if(n!==void 0||y){const P=await ZJ(e,l,{metadata:u,resource:f,authorizationCode:n,fetchFn:i});return await e.saveTokens(P),"AUTHORIZED"}const p=await e.tokens();if(p!=null&&p.refresh_token)try{const P=await KJ(l,{metadata:u,clientInformation:h,refreshToken:p.refresh_token,resource:f,addClientAuthentication:e.addClientAuthentication,fetchFn:i});return await e.saveTokens(P),"AUTHORIZED"}catch(P){if(!(!(P instanceof un)||P instanceof rc))throw P}const b=e.state?await e.state():void 0,{authorizationUrl:g,codeVerifier:v}=await BJ(l,{metadata:u,clientInformation:h,state:b,redirectUrl:e.redirectUrl,scope:m,resource:f});return await e.saveCodeVerifier(v),await e.redirectToAuthorization(g),"REDIRECT"}function zJ(e){if(!e)return!1;try{const t=new URL(e);return t.protocol==="https:"&&t.pathname!=="/"}catch{return!1}}async function IJ(e,t,n){const r=jJ(e);if(t.validateResourceURL)return await t.validateResourceURL(r,n==null?void 0:n.resource);if(n){if(!TJ({requestedResource:r,configuredResource:n.resource}))throw new Error(`Protected resource ${n.resource} does not match expected ${r} (or origin)`);return new URL(n.resource)}}function wm(e){const t=e.headers.get("WWW-Authenticate");if(!t)return{};const[n,r]=t.split(" ");if(n.toLowerCase()!=="bearer"||!r)return{};const a=sy(e,"resource_metadata")||void 0;let i;if(a)try{i=new URL(a)}catch{}const s=sy(e,"scope")||void 0,o=sy(e,"error")||void 0;return{resourceMetadataUrl:i,scope:s,error:o}}function sy(e,t){const n=e.headers.get("WWW-Authenticate");if(!n)return null;const r=new RegExp(`${t}=(?:"([^"]+)"|([^\\s,]+))`),a=n.match(r);return a?a[1]||a[2]:null}async function RM(e,t,n=fetch){var a,i;const r=await FJ(e,"oauth-protected-resource",n,{protocolVersion:t==null?void 0:t.protocolVersion,metadataUrl:t==null?void 0:t.resourceMetadataUrl});if(!r||r.status===404)throw await((a=r==null?void 0:r.body)==null?void 0:a.cancel()),new Error("Resource server does not implement OAuth 2.0 Protected Resource Metadata.");if(!r.ok)throw await((i=r.body)==null?void 0:i.cancel()),new Error(`HTTP ${r.status} trying to load well-known OAuth protected resource metadata.`);return xJ.parse(await r.json())}async function bw(e,t,n=fetch){try{return await n(e,{headers:t})}catch(r){if(r instanceof TypeError)return t?bw(e,void 0,n):void 0;throw r}}function LJ(e,t="",n={}){return t.endsWith("/")&&(t=t.slice(0,-1)),n.prependPathname?`${t}/.well-known/${e}`:`/.well-known/${e}${t}`}async function bE(e,t,n=fetch){return await bw(e,{"MCP-Protocol-Version":t},n)}function UJ(e,t){return!e||e.status>=400&&e.status<500&&t!=="/"}async function FJ(e,t,n,r){const a=new URL(e),i=(r==null?void 0:r.protocolVersion)??kp;let s;if(r!=null&&r.metadataUrl)s=new URL(r.metadataUrl);else{const l=LJ(t,a.pathname);s=new URL(l,(r==null?void 0:r.metadataServerUrl)??a),s.search=a.search}let o=await bE(s,i,n);if(!(r!=null&&r.metadataUrl)&&UJ(o,a.pathname)){const l=new URL(`/.well-known/${t}`,a);o=await bE(l,i,n)}return o}function qJ(e){const 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"}),r.push({url:new URL("/.well-known/openid-configuration",t.origin),type:"oidc"}),r;let a=t.pathname;return a.endsWith("/")&&(a=a.slice(0,-1)),r.push({url:new URL(`/.well-known/oauth-authorization-server${a}`,t.origin),type:"oauth"}),r.push({url:new URL(`/.well-known/openid-configuration${a}`,t.origin),type:"oidc"}),r.push({url:new URL(`${a}/.well-known/openid-configuration`,t.origin),type:"oidc"}),r}async function $M(e,{fetchFn:t=fetch,protocolVersion:n=kp}={}){var i;const r={"MCP-Protocol-Version":n,Accept:"application/json"},a=qJ(e);for(const{url:s,type:o}of a){const l=await bw(s,r,t);if(l){if(!l.ok){if(await((i=l.body)==null?void 0:i.cancel()),l.status>=400&&l.status<500)continue;throw new Error(`HTTP ${l.status} trying to load ${o==="oauth"?"OAuth":"OpenID provider"} metadata from ${s}`)}return o==="oauth"?TM.parse(await l.json()):SJ.parse(await l.json())}}}async function HJ(e,t){let n,r;try{n=await RM(e,{resourceMetadataUrl:t==null?void 0:t.resourceMetadataUrl},t==null?void 0:t.fetchFn),n.authorization_servers&&n.authorization_servers.length>0&&(r=n.authorization_servers[0])}catch{}r||(r=String(new URL("/",e)));const a=await $M(r,{fetchFn:t==null?void 0:t.fetchFn});return{authorizationServerUrl:r,authorizationServerMetadata:a,resourceMetadata:n}}async function BJ(e,{metadata:t,clientInformation:n,redirectUrl:r,scope:a,state:i,resource:s}){let o;if(t){if(o=new URL(t.authorization_endpoint),!t.response_types_supported.includes(ry))throw new Error(`Incompatible auth server: does not support response type ${ry}`);if(t.code_challenge_methods_supported&&!t.code_challenge_methods_supported.includes(ay))throw new Error(`Incompatible auth server: does not support code challenge method ${ay}`)}else o=new URL("/authorize",e);const l=await bJ(),u=l.code_verifier,d=l.code_challenge;return o.searchParams.set("response_type",ry),o.searchParams.set("client_id",n.client_id),o.searchParams.set("code_challenge",d),o.searchParams.set("code_challenge_method",ay),o.searchParams.set("redirect_uri",String(r)),i&&o.searchParams.set("state",i),a&&o.searchParams.set("scope",a),a!=null&&a.includes("offline_access")&&o.searchParams.append("prompt","consent"),s&&o.searchParams.set("resource",s.href),{authorizationUrl:o,codeVerifier:u}}function VJ(e,t,n){return new URLSearchParams({grant_type:"authorization_code",code:e,code_verifier:t,redirect_uri:String(n)})}async function OM(e,{metadata:t,tokenRequestParams:n,clientInformation:r,addClientAuthentication:a,resource:i,fetchFn:s}){const o=t!=null&&t.token_endpoint?new URL(t.token_endpoint):new URL("/token",e),l=new Headers({"Content-Type":"application/x-www-form-urlencoded",Accept:"application/json"});if(i&&n.set("resource",i.href),a)await a(l,n,o,t);else if(r){const d=(t==null?void 0:t.token_endpoint_auth_methods_supported)??[],f=$J(r,d);OJ(f,r,l,n)}const u=await(s??fetch)(o,{method:"POST",headers:l,body:n});if(!u.ok)throw await AM(u);return _J.parse(await u.json())}async function KJ(e,{metadata:t,clientInformation:n,refreshToken:r,resource:a,addClientAuthentication:i,fetchFn:s}){const o=new URLSearchParams({grant_type:"refresh_token",refresh_token:r}),l=await OM(e,{metadata:t,tokenRequestParams:o,clientInformation:n,addClientAuthentication:i,resource:a,fetchFn:s});return{refresh_token:r,...l}}async function ZJ(e,t,{metadata:n,resource:r,authorizationCode:a,fetchFn:i}={}){const s=e.clientMetadata.scope;let o;if(e.prepareTokenRequest&&(o=await e.prepareTokenRequest(s)),!o){if(!a)throw new Error("Either provider.prepareTokenRequest() or authorizationCode is required");if(!e.redirectUrl)throw new Error("redirectUrl is required for authorization_code flow");const u=await e.codeVerifier();o=VJ(a,u,e.redirectUrl)}const l=await e.clientInformation();return OM(t,{metadata:n,tokenRequestParams:o,clientInformation:l??void 0,addClientAuthentication:e.addClientAuthentication,resource:r,fetchFn:i})}async function GJ(e,{metadata:t,clientMetadata:n,scope:r,fetchFn:a}){let i;if(t){if(!t.registration_endpoint)throw new Error("Incompatible auth server: does not support dynamic client registration");i=new URL(t.registration_endpoint)}else i=new URL("/register",e);const s=await(a??fetch)(i,{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({...n,...r!==void 0?{scope:r}:{}})});if(!s.ok)throw await AM(s);return NJ.parse(await s.json())}class QJ extends Error{constructor(t,n,r){super(`SSE error: ${n}`),this.code=t,this.event=r}}class YJ{constructor(t,n){this._url=t,this._resourceMetadataUrl=void 0,this._scope=void 0,this._eventSourceInit=n==null?void 0:n.eventSourceInit,this._requestInit=n==null?void 0:n.requestInit,this._authProvider=n==null?void 0:n.authProvider,this._fetch=n==null?void 0:n.fetch,this._fetchWithInit=jM(n==null?void 0:n.fetch,n==null?void 0:n.requestInit)}async _authThenStart(){var n;if(!this._authProvider)throw new cr("No auth provider");let t;try{t=await Jr(this._authProvider,{serverUrl:this._url,resourceMetadataUrl:this._resourceMetadataUrl,scope:this._scope,fetchFn:this._fetchWithInit})}catch(r){throw(n=this.onerror)==null||n.call(this,r),r}if(t!=="AUTHORIZED")throw new cr;return await this._startOrAuth()}async _commonHeaders(){var r;const t={};if(this._authProvider){const a=await this._authProvider.tokens();a&&(t.Authorization=`Bearer ${a.access_token}`)}this._protocolVersion&&(t["mcp-protocol-version"]=this._protocolVersion);const n=gm((r=this._requestInit)==null?void 0:r.headers);return new Headers({...t,...n})}_startOrAuth(){var n;const t=((n=this==null?void 0:this._eventSourceInit)==null?void 0:n.fetch)??this._fetch??fetch;return new Promise((r,a)=>{this._eventSource=new sh(this._url.href,{...this._eventSourceInit,fetch:async(i,s)=>{const o=await this._commonHeaders();o.set("Accept","text/event-stream");const l=await t(i,{...s,headers:o});if(l.status===401&&l.headers.has("www-authenticate")){const{resourceMetadataUrl:u,scope:d}=wm(l);this._resourceMetadataUrl=u,this._scope=d}return l}}),this._abortController=new AbortController,this._eventSource.onerror=i=>{var o;if(i.code===401&&this._authProvider){this._authThenStart().then(r,a);return}const s=new QJ(i.code,i.message,i);a(s),(o=this.onerror)==null||o.call(this,s)},this._eventSource.onopen=()=>{},this._eventSource.addEventListener("endpoint",i=>{var o;const s=i;try{if(this._endpoint=new URL(s.data,this._url),this._endpoint.origin!==this._url.origin)throw new Error(`Endpoint origin does not match connection origin: ${this._endpoint.origin}`)}catch(l){a(l),(o=this.onerror)==null||o.call(this,l),this.close();return}r()}),this._eventSource.onmessage=i=>{var l,u;const s=i;let o;try{o=ah.parse(JSON.parse(s.data))}catch(d){(l=this.onerror)==null||l.call(this,d);return}(u=this.onmessage)==null||u.call(this,o)}})}async start(){if(this._eventSource)throw new Error("SSEClientTransport already started! If using Client class, note that connect() calls start() automatically.");return await this._startOrAuth()}async finishAuth(t){if(!this._authProvider)throw new cr("No auth provider");if(await Jr(this._authProvider,{serverUrl:this._url,authorizationCode:t,resourceMetadataUrl:this._resourceMetadataUrl,scope:this._scope,fetchFn:this._fetchWithInit})!=="AUTHORIZED")throw new cr("Failed to authorize")}async close(){var t,n,r;(t=this._abortController)==null||t.abort(),(n=this._eventSource)==null||n.close(),(r=this.onclose)==null||r.call(this)}async send(t){var n,r,a;if(!this._endpoint)throw new Error("Not connected");try{const i=await this._commonHeaders();i.set("content-type","application/json");const s={...this._requestInit,method:"POST",headers:i,body:JSON.stringify(t),signal:(n=this._abortController)==null?void 0:n.signal},o=await(this._fetch??fetch)(this._endpoint,s);if(!o.ok){const l=await o.text().catch(()=>null);if(o.status===401&&this._authProvider){const{resourceMetadataUrl:u,scope:d}=wm(o);if(this._resourceMetadataUrl=u,this._scope=d,await Jr(this._authProvider,{serverUrl:this._url,resourceMetadataUrl:this._resourceMetadataUrl,scope:this._scope,fetchFn:this._fetchWithInit})!=="AUTHORIZED")throw new cr;return this.send(t)}throw new Error(`Error POSTing to endpoint (HTTP ${o.status}): ${l}`)}await((r=o.body)==null?void 0:r.cancel())}catch(i){throw(a=this.onerror)==null||a.call(this,i),i}}setProtocolVersion(t){this._protocolVersion=t}}class XJ extends TransformStream{constructor({onError:t,onRetry:n,onComment:r}={}){let a;super({start(i){a=CM({onEvent:s=>{i.enqueue(s)},onError(s){t==="terminate"?i.error(s):typeof t=="function"&&t(s)},onRetry:n,onComment:r})},transform(i){a.feed(i)}})}}const WJ={initialReconnectionDelay:1e3,maxReconnectionDelay:3e4,reconnectionDelayGrowFactor:1.5,maxRetries:2};class zo extends Error{constructor(t,n){super(`Streamable HTTP error: ${n}`),this.code=t}}class JJ{constructor(t,n){this._hasCompletedAuthFlow=!1,this._url=t,this._resourceMetadataUrl=void 0,this._scope=void 0,this._requestInit=n==null?void 0:n.requestInit,this._authProvider=n==null?void 0:n.authProvider,this._fetch=n==null?void 0:n.fetch,this._fetchWithInit=jM(n==null?void 0:n.fetch,n==null?void 0:n.requestInit),this._sessionId=n==null?void 0:n.sessionId,this._reconnectionOptions=(n==null?void 0:n.reconnectionOptions)??WJ}async _authThenStart(){var n;if(!this._authProvider)throw new cr("No auth provider");let t;try{t=await Jr(this._authProvider,{serverUrl:this._url,resourceMetadataUrl:this._resourceMetadataUrl,scope:this._scope,fetchFn:this._fetchWithInit})}catch(r){throw(n=this.onerror)==null||n.call(this,r),r}if(t!=="AUTHORIZED")throw new cr;return await this._startOrAuthSse({resumptionToken:void 0})}async _commonHeaders(){var r;const t={};if(this._authProvider){const a=await this._authProvider.tokens();a&&(t.Authorization=`Bearer ${a.access_token}`)}this._sessionId&&(t["mcp-session-id"]=this._sessionId),this._protocolVersion&&(t["mcp-protocol-version"]=this._protocolVersion);const n=gm((r=this._requestInit)==null?void 0:r.headers);return new Headers({...t,...n})}async _startOrAuthSse(t){var r,a,i;const{resumptionToken:n}=t;try{const s=await this._commonHeaders();s.set("Accept","text/event-stream"),n&&s.set("last-event-id",n);const o=await(this._fetch??fetch)(this._url,{method:"GET",headers:s,signal:(r=this._abortController)==null?void 0:r.signal});if(!o.ok){if(await((a=o.body)==null?void 0:a.cancel()),o.status===401&&this._authProvider)return await this._authThenStart();if(o.status===405)return;throw new zo(o.status,`Failed to open SSE stream: ${o.statusText}`)}this._handleSseStream(o.body,t,!0)}catch(s){throw(i=this.onerror)==null||i.call(this,s),s}}_getNextReconnectionDelay(t){if(this._serverRetryMs!==void 0)return this._serverRetryMs;const n=this._reconnectionOptions.initialReconnectionDelay,r=this._reconnectionOptions.reconnectionDelayGrowFactor,a=this._reconnectionOptions.maxReconnectionDelay;return Math.min(n*Math.pow(r,t),a)}_scheduleReconnection(t,n=0){var i;const r=this._reconnectionOptions.maxRetries;if(n>=r){(i=this.onerror)==null||i.call(this,new Error(`Maximum reconnection attempts (${r}) exceeded.`));return}const a=this._getNextReconnectionDelay(n);this._reconnectionTimeout=setTimeout(()=>{this._startOrAuthSse(t).catch(s=>{var o;(o=this.onerror)==null||o.call(this,new Error(`Failed to reconnect SSE stream: ${s instanceof Error?s.message:String(s)}`)),this._scheduleReconnection(t,n+1)})},a)}_handleSseStream(t,n,r){if(!t)return;const{onresumptiontoken:a,replayMessageId:i}=n;let s,o=!1,l=!1;(async()=>{var d,f,m,h;try{const y=t.pipeThrough(new TextDecoderStream).pipeThrough(new XJ({onRetry:g=>{this._serverRetryMs=g}})).getReader();for(;;){const{value:g,done:v}=await y.read();if(v)break;if(g.id&&(s=g.id,o=!0,a==null||a(g.id)),!!g.data&&(!g.event||g.event==="message"))try{const w=ah.parse(JSON.parse(g.data));Wc(w)&&(l=!0,i!==void 0&&(w.id=i)),(d=this.onmessage)==null||d.call(this,w)}catch(w){(f=this.onerror)==null||f.call(this,w)}}(r||o)&&!l&&this._abortController&&!this._abortController.signal.aborted&&this._scheduleReconnection({resumptionToken:s,onresumptiontoken:a,replayMessageId:i},0)}catch(y){if((m=this.onerror)==null||m.call(this,new Error(`SSE stream disconnected: ${y}`)),(r||o)&&!l&&this._abortController&&!this._abortController.signal.aborted)try{this._scheduleReconnection({resumptionToken:s,onresumptiontoken:a,replayMessageId:i},0)}catch(g){(h=this.onerror)==null||h.call(this,new Error(`Failed to reconnect: ${g instanceof Error?g.message:String(g)}`))}}})()}async start(){if(this._abortController)throw new Error("StreamableHTTPClientTransport already started! If using Client class, note that connect() calls start() automatically.");this._abortController=new AbortController}async finishAuth(t){if(!this._authProvider)throw new cr("No auth provider");if(await Jr(this._authProvider,{serverUrl:this._url,authorizationCode:t,resourceMetadataUrl:this._resourceMetadataUrl,scope:this._scope,fetchFn:this._fetchWithInit})!=="AUTHORIZED")throw new cr("Failed to authorize")}async close(){var t,n;this._reconnectionTimeout&&(clearTimeout(this._reconnectionTimeout),this._reconnectionTimeout=void 0),(t=this._abortController)==null||t.abort(),(n=this.onclose)==null||n.call(this)}async send(t,n){var r,a,i,s,o,l;try{const{resumptionToken:u,onresumptiontoken:d}=n||{};if(u){this._startOrAuthSse({resumptionToken:u,replayMessageId:i0(t)?t.id:void 0}).catch(v=>{var w;return(w=this.onerror)==null?void 0:w.call(this,v)});return}const f=await this._commonHeaders();f.set("content-type","application/json"),f.set("accept","application/json, text/event-stream");const m={...this._requestInit,method:"POST",headers:f,body:JSON.stringify(t),signal:(r=this._abortController)==null?void 0:r.signal},h=await(this._fetch??fetch)(this._url,m),y=h.headers.get("mcp-session-id");if(y&&(this._sessionId=y),!h.ok){const v=await h.text().catch(()=>null);if(h.status===401&&this._authProvider){if(this._hasCompletedAuthFlow)throw new zo(401,"Server returned 401 after successful authentication");const{resourceMetadataUrl:w,scope:S}=wm(h);if(this._resourceMetadataUrl=w,this._scope=S,await Jr(this._authProvider,{serverUrl:this._url,resourceMetadataUrl:this._resourceMetadataUrl,scope:this._scope,fetchFn:this._fetchWithInit})!=="AUTHORIZED")throw new cr;return this._hasCompletedAuthFlow=!0,this.send(t)}if(h.status===403&&this._authProvider){const{resourceMetadataUrl:w,scope:S,error:E}=wm(h);if(E==="insufficient_scope"){const C=h.headers.get("WWW-Authenticate");if(this._lastUpscopingHeader===C)throw new zo(403,"Server returned 403 after trying upscoping");if(S&&(this._scope=S),w&&(this._resourceMetadataUrl=w),this._lastUpscopingHeader=C??void 0,await Jr(this._authProvider,{serverUrl:this._url,resourceMetadataUrl:this._resourceMetadataUrl,scope:this._scope,fetchFn:this._fetch})!=="AUTHORIZED")throw new cr;return this.send(t)}}throw new zo(h.status,`Error POSTing to endpoint: ${v}`)}if(this._hasCompletedAuthFlow=!1,this._lastUpscopingHeader=void 0,h.status===202){await((a=h.body)==null?void 0:a.cancel()),YX(t)&&this._startOrAuthSse({resumptionToken:void 0}).catch(v=>{var w;return(w=this.onerror)==null?void 0:w.call(this,v)});return}const b=(Array.isArray(t)?t:[t]).filter(v=>"method"in v&&"id"in v&&v.id!==void 0).length>0,g=h.headers.get("content-type");if(b)if(g!=null&&g.includes("text/event-stream"))this._handleSseStream(h.body,{onresumptiontoken:d},!1);else if(g!=null&&g.includes("application/json")){const v=await h.json(),w=Array.isArray(v)?v.map(S=>ah.parse(S)):[ah.parse(v)];for(const S of w)(i=this.onmessage)==null||i.call(this,S)}else throw await((s=h.body)==null?void 0:s.cancel()),new zo(-1,`Unexpected content type: ${g}`);else await((o=h.body)==null?void 0:o.cancel())}catch(u){throw(l=this.onerror)==null||l.call(this,u),u}}get sessionId(){return this._sessionId}async terminateSession(){var t,n,r;if(this._sessionId)try{const a=await this._commonHeaders(),i={...this._requestInit,method:"DELETE",headers:a,signal:(t=this._abortController)==null?void 0:t.signal},s=await(this._fetch??fetch)(this._url,i);if(await((n=s.body)==null?void 0:n.cancel()),!s.ok&&s.status!==405)throw new zo(s.status,`Failed to terminate session: ${s.statusText}`);this._sessionId=void 0}catch(a){throw(r=this.onerror)==null||r.call(this,a),a}}setProtocolVersion(t){this._protocolVersion=t}get protocolVersion(){return this._protocolVersion}async resumeStream(t,n){await this._startOrAuthSse({resumptionToken:t,onresumptiontoken:n==null?void 0:n.onresumptiontoken})}}function Np(e){return!!e._zod}function Ai(e,t){return Np(e)?$O(e,t):e.safeParse(t)}function MM(e){var n,r;if(!e)return;let t;if(Np(e)?t=(r=(n=e._zod)==null?void 0:n.def)==null?void 0:r.shape:t=e.shape,!!t){if(typeof t=="function")try{return t()}catch{return}return t}}function eee(e){var a;if(Np(e)){const s=(a=e._zod)==null?void 0:a.def;if(s){if(s.value!==void 0)return s.value;if(Array.isArray(s.values)&&s.values.length>0)return s.values[0]}}const n=e._def;if(n){if(n.value!==void 0)return n.value;if(Array.isArray(n.values)&&n.values.length>0)return n.values[0]}const r=e.value;if(r!==void 0)return r}function js(e){return e==="completed"||e==="failed"||e==="cancelled"}new Set("ABCDEFGHIJKLMNOPQRSTUVXYZabcdefghijklmnopqrstuvxyz0123456789");function xE(e){const t=MM(e),n=t==null?void 0:t.method;if(!n)throw new Error("Schema is missing a method literal");const r=eee(n);if(typeof r!="string")throw new Error("Schema method literal must be a string");return r}function wE(e,t){const n=Ai(e,t);if(!n.success)throw n.error;return n.data}const tee=6e4;class nee{constructor(t){this._options=t,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(Jx,n=>{this._oncancel(n)}),this.setNotificationHandler(tw,n=>{this._onprogress(n)}),this.setRequestHandler(ew,n=>({})),this._taskStore=t==null?void 0:t.taskStore,this._taskMessageQueue=t==null?void 0:t.taskMessageQueue,this._taskStore&&(this.setRequestHandler(nw,async(n,r)=>{const a=await this._taskStore.getTask(n.params.taskId,r.sessionId);if(!a)throw new Ne(Oe.InvalidParams,"Failed to retrieve task: Task not found");return{...a}}),this.setRequestHandler(aw,async(n,r)=>{const a=async()=>{var o;const i=n.params.taskId;if(this._taskMessageQueue){let l;for(;l=await this._taskMessageQueue.dequeue(i,r.sessionId);){if(l.type==="response"||l.type==="error"){const u=l.message,d=u.id,f=this._requestResolvers.get(d);if(f)if(this._requestResolvers.delete(d),l.type==="response")f(u);else{const m=u,h=new Ne(m.error.code,m.error.message,m.error.data);f(h)}else{const m=l.type==="response"?"Response":"Error";this._onerror(new Error(`${m} handler missing for request ${d}`))}continue}await((o=this._transport)==null?void 0:o.send(l.message,{relatedRequestId:r.requestId}))}}const s=await this._taskStore.getTask(i,r.sessionId);if(!s)throw new Ne(Oe.InvalidParams,`Task not found: ${i}`);if(!js(s.status))return await this._waitForTaskUpdate(i,r.signal),await a();if(js(s.status)){const l=await this._taskStore.getTaskResult(i,r.sessionId);return this._clearTaskQueue(i),{...l,_meta:{...l._meta,[Ds]:{taskId:i}}}}return await a()};return await a()}),this.setRequestHandler(iw,async(n,r)=>{var a;try{const{tasks:i,nextCursor:s}=await this._taskStore.listTasks((a=n.params)==null?void 0:a.cursor,r.sessionId);return{tasks:i,nextCursor:s,_meta:{}}}catch(i){throw new Ne(Oe.InvalidParams,`Failed to list tasks: ${i instanceof Error?i.message:String(i)}`)}}),this.setRequestHandler(ow,async(n,r)=>{try{const a=await this._taskStore.getTask(n.params.taskId,r.sessionId);if(!a)throw new Ne(Oe.InvalidParams,`Task not found: ${n.params.taskId}`);if(js(a.status))throw new Ne(Oe.InvalidParams,`Cannot cancel task in terminal status: ${a.status}`);await this._taskStore.updateTaskStatus(n.params.taskId,"cancelled","Client cancelled task execution.",r.sessionId),this._clearTaskQueue(n.params.taskId);const i=await this._taskStore.getTask(n.params.taskId,r.sessionId);if(!i)throw new Ne(Oe.InvalidParams,`Task not found after cancellation: ${n.params.taskId}`);return{_meta:{},...i}}catch(a){throw a instanceof Ne?a:new Ne(Oe.InvalidRequest,`Failed to cancel task: ${a instanceof Error?a.message:String(a)}`)}}))}async _oncancel(t){if(!t.params.requestId)return;const n=this._requestHandlerAbortControllers.get(t.params.requestId);n==null||n.abort(t.params.reason)}_setupTimeout(t,n,r,a,i=!1){this._timeoutInfo.set(t,{timeoutId:setTimeout(a,n),startTime:Date.now(),timeout:n,maxTotalTimeout:r,resetTimeoutOnProgress:i,onTimeout:a})}_resetTimeout(t){const n=this._timeoutInfo.get(t);if(!n)return!1;const r=Date.now()-n.startTime;if(n.maxTotalTimeout&&r>=n.maxTotalTimeout)throw this._timeoutInfo.delete(t),Ne.fromError(Oe.RequestTimeout,"Maximum total timeout exceeded",{maxTotalTimeout:n.maxTotalTimeout,totalElapsed:r});return clearTimeout(n.timeoutId),n.timeoutId=setTimeout(n.onTimeout,n.timeout),!0}_cleanupTimeout(t){const n=this._timeoutInfo.get(t);n&&(clearTimeout(n.timeoutId),this._timeoutInfo.delete(t))}async connect(t){var i,s,o;if(this._transport)throw new Error("Already connected to a transport. Call close() before connecting to a new transport, or use a separate Protocol instance per connection.");this._transport=t;const n=(i=this.transport)==null?void 0:i.onclose;this._transport.onclose=()=>{n==null||n(),this._onclose()};const r=(s=this.transport)==null?void 0:s.onerror;this._transport.onerror=l=>{r==null||r(l),this._onerror(l)};const a=(o=this._transport)==null?void 0:o.onmessage;this._transport.onmessage=(l,u)=>{a==null||a(l,u),Wc(l)||LX(l)?this._onresponse(l):i0(l)?this._onrequest(l,u):IX(l)?this._onnotification(l):this._onerror(new Error(`Unknown message type: ${JSON.stringify(l)}`))},await this._transport.start()}_onclose(){var r;const t=this._responseHandlers;this._responseHandlers=new Map,this._progressHandlers.clear(),this._taskProgressTokens.clear(),this._pendingDebouncedNotifications.clear();for(const a of this._timeoutInfo.values())clearTimeout(a.timeoutId);this._timeoutInfo.clear();for(const a of this._requestHandlerAbortControllers.values())a.abort();this._requestHandlerAbortControllers.clear();const n=Ne.fromError(Oe.ConnectionClosed,"Connection closed");this._transport=void 0,(r=this.onclose)==null||r.call(this);for(const a of t.values())a(n)}_onerror(t){var n;(n=this.onerror)==null||n.call(this,t)}_onnotification(t){const n=this._notificationHandlers.get(t.method)??this.fallbackNotificationHandler;n!==void 0&&Promise.resolve().then(()=>n(t)).catch(r=>this._onerror(new Error(`Uncaught error in notification handler: ${r}`)))}_onrequest(t,n){var d,f,m,h;const r=this._requestHandlers.get(t.method)??this.fallbackRequestHandler,a=this._transport,i=(m=(f=(d=t.params)==null?void 0:d._meta)==null?void 0:f[Ds])==null?void 0:m.taskId;if(r===void 0){const y={jsonrpc:"2.0",id:t.id,error:{code:Oe.MethodNotFound,message:"Method not found"}};i&&this._taskMessageQueue?this._enqueueTaskMessage(i,{type:"error",message:y,timestamp:Date.now()},a==null?void 0:a.sessionId).catch(p=>this._onerror(new Error(`Failed to enqueue error response: ${p}`))):a==null||a.send(y).catch(p=>this._onerror(new Error(`Failed to send an error response: ${p}`)));return}const s=new AbortController;this._requestHandlerAbortControllers.set(t.id,s);const o=zX(t.params)?t.params.task:void 0,l=this._taskStore?this.requestTaskStore(t,a==null?void 0:a.sessionId):void 0,u={signal:s.signal,sessionId:a==null?void 0:a.sessionId,_meta:(h=t.params)==null?void 0:h._meta,sendNotification:async y=>{if(s.signal.aborted)return;const p={relatedRequestId:t.id};i&&(p.relatedTask={taskId:i}),await this.notification(y,p)},sendRequest:async(y,p,b)=>{var w;if(s.signal.aborted)throw new Ne(Oe.ConnectionClosed,"Request was cancelled");const g={...b,relatedRequestId:t.id};i&&!g.relatedTask&&(g.relatedTask={taskId:i});const v=((w=g.relatedTask)==null?void 0:w.taskId)??i;return v&&l&&await l.updateTaskStatus(v,"input_required"),await this.request(y,p,g)},authInfo:n==null?void 0:n.authInfo,requestId:t.id,requestInfo:n==null?void 0:n.requestInfo,taskId:i,taskStore:l,taskRequestedTtl:o==null?void 0:o.ttl,closeSSEStream:n==null?void 0:n.closeSSEStream,closeStandaloneSSEStream:n==null?void 0:n.closeStandaloneSSEStream};Promise.resolve().then(()=>{o&&this.assertTaskHandlerCapability(t.method)}).then(()=>r(t,u)).then(async y=>{if(s.signal.aborted)return;const p={result:y,jsonrpc:"2.0",id:t.id};i&&this._taskMessageQueue?await this._enqueueTaskMessage(i,{type:"response",message:p,timestamp:Date.now()},a==null?void 0:a.sessionId):await(a==null?void 0:a.send(p))},async y=>{if(s.signal.aborted)return;const p={jsonrpc:"2.0",id:t.id,error:{code:Number.isSafeInteger(y.code)?y.code:Oe.InternalError,message:y.message??"Internal error",...y.data!==void 0&&{data:y.data}}};i&&this._taskMessageQueue?await this._enqueueTaskMessage(i,{type:"error",message:p,timestamp:Date.now()},a==null?void 0:a.sessionId):await(a==null?void 0:a.send(p))}).catch(y=>this._onerror(new Error(`Failed to send response: ${y}`))).finally(()=>{this._requestHandlerAbortControllers.get(t.id)===s&&this._requestHandlerAbortControllers.delete(t.id)})}_onprogress(t){const{progressToken:n,...r}=t.params,a=Number(n),i=this._progressHandlers.get(a);if(!i){this._onerror(new Error(`Received a progress notification for an unknown token: ${JSON.stringify(t)}`));return}const s=this._responseHandlers.get(a),o=this._timeoutInfo.get(a);if(o&&s&&o.resetTimeoutOnProgress)try{this._resetTimeout(a)}catch(l){this._responseHandlers.delete(a),this._progressHandlers.delete(a),this._cleanupTimeout(a),s(l);return}i(r)}_onresponse(t){const n=Number(t.id),r=this._requestResolvers.get(n);if(r){if(this._requestResolvers.delete(n),Wc(t))r(t);else{const s=new Ne(t.error.code,t.error.message,t.error.data);r(s)}return}const a=this._responseHandlers.get(n);if(a===void 0){this._onerror(new Error(`Received a response for an unknown message ID: ${JSON.stringify(t)}`));return}this._responseHandlers.delete(n),this._cleanupTimeout(n);let i=!1;if(Wc(t)&&t.result&&typeof t.result=="object"){const s=t.result;if(s.task&&typeof s.task=="object"){const o=s.task;typeof o.taskId=="string"&&(i=!0,this._taskProgressTokens.set(o.taskId,n))}}if(i||this._progressHandlers.delete(n),Wc(t))a(t);else{const s=Ne.fromError(t.error.code,t.error.message,t.error.data);a(s)}}get transport(){return this._transport}async close(){var t;await((t=this._transport)==null?void 0:t.close())}async*requestStream(t,n,r){var s,o;const{task:a}=r??{};if(!a){try{yield{type:"result",result:await this.request(t,n,r)}}catch(l){yield{type:"error",error:l instanceof Ne?l:new Ne(Oe.InternalError,String(l))}}return}let i;try{const l=await this.request(t,Ju,r);if(l.task)i=l.task.taskId,yield{type:"taskCreated",task:l.task};else throw new Ne(Oe.InternalError,"Task creation did not return a task");for(;;){const u=await this.getTask({taskId:i},r);if(yield{type:"taskStatus",task:u},js(u.status)){u.status==="completed"?yield{type:"result",result:await this.getTaskResult({taskId:i},n,r)}:u.status==="failed"?yield{type:"error",error:new Ne(Oe.InternalError,`Task ${i} failed`)}:u.status==="cancelled"&&(yield{type:"error",error:new Ne(Oe.InternalError,`Task ${i} was cancelled`)});return}if(u.status==="input_required"){yield{type:"result",result:await this.getTaskResult({taskId:i},n,r)};return}const d=u.pollInterval??((s=this._options)==null?void 0:s.defaultTaskPollInterval)??1e3;await new Promise(f=>setTimeout(f,d)),(o=r==null?void 0:r.signal)==null||o.throwIfAborted()}}catch(l){yield{type:"error",error:l instanceof Ne?l:new Ne(Oe.InternalError,String(l))}}}request(t,n,r){const{relatedRequestId:a,resumptionToken:i,onresumptiontoken:s,task:o,relatedTask:l}=r??{};return new Promise((u,d)=>{var v,w,S,E,C;const f=T=>{d(T)};if(!this._transport){f(new Error("Not connected"));return}if(((v=this._options)==null?void 0:v.enforceStrictCapabilities)===!0)try{this.assertCapabilityForMethod(t.method),o&&this.assertTaskCapability(t.method)}catch(T){f(T);return}(w=r==null?void 0:r.signal)==null||w.throwIfAborted();const m=this._requestMessageId++,h={...t,jsonrpc:"2.0",id:m};r!=null&&r.onprogress&&(this._progressHandlers.set(m,r.onprogress),h.params={...t.params,_meta:{...((S=t.params)==null?void 0:S._meta)||{},progressToken:m}}),o&&(h.params={...h.params,task:o}),l&&(h.params={...h.params,_meta:{...((E=h.params)==null?void 0:E._meta)||{},[Ds]:l}});const y=T=>{var R;this._responseHandlers.delete(m),this._progressHandlers.delete(m),this._cleanupTimeout(m),(R=this._transport)==null||R.send({jsonrpc:"2.0",method:"notifications/cancelled",params:{requestId:m,reason:String(T)}},{relatedRequestId:a,resumptionToken:i,onresumptiontoken:s}).catch($=>this._onerror(new Error(`Failed to send cancellation: ${$}`)));const P=T instanceof Ne?T:new Ne(Oe.RequestTimeout,String(T));d(P)};this._responseHandlers.set(m,T=>{var P;if(!((P=r==null?void 0:r.signal)!=null&&P.aborted)){if(T instanceof Error)return d(T);try{const R=Ai(n,T.result);R.success?u(R.data):d(R.error)}catch(R){d(R)}}}),(C=r==null?void 0:r.signal)==null||C.addEventListener("abort",()=>{var T;y((T=r==null?void 0:r.signal)==null?void 0:T.reason)});const p=(r==null?void 0:r.timeout)??tee,b=()=>y(Ne.fromError(Oe.RequestTimeout,"Request timed out",{timeout:p}));this._setupTimeout(m,p,r==null?void 0:r.maxTotalTimeout,b,(r==null?void 0:r.resetTimeoutOnProgress)??!1);const g=l==null?void 0:l.taskId;if(g){const T=P=>{const R=this._responseHandlers.get(m);R?R(P):this._onerror(new Error(`Response handler missing for side-channeled request ${m}`))};this._requestResolvers.set(m,T),this._enqueueTaskMessage(g,{type:"request",message:h,timestamp:Date.now()}).catch(P=>{this._cleanupTimeout(m),d(P)})}else this._transport.send(h,{relatedRequestId:a,resumptionToken:i,onresumptiontoken:s}).catch(T=>{this._cleanupTimeout(m),d(T)})})}async getTask(t,n){return this.request({method:"tasks/get",params:t},rw,n)}async getTaskResult(t,n,r){return this.request({method:"tasks/result",params:t},n,r)}async listTasks(t,n){return this.request({method:"tasks/list",params:t},sw,n)}async cancelTask(t,n){return this.request({method:"tasks/cancel",params:t},nW,n)}async notification(t,n){var o,l,u,d;if(!this._transport)throw new Error("Not connected");this.assertNotificationCapability(t.method);const r=(o=n==null?void 0:n.relatedTask)==null?void 0:o.taskId;if(r){const f={...t,jsonrpc:"2.0",params:{...t.params,_meta:{...((l=t.params)==null?void 0:l._meta)||{},[Ds]:n.relatedTask}}};await this._enqueueTaskMessage(r,{type:"notification",message:f,timestamp:Date.now()});return}if((((u=this._options)==null?void 0:u.debouncedNotificationMethods)??[]).includes(t.method)&&!t.params&&!(n!=null&&n.relatedRequestId)&&!(n!=null&&n.relatedTask)){if(this._pendingDebouncedNotifications.has(t.method))return;this._pendingDebouncedNotifications.add(t.method),Promise.resolve().then(()=>{var m,h;if(this._pendingDebouncedNotifications.delete(t.method),!this._transport)return;let f={...t,jsonrpc:"2.0"};n!=null&&n.relatedTask&&(f={...f,params:{...f.params,_meta:{...((m=f.params)==null?void 0:m._meta)||{},[Ds]:n.relatedTask}}}),(h=this._transport)==null||h.send(f,n).catch(y=>this._onerror(y))});return}let s={...t,jsonrpc:"2.0"};n!=null&&n.relatedTask&&(s={...s,params:{...s.params,_meta:{...((d=s.params)==null?void 0:d._meta)||{},[Ds]:n.relatedTask}}}),await this._transport.send(s,n)}setRequestHandler(t,n){const r=xE(t);this.assertRequestHandlerCapability(r),this._requestHandlers.set(r,(a,i)=>{const s=wE(t,a);return Promise.resolve(n(s,i))})}removeRequestHandler(t){this._requestHandlers.delete(t)}assertCanSetRequestHandler(t){if(this._requestHandlers.has(t))throw new Error(`A request handler for ${t} already exists, which would be overridden`)}setNotificationHandler(t,n){const r=xE(t);this._notificationHandlers.set(r,a=>{const i=wE(t,a);return Promise.resolve(n(i))})}removeNotificationHandler(t){this._notificationHandlers.delete(t)}_cleanupTaskProgressHandler(t){const n=this._taskProgressTokens.get(t);n!==void 0&&(this._progressHandlers.delete(n),this._taskProgressTokens.delete(t))}async _enqueueTaskMessage(t,n,r){var i;if(!this._taskStore||!this._taskMessageQueue)throw new Error("Cannot enqueue task message: taskStore and taskMessageQueue are not configured");const a=(i=this._options)==null?void 0:i.maxTaskQueueSize;await this._taskMessageQueue.enqueue(t,n,r,a)}async _clearTaskQueue(t,n){if(this._taskMessageQueue){const r=await this._taskMessageQueue.dequeueAll(t,n);for(const a of r)if(a.type==="request"&&i0(a.message)){const i=a.message.id,s=this._requestResolvers.get(i);s?(s(new Ne(Oe.InternalError,"Task cancelled or completed")),this._requestResolvers.delete(i)):this._onerror(new Error(`Resolver missing for request ${i} during task ${t} cleanup`))}}}async _waitForTaskUpdate(t,n){var a,i;let r=((a=this._options)==null?void 0:a.defaultTaskPollInterval)??1e3;try{const s=await((i=this._taskStore)==null?void 0:i.getTask(t));s!=null&&s.pollInterval&&(r=s.pollInterval)}catch{}return new Promise((s,o)=>{if(n.aborted){o(new Ne(Oe.InvalidRequest,"Request cancelled"));return}const l=setTimeout(s,r);n.addEventListener("abort",()=>{clearTimeout(l),o(new Ne(Oe.InvalidRequest,"Request cancelled"))},{once:!0})})}requestTaskStore(t,n){const r=this._taskStore;if(!r)throw new Error("No task store configured");return{createTask:async a=>{if(!t)throw new Error("No request provided");return await r.createTask(a,t.id,{method:t.method,params:t.params},n)},getTask:async a=>{const i=await r.getTask(a,n);if(!i)throw new Ne(Oe.InvalidParams,"Failed to retrieve task: Task not found");return i},storeTaskResult:async(a,i,s)=>{await r.storeTaskResult(a,i,s,n);const o=await r.getTask(a,n);if(o){const l=dm.parse({method:"notifications/tasks/status",params:o});await this.notification(l),js(o.status)&&this._cleanupTaskProgressHandler(a)}},getTaskResult:a=>r.getTaskResult(a,n),updateTaskStatus:async(a,i,s)=>{const o=await r.getTask(a,n);if(!o)throw new Ne(Oe.InvalidParams,`Task "${a}" not found - it may have been cleaned up`);if(js(o.status))throw new Ne(Oe.InvalidParams,`Cannot update task "${a}" from terminal status "${o.status}" to "${i}". Terminal states (completed, failed, cancelled) cannot transition to other states.`);await r.updateTaskStatus(a,i,s,n);const l=await r.getTask(a,n);if(l){const u=dm.parse({method:"notifications/tasks/status",params:l});await this.notification(u),js(l.status)&&this._cleanupTaskProgressHandler(a)}},listTasks:a=>r.listTasks(a,n)}}}function SE(e){return e!==null&&typeof e=="object"&&!Array.isArray(e)}function ree(e,t){const n={...e};for(const r in t){const a=r,i=t[a];if(i===void 0)continue;const s=n[a];SE(s)&&SE(i)?n[a]={...s,...i}:n[a]=i}return n}var C0={exports:{}},PM={},Pa={},Ts={},Id={},Ue={},ed={};(function(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;class t{}e._CodeOrName=t,e.IDENTIFIER=/^[a-z$_][a-z$_0-9]*$/i;class n extends t{constructor(v){if(super(),!e.IDENTIFIER.test(v))throw new Error("CodeGen: name must be a valid identifier");this.str=v}toString(){return this.str}emptyStr(){return!1}get names(){return{[this.str]:1}}}e.Name=n;class r extends t{constructor(v){super(),this._items=typeof v=="string"?[v]:v}toString(){return this.str}emptyStr(){if(this._items.length>1)return!1;const v=this._items[0];return v===""||v==='""'}get str(){var v;return(v=this._str)!==null&&v!==void 0?v:this._str=this._items.reduce((w,S)=>`${w}${S}`,"")}get names(){var v;return(v=this._names)!==null&&v!==void 0?v:this._names=this._items.reduce((w,S)=>(S instanceof n&&(w[S.str]=(w[S.str]||0)+1),w),{})}}e._Code=r,e.nil=new r("");function a(g,...v){const w=[g[0]];let S=0;for(;S<v.length;)o(w,v[S]),w.push(g[++S]);return new r(w)}e._=a;const i=new r("+");function s(g,...v){const w=[h(g[0])];let S=0;for(;S<v.length;)w.push(i),o(w,v[S]),w.push(i,h(g[++S]));return l(w),new r(w)}e.str=s;function o(g,v){v instanceof r?g.push(...v._items):v instanceof n?g.push(v):g.push(f(v))}e.addCodeArg=o;function l(g){let v=1;for(;v<g.length-1;){if(g[v]===i){const w=u(g[v-1],g[v+1]);if(w!==void 0){g.splice(v-1,3,w);continue}g[v++]="+"}v++}}function u(g,v){if(v==='""')return g;if(g==='""')return v;if(typeof g=="string")return v instanceof n||g[g.length-1]!=='"'?void 0:typeof v!="string"?`${g.slice(0,-1)}${v}"`:v[0]==='"'?g.slice(0,-1)+v.slice(1):void 0;if(typeof v=="string"&&v[0]==='"'&&!(g instanceof n))return`"${g}${v.slice(1)}`}function d(g,v){return v.emptyStr()?g:g.emptyStr()?v:s`${g}${v}`}e.strConcat=d;function f(g){return typeof g=="number"||typeof g=="boolean"||g===null?g:h(Array.isArray(g)?g.join(","):g)}function m(g){return new r(h(g))}e.stringify=m;function h(g){return JSON.stringify(g).replace(/\u2028/g,"\\u2028").replace(/\u2029/g,"\\u2029")}e.safeStringify=h;function y(g){return typeof g=="string"&&e.IDENTIFIER.test(g)?new r(`.${g}`):a`[${g}]`}e.getProperty=y;function p(g){if(typeof g=="string"&&e.IDENTIFIER.test(g))return new r(`${g}`);throw new Error(`CodeGen: invalid export name: ${g}, use explicit $id name mapping`)}e.getEsmExportName=p;function b(g){return new r(g.toString())}e.regexpCode=b})(ed);var N0={};(function(e){Object.defineProperty(e,"__esModule",{value:!0}),e.ValueScope=e.ValueScopeName=e.Scope=e.varKinds=e.UsedValueState=void 0;const t=ed;class n extends Error{constructor(u){super(`CodeGen: "code" for ${u} not defined`),this.value=u.value}}var r;(function(l){l[l.Started=0]="Started",l[l.Completed=1]="Completed"})(r||(e.UsedValueState=r={})),e.varKinds={const:new t.Name("const"),let:new t.Name("let"),var:new t.Name("var")};class a{constructor({prefixes:u,parent:d}={}){this._names={},this._prefixes=u,this._parent=d}toName(u){return u instanceof t.Name?u:this.name(u)}name(u){return new t.Name(this._newName(u))}_newName(u){const d=this._names[u]||this._nameGroup(u);return`${u}${d.index++}`}_nameGroup(u){var d,f;if(!((f=(d=this._parent)===null||d===void 0?void 0:d._prefixes)===null||f===void 0)&&f.has(u)||this._prefixes&&!this._prefixes.has(u))throw new Error(`CodeGen: prefix "${u}" is not allowed in this scope`);return this._names[u]={prefix:u,index:0}}}e.Scope=a;class i extends t.Name{constructor(u,d){super(d),this.prefix=u}setValue(u,{property:d,itemIndex:f}){this.value=u,this.scopePath=(0,t._)`.${new t.Name(d)}[${f}]`}}e.ValueScopeName=i;const s=(0,t._)`\n`;class o extends a{constructor(u){super(u),this._values={},this._scope=u.scope,this.opts={...u,_n:u.lines?s:t.nil}}get(){return this._scope}name(u){return new i(u,this._newName(u))}value(u,d){var f;if(d.ref===void 0)throw new Error("CodeGen: ref must be passed in value");const m=this.toName(u),{prefix:h}=m,y=(f=d.key)!==null&&f!==void 0?f:d.ref;let p=this._values[h];if(p){const v=p.get(y);if(v)return v}else p=this._values[h]=new Map;p.set(y,m);const b=this._scope[h]||(this._scope[h]=[]),g=b.length;return b[g]=d.ref,m.setValue(d,{property:h,itemIndex:g}),m}getValue(u,d){const f=this._values[u];if(f)return f.get(d)}scopeRefs(u,d=this._values){return this._reduceValues(d,f=>{if(f.scopePath===void 0)throw new Error(`CodeGen: name "${f}" has no value`);return(0,t._)`${u}${f.scopePath}`})}scopeCode(u=this._values,d,f){return this._reduceValues(u,m=>{if(m.value===void 0)throw new Error(`CodeGen: name "${m}" has no value`);return m.value.code},d,f)}_reduceValues(u,d,f={},m){let h=t.nil;for(const y in u){const p=u[y];if(!p)continue;const b=f[y]=f[y]||new Map;p.forEach(g=>{if(b.has(g))return;b.set(g,r.Started);let v=d(g);if(v){const w=this.opts.es5?e.varKinds.var:e.varKinds.const;h=(0,t._)`${h}${w} ${g} = ${v};${this.opts._n}`}else if(v=m==null?void 0:m(g))h=(0,t._)`${h}${v}${this.opts._n}`;else throw new n(g);b.set(g,r.Completed)})}return h}}e.ValueScope=o})(N0);(function(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;const t=ed,n=N0;var r=ed;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 a=N0;Object.defineProperty(e,"Scope",{enumerable:!0,get:function(){return a.Scope}}),Object.defineProperty(e,"ValueScope",{enumerable:!0,get:function(){return a.ValueScope}}),Object.defineProperty(e,"ValueScopeName",{enumerable:!0,get:function(){return a.ValueScopeName}}),Object.defineProperty(e,"varKinds",{enumerable:!0,get:function(){return a.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("+")};class i{optimizeNodes(){return this}optimizeNames(k,M){return this}}class s extends i{constructor(k,M,I){super(),this.varKind=k,this.name=M,this.rhs=I}render({es5:k,_n:M}){const I=k?n.varKinds.var:this.varKind,Q=this.rhs===void 0?"":` = ${this.rhs}`;return`${I} ${this.name}${Q};`+M}optimizeNames(k,M){if(k[this.name.str])return this.rhs&&(this.rhs=D(this.rhs,k,M)),this}get names(){return this.rhs instanceof t._CodeOrName?this.rhs.names:{}}}class o extends i{constructor(k,M,I){super(),this.lhs=k,this.rhs=M,this.sideEffects=I}render({_n:k}){return`${this.lhs} = ${this.rhs};`+k}optimizeNames(k,M){if(!(this.lhs instanceof t.Name&&!k[this.lhs.str]&&!this.sideEffects))return this.rhs=D(this.rhs,k,M),this}get names(){const k=this.lhs instanceof t.Name?{}:{...this.lhs.names};return z(k,this.rhs)}}class l extends o{constructor(k,M,I,Q){super(k,I,Q),this.op=M}render({_n:k}){return`${this.lhs} ${this.op}= ${this.rhs};`+k}}class u extends i{constructor(k){super(),this.label=k,this.names={}}render({_n:k}){return`${this.label}:`+k}}class d extends i{constructor(k){super(),this.label=k,this.names={}}render({_n:k}){return`break${this.label?` ${this.label}`:""};`+k}}class f extends i{constructor(k){super(),this.error=k}render({_n:k}){return`throw ${this.error};`+k}get names(){return this.error.names}}class m extends i{constructor(k){super(),this.code=k}render({_n:k}){return`${this.code};`+k}optimizeNodes(){return`${this.code}`?this:void 0}optimizeNames(k,M){return this.code=D(this.code,k,M),this}get names(){return this.code instanceof t._CodeOrName?this.code.names:{}}}class h extends i{constructor(k=[]){super(),this.nodes=k}render(k){return this.nodes.reduce((M,I)=>M+I.render(k),"")}optimizeNodes(){const{nodes:k}=this;let M=k.length;for(;M--;){const I=k[M].optimizeNodes();Array.isArray(I)?k.splice(M,1,...I):I?k[M]=I:k.splice(M,1)}return k.length>0?this:void 0}optimizeNames(k,M){const{nodes:I}=this;let Q=I.length;for(;Q--;){const W=I[Q];W.optimizeNames(k,M)||(A(k,W.names),I.splice(Q,1))}return I.length>0?this:void 0}get names(){return this.nodes.reduce((k,M)=>O(k,M.names),{})}}class y extends h{render(k){return"{"+k._n+super.render(k)+"}"+k._n}}class p extends h{}class b extends y{}b.kind="else";class g extends y{constructor(k,M){super(M),this.condition=k}render(k){let M=`if(${this.condition})`+super.render(k);return this.else&&(M+="else "+this.else.render(k)),M}optimizeNodes(){super.optimizeNodes();const k=this.condition;if(k===!0)return this.nodes;let M=this.else;if(M){const I=M.optimizeNodes();M=this.else=Array.isArray(I)?new b(I):I}if(M)return k===!1?M instanceof g?M:M.nodes:this.nodes.length?this:new g(B(k),M instanceof g?[M]:M.nodes);if(!(k===!1||!this.nodes.length))return this}optimizeNames(k,M){var I;if(this.else=(I=this.else)===null||I===void 0?void 0:I.optimizeNames(k,M),!!(super.optimizeNames(k,M)||this.else))return this.condition=D(this.condition,k,M),this}get names(){const k=super.names;return z(k,this.condition),this.else&&O(k,this.else.names),k}}g.kind="if";class v extends y{}v.kind="for";class w extends v{constructor(k){super(),this.iteration=k}render(k){return`for(${this.iteration})`+super.render(k)}optimizeNames(k,M){if(super.optimizeNames(k,M))return this.iteration=D(this.iteration,k,M),this}get names(){return O(super.names,this.iteration.names)}}class S extends v{constructor(k,M,I,Q){super(),this.varKind=k,this.name=M,this.from=I,this.to=Q}render(k){const M=k.es5?n.varKinds.var:this.varKind,{name:I,from:Q,to:W}=this;return`for(${M} ${I}=${Q}; ${I}<${W}; ${I}++)`+super.render(k)}get names(){const k=z(super.names,this.from);return z(k,this.to)}}class E extends v{constructor(k,M,I,Q){super(),this.loop=k,this.varKind=M,this.name=I,this.iterable=Q}render(k){return`for(${this.varKind} ${this.name} ${this.loop} ${this.iterable})`+super.render(k)}optimizeNames(k,M){if(super.optimizeNames(k,M))return this.iterable=D(this.iterable,k,M),this}get names(){return O(super.names,this.iterable.names)}}class C extends y{constructor(k,M,I){super(),this.name=k,this.args=M,this.async=I}render(k){return`${this.async?"async ":""}function ${this.name}(${this.args})`+super.render(k)}}C.kind="func";class T extends h{render(k){return"return "+super.render(k)}}T.kind="return";class P extends y{render(k){let M="try"+super.render(k);return this.catch&&(M+=this.catch.render(k)),this.finally&&(M+=this.finally.render(k)),M}optimizeNodes(){var k,M;return super.optimizeNodes(),(k=this.catch)===null||k===void 0||k.optimizeNodes(),(M=this.finally)===null||M===void 0||M.optimizeNodes(),this}optimizeNames(k,M){var I,Q;return super.optimizeNames(k,M),(I=this.catch)===null||I===void 0||I.optimizeNames(k,M),(Q=this.finally)===null||Q===void 0||Q.optimizeNames(k,M),this}get names(){const k=super.names;return this.catch&&O(k,this.catch.names),this.finally&&O(k,this.finally.names),k}}class R extends y{constructor(k){super(),this.error=k}render(k){return`catch(${this.error})`+super.render(k)}}R.kind="catch";class $ extends y{render(k){return"finally"+super.render(k)}}$.kind="finally";class j{constructor(k,M={}){this._values={},this._blockStarts=[],this._constants={},this.opts={...M,_n:M.lines?`
483
+ `:""},this._extScope=k,this._scope=new n.Scope({parent:k}),this._nodes=[new p]}toString(){return this._root.render(this.opts)}name(k){return this._scope.name(k)}scopeName(k){return this._extScope.name(k)}scopeValue(k,M){const I=this._extScope.value(k,M);return(this._values[I.prefix]||(this._values[I.prefix]=new Set)).add(I),I}getScopeValue(k,M){return this._extScope.getValue(k,M)}scopeRefs(k){return this._extScope.scopeRefs(k,this._values)}scopeCode(){return this._extScope.scopeCode(this._values)}_def(k,M,I,Q){const W=this._scope.toName(M);return I!==void 0&&Q&&(this._constants[W.str]=I),this._leafNode(new s(k,W,I)),W}const(k,M,I){return this._def(n.varKinds.const,k,M,I)}let(k,M,I){return this._def(n.varKinds.let,k,M,I)}var(k,M,I){return this._def(n.varKinds.var,k,M,I)}assign(k,M,I){return this._leafNode(new o(k,M,I))}add(k,M){return this._leafNode(new l(k,e.operators.ADD,M))}code(k){return typeof k=="function"?k():k!==t.nil&&this._leafNode(new m(k)),this}object(...k){const M=["{"];for(const[I,Q]of k)M.length>1&&M.push(","),M.push(I),(I!==Q||this.opts.es5)&&(M.push(":"),(0,t.addCodeArg)(M,Q));return M.push("}"),new t._Code(M)}if(k,M,I){if(this._blockNode(new g(k)),M&&I)this.code(M).else().code(I).endIf();else if(M)this.code(M).endIf();else if(I)throw new Error('CodeGen: "else" body without "then" body');return this}elseIf(k){return this._elseNode(new g(k))}else(){return this._elseNode(new b)}endIf(){return this._endBlockNode(g,b)}_for(k,M){return this._blockNode(k),M&&this.code(M).endFor(),this}for(k,M){return this._for(new w(k),M)}forRange(k,M,I,Q,W=this.opts.es5?n.varKinds.var:n.varKinds.let){const oe=this._scope.toName(k);return this._for(new S(W,oe,M,I),()=>Q(oe))}forOf(k,M,I,Q=n.varKinds.const){const W=this._scope.toName(k);if(this.opts.es5){const oe=M instanceof t.Name?M:this.var("_arr",M);return this.forRange("_i",0,(0,t._)`${oe}.length`,de=>{this.var(W,(0,t._)`${oe}[${de}]`),I(W)})}return this._for(new E("of",Q,W,M),()=>I(W))}forIn(k,M,I,Q=this.opts.es5?n.varKinds.var:n.varKinds.const){if(this.opts.ownProperties)return this.forOf(k,(0,t._)`Object.keys(${M})`,I);const W=this._scope.toName(k);return this._for(new E("in",Q,W,M),()=>I(W))}endFor(){return this._endBlockNode(v)}label(k){return this._leafNode(new u(k))}break(k){return this._leafNode(new d(k))}return(k){const M=new T;if(this._blockNode(M),this.code(k),M.nodes.length!==1)throw new Error('CodeGen: "return" should have one node');return this._endBlockNode(T)}try(k,M,I){if(!M&&!I)throw new Error('CodeGen: "try" without "catch" and "finally"');const Q=new P;if(this._blockNode(Q),this.code(k),M){const W=this.name("e");this._currNode=Q.catch=new R(W),M(W)}return I&&(this._currNode=Q.finally=new $,this.code(I)),this._endBlockNode(R,$)}throw(k){return this._leafNode(new f(k))}block(k,M){return this._blockStarts.push(this._nodes.length),k&&this.code(k).endBlock(M),this}endBlock(k){const M=this._blockStarts.pop();if(M===void 0)throw new Error("CodeGen: not in self-balancing block");const I=this._nodes.length-M;if(I<0||k!==void 0&&I!==k)throw new Error(`CodeGen: wrong number of nodes: ${I} vs ${k} expected`);return this._nodes.length=M,this}func(k,M=t.nil,I,Q){return this._blockNode(new C(k,M,I)),Q&&this.code(Q).endFunc(),this}endFunc(){return this._endBlockNode(C)}optimize(k=1){for(;k-- >0;)this._root.optimizeNodes(),this._root.optimizeNames(this._root.names,this._constants)}_leafNode(k){return this._currNode.nodes.push(k),this}_blockNode(k){this._currNode.nodes.push(k),this._nodes.push(k)}_endBlockNode(k,M){const I=this._currNode;if(I instanceof k||M&&I instanceof M)return this._nodes.pop(),this;throw new Error(`CodeGen: not in block "${M?`${k.kind}/${M.kind}`:k.kind}"`)}_elseNode(k){const M=this._currNode;if(!(M instanceof g))throw new Error('CodeGen: "else" without "if"');return this._currNode=M.else=k,this}get _root(){return this._nodes[0]}get _currNode(){const k=this._nodes;return k[k.length-1]}set _currNode(k){const M=this._nodes;M[M.length-1]=k}}e.CodeGen=j;function O(_,k){for(const M in k)_[M]=(_[M]||0)+(k[M]||0);return _}function z(_,k){return k instanceof t._CodeOrName?O(_,k.names):_}function D(_,k,M){if(_ instanceof t.Name)return I(_);if(!Q(_))return _;return new t._Code(_._items.reduce((W,oe)=>(oe instanceof t.Name&&(oe=I(oe)),oe instanceof t._Code?W.push(...oe._items):W.push(oe),W),[]));function I(W){const oe=M[W.str];return oe===void 0||k[W.str]!==1?W:(delete k[W.str],oe)}function Q(W){return W instanceof t._Code&&W._items.some(oe=>oe instanceof t.Name&&k[oe.str]===1&&M[oe.str]!==void 0)}}function A(_,k){for(const M in k)_[M]=(_[M]||0)-(k[M]||0)}function B(_){return typeof _=="boolean"||typeof _=="number"||_===null?!_:(0,t._)`!${G(_)}`}e.not=B;const Z=q(e.operators.AND);function F(..._){return _.reduce(Z)}e.and=F;const J=q(e.operators.OR);function N(..._){return _.reduce(J)}e.or=N;function q(_){return(k,M)=>k===t.nil?M:M===t.nil?k:(0,t._)`${G(k)} ${_} ${G(M)}`}function G(_){return _ instanceof t.Name?_:(0,t._)`(${_})`}})(Ue);var ge={};Object.defineProperty(ge,"__esModule",{value:!0});ge.checkStrictMode=ge.getErrorPath=ge.Type=ge.useFunc=ge.setEvaluated=ge.evaluatedPropsToName=ge.mergeEvaluated=ge.eachItem=ge.unescapeJsonPointer=ge.escapeJsonPointer=ge.escapeFragment=ge.unescapeFragment=ge.schemaRefOrVal=ge.schemaHasRulesButRef=ge.schemaHasRules=ge.checkUnknownRules=ge.alwaysValidSchema=ge.toHash=void 0;const ut=Ue,aee=ed;function iee(e){const t={};for(const n of e)t[n]=!0;return t}ge.toHash=iee;function see(e,t){return typeof t=="boolean"?t:Object.keys(t).length===0?!0:(DM(e,t),!zM(t,e.self.RULES.all))}ge.alwaysValidSchema=see;function DM(e,t=e.schema){const{opts:n,self:r}=e;if(!n.strictSchema||typeof t=="boolean")return;const a=r.RULES.keywords;for(const i in t)a[i]||UM(e,`unknown keyword: "${i}"`)}ge.checkUnknownRules=DM;function zM(e,t){if(typeof e=="boolean")return!e;for(const n in e)if(t[n])return!0;return!1}ge.schemaHasRules=zM;function oee(e,t){if(typeof e=="boolean")return!e;for(const n in e)if(n!=="$ref"&&t.all[n])return!0;return!1}ge.schemaHasRulesButRef=oee;function lee({topSchemaRef:e,schemaPath:t},n,r,a){if(!a){if(typeof n=="number"||typeof n=="boolean")return n;if(typeof n=="string")return(0,ut._)`${n}`}return(0,ut._)`${e}${t}${(0,ut.getProperty)(r)}`}ge.schemaRefOrVal=lee;function cee(e){return IM(decodeURIComponent(e))}ge.unescapeFragment=cee;function uee(e){return encodeURIComponent(xw(e))}ge.escapeFragment=uee;function xw(e){return typeof e=="number"?`${e}`:e.replace(/~/g,"~0").replace(/\//g,"~1")}ge.escapeJsonPointer=xw;function IM(e){return e.replace(/~1/g,"/").replace(/~0/g,"~")}ge.unescapeJsonPointer=IM;function dee(e,t){if(Array.isArray(e))for(const n of e)t(n);else t(e)}ge.eachItem=dee;function _E({mergeNames:e,mergeToName:t,mergeValues:n,resultToName:r}){return(a,i,s,o)=>{const l=s===void 0?i:s instanceof ut.Name?(i instanceof ut.Name?e(a,i,s):t(a,i,s),s):i instanceof ut.Name?(t(a,s,i),i):n(i,s);return o===ut.Name&&!(l instanceof ut.Name)?r(a,l):l}}ge.mergeEvaluated={props:_E({mergeNames:(e,t,n)=>e.if((0,ut._)`${n} !== true && ${t} !== undefined`,()=>{e.if((0,ut._)`${t} === true`,()=>e.assign(n,!0),()=>e.assign(n,(0,ut._)`${n} || {}`).code((0,ut._)`Object.assign(${n}, ${t})`))}),mergeToName:(e,t,n)=>e.if((0,ut._)`${n} !== true`,()=>{t===!0?e.assign(n,!0):(e.assign(n,(0,ut._)`${n} || {}`),ww(e,n,t))}),mergeValues:(e,t)=>e===!0?!0:{...e,...t},resultToName:LM}),items:_E({mergeNames:(e,t,n)=>e.if((0,ut._)`${n} !== true && ${t} !== undefined`,()=>e.assign(n,(0,ut._)`${t} === true ? true : ${n} > ${t} ? ${n} : ${t}`)),mergeToName:(e,t,n)=>e.if((0,ut._)`${n} !== true`,()=>e.assign(n,t===!0?!0:(0,ut._)`${n} > ${t} ? ${n} : ${t}`)),mergeValues:(e,t)=>e===!0?!0:Math.max(e,t),resultToName:(e,t)=>e.var("items",t)})};function LM(e,t){if(t===!0)return e.var("props",!0);const n=e.var("props",(0,ut._)`{}`);return t!==void 0&&ww(e,n,t),n}ge.evaluatedPropsToName=LM;function ww(e,t,n){Object.keys(n).forEach(r=>e.assign((0,ut._)`${t}${(0,ut.getProperty)(r)}`,!0))}ge.setEvaluated=ww;const kE={};function fee(e,t){return e.scopeValue("func",{ref:t,code:kE[t.code]||(kE[t.code]=new aee._Code(t.code))})}ge.useFunc=fee;var j0;(function(e){e[e.Num=0]="Num",e[e.Str=1]="Str"})(j0||(ge.Type=j0={}));function hee(e,t,n){if(e instanceof ut.Name){const r=t===j0.Num;return n?r?(0,ut._)`"[" + ${e} + "]"`:(0,ut._)`"['" + ${e} + "']"`:r?(0,ut._)`"/" + ${e}`:(0,ut._)`"/" + ${e}.replace(/~/g, "~0").replace(/\\//g, "~1")`}return n?(0,ut.getProperty)(e).toString():"/"+xw(e)}ge.getErrorPath=hee;function UM(e,t,n=e.opts.strictSchema){if(n){if(t=`strict mode: ${t}`,n===!0)throw new Error(t);e.self.logger.warn(t)}}ge.checkStrictMode=UM;var Na={};Object.defineProperty(Na,"__esModule",{value:!0});const Cn=Ue,mee={data:new Cn.Name("data"),valCxt:new Cn.Name("valCxt"),instancePath:new Cn.Name("instancePath"),parentData:new Cn.Name("parentData"),parentDataProperty:new Cn.Name("parentDataProperty"),rootData:new Cn.Name("rootData"),dynamicAnchors:new Cn.Name("dynamicAnchors"),vErrors:new Cn.Name("vErrors"),errors:new Cn.Name("errors"),this:new Cn.Name("this"),self:new Cn.Name("self"),scope:new Cn.Name("scope"),json:new Cn.Name("json"),jsonPos:new Cn.Name("jsonPos"),jsonLen:new Cn.Name("jsonLen"),jsonPart:new Cn.Name("jsonPart")};Na.default=mee;(function(e){Object.defineProperty(e,"__esModule",{value:!0}),e.extendErrors=e.resetErrorsCount=e.reportExtraError=e.reportError=e.keyword$DataError=e.keywordError=void 0;const t=Ue,n=ge,r=Na;e.keywordError={message:({keyword:b})=>(0,t.str)`must pass "${b}" keyword validation`},e.keyword$DataError={message:({keyword:b,schemaType:g})=>g?(0,t.str)`"${b}" keyword must be ${g} ($data)`:(0,t.str)`"${b}" keyword is invalid ($data)`};function a(b,g=e.keywordError,v,w){const{it:S}=b,{gen:E,compositeRule:C,allErrors:T}=S,P=f(b,g,v);w??(C||T)?l(E,P):u(S,(0,t._)`[${P}]`)}e.reportError=a;function i(b,g=e.keywordError,v){const{it:w}=b,{gen:S,compositeRule:E,allErrors:C}=w,T=f(b,g,v);l(S,T),E||C||u(w,r.default.vErrors)}e.reportExtraError=i;function s(b,g){b.assign(r.default.errors,g),b.if((0,t._)`${r.default.vErrors} !== null`,()=>b.if(g,()=>b.assign((0,t._)`${r.default.vErrors}.length`,g),()=>b.assign(r.default.vErrors,null)))}e.resetErrorsCount=s;function o({gen:b,keyword:g,schemaValue:v,data:w,errsCount:S,it:E}){if(S===void 0)throw new Error("ajv implementation error");const C=b.name("err");b.forRange("i",S,r.default.errors,T=>{b.const(C,(0,t._)`${r.default.vErrors}[${T}]`),b.if((0,t._)`${C}.instancePath === undefined`,()=>b.assign((0,t._)`${C}.instancePath`,(0,t.strConcat)(r.default.instancePath,E.errorPath))),b.assign((0,t._)`${C}.schemaPath`,(0,t.str)`${E.errSchemaPath}/${g}`),E.opts.verbose&&(b.assign((0,t._)`${C}.schema`,v),b.assign((0,t._)`${C}.data`,w))})}e.extendErrors=o;function l(b,g){const v=b.const("err",g);b.if((0,t._)`${r.default.vErrors} === null`,()=>b.assign(r.default.vErrors,(0,t._)`[${v}]`),(0,t._)`${r.default.vErrors}.push(${v})`),b.code((0,t._)`${r.default.errors}++`)}function u(b,g){const{gen:v,validateName:w,schemaEnv:S}=b;S.$async?v.throw((0,t._)`new ${b.ValidationError}(${g})`):(v.assign((0,t._)`${w}.errors`,g),v.return(!1))}const d={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 f(b,g,v){const{createErrors:w}=b.it;return w===!1?(0,t._)`{}`:m(b,g,v)}function m(b,g,v={}){const{gen:w,it:S}=b,E=[h(S,v),y(b,v)];return p(b,g,E),w.object(...E)}function h({errorPath:b},{instancePath:g}){const v=g?(0,t.str)`${b}${(0,n.getErrorPath)(g,n.Type.Str)}`:b;return[r.default.instancePath,(0,t.strConcat)(r.default.instancePath,v)]}function y({keyword:b,it:{errSchemaPath:g}},{schemaPath:v,parentSchema:w}){let S=w?g:(0,t.str)`${g}/${b}`;return v&&(S=(0,t.str)`${S}${(0,n.getErrorPath)(v,n.Type.Str)}`),[d.schemaPath,S]}function p(b,{params:g,message:v},w){const{keyword:S,data:E,schemaValue:C,it:T}=b,{opts:P,propertyName:R,topSchemaRef:$,schemaPath:j}=T;w.push([d.keyword,S],[d.params,typeof g=="function"?g(b):g||(0,t._)`{}`]),P.messages&&w.push([d.message,typeof v=="function"?v(b):v]),P.verbose&&w.push([d.schema,C],[d.parentSchema,(0,t._)`${$}${j}`],[r.default.data,E]),R&&w.push([d.propertyName,R])}})(Id);var EE;function pee(){if(EE)return Ts;EE=1,Object.defineProperty(Ts,"__esModule",{value:!0}),Ts.boolOrEmptySchema=Ts.topBoolOrEmptySchema=void 0;const e=Id,t=Ue,n=Na,r={message:"boolean schema is false"};function a(o){const{gen:l,schema:u,validateName:d}=o;u===!1?s(o,!1):typeof u=="object"&&u.$async===!0?l.return(n.default.data):(l.assign((0,t._)`${d}.errors`,null),l.return(!0))}Ts.topBoolOrEmptySchema=a;function i(o,l){const{gen:u,schema:d}=o;d===!1?(u.var(l,!1),s(o)):u.var(l,!0)}Ts.boolOrEmptySchema=i;function s(o,l){const{gen:u,data:d}=o,f={gen:u,keyword:"false schema",data:d,schema:!1,schemaCode:!1,schemaValue:!1,params:{},it:o};(0,e.reportError)(f,r,void 0,l)}return Ts}var Xt={},bo={};Object.defineProperty(bo,"__esModule",{value:!0});bo.getRules=bo.isJSONType=void 0;const gee=["string","number","integer","boolean","null","object","array"],yee=new Set(gee);function vee(e){return typeof e=="string"&&yee.has(e)}bo.isJSONType=vee;function bee(){const 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:{}}}bo.getRules=bee;var ni={};Object.defineProperty(ni,"__esModule",{value:!0});ni.shouldUseRule=ni.shouldUseGroup=ni.schemaHasRulesForType=void 0;function xee({schema:e,self:t},n){const r=t.RULES.types[n];return r&&r!==!0&&FM(e,r)}ni.schemaHasRulesForType=xee;function FM(e,t){return t.rules.some(n=>qM(e,n))}ni.shouldUseGroup=FM;function qM(e,t){var n;return e[t.keyword]!==void 0||((n=t.definition.implements)===null||n===void 0?void 0:n.some(r=>e[r]!==void 0))}ni.shouldUseRule=qM;Object.defineProperty(Xt,"__esModule",{value:!0});Xt.reportTypeError=Xt.checkDataTypes=Xt.checkDataType=Xt.coerceAndCheckDataType=Xt.getJSONTypes=Xt.getSchemaTypes=Xt.DataType=void 0;const wee=bo,See=ni,_ee=Id,Ie=Ue,HM=ge;var _l;(function(e){e[e.Correct=0]="Correct",e[e.Wrong=1]="Wrong"})(_l||(Xt.DataType=_l={}));function kee(e){const t=BM(e.type);if(t.includes("null")){if(e.nullable===!1)throw new Error("type: null contradicts nullable: false")}else{if(!t.length&&e.nullable!==void 0)throw new Error('"nullable" cannot be used without "type"');e.nullable===!0&&t.push("null")}return t}Xt.getSchemaTypes=kee;function BM(e){const t=Array.isArray(e)?e:e?[e]:[];if(t.every(wee.isJSONType))return t;throw new Error("type must be JSONType or JSONType[]: "+t.join(","))}Xt.getJSONTypes=BM;function Eee(e,t){const{gen:n,data:r,opts:a}=e,i=Cee(t,a.coerceTypes),s=t.length>0&&!(i.length===0&&t.length===1&&(0,See.schemaHasRulesForType)(e,t[0]));if(s){const o=Sw(t,r,a.strictNumbers,_l.Wrong);n.if(o,()=>{i.length?Nee(e,t,i):_w(e)})}return s}Xt.coerceAndCheckDataType=Eee;const VM=new Set(["string","number","integer","boolean","null"]);function Cee(e,t){return t?e.filter(n=>VM.has(n)||t==="array"&&n==="array"):[]}function Nee(e,t,n){const{gen:r,data:a,opts:i}=e,s=r.let("dataType",(0,Ie._)`typeof ${a}`),o=r.let("coerced",(0,Ie._)`undefined`);i.coerceTypes==="array"&&r.if((0,Ie._)`${s} == 'object' && Array.isArray(${a}) && ${a}.length == 1`,()=>r.assign(a,(0,Ie._)`${a}[0]`).assign(s,(0,Ie._)`typeof ${a}`).if(Sw(t,a,i.strictNumbers),()=>r.assign(o,a))),r.if((0,Ie._)`${o} !== undefined`);for(const u of n)(VM.has(u)||u==="array"&&i.coerceTypes==="array")&&l(u);r.else(),_w(e),r.endIf(),r.if((0,Ie._)`${o} !== undefined`,()=>{r.assign(a,o),jee(e,o)});function l(u){switch(u){case"string":r.elseIf((0,Ie._)`${s} == "number" || ${s} == "boolean"`).assign(o,(0,Ie._)`"" + ${a}`).elseIf((0,Ie._)`${a} === null`).assign(o,(0,Ie._)`""`);return;case"number":r.elseIf((0,Ie._)`${s} == "boolean" || ${a} === null
484
+ || (${s} == "string" && ${a} && ${a} == +${a})`).assign(o,(0,Ie._)`+${a}`);return;case"integer":r.elseIf((0,Ie._)`${s} === "boolean" || ${a} === null
485
+ || (${s} === "string" && ${a} && ${a} == +${a} && !(${a} % 1))`).assign(o,(0,Ie._)`+${a}`);return;case"boolean":r.elseIf((0,Ie._)`${a} === "false" || ${a} === 0 || ${a} === null`).assign(o,!1).elseIf((0,Ie._)`${a} === "true" || ${a} === 1`).assign(o,!0);return;case"null":r.elseIf((0,Ie._)`${a} === "" || ${a} === 0 || ${a} === false`),r.assign(o,null);return;case"array":r.elseIf((0,Ie._)`${s} === "string" || ${s} === "number"
486
+ || ${s} === "boolean" || ${a} === null`).assign(o,(0,Ie._)`[${a}]`)}}}function jee({gen:e,parentData:t,parentDataProperty:n},r){e.if((0,Ie._)`${t} !== undefined`,()=>e.assign((0,Ie._)`${t}[${n}]`,r))}function T0(e,t,n,r=_l.Correct){const a=r===_l.Correct?Ie.operators.EQ:Ie.operators.NEQ;let i;switch(e){case"null":return(0,Ie._)`${t} ${a} null`;case"array":i=(0,Ie._)`Array.isArray(${t})`;break;case"object":i=(0,Ie._)`${t} && typeof ${t} == "object" && !Array.isArray(${t})`;break;case"integer":i=s((0,Ie._)`!(${t} % 1) && !isNaN(${t})`);break;case"number":i=s();break;default:return(0,Ie._)`typeof ${t} ${a} ${e}`}return r===_l.Correct?i:(0,Ie.not)(i);function s(o=Ie.nil){return(0,Ie.and)((0,Ie._)`typeof ${t} == "number"`,o,n?(0,Ie._)`isFinite(${t})`:Ie.nil)}}Xt.checkDataType=T0;function Sw(e,t,n,r){if(e.length===1)return T0(e[0],t,n,r);let a;const i=(0,HM.toHash)(e);if(i.array&&i.object){const s=(0,Ie._)`typeof ${t} != "object"`;a=i.null?s:(0,Ie._)`!${t} || ${s}`,delete i.null,delete i.array,delete i.object}else a=Ie.nil;i.number&&delete i.integer;for(const s in i)a=(0,Ie.and)(a,T0(s,t,n,r));return a}Xt.checkDataTypes=Sw;const Tee={message:({schema:e})=>`must be ${e}`,params:({schema:e,schemaValue:t})=>typeof e=="string"?(0,Ie._)`{type: ${e}}`:(0,Ie._)`{type: ${t}}`};function _w(e){const t=Aee(e);(0,_ee.reportError)(t,Tee)}Xt.reportTypeError=_w;function Aee(e){const{gen:t,data:n,schema:r}=e,a=(0,HM.schemaRefOrVal)(e,r,"type");return{gen:t,keyword:"type",data:n,schema:r.type,schemaCode:a,schemaValue:a,parentSchema:r,params:{},it:e}}var Fc={},CE;function Ree(){if(CE)return Fc;CE=1,Object.defineProperty(Fc,"__esModule",{value:!0}),Fc.assignDefaults=void 0;const e=Ue,t=ge;function n(a,i){const{properties:s,items:o}=a.schema;if(i==="object"&&s)for(const l in s)r(a,l,s[l].default);else i==="array"&&Array.isArray(o)&&o.forEach((l,u)=>r(a,u,l.default))}Fc.assignDefaults=n;function r(a,i,s){const{gen:o,compositeRule:l,data:u,opts:d}=a;if(s===void 0)return;const f=(0,e._)`${u}${(0,e.getProperty)(i)}`;if(l){(0,t.checkStrictMode)(a,`default is ignored for: ${f}`);return}let m=(0,e._)`${f} === undefined`;d.useDefaults==="empty"&&(m=(0,e._)`${m} || ${f} === null || ${f} === ""`),o.if(m,(0,e._)`${f} = ${(0,e.stringify)(s)}`)}return Fc}var Hr={},qe={};Object.defineProperty(qe,"__esModule",{value:!0});qe.validateUnion=qe.validateArray=qe.usePattern=qe.callValidateCode=qe.schemaProperties=qe.allSchemaProperties=qe.noPropertyInData=qe.propertyInData=qe.isOwnProperty=qe.hasPropFunc=qe.reportMissingProp=qe.checkMissingProp=qe.checkReportMissingProp=void 0;const _t=Ue,kw=ge,Si=Na,$ee=ge;function Oee(e,t){const{gen:n,data:r,it:a}=e;n.if(Cw(n,r,t,a.opts.ownProperties),()=>{e.setParams({missingProperty:(0,_t._)`${t}`},!0),e.error()})}qe.checkReportMissingProp=Oee;function Mee({gen:e,data:t,it:{opts:n}},r,a){return(0,_t.or)(...r.map(i=>(0,_t.and)(Cw(e,t,i,n.ownProperties),(0,_t._)`${a} = ${i}`)))}qe.checkMissingProp=Mee;function Pee(e,t){e.setParams({missingProperty:t},!0),e.error()}qe.reportMissingProp=Pee;function KM(e){return e.scopeValue("func",{ref:Object.prototype.hasOwnProperty,code:(0,_t._)`Object.prototype.hasOwnProperty`})}qe.hasPropFunc=KM;function Ew(e,t,n){return(0,_t._)`${KM(e)}.call(${t}, ${n})`}qe.isOwnProperty=Ew;function Dee(e,t,n,r){const a=(0,_t._)`${t}${(0,_t.getProperty)(n)} !== undefined`;return r?(0,_t._)`${a} && ${Ew(e,t,n)}`:a}qe.propertyInData=Dee;function Cw(e,t,n,r){const a=(0,_t._)`${t}${(0,_t.getProperty)(n)} === undefined`;return r?(0,_t.or)(a,(0,_t.not)(Ew(e,t,n))):a}qe.noPropertyInData=Cw;function ZM(e){return e?Object.keys(e).filter(t=>t!=="__proto__"):[]}qe.allSchemaProperties=ZM;function zee(e,t){return ZM(t).filter(n=>!(0,kw.alwaysValidSchema)(e,t[n]))}qe.schemaProperties=zee;function Iee({schemaCode:e,data:t,it:{gen:n,topSchemaRef:r,schemaPath:a,errorPath:i},it:s},o,l,u){const d=u?(0,_t._)`${e}, ${t}, ${r}${a}`:t,f=[[Si.default.instancePath,(0,_t.strConcat)(Si.default.instancePath,i)],[Si.default.parentData,s.parentData],[Si.default.parentDataProperty,s.parentDataProperty],[Si.default.rootData,Si.default.rootData]];s.opts.dynamicRef&&f.push([Si.default.dynamicAnchors,Si.default.dynamicAnchors]);const m=(0,_t._)`${d}, ${n.object(...f)}`;return l!==_t.nil?(0,_t._)`${o}.call(${l}, ${m})`:(0,_t._)`${o}(${m})`}qe.callValidateCode=Iee;const Lee=(0,_t._)`new RegExp`;function Uee({gen:e,it:{opts:t}},n){const r=t.unicodeRegExp?"u":"",{regExp:a}=t.code,i=a(n,r);return e.scopeValue("pattern",{key:i.toString(),ref:i,code:(0,_t._)`${a.code==="new RegExp"?Lee:(0,$ee.useFunc)(e,a)}(${n}, ${r})`})}qe.usePattern=Uee;function Fee(e){const{gen:t,data:n,keyword:r,it:a}=e,i=t.name("valid");if(a.allErrors){const o=t.let("valid",!0);return s(()=>t.assign(o,!1)),o}return t.var(i,!0),s(()=>t.break()),i;function s(o){const l=t.const("len",(0,_t._)`${n}.length`);t.forRange("i",0,l,u=>{e.subschema({keyword:r,dataProp:u,dataPropType:kw.Type.Num},i),t.if((0,_t.not)(i),o)})}}qe.validateArray=Fee;function qee(e){const{gen:t,schema:n,keyword:r,it:a}=e;if(!Array.isArray(n))throw new Error("ajv implementation error");if(n.some(l=>(0,kw.alwaysValidSchema)(a,l))&&!a.opts.unevaluated)return;const s=t.let("valid",!1),o=t.name("_valid");t.block(()=>n.forEach((l,u)=>{const d=e.subschema({keyword:r,schemaProp:u,compositeRule:!0},o);t.assign(s,(0,_t._)`${s} || ${o}`),e.mergeValidEvaluated(d,o)||t.if((0,_t.not)(s))})),e.result(s,()=>e.reset(),()=>e.error(!0))}qe.validateUnion=qee;var NE;function Hee(){if(NE)return Hr;NE=1,Object.defineProperty(Hr,"__esModule",{value:!0}),Hr.validateKeywordUsage=Hr.validSchemaType=Hr.funcKeywordCode=Hr.macroKeywordCode=void 0;const e=Ue,t=Na,n=qe,r=Id;function a(m,h){const{gen:y,keyword:p,schema:b,parentSchema:g,it:v}=m,w=h.macro.call(v.self,b,g,v),S=u(y,p,w);v.opts.validateSchema!==!1&&v.self.validateSchema(w,!0);const E=y.name("valid");m.subschema({schema:w,schemaPath:e.nil,errSchemaPath:`${v.errSchemaPath}/${p}`,topSchemaRef:S,compositeRule:!0},E),m.pass(E,()=>m.error(!0))}Hr.macroKeywordCode=a;function i(m,h){var y;const{gen:p,keyword:b,schema:g,parentSchema:v,$data:w,it:S}=m;l(S,h);const E=!w&&h.compile?h.compile.call(S.self,g,v,S):h.validate,C=u(p,b,E),T=p.let("valid");m.block$data(T,P),m.ok((y=h.valid)!==null&&y!==void 0?y:T);function P(){if(h.errors===!1)j(),h.modifying&&s(m),O(()=>m.error());else{const z=h.async?R():$();h.modifying&&s(m),O(()=>o(m,z))}}function R(){const z=p.let("ruleErrs",null);return p.try(()=>j((0,e._)`await `),D=>p.assign(T,!1).if((0,e._)`${D} instanceof ${S.ValidationError}`,()=>p.assign(z,(0,e._)`${D}.errors`),()=>p.throw(D))),z}function $(){const z=(0,e._)`${C}.errors`;return p.assign(z,null),j(e.nil),z}function j(z=h.async?(0,e._)`await `:e.nil){const D=S.opts.passContext?t.default.this:t.default.self,A=!("compile"in h&&!w||h.schema===!1);p.assign(T,(0,e._)`${z}${(0,n.callValidateCode)(m,C,D,A)}`,h.modifying)}function O(z){var D;p.if((0,e.not)((D=h.valid)!==null&&D!==void 0?D:T),z)}}Hr.funcKeywordCode=i;function s(m){const{gen:h,data:y,it:p}=m;h.if(p.parentData,()=>h.assign(y,(0,e._)`${p.parentData}[${p.parentDataProperty}]`))}function o(m,h){const{gen:y}=m;y.if((0,e._)`Array.isArray(${h})`,()=>{y.assign(t.default.vErrors,(0,e._)`${t.default.vErrors} === null ? ${h} : ${t.default.vErrors}.concat(${h})`).assign(t.default.errors,(0,e._)`${t.default.vErrors}.length`),(0,r.extendErrors)(m)},()=>m.error())}function l({schemaEnv:m},h){if(h.async&&!m.$async)throw new Error("async keyword in sync schema")}function u(m,h,y){if(y===void 0)throw new Error(`keyword "${h}" failed to compile`);return m.scopeValue("keyword",typeof y=="function"?{ref:y}:{ref:y,code:(0,e.stringify)(y)})}function d(m,h,y=!1){return!h.length||h.some(p=>p==="array"?Array.isArray(m):p==="object"?m&&typeof m=="object"&&!Array.isArray(m):typeof m==p||y&&typeof m>"u")}Hr.validSchemaType=d;function f({schema:m,opts:h,self:y,errSchemaPath:p},b,g){if(Array.isArray(b.keyword)?!b.keyword.includes(g):b.keyword!==g)throw new Error("ajv implementation error");const v=b.dependencies;if(v!=null&&v.some(w=>!Object.prototype.hasOwnProperty.call(m,w)))throw new Error(`parent schema must have dependencies of ${g}: ${v.join(",")}`);if(b.validateSchema&&!b.validateSchema(m[g])){const S=`keyword "${g}" value is invalid at path "${p}": `+y.errorsText(b.validateSchema.errors);if(h.validateSchema==="log")y.logger.error(S);else throw new Error(S)}}return Hr.validateKeywordUsage=f,Hr}var Da={},jE;function Bee(){if(jE)return Da;jE=1,Object.defineProperty(Da,"__esModule",{value:!0}),Da.extendSubschemaMode=Da.extendSubschemaData=Da.getSubschema=void 0;const e=Ue,t=ge;function n(i,{keyword:s,schemaProp:o,schema:l,schemaPath:u,errSchemaPath:d,topSchemaRef:f}){if(s!==void 0&&l!==void 0)throw new Error('both "keyword" and "schema" passed, only one allowed');if(s!==void 0){const m=i.schema[s];return o===void 0?{schema:m,schemaPath:(0,e._)`${i.schemaPath}${(0,e.getProperty)(s)}`,errSchemaPath:`${i.errSchemaPath}/${s}`}:{schema:m[o],schemaPath:(0,e._)`${i.schemaPath}${(0,e.getProperty)(s)}${(0,e.getProperty)(o)}`,errSchemaPath:`${i.errSchemaPath}/${s}/${(0,t.escapeFragment)(o)}`}}if(l!==void 0){if(u===void 0||d===void 0||f===void 0)throw new Error('"schemaPath", "errSchemaPath" and "topSchemaRef" are required with "schema"');return{schema:l,schemaPath:u,topSchemaRef:f,errSchemaPath:d}}throw new Error('either "keyword" or "schema" must be passed')}Da.getSubschema=n;function r(i,s,{dataProp:o,dataPropType:l,data:u,dataTypes:d,propertyName:f}){if(u!==void 0&&o!==void 0)throw new Error('both "data" and "dataProp" passed, only one allowed');const{gen:m}=s;if(o!==void 0){const{errorPath:y,dataPathArr:p,opts:b}=s,g=m.let("data",(0,e._)`${s.data}${(0,e.getProperty)(o)}`,!0);h(g),i.errorPath=(0,e.str)`${y}${(0,t.getErrorPath)(o,l,b.jsPropertySyntax)}`,i.parentDataProperty=(0,e._)`${o}`,i.dataPathArr=[...p,i.parentDataProperty]}if(u!==void 0){const y=u instanceof e.Name?u:m.let("data",u,!0);h(y),f!==void 0&&(i.propertyName=f)}d&&(i.dataTypes=d);function h(y){i.data=y,i.dataLevel=s.dataLevel+1,i.dataTypes=[],s.definedProperties=new Set,i.parentData=s.data,i.dataNames=[...s.dataNames,y]}}Da.extendSubschemaData=r;function a(i,{jtdDiscriminator:s,jtdMetadata:o,compositeRule:l,createErrors:u,allErrors:d}){l!==void 0&&(i.compositeRule=l),u!==void 0&&(i.createErrors=u),d!==void 0&&(i.allErrors=d),i.jtdDiscriminator=s,i.jtdMetadata=o}return Da.extendSubschemaMode=a,Da}var gn={},GM=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,a,i;if(Array.isArray(t)){if(r=t.length,r!=n.length)return!1;for(a=r;a--!==0;)if(!e(t[a],n[a]))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(i=Object.keys(t),r=i.length,r!==Object.keys(n).length)return!1;for(a=r;a--!==0;)if(!Object.prototype.hasOwnProperty.call(n,i[a]))return!1;for(a=r;a--!==0;){var s=i[a];if(!e(t[s],n[s]))return!1}return!0}return t!==t&&n!==n},QM={exports:{}},Yi=QM.exports=function(e,t,n){typeof t=="function"&&(n=t,t={}),n=t.cb||n;var r=typeof n=="function"?n:n.pre||function(){},a=n.post||function(){};oh(t,r,a,e,"",e)};Yi.keywords={additionalItems:!0,items:!0,contains:!0,additionalProperties:!0,propertyNames:!0,not:!0,if:!0,then:!0,else:!0};Yi.arrayKeywords={items:!0,allOf:!0,anyOf:!0,oneOf:!0};Yi.propsKeywords={$defs:!0,definitions:!0,properties:!0,patternProperties:!0,dependencies:!0};Yi.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 oh(e,t,n,r,a,i,s,o,l,u){if(r&&typeof r=="object"&&!Array.isArray(r)){t(r,a,i,s,o,l,u);for(var d in r){var f=r[d];if(Array.isArray(f)){if(d in Yi.arrayKeywords)for(var m=0;m<f.length;m++)oh(e,t,n,f[m],a+"/"+d+"/"+m,i,a,d,r,m)}else if(d in Yi.propsKeywords){if(f&&typeof f=="object")for(var h in f)oh(e,t,n,f[h],a+"/"+d+"/"+Vee(h),i,a,d,r,h)}else(d in Yi.keywords||e.allKeys&&!(d in Yi.skipKeywords))&&oh(e,t,n,f,a+"/"+d,i,a,d,r)}n(r,a,i,s,o,l,u)}}function Vee(e){return e.replace(/~/g,"~0").replace(/\//g,"~1")}var Kee=QM.exports;Object.defineProperty(gn,"__esModule",{value:!0});gn.getSchemaRefs=gn.resolveUrl=gn.normalizeId=gn._getFullPath=gn.getFullPath=gn.inlineRef=void 0;const Zee=ge,Gee=GM,Qee=Kee,Yee=new Set(["type","format","pattern","maxLength","minLength","maxProperties","minProperties","maxItems","minItems","maximum","minimum","uniqueItems","multipleOf","required","enum","const"]);function Xee(e,t=!0){return typeof e=="boolean"?!0:t===!0?!A0(e):t?YM(e)<=t:!1}gn.inlineRef=Xee;const Wee=new Set(["$ref","$recursiveRef","$recursiveAnchor","$dynamicRef","$dynamicAnchor"]);function A0(e){for(const t in e){if(Wee.has(t))return!0;const n=e[t];if(Array.isArray(n)&&n.some(A0)||typeof n=="object"&&A0(n))return!0}return!1}function YM(e){let t=0;for(const n in e){if(n==="$ref")return 1/0;if(t++,!Yee.has(n)&&(typeof e[n]=="object"&&(0,Zee.eachItem)(e[n],r=>t+=YM(r)),t===1/0))return 1/0}return t}function XM(e,t="",n){n!==!1&&(t=kl(t));const r=e.parse(t);return WM(e,r)}gn.getFullPath=XM;function WM(e,t){return e.serialize(t).split("#")[0]+"#"}gn._getFullPath=WM;const Jee=/#\/?$/;function kl(e){return e?e.replace(Jee,""):""}gn.normalizeId=kl;function ete(e,t,n){return n=kl(n),e.resolve(t,n)}gn.resolveUrl=ete;const tte=/^[a-z_][-a-z0-9._]*$/i;function nte(e,t){if(typeof e=="boolean")return{};const{schemaId:n,uriResolver:r}=this.opts,a=kl(e[n]||t),i={"":a},s=XM(r,a,!1),o={},l=new Set;return Qee(e,{allKeys:!0},(f,m,h,y)=>{if(y===void 0)return;const p=s+m;let b=i[y];typeof f[n]=="string"&&(b=g.call(this,f[n])),v.call(this,f.$anchor),v.call(this,f.$dynamicAnchor),i[m]=b;function g(w){const S=this.opts.uriResolver.resolve;if(w=kl(b?S(b,w):w),l.has(w))throw d(w);l.add(w);let E=this.refs[w];return typeof E=="string"&&(E=this.refs[E]),typeof E=="object"?u(f,E.schema,w):w!==kl(p)&&(w[0]==="#"?(u(f,o[w],w),o[w]=f):this.refs[w]=p),w}function v(w){if(typeof w=="string"){if(!tte.test(w))throw new Error(`invalid anchor "${w}"`);g.call(this,`#${w}`)}}}),o;function u(f,m,h){if(m!==void 0&&!Gee(f,m))throw d(h)}function d(f){return new Error(`reference "${f}" resolves to more than one schema`)}}gn.getSchemaRefs=nte;var TE;function jp(){if(TE)return Pa;TE=1,Object.defineProperty(Pa,"__esModule",{value:!0}),Pa.getData=Pa.KeywordCxt=Pa.validateFunctionCode=void 0;const e=pee(),t=Xt,n=ni,r=Xt,a=Ree(),i=Hee(),s=Bee(),o=Ue,l=Na,u=gn,d=ge,f=Id;function m(L){if(E(L)&&(T(L),S(L))){b(L);return}h(L,()=>(0,e.topBoolOrEmptySchema)(L))}Pa.validateFunctionCode=m;function h({gen:L,validateName:V,schema:X,schemaEnv:ne,opts:K},re){K.code.es5?L.func(V,(0,o._)`${l.default.data}, ${l.default.valCxt}`,ne.$async,()=>{L.code((0,o._)`"use strict"; ${v(X,K)}`),p(L,K),L.code(re)}):L.func(V,(0,o._)`${l.default.data}, ${y(K)}`,ne.$async,()=>L.code(v(X,K)).code(re))}function y(L){return(0,o._)`{${l.default.instancePath}="", ${l.default.parentData}, ${l.default.parentDataProperty}, ${l.default.rootData}=${l.default.data}${L.dynamicRef?(0,o._)`, ${l.default.dynamicAnchors}={}`:o.nil}}={}`}function p(L,V){L.if(l.default.valCxt,()=>{L.var(l.default.instancePath,(0,o._)`${l.default.valCxt}.${l.default.instancePath}`),L.var(l.default.parentData,(0,o._)`${l.default.valCxt}.${l.default.parentData}`),L.var(l.default.parentDataProperty,(0,o._)`${l.default.valCxt}.${l.default.parentDataProperty}`),L.var(l.default.rootData,(0,o._)`${l.default.valCxt}.${l.default.rootData}`),V.dynamicRef&&L.var(l.default.dynamicAnchors,(0,o._)`${l.default.valCxt}.${l.default.dynamicAnchors}`)},()=>{L.var(l.default.instancePath,(0,o._)`""`),L.var(l.default.parentData,(0,o._)`undefined`),L.var(l.default.parentDataProperty,(0,o._)`undefined`),L.var(l.default.rootData,l.default.data),V.dynamicRef&&L.var(l.default.dynamicAnchors,(0,o._)`{}`)})}function b(L){const{schema:V,opts:X,gen:ne}=L;h(L,()=>{X.$comment&&V.$comment&&z(L),$(L),ne.let(l.default.vErrors,null),ne.let(l.default.errors,0),X.unevaluated&&g(L),P(L),D(L)})}function g(L){const{gen:V,validateName:X}=L;L.evaluated=V.const("evaluated",(0,o._)`${X}.evaluated`),V.if((0,o._)`${L.evaluated}.dynamicProps`,()=>V.assign((0,o._)`${L.evaluated}.props`,(0,o._)`undefined`)),V.if((0,o._)`${L.evaluated}.dynamicItems`,()=>V.assign((0,o._)`${L.evaluated}.items`,(0,o._)`undefined`))}function v(L,V){const X=typeof L=="object"&&L[V.schemaId];return X&&(V.code.source||V.code.process)?(0,o._)`/*# sourceURL=${X} */`:o.nil}function w(L,V){if(E(L)&&(T(L),S(L))){C(L,V);return}(0,e.boolOrEmptySchema)(L,V)}function S({schema:L,self:V}){if(typeof L=="boolean")return!L;for(const X in L)if(V.RULES.all[X])return!0;return!1}function E(L){return typeof L.schema!="boolean"}function C(L,V){const{schema:X,gen:ne,opts:K}=L;K.$comment&&X.$comment&&z(L),j(L),O(L);const re=ne.const("_errs",l.default.errors);P(L,re),ne.var(V,(0,o._)`${re} === ${l.default.errors}`)}function T(L){(0,d.checkUnknownRules)(L),R(L)}function P(L,V){if(L.opts.jtd)return B(L,[],!1,V);const X=(0,t.getSchemaTypes)(L.schema),ne=(0,t.coerceAndCheckDataType)(L,X);B(L,X,!ne,V)}function R(L){const{schema:V,errSchemaPath:X,opts:ne,self:K}=L;V.$ref&&ne.ignoreKeywordsWithRef&&(0,d.schemaHasRulesButRef)(V,K.RULES)&&K.logger.warn(`$ref: keywords ignored in schema at path "${X}"`)}function $(L){const{schema:V,opts:X}=L;V.default!==void 0&&X.useDefaults&&X.strictSchema&&(0,d.checkStrictMode)(L,"default is ignored in the schema root")}function j(L){const V=L.schema[L.opts.schemaId];V&&(L.baseId=(0,u.resolveUrl)(L.opts.uriResolver,L.baseId,V))}function O(L){if(L.schema.$async&&!L.schemaEnv.$async)throw new Error("async schema in sync schema")}function z({gen:L,schemaEnv:V,schema:X,errSchemaPath:ne,opts:K}){const re=X.$comment;if(K.$comment===!0)L.code((0,o._)`${l.default.self}.logger.log(${re})`);else if(typeof K.$comment=="function"){const ae=(0,o.str)`${ne}/$comment`,Ae=L.scopeValue("root",{ref:V.root});L.code((0,o._)`${l.default.self}.opts.$comment(${re}, ${ae}, ${Ae}.schema)`)}}function D(L){const{gen:V,schemaEnv:X,validateName:ne,ValidationError:K,opts:re}=L;X.$async?V.if((0,o._)`${l.default.errors} === 0`,()=>V.return(l.default.data),()=>V.throw((0,o._)`new ${K}(${l.default.vErrors})`)):(V.assign((0,o._)`${ne}.errors`,l.default.vErrors),re.unevaluated&&A(L),V.return((0,o._)`${l.default.errors} === 0`))}function A({gen:L,evaluated:V,props:X,items:ne}){X instanceof o.Name&&L.assign((0,o._)`${V}.props`,X),ne instanceof o.Name&&L.assign((0,o._)`${V}.items`,ne)}function B(L,V,X,ne){const{gen:K,schema:re,data:ae,allErrors:Ae,opts:ce,self:we}=L,{RULES:Ce}=we;if(re.$ref&&(ce.ignoreKeywordsWithRef||!(0,d.schemaHasRulesButRef)(re,Ce))){K.block(()=>Q(L,"$ref",Ce.all.$ref.definition));return}ce.jtd||F(L,V),K.block(()=>{for(const Ut of Ce.rules)ht(Ut);ht(Ce.post)});function ht(Ut){(0,n.shouldUseGroup)(re,Ut)&&(Ut.type?(K.if((0,r.checkDataType)(Ut.type,ae,ce.strictNumbers)),Z(L,Ut),V.length===1&&V[0]===Ut.type&&X&&(K.else(),(0,r.reportTypeError)(L)),K.endIf()):Z(L,Ut),Ae||K.if((0,o._)`${l.default.errors} === ${ne||0}`))}}function Z(L,V){const{gen:X,schema:ne,opts:{useDefaults:K}}=L;K&&(0,a.assignDefaults)(L,V.type),X.block(()=>{for(const re of V.rules)(0,n.shouldUseRule)(ne,re)&&Q(L,re.keyword,re.definition,V.type)})}function F(L,V){L.schemaEnv.meta||!L.opts.strictTypes||(J(L,V),L.opts.allowUnionTypes||N(L,V),q(L,L.dataTypes))}function J(L,V){if(V.length){if(!L.dataTypes.length){L.dataTypes=V;return}V.forEach(X=>{_(L.dataTypes,X)||M(L,`type "${X}" not allowed by context "${L.dataTypes.join(",")}"`)}),k(L,V)}}function N(L,V){V.length>1&&!(V.length===2&&V.includes("null"))&&M(L,"use allowUnionTypes to allow union type keyword")}function q(L,V){const X=L.self.RULES.all;for(const ne in X){const K=X[ne];if(typeof K=="object"&&(0,n.shouldUseRule)(L.schema,K)){const{type:re}=K.definition;re.length&&!re.some(ae=>G(V,ae))&&M(L,`missing type "${re.join(",")}" for keyword "${ne}"`)}}}function G(L,V){return L.includes(V)||V==="number"&&L.includes("integer")}function _(L,V){return L.includes(V)||V==="integer"&&L.includes("number")}function k(L,V){const X=[];for(const ne of L.dataTypes)_(V,ne)?X.push(ne):V.includes("integer")&&ne==="number"&&X.push("integer");L.dataTypes=X}function M(L,V){const X=L.schemaEnv.baseId+L.errSchemaPath;V+=` at "${X}" (strictTypes)`,(0,d.checkStrictMode)(L,V,L.opts.strictTypes)}class I{constructor(V,X,ne){if((0,i.validateKeywordUsage)(V,X,ne),this.gen=V.gen,this.allErrors=V.allErrors,this.keyword=ne,this.data=V.data,this.schema=V.schema[ne],this.$data=X.$data&&V.opts.$data&&this.schema&&this.schema.$data,this.schemaValue=(0,d.schemaRefOrVal)(V,this.schema,ne,this.$data),this.schemaType=X.schemaType,this.parentSchema=V.schema,this.params={},this.it=V,this.def=X,this.$data)this.schemaCode=V.gen.const("vSchema",de(this.$data,V));else if(this.schemaCode=this.schemaValue,!(0,i.validSchemaType)(this.schema,X.schemaType,X.allowUndefined))throw new Error(`${ne} value must be ${JSON.stringify(X.schemaType)}`);("code"in X?X.trackErrors:X.errors!==!1)&&(this.errsCount=V.gen.const("_errs",l.default.errors))}result(V,X,ne){this.failResult((0,o.not)(V),X,ne)}failResult(V,X,ne){this.gen.if(V),ne?ne():this.error(),X?(this.gen.else(),X(),this.allErrors&&this.gen.endIf()):this.allErrors?this.gen.endIf():this.gen.else()}pass(V,X){this.failResult((0,o.not)(V),void 0,X)}fail(V){if(V===void 0){this.error(),this.allErrors||this.gen.if(!1);return}this.gen.if(V),this.error(),this.allErrors?this.gen.endIf():this.gen.else()}fail$data(V){if(!this.$data)return this.fail(V);const{schemaCode:X}=this;this.fail((0,o._)`${X} !== undefined && (${(0,o.or)(this.invalid$data(),V)})`)}error(V,X,ne){if(X){this.setParams(X),this._error(V,ne),this.setParams({});return}this._error(V,ne)}_error(V,X){(V?f.reportExtraError:f.reportError)(this,this.def.error,X)}$dataError(){(0,f.reportError)(this,this.def.$dataError||f.keyword$DataError)}reset(){if(this.errsCount===void 0)throw new Error('add "trackErrors" to keyword definition');(0,f.resetErrorsCount)(this.gen,this.errsCount)}ok(V){this.allErrors||this.gen.if(V)}setParams(V,X){X?Object.assign(this.params,V):this.params=V}block$data(V,X,ne=o.nil){this.gen.block(()=>{this.check$data(V,ne),X()})}check$data(V=o.nil,X=o.nil){if(!this.$data)return;const{gen:ne,schemaCode:K,schemaType:re,def:ae}=this;ne.if((0,o.or)((0,o._)`${K} === undefined`,X)),V!==o.nil&&ne.assign(V,!0),(re.length||ae.validateSchema)&&(ne.elseIf(this.invalid$data()),this.$dataError(),V!==o.nil&&ne.assign(V,!1)),ne.else()}invalid$data(){const{gen:V,schemaCode:X,schemaType:ne,def:K,it:re}=this;return(0,o.or)(ae(),Ae());function ae(){if(ne.length){if(!(X instanceof o.Name))throw new Error("ajv implementation error");const ce=Array.isArray(ne)?ne:[ne];return(0,o._)`${(0,r.checkDataTypes)(ce,X,re.opts.strictNumbers,r.DataType.Wrong)}`}return o.nil}function Ae(){if(K.validateSchema){const ce=V.scopeValue("validate$data",{ref:K.validateSchema});return(0,o._)`!${ce}(${X})`}return o.nil}}subschema(V,X){const ne=(0,s.getSubschema)(this.it,V);(0,s.extendSubschemaData)(ne,this.it,V),(0,s.extendSubschemaMode)(ne,V);const K={...this.it,...ne,items:void 0,props:void 0};return w(K,X),K}mergeEvaluated(V,X){const{it:ne,gen:K}=this;ne.opts.unevaluated&&(ne.props!==!0&&V.props!==void 0&&(ne.props=d.mergeEvaluated.props(K,V.props,ne.props,X)),ne.items!==!0&&V.items!==void 0&&(ne.items=d.mergeEvaluated.items(K,V.items,ne.items,X)))}mergeValidEvaluated(V,X){const{it:ne,gen:K}=this;if(ne.opts.unevaluated&&(ne.props!==!0||ne.items!==!0))return K.if(X,()=>this.mergeEvaluated(V,o.Name)),!0}}Pa.KeywordCxt=I;function Q(L,V,X,ne){const K=new I(L,X,V);"code"in X?X.code(K,ne):K.$data&&X.validate?(0,i.funcKeywordCode)(K,X):"macro"in X?(0,i.macroKeywordCode)(K,X):(X.compile||X.validate)&&(0,i.funcKeywordCode)(K,X)}const W=/^\/(?:[^~]|~0|~1)*$/,oe=/^([0-9]+)(#|\/(?:[^~]|~0|~1)*)?$/;function de(L,{dataLevel:V,dataNames:X,dataPathArr:ne}){let K,re;if(L==="")return l.default.rootData;if(L[0]==="/"){if(!W.test(L))throw new Error(`Invalid JSON-pointer: ${L}`);K=L,re=l.default.rootData}else{const we=oe.exec(L);if(!we)throw new Error(`Invalid JSON-pointer: ${L}`);const Ce=+we[1];if(K=we[2],K==="#"){if(Ce>=V)throw new Error(ce("property/index",Ce));return ne[V-Ce]}if(Ce>V)throw new Error(ce("data",Ce));if(re=X[V-Ce],!K)return re}let ae=re;const Ae=K.split("/");for(const we of Ae)we&&(re=(0,o._)`${re}${(0,o.getProperty)((0,d.unescapeJsonPointer)(we))}`,ae=(0,o._)`${ae} && ${re}`);return ae;function ce(we,Ce){return`Cannot access ${we} ${Ce} levels up, current level is ${V}`}}return Pa.getData=de,Pa}var Ld={};Object.defineProperty(Ld,"__esModule",{value:!0});class rte extends Error{constructor(t){super("validation failed"),this.errors=t,this.ajv=this.validation=!0}}Ld.default=rte;var kc={};Object.defineProperty(kc,"__esModule",{value:!0});const oy=gn;class ate extends Error{constructor(t,n,r,a){super(a||`can't resolve reference ${r} from id ${n}`),this.missingRef=(0,oy.resolveUrl)(t,n,r),this.missingSchema=(0,oy.normalizeId)((0,oy.getFullPath)(t,this.missingRef))}}kc.default=ate;var Wn={};Object.defineProperty(Wn,"__esModule",{value:!0});Wn.resolveSchema=Wn.getCompilingSchema=Wn.resolveRef=Wn.compileSchema=Wn.SchemaEnv=void 0;const Br=Ue,ite=Ld,As=Na,Wr=gn,AE=ge,ste=jp();class Tp{constructor(t){var n;this.refs={},this.dynamicAnchors={};let r;typeof t.schema=="object"&&(r=t.schema),this.schema=t.schema,this.schemaId=t.schemaId,this.root=t.root||this,this.baseId=(n=t.baseId)!==null&&n!==void 0?n:(0,Wr.normalizeId)(r==null?void 0:r[t.schemaId||"$id"]),this.schemaPath=t.schemaPath,this.localRefs=t.localRefs,this.meta=t.meta,this.$async=r==null?void 0:r.$async,this.refs={}}}Wn.SchemaEnv=Tp;function Nw(e){const t=JM.call(this,e);if(t)return t;const n=(0,Wr.getFullPath)(this.opts.uriResolver,e.root.baseId),{es5:r,lines:a}=this.opts.code,{ownProperties:i}=this.opts,s=new Br.CodeGen(this.scope,{es5:r,lines:a,ownProperties:i});let o;e.$async&&(o=s.scopeValue("Error",{ref:ite.default,code:(0,Br._)`require("ajv/dist/runtime/validation_error").default`}));const l=s.scopeName("validate");e.validateName=l;const u={gen:s,allErrors:this.opts.allErrors,data:As.default.data,parentData:As.default.parentData,parentDataProperty:As.default.parentDataProperty,dataNames:[As.default.data],dataPathArr:[Br.nil],dataLevel:0,dataTypes:[],definedProperties:new Set,topSchemaRef:s.scopeValue("schema",this.opts.code.source===!0?{ref:e.schema,code:(0,Br.stringify)(e.schema)}:{ref:e.schema}),validateName:l,ValidationError:o,schema:e.schema,schemaEnv:e,rootId:n,baseId:e.baseId||n,schemaPath:Br.nil,errSchemaPath:e.schemaPath||(this.opts.jtd?"":"#"),errorPath:(0,Br._)`""`,opts:this.opts,self:this};let d;try{this._compilations.add(e),(0,ste.validateFunctionCode)(u),s.optimize(this.opts.code.optimize);const f=s.toString();d=`${s.scopeRefs(As.default.scope)}return ${f}`,this.opts.code.process&&(d=this.opts.code.process(d,e));const h=new Function(`${As.default.self}`,`${As.default.scope}`,d)(this,this.scope.get());if(this.scope.value(l,{ref:h}),h.errors=null,h.schema=e.schema,h.schemaEnv=e,e.$async&&(h.$async=!0),this.opts.code.source===!0&&(h.source={validateName:l,validateCode:f,scopeValues:s._values}),this.opts.unevaluated){const{props:y,items:p}=u;h.evaluated={props:y instanceof Br.Name?void 0:y,items:p instanceof Br.Name?void 0:p,dynamicProps:y instanceof Br.Name,dynamicItems:p instanceof Br.Name},h.source&&(h.source.evaluated=(0,Br.stringify)(h.evaluated))}return e.validate=h,e}catch(f){throw delete e.validate,delete e.validateName,d&&this.logger.error("Error compiling schema, function code:",d),f}finally{this._compilations.delete(e)}}Wn.compileSchema=Nw;function ote(e,t,n){var r;n=(0,Wr.resolveUrl)(this.opts.uriResolver,t,n);const a=e.refs[n];if(a)return a;let i=ute.call(this,e,n);if(i===void 0){const s=(r=e.localRefs)===null||r===void 0?void 0:r[n],{schemaId:o}=this.opts;s&&(i=new Tp({schema:s,schemaId:o,root:e,baseId:t}))}if(i!==void 0)return e.refs[n]=lte.call(this,i)}Wn.resolveRef=ote;function lte(e){return(0,Wr.inlineRef)(e.schema,this.opts.inlineRefs)?e.schema:e.validate?e:Nw.call(this,e)}function JM(e){for(const t of this._compilations)if(cte(t,e))return t}Wn.getCompilingSchema=JM;function cte(e,t){return e.schema===t.schema&&e.root===t.root&&e.baseId===t.baseId}function ute(e,t){let n;for(;typeof(n=this.refs[t])=="string";)t=n;return n||this.schemas[t]||Ap.call(this,e,t)}function Ap(e,t){const n=this.opts.uriResolver.parse(t),r=(0,Wr._getFullPath)(this.opts.uriResolver,n);let a=(0,Wr.getFullPath)(this.opts.uriResolver,e.baseId,void 0);if(Object.keys(e.schema).length>0&&r===a)return ly.call(this,n,e);const i=(0,Wr.normalizeId)(r),s=this.refs[i]||this.schemas[i];if(typeof s=="string"){const o=Ap.call(this,e,s);return typeof(o==null?void 0:o.schema)!="object"?void 0:ly.call(this,n,o)}if(typeof(s==null?void 0:s.schema)=="object"){if(s.validate||Nw.call(this,s),i===(0,Wr.normalizeId)(t)){const{schema:o}=s,{schemaId:l}=this.opts,u=o[l];return u&&(a=(0,Wr.resolveUrl)(this.opts.uriResolver,a,u)),new Tp({schema:o,schemaId:l,root:e,baseId:a})}return ly.call(this,n,s)}}Wn.resolveSchema=Ap;const dte=new Set(["properties","patternProperties","enum","dependencies","definitions"]);function ly(e,{baseId:t,schema:n,root:r}){var a;if(((a=e.fragment)===null||a===void 0?void 0:a[0])!=="/")return;for(const o of e.fragment.slice(1).split("/")){if(typeof n=="boolean")return;const l=n[(0,AE.unescapeFragment)(o)];if(l===void 0)return;n=l;const u=typeof n=="object"&&n[this.opts.schemaId];!dte.has(o)&&u&&(t=(0,Wr.resolveUrl)(this.opts.uriResolver,t,u))}let i;if(typeof n!="boolean"&&n.$ref&&!(0,AE.schemaHasRulesButRef)(n,this.RULES)){const o=(0,Wr.resolveUrl)(this.opts.uriResolver,t,n.$ref);i=Ap.call(this,r,o)}const{schemaId:s}=this.opts;if(i=i||new Tp({schema:n,schemaId:s,root:r,baseId:t}),i.schema!==i.root.schema)return i}const fte="https://raw.githubusercontent.com/ajv-validator/ajv/master/lib/refs/data.json#",hte="Meta-schema for $data reference (JSON AnySchema extension proposal)",mte="object",pte=["$data"],gte={$data:{type:"string",anyOf:[{format:"relative-json-pointer"},{format:"json-pointer"}]}},yte=!1,vte={$id:fte,description:hte,type:mte,required:pte,properties:gte,additionalProperties:yte};var jw={},Rp={exports:{}};const bte=RegExp.prototype.test.bind(/^[\da-f]{8}-[\da-f]{4}-[\da-f]{4}-[\da-f]{4}-[\da-f]{12}$/iu),Tw=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),Ec=RegExp.prototype.test.bind(/^[\da-f]{2}$/iu),Aw=RegExp.prototype.test.bind(/^[\da-z\-._~]$/iu),eP=RegExp.prototype.test.bind(/^[A-Za-z0-9\-._~!$&'()*+,;=:@/]$/u),Rw=RegExp.prototype.test.bind(/^[A-Za-z0-9\-._~!$&'()*+,;=:@/?]$/u),xte=RegExp.prototype.test.bind(/^[A-Za-z0-9\-._~!$&'()*+,;=:]$/u),Yn=new Array(256);{const e="0123456789ABCDEF";for(let t=0;t<256;t++)Yn[t]="%"+e[t>>4]+e[t&15]}function jn(e){return e<2048?Yn[192|e>>6]+Yn[128|e&63]:e<65536?Yn[224|e>>12]+Yn[128|e>>6&63]+Yn[128|e&63]:Yn[240|e>>18]+Yn[128|e>>12&63]+Yn[128|e>>6&63]+Yn[128|e&63]}const wte=RegExp.prototype.test.bind(/^[\dA-Fa-f]{1,4}$/),Ste=RegExp.prototype.test.bind(/^[vV][\dA-Fa-f]+\.[A-Za-z\d\-._~!$&'()*+,;=:]+$/),_te=RegExp.prototype.test.bind(/^[A-Za-z\d\-._~]$/),kte=RegExp.prototype.test.bind(/[^!"$&'()*+,\-.;=_`a-z{}~]/u);function Ete(e){if(e.length===0)return!1;for(let t=0;t<e.length;t++)if(!_te(e[t])){if(e[t]==="%"&&t+2<e.length&&Ec(e.slice(t+1,t+3))){t+=2;continue}return!1}return!0}function RE(e){let t=-1,n=0,r=-1,a=0;for(let o=0;o<e.length;o++)e[o]==="0"?(r===-1&&(r=o),a++,a>n&&(n=a,t=r)):(r=-1,a=0);if(n<2)return e.join(":");const i=e.slice(0,t).join(":"),s=e.slice(t+n).join(":");return i+"::"+s}function Cte(e){const t=e.indexOf("::");if(t!==-1&&e.indexOf("::",t+1)!==-1)return;const n=t===-1?e.split(":"):e.slice(0,t).split(":"),r=t===-1?[]:e.slice(t+2).split(":");t!==-1&&(n.length===1&&n[0]===""&&(n.length=0),r.length===1&&r[0]===""&&(r.length=0));const a=n.concat(r);let i=0;for(let o=0;o<a.length;o++){const l=a[o];if(l==="")return;if(l.indexOf(".")!==-1){if(o!==a.length-1||t!==-1&&r.length===0||!Tw(l))return;i+=2;continue}if(!wte(l))return;a[o]=parseInt(l,16).toString(16),i++}if(t===-1)return i!==8?void 0:RE(a);if(i>=8)return;const s=a.slice(0,n.length);for(let o=i;o<8;o++)s.push("0");for(let o=n.length;o<a.length;o++)s.push(a[o]);return RE(s)}function R0(e){const t=e[0]==="["&&e[e.length-1]==="]";if((e[0]==="["||e[e.length-1]==="]")&&!t)return{host:e,isIPV6:!1,error:!0};let r=t?e.slice(1,-1):e;if(t&&Ste(r))return r=r.toLowerCase(),{host:`[${r}]`,escapedHost:r,isIPV6:!1,isIPVFuture:!0};if(Nte(r,":")<2)return{host:e,isIPV6:!1,error:t};let a="";const i=r.indexOf("%");if(i!==-1){const o=r.slice(i,i+3).toLowerCase()==="%25"?3:1;if(a=r.slice(i+o),!Ete(a))return{host:e,isIPV6:!1,error:!0};r=r.slice(0,i)}const s=Cte(r);return s===void 0?{host:e,isIPV6:!1,error:!0}:{host:s+(a?"%"+a:""),escapedHost:s+(a?"%25"+a:""),isIPV6:!0}}function Nte(e,t){let n=0;for(let r=0;r<e.length;r++)e[r]===t&&n++;return n}function jte(e){let t=e;const n=[];let r=-1,a=0;for(;a=t.length;){if(a===1){if(t===".")break;if(t==="/"){n.push("/");break}else{n.push(t);break}}else if(a===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(a===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}else 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}else n.push(t.slice(0,r)),t=t.slice(r)}return n.join("")}const Tte={"@":"%40","/":"%2F","?":"%3F","#":"%23",":":"%3A"},Ate=/[@/?#:]/g,Rte=/[@/?#]/g;function tP(e,t){const n=t?Rte:Ate;return n.lastIndex=0,e.replace(n,r=>Tte[r])}function nP(e,t=!1){if(e.indexOf("%")===-1)return e;let n="";for(let r=0;r<e.length;r++){if(e[r]==="%"&&r+2<e.length){const a=e.slice(r+1,r+3);if(Ec(a)){const i=a.toUpperCase(),s=String.fromCharCode(parseInt(i,16));t&&Aw(s)?n+=s:n+="%"+i,r+=2;continue}}n+=e[r]}return n}function $te(e){let t="";for(let n=0;n<e.length;n++){const r=e[n];if(r==="%"&&n+2<e.length){const a=e.slice(n+1,n+3);if(Ec(a)){const i=a.toUpperCase(),s=String.fromCharCode(parseInt(i,16));s!=="."&&Aw(s)?t+=s:t+="%"+i,n+=2;continue}}if(eP(r))t+=r;else{const a=e.charCodeAt(n);if(a<128)t+=rP(a)?r:Yn[a];else if(a<55296||a>57343)t+=jn(a);else if(a<=56319&&n+1<e.length){const i=e.charCodeAt(n+1);i>=56320&&i<=57343?(t+=jn(65536+(a-55296<<10)+(i-56320)),n++):t+=jn(65533)}else t+=jn(65533)}}return t}function Ote(e,t=!1){let n="",r=t&&e[0]!=="/";for(let a=0;a<e.length;a++){const i=e[a];if(i==="%"&&a+2<e.length){const s=e.slice(a+1,a+3);if(Ec(s)){n+="%"+s.toUpperCase(),a+=2;continue}}if(i==="/"&&(r=!1),eP(i)&&(i!==":"||!r))n+=i;else{const s=e.charCodeAt(a);if(s<128)n+=Yn[s];else if(s<55296||s>57343)n+=jn(s);else if(s<=56319&&a+1<e.length){const o=e.charCodeAt(a+1);o>=56320&&o<=57343?(n+=jn(65536+(s-55296<<10)+(o-56320)),a++):n+=jn(65533)}else n+=jn(65533)}}return n}function $w(e,t){let n="";for(let r=0;r<e.length;r++){const a=e[r];if(a==="%"&&r+2<e.length){const i=e.slice(r+1,r+3);if(Ec(i)){n+="%"+i.toUpperCase(),r+=2;continue}}if(t(a))n+=a;else{const i=e.charCodeAt(r);if(i<128)n+=Yn[i];else if(i<55296||i>57343)n+=jn(i);else if(i<=56319&&r+1<e.length){const s=e.charCodeAt(r+1);s>=56320&&s<=57343?(n+=jn(65536+(i-55296<<10)+(s-56320)),r++):n+=jn(65533)}else n+=jn(65533)}}return n}function Mte(e){return $w(e,xte)}function Pte(e){return $w(e,Rw)}function Dte(e){return $w(e,Rw)}function rP(e){return e>=48&&e<=57||e>=65&&e<=90||e>=97&&e<=122||e===42||e===43||e===45||e===46||e===47||e===64||e===95}function zte(e){let t="";for(let n=0;n<e.length;n++){const r=e[n];if(r==="%"&&n+2<e.length){const a=e.slice(n+1,n+3);if(Ec(a)){const i=a.toUpperCase(),s=String.fromCharCode(parseInt(i,16));Aw(s)?t+=s:t+="%"+i,n+=2;continue}}if(Rw(r))t+=r;else{const a=e.charCodeAt(n);if(a<128)t+=rP(a)?r:Yn[a];else if(a<55296||a>57343)t+=jn(a);else if(a<=56319&&n+1<e.length){const i=e.charCodeAt(n+1);i>=56320&&i<=57343?(t+=jn(65536+(a-55296<<10)+(i-56320)),n++):t+=jn(65533)}else t+=jn(65533)}}return t}function Ite(e){const t=[];if(e.userinfo!==void 0&&(t.push(Mte(e.userinfo)),t.push("@")),e.host!==void 0){let n=e.host;if(!Tw(n)){let r=R0(n);r.isIPV6!==!0&&r.isIPVFuture!==!0&&(n=nP(n,!0),r=R0(n)),r.isIPV6===!0||r.isIPVFuture===!0?n=`[${r.escapedHost}]`:n=tP(n,!1)}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}var aP={nonSimpleDomain:kte,recomposeAuthority:Ite,reescapeHostDelimiters:tP,normalizePercentEncoding:nP,normalizePathEncoding:$te,serializePathEncoding:Ote,normalizeQueryFragmentEncoding:zte,encodeQuery:Pte,encodeFragment:Dte,removeDotSegments:jte,isIPv4:Tw,isUUID:bte,normalizeIPv6:R0};const{isUUID:Lte}=aP,Ute=/^([\da-z][\d\-a-z]{0,31}):((?:[\w!$'()*+,\-./:;=@]|%[\da-f]{2})+)$/iu;function iP(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 sP(e){return e.host||(e.error=e.error||"HTTP URIs must have a host."),e}function oP(e){const t=String(e.scheme).toLowerCase()==="https";return(e.port===(t?443:80)||e.port==="")&&(e.port=void 0),e.path||(e.path="/"),e}function Fte(e){return e.secure=iP(e),e.resourceName=(e.path||"/")+(e.query?"?"+e.query:""),e.path=void 0,e.query=void 0,e}function qte(e){if((e.port===(iP(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){const t=e.resourceName.indexOf("?"),n=t===-1?e.resourceName:e.resourceName.slice(0,t);e.path=n&&n!=="/"?n:void 0,e.query=t===-1?void 0:e.resourceName.slice(t+1),e.resourceName=void 0}return e.fragment=void 0,e}function Hte(e,t){if(!e.path)return e.error="URN can not be parsed",e;const n=e.path.match(Ute);if(n&&n[0]===e.path){const r=t.scheme||e.scheme||"urn";e.nid=n[1].toLowerCase(),e.nss=n[2];const a=`${r}:${t.nid||e.nid}`,i=Ow(a);e.path=void 0,i&&(e=i.parse(e,t))}else e.error=e.error||"URN can not be parsed.";return e}function Bte(e,t){if(e.nid===void 0)throw new Error("URN without nid cannot be serialized");const n=t.scheme||e.scheme||"urn",r=e.nid.toLowerCase(),a=`${n}:${t.nid||r}`,i=Ow(a);i&&(e=i.serialize(e,t));const s=e,o=e.nss;return s.path=`${r||t.nid}:${o}`,t.skipEscape=!0,s}function Vte(e,t){const n=e;return n.uuid=n.nss,n.nss=void 0,!t.tolerant&&(!n.uuid||!Lte(n.uuid))&&(n.error=n.error||"UUID is not valid."),n}function Kte(e){const t=e;return t.nss=(e.uuid||"").toLowerCase(),t}const lP={scheme:"http",domainHost:!0,parse:sP,serialize:oP},Zte={scheme:"https",domainHost:lP.domainHost,parse:sP,serialize:oP},lh={scheme:"ws",domainHost:!0,parse:Fte,serialize:qte},Gte={scheme:"wss",domainHost:lh.domainHost,parse:lh.parse,serialize:lh.serialize},Qte={scheme:"urn",parse:Hte,serialize:Bte,skipNormalize:!0},Yte={scheme:"urn:uuid",parse:Vte,serialize:Kte,skipNormalize:!0},Sm={http:lP,https:Zte,ws:lh,wss:Gte,urn:Qte,"urn:uuid":Yte};Object.setPrototypeOf(Sm,null);function Ow(e){return e&&(Sm[e]||Sm[e.toLowerCase()])||void 0}var Xte={SCHEMES:Sm,getSchemeHandler:Ow};const{normalizeIPv6:cP,removeDotSegments:tu,recomposeAuthority:Wte,normalizePercentEncoding:uP,normalizePathEncoding:Jte,serializePathEncoding:$E,normalizeQueryFragmentEncoding:OE,encodeQuery:ene,encodeFragment:tne,reescapeHostDelimiters:nne,isIPv4:dP,nonSimpleDomain:rne}=aP,{SCHEMES:fP,getSchemeHandler:Mw}=Xte,hP=/^[A-Za-z][A-Za-z0-9+.-]*$/u,mP="URI scheme is malformed.";function ME(e){const t=unescape(String(e));if(!hP.test(t))throw new TypeError(mP);return t}function ane(e,t){return typeof e=="string"?e=fne(e,t):typeof e=="object"&&(e=km(xo(e,t),t)),e}function ine(e,t,n){const r=n?Object.assign({scheme:"null"},n):{scheme:"null"},{parsed:a,malformedAuthorityOrPort:i,malformedPercentEncoding:s,malformedSchemeSpecific:o,malformedHost:l,malformedScheme:u}=_m(e,r),{parsed:d,malformedAuthorityOrPort:f,malformedPercentEncoding:m,malformedSchemeSpecific:h,malformedHost:y,malformedScheme:p}=_m(t,r);if(i||f||s||m||o||h||l||y||u||p)throw new Error(a.error||d.error||"URI is malformed.");const b=pP(a,d,r,!0),g=Mw(n&&n.scheme||b.scheme),v=b.host,w=v!==void 0&&v!==""&&(dP(v)||cP(v).isIPV6);gP(b,n||{},g,w);const S=v&&v.indexOf("%")!==-1&&!new RegExp("\\P{ASCII}","u").test(v);if(b.error&&!S)throw new Error(b.error);return r.skipEscape=!0,xo(b,r)}function pP(e,t,n,r){const a={};return r||(e=km(xo(e,n),n),t=km(xo(t,n),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=tu(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=tu(t.path||""),a.query=t.query):(t.path?(t.path[0]==="/"?a.path=tu(t.path):((e.userinfo!==void 0||e.host!==void 0||e.port!==void 0)&&!e.path?a.path="/"+t.path:e.path?a.path=e.path.slice(0,e.path.lastIndexOf("/")+1)+t.path:a.path=t.path,a.path=tu(a.path)),a.query=t.query):(a.path=e.path,t.query!==void 0?a.query=t.query:a.query=e.query),a.userinfo=e.userinfo,a.host=e.host,a.port=e.port),a.scheme=e.scheme),a.fragment=t.fragment,a}function sne(e,t,n){const r=PE(e,n),a=PE(t,n);return r!==void 0&&a!==void 0&&r===a}function xo(e,t){const 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:""},r=Object.assign({},t),a=[];n.scheme&&(n.scheme=ME(n.scheme));const i=Mw(r.scheme||n.scheme);i&&i.serialize&&i.serialize(n,r);const s=n.userinfo!==void 0||n.host!==void 0||n.port!==void 0,o=!r.skipEscape&&n.scheme===void 0&&!s;n.path!==void 0&&(r.skipEscape?n.path=uP(n.path):n.path=$E(n.path,o)),r.reference!=="suffix"&&n.scheme&&(n.scheme=ME(n.scheme),a.push(n.scheme,":"));const l=Wte(n);if(l!==void 0&&(r.reference!=="suffix"&&a.push("//"),a.push(l),n.path&&n.path[0]!=="/"&&a.push("/")),n.path!==void 0){let u=n.path;!r.absolutePath&&(!i||!i.absolutePath)&&(u=tu(u)),o&&(u=$E(u,!0)),l===void 0&&u[0]==="/"&&u[1]==="/"&&(u="/%2F"+u.slice(2)),a.push(u)}return n.query!==void 0&&a.push("?",ene(n.query)),n.fragment!==void 0&&a.push("#",tne(n.fragment)),a.join("")}const one=/^(?:([^#/:?]+):)?(?:\/\/((?:([^#/?@]*)@)?(\[[^#/?\]]+\]|[^#/:?]*)(?::(\d*))?))?([^#?]*)(?:\?([^#]*))?(?:#((?:.|[\n\r])*))?/u,lne=/^(?:[^#/:?]+:)?\/\/([^/?#]*)/,cne=/^(?:[^#/:?]+:)?([/\\\t\n\r]*)/;function une(e,t){if(t[2]!==void 0&&e.path&&e.path[0]!=="/")return'URI path must start with "/" when authority is present.';if(typeof e.port=="number"&&(e.port<0||e.port>65535))return"URI port is malformed."}function qc(e){if(e===void 0)return!1;let t=e.indexOf("%");for(;t!==-1;){if(t+2>=e.length||!/^[\da-f]{2}$/iu.test(e.slice(t+1,t+3)))return!0;t=e.indexOf("%",t+3)}return!1}function dne(e){const t=e[4];return qc(e[3])||t!==void 0&&!(t[0]==="["&&t[t.length-1]==="]")&&qc(t)||qc(e[6])||qc(e[7])||qc(e[8])}function gP(e,t,n,r){if(!t.unicodeSupport&&(!n||!n.unicodeSupport)&&e.host&&e.host[0]!=="["&&(t.domainHost||n&&n.domainHost)&&r===!1&&rne(e.host))try{e.host=new URL("http://"+e.host).hostname}catch(a){return e.error=e.error||"Host's domain name can not be converted to ASCII: "+a,!0}return!1}function _m(e,t){const n=Object.assign({},t),r={scheme:void 0,userinfo:void 0,host:"",port:void 0,path:"",query:void 0,fragment:void 0};let a=!1,i=!1,s=!1,o=!1,l=!1,u=!1,d=!1;n.reference==="suffix"&&(n.scheme?e=n.scheme+":"+e:e="//"+e);const f=e.match(lne);f!==null&&f[1].indexOf("\\")!==-1&&(r.error="URI authority must not contain a literal backslash.",a=!0);const m=e.match(cne);if(m!==null){const y=m[1],p=y.replace(/[\t\n\r]/g,"");p.length>=2&&(p.slice(0,2)!=="//"?(r.error=r.error||"URI authority must not contain a literal backslash.",a=!0):y.length!==p.length&&(r.error=r.error||"URI authority introducer must not contain whitespace.",a=!0))}const h=e.match(one);if(h){if(r.scheme=h[1],r.userinfo=h[3],r.host=h[4],r.port=parseInt(h[5],10),r.path=h[6]||"",r.query=h[7],r.fragment=h[8],r.scheme!==void 0){const b=unescape(r.scheme);hP.test(b)?r.scheme=b.toLowerCase():(r.error=r.error||mP,u=!0)}i=dne(h),i&&(r.error=r.error||"URI contains malformed percent-encoding."),isNaN(r.port)&&(r.port=h[5]);const y=une(r,h);if(y!==void 0&&(r.error=r.error||y,a=!0),r.host)if(dP(r.host)===!1){const g=r.host[0]==="["&&r.host[r.host.length-1]==="]",v=cP(r.host);d=v.isIPV6||v.isIPVFuture===!0,l=g&&v.error===!0,r.host=d?v.host:v.host.toLowerCase(),l&&(r.error=r.error||"URI host is malformed.",a=!0)}else d=!0;r.scheme===void 0&&r.userinfo===void 0&&r.host===void 0&&r.port===void 0&&r.query===void 0&&!r.path?r.reference="same-document":r.scheme===void 0?r.reference="relative":r.fragment===void 0?r.reference="absolute":r.reference="uri",n.reference&&n.reference!=="suffix"&&n.reference!==r.reference&&(r.error=r.error||"URI is not a "+n.reference+" reference.");const p=Mw(n.scheme||r.scheme);if(o=gP(r,n,p,d),!p||p&&!p.skipNormalize){if(e.indexOf("%")!==-1&&r.host!==void 0&&!l){const b=d?r.host:uP(r.host,!0);r.host=nne(b,d)}r.path&&(r.path=Jte(r.path)),r.query&&(r.query=OE(r.query)),r.fragment&&(r.fragment=OE(r.fragment))}p&&p.parse&&(p.parse(r,n),p===fP.urn&&r.nid===void 0&&(s=!0))}else r.error=r.error||"URI can not be parsed.";return{parsed:r,malformedAuthorityOrPort:a,malformedPercentEncoding:i,malformedSchemeSpecific:s,malformedHost:o,malformedScheme:u}}function km(e,t){return _m(e,t).parsed}function fne(e,t){return yP(e,t).normalized}function yP(e,t){const{parsed:n,malformedAuthorityOrPort:r,malformedPercentEncoding:a,malformedSchemeSpecific:i,malformedHost:s,malformedScheme:o}=_m(e,t);return{normalized:r||a||i||s||o?e:xo(n,t),malformedAuthorityOrPort:r,malformedPercentEncoding:a,malformedSchemeSpecific:i,malformedHost:s,malformedScheme:o}}function PE(e,t){if(typeof e!="string"&&typeof e!="object")return;let n;try{n=typeof e=="string"?e:xo(e,t)}catch{return}const{normalized:r,malformedAuthorityOrPort:a,malformedPercentEncoding:i,malformedSchemeSpecific:s,malformedHost:o,malformedScheme:l}=yP(n,t);return a||i||s||o||l?void 0:r}const Pw={SCHEMES:fP,normalize:ane,resolve:ine,resolveComponent:pP,equal:sne,serialize:xo,parse:km};Rp.exports=Pw;Rp.exports.default=Pw;Rp.exports.fastUri=Pw;var hne=Rp.exports;Object.defineProperty(jw,"__esModule",{value:!0});const vP=hne;vP.code='require("ajv/dist/runtime/uri").default';jw.default=vP;(function(e){Object.defineProperty(e,"__esModule",{value:!0}),e.CodeGen=e.Name=e.nil=e.stringify=e.str=e._=e.KeywordCxt=void 0;var t=jp();Object.defineProperty(e,"KeywordCxt",{enumerable:!0,get:function(){return t.KeywordCxt}});var n=Ue;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}});const r=Ld,a=kc,i=bo,s=Wn,o=Ue,l=gn,u=Xt,d=ge,f=vte,m=jw,h=(N,q)=>new RegExp(N,q);h.code="new RegExp";const y=["removeAdditional","useDefaults","coerceTypes"],p=new Set(["validate","serialize","parse","wrapper","root","schema","keyword","pattern","formats","validate$data","func","obj","Error"]),b={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."},g={ignoreKeywordsWithRef:"",jsPropertySyntax:"",unicode:'"minLength"/"maxLength" account for unicode characters by default.'},v=200;function w(N){var q,G,_,k,M,I,Q,W,oe,de,L,V,X,ne,K,re,ae,Ae,ce,we,Ce,ht,Ut,gt,ar;const Y=N.strict,se=(q=N.code)===null||q===void 0?void 0:q.optimize,Se=se===!0||se===void 0?1:se||0,je=(_=(G=N.code)===null||G===void 0?void 0:G.regExp)!==null&&_!==void 0?_:h,Xe=(k=N.uriResolver)!==null&&k!==void 0?k:m.default;return{strictSchema:(I=(M=N.strictSchema)!==null&&M!==void 0?M:Y)!==null&&I!==void 0?I:!0,strictNumbers:(W=(Q=N.strictNumbers)!==null&&Q!==void 0?Q:Y)!==null&&W!==void 0?W:!0,strictTypes:(de=(oe=N.strictTypes)!==null&&oe!==void 0?oe:Y)!==null&&de!==void 0?de:"log",strictTuples:(V=(L=N.strictTuples)!==null&&L!==void 0?L:Y)!==null&&V!==void 0?V:"log",strictRequired:(ne=(X=N.strictRequired)!==null&&X!==void 0?X:Y)!==null&&ne!==void 0?ne:!1,code:N.code?{...N.code,optimize:Se,regExp:je}:{optimize:Se,regExp:je},loopRequired:(K=N.loopRequired)!==null&&K!==void 0?K:v,loopEnum:(re=N.loopEnum)!==null&&re!==void 0?re:v,meta:(ae=N.meta)!==null&&ae!==void 0?ae:!0,messages:(Ae=N.messages)!==null&&Ae!==void 0?Ae:!0,inlineRefs:(ce=N.inlineRefs)!==null&&ce!==void 0?ce:!0,schemaId:(we=N.schemaId)!==null&&we!==void 0?we:"$id",addUsedSchema:(Ce=N.addUsedSchema)!==null&&Ce!==void 0?Ce:!0,validateSchema:(ht=N.validateSchema)!==null&&ht!==void 0?ht:!0,validateFormats:(Ut=N.validateFormats)!==null&&Ut!==void 0?Ut:!0,unicodeRegExp:(gt=N.unicodeRegExp)!==null&&gt!==void 0?gt:!0,int32range:(ar=N.int32range)!==null&&ar!==void 0?ar:!0,uriResolver:Xe}}class S{constructor(q={}){this.schemas={},this.refs={},this.formats=Object.create(null),this._compilations=new Set,this._loading={},this._cache=new Map,q=this.opts={...q,...w(q)};const{es5:G,lines:_}=this.opts.code;this.scope=new o.ValueScope({scope:{},prefixes:p,es5:G,lines:_}),this.logger=O(q.logger);const k=q.validateFormats;q.validateFormats=!1,this.RULES=(0,i.getRules)(),E.call(this,b,q,"NOT SUPPORTED"),E.call(this,g,q,"DEPRECATED","warn"),this._metaOpts=$.call(this),q.formats&&P.call(this),this._addVocabularies(),this._addDefaultMetaSchema(),q.keywords&&R.call(this,q.keywords),typeof q.meta=="object"&&this.addMetaSchema(q.meta),T.call(this),q.validateFormats=k}_addVocabularies(){this.addKeyword("$async")}_addDefaultMetaSchema(){const{$data:q,meta:G,schemaId:_}=this.opts;let k=f;_==="id"&&(k={...f},k.id=k.$id,delete k.$id),G&&q&&this.addMetaSchema(k,k[_],!1)}defaultMeta(){const{meta:q,schemaId:G}=this.opts;return this.opts.defaultMeta=typeof q=="object"?q[G]||q:void 0}validate(q,G){let _;if(typeof q=="string"){if(_=this.getSchema(q),!_)throw new Error(`no schema with key or ref "${q}"`)}else _=this.compile(q);const k=_(G);return"$async"in _||(this.errors=_.errors),k}compile(q,G){const _=this._addSchema(q,G);return _.validate||this._compileSchemaEnv(_)}compileAsync(q,G){if(typeof this.opts.loadSchema!="function")throw new Error("options.loadSchema should be a function");const{loadSchema:_}=this.opts;return k.call(this,q,G);async function k(de,L){await M.call(this,de.$schema);const V=this._addSchema(de,L);return V.validate||I.call(this,V)}async function M(de){de&&!this.getSchema(de)&&await k.call(this,{$ref:de},!0)}async function I(de){try{return this._compileSchemaEnv(de)}catch(L){if(!(L instanceof a.default))throw L;return Q.call(this,L),await W.call(this,L.missingSchema),I.call(this,de)}}function Q({missingSchema:de,missingRef:L}){if(this.refs[de])throw new Error(`AnySchema ${de} is loaded but ${L} cannot be resolved`)}async function W(de){const L=await oe.call(this,de);this.refs[de]||await M.call(this,L.$schema),this.refs[de]||this.addSchema(L,de,G)}async function oe(de){const L=this._loading[de];if(L)return L;try{return await(this._loading[de]=_(de))}finally{delete this._loading[de]}}}addSchema(q,G,_,k=this.opts.validateSchema){if(Array.isArray(q)){for(const I of q)this.addSchema(I,void 0,_,k);return this}let M;if(typeof q=="object"){const{schemaId:I}=this.opts;if(M=q[I],M!==void 0&&typeof M!="string")throw new Error(`schema ${I} must be string`)}return G=(0,l.normalizeId)(G||M),this._checkUnique(G),this.schemas[G]=this._addSchema(q,_,G,k,!0),this}addMetaSchema(q,G,_=this.opts.validateSchema){return this.addSchema(q,G,!0,_),this}validateSchema(q,G){if(typeof q=="boolean")return!0;let _;if(_=q.$schema,_!==void 0&&typeof _!="string")throw new Error("$schema must be a string");if(_=_||this.opts.defaultMeta||this.defaultMeta(),!_)return this.logger.warn("meta-schema not available"),this.errors=null,!0;const k=this.validate(_,q);if(!k&&G){const M="schema is invalid: "+this.errorsText();if(this.opts.validateSchema==="log")this.logger.error(M);else throw new Error(M)}return k}getSchema(q){let G;for(;typeof(G=C.call(this,q))=="string";)q=G;if(G===void 0){const{schemaId:_}=this.opts,k=new s.SchemaEnv({schema:{},schemaId:_});if(G=s.resolveSchema.call(this,k,q),!G)return;this.refs[q]=G}return G.validate||this._compileSchemaEnv(G)}removeSchema(q){if(q instanceof RegExp)return this._removeAllSchemas(this.schemas,q),this._removeAllSchemas(this.refs,q),this;switch(typeof q){case"undefined":return this._removeAllSchemas(this.schemas),this._removeAllSchemas(this.refs),this._cache.clear(),this;case"string":{const G=C.call(this,q);return typeof G=="object"&&this._cache.delete(G.schema),delete this.schemas[q],delete this.refs[q],this}case"object":{const G=q;this._cache.delete(G);let _=q[this.opts.schemaId];return _&&(_=(0,l.normalizeId)(_),delete this.schemas[_],delete this.refs[_]),this}default:throw new Error("ajv.removeSchema: invalid parameter")}}addVocabulary(q){for(const G of q)this.addKeyword(G);return this}addKeyword(q,G){let _;if(typeof q=="string")_=q,typeof G=="object"&&(this.logger.warn("these parameters are deprecated, see docs for addKeyword"),G.keyword=_);else if(typeof q=="object"&&G===void 0){if(G=q,_=G.keyword,Array.isArray(_)&&!_.length)throw new Error("addKeywords: keyword must be string or non-empty array")}else throw new Error("invalid addKeywords parameters");if(D.call(this,_,G),!G)return(0,d.eachItem)(_,M=>A.call(this,M)),this;Z.call(this,G);const k={...G,type:(0,u.getJSONTypes)(G.type),schemaType:(0,u.getJSONTypes)(G.schemaType)};return(0,d.eachItem)(_,k.type.length===0?M=>A.call(this,M,k):M=>k.type.forEach(I=>A.call(this,M,k,I))),this}getKeyword(q){const G=this.RULES.all[q];return typeof G=="object"?G.definition:!!G}removeKeyword(q){const{RULES:G}=this;delete G.keywords[q],delete G.all[q];for(const _ of G.rules){const k=_.rules.findIndex(M=>M.keyword===q);k>=0&&_.rules.splice(k,1)}return this}addFormat(q,G){return typeof G=="string"&&(G=new RegExp(G)),this.formats[q]=G,this}errorsText(q=this.errors,{separator:G=", ",dataVar:_="data"}={}){return!q||q.length===0?"No errors":q.map(k=>`${_}${k.instancePath} ${k.message}`).reduce((k,M)=>k+G+M)}$dataMetaSchema(q,G){const _=this.RULES.all;q=JSON.parse(JSON.stringify(q));for(const k of G){const M=k.split("/").slice(1);let I=q;for(const Q of M)I=I[Q];for(const Q in _){const W=_[Q];if(typeof W!="object")continue;const{$data:oe}=W.definition,de=I[Q];oe&&de&&(I[Q]=J(de))}}return q}_removeAllSchemas(q,G){for(const _ in q){const k=q[_];(!G||G.test(_))&&(typeof k=="string"?delete q[_]:k&&!k.meta&&(this._cache.delete(k.schema),delete q[_]))}}_addSchema(q,G,_,k=this.opts.validateSchema,M=this.opts.addUsedSchema){let I;const{schemaId:Q}=this.opts;if(typeof q=="object")I=q[Q];else{if(this.opts.jtd)throw new Error("schema must be object");if(typeof q!="boolean")throw new Error("schema must be object or boolean")}let W=this._cache.get(q);if(W!==void 0)return W;_=(0,l.normalizeId)(I||_);const oe=l.getSchemaRefs.call(this,q,_);return W=new s.SchemaEnv({schema:q,schemaId:Q,meta:G,baseId:_,localRefs:oe}),this._cache.set(W.schema,W),M&&!_.startsWith("#")&&(_&&this._checkUnique(_),this.refs[_]=W),k&&this.validateSchema(q,!0),W}_checkUnique(q){if(this.schemas[q]||this.refs[q])throw new Error(`schema with key or id "${q}" already exists`)}_compileSchemaEnv(q){if(q.meta?this._compileMetaSchema(q):s.compileSchema.call(this,q),!q.validate)throw new Error("ajv implementation error");return q.validate}_compileMetaSchema(q){const G=this.opts;this.opts=this._metaOpts;try{s.compileSchema.call(this,q)}finally{this.opts=G}}}S.ValidationError=r.default,S.MissingRefError=a.default,e.default=S;function E(N,q,G,_="error"){for(const k in N){const M=k;M in q&&this.logger[_](`${G}: option ${k}. ${N[M]}`)}}function C(N){return N=(0,l.normalizeId)(N),this.schemas[N]||this.refs[N]}function T(){const N=this.opts.schemas;if(N)if(Array.isArray(N))this.addSchema(N);else for(const q in N)this.addSchema(N[q],q)}function P(){for(const N in this.opts.formats){const q=this.opts.formats[N];q&&this.addFormat(N,q)}}function R(N){if(Array.isArray(N)){this.addVocabulary(N);return}this.logger.warn("keywords option as map is deprecated, pass array");for(const q in N){const G=N[q];G.keyword||(G.keyword=q),this.addKeyword(G)}}function $(){const N={...this.opts};for(const q of y)delete N[q];return N}const j={log(){},warn(){},error(){}};function O(N){if(N===!1)return j;if(N===void 0)return console;if(N.log&&N.warn&&N.error)return N;throw new Error("logger must implement log, warn and error methods")}const z=/^[a-z_$][a-z0-9_$:-]*$/i;function D(N,q){const{RULES:G}=this;if((0,d.eachItem)(N,_=>{if(G.keywords[_])throw new Error(`Keyword ${_} is already defined`);if(!z.test(_))throw new Error(`Keyword ${_} has invalid name`)}),!!q&&q.$data&&!("code"in q||"validate"in q))throw new Error('$data keyword must have "code" or "validate" function')}function A(N,q,G){var _;const k=q==null?void 0:q.post;if(G&&k)throw new Error('keyword with "post" flag cannot have "type"');const{RULES:M}=this;let I=k?M.post:M.rules.find(({type:W})=>W===G);if(I||(I={type:G,rules:[]},M.rules.push(I)),M.keywords[N]=!0,!q)return;const Q={keyword:N,definition:{...q,type:(0,u.getJSONTypes)(q.type),schemaType:(0,u.getJSONTypes)(q.schemaType)}};q.before?B.call(this,I,Q,q.before):I.rules.push(Q),M.all[N]=Q,(_=q.implements)===null||_===void 0||_.forEach(W=>this.addKeyword(W))}function B(N,q,G){const _=N.rules.findIndex(k=>k.keyword===G);_>=0?N.rules.splice(_,0,q):(N.rules.push(q),this.logger.warn(`rule ${G} is not defined`))}function Z(N){let{metaSchema:q}=N;q!==void 0&&(N.$data&&this.opts.$data&&(q=J(q)),N.validateSchema=this.compile(q,!0))}const F={$ref:"https://raw.githubusercontent.com/ajv-validator/ajv/master/lib/refs/data.json#"};function J(N){return{anyOf:[N,F]}}})(PM);var Dw={},zw={},Iw={};Object.defineProperty(Iw,"__esModule",{value:!0});const mne={keyword:"id",code(){throw new Error('NOT SUPPORTED: keyword "id", use "$id" for schema ID')}};Iw.default=mne;var wo={};Object.defineProperty(wo,"__esModule",{value:!0});wo.callRef=wo.getValidate=void 0;const pne=kc,DE=qe,Zn=Ue,Io=Na,zE=Wn,Nf=ge,gne={keyword:"$ref",schemaType:"string",code(e){const{gen:t,schema:n,it:r}=e,{baseId:a,schemaEnv:i,validateName:s,opts:o,self:l}=r,{root:u}=i;if((n==="#"||n==="#/")&&a===u.baseId)return f();const d=zE.resolveRef.call(l,u,a,n);if(d===void 0)throw new pne.default(r.opts.uriResolver,a,n);if(d instanceof zE.SchemaEnv)return m(d);return h(d);function f(){if(i===u)return ch(e,s,i,i.$async);const y=t.scopeValue("root",{ref:u});return ch(e,(0,Zn._)`${y}.validate`,u,u.$async)}function m(y){const p=bP(e,y);ch(e,p,y,y.$async)}function h(y){const p=t.scopeValue("schema",o.code.source===!0?{ref:y,code:(0,Zn.stringify)(y)}:{ref:y}),b=t.name("valid"),g=e.subschema({schema:y,dataTypes:[],schemaPath:Zn.nil,topSchemaRef:p,errSchemaPath:n},b);e.mergeEvaluated(g),e.ok(b)}}};function bP(e,t){const{gen:n}=e;return t.validate?n.scopeValue("validate",{ref:t.validate}):(0,Zn._)`${n.scopeValue("wrapper",{ref:t})}.validate`}wo.getValidate=bP;function ch(e,t,n,r){const{gen:a,it:i}=e,{allErrors:s,schemaEnv:o,opts:l}=i,u=l.passContext?Io.default.this:Zn.nil;r?d():f();function d(){if(!o.$async)throw new Error("async schema referenced by sync schema");const y=a.let("valid");a.try(()=>{a.code((0,Zn._)`await ${(0,DE.callValidateCode)(e,t,u)}`),h(t),s||a.assign(y,!0)},p=>{a.if((0,Zn._)`!(${p} instanceof ${i.ValidationError})`,()=>a.throw(p)),m(p),s||a.assign(y,!1)}),e.ok(y)}function f(){e.result((0,DE.callValidateCode)(e,t,u),()=>h(t),()=>m(t))}function m(y){const p=(0,Zn._)`${y}.errors`;a.assign(Io.default.vErrors,(0,Zn._)`${Io.default.vErrors} === null ? ${p} : ${Io.default.vErrors}.concat(${p})`),a.assign(Io.default.errors,(0,Zn._)`${Io.default.vErrors}.length`)}function h(y){var p;if(!i.opts.unevaluated)return;const b=(p=n==null?void 0:n.validate)===null||p===void 0?void 0:p.evaluated;if(i.props!==!0)if(b&&!b.dynamicProps)b.props!==void 0&&(i.props=Nf.mergeEvaluated.props(a,b.props,i.props));else{const g=a.var("props",(0,Zn._)`${y}.evaluated.props`);i.props=Nf.mergeEvaluated.props(a,g,i.props,Zn.Name)}if(i.items!==!0)if(b&&!b.dynamicItems)b.items!==void 0&&(i.items=Nf.mergeEvaluated.items(a,b.items,i.items));else{const g=a.var("items",(0,Zn._)`${y}.evaluated.items`);i.items=Nf.mergeEvaluated.items(a,g,i.items,Zn.Name)}}}wo.callRef=ch;wo.default=gne;Object.defineProperty(zw,"__esModule",{value:!0});const yne=Iw,vne=wo,bne=["$schema","$id","$defs","$vocabulary",{keyword:"$comment"},"definitions",yne.default,vne.default];zw.default=bne;var Lw={},Uw={};Object.defineProperty(Uw,"__esModule",{value:!0});const Em=Ue,_i=Em.operators,Cm={maximum:{okStr:"<=",ok:_i.LTE,fail:_i.GT},minimum:{okStr:">=",ok:_i.GTE,fail:_i.LT},exclusiveMaximum:{okStr:"<",ok:_i.LT,fail:_i.GTE},exclusiveMinimum:{okStr:">",ok:_i.GT,fail:_i.LTE}},xne={message:({keyword:e,schemaCode:t})=>(0,Em.str)`must be ${Cm[e].okStr} ${t}`,params:({keyword:e,schemaCode:t})=>(0,Em._)`{comparison: ${Cm[e].okStr}, limit: ${t}}`},wne={keyword:Object.keys(Cm),type:"number",schemaType:"number",$data:!0,error:xne,code(e){const{keyword:t,data:n,schemaCode:r}=e;e.fail$data((0,Em._)`${n} ${Cm[t].fail} ${r} || isNaN(${n})`)}};Uw.default=wne;var Fw={};Object.defineProperty(Fw,"__esModule",{value:!0});const Nu=Ue,Sne={message:({schemaCode:e})=>(0,Nu.str)`must be multiple of ${e}`,params:({schemaCode:e})=>(0,Nu._)`{multipleOf: ${e}}`},_ne={keyword:"multipleOf",type:"number",schemaType:"number",$data:!0,error:Sne,code(e){const{gen:t,data:n,schemaCode:r,it:a}=e,i=a.opts.multipleOfPrecision,s=t.let("res"),o=i?(0,Nu._)`Math.abs(Math.round(${s}) - ${s}) > 1e-${i}`:(0,Nu._)`${s} !== parseInt(${s})`;e.fail$data((0,Nu._)`(${r} === 0 || (${s} = ${n}/${r}, ${o}))`)}};Fw.default=_ne;var qw={},Hw={};Object.defineProperty(Hw,"__esModule",{value:!0});function xP(e){const t=e.length;let n=0,r=0,a;for(;r<t;)n++,a=e.charCodeAt(r++),a>=55296&&a<=56319&&r<t&&(a=e.charCodeAt(r),(a&64512)===56320&&r++);return n}Hw.default=xP;xP.code='require("ajv/dist/runtime/ucs2length").default';Object.defineProperty(qw,"__esModule",{value:!0});const Us=Ue,kne=ge,Ene=Hw,Cne={message({keyword:e,schemaCode:t}){const n=e==="maxLength"?"more":"fewer";return(0,Us.str)`must NOT have ${n} than ${t} characters`},params:({schemaCode:e})=>(0,Us._)`{limit: ${e}}`},Nne={keyword:["maxLength","minLength"],type:"string",schemaType:"number",$data:!0,error:Cne,code(e){const{keyword:t,data:n,schemaCode:r,it:a}=e,i=t==="maxLength"?Us.operators.GT:Us.operators.LT,s=a.opts.unicode===!1?(0,Us._)`${n}.length`:(0,Us._)`${(0,kne.useFunc)(e.gen,Ene.default)}(${n})`;e.fail$data((0,Us._)`${s} ${i} ${r}`)}};qw.default=Nne;var Bw={};Object.defineProperty(Bw,"__esModule",{value:!0});const jne=qe,Tne=ge,ul=Ue,Ane={message:({schemaCode:e})=>(0,ul.str)`must match pattern "${e}"`,params:({schemaCode:e})=>(0,ul._)`{pattern: ${e}}`},Rne={keyword:"pattern",type:"string",schemaType:"string",$data:!0,error:Ane,code(e){const{gen:t,data:n,$data:r,schema:a,schemaCode:i,it:s}=e,o=s.opts.unicodeRegExp?"u":"";if(r){const{regExp:l}=s.opts.code,u=l.code==="new RegExp"?(0,ul._)`new RegExp`:(0,Tne.useFunc)(t,l),d=t.let("valid");t.try(()=>t.assign(d,(0,ul._)`${u}(${i}, ${o}).test(${n})`),()=>t.assign(d,!1)),e.fail$data((0,ul._)`!${d}`)}else{const l=(0,jne.usePattern)(e,a);e.fail$data((0,ul._)`!${l}.test(${n})`)}}};Bw.default=Rne;var Vw={};Object.defineProperty(Vw,"__esModule",{value:!0});const ju=Ue,$ne={message({keyword:e,schemaCode:t}){const n=e==="maxProperties"?"more":"fewer";return(0,ju.str)`must NOT have ${n} than ${t} properties`},params:({schemaCode:e})=>(0,ju._)`{limit: ${e}}`},One={keyword:["maxProperties","minProperties"],type:"object",schemaType:"number",$data:!0,error:$ne,code(e){const{keyword:t,data:n,schemaCode:r}=e,a=t==="maxProperties"?ju.operators.GT:ju.operators.LT;e.fail$data((0,ju._)`Object.keys(${n}).length ${a} ${r}`)}};Vw.default=One;var Kw={};Object.defineProperty(Kw,"__esModule",{value:!0});const Hc=qe,Tu=Ue,Mne=ge,Pne={message:({params:{missingProperty:e}})=>(0,Tu.str)`must have required property '${e}'`,params:({params:{missingProperty:e}})=>(0,Tu._)`{missingProperty: ${e}}`},Dne={keyword:"required",type:"object",schemaType:"array",$data:!0,error:Pne,code(e){const{gen:t,schema:n,schemaCode:r,data:a,$data:i,it:s}=e,{opts:o}=s;if(!i&&n.length===0)return;const l=n.length>=o.loopRequired;if(s.allErrors?u():d(),o.strictRequired){const h=e.parentSchema.properties,{definedProperties:y}=e.it;for(const p of n)if((h==null?void 0:h[p])===void 0&&!y.has(p)){const b=s.schemaEnv.baseId+s.errSchemaPath,g=`required property "${p}" is not defined at "${b}" (strictRequired)`;(0,Mne.checkStrictMode)(s,g,s.opts.strictRequired)}}function u(){if(l||i)e.block$data(Tu.nil,f);else for(const h of n)(0,Hc.checkReportMissingProp)(e,h)}function d(){const h=t.let("missing");if(l||i){const y=t.let("valid",!0);e.block$data(y,()=>m(h,y)),e.ok(y)}else t.if((0,Hc.checkMissingProp)(e,n,h)),(0,Hc.reportMissingProp)(e,h),t.else()}function f(){t.forOf("prop",r,h=>{e.setParams({missingProperty:h}),t.if((0,Hc.noPropertyInData)(t,a,h,o.ownProperties),()=>e.error())})}function m(h,y){e.setParams({missingProperty:h}),t.forOf(h,r,()=>{t.assign(y,(0,Hc.propertyInData)(t,a,h,o.ownProperties)),t.if((0,Tu.not)(y),()=>{e.error(),t.break()})},Tu.nil)}}};Kw.default=Dne;var Zw={};Object.defineProperty(Zw,"__esModule",{value:!0});const Au=Ue,zne={message({keyword:e,schemaCode:t}){const n=e==="maxItems"?"more":"fewer";return(0,Au.str)`must NOT have ${n} than ${t} items`},params:({schemaCode:e})=>(0,Au._)`{limit: ${e}}`},Ine={keyword:["maxItems","minItems"],type:"array",schemaType:"number",$data:!0,error:zne,code(e){const{keyword:t,data:n,schemaCode:r}=e,a=t==="maxItems"?Au.operators.GT:Au.operators.LT;e.fail$data((0,Au._)`${n}.length ${a} ${r}`)}};Zw.default=Ine;var Gw={},Ud={};Object.defineProperty(Ud,"__esModule",{value:!0});const wP=GM;wP.code='require("ajv/dist/runtime/equal").default';Ud.default=wP;Object.defineProperty(Gw,"__esModule",{value:!0});const cy=Xt,fn=Ue,Lne=ge,Une=Ud,Fne={message:({params:{i:e,j:t}})=>(0,fn.str)`must NOT have duplicate items (items ## ${t} and ${e} are identical)`,params:({params:{i:e,j:t}})=>(0,fn._)`{i: ${e}, j: ${t}}`},qne={keyword:"uniqueItems",type:"array",schemaType:"boolean",$data:!0,error:Fne,code(e){const{gen:t,data:n,$data:r,schema:a,parentSchema:i,schemaCode:s,it:o}=e;if(!r&&!a)return;const l=t.let("valid"),u=i.items?(0,cy.getSchemaTypes)(i.items):[];e.block$data(l,d,(0,fn._)`${s} === false`),e.ok(l);function d(){const y=t.let("i",(0,fn._)`${n}.length`),p=t.let("j");e.setParams({i:y,j:p}),t.assign(l,!0),t.if((0,fn._)`${y} > 1`,()=>(f()?m:h)(y,p))}function f(){return u.length>0&&!u.some(y=>y==="object"||y==="array")}function m(y,p){const b=t.name("item"),g=(0,cy.checkDataTypes)(u,b,o.opts.strictNumbers,cy.DataType.Wrong),v=t.const("indices",(0,fn._)`{}`);t.for((0,fn._)`;${y}--;`,()=>{t.let(b,(0,fn._)`${n}[${y}]`),t.if(g,(0,fn._)`continue`),u.length>1&&t.if((0,fn._)`typeof ${b} == "string"`,(0,fn._)`${b} += "_"`),t.if((0,fn._)`typeof ${v}[${b}] == "number"`,()=>{t.assign(p,(0,fn._)`${v}[${b}]`),e.error(),t.assign(l,!1).break()}).code((0,fn._)`${v}[${b}] = ${y}`)})}function h(y,p){const b=(0,Lne.useFunc)(t,Une.default),g=t.name("outer");t.label(g).for((0,fn._)`;${y}--;`,()=>t.for((0,fn._)`${p} = ${y}; ${p}--;`,()=>t.if((0,fn._)`${b}(${n}[${y}], ${n}[${p}])`,()=>{e.error(),t.assign(l,!1).break(g)})))}}};Gw.default=qne;var Qw={};Object.defineProperty(Qw,"__esModule",{value:!0});const $0=Ue,Hne=ge,Bne=Ud,Vne={message:"must be equal to constant",params:({schemaCode:e})=>(0,$0._)`{allowedValue: ${e}}`},Kne={keyword:"const",$data:!0,error:Vne,code(e){const{gen:t,data:n,$data:r,schemaCode:a,schema:i}=e;r||i&&typeof i=="object"?e.fail$data((0,$0._)`!${(0,Hne.useFunc)(t,Bne.default)}(${n}, ${a})`):e.fail((0,$0._)`${i} !== ${n}`)}};Qw.default=Kne;var Yw={};Object.defineProperty(Yw,"__esModule",{value:!0});const nu=Ue,Zne=ge,Gne=Ud,Qne={message:"must be equal to one of the allowed values",params:({schemaCode:e})=>(0,nu._)`{allowedValues: ${e}}`},Yne={keyword:"enum",schemaType:"array",$data:!0,error:Qne,code(e){const{gen:t,data:n,$data:r,schema:a,schemaCode:i,it:s}=e;if(!r&&a.length===0)throw new Error("enum must have non-empty array");const o=a.length>=s.opts.loopEnum;let l;const u=()=>l??(l=(0,Zne.useFunc)(t,Gne.default));let d;if(o||r)d=t.let("valid"),e.block$data(d,f);else{if(!Array.isArray(a))throw new Error("ajv implementation error");const h=t.const("vSchema",i);d=(0,nu.or)(...a.map((y,p)=>m(h,p)))}e.pass(d);function f(){t.assign(d,!1),t.forOf("v",i,h=>t.if((0,nu._)`${u()}(${n}, ${h})`,()=>t.assign(d,!0).break()))}function m(h,y){const p=a[y];return typeof p=="object"&&p!==null?(0,nu._)`${u()}(${n}, ${h}[${y}])`:(0,nu._)`${n} === ${p}`}}};Yw.default=Yne;Object.defineProperty(Lw,"__esModule",{value:!0});const Xne=Uw,Wne=Fw,Jne=qw,ere=Bw,tre=Vw,nre=Kw,rre=Zw,are=Gw,ire=Qw,sre=Yw,ore=[Xne.default,Wne.default,Jne.default,ere.default,tre.default,nre.default,rre.default,are.default,{keyword:"type",schemaType:["string","array"]},{keyword:"nullable",schemaType:"boolean"},ire.default,sre.default];Lw.default=ore;var Xw={},Cc={};Object.defineProperty(Cc,"__esModule",{value:!0});Cc.validateAdditionalItems=void 0;const Fs=Ue,O0=ge,lre={message:({params:{len:e}})=>(0,Fs.str)`must NOT have more than ${e} items`,params:({params:{len:e}})=>(0,Fs._)`{limit: ${e}}`},cre={keyword:"additionalItems",type:"array",schemaType:["boolean","object"],before:"uniqueItems",error:lre,code(e){const{parentSchema:t,it:n}=e,{items:r}=t;if(!Array.isArray(r)){(0,O0.checkStrictMode)(n,'"additionalItems" is ignored when "items" is not an array of schemas');return}SP(e,r)}};function SP(e,t){const{gen:n,schema:r,data:a,keyword:i,it:s}=e;s.items=!0;const o=n.const("len",(0,Fs._)`${a}.length`);if(r===!1)e.setParams({len:t.length}),e.pass((0,Fs._)`${o} <= ${t.length}`);else if(typeof r=="object"&&!(0,O0.alwaysValidSchema)(s,r)){const u=n.var("valid",(0,Fs._)`${o} <= ${t.length}`);n.if((0,Fs.not)(u),()=>l(u)),e.ok(u)}function l(u){n.forRange("i",t.length,o,d=>{e.subschema({keyword:i,dataProp:d,dataPropType:O0.Type.Num},u),s.allErrors||n.if((0,Fs.not)(u),()=>n.break())})}}Cc.validateAdditionalItems=SP;Cc.default=cre;var Ww={},Nc={};Object.defineProperty(Nc,"__esModule",{value:!0});Nc.validateTuple=void 0;const IE=Ue,uh=ge,ure=qe,dre={keyword:"items",type:"array",schemaType:["object","array","boolean"],before:"uniqueItems",code(e){const{schema:t,it:n}=e;if(Array.isArray(t))return _P(e,"additionalItems",t);n.items=!0,!(0,uh.alwaysValidSchema)(n,t)&&e.ok((0,ure.validateArray)(e))}};function _P(e,t,n=e.schema){const{gen:r,parentSchema:a,data:i,keyword:s,it:o}=e;d(a),o.opts.unevaluated&&n.length&&o.items!==!0&&(o.items=uh.mergeEvaluated.items(r,n.length,o.items));const l=r.name("valid"),u=r.const("len",(0,IE._)`${i}.length`);n.forEach((f,m)=>{(0,uh.alwaysValidSchema)(o,f)||(r.if((0,IE._)`${u} > ${m}`,()=>e.subschema({keyword:s,schemaProp:m,dataProp:m},l)),e.ok(l))});function d(f){const{opts:m,errSchemaPath:h}=o,y=n.length,p=y===f.minItems&&(y===f.maxItems||f[t]===!1);if(m.strictTuples&&!p){const b=`"${s}" is ${y}-tuple, but minItems or maxItems/${t} are not specified or different at path "${h}"`;(0,uh.checkStrictMode)(o,b,m.strictTuples)}}}Nc.validateTuple=_P;Nc.default=dre;Object.defineProperty(Ww,"__esModule",{value:!0});const fre=Nc,hre={keyword:"prefixItems",type:"array",schemaType:["array"],before:"uniqueItems",code:e=>(0,fre.validateTuple)(e,"items")};Ww.default=hre;var Jw={};Object.defineProperty(Jw,"__esModule",{value:!0});const LE=Ue,mre=ge,pre=qe,gre=Cc,yre={message:({params:{len:e}})=>(0,LE.str)`must NOT have more than ${e} items`,params:({params:{len:e}})=>(0,LE._)`{limit: ${e}}`},vre={keyword:"items",type:"array",schemaType:["object","boolean"],before:"uniqueItems",error:yre,code(e){const{schema:t,parentSchema:n,it:r}=e,{prefixItems:a}=n;r.items=!0,!(0,mre.alwaysValidSchema)(r,t)&&(a?(0,gre.validateAdditionalItems)(e,a):e.ok((0,pre.validateArray)(e)))}};Jw.default=vre;var e1={};Object.defineProperty(e1,"__esModule",{value:!0});const Cr=Ue,jf=ge,bre={message:({params:{min:e,max:t}})=>t===void 0?(0,Cr.str)`must contain at least ${e} valid item(s)`:(0,Cr.str)`must contain at least ${e} and no more than ${t} valid item(s)`,params:({params:{min:e,max:t}})=>t===void 0?(0,Cr._)`{minContains: ${e}}`:(0,Cr._)`{minContains: ${e}, maxContains: ${t}}`},xre={keyword:"contains",type:"array",schemaType:["object","boolean"],before:"uniqueItems",trackErrors:!0,error:bre,code(e){const{gen:t,schema:n,parentSchema:r,data:a,it:i}=e;let s,o;const{minContains:l,maxContains:u}=r;i.opts.next?(s=l===void 0?1:l,o=u):s=1;const d=t.const("len",(0,Cr._)`${a}.length`);if(e.setParams({min:s,max:o}),o===void 0&&s===0){(0,jf.checkStrictMode)(i,'"minContains" == 0 without "maxContains": "contains" keyword ignored');return}if(o!==void 0&&s>o){(0,jf.checkStrictMode)(i,'"minContains" > "maxContains" is always invalid'),e.fail();return}if((0,jf.alwaysValidSchema)(i,n)){let p=(0,Cr._)`${d} >= ${s}`;o!==void 0&&(p=(0,Cr._)`${p} && ${d} <= ${o}`),e.pass(p);return}i.items=!0;const f=t.name("valid");o===void 0&&s===1?h(f,()=>t.if(f,()=>t.break())):s===0?(t.let(f,!0),o!==void 0&&t.if((0,Cr._)`${a}.length > 0`,m)):(t.let(f,!1),m()),e.result(f,()=>e.reset());function m(){const p=t.name("_valid"),b=t.let("count",0);h(p,()=>t.if(p,()=>y(b)))}function h(p,b){t.forRange("i",0,d,g=>{e.subschema({keyword:"contains",dataProp:g,dataPropType:jf.Type.Num,compositeRule:!0},p),b()})}function y(p){t.code((0,Cr._)`${p}++`),o===void 0?t.if((0,Cr._)`${p} >= ${s}`,()=>t.assign(f,!0).break()):(t.if((0,Cr._)`${p} > ${o}`,()=>t.assign(f,!1).break()),s===1?t.assign(f,!0):t.if((0,Cr._)`${p} >= ${s}`,()=>t.assign(f,!0)))}}};e1.default=xre;var kP={};(function(e){Object.defineProperty(e,"__esModule",{value:!0}),e.validateSchemaDeps=e.validatePropertyDeps=e.error=void 0;const t=Ue,n=ge,r=qe;e.error={message:({params:{property:l,depsCount:u,deps:d}})=>{const f=u===1?"property":"properties";return(0,t.str)`must have ${f} ${d} when property ${l} is present`},params:({params:{property:l,depsCount:u,deps:d,missingProperty:f}})=>(0,t._)`{property: ${l},
487
+ missingProperty: ${f},
488
+ depsCount: ${u},
489
+ deps: ${d}}`};const a={keyword:"dependencies",type:"object",schemaType:"object",error:e.error,code(l){const[u,d]=i(l);s(l,u),o(l,d)}};function i({schema:l}){const u={},d={};for(const f in l){if(f==="__proto__")continue;const m=Array.isArray(l[f])?u:d;m[f]=l[f]}return[u,d]}function s(l,u=l.schema){const{gen:d,data:f,it:m}=l;if(Object.keys(u).length===0)return;const h=d.let("missing");for(const y in u){const p=u[y];if(p.length===0)continue;const b=(0,r.propertyInData)(d,f,y,m.opts.ownProperties);l.setParams({property:y,depsCount:p.length,deps:p.join(", ")}),m.allErrors?d.if(b,()=>{for(const g of p)(0,r.checkReportMissingProp)(l,g)}):(d.if((0,t._)`${b} && (${(0,r.checkMissingProp)(l,p,h)})`),(0,r.reportMissingProp)(l,h),d.else())}}e.validatePropertyDeps=s;function o(l,u=l.schema){const{gen:d,data:f,keyword:m,it:h}=l,y=d.name("valid");for(const p in u)(0,n.alwaysValidSchema)(h,u[p])||(d.if((0,r.propertyInData)(d,f,p,h.opts.ownProperties),()=>{const b=l.subschema({keyword:m,schemaProp:p},y);l.mergeValidEvaluated(b,y)},()=>d.var(y,!0)),l.ok(y))}e.validateSchemaDeps=o,e.default=a})(kP);var t1={};Object.defineProperty(t1,"__esModule",{value:!0});const EP=Ue,wre=ge,Sre={message:"property name must be valid",params:({params:e})=>(0,EP._)`{propertyName: ${e.propertyName}}`},_re={keyword:"propertyNames",type:"object",schemaType:["object","boolean"],error:Sre,code(e){const{gen:t,schema:n,data:r,it:a}=e;if((0,wre.alwaysValidSchema)(a,n))return;const i=t.name("valid");t.forIn("key",r,s=>{e.setParams({propertyName:s}),e.subschema({keyword:"propertyNames",data:s,dataTypes:["string"],propertyName:s,compositeRule:!0},i),t.if((0,EP.not)(i),()=>{e.error(!0),a.allErrors||t.break()})}),e.ok(i)}};t1.default=_re;var $p={};Object.defineProperty($p,"__esModule",{value:!0});const Tf=qe,Vr=Ue,kre=Na,Af=ge,Ere={message:"must NOT have additional properties",params:({params:e})=>(0,Vr._)`{additionalProperty: ${e.additionalProperty}}`},Cre={keyword:"additionalProperties",type:["object"],schemaType:["boolean","object"],allowUndefined:!0,trackErrors:!0,error:Ere,code(e){const{gen:t,schema:n,parentSchema:r,data:a,errsCount:i,it:s}=e;if(!i)throw new Error("ajv implementation error");const{allErrors:o,opts:l}=s;if(s.props=!0,l.removeAdditional!=="all"&&(0,Af.alwaysValidSchema)(s,n))return;const u=(0,Tf.allSchemaProperties)(r.properties),d=(0,Tf.allSchemaProperties)(r.patternProperties);f(),e.ok((0,Vr._)`${i} === ${kre.default.errors}`);function f(){t.forIn("key",a,b=>{!u.length&&!d.length?y(b):t.if(m(b),()=>y(b))})}function m(b){let g;if(u.length>8){const v=(0,Af.schemaRefOrVal)(s,r.properties,"properties");g=(0,Tf.isOwnProperty)(t,v,b)}else u.length?g=(0,Vr.or)(...u.map(v=>(0,Vr._)`${b} === ${v}`)):g=Vr.nil;return d.length&&(g=(0,Vr.or)(g,...d.map(v=>(0,Vr._)`${(0,Tf.usePattern)(e,v)}.test(${b})`))),(0,Vr.not)(g)}function h(b){t.code((0,Vr._)`delete ${a}[${b}]`)}function y(b){if(l.removeAdditional==="all"||l.removeAdditional&&n===!1){h(b);return}if(n===!1){e.setParams({additionalProperty:b}),e.error(),o||t.break();return}if(typeof n=="object"&&!(0,Af.alwaysValidSchema)(s,n)){const g=t.name("valid");l.removeAdditional==="failing"?(p(b,g,!1),t.if((0,Vr.not)(g),()=>{e.reset(),h(b)})):(p(b,g),o||t.if((0,Vr.not)(g),()=>t.break()))}}function p(b,g,v){const w={keyword:"additionalProperties",dataProp:b,dataPropType:Af.Type.Str};v===!1&&Object.assign(w,{compositeRule:!0,createErrors:!1,allErrors:!1}),e.subschema(w,g)}}};$p.default=Cre;var n1={};Object.defineProperty(n1,"__esModule",{value:!0});const Nre=jp(),UE=qe,uy=ge,FE=$p,jre={keyword:"properties",type:"object",schemaType:"object",code(e){const{gen:t,schema:n,parentSchema:r,data:a,it:i}=e;i.opts.removeAdditional==="all"&&r.additionalProperties===void 0&&FE.default.code(new Nre.KeywordCxt(i,FE.default,"additionalProperties"));const s=(0,UE.allSchemaProperties)(n);for(const f of s)i.definedProperties.add(f);i.opts.unevaluated&&s.length&&i.props!==!0&&(i.props=uy.mergeEvaluated.props(t,(0,uy.toHash)(s),i.props));const o=s.filter(f=>!(0,uy.alwaysValidSchema)(i,n[f]));if(o.length===0)return;const l=t.name("valid");for(const f of o)u(f)?d(f):(t.if((0,UE.propertyInData)(t,a,f,i.opts.ownProperties)),d(f),i.allErrors||t.else().var(l,!0),t.endIf()),e.it.definedProperties.add(f),e.ok(l);function u(f){return i.opts.useDefaults&&!i.compositeRule&&n[f].default!==void 0}function d(f){e.subschema({keyword:"properties",schemaProp:f,dataProp:f},l)}}};n1.default=jre;var r1={};Object.defineProperty(r1,"__esModule",{value:!0});const qE=qe,Rf=Ue,HE=ge,BE=ge,Tre={keyword:"patternProperties",type:"object",schemaType:"object",code(e){const{gen:t,schema:n,data:r,parentSchema:a,it:i}=e,{opts:s}=i,o=(0,qE.allSchemaProperties)(n),l=o.filter(p=>(0,HE.alwaysValidSchema)(i,n[p]));if(o.length===0||l.length===o.length&&(!i.opts.unevaluated||i.props===!0))return;const u=s.strictSchema&&!s.allowMatchingProperties&&a.properties,d=t.name("valid");i.props!==!0&&!(i.props instanceof Rf.Name)&&(i.props=(0,BE.evaluatedPropsToName)(t,i.props));const{props:f}=i;m();function m(){for(const p of o)u&&h(p),i.allErrors?y(p):(t.var(d,!0),y(p),t.if(d))}function h(p){for(const b in u)new RegExp(p).test(b)&&(0,HE.checkStrictMode)(i,`property ${b} matches pattern ${p} (use allowMatchingProperties)`)}function y(p){t.forIn("key",r,b=>{t.if((0,Rf._)`${(0,qE.usePattern)(e,p)}.test(${b})`,()=>{const g=l.includes(p);g||e.subschema({keyword:"patternProperties",schemaProp:p,dataProp:b,dataPropType:BE.Type.Str},d),i.opts.unevaluated&&f!==!0?t.assign((0,Rf._)`${f}[${b}]`,!0):!g&&!i.allErrors&&t.if((0,Rf.not)(d),()=>t.break())})})}}};r1.default=Tre;var a1={};Object.defineProperty(a1,"__esModule",{value:!0});const Are=ge,Rre={keyword:"not",schemaType:["object","boolean"],trackErrors:!0,code(e){const{gen:t,schema:n,it:r}=e;if((0,Are.alwaysValidSchema)(r,n)){e.fail();return}const a=t.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"}};a1.default=Rre;var i1={};Object.defineProperty(i1,"__esModule",{value:!0});const $re=qe,Ore={keyword:"anyOf",schemaType:"array",trackErrors:!0,code:$re.validateUnion,error:{message:"must match a schema in anyOf"}};i1.default=Ore;var s1={};Object.defineProperty(s1,"__esModule",{value:!0});const dh=Ue,Mre=ge,Pre={message:"must match exactly one schema in oneOf",params:({params:e})=>(0,dh._)`{passingSchemas: ${e.passing}}`},Dre={keyword:"oneOf",schemaType:"array",trackErrors:!0,error:Pre,code(e){const{gen:t,schema:n,parentSchema:r,it:a}=e;if(!Array.isArray(n))throw new Error("ajv implementation error");if(a.opts.discriminator&&r.discriminator)return;const i=n,s=t.let("valid",!1),o=t.let("passing",null),l=t.name("_valid");e.setParams({passing:o}),t.block(u),e.result(s,()=>e.reset(),()=>e.error(!0));function u(){i.forEach((d,f)=>{let m;(0,Mre.alwaysValidSchema)(a,d)?t.var(l,!0):m=e.subschema({keyword:"oneOf",schemaProp:f,compositeRule:!0},l),f>0&&t.if((0,dh._)`${l} && ${s}`).assign(s,!1).assign(o,(0,dh._)`[${o}, ${f}]`).else(),t.if(l,()=>{t.assign(s,!0),t.assign(o,f),m&&e.mergeEvaluated(m,dh.Name)})})}}};s1.default=Dre;var o1={};Object.defineProperty(o1,"__esModule",{value:!0});const zre=ge,Ire={keyword:"allOf",schemaType:"array",code(e){const{gen:t,schema:n,it:r}=e;if(!Array.isArray(n))throw new Error("ajv implementation error");const a=t.name("valid");n.forEach((i,s)=>{if((0,zre.alwaysValidSchema)(r,i))return;const o=e.subschema({keyword:"allOf",schemaProp:s},a);e.ok(a),e.mergeEvaluated(o)})}};o1.default=Ire;var l1={};Object.defineProperty(l1,"__esModule",{value:!0});const Nm=Ue,CP=ge,Lre={message:({params:e})=>(0,Nm.str)`must match "${e.ifClause}" schema`,params:({params:e})=>(0,Nm._)`{failingKeyword: ${e.ifClause}}`},Ure={keyword:"if",schemaType:["object","boolean"],trackErrors:!0,error:Lre,code(e){const{gen:t,parentSchema:n,it:r}=e;n.then===void 0&&n.else===void 0&&(0,CP.checkStrictMode)(r,'"if" without "then" and "else" is ignored');const a=VE(r,"then"),i=VE(r,"else");if(!a&&!i)return;const s=t.let("valid",!0),o=t.name("_valid");if(l(),e.reset(),a&&i){const d=t.let("ifClause");e.setParams({ifClause:d}),t.if(o,u("then",d),u("else",d))}else a?t.if(o,u("then")):t.if((0,Nm.not)(o),u("else"));e.pass(s,()=>e.error(!0));function l(){const d=e.subschema({keyword:"if",compositeRule:!0,createErrors:!1,allErrors:!1},o);e.mergeEvaluated(d)}function u(d,f){return()=>{const m=e.subschema({keyword:d},o);t.assign(s,o),e.mergeValidEvaluated(m,s),f?t.assign(f,(0,Nm._)`${d}`):e.setParams({ifClause:d})}}}};function VE(e,t){const n=e.schema[t];return n!==void 0&&!(0,CP.alwaysValidSchema)(e,n)}l1.default=Ure;var c1={};Object.defineProperty(c1,"__esModule",{value:!0});const Fre=ge,qre={keyword:["then","else"],schemaType:["object","boolean"],code({keyword:e,parentSchema:t,it:n}){t.if===void 0&&(0,Fre.checkStrictMode)(n,`"${e}" without "if" is ignored`)}};c1.default=qre;Object.defineProperty(Xw,"__esModule",{value:!0});const Hre=Cc,Bre=Ww,Vre=Nc,Kre=Jw,Zre=e1,Gre=kP,Qre=t1,Yre=$p,Xre=n1,Wre=r1,Jre=a1,eae=i1,tae=s1,nae=o1,rae=l1,aae=c1;function iae(e=!1){const t=[Jre.default,eae.default,tae.default,nae.default,rae.default,aae.default,Qre.default,Yre.default,Gre.default,Xre.default,Wre.default];return e?t.push(Bre.default,Kre.default):t.push(Hre.default,Vre.default),t.push(Zre.default),t}Xw.default=iae;var u1={},d1={};Object.defineProperty(d1,"__esModule",{value:!0});const Ft=Ue,sae={message:({schemaCode:e})=>(0,Ft.str)`must match format "${e}"`,params:({schemaCode:e})=>(0,Ft._)`{format: ${e}}`},oae={keyword:"format",type:["number","string"],schemaType:"string",$data:!0,error:sae,code(e,t){const{gen:n,data:r,$data:a,schema:i,schemaCode:s,it:o}=e,{opts:l,errSchemaPath:u,schemaEnv:d,self:f}=o;if(!l.validateFormats)return;a?m():h();function m(){const y=n.scopeValue("formats",{ref:f.formats,code:l.code.formats}),p=n.const("fDef",(0,Ft._)`${y}[${s}]`),b=n.let("fType"),g=n.let("format");n.if((0,Ft._)`typeof ${p} == "object" && !(${p} instanceof RegExp)`,()=>n.assign(b,(0,Ft._)`${p}.type || "string"`).assign(g,(0,Ft._)`${p}.validate`),()=>n.assign(b,(0,Ft._)`"string"`).assign(g,p)),e.fail$data((0,Ft.or)(v(),w()));function v(){return l.strictSchema===!1?Ft.nil:(0,Ft._)`${s} && !${g}`}function w(){const S=d.$async?(0,Ft._)`(${p}.async ? await ${g}(${r}) : ${g}(${r}))`:(0,Ft._)`${g}(${r})`,E=(0,Ft._)`(typeof ${g} == "function" ? ${S} : ${g}.test(${r}))`;return(0,Ft._)`${g} && ${g} !== true && ${b} === ${t} && !${E}`}}function h(){const y=f.formats[i];if(!y){v();return}if(y===!0)return;const[p,b,g]=w(y);p===t&&e.pass(S());function v(){if(l.strictSchema===!1){f.logger.warn(E());return}throw new Error(E());function E(){return`unknown format "${i}" ignored in schema at path "${u}"`}}function w(E){const C=E instanceof RegExp?(0,Ft.regexpCode)(E):l.code.formats?(0,Ft._)`${l.code.formats}${(0,Ft.getProperty)(i)}`:void 0,T=n.scopeValue("formats",{key:i,ref:E,code:C});return typeof E=="object"&&!(E instanceof RegExp)?[E.type||"string",E.validate,(0,Ft._)`${T}.validate`]:["string",E,T]}function S(){if(typeof y=="object"&&!(y instanceof RegExp)&&y.async){if(!d.$async)throw new Error("async format in sync schema");return(0,Ft._)`await ${g}(${r})`}return typeof b=="function"?(0,Ft._)`${g}(${r})`:(0,Ft._)`${g}.test(${r})`}}}};d1.default=oae;Object.defineProperty(u1,"__esModule",{value:!0});const lae=d1,cae=[lae.default];u1.default=cae;var ac={};Object.defineProperty(ac,"__esModule",{value:!0});ac.contentVocabulary=ac.metadataVocabulary=void 0;ac.metadataVocabulary=["title","description","default","deprecated","readOnly","writeOnly","examples"];ac.contentVocabulary=["contentMediaType","contentEncoding","contentSchema"];Object.defineProperty(Dw,"__esModule",{value:!0});const uae=zw,dae=Lw,fae=Xw,hae=u1,KE=ac,mae=[uae.default,dae.default,(0,fae.default)(),hae.default,KE.metadataVocabulary,KE.contentVocabulary];Dw.default=mae;var f1={},Op={};Object.defineProperty(Op,"__esModule",{value:!0});Op.DiscrError=void 0;var ZE;(function(e){e.Tag="tag",e.Mapping="mapping"})(ZE||(Op.DiscrError=ZE={}));Object.defineProperty(f1,"__esModule",{value:!0});const Go=Ue,M0=Op,GE=Wn,pae=kc,gae=ge,yae={message:({params:{discrError:e,tagName:t}})=>e===M0.DiscrError.Tag?`tag "${t}" must be string`:`value of tag "${t}" must be in oneOf`,params:({params:{discrError:e,tag:t,tagName:n}})=>(0,Go._)`{error: ${e}, tag: ${n}, tagValue: ${t}}`},vae={keyword:"discriminator",type:"object",schemaType:"object",error:yae,code(e){const{gen:t,data:n,schema:r,parentSchema:a,it:i}=e,{oneOf:s}=a;if(!i.opts.discriminator)throw new Error("discriminator: requires discriminator option");const o=r.propertyName;if(typeof o!="string")throw new Error("discriminator: requires propertyName");if(r.mapping)throw new Error("discriminator: mapping is not supported");if(!s)throw new Error("discriminator: requires oneOf keyword");const l=t.let("valid",!1),u=t.const("tag",(0,Go._)`${n}${(0,Go.getProperty)(o)}`);t.if((0,Go._)`typeof ${u} == "string"`,()=>d(),()=>e.error(!1,{discrError:M0.DiscrError.Tag,tag:u,tagName:o})),e.ok(l);function d(){const h=m();t.if(!1);for(const y in h)t.elseIf((0,Go._)`${u} === ${y}`),t.assign(l,f(h[y]));t.else(),e.error(!1,{discrError:M0.DiscrError.Mapping,tag:u,tagName:o}),t.endIf()}function f(h){const y=t.name("valid"),p=e.subschema({keyword:"oneOf",schemaProp:h},y);return e.mergeEvaluated(p,Go.Name),y}function m(){var h;const y={},p=g(a);let b=!0;for(let S=0;S<s.length;S++){let E=s[S];if(E!=null&&E.$ref&&!(0,gae.schemaHasRulesButRef)(E,i.self.RULES)){const T=E.$ref;if(E=GE.resolveRef.call(i.self,i.schemaEnv.root,i.baseId,T),E instanceof GE.SchemaEnv&&(E=E.schema),E===void 0)throw new pae.default(i.opts.uriResolver,i.baseId,T)}const C=(h=E==null?void 0:E.properties)===null||h===void 0?void 0:h[o];if(typeof C!="object")throw new Error(`discriminator: oneOf subschemas (or referenced schemas) must have "properties/${o}"`);b=b&&(p||g(E)),v(C,S)}if(!b)throw new Error(`discriminator: "${o}" must be required`);return y;function g({required:S}){return Array.isArray(S)&&S.includes(o)}function v(S,E){if(S.const)w(S.const,E);else if(S.enum)for(const C of S.enum)w(C,E);else throw new Error(`discriminator: "properties/${o}" must have "const" or "enum"`)}function w(S,E){if(typeof S!="string"||S in y)throw new Error(`discriminator: "${o}" values must be unique strings`);y[S]=E}}}};f1.default=vae;const bae="http://json-schema.org/draft-07/schema#",xae="http://json-schema.org/draft-07/schema#",wae="Core schema meta-schema",Sae={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:[]}},_ae=["object","boolean"],kae={$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:"#"}},Eae={$schema:bae,$id:xae,title:wae,definitions:Sae,type:_ae,properties:kae,default:!0};(function(e,t){Object.defineProperty(t,"__esModule",{value:!0}),t.MissingRefError=t.ValidationError=t.CodeGen=t.Name=t.nil=t.stringify=t.str=t._=t.KeywordCxt=t.Ajv=void 0;const n=PM,r=Dw,a=f1,i=Eae,s=["/properties"],o="http://json-schema.org/draft-07/schema";class l extends n.default{_addVocabularies(){super._addVocabularies(),r.default.forEach(y=>this.addVocabulary(y)),this.opts.discriminator&&this.addKeyword(a.default)}_addDefaultMetaSchema(){if(super._addDefaultMetaSchema(),!this.opts.meta)return;const y=this.opts.$data?this.$dataMetaSchema(i,s):i;this.addMetaSchema(y,o,!1),this.refs["http://json-schema.org/schema"]=o}defaultMeta(){return this.opts.defaultMeta=super.defaultMeta()||(this.getSchema(o)?o:void 0)}}t.Ajv=l,e.exports=t=l,e.exports.Ajv=l,Object.defineProperty(t,"__esModule",{value:!0}),t.default=l;var u=jp();Object.defineProperty(t,"KeywordCxt",{enumerable:!0,get:function(){return u.KeywordCxt}});var d=Ue;Object.defineProperty(t,"_",{enumerable:!0,get:function(){return d._}}),Object.defineProperty(t,"str",{enumerable:!0,get:function(){return d.str}}),Object.defineProperty(t,"stringify",{enumerable:!0,get:function(){return d.stringify}}),Object.defineProperty(t,"nil",{enumerable:!0,get:function(){return d.nil}}),Object.defineProperty(t,"Name",{enumerable:!0,get:function(){return d.Name}}),Object.defineProperty(t,"CodeGen",{enumerable:!0,get:function(){return d.CodeGen}});var f=Ld;Object.defineProperty(t,"ValidationError",{enumerable:!0,get:function(){return f.default}});var m=kc;Object.defineProperty(t,"MissingRefError",{enumerable:!0,get:function(){return m.default}})})(C0,C0.exports);var NP=C0.exports;const Cae=ic(NP);var P0={exports:{}},jP={};(function(e){Object.defineProperty(e,"__esModule",{value:!0}),e.formatNames=e.fastFormats=e.fullFormats=void 0;function t(j,O){return{validate:j,compare:O}}e.fullFormats={date:t(i,s),time:t(l(!0),u),"date-time":t(m(!0),h),"iso-time":t(l(),d),"iso-date-time":t(m(),y),duration:/^P(?!$)((\d+Y)?(\d+M)?(\d+D)?(T(?=\d)(\d+H)?(\d+M)?(\d+S)?)?|(\d+W)?)$/,uri:g,"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:$,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:w,int32:{type:"number",validate:C},int64:{type:"number",validate:T},float:{type:"number",validate:P},double:{type:"number",validate:P},password:!0,binary:!0},e.fastFormats={...e.fullFormats,date:t(/^\d\d\d\d-[0-1]\d-[0-3]\d$/,s),time:t(/^(?:[0-2]\d:[0-5]\d:[0-5]\d|23:59:60)(?:\.\d+)?(?:z|[+-]\d\d(?::?\d\d)?)$/i,u),"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,h),"iso-time":t(/^(?:[0-2]\d:[0-5]\d:[0-5]\d|23:59:60)(?:\.\d+)?(?:z|[+-]\d\d(?::?\d\d)?)?$/i,d),"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,y),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(j){return j%4===0&&(j%100!==0||j%400===0)}const r=/^(\d\d\d\d)-(\d\d)-(\d\d)$/,a=[0,31,28,31,30,31,30,31,31,30,31,30,31];function i(j){const O=r.exec(j);if(!O)return!1;const z=+O[1],D=+O[2],A=+O[3];return D>=1&&D<=12&&A>=1&&A<=(D===2&&n(z)?29:a[D])}function s(j,O){if(j&&O)return j>O?1:j<O?-1:0}const o=/^(\d\d):(\d\d):(\d\d(?:\.\d+)?)(z|([+-])(\d\d)(?::?(\d\d))?)?$/i;function l(j){return function(z){const D=o.exec(z);if(!D)return!1;const A=+D[1],B=+D[2],Z=+D[3],F=D[4],J=D[5]==="-"?-1:1,N=+(D[6]||0),q=+(D[7]||0);if(N>23||q>59||j&&!F)return!1;if(A<=23&&B<=59&&Z<60)return!0;const G=B-q*J,_=A-N*J-(G<0?1:0);return(_===23||_===-1)&&(G===59||G===-1)&&Z<61}}function u(j,O){if(!(j&&O))return;const z=new Date("2020-01-01T"+j).valueOf(),D=new Date("2020-01-01T"+O).valueOf();if(z&&D)return z-D}function d(j,O){if(!(j&&O))return;const z=o.exec(j),D=o.exec(O);if(z&&D)return j=z[1]+z[2]+z[3],O=D[1]+D[2]+D[3],j>O?1:j<O?-1:0}const f=/t|\s/i;function m(j){const O=l(j);return function(D){const A=D.split(f);return A.length===2&&i(A[0])&&O(A[1])}}function h(j,O){if(!(j&&O))return;const z=new Date(j).valueOf(),D=new Date(O).valueOf();if(z&&D)return z-D}function y(j,O){if(!(j&&O))return;const[z,D]=j.split(f),[A,B]=O.split(f),Z=s(z,A);if(Z!==void 0)return Z||u(D,B)}const p=/\/|:/,b=/^(?:[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 g(j){return p.test(j)&&b.test(j)}const v=/^(?:[A-Za-z0-9+/]{4})*(?:[A-Za-z0-9+/]{2}==|[A-Za-z0-9+/]{3}=)?$/gm;function w(j){return v.lastIndex=0,v.test(j)}const S=-2147483648,E=2**31-1;function C(j){return Number.isInteger(j)&&j<=E&&j>=S}function T(j){return Number.isInteger(j)}function P(){return!0}const R=/[^\\]\\Z/;function $(j){if(R.test(j))return!1;try{return new RegExp(j),!0}catch{return!1}}})(jP);var TP={};(function(e){Object.defineProperty(e,"__esModule",{value:!0}),e.formatLimitDefinition=void 0;const t=NP,n=Ue,r=n.operators,a={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}},i={message:({keyword:o,schemaCode:l})=>(0,n.str)`should be ${a[o].okStr} ${l}`,params:({keyword:o,schemaCode:l})=>(0,n._)`{comparison: ${a[o].okStr}, limit: ${l}}`};e.formatLimitDefinition={keyword:Object.keys(a),type:"string",schemaType:"string",$data:!0,error:i,code(o){const{gen:l,data:u,schemaCode:d,keyword:f,it:m}=o,{opts:h,self:y}=m;if(!h.validateFormats)return;const p=new t.KeywordCxt(m,y.RULES.all.format.definition,"format");p.$data?b():g();function b(){const w=l.scopeValue("formats",{ref:y.formats,code:h.code.formats}),S=l.const("fmt",(0,n._)`${w}[${p.schemaCode}]`);o.fail$data((0,n.or)((0,n._)`typeof ${S} != "object"`,(0,n._)`${S} instanceof RegExp`,(0,n._)`typeof ${S}.compare != "function"`,v(S)))}function g(){const w=p.schema,S=y.formats[w];if(!S||S===!0)return;if(typeof S!="object"||S instanceof RegExp||typeof S.compare!="function")throw new Error(`"${f}": format "${w}" does not define "compare" function`);const E=l.scopeValue("formats",{key:w,ref:S,code:h.code.formats?(0,n._)`${h.code.formats}${(0,n.getProperty)(w)}`:void 0});o.fail$data(v(E))}function v(w){return(0,n._)`${w}.compare(${u}, ${d}) ${a[f].fail} 0`}},dependencies:["format"]};const s=o=>(o.addKeyword(e.formatLimitDefinition),o);e.default=s})(TP);(function(e,t){Object.defineProperty(t,"__esModule",{value:!0});const n=jP,r=TP,a=Ue,i=new a.Name("fullFormats"),s=new a.Name("fastFormats"),o=(u,d={keywords:!0})=>{if(Array.isArray(d))return l(u,d,n.fullFormats,i),u;const[f,m]=d.mode==="fast"?[n.fastFormats,s]:[n.fullFormats,i],h=d.formats||n.formatNames;return l(u,h,f,m),d.keywords&&(0,r.default)(u),u};o.get=(u,d="full")=>{const m=(d==="fast"?n.fastFormats:n.fullFormats)[u];if(!m)throw new Error(`Unknown format "${u}"`);return m};function l(u,d,f,m){var h,y;(h=(y=u.opts.code).formats)!==null&&h!==void 0||(y.formats=(0,a._)`require("ajv-formats/dist/formats").${m}`);for(const p of d)u.addFormat(p,f[p])}e.exports=t=o,Object.defineProperty(t,"__esModule",{value:!0}),t.default=o})(P0,P0.exports);var Nae=P0.exports;const jae=ic(Nae);function Tae(){const e=new Cae({strict:!1,validateFormats:!0,validateSchema:!1,allErrors:!0});return jae(e),e}class Aae{constructor(t){this._ajv=t??Tae()}getValidator(t){const n="$id"in t&&typeof t.$id=="string"?this._ajv.getSchema(t.$id)??this._ajv.compile(t):this._ajv.compile(t);return r=>n(r)?{valid:!0,data:r,errorMessage:void 0}:{valid:!1,data:void 0,errorMessage:this._ajv.errorsText(n.errors)}}}class Rae{constructor(t){this._client=t}async*callToolStream(t,n=zd,r){const a=this._client,i={...r,task:(r==null?void 0:r.task)??(a.isToolTask(t.name)?{}:void 0)},s=a.requestStream({method:"tools/call",params:t},n,i),o=a.getToolOutputValidator(t.name);for await(const l of s){if(l.type==="result"&&o){const u=l.result;if(!u.structuredContent&&!u.isError){yield{type:"error",error:new Ne(Oe.InvalidRequest,`Tool ${t.name} has an output schema but did not return structured content`)};return}if(u.structuredContent)try{const d=o(u.structuredContent);if(!d.valid){yield{type:"error",error:new Ne(Oe.InvalidParams,`Structured content does not match the tool's output schema: ${d.errorMessage}`)};return}}catch(d){if(d instanceof Ne){yield{type:"error",error:d};return}yield{type:"error",error:new Ne(Oe.InvalidParams,`Failed to validate structured content: ${d instanceof Error?d.message:String(d)}`)};return}}yield l}}async getTask(t,n){return this._client.getTask({taskId:t},n)}async getTaskResult(t,n,r){return this._client.getTaskResult({taskId:t},n,r)}async listTasks(t,n){return this._client.listTasks(t?{cursor:t}:void 0,n)}async cancelTask(t,n){return this._client.cancelTask({taskId:t},n)}requestStream(t,n,r){return this._client.requestStream(t,n,r)}}function $ae(e,t,n){var r;if(!e)throw new Error(`${n} does not support task creation (required for ${t})`);switch(t){case"tools/call":if(!((r=e.tools)!=null&&r.call))throw new Error(`${n} does not support task creation for tools/call (required for ${t})`);break}}function Oae(e,t,n){var r,a;if(!e)throw new Error(`${n} does not support task creation (required for ${t})`);switch(t){case"sampling/createMessage":if(!((r=e.sampling)!=null&&r.createMessage))throw new Error(`${n} does not support task creation for sampling/createMessage (required for ${t})`);break;case"elicitation/create":if(!((a=e.elicitation)!=null&&a.create))throw new Error(`${n} does not support task creation for elicitation/create (required for ${t})`);break}}function fh(e,t){if(!(!e||t===null||typeof t!="object")){if(e.type==="object"&&e.properties&&typeof e.properties=="object"){const n=t,r=e.properties;for(const a of Object.keys(r)){const i=r[a];n[a]===void 0&&Object.prototype.hasOwnProperty.call(i,"default")&&(n[a]=i.default),n[a]!==void 0&&fh(i,n[a])}}if(Array.isArray(e.anyOf))for(const n of e.anyOf)typeof n!="boolean"&&fh(n,t);if(Array.isArray(e.oneOf))for(const n of e.oneOf)typeof n!="boolean"&&fh(n,t)}}function Mae(e){if(!e)return{supportsFormMode:!1,supportsUrlMode:!1};const t=e.form!==void 0,n=e.url!==void 0;return{supportsFormMode:t||!t&&!n,supportsUrlMode:n}}class Pae extends nee{constructor(t,n){super(n),this._clientInfo=t,this._cachedToolOutputValidators=new Map,this._cachedKnownTaskTools=new Set,this._cachedRequiredTaskTools=new Set,this._listChangedDebounceTimers=new Map,this._capabilities=(n==null?void 0:n.capabilities)??{},this._jsonSchemaValidator=(n==null?void 0:n.jsonSchemaValidator)??new Aae,n!=null&&n.listChanged&&(this._pendingListChangedConfig=n.listChanged)}_setupListChangedHandlers(t){var n,r,a,i,s,o;t.tools&&((r=(n=this._serverCapabilities)==null?void 0:n.tools)!=null&&r.listChanged)&&this._setupListChangedHandler("tools",vM,t.tools,async()=>(await this.listTools()).tools),t.prompts&&((i=(a=this._serverCapabilities)==null?void 0:a.prompts)!=null&&i.listChanged)&&this._setupListChangedHandler("prompts",gM,t.prompts,async()=>(await this.listPrompts()).prompts),t.resources&&((o=(s=this._serverCapabilities)==null?void 0:s.resources)!=null&&o.listChanged)&&this._setupListChangedHandler("resources",pM,t.resources,async()=>(await this.listResources()).resources)}get experimental(){return this._experimental||(this._experimental={tasks:new Rae(this)}),this._experimental}registerCapabilities(t){if(this.transport)throw new Error("Cannot register capabilities after connecting to transport");this._capabilities=ree(this._capabilities,t)}setRequestHandler(t,n){var o;const r=MM(t),a=r==null?void 0:r.method;if(!a)throw new Error("Schema is missing a method literal");let i;if(Np(a)){const l=a,u=(o=l._zod)==null?void 0:o.def;i=(u==null?void 0:u.value)??l.value}else{const l=a,u=l._def;i=(u==null?void 0:u.value)??l.value}if(typeof i!="string")throw new Error("Schema method literal must be a string");const s=i;if(s==="elicitation/create"){const l=async(u,d)=>{var w,S;const f=Ai(_M,u);if(!f.success){const E=f.error instanceof Error?f.error.message:String(f.error);throw new Ne(Oe.InvalidParams,`Invalid elicitation request: ${E}`)}const{params:m}=f.data;m.mode=m.mode??"form";const{supportsFormMode:h,supportsUrlMode:y}=Mae(this._capabilities.elicitation);if(m.mode==="form"&&!h)throw new Ne(Oe.InvalidParams,"Client does not support form-mode elicitation requests");if(m.mode==="url"&&!y)throw new Ne(Oe.InvalidParams,"Client does not support URL-mode elicitation requests");const p=await Promise.resolve(n(u,d));if(m.task){const E=Ai(Ju,p);if(!E.success){const C=E.error instanceof Error?E.error.message:String(E.error);throw new Ne(Oe.InvalidParams,`Invalid task creation result: ${C}`)}return E.data}const b=Ai(kM,p);if(!b.success){const E=b.error instanceof Error?b.error.message:String(b.error);throw new Ne(Oe.InvalidParams,`Invalid elicitation result: ${E}`)}const g=b.data,v=m.mode==="form"?m.requestedSchema:void 0;if(m.mode==="form"&&g.action==="accept"&&g.content&&v&&(S=(w=this._capabilities.elicitation)==null?void 0:w.form)!=null&&S.applyDefaults)try{fh(v,g.content)}catch{}return g};return super.setRequestHandler(t,l)}if(s==="sampling/createMessage"){const l=async(u,d)=>{const f=Ai(xM,u);if(!f.success){const g=f.error instanceof Error?f.error.message:String(f.error);throw new Ne(Oe.InvalidParams,`Invalid sampling request: ${g}`)}const{params:m}=f.data,h=await Promise.resolve(n(u,d));if(m.task){const g=Ai(Ju,h);if(!g.success){const v=g.error instanceof Error?g.error.message:String(g.error);throw new Ne(Oe.InvalidParams,`Invalid task creation result: ${v}`)}return g.data}const p=m.tools||m.toolChoice?SM:wM,b=Ai(p,h);if(!b.success){const g=b.error instanceof Error?b.error.message:String(b.error);throw new Ne(Oe.InvalidParams,`Invalid sampling result: ${g}`)}return b.data};return super.setRequestHandler(t,l)}return super.setRequestHandler(t,n)}assertCapability(t,n){var r;if(!((r=this._serverCapabilities)!=null&&r[t]))throw new Error(`Server does not support ${t} (required for ${n})`)}async connect(t,n){if(await super.connect(t),t.sessionId===void 0)try{const r=await this.request({method:"initialize",params:{protocolVersion:kp,capabilities:this._capabilities,clientInfo:this._clientInfo}},lM,n);if(r===void 0)throw new Error(`Server sent invalid initialize result: ${r}`);if(!MX.includes(r.protocolVersion))throw new Error(`Server's protocol version is not supported: ${r.protocolVersion}`);this._serverCapabilities=r.capabilities,this._serverVersion=r.serverInfo,t.setProtocolVersion&&t.setProtocolVersion(r.protocolVersion),this._instructions=r.instructions,await this.notification({method:"notifications/initialized"}),this._pendingListChangedConfig&&(this._setupListChangedHandlers(this._pendingListChangedConfig),this._pendingListChangedConfig=void 0)}catch(r){throw this.close(),r}}getServerCapabilities(){return this._serverCapabilities}getServerVersion(){return this._serverVersion}getInstructions(){return this._instructions}assertCapabilityForMethod(t){var n,r,a,i,s;switch(t){case"logging/setLevel":if(!((n=this._serverCapabilities)!=null&&n.logging))throw new Error(`Server does not support logging (required for ${t})`);break;case"prompts/get":case"prompts/list":if(!((r=this._serverCapabilities)!=null&&r.prompts))throw new Error(`Server does not support prompts (required for ${t})`);break;case"resources/list":case"resources/templates/list":case"resources/read":case"resources/subscribe":case"resources/unsubscribe":if(!((a=this._serverCapabilities)!=null&&a.resources))throw new Error(`Server does not support resources (required for ${t})`);if(t==="resources/subscribe"&&!this._serverCapabilities.resources.subscribe)throw new Error(`Server does not support resource subscriptions (required for ${t})`);break;case"tools/call":case"tools/list":if(!((i=this._serverCapabilities)!=null&&i.tools))throw new Error(`Server does not support tools (required for ${t})`);break;case"completion/complete":if(!((s=this._serverCapabilities)!=null&&s.completions))throw new Error(`Server does not support completions (required for ${t})`);break}}assertNotificationCapability(t){var n;switch(t){case"notifications/roots/list_changed":if(!((n=this._capabilities.roots)!=null&&n.listChanged))throw new Error(`Client does not support roots list changed notifications (required for ${t})`);break}}assertRequestHandlerCapability(t){if(this._capabilities)switch(t){case"sampling/createMessage":if(!this._capabilities.sampling)throw new Error(`Client does not support sampling capability (required for ${t})`);break;case"elicitation/create":if(!this._capabilities.elicitation)throw new Error(`Client does not support elicitation capability (required for ${t})`);break;case"roots/list":if(!this._capabilities.roots)throw new Error(`Client does not support roots capability (required for ${t})`);break;case"tasks/get":case"tasks/list":case"tasks/result":case"tasks/cancel":if(!this._capabilities.tasks)throw new Error(`Client does not support tasks capability (required for ${t})`);break}}assertTaskCapability(t){var n,r;$ae((r=(n=this._serverCapabilities)==null?void 0:n.tasks)==null?void 0:r.requests,t,"Server")}assertTaskHandlerCapability(t){var n;this._capabilities&&Oae((n=this._capabilities.tasks)==null?void 0:n.requests,t,"Client")}async ping(t){return this.request({method:"ping"},ll,t)}async complete(t,n){return this.request({method:"completion/complete",params:t},EM,n)}async setLoggingLevel(t,n){return this.request({method:"logging/setLevel",params:{level:t}},ll,n)}async getPrompt(t,n){return this.request({method:"prompts/get",params:t},pw,n)}async listPrompts(t,n){return this.request({method:"prompts/list",params:t},hm,n)}async listResources(t,n){return this.request({method:"resources/list",params:t},fm,n)}async listResourceTemplates(t,n){return this.request({method:"resources/templates/list",params:t},mM,n)}async readResource(t,n){return this.request({method:"resources/read",params:t},uw,n)}async subscribeResource(t,n){return this.request({method:"resources/subscribe",params:t},ll,n)}async unsubscribeResource(t,n){return this.request({method:"resources/unsubscribe",params:t},ll,n)}async callTool(t,n=zd,r){if(this.isToolTaskRequired(t.name))throw new Ne(Oe.InvalidRequest,`Tool "${t.name}" requires task-based execution. Use client.experimental.tasks.callToolStream() instead.`);const a=await this.request({method:"tools/call",params:t},n,r),i=this.getToolOutputValidator(t.name);if(i){if(!a.structuredContent&&!a.isError)throw new Ne(Oe.InvalidRequest,`Tool ${t.name} has an output schema but did not return structured content`);if(a.structuredContent)try{const s=i(a.structuredContent);if(!s.valid)throw new Ne(Oe.InvalidParams,`Structured content does not match the tool's output schema: ${s.errorMessage}`)}catch(s){throw s instanceof Ne?s:new Ne(Oe.InvalidParams,`Failed to validate structured content: ${s instanceof Error?s.message:String(s)}`)}}return a}isToolTask(t){var n,r,a,i;return(i=(a=(r=(n=this._serverCapabilities)==null?void 0:n.tasks)==null?void 0:r.requests)==null?void 0:a.tools)!=null&&i.call?this._cachedKnownTaskTools.has(t):!1}isToolTaskRequired(t){return this._cachedRequiredTaskTools.has(t)}cacheToolMetadata(t){var n;this._cachedToolOutputValidators.clear(),this._cachedKnownTaskTools.clear(),this._cachedRequiredTaskTools.clear();for(const r of t){if(r.outputSchema){const i=this._jsonSchemaValidator.getValidator(r.outputSchema);this._cachedToolOutputValidators.set(r.name,i)}const a=(n=r.execution)==null?void 0:n.taskSupport;(a==="required"||a==="optional")&&this._cachedKnownTaskTools.add(r.name),a==="required"&&this._cachedRequiredTaskTools.add(r.name)}}getToolOutputValidator(t){return this._cachedToolOutputValidators.get(t)}async listTools(t,n){const r=await this.request({method:"tools/list",params:t},gw,n);return this.cacheToolMetadata(r.tools),r}_setupListChangedHandler(t,n,r,a){const i=jW.safeParse(r);if(!i.success)throw new Error(`Invalid ${t} listChanged options: ${i.error.message}`);if(typeof r.onChanged!="function")throw new Error(`Invalid ${t} listChanged options: onChanged must be a function`);const{autoRefresh:s,debounceMs:o}=i.data,{onChanged:l}=r,u=async()=>{if(!s){l(null,null);return}try{const f=await a();l(null,f)}catch(f){const m=f instanceof Error?f:new Error(String(f));l(m,null)}},d=()=>{if(o){const f=this._listChangedDebounceTimers.get(t);f&&clearTimeout(f);const m=setTimeout(u,o);this._listChangedDebounceTimers.set(t,m)}else u()};this.setNotificationHandler(n,d)}async sendRootsListChanged(){return this.notification({method:"notifications/roots/list_changed"})}}function Bc(e,t){if(!e)throw new Error(t)}var QE=3e3,Dae=5e3,dy=5*60*1e3;function zae(e){const{url:t,clientName:n,clientUri:r,callbackUrl:a=typeof window<"u"?ol(new URL("/oauth/callback",window.location.origin).toString()):"/oauth/callback",storageKeyPrefix:i="mcp:auth",clientConfig:s={},customHeaders:o={},autoRetry:l=!1,autoReconnect:u=QE,transportType:d="auto",preventAutoAuth:f=!1,onPopupWindow:m}=e,[h,y]=x.useState("discovering"),[p,b]=x.useState([]),[g,v]=x.useState([]),[w,S]=x.useState([]),[E,C]=x.useState([]),[T,P]=x.useState(void 0),[R,$]=x.useState([]),[j,O]=x.useState(void 0),z=x.useRef(null),D=x.useRef(null),A=x.useRef(null),B=x.useRef(!1),Z=x.useRef(!0),F=x.useRef(0),J=x.useRef(null),N=x.useRef(h),q=x.useRef(u),G=x.useRef(null);x.useEffect(()=>{N.current=h,q.current=u},[h,u]);const _=x.useCallback((K,re,...ae)=>{const Ae=ae.length>0?`${re} ${ae.map(ce=>JSON.stringify(ce)).join(" ")}`:re;console[K](`[useMcp] ${Ae}`),Z.current&&$(ce=>[...ce.slice(-100),{level:K,message:Ae,timestamp:Date.now()}])},[]),k=x.useCallback(async(K=!1)=>{K||_("info","Disconnecting..."),B.current=!1,J.current&&clearTimeout(J.current),J.current=null;const re=D.current;if(z.current=null,D.current=null,Z.current&&!K&&(y("discovering"),b([]),v([]),S([]),C([]),P(void 0),O(void 0)),re)try{await re.close(),K||_("debug","Transport closed")}catch(ae){K||_("warn","Error closing transport:",ae)}},[_]),M=x.useCallback((K,re)=>{var ae;if(_("error",K,re??""),Z.current){y("failed"),P(K);const Ae=(ae=A.current)==null?void 0:ae.getLastAttemptedAuthUrl();Ae&&(O(Ae),_("info","Manual authentication URL may be available.",Ae))}B.current=!1},[_]),I=x.useCallback(async()=>{if(B.current){_("debug","Connection attempt already in progress.");return}if(!Z.current){_("debug","Connect called after unmount, aborting.");return}B.current=!0,F.current+=1,P(void 0),O(void 0),G.current=null,y("discovering"),_("info",`Connecting attempt #${F.current} to ${t}...`),A.current||(A.current=new Yk(t,{storageKeyPrefix:i,clientName:n,clientUri:r,callbackUrl:a,preventAutoAuth:f,onPopupWindow:m}),_("debug","BrowserOAuthClientProvider initialized in connect.")),z.current||(z.current=new Pae({name:s.name||"use-mcp-react-client",version:s.version||"0.1.0"},{capabilities:{}}),_("debug","MCP Client initialized in connect."));const K=async ae=>{_("info",`Attempting connection with ${ae.toUpperCase()} transport...`),N.current!=="authenticating"&&y("connecting");let Ae;try{Bc(A.current,"Auth Provider must be initialized"),Bc(z.current,"Client must be initialized"),D.current&&(await D.current.close().catch(ht=>_("warn",`Error closing previous transport: ${ht.message}`)),D.current=null);const ce={authProvider:A.current,requestInit:{headers:{Accept:"application/json, text/event-stream",...o}}},we=ol(t),Ce=new URL(we);_("debug",`Creating ${ae.toUpperCase()} transport for URL: ${Ce.toString()}`),_("debug","Transport options:",{authProvider:!!A.current,headers:o,url:Ce.toString()}),ae==="http"?(_("debug","Creating StreamableHTTPClientTransport..."),Ae=new JJ(Ce,ce),_("debug","StreamableHTTPClientTransport created successfully")):(_("debug","Creating SSEClientTransport..."),Ae=new YJ(Ce,ce),_("debug","SSEClientTransport created successfully")),D.current=Ae,_("debug",`${ae.toUpperCase()} transport created and assigned to ref.`)}catch(ce){return M(`Failed to create ${ae.toUpperCase()} transport: ${ce instanceof Error?ce.message:String(ce)}`,ce instanceof Error?ce:void 0),"failed"}Ae.onmessage=ce=>{var we,Ce;_("debug",`[Transport] Received: ${JSON.stringify(ce)}`),(Ce=(we=z.current)==null?void 0:we.handleMessage)==null||Ce.call(we,ce)},Ae.onerror=ce=>{_("warn",`Transport error event (${ae.toUpperCase()}):`,ce),_("debug","Error details:",{message:ce.message,stack:ce.stack,name:ce.name,cause:ce.cause}),M(`Transport error (${ae.toUpperCase()}): ${ce.message}`,ce)},Ae.onclose=()=>{if(!Z.current||B.current)return;_("info",`Transport connection closed (${G.current||"unknown"} type).`);const ce=N.current,we=q.current;if(ce==="ready"&&we){const Ce=typeof we=="number"?we:QE;_("info",`Attempting to reconnect in ${Ce}ms...`),y("connecting"),setTimeout(()=>{Z.current&&I()},Ce)}else ce!=="failed"&&ce!=="authenticating"&&M("Connection closed unexpectedly.")};try{_("info",`Connecting client via ${ae.toUpperCase()}...`),_("debug","About to call client.connect() with transport instance"),_("debug",`Transport instance type: ${Ae.constructor.name}`),await z.current.connect(Ae),_("info",`Client connected via ${ae.toUpperCase()}. Loading tools, resources, and prompts...`),G.current=ae,y("loading");const ce=await z.current.request({method:"tools/list"},gw);let we={resources:[],resourceTemplates:[]};try{we=await z.current.request({method:"resources/list"},fm)}catch(ht){_("debug","Server does not support resources/list method",ht)}let Ce={prompts:[]};try{Ce=await z.current.request({method:"prompts/list"},hm)}catch(ht){_("debug","Server does not support prompts/list method",ht)}if(Z.current){b(ce.tools),v(we.resources),S(Array.isArray(we.resourceTemplates)?we.resourceTemplates:[]),C(Ce.prompts);const ht=[`Loaded ${ce.tools.length} tools`];return(we.resources.length>0||we.resourceTemplates&&we.resourceTemplates.length>0)&&(ht.push(`${we.resources.length} resources`),Array.isArray(we.resourceTemplates)&&we.resourceTemplates.length>0&&ht.push(`${we.resourceTemplates.length} resource templates`)),Ce.prompts.length>0&&ht.push(`${Ce.prompts.length} prompts`),_("info",ht.join(", ")+"."),y("ready"),F.current=0,"success"}else return"failed"}catch(ce){_("debug",`Client connect error via ${ae.toUpperCase()}:`,ce),_("debug","Connect error details:",{message:ce instanceof Error?ce.message:String(ce),stack:ce instanceof Error?ce.stack:"N/A",name:ce instanceof Error?ce.name:"Unknown",cause:ce instanceof Error?ce.cause:void 0});const we=ce instanceof Error?ce:new Error(String(ce)),Ce=we.message,ht=Ce.includes("404")||Ce.includes("Not Found"),Ut=Ce.includes("405")||Ce.includes("Method Not Allowed"),gt=Ce==="Failed to fetch"||Ce==="NetworkError when attempting to fetch resource."||Ce==="Load failed";if(ae==="http"&&(ht||Ut||gt))return _("warn",`HTTP transport failed (${gt?"CORS":ht?"404":"405"}).`),"fallback";if(we instanceof cr||Ce.includes("Unauthorized")||Ce.includes("401")){_("info","Authentication required."),Bc(A.current,"Auth Provider not available for auth flow");const ar=await A.current.tokens();if(f&&!ar)return _("info","Authentication required but auto-auth prevented. User action needed."),y("pending_auth"),"auth_redirect";N.current!=="authenticating"&&N.current!=="pending_auth"&&(y("authenticating"),J.current&&clearTimeout(J.current),J.current=setTimeout(()=>{},dy));try{const Y=await Jr(A.current,{serverUrl:t});if(!Z.current)return"failed";if(Y==="AUTHORIZED")return _("info","Authentication successful via existing token or refresh. Re-attempting connection..."),J.current&&clearTimeout(J.current),B.current=!1,I(),"failed";if(Y==="REDIRECT")return _("info","Redirecting for authentication. Waiting for callback..."),"auth_redirect"}catch(Y){return Z.current&&(J.current&&clearTimeout(J.current),M(`Failed to initiate authentication: ${Y instanceof Error?Y.message:String(Y)}`,Y instanceof Error?Y:void 0)),"failed"}}return M(`Failed to connect via ${ae.toUpperCase()}: ${Ce}`,we),"failed"}};let re="failed";if(console.log({transportType:d}),d==="sse")_("debug","Using SSE-only transport mode"),re=await K("sse");else if(d==="http")_("debug","Using HTTP-only transport mode"),re=await K("http");else{_("debug","Using auto transport mode (HTTP with SSE fallback)");const ae=await K("http");if(ae==="fallback"&&Z.current&&N.current!=="authenticating"){_("info","HTTP failed, attempting SSE fallback...");const Ae=await K("sse");re=Ae,Ae==="failed"&&Z.current}else re=ae}(re==="success"||re==="failed")&&(B.current=!1),_("debug",`Connection sequence finished with status: ${re}`)},[_,M,k,Jr,t,i,n,r,a,s.name,s.version]),Q=x.useCallback(async(K,re)=>{if(N.current!=="ready"||!z.current)throw new Error(`MCP client is not ready (current state: ${h}). Cannot call tool "${K}".`);_("info",`Calling tool: ${K}`,re);try{const ae=await z.current.request({method:"tools/call",params:{name:K,arguments:re}},zd);return _("info",`Tool "${K}" call successful:`,ae),ae}catch(ae){_("error",`Error calling tool "${K}": ${ae instanceof Error?ae.message:String(ae)}`,ae);const Ae=ae instanceof Error?ae:new Error(String(ae));if(Ae instanceof cr||Ae.message.includes("Unauthorized")||Ae.message.includes("401")){_("warn","Tool call unauthorized, attempting re-authentication..."),y("authenticating"),J.current&&clearTimeout(J.current),J.current=setTimeout(()=>{},dy);try{Bc(A.current,"Auth Provider not available for tool re-auth");const ce=await Jr(A.current,{serverUrl:t});if(!Z.current)return;ce==="AUTHORIZED"?(_("info","Re-authentication successful. Retrying tool call is recommended, or reconnecting."),J.current&&clearTimeout(J.current),B.current=!1,I()):ce==="REDIRECT"&&_("info","Redirecting for re-authentication for tool call.")}catch(ce){if(!Z.current)return;J.current&&clearTimeout(J.current),M(`Re-authentication failed: ${ce instanceof Error?ce.message:String(ce)}`,ce instanceof Error?ce:void 0)}}if(N.current!=="authenticating")throw ae;return}},[h,t,_,M,I]),W=x.useCallback(()=>{N.current==="failed"?(_("info","Retry requested..."),I()):_("warn",`Retry called but state is not 'failed' (state: ${N.current}). Ignoring.`)},[_,I]),oe=x.useCallback(async()=>{var re;_("info","Manual authentication requested...");const K=N.current;if(K==="failed")_("info","Attempting to reconnect and authenticate via retry..."),W();else if(K==="pending_auth"){_("info","Proceeding with authentication from pending state..."),y("authenticating"),J.current&&clearTimeout(J.current),J.current=setTimeout(()=>{},dy);try{Bc(A.current,"Auth Provider not available for manual auth");const ae=await Jr(A.current,{serverUrl:t});if(!Z.current)return;ae==="AUTHORIZED"?(_("info","Manual authentication successful. Re-attempting connection..."),J.current&&clearTimeout(J.current),B.current=!1,I()):ae==="REDIRECT"&&_("info","Redirecting for manual authentication. Waiting for callback...")}catch(ae){if(!Z.current)return;J.current&&clearTimeout(J.current),M(`Manual authentication failed: ${ae instanceof Error?ae.message:String(ae)}`,ae instanceof Error?ae:void 0)}}else if(K==="authenticating"){_("warn","Already attempting authentication. Check for blocked popups or wait for timeout.");const ae=(re=A.current)==null?void 0:re.getLastAttemptedAuthUrl();ae&&!j&&(O(ae),_("info","Manual authentication URL retrieved:",ae))}else _("info",`Client not in a state requiring manual authentication trigger (state: ${K}). If needed, try disconnecting and reconnecting.`)},[_,W,j,t,M,I]),de=x.useCallback(()=>{if(A.current){const K=A.current.clearStorage();_("info",`Cleared ${K} item(s) from localStorage for ${t}.`),O(void 0),k()}else _("warn","Auth provider not initialized, cannot clear storage.")},[t,_,k]),L=x.useCallback(async()=>{if(N.current!=="ready"||!z.current)throw new Error(`MCP client is not ready (current state: ${h}). Cannot list resources.`);_("info","Listing resources...");try{const K=await z.current.request({method:"resources/list"},fm);Z.current&&(v(K.resources),S(Array.isArray(K.resourceTemplates)?K.resourceTemplates:[]),_("info",`Listed ${K.resources.length} resources, ${Array.isArray(K.resourceTemplates)?K.resourceTemplates.length:0} resource templates.`))}catch(K){throw _("error",`Error listing resources: ${K instanceof Error?K.message:String(K)}`,K),K}},[h,_]),V=x.useCallback(async K=>{if(N.current!=="ready"||!z.current)throw new Error(`MCP client is not ready (current state: ${h}). Cannot read resource "${K}".`);_("info",`Reading resource: ${K}`);try{const re=await z.current.request({method:"resources/read",params:{uri:K}},uw);return _("info",`Resource "${K}" read successfully`),re}catch(re){throw _("error",`Error reading resource "${K}": ${re instanceof Error?re.message:String(re)}`,re),re}},[h,_]),X=x.useCallback(async()=>{if(N.current!=="ready"||!z.current)throw new Error(`MCP client is not ready (current state: ${h}). Cannot list prompts.`);_("info","Listing prompts...");try{const K=await z.current.request({method:"prompts/list"},hm);Z.current&&(C(K.prompts),_("info",`Listed ${K.prompts.length} prompts.`))}catch(K){throw _("error",`Error listing prompts: ${K instanceof Error?K.message:String(K)}`,K),K}},[h,_]),ne=x.useCallback(async(K,re)=>{if(N.current!=="ready"||!z.current)throw new Error(`MCP client is not ready (current state: ${h}). Cannot get prompt "${K}".`);_("info",`Getting prompt: ${K}`,re);try{const ae=await z.current.request({method:"prompts/get",params:{name:K,arguments:re}},pw);return _("info",`Prompt "${K}" retrieved successfully`),ae}catch(ae){throw _("error",`Error getting prompt "${K}": ${ae instanceof Error?ae.message:String(ae)}`,ae),ae}},[h,_]);return x.useEffect(()=>{const K=re=>{var ae;re.origin===window.location.origin&&((ae=re.data)==null?void 0:ae.type)==="mcp_auth_callback"&&(_("info","Received auth callback message.",re.data),J.current&&clearTimeout(J.current),re.data.success?(_("info","Authentication successful via popup. Reconnecting client..."),B.current=!1,I()):M(`Authentication failed in callback: ${re.data.error||"Unknown reason."}`))};return window.addEventListener("message",K),_("debug","Auth callback message listener added."),()=>{window.removeEventListener("message",K),_("debug","Auth callback message listener removed."),J.current&&clearTimeout(J.current)}},[_,M,I]),x.useEffect(()=>(Z.current=!0,_("debug","useMcp mounted, initiating connection."),F.current=0,(!A.current||A.current.serverUrl!==t)&&(A.current=new Yk(t,{storageKeyPrefix:i,clientName:n,clientUri:r,callbackUrl:a,preventAutoAuth:f,onPopupWindow:m}),_("debug","BrowserOAuthClientProvider initialized/updated on mount/option change.")),I(),()=>{Z.current=!1,_("debug","useMcp unmounting, disconnecting."),k(!0)}),[t,i,a,n,r,s.name,s.version,I,k]),x.useEffect(()=>{let K=null;if(h==="failed"&&l&&F.current>0){const re=typeof l=="number"?l:Dae;_("info",`Connection failed, auto-retrying in ${re}ms...`),K=setTimeout(()=>{Z.current&&N.current==="failed"&&W()},re)}return()=>{K&&clearTimeout(K)}},[h,l,W,_]),{state:h,tools:p,resources:g,resourceTemplates:w,prompts:E,error:T,log:R,authUrl:j,callTool:Q,listResources:L,readResource:V,listPrompts:X,getPrompt:ne,retry:W,disconnect:k,authenticate:oe,clearStorage:de}}function Iae({service:e,autoConnect:t=!1,onConnected:n,onError:r}){const{toast:a}=nn(),{state:i,tools:s,resources:o,prompts:l,error:u,authUrl:d,callTool:f,readResource:m,listResources:h,getPrompt:y,listPrompts:p,retry:b,disconnect:g,authenticate:v,clearStorage:w}=zae({url:e.url,clientName:"AgentDeck",clientUri:window.location.origin,callbackUrl:`${window.location.origin}/oauth/callback`,storageKeyPrefix:`mcp:auth:${e.id}`,autoRetry:3,autoReconnect:5e3,transportType:"auto",preventAutoAuth:!t}),S=i==="ready",E=i==="connecting"||i==="loading",C=i==="authenticating"||i==="pending_auth",T=i==="failed";return ca.useEffect(()=>{S&&n&&(n(),a({title:"Connected to MCP service",description:`Successfully connected to ${e.name}`}))},[S,n,e.name,a]),ca.useEffect(()=>{T&&u&&r&&(r(u),a({title:"MCP connection failed",description:u,variant:"destructive"}))},[T,u,r,a]),{isConnected:S,isConnecting:E,isAuthenticating:C,hasError:T,error:u,tools:s,resources:o,prompts:l,connect:()=>{b()},disconnect:g,retry:b,authenticate:v,callTool:async(z,D)=>{try{return await f(z,D)}catch(A){const B=A instanceof Error?A.message:"Unknown error";throw a({title:"Tool call failed",description:B,variant:"destructive"}),A}},readResource:async z=>{try{return await m(z)}catch(D){const A=D instanceof Error?D.message:"Unknown error";throw a({title:"Resource read failed",description:A,variant:"destructive"}),D}},listResources:async()=>{try{await h()}catch(z){const D=z instanceof Error?z.message:"Unknown error";throw a({title:"Resource listing failed",description:D,variant:"destructive"}),z}},getPrompt:async(z,D)=>{try{return await y(z,D)}catch(A){const B=A instanceof Error?A.message:"Unknown error";throw a({title:"Prompt retrieval failed",description:B,variant:"destructive"}),A}},listPrompts:async()=>{try{await p()}catch(z){const D=z instanceof Error?z.message:"Unknown error";throw a({title:"Prompt listing failed",description:D,variant:"destructive"}),z}},authUrl:d,clearStorage:w}}function Lae(){const[e,t]=x.useState("https://api.githubcopilot.com/mcp"),[n,r]=x.useState("get_me"),[a,i]=x.useState("{}"),[s,o]=x.useState(""),l={id:"test-mcp-service",name:"Test MCP Service",url:e,registeredAt:new Date().toISOString(),updatedAt:new Date().toISOString()},{isConnected:u,isConnecting:d,isAuthenticating:f,hasError:m,error:h,tools:y,resources:p,prompts:b,connect:g,disconnect:v,retry:w,authenticate:S,callTool:E,authUrl:C,clearStorage:T}=Iae({service:l,autoConnect:!1,onConnected:()=>{console.log("Connected to test MCP service")},onError:j=>{console.error("Test MCP service error:",j)}}),R=d?{status:"connecting",icon:v_,color:"text-yellow-500"}:f?{status:"authenticating",icon:lf,color:"text-blue-500"}:u?{status:"connected",icon:Cv,color:"text-green-500"}:m?{status:"error",icon:g_,color:"text-red-500"}:{status:"disconnected",icon:g_,color:"text-gray-500"},$=async()=>{try{let j={};a.trim()&&(j=JSON.parse(a));const O=await E(n,j);o(JSON.stringify(O,null,2))}catch(j){o(`Error: ${j instanceof Error?j.message:"Unknown error"}`)}};return c.jsxs("div",{className:"container mx-auto p-6 space-y-6",children:[c.jsxs("div",{className:"text-center",children:[c.jsx("h1",{className:"text-3xl font-bold mb-2",children:"use-mcp Integration Test"}),c.jsx("p",{className:"text-muted-foreground",children:"Testing the new use-mcp library integration with OAuth support"})]}),c.jsxs(Fa,{children:[c.jsxs(ji,{children:[c.jsxs(Ti,{className:"flex items-center gap-2",children:[c.jsx(R.icon,{className:`w-5 h-5 ${R.color}`}),"Connection Status: ",R.status]}),c.jsx(_u,{children:"Current connection state and available actions"})]}),c.jsxs(qa,{className:"space-y-4",children:[c.jsxs("div",{className:"flex items-center justify-between",children:[c.jsxs("div",{className:"space-y-1",children:[c.jsx(Qe,{children:"Service URL"}),c.jsx(at,{value:e,onChange:j=>t(j.target.value),placeholder:"Enter MCP service URL"})]}),c.jsxs("div",{className:"flex gap-2",children:[!u&&!d&&c.jsx(le,{onClick:g,children:"Connect"}),u&&c.jsx(le,{onClick:v,variant:"outline",children:"Disconnect"}),m&&c.jsxs(le,{onClick:w,variant:"outline",children:[c.jsx(v_,{className:"w-4 h-4 mr-1"}),"Retry"]}),C&&!u&&c.jsxs(le,{onClick:S,variant:"outline",children:[c.jsx(lf,{className:"w-4 h-4 mr-1"}),"Authenticate"]})]})]}),h&&c.jsxs("div",{className:"flex items-center gap-2 p-3 bg-destructive/10 border border-destructive/20 rounded-md",children:[c.jsx(pT,{className:"w-4 h-4 text-destructive"}),c.jsx("span",{className:"text-sm text-destructive",children:h})]})]})]}),c.jsxs("div",{className:"grid grid-cols-1 md:grid-cols-3 gap-4",children:[c.jsxs(Fa,{children:[c.jsx(ji,{children:c.jsxs(Ti,{className:"flex items-center gap-2",children:[c.jsx(Qb,{className:"w-4 h-4"}),"Tools (",y.length,")"]})}),c.jsx(qa,{children:y.length===0?c.jsx("p",{className:"text-sm text-muted-foreground",children:u?"No tools available":"Connect to see tools"}):c.jsxs("div",{className:"space-y-2",children:[y.slice(0,5).map((j,O)=>c.jsx("div",{className:"text-sm",children:c.jsx(mn,{variant:"outline",className:"text-xs",children:j.name})},O)),y.length>5&&c.jsxs("p",{className:"text-xs text-muted-foreground",children:["+",y.length-5," more tools"]})]})})]}),c.jsxs(Fa,{children:[c.jsx(ji,{children:c.jsxs(Ti,{children:["Resources (",p.length,")"]})}),c.jsx(qa,{children:c.jsx("p",{className:"text-sm text-muted-foreground",children:u?`${p.length} resources available`:"Connect to see resources"})})]}),c.jsxs(Fa,{children:[c.jsx(ji,{children:c.jsxs(Ti,{children:["Prompts (",b.length,")"]})}),c.jsx(qa,{children:c.jsx("p",{className:"text-sm text-muted-foreground",children:u?`${b.length} prompts available`:"Connect to see prompts"})})]})]}),u&&c.jsxs(Fa,{children:[c.jsxs(ji,{children:[c.jsx(Ti,{children:"Test Tool Call"}),c.jsx(_u,{children:"Test calling a tool on the connected MCP service"})]}),c.jsxs(qa,{className:"space-y-4",children:[c.jsxs("div",{className:"grid grid-cols-1 md:grid-cols-2 gap-4",children:[c.jsxs("div",{className:"space-y-2",children:[c.jsx(Qe,{htmlFor:"toolName",children:"Tool Name"}),c.jsx(at,{id:"toolName",value:n,onChange:j=>r(j.target.value),placeholder:"e.g., get_me"})]}),c.jsxs("div",{className:"space-y-2",children:[c.jsx(Qe,{htmlFor:"toolArgs",children:"Arguments (JSON)"}),c.jsx(at,{id:"toolArgs",value:a,onChange:j=>i(j.target.value),placeholder:'{"key": "value"}'})]})]}),c.jsxs(le,{onClick:$,disabled:!u,children:[c.jsx(QI,{className:"w-4 h-4 mr-1"}),"Call Tool"]}),s&&c.jsxs("div",{className:"space-y-2",children:[c.jsx(Qe,{children:"Result"}),c.jsx(Za,{value:s,readOnly:!0,rows:10,className:"font-mono text-sm"})]})]})]}),C&&c.jsxs(Fa,{children:[c.jsxs(ji,{children:[c.jsxs(Ti,{className:"flex items-center gap-2",children:[c.jsx(lf,{className:"w-4 h-4"}),"OAuth Authentication"]}),c.jsx(_u,{children:"This service requires OAuth authentication"})]}),c.jsxs(qa,{className:"space-y-4",children:[c.jsx("div",{className:"p-3 bg-blue-50 border border-blue-200 rounded-md",children:c.jsx("p",{className:"text-sm text-blue-800",children:'This MCP service requires OAuth authentication. Click the "Authenticate" button above to start the OAuth flow.'})}),c.jsxs("div",{className:"flex gap-2",children:[c.jsxs(le,{onClick:S,variant:"outline",children:[c.jsx(lf,{className:"w-4 h-4 mr-1"}),"Start OAuth Flow"]}),c.jsx(le,{onClick:T,variant:"outline",children:"Clear OAuth Data"})]})]})]})]})}function AP(e){return e.before.title!==e.after.title||e.before.body!==e.after.body||e.before.triggers.join(`
490
+ `)!==e.after.triggers.join(`
491
+ `)}class Uae{diff(t,n,r={}){let a;typeof r=="function"?(a=r,r={}):"callback"in r&&(a=r.callback);const i=this.castInput(t,r),s=this.castInput(n,r),o=this.removeEmpty(this.tokenize(i,r)),l=this.removeEmpty(this.tokenize(s,r));return this.diffWithOptionsObj(o,l,r,a)}diffWithOptionsObj(t,n,r,a){var i;const s=v=>{if(v=this.postProcess(v,r),a){setTimeout(function(){a(v)},0);return}else return v},o=n.length,l=t.length;let u=1,d=o+l;r.maxEditLength!=null&&(d=Math.min(d,r.maxEditLength));const f=(i=r.timeout)!==null&&i!==void 0?i:1/0,m=Date.now()+f,h=[{oldPos:-1,lastComponent:void 0}];let y=this.extractCommon(h[0],n,t,0,r);if(h[0].oldPos+1>=l&&y+1>=o)return s(this.buildValues(h[0].lastComponent,n,t));let p=-1/0,b=1/0;const g=()=>{for(let v=Math.max(p,-u);v<=Math.min(b,u);v+=2){let w;const S=h[v-1],E=h[v+1];S&&(h[v-1]=void 0);let C=!1;if(E){const P=E.oldPos-v;C=E&&0<=P&&P<o}const T=S&&S.oldPos+1<l;if(!C&&!T){h[v]=void 0;continue}if(!T||C&&S.oldPos<E.oldPos?w=this.addToPath(E,!0,!1,0,r):w=this.addToPath(S,!1,!0,1,r),y=this.extractCommon(w,n,t,v,r),w.oldPos+1>=l&&y+1>=o)return s(this.buildValues(w.lastComponent,n,t))||!0;h[v]=w,w.oldPos+1>=l&&(b=Math.min(b,v-1)),y+1>=o&&(p=Math.max(p,v+1))}u++};if(a)(function v(){setTimeout(function(){if(u>d||Date.now()>m)return a(void 0);g()||v()},0)})();else for(;u<=d&&Date.now()<=m;){const v=g();if(v)return v}}addToPath(t,n,r,a,i){const s=t.lastComponent;return s&&!i.oneChangePerToken&&s.added===n&&s.removed===r?{oldPos:t.oldPos+a,lastComponent:{count:s.count+1,added:n,removed:r,previousComponent:s.previousComponent}}:{oldPos:t.oldPos+a,lastComponent:{count:1,added:n,removed:r,previousComponent:s}}}extractCommon(t,n,r,a,i){const s=n.length,o=r.length;let l=t.oldPos,u=l-a,d=0;for(;u+1<s&&l+1<o&&this.equals(r[l+1],n[u+1],i);)u++,l++,d++,i.oneChangePerToken&&(t.lastComponent={count:1,previousComponent:t.lastComponent,added:!1,removed:!1});return d&&!i.oneChangePerToken&&(t.lastComponent={count:d,previousComponent:t.lastComponent,added:!1,removed:!1}),t.oldPos=l,u}equals(t,n,r){return r.comparator?r.comparator(t,n):t===n||!!r.ignoreCase&&t.toLowerCase()===n.toLowerCase()}removeEmpty(t){const n=[];for(let r=0;r<t.length;r++)t[r]&&n.push(t[r]);return n}castInput(t,n){return t}tokenize(t,n){return Array.from(t)}join(t){return t.join("")}postProcess(t,n){return t}get useLongestToken(){return!1}buildValues(t,n,r){const a=[];let i;for(;t;)a.push(t),i=t.previousComponent,delete t.previousComponent,t=i;a.reverse();const s=a.length;let o=0,l=0,u=0;for(;o<s;o++){const d=a[o];if(d.removed)d.value=this.join(r.slice(u,u+d.count)),u+=d.count;else{if(!d.added&&this.useLongestToken){let f=n.slice(l,l+d.count);f=f.map(function(m,h){const y=r[u+h];return y.length>m.length?y:m}),d.value=this.join(f)}else d.value=this.join(n.slice(l,l+d.count));l+=d.count,d.added||(u+=d.count)}}return a}}class Fae extends Uae{constructor(){super(...arguments),this.tokenize=Bae}equals(t,n,r){return r.ignoreWhitespace?((!r.newlineIsToken||!t.includes(`
492
+ `))&&(t=t.trim()),(!r.newlineIsToken||!n.includes(`
493
+ `))&&(n=n.trim())):r.ignoreNewlineAtEof&&!r.newlineIsToken&&(t.endsWith(`
494
+ `)&&(t=t.slice(0,-1)),n.endsWith(`
495
+ `)&&(n=n.slice(0,-1))),super.equals(t,n,r)}}const qae=new Fae;function Hae(e,t,n){return qae.diff(e,t,n)}function Bae(e,t){t.stripTrailingCr&&(e=e.replace(/\r\n/g,`
496
+ `));const n=[],r=e.split(/(\n|\r\n)/);r[r.length-1]||r.pop();for(let a=0;a<r.length;a++){const i=r[a];a%2&&!t.newlineIsToken?n[n.length-1]+=i:n.push(i)}return n}const fy=3,Vae=10;function Kae(e){return e===""?[]:e.replace(/\n$/,"").split(`
497
+ `)}function Zae(e,t){const n=Hae(e,t),r=[];let a=1,i=1;for(const s of n){const o=Kae(s.value);if(!s.added&&!s.removed&&o.length>=Vae){const u=o.slice(0,fy),d=o.slice(-fy),f=o.length-fy*2;for(const m of u)r.push({kind:"unchanged",text:m,oldLine:a++,newLine:i++});f>0&&(r.push({kind:"ellipsis",text:`${f} unchanged lines`}),a+=f,i+=f);for(const m of d)r.push({kind:"unchanged",text:m,oldLine:a++,newLine:i++});continue}for(const u of o)s.added?r.push({kind:"added",text:u,newLine:i++}):s.removed?r.push({kind:"removed",text:u,oldLine:a++}):r.push({kind:"unchanged",text:u,oldLine:a++,newLine:i++})}return r}function Gae(e){return e.some(t=>t.kind==="added"||t.kind==="removed")}const h1="max-w-full overflow-x-auto rounded-md border border-gray-800 bg-gray-950 font-mono text-xs leading-5";function Qae(e){switch(e){case"added":return"bg-emerald-950/70 text-emerald-100";case"removed":return"bg-rose-950/70 text-rose-100";case"ellipsis":return"bg-gray-900 text-gray-500 italic";default:return"bg-gray-950 text-gray-300"}}function Yae(e){switch(e){case"added":return"+";case"removed":return"-";case"ellipsis":return"…";default:return" "}}function Xae({rows:e,emptyLabel:t}){return e.length===0?c.jsx("p",{className:"text-sm text-gray-500",children:t}):c.jsx("div",{className:h1,children:e.map((n,r)=>c.jsxs("div",{className:`grid min-w-0 grid-cols-[3rem_3rem_minmax(0,1fr)] gap-0 ${Qae(n.kind)}`,children:[c.jsx("span",{className:"select-none border-r border-gray-800/80 px-2 py-0.5 text-right text-gray-600",children:n.oldLine??""}),c.jsx("span",{className:"select-none border-r border-gray-800/80 px-2 py-0.5 text-right text-gray-600",children:n.newLine??""}),c.jsxs("div",{className:"flex min-w-0 gap-2 px-2 py-0.5",children:[c.jsx("span",{className:"w-3 shrink-0 select-none text-gray-500",children:Yae(n.kind)}),c.jsx("span",{className:"min-w-0 whitespace-pre-wrap break-words",children:n.text||" "})]})]},`${n.kind}-${r}-${n.oldLine??""}-${n.newLine??""}`))})}function Wae({before:e,after:t}){const n=e.filter(a=>!t.includes(a)),r=t.filter(a=>!e.includes(a));return n.length===0&&r.length===0?null:c.jsxs("div",{className:"space-y-2",children:[c.jsx("h4",{className:"text-sm font-medium text-gray-400",children:"Triggers"}),c.jsxs("div",{className:`${h1} p-0`,children:[n.map(a=>c.jsxs("div",{className:"grid min-w-0 grid-cols-[3rem_3rem_minmax(0,1fr)] bg-rose-950/70 text-rose-100",children:[c.jsx("span",{className:"border-r border-gray-800/80 px-2 py-0.5"}),c.jsx("span",{className:"border-r border-gray-800/80 px-2 py-0.5"}),c.jsxs("div",{className:"flex gap-2 px-2 py-0.5",children:[c.jsx("span",{className:"w-3 shrink-0 text-gray-500",children:"-"}),c.jsx("span",{children:a})]})]},`removed-${a}`)),r.map(a=>c.jsxs("div",{className:"grid min-w-0 grid-cols-[3rem_3rem_minmax(0,1fr)] bg-emerald-950/70 text-emerald-100",children:[c.jsx("span",{className:"border-r border-gray-800/80 px-2 py-0.5"}),c.jsx("span",{className:"border-r border-gray-800/80 px-2 py-0.5"}),c.jsxs("div",{className:"flex gap-2 px-2 py-0.5",children:[c.jsx("span",{className:"w-3 shrink-0 text-gray-500",children:"+"}),c.jsx("span",{children:a})]})]},`added-${a}`))]})]})}function Jae({preview:e}){const t=AP(e),n=Zae(e.before.body,e.after.body),r=e.before.body.trim()!==e.after.body.trim()&&e.after.body.length>0&&!e.after.body.includes(e.before.body.slice(0,40))&&Gae(n),a=e.before.title!==e.after.title,i=e.before.triggers.join(`
498
+ `)!==e.after.triggers.join(`
499
+ `);return c.jsxs("div",{className:"min-w-0 space-y-4",children:[!t&&c.jsxs("div",{className:"rounded-md border border-amber-500/50 bg-amber-500/10 p-3 text-sm text-amber-100",children:["No change detected — ops did not alter the playbook body or triggers. Reject this proposal and re-propose with a matching list anchor or ",c.jsx("code",{children:"rewrite_body"}),"."]}),r&&c.jsx("div",{className:"rounded-md border border-amber-500/50 bg-amber-500/10 p-3 text-sm text-amber-100",children:"Full-body rewrite proposed — review carefully."}),a&&c.jsxs("div",{className:"space-y-2",children:[c.jsx("h4",{className:"text-sm font-medium text-gray-400",children:"Title"}),c.jsxs("div",{className:`${h1} p-0`,children:[e.before.title&&c.jsxs("div",{className:"grid min-w-0 grid-cols-[3rem_3rem_minmax(0,1fr)] bg-rose-950/70 text-rose-100",children:[c.jsx("span",{className:"border-r border-gray-800/80 px-2 py-0.5"}),c.jsx("span",{className:"border-r border-gray-800/80 px-2 py-0.5"}),c.jsxs("div",{className:"flex gap-2 px-2 py-0.5",children:[c.jsx("span",{className:"w-3 shrink-0 text-gray-500",children:"-"}),c.jsx("span",{children:e.before.title})]})]}),e.after.title&&c.jsxs("div",{className:"grid min-w-0 grid-cols-[3rem_3rem_minmax(0,1fr)] bg-emerald-950/70 text-emerald-100",children:[c.jsx("span",{className:"border-r border-gray-800/80 px-2 py-0.5"}),c.jsx("span",{className:"border-r border-gray-800/80 px-2 py-0.5"}),c.jsxs("div",{className:"flex gap-2 px-2 py-0.5",children:[c.jsx("span",{className:"w-3 shrink-0 text-gray-500",children:"+"}),c.jsx("span",{children:e.after.title})]})]})]})]}),c.jsxs("div",{className:"space-y-2",children:[c.jsx("h4",{className:"text-sm font-medium text-gray-400",children:"Body"}),c.jsx(Xae,{rows:n,emptyLabel:"No body changes."})]}),i&&c.jsx(Wae,{before:e.before.triggers,after:e.after.triggers})]})}function eie(e){if(!e)return[];try{return JSON.parse(e)}catch{return[]}}function tie({conflicts:e,title:t="Trigger overlap warnings"}){return e.length===0?null:c.jsxs("div",{className:"rounded-md border border-amber-500/40 bg-amber-500/10 p-4 text-sm text-amber-50",children:[c.jsx("p",{className:"text-xs font-medium uppercase tracking-wide text-amber-200/90",children:t}),c.jsx("p",{className:"mt-2 text-amber-100/90",children:"These triggers overlap with other playbooks on the deck. Accept is still allowed — disambiguate triggers or propose a merge if the wrong playbook keeps firing."}),c.jsx("ul",{className:"mt-3 space-y-2",children:e.map(n=>c.jsxs("li",{className:"rounded border border-amber-500/20 bg-gray-950/60 p-3",children:[c.jsxs("div",{className:"flex flex-wrap items-center gap-2",children:[c.jsx(mn,{variant:"outline",className:"border-amber-400/40 text-amber-100",children:n.level}),c.jsx("span",{className:"font-medium text-amber-50",children:n.otherPlaybookTitle}),c.jsx("span",{className:"font-mono text-xs text-amber-200/70",children:n.otherPlaybookId})]}),c.jsxs("p",{className:"mt-2 text-amber-100/90",children:[c.jsx("span",{className:"text-amber-200/80",children:"Candidate:"})," ",n.trigger]}),c.jsxs("p",{className:"text-amber-100/80",children:[c.jsx("span",{className:"text-amber-200/80",children:"Other:"})," ",n.otherTrigger]})]},`${n.trigger}-${n.otherPlaybookId}-${n.level}`))})]})}const $f=8,nie=[{value:"proposed",label:"Waiting"},{value:"accepted",label:"Accepted"},{value:"rejected",label:"Rejected"},{value:"superseded",label:"Superseded"},{value:"stale",label:"Stale"},{value:"all",label:"All"}];function rie(e){if(!e.evidenceJson)return null;try{return JSON.parse(e.evidenceJson)}catch{return null}}function YE(e){switch(e){case"proposed":return"border-blue-500/40 text-blue-200";case"accepted":return"border-emerald-500/40 text-emerald-200";case"rejected":return"border-rose-500/40 text-rose-200";case"superseded":return"border-violet-500/40 text-violet-200";case"stale":return"border-amber-500/40 text-amber-200"}}function aie(){const[e,t]=x.useState(null),[n,r]=x.useState("proposed"),[a,i]=x.useState(0),{toast:s}=nn(),o=cn();function l(j){t(j)}function u(j){r(j),i(0),t(null)}const{data:d=[]}=wt({queryKey:["/api/playbook-patches","proposed"],queryFn:()=>Iv("proposed")}),f=n==="all"?void 0:n,{data:m=[],isLoading:h}=wt({queryKey:["/api/playbook-patches",n],queryFn:()=>Iv(f)}),y=Math.max(1,Math.ceil(m.length/$f)),p=Math.min(a,y-1),b=x.useMemo(()=>{const j=p*$f;return m.slice(j,j+$f)},[m,p]);x.useEffect(()=>{a!==p&&i(p)},[a,p]);const{data:g,isLoading:v,isError:w,error:S}=wt({queryKey:["/api/playbook-patches",e,"preview"],queryFn:()=>Y9(e),enabled:!!e}),E=g?AP(g):!1,C=m.find(j=>j.id===e)??null,T=(C==null?void 0:C.status)==="proposed",P=St({mutationFn:j=>X9(j),onSuccess:()=>{s({title:"Patch accepted"}),t(null),o.invalidateQueries({queryKey:["/api/playbook-patches"]}),o.invalidateQueries({queryKey:["/api/playbooks"]}),o.invalidateQueries({queryKey:["/api/feedback-signals"]})},onError:j=>{s({title:"Accept failed",description:j.message,variant:"destructive"})}}),R=St({mutationFn:j=>W9(j),onSuccess:()=>{s({title:"Patch rejected"}),t(null),o.invalidateQueries({queryKey:["/api/playbook-patches"]}),o.invalidateQueries({queryKey:["/api/feedback-signals"]})},onError:j=>{s({title:"Reject failed",description:j.message,variant:"destructive"})}}),$=n==="proposed"?"No proposals waiting for review.":n==="all"?"No playbook patches yet.":`No ${n} patches.`;return c.jsxs("div",{className:"flex h-dvh flex-col overflow-hidden bg-gray-950 text-gray-100",children:[c.jsx("header",{className:"shrink-0 border-b border-gray-800 px-4 py-4 sm:px-6",children:c.jsxs("div",{className:"mx-auto flex max-w-7xl flex-wrap items-center gap-3",children:[c.jsx(Yl,{href:"/",children:c.jsxs(le,{variant:"ghost",size:"sm",className:"text-gray-300",children:[c.jsx(uT,{className:"mr-1 h-4 w-4"}),"Deck"]})}),c.jsx("h1",{className:"text-lg font-semibold",children:"Playbook review queue"}),c.jsxs(mn,{variant:"secondary",children:[d.length," waiting"]}),c.jsx(Yl,{href:"/feedback-signals",className:"ml-auto text-sm hover:underline",style:{color:"#92E4DD"},children:"Feedback data →"})]})}),c.jsxs("main",{className:"mx-auto grid w-full max-w-7xl min-h-0 flex-1 gap-6 overflow-hidden px-4 py-6 sm:px-6 lg:grid-cols-[minmax(18rem,20rem)_minmax(0,1fr)] lg:items-stretch",children:[c.jsxs("section",{className:"flex min-h-0 min-w-0 flex-col",children:[c.jsx("h2",{className:"mb-3 shrink-0 text-sm font-medium text-gray-400",children:"Proposals"}),c.jsx("div",{className:"mb-3 flex shrink-0 flex-wrap gap-1",children:nie.map(({value:j,label:O})=>{const z=n===j;return c.jsx(le,{size:"sm",variant:z?"gold":"outline",className:z?void 0:"border-gray-600 bg-transparent text-gray-300 hover:bg-gray-800 hover:text-gray-100","aria-pressed":z,onClick:()=>u(j),children:O},j)})}),c.jsxs("div",{className:"min-h-0 flex-1 overflow-y-auto",children:[h&&c.jsx("p",{className:"text-sm text-gray-500",children:"Loading…"}),!h&&m.length===0&&c.jsx("p",{className:"text-sm text-gray-500",children:$}),c.jsx("ul",{className:"space-y-2",children:b.map(j=>c.jsx("li",{children:c.jsxs("button",{type:"button",onClick:()=>l(j.id),className:`w-full rounded-lg border p-3 text-left transition ${e===j.id?"border-blue-500 bg-gray-900":"border-gray-800 bg-gray-900/50 hover:border-gray-700"}`,children:[c.jsxs("div",{className:"flex items-start justify-between gap-2",children:[c.jsxs("div",{className:"min-w-0",children:[c.jsx("span",{className:"block font-medium leading-snug",children:j.kind==="create"?`New: ${j.displayTitle}`:j.displayTitle}),j.playbookId&&j.kind!=="create"&&c.jsx("span",{className:"mt-0.5 block truncate font-mono text-xs text-gray-600",children:j.playbookId}),K_(j.deckNames)&&c.jsxs("span",{className:"mt-1 block text-xs text-gray-500",children:["Decks: ",K_(j.deckNames)]})]}),c.jsxs("div",{className:"flex shrink-0 flex-col items-end gap-1",children:[c.jsx(mn,{variant:"outline",className:"shrink-0",children:j.kind}),n!=="proposed"&&c.jsx(mn,{variant:"outline",className:`shrink-0 ${YE(j.status)}`,children:j.status})]})]}),c.jsx("p",{className:"mt-1 line-clamp-2 text-sm text-gray-400",children:j.rationale}),c.jsxs("p",{className:"mt-1 text-xs text-gray-600",children:[j.source," · ",new Date(j.createdAt).toLocaleString()]})]})},j.id))})]}),m.length>$f&&c.jsxs("div",{className:"mt-3 flex shrink-0 items-center justify-between gap-2 border-t border-gray-800 pt-3",children:[c.jsxs(le,{type:"button",size:"sm",variant:"outline",className:"border-gray-600 bg-transparent text-gray-300 hover:bg-gray-800",disabled:p<=0,onClick:()=>i(j=>Math.max(0,j-1)),children:[c.jsx(hT,{className:"mr-1 h-4 w-4"}),"Newer"]}),c.jsxs("span",{className:"text-xs text-gray-500",children:[p+1," / ",y,c.jsxs("span",{className:"ml-1 text-gray-600",children:["(",m.length,")"]})]}),c.jsxs(le,{type:"button",size:"sm",variant:"outline",className:"border-gray-600 bg-transparent text-gray-300 hover:bg-gray-800",disabled:p>=y-1,onClick:()=>i(j=>Math.min(y-1,j+1)),children:["Older",c.jsx(mT,{className:"ml-1 h-4 w-4"})]})]})]}),c.jsxs("section",{className:"flex min-h-0 min-w-0 flex-col overflow-hidden",children:[c.jsx("h2",{className:"mb-3 shrink-0 text-sm font-medium text-gray-400",children:"Detail"}),!C&&c.jsx("p",{className:"text-sm text-gray-500",children:"Select a proposal to preview the diff."}),C&&c.jsxs("div",{className:"flex min-h-0 flex-1 flex-col overflow-hidden rounded-lg border border-gray-800 bg-gray-900/50",children:[c.jsx("div",{className:"min-h-0 flex-1 overflow-y-auto overscroll-contain p-4 sm:p-5",children:c.jsxs("div",{className:"min-w-0 space-y-4",children:[c.jsxs("div",{className:"flex flex-wrap items-center gap-2",children:[c.jsx(mn,{variant:"outline",className:YE(C.status),children:C.status}),C.resolvedAt&&c.jsxs("span",{className:"text-xs text-gray-500",children:["Resolved ",new Date(C.resolvedAt).toLocaleString()]})]}),c.jsx("p",{className:"text-sm leading-relaxed text-gray-300",children:C.rationale}),C.status==="rejected"&&C.rejectionReason&&c.jsxs("div",{className:"rounded-md border border-rose-500/40 bg-rose-500/10 p-3 text-sm text-rose-100",children:[c.jsx("p",{className:"text-xs font-medium uppercase tracking-wide text-rose-300/80",children:"Rejection reason"}),c.jsx("p",{className:"mt-1",children:C.rejectionReason})]}),C.status==="superseded"&&C.supersededBy&&c.jsxs("div",{className:"rounded-md border border-violet-500/40 bg-violet-500/10 p-3 text-sm text-violet-100",children:[c.jsx("p",{className:"text-xs font-medium uppercase tracking-wide text-violet-300/80",children:"Superseded by"}),c.jsx("button",{type:"button",className:"mt-1 font-mono text-sm underline-offset-2 hover:underline",onClick:()=>{const j=C.supersededBy;r("all"),i(0),l(j)},children:C.supersededBy})]}),(()=>{const j=rie(C);return j?c.jsxs("div",{className:"rounded-md border border-gray-700 bg-gray-950 p-4 text-sm",children:[c.jsx("p",{className:"text-xs font-medium uppercase tracking-wide text-gray-500",children:"Your correction"}),c.jsxs("p",{className:"mt-2 italic text-gray-200",children:["“",j.user_feedback_excerpt,"”"]}),j.failure_summary&&c.jsx("p",{className:"mt-2 text-gray-400",children:j.failure_summary})]}):null})(),(()=>{const j=eie(C.conflictsJson),O=(g==null?void 0:g.trigger_conflicts)??[],z=O.length>0?O:j;return c.jsx(tie,{conflicts:z})})(),v&&c.jsx("p",{className:"text-sm text-gray-500",children:"Loading preview…"}),w&&c.jsxs("div",{className:"rounded-md border border-rose-500/50 bg-rose-500/10 p-3 text-sm text-rose-100",children:["Preview failed —"," ",(S==null?void 0:S.message)??"could not apply ops to the current playbook.",T?" Reject and re-propose with exact list anchors or rewrite_body.":" Historical preview may be incomplete if the playbook changed."]}),g&&c.jsx(Jae,{preview:g}),C.status==="stale"&&c.jsx("p",{className:"text-sm text-amber-400",children:"Stale — playbook changed since proposal. Re-propose from a fresh session."})]})}),T?c.jsxs("div",{className:"relative z-10 shrink-0 space-y-3 border-t border-gray-800 bg-gray-950 p-4 shadow-[0_-16px_32px_rgba(0,0,0,0.55)] sm:p-5",children:[c.jsx("h3",{className:"text-sm font-medium text-gray-400",children:"Your decision"}),c.jsxs("div",{className:"flex flex-wrap gap-2",children:[c.jsx(le,{variant:"gold",onClick:()=>P.mutate(C.id),disabled:P.isPending||w||!E,children:"Accept"}),c.jsx(le,{variant:"destructive",onClick:()=>R.mutate(C.id),disabled:R.isPending,children:"Reject"})]})]}):c.jsxs("div",{className:"shrink-0 border-t border-gray-800 bg-gray-950 px-4 py-3 text-sm text-gray-500 sm:px-5",children:["Read-only — already ",C.status,". Switch to Waiting to review open proposals."]})]})]})]})]})}const XE="border-[#C4B643] data-[state=checked]:bg-[#C4B643] data-[state=checked]:text-[#0A0A07] data-[state=indeterminate]:bg-[#C4B643] data-[state=indeterminate]:text-[#0A0A07]";function iie(){const{toast:e}=nn(),t=cn(),[n,r]=x.useState("open"),[a,i]=x.useState(""),[s,o]=x.useState(!1),[l,u]=x.useState(new Set),{data:d}=wt({queryKey:["/api/playbooks/vault"]}),f=(d==null?void 0:d.data)??[],m=x.useMemo(()=>{const T=new Map;for(const P of f)T.set(P.id,P.title);return T},[f]),h={status:n==="all"?void 0:n,playbookId:a||void 0,excludeInProposal:n==="open"?!s:void 0},{data:y=[],isLoading:p}=wt({queryKey:["/api/feedback-signals",h],queryFn:()=>eF(h)}),b=St({mutationFn:T=>tF(T),onSuccess:T=>{e({title:`Discarded ${T.discarded} signal(s)`}),u(new Set),t.invalidateQueries({queryKey:["/api/feedback-signals"]})},onError:T=>{e({title:"Discard failed",description:T.message,variant:"destructive"})}}),g=T=>{u(P=>{const R=new Set(P);return R.has(T)?R.delete(T):R.add(T),R})},v=async()=>{const T=l.size>0?y.filter(P=>l.has(P.id)):y;if(T.length!==0){if(T.some(P=>!P.id)){e({title:"Copy blocked",description:"Every signal must include an id for tracking.",variant:"destructive"});return}try{await navigator.clipboard.writeText(aF(T)),e({title:"Copied curation prompt",description:`${T.length} signal id(s) included — paste into your IDE agent.`})}catch(P){e({title:"Copy failed",description:P instanceof Error?P.message:"Clipboard unavailable",variant:"destructive"})}}},w=[...l].filter(T=>{const P=y.find(R=>R.id===T);return(P==null?void 0:P.status)==="open"}),S=y.length>0&&y.every(T=>l.has(T.id)),E=y.some(T=>l.has(T.id)),C=()=>{if(S){u(new Set);return}u(new Set(y.map(T=>T.id)))};return c.jsxs("div",{className:"flex min-h-dvh flex-col bg-gray-950 text-gray-100",children:[c.jsx("header",{className:"shrink-0 border-b border-gray-800 px-4 py-4 sm:px-6",children:c.jsxs("div",{className:"mx-auto flex max-w-7xl flex-wrap items-center gap-3",children:[c.jsx(Yl,{href:"/",children:c.jsxs(le,{variant:"ghost",size:"sm",className:"text-gray-300",children:[c.jsx(uT,{className:"mr-1 h-4 w-4"}),"Home"]})}),c.jsx("h1",{className:"text-lg font-semibold",children:"Feedback"}),c.jsx(mn,{variant:"outline",children:y.length}),c.jsx(Yl,{href:"/playbook-patches",className:"ml-auto text-sm hover:underline",style:{color:"#92E4DD"},children:"Playbook proposals →"})]})}),c.jsxs("main",{className:"mx-auto w-full max-w-7xl flex-1 space-y-4 px-4 py-6 sm:px-6",children:[c.jsx("p",{className:"text-sm text-gray-400",children:"Durable correction data for playbook enhancement. Filter by playbook, copy rows (with ids) for an IDE agent to propose, then accept the proposal to mark feedback solved."}),c.jsxs("div",{className:"flex flex-wrap items-end gap-3 rounded-lg border border-gray-800 bg-gray-900/40 p-3",children:[c.jsxs("label",{className:"text-xs text-gray-500",children:["Playbook",c.jsxs("select",{className:"mt-1 block min-w-[12rem] rounded border border-gray-700 bg-gray-950 px-2 py-1.5 text-sm text-gray-100",value:a,onChange:T=>{i(T.target.value),u(new Set)},children:[c.jsx("option",{value:"",children:"All"}),f.map(T=>c.jsx("option",{value:T.id,children:T.title},T.id))]})]}),c.jsx("div",{className:"flex flex-wrap gap-1",children:[["open","Open"],["actioned","Actioned"],["discarded","Discarded"],["all","All"]].map(([T,P])=>{const R=n===T;return c.jsx(le,{size:"sm",variant:R?"gold":"outline",className:R?void 0:"border-gray-600 bg-transparent text-gray-300 hover:bg-gray-800 hover:text-gray-100","aria-pressed":R,onClick:()=>{r(T),u(new Set)},children:P},T)})}),n==="open"&&c.jsxs("label",{className:"flex items-center gap-2 text-xs text-gray-400",children:[c.jsx("input",{type:"checkbox",checked:s,onChange:T=>o(T.target.checked)}),"Include already in an open proposal"]}),c.jsxs("div",{className:"ml-auto flex flex-wrap gap-2",children:[c.jsxs(le,{size:"sm",variant:"outline",disabled:y.length===0,onClick:()=>void v(),children:[c.jsx(Gb,{className:"mr-1 h-3.5 w-3.5"}),"Copy for agent",l.size>0?` (${l.size})`:""]}),c.jsxs(le,{size:"sm",variant:"destructive",disabled:w.length===0||b.isPending,onClick:()=>b.mutate(w),children:[c.jsx(wd,{className:"mr-1 h-3.5 w-3.5"}),"Discard selected"]})]})]}),p&&c.jsx("p",{className:"text-sm text-gray-500",children:"Loading…"}),!p&&y.length===0&&c.jsx("p",{className:"text-sm text-gray-500",children:"No signals match these filters."}),!p&&y.length>0&&c.jsx("div",{className:"overflow-x-auto rounded-lg border border-gray-800",children:c.jsxs("table",{className:"w-full min-w-[48rem] text-left text-sm",children:[c.jsx("thead",{className:"border-b border-gray-800 bg-gray-900/80 text-xs uppercase text-gray-500",children:c.jsxs("tr",{children:[c.jsx("th",{className:"w-10 px-3 py-2",children:c.jsx(tm,{checked:S?!0:E?"indeterminate":!1,onCheckedChange:C,"aria-label":"Select all visible signals",disabled:y.length===0,className:XE})}),c.jsx("th",{className:"px-3 py-2",children:"Excerpt"}),c.jsx("th",{className:"px-3 py-2",children:"Failure"}),c.jsx("th",{className:"px-3 py-2",children:"Playbook"}),c.jsx("th",{className:"px-3 py-2",children:"Source"}),c.jsx("th",{className:"px-3 py-2",children:"When"})]})}),c.jsx("tbody",{children:y.map(T=>{const P=nF(T);return c.jsxs("tr",{className:"border-b border-gray-800/80 align-top",children:[c.jsx("td",{className:"px-3 py-2",children:c.jsx(tm,{checked:l.has(T.id),onCheckedChange:()=>g(T.id),"aria-label":`Select ${T.id}`,className:XE})}),c.jsxs("td",{className:"px-3 py-2",children:[c.jsx("p",{className:"font-mono text-[11px] text-gray-600",children:T.id}),c.jsxs("p",{className:"text-gray-200",children:["“",T.userFeedbackExcerpt,"”"]}),P&&c.jsx(mn,{variant:"outline",className:"mt-1 text-[10px]",children:"In proposal"})]}),c.jsx("td",{className:"px-3 py-2 text-gray-400",children:T.failureSummary}),c.jsx("td",{className:"px-3 py-2 text-gray-300",children:T.candidatePlaybookId?m.get(T.candidatePlaybookId)??T.candidatePlaybookId:"—"}),c.jsx("td",{className:"px-3 py-2 text-gray-500",children:T.source}),c.jsx("td",{className:"px-3 py-2 whitespace-nowrap text-gray-500",children:new Date(T.createdAt).toLocaleString()})]},T.id)})})]})})]})]})}function sie(){const e=new URLSearchParams(window.location.search),t=e.get("challenge")??"",n=e.get("session")??"",[r,a]=x.useState("idle"),[i,s]=x.useState("");x.useEffect(()=>{(!t||!n)&&(a("error"),s("Missing challenge or session in URL."))},[t,n]);async function o(){if(!(!t||!n)){a("loading");try{await ke("POST","/api/trusted-session/admin/approve",{challengeId:t,runtimeSessionId:n}),a("success"),s("Admin elevation approved for this MCP session. Return to the agent.")}catch(l){a("error"),s(l instanceof Error?l.message:"Approval failed")}}}return c.jsx("div",{className:"min-h-screen flex items-center justify-center p-6 bg-muted/30",children:c.jsxs(Fa,{className:"w-full max-w-md",children:[c.jsxs(ji,{children:[c.jsx(Ti,{children:"Approve agent-admin elevation"}),c.jsx(_u,{children:"Grants ephemeral deck-admin mode to one MCP session (30-minute lease). This does not change the persistent workspace grant."})]}),c.jsxs(qa,{className:"space-y-4",children:[t&&n?c.jsxs("dl",{className:"text-sm space-y-1 text-muted-foreground",children:[c.jsxs("div",{children:[c.jsx("dt",{className:"inline font-medium text-foreground",children:"Session "}),c.jsx("dd",{className:"inline font-mono text-xs",children:n})]}),c.jsxs("div",{children:[c.jsx("dt",{className:"inline font-medium text-foreground",children:"Challenge "}),c.jsx("dd",{className:"inline font-mono text-xs",children:t})]})]}):null,r==="success"?c.jsx("p",{className:"text-sm text-green-700 dark:text-green-400",children:i}):r==="error"?c.jsx("p",{className:"text-sm text-destructive",children:i}):null,r!=="success"&&t&&n?c.jsx(le,{onClick:()=>void o(),disabled:r==="loading",className:"w-full",children:r==="loading"?"Approving…":"Approve elevation"}):null]})]})})}function oie(){return c.jsxs(o3,{children:[c.jsx(Cs,{path:"/",component:CZ}),c.jsx(Cs,{path:"/oauth/callback",component:TZ}),c.jsx(Cs,{path:"/playbook-patches",component:aie}),c.jsx(Cs,{path:"/feedback-signals",component:iie}),c.jsx(Cs,{path:"/admin/approve",component:sie}),c.jsx(Cs,{path:"/mcp-test",component:Lae}),c.jsx(Cs,{component:jZ})]})}function lie(){const[e,t]=x.useState(!1);return x.useEffect(()=>{let n=!1;return q3().finally(()=>{n||t(!0)}),()=>{n=!0}},[]),e?c.jsx(j3,{client:F3,children:c.jsxs(wU,{children:[c.jsx(DL,{}),c.jsx(oie,{})]})}):c.jsx("div",{className:"flex min-h-screen items-center justify-center bg-[#0B1220] text-sm text-gray-300",children:"Loading AgentDeck..."})}Az.createRoot(document.getElementById("root")).render(c.jsx(x.StrictMode,{children:c.jsx(lie,{})}));