@agent-deck/backend 1.7.1 → 1.7.2
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/.tsbuildinfo +1 -1
- package/dist/lib/http-auth.d.ts +14 -0
- package/dist/lib/http-auth.d.ts.map +1 -1
- package/dist/lib/http-auth.js +25 -0
- package/dist/lib/http-auth.js.map +1 -1
- package/dist/mcp-server.d.ts +9 -0
- package/dist/mcp-server.d.ts.map +1 -1
- package/dist/mcp-server.js +112 -39
- package/dist/mcp-server.js.map +1 -1
- package/dist/mcp-tools/test-harness.d.ts +2 -2
- package/dist/mcp-tools/test-harness.d.ts.map +1 -1
- package/dist/mcp-tools/test-harness.js +23 -15
- package/dist/mcp-tools/test-harness.js.map +1 -1
- package/dist/routes/trusted-session.d.ts.map +1 -1
- package/dist/routes/trusted-session.js +40 -4
- package/dist/routes/trusted-session.js.map +1 -1
- package/dist/trusted-session/route-policy-registry.d.ts.map +1 -1
- package/dist/trusted-session/route-policy-registry.js +2 -0
- package/dist/trusted-session/route-policy-registry.js.map +1 -1
- package/dist/trusted-session/store.d.ts +6 -0
- package/dist/trusted-session/store.d.ts.map +1 -1
- package/dist/trusted-session/store.js +30 -1
- package/dist/trusted-session/store.js.map +1 -1
- package/package.json +2 -2
- package/static-ui/assets/index-BV3jJARs.js +499 -0
- package/static-ui/index.html +1 -1
- package/static-ui/assets/index-DwI7IkPX.js +0 -499
|
@@ -0,0 +1,499 @@
|
|
|
1
|
+
var CP=Object.defineProperty;var g1=e=>{throw TypeError(e)};var NP=(e,t,n)=>t in e?CP(e,t,{enumerable:!0,configurable:!0,writable:!0,value:n}):e[t]=n;var Ta=(e,t,n)=>NP(e,typeof t!="symbol"?t+"":t,n),Mm=(e,t,n)=>t.has(e)||g1("Cannot "+n);var U=(e,t,n)=>(Mm(e,t,"read from private field"),n?n.call(e):t.get(e)),_e=(e,t,n)=>t.has(e)?g1("Cannot add the same private member more than once"):t instanceof WeakSet?t.add(e):t.set(e,n),me=(e,t,n,r)=>(Mm(e,t,"write to private field"),r?r.call(e,n):t.set(e,n),n),Le=(e,t,n)=>(Mm(e,t,"access private method"),n);var Ud=(e,t,n,r)=>({set _(a){me(e,t,a,n)},get _(){return U(e,t,r)}});function jP(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 fh=typeof globalThis<"u"?globalThis:typeof window<"u"?window:typeof global<"u"?global:typeof self<"u"?self:{};function ac(e){return e&&e.__esModule&&Object.prototype.hasOwnProperty.call(e,"default")?e.default:e}var sC={exports:{}},Np={};/**
|
|
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 TP=Symbol.for("react.transitional.element"),AP=Symbol.for("react.fragment");function oC(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:TP,type:e,key:r,ref:t!==void 0?t:null,props:n}}Np.Fragment=AP;Np.jsx=oC;Np.jsxs=oC;sC.exports=Np;var c=sC.exports,lC={exports:{}},jp={},cC={exports:{}},uC={};/**
|
|
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,T=B[J];if(0<a(T,Z))B[J]=Z,B[F]=T,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,T=B.length,q=T>>>1;J<q;){var G=2*(J+1)-1,_=B[G],E=G+1,M=B[E];if(0>a(_,F))E<T&&0>a(M,_)?(B[J]=M,B[E]=F,J=E):(B[J]=_,B[G]=F,J=G);else if(E<T&&0>a(M,F))B[J]=M,B[E]=F,J=E;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,p=3,h=!1,y=!1,m=!1,b=!1,g=typeof setTimeout=="function"?setTimeout:null,v=typeof clearTimeout=="function"?clearTimeout:null,x=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 k(B){if(m=!1,S(B),!y)if(n(l)!==null)y=!0,C||(C=!0,O());else{var Z=n(u);Z!==null&&A(k,Z.startTime-B)}}var C=!1,N=-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,m&&(m=!1,v(N),N=-1),h=!0;var F=p;try{t:{for(S(B),f=n(l);f!==null&&!(f.expirationTime>B&&$());){var J=f.callback;if(typeof J=="function"){f.callback=null,p=f.priorityLevel;var T=J(f.expirationTime<=B);if(B=e.unstable_now(),typeof T=="function"){f.callback=T,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(k,q.startTime-B),Z=!1}}break e}finally{f=null,p=F,h=!1}Z=void 0}}finally{Z?O():C=!1}}}var O;if(typeof x=="function")O=function(){x(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){N=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 p},e.unstable_next=function(B){switch(p){case 1:case 2:case 3:var Z=3;break;default:Z=p}var F=p;p=Z;try{return B()}finally{p=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=p;p=B;try{return Z()}finally{p=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 T=-1;break;case 2:T=250;break;case 5:T=1073741823;break;case 4:T=1e4;break;default:T=5e3}return T=F+T,B={id:d++,callback:Z,priorityLevel:B,startTime:F,expirationTime:T,sortIndex:-1},F>J?(B.sortIndex=F,t(u,B),n(l)===null&&B===n(u)&&(m?(v(N),N=-1):m=!0,A(k,F-J))):(B.sortIndex=T,t(l,B),y||h||(y=!0,C||(C=!0,O()))),B},e.unstable_shouldYield=$,e.unstable_wrapCallback=function(B){var Z=p;return function(){var F=p;p=Z;try{return B.apply(this,arguments)}finally{p=F}}}})(uC);cC.exports=uC;var RP=cC.exports,dC={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 P0=Symbol.for("react.transitional.element"),$P=Symbol.for("react.portal"),OP=Symbol.for("react.fragment"),MP=Symbol.for("react.strict_mode"),PP=Symbol.for("react.profiler"),DP=Symbol.for("react.consumer"),zP=Symbol.for("react.context"),IP=Symbol.for("react.forward_ref"),LP=Symbol.for("react.suspense"),UP=Symbol.for("react.memo"),fC=Symbol.for("react.lazy"),FP=Symbol.for("react.activity"),y1=Symbol.iterator;function qP(e){return e===null||typeof e!="object"?null:(e=y1&&e[y1]||e["@@iterator"],typeof e=="function"?e:null)}var hC={isMounted:function(){return!1},enqueueForceUpdate:function(){},enqueueReplaceState:function(){},enqueueSetState:function(){}},pC=Object.assign,mC={};function ic(e,t,n){this.props=e,this.context=t,this.refs=mC,this.updater=n||hC}ic.prototype.isReactComponent={};ic.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")};ic.prototype.forceUpdate=function(e){this.updater.enqueueForceUpdate(this,e,"forceUpdate")};function gC(){}gC.prototype=ic.prototype;function D0(e,t,n){this.props=e,this.context=t,this.refs=mC,this.updater=n||hC}var z0=D0.prototype=new gC;z0.constructor=D0;pC(z0,ic.prototype);z0.isPureReactComponent=!0;var v1=Array.isArray;function fy(){}var kt={H:null,A:null,T:null,S:null},yC=Object.prototype.hasOwnProperty;function I0(e,t,n){var r=n.ref;return{$$typeof:P0,type:e,key:t,ref:r!==void 0?r:null,props:n}}function HP(e,t){return I0(e.type,t,e.props)}function L0(e){return typeof e=="object"&&e!==null&&e.$$typeof===P0}function BP(e){var t={"=":"=0",":":"=2"};return"$"+e.replace(/[=:]/g,function(n){return t[n]})}var b1=/\/+/g;function Pm(e,t){return typeof e=="object"&&e!==null&&e.key!=null?BP(""+e.key):t.toString(36)}function VP(e){switch(e.status){case"fulfilled":return e.value;case"rejected":throw e.reason;default:switch(typeof e.status=="string"?e.then(fy,fy):(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 Io(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 P0:case $P:s=!0;break;case fC:return s=e._init,Io(s(e._payload),t,n,r,a)}}if(s)return a=a(e),s=r===""?"."+Pm(e,0):r,v1(a)?(n="",s!=null&&(n=s.replace(b1,"$&/")+"/"),Io(a,t,n,"",function(u){return u})):a!=null&&(L0(a)&&(a=HP(a,n+(a.key==null||e&&e.key===a.key?"":(""+a.key).replace(b1,"$&/")+"/")+s)),t.push(a)),1;s=0;var o=r===""?".":r+":";if(v1(e))for(var l=0;l<e.length;l++)r=e[l],i=o+Pm(r,l),s+=Io(r,t,n,i,a);else if(l=qP(e),typeof l=="function")for(e=l.call(e),l=0;!(r=e.next()).done;)r=r.value,i=o+Pm(r,l++),s+=Io(r,t,n,i,a);else if(i==="object"){if(typeof e.then=="function")return Io(VP(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 Fd(e,t,n){if(e==null)return e;var r=[],a=0;return Io(e,r,"","",function(i){return t.call(n,i,a++)}),r}function KP(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 x1=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)},ZP={map:Fd,forEach:function(e,t,n){Fd(e,function(){t.apply(this,arguments)},n)},count:function(e){var t=0;return Fd(e,function(){t++}),t},toArray:function(e){return Fd(e,function(t){return t})||[]},only:function(e){if(!L0(e))throw Error("React.Children.only expected to receive a single React element child.");return e}};Me.Activity=FP;Me.Children=ZP;Me.Component=ic;Me.Fragment=OP;Me.Profiler=PP;Me.PureComponent=D0;Me.StrictMode=MP;Me.Suspense=LP;Me.__CLIENT_INTERNALS_DO_NOT_USE_OR_WARN_USERS_THEY_CANNOT_UPGRADE=kt;Me.__COMPILER_RUNTIME={__proto__:null,c:function(e){return kt.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=pC({},e.props),a=e.key;if(t!=null)for(i in t.key!==void 0&&(a=""+t.key),t)!yC.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 I0(e.type,a,r)};Me.createContext=function(e){return e={$$typeof:zP,_currentValue:e,_currentValue2:e,_threadCount:0,Provider:null,Consumer:null},e.Provider=e,e.Consumer={$$typeof:DP,_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)yC.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 I0(e,i,a)};Me.createRef=function(){return{current:null}};Me.forwardRef=function(e){return{$$typeof:IP,render:e}};Me.isValidElement=L0;Me.lazy=function(e){return{$$typeof:fC,_payload:{_status:-1,_result:e},_init:KP}};Me.memo=function(e,t){return{$$typeof:UP,type:e,compare:t===void 0?null:t}};Me.startTransition=function(e){var t=kt.T,n={};kt.T=n;try{var r=e(),a=kt.S;a!==null&&a(n,r),typeof r=="object"&&r!==null&&typeof r.then=="function"&&r.then(fy,x1)}catch(i){x1(i)}finally{t!==null&&n.types!==null&&(t.types=n.types),kt.T=t}};Me.unstable_useCacheRefresh=function(){return kt.H.useCacheRefresh()};Me.use=function(e){return kt.H.use(e)};Me.useActionState=function(e,t,n){return kt.H.useActionState(e,t,n)};Me.useCallback=function(e,t){return kt.H.useCallback(e,t)};Me.useContext=function(e){return kt.H.useContext(e)};Me.useDebugValue=function(){};Me.useDeferredValue=function(e,t){return kt.H.useDeferredValue(e,t)};Me.useEffect=function(e,t){return kt.H.useEffect(e,t)};Me.useEffectEvent=function(e){return kt.H.useEffectEvent(e)};Me.useId=function(){return kt.H.useId()};Me.useImperativeHandle=function(e,t,n){return kt.H.useImperativeHandle(e,t,n)};Me.useInsertionEffect=function(e,t){return kt.H.useInsertionEffect(e,t)};Me.useLayoutEffect=function(e,t){return kt.H.useLayoutEffect(e,t)};Me.useMemo=function(e,t){return kt.H.useMemo(e,t)};Me.useOptimistic=function(e,t){return kt.H.useOptimistic(e,t)};Me.useReducer=function(e,t,n){return kt.H.useReducer(e,t,n)};Me.useRef=function(e){return kt.H.useRef(e)};Me.useState=function(e){return kt.H.useState(e)};Me.useSyncExternalStore=function(e,t,n){return kt.H.useSyncExternalStore(e,t,n)};Me.useTransition=function(){return kt.H.useTransition()};Me.version="19.2.8";dC.exports=Me;var w=dC.exports;const ca=ac(w),ad=jP({__proto__:null,default:ca},[w]);var vC={exports:{}},In={};/**
|
|
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 GP=w;function bC(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 zn={d:{f:vi,r:function(){throw Error(bC(522))},D:vi,C:vi,L:vi,m:vi,X:vi,S:vi,M:vi},p:0,findDOMNode:null},QP=Symbol.for("react.portal");function YP(e,t,n){var r=3<arguments.length&&arguments[3]!==void 0?arguments[3]:null;return{$$typeof:QP,key:r==null?null:""+r,children:e,containerInfo:t,implementation:n}}var nu=GP.__CLIENT_INTERNALS_DO_NOT_USE_OR_WARN_USERS_THEY_CANNOT_UPGRADE;function Tp(e,t){if(e==="font")return"";if(typeof t=="string")return t==="use-credentials"?t:""}In.__DOM_INTERNALS_DO_NOT_USE_OR_WARN_USERS_THEY_CANNOT_UPGRADE=zn;In.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(bC(299));return YP(e,t,null,n)};In.flushSync=function(e){var t=nu.T,n=zn.p;try{if(nu.T=null,zn.p=2,e)return e()}finally{nu.T=t,zn.p=n,zn.d.f()}};In.preconnect=function(e,t){typeof e=="string"&&(t?(t=t.crossOrigin,t=typeof t=="string"?t==="use-credentials"?t:"":void 0):t=null,zn.d.C(e,t))};In.prefetchDNS=function(e){typeof e=="string"&&zn.d.D(e)};In.preinit=function(e,t){if(typeof e=="string"&&t&&typeof t.as=="string"){var n=t.as,r=Tp(n,t.crossOrigin),a=typeof t.integrity=="string"?t.integrity:void 0,i=typeof t.fetchPriority=="string"?t.fetchPriority:void 0;n==="style"?zn.d.S(e,typeof t.precedence=="string"?t.precedence:void 0,{crossOrigin:r,integrity:a,fetchPriority:i}):n==="script"&&zn.d.X(e,{crossOrigin:r,integrity:a,fetchPriority:i,nonce:typeof t.nonce=="string"?t.nonce:void 0})}};In.preinitModule=function(e,t){if(typeof e=="string")if(typeof t=="object"&&t!==null){if(t.as==null||t.as==="script"){var n=Tp(t.as,t.crossOrigin);zn.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&&zn.d.M(e)};In.preload=function(e,t){if(typeof e=="string"&&typeof t=="object"&&t!==null&&typeof t.as=="string"){var n=t.as,r=Tp(n,t.crossOrigin);zn.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})}};In.preloadModule=function(e,t){if(typeof e=="string")if(t){var n=Tp(t.as,t.crossOrigin);zn.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 zn.d.m(e)};In.requestFormReset=function(e){zn.d.r(e)};In.unstable_batchedUpdates=function(e,t){return e(t)};In.useFormState=function(e,t,n){return nu.H.useFormState(e,t,n)};In.useFormStatus=function(){return nu.H.useHostTransitionStatus()};In.version="19.2.8";function xC(){if(!(typeof __REACT_DEVTOOLS_GLOBAL_HOOK__>"u"||typeof __REACT_DEVTOOLS_GLOBAL_HOOK__.checkDCE!="function"))try{__REACT_DEVTOOLS_GLOBAL_HOOK__.checkDCE(xC)}catch(e){console.error(e)}}xC(),vC.exports=In;var wo=vC.exports;const XP=ac(wo);/**
|
|
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 en=RP,wC=w,WP=wo;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 SC(e){return!(!e||e.nodeType!==1&&e.nodeType!==9&&e.nodeType!==11)}function id(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 _C(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 kC(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 w1(e){if(id(e)!==e)throw Error(te(188))}function JP(e){var t=e.alternate;if(!t){if(t=id(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 w1(a),e;if(i===r)return w1(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 EC(e){var t=e.tag;if(t===5||t===26||t===27||t===6)return e;for(e=e.child;e!==null;){if(t=EC(e),t!==null)return t;e=e.sibling}return null}var Nt=Object.assign,eD=Symbol.for("react.element"),qd=Symbol.for("react.transitional.element"),Bc=Symbol.for("react.portal"),Go=Symbol.for("react.fragment"),CC=Symbol.for("react.strict_mode"),hy=Symbol.for("react.profiler"),NC=Symbol.for("react.consumer"),Qa=Symbol.for("react.context"),U0=Symbol.for("react.forward_ref"),py=Symbol.for("react.suspense"),my=Symbol.for("react.suspense_list"),F0=Symbol.for("react.memo"),Ei=Symbol.for("react.lazy"),gy=Symbol.for("react.activity"),tD=Symbol.for("react.memo_cache_sentinel"),S1=Symbol.iterator;function Nc(e){return e===null||typeof e!="object"?null:(e=S1&&e[S1]||e["@@iterator"],typeof e=="function"?e:null)}var nD=Symbol.for("react.client.reference");function yy(e){if(e==null)return null;if(typeof e=="function")return e.$$typeof===nD?null:e.displayName||e.name||null;if(typeof e=="string")return e;switch(e){case Go:return"Fragment";case hy:return"Profiler";case CC:return"StrictMode";case py:return"Suspense";case my:return"SuspenseList";case gy:return"Activity"}if(typeof e=="object")switch(e.$$typeof){case Bc:return"Portal";case Qa:return e.displayName||"Context";case NC:return(e._context.displayName||"Context")+".Consumer";case U0:var t=e.render;return e=e.displayName,e||(e=t.displayName||t.name||"",e=e!==""?"ForwardRef("+e+")":"ForwardRef"),e;case F0:return t=e.displayName||null,t!==null?t:yy(e.type)||"Memo";case Ei:t=e._payload,e=e._init;try{return yy(e(t))}catch{}}return null}var Vc=Array.isArray,Re=wC.__CLIENT_INTERNALS_DO_NOT_USE_OR_WARN_USERS_THEY_CANNOT_UPGRADE,Je=WP.__DOM_INTERNALS_DO_NOT_USE_OR_WARN_USERS_THEY_CANNOT_UPGRADE,Xs={pending:!1,data:null,method:null,action:null},vy=[],Qo=-1;function _a(e){return{current:e}}function on(e){0>Qo||(e.current=vy[Qo],vy[Qo]=null,Qo--)}function pt(e,t){Qo++,vy[Qo]=e.current,e.current=t}var xa=_a(null),Au=_a(null),Yi=_a(null),hh=_a(null);function ph(e,t){switch(pt(Yi,t),pt(Au,e),pt(xa,null),t.nodeType){case 9:case 11:e=(e=t.documentElement)&&(e=e.namespaceURI)?jS(e):0;break;default:if(e=t.tagName,t=t.namespaceURI)t=jS(t),e=Zj(t,e);else switch(e){case"svg":e=1;break;case"math":e=2;break;default:e=0}}on(xa),pt(xa,e)}function zl(){on(xa),on(Au),on(Yi)}function by(e){e.memoizedState!==null&&pt(hh,e);var t=xa.current,n=Zj(t,e.type);t!==n&&(pt(Au,e),pt(xa,n))}function mh(e){Au.current===e&&(on(xa),on(Au)),hh.current===e&&(on(hh),Fu._currentValue=Xs)}var Dm,_1;function As(e){if(Dm===void 0)try{throw Error()}catch(n){var t=n.stack.trim().match(/\n( *(at )?)/);Dm=t&&t[1]||"",_1=-1<n.stack.indexOf(`
|
|
42
|
+
at`)?" (<anonymous>)":-1<n.stack.indexOf("@")?"@unknown:0:0":""}return`
|
|
43
|
+
`+Dm+e+_1}var zm=!1;function Im(e,t){if(!e||zm)return"";zm=!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 p=h}Reflect.construct(e,[],f)}else{try{f.call()}catch(h){p=h}e.call(f.prototype)}}else{try{throw Error()}catch(h){p=h}(f=e())&&typeof f.catch=="function"&&f.catch(function(){})}}catch(h){if(h&&p&&typeof h.stack=="string")return[h.stack,p.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{zm=!1,Error.prepareStackTrace=n}return(n=e?e.displayName||e.name:"")?As(n):""}function rD(e,t){switch(e.tag){case 26:case 27:case 5:return As(e.type);case 16:return As("Lazy");case 13:return e.child!==t&&t!==null?As("Suspense Fallback"):As("Suspense");case 19:return As("SuspenseList");case 0:case 15:return Im(e.type,!1);case 11:return Im(e.type.render,!1);case 1:return Im(e.type,!0);case 31:return As("Activity");default:return""}}function k1(e){try{var t="",n=null;do t+=rD(e,n),n=e,e=e.return;while(e);return t}catch(r){return`
|
|
47
|
+
Error generating stack: `+r.message+`
|
|
48
|
+
`+r.stack}}var xy=Object.prototype.hasOwnProperty,q0=en.unstable_scheduleCallback,Lm=en.unstable_cancelCallback,aD=en.unstable_shouldYield,iD=en.unstable_requestPaint,dr=en.unstable_now,sD=en.unstable_getCurrentPriorityLevel,jC=en.unstable_ImmediatePriority,TC=en.unstable_UserBlockingPriority,gh=en.unstable_NormalPriority,oD=en.unstable_LowPriority,AC=en.unstable_IdlePriority,lD=en.log,cD=en.unstable_setDisableYieldValue,sd=null,fr=null;function Bi(e){if(typeof lD=="function"&&cD(e),fr&&typeof fr.setStrictMode=="function")try{fr.setStrictMode(sd,e)}catch{}}var hr=Math.clz32?Math.clz32:fD,uD=Math.log,dD=Math.LN2;function fD(e){return e>>>=0,e===0?32:31-(uD(e)/dD|0)|0}var Hd=256,Bd=262144,Vd=4194304;function Rs(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 Ap(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=Rs(r):(s&=o,s!==0?a=Rs(s):n||(n=o&~e,n!==0&&(a=Rs(n))))):(o=r&~i,o!==0?a=Rs(o):s!==0?a=Rs(s):n||(n=r&~e,n!==0&&(a=Rs(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 od(e,t){return(e.pendingLanes&~(e.suspendedLanes&~e.pingedLanes)&t)===0}function hD(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 RC(){var e=Vd;return Vd<<=1,!(Vd&62914560)&&(Vd=4194304),e}function Um(e){for(var t=[],n=0;31>n;n++)t.push(e);return t}function ld(e,t){e.pendingLanes|=t,t!==268435456&&(e.suspendedLanes=0,e.pingedLanes=0,e.warmLanes=0)}function pD(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-hr(n),f=1<<d;o[d]=0,l[d]=-1;var p=u[d];if(p!==null)for(u[d]=null,d=0;d<p.length;d++){var h=p[d];h!==null&&(h.lane&=-536870913)}n&=~f}r!==0&&$C(e,r,0),i!==0&&a===0&&e.tag!==0&&(e.suspendedLanes|=i&~(s&~t))}function $C(e,t,n){e.pendingLanes|=t,e.suspendedLanes&=~t;var r=31-hr(t);e.entangledLanes|=t,e.entanglements[r]=e.entanglements[r]|1073741824|n&261930}function OC(e,t){var n=e.entangledLanes|=t;for(e=e.entanglements;n;){var r=31-hr(n),a=1<<r;a&t|e[r]&t&&(e[r]|=t),n&=~a}}function MC(e,t){var n=t&-t;return n=n&42?1:H0(n),n&(e.suspendedLanes|t)?0:n}function H0(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 B0(e){return e&=-e,2<e?8<e?e&134217727?32:268435456:8:2}function PC(){var e=Je.p;return e!==0?e:(e=window.event,e===void 0?32:a2(e.type))}function E1(e,t){var n=Je.p;try{return Je.p=e,t()}finally{Je.p=n}}var ms=Math.random().toString(36).slice(2),gn="__reactFiber$"+ms,Jn="__reactProps$"+ms,sc="__reactContainer$"+ms,wy="__reactEvents$"+ms,mD="__reactListeners$"+ms,gD="__reactHandles$"+ms,C1="__reactResources$"+ms,cd="__reactMarker$"+ms;function V0(e){delete e[gn],delete e[Jn],delete e[wy],delete e[mD],delete e[gD]}function Yo(e){var t=e[gn];if(t)return t;for(var n=e.parentNode;n;){if(t=n[sc]||n[gn]){if(n=t.alternate,t.child!==null||n!==null&&n.child!==null)for(e=OS(e);e!==null;){if(n=e[gn])return n;e=OS(e)}return t}e=n,n=e.parentNode}return null}function oc(e){if(e=e[gn]||e[sc]){var t=e.tag;if(t===5||t===6||t===13||t===31||t===26||t===27||t===3)return e}return null}function Kc(e){var t=e.tag;if(t===5||t===26||t===27||t===6)return e.stateNode;throw Error(te(33))}function ul(e){var t=e[C1];return t||(t=e[C1]={hoistableStyles:new Map,hoistableScripts:new Map}),t}function sn(e){e[cd]=!0}var DC=new Set,zC={};function So(e,t){Il(e,t),Il(e+"Capture",t)}function Il(e,t){for(zC[e]=t,e=0;e<t.length;e++)DC.add(t[e])}var yD=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]*$"),N1={},j1={};function vD(e){return xy.call(j1,e)?!0:xy.call(N1,e)?!1:yD.test(e)?j1[e]=!0:(N1[e]=!0,!1)}function $f(e,t,n){if(vD(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 Kd(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 Nr(e){switch(typeof e){case"bigint":case"boolean":case"number":case"string":case"undefined":return e;case"object":return e;default:return""}}function IC(e){var t=e.type;return(e=e.nodeName)&&e.toLowerCase()==="input"&&(t==="checkbox"||t==="radio")}function bD(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 Sy(e){if(!e._valueTracker){var t=IC(e)?"checked":"value";e._valueTracker=bD(e,t,""+e[t])}}function LC(e){if(!e)return!1;var t=e._valueTracker;if(!t)return!0;var n=t.getValue(),r="";return e&&(r=IC(e)?e.checked?"true":"false":e.value),e=r,e!==n?(t.setValue(e),!0):!1}function yh(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 xD=/[\n"\\]/g;function $r(e){return e.replace(xD,function(t){return"\\"+t.charCodeAt(0).toString(16)+" "})}function _y(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=""+Nr(t)):e.value!==""+Nr(t)&&(e.value=""+Nr(t)):s!=="submit"&&s!=="reset"||e.removeAttribute("value"),t!=null?ky(e,s,Nr(t)):n!=null?ky(e,s,Nr(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=""+Nr(o):e.removeAttribute("name")}function UC(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)){Sy(e);return}n=n!=null?""+Nr(n):"",t=t!=null?""+Nr(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),Sy(e)}function ky(e,t,n){t==="number"&&yh(e.ownerDocument)===e||e.defaultValue===""+n||(e.defaultValue=""+n)}function dl(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=""+Nr(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 FC(e,t,n){if(t!=null&&(t=""+Nr(t),t!==e.value&&(e.value=t),n==null)){e.defaultValue!==t&&(e.defaultValue=t);return}e.defaultValue=n!=null?""+Nr(n):""}function qC(e,t,n,r){if(t==null){if(r!=null){if(n!=null)throw Error(te(92));if(Vc(r)){if(1<r.length)throw Error(te(93));r=r[0]}n=r}n==null&&(n=""),t=n}n=Nr(t),e.defaultValue=n,r=e.textContent,r===n&&r!==""&&r!==null&&(e.value=r),Sy(e)}function Ll(e,t){if(t){var n=e.firstChild;if(n&&n===e.lastChild&&n.nodeType===3){n.nodeValue=t;return}}e.textContent=t}var wD=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 T1(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||wD.has(t)?t==="float"?e.cssFloat=n:e[t]=(""+n).trim():e[t]=n+"px"}function HC(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&&T1(e,a,r)}else for(var i in t)t.hasOwnProperty(i)&&T1(e,i,t[i])}function K0(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 SD=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"]]),_D=/^[\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 Of(e){return _D.test(""+e)?"javascript:throw new Error('React has blocked a javascript: URL as a security precaution.')":e}function Ya(){}var Ey=null;function Z0(e){return e=e.target||e.srcElement||window,e.correspondingUseElement&&(e=e.correspondingUseElement),e.nodeType===3?e.parentNode:e}var Xo=null,fl=null;function A1(e){var t=oc(e);if(t&&(e=t.stateNode)){var n=e[Jn]||null;e:switch(e=t.stateNode,t.type){case"input":if(_y(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="'+$r(""+t)+'"][type="radio"]'),t=0;t<n.length;t++){var r=n[t];if(r!==e&&r.form===e.form){var a=r[Jn]||null;if(!a)throw Error(te(90));_y(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&&LC(r)}break e;case"textarea":FC(e,n.value,n.defaultValue);break e;case"select":t=n.value,t!=null&&dl(e,!!n.multiple,t,!1)}}}var Fm=!1;function BC(e,t,n){if(Fm)return e(t,n);Fm=!0;try{var r=e(t);return r}finally{if(Fm=!1,(Xo!==null||fl!==null)&&(qp(),Xo&&(t=Xo,e=fl,fl=Xo=null,A1(t),e)))for(t=0;t<e.length;t++)A1(e[t])}}function Ru(e,t){var n=e.stateNode;if(n===null)return null;var r=n[Jn]||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"),Cy=!1;if(ai)try{var jc={};Object.defineProperty(jc,"passive",{get:function(){Cy=!0}}),window.addEventListener("test",jc,jc),window.removeEventListener("test",jc,jc)}catch{Cy=!1}var Vi=null,G0=null,Mf=null;function VC(){if(Mf)return Mf;var e,t=G0,n=t.length,r,a="value"in Vi?Vi.value:Vi.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 Mf=a.slice(e,1<r?1-r:void 0)}function Pf(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 Zd(){return!0}function R1(){return!1}function er(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)?Zd:R1,this.isPropagationStopped=R1,this}return Nt(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=Zd)},stopPropagation:function(){var n=this.nativeEvent;n&&(n.stopPropagation?n.stopPropagation():typeof n.cancelBubble!="unknown"&&(n.cancelBubble=!0),this.isPropagationStopped=Zd)},persist:function(){},isPersistent:Zd}),t}var _o={eventPhase:0,bubbles:0,cancelable:0,timeStamp:function(e){return e.timeStamp||Date.now()},defaultPrevented:0,isTrusted:0},Rp=er(_o),ud=Nt({},_o,{view:0,detail:0}),kD=er(ud),qm,Hm,Tc,$p=Nt({},ud,{screenX:0,screenY:0,clientX:0,clientY:0,pageX:0,pageY:0,ctrlKey:0,shiftKey:0,altKey:0,metaKey:0,getModifierState:Q0,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!==Tc&&(Tc&&e.type==="mousemove"?(qm=e.screenX-Tc.screenX,Hm=e.screenY-Tc.screenY):Hm=qm=0,Tc=e),qm)},movementY:function(e){return"movementY"in e?e.movementY:Hm}}),$1=er($p),ED=Nt({},$p,{dataTransfer:0}),CD=er(ED),ND=Nt({},ud,{relatedTarget:0}),Bm=er(ND),jD=Nt({},_o,{animationName:0,elapsedTime:0,pseudoElement:0}),TD=er(jD),AD=Nt({},_o,{clipboardData:function(e){return"clipboardData"in e?e.clipboardData:window.clipboardData}}),RD=er(AD),$D=Nt({},_o,{data:0}),O1=er($D),OD={Esc:"Escape",Spacebar:" ",Left:"ArrowLeft",Up:"ArrowUp",Right:"ArrowRight",Down:"ArrowDown",Del:"Delete",Win:"OS",Menu:"ContextMenu",Apps:"ContextMenu",Scroll:"ScrollLock",MozPrintableKey:"Unidentified"},MD={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"},PD={Alt:"altKey",Control:"ctrlKey",Meta:"metaKey",Shift:"shiftKey"};function DD(e){var t=this.nativeEvent;return t.getModifierState?t.getModifierState(e):(e=PD[e])?!!t[e]:!1}function Q0(){return DD}var zD=Nt({},ud,{key:function(e){if(e.key){var t=OD[e.key]||e.key;if(t!=="Unidentified")return t}return e.type==="keypress"?(e=Pf(e),e===13?"Enter":String.fromCharCode(e)):e.type==="keydown"||e.type==="keyup"?MD[e.keyCode]||"Unidentified":""},code:0,location:0,ctrlKey:0,shiftKey:0,altKey:0,metaKey:0,repeat:0,locale:0,getModifierState:Q0,charCode:function(e){return e.type==="keypress"?Pf(e):0},keyCode:function(e){return e.type==="keydown"||e.type==="keyup"?e.keyCode:0},which:function(e){return e.type==="keypress"?Pf(e):e.type==="keydown"||e.type==="keyup"?e.keyCode:0}}),ID=er(zD),LD=Nt({},$p,{pointerId:0,width:0,height:0,pressure:0,tangentialPressure:0,tiltX:0,tiltY:0,twist:0,pointerType:0,isPrimary:0}),M1=er(LD),UD=Nt({},ud,{touches:0,targetTouches:0,changedTouches:0,altKey:0,metaKey:0,ctrlKey:0,shiftKey:0,getModifierState:Q0}),FD=er(UD),qD=Nt({},_o,{propertyName:0,elapsedTime:0,pseudoElement:0}),HD=er(qD),BD=Nt({},$p,{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}),VD=er(BD),KD=Nt({},_o,{newState:0,oldState:0}),ZD=er(KD),GD=[9,13,27,32],Y0=ai&&"CompositionEvent"in window,ru=null;ai&&"documentMode"in document&&(ru=document.documentMode);var QD=ai&&"TextEvent"in window&&!ru,KC=ai&&(!Y0||ru&&8<ru&&11>=ru),P1=" ",D1=!1;function ZC(e,t){switch(e){case"keyup":return GD.indexOf(t.keyCode)!==-1;case"keydown":return t.keyCode!==229;case"keypress":case"mousedown":case"focusout":return!0;default:return!1}}function GC(e){return e=e.detail,typeof e=="object"&&"data"in e?e.data:null}var Wo=!1;function YD(e,t){switch(e){case"compositionend":return GC(t);case"keypress":return t.which!==32?null:(D1=!0,P1);case"textInput":return e=t.data,e===P1&&D1?null:e;default:return null}}function XD(e,t){if(Wo)return e==="compositionend"||!Y0&&ZC(e,t)?(e=VC(),Mf=G0=Vi=null,Wo=!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 KC&&t.locale!=="ko"?null:t.data;default:return null}}var WD={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 z1(e){var t=e&&e.nodeName&&e.nodeName.toLowerCase();return t==="input"?!!WD[e.type]:t==="textarea"}function QC(e,t,n,r){Xo?fl?fl.push(r):fl=[r]:Xo=r,t=Ph(t,"onChange"),0<t.length&&(n=new Rp("onChange","change",null,n,r),e.push({event:n,listeners:t}))}var au=null,$u=null;function JD(e){Bj(e,0)}function Op(e){var t=Kc(e);if(LC(t))return e}function I1(e,t){if(e==="change")return t}var YC=!1;if(ai){var Vm;if(ai){var Km="oninput"in document;if(!Km){var L1=document.createElement("div");L1.setAttribute("oninput","return;"),Km=typeof L1.oninput=="function"}Vm=Km}else Vm=!1;YC=Vm&&(!document.documentMode||9<document.documentMode)}function U1(){au&&(au.detachEvent("onpropertychange",XC),$u=au=null)}function XC(e){if(e.propertyName==="value"&&Op($u)){var t=[];QC(t,$u,e,Z0(e)),BC(JD,t)}}function e4(e,t,n){e==="focusin"?(U1(),au=t,$u=n,au.attachEvent("onpropertychange",XC)):e==="focusout"&&U1()}function t4(e){if(e==="selectionchange"||e==="keyup"||e==="keydown")return Op($u)}function n4(e,t){if(e==="click")return Op(t)}function r4(e,t){if(e==="input"||e==="change")return Op(t)}function a4(e,t){return e===t&&(e!==0||1/e===1/t)||e!==e&&t!==t}var yr=typeof Object.is=="function"?Object.is:a4;function Ou(e,t){if(yr(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(!xy.call(t,a)||!yr(e[a],t[a]))return!1}return!0}function F1(e){for(;e&&e.firstChild;)e=e.firstChild;return e}function q1(e,t){var n=F1(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=F1(n)}}function WC(e,t){return e&&t?e===t?!0:e&&e.nodeType===3?!1:t&&t.nodeType===3?WC(e,t.parentNode):"contains"in e?e.contains(t):e.compareDocumentPosition?!!(e.compareDocumentPosition(t)&16):!1:!1}function JC(e){e=e!=null&&e.ownerDocument!=null&&e.ownerDocument.defaultView!=null?e.ownerDocument.defaultView:window;for(var t=yh(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=yh(e.document)}return t}function X0(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 i4=ai&&"documentMode"in document&&11>=document.documentMode,Jo=null,Ny=null,iu=null,jy=!1;function H1(e,t,n){var r=n.window===n?n.document:n.nodeType===9?n:n.ownerDocument;jy||Jo==null||Jo!==yh(r)||(r=Jo,"selectionStart"in r&&X0(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}),iu&&Ou(iu,r)||(iu=r,r=Ph(Ny,"onSelect"),0<r.length&&(t=new Rp("onSelect","select",null,t,n),e.push({event:t,listeners:r}),t.target=Jo)))}function ks(e,t){var n={};return n[e.toLowerCase()]=t.toLowerCase(),n["Webkit"+e]="webkit"+t,n["Moz"+e]="moz"+t,n}var el={animationend:ks("Animation","AnimationEnd"),animationiteration:ks("Animation","AnimationIteration"),animationstart:ks("Animation","AnimationStart"),transitionrun:ks("Transition","TransitionRun"),transitionstart:ks("Transition","TransitionStart"),transitioncancel:ks("Transition","TransitionCancel"),transitionend:ks("Transition","TransitionEnd")},Zm={},eN={};ai&&(eN=document.createElement("div").style,"AnimationEvent"in window||(delete el.animationend.animation,delete el.animationiteration.animation,delete el.animationstart.animation),"TransitionEvent"in window||delete el.transitionend.transition);function ko(e){if(Zm[e])return Zm[e];if(!el[e])return e;var t=el[e],n;for(n in t)if(t.hasOwnProperty(n)&&n in eN)return Zm[e]=t[n];return e}var tN=ko("animationend"),nN=ko("animationiteration"),rN=ko("animationstart"),s4=ko("transitionrun"),o4=ko("transitionstart"),l4=ko("transitioncancel"),aN=ko("transitionend"),iN=new Map,Ty="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(" ");Ty.push("scrollEnd");function na(e,t){iN.set(e,t),So(t,[e])}var vh=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)},kr=[],tl=0,W0=0;function Mp(){for(var e=tl,t=W0=tl=0;t<e;){var n=kr[t];kr[t++]=null;var r=kr[t];kr[t++]=null;var a=kr[t];kr[t++]=null;var i=kr[t];if(kr[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&&sN(n,a,i)}}function Pp(e,t,n,r){kr[tl++]=e,kr[tl++]=t,kr[tl++]=n,kr[tl++]=r,W0|=r,e.lanes|=r,e=e.alternate,e!==null&&(e.lanes|=r)}function J0(e,t,n,r){return Pp(e,t,n,r),bh(e)}function Eo(e,t){return Pp(e,null,null,t),bh(e)}function sN(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-hr(n),e=i.hiddenUpdates,r=e[a],r===null?e[a]=[t]:r.push(t),t.lane=n|536870912),i):null}function bh(e){if(50<pu)throw pu=0,Yy=null,Error(te(185));for(var t=e.return;t!==null;)e=t,t=e.return;return e.tag===3?e.stateNode:null}var nl={};function c4(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 cr(e,t,n,r){return new c4(e,t,n,r)}function eb(e){return e=e.prototype,!(!e||!e.isReactComponent)}function Ja(e,t){var n=e.alternate;return n===null?(n=cr(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 oN(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 Df(e,t,n,r,a,i){var s=0;if(r=e,typeof e=="function")eb(e)&&(s=1);else if(typeof e=="string")s=pz(e,n,xa.current)?26:e==="html"||e==="head"||e==="body"?27:5;else e:switch(e){case gy:return e=cr(31,n,t,a),e.elementType=gy,e.lanes=i,e;case Go:return Ws(n.children,a,i,t);case CC:s=8,a|=24;break;case hy:return e=cr(12,n,t,a|2),e.elementType=hy,e.lanes=i,e;case py:return e=cr(13,n,t,a),e.elementType=py,e.lanes=i,e;case my:return e=cr(19,n,t,a),e.elementType=my,e.lanes=i,e;default:if(typeof e=="object"&&e!==null)switch(e.$$typeof){case Qa:s=10;break e;case NC:s=9;break e;case U0:s=11;break e;case F0:s=14;break e;case Ei:s=16,r=null;break e}s=29,n=Error(te(130,e===null?"null":typeof e,"")),r=null}return t=cr(s,n,t,a),t.elementType=e,t.type=r,t.lanes=i,t}function Ws(e,t,n,r){return e=cr(7,e,r,t),e.lanes=n,e}function Gm(e,t,n){return e=cr(6,e,null,t),e.lanes=n,e}function lN(e){var t=cr(18,null,null,0);return t.stateNode=e,t}function Qm(e,t,n){return t=cr(4,e.children!==null?e.children:[],e.key,t),t.lanes=n,t.stateNode={containerInfo:e.containerInfo,pendingChildren:null,implementation:e.implementation},t}var B1=new WeakMap;function Or(e,t){if(typeof e=="object"&&e!==null){var n=B1.get(e);return n!==void 0?n:(t={value:e,source:t,stack:k1(t)},B1.set(e,t),t)}return{value:e,source:t,stack:k1(t)}}var rl=[],al=0,xh=null,Mu=0,jr=[],Tr=0,os=null,ga=1,ya="";function Fa(e,t){rl[al++]=Mu,rl[al++]=xh,xh=e,Mu=t}function cN(e,t,n){jr[Tr++]=ga,jr[Tr++]=ya,jr[Tr++]=os,os=e;var r=ga;e=ya;var a=32-hr(r)-1;r&=~(1<<a),n+=1;var i=32-hr(t)+a;if(30<i){var s=a-a%5;i=(r&(1<<s)-1).toString(32),r>>=s,a-=s,ga=1<<32-hr(t)+a|n<<a|r,ya=i+e}else ga=1<<i|n<<a|r,ya=e}function tb(e){e.return!==null&&(Fa(e,1),cN(e,1,0))}function nb(e){for(;e===xh;)xh=rl[--al],rl[al]=null,Mu=rl[--al],rl[al]=null;for(;e===os;)os=jr[--Tr],jr[Tr]=null,ya=jr[--Tr],jr[Tr]=null,ga=jr[--Tr],jr[Tr]=null}function uN(e,t){jr[Tr++]=ga,jr[Tr++]=ya,jr[Tr++]=os,ga=t.id,ya=t.overflow,os=e}var yn=null,xt=null,Qe=!1,Xi=null,Mr=!1,Ay=Error(te(519));function ls(e){var t=Error(te(418,1<arguments.length&&arguments[1]!==void 0&&arguments[1]?"text":"HTML",""));throw Pu(Or(t,e)),Ay}function V1(e){var t=e.stateNode,n=e.type,r=e.memoizedProps;switch(t[gn]=e,t[Jn]=r,n){case"dialog":He("cancel",t),He("close",t);break;case"iframe":case"object":case"embed":He("load",t);break;case"video":case"audio":for(n=0;n<Lu.length;n++)He(Lu[n],t);break;case"source":He("error",t);break;case"img":case"image":case"link":He("error",t),He("load",t);break;case"details":He("toggle",t);break;case"input":He("invalid",t),UC(t,r.value,r.defaultValue,r.checked,r.defaultChecked,r.type,r.name,!0);break;case"select":He("invalid",t);break;case"textarea":He("invalid",t),qC(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||Kj(t.textContent,n)?(r.popover!=null&&(He("beforetoggle",t),He("toggle",t)),r.onScroll!=null&&He("scroll",t),r.onScrollEnd!=null&&He("scrollend",t),r.onClick!=null&&(t.onclick=Ya),t=!0):t=!1,t||ls(e,!0)}function K1(e){for(yn=e.return;yn;)switch(yn.tag){case 5:case 31:case 13:Mr=!1;return;case 27:case 3:Mr=!0;return;default:yn=yn.return}}function Ao(e){if(e!==yn)return!1;if(!Qe)return K1(e),Qe=!0,!1;var t=e.tag,n;if((n=t!==3&&t!==27)&&((n=t===5)&&(n=e.type,n=!(n!=="form"&&n!=="button")||tv(e.type,e.memoizedProps)),n=!n),n&&xt&&ls(e),K1(e),t===13){if(e=e.memoizedState,e=e!==null?e.dehydrated:null,!e)throw Error(te(317));xt=$S(e)}else if(t===31){if(e=e.memoizedState,e=e!==null?e.dehydrated:null,!e)throw Error(te(317));xt=$S(e)}else t===27?(t=xt,gs(e.type)?(e=iv,iv=null,xt=e):xt=t):xt=yn?Dr(e.stateNode.nextSibling):null;return!0}function ro(){xt=yn=null,Qe=!1}function Ym(){var e=Xi;return e!==null&&(Zn===null?Zn=e:Zn.push.apply(Zn,e),Xi=null),e}function Pu(e){Xi===null?Xi=[e]:Xi.push(e)}var Ry=_a(null),Co=null,Xa=null;function Ai(e,t,n){pt(Ry,t._currentValue),t._currentValue=n}function ei(e){e._currentValue=Ry.current,on(Ry)}function $y(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 Oy(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),$y(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),$y(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 lc(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;yr(a.pendingProps.value,s.value)||(e!==null?e.push(o):e=[o])}}else if(a===hh.current){if(s=a.alternate,s===null)throw Error(te(387));s.memoizedState.memoizedState!==a.memoizedState.memoizedState&&(e!==null?e.push(Fu):e=[Fu])}a=a.return}e!==null&&Oy(t,e,n,r),t.flags|=262144}function wh(e){for(e=e.firstContext;e!==null;){if(!yr(e.context._currentValue,e.memoizedValue))return!0;e=e.next}return!1}function ao(e){Co=e,Xa=null,e=e.dependencies,e!==null&&(e.firstContext=null)}function vn(e){return dN(Co,e)}function Gd(e,t){return Co===null&&ao(e),dN(e,t)}function dN(e,t){var n=t._currentValue;if(t={context:t,memoizedValue:n,next:null},Xa===null){if(e===null)throw Error(te(308));Xa=t,e.dependencies={lanes:0,firstContext:t},e.flags|=524288}else Xa=Xa.next=t;return n}var u4=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()})}},d4=en.unstable_scheduleCallback,f4=en.unstable_NormalPriority,Kt={$$typeof:Qa,Consumer:null,Provider:null,_currentValue:null,_currentValue2:null,_threadCount:0};function rb(){return{controller:new u4,data:new Map,refCount:0}}function dd(e){e.refCount--,e.refCount===0&&d4(f4,function(){e.controller.abort()})}var su=null,My=0,Ul=0,hl=null;function h4(e,t){if(su===null){var n=su=[];My=0,Ul=jb(),hl={status:"pending",value:void 0,then:function(r){n.push(r)}}}return My++,t.then(Z1,Z1),t}function Z1(){if(--My===0&&su!==null){hl!==null&&(hl.status="fulfilled");var e=su;su=null,Ul=0,hl=null;for(var t=0;t<e.length;t++)(0,e[t])()}}function p4(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 G1=Re.S;Re.S=function(e,t){Ej=dr(),typeof t=="object"&&t!==null&&typeof t.then=="function"&&h4(e,t),G1!==null&&G1(e,t)};var Js=_a(null);function ab(){var e=Js.current;return e!==null?e:dt.pooledCache}function zf(e,t){t===null?pt(Js,Js.current):pt(Js,t.pool)}function fN(){var e=ab();return e===null?null:{parent:Kt._currentValue,pool:e}}var cc=Error(te(460)),ib=Error(te(474)),Dp=Error(te(542)),Sh={then:function(){}};function Q1(e){return e=e.status,e==="fulfilled"||e==="rejected"}function hN(e,t,n){switch(n=e[n],n===void 0?e.push(t):n!==t&&(t.then(Ya,Ya),t=n),t.status){case"fulfilled":return t.value;case"rejected":throw e=t.reason,X1(e),e;default:if(typeof t.status=="string")t.then(Ya,Ya);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,X1(e),e}throw eo=t,cc}}function $s(e){try{var t=e._init;return t(e._payload)}catch(n){throw n!==null&&typeof n=="object"&&typeof n.then=="function"?(eo=n,cc):n}}var eo=null;function Y1(){if(eo===null)throw Error(te(459));var e=eo;return eo=null,e}function X1(e){if(e===cc||e===Dp)throw Error(te(483))}var pl=null,Du=0;function Qd(e){var t=Du;return Du+=1,pl===null&&(pl=[]),hN(pl,e,t)}function Ac(e,t){t=t.props.ref,e.ref=t!==void 0?t:null}function Yd(e,t){throw t.$$typeof===eD?Error(te(525)):(e=Object.prototype.toString.call(t),Error(te(31,e==="[object Object]"?"object with keys {"+Object.keys(t).join(", ")+"}":e)))}function pN(e){function t(g,v){if(e){var x=g.deletions;x===null?(g.deletions=[v],g.flags|=16):x.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=Ja(g,v),g.index=0,g.sibling=null,g}function i(g,v,x){return g.index=x,e?(x=g.alternate,x!==null?(x=x.index,x<v?(g.flags|=67108866,v):x):(g.flags|=67108866,v)):(g.flags|=1048576,v)}function s(g){return e&&g.alternate===null&&(g.flags|=67108866),g}function o(g,v,x,S){return v===null||v.tag!==6?(v=Gm(x,g.mode,S),v.return=g,v):(v=a(v,x),v.return=g,v)}function l(g,v,x,S){var k=x.type;return k===Go?d(g,v,x.props.children,S,x.key):v!==null&&(v.elementType===k||typeof k=="object"&&k!==null&&k.$$typeof===Ei&&$s(k)===v.type)?(v=a(v,x.props),Ac(v,x),v.return=g,v):(v=Df(x.type,x.key,x.props,null,g.mode,S),Ac(v,x),v.return=g,v)}function u(g,v,x,S){return v===null||v.tag!==4||v.stateNode.containerInfo!==x.containerInfo||v.stateNode.implementation!==x.implementation?(v=Qm(x,g.mode,S),v.return=g,v):(v=a(v,x.children||[]),v.return=g,v)}function d(g,v,x,S,k){return v===null||v.tag!==7?(v=Ws(x,g.mode,S,k),v.return=g,v):(v=a(v,x),v.return=g,v)}function f(g,v,x){if(typeof v=="string"&&v!==""||typeof v=="number"||typeof v=="bigint")return v=Gm(""+v,g.mode,x),v.return=g,v;if(typeof v=="object"&&v!==null){switch(v.$$typeof){case qd:return x=Df(v.type,v.key,v.props,null,g.mode,x),Ac(x,v),x.return=g,x;case Bc:return v=Qm(v,g.mode,x),v.return=g,v;case Ei:return v=$s(v),f(g,v,x)}if(Vc(v)||Nc(v))return v=Ws(v,g.mode,x,null),v.return=g,v;if(typeof v.then=="function")return f(g,Qd(v),x);if(v.$$typeof===Qa)return f(g,Gd(g,v),x);Yd(g,v)}return null}function p(g,v,x,S){var k=v!==null?v.key:null;if(typeof x=="string"&&x!==""||typeof x=="number"||typeof x=="bigint")return k!==null?null:o(g,v,""+x,S);if(typeof x=="object"&&x!==null){switch(x.$$typeof){case qd:return x.key===k?l(g,v,x,S):null;case Bc:return x.key===k?u(g,v,x,S):null;case Ei:return x=$s(x),p(g,v,x,S)}if(Vc(x)||Nc(x))return k!==null?null:d(g,v,x,S,null);if(typeof x.then=="function")return p(g,v,Qd(x),S);if(x.$$typeof===Qa)return p(g,v,Gd(g,x),S);Yd(g,x)}return null}function h(g,v,x,S,k){if(typeof S=="string"&&S!==""||typeof S=="number"||typeof S=="bigint")return g=g.get(x)||null,o(v,g,""+S,k);if(typeof S=="object"&&S!==null){switch(S.$$typeof){case qd:return g=g.get(S.key===null?x:S.key)||null,l(v,g,S,k);case Bc:return g=g.get(S.key===null?x:S.key)||null,u(v,g,S,k);case Ei:return S=$s(S),h(g,v,x,S,k)}if(Vc(S)||Nc(S))return g=g.get(x)||null,d(v,g,S,k,null);if(typeof S.then=="function")return h(g,v,x,Qd(S),k);if(S.$$typeof===Qa)return h(g,v,x,Gd(v,S),k);Yd(v,S)}return null}function y(g,v,x,S){for(var k=null,C=null,N=v,P=v=0,R=null;N!==null&&P<x.length;P++){N.index>P?(R=N,N=null):R=N.sibling;var $=p(g,N,x[P],S);if($===null){N===null&&(N=R);break}e&&N&&$.alternate===null&&t(g,N),v=i($,v,P),C===null?k=$:C.sibling=$,C=$,N=R}if(P===x.length)return n(g,N),Qe&&Fa(g,P),k;if(N===null){for(;P<x.length;P++)N=f(g,x[P],S),N!==null&&(v=i(N,v,P),C===null?k=N:C.sibling=N,C=N);return Qe&&Fa(g,P),k}for(N=r(N);P<x.length;P++)R=h(N,g,P,x[P],S),R!==null&&(e&&R.alternate!==null&&N.delete(R.key===null?P:R.key),v=i(R,v,P),C===null?k=R:C.sibling=R,C=R);return e&&N.forEach(function(j){return t(g,j)}),Qe&&Fa(g,P),k}function m(g,v,x,S){if(x==null)throw Error(te(151));for(var k=null,C=null,N=v,P=v=0,R=null,$=x.next();N!==null&&!$.done;P++,$=x.next()){N.index>P?(R=N,N=null):R=N.sibling;var j=p(g,N,$.value,S);if(j===null){N===null&&(N=R);break}e&&N&&j.alternate===null&&t(g,N),v=i(j,v,P),C===null?k=j:C.sibling=j,C=j,N=R}if($.done)return n(g,N),Qe&&Fa(g,P),k;if(N===null){for(;!$.done;P++,$=x.next())$=f(g,$.value,S),$!==null&&(v=i($,v,P),C===null?k=$:C.sibling=$,C=$);return Qe&&Fa(g,P),k}for(N=r(N);!$.done;P++,$=x.next())$=h(N,g,P,$.value,S),$!==null&&(e&&$.alternate!==null&&N.delete($.key===null?P:$.key),v=i($,v,P),C===null?k=$:C.sibling=$,C=$);return e&&N.forEach(function(O){return t(g,O)}),Qe&&Fa(g,P),k}function b(g,v,x,S){if(typeof x=="object"&&x!==null&&x.type===Go&&x.key===null&&(x=x.props.children),typeof x=="object"&&x!==null){switch(x.$$typeof){case qd:e:{for(var k=x.key;v!==null;){if(v.key===k){if(k=x.type,k===Go){if(v.tag===7){n(g,v.sibling),S=a(v,x.props.children),S.return=g,g=S;break e}}else if(v.elementType===k||typeof k=="object"&&k!==null&&k.$$typeof===Ei&&$s(k)===v.type){n(g,v.sibling),S=a(v,x.props),Ac(S,x),S.return=g,g=S;break e}n(g,v);break}else t(g,v);v=v.sibling}x.type===Go?(S=Ws(x.props.children,g.mode,S,x.key),S.return=g,g=S):(S=Df(x.type,x.key,x.props,null,g.mode,S),Ac(S,x),S.return=g,g=S)}return s(g);case Bc:e:{for(k=x.key;v!==null;){if(v.key===k)if(v.tag===4&&v.stateNode.containerInfo===x.containerInfo&&v.stateNode.implementation===x.implementation){n(g,v.sibling),S=a(v,x.children||[]),S.return=g,g=S;break e}else{n(g,v);break}else t(g,v);v=v.sibling}S=Qm(x,g.mode,S),S.return=g,g=S}return s(g);case Ei:return x=$s(x),b(g,v,x,S)}if(Vc(x))return y(g,v,x,S);if(Nc(x)){if(k=Nc(x),typeof k!="function")throw Error(te(150));return x=k.call(x),m(g,v,x,S)}if(typeof x.then=="function")return b(g,v,Qd(x),S);if(x.$$typeof===Qa)return b(g,v,Gd(g,x),S);Yd(g,x)}return typeof x=="string"&&x!==""||typeof x=="number"||typeof x=="bigint"?(x=""+x,v!==null&&v.tag===6?(n(g,v.sibling),S=a(v,x),S.return=g,g=S):(n(g,v),S=Gm(x,g.mode,S),S.return=g,g=S),s(g)):n(g,v)}return function(g,v,x,S){try{Du=0;var k=b(g,v,x,S);return pl=null,k}catch(N){if(N===cc||N===Dp)throw N;var C=cr(29,N,null,g.mode);return C.lanes=S,C.return=g,C}finally{}}}var io=pN(!0),mN=pN(!1),Ci=!1;function sb(e){e.updateQueue={baseState:e.memoizedState,firstBaseUpdate:null,lastBaseUpdate:null,shared:{pending:null,lanes:0,hiddenCallbacks:null},callbacks:null}}function Py(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 Wi(e){return{lane:e,tag:0,payload:null,callback:null,next:null}}function Ji(e,t,n){var r=e.updateQueue;if(r===null)return null;if(r=r.shared,We&2){var a=r.pending;return a===null?t.next=t:(t.next=a.next,a.next=t),r.pending=t,t=bh(e),sN(e,null,n),t}return Pp(e,r,t,n),bh(e)}function ou(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,OC(e,n)}}function Xm(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 Dy=!1;function lu(){if(Dy){var e=hl;if(e!==null)throw e}}function cu(e,t,n,r){Dy=!1;var a=e.updateQueue;Ci=!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 p=o.lane&-536870913,h=p!==o.lane;if(h?(Ke&p)===p:(r&p)===p){p!==0&&p===Ul&&(Dy=!0),d!==null&&(d=d.next={lane:0,tag:o.tag,payload:o.payload,callback:null,next:null});e:{var y=e,m=o;p=t;var b=n;switch(m.tag){case 1:if(y=m.payload,typeof y=="function"){f=y.call(b,f,p);break e}f=y;break e;case 3:y.flags=y.flags&-65537|128;case 0:if(y=m.payload,p=typeof y=="function"?y.call(b,f,p):y,p==null)break e;f=Nt({},f,p);break e;case 2:Ci=!0}}p=o.callback,p!==null&&(e.flags|=64,h&&(e.flags|=8192),h=a.callbacks,h===null?a.callbacks=[p]:h.push(p))}else h={lane:p,tag:o.tag,payload:o.payload,callback:o.callback,next:null},d===null?(u=d=h,l=f):d=d.next=h,s|=p;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),us|=s,e.lanes=s,e.memoizedState=f}}function gN(e,t){if(typeof e!="function")throw Error(te(191,e));e.call(t)}function yN(e,t){var n=e.callbacks;if(n!==null)for(e.callbacks=null,e=0;e<n.length;e++)gN(n[e],t)}var Fl=_a(null),_h=_a(0);function W1(e,t){e=li,pt(_h,e),pt(Fl,t),li=e|t.baseLanes}function zy(){pt(_h,li),pt(Fl,Fl.current)}function ob(){li=_h.current,on(Fl),on(_h)}var vr=_a(null),Pr=null;function Ri(e){var t=e.alternate;pt(Ft,Ft.current&1),pt(vr,e),Pr===null&&(t===null||Fl.current!==null||t.memoizedState!==null)&&(Pr=e)}function Iy(e){pt(Ft,Ft.current),pt(vr,e),Pr===null&&(Pr=e)}function vN(e){e.tag===22?(pt(Ft,Ft.current),pt(vr,e),Pr===null&&(Pr=e)):$i()}function $i(){pt(Ft,Ft.current),pt(vr,vr.current)}function sr(e){on(vr),Pr===e&&(Pr=null),on(Ft)}var Ft=_a(0);function kh(e){for(var t=e;t!==null;){if(t.tag===13){var n=t.memoizedState;if(n!==null&&(n=n.dehydrated,n===null||rv(n)||av(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,Bt=null,Eh=!1,ml=!1,so=!1,Ch=0,zu=0,gl=null,m4=0;function Dt(){throw Error(te(321))}function lb(e,t){if(t===null)return!1;for(var n=0;n<t.length&&n<e.length;n++)if(!yr(e[n],t[n]))return!1;return!0}function cb(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?QN:xb,so=!1,i=n(r,a),so=!1,ml&&(i=xN(t,n,r,a)),bN(e),i}function bN(e){Re.H=Iu;var t=ot!==null&&ot.next!==null;if(ii=0,Bt=ot=Pe=null,Eh=!1,zu=0,gl=null,t)throw Error(te(300));e===null||Zt||(e=e.dependencies,e!==null&&wh(e)&&(Zt=!0))}function xN(e,t,n,r){Pe=e;var a=0;do{if(ml&&(gl=null),zu=0,ml=!1,25<=a)throw Error(te(301));if(a+=1,Bt=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=YN,i=t(n,r)}while(ml);return i}function g4(){var e=Re.H,t=e.useState()[0];return t=typeof t.then=="function"?fd(t):t,e=e.useState()[0],(ot!==null?ot.memoizedState:null)!==e&&(Pe.flags|=1024),t}function ub(){var e=Ch!==0;return Ch=0,e}function db(e,t,n){t.updateQueue=e.updateQueue,t.flags&=-2053,e.lanes&=~n}function fb(e){if(Eh){for(e=e.memoizedState;e!==null;){var t=e.queue;t!==null&&(t.pending=null),e=e.next}Eh=!1}ii=0,Bt=ot=Pe=null,ml=!1,zu=Ch=0,gl=null}function On(){var e={memoizedState:null,baseState:null,baseQueue:null,queue:null,next:null};return Bt===null?Pe.memoizedState=Bt=e:Bt=Bt.next=e,Bt}function qt(){if(ot===null){var e=Pe.alternate;e=e!==null?e.memoizedState:null}else e=ot.next;var t=Bt===null?Pe.memoizedState:Bt.next;if(t!==null)Bt=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},Bt===null?Pe.memoizedState=Bt=e:Bt=Bt.next=e}return Bt}function zp(){return{lastEffect:null,events:null,stores:null,memoCache:null}}function fd(e){var t=zu;return zu+=1,gl===null&&(gl=[]),e=hN(gl,e,t),t=Pe,(Bt===null?t.memoizedState:Bt.next)===null&&(t=t.alternate,Re.H=t===null||t.memoizedState===null?QN:xb),e}function Ip(e){if(e!==null&&typeof e=="object"){if(typeof e.then=="function")return fd(e);if(e.$$typeof===Qa)return vn(e)}throw Error(te(438,String(e)))}function hb(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=zp(),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]=tD;return t.index++,n}function si(e,t){return typeof t=="function"?t(e):t}function If(e){var t=qt();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?(Ke&f)===f:(ii&f)===f){var p=u.revertLane;if(p===0)l!==null&&(l=l.next={lane:0,revertLane:0,gesture:null,action:u.action,hasEagerState:u.hasEagerState,eagerState:u.eagerState,next:null}),f===Ul&&(d=!0);else if((ii&p)===p){u=u.next,p===Ul&&(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|=p,us|=p;f=u.action,so&&n(i,f),i=u.hasEagerState?u.eagerState:n(i,f)}else p={lane:f,revertLane:u.revertLane,gesture:u.gesture,action:u.action,hasEagerState:u.hasEagerState,eagerState:u.eagerState,next:null},l===null?(o=l=p,s=i):l=l.next=p,Pe.lanes|=f,us|=f;u=u.next}while(u!==null&&u!==t);if(l===null?s=i:l.next=o,!yr(i,e.memoizedState)&&(Zt=!0,d&&(n=hl,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 Wm(e){var t=qt(),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);yr(i,t.memoizedState)||(Zt=!0),t.memoizedState=i,t.baseQueue===null&&(t.baseState=i),n.lastRenderedState=i}return[i,r]}function wN(e,t,n){var r=Pe,a=qt(),i=Qe;if(i){if(n===void 0)throw Error(te(407));n=n()}else n=t();var s=!yr((ot||a).memoizedState,n);if(s&&(a.memoizedState=n,Zt=!0),a=a.queue,mb(kN.bind(null,r,a,e),[e]),a.getSnapshot!==t||s||Bt!==null&&Bt.memoizedState.tag&1){if(r.flags|=2048,ql(9,{destroy:void 0},_N.bind(null,r,a,n,t),null),dt===null)throw Error(te(349));i||ii&127||SN(r,t,n)}return n}function SN(e,t,n){e.flags|=16384,e={getSnapshot:t,value:n},t=Pe.updateQueue,t===null?(t=zp(),Pe.updateQueue=t,t.stores=[e]):(n=t.stores,n===null?t.stores=[e]:n.push(e))}function _N(e,t,n,r){t.value=n,t.getSnapshot=r,EN(t)&&CN(e)}function kN(e,t,n){return n(function(){EN(t)&&CN(e)})}function EN(e){var t=e.getSnapshot;e=e.value;try{var n=t();return!yr(e,n)}catch{return!0}}function CN(e){var t=Eo(e,2);t!==null&&Wn(t,e,2)}function Ly(e){var t=On();if(typeof e=="function"){var n=e;if(e=n(),so){Bi(!0);try{n()}finally{Bi(!1)}}}return t.memoizedState=t.baseState=e,t.queue={pending:null,lanes:0,dispatch:null,lastRenderedReducer:si,lastRenderedState:e},t}function NN(e,t,n,r){return e.baseState=n,pb(e,ot,typeof r=="function"?r:si)}function y4(e,t,n,r,a){if(Up(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,jN(t,i)):(i.next=n.next,t.pending=n.next=i)}}function jN(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),J1(e,t,o)}catch(u){Uy(e,t,u)}finally{i!==null&&s.types!==null&&(i.types=s.types),Re.T=i}}else try{i=n(a,r),J1(e,t,i)}catch(u){Uy(e,t,u)}}function J1(e,t,n){n!==null&&typeof n=="object"&&typeof n.then=="function"?n.then(function(r){eS(e,t,r)},function(r){return Uy(e,t,r)}):eS(e,t,n)}function eS(e,t,n){t.status="fulfilled",t.value=n,TN(t),e.state=n,t=e.pending,t!==null&&(n=t.next,n===t?e.pending=null:(n=n.next,t.next=n,jN(e,n)))}function Uy(e,t,n){var r=e.pending;if(e.pending=null,r!==null){r=r.next;do t.status="rejected",t.reason=n,TN(t),t=t.next;while(t!==r)}e.action=null}function TN(e){e=e.listeners;for(var t=0;t<e.length;t++)(0,e[t])()}function AN(e,t){return t}function tS(e,t){if(Qe){var n=dt.formState;if(n!==null){e:{var r=Pe;if(Qe){if(xt){t:{for(var a=xt,i=Mr;a.nodeType!==8;){if(!i){a=null;break t}if(a=Dr(a.nextSibling),a===null){a=null;break t}}i=a.data,a=i==="F!"||i==="F"?a:null}if(a){xt=Dr(a.nextSibling),r=a.data==="F!";break e}}ls(r)}r=!1}r&&(t=n[0])}}return n=On(),n.memoizedState=n.baseState=t,r={pending:null,lanes:0,dispatch:null,lastRenderedReducer:AN,lastRenderedState:t},n.queue=r,n=KN.bind(null,Pe,r),r.dispatch=n,r=Ly(!1),i=bb.bind(null,Pe,!1,r.queue),r=On(),a={state:t,dispatch:null,action:e,pending:null},r.queue=a,n=y4.bind(null,Pe,a,i,n),a.dispatch=n,r.memoizedState=e,[t,n,!1]}function nS(e){var t=qt();return RN(t,ot,e)}function RN(e,t,n){if(t=pb(e,t,AN)[0],e=If(si)[0],typeof t=="object"&&t!==null&&typeof t.then=="function")try{var r=fd(t)}catch(s){throw s===cc?Dp:s}else r=t;t=qt();var a=t.queue,i=a.dispatch;return n!==t.memoizedState&&(Pe.flags|=2048,ql(9,{destroy:void 0},v4.bind(null,a,n),null)),[r,i,e]}function v4(e,t){e.action=t}function rS(e){var t=qt(),n=ot;if(n!==null)return RN(t,n,e);qt(),t=t.memoizedState,n=qt();var r=n.queue.dispatch;return n.memoizedState=e,[t,r,!1]}function ql(e,t,n,r){return e={tag:e,create:n,deps:r,inst:t,next:null},t=Pe.updateQueue,t===null&&(t=zp(),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 $N(){return qt().memoizedState}function Lf(e,t,n,r){var a=On();Pe.flags|=e,a.memoizedState=ql(1|t,{destroy:void 0},n,r===void 0?null:r)}function Lp(e,t,n,r){var a=qt();r=r===void 0?null:r;var i=a.memoizedState.inst;ot!==null&&r!==null&&lb(r,ot.memoizedState.deps)?a.memoizedState=ql(t,i,n,r):(Pe.flags|=e,a.memoizedState=ql(1|t,i,n,r))}function aS(e,t){Lf(8390656,8,e,t)}function mb(e,t){Lp(2048,8,e,t)}function b4(e){Pe.flags|=4;var t=Pe.updateQueue;if(t===null)t=zp(),Pe.updateQueue=t,t.events=[e];else{var n=t.events;n===null?t.events=[e]:n.push(e)}}function ON(e){var t=qt().memoizedState;return b4({ref:t,nextImpl:e}),function(){if(We&2)throw Error(te(440));return t.impl.apply(void 0,arguments)}}function MN(e,t){return Lp(4,2,e,t)}function PN(e,t){return Lp(4,4,e,t)}function DN(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 zN(e,t,n){n=n!=null?n.concat([e]):null,Lp(4,4,DN.bind(null,t,e),n)}function gb(){}function IN(e,t){var n=qt();t=t===void 0?null:t;var r=n.memoizedState;return t!==null&&lb(t,r[1])?r[0]:(n.memoizedState=[e,t],e)}function LN(e,t){var n=qt();t=t===void 0?null:t;var r=n.memoizedState;if(t!==null&&lb(t,r[1]))return r[0];if(r=e(),so){Bi(!0);try{e()}finally{Bi(!1)}}return n.memoizedState=[r,t],r}function yb(e,t,n){return n===void 0||ii&1073741824&&!(Ke&261930)?e.memoizedState=t:(e.memoizedState=n,e=Nj(),Pe.lanes|=e,us|=e,n)}function UN(e,t,n,r){return yr(n,t)?n:Fl.current!==null?(e=yb(e,n,r),yr(e,t)||(Zt=!0),e):!(ii&42)||ii&1073741824&&!(Ke&261930)?(Zt=!0,e.memoizedState=n):(e=Nj(),Pe.lanes|=e,us|=e,t)}function FN(e,t,n,r,a){var i=Je.p;Je.p=i!==0&&8>i?i:8;var s=Re.T,o={};Re.T=o,bb(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=p4(l,r);uu(e,t,d,pr(e))}else uu(e,t,r,pr(e))}catch(f){uu(e,t,{then:function(){},status:"rejected",reason:f},pr())}finally{Je.p=i,s!==null&&o.types!==null&&(s.types=o.types),Re.T=s}}function x4(){}function Fy(e,t,n,r){if(e.tag!==5)throw Error(te(476));var a=qN(e).queue;FN(e,a,t,Xs,n===null?x4:function(){return HN(e),n(r)})}function qN(e){var t=e.memoizedState;if(t!==null)return t;t={memoizedState:Xs,baseState:Xs,baseQueue:null,queue:{pending:null,lanes:0,dispatch:null,lastRenderedReducer:si,lastRenderedState:Xs},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 HN(e){var t=qN(e);t.next===null&&(t=e.alternate.memoizedState),uu(e,t.next.queue,{},pr())}function vb(){return vn(Fu)}function BN(){return qt().memoizedState}function VN(){return qt().memoizedState}function w4(e){for(var t=e.return;t!==null;){switch(t.tag){case 24:case 3:var n=pr();e=Wi(n);var r=Ji(t,e,n);r!==null&&(Wn(r,t,n),ou(r,t,n)),t={cache:rb()},e.payload=t;return}t=t.return}}function S4(e,t,n){var r=pr();n={lane:r,revertLane:0,gesture:null,action:n,hasEagerState:!1,eagerState:null,next:null},Up(e)?ZN(t,n):(n=J0(e,t,n,r),n!==null&&(Wn(n,e,r),GN(n,t,r)))}function KN(e,t,n){var r=pr();uu(e,t,n,r)}function uu(e,t,n,r){var a={lane:r,revertLane:0,gesture:null,action:n,hasEagerState:!1,eagerState:null,next:null};if(Up(e))ZN(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,yr(o,s))return Pp(e,t,a,0),dt===null&&Mp(),!1}catch{}finally{}if(n=J0(e,t,a,r),n!==null)return Wn(n,e,r),GN(n,t,r),!0}return!1}function bb(e,t,n,r){if(r={lane:2,revertLane:jb(),gesture:null,action:r,hasEagerState:!1,eagerState:null,next:null},Up(e)){if(t)throw Error(te(479))}else t=J0(e,n,r,2),t!==null&&Wn(t,e,2)}function Up(e){var t=e.alternate;return e===Pe||t!==null&&t===Pe}function ZN(e,t){ml=Eh=!0;var n=e.pending;n===null?t.next=t:(t.next=n.next,n.next=t),e.pending=t}function GN(e,t,n){if(n&4194048){var r=t.lanes;r&=e.pendingLanes,n|=r,t.lanes=n,OC(e,n)}}var Iu={readContext:vn,use:Ip,useCallback:Dt,useContext:Dt,useEffect:Dt,useImperativeHandle:Dt,useLayoutEffect:Dt,useInsertionEffect:Dt,useMemo:Dt,useReducer:Dt,useRef:Dt,useState:Dt,useDebugValue:Dt,useDeferredValue:Dt,useTransition:Dt,useSyncExternalStore:Dt,useId:Dt,useHostTransitionStatus:Dt,useFormState:Dt,useActionState:Dt,useOptimistic:Dt,useMemoCache:Dt,useCacheRefresh:Dt};Iu.useEffectEvent=Dt;var QN={readContext:vn,use:Ip,useCallback:function(e,t){return On().memoizedState=[e,t===void 0?null:t],e},useContext:vn,useEffect:aS,useImperativeHandle:function(e,t,n){n=n!=null?n.concat([e]):null,Lf(4194308,4,DN.bind(null,t,e),n)},useLayoutEffect:function(e,t){return Lf(4194308,4,e,t)},useInsertionEffect:function(e,t){Lf(4,2,e,t)},useMemo:function(e,t){var n=On();t=t===void 0?null:t;var r=e();if(so){Bi(!0);try{e()}finally{Bi(!1)}}return n.memoizedState=[r,t],r},useReducer:function(e,t,n){var r=On();if(n!==void 0){var a=n(t);if(so){Bi(!0);try{n(t)}finally{Bi(!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=S4.bind(null,Pe,e),[r.memoizedState,e]},useRef:function(e){var t=On();return e={current:e},t.memoizedState=e},useState:function(e){e=Ly(e);var t=e.queue,n=KN.bind(null,Pe,t);return t.dispatch=n,[e.memoizedState,n]},useDebugValue:gb,useDeferredValue:function(e,t){var n=On();return yb(n,e,t)},useTransition:function(){var e=Ly(!1);return e=FN.bind(null,Pe,e.queue,!0,!1),On().memoizedState=e,[!1,e]},useSyncExternalStore:function(e,t,n){var r=Pe,a=On();if(Qe){if(n===void 0)throw Error(te(407));n=n()}else{if(n=t(),dt===null)throw Error(te(349));Ke&127||SN(r,t,n)}a.memoizedState=n;var i={value:n,getSnapshot:t};return a.queue=i,aS(kN.bind(null,r,i,e),[e]),r.flags|=2048,ql(9,{destroy:void 0},_N.bind(null,r,i,n,t),null),n},useId:function(){var e=On(),t=dt.identifierPrefix;if(Qe){var n=ya,r=ga;n=(r&~(1<<32-hr(r)-1)).toString(32)+n,t="_"+t+"R_"+n,n=Ch++,0<n&&(t+="H"+n.toString(32)),t+="_"}else n=m4++,t="_"+t+"r_"+n.toString(32)+"_";return e.memoizedState=t},useHostTransitionStatus:vb,useFormState:tS,useActionState:tS,useOptimistic:function(e){var t=On();t.memoizedState=t.baseState=e;var n={pending:null,lanes:0,dispatch:null,lastRenderedReducer:null,lastRenderedState:null};return t.queue=n,t=bb.bind(null,Pe,!0,n),n.dispatch=t,[e,t]},useMemoCache:hb,useCacheRefresh:function(){return On().memoizedState=w4.bind(null,Pe)},useEffectEvent:function(e){var t=On(),n={impl:e};return t.memoizedState=n,function(){if(We&2)throw Error(te(440));return n.impl.apply(void 0,arguments)}}},xb={readContext:vn,use:Ip,useCallback:IN,useContext:vn,useEffect:mb,useImperativeHandle:zN,useInsertionEffect:MN,useLayoutEffect:PN,useMemo:LN,useReducer:If,useRef:$N,useState:function(){return If(si)},useDebugValue:gb,useDeferredValue:function(e,t){var n=qt();return UN(n,ot.memoizedState,e,t)},useTransition:function(){var e=If(si)[0],t=qt().memoizedState;return[typeof e=="boolean"?e:fd(e),t]},useSyncExternalStore:wN,useId:BN,useHostTransitionStatus:vb,useFormState:nS,useActionState:nS,useOptimistic:function(e,t){var n=qt();return NN(n,ot,e,t)},useMemoCache:hb,useCacheRefresh:VN};xb.useEffectEvent=ON;var YN={readContext:vn,use:Ip,useCallback:IN,useContext:vn,useEffect:mb,useImperativeHandle:zN,useInsertionEffect:MN,useLayoutEffect:PN,useMemo:LN,useReducer:Wm,useRef:$N,useState:function(){return Wm(si)},useDebugValue:gb,useDeferredValue:function(e,t){var n=qt();return ot===null?yb(n,e,t):UN(n,ot.memoizedState,e,t)},useTransition:function(){var e=Wm(si)[0],t=qt().memoizedState;return[typeof e=="boolean"?e:fd(e),t]},useSyncExternalStore:wN,useId:BN,useHostTransitionStatus:vb,useFormState:rS,useActionState:rS,useOptimistic:function(e,t){var n=qt();return ot!==null?NN(n,ot,e,t):(n.baseState=e,[e,n.queue.dispatch])},useMemoCache:hb,useCacheRefresh:VN};YN.useEffectEvent=ON;function Jm(e,t,n,r){t=e.memoizedState,n=n(r,t),n=n==null?t:Nt({},t,n),e.memoizedState=n,e.lanes===0&&(e.updateQueue.baseState=n)}var qy={enqueueSetState:function(e,t,n){e=e._reactInternals;var r=pr(),a=Wi(r);a.payload=t,n!=null&&(a.callback=n),t=Ji(e,a,r),t!==null&&(Wn(t,e,r),ou(t,e,r))},enqueueReplaceState:function(e,t,n){e=e._reactInternals;var r=pr(),a=Wi(r);a.tag=1,a.payload=t,n!=null&&(a.callback=n),t=Ji(e,a,r),t!==null&&(Wn(t,e,r),ou(t,e,r))},enqueueForceUpdate:function(e,t){e=e._reactInternals;var n=pr(),r=Wi(n);r.tag=2,t!=null&&(r.callback=t),t=Ji(e,r,n),t!==null&&(Wn(t,e,n),ou(t,e,n))}};function iS(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?!Ou(n,r)||!Ou(a,i):!0}function sS(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&&qy.enqueueReplaceState(t,t.state,null)}function oo(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=Nt({},n));for(var a in e)n[a]===void 0&&(n[a]=e[a])}return n}function XN(e){vh(e)}function WN(e){console.error(e)}function JN(e){vh(e)}function Nh(e,t){try{var n=e.onUncaughtError;n(t.value,{componentStack:t.stack})}catch(r){setTimeout(function(){throw r})}}function oS(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 Hy(e,t,n){return n=Wi(n),n.tag=3,n.payload={element:null},n.callback=function(){Nh(e,t)},n}function ej(e){return e=Wi(e),e.tag=3,e}function tj(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(){oS(t,n,r)}}var s=n.stateNode;s!==null&&typeof s.componentDidCatch=="function"&&(e.callback=function(){oS(t,n,r),typeof a!="function"&&(es===null?es=new Set([this]):es.add(this));var o=r.stack;this.componentDidCatch(r.value,{componentStack:o!==null?o:""})})}function _4(e,t,n,r,a){if(n.flags|=32768,r!==null&&typeof r=="object"&&typeof r.then=="function"){if(t=n.alternate,t!==null&&lc(t,n,a,!0),n=vr.current,n!==null){switch(n.tag){case 31:case 13:return Pr===null?$h():n.alternate===null&&It===0&&(It=3),n.flags&=-257,n.flags|=65536,n.lanes=a,r===Sh?n.flags|=16384:(t=n.updateQueue,t===null?n.updateQueue=new Set([r]):t.add(r),ug(e,r,a)),!1;case 22:return n.flags|=65536,r===Sh?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)),ug(e,r,a)),!1}throw Error(te(435,n.tag))}return ug(e,r,a),$h(),!1}if(Qe)return t=vr.current,t!==null?(!(t.flags&65536)&&(t.flags|=256),t.flags|=65536,t.lanes=a,r!==Ay&&(e=Error(te(422),{cause:r}),Pu(Or(e,n)))):(r!==Ay&&(t=Error(te(423),{cause:r}),Pu(Or(t,n))),e=e.current.alternate,e.flags|=65536,a&=-a,e.lanes|=a,r=Or(r,n),a=Hy(e.stateNode,r,a),Xm(e,a),It!==4&&(It=2)),!1;var i=Error(te(520),{cause:r});if(i=Or(i,n),hu===null?hu=[i]:hu.push(i),It!==4&&(It=2),t===null)return!0;r=Or(r,n),n=t;do{switch(n.tag){case 3:return n.flags|=65536,e=a&-a,n.lanes|=e,e=Hy(n.stateNode,r,e),Xm(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"&&(es===null||!es.has(i))))return n.flags|=65536,a&=-a,n.lanes|=a,a=ej(a),tj(a,e,n,r),Xm(n,a),!1}n=n.return}while(n!==null);return!1}var wb=Error(te(461)),Zt=!1;function fn(e,t,n,r){t.child=e===null?mN(t,null,n,r):io(t,e.child,n,r)}function lS(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 ao(t),r=cb(e,t,n,s,i,a),o=ub(),e!==null&&!Zt?(db(e,t,a),oi(e,t,a)):(Qe&&o&&tb(t),t.flags|=1,fn(e,t,r,a),t.child)}function cS(e,t,n,r,a){if(e===null){var i=n.type;return typeof i=="function"&&!eb(i)&&i.defaultProps===void 0&&n.compare===null?(t.tag=15,t.type=i,nj(e,t,i,r,a)):(e=Df(n.type,null,r,t,t.mode,a),e.ref=t.ref,e.return=t,t.child=e)}if(i=e.child,!Sb(e,a)){var s=i.memoizedProps;if(n=n.compare,n=n!==null?n:Ou,n(s,r)&&e.ref===t.ref)return oi(e,t,a)}return t.flags|=1,e=Ja(i,r),e.ref=t.ref,e.return=t,t.child=e}function nj(e,t,n,r,a){if(e!==null){var i=e.memoizedProps;if(Ou(i,r)&&e.ref===t.ref)if(Zt=!1,t.pendingProps=r=i,Sb(e,a))e.flags&131072&&(Zt=!0);else return t.lanes=e.lanes,oi(e,t,a)}return By(e,t,n,r,a)}function rj(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 uS(e,t,i,n,r)}if(n&536870912)t.memoizedState={baseLanes:0,cachePool:null},e!==null&&zf(t,i!==null?i.cachePool:null),i!==null?W1(t,i):zy(),vN(t);else return r=t.lanes=536870912,uS(e,t,i!==null?i.baseLanes|n:n,n,r)}else i!==null?(zf(t,i.cachePool),W1(t,i),$i(),t.memoizedState=null):(e!==null&&zf(t,null),zy(),$i());return fn(e,t,a,n),t.child}function Zc(e,t){return e!==null&&e.tag===22||t.stateNode!==null||(t.stateNode={_visibility:1,_pendingMarkers:null,_retryCache:null,_transitions:null}),t.sibling}function uS(e,t,n,r,a){var i=ab();return i=i===null?null:{parent:Kt._currentValue,pool:i},t.memoizedState={baseLanes:n,cachePool:i},e!==null&&zf(t,null),zy(),vN(t),e!==null&&lc(e,t,r,!0),t.childLanes=a,null}function Uf(e,t){return t=jh({mode:t.mode,children:t.children},e.mode),t.ref=e.ref,e.child=t,t.return=e,t}function dS(e,t,n){return io(t,e.child,null,n),e=Uf(t,t.pendingProps),e.flags|=2,sr(t),t.memoizedState=null,e}function k4(e,t,n){var r=t.pendingProps,a=(t.flags&128)!==0;if(t.flags&=-129,e===null){if(Qe){if(r.mode==="hidden")return e=Uf(t,r),t.lanes=536870912,Zc(null,e);if(Iy(t),(e=xt)?(e=Qj(e,Mr),e=e!==null&&e.data==="&"?e:null,e!==null&&(t.memoizedState={dehydrated:e,treeContext:os!==null?{id:ga,overflow:ya}:null,retryLane:536870912,hydrationErrors:null},n=lN(e),n.return=t,t.child=n,yn=t,xt=null)):e=null,e===null)throw ls(t);return t.lanes=536870912,null}return Uf(t,r)}var i=e.memoizedState;if(i!==null){var s=i.dehydrated;if(Iy(t),a)if(t.flags&256)t.flags&=-257,t=dS(e,t,n);else if(t.memoizedState!==null)t.child=e.child,t.flags|=128,t=null;else throw Error(te(558));else if(Zt||lc(e,t,n,!1),a=(n&e.childLanes)!==0,Zt||a){if(r=dt,r!==null&&(s=MC(r,n),s!==0&&s!==i.retryLane))throw i.retryLane=s,Eo(e,s),Wn(r,e,s),wb;$h(),t=dS(e,t,n)}else e=i.treeContext,xt=Dr(s.nextSibling),yn=t,Qe=!0,Xi=null,Mr=!1,e!==null&&uN(t,e),t=Uf(t,r),t.flags|=4096;return t}return e=Ja(e.child,{mode:r.mode,children:r.children}),e.ref=t.ref,t.child=e,e.return=t,e}function Ff(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 By(e,t,n,r,a){return ao(t),n=cb(e,t,n,r,void 0,a),r=ub(),e!==null&&!Zt?(db(e,t,a),oi(e,t,a)):(Qe&&r&&tb(t),t.flags|=1,fn(e,t,n,a),t.child)}function fS(e,t,n,r,a,i){return ao(t),t.updateQueue=null,n=xN(t,r,n,a),bN(e),r=ub(),e!==null&&!Zt?(db(e,t,i),oi(e,t,i)):(Qe&&r&&tb(t),t.flags|=1,fn(e,t,n,i),t.child)}function hS(e,t,n,r,a){if(ao(t),t.stateNode===null){var i=nl,s=n.contextType;typeof s=="object"&&s!==null&&(i=vn(s)),i=new n(r,i),t.memoizedState=i.state!==null&&i.state!==void 0?i.state:null,i.updater=qy,t.stateNode=i,i._reactInternals=t,i=t.stateNode,i.props=r,i.state=t.memoizedState,i.refs={},sb(t),s=n.contextType,i.context=typeof s=="object"&&s!==null?vn(s):nl,i.state=t.memoizedState,s=n.getDerivedStateFromProps,typeof s=="function"&&(Jm(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&&qy.enqueueReplaceState(i,i.state,null),cu(t,r,i,a),lu(),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=oo(n,o);i.props=l;var u=i.context,d=n.contextType;s=nl,typeof d=="object"&&d!==null&&(s=vn(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)&&sS(t,i,r,s),Ci=!1;var p=t.memoizedState;i.state=p,cu(t,r,i,a),lu(),u=t.memoizedState,o||p!==u||Ci?(typeof f=="function"&&(Jm(t,n,f,r),u=t.memoizedState),(l=Ci||iS(t,n,l,r,p,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,Py(e,t),s=t.memoizedProps,d=oo(n,s),i.props=d,f=t.pendingProps,p=i.context,u=n.contextType,l=nl,typeof u=="object"&&u!==null&&(l=vn(u)),o=n.getDerivedStateFromProps,(u=typeof o=="function"||typeof i.getSnapshotBeforeUpdate=="function")||typeof i.UNSAFE_componentWillReceiveProps!="function"&&typeof i.componentWillReceiveProps!="function"||(s!==f||p!==l)&&sS(t,i,r,l),Ci=!1,p=t.memoizedState,i.state=p,cu(t,r,i,a),lu();var h=t.memoizedState;s!==f||p!==h||Ci||e!==null&&e.dependencies!==null&&wh(e.dependencies)?(typeof o=="function"&&(Jm(t,n,o,r),h=t.memoizedState),(d=Ci||iS(t,n,d,r,p,h,l)||e!==null&&e.dependencies!==null&&wh(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&&p===e.memoizedState||(t.flags|=4),typeof i.getSnapshotBeforeUpdate!="function"||s===e.memoizedProps&&p===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&&p===e.memoizedState||(t.flags|=4),typeof i.getSnapshotBeforeUpdate!="function"||s===e.memoizedProps&&p===e.memoizedState||(t.flags|=1024),r=!1)}return i=r,Ff(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=io(t,e.child,null,a),t.child=io(t,null,n,a)):fn(e,t,n,a),t.memoizedState=i.state,e=t.child):e=oi(e,t,a),e}function pS(e,t,n,r){return ro(),t.flags|=256,fn(e,t,n,r),t.child}var eg={dehydrated:null,treeContext:null,retryLane:0,hydrationErrors:null};function tg(e){return{baseLanes:e,cachePool:fN()}}function ng(e,t,n){return e=e!==null?e.childLanes&~n:0,t&&(e|=ur),e}function aj(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:(Ft.current&2)!==0),s&&(a=!0,t.flags&=-129),s=(t.flags&32)!==0,t.flags&=-33,e===null){if(Qe){if(a?Ri(t):$i(),(e=xt)?(e=Qj(e,Mr),e=e!==null&&e.data!=="&"?e:null,e!==null&&(t.memoizedState={dehydrated:e,treeContext:os!==null?{id:ga,overflow:ya}:null,retryLane:536870912,hydrationErrors:null},n=lN(e),n.return=t,t.child=n,yn=t,xt=null)):e=null,e===null)throw ls(t);return av(e)?t.lanes=32:t.lanes=536870912,null}var o=r.children;return r=r.fallback,a?($i(),a=t.mode,o=jh({mode:"hidden",children:o},a),r=Ws(r,a,n,null),o.return=t,r.return=t,o.sibling=r,t.child=o,r=t.child,r.memoizedState=tg(n),r.childLanes=ng(e,s,n),t.memoizedState=eg,Zc(null,r)):(Ri(t),Vy(t,o))}var l=e.memoizedState;if(l!==null&&(o=l.dehydrated,o!==null)){if(i)t.flags&256?(Ri(t),t.flags&=-257,t=rg(e,t,n)):t.memoizedState!==null?($i(),t.child=e.child,t.flags|=128,t=null):($i(),o=r.fallback,a=t.mode,r=jh({mode:"visible",children:r.children},a),o=Ws(o,a,n,null),o.flags|=2,r.return=t,o.return=t,r.sibling=o,t.child=r,io(t,e.child,null,n),r=t.child,r.memoizedState=tg(n),r.childLanes=ng(e,s,n),t.memoizedState=eg,t=Zc(null,r));else if(Ri(t),av(o)){if(s=o.nextSibling&&o.nextSibling.dataset,s)var u=s.dgst;s=u,r=Error(te(419)),r.stack="",r.digest=s,Pu({value:r,source:null,stack:null}),t=rg(e,t,n)}else if(Zt||lc(e,t,n,!1),s=(n&e.childLanes)!==0,Zt||s){if(s=dt,s!==null&&(r=MC(s,n),r!==0&&r!==l.retryLane))throw l.retryLane=r,Eo(e,r),Wn(s,e,r),wb;rv(o)||$h(),t=rg(e,t,n)}else rv(o)?(t.flags|=192,t.child=e.child,t=null):(e=l.treeContext,xt=Dr(o.nextSibling),yn=t,Qe=!0,Xi=null,Mr=!1,e!==null&&uN(t,e),t=Vy(t,r.children),t.flags|=4096);return t}return a?($i(),o=r.fallback,a=t.mode,l=e.child,u=l.sibling,r=Ja(l,{mode:"hidden",children:r.children}),r.subtreeFlags=l.subtreeFlags&65011712,u!==null?o=Ja(u,o):(o=Ws(o,a,n,null),o.flags|=2),o.return=t,r.return=t,r.sibling=o,t.child=r,Zc(null,r),r=t.child,o=e.child.memoizedState,o===null?o=tg(n):(a=o.cachePool,a!==null?(l=Kt._currentValue,a=a.parent!==l?{parent:l,pool:l}:a):a=fN(),o={baseLanes:o.baseLanes|n,cachePool:a}),r.memoizedState=o,r.childLanes=ng(e,s,n),t.memoizedState=eg,Zc(e.child,r)):(Ri(t),n=e.child,e=n.sibling,n=Ja(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 Vy(e,t){return t=jh({mode:"visible",children:t},e.mode),t.return=e,e.child=t}function jh(e,t){return e=cr(22,e,null,t),e.lanes=0,e}function rg(e,t,n){return io(t,e.child,null,n),e=Vy(t,t.pendingProps.children),e.flags|=2,t.memoizedState=null,e}function mS(e,t,n){e.lanes|=t;var r=e.alternate;r!==null&&(r.lanes|=t),$y(e.return,t,n)}function ag(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 ij(e,t,n){var r=t.pendingProps,a=r.revealOrder,i=r.tail;r=r.children;var s=Ft.current,o=(s&2)!==0;if(o?(s=s&1|2,t.flags|=128):s&=1,pt(Ft,s),fn(e,t,r,n),r=Qe?Mu:0,!o&&e!==null&&e.flags&128)e:for(e=t.child;e!==null;){if(e.tag===13)e.memoizedState!==null&&mS(e,n,t);else if(e.tag===19)mS(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&&kh(e)===null&&(a=n),n=n.sibling;n=a,n===null?(a=t.child,t.child=null):(a=n.sibling,n.sibling=null),ag(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&&kh(e)===null){t.child=a;break}e=a.sibling,a.sibling=n,n=a,a=e}ag(t,!0,n,null,i,r);break;case"together":ag(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),us|=t.lanes,!(n&t.childLanes))if(e!==null){if(lc(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=Ja(e,e.pendingProps),t.child=n,n.return=t;e.sibling!==null;)e=e.sibling,n=n.sibling=Ja(e,e.pendingProps),n.return=t;n.sibling=null}return t.child}function Sb(e,t){return e.lanes&t?!0:(e=e.dependencies,!!(e!==null&&wh(e)))}function E4(e,t,n){switch(t.tag){case 3:ph(t,t.stateNode.containerInfo),Ai(t,Kt,e.memoizedState.cache),ro();break;case 27:case 5:by(t);break;case 4:ph(t,t.stateNode.containerInfo);break;case 10:Ai(t,t.type,t.memoizedProps.value);break;case 31:if(t.memoizedState!==null)return t.flags|=128,Iy(t),null;break;case 13:var r=t.memoizedState;if(r!==null)return r.dehydrated!==null?(Ri(t),t.flags|=128,null):n&t.child.childLanes?aj(e,t,n):(Ri(t),e=oi(e,t,n),e!==null?e.sibling:null);Ri(t);break;case 19:var a=(e.flags&128)!==0;if(r=(n&t.childLanes)!==0,r||(lc(e,t,n,!1),r=(n&t.childLanes)!==0),a){if(r)return ij(e,t,n);t.flags|=128}if(a=t.memoizedState,a!==null&&(a.rendering=null,a.tail=null,a.lastEffect=null),pt(Ft,Ft.current),r)break;return null;case 22:return t.lanes=0,rj(e,t,n,t.pendingProps);case 24:Ai(t,Kt,e.memoizedState.cache)}return oi(e,t,n)}function sj(e,t,n){if(e!==null)if(e.memoizedProps!==t.pendingProps)Zt=!0;else{if(!Sb(e,n)&&!(t.flags&128))return Zt=!1,E4(e,t,n);Zt=!!(e.flags&131072)}else Zt=!1,Qe&&t.flags&1048576&&cN(t,Mu,t.index);switch(t.lanes=0,t.tag){case 16:e:{var r=t.pendingProps;if(e=$s(t.elementType),t.type=e,typeof e=="function")eb(e)?(r=oo(e,r),t.tag=1,t=hS(null,t,e,r,n)):(t.tag=0,t=By(null,t,e,r,n));else{if(e!=null){var a=e.$$typeof;if(a===U0){t.tag=11,t=lS(null,t,e,r,n);break e}else if(a===F0){t.tag=14,t=cS(null,t,e,r,n);break e}}throw t=yy(e)||e,Error(te(306,t,""))}}return t;case 0:return By(e,t,t.type,t.pendingProps,n);case 1:return r=t.type,a=oo(r,t.pendingProps),hS(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,Py(e,t),cu(t,r,null,n);var s=t.memoizedState;if(r=s.cache,Ai(t,Kt,r),r!==i.cache&&Oy(t,[Kt],n,!0),lu(),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=pS(e,t,r,n);break e}else if(r!==a){a=Or(Error(te(424)),t),Pu(a),t=pS(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=Dr(e.firstChild),yn=t,Qe=!0,Xi=null,Mr=!0,n=mN(t,null,r,n),t.child=n;n;)n.flags=n.flags&-3|4096,n=n.sibling}else{if(ro(),r===a){t=oi(e,t,n);break e}fn(e,t,r,n)}t=t.child}return t;case 26:return Ff(e,t),e===null?(n=PS(t.type,null,t.pendingProps,null))?t.memoizedState=n:Qe||(n=t.type,e=t.pendingProps,r=Dh(Yi.current).createElement(n),r[gn]=t,r[Jn]=e,xn(r,n,e),sn(r),t.stateNode=r):t.memoizedState=PS(t.type,e.memoizedProps,t.pendingProps,e.memoizedState),null;case 27:return by(t),e===null&&Qe&&(r=t.stateNode=Yj(t.type,t.pendingProps,Yi.current),yn=t,Mr=!0,a=xt,gs(t.type)?(iv=a,xt=Dr(r.firstChild)):xt=a),fn(e,t,t.pendingProps.children,n),Ff(e,t),e===null&&(t.flags|=4194304),t.child;case 5:return e===null&&Qe&&((a=r=xt)&&(r=tz(r,t.type,t.pendingProps,Mr),r!==null?(t.stateNode=r,yn=t,xt=Dr(r.firstChild),Mr=!1,a=!0):a=!1),a||ls(t)),by(t),a=t.type,i=t.pendingProps,s=e!==null?e.memoizedProps:null,r=i.children,tv(a,i)?r=null:s!==null&&tv(a,s)&&(t.flags|=32),t.memoizedState!==null&&(a=cb(e,t,g4,null,null,n),Fu._currentValue=a),Ff(e,t),fn(e,t,r,n),t.child;case 6:return e===null&&Qe&&((e=n=xt)&&(n=nz(n,t.pendingProps,Mr),n!==null?(t.stateNode=n,yn=t,xt=null,e=!0):e=!1),e||ls(t)),null;case 13:return aj(e,t,n);case 4:return ph(t,t.stateNode.containerInfo),r=t.pendingProps,e===null?t.child=io(t,null,r,n):fn(e,t,r,n),t.child;case 11:return lS(e,t,t.type,t.pendingProps,n);case 7:return fn(e,t,t.pendingProps,n),t.child;case 8:return fn(e,t,t.pendingProps.children,n),t.child;case 12:return fn(e,t,t.pendingProps.children,n),t.child;case 10:return r=t.pendingProps,Ai(t,t.type,r.value),fn(e,t,r.children,n),t.child;case 9:return a=t.type._context,r=t.pendingProps.children,ao(t),a=vn(a),r=r(a),t.flags|=1,fn(e,t,r,n),t.child;case 14:return cS(e,t,t.type,t.pendingProps,n);case 15:return nj(e,t,t.type,t.pendingProps,n);case 19:return ij(e,t,n);case 31:return k4(e,t,n);case 22:return rj(e,t,n,t.pendingProps);case 24:return ao(t),r=vn(Kt),e===null?(a=ab(),a===null&&(a=dt,i=rb(),a.pooledCache=i,i.refCount++,i!==null&&(a.pooledCacheLanes|=n),a=i),t.memoizedState={parent:r,cache:a},sb(t),Ai(t,Kt,a)):(e.lanes&n&&(Py(e,t),cu(t,null,null,n),lu()),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),Ai(t,Kt,r)):(r=i.cache,Ai(t,Kt,r),r!==a.cache&&Oy(t,[Kt],n,!0))),fn(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 ig(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(Aj())e.flags|=8192;else throw eo=Sh,ib}else e.flags&=-16777217}function gS(e,t){if(t.type!=="stylesheet"||t.state.loading&4)e.flags&=-16777217;else if(e.flags|=16777216,!Jj(t))if(Aj())e.flags|=8192;else throw eo=Sh,ib}function Xd(e,t){t!==null&&(e.flags|=4),e.flags&16384&&(t=e.tag!==22?RC():536870912,e.lanes|=t,Hl|=t)}function Rc(e,t){if(!Qe)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 C4(e,t,n){var r=t.pendingProps;switch(nb(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),ei(Kt),zl(),n.pendingContext&&(n.context=n.pendingContext,n.pendingContext=null),(e===null||e.child===null)&&(Ao(t)?Ra(t):e===null||e.memoizedState.isDehydrated&&!(t.flags&256)||(t.flags|=1024,Ym())),vt(t),null;case 26:var a=t.type,i=t.memoizedState;return e===null?(Ra(t),i!==null?(vt(t),gS(t,i)):(vt(t),ig(t,a,null,r,n))):i?i!==e.memoizedState?(Ra(t),vt(t),gS(t,i)):(vt(t),t.flags&=-16777217):(e=e.memoizedProps,e!==r&&Ra(t),vt(t),ig(t,a,e,r,n)),null;case 27:if(mh(t),n=Yi.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,Ao(t)?V1(t):(e=Yj(a,r,n),t.stateNode=e,Ra(t))}return vt(t),null;case 5:if(mh(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,Ao(t))V1(t);else{var s=Dh(Yi.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[gn]=t,i[Jn]=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(xn(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),ig(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=Yi.current,Ao(t)){if(e=t.stateNode,n=t.memoizedProps,r=null,a=yn,a!==null)switch(a.tag){case 27:case 5:r=a.memoizedProps}e[gn]=t,e=!!(e.nodeValue===n||r!==null&&r.suppressHydrationWarning===!0||Kj(e.nodeValue,n)),e||ls(t,!0)}else e=Dh(e).createTextNode(r),e[gn]=t,t.stateNode=e}return vt(t),null;case 31:if(n=t.memoizedState,e===null||e.memoizedState!==null){if(r=Ao(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[gn]=t}else ro(),!(t.flags&128)&&(t.memoizedState=null),t.flags|=4;vt(t),e=!1}else n=Ym(),e!==null&&e.memoizedState!==null&&(e.memoizedState.hydrationErrors=n),e=!0;if(!e)return t.flags&256?(sr(t),t):(sr(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=Ao(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[gn]=t}else ro(),!(t.flags&128)&&(t.memoizedState=null),t.flags|=4;vt(t),a=!1}else a=Ym(),e!==null&&e.memoizedState!==null&&(e.memoizedState.hydrationErrors=a),a=!0;if(!a)return t.flags&256?(sr(t),t):(sr(t),null)}return sr(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),Xd(t,t.updateQueue),vt(t),null);case 4:return zl(),e===null&&Tb(t.stateNode.containerInfo),vt(t),null;case 10:return ei(t.type),vt(t),null;case 19:if(on(Ft),r=t.memoizedState,r===null)return vt(t),null;if(a=(t.flags&128)!==0,i=r.rendering,i===null)if(a)Rc(r,!1);else{if(It!==0||e!==null&&e.flags&128)for(e=t.child;e!==null;){if(i=kh(e),i!==null){for(t.flags|=128,Rc(r,!1),e=i.updateQueue,t.updateQueue=e,Xd(t,e),t.subtreeFlags=0,e=n,n=t.child;n!==null;)oN(n,e),n=n.sibling;return pt(Ft,Ft.current&1|2),Qe&&Fa(t,r.treeForkCount),t.child}e=e.sibling}r.tail!==null&&dr()>Ah&&(t.flags|=128,a=!0,Rc(r,!1),t.lanes=4194304)}else{if(!a)if(e=kh(i),e!==null){if(t.flags|=128,a=!0,e=e.updateQueue,t.updateQueue=e,Xd(t,e),Rc(r,!0),r.tail===null&&r.tailMode==="hidden"&&!i.alternate&&!Qe)return vt(t),null}else 2*dr()-r.renderingStartTime>Ah&&n!==536870912&&(t.flags|=128,a=!0,Rc(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=dr(),e.sibling=null,n=Ft.current,pt(Ft,a?n&1|2:n&1),Qe&&Fa(t,r.treeForkCount),e):(vt(t),null);case 22:case 23:return sr(t),ob(),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&&Xd(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&&on(Js),null;case 24:return n=null,e!==null&&(n=e.memoizedState.cache),t.memoizedState.cache!==n&&(t.flags|=2048),ei(Kt),vt(t),null;case 25:return null;case 30:return null}throw Error(te(156,t.tag))}function N4(e,t){switch(nb(t),t.tag){case 1:return e=t.flags,e&65536?(t.flags=e&-65537|128,t):null;case 3:return ei(Kt),zl(),e=t.flags,e&65536&&!(e&128)?(t.flags=e&-65537|128,t):null;case 26:case 27:case 5:return mh(t),null;case 31:if(t.memoizedState!==null){if(sr(t),t.alternate===null)throw Error(te(340));ro()}return e=t.flags,e&65536?(t.flags=e&-65537|128,t):null;case 13:if(sr(t),e=t.memoizedState,e!==null&&e.dehydrated!==null){if(t.alternate===null)throw Error(te(340));ro()}return e=t.flags,e&65536?(t.flags=e&-65537|128,t):null;case 19:return on(Ft),null;case 4:return zl(),null;case 10:return ei(t.type),null;case 22:case 23:return sr(t),ob(),e!==null&&on(Js),e=t.flags,e&65536?(t.flags=e&-65537|128,t):null;case 24:return ei(Kt),null;case 25:return null;default:return null}}function oj(e,t){switch(nb(t),t.tag){case 3:ei(Kt),zl();break;case 26:case 27:case 5:mh(t);break;case 4:zl();break;case 31:t.memoizedState!==null&&sr(t);break;case 13:sr(t);break;case 19:on(Ft);break;case 10:ei(t.type);break;case 22:case 23:sr(t),ob(),e!==null&&on(Js);break;case 24:ei(Kt)}}function hd(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 cs(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 lj(e){var t=e.updateQueue;if(t!==null){var n=e.stateNode;try{yN(t,n)}catch(r){it(e,e.return,r)}}}function cj(e,t,n){n.props=oo(e.type,e.memoizedProps),n.state=e.memoizedState;try{n.componentWillUnmount()}catch(r){it(e,t,r)}}function du(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 uj(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 sg(e,t,n){try{var r=e.stateNode;Q4(r,e.type,n,t),r[Jn]=t}catch(a){it(e,e.return,a)}}function dj(e){return e.tag===5||e.tag===3||e.tag===26||e.tag===27&&gs(e.type)||e.tag===4}function og(e){e:for(;;){for(;e.sibling===null;){if(e.return===null||dj(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&&gs(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 Ky(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=Ya));else if(r!==4&&(r===27&&gs(e.type)&&(n=e.stateNode,t=null),e=e.child,e!==null))for(Ky(e,t,n),e=e.sibling;e!==null;)Ky(e,t,n),e=e.sibling}function Th(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&&gs(e.type)&&(n=e.stateNode),e=e.child,e!==null))for(Th(e,t,n),e=e.sibling;e!==null;)Th(e,t,n),e=e.sibling}function fj(e){var t=e.stateNode,n=e.memoizedProps;try{for(var r=e.type,a=t.attributes;a.length;)t.removeAttributeNode(a[0]);xn(t,r,n),t[gn]=e,t[Jn]=n}catch(i){it(e,e.return,i)}}var Za=!1,Vt=!1,lg=!1,yS=typeof WeakSet=="function"?WeakSet:Set,an=null;function j4(e,t){if(e=e.containerInfo,Jy=Uh,e=JC(e),X0(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,p=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;)p=f,f=h;for(;;){if(f===e)break t;if(p===n&&++u===a&&(o=s),p===i&&++d===r&&(l=s),(h=f.nextSibling)!==null)break;f=p,p=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(ev={focusedElem:e,selectionRange:n},Uh=!1,an=t;an!==null;)if(t=an,e=t.child,(t.subtreeFlags&1028)!==0&&e!==null)e.return=t,an=e;else for(;an!==null;){switch(t=an,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=oo(n.type,a);e=r.getSnapshotBeforeUpdate(y,i),r.__reactInternalSnapshotBeforeUpdate=e}catch(m){it(n,n.return,m)}}break;case 3:if(e&1024){if(e=t.stateNode.containerInfo,n=e.nodeType,n===9)nv(e);else if(n===1)switch(e.nodeName){case"HEAD":case"HTML":case"BODY":nv(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,an=e;break}an=t.return}}function hj(e,t,n){var r=n.flags;switch(n.tag){case 0:case 11:case 15:Oa(e,n),r&4&&hd(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=oo(n.type,t.memoizedProps);t=t.memoizedState;try{e.componentDidUpdate(a,t,e.__reactInternalSnapshotBeforeUpdate)}catch(s){it(n,n.return,s)}}r&64&&lj(n),r&512&&du(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{yN(e,t)}catch(s){it(n,n.return,s)}}break;case 27:t===null&&r&4&&fj(n);case 26:case 5:Oa(e,n),t===null&&r&4&&uj(n),r&512&&du(n,n.return);break;case 12:Oa(e,n);break;case 31:Oa(e,n),r&4&&gj(e,n);break;case 13:Oa(e,n),r&4&&yj(e,n),r&64&&(e=n.memoizedState,e!==null&&(e=e.dehydrated,e!==null&&(n=z4.bind(null,n),rz(e,n))));break;case 22:if(r=n.memoizedState!==null||Za,!r){t=t!==null&&t.memoizedState!==null||Vt,a=Za;var i=Vt;Za=r,(Vt=t)&&!i?Ia(e,n,(n.subtreeFlags&8772)!==0):Oa(e,n),Za=a,Vt=i}break;case 30:break;default:Oa(e,n)}}function pj(e){var t=e.alternate;t!==null&&(e.alternate=null,pj(t)),e.child=null,e.deletions=null,e.sibling=null,e.tag===5&&(t=e.stateNode,t!==null&&V0(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 jt=null,Vn=!1;function $a(e,t,n){for(n=n.child;n!==null;)mj(e,t,n),n=n.sibling}function mj(e,t,n){if(fr&&typeof fr.onCommitFiberUnmount=="function")try{fr.onCommitFiberUnmount(sd,n)}catch{}switch(n.tag){case 26:Vt||va(n,t),$a(e,t,n),n.memoizedState?n.memoizedState.count--:n.stateNode&&(n=n.stateNode,n.parentNode.removeChild(n));break;case 27:Vt||va(n,t);var r=jt,a=Vn;gs(n.type)&&(jt=n.stateNode,Vn=!1),$a(e,t,n),mu(n.stateNode),jt=r,Vn=a;break;case 5:Vt||va(n,t);case 6:if(r=jt,a=Vn,jt=null,$a(e,t,n),jt=r,Vn=a,jt!==null)if(Vn)try{(jt.nodeType===9?jt.body:jt.nodeName==="HTML"?jt.ownerDocument.body:jt).removeChild(n.stateNode)}catch(i){it(n,t,i)}else try{jt.removeChild(n.stateNode)}catch(i){it(n,t,i)}break;case 18:jt!==null&&(Vn?(e=jt,AS(e.nodeType===9?e.body:e.nodeName==="HTML"?e.ownerDocument.body:e,n.stateNode),Zl(e)):AS(jt,n.stateNode));break;case 4:r=jt,a=Vn,jt=n.stateNode.containerInfo,Vn=!0,$a(e,t,n),jt=r,Vn=a;break;case 0:case 11:case 14:case 15:cs(2,n,t),Vt||cs(4,n,t),$a(e,t,n);break;case 1:Vt||(va(n,t),r=n.stateNode,typeof r.componentWillUnmount=="function"&&cj(n,t,r)),$a(e,t,n);break;case 21:$a(e,t,n);break;case 22:Vt=(r=Vt)||n.memoizedState!==null,$a(e,t,n),Vt=r;break;default:$a(e,t,n)}}function gj(e,t){if(t.memoizedState===null&&(e=t.alternate,e!==null&&(e=e.memoizedState,e!==null))){e=e.dehydrated;try{Zl(e)}catch(n){it(t,t.return,n)}}}function yj(e,t){if(t.memoizedState===null&&(e=t.alternate,e!==null&&(e=e.memoizedState,e!==null&&(e=e.dehydrated,e!==null))))try{Zl(e)}catch(n){it(t,t.return,n)}}function T4(e){switch(e.tag){case 31:case 13:case 19:var t=e.stateNode;return t===null&&(t=e.stateNode=new yS),t;case 22:return e=e.stateNode,t=e._retryCache,t===null&&(t=e._retryCache=new yS),t;default:throw Error(te(435,e.tag))}}function Wd(e,t){var n=T4(e);t.forEach(function(r){if(!n.has(r)){n.add(r);var a=I4.bind(null,e,r);r.then(a,a)}})}function Un(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(gs(o.type)){jt=o.stateNode,Vn=!1;break e}break;case 5:jt=o.stateNode,Vn=!1;break e;case 3:case 4:jt=o.stateNode.containerInfo,Vn=!0;break e}o=o.return}if(jt===null)throw Error(te(160));mj(i,s,a),jt=null,Vn=!1,i=a.alternate,i!==null&&(i.return=null),a.return=null}if(t.subtreeFlags&13886)for(t=t.child;t!==null;)vj(t,e),t=t.sibling}var Yr=null;function vj(e,t){var n=e.alternate,r=e.flags;switch(e.tag){case 0:case 11:case 14:case 15:Un(t,e),Fn(e),r&4&&(cs(3,e,e.return),hd(3,e),cs(5,e,e.return));break;case 1:Un(t,e),Fn(e),r&512&&(Vt||n===null||va(n,n.return)),r&64&&Za&&(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=Yr;if(Un(t,e),Fn(e),r&512&&(Vt||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[cd]||i[gn]||i.namespaceURI==="http://www.w3.org/2000/svg"||i.hasAttribute("itemprop"))&&(i=a.createElement(r),a.head.insertBefore(i,a.querySelector("head > title"))),xn(i,r,n),i[gn]=e,sn(i),r=i;break e;case"link":var s=zS("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),xn(i,r,n),a.head.appendChild(i);break;case"meta":if(s=zS("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),xn(i,r,n),a.head.appendChild(i);break;default:throw Error(te(468,r))}i[gn]=e,sn(i),r=i}e.stateNode=r}else IS(a,e.type,e.stateNode);else e.stateNode=DS(a,r,e.memoizedProps);else i!==r?(i===null?n.stateNode!==null&&(n=n.stateNode,n.parentNode.removeChild(n)):i.count--,r===null?IS(a,e.type,e.stateNode):DS(a,r,e.memoizedProps)):r===null&&e.stateNode!==null&&sg(e,e.memoizedProps,n.memoizedProps)}break;case 27:Un(t,e),Fn(e),r&512&&(Vt||n===null||va(n,n.return)),n!==null&&r&4&&sg(e,e.memoizedProps,n.memoizedProps);break;case 5:if(Un(t,e),Fn(e),r&512&&(Vt||n===null||va(n,n.return)),e.flags&32){a=e.stateNode;try{Ll(a,"")}catch(y){it(e,e.return,y)}}r&4&&e.stateNode!=null&&(a=e.memoizedProps,sg(e,a,n!==null?n.memoizedProps:a)),r&1024&&(lg=!0);break;case 6:if(Un(t,e),Fn(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(Bf=null,a=Yr,Yr=zh(t.containerInfo),Un(t,e),Yr=a,Fn(e),r&4&&n!==null&&n.memoizedState.isDehydrated)try{Zl(t.containerInfo)}catch(y){it(e,e.return,y)}lg&&(lg=!1,bj(e));break;case 4:r=Yr,Yr=zh(e.stateNode.containerInfo),Un(t,e),Fn(e),Yr=r;break;case 12:Un(t,e),Fn(e);break;case 31:Un(t,e),Fn(e),r&4&&(r=e.updateQueue,r!==null&&(e.updateQueue=null,Wd(e,r)));break;case 13:Un(t,e),Fn(e),e.child.flags&8192&&e.memoizedState!==null!=(n!==null&&n.memoizedState!==null)&&(Fp=dr()),r&4&&(r=e.updateQueue,r!==null&&(e.updateQueue=null,Wd(e,r)));break;case 22:a=e.memoizedState!==null;var l=n!==null&&n.memoizedState!==null,u=Za,d=Vt;if(Za=u||a,Vt=d||l,Un(t,e),Vt=d,Za=u,Fn(e),r&8192)e:for(t=e.stateNode,t._visibility=a?t._visibility&-2:t._visibility|1,a&&(n===null||l||Za||Vt||Os(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,p=f!=null&&f.hasOwnProperty("display")?f.display:null;o.style.display=p==null||typeof p=="boolean"?"":(""+p).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?RS(h,!0):RS(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,Wd(e,n))));break;case 19:Un(t,e),Fn(e),r&4&&(r=e.updateQueue,r!==null&&(e.updateQueue=null,Wd(e,r)));break;case 30:break;case 21:break;default:Un(t,e),Fn(e)}}function Fn(e){var t=e.flags;if(t&2){try{for(var n,r=e.return;r!==null;){if(dj(r)){n=r;break}r=r.return}if(n==null)throw Error(te(160));switch(n.tag){case 27:var a=n.stateNode,i=og(e);Th(e,i,a);break;case 5:var s=n.stateNode;n.flags&32&&(Ll(s,""),n.flags&=-33);var o=og(e);Th(e,o,s);break;case 3:case 4:var l=n.stateNode.containerInfo,u=og(e);Ky(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 bj(e){if(e.subtreeFlags&1024)for(e=e.child;e!==null;){var t=e;bj(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;)hj(e,t.alternate,t),t=t.sibling}function Os(e){for(e=e.child;e!==null;){var t=e;switch(t.tag){case 0:case 11:case 14:case 15:cs(4,t,t.return),Os(t);break;case 1:va(t,t.return);var n=t.stateNode;typeof n.componentWillUnmount=="function"&&cj(t,t.return,n),Os(t);break;case 27:mu(t.stateNode);case 26:case 5:va(t,t.return),Os(t);break;case 22:t.memoizedState===null&&Os(t);break;case 30:Os(t);break;default:Os(t)}e=e.sibling}}function Ia(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:Ia(a,i,n),hd(4,i);break;case 1:if(Ia(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++)gN(l[a],o)}catch(u){it(r,r.return,u)}}n&&s&64&&lj(i),du(i,i.return);break;case 27:fj(i);case 26:case 5:Ia(a,i,n),n&&r===null&&s&4&&uj(i),du(i,i.return);break;case 12:Ia(a,i,n);break;case 31:Ia(a,i,n),n&&s&4&&gj(a,i);break;case 13:Ia(a,i,n),n&&s&4&&yj(a,i);break;case 22:i.memoizedState===null&&Ia(a,i,n),du(i,i.return);break;case 30:break;default:Ia(a,i,n)}t=t.sibling}}function _b(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&&dd(n))}function kb(e,t){e=null,t.alternate!==null&&(e=t.alternate.memoizedState.cache),t=t.memoizedState.cache,t!==e&&(t.refCount++,e!=null&&dd(e))}function Fr(e,t,n,r){if(t.subtreeFlags&10256)for(t=t.child;t!==null;)xj(e,t,n,r),t=t.sibling}function xj(e,t,n,r){var a=t.flags;switch(t.tag){case 0:case 11:case 15:Fr(e,t,n,r),a&2048&&hd(9,t);break;case 1:Fr(e,t,n,r);break;case 3:Fr(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&&dd(e)));break;case 12:if(a&2048){Fr(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 Fr(e,t,n,r);break;case 31:Fr(e,t,n,r);break;case 13:Fr(e,t,n,r);break;case 23:break;case 22:i=t.stateNode,s=t.alternate,t.memoizedState!==null?i._visibility&2?Fr(e,t,n,r):fu(e,t):i._visibility&2?Fr(e,t,n,r):(i._visibility|=2,Lo(e,t,n,r,(t.subtreeFlags&10256)!==0||!1)),a&2048&&_b(s,t);break;case 24:Fr(e,t,n,r),a&2048&&kb(t.alternate,t);break;default:Fr(e,t,n,r)}}function Lo(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:Lo(i,s,o,l,a),hd(8,s);break;case 23:break;case 22:var d=s.stateNode;s.memoizedState!==null?d._visibility&2?Lo(i,s,o,l,a):fu(i,s):(d._visibility|=2,Lo(i,s,o,l,a)),a&&u&2048&&_b(s.alternate,s);break;case 24:Lo(i,s,o,l,a),a&&u&2048&&kb(s.alternate,s);break;default:Lo(i,s,o,l,a)}t=t.sibling}}function fu(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:fu(n,r),a&2048&&_b(r.alternate,r);break;case 24:fu(n,r),a&2048&&kb(r.alternate,r);break;default:fu(n,r)}t=t.sibling}}var Gc=8192;function Ro(e,t,n){if(e.subtreeFlags&Gc)for(e=e.child;e!==null;)wj(e,t,n),e=e.sibling}function wj(e,t,n){switch(e.tag){case 26:Ro(e,t,n),e.flags&Gc&&e.memoizedState!==null&&mz(n,Yr,e.memoizedState,e.memoizedProps);break;case 5:Ro(e,t,n);break;case 3:case 4:var r=Yr;Yr=zh(e.stateNode.containerInfo),Ro(e,t,n),Yr=r;break;case 22:e.memoizedState===null&&(r=e.alternate,r!==null&&r.memoizedState!==null?(r=Gc,Gc=16777216,Ro(e,t,n),Gc=r):Ro(e,t,n));break;default:Ro(e,t,n)}}function Sj(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 $c(e){var t=e.deletions;if(e.flags&16){if(t!==null)for(var n=0;n<t.length;n++){var r=t[n];an=r,kj(r,e)}Sj(e)}if(e.subtreeFlags&10256)for(e=e.child;e!==null;)_j(e),e=e.sibling}function _j(e){switch(e.tag){case 0:case 11:case 15:$c(e),e.flags&2048&&cs(9,e,e.return);break;case 3:$c(e);break;case 12:$c(e);break;case 22:var t=e.stateNode;e.memoizedState!==null&&t._visibility&2&&(e.return===null||e.return.tag!==13)?(t._visibility&=-3,qf(e)):$c(e);break;default:$c(e)}}function qf(e){var t=e.deletions;if(e.flags&16){if(t!==null)for(var n=0;n<t.length;n++){var r=t[n];an=r,kj(r,e)}Sj(e)}for(e=e.child;e!==null;){switch(t=e,t.tag){case 0:case 11:case 15:cs(8,t,t.return),qf(t);break;case 22:n=t.stateNode,n._visibility&2&&(n._visibility&=-3,qf(t));break;default:qf(t)}e=e.sibling}}function kj(e,t){for(;an!==null;){var n=an;switch(n.tag){case 0:case 11:case 15:cs(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:dd(n.memoizedState.cache)}if(r=n.child,r!==null)r.return=n,an=r;else e:for(n=e;an!==null;){r=an;var a=r.sibling,i=r.return;if(pj(r),r===n){an=null;break e}if(a!==null){a.return=i,an=a;break e}an=i}}}var A4={getCacheForType:function(e){var t=vn(Kt),n=t.data.get(e);return n===void 0&&(n=e(),t.data.set(e,n)),n},cacheSignal:function(){return vn(Kt).controller.signal}},R4=typeof WeakMap=="function"?WeakMap:Map,We=0,dt=null,Be=null,Ke=0,rt=0,ir=null,Ki=!1,uc=!1,Eb=!1,li=0,It=0,us=0,to=0,Cb=0,ur=0,Hl=0,hu=null,Zn=null,Zy=!1,Fp=0,Ej=0,Ah=1/0,Rh=null,es=null,Wt=0,ts=null,Bl=null,ti=0,Gy=0,Qy=null,Cj=null,pu=0,Yy=null;function pr(){return We&2&&Ke!==0?Ke&-Ke:Re.T!==null?jb():PC()}function Nj(){if(ur===0)if(!(Ke&536870912)||Qe){var e=Bd;Bd<<=1,!(Bd&3932160)&&(Bd=262144),ur=e}else ur=536870912;return e=vr.current,e!==null&&(e.flags|=32),ur}function Wn(e,t,n){(e===dt&&(rt===2||rt===9)||e.cancelPendingCommit!==null)&&(Vl(e,0),Zi(e,Ke,ur,!1)),ld(e,n),(!(We&2)||e!==dt)&&(e===dt&&(!(We&2)&&(to|=n),It===4&&Zi(e,Ke,ur,!1)),ka(e))}function jj(e,t,n){if(We&6)throw Error(te(327));var r=!n&&(t&127)===0&&(t&e.expiredLanes)===0||od(e,t),a=r?M4(e,t):cg(e,t,!0),i=r;do{if(a===0){uc&&!r&&Zi(e,t,0,!1);break}else{if(n=e.current.alternate,i&&!$4(n)){a=cg(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=hu;var l=o.current.memoizedState.isDehydrated;if(l&&(Vl(o,s).flags|=256),s=cg(o,s,!1),s!==2){if(Eb&&!l){o.errorRecoveryDisabledLanes|=i,to|=i,a=4;break e}i=Zn,Zn=a,i!==null&&(Zn===null?Zn=i:Zn.push.apply(Zn,i))}a=s}if(i=!1,a!==2)continue}}if(a===1){Vl(e,0),Zi(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:Zi(r,t,ur,!Ki);break e;case 2:Zn=null;break;case 3:case 5:break;default:throw Error(te(329))}if((t&62914560)===t&&(a=Fp+300-dr(),10<a)){if(Zi(r,t,ur,!Ki),Ap(r,0,!0)!==0)break e;ti=t,r.timeoutHandle=Gj(vS.bind(null,r,n,Zn,Rh,Zy,t,ur,to,Hl,Ki,i,"Throttled",-0,0),a);break e}vS(r,n,Zn,Rh,Zy,t,ur,to,Hl,Ki,i,null,-0,0)}}break}while(!0);ka(e)}function vS(e,t,n,r,a,i,s,o,l,u,d,f,p,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:Ya},wj(t,i,f);var y=(i&62914560)===i?Fp-dr():(i&4194048)===i?Ej-dr():0;if(y=gz(f,y),y!==null){ti=i,e.cancelPendingCommit=y(xS.bind(null,e,t,i,n,r,a,s,o,l,d,f,null,p,h)),Zi(e,i,s,!u);return}}xS(e,t,i,n,r,a,s,o,l)}function $4(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(!yr(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 Zi(e,t,n,r){t&=~Cb,t&=~to,e.suspendedLanes|=t,e.pingedLanes&=~t,r&&(e.warmLanes|=t),r=e.expirationTimes;for(var a=t;0<a;){var i=31-hr(a),s=1<<i;r[i]=-1,a&=~s}n!==0&&$C(e,n,t)}function qp(){return We&6?!0:(pd(0),!1)}function Nb(){if(Be!==null){if(rt===0)var e=Be.return;else e=Be,Xa=Co=null,fb(e),pl=null,Du=0,e=Be;for(;e!==null;)oj(e.alternate,e),e=e.return;Be=null}}function Vl(e,t){var n=e.timeoutHandle;n!==-1&&(e.timeoutHandle=-1,W4(n)),n=e.cancelPendingCommit,n!==null&&(e.cancelPendingCommit=null,n()),ti=0,Nb(),dt=e,Be=n=Ja(e.current,null),Ke=t,rt=0,ir=null,Ki=!1,uc=od(e,t),Eb=!1,Hl=ur=Cb=to=us=It=0,Zn=hu=null,Zy=!1,t&8&&(t|=t&32);var r=e.entangledLanes;if(r!==0)for(e=e.entanglements,r&=t;0<r;){var a=31-hr(r),i=1<<a;t|=e[a],r&=~i}return li=t,Mp(),n}function Tj(e,t){Pe=null,Re.H=Iu,t===cc||t===Dp?(t=Y1(),rt=3):t===ib?(t=Y1(),rt=4):rt=t===wb?8:t!==null&&typeof t=="object"&&typeof t.then=="function"?6:1,ir=t,Be===null&&(It=1,Nh(e,Or(t,e.current)))}function Aj(){var e=vr.current;return e===null?!0:(Ke&4194048)===Ke?Pr===null:(Ke&62914560)===Ke||Ke&536870912?e===Pr:!1}function Rj(){var e=Re.H;return Re.H=Iu,e===null?Iu:e}function $j(){var e=Re.A;return Re.A=A4,e}function $h(){It=4,Ki||(Ke&4194048)!==Ke&&vr.current!==null||(uc=!0),!(us&134217727)&&!(to&134217727)||dt===null||Zi(dt,Ke,ur,!1)}function cg(e,t,n){var r=We;We|=2;var a=Rj(),i=$j();(dt!==e||Ke!==t)&&(Rh=null,Vl(e,t)),t=!1;var s=It;e:do try{if(rt!==0&&Be!==null){var o=Be,l=ir;switch(rt){case 8:Nb(),s=6;break e;case 3:case 2:case 9:case 6:vr.current===null&&(t=!0);var u=rt;if(rt=0,ir=null,il(e,o,l,u),n&&uc){s=0;break e}break;default:u=rt,rt=0,ir=null,il(e,o,l,u)}}O4(),s=It;break}catch(d){Tj(e,d)}while(!0);return t&&e.shellSuspendCounter++,Xa=Co=null,We=r,Re.H=a,Re.A=i,Be===null&&(dt=null,Ke=0,Mp()),s}function O4(){for(;Be!==null;)Oj(Be)}function M4(e,t){var n=We;We|=2;var r=Rj(),a=$j();dt!==e||Ke!==t?(Rh=null,Ah=dr()+500,Vl(e,t)):uc=od(e,t);e:do try{if(rt!==0&&Be!==null){t=Be;var i=ir;t:switch(rt){case 1:rt=0,ir=null,il(e,t,i,1);break;case 2:case 9:if(Q1(i)){rt=0,ir=null,bS(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:Q1(i)?(rt=0,ir=null,bS(t)):(rt=0,ir=null,il(e,t,i,7));break;case 5:var s=null;switch(Be.tag){case 26:s=Be.memoizedState;case 5:case 27:var o=Be;if(s?Jj(s):o.stateNode.complete){rt=0,ir=null;var l=o.sibling;if(l!==null)Be=l;else{var u=o.return;u!==null?(Be=u,Hp(u)):Be=null}break t}}rt=0,ir=null,il(e,t,i,5);break;case 6:rt=0,ir=null,il(e,t,i,6);break;case 8:Nb(),It=6;break e;default:throw Error(te(462))}}P4();break}catch(d){Tj(e,d)}while(!0);return Xa=Co=null,Re.H=r,Re.A=a,We=n,Be!==null?0:(dt=null,Ke=0,Mp(),It)}function P4(){for(;Be!==null&&!aD();)Oj(Be)}function Oj(e){var t=sj(e.alternate,e,li);e.memoizedProps=e.pendingProps,t===null?Hp(e):Be=t}function bS(e){var t=e,n=t.alternate;switch(t.tag){case 15:case 0:t=fS(n,t,t.pendingProps,t.type,void 0,Ke);break;case 11:t=fS(n,t,t.pendingProps,t.type.render,t.ref,Ke);break;case 5:fb(t);default:oj(n,t),t=Be=oN(t,li),t=sj(n,t,li)}e.memoizedProps=e.pendingProps,t===null?Hp(e):Be=t}function il(e,t,n,r){Xa=Co=null,fb(t),pl=null,Du=0;var a=t.return;try{if(_4(e,a,t,n,Ke)){It=1,Nh(e,Or(n,e.current)),Be=null;return}}catch(i){if(a!==null)throw Be=a,i;It=1,Nh(e,Or(n,e.current)),Be=null;return}t.flags&32768?(Qe||r===1?e=!0:uc||Ke&536870912?e=!1:(Ki=e=!0,(r===2||r===9||r===3||r===6)&&(r=vr.current,r!==null&&r.tag===13&&(r.flags|=16384))),Mj(t,e)):Hp(t)}function Hp(e){var t=e;do{if(t.flags&32768){Mj(t,Ki);return}e=t.return;var n=C4(t.alternate,t,li);if(n!==null){Be=n;return}if(t=t.sibling,t!==null){Be=t;return}Be=t=e}while(t!==null);It===0&&(It=5)}function Mj(e,t){do{var n=N4(e.alternate,e);if(n!==null){n.flags&=32767,Be=n;return}if(n=e.return,n!==null&&(n.flags|=32768,n.subtreeFlags=0,n.deletions=null),!t&&(e=e.sibling,e!==null)){Be=e;return}Be=e=n}while(e!==null);It=6,Be=null}function xS(e,t,n,r,a,i,s,o,l){e.cancelPendingCommit=null;do Bp();while(Wt!==0);if(We&6)throw Error(te(327));if(t!==null){if(t===e.current)throw Error(te(177));if(i=t.lanes|t.childLanes,i|=W0,pD(e,n,i,s,o,l),e===dt&&(Be=dt=null,Ke=0),Bl=t,ts=e,ti=n,Gy=i,Qy=a,Cj=r,t.subtreeFlags&10256||t.flags&10256?(e.callbackNode=null,e.callbackPriority=0,L4(gh,function(){return Lj(),null})):(e.callbackNode=null,e.callbackPriority=0),r=(t.flags&13878)!==0,t.subtreeFlags&13878||r){r=Re.T,Re.T=null,a=Je.p,Je.p=2,s=We,We|=4;try{j4(e,t,n)}finally{We=s,Je.p=a,Re.T=r}}Wt=1,Pj(),Dj(),zj()}}function Pj(){if(Wt===1){Wt=0;var e=ts,t=Bl,n=(t.flags&13878)!==0;if(t.subtreeFlags&13878||n){n=Re.T,Re.T=null;var r=Je.p;Je.p=2;var a=We;We|=4;try{vj(t,e);var i=ev,s=JC(e.containerInfo),o=i.focusedElem,l=i.selectionRange;if(s!==o&&o&&o.ownerDocument&&WC(o.ownerDocument.documentElement,o)){if(l!==null&&X0(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,p=f&&f.defaultView||window;if(p.getSelection){var h=p.getSelection(),y=o.textContent.length,m=Math.min(l.start,y),b=l.end===void 0?m:Math.min(l.end,y);!h.extend&&m>b&&(s=b,b=m,m=s);var g=q1(o,m),v=q1(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 x=f.createRange();x.setStart(g.node,g.offset),h.removeAllRanges(),m>b?(h.addRange(x),h.extend(v.node,v.offset)):(x.setEnd(v.node,v.offset),h.addRange(x))}}}}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}}Uh=!!Jy,ev=Jy=null}finally{We=a,Je.p=r,Re.T=n}}e.current=t,Wt=2}}function Dj(){if(Wt===2){Wt=0;var e=ts,t=Bl,n=(t.flags&8772)!==0;if(t.subtreeFlags&8772||n){n=Re.T,Re.T=null;var r=Je.p;Je.p=2;var a=We;We|=4;try{hj(e,t.alternate,t)}finally{We=a,Je.p=r,Re.T=n}}Wt=3}}function zj(){if(Wt===4||Wt===3){Wt=0,iD();var e=ts,t=Bl,n=ti,r=Cj;t.subtreeFlags&10256||t.flags&10256?Wt=5:(Wt=0,Bl=ts=null,Ij(e,e.pendingLanes));var a=e.pendingLanes;if(a===0&&(es=null),B0(n),t=t.stateNode,fr&&typeof fr.onCommitFiberRoot=="function")try{fr.onCommitFiberRoot(sd,t,void 0,(t.current.flags&128)===128)}catch{}if(r!==null){t=Re.T,a=Je.p,Je.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,Je.p=a}}ti&3&&Bp(),ka(e),a=e.pendingLanes,n&261930&&a&42?e===Yy?pu++:(pu=0,Yy=e):pu=0,pd(0)}}function Ij(e,t){(e.pooledCacheLanes&=t)===0&&(t=e.pooledCache,t!=null&&(e.pooledCache=null,dd(t)))}function Bp(){return Pj(),Dj(),zj(),Lj()}function Lj(){if(Wt!==5)return!1;var e=ts,t=Gy;Gy=0;var n=B0(ti),r=Re.T,a=Je.p;try{Je.p=32>n?32:n,Re.T=null,n=Qy,Qy=null;var i=ts,s=ti;if(Wt=0,Bl=ts=null,ti=0,We&6)throw Error(te(331));var o=We;if(We|=4,_j(i.current),xj(i,i.current,s,n),We=o,pd(0,!1),fr&&typeof fr.onPostCommitFiberRoot=="function")try{fr.onPostCommitFiberRoot(sd,i)}catch{}return!0}finally{Je.p=a,Re.T=r,Ij(e,t)}}function wS(e,t,n){t=Or(n,t),t=Hy(e.stateNode,t,2),e=Ji(e,t,2),e!==null&&(ld(e,2),ka(e))}function it(e,t,n){if(e.tag===3)wS(e,e,n);else for(;t!==null;){if(t.tag===3){wS(t,e,n);break}else if(t.tag===1){var r=t.stateNode;if(typeof t.type.getDerivedStateFromError=="function"||typeof r.componentDidCatch=="function"&&(es===null||!es.has(r))){e=Or(n,e),n=ej(2),r=Ji(t,n,2),r!==null&&(tj(n,r,t,e),ld(r,2),ka(r));break}}t=t.return}}function ug(e,t,n){var r=e.pingCache;if(r===null){r=e.pingCache=new R4;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)||(Eb=!0,a.add(n),e=D4.bind(null,e,t,n),t.then(e,e))}function D4(e,t,n){var r=e.pingCache;r!==null&&r.delete(t),e.pingedLanes|=e.suspendedLanes&n,e.warmLanes&=~n,dt===e&&(Ke&n)===n&&(It===4||It===3&&(Ke&62914560)===Ke&&300>dr()-Fp?!(We&2)&&Vl(e,0):Cb|=n,Hl===Ke&&(Hl=0)),ka(e)}function Uj(e,t){t===0&&(t=RC()),e=Eo(e,t),e!==null&&(ld(e,t),ka(e))}function z4(e){var t=e.memoizedState,n=0;t!==null&&(n=t.retryLane),Uj(e,n)}function I4(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),Uj(e,n)}function L4(e,t){return q0(e,t)}var Oh=null,Uo=null,Xy=!1,Mh=!1,dg=!1,Gi=0;function ka(e){e!==Uo&&e.next===null&&(Uo===null?Oh=Uo=e:Uo=Uo.next=e),Mh=!0,Xy||(Xy=!0,F4())}function pd(e,t){if(!dg&&Mh){dg=!0;do for(var n=!1,r=Oh;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-hr(42|e)+1)-1,i&=a&~(s&~o),i=i&201326741?i&201326741|1:i?i|2:0}i!==0&&(n=!0,SS(r,i))}else i=Ke,i=Ap(r,r===dt?i:0,r.cancelPendingCommit!==null||r.timeoutHandle!==-1),!(i&3)||od(r,i)||(n=!0,SS(r,i));r=r.next}while(n);dg=!1}}function U4(){Fj()}function Fj(){Mh=Xy=!1;var e=0;Gi!==0&&X4()&&(e=Gi);for(var t=dr(),n=null,r=Oh;r!==null;){var a=r.next,i=qj(r,t);i===0?(r.next=null,n===null?Oh=a:n.next=a,a===null&&(Uo=n)):(n=r,(e!==0||i&3)&&(Mh=!0)),r=a}Wt!==0&&Wt!==5||pd(e),Gi!==0&&(Gi=0)}function qj(e,t){for(var n=e.suspendedLanes,r=e.pingedLanes,a=e.expirationTimes,i=e.pendingLanes&-62914561;0<i;){var s=31-hr(i),o=1<<s,l=a[s];l===-1?(!(o&n)||o&r)&&(a[s]=hD(o,t)):l<=t&&(e.expiredLanes|=o),i&=~o}if(t=dt,n=Ke,n=Ap(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&&Lm(r),e.callbackNode=null,e.callbackPriority=0;if(!(n&3)||od(e,n)){if(t=n&-n,t===e.callbackPriority)return t;switch(r!==null&&Lm(r),B0(n)){case 2:case 8:n=TC;break;case 32:n=gh;break;case 268435456:n=AC;break;default:n=gh}return r=Hj.bind(null,e),n=q0(n,r),e.callbackPriority=t,e.callbackNode=n,t}return r!==null&&r!==null&&Lm(r),e.callbackPriority=2,e.callbackNode=null,2}function Hj(e,t){if(Wt!==0&&Wt!==5)return e.callbackNode=null,e.callbackPriority=0,null;var n=e.callbackNode;if(Bp()&&e.callbackNode!==n)return null;var r=Ke;return r=Ap(e,e===dt?r:0,e.cancelPendingCommit!==null||e.timeoutHandle!==-1),r===0?null:(jj(e,r,t),qj(e,dr()),e.callbackNode!=null&&e.callbackNode===n?Hj.bind(null,e):null)}function SS(e,t){if(Bp())return null;jj(e,t,!0)}function F4(){J4(function(){We&6?q0(jC,U4):Fj()})}function jb(){if(Gi===0){var e=Ul;e===0&&(e=Hd,Hd<<=1,!(Hd&261888)&&(Hd=256)),Gi=e}return Gi}function _S(e){return e==null||typeof e=="symbol"||typeof e=="boolean"?null:typeof e=="function"?e:Of(""+e)}function kS(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 q4(e,t,n,r,a){if(t==="submit"&&n&&n.stateNode===a){var i=_S((a[Jn]||null).action),s=r.submitter;s&&(t=(t=s[Jn]||null)?_S(t.formAction):s.getAttribute("formAction"),t!==null&&(i=t,s=null));var o=new Rp("action","action",null,r,a);e.push({event:o,listeners:[{instance:null,listener:function(){if(r.defaultPrevented){if(Gi!==0){var l=s?kS(a,s):new FormData(a);Fy(n,{pending:!0,data:l,method:a.method,action:i},null,l)}}else typeof i=="function"&&(o.preventDefault(),l=s?kS(a,s):new FormData(a),Fy(n,{pending:!0,data:l,method:a.method,action:i},i,l))},currentTarget:a}]})}}for(var fg=0;fg<Ty.length;fg++){var hg=Ty[fg],H4=hg.toLowerCase(),B4=hg[0].toUpperCase()+hg.slice(1);na(H4,"on"+B4)}na(tN,"onAnimationEnd");na(nN,"onAnimationIteration");na(rN,"onAnimationStart");na("dblclick","onDoubleClick");na("focusin","onFocus");na("focusout","onBlur");na(s4,"onTransitionRun");na(o4,"onTransitionStart");na(l4,"onTransitionCancel");na(aN,"onTransitionEnd");Il("onMouseEnter",["mouseout","mouseover"]);Il("onMouseLeave",["mouseout","mouseover"]);Il("onPointerEnter",["pointerout","pointerover"]);Il("onPointerLeave",["pointerout","pointerover"]);So("onChange","change click focusin focusout input keydown keyup selectionchange".split(" "));So("onSelect","focusout contextmenu dragend focusin keydown keyup mousedown mouseup selectionchange".split(" "));So("onBeforeInput",["compositionend","keypress","textInput","paste"]);So("onCompositionEnd","compositionend focusout keydown keypress keyup mousedown".split(" "));So("onCompositionStart","compositionstart focusout keydown keypress keyup mousedown".split(" "));So("onCompositionUpdate","compositionupdate focusout keydown keypress keyup mousedown".split(" "));var Lu="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(" "),V4=new Set("beforetoggle cancel close invalid load scroll scrollend toggle".split(" ").concat(Lu));function Bj(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){vh(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){vh(d)}a.currentTarget=null,i=l}}}}function He(e,t){var n=t[wy];n===void 0&&(n=t[wy]=new Set);var r=e+"__bubble";n.has(r)||(Vj(t,e,2,!1),n.add(r))}function pg(e,t,n){var r=0;t&&(r|=4),Vj(n,e,r,t)}var Jd="_reactListening"+Math.random().toString(36).slice(2);function Tb(e){if(!e[Jd]){e[Jd]=!0,DC.forEach(function(n){n!=="selectionchange"&&(V4.has(n)||pg(n,!1,e),pg(n,!0,e))});var t=e.nodeType===9?e:e.ownerDocument;t===null||t[Jd]||(t[Jd]=!0,pg("selectionchange",!1,t))}}function Vj(e,t,n,r){switch(a2(t)){case 2:var a=bz;break;case 8:a=xz;break;default:a=Ob}n=a.bind(null,t,n,e),a=void 0,!Cy||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 mg(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=Yo(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}BC(function(){var u=i,d=Z0(n),f=[];e:{var p=iN.get(e);if(p!==void 0){var h=Rp,y=e;switch(e){case"keypress":if(Pf(n)===0)break e;case"keydown":case"keyup":h=ID;break;case"focusin":y="focus",h=Bm;break;case"focusout":y="blur",h=Bm;break;case"beforeblur":case"afterblur":h=Bm;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=$1;break;case"drag":case"dragend":case"dragenter":case"dragexit":case"dragleave":case"dragover":case"dragstart":case"drop":h=CD;break;case"touchcancel":case"touchend":case"touchmove":case"touchstart":h=FD;break;case tN:case nN:case rN:h=TD;break;case aN:h=HD;break;case"scroll":case"scrollend":h=kD;break;case"wheel":h=VD;break;case"copy":case"cut":case"paste":h=RD;break;case"gotpointercapture":case"lostpointercapture":case"pointercancel":case"pointerdown":case"pointermove":case"pointerout":case"pointerover":case"pointerup":h=M1;break;case"toggle":case"beforetoggle":h=ZD}var m=(t&4)!==0,b=!m&&(e==="scroll"||e==="scrollend"),g=m?p!==null?p+"Capture":null:p;m=[];for(var v=u,x;v!==null;){var S=v;if(x=S.stateNode,S=S.tag,S!==5&&S!==26&&S!==27||x===null||g===null||(S=Ru(v,g),S!=null&&m.push(Uu(v,S,x))),b)break;v=v.return}0<m.length&&(p=new h(p,y,null,n,d),f.push({event:p,listeners:m}))}}if(!(t&7)){e:{if(p=e==="mouseover"||e==="pointerover",h=e==="mouseout"||e==="pointerout",p&&n!==Ey&&(y=n.relatedTarget||n.fromElement)&&(Yo(y)||y[sc]))break e;if((h||p)&&(p=d.window===d?d:(p=d.ownerDocument)?p.defaultView||p.parentWindow:window,h?(y=n.relatedTarget||n.toElement,h=u,y=y?Yo(y):null,y!==null&&(b=id(y),m=y.tag,y!==b||m!==5&&m!==27&&m!==6)&&(y=null)):(h=null,y=u),h!==y)){if(m=$1,S="onMouseLeave",g="onMouseEnter",v="mouse",(e==="pointerout"||e==="pointerover")&&(m=M1,S="onPointerLeave",g="onPointerEnter",v="pointer"),b=h==null?p:Kc(h),x=y==null?p:Kc(y),p=new m(S,v+"leave",h,n,d),p.target=b,p.relatedTarget=x,S=null,Yo(d)===u&&(m=new m(g,v+"enter",y,n,d),m.target=x,m.relatedTarget=b,S=m),b=S,h&&y)t:{for(m=K4,g=h,v=y,x=0,S=g;S;S=m(S))x++;S=0;for(var k=v;k;k=m(k))S++;for(;0<x-S;)g=m(g),x--;for(;0<S-x;)v=m(v),S--;for(;x--;){if(g===v||v!==null&&g===v.alternate){m=g;break t}g=m(g),v=m(v)}m=null}else m=null;h!==null&&ES(f,p,h,m,!1),y!==null&&b!==null&&ES(f,b,y,m,!0)}}e:{if(p=u?Kc(u):window,h=p.nodeName&&p.nodeName.toLowerCase(),h==="select"||h==="input"&&p.type==="file")var C=I1;else if(z1(p))if(YC)C=r4;else{C=t4;var N=e4}else h=p.nodeName,!h||h.toLowerCase()!=="input"||p.type!=="checkbox"&&p.type!=="radio"?u&&K0(u.elementType)&&(C=I1):C=n4;if(C&&(C=C(e,u))){QC(f,C,n,d);break e}N&&N(e,p,u),e==="focusout"&&u&&p.type==="number"&&u.memoizedProps.value!=null&&ky(p,"number",p.value)}switch(N=u?Kc(u):window,e){case"focusin":(z1(N)||N.contentEditable==="true")&&(Jo=N,Ny=u,iu=null);break;case"focusout":iu=Ny=Jo=null;break;case"mousedown":jy=!0;break;case"contextmenu":case"mouseup":case"dragend":jy=!1,H1(f,n,d);break;case"selectionchange":if(i4)break;case"keydown":case"keyup":H1(f,n,d)}var P;if(Y0)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 Wo?ZC(e,n)&&(R="onCompositionEnd"):e==="keydown"&&n.keyCode===229&&(R="onCompositionStart");R&&(KC&&n.locale!=="ko"&&(Wo||R!=="onCompositionStart"?R==="onCompositionEnd"&&Wo&&(P=VC()):(Vi=d,G0="value"in Vi?Vi.value:Vi.textContent,Wo=!0)),N=Ph(u,R),0<N.length&&(R=new O1(R,e,null,n,d),f.push({event:R,listeners:N}),P?R.data=P:(P=GC(n),P!==null&&(R.data=P)))),(P=QD?YD(e,n):XD(e,n))&&(R=Ph(u,"onBeforeInput"),0<R.length&&(N=new O1("onBeforeInput","beforeinput",null,n,d),f.push({event:N,listeners:R}),N.data=P)),q4(f,e,u,n,d)}Bj(f,t)})}function Uu(e,t,n){return{instance:e,listener:t,currentTarget:n}}function Ph(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=Ru(e,n),a!=null&&r.unshift(Uu(e,a,i)),a=Ru(e,t),a!=null&&r.push(Uu(e,a,i))),e.tag===3)return r;e=e.return}return[]}function K4(e){if(e===null)return null;do e=e.return;while(e&&e.tag!==5&&e.tag!==27);return e||null}function ES(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=Ru(n,i),u!=null&&s.unshift(Uu(n,u,l))):a||(u=Ru(n,i),u!=null&&s.push(Uu(n,u,l)))),n=n.return}s.length!==0&&e.push({event:t,listeners:s})}var Z4=/\r\n?/g,G4=/\u0000|\uFFFD/g;function CS(e){return(typeof e=="string"?e:""+e).replace(Z4,`
|
|
49
|
+
`).replace(G4,"")}function Kj(e,t){return t=CS(t),CS(e)===t}function st(e,t,n,r,a,i){switch(n){case"children":typeof r=="string"?t==="body"||t==="textarea"&&r===""||Ll(e,r):(typeof r=="number"||typeof r=="bigint")&&t!=="body"&&Ll(e,""+r);break;case"className":Kd(e,"class",r);break;case"tabIndex":Kd(e,"tabindex",r);break;case"dir":case"role":case"viewBox":case"width":case"height":Kd(e,n,r);break;case"style":HC(e,r,i);break;case"data":if(t!=="object"){Kd(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=Of(""+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=Of(""+r),e.setAttribute(n,r);break;case"onClick":r!=null&&(e.onclick=Ya);break;case"onScroll":r!=null&&He("scroll",e);break;case"onScrollEnd":r!=null&&He("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=Of(""+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":He("beforetoggle",e),He("toggle",e),$f(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":$f(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=SD.get(n)||n,$f(e,n,r))}}function Wy(e,t,n,r,a,i){switch(n){case"style":HC(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"?Ll(e,r):(typeof r=="number"||typeof r=="bigint")&&Ll(e,""+r);break;case"onScroll":r!=null&&He("scroll",e);break;case"onScrollEnd":r!=null&&He("scrollend",e);break;case"onClick":r!=null&&(e.onclick=Ya);break;case"suppressContentEditableWarning":case"suppressHydrationWarning":case"innerHTML":case"ref":break;case"innerText":case"textContent":break;default:if(!zC.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[Jn]||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,""):$f(e,n,r)}}}function xn(e,t,n){switch(t){case"div":case"span":case"svg":case"path":case"a":case"g":case"p":case"li":break;case"img":He("error",e),He("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":He("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)}}UC(e,i,o,l,u,s,a,!1);return;case"select":He("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?dl(e,!!r,t,!1):n!=null&&dl(e,!!r,n,!0);return;case"textarea":He("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)}qC(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":He("beforetoggle",e),He("toggle",e),He("cancel",e),He("close",e);break;case"iframe":case"object":He("load",e);break;case"video":case"audio":for(r=0;r<Lu.length;r++)He(Lu[r],e);break;case"image":He("error",e),He("load",e);break;case"details":He("toggle",e);break;case"embed":case"source":case"link":He("error",e),He("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(K0(t)){for(d in n)n.hasOwnProperty(d)&&(r=n[d],r!==void 0&&Wy(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 Q4(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 p in r){var h=r[p];if(f=n[p],r.hasOwnProperty(p)&&(h!=null||f!=null))switch(p){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,p,h,r,f)}}_y(e,s,o,l,u,d,i,a);return;case"select":h=s=o=p=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":p=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,p!=null?dl(e,!!n,p,!1):!!r!=!!n&&(t!=null?dl(e,!!n,t,!0):dl(e,!!n,n?[]:"",!1));return;case"textarea":h=p=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":p=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)}FC(e,p,h);return;case"option":for(var y in n)if(p=n[y],n.hasOwnProperty(y)&&p!=null&&!r.hasOwnProperty(y))switch(y){case"selected":e.selected=!1;break;default:st(e,t,y,null,r,p)}for(l in r)if(p=r[l],h=n[l],r.hasOwnProperty(l)&&p!==h&&(p!=null||h!=null))switch(l){case"selected":e.selected=p&&typeof p!="function"&&typeof p!="symbol";break;default:st(e,t,l,p,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 m in n)p=n[m],n.hasOwnProperty(m)&&p!=null&&!r.hasOwnProperty(m)&&st(e,t,m,null,r,p);for(u in r)if(p=r[u],h=n[u],r.hasOwnProperty(u)&&p!==h&&(p!=null||h!=null))switch(u){case"children":case"dangerouslySetInnerHTML":if(p!=null)throw Error(te(137,t));break;default:st(e,t,u,p,r,h)}return;default:if(K0(t)){for(var b in n)p=n[b],n.hasOwnProperty(b)&&p!==void 0&&!r.hasOwnProperty(b)&&Wy(e,t,b,void 0,r,p);for(d in r)p=r[d],h=n[d],!r.hasOwnProperty(d)||p===h||p===void 0&&h===void 0||Wy(e,t,d,p,r,h);return}}for(var g in n)p=n[g],n.hasOwnProperty(g)&&p!=null&&!r.hasOwnProperty(g)&&st(e,t,g,null,r,p);for(f in r)p=r[f],h=n[f],!r.hasOwnProperty(f)||p===h||p==null&&h==null||st(e,t,f,p,r,h)}function NS(e){switch(e){case"css":case"script":case"font":case"img":case"image":case"input":case"link":return!0;default:return!1}}function Y4(){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&&NS(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&&NS(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 Jy=null,ev=null;function Dh(e){return e.nodeType===9?e:e.ownerDocument}function jS(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 Zj(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 tv(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 gg=null;function X4(){var e=window.event;return e&&e.type==="popstate"?e===gg?!1:(gg=e,!0):(gg=null,!1)}var Gj=typeof setTimeout=="function"?setTimeout:void 0,W4=typeof clearTimeout=="function"?clearTimeout:void 0,TS=typeof Promise=="function"?Promise:void 0,J4=typeof queueMicrotask=="function"?queueMicrotask:typeof TS<"u"?function(e){return TS.resolve(null).then(e).catch(ez)}:Gj;function ez(e){setTimeout(function(){throw e})}function gs(e){return e==="head"}function AS(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),Zl(t);return}r--}else if(n==="$"||n==="$?"||n==="$~"||n==="$!"||n==="&")r++;else if(n==="html")mu(e.ownerDocument.documentElement);else if(n==="head"){n=e.ownerDocument.head,mu(n);for(var i=n.firstChild;i;){var s=i.nextSibling,o=i.nodeName;i[cd]||o==="SCRIPT"||o==="STYLE"||o==="LINK"&&i.rel.toLowerCase()==="stylesheet"||n.removeChild(i),i=s}}else n==="body"&&mu(e.ownerDocument.body);n=a}while(n);Zl(t)}function RS(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 nv(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":nv(n),V0(n);continue;case"SCRIPT":case"STYLE":continue;case"LINK":if(n.rel.toLowerCase()==="stylesheet")continue}e.removeChild(n)}}function tz(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[cd])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=Dr(e.nextSibling),e===null)break}return null}function nz(e,t,n){if(t==="")return null;for(;e.nodeType!==3;)if((e.nodeType!==1||e.nodeName!=="INPUT"||e.type!=="hidden")&&!n||(e=Dr(e.nextSibling),e===null))return null;return e}function Qj(e,t){for(;e.nodeType!==8;)if((e.nodeType!==1||e.nodeName!=="INPUT"||e.type!=="hidden")&&!t||(e=Dr(e.nextSibling),e===null))return null;return e}function rv(e){return e.data==="$?"||e.data==="$~"}function av(e){return e.data==="$!"||e.data==="$?"&&e.ownerDocument.readyState!=="loading"}function rz(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 Dr(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 iv=null;function $S(e){e=e.nextSibling;for(var t=0;e;){if(e.nodeType===8){var n=e.data;if(n==="/$"||n==="/&"){if(t===0)return Dr(e.nextSibling);t--}else n!=="$"&&n!=="$!"&&n!=="$?"&&n!=="$~"&&n!=="&"||t++}e=e.nextSibling}return null}function OS(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 Yj(e,t,n){switch(t=Dh(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 mu(e){for(var t=e.attributes;t.length;)e.removeAttributeNode(t[0]);V0(e)}var zr=new Map,MS=new Set;function zh(e){return typeof e.getRootNode=="function"?e.getRootNode():e.nodeType===9?e:e.ownerDocument}var di=Je.d;Je.d={f:az,r:iz,D:sz,C:oz,L:lz,m:cz,X:dz,S:uz,M:fz};function az(){var e=di.f(),t=qp();return e||t}function iz(e){var t=oc(e);t!==null&&t.tag===5&&t.type==="form"?HN(t):di.r(e)}var dc=typeof document>"u"?null:document;function Xj(e,t,n){var r=dc;if(r&&typeof t=="string"&&t){var a=$r(t);a='link[rel="'+e+'"][href="'+a+'"]',typeof n=="string"&&(a+='[crossorigin="'+n+'"]'),MS.has(a)||(MS.add(a),e={rel:e,crossOrigin:n,href:t},r.querySelector(a)===null&&(t=r.createElement("link"),xn(t,"link",e),sn(t),r.head.appendChild(t)))}}function sz(e){di.D(e),Xj("dns-prefetch",e,null)}function oz(e,t){di.C(e,t),Xj("preconnect",e,t)}function lz(e,t,n){di.L(e,t,n);var r=dc;if(r&&e&&t){var a='link[rel="preload"][as="'+$r(t)+'"]';t==="image"&&n&&n.imageSrcSet?(a+='[imagesrcset="'+$r(n.imageSrcSet)+'"]',typeof n.imageSizes=="string"&&(a+='[imagesizes="'+$r(n.imageSizes)+'"]')):a+='[href="'+$r(e)+'"]';var i=a;switch(t){case"style":i=Kl(e);break;case"script":i=fc(e)}zr.has(i)||(e=Nt({rel:"preload",href:t==="image"&&n&&n.imageSrcSet?void 0:e,as:t},n),zr.set(i,e),r.querySelector(a)!==null||t==="style"&&r.querySelector(md(i))||t==="script"&&r.querySelector(gd(i))||(t=r.createElement("link"),xn(t,"link",e),sn(t),r.head.appendChild(t)))}}function cz(e,t){di.m(e,t);var n=dc;if(n&&e){var r=t&&typeof t.as=="string"?t.as:"script",a='link[rel="modulepreload"][as="'+$r(r)+'"][href="'+$r(e)+'"]',i=a;switch(r){case"audioworklet":case"paintworklet":case"serviceworker":case"sharedworker":case"worker":case"script":i=fc(e)}if(!zr.has(i)&&(e=Nt({rel:"modulepreload",href:e},t),zr.set(i,e),n.querySelector(a)===null)){switch(r){case"audioworklet":case"paintworklet":case"serviceworker":case"sharedworker":case"worker":case"script":if(n.querySelector(gd(i)))return}r=n.createElement("link"),xn(r,"link",e),sn(r),n.head.appendChild(r)}}}function uz(e,t,n){di.S(e,t,n);var r=dc;if(r&&e){var a=ul(r).hoistableStyles,i=Kl(e);t=t||"default";var s=a.get(i);if(!s){var o={loading:0,preload:null};if(s=r.querySelector(md(i)))o.loading=5;else{e=Nt({rel:"stylesheet",href:e,"data-precedence":t},n),(n=zr.get(i))&&Ab(e,n);var l=s=r.createElement("link");sn(l),xn(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,Hf(s,t,r)}s={type:"stylesheet",instance:s,count:1,state:o},a.set(i,s)}}}function dz(e,t){di.X(e,t);var n=dc;if(n&&e){var r=ul(n).hoistableScripts,a=fc(e),i=r.get(a);i||(i=n.querySelector(gd(a)),i||(e=Nt({src:e,async:!0},t),(t=zr.get(a))&&Rb(e,t),i=n.createElement("script"),sn(i),xn(i,"link",e),n.head.appendChild(i)),i={type:"script",instance:i,count:1,state:null},r.set(a,i))}}function fz(e,t){di.M(e,t);var n=dc;if(n&&e){var r=ul(n).hoistableScripts,a=fc(e),i=r.get(a);i||(i=n.querySelector(gd(a)),i||(e=Nt({src:e,async:!0,type:"module"},t),(t=zr.get(a))&&Rb(e,t),i=n.createElement("script"),sn(i),xn(i,"link",e),n.head.appendChild(i)),i={type:"script",instance:i,count:1,state:null},r.set(a,i))}}function PS(e,t,n,r){var a=(a=Yi.current)?zh(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=Kl(n.href),n=ul(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=Kl(n.href);var i=ul(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(md(e)))&&!i._p&&(s.instance=i,s.state.loading=5),zr.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},zr.set(e,n),i||hz(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=fc(n),n=ul(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 Kl(e){return'href="'+$r(e)+'"'}function md(e){return'link[rel="stylesheet"]['+e+"]"}function Wj(e){return Nt({},e,{"data-precedence":e.precedence,precedence:null})}function hz(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}),xn(t,"link",n),sn(t),e.head.appendChild(t))}function fc(e){return'[src="'+$r(e)+'"]'}function gd(e){return"script[async]"+e}function DS(e,t,n){if(t.count++,t.instance===null)switch(t.type){case"style":var r=e.querySelector('style[data-href~="'+$r(n.href)+'"]');if(r)return t.instance=r,sn(r),r;var a=Nt({},n,{"data-href":n.href,"data-precedence":n.precedence,href:null,precedence:null});return r=(e.ownerDocument||e).createElement("style"),sn(r),xn(r,"style",a),Hf(r,n.precedence,e),t.instance=r;case"stylesheet":a=Kl(n.href);var i=e.querySelector(md(a));if(i)return t.state.loading|=4,t.instance=i,sn(i),i;r=Wj(n),(a=zr.get(a))&&Ab(r,a),i=(e.ownerDocument||e).createElement("link"),sn(i);var s=i;return s._p=new Promise(function(o,l){s.onload=o,s.onerror=l}),xn(i,"link",r),t.state.loading|=4,Hf(i,n.precedence,e),t.instance=i;case"script":return i=fc(n.src),(a=e.querySelector(gd(i)))?(t.instance=a,sn(a),a):(r=n,(a=zr.get(i))&&(r=Nt({},n),Rb(r,a)),e=e.ownerDocument||e,a=e.createElement("script"),sn(a),xn(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,Hf(r,n.precedence,e));return t.instance}function Hf(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 Ab(e,t){e.crossOrigin==null&&(e.crossOrigin=t.crossOrigin),e.referrerPolicy==null&&(e.referrerPolicy=t.referrerPolicy),e.title==null&&(e.title=t.title)}function Rb(e,t){e.crossOrigin==null&&(e.crossOrigin=t.crossOrigin),e.referrerPolicy==null&&(e.referrerPolicy=t.referrerPolicy),e.integrity==null&&(e.integrity=t.integrity)}var Bf=null;function zS(e,t,n){if(Bf===null){var r=new Map,a=Bf=new Map;a.set(n,r)}else a=Bf,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[cd]||i[gn]||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 IS(e,t,n){e=e.ownerDocument||e,e.head.insertBefore(n,t==="title"?e.querySelector("head > title"):null)}function pz(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 Jj(e){return!(e.type==="stylesheet"&&!(e.state.loading&3))}function mz(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=Kl(r.href),i=t.querySelector(md(a));if(i){t=i._p,t!==null&&typeof t=="object"&&typeof t.then=="function"&&(e.count++,e=Ih.bind(e),t.then(e,e)),n.state.loading|=4,n.instance=i,sn(i);return}i=t.ownerDocument||t,r=Wj(r),(a=zr.get(a))&&Ab(r,a),i=i.createElement("link"),sn(i);var s=i;s._p=new Promise(function(o,l){s.onload=o,s.onerror=l}),xn(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=Ih.bind(e),t.addEventListener("load",n),t.addEventListener("error",n))}}var yg=0;function gz(e,t){return e.stylesheets&&e.count===0&&Vf(e,e.stylesheets),0<e.count||0<e.imgCount?function(n){var r=setTimeout(function(){if(e.stylesheets&&Vf(e,e.stylesheets),e.unsuspend){var i=e.unsuspend;e.unsuspend=null,i()}},6e4+t);0<e.imgBytes&&yg===0&&(yg=62500*Y4());var a=setTimeout(function(){if(e.waitingForImages=!1,e.count===0&&(e.stylesheets&&Vf(e,e.stylesheets),e.unsuspend)){var i=e.unsuspend;e.unsuspend=null,i()}},(e.imgBytes>yg?50:800)+t);return e.unsuspend=n,function(){e.unsuspend=null,clearTimeout(r),clearTimeout(a)}}:null}function Ih(){if(this.count--,this.count===0&&(this.imgCount===0||!this.waitingForImages)){if(this.stylesheets)Vf(this,this.stylesheets);else if(this.unsuspend){var e=this.unsuspend;this.unsuspend=null,e()}}}var Lh=null;function Vf(e,t){e.stylesheets=null,e.unsuspend!==null&&(e.count++,Lh=new Map,t.forEach(yz,e),Lh=null,Ih.call(e))}function yz(e,t){if(!(t.state.loading&4)){var n=Lh.get(e);if(n)var r=n.get(null);else{n=new Map,Lh.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=Ih.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 Fu={$$typeof:Qa,Provider:null,Consumer:null,_currentValue:Xs,_currentValue2:Xs,_threadCount:0};function vz(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=Um(-1),this.entangledLanes=this.shellSuspendCounter=this.errorRecoveryDisabledLanes=this.expiredLanes=this.warmLanes=this.pingedLanes=this.suspendedLanes=this.pendingLanes=0,this.entanglements=Um(0),this.hiddenUpdates=Um(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 e2(e,t,n,r,a,i,s,o,l,u,d,f){return e=new vz(e,t,n,s,l,u,d,f,o),t=1,i===!0&&(t|=24),i=cr(3,null,null,t),e.current=i,i.stateNode=e,t=rb(),t.refCount++,e.pooledCache=t,t.refCount++,i.memoizedState={element:r,isDehydrated:n,cache:t},sb(i),e}function t2(e){return e?(e=nl,e):nl}function n2(e,t,n,r,a,i){a=t2(a),r.context===null?r.context=a:r.pendingContext=a,r=Wi(t),r.payload={element:n},i=i===void 0?null:i,i!==null&&(r.callback=i),n=Ji(e,r,t),n!==null&&(Wn(n,e,t),ou(n,e,t))}function LS(e,t){if(e=e.memoizedState,e!==null&&e.dehydrated!==null){var n=e.retryLane;e.retryLane=n!==0&&n<t?n:t}}function $b(e,t){LS(e,t),(e=e.alternate)&&LS(e,t)}function r2(e){if(e.tag===13||e.tag===31){var t=Eo(e,67108864);t!==null&&Wn(t,e,67108864),$b(e,67108864)}}function US(e){if(e.tag===13||e.tag===31){var t=pr();t=H0(t);var n=Eo(e,t);n!==null&&Wn(n,e,t),$b(e,t)}}var Uh=!0;function bz(e,t,n,r){var a=Re.T;Re.T=null;var i=Je.p;try{Je.p=2,Ob(e,t,n,r)}finally{Je.p=i,Re.T=a}}function xz(e,t,n,r){var a=Re.T;Re.T=null;var i=Je.p;try{Je.p=8,Ob(e,t,n,r)}finally{Je.p=i,Re.T=a}}function Ob(e,t,n,r){if(Uh){var a=sv(r);if(a===null)mg(e,t,r,Fh,n),FS(e,r);else if(Sz(a,e,t,n,r))r.stopPropagation();else if(FS(e,r),t&4&&-1<wz.indexOf(e)){for(;a!==null;){var i=oc(a);if(i!==null)switch(i.tag){case 3:if(i=i.stateNode,i.current.memoizedState.isDehydrated){var s=Rs(i.pendingLanes);if(s!==0){var o=i;for(o.pendingLanes|=2,o.entangledLanes|=2;s;){var l=1<<31-hr(s);o.entanglements[1]|=l,s&=~l}ka(i),!(We&6)&&(Ah=dr()+500,pd(0))}}break;case 31:case 13:o=Eo(i,2),o!==null&&Wn(o,i,2),qp(),$b(i,2)}if(i=sv(r),i===null&&mg(e,t,r,Fh,n),i===a)break;a=i}a!==null&&r.stopPropagation()}else mg(e,t,r,null,n)}}function sv(e){return e=Z0(e),Mb(e)}var Fh=null;function Mb(e){if(Fh=null,e=Yo(e),e!==null){var t=id(e);if(t===null)e=null;else{var n=t.tag;if(n===13){if(e=_C(t),e!==null)return e;e=null}else if(n===31){if(e=kC(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 Fh=e,null}function a2(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(sD()){case jC:return 2;case TC:return 8;case gh:case oD:return 32;case AC:return 268435456;default:return 32}default:return 32}}var ov=!1,ns=null,rs=null,as=null,qu=new Map,Hu=new Map,Oi=[],wz="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 FS(e,t){switch(e){case"focusin":case"focusout":ns=null;break;case"dragenter":case"dragleave":rs=null;break;case"mouseover":case"mouseout":as=null;break;case"pointerover":case"pointerout":qu.delete(t.pointerId);break;case"gotpointercapture":case"lostpointercapture":Hu.delete(t.pointerId)}}function Oc(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=oc(t),t!==null&&r2(t)),e):(e.eventSystemFlags|=r,t=e.targetContainers,a!==null&&t.indexOf(a)===-1&&t.push(a),e)}function Sz(e,t,n,r,a){switch(t){case"focusin":return ns=Oc(ns,e,t,n,r,a),!0;case"dragenter":return rs=Oc(rs,e,t,n,r,a),!0;case"mouseover":return as=Oc(as,e,t,n,r,a),!0;case"pointerover":var i=a.pointerId;return qu.set(i,Oc(qu.get(i)||null,e,t,n,r,a)),!0;case"gotpointercapture":return i=a.pointerId,Hu.set(i,Oc(Hu.get(i)||null,e,t,n,r,a)),!0}return!1}function i2(e){var t=Yo(e.target);if(t!==null){var n=id(t);if(n!==null){if(t=n.tag,t===13){if(t=_C(n),t!==null){e.blockedOn=t,E1(e.priority,function(){US(n)});return}}else if(t===31){if(t=kC(n),t!==null){e.blockedOn=t,E1(e.priority,function(){US(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 Kf(e){if(e.blockedOn!==null)return!1;for(var t=e.targetContainers;0<t.length;){var n=sv(e.nativeEvent);if(n===null){n=e.nativeEvent;var r=new n.constructor(n.type,n);Ey=r,n.target.dispatchEvent(r),Ey=null}else return t=oc(n),t!==null&&r2(t),e.blockedOn=n,!1;t.shift()}return!0}function qS(e,t,n){Kf(e)&&n.delete(t)}function _z(){ov=!1,ns!==null&&Kf(ns)&&(ns=null),rs!==null&&Kf(rs)&&(rs=null),as!==null&&Kf(as)&&(as=null),qu.forEach(qS),Hu.forEach(qS)}function ef(e,t){e.blockedOn===t&&(e.blockedOn=null,ov||(ov=!0,en.unstable_scheduleCallback(en.unstable_NormalPriority,_z)))}var tf=null;function HS(e){tf!==e&&(tf=e,en.unstable_scheduleCallback(en.unstable_NormalPriority,function(){tf===e&&(tf=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(Mb(r||n)===null)continue;break}var i=oc(n);i!==null&&(e.splice(t,3),t-=3,Fy(i,{pending:!0,data:a,method:n.method,action:r},r,a))}}))}function Zl(e){function t(l){return ef(l,e)}ns!==null&&ef(ns,e),rs!==null&&ef(rs,e),as!==null&&ef(as,e),qu.forEach(t),Hu.forEach(t);for(var n=0;n<Oi.length;n++){var r=Oi[n];r.blockedOn===e&&(r.blockedOn=null)}for(;0<Oi.length&&(n=Oi[0],n.blockedOn===null);)i2(n),n.blockedOn===null&&Oi.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[Jn]||null;if(typeof i=="function")s||HS(n);else if(s){var o=null;if(i&&i.hasAttribute("formAction")){if(a=i,s=i[Jn]||null)o=s.formAction;else if(Mb(a)!==null)continue}else o=s.action;typeof o=="function"?n[r+1]=o:(n.splice(r,3),r-=3),HS(n)}}}function s2(){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 Pb(e){this._internalRoot=e}Vp.prototype.render=Pb.prototype.render=function(e){var t=this._internalRoot;if(t===null)throw Error(te(409));var n=t.current,r=pr();n2(n,r,e,t,null,null)};Vp.prototype.unmount=Pb.prototype.unmount=function(){var e=this._internalRoot;if(e!==null){this._internalRoot=null;var t=e.containerInfo;n2(e.current,2,null,e,null,null),qp(),t[sc]=null}};function Vp(e){this._internalRoot=e}Vp.prototype.unstable_scheduleHydration=function(e){if(e){var t=PC();e={blockedOn:null,target:e,priority:t};for(var n=0;n<Oi.length&&t!==0&&t<Oi[n].priority;n++);Oi.splice(n,0,e),n===0&&i2(e)}};var BS=wC.version;if(BS!=="19.2.8")throw Error(te(527,BS,"19.2.8"));Je.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=JP(t),e=e!==null?EC(e):null,e=e===null?null:e.stateNode,e};var kz={bundleType:0,version:"19.2.8",rendererPackageName:"react-dom",currentDispatcherRef:Re,reconcilerVersion:"19.2.8"};if(typeof __REACT_DEVTOOLS_GLOBAL_HOOK__<"u"){var nf=__REACT_DEVTOOLS_GLOBAL_HOOK__;if(!nf.isDisabled&&nf.supportsFiber)try{sd=nf.inject(kz),fr=nf}catch{}}jp.createRoot=function(e,t){if(!SC(e))throw Error(te(299));var n=!1,r="",a=XN,i=WN,s=JN;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=e2(e,1,!1,null,null,n,r,null,a,i,s,s2),e[sc]=t.current,Tb(e),new Pb(t)};jp.hydrateRoot=function(e,t,n){if(!SC(e))throw Error(te(299));var r=!1,a="",i=XN,s=WN,o=JN,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=e2(e,1,!0,t,n??null,r,a,l,i,s,o,s2),t.context=t2(null),n=t.current,r=pr(),r=H0(r),a=Wi(r),a.callback=null,Ji(n,a,r),n=r,t.current.lanes=n,ld(t,n),ka(t),e[sc]=t.current,Tb(e),new Vp(t)};jp.version="19.2.8";function o2(){if(!(typeof __REACT_DEVTOOLS_GLOBAL_HOOK__>"u"||typeof __REACT_DEVTOOLS_GLOBAL_HOOK__.checkDCE!="function"))try{__REACT_DEVTOOLS_GLOBAL_HOOK__.checkDCE(o2)}catch(e){console.error(e)}}o2(),lC.exports=jp;var Ez=lC.exports;function Cz(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 l2={exports:{}},c2={};/**
|
|
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 Gl=w;function Nz(e,t){return e===t&&(e!==0||1/e===1/t)||e!==e&&t!==t}var jz=typeof Object.is=="function"?Object.is:Nz,Tz=Gl.useState,Az=Gl.useEffect,Rz=Gl.useLayoutEffect,$z=Gl.useDebugValue;function Oz(e,t){var n=t(),r=Tz({inst:{value:n,getSnapshot:t}}),a=r[0].inst,i=r[1];return Rz(function(){a.value=n,a.getSnapshot=t,vg(a)&&i({inst:a})},[e,n,t]),Az(function(){return vg(a)&&i({inst:a}),e(function(){vg(a)&&i({inst:a})})},[e]),$z(n),n}function vg(e){var t=e.getSnapshot;e=e.value;try{var n=t();return!jz(e,n)}catch{return!0}}function Mz(e,t){return t()}var Pz=typeof window>"u"||typeof window.document>"u"||typeof window.document.createElement>"u"?Mz:Oz;c2.useSyncExternalStore=Gl.useSyncExternalStore!==void 0?Gl.useSyncExternalStore:Pz;l2.exports=c2;var Dz=l2.exports;const zz=ad.useInsertionEffect,Iz=typeof window<"u"&&typeof window.document<"u"&&typeof window.document.createElement<"u",Lz=Iz?w.useLayoutEffect:w.useEffect,Uz=zz||Lz,u2=e=>{const t=w.useRef([e,(...n)=>t[0](...n)]).current;return Uz(()=>{t[0]=e}),t[1]},Fz="popstate",Db="pushState",zb="replaceState",qz="hashchange",VS=[Fz,Db,zb,qz],Hz=e=>{for(const t of VS)addEventListener(t,e);return()=>{for(const t of VS)removeEventListener(t,e)}},d2=(e,t)=>Dz.useSyncExternalStore(Hz,e,t),Bz=()=>location.search,Vz=({ssrSearch:e=""}={})=>d2(Bz,()=>e),KS=()=>location.pathname,Kz=({ssrPath:e}={})=>d2(KS,e?()=>e:KS),Zz=(e,{replace:t=!1,state:n=null}={})=>history[t?zb:Db](n,"",e),Gz=(e={})=>[Kz(e),Zz],ZS=Symbol.for("wouter_v3");if(typeof history<"u"&&typeof window[ZS]>"u"){for(const e of[Db,zb]){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,ZS,{value:!0})}const Qz=(e,t)=>t.toLowerCase().indexOf(e.toLowerCase())?"~"+t:t.slice(e.length)||"/",f2=(e="")=>e==="/"?"":e,Yz=(e,t)=>e[0]==="~"?e.slice(1):f2(t)+e,Xz=(e="",t)=>Qz(GS(f2(e)),GS(t)),GS=e=>{try{return decodeURI(e)}catch{return e}},h2={hook:Gz,searchHook:Vz,parser:Cz,base:"",ssrPath:void 0,ssrSearch:void 0,ssrContext:void 0,hrefs:e=>e},p2=w.createContext(h2),yd=()=>w.useContext(p2),m2={},g2=w.createContext(m2),Wz=()=>w.useContext(g2),Kp=e=>{const[t,n]=e.hook(e);return[Xz(e.base,t),u2((r,a)=>n(Yz(r,e.base),a))]},Jz=()=>Kp(yd()),y2=(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,p)=>[f,l[p]])):s.groups;let d={...l};return u&&Object.assign(d,u),d})(),...r?[o]:[]]:[!1,null]},e3=({children:e,...t})=>{var d,f;const n=yd(),r=t.hook?h2: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=w.useRef({}),l=o.current,u=l;for(let p in r){const h=p==="base"?r[p]+(t[p]||""):t[p]||r[p];l===u&&h!==u[p]&&(o.current=u={...u}),u[p]=h,(h!==r[p]||h!==a[p])&&(a=u)}return w.createElement(p2.Provider,{value:a,children:e})},QS=({children:e,component:t},n)=>t?w.createElement(t,{params:n}):typeof e=="function"?e(n):e,t3=e=>{let t=w.useRef(m2);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},Es=({path:e,nest:t,match:n,...r})=>{const a=yd(),[i]=Kp(a),[s,o,l]=n??y2(a.parser,e,i,t),u=t3({...Wz(),...o});if(!s)return null;const d=l?w.createElement(e3,{base:l},QS(r,u)):QS(r,u);return w.createElement(g2.Provider,{value:u,children:d})},Ql=w.forwardRef((e,t)=>{const n=yd(),[r,a]=Kp(n),{to:i="",href:s=i,onClick:o,asChild:l,children:u,className:d,replace:f,state:p,...h}=e,y=u2(b=>{b.ctrlKey||b.metaKey||b.altKey||b.shiftKey||b.button!==0||(o==null||o(b),b.defaultPrevented||(b.preventDefault(),a(s,e)))}),m=n.hrefs(s[0]==="~"?s.slice(1):n.base+s,n);return l&&w.isValidElement(u)?w.cloneElement(u,{onClick:y,href:m}):w.createElement("a",{...h,onClick:y,href:m,className:d!=null&&d.call?d(r===s):d,children:u,ref:t})}),v2=e=>Array.isArray(e)?e.flatMap(t=>v2(t&&t.type===w.Fragment?t.props.children:t)):[e],n3=({children:e,location:t})=>{const n=yd(),[r]=Kp(n);for(const a of v2(e)){let i=0;if(w.isValidElement(a)&&(i=y2(n.parser,a.props.path,t||r,a.props.nest))[0])return w.cloneElement(a,{match:i})}return null};var hc=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(){}},lo=typeof window>"u"||"Deno"in globalThis;function Pn(){}function r3(e,t){return typeof e=="function"?e(t):e}function lv(e){return typeof e=="number"&&e>=0&&e!==1/0}function b2(e,t){return Math.max(e+(t||0)-Date.now(),0)}function is(e,t){return typeof e=="function"?e(t):e}function Cr(e,t){return typeof e=="function"?e(t):e}function YS(e,t){const{type:n="all",exact:r,fetchStatus:a,predicate:i,queryKey:s,stale:o}=e;if(s){if(r){if(t.queryHash!==Ib(s,t.options))return!1}else if(!Bu(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 XS(e,t){const{exact:n,status:r,predicate:a,mutationKey:i}=e;if(i){if(!t.options.mutationKey)return!1;if(n){if(co(t.options.mutationKey)!==co(i))return!1}else if(!Bu(t.options.mutationKey,i))return!1}return!(r&&t.state.status!==r||a&&!a(t))}function Ib(e,t){return((t==null?void 0:t.queryKeyHashFn)||co)(e)}function co(e){return JSON.stringify(e,(t,n)=>cv(n)?Object.keys(n).sort().reduce((r,a)=>(r[a]=n[a],r),{}):n)}function Bu(e,t){return e===t?!0:typeof e!=typeof t?!1:e&&t&&typeof e=="object"&&typeof t=="object"?Object.keys(t).every(n=>Bu(e[n],t[n])):!1}function x2(e,t){if(e===t)return e;const n=WS(e)&&WS(t);if(n||cv(e)&&cv(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]=x2(e[f],t[f]),o[f]===e[f]&&e[f]!==void 0&&u++)}return a===s&&u===a?e:o}return t}function qh(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 WS(e){return Array.isArray(e)&&e.length===Object.keys(e).length}function cv(e){if(!JS(e))return!1;const t=e.constructor;if(t===void 0)return!0;const n=t.prototype;return!(!JS(n)||!n.hasOwnProperty("isPrototypeOf")||Object.getPrototypeOf(e)!==Object.prototype)}function JS(e){return Object.prototype.toString.call(e)==="[object Object]"}function a3(e){return new Promise(t=>{setTimeout(t,e)})}function uv(e,t,n){return typeof n.structuralSharing=="function"?n.structuralSharing(e,t):n.structuralSharing!==!1?x2(e,t):t}function i3(e,t,n=0){const r=[...e,t];return n&&r.length>n?r.slice(1):r}function s3(e,t,n=0){const r=[t,...e];return n&&r.length>n?r.slice(0,-1):r}var Lb=Symbol();function w2(e,t){return!e.queryFn&&(t!=null&&t.initialPromise)?()=>t.initialPromise:!e.queryFn||e.queryFn===Lb?()=>Promise.reject(new Error(`Missing queryFn: '${e.queryHash}'`)):e.queryFn}function S2(e,t){return typeof e=="function"?e(...t):!!e}var Hs,Pi,kl,YE,o3=(YE=class extends hc{constructor(){super();_e(this,Hs);_e(this,Pi);_e(this,kl);me(this,kl,t=>{if(!lo&&window.addEventListener){const n=()=>t();return window.addEventListener("visibilitychange",n,!1),()=>{window.removeEventListener("visibilitychange",n)}}})}onSubscribe(){U(this,Pi)||this.setEventListener(U(this,kl))}onUnsubscribe(){var t;this.hasListeners()||((t=U(this,Pi))==null||t.call(this),me(this,Pi,void 0))}setEventListener(t){var n;me(this,kl,t),(n=U(this,Pi))==null||n.call(this),me(this,Pi,t(r=>{typeof r=="boolean"?this.setFocused(r):this.onFocus()}))}setFocused(t){U(this,Hs)!==t&&(me(this,Hs,t),this.onFocus())}onFocus(){const t=this.isFocused();this.listeners.forEach(n=>{n(t)})}isFocused(){var t;return typeof U(this,Hs)=="boolean"?U(this,Hs):((t=globalThis.document)==null?void 0:t.visibilityState)!=="hidden"}},Hs=new WeakMap,Pi=new WeakMap,kl=new WeakMap,YE),Ub=new o3,El,Di,Cl,XE,l3=(XE=class extends hc{constructor(){super();_e(this,El,!0);_e(this,Di);_e(this,Cl);me(this,Cl,t=>{if(!lo&&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,Di)||this.setEventListener(U(this,Cl))}onUnsubscribe(){var t;this.hasListeners()||((t=U(this,Di))==null||t.call(this),me(this,Di,void 0))}setEventListener(t){var n;me(this,Cl,t),(n=U(this,Di))==null||n.call(this),me(this,Di,t(this.setOnline.bind(this)))}setOnline(t){U(this,El)!==t&&(me(this,El,t),this.listeners.forEach(r=>{r(t)}))}isOnline(){return U(this,El)}},El=new WeakMap,Di=new WeakMap,Cl=new WeakMap,XE),Hh=new l3;function dv(){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 c3(e){return Math.min(1e3*2**e,3e4)}function _2(e){return(e??"online")==="online"?Hh.isOnline():!0}var k2=class extends Error{constructor(e){super("CancelledError"),this.revert=e==null?void 0:e.revert,this.silent=e==null?void 0:e.silent}};function E2(e){let t=!1,n=0,r;const a=dv(),i=()=>a.status!=="pending",s=m=>{var b;i()||(p(new k2(m)),(b=e.abort)==null||b.call(e))},o=()=>{t=!0},l=()=>{t=!1},u=()=>Ub.isFocused()&&(e.networkMode==="always"||Hh.isOnline())&&e.canRun(),d=()=>_2(e.networkMode)&&e.canRun(),f=m=>{i()||(r==null||r(),a.resolve(m))},p=m=>{i()||(r==null||r(),a.reject(m))},h=()=>new Promise(m=>{var b;r=g=>{(i()||u())&&m(g)},(b=e.onPause)==null||b.call(e)}).then(()=>{var m;r=void 0,i()||(m=e.onContinue)==null||m.call(e)}),y=()=>{if(i())return;let m;const b=n===0?e.initialPromise:void 0;try{m=b??e.fn()}catch(g){m=Promise.reject(g)}Promise.resolve(m).then(f).catch(g=>{var C;if(i())return;const v=e.retry??(lo?0:3),x=e.retryDelay??c3,S=typeof x=="function"?x(n,g):x,k=v===!0||typeof v=="number"&&n<v||typeof v=="function"&&v(n,g);if(t||!k){p(g);return}n++,(C=e.onFail)==null||C.call(e,n,g),a3(S).then(()=>u()?void 0:h()).then(()=>{t?p(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 u3=e=>setTimeout(e,0);function d3(){let e=[],t=0,n=o=>{o()},r=o=>{o()},a=u3;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 Xt=d3(),Bs,WE,C2=(WE=class{constructor(){_e(this,Bs)}destroy(){this.clearGcTimeout()}scheduleGc(){this.clearGcTimeout(),lv(this.gcTime)&&me(this,Bs,setTimeout(()=>{this.optionalRemove()},this.gcTime))}updateGcTime(e){this.gcTime=Math.max(this.gcTime||0,e??(lo?1/0:5*60*1e3))}clearGcTimeout(){U(this,Bs)&&(clearTimeout(U(this,Bs)),me(this,Bs,void 0))}},Bs=new WeakMap,WE),Nl,jl,_r,Vs,rn,ed,Ks,Gr,La,JE,f3=(JE=class extends C2{constructor(t){super();_e(this,Gr);_e(this,Nl);_e(this,jl);_e(this,_r);_e(this,Vs);_e(this,rn);_e(this,ed);_e(this,Ks);me(this,Ks,!1),me(this,ed,t.defaultOptions),this.setOptions(t.options),this.observers=[],me(this,Vs,t.client),me(this,_r,U(this,Vs).getQueryCache()),this.queryKey=t.queryKey,this.queryHash=t.queryHash,me(this,Nl,h3(this.options)),this.state=t.state??U(this,Nl),this.scheduleGc()}get meta(){return this.options.meta}get promise(){var t;return(t=U(this,rn))==null?void 0:t.promise}setOptions(t){this.options={...U(this,ed),...t},this.updateGcTime(this.options.gcTime)}optionalRemove(){!this.observers.length&&this.state.fetchStatus==="idle"&&U(this,_r).remove(this)}setData(t,n){const r=uv(this.state.data,t,this.options);return Le(this,Gr,La).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,Gr,La).call(this,{type:"setState",state:t,setStateOptions:n})}cancel(t){var r,a;const n=(r=U(this,rn))==null?void 0:r.promise;return(a=U(this,rn))==null||a.cancel(t),n?n.then(Pn).catch(Pn):Promise.resolve()}destroy(){super.destroy(),this.cancel({silent:!0})}reset(){this.destroy(),this.setState(U(this,Nl))}isActive(){return this.observers.some(t=>Cr(t.options.enabled,this)!==!1)}isDisabled(){return this.getObserversCount()>0?!this.isActive():this.options.queryFn===Lb||this.state.dataUpdateCount+this.state.errorUpdateCount===0}isStatic(){return this.getObserversCount()>0?this.observers.some(t=>is(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:!b2(this.state.dataUpdatedAt,t)}onFocus(){var n;const t=this.observers.find(r=>r.shouldFetchOnWindowFocus());t==null||t.refetch({cancelRefetch:!1}),(n=U(this,rn))==null||n.continue()}onOnline(){var n;const t=this.observers.find(r=>r.shouldFetchOnReconnect());t==null||t.refetch({cancelRefetch:!1}),(n=U(this,rn))==null||n.continue()}addObserver(t){this.observers.includes(t)||(this.observers.push(t),this.clearGcTimeout(),U(this,_r).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,rn)&&(U(this,Ks)?U(this,rn).cancel({revert:!0}):U(this,rn).cancelRetry()),this.scheduleGc()),U(this,_r).notify({type:"observerRemoved",query:this,observer:t}))}getObserversCount(){return this.observers.length}invalidate(){this.state.isInvalidated||Le(this,Gr,La).call(this,{type:"invalidate"})}async fetch(t,n){var l,u,d,f,p,h,y,m,b,g,v,x;if(this.state.fetchStatus!=="idle"&&((l=U(this,rn))==null?void 0:l.status())!=="rejected"){if(this.state.data!==void 0&&(n!=null&&n.cancelRefetch))this.cancel({silent:!0});else if(U(this,rn))return U(this,rn).continueRetry(),U(this,rn).promise}if(t&&this.setOptions(t),!this.options.queryFn){const S=this.observers.find(k=>k.options.queryFn);S&&this.setOptions(S.options)}const r=new AbortController,a=S=>{Object.defineProperty(S,"signal",{enumerable:!0,get:()=>(me(this,Ks,!0),r.signal)})},i=()=>{const S=w2(this.options,n),C=(()=>{const N={client:U(this,Vs),queryKey:this.queryKey,meta:this.meta};return a(N),N})();return me(this,Ks,!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,Vs),state:this.state,fetchFn:i};return a(S),S})();(u=this.options.behavior)==null||u.onFetch(o,this),me(this,jl,this.state),(this.state.fetchStatus==="idle"||this.state.fetchMeta!==((d=o.fetchOptions)==null?void 0:d.meta))&&Le(this,Gr,La).call(this,{type:"fetch",meta:(f=o.fetchOptions)==null?void 0:f.meta}),me(this,rn,E2({initialPromise:n==null?void 0:n.initialPromise,fn:o.fetchFn,abort:r.abort.bind(r),onFail:(S,k)=>{Le(this,Gr,La).call(this,{type:"failed",failureCount:S,error:k})},onPause:()=>{Le(this,Gr,La).call(this,{type:"pause"})},onContinue:()=>{Le(this,Gr,La).call(this,{type:"continue"})},retry:o.options.retry,retryDelay:o.options.retryDelay,networkMode:o.options.networkMode,canRun:()=>!0}));try{const S=await U(this,rn).start();if(S===void 0)throw new Error(`${this.queryHash} data is undefined`);return this.setData(S),(h=(p=U(this,_r).config).onSuccess)==null||h.call(p,S,this),(m=(y=U(this,_r).config).onSettled)==null||m.call(y,S,this.state.error,this),S}catch(S){if(S instanceof k2){if(S.silent)return U(this,rn).promise;if(S.revert){if(this.setState({...U(this,jl),fetchStatus:"idle"}),this.state.data===void 0)throw S;return this.state.data}}throw Le(this,Gr,La).call(this,{type:"error",error:S}),(g=(b=U(this,_r).config).onError)==null||g.call(b,S,this),(x=(v=U(this,_r).config).onSettled)==null||x.call(v,this.state.data,S,this),S}finally{this.scheduleGc()}}},Nl=new WeakMap,jl=new WeakMap,_r=new WeakMap,Vs=new WeakMap,rn=new WeakMap,ed=new WeakMap,Ks=new WeakMap,Gr=new WeakSet,La=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,...N2(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 me(this,jl,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),Xt.batch(()=>{this.observers.forEach(r=>{r.onQueryUpdate()}),U(this,_r).notify({query:this,type:"updated",action:t})})},JE);function N2(e,t){return{fetchFailureCount:0,fetchFailureReason:null,fetchStatus:_2(t.networkMode)?"fetching":"paused",...e===void 0&&{error:null,status:"pending"}}}function h3(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,eC,p3=(eC=class extends hc{constructor(t={}){super();_e(this,ua);this.config=t,me(this,ua,new Map)}build(t,n,r){const a=n.queryKey,i=n.queryHash??Ib(a,n);let s=this.get(i);return s||(s=new f3({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(){Xt.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=>YS(n,r))}findAll(t={}){const n=this.getAll();return Object.keys(t).length>0?n.filter(r=>YS(t,r)):n}notify(t){Xt.batch(()=>{this.listeners.forEach(n=>{n(t)})})}onFocus(){Xt.batch(()=>{this.getAll().forEach(t=>{t.onFocus()})})}onOnline(){Xt.batch(()=>{this.getAll().forEach(t=>{t.onOnline()})})}},ua=new WeakMap,eC),da,Rn,Zs,fa,_i,tC,m3=(tC=class extends C2{constructor(t){super();_e(this,fa);_e(this,da);_e(this,Rn);_e(this,Zs);this.mutationId=t.mutationId,me(this,Rn,t.mutationCache),me(this,da,[]),this.state=t.state||j2(),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,Rn).notify({type:"observerAdded",mutation:this,observer:t}))}removeObserver(t){me(this,da,U(this,da).filter(n=>n!==t)),this.scheduleGc(),U(this,Rn).notify({type:"observerRemoved",mutation:this,observer:t})}optionalRemove(){U(this,da).length||(this.state.status==="pending"?this.scheduleGc():U(this,Rn).remove(this))}continue(){var t;return((t=U(this,Zs))==null?void 0:t.continue())??this.execute(this.state.variables)}async execute(t){var i,s,o,l,u,d,f,p,h,y,m,b,g,v,x,S,k,C,N,P;const n=()=>{Le(this,fa,_i).call(this,{type:"continue"})};me(this,Zs,E2({fn:()=>this.options.mutationFn?this.options.mutationFn(t):Promise.reject(new Error("No mutationFn found")),onFail:(R,$)=>{Le(this,fa,_i).call(this,{type:"failed",failureCount:R,error:$})},onPause:()=>{Le(this,fa,_i).call(this,{type:"pause"})},onContinue:n,retry:this.options.retry??0,retryDelay:this.options.retryDelay,networkMode:this.options.networkMode,canRun:()=>U(this,Rn).canRun(this)}));const r=this.state.status==="pending",a=!U(this,Zs).canStart();try{if(r)n();else{Le(this,fa,_i).call(this,{type:"pending",variables:t,isPaused:a}),await((s=(i=U(this,Rn).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,_i).call(this,{type:"pending",context:$,variables:t,isPaused:a})}const R=await U(this,Zs).start();return await((d=(u=U(this,Rn).config).onSuccess)==null?void 0:d.call(u,R,t,this.state.context,this)),await((p=(f=this.options).onSuccess)==null?void 0:p.call(f,R,t,this.state.context)),await((y=(h=U(this,Rn).config).onSettled)==null?void 0:y.call(h,R,null,this.state.variables,this.state.context,this)),await((b=(m=this.options).onSettled)==null?void 0:b.call(m,R,null,t,this.state.context)),Le(this,fa,_i).call(this,{type:"success",data:R}),R}catch(R){try{throw await((v=(g=U(this,Rn).config).onError)==null?void 0:v.call(g,R,t,this.state.context,this)),await((S=(x=this.options).onError)==null?void 0:S.call(x,R,t,this.state.context)),await((C=(k=U(this,Rn).config).onSettled)==null?void 0:C.call(k,void 0,R,this.state.variables,this.state.context,this)),await((P=(N=this.options).onSettled)==null?void 0:P.call(N,void 0,R,t,this.state.context)),R}finally{Le(this,fa,_i).call(this,{type:"error",error:R})}}finally{U(this,Rn).runNext(this)}}},da=new WeakMap,Rn=new WeakMap,Zs=new WeakMap,fa=new WeakSet,_i=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),Xt.batch(()=>{U(this,da).forEach(r=>{r.onMutationUpdate(t)}),U(this,Rn).notify({mutation:this,type:"updated",action:t})})},tC);function j2(){return{context:void 0,data:void 0,error:null,failureCount:0,failureReason:null,isPaused:!1,status:"idle",variables:void 0,submittedAt:0}}var Ba,Qr,td,nC,g3=(nC=class extends hc{constructor(t={}){super();_e(this,Ba);_e(this,Qr);_e(this,td);this.config=t,me(this,Ba,new Set),me(this,Qr,new Map),me(this,td,0)}build(t,n,r){const a=new m3({mutationCache:this,mutationId:++Ud(this,td)._,options:t.defaultMutationOptions(n),state:r});return this.add(a),a}add(t){U(this,Ba).add(t);const n=rf(t);if(typeof n=="string"){const r=U(this,Qr).get(n);r?r.push(t):U(this,Qr).set(n,[t])}this.notify({type:"added",mutation:t})}remove(t){if(U(this,Ba).delete(t)){const n=rf(t);if(typeof n=="string"){const r=U(this,Qr).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,Qr).delete(n)}}this.notify({type:"removed",mutation:t})}canRun(t){const n=rf(t);if(typeof n=="string"){const r=U(this,Qr).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=rf(t);if(typeof n=="string"){const a=(r=U(this,Qr).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(){Xt.batch(()=>{U(this,Ba).forEach(t=>{this.notify({type:"removed",mutation:t})}),U(this,Ba).clear(),U(this,Qr).clear()})}getAll(){return Array.from(U(this,Ba))}find(t){const n={exact:!0,...t};return this.getAll().find(r=>XS(n,r))}findAll(t={}){return this.getAll().filter(n=>XS(t,n))}notify(t){Xt.batch(()=>{this.listeners.forEach(n=>{n(t)})})}resumePausedMutations(){const t=this.getAll().filter(n=>n.state.isPaused);return Xt.batch(()=>Promise.all(t.map(n=>n.continue().catch(Pn))))}},Ba=new WeakMap,Qr=new WeakMap,td=new WeakMap,nC);function rf(e){var t;return(t=e.options.scope)==null?void 0:t.id}function e_(e){return{onFetch:(t,n)=>{var d,f,p,h,y;const r=t.options,a=(p=(f=(d=t.fetchOptions)==null?void 0:d.meta)==null?void 0:f.fetchMore)==null?void 0:p.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 m=!1;const b=x=>{Object.defineProperty(x,"signal",{enumerable:!0,get:()=>(t.signal.aborted?m=!0:t.signal.addEventListener("abort",()=>{m=!0}),t.signal)})},g=w2(t.options,t.fetchOptions),v=async(x,S,k)=>{if(m)return Promise.reject();if(S==null&&x.pages.length)return Promise.resolve(x);const N=(()=>{const j={client:t.client,queryKey:t.queryKey,pageParam:S,direction:k?"backward":"forward",meta:t.options.meta};return b(j),j})(),P=await g(N),{maxPages:R}=t.options,$=k?s3:i3;return{pages:$(x.pages,P,R),pageParams:$(x.pageParams,S,R)}};if(a&&i.length){const x=a==="backward",S=x?y3:t_,k={pages:i,pageParams:s},C=S(r,k);o=await v(k,C,x)}else{const x=e??i.length;do{const S=l===0?s[0]??r.initialPageParam:t_(r,o);if(l>0&&S==null)break;o=await v(o,S),l++}while(l<x)}return o};t.options.persister?t.fetchFn=()=>{var m,b;return(b=(m=t.options).persister)==null?void 0:b.call(m,u,{client:t.client,queryKey:t.queryKey,meta:t.options.meta,signal:t.signal},n)}:t.fetchFn=u}}}function t_(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 y3(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 zt,zi,Ii,Tl,Al,Li,Rl,$l,rC,v3=(rC=class{constructor(e={}){_e(this,zt);_e(this,zi);_e(this,Ii);_e(this,Tl);_e(this,Al);_e(this,Li);_e(this,Rl);_e(this,$l);me(this,zt,e.queryCache||new p3),me(this,zi,e.mutationCache||new g3),me(this,Ii,e.defaultOptions||{}),me(this,Tl,new Map),me(this,Al,new Map),me(this,Li,0)}mount(){Ud(this,Li)._++,U(this,Li)===1&&(me(this,Rl,Ub.subscribe(async e=>{e&&(await this.resumePausedMutations(),U(this,zt).onFocus())})),me(this,$l,Hh.subscribe(async e=>{e&&(await this.resumePausedMutations(),U(this,zt).onOnline())})))}unmount(){var e,t;Ud(this,Li)._--,U(this,Li)===0&&((e=U(this,Rl))==null||e.call(this),me(this,Rl,void 0),(t=U(this,$l))==null||t.call(this),me(this,$l,void 0))}isFetching(e){return U(this,zt).findAll({...e,fetchStatus:"fetching"}).length}isMutating(e){return U(this,zi).findAll({...e,status:"pending"}).length}getQueryData(e){var n;const t=this.defaultQueryOptions({queryKey:e});return(n=U(this,zt).get(t.queryHash))==null?void 0:n.state.data}ensureQueryData(e){const t=this.defaultQueryOptions(e),n=U(this,zt).build(this,t),r=n.state.data;return r===void 0?this.fetchQuery(e):(e.revalidateIfStale&&n.isStaleByTime(is(t.staleTime,n))&&this.prefetchQuery(t),Promise.resolve(r))}getQueriesData(e){return U(this,zt).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,zt).get(r.queryHash),i=a==null?void 0:a.state.data,s=r3(t,i);if(s!==void 0)return U(this,zt).build(this,r).setData(s,{...n,manual:!0})}setQueriesData(e,t,n){return Xt.batch(()=>U(this,zt).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,zt).get(t.queryHash))==null?void 0:n.state}removeQueries(e){const t=U(this,zt);Xt.batch(()=>{t.findAll(e).forEach(n=>{t.remove(n)})})}resetQueries(e,t){const n=U(this,zt);return Xt.batch(()=>(n.findAll(e).forEach(r=>{r.reset()}),this.refetchQueries({type:"active",...e},t)))}cancelQueries(e,t={}){const n={revert:!0,...t},r=Xt.batch(()=>U(this,zt).findAll(e).map(a=>a.cancel(n)));return Promise.all(r).then(Pn).catch(Pn)}invalidateQueries(e,t={}){return Xt.batch(()=>(U(this,zt).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=Xt.batch(()=>U(this,zt).findAll(e).filter(a=>!a.isDisabled()&&!a.isStatic()).map(a=>{let i=a.fetch(void 0,n);return n.throwOnError||(i=i.catch(Pn)),a.state.fetchStatus==="paused"?Promise.resolve():i}));return Promise.all(r).then(Pn)}fetchQuery(e){const t=this.defaultQueryOptions(e);t.retry===void 0&&(t.retry=!1);const n=U(this,zt).build(this,t);return n.isStaleByTime(is(t.staleTime,n))?n.fetch(t):Promise.resolve(n.state.data)}prefetchQuery(e){return this.fetchQuery(e).then(Pn).catch(Pn)}fetchInfiniteQuery(e){return e.behavior=e_(e.pages),this.fetchQuery(e)}prefetchInfiniteQuery(e){return this.fetchInfiniteQuery(e).then(Pn).catch(Pn)}ensureInfiniteQueryData(e){return e.behavior=e_(e.pages),this.ensureQueryData(e)}resumePausedMutations(){return Hh.isOnline()?U(this,zi).resumePausedMutations():Promise.resolve()}getQueryCache(){return U(this,zt)}getMutationCache(){return U(this,zi)}getDefaultOptions(){return U(this,Ii)}setDefaultOptions(e){me(this,Ii,e)}setQueryDefaults(e,t){U(this,Tl).set(co(e),{queryKey:e,defaultOptions:t})}getQueryDefaults(e){const t=[...U(this,Tl).values()],n={};return t.forEach(r=>{Bu(e,r.queryKey)&&Object.assign(n,r.defaultOptions)}),n}setMutationDefaults(e,t){U(this,Al).set(co(e),{mutationKey:e,defaultOptions:t})}getMutationDefaults(e){const t=[...U(this,Al).values()],n={};return t.forEach(r=>{Bu(e,r.mutationKey)&&Object.assign(n,r.defaultOptions)}),n}defaultQueryOptions(e){if(e._defaulted)return e;const t={...U(this,Ii).queries,...this.getQueryDefaults(e.queryKey),...e,_defaulted:!0};return t.queryHash||(t.queryHash=Ib(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===Lb&&(t.enabled=!1),t}defaultMutationOptions(e){return e!=null&&e._defaulted?e:{...U(this,Ii).mutations,...(e==null?void 0:e.mutationKey)&&this.getMutationDefaults(e.mutationKey),...e,_defaulted:!0}}clear(){U(this,zt).clear(),U(this,zi).clear()}},zt=new WeakMap,zi=new WeakMap,Ii=new WeakMap,Tl=new WeakMap,Al=new WeakMap,Li=new WeakMap,Rl=new WeakMap,$l=new WeakMap,rC),Hn,Ze,nd,$n,Gs,Ol,Va,Ui,rd,Ml,Pl,Qs,Ys,Fi,Dl,tt,Qc,fv,hv,pv,mv,gv,yv,vv,T2,aC,b3=(aC=class extends hc{constructor(t,n){super();_e(this,tt);_e(this,Hn);_e(this,Ze);_e(this,nd);_e(this,$n);_e(this,Gs);_e(this,Ol);_e(this,Va);_e(this,Ui);_e(this,rd);_e(this,Ml);_e(this,Pl);_e(this,Qs);_e(this,Ys);_e(this,Fi);_e(this,Dl,new Set);this.options=n,me(this,Hn,t),me(this,Ui,null),me(this,Va,dv()),this.bindMethods(),this.setOptions(n)}bindMethods(){this.refetch=this.refetch.bind(this)}onSubscribe(){this.listeners.size===1&&(U(this,Ze).addObserver(this),n_(U(this,Ze),this.options)?Le(this,tt,Qc).call(this):this.updateResult(),Le(this,tt,mv).call(this))}onUnsubscribe(){this.hasListeners()||this.destroy()}shouldFetchOnReconnect(){return bv(U(this,Ze),this.options,this.options.refetchOnReconnect)}shouldFetchOnWindowFocus(){return bv(U(this,Ze),this.options,this.options.refetchOnWindowFocus)}destroy(){this.listeners=new Set,Le(this,tt,gv).call(this),Le(this,tt,yv).call(this),U(this,Ze).removeObserver(this)}setOptions(t){const n=this.options,r=U(this,Ze);if(this.options=U(this,Hn).defaultQueryOptions(t),this.options.enabled!==void 0&&typeof this.options.enabled!="boolean"&&typeof this.options.enabled!="function"&&typeof Cr(this.options.enabled,U(this,Ze))!="boolean")throw new Error("Expected enabled to be a boolean or a callback that returns a boolean");Le(this,tt,vv).call(this),U(this,Ze).setOptions(this.options),n._defaulted&&!qh(this.options,n)&&U(this,Hn).getQueryCache().notify({type:"observerOptionsUpdated",query:U(this,Ze),observer:this});const a=this.hasListeners();a&&r_(U(this,Ze),r,this.options,n)&&Le(this,tt,Qc).call(this),this.updateResult(),a&&(U(this,Ze)!==r||Cr(this.options.enabled,U(this,Ze))!==Cr(n.enabled,U(this,Ze))||is(this.options.staleTime,U(this,Ze))!==is(n.staleTime,U(this,Ze)))&&Le(this,tt,fv).call(this);const i=Le(this,tt,hv).call(this);a&&(U(this,Ze)!==r||Cr(this.options.enabled,U(this,Ze))!==Cr(n.enabled,U(this,Ze))||i!==U(this,Fi))&&Le(this,tt,pv).call(this,i)}getOptimisticResult(t){const n=U(this,Hn).getQueryCache().build(U(this,Hn),t),r=this.createResult(n,t);return w3(this,r)&&(me(this,$n,r),me(this,Ol,this.options),me(this,Gs,U(this,Ze).state)),r}getCurrentResult(){return U(this,$n)}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,Va).status==="pending"&&U(this,Va).reject(new Error("experimental_prefetchInRender feature flag is not enabled")),Reflect.get(r,a))})}trackProp(t){U(this,Dl).add(t)}getCurrentQuery(){return U(this,Ze)}refetch({...t}={}){return this.fetch({...t})}fetchOptimistic(t){const n=U(this,Hn).defaultQueryOptions(t),r=U(this,Hn).getQueryCache().build(U(this,Hn),n);return r.fetch().then(()=>this.createResult(r,n))}fetch(t){return Le(this,tt,Qc).call(this,{...t,cancelRefetch:t.cancelRefetch??!0}).then(()=>(this.updateResult(),U(this,$n)))}createResult(t,n){var R;const r=U(this,Ze),a=this.options,i=U(this,$n),s=U(this,Gs),o=U(this,Ol),u=t!==r?t.state:U(this,nd),{state:d}=t;let f={...d},p=!1,h;if(n._optimisticResults){const $=this.hasListeners(),j=!$&&n_(t,n),O=$&&r_(t,r,n,a);(j||O)&&(f={...f,...N2(d.data,t.options)}),n._optimisticResults==="isRestoring"&&(f.fetchStatus="idle")}let{error:y,errorUpdatedAt:m,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,Pl))==null?void 0:R.state.data,U(this,Pl)):n.placeholderData,$!==void 0&&(b="success",h=uv(i==null?void 0:i.data,$,n),p=!0)}if(n.select&&h!==void 0&&!g)if(i&&h===(s==null?void 0:s.data)&&n.select===U(this,rd))h=U(this,Ml);else try{me(this,rd,n.select),h=n.select(h),h=uv(i==null?void 0:i.data,h,n),me(this,Ml,h),me(this,Ui,null)}catch($){me(this,Ui,$)}U(this,Ui)&&(y=U(this,Ui),h=U(this,Ml),m=Date.now(),b="error");const v=f.fetchStatus==="fetching",x=b==="pending",S=b==="error",k=x&&v,C=h!==void 0,P={status:b,fetchStatus:f.fetchStatus,isPending:x,isSuccess:b==="success",isError:S,isInitialLoading:k,isLoading:k,data:h,dataUpdatedAt:f.dataUpdatedAt,error:y,errorUpdatedAt:m,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&&!x,isLoadingError:S&&!C,isPaused:f.fetchStatus==="paused",isPlaceholderData:p,isRefetchError:S&&C,isStale:Fb(t,n),refetch:this.refetch,promise:U(this,Va),isEnabled:Cr(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=me(this,Va,P.promise=dv());$(z)},O=U(this,Va);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,$n),n=this.createResult(U(this,Ze),this.options);if(me(this,Gs,U(this,Ze).state),me(this,Ol,this.options),U(this,Gs).data!==void 0&&me(this,Pl,U(this,Ze)),qh(n,t))return;me(this,$n,n);const r=()=>{if(!t)return!0;const{notifyOnChangeProps:a}=this.options,i=typeof a=="function"?a():a;if(i==="all"||!i&&!U(this,Dl).size)return!0;const s=new Set(i??U(this,Dl));return this.options.throwOnError&&s.add("error"),Object.keys(U(this,$n)).some(o=>{const l=o;return U(this,$n)[l]!==t[l]&&s.has(l)})};Le(this,tt,T2).call(this,{listeners:r()})}onQueryUpdate(){this.updateResult(),this.hasListeners()&&Le(this,tt,mv).call(this)}},Hn=new WeakMap,Ze=new WeakMap,nd=new WeakMap,$n=new WeakMap,Gs=new WeakMap,Ol=new WeakMap,Va=new WeakMap,Ui=new WeakMap,rd=new WeakMap,Ml=new WeakMap,Pl=new WeakMap,Qs=new WeakMap,Ys=new WeakMap,Fi=new WeakMap,Dl=new WeakMap,tt=new WeakSet,Qc=function(t){Le(this,tt,vv).call(this);let n=U(this,Ze).fetch(this.options,t);return t!=null&&t.throwOnError||(n=n.catch(Pn)),n},fv=function(){Le(this,tt,gv).call(this);const t=is(this.options.staleTime,U(this,Ze));if(lo||U(this,$n).isStale||!lv(t))return;const r=b2(U(this,$n).dataUpdatedAt,t)+1;me(this,Qs,setTimeout(()=>{U(this,$n).isStale||this.updateResult()},r))},hv=function(){return(typeof this.options.refetchInterval=="function"?this.options.refetchInterval(U(this,Ze)):this.options.refetchInterval)??!1},pv=function(t){Le(this,tt,yv).call(this),me(this,Fi,t),!(lo||Cr(this.options.enabled,U(this,Ze))===!1||!lv(U(this,Fi))||U(this,Fi)===0)&&me(this,Ys,setInterval(()=>{(this.options.refetchIntervalInBackground||Ub.isFocused())&&Le(this,tt,Qc).call(this)},U(this,Fi)))},mv=function(){Le(this,tt,fv).call(this),Le(this,tt,pv).call(this,Le(this,tt,hv).call(this))},gv=function(){U(this,Qs)&&(clearTimeout(U(this,Qs)),me(this,Qs,void 0))},yv=function(){U(this,Ys)&&(clearInterval(U(this,Ys)),me(this,Ys,void 0))},vv=function(){const t=U(this,Hn).getQueryCache().build(U(this,Hn),this.options);if(t===U(this,Ze))return;const n=U(this,Ze);me(this,Ze,t),me(this,nd,t.state),this.hasListeners()&&(n==null||n.removeObserver(this),t.addObserver(this))},T2=function(t){Xt.batch(()=>{t.listeners&&this.listeners.forEach(n=>{n(U(this,$n))}),U(this,Hn).getQueryCache().notify({query:U(this,Ze),type:"observerResultsUpdated"})})},aC);function x3(e,t){return Cr(t.enabled,e)!==!1&&e.state.data===void 0&&!(e.state.status==="error"&&t.retryOnMount===!1)}function n_(e,t){return x3(e,t)||e.state.data!==void 0&&bv(e,t,t.refetchOnMount)}function bv(e,t,n){if(Cr(t.enabled,e)!==!1&&is(t.staleTime,e)!=="static"){const r=typeof n=="function"?n(e):n;return r==="always"||r!==!1&&Fb(e,t)}return!1}function r_(e,t,n,r){return(e!==t||Cr(r.enabled,e)===!1)&&(!n.suspense||e.state.status!=="error")&&Fb(e,n)}function Fb(e,t){return Cr(t.enabled,e)!==!1&&e.isStaleByTime(is(t.staleTime,e))}function w3(e,t){return!qh(e.getCurrentResult(),t)}var qi,Hi,Bn,Ka,ri,Zf,xv,iC,S3=(iC=class extends hc{constructor(n,r){super();_e(this,ri);_e(this,qi);_e(this,Hi);_e(this,Bn);_e(this,Ka);me(this,qi,n),this.setOptions(r),this.bindMethods(),Le(this,ri,Zf).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,qi).defaultMutationOptions(n),qh(this.options,r)||U(this,qi).getMutationCache().notify({type:"observerOptionsUpdated",mutation:U(this,Bn),observer:this}),r!=null&&r.mutationKey&&this.options.mutationKey&&co(r.mutationKey)!==co(this.options.mutationKey)?this.reset():((a=U(this,Bn))==null?void 0:a.state.status)==="pending"&&U(this,Bn).setOptions(this.options)}onUnsubscribe(){var n;this.hasListeners()||(n=U(this,Bn))==null||n.removeObserver(this)}onMutationUpdate(n){Le(this,ri,Zf).call(this),Le(this,ri,xv).call(this,n)}getCurrentResult(){return U(this,Hi)}reset(){var n;(n=U(this,Bn))==null||n.removeObserver(this),me(this,Bn,void 0),Le(this,ri,Zf).call(this),Le(this,ri,xv).call(this)}mutate(n,r){var a;return me(this,Ka,r),(a=U(this,Bn))==null||a.removeObserver(this),me(this,Bn,U(this,qi).getMutationCache().build(U(this,qi),this.options)),U(this,Bn).addObserver(this),U(this,Bn).execute(n)}},qi=new WeakMap,Hi=new WeakMap,Bn=new WeakMap,Ka=new WeakMap,ri=new WeakSet,Zf=function(){var r;const n=((r=U(this,Bn))==null?void 0:r.state)??j2();me(this,Hi,{...n,isPending:n.status==="pending",isSuccess:n.status==="success",isError:n.status==="error",isIdle:n.status==="idle",mutate:this.mutate,reset:this.reset})},xv=function(n){Xt.batch(()=>{var r,a,i,s,o,l,u,d;if(U(this,Ka)&&this.hasListeners()){const f=U(this,Hi).variables,p=U(this,Hi).context;(n==null?void 0:n.type)==="success"?((a=(r=U(this,Ka)).onSuccess)==null||a.call(r,n.data,f,p),(s=(i=U(this,Ka)).onSettled)==null||s.call(i,n.data,null,f,p)):(n==null?void 0:n.type)==="error"&&((l=(o=U(this,Ka)).onError)==null||l.call(o,n.error,f,p),(d=(u=U(this,Ka)).onSettled)==null||d.call(u,void 0,n.error,f,p))}this.listeners.forEach(f=>{f(U(this,Hi))})})},iC),A2=w.createContext(void 0),ln=e=>{const t=w.useContext(A2);if(!t)throw new Error("No QueryClient set, use QueryClientProvider to set one");return t},_3=({client:e,children:t})=>(w.useEffect(()=>(e.mount(),()=>{e.unmount()}),[e]),c.jsx(A2.Provider,{value:e,children:t})),R2=w.createContext(!1),k3=()=>w.useContext(R2);R2.Provider;function E3(){let e=!1;return{clearReset:()=>{e=!1},reset:()=>{e=!0},isReset:()=>e}}var C3=w.createContext(E3()),N3=()=>w.useContext(C3),j3=(e,t)=>{(e.suspense||e.throwOnError||e.experimental_prefetchInRender)&&(t.isReset()||(e.retryOnMount=!1))},T3=e=>{w.useEffect(()=>{e.clearReset()},[e])},A3=({result:e,errorResetBoundary:t,throwOnError:n,query:r,suspense:a})=>e.isError&&!t.isReset()&&!e.isFetching&&r&&(a&&e.data===void 0||S2(n,[e.error,r])),R3=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))}},$3=(e,t)=>e.isLoading&&e.isFetching&&!t,O3=(e,t)=>(e==null?void 0:e.suspense)&&t.isPending,a_=(e,t,n)=>t.fetchOptimistic(e).catch(()=>{n.clearReset()});function M3(e,t,n){var f,p,h,y,m;const r=k3(),a=N3(),i=ln(),s=i.defaultQueryOptions(e);(p=(f=i.getDefaultOptions().queries)==null?void 0:f._experimental_beforeQuery)==null||p.call(f,s),s._optimisticResults=r?"isRestoring":"optimistic",R3(s),j3(s,a),T3(a);const o=!i.getQueryCache().get(s.queryHash),[l]=w.useState(()=>new t(i,s)),u=l.getOptimisticResult(s),d=!r&&e.subscribed!==!1;if(w.useSyncExternalStore(w.useCallback(b=>{const g=d?l.subscribe(Xt.batchCalls(b)):Pn;return l.updateResult(),g},[l,d]),()=>l.getCurrentResult(),()=>l.getCurrentResult()),w.useEffect(()=>{l.setOptions(s)},[s,l]),O3(s,u))throw a_(s,l,a);if(A3({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&&!lo&&$3(u,r)){const b=o?a_(s,l,a):(m=i.getQueryCache().get(s.queryHash))==null?void 0:m.promise;b==null||b.catch(Pn).finally(()=>{l.updateResult()})}return s.notifyOnChangeProps?u:l.trackResult(u)}function wt(e,t){return M3(e,b3)}function St(e,t){const n=ln(),[r]=w.useState(()=>new S3(n,e));w.useEffect(()=>{r.setOptions(e)},[r,e]);const a=w.useSyncExternalStore(w.useCallback(s=>r.subscribe(Xt.batchCalls(s)),[r]),()=>r.getCurrentResult(),()=>r.getCurrentResult()),i=w.useCallback((s,o)=>{r.mutate(s,o).catch(Pn)},[r]);if(a.error&&S2(r.options.throwOnError,[a.error]))throw a.error;return{...a,mutate:i,mutateAsync:a.mutate}}async function $2(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 $2(r),r}const P3=({on401:e})=>async({queryKey:t})=>{const n=t.join("/"),r=await fetch(n,{credentials:"include"});return await $2(r),await r.json()},D3=new v3({defaultOptions:{queries:{queryFn:P3({on401:"throw"}),refetchInterval:!1,refetchOnWindowFocus:!0,staleTime:0,gcTime:10*60*1e3,retry:!1},mutations:{retry:!1}}});async function z3(){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 I3=1,L3=1e6;let bg=0;function U3(){return bg=(bg+1)%Number.MAX_SAFE_INTEGER,bg.toString()}const xg=new Map,i_=e=>{if(xg.has(e))return;const t=setTimeout(()=>{xg.delete(e),gu({type:"REMOVE_TOAST",toastId:e})},L3);xg.set(e,t)},F3=(e,t)=>{switch(t.type){case"ADD_TOAST":return{...e,toasts:[t.toast,...e.toasts].slice(0,I3)};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?i_(n):e.toasts.forEach(r=>{i_(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)}}},Gf=[];let Qf={toasts:[]};function gu(e){Qf=F3(Qf,e),Gf.forEach(t=>{t(Qf)})}function q3({...e}){const t=U3(),n=a=>gu({type:"UPDATE_TOAST",toast:{...a,id:t}}),r=()=>gu({type:"DISMISS_TOAST",toastId:t});return gu({type:"ADD_TOAST",toast:{...e,id:t,open:!0,onOpenChange:a=>{a||r()}}}),{id:t,dismiss:r,update:n}}function tn(){const[e,t]=w.useState(Qf);return w.useEffect(()=>(Gf.push(t),()=>{const n=Gf.indexOf(t);n>-1&&Gf.splice(n,1)}),[e]),{...e,toast:q3,dismiss:n=>gu({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 s_(e,t){if(typeof e=="function")return e(t);e!=null&&(e.current=t)}function O2(...e){return t=>{let n=!1;const r=e.map(a=>{const i=s_(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():s_(e[a],null)}}}}function lt(...e){return w.useCallback(O2(...e),e)}function H3(e,t){const n=w.createContext(t),r=i=>{const{children:s,...o}=i,l=w.useMemo(()=>o,Object.values(o));return c.jsx(n.Provider,{value:l,children:s})};r.displayName=e+"Provider";function a(i){const s=w.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=w.createContext(s),l=n.length;n=[...n,s];const u=f=>{var g;const{scope:p,children:h,...y}=f,m=((g=p==null?void 0:p[e])==null?void 0:g[l])||o,b=w.useMemo(()=>y,Object.values(y));return c.jsx(m.Provider,{value:b,children:h})};u.displayName=i+"Provider";function d(f,p){var m;const h=((m=p==null?void 0:p[e])==null?void 0:m[l])||o,y=w.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=>w.createContext(s));return function(o){const l=(o==null?void 0:o[e])||i;return w.useMemo(()=>({[`__scope${e}`]:{...o,[e]:l}}),[o,l])}};return a.scopeName=e,[r,B3(a,...t)]}function B3(...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 w.useMemo(()=>({[`__scope${t.scopeName}`]:s}),[s])}};return n.scopeName=t.scopeName,n}function uo(e){const t=K3(e),n=w.forwardRef((r,a)=>{const{children:i,...s}=r,o=w.Children.toArray(i),l=o.find(G3);if(l){const u=l.props.children,d=o.map(f=>f===l?w.Children.count(u)>1?w.Children.only(null):w.isValidElement(u)?u.props.children:null:f);return c.jsx(t,{...s,ref:a,children:w.isValidElement(u)?w.cloneElement(u,void 0,d):null})}return c.jsx(t,{...s,ref:a,children:i})});return n.displayName=`${e}.Slot`,n}var V3=uo("Slot");function K3(e){const t=w.forwardRef((n,r)=>{const{children:a,...i}=n;if(w.isValidElement(a)){const s=Y3(a),o=Q3(i,a.props);return a.type!==w.Fragment&&(o.ref=r?O2(r,s):s),w.cloneElement(a,o)}return w.Children.count(a)>1?w.Children.only(null):null});return t.displayName=`${e}.SlotClone`,t}var M2=Symbol("radix.slottable");function Z3(e){const t=({children:n})=>c.jsx(c.Fragment,{children:n});return t.displayName=`${e}.Slottable`,t.__radixId=M2,t}function G3(e){return w.isValidElement(e)&&typeof e.type=="function"&&"__radixId"in e.type&&e.type.__radixId===M2}function Q3(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 Y3(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 qb(e){const t=e+"CollectionProvider",[n,r]=fi(t),[a,i]=n(t,{collectionRef:{current:null},itemMap:new Map}),s=m=>{const{scope:b,children:g}=m,v=ca.useRef(null),x=ca.useRef(new Map).current;return c.jsx(a,{scope:b,itemMap:x,collectionRef:v,children:g})};s.displayName=t;const o=e+"CollectionSlot",l=uo(o),u=ca.forwardRef((m,b)=>{const{scope:g,children:v}=m,x=i(o,g),S=lt(b,x.collectionRef);return c.jsx(l,{ref:S,children:v})});u.displayName=o;const d=e+"CollectionItemSlot",f="data-radix-collection-item",p=uo(d),h=ca.forwardRef((m,b)=>{const{scope:g,children:v,...x}=m,S=ca.useRef(null),k=lt(b,S),C=i(d,g);return ca.useEffect(()=>(C.itemMap.set(S,{ref:S,...x}),()=>void C.itemMap.delete(S))),c.jsx(p,{[f]:"",ref:k,children:v})});h.displayName=d;function y(m){const b=i(e+"CollectionConsumer",m);return ca.useCallback(()=>{const v=b.collectionRef.current;if(!v)return[];const x=Array.from(v.querySelectorAll(`[${f}]`));return Array.from(b.itemMap.values()).sort((C,N)=>x.indexOf(C.ref.current)-x.indexOf(N.ref.current))},[b.collectionRef,b.itemMap])}return[{Provider:s,Slot:u,ItemSlot:h},y,r]}var X3=["a","button","div","form","h2","h3","img","input","label","li","nav","ol","p","select","span","svg","ul"],De=X3.reduce((e,t)=>{const n=uo(`Primitive.${t}`),r=w.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 P2(e,t){e&&wo.flushSync(()=>e.dispatchEvent(t))}function Ir(e){const t=w.useRef(e);return w.useEffect(()=>{t.current=e}),w.useMemo(()=>(...n)=>{var r;return(r=t.current)==null?void 0:r.call(t,...n)},[])}function W3(e,t=globalThis==null?void 0:globalThis.document){const n=Ir(e);w.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 J3="DismissableLayer",wv="dismissableLayer.update",eI="dismissableLayer.pointerDownOutside",tI="dismissableLayer.focusOutside",o_,D2=w.createContext({layers:new Set,layersWithOutsidePointerEventsDisabled:new Set,branches:new Set}),pc=w.forwardRef((e,t)=>{const{disableOutsidePointerEvents:n=!1,onEscapeKeyDown:r,onPointerDownOutside:a,onFocusOutside:i,onInteractOutside:s,onDismiss:o,...l}=e,u=w.useContext(D2),[d,f]=w.useState(null),p=(d==null?void 0:d.ownerDocument)??(globalThis==null?void 0:globalThis.document),[,h]=w.useState({}),y=lt(t,N=>f(N)),m=Array.from(u.layers),[b]=[...u.layersWithOutsidePointerEventsDisabled].slice(-1),g=m.indexOf(b),v=d?m.indexOf(d):-1,x=u.layersWithOutsidePointerEventsDisabled.size>0,S=v>=g,k=rI(N=>{const P=N.target,R=[...u.branches].some($=>$.contains(P));!S||R||(a==null||a(N),s==null||s(N),N.defaultPrevented||o==null||o())},p),C=aI(N=>{const P=N.target;[...u.branches].some($=>$.contains(P))||(i==null||i(N),s==null||s(N),N.defaultPrevented||o==null||o())},p);return W3(N=>{v===u.layers.size-1&&(r==null||r(N),!N.defaultPrevented&&o&&(N.preventDefault(),o()))},p),w.useEffect(()=>{if(d)return n&&(u.layersWithOutsidePointerEventsDisabled.size===0&&(o_=p.body.style.pointerEvents,p.body.style.pointerEvents="none"),u.layersWithOutsidePointerEventsDisabled.add(d)),u.layers.add(d),l_(),()=>{n&&u.layersWithOutsidePointerEventsDisabled.size===1&&(p.body.style.pointerEvents=o_)}},[d,p,n,u]),w.useEffect(()=>()=>{d&&(u.layers.delete(d),u.layersWithOutsidePointerEventsDisabled.delete(d),l_())},[d,u]),w.useEffect(()=>{const N=()=>h({});return document.addEventListener(wv,N),()=>document.removeEventListener(wv,N)},[]),c.jsx(De.div,{...l,ref:y,style:{pointerEvents:x?S?"auto":"none":void 0,...e.style},onFocusCapture:xe(e.onFocusCapture,C.onFocusCapture),onBlurCapture:xe(e.onBlurCapture,C.onBlurCapture),onPointerDownCapture:xe(e.onPointerDownCapture,k.onPointerDownCapture)})});pc.displayName=J3;var nI="DismissableLayerBranch",z2=w.forwardRef((e,t)=>{const n=w.useContext(D2),r=w.useRef(null),a=lt(t,r);return w.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})});z2.displayName=nI;function rI(e,t=globalThis==null?void 0:globalThis.document){const n=Ir(e),r=w.useRef(!1),a=w.useRef(()=>{});return w.useEffect(()=>{const i=o=>{if(o.target&&!r.current){let l=function(){I2(eI,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 aI(e,t=globalThis==null?void 0:globalThis.document){const n=Ir(e),r=w.useRef(!1);return w.useEffect(()=>{const a=i=>{i.target&&!r.current&&I2(tI,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 l_(){const e=new CustomEvent(wv);document.dispatchEvent(e)}function I2(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?P2(a,i):a.dispatchEvent(i)}var iI=pc,sI=z2,wn=globalThis!=null&&globalThis.document?w.useLayoutEffect:()=>{},oI="Portal",vd=w.forwardRef((e,t)=>{var o;const{container:n,...r}=e,[a,i]=w.useState(!1);wn(()=>i(!0),[]);const s=n||a&&((o=globalThis==null?void 0:globalThis.document)==null?void 0:o.body);return s?XP.createPortal(c.jsx(De.div,{...r,ref:t}),s):null});vd.displayName=oI;function lI(e,t){return w.useReducer((n,r)=>t[n][r]??n,e)}var hi=e=>{const{present:t,children:n}=e,r=cI(t),a=typeof n=="function"?n({present:r.isPresent}):w.Children.only(n),i=lt(r.ref,uI(a));return typeof n=="function"||r.isPresent?w.cloneElement(a,{ref:i}):null};hi.displayName="Presence";function cI(e){const[t,n]=w.useState(),r=w.useRef(null),a=w.useRef(e),i=w.useRef("none"),s=e?"mounted":"unmounted",[o,l]=lI(s,{mounted:{UNMOUNT:"unmounted",ANIMATION_OUT:"unmountSuspended"},unmountSuspended:{MOUNT:"mounted",ANIMATION_END:"unmounted"},unmounted:{MOUNT:"mounted"}});return w.useEffect(()=>{const u=af(r.current);i.current=o==="mounted"?u:"none"},[o]),wn(()=>{const u=r.current,d=a.current;if(d!==e){const p=i.current,h=af(u);e?l("MOUNT"):h==="none"||(u==null?void 0:u.display)==="none"?l("UNMOUNT"):l(d&&p!==h?"ANIMATION_OUT":"UNMOUNT"),a.current=e}},[e,l]),wn(()=>{if(t){let u;const d=t.ownerDocument.defaultView??window,f=h=>{const m=af(r.current).includes(CSS.escape(h.animationName));if(h.target===t&&m&&(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)})}},p=h=>{h.target===t&&(i.current=af(r.current))};return t.addEventListener("animationstart",p),t.addEventListener("animationcancel",f),t.addEventListener("animationend",f),()=>{d.clearTimeout(u),t.removeEventListener("animationstart",p),t.removeEventListener("animationcancel",f),t.removeEventListener("animationend",f)}}else l("ANIMATION_END")},[t,l]),{isPresent:["mounted","unmountSuspended"].includes(o),ref:w.useCallback(u=>{r.current=u?getComputedStyle(u):null,n(u)},[])}}function af(e){return(e==null?void 0:e.animationName)||"none"}function uI(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 dI=ad[" useInsertionEffect ".trim().toString()]||wn;function fo({prop:e,defaultProp:t,onChange:n=()=>{},caller:r}){const[a,i,s]=fI({defaultProp:t,onChange:n}),o=e!==void 0,l=o?e:a;{const d=w.useRef(e!==void 0);w.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=w.useCallback(d=>{var f;if(o){const p=hI(d)?d(e):d;p!==e&&((f=s.current)==null||f.call(s,p))}else i(d)},[o,e,i,s]);return[l,u]}function fI({defaultProp:e,onChange:t}){const[n,r]=w.useState(e),a=w.useRef(n),i=w.useRef(t);return dI(()=>{i.current=t},[t]),w.useEffect(()=>{var s;a.current!==n&&((s=i.current)==null||s.call(i,n),a.current=n)},[n,a]),[n,r,i]}function hI(e){return typeof e=="function"}var L2=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"}),pI="VisuallyHidden",Zp=w.forwardRef((e,t)=>c.jsx(De.span,{...e,ref:t,style:{...L2,...e.style}}));Zp.displayName=pI;var mI=Zp,Hb="ToastProvider",[Bb,gI,yI]=qb("Toast"),[U2,Gae]=fi("Toast",[yI]),[vI,Gp]=U2(Hb),F2=e=>{const{__scopeToast:t,label:n="Notification",duration:r=5e3,swipeDirection:a="right",swipeThreshold:i=50,children:s}=e,[o,l]=w.useState(null),[u,d]=w.useState(0),f=w.useRef(!1),p=w.useRef(!1);return n.trim()||console.error(`Invalid prop \`label\` supplied to \`${Hb}\`. Expected non-empty \`string\`.`),c.jsx(Bb.Provider,{scope:t,children:c.jsx(vI,{scope:t,label:n,duration:r,swipeDirection:a,swipeThreshold:i,toastCount:u,viewport:o,onViewportChange:l,onToastAdd:w.useCallback(()=>d(h=>h+1),[]),onToastRemove:w.useCallback(()=>d(h=>h-1),[]),isFocusedToastEscapeKeyDownRef:f,isClosePausedRef:p,children:s})})};F2.displayName=Hb;var q2="ToastViewport",bI=["F8"],Sv="toast.viewportPause",_v="toast.viewportResume",H2=w.forwardRef((e,t)=>{const{__scopeToast:n,hotkey:r=bI,label:a="Notifications ({hotkey})",...i}=e,s=Gp(q2,n),o=gI(n),l=w.useRef(null),u=w.useRef(null),d=w.useRef(null),f=w.useRef(null),p=lt(t,f,s.onViewportChange),h=r.join("+").replace(/Key/g,"").replace(/Digit/g,""),y=s.toastCount>0;w.useEffect(()=>{const b=g=>{var x;r.length!==0&&r.every(S=>g[S]||g.code===S)&&((x=f.current)==null||x.focus())};return document.addEventListener("keydown",b),()=>document.removeEventListener("keydown",b)},[r]),w.useEffect(()=>{const b=l.current,g=f.current;if(y&&b&&g){const v=()=>{if(!s.isClosePausedRef.current){const C=new CustomEvent(Sv);g.dispatchEvent(C),s.isClosePausedRef.current=!0}},x=()=>{if(s.isClosePausedRef.current){const C=new CustomEvent(_v);g.dispatchEvent(C),s.isClosePausedRef.current=!1}},S=C=>{!b.contains(C.relatedTarget)&&x()},k=()=>{b.contains(document.activeElement)||x()};return b.addEventListener("focusin",v),b.addEventListener("focusout",S),b.addEventListener("pointermove",v),b.addEventListener("pointerleave",k),window.addEventListener("blur",v),window.addEventListener("focus",x),()=>{b.removeEventListener("focusin",v),b.removeEventListener("focusout",S),b.removeEventListener("pointermove",v),b.removeEventListener("pointerleave",k),window.removeEventListener("blur",v),window.removeEventListener("focus",x)}}},[y,s.isClosePausedRef]);const m=w.useCallback(({tabbingDirection:b})=>{const v=o().map(x=>{const S=x.ref.current,k=[S,...$I(S)];return b==="forwards"?k:k.reverse()});return(b==="forwards"?v.reverse():v).flat()},[o]);return w.useEffect(()=>{const b=f.current;if(b){const g=v=>{var k,C,N;const x=v.altKey||v.ctrlKey||v.metaKey;if(v.key==="Tab"&&!x){const P=document.activeElement,R=v.shiftKey;if(v.target===b&&R){(k=u.current)==null||k.focus();return}const O=m({tabbingDirection:R?"backwards":"forwards"}),z=O.findIndex(D=>D===P);wg(O.slice(z+1))?v.preventDefault():R?(C=u.current)==null||C.focus():(N=d.current)==null||N.focus()}};return b.addEventListener("keydown",g),()=>b.removeEventListener("keydown",g)}},[o,m]),c.jsxs(sI,{ref:l,role:"region","aria-label":a.replace("{hotkey}",h),tabIndex:-1,style:{pointerEvents:y?void 0:"none"},children:[y&&c.jsx(kv,{ref:u,onFocusFromOutsideViewport:()=>{const b=m({tabbingDirection:"forwards"});wg(b)}}),c.jsx(Bb.Slot,{scope:n,children:c.jsx(De.ol,{tabIndex:-1,...i,ref:p})}),y&&c.jsx(kv,{ref:d,onFocusFromOutsideViewport:()=>{const b=m({tabbingDirection:"backwards"});wg(b)}})]})});H2.displayName=q2;var B2="ToastFocusProxy",kv=w.forwardRef((e,t)=>{const{__scopeToast:n,onFocusFromOutsideViewport:r,...a}=e,i=Gp(B2,n);return c.jsx(Zp,{tabIndex:0,...a,ref:t,style:{position:"fixed"},onFocus:s=>{var u;const o=s.relatedTarget;!((u=i.viewport)!=null&&u.contains(o))&&r()}})});kv.displayName=B2;var bd="Toast",xI="toast.swipeStart",wI="toast.swipeMove",SI="toast.swipeCancel",_I="toast.swipeEnd",V2=w.forwardRef((e,t)=>{const{forceMount:n,open:r,defaultOpen:a,onOpenChange:i,...s}=e,[o,l]=fo({prop:r,defaultProp:a??!0,onChange:i,caller:bd});return c.jsx(hi,{present:n||o,children:c.jsx(CI,{open:o,...s,ref:t,onClose:()=>l(!1),onPause:Ir(e.onPause),onResume:Ir(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)})})})});V2.displayName=bd;var[kI,EI]=U2(bd,{onClose(){}}),CI=w.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:p,onSwipeEnd:h,...y}=e,m=Gp(bd,n),[b,g]=w.useState(null),v=lt(t,D=>g(D)),x=w.useRef(null),S=w.useRef(null),k=a||m.duration,C=w.useRef(0),N=w.useRef(k),P=w.useRef(0),{onToastAdd:R,onToastRemove:$}=m,j=Ir(()=>{var A;(b==null?void 0:b.contains(document.activeElement))&&((A=m.viewport)==null||A.focus()),s()}),O=w.useCallback(D=>{!D||D===1/0||(window.clearTimeout(P.current),C.current=new Date().getTime(),P.current=window.setTimeout(j,D))},[j]);w.useEffect(()=>{const D=m.viewport;if(D){const A=()=>{O(N.current),u==null||u()},B=()=>{const Z=new Date().getTime()-C.current;N.current=N.current-Z,window.clearTimeout(P.current),l==null||l()};return D.addEventListener(Sv,B),D.addEventListener(_v,A),()=>{D.removeEventListener(Sv,B),D.removeEventListener(_v,A)}}},[m.viewport,k,l,u,O]),w.useEffect(()=>{i&&!m.isClosePausedRef.current&&O(k)},[i,k,m.isClosePausedRef,O]),w.useEffect(()=>(R(),()=>$()),[R,$]);const z=w.useMemo(()=>b?W2(b):null,[b]);return m.viewport?c.jsxs(c.Fragment,{children:[z&&c.jsx(NI,{__scopeToast:n,role:"status","aria-live":r==="foreground"?"assertive":"polite",children:z}),c.jsx(kI,{scope:n,onClose:j,children:wo.createPortal(c.jsx(Bb.ItemSlot,{scope:n,children:c.jsx(iI,{asChild:!0,onEscapeKeyDown:xe(o,()=>{m.isFocusedToastEscapeKeyDownRef.current||j(),m.isFocusedToastEscapeKeyDownRef.current=!1}),children:c.jsx(De.li,{tabIndex:0,"data-state":i?"open":"closed","data-swipe-direction":m.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||(m.isFocusedToastEscapeKeyDownRef.current=!0,j()))}),onPointerDown:xe(e.onPointerDown,D=>{D.button===0&&(x.current={x:D.clientX,y:D.clientY})}),onPointerMove:xe(e.onPointerMove,D=>{if(!x.current)return;const A=D.clientX-x.current.x,B=D.clientY-x.current.y,Z=!!S.current,F=["left","right"].includes(m.swipeDirection),J=["left","up"].includes(m.swipeDirection)?Math.min:Math.max,T=F?J(0,A):0,q=F?0:J(0,B),G=D.pointerType==="touch"?10:2,_={x:T,y:q},E={originalEvent:D,delta:_};Z?(S.current=_,sf(wI,f,E,{discrete:!1})):c_(_,m.swipeDirection,G)?(S.current=_,sf(xI,d,E,{discrete:!1}),D.target.setPointerCapture(D.pointerId)):(Math.abs(A)>G||Math.abs(B)>G)&&(x.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,x.current=null,A){const Z=D.currentTarget,F={originalEvent:D,delta:A};c_(A,m.swipeDirection,m.swipeThreshold)?sf(_I,h,F,{discrete:!0}):sf(SI,p,F,{discrete:!0}),Z.addEventListener("click",J=>J.preventDefault(),{once:!0})}})})})}),m.viewport)})]}):null}),NI=e=>{const{__scopeToast:t,children:n,...r}=e,a=Gp(bd,t),[i,s]=w.useState(!1),[o,l]=w.useState(!1);return AI(()=>s(!0)),w.useEffect(()=>{const u=window.setTimeout(()=>l(!0),1e3);return()=>window.clearTimeout(u)},[]),o?null:c.jsx(vd,{asChild:!0,children:c.jsx(Zp,{...r,children:i&&c.jsxs(c.Fragment,{children:[a.label," ",n]})})})},jI="ToastTitle",K2=w.forwardRef((e,t)=>{const{__scopeToast:n,...r}=e;return c.jsx(De.div,{...r,ref:t})});K2.displayName=jI;var TI="ToastDescription",Z2=w.forwardRef((e,t)=>{const{__scopeToast:n,...r}=e;return c.jsx(De.div,{...r,ref:t})});Z2.displayName=TI;var G2="ToastAction",Q2=w.forwardRef((e,t)=>{const{altText:n,...r}=e;return n.trim()?c.jsx(X2,{altText:n,asChild:!0,children:c.jsx(Vb,{...r,ref:t})}):(console.error(`Invalid prop \`altText\` supplied to \`${G2}\`. Expected non-empty \`string\`.`),null)});Q2.displayName=G2;var Y2="ToastClose",Vb=w.forwardRef((e,t)=>{const{__scopeToast:n,...r}=e,a=EI(Y2,n);return c.jsx(X2,{asChild:!0,children:c.jsx(De.button,{type:"button",...r,ref:t,onClick:xe(e.onClick,a.onClose)})})});Vb.displayName=Y2;var X2=w.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 W2(e){const t=[];return Array.from(e.childNodes).forEach(r=>{if(r.nodeType===r.TEXT_NODE&&r.textContent&&t.push(r.textContent),RI(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(...W2(r))}}),t}function sf(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?P2(a,i):a.dispatchEvent(i)}var c_=(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 AI(e=()=>{}){const t=Ir(e);wn(()=>{let n=0,r=0;return n=window.requestAnimationFrame(()=>r=window.requestAnimationFrame(t)),()=>{window.cancelAnimationFrame(n),window.cancelAnimationFrame(r)}},[t])}function RI(e){return e.nodeType===e.ELEMENT_NODE}function $I(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 wg(e){const t=document.activeElement;return e.some(n=>n===t?!0:(n.focus(),document.activeElement!==t))}var OI=F2,J2=H2,eT=V2,tT=K2,nT=Z2,rT=Q2,aT=Vb;function iT(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=iT(e[t]))&&(r&&(r+=" "),r+=n)}else for(n in e)e[n]&&(r&&(r+=" "),r+=n);return r}function sT(){for(var e,t,n=0,r="",a=arguments.length;n<a;n++)(e=arguments[n])&&(t=iT(e))&&(r&&(r+=" "),r+=t);return r}const u_=e=>typeof e=="boolean"?`${e}`:e===0?"0":e,d_=sT,Qp=(e,t)=>n=>{var r;if((t==null?void 0:t.variants)==null)return d_(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 p=u_(d)||u_(f);return a[u][p]}),o=n&&Object.entries(n).reduce((u,d)=>{let[f,p]=d;return p===void 0||(u[f]=p),u},{}),l=t==null||(r=t.compoundVariants)===null||r===void 0?void 0:r.reduce((u,d)=>{let{class:f,className:p,...h}=d;return Object.entries(h).every(y=>{let[m,b]=y;return Array.isArray(b)?b.includes({...i,...o}[m]):{...i,...o}[m]===b})?[...u,f,p]:u},[]);return d_(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 MI=e=>e.replace(/([a-z0-9])([A-Z])/g,"$1-$2").toLowerCase(),oT=(...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 PI={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 DI=w.forwardRef(({color:e="currentColor",size:t=24,strokeWidth:n=2,absoluteStrokeWidth:r,className:a="",children:i,iconNode:s,...o},l)=>w.createElement("svg",{ref:l,...PI,width:t,height:t,stroke:e,strokeWidth:r?Number(n)*24/Number(t):n,className:oT("lucide",a),...o},[...s.map(([u,d])=>w.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=w.forwardRef(({className:r,...a},i)=>w.createElement(DI,{ref:i,iconNode:t,className:oT(`lucide-${MI(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 zI=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 lT=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 cT=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 Kb=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 II=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 Sg=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 uT=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 Yp=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 dT=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 fT=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 LI=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 hT=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 Ev=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 f_=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 UI=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 Zb=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 h_=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 pT=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 Wa=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 FI=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 qI=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 Cv=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 of=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 Bh=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 HI=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 p_=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 BI=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 Fs=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 VI=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 mT=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 Vh=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 KI=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 ZI=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 xd=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 Ar=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 GI=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 QI=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 Gb=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 Kh=Fe("X",[["path",{d:"M18 6 6 18",key:"1bl5f8"}],["path",{d:"m6 6 12 12",key:"d8bk6v"}]]),Qb="-",YI=e=>{const t=WI(e),{conflictingClassGroups:n,conflictingClassGroupModifiers:r}=e;return{getClassGroupId:s=>{const o=s.split(Qb);return o[0]===""&&o.length!==1&&o.shift(),gT(o,t)||XI(s)},getConflictingClassGroupIds:(s,o)=>{const l=n[s]||[];return o&&r[s]?[...l,...r[s]]:l}}},gT=(e,t)=>{var s;if(e.length===0)return t.classGroupId;const n=e[0],r=t.nextPart.get(n),a=r?gT(e.slice(1),r):void 0;if(a)return a;if(t.validators.length===0)return;const i=e.join(Qb);return(s=t.validators.find(({validator:o})=>o(i)))==null?void 0:s.classGroupId},m_=/^\[(.+)\]$/,XI=e=>{if(m_.test(e)){const t=m_.exec(e)[1],n=t==null?void 0:t.substring(0,t.indexOf(":"));if(n)return"arbitrary.."+n}},WI=e=>{const{theme:t,prefix:n}=e,r={nextPart:new Map,validators:[]};return eL(Object.entries(e.classGroups),n).forEach(([i,s])=>{Nv(s,r,i,t)}),r},Nv=(e,t,n,r)=>{e.forEach(a=>{if(typeof a=="string"){const i=a===""?t:g_(t,a);i.classGroupId=n;return}if(typeof a=="function"){if(JI(a)){Nv(a(r),t,n,r);return}t.validators.push({validator:a,classGroupId:n});return}Object.entries(a).forEach(([i,s])=>{Nv(s,g_(t,i),n,r)})})},g_=(e,t)=>{let n=e;return t.split(Qb).forEach(r=>{n.nextPart.has(r)||n.nextPart.set(r,{nextPart:new Map,validators:[]}),n=n.nextPart.get(r)}),n},JI=e=>e.isThemeGetter,eL=(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,tL=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)}}},yT="!",nL=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 p=l.length===0?o:o.substring(d),h=p.startsWith(yT),y=h?p.substring(1):p,m=f&&f>d?f-d:void 0;return{modifiers:l,hasImportantModifier:h,baseClassName:y,maybePostfixModifierPosition:m}};return n?o=>n({className:o,parseClassName:s}):s},rL=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},aL=e=>({cache:tL(e.cacheSize),parseClassName:nL(e),...YI(e)}),iL=/\s+/,sL=(e,t)=>{const{parseClassName:n,getClassGroupId:r,getConflictingClassGroupIds:a}=t,i=[],s=e.trim().split(iL);let o="";for(let l=s.length-1;l>=0;l-=1){const u=s[l],{modifiers:d,hasImportantModifier:f,baseClassName:p,maybePostfixModifierPosition:h}=n(u);let y=!!h,m=r(y?p.substring(0,h):p);if(!m){if(!y){o=u+(o.length>0?" "+o:o);continue}if(m=r(p),!m){o=u+(o.length>0?" "+o:o);continue}y=!1}const b=rL(d).join(":"),g=f?b+yT:b,v=g+m;if(i.includes(v))continue;i.push(v);const x=a(m,y);for(let S=0;S<x.length;++S){const k=x[S];i.push(g+k)}o=u+(o.length>0?" "+o:o)}return o};function oL(){let e=0,t,n,r="";for(;e<arguments.length;)(t=arguments[e++])&&(n=vT(t))&&(r&&(r+=" "),r+=n);return r}const vT=e=>{if(typeof e=="string")return e;let t,n="";for(let r=0;r<e.length;r++)e[r]&&(t=vT(e[r]))&&(n&&(n+=" "),n+=t);return n};function lL(e,...t){let n,r,a,i=s;function s(l){const u=t.reduce((d,f)=>f(d),e());return n=aL(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=sL(l,n);return a(l,d),d}return function(){return i(oL.apply(null,arguments))}}const bt=e=>{const t=n=>n[e]||[];return t.isThemeGetter=!0,t},bT=/^\[(?:([a-z-]+):)?(.+)\]$/i,cL=/^\d+\/\d+$/,uL=new Set(["px","full","screen"]),dL=/^(\d+(\.\d+)?)?(xs|sm|md|lg|xl)$/,fL=/\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$/,hL=/^(rgba?|hsla?|hwb|(ok)?(lab|lch))\(.+\)$/,pL=/^(inset_)?-?((\d+)?\.?(\d+)[a-z]+|0)_-?((\d+)?\.?(\d+)[a-z]+|0)/,mL=/^(url|image|image-set|cross-fade|element|(repeating-)?(linear|radial|conic)-gradient)\(.+\)$/,Ma=e=>yl(e)||uL.has(e)||cL.test(e),bi=e=>mc(e,"length",_L),yl=e=>!!e&&!Number.isNaN(Number(e)),_g=e=>mc(e,"number",yl),Mc=e=>!!e&&Number.isInteger(Number(e)),gL=e=>e.endsWith("%")&&yl(e.slice(0,-1)),ze=e=>bT.test(e),xi=e=>dL.test(e),yL=new Set(["length","size","percentage"]),vL=e=>mc(e,yL,xT),bL=e=>mc(e,"position",xT),xL=new Set(["image","url"]),wL=e=>mc(e,xL,EL),SL=e=>mc(e,"",kL),Pc=()=>!0,mc=(e,t,n)=>{const r=bT.exec(e);return r?r[1]?typeof t=="string"?r[1]===t:t.has(r[1]):n(r[2]):!1},_L=e=>fL.test(e)&&!hL.test(e),xT=()=>!1,kL=e=>pL.test(e),EL=e=>mL.test(e),CL=()=>{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"),p=bt("gap"),h=bt("gradientColorStops"),y=bt("gradientColorStopPositions"),m=bt("inset"),b=bt("margin"),g=bt("opacity"),v=bt("padding"),x=bt("saturate"),S=bt("scale"),k=bt("sepia"),C=bt("skew"),N=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",yl,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],T=()=>["auto","avoid","all","avoid-page","page","left","right","column"],q=()=>[yl,ze];return{cacheSize:500,separator:":",theme:{colors:[Pc],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:[gL,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":T()}],"break-before":[{"break-before":T()}],"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:[m]}],"inset-x":[{"inset-x":[m]}],"inset-y":[{"inset-y":[m]}],start:[{start:[m]}],end:[{end:[m]}],top:[{top:[m]}],right:[{right:[m]}],bottom:[{bottom:[m]}],left:[{left:[m]}],visibility:["visible","invisible","collapse"],z:[{z:["auto",Mc,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",Mc,ze]}],"grid-cols":[{"grid-cols":[Pc]}],"col-start-end":[{col:["auto",{span:["full",Mc,ze]},ze]}],"col-start":[{"col-start":D()}],"col-end":[{"col-end":D()}],"grid-rows":[{"grid-rows":[Pc]}],"row-start-end":[{row:["auto",{span:[Mc,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:[p]}],"gap-x":[{"gap-x":[p]}],"gap-y":[{"gap-y":[p]}],"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":[N]}],"space-x-reverse":["space-x-reverse"],"space-y":[{"space-y":[N]}],"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",_g]}],"font-family":[{font:[Pc]}],"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",yl,_g]}],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(),bL]}],"bg-repeat":[{bg:["no-repeat",{repeat:["","x","y","round","space"]}]}],"bg-size":[{bg:["auto","cover","contain",vL]}],"bg-image":[{bg:["none",{"gradient-to":["t","tr","r","br","b","bl","l","tl"]},wL]}],"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,SL]}],"shadow-color":[{shadow:[Pc]}],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:[x]}],sepia:[{sepia:[k]}],"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":[x]}],"backdrop-sepia":[{"backdrop-sepia":[k]}],"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:[Mc,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,_g]}],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"]}}},NL=lL(CL);function Te(...e){return NL(sT(e))}const jL=OI,wT=w.forwardRef(({className:e,...t},n)=>c.jsx(J2,{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}));wT.displayName=J2.displayName;const TL=Qp("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"}}),ST=w.forwardRef(({className:e,variant:t,...n},r)=>c.jsx(eT,{ref:r,className:Te(TL({variant:t}),e),...n}));ST.displayName=eT.displayName;const AL=w.forwardRef(({className:e,...t},n)=>c.jsx(rT,{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}));AL.displayName=rT.displayName;const _T=w.forwardRef(({className:e,...t},n)=>c.jsx(aT,{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(Kh,{className:"h-4 w-4"})}));_T.displayName=aT.displayName;const kT=w.forwardRef(({className:e,...t},n)=>c.jsx(tT,{ref:n,className:Te("text-sm font-semibold",e),...t}));kT.displayName=tT.displayName;const ET=w.forwardRef(({className:e,...t},n)=>c.jsx(nT,{ref:n,className:Te("text-sm opacity-90",e),...t}));ET.displayName=nT.displayName;function RL(){const{toasts:e}=tn();return c.jsxs(jL,{children:[e.map(function({id:t,title:n,description:r,action:a,...i}){return c.jsxs(ST,{...i,children:[c.jsxs("div",{className:"grid gap-1",children:[n&&c.jsx(kT,{children:n}),r&&c.jsx(ET,{children:r})]}),a,c.jsx(_T,{})]},t)}),c.jsx(wT,{})]})}var $L=ad[" useId ".trim().toString()]||(()=>{}),OL=0;function ni(e){const[t,n]=w.useState($L());return wn(()=>{n(r=>r??String(OL++))},[e]),t?`radix-${t}`:""}const ML=["top","right","bottom","left"],ds=Math.min,or=Math.max,Zh=Math.round,lf=Math.floor,wa=e=>({x:e,y:e}),PL={left:"right",right:"left",bottom:"top",top:"bottom"},DL={start:"end",end:"start"};function jv(e,t,n){return or(e,ds(t,n))}function ci(e,t){return typeof e=="function"?e(t):e}function ui(e){return e.split("-")[0]}function gc(e){return e.split("-")[1]}function Yb(e){return e==="x"?"y":"x"}function Xb(e){return e==="y"?"height":"width"}const zL=new Set(["top","bottom"]);function ba(e){return zL.has(ui(e))?"y":"x"}function Wb(e){return Yb(ba(e))}function IL(e,t,n){n===void 0&&(n=!1);const r=gc(e),a=Wb(e),i=Xb(a);let s=a==="x"?r===(n?"end":"start")?"right":"left":r==="start"?"bottom":"top";return t.reference[i]>t.floating[i]&&(s=Gh(s)),[s,Gh(s)]}function LL(e){const t=Gh(e);return[Tv(e),t,Tv(t)]}function Tv(e){return e.replace(/start|end/g,t=>DL[t])}const y_=["left","right"],v_=["right","left"],UL=["top","bottom"],FL=["bottom","top"];function qL(e,t,n){switch(e){case"top":case"bottom":return n?t?v_:y_:t?y_:v_;case"left":case"right":return t?UL:FL;default:return[]}}function HL(e,t,n,r){const a=gc(e);let i=qL(ui(e),n==="start",r);return a&&(i=i.map(s=>s+"-"+a),t&&(i=i.concat(i.map(Tv)))),i}function Gh(e){return e.replace(/left|right|bottom|top/g,t=>PL[t])}function BL(e){return{top:0,right:0,bottom:0,left:0,...e}}function CT(e){return typeof e!="number"?BL(e):{top:e,right:e,bottom:e,left:e}}function Qh(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 b_(e,t,n){let{reference:r,floating:a}=e;const i=ba(t),s=Wb(t),o=Xb(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,p=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(gc(t)){case"start":h[s]-=p*(n&&u?-1:1);break;case"end":h[s]+=p*(n&&u?-1:1);break}return h}const VL=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}=b_(u,r,l),p=r,h={},y=0;for(let m=0;m<o.length;m++){const{name:b,fn:g}=o[m],{x:v,y:x,data:S,reset:k}=await g({x:d,y:f,initialPlacement:r,placement:p,strategy:a,middlewareData:h,rects:u,platform:s,elements:{reference:e,floating:t}});d=v??d,f=x??f,h={...h,[b]:{...h[b],...S}},k&&y<=50&&(y++,typeof k=="object"&&(k.placement&&(p=k.placement),k.rects&&(u=k.rects===!0?await s.getElementRects({reference:e,floating:t,strategy:a}):k.rects),{x:d,y:f}=b_(u,p,l)),m=-1)}return{x:d,y:f,placement:p,strategy:a,middlewareData:h}};async function Vu(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:p=!1,padding:h=0}=ci(t,e),y=CT(h),b=o[p?f==="floating"?"reference":"floating":f],g=Qh(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,x=await(i.getOffsetParent==null?void 0:i.getOffsetParent(o.floating)),S=await(i.isElement==null?void 0:i.isElement(x))?await(i.getScale==null?void 0:i.getScale(x))||{x:1,y:1}:{x:1,y:1},k=Qh(i.convertOffsetParentRelativeRectToViewportRelativeRect?await i.convertOffsetParentRelativeRectToViewportRelativeRect({elements:o,rect:v,offsetParent:x,strategy:l}):v);return{top:(g.top-k.top+y.top)/S.y,bottom:(k.bottom-g.bottom+y.bottom)/S.y,left:(g.left-k.left+y.left)/S.x,right:(k.right-g.right+y.right)/S.x}}const KL=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=CT(d),p={x:n,y:r},h=Wb(a),y=Xb(h),m=await s.getDimensions(u),b=h==="y",g=b?"top":"left",v=b?"bottom":"right",x=b?"clientHeight":"clientWidth",S=i.reference[y]+i.reference[h]-p[h]-i.floating[y],k=p[h]-i.reference[h],C=await(s.getOffsetParent==null?void 0:s.getOffsetParent(u));let N=C?C[x]:0;(!N||!await(s.isElement==null?void 0:s.isElement(C)))&&(N=o.floating[x]||i.floating[y]);const P=S/2-k/2,R=N/2-m[y]/2-1,$=ds(f[g],R),j=ds(f[v],R),O=$,z=N-m[y]-j,D=N/2-m[y]/2+P,A=jv(O,D,z),B=!l.arrow&&gc(a)!=null&&D!==A&&i.reference[y]/2-(D<O?$:j)-m[y]/2<0,Z=B?D<O?D-O:D-z:0;return{[h]:p[h]+Z,data:{[h]:A,centerOffset:D-A-Z,...B&&{alignmentOffset:Z}},reset:B}}}),ZL=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:p,fallbackStrategy:h="bestFit",fallbackAxisSideDirection:y="none",flipAlignment:m=!0,...b}=ci(e,t);if((n=i.arrow)!=null&&n.alignmentOffset)return{};const g=ui(a),v=ba(o),x=ui(o)===o,S=await(l.isRTL==null?void 0:l.isRTL(u.floating)),k=p||(x||!m?[Gh(o)]:LL(o)),C=y!=="none";!p&&C&&k.push(...HL(o,m,y,S));const N=[o,...k],P=await Vu(t,b),R=[];let $=((r=i.flip)==null?void 0:r.overflows)||[];if(d&&R.push(P[g]),f){const D=IL(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=N[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,T)=>J+T,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 x_(e,t){return{top:e.top-t.height,right:e.right-t.width,bottom:e.bottom-t.height,left:e.left-t.width}}function w_(e){return ML.some(t=>e[t]>=0)}const GL=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 Vu(t,{...a,elementContext:"reference"}),s=x_(i,n.reference);return{data:{referenceHiddenOffsets:s,referenceHidden:w_(s)}}}case"escaped":{const i=await Vu(t,{...a,altBoundary:!0}),s=x_(i,n.floating);return{data:{escapedOffsets:s,escaped:w_(s)}}}default:return{}}}}},NT=new Set(["left","top"]);async function QL(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=gc(n),l=ba(n)==="y",u=NT.has(s)?-1:1,d=i&&l?-1:1,f=ci(t,e);let{mainAxis:p,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:p*u}:{x:p*u,y:h*d}}const YL=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 QL(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}}}}},XL=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 Vu(t,l),f=ba(ui(a)),p=Yb(f);let h=u[p],y=u[f];if(i){const b=p==="y"?"top":"left",g=p==="y"?"bottom":"right",v=h+d[b],x=h-d[g];h=jv(v,h,x)}if(s){const b=f==="y"?"top":"left",g=f==="y"?"bottom":"right",v=y+d[b],x=y-d[g];y=jv(v,y,x)}const m=o.fn({...t,[p]:h,[f]:y});return{...m,data:{x:m.x-n,y:m.y-r,enabled:{[p]:i,[f]:s}}}}}},WL=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),p=Yb(f);let h=d[p],y=d[f];const m=ci(o,t),b=typeof m=="number"?{mainAxis:m,crossAxis:0}:{mainAxis:0,crossAxis:0,...m};if(l){const x=p==="y"?"height":"width",S=i.reference[p]-i.floating[x]+b.mainAxis,k=i.reference[p]+i.reference[x]-b.mainAxis;h<S?h=S:h>k&&(h=k)}if(u){var g,v;const x=p==="y"?"width":"height",S=NT.has(ui(a)),k=i.reference[f]-i.floating[x]+(S&&((g=s.offset)==null?void 0:g[f])||0)+(S?0:b.crossAxis),C=i.reference[f]+i.reference[x]+(S?0:((v=s.offset)==null?void 0:v[f])||0)-(S?b.crossAxis:0);y<k?y=k:y>C&&(y=C)}return{[p]:h,[f]:y}}}},JL=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 Vu(t,u),f=ui(a),p=gc(a),h=ba(a)==="y",{width:y,height:m}=i.floating;let b,g;f==="top"||f==="bottom"?(b=f,g=p===(await(s.isRTL==null?void 0:s.isRTL(o.floating))?"start":"end")?"left":"right"):(g=f,b=p==="end"?"top":"bottom");const v=m-d.top-d.bottom,x=y-d.left-d.right,S=ds(m-d[b],v),k=ds(y-d[g],x),C=!t.middlewareData.shift;let N=S,P=k;if((n=t.middlewareData.shift)!=null&&n.enabled.x&&(P=x),(r=t.middlewareData.shift)!=null&&r.enabled.y&&(N=v),C&&!p){const $=or(d.left,0),j=or(d.right,0),O=or(d.top,0),z=or(d.bottom,0);h?P=y-2*($!==0||j!==0?$+j:or(d.left,d.right)):N=m-2*(O!==0||z!==0?O+z:or(d.top,d.bottom))}await l({...t,availableWidth:P,availableHeight:N});const R=await s.getDimensions(o.floating);return y!==R.width||m!==R.height?{reset:{rects:!0}}:{}}}};function Xp(){return typeof window<"u"}function yc(e){return jT(e)?(e.nodeName||"").toLowerCase():"#document"}function mr(e){var t;return(e==null||(t=e.ownerDocument)==null?void 0:t.defaultView)||window}function Ea(e){var t;return(t=(jT(e)?e.ownerDocument:e.document)||window.document)==null?void 0:t.documentElement}function jT(e){return Xp()?e instanceof Node||e instanceof mr(e).Node:!1}function ea(e){return Xp()?e instanceof Element||e instanceof mr(e).Element:!1}function Sa(e){return Xp()?e instanceof HTMLElement||e instanceof mr(e).HTMLElement:!1}function S_(e){return!Xp()||typeof ShadowRoot>"u"?!1:e instanceof ShadowRoot||e instanceof mr(e).ShadowRoot}const e5=new Set(["inline","contents"]);function wd(e){const{overflow:t,overflowX:n,overflowY:r,display:a}=ta(e);return/auto|scroll|overlay|hidden|clip/.test(t+r+n)&&!e5.has(a)}const t5=new Set(["table","td","th"]);function n5(e){return t5.has(yc(e))}const r5=[":popover-open",":modal"];function Wp(e){return r5.some(t=>{try{return e.matches(t)}catch{return!1}})}const a5=["transform","translate","scale","rotate","perspective"],i5=["transform","translate","scale","rotate","perspective","filter"],s5=["paint","layout","strict","content"];function Jb(e){const t=ex(),n=ea(e)?ta(e):e;return a5.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)||i5.some(r=>(n.willChange||"").includes(r))||s5.some(r=>(n.contain||"").includes(r))}function o5(e){let t=fs(e);for(;Sa(t)&&!Yl(t);){if(Jb(t))return t;if(Wp(t))return null;t=fs(t)}return null}function ex(){return typeof CSS>"u"||!CSS.supports?!1:CSS.supports("-webkit-backdrop-filter","none")}const l5=new Set(["html","body","#document"]);function Yl(e){return l5.has(yc(e))}function ta(e){return mr(e).getComputedStyle(e)}function Jp(e){return ea(e)?{scrollLeft:e.scrollLeft,scrollTop:e.scrollTop}:{scrollLeft:e.scrollX,scrollTop:e.scrollY}}function fs(e){if(yc(e)==="html")return e;const t=e.assignedSlot||e.parentNode||S_(e)&&e.host||Ea(e);return S_(t)?t.host:t}function TT(e){const t=fs(e);return Yl(t)?e.ownerDocument?e.ownerDocument.body:e.body:Sa(t)&&wd(t)?t:TT(t)}function Ku(e,t,n){var r;t===void 0&&(t=[]),n===void 0&&(n=!0);const a=TT(e),i=a===((r=e.ownerDocument)==null?void 0:r.body),s=mr(a);if(i){const o=Av(s);return t.concat(s,s.visualViewport||[],wd(a)?a:[],o&&n?Ku(o):[])}return t.concat(a,Ku(a,[],n))}function Av(e){return e.parent&&Object.getPrototypeOf(e.parent)?e.frameElement:null}function AT(e){const t=ta(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=Zh(n)!==i||Zh(r)!==s;return o&&(n=i,r=s),{width:n,height:r,$:o}}function tx(e){return ea(e)?e:e.contextElement}function vl(e){const t=tx(e);if(!Sa(t))return wa(1);const n=t.getBoundingClientRect(),{width:r,height:a,$:i}=AT(t);let s=(i?Zh(n.width):n.width)/r,o=(i?Zh(n.height):n.height)/a;return(!s||!Number.isFinite(s))&&(s=1),(!o||!Number.isFinite(o))&&(o=1),{x:s,y:o}}const c5=wa(0);function RT(e){const t=mr(e);return!ex()||!t.visualViewport?c5:{x:t.visualViewport.offsetLeft,y:t.visualViewport.offsetTop}}function u5(e,t,n){return t===void 0&&(t=!1),!n||t&&n!==mr(e)?!1:t}function ho(e,t,n,r){t===void 0&&(t=!1),n===void 0&&(n=!1);const a=e.getBoundingClientRect(),i=tx(e);let s=wa(1);t&&(r?ea(r)&&(s=vl(r)):s=vl(e));const o=u5(i,n,r)?RT(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 p=mr(i),h=r&&ea(r)?mr(r):r;let y=p,m=Av(y);for(;m&&r&&h!==y;){const b=vl(m),g=m.getBoundingClientRect(),v=ta(m),x=g.left+(m.clientLeft+parseFloat(v.paddingLeft))*b.x,S=g.top+(m.clientTop+parseFloat(v.paddingTop))*b.y;l*=b.x,u*=b.y,d*=b.x,f*=b.y,l+=x,u+=S,y=mr(m),m=Av(y)}}return Qh({width:d,height:f,x:l,y:u})}function em(e,t){const n=Jp(e).scrollLeft;return t?t.left+n:ho(Ea(e)).left+n}function $T(e,t){const n=e.getBoundingClientRect(),r=n.left+t.scrollLeft-em(e,n),a=n.top+t.scrollTop;return{x:r,y:a}}function d5(e){let{elements:t,rect:n,offsetParent:r,strategy:a}=e;const i=a==="fixed",s=Ea(r),o=t?Wp(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)&&((yc(r)!=="body"||wd(s))&&(l=Jp(r)),Sa(r))){const h=ho(r);u=vl(r),d.x=h.x+r.clientLeft,d.y=h.y+r.clientTop}const p=s&&!f&&!i?$T(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+p.x,y:n.y*u.y-l.scrollTop*u.y+d.y+p.y}}function f5(e){return Array.from(e.getClientRects())}function h5(e){const t=Ea(e),n=Jp(e),r=e.ownerDocument.body,a=or(t.scrollWidth,t.clientWidth,r.scrollWidth,r.clientWidth),i=or(t.scrollHeight,t.clientHeight,r.scrollHeight,r.clientHeight);let s=-n.scrollLeft+em(e);const o=-n.scrollTop;return ta(r).direction==="rtl"&&(s+=or(t.clientWidth,r.clientWidth)-a),{width:a,height:i,x:s,y:o}}const __=25;function p5(e,t){const n=mr(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=ex();(!d||d&&t==="fixed")&&(o=a.offsetLeft,l=a.offsetTop)}const u=em(r);if(u<=0){const d=r.ownerDocument,f=d.body,p=getComputedStyle(f),h=d.compatMode==="CSS1Compat"&&parseFloat(p.marginLeft)+parseFloat(p.marginRight)||0,y=Math.abs(r.clientWidth-f.clientWidth-h);y<=__&&(i-=y)}else u<=__&&(i+=u);return{width:i,height:s,x:o,y:l}}const m5=new Set(["absolute","fixed"]);function g5(e,t){const n=ho(e,!0,t==="fixed"),r=n.top+e.clientTop,a=n.left+e.clientLeft,i=Sa(e)?vl(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 k_(e,t,n){let r;if(t==="viewport")r=p5(e,n);else if(t==="document")r=h5(Ea(e));else if(ea(t))r=g5(t,n);else{const a=RT(e);r={x:t.x-a.x,y:t.y-a.y,width:t.width,height:t.height}}return Qh(r)}function OT(e,t){const n=fs(e);return n===t||!ea(n)||Yl(n)?!1:ta(n).position==="fixed"||OT(n,t)}function y5(e,t){const n=t.get(e);if(n)return n;let r=Ku(e,[],!1).filter(o=>ea(o)&&yc(o)!=="body"),a=null;const i=ta(e).position==="fixed";let s=i?fs(e):e;for(;ea(s)&&!Yl(s);){const o=ta(s),l=Jb(s);!l&&o.position==="fixed"&&(a=null),(i?!l&&!a:!l&&o.position==="static"&&!!a&&m5.has(a.position)||wd(s)&&!l&&OT(e,s))?r=r.filter(d=>d!==s):a=o,s=fs(s)}return t.set(e,r),r}function v5(e){let{element:t,boundary:n,rootBoundary:r,strategy:a}=e;const s=[...n==="clippingAncestors"?Wp(t)?[]:y5(t,this._c):[].concat(n),r],o=s[0],l=s.reduce((u,d)=>{const f=k_(t,d,a);return u.top=or(f.top,u.top),u.right=ds(f.right,u.right),u.bottom=ds(f.bottom,u.bottom),u.left=or(f.left,u.left),u},k_(t,o,a));return{width:l.right-l.left,height:l.bottom-l.top,x:l.left,y:l.top}}function b5(e){const{width:t,height:n}=AT(e);return{width:t,height:n}}function x5(e,t,n){const r=Sa(t),a=Ea(t),i=n==="fixed",s=ho(e,!0,i,t);let o={scrollLeft:0,scrollTop:0};const l=wa(0);function u(){l.x=em(a)}if(r||!r&&!i)if((yc(t)!=="body"||wd(a))&&(o=Jp(t)),r){const h=ho(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?$T(a,o):wa(0),f=s.left+o.scrollLeft-l.x-d.x,p=s.top+o.scrollTop-l.y-d.y;return{x:f,y:p,width:s.width,height:s.height}}function kg(e){return ta(e).position==="static"}function E_(e,t){if(!Sa(e)||ta(e).position==="fixed")return null;if(t)return t(e);let n=e.offsetParent;return Ea(e)===n&&(n=n.ownerDocument.body),n}function MT(e,t){const n=mr(e);if(Wp(e))return n;if(!Sa(e)){let a=fs(e);for(;a&&!Yl(a);){if(ea(a)&&!kg(a))return a;a=fs(a)}return n}let r=E_(e,t);for(;r&&n5(r)&&kg(r);)r=E_(r,t);return r&&Yl(r)&&kg(r)&&!Jb(r)?n:r||o5(e)||n}const w5=async function(e){const t=this.getOffsetParent||MT,n=this.getDimensions,r=await n(e.floating);return{reference:x5(e.reference,await t(e.floating),e.strategy),floating:{x:0,y:0,width:r.width,height:r.height}}};function S5(e){return ta(e).direction==="rtl"}const _5={convertOffsetParentRelativeRectToViewportRelativeRect:d5,getDocumentElement:Ea,getClippingRect:v5,getOffsetParent:MT,getElementRects:w5,getClientRects:f5,getDimensions:b5,getScale:vl,isElement:ea,isRTL:S5};function PT(e,t){return e.x===t.x&&e.y===t.y&&e.width===t.width&&e.height===t.height}function k5(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:p,height:h}=u;if(o||t(),!p||!h)return;const y=lf(f),m=lf(a.clientWidth-(d+p)),b=lf(a.clientHeight-(f+h)),g=lf(d),x={rootMargin:-y+"px "+-m+"px "+-b+"px "+-g+"px",threshold:or(0,ds(1,l))||1};let S=!0;function k(C){const N=C[0].intersectionRatio;if(N!==l){if(!S)return s();N?s(!1,N):r=setTimeout(()=>{s(!1,1e-7)},1e3)}N===1&&!PT(u,e.getBoundingClientRect())&&s(),S=!1}try{n=new IntersectionObserver(k,{...x,root:a.ownerDocument})}catch{n=new IntersectionObserver(k,x)}n.observe(e)}return s(!0),i}function E5(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=tx(e),d=a||i?[...u?Ku(u):[],...Ku(t)]:[];d.forEach(g=>{a&&g.addEventListener("scroll",n,{passive:!0}),i&&g.addEventListener("resize",n)});const f=u&&o?k5(u,n):null;let p=-1,h=null;s&&(h=new ResizeObserver(g=>{let[v]=g;v&&v.target===u&&h&&(h.unobserve(t),cancelAnimationFrame(p),p=requestAnimationFrame(()=>{var x;(x=h)==null||x.observe(t)})),n()}),u&&!l&&h.observe(u),h.observe(t));let y,m=l?ho(e):null;l&&b();function b(){const g=ho(e);m&&!PT(m,g)&&n(),m=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 C5=YL,N5=XL,j5=ZL,T5=JL,A5=GL,C_=KL,R5=WL,$5=(e,t,n)=>{const r=new Map,a={platform:_5,...n},i={...a.platform,_c:r};return VL(e,t,{...a,platform:i})};var O5=typeof document<"u",M5=function(){},Yf=O5?w.useLayoutEffect:M5;function Yh(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(!Yh(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)&&!Yh(e[i],t[i]))return!1}return!0}return e!==e&&t!==t}function DT(e){return typeof window>"u"?1:(e.ownerDocument.defaultView||window).devicePixelRatio||1}function N_(e,t){const n=DT(e);return Math.round(t*n)/n}function Eg(e){const t=w.useRef(e);return Yf(()=>{t.current=e}),t}function P5(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]=w.useState({x:0,y:0,strategy:n,placement:t,middlewareData:{},isPositioned:!1}),[p,h]=w.useState(r);Yh(p,r)||h(r);const[y,m]=w.useState(null),[b,g]=w.useState(null),v=w.useCallback(F=>{F!==C.current&&(C.current=F,m(F))},[]),x=w.useCallback(F=>{F!==N.current&&(N.current=F,g(F))},[]),S=i||y,k=s||b,C=w.useRef(null),N=w.useRef(null),P=w.useRef(d),R=l!=null,$=Eg(l),j=Eg(a),O=Eg(u),z=w.useCallback(()=>{if(!C.current||!N.current)return;const F={placement:t,strategy:n,middleware:p};j.current&&(F.platform=j.current),$5(C.current,N.current,F).then(J=>{const T={...J,isPositioned:O.current!==!1};D.current&&!Yh(P.current,T)&&(P.current=T,wo.flushSync(()=>{f(T)}))})},[p,t,n,j,O]);Yf(()=>{u===!1&&P.current.isPositioned&&(P.current.isPositioned=!1,f(F=>({...F,isPositioned:!1})))},[u]);const D=w.useRef(!1);Yf(()=>(D.current=!0,()=>{D.current=!1}),[]),Yf(()=>{if(S&&(C.current=S),k&&(N.current=k),S&&k){if($.current)return $.current(S,k,z);z()}},[S,k,z,$,R]);const A=w.useMemo(()=>({reference:C,floating:N,setReference:v,setFloating:x}),[v,x]),B=w.useMemo(()=>({reference:S,floating:k}),[S,k]),Z=w.useMemo(()=>{const F={position:n,left:0,top:0};if(!B.floating)return F;const J=N_(B.floating,d.x),T=N_(B.floating,d.y);return o?{...F,transform:"translate("+J+"px, "+T+"px)",...DT(B.floating)>=1.5&&{willChange:"transform"}}:{position:n,left:J,top:T}},[n,o,B.floating,d.x,d.y]);return w.useMemo(()=>({...d,update:z,refs:A,elements:B,floatingStyles:Z}),[d,z,A,B,Z])}const D5=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?C_({element:r.current,padding:a}).fn(n):{}:r?C_({element:r,padding:a}).fn(n):{}}}},z5=(e,t)=>({...C5(e),options:[e,t]}),I5=(e,t)=>({...N5(e),options:[e,t]}),L5=(e,t)=>({...R5(e),options:[e,t]}),U5=(e,t)=>({...j5(e),options:[e,t]}),F5=(e,t)=>({...T5(e),options:[e,t]}),q5=(e,t)=>({...A5(e),options:[e,t]}),H5=(e,t)=>({...D5(e),options:[e,t]});var B5="Arrow",zT=w.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"})})});zT.displayName=B5;var V5=zT;function K5(e){const[t,n]=w.useState(void 0);return wn(()=>{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 nx="Popper",[IT,vc]=fi(nx),[Z5,LT]=IT(nx),UT=e=>{const{__scopePopper:t,children:n}=e,[r,a]=w.useState(null);return c.jsx(Z5,{scope:t,anchor:r,onAnchorChange:a,children:n})};UT.displayName=nx;var FT="PopperAnchor",qT=w.forwardRef((e,t)=>{const{__scopePopper:n,virtualRef:r,...a}=e,i=LT(FT,n),s=w.useRef(null),o=lt(t,s),l=w.useRef(null);return w.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})});qT.displayName=FT;var rx="PopperContent",[G5,Q5]=IT(rx),HT=w.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:p=!1,updatePositionStrategy:h="optimized",onPlaced:y,...m}=e,b=LT(rx,n),[g,v]=w.useState(null),x=lt(t,X=>v(X)),[S,k]=w.useState(null),C=K5(S),N=(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(X5),altBoundary:O},{refs:D,floatingStyles:A,placement:B,isPositioned:Z,middlewareData:F}=P5({strategy:"fixed",placement:R,whileElementsMounted:(...X)=>E5(...X,{animationFrame:h==="always"}),elements:{reference:b.anchor},middleware:[z5({mainAxis:a+P,alignmentAxis:s}),l&&I5({mainAxis:!0,crossAxis:!1,limiter:f==="partial"?L5():void 0,...z}),l&&U5({...z}),F5({...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&&H5({element:S,padding:o}),W5({arrowWidth:N,arrowHeight:P}),p&&q5({strategy:"referenceHidden",...z})]}),[J,T]=KT(B),q=Ir(y);wn(()=>{Z&&(q==null||q())},[Z,q]);const G=(Q=F.arrow)==null?void 0:Q.x,_=(W=F.arrow)==null?void 0:W.y,E=((oe=F.arrow)==null?void 0:oe.centerOffset)!==0,[M,I]=w.useState();return wn(()=>{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(G5,{scope:n,placedSide:J,onArrowChange:k,arrowX:G,arrowY:_,shouldHideArrow:E,children:c.jsx(De.div,{"data-side":J,"data-align":T,...m,ref:x,style:{...m.style,animation:Z?void 0:"none"}})})})});HT.displayName=rx;var BT="PopperArrow",Y5={top:"bottom",right:"left",bottom:"top",left:"right"},VT=w.forwardRef(function(t,n){const{__scopePopper:r,...a}=t,i=Q5(BT,r),s=Y5[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(V5,{...a,ref:n,style:{...a.style,display:"block"}})})});VT.displayName=BT;function X5(e){return e!==null}var W5=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]=KT(n),f={start:"0%",center:"50%",end:"100%"}[d],p=(((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="",m="";return u==="bottom"?(y=s?f:`${p}px`,m=`${-l}px`):u==="top"?(y=s?f:`${p}px`,m=`${r.floating.height+l}px`):u==="right"?(y=`${-l}px`,m=s?f:`${h}px`):u==="left"&&(y=`${r.floating.width+l}px`,m=s?f:`${h}px`),{data:{x:y,y:m}}}});function KT(e){const[t,n="center"]=e.split("-");return[t,n]}var ZT=UT,tm=qT,ax=HT,ix=VT,[nm,Qae]=fi("Tooltip",[vc]),sx=vc(),GT="TooltipProvider",J5=700,j_="tooltip.open",[eU,QT]=nm(GT),YT=e=>{const{__scopeTooltip:t,delayDuration:n=J5,skipDelayDuration:r=300,disableHoverableContent:a=!1,children:i}=e,s=w.useRef(!0),o=w.useRef(!1),l=w.useRef(0);return w.useEffect(()=>{const u=l.current;return()=>window.clearTimeout(u)},[]),c.jsx(eU,{scope:t,isOpenDelayedRef:s,delayDuration:n,onOpen:w.useCallback(()=>{window.clearTimeout(l.current),s.current=!1},[]),onClose:w.useCallback(()=>{window.clearTimeout(l.current),l.current=window.setTimeout(()=>s.current=!0,r)},[r]),isPointerInTransitRef:o,onPointerInTransitChange:w.useCallback(u=>{o.current=u},[]),disableHoverableContent:a,children:i})};YT.displayName=GT;var XT="Tooltip",[Yae,rm]=nm(XT),Rv="TooltipTrigger",tU=w.forwardRef((e,t)=>{const{__scopeTooltip:n,...r}=e,a=rm(Rv,n),i=QT(Rv,n),s=sx(n),o=w.useRef(null),l=lt(t,o,a.onTriggerChange),u=w.useRef(!1),d=w.useRef(!1),f=w.useCallback(()=>u.current=!1,[]);return w.useEffect(()=>()=>document.removeEventListener("pointerup",f),[f]),c.jsx(tm,{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,p=>{p.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)})})});tU.displayName=Rv;var nU="TooltipPortal",[Xae,rU]=nm(nU,{forceMount:void 0}),Xl="TooltipContent",WT=w.forwardRef((e,t)=>{const n=rU(Xl,e.__scopeTooltip),{forceMount:r=n.forceMount,side:a="top",...i}=e,s=rm(Xl,e.__scopeTooltip);return c.jsx(hi,{present:r||s.open,children:s.disableHoverableContent?c.jsx(JT,{side:a,...i,ref:t}):c.jsx(aU,{side:a,...i,ref:t})})}),aU=w.forwardRef((e,t)=>{const n=rm(Xl,e.__scopeTooltip),r=QT(Xl,e.__scopeTooltip),a=w.useRef(null),i=lt(t,a),[s,o]=w.useState(null),{trigger:l,onClose:u}=n,d=a.current,{onPointerInTransitChange:f}=r,p=w.useCallback(()=>{o(null),f(!1)},[f]),h=w.useCallback((y,m)=>{const b=y.currentTarget,g={x:y.clientX,y:y.clientY},v=cU(g,b.getBoundingClientRect()),x=uU(g,v),S=dU(m.getBoundingClientRect()),k=hU([...x,...S]);o(k),f(!0)},[f]);return w.useEffect(()=>()=>p(),[p]),w.useEffect(()=>{if(l&&d){const y=b=>h(b,d),m=b=>h(b,l);return l.addEventListener("pointerleave",y),d.addEventListener("pointerleave",m),()=>{l.removeEventListener("pointerleave",y),d.removeEventListener("pointerleave",m)}}},[l,d,h,p]),w.useEffect(()=>{if(s){const y=m=>{const b=m.target,g={x:m.clientX,y:m.clientY},v=(l==null?void 0:l.contains(b))||(d==null?void 0:d.contains(b)),x=!fU(g,s);v?p():x&&(p(),u())};return document.addEventListener("pointermove",y),()=>document.removeEventListener("pointermove",y)}},[l,d,s,u,p]),c.jsx(JT,{...e,ref:i})}),[iU,sU]=nm(XT,{isInside:!1}),oU=Z3("TooltipContent"),JT=w.forwardRef((e,t)=>{const{__scopeTooltip:n,children:r,"aria-label":a,onEscapeKeyDown:i,onPointerDownOutside:s,...o}=e,l=rm(Xl,n),u=sx(n),{onClose:d}=l;return w.useEffect(()=>(document.addEventListener(j_,d),()=>document.removeEventListener(j_,d)),[d]),w.useEffect(()=>{if(l.trigger){const f=p=>{const h=p.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(ax,{"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(oU,{children:r}),c.jsx(iU,{scope:n,isInside:!0,children:c.jsx(mI,{id:l.contentId,role:"tooltip",children:a||r})})]})})});WT.displayName=Xl;var eA="TooltipArrow",lU=w.forwardRef((e,t)=>{const{__scopeTooltip:n,...r}=e,a=sx(n);return sU(eA,n).isInside?null:c.jsx(ix,{...a,...r,ref:t})});lU.displayName=eA;function cU(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 uU(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 dU(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 fU(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,p=l.y;d>r!=p>r&&n<(f-u)*(r-d)/(p-d)+u&&(a=!a)}return a}function hU(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),pU(t)}function pU(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 mU=YT,tA=WT;const gU=mU,yU=w.forwardRef(({className:e,sideOffset:t=4,...n},r)=>c.jsx(tA,{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}));yU.displayName=tA.displayName;const vU={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 bU(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))}:vU}const Mn="#92E4DD",Gn="#F9386D",Zr="#FFFFFF",ha="bg-gradient-to-b from-gray-900 via-gray-800 to-gray-900";function oa(e){return Mn}function pa(e){return{borderColor:e,color:e,boxShadow:`0 0 20px ${e}20`}}const xU=Qp("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=w.forwardRef(({className:e,variant:t,size:n,asChild:r=!1,...a},i)=>{const s=r?V3:"button";return c.jsx(s,{className:Te(xU({variant:t,size:n,className:e})),ref:i,...a})});le.displayName="Button";function bl({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(Ar,{className:"h-2.5 w-2.5 shrink-0"}),c.jsx("span",{className:"max-w-[72px] truncate",children:t.message})]})}const T_="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 wU(e){return e.iconUrl?e.iconUrl:null}function nA({service:e}){const t=oa(),n=wU(e),[r,a]=w.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(${T_}) no-repeat center / contain`,mask:`url(${T_}) no-repeat center / contain`},"aria-hidden":!0})}function ox(e){return e?"ring-2 ring-inset ring-yellow-400/90 shadow-[0_0_10px_rgba(250,204,21,0.2)]":""}function lx(){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 SU({service:e,onDragStart:t,onDragEnd:n,isInActiveDeck:r,onCardClick:a,isInCollection:i=!1,onMouseEnter:s,onMouseLeave:o,activeDeck:l,warnings:u}){const d=ln(),{toast:f}=tn(),p=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"})}}),m=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
|
+
${ox(r)}
|
|
278
|
+
${i?"hover:scale-110 hover:rotate-0":"hover:scale-105"}
|
|
279
|
+
`,style:{borderColor:p,boxShadow:`0 0 20px ${p}20`},children:[c.jsx(bl,{warnings:u}),r&&c.jsx(lx,{}),c.jsx("div",{className:"absolute top-1 left-1 text-xs font-bold",children:c.jsx("div",{className:"leading-none",style:{color:p},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:p},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(xd,{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:p},children:c.jsx(nA,{service:e})}),c.jsx("h3",{className:"font-bold text-xs mb-1 line-clamp-2","data-testid":`text-service-name-${e.id}`,style:{color:p},children:e.name}),c.jsx("div",{className:"text-[8px] px-1 py-0.5 rounded border opacity-70",style:{color:p,borderColor:p},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:p,borderColor:p},onClick:m,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 _U=w.memo(SU);function kU(e){return e.iconUrl?e.iconUrl:null}function rA({credential:e,color:t}){const n=kU(e);return n?c.jsx("img",{src:n,alt:"",className:"h-7 w-7 object-contain rounded-sm",draggable:!1}):c.jsx(Cv,{className:"h-7 w-7",strokeWidth:2.25,style:{color:t}})}function EU({credential:e,isInActiveDeck:t,activeDeck:n,isInCollection:r=!0,onDragStart:a,onDragEnd:i,onMouseEnter:s,onMouseLeave:o,onCardClick:l,warnings:u}){const d=ln(),{toast:f}=tn(),p=Gn,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:m=>{f({title:"Failed to add to deck",description:m.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:m=>{f({title:"Failed to remove API key",description:m.message,variant:"destructive"})}});return c.jsx("div",{className:"relative group cursor-pointer",draggable:!t&&!!a,onDragStart:a?m=>a(m,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
|
+
${ox(t)}
|
|
285
|
+
${r?"hover:scale-110 hover:rotate-0":"hover:scale-105"}
|
|
286
|
+
`,style:{borderColor:p,boxShadow:`0 0 20px ${p}20`},children:[c.jsx(bl,{warnings:u}),t&&c.jsx(lx,{}),c.jsx("div",{className:"absolute top-1 left-1 text-xs font-bold",children:c.jsx("div",{className:"leading-none",style:{color:p},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:p},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:m=>{m.stopPropagation(),window.confirm(`Remove ${e.label} from your vault?`)&&y.mutate()},title:`Remove ${e.label}`,children:c.jsx(xd,{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:p},children:c.jsx(rA,{credential:e,color:p})}),c.jsx("h3",{className:"font-bold text-xs mb-1 line-clamp-2","data-testid":`text-credential-name-${e.id}`,style:{color:p},children:e.label}),c.jsx("div",{className:"text-[8px] px-1 py-0.5 rounded border opacity-70",style:{color:p,borderColor:p},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:p,borderColor:p},onClick:m=>{m.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 CU=w.memo(EU);function NU({playbook:e,isInActiveDeck:t,activeDeck:n,isInCollection:r=!0,onDragStart:a,onDragEnd:i,onMouseEnter:s,onMouseLeave:o,onCardClick:l,warnings:u}){const d=ln(),{toast:f}=tn(),p=Zr,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"})}}),m=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
|
+
${ox(t)}
|
|
292
|
+
${r?"hover:scale-110 hover:rotate-0":"hover:scale-105"}
|
|
293
|
+
`,style:{borderColor:p,boxShadow:`0 0 20px ${p}20`},children:[c.jsx(bl,{warnings:u}),t&&c.jsx(lx,{}),c.jsx("div",{className:"absolute top-1 left-1 text-xs font-bold",children:c.jsx("div",{className:"leading-none",style:{color:p},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:p},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}"?`)&&m.mutate()},title:`Delete ${e.title}`,children:c.jsx(xd,{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:p},children:c.jsx(Kb,{className:"h-7 w-7",strokeWidth:2.25})}),c.jsx("h3",{className:"font-bold text-xs mb-1 line-clamp-2",style:{color:p},children:e.title}),c.jsxs("div",{className:"text-[8px] px-1 py-0.5 rounded border opacity-70",style:{color:p,borderColor:p},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:p,borderColor:p},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 jU=w.memo(NU),Zu=128,aA=192,Wl=48,TU=10,Xh=12,cf=64,uf=4,A_=14,iA=12,sA=1.08;function AU(e=iA,t=sA){const n=e*Math.PI/180,r=Zu*Math.sin(n)+aA*Math.cos(n);return Math.ceil(r*t)+8}const $v=AU();function oA(e,t=Wl){return e===0?0:Zu+Math.max(0,e-1)*(Zu-t)}function RU(e=TU,t=Wl,n=Xh){return oA(e,t)+2*n}function $U(e,t=Wl){return oA(e,t)+2*Xh}const OU=RU();function MU(e,t,n,r=iA){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 PU(e){return{flexShrink:0,marginLeft:e===0?0:`-${Wl}px`}}function DU(e,t,n){return n===e?999999:t-e}function zU({cardCount:e,children:t}){const n=w.useRef(null),r=w.useRef([]),a=w.useRef(0),i=w.useRef(void 0),[s,o]=w.useState(!1),[l,u]=w.useState(!1),[d,f]=w.useState(!1),[p,h]=w.useState(!1),[y,m]=w.useState(!1),b=w.useRef(!1),g=w.useRef(!1),[v,x]=w.useState(null),S=w.useRef(null);S.current=v;const k=w.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:MU(Z,O.left,O.width),J=z===A?sA:1;D.style.transform=`rotate(${F}deg) scale(${J})`,D.style.transformOrigin="center center",D.style.zIndex=String(DU(A,e,z))})},[e]),C=w.useCallback(j=>{const O=n.current;if(!O)return;const z=Zu-Wl;O.scrollBy({left:j==="left"?-z:z,behavior:"smooth"})},[]),N=w.useCallback(()=>{const j=n.current;if(!j)return;const z=$U(e,Wl)>j.clientWidth+2;o(z),u(z&&j.scrollLeft>4),f(z&&j.scrollLeft+j.clientWidth<j.scrollWidth-4),k()},[e,k]);w.useLayoutEffect(()=>{const j=n.current;if(!j)return;N();const O=new ResizeObserver(N);return O.observe(j),j.addEventListener("scroll",N,{passive:!0}),()=>{O.disconnect(),j.removeEventListener("scroll",N)}},[e,N]),w.useEffect(()=>{const j=()=>{const O=n.current,z=a.current;if(O&&z!==0){O.scrollLeft+=z,k();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,m(A)),i.current=requestAnimationFrame(j)};return i.current=requestAnimationFrame(j),()=>{i.current!==void 0&&cancelAnimationFrame(i.current)}},[k]);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<cf&&l){const A=1-D/cf;a.current=-(uf+A*(A_-uf))}else if(D>z.width-cf&&d){const A=1-(z.width-D)/cf;a.current=uf+A*(A_-uf)}else a.current=0;k()},R=()=>{a.current=0,b.current=!1,g.current=!1,h(!1),m(!1)};if(w.useLayoutEffect(()=>{r.current.length=e,k()},[e,v,k]),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",p),"aria-label":"Scroll deck left","data-testid":"deck-scroll-left",onClick:()=>C("left"),children:c.jsx(dT,{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(fT,{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:OU,maxWidth:"100%"},children:c.jsx("div",{className:"flex items-center justify-start isolate group/fan",style:{minHeight:$v,paddingLeft:Xh,paddingRight:Xh},children:w.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:{...PU(O),minHeight:$v},onMouseEnter:()=>x(O),onMouseLeave:()=>x(null),children:j},j&&typeof j=="object"&&"key"in j?j.key:O))})})]})}const at=w.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 IU({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:p}){const[h,y]=w.useState(!1),[m,b]=w.useState(e.name),g=w.useRef(null),v=ln(),{toast:x}=tn();w.useEffect(()=>{b(e.name),y(!1)},[e.id,e.name]),w.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),x({title:"Could not rename deck",description:R.message,variant:"destructive"})}}),k=()=>{const R=m.trim();if(!R||R===e.name){b(e.name),y(!1);return}S.mutate(R)},C=R=>{R.preventDefault(),i(R)},N=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:m,disabled:S.isPending,onChange:R=>b(R.target.value),onBlur:k,onKeyDown:R=>{R.key==="Enter"?(R.preventDefault(),k()):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:N,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:$v},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:Zu,height:aA},"data-testid":"deck-empty-placeholder",children:c.jsx(Fs,{className:"h-8 w-8 text-gray-500"})})}):c.jsxs(zU,{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:Gn,boxShadow:`0 0 20px ${Gn}20`},draggable:!0,onDragStart:j=>o(j,R,!0),onDragEnd:u,onClick:()=>p==null?void 0:p(R),"data-testid":`deck-card-${R.id}`,children:[c.jsx(bl,{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:Gn},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:Gn},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:Gn},children:c.jsx(rA,{credential:R,color:Gn})}),c.jsx("h3",{className:"font-bold text-xs mb-1 line-clamp-2",style:{color:Gn},children:R.label}),c.jsx("div",{className:"text-[8px] px-1 py-0.5 rounded border opacity-70",style:{color:Gn,borderColor:Gn},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:Zr,boxShadow:`0 0 20px ${Zr}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(bl,{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:Zr},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:Zr},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:Zr},children:c.jsx(Kb,{className:"h-7 w-7",strokeWidth:2.25})}),c.jsx("h3",{className:"font-bold text-xs mb-1 line-clamp-2",style:{color:Zr},children:R.title}),c.jsx("div",{className:"text-[8px] px-1 py-0.5 rounded border opacity-70",style:{color:Zr,borderColor:Zr},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(bl,{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(nA,{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 Cg=0;function cx(){w.useEffect(()=>{const e=document.querySelectorAll("[data-radix-focus-guard]");return document.body.insertAdjacentElement("afterbegin",e[0]??R_()),document.body.insertAdjacentElement("beforeend",e[1]??R_()),Cg++,()=>{Cg===1&&document.querySelectorAll("[data-radix-focus-guard]").forEach(t=>t.remove()),Cg--}},[])}function R_(){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 Ng="focusScope.autoFocusOnMount",jg="focusScope.autoFocusOnUnmount",$_={bubbles:!1,cancelable:!0},LU="FocusScope",am=w.forwardRef((e,t)=>{const{loop:n=!1,trapped:r=!1,onMountAutoFocus:a,onUnmountAutoFocus:i,...s}=e,[o,l]=w.useState(null),u=Ir(a),d=Ir(i),f=w.useRef(null),p=lt(t,m=>l(m)),h=w.useRef({paused:!1,pause(){this.paused=!0},resume(){this.paused=!1}}).current;w.useEffect(()=>{if(r){let m=function(x){if(h.paused||!o)return;const S=x.target;o.contains(S)?f.current=S:ki(f.current,{select:!0})},b=function(x){if(h.paused||!o)return;const S=x.relatedTarget;S!==null&&(o.contains(S)||ki(f.current,{select:!0}))},g=function(x){if(document.activeElement===document.body)for(const k of x)k.removedNodes.length>0&&ki(o)};document.addEventListener("focusin",m),document.addEventListener("focusout",b);const v=new MutationObserver(g);return o&&v.observe(o,{childList:!0,subtree:!0}),()=>{document.removeEventListener("focusin",m),document.removeEventListener("focusout",b),v.disconnect()}}},[r,o,h.paused]),w.useEffect(()=>{if(o){M_.add(h);const m=document.activeElement;if(!o.contains(m)){const g=new CustomEvent(Ng,$_);o.addEventListener(Ng,u),o.dispatchEvent(g),g.defaultPrevented||(UU(VU(lA(o)),{select:!0}),document.activeElement===m&&ki(o))}return()=>{o.removeEventListener(Ng,u),setTimeout(()=>{const g=new CustomEvent(jg,$_);o.addEventListener(jg,d),o.dispatchEvent(g),g.defaultPrevented||ki(m??document.body,{select:!0}),o.removeEventListener(jg,d),M_.remove(h)},0)}}},[o,u,d,h]);const y=w.useCallback(m=>{if(!n&&!r||h.paused)return;const b=m.key==="Tab"&&!m.altKey&&!m.ctrlKey&&!m.metaKey,g=document.activeElement;if(b&&g){const v=m.currentTarget,[x,S]=FU(v);x&&S?!m.shiftKey&&g===S?(m.preventDefault(),n&&ki(x,{select:!0})):m.shiftKey&&g===x&&(m.preventDefault(),n&&ki(S,{select:!0})):g===v&&m.preventDefault()}},[n,r,h.paused]);return c.jsx(De.div,{tabIndex:-1,...s,ref:p,onKeyDown:y})});am.displayName=LU;function UU(e,{select:t=!1}={}){const n=document.activeElement;for(const r of e)if(ki(r,{select:t}),document.activeElement!==n)return}function FU(e){const t=lA(e),n=O_(t,e),r=O_(t.reverse(),e);return[n,r]}function lA(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 O_(e,t){for(const n of e)if(!qU(n,{upTo:t}))return n}function qU(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 HU(e){return e instanceof HTMLInputElement&&"select"in e}function ki(e,{select:t=!1}={}){if(e&&e.focus){const n=document.activeElement;e.focus({preventScroll:!0}),e!==n&&HU(e)&&t&&e.select()}}var M_=BU();function BU(){let e=[];return{add(t){const n=e[0];t!==n&&(n==null||n.pause()),e=P_(e,t),e.unshift(t)},remove(t){var n;e=P_(e,t),(n=e[0])==null||n.resume()}}}function P_(e,t){const n=[...e],r=n.indexOf(t);return r!==-1&&n.splice(r,1),n}function VU(e){return e.filter(t=>t.tagName!=="A")}var KU=function(e){if(typeof document>"u")return null;var t=Array.isArray(e)?e[0]:e;return t.ownerDocument.body},$o=new WeakMap,df=new WeakMap,ff={},Tg=0,cA=function(e){return e&&(e.host||cA(e.parentNode))},ZU=function(e,t){return t.map(function(n){if(e.contains(n))return n;var r=cA(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})},GU=function(e,t,n,r){var a=ZU(t,Array.isArray(e)?e:[e]);ff[n]||(ff[n]=new WeakMap);var i=ff[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(p){if(o.has(p))d(p);else try{var h=p.getAttribute(r),y=h!==null&&h!=="false",m=($o.get(p)||0)+1,b=(i.get(p)||0)+1;$o.set(p,m),i.set(p,b),s.push(p),m===1&&y&&df.set(p,!0),b===1&&p.setAttribute(n,"true"),y||p.setAttribute(r,"true")}catch(g){console.error("aria-hidden: cannot operate on ",p,g)}})};return d(t),o.clear(),Tg++,function(){s.forEach(function(f){var p=$o.get(f)-1,h=i.get(f)-1;$o.set(f,p),i.set(f,h),p||(df.has(f)||f.removeAttribute(r),df.delete(f)),h||f.removeAttribute(n)}),Tg--,Tg||($o=new WeakMap,$o=new WeakMap,df=new WeakMap,ff={})}},ux=function(e,t,n){n===void 0&&(n="data-aria-hidden");var r=Array.from(Array.isArray(e)?e:[e]),a=KU(e);return a?(r.push.apply(r,Array.from(a.querySelectorAll("[aria-live], script"))),GU(r,a,n,"aria-hidden")):function(){return null}},ma=function(){return ma=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},ma.apply(this,arguments)};function uA(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 QU(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 Xf="right-scroll-bar-position",Wf="width-before-scroll-bar",YU="with-scroll-bars-hidden",XU="--removed-body-scroll-bar-size";function Ag(e,t){return typeof e=="function"?e(t):e&&(e.current=t),e}function WU(e,t){var n=w.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 JU=typeof window<"u"?w.useLayoutEffect:w.useEffect,D_=new WeakMap;function e6(e,t){var n=WU(null,function(r){return e.forEach(function(a){return Ag(a,r)})});return JU(function(){var r=D_.get(n);if(r){var a=new Set(r),i=new Set(e),s=n.current;a.forEach(function(o){i.has(o)||Ag(o,null)}),i.forEach(function(o){a.has(o)||Ag(o,s)})}D_.set(n,e)},[e]),n}function t6(e){return e}function n6(e,t){t===void 0&&(t=t6);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 r6(e){e===void 0&&(e={});var t=n6(null);return t.options=ma({async:!0,ssr:!1},e),t}var dA=function(e){var t=e.sideCar,n=uA(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 w.createElement(r,ma({},n))};dA.isSideCarExport=!0;function a6(e,t){return e.useMedium(t),dA}var fA=r6(),Rg=function(){},im=w.forwardRef(function(e,t){var n=w.useRef(null),r=w.useState({onScrollCapture:Rg,onWheelCapture:Rg,onTouchMoveCapture:Rg}),a=r[0],i=r[1],s=e.forwardProps,o=e.children,l=e.className,u=e.removeScrollBar,d=e.enabled,f=e.shards,p=e.sideCar,h=e.noRelative,y=e.noIsolation,m=e.inert,b=e.allowPinchZoom,g=e.as,v=g===void 0?"div":g,x=e.gapMode,S=uA(e,["forwardProps","children","className","removeScrollBar","enabled","shards","sideCar","noRelative","noIsolation","inert","allowPinchZoom","as","gapMode"]),k=p,C=e6([n,t]),N=ma(ma({},S),a);return w.createElement(w.Fragment,null,d&&w.createElement(k,{sideCar:fA,removeScrollBar:u,shards:f,noRelative:h,noIsolation:y,inert:m,setCallbacks:i,allowPinchZoom:!!b,lockRef:n,gapMode:x}),s?w.cloneElement(w.Children.only(o),ma(ma({},N),{ref:C})):w.createElement(v,ma({},N,{className:l,ref:C}),o))});im.defaultProps={enabled:!0,removeScrollBar:!0,inert:!1};im.classNames={fullWidth:Wf,zeroRight:Xf};var i6=function(){if(typeof __webpack_nonce__<"u")return __webpack_nonce__};function s6(){if(!document)return null;var e=document.createElement("style");e.type="text/css";var t=i6();return t&&e.setAttribute("nonce",t),e}function o6(e,t){e.styleSheet?e.styleSheet.cssText=t:e.appendChild(document.createTextNode(t))}function l6(e){var t=document.head||document.getElementsByTagName("head")[0];t.appendChild(e)}var c6=function(){var e=0,t=null;return{add:function(n){e==0&&(t=s6())&&(o6(t,n),l6(t)),e++},remove:function(){e--,!e&&t&&(t.parentNode&&t.parentNode.removeChild(t),t=null)}}},u6=function(){var e=c6();return function(t,n){w.useEffect(function(){return e.add(t),function(){e.remove()}},[t&&n])}},hA=function(){var e=u6(),t=function(n){var r=n.styles,a=n.dynamic;return e(r,a),null};return t},d6={left:0,top:0,right:0,gap:0},$g=function(e){return parseInt(e||"",10)||0},f6=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[$g(n),$g(r),$g(a)]},h6=function(e){if(e===void 0&&(e="margin"),typeof window>"u")return d6;var t=f6(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])}},p6=hA(),xl="data-scroll-locked",m6=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(YU,` {
|
|
295
|
+
overflow: hidden `).concat(r,`;
|
|
296
|
+
padding-right: `).concat(o,"px ").concat(r,`;
|
|
297
|
+
}
|
|
298
|
+
body[`).concat(xl,`] {
|
|
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(Xf,` {
|
|
312
|
+
right: `).concat(o,"px ").concat(r,`;
|
|
313
|
+
}
|
|
314
|
+
|
|
315
|
+
.`).concat(Wf,` {
|
|
316
|
+
margin-right: `).concat(o,"px ").concat(r,`;
|
|
317
|
+
}
|
|
318
|
+
|
|
319
|
+
.`).concat(Xf," .").concat(Xf,` {
|
|
320
|
+
right: 0 `).concat(r,`;
|
|
321
|
+
}
|
|
322
|
+
|
|
323
|
+
.`).concat(Wf," .").concat(Wf,` {
|
|
324
|
+
margin-right: 0 `).concat(r,`;
|
|
325
|
+
}
|
|
326
|
+
|
|
327
|
+
body[`).concat(xl,`] {
|
|
328
|
+
`).concat(XU,": ").concat(o,`px;
|
|
329
|
+
}
|
|
330
|
+
`)},z_=function(){var e=parseInt(document.body.getAttribute(xl)||"0",10);return isFinite(e)?e:0},g6=function(){w.useEffect(function(){return document.body.setAttribute(xl,(z_()+1).toString()),function(){var e=z_()-1;e<=0?document.body.removeAttribute(xl):document.body.setAttribute(xl,e.toString())}},[])},y6=function(e){var t=e.noRelative,n=e.noImportant,r=e.gapMode,a=r===void 0?"margin":r;g6();var i=w.useMemo(function(){return h6(a)},[a]);return w.createElement(p6,{styles:m6(i,!t,a,n?"":"!important")})},Ov=!1;if(typeof window<"u")try{var hf=Object.defineProperty({},"passive",{get:function(){return Ov=!0,!0}});window.addEventListener("test",hf,hf),window.removeEventListener("test",hf,hf)}catch{Ov=!1}var Oo=Ov?{passive:!1}:!1,v6=function(e){return e.tagName==="TEXTAREA"},pA=function(e,t){if(!(e instanceof Element))return!1;var n=window.getComputedStyle(e);return n[t]!=="hidden"&&!(n.overflowY===n.overflowX&&!v6(e)&&n[t]==="visible")},b6=function(e){return pA(e,"overflowY")},x6=function(e){return pA(e,"overflowX")},I_=function(e,t){var n=t.ownerDocument,r=t;do{typeof ShadowRoot<"u"&&r instanceof ShadowRoot&&(r=r.host);var a=mA(e,r);if(a){var i=gA(e,r),s=i[1],o=i[2];if(s>o)return!0}r=r.parentNode}while(r&&r!==n.body);return!1},w6=function(e){var t=e.scrollTop,n=e.scrollHeight,r=e.clientHeight;return[t,n,r]},S6=function(e){var t=e.scrollLeft,n=e.scrollWidth,r=e.clientWidth;return[t,n,r]},mA=function(e,t){return e==="v"?b6(t):x6(t)},gA=function(e,t){return e==="v"?w6(t):S6(t)},_6=function(e,t){return e==="h"&&t==="rtl"?-1:1},k6=function(e,t,n,r,a){var i=_6(e,window.getComputedStyle(t).direction),s=i*r,o=n.target,l=t.contains(o),u=!1,d=s>0,f=0,p=0;do{if(!o)break;var h=gA(e,o),y=h[0],m=h[1],b=h[2],g=m-b-i*y;(y||g)&&mA(e,o)&&(f+=g,p+=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(p)<1)&&(u=!0),u},pf=function(e){return"changedTouches"in e?[e.changedTouches[0].clientX,e.changedTouches[0].clientY]:[0,0]},L_=function(e){return[e.deltaX,e.deltaY]},U_=function(e){return e&&"current"in e?e.current:e},E6=function(e,t){return e[0]===t[0]&&e[1]===t[1]},C6=function(e){return`
|
|
331
|
+
.block-interactivity-`.concat(e,` {pointer-events: none;}
|
|
332
|
+
.allow-interactivity-`).concat(e,` {pointer-events: all;}
|
|
333
|
+
`)},N6=0,Mo=[];function j6(e){var t=w.useRef([]),n=w.useRef([0,0]),r=w.useRef(),a=w.useState(N6++)[0],i=w.useState(hA)[0],s=w.useRef(e);w.useEffect(function(){s.current=e},[e]),w.useEffect(function(){if(e.inert){document.body.classList.add("block-interactivity-".concat(a));var m=QU([e.lockRef.current],(e.shards||[]).map(U_),!0).filter(Boolean);return m.forEach(function(b){return b.classList.add("allow-interactivity-".concat(a))}),function(){document.body.classList.remove("block-interactivity-".concat(a)),m.forEach(function(b){return b.classList.remove("allow-interactivity-".concat(a))})}}},[e.inert,e.lockRef.current,e.shards]);var o=w.useCallback(function(m,b){if("touches"in m&&m.touches.length===2||m.type==="wheel"&&m.ctrlKey)return!s.current.allowPinchZoom;var g=pf(m),v=n.current,x="deltaX"in m?m.deltaX:v[0]-g[0],S="deltaY"in m?m.deltaY:v[1]-g[1],k,C=m.target,N=Math.abs(x)>Math.abs(S)?"h":"v";if("touches"in m&&N==="h"&&C.type==="range")return!1;var P=I_(N,C);if(!P)return!0;if(P?k=N:(k=N==="v"?"h":"v",P=I_(N,C)),!P)return!1;if(!r.current&&"changedTouches"in m&&(x||S)&&(r.current=k),!k)return!0;var R=r.current||k;return k6(R,b,m,R==="h"?x:S)},[]),l=w.useCallback(function(m){var b=m;if(!(!Mo.length||Mo[Mo.length-1]!==i)){var g="deltaY"in b?L_(b):pf(b),v=t.current.filter(function(k){return k.name===b.type&&(k.target===b.target||b.target===k.shadowParent)&&E6(k.delta,g)})[0];if(v&&v.should){b.cancelable&&b.preventDefault();return}if(!v){var x=(s.current.shards||[]).map(U_).filter(Boolean).filter(function(k){return k.contains(b.target)}),S=x.length>0?o(b,x[0]):!s.current.noIsolation;S&&b.cancelable&&b.preventDefault()}}},[]),u=w.useCallback(function(m,b,g,v){var x={name:m,delta:b,target:g,should:v,shadowParent:T6(g)};t.current.push(x),setTimeout(function(){t.current=t.current.filter(function(S){return S!==x})},1)},[]),d=w.useCallback(function(m){n.current=pf(m),r.current=void 0},[]),f=w.useCallback(function(m){u(m.type,L_(m),m.target,o(m,e.lockRef.current))},[]),p=w.useCallback(function(m){u(m.type,pf(m),m.target,o(m,e.lockRef.current))},[]);w.useEffect(function(){return Mo.push(i),e.setCallbacks({onScrollCapture:f,onWheelCapture:f,onTouchMoveCapture:p}),document.addEventListener("wheel",l,Oo),document.addEventListener("touchmove",l,Oo),document.addEventListener("touchstart",d,Oo),function(){Mo=Mo.filter(function(m){return m!==i}),document.removeEventListener("wheel",l,Oo),document.removeEventListener("touchmove",l,Oo),document.removeEventListener("touchstart",d,Oo)}},[]);var h=e.removeScrollBar,y=e.inert;return w.createElement(w.Fragment,null,y?w.createElement(i,{styles:C6(a)}):null,h?w.createElement(y6,{noRelative:e.noRelative,gapMode:e.gapMode}):null)}function T6(e){for(var t=null;e!==null;)e instanceof ShadowRoot&&(t=e.host,e=e.host),e=e.parentNode;return t}const A6=a6(fA,j6);var sm=w.forwardRef(function(e,t){return w.createElement(im,ma({},e,{ref:t,sideCar:A6}))});sm.classNames=im.classNames;var om="Popover",[yA,Wae]=fi(om,[vc]),Sd=vc(),[R6,ys]=yA(om),vA=e=>{const{__scopePopover:t,children:n,open:r,defaultOpen:a,onOpenChange:i,modal:s=!1}=e,o=Sd(t),l=w.useRef(null),[u,d]=w.useState(!1),[f,p]=fo({prop:r,defaultProp:a??!1,onChange:i,caller:om});return c.jsx(ZT,{...o,children:c.jsx(R6,{scope:t,contentId:ni(),triggerRef:l,open:f,onOpenChange:p,onOpenToggle:w.useCallback(()=>p(h=>!h),[p]),hasCustomAnchor:u,onCustomAnchorAdd:w.useCallback(()=>d(!0),[]),onCustomAnchorRemove:w.useCallback(()=>d(!1),[]),modal:s,children:n})})};vA.displayName=om;var bA="PopoverAnchor",$6=w.forwardRef((e,t)=>{const{__scopePopover:n,...r}=e,a=ys(bA,n),i=Sd(n),{onCustomAnchorAdd:s,onCustomAnchorRemove:o}=a;return w.useEffect(()=>(s(),()=>o()),[s,o]),c.jsx(tm,{...i,...r,ref:t})});$6.displayName=bA;var xA="PopoverTrigger",wA=w.forwardRef((e,t)=>{const{__scopePopover:n,...r}=e,a=ys(xA,n),i=Sd(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":CA(a.open),...r,ref:s,onClick:xe(e.onClick,a.onOpenToggle)});return a.hasCustomAnchor?o:c.jsx(tm,{asChild:!0,...i,children:o})});wA.displayName=xA;var dx="PopoverPortal",[O6,M6]=yA(dx,{forceMount:void 0}),SA=e=>{const{__scopePopover:t,forceMount:n,children:r,container:a}=e,i=ys(dx,t);return c.jsx(O6,{scope:t,forceMount:n,children:c.jsx(hi,{present:n||i.open,children:c.jsx(vd,{asChild:!0,container:a,children:r})})})};SA.displayName=dx;var Jl="PopoverContent",_A=w.forwardRef((e,t)=>{const n=M6(Jl,e.__scopePopover),{forceMount:r=n.forceMount,...a}=e,i=ys(Jl,e.__scopePopover);return c.jsx(hi,{present:r||i.open,children:i.modal?c.jsx(D6,{...a,ref:t}):c.jsx(z6,{...a,ref:t})})});_A.displayName=Jl;var P6=uo("PopoverContent.RemoveScroll"),D6=w.forwardRef((e,t)=>{const n=ys(Jl,e.__scopePopover),r=w.useRef(null),a=lt(t,r),i=w.useRef(!1);return w.useEffect(()=>{const s=r.current;if(s)return ux(s)},[]),c.jsx(sm,{as:P6,allowPinchZoom:!0,children:c.jsx(kA,{...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})})})}),z6=w.forwardRef((e,t)=>{const n=ys(Jl,e.__scopePopover),r=w.useRef(!1),a=w.useRef(!1);return c.jsx(kA,{...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()}})}),kA=w.forwardRef((e,t)=>{const{__scopePopover:n,trapFocus:r,onOpenAutoFocus:a,onCloseAutoFocus:i,disableOutsidePointerEvents:s,onEscapeKeyDown:o,onPointerDownOutside:l,onFocusOutside:u,onInteractOutside:d,...f}=e,p=ys(Jl,n),h=Sd(n);return cx(),c.jsx(am,{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:()=>p.onOpenChange(!1),children:c.jsx(ax,{"data-state":CA(p.open),role:"dialog",id:p.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)"}})})})}),EA="PopoverClose",I6=w.forwardRef((e,t)=>{const{__scopePopover:n,...r}=e,a=ys(EA,n);return c.jsx(De.button,{type:"button",...r,ref:t,onClick:xe(e.onClick,()=>a.onOpenChange(!1))})});I6.displayName=EA;var L6="PopoverArrow",U6=w.forwardRef((e,t)=>{const{__scopePopover:n,...r}=e,a=Sd(n);return c.jsx(ix,{...a,...r,ref:t})});U6.displayName=L6;function CA(e){return e?"open":"closed"}var F6=vA,q6=wA,H6=SA,NA=_A;const B6=F6,V6=q6,jA=w.forwardRef(({className:e,align:t="center",sideOffset:n=4,...r},a)=>c.jsx(H6,{children:c.jsx(NA,{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})}));jA.displayName=NA.displayName;function K6(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 TA(e,t=24){return e.length>t?`${e.slice(0,t-1)}…`:e}function Z6(e){const t=e.replace(/\/+$/,""),n=t.lastIndexOf("/");return n>=0?t.slice(n+1):t}function G6(e){const t=new Map;for(const n of e)t.set(n.deckId,(t.get(n.deckId)??0)+1);return t}function Q6(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 Y6(e){return e==="agent-admin"?"admin":e==="normal"?"normal":"unknown"}function X6(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 W6(e){const t=new Map,n=[],r=new Map;for(const i of e){if(i.workspaceRoot){const s=i.workspaceRoot,o=`${Z6(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=`◆ ${TA(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 J6(e,t){const{isWorkspaceGroup:n,highlighted:r,clientMeta:a}=t;return!e.workspaceRoot&&n?`no folder · ${a}`:n&&r?a:n?`${TA(e.deckName)} · ${a}`:a}const e9="w-[min(22rem,calc(100vw-2rem))]";function t9({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=w.useMemo(()=>W6(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:Mn},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(KI,{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 p=f.clientName??"agent",h=K6(f.lastActivityAt,t),y=h?`${p} · ${h}`:p,m=n===f.deckId,b=J6(f,{isWorkspaceGroup:u,highlighted:m,clientMeta:y});return c.jsxs("li",{className:Te("rounded-md border-l-2 py-1.5 pl-2 pr-2 font-mono text-xs",m?"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:Mn},children:["⌘",f.badge]}),c.jsx("span",{className:Te("rounded px-1.5 py-0.5 font-sans text-[10px] uppercase tracking-wide",X6(f.mode)),children:Y6(f.mode)})]}),c.jsx("span",{className:"mt-0.5 block font-sans text-[10px] text-gray-400",children:b})]},f.badge)})})]},o))})]})}function n9({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(B6,{children:[c.jsx(V6,{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(VI,{className:"mr-1 h-3 w-3",style:{color:Mn},"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(jA,{align:"end",className:Te(e9,"border-white/10 bg-gray-950/95 p-0 text-gray-100"),"data-testid":"live-session-badges-panel",children:c.jsx(t9,{bindings:n,highlightDeckId:e})})]})}var lm="Dialog",[AA,Jae]=fi(lm),[r9,ra]=AA(lm),RA=e=>{const{__scopeDialog:t,children:n,open:r,defaultOpen:a,onOpenChange:i,modal:s=!0}=e,o=w.useRef(null),l=w.useRef(null),[u,d]=fo({prop:r,defaultProp:a??!1,onChange:i,caller:lm});return c.jsx(r9,{scope:t,triggerRef:o,contentRef:l,contentId:ni(),titleId:ni(),descriptionId:ni(),open:u,onOpenChange:d,onOpenToggle:w.useCallback(()=>d(f=>!f),[d]),modal:s,children:n})};RA.displayName=lm;var $A="DialogTrigger",a9=w.forwardRef((e,t)=>{const{__scopeDialog:n,...r}=e,a=ra($A,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)})});a9.displayName=$A;var fx="DialogPortal",[i9,OA]=AA(fx,{forceMount:void 0}),MA=e=>{const{__scopeDialog:t,forceMount:n,children:r,container:a}=e,i=ra(fx,t);return c.jsx(i9,{scope:t,forceMount:n,children:w.Children.map(r,s=>c.jsx(hi,{present:n||i.open,children:c.jsx(vd,{asChild:!0,container:a,children:s})}))})};MA.displayName=fx;var Wh="DialogOverlay",PA=w.forwardRef((e,t)=>{const n=OA(Wh,e.__scopeDialog),{forceMount:r=n.forceMount,...a}=e,i=ra(Wh,e.__scopeDialog);return i.modal?c.jsx(hi,{present:r||i.open,children:c.jsx(o9,{...a,ref:t})}):null});PA.displayName=Wh;var s9=uo("DialogOverlay.RemoveScroll"),o9=w.forwardRef((e,t)=>{const{__scopeDialog:n,...r}=e,a=ra(Wh,n);return c.jsx(sm,{as:s9,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",DA=w.forwardRef((e,t)=>{const n=OA(po,e.__scopeDialog),{forceMount:r=n.forceMount,...a}=e,i=ra(po,e.__scopeDialog);return c.jsx(hi,{present:r||i.open,children:i.modal?c.jsx(l9,{...a,ref:t}):c.jsx(c9,{...a,ref:t})})});DA.displayName=po;var l9=w.forwardRef((e,t)=>{const n=ra(po,e.__scopeDialog),r=w.useRef(null),a=lt(t,n.contentRef,r);return w.useEffect(()=>{const i=r.current;if(i)return ux(i)},[]),c.jsx(zA,{...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())})}),c9=w.forwardRef((e,t)=>{const n=ra(po,e.__scopeDialog),r=w.useRef(!1),a=w.useRef(!1);return c.jsx(zA,{...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()}})}),zA=w.forwardRef((e,t)=>{const{__scopeDialog:n,trapFocus:r,onOpenAutoFocus:a,onCloseAutoFocus:i,...s}=e,o=ra(po,n),l=w.useRef(null),u=lt(t,l);return cx(),c.jsxs(c.Fragment,{children:[c.jsx(am,{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(u9,{titleId:o.titleId}),c.jsx(f9,{contentRef:l,descriptionId:o.descriptionId})]})]})}),hx="DialogTitle",IA=w.forwardRef((e,t)=>{const{__scopeDialog:n,...r}=e,a=ra(hx,n);return c.jsx(De.h2,{id:a.titleId,...r,ref:t})});IA.displayName=hx;var LA="DialogDescription",UA=w.forwardRef((e,t)=>{const{__scopeDialog:n,...r}=e,a=ra(LA,n);return c.jsx(De.p,{id:a.descriptionId,...r,ref:t})});UA.displayName=LA;var FA="DialogClose",qA=w.forwardRef((e,t)=>{const{__scopeDialog:n,...r}=e,a=ra(FA,n);return c.jsx(De.button,{type:"button",...r,ref:t,onClick:xe(e.onClick,()=>a.onOpenChange(!1))})});qA.displayName=FA;function px(e){return e?"open":"closed"}var HA="DialogTitleWarning",[eie,BA]=H3(HA,{contentName:po,titleName:hx,docsSlug:"dialog"}),u9=({titleId:e})=>{const t=BA(HA),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 w.useEffect(()=>{e&&(document.getElementById(e)||console.error(n))},[n,e]),null},d9="DialogDescriptionWarning",f9=({contentRef:e,descriptionId:t})=>{const r=`Warning: Missing \`Description\` or \`aria-describedby={undefined}\` for {${BA(d9).contentName}}.`;return w.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},h9=RA,p9=MA,VA=PA,KA=DA,ZA=IA,GA=UA,m9=qA;const vs=h9,g9=p9,QA=w.forwardRef(({className:e,...t},n)=>c.jsx(VA,{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}));QA.displayName=VA.displayName;const pi=w.forwardRef(({className:e,children:t,...n},r)=>c.jsxs(g9,{children:[c.jsx(QA,{}),c.jsxs(KA,{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(m9,{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(Kh,{className:"h-4 w-4"}),c.jsx("span",{className:"sr-only",children:"Close"})]})]})]}));pi.displayName=KA.displayName;const mi=({className:e,...t})=>c.jsx("div",{className:Te("flex flex-col space-y-1.5 text-center sm:text-left",e),...t});mi.displayName="DialogHeader";const gi=w.forwardRef(({className:e,...t},n)=>c.jsx(ZA,{ref:n,className:Te("text-lg font-semibold leading-none tracking-tight",e),...t}));gi.displayName=ZA.displayName;const No=w.forwardRef(({className:e,...t},n)=>c.jsx(GA,{ref:n,className:Te("text-sm text-muted-foreground",e),...t}));No.displayName=GA.displayName;const Ga=w.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}));Ga.displayName="Textarea";var y9="Label",YA=w.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())}}));YA.displayName=y9;var XA=YA;const v9=Qp("text-sm font-medium leading-none peer-disabled:cursor-not-allowed peer-disabled:opacity-70"),Ge=w.forwardRef(({className:e,...t},n)=>c.jsx(XA,{ref:n,className:Te(v9(),e),...t}));Ge.displayName=XA.displayName;var b9=w.createContext(void 0);function mx(e){const t=w.useContext(b9);return e||t||"ltr"}var Og="rovingFocusGroup.onEntryFocus",x9={bubbles:!1,cancelable:!0},_d="RovingFocusGroup",[Mv,WA,w9]=qb(_d),[S9,JA]=fi(_d,[w9]),[_9,k9]=S9(_d),eR=w.forwardRef((e,t)=>c.jsx(Mv.Provider,{scope:e.__scopeRovingFocusGroup,children:c.jsx(Mv.Slot,{scope:e.__scopeRovingFocusGroup,children:c.jsx(E9,{...e,ref:t})})}));eR.displayName=_d;var E9=w.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,p=w.useRef(null),h=lt(t,p),y=mx(i),[m,b]=fo({prop:s,defaultProp:o??null,onChange:l,caller:_d}),[g,v]=w.useState(!1),x=Ir(u),S=WA(n),k=w.useRef(!1),[C,N]=w.useState(0);return w.useEffect(()=>{const P=p.current;if(P)return P.addEventListener(Og,x),()=>P.removeEventListener(Og,x)},[x]),c.jsx(_9,{scope:n,orientation:r,dir:y,loop:a,currentTabStopId:m,onItemFocus:w.useCallback(P=>b(P),[b]),onItemShiftTab:w.useCallback(()=>v(!0),[]),onFocusableItemAdd:w.useCallback(()=>N(P=>P+1),[]),onFocusableItemRemove:w.useCallback(()=>N(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,()=>{k.current=!0}),onFocus:xe(e.onFocus,P=>{const R=!k.current;if(P.target===P.currentTarget&&R&&!g){const $=new CustomEvent(Og,x9);if(P.currentTarget.dispatchEvent($),!$.defaultPrevented){const j=S().filter(B=>B.focusable),O=j.find(B=>B.active),z=j.find(B=>B.id===m),A=[O,z,...j].filter(Boolean).map(B=>B.ref.current);rR(A,d)}}k.current=!1}),onBlur:xe(e.onBlur,()=>v(!1))})})}),tR="RovingFocusGroupItem",nR=w.forwardRef((e,t)=>{const{__scopeRovingFocusGroup:n,focusable:r=!0,active:a=!1,tabStopId:i,children:s,...o}=e,l=ni(),u=i||l,d=k9(tR,n),f=d.currentTabStopId===u,p=WA(n),{onFocusableItemAdd:h,onFocusableItemRemove:y,currentTabStopId:m}=d;return w.useEffect(()=>{if(r)return h(),()=>y()},[r,h,y]),c.jsx(Mv.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=j9(b,d.orientation,d.dir);if(g!==void 0){if(b.metaKey||b.ctrlKey||b.altKey||b.shiftKey)return;b.preventDefault();let x=p().filter(S=>S.focusable).map(S=>S.ref.current);if(g==="last")x.reverse();else if(g==="prev"||g==="next"){g==="prev"&&x.reverse();const S=x.indexOf(b.currentTarget);x=d.loop?T9(x,S+1):x.slice(S+1)}setTimeout(()=>rR(x))}}),children:typeof s=="function"?s({isCurrentTabStop:f,hasTabStop:m!=null}):s})})});nR.displayName=tR;var C9={ArrowLeft:"prev",ArrowUp:"prev",ArrowRight:"next",ArrowDown:"next",PageUp:"first",Home:"first",PageDown:"last",End:"last"};function N9(e,t){return t!=="rtl"?e:e==="ArrowLeft"?"ArrowRight":e==="ArrowRight"?"ArrowLeft":e}function j9(e,t,n){const r=N9(e.key,n);if(!(t==="vertical"&&["ArrowLeft","ArrowRight"].includes(r))&&!(t==="horizontal"&&["ArrowUp","ArrowDown"].includes(r)))return C9[r]}function rR(e,t=!1){const n=document.activeElement;for(const r of e)if(r===n||(r.focus({preventScroll:t}),document.activeElement!==n))return}function T9(e,t){return e.map((n,r)=>e[(t+r)%e.length])}var A9=eR,R9=nR,cm="Tabs",[$9,tie]=fi(cm,[JA]),aR=JA(),[O9,gx]=$9(cm),iR=w.forwardRef((e,t)=>{const{__scopeTabs:n,value:r,onValueChange:a,defaultValue:i,orientation:s="horizontal",dir:o,activationMode:l="automatic",...u}=e,d=mx(o),[f,p]=fo({prop:r,onChange:a,defaultProp:i??"",caller:cm});return c.jsx(O9,{scope:n,baseId:ni(),value:f,onValueChange:p,orientation:s,dir:d,activationMode:l,children:c.jsx(De.div,{dir:d,"data-orientation":s,...u,ref:t})})});iR.displayName=cm;var sR="TabsList",oR=w.forwardRef((e,t)=>{const{__scopeTabs:n,loop:r=!0,...a}=e,i=gx(sR,n),s=aR(n);return c.jsx(A9,{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})})});oR.displayName=sR;var lR="TabsTrigger",cR=w.forwardRef((e,t)=>{const{__scopeTabs:n,value:r,disabled:a=!1,...i}=e,s=gx(lR,n),o=aR(n),l=fR(s.baseId,r),u=hR(s.baseId,r),d=r===s.value;return c.jsx(R9,{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)})})})});cR.displayName=lR;var uR="TabsContent",dR=w.forwardRef((e,t)=>{const{__scopeTabs:n,value:r,forceMount:a,children:i,...s}=e,o=gx(uR,n),l=fR(o.baseId,r),u=hR(o.baseId,r),d=r===o.value,f=w.useRef(d);return w.useEffect(()=>{const p=requestAnimationFrame(()=>f.current=!1);return()=>cancelAnimationFrame(p)},[]),c.jsx(hi,{present:a||d,children:({present:p})=>c.jsx(De.div,{"data-state":d?"active":"inactive","data-orientation":o.orientation,role:"tabpanel","aria-labelledby":l,hidden:!p,id:u,tabIndex:0,...s,ref:t,style:{...e.style,animationDuration:f.current?"0s":void 0},children:p&&i})})});dR.displayName=uR;function fR(e,t){return`${e}-trigger-${t}`}function hR(e,t){return`${e}-content-${t}`}var M9=iR,pR=oR,mR=cR,gR=dR;const P9=M9,yR=w.forwardRef(({className:e,...t},n)=>c.jsx(pR,{ref:n,className:Te("inline-flex h-10 items-center justify-center rounded-md bg-muted p-1 text-muted-foreground",e),...t}));yR.displayName=pR.displayName;const Pv=w.forwardRef(({className:e,...t},n)=>c.jsx(mR,{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}));Pv.displayName=mR.displayName;const Dv=w.forwardRef(({className:e,...t},n)=>c.jsx(gR,{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}));Dv.displayName=gR.displayName;function yu(e){return typeof e=="object"&&e!==null&&!Array.isArray(e)}function vR(e){return yu(e)&&typeof e.command=="string"}function Mg(e){return!yu(e)||Object.keys(e).length===0?!1:Object.values(e).every(vR)}function D9(e){let t=e.trim();return t.startsWith("```")?t.replace(/^```(?:json)?\s*\n?/i,"").replace(/\n?```\s*$/,"").trim():t}function z9(e){if(!yu(e))throw new Error("Configuration must be a JSON object");if(yu(e.config)&&Mg(e.config.mcpServers))return{mcpServers:e.config.mcpServers};if(Mg(e.mcpServers))return{mcpServers:e.mcpServers};if(yu(e)&&typeof e.command=="string"){const t=typeof e.name=="string"&&e.name.trim()?e.name.trim():"local-server",{name:n,...r}=e;if(!vR(r))throw new Error("Missing or invalid command");return{mcpServers:{[t]:r}}}if(Mg(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 I9(e){let t;try{t=JSON.parse(D9(e))}catch(n){throw new Error(`Failed to parse JSON: ${n instanceof Error?n.message:"Unknown error"}`)}return z9(t)}function L9({type:e,open:t,onOpenChange:n}){const[r,a]=w.useState("remote"),[i,s]=w.useState("json"),[o,l]=w.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]=w.useState(null),[f,p]=w.useState(null),[h,y]=w.useState(null),[m,b]=w.useState({name:"",type:"mcp",url:"http://localhost:8000/mcp",description:"",headers_enabled:!1,headers:{},cardColor:Mn}),[g,v]=w.useState(`{
|
|
356
|
+
|
|
357
|
+
}`),[x,S]=w.useState(null),[k,C]=w.useState({name:"",type:"local-mcp",command:"",args:[""],env:{},description:"",cardColor:Mn}),[N,P]=w.useState({name:"",type:"a2a",manifest_url:"http://localhost:8001/.well-known/a2a/manifest.json",description:"",cardColor:Mn}),R=ln(),{toast:$}=tn(),j=()=>{try{p(null);const E=I9(o),M=Object.entries(E.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:Mn}),O(I)}catch(E){p(E instanceof Error?E.message:"Failed to parse JSON"),d(null)}},O=async E=>{try{const Q=((await ke("GET","/api/services")).data||[]).find(W=>W.name===E);y(Q?E:null)}catch(M){console.error("Failed to check name conflict:",M)}},z=async E=>{await O(E)},D=St({mutationFn:async E=>{if(e==="mcp"&&r==="local"){const M={mcpServers:{[E.name]:{command:E.command,args:E.args.filter(I=>I.trim()!==""),...Object.keys(E.env).length>0&&{env:E.env}}}};return console.log("Importing local MCP server:",M),ke("POST","/api/local-mcp/import",{config:JSON.stringify(M)})}else{const M={name:E.name,type:e,url:e==="mcp"?E.url:E.manifest_url,description:E.description,cardColor:E.cardColor,...E.headers_enabled&&{headers:E.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"?m:k:N).name} has been added to your collection.`}),B()},onError:E=>{var M;console.error("Registration failed:",E),console.error("Error details:",{message:E==null?void 0:E.message,name:E==null?void 0:E.name,stack:E==null?void 0:E.stack,toString:E==null?void 0:E.toString(),constructor:(M=E==null?void 0:E.constructor)==null?void 0:M.name}),$({title:"Registration failed",description:(E==null?void 0:E.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(k.name),h){$({title:"Name Conflict",description:`A service with the name "${k.name}" already exists. Please choose a different name.`,variant:"destructive"});return}D.mutate(k)}}else{const E=e==="mcp"?r==="remote"?m:k:N;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}if(e==="mcp"&&r==="remote"&&m.headers_enabled){const M=J();if(M===null)return;D.mutate({...m,headers:M});return}D.mutate(E)}},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),p(null),y(null),b({name:"",type:"mcp",url:"http://localhost:8000/mcp",description:"",headers_enabled:!1,headers:{},cardColor:Mn}),v(`{
|
|
368
|
+
|
|
369
|
+
}`),S(null),C({name:"",type:"local-mcp",command:"",args:[""],env:{},description:"",cardColor:Mn}),P({name:"",type:"a2a",manifest_url:"http://localhost:8001/.well-known/a2a/manifest.json",description:"",cardColor:Mn}),n(!1)},Z=(E,M)=>{b(I=>({...I,[E]:M}))},F=E=>{Z("headers_enabled",E),E&&g.trim()===`{
|
|
370
|
+
|
|
371
|
+
}`&&v(`{
|
|
372
|
+
"Authorization": "Bearer "
|
|
373
|
+
}`),E||S(null)},J=()=>{const E=g.trim();if(!E||E==="{}")return{};try{const M=JSON.parse(E);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}},T=(E,M)=>{C(I=>({...I,[E]:M}))},q=(E,M)=>{P(I=>({...I,[E]: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 E,M;if(e==="mcp"&&r==="local"){if(i==="json")return!o.trim();if(i==="review")return!k.name.trim()||!k.command.trim()}else{const I=e==="mcp"?r==="remote"?m:k:N;return!I.name.trim()||e==="mcp"&&r==="remote"&&!((E=I.url)!=null&&E.trim())||e==="a2a"&&!((M=I.manifest_url)!=null&&M.trim())}return!1};return c.jsx(vs,{open:t,onOpenChange:n,children:c.jsxs(pi,{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(mi,{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(Vh,{className:"w-6 h-6 mr-3",style:{color:"#92E4DD"}}):c.jsx(II,{className:"w-6 h-6 mr-3",style:{color:"#92E4DD"}}),"Register ",e==="mcp"?"MCP Server":"A2A Agent"]}),c.jsx(No,{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(P9,{value:r,onValueChange:E=>a(E),className:"w-full",children:[c.jsxs(yR,{className:"grid w-full grid-cols-2 bg-white/10 border border-white/20",children:[c.jsxs(Pv,{value:"remote",className:"data-[state=active]:bg-white/20 data-[state=active]:text-white text-gray-400",children:[c.jsx(Vh,{className:"w-4 h-4 mr-2"}),"Remote MCP"]}),c.jsxs(Pv,{value:"local",className:"data-[state=active]:bg-white/20 data-[state=active]:text-white text-gray-400",children:[c.jsx(ZI,{className:"w-4 h-4 mr-2"}),"Local MCP"]})]}),c.jsxs(Dv,{value:"remote",className:"space-y-4 mt-4",children:[c.jsxs("div",{children:[c.jsx(Ge,{htmlFor:"name",className:"text-sm font-semibold",style:{color:"#92E4DD"},children:"Server Name"}),c.jsx(at,{id:"name",placeholder:"e.g., Database Tools",value:m.name,onChange:E=>{Z("name",E.target.value),E.target.value.trim()?z(E.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(Ar,{className:"w-4 h-4"}),c.jsx("span",{children:"A service with this name already exists"})]})]}),c.jsxs("div",{children:[c.jsx(Ge,{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:m.url,onChange:E=>Z("url",E.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(Ge,{htmlFor:"description",className:"text-sm font-semibold",style:{color:"#92E4DD"},children:"Description"}),c.jsx(Ga,{id:"description",placeholder:"Brief description of capabilities...",value:m.description,onChange:E=>Z("description",E.target.value),rows:3,className:"bg-white/10 border-white/20 text-white placeholder-gray-400 resize-none","data-testid":"textarea-description"})]})]}),c.jsxs(Dv,{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(Ge,{htmlFor:"local-json",className:"text-sm font-semibold",style:{color:"#92E4DD"},children:"Local MCP Configuration (JSON)"}),c.jsx(Ga,{id:"local-json",placeholder:`{
|
|
374
|
+
"mcpServers": {
|
|
375
|
+
"memory": {
|
|
376
|
+
"command": "npx",
|
|
377
|
+
"args": ["-y", "@modelcontextprotocol/server-memory"]
|
|
378
|
+
}
|
|
379
|
+
}
|
|
380
|
+
}`,value:o,onChange:E=>l(E.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(Ev,{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(Ge,{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:k.name,onChange:E=>{T("name",E.target.value),E.target.value.trim()?z(E.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(Ar,{className:"w-4 h-4 mr-1"}),'A service with the name "',h,'" already exists.']})]}),c.jsxs("div",{children:[c.jsx(Ge,{htmlFor:"command",className:"text-sm font-semibold",style:{color:"#92E4DD"},children:"Command"}),c.jsx(at,{id:"command",placeholder:"e.g., npx, python, node",value:k.command,onChange:E=>T("command",E.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(Ge,{className:"text-sm font-semibold",style:{color:"#92E4DD"},children:"Arguments"}),k.args.map((E,M)=>c.jsxs("div",{className:"flex gap-2 mb-2",children:[c.jsx(at,{placeholder:`Argument ${M+1}`,value:E,onChange:I=>{const Q=[...k.args];Q[M]=I.target.value,T("args",Q)},className:"bg-white/10 border-white/20 text-white placeholder-gray-400","data-testid":`input-arg-${M}`}),M===k.args.length-1&&c.jsx(le,{type:"button",size:"sm",onClick:()=>T("args",[...k.args,""]),className:"bg-white/20 hover:bg-white/30 text-white",children:c.jsx(Fs,{className:"w-4 h-4"})}),k.args.length>1&&c.jsx(le,{type:"button",size:"sm",variant:"destructive",onClick:()=>{const I=k.args.filter((Q,W)=>W!==M);T("args",I)},className:"bg-red-500/80 hover:bg-red-500 text-white",children:c.jsx(Kh,{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(Ge,{className:"text-sm font-semibold",style:{color:"#92E4DD"},children:"Environment Variables"}),Object.entries(k.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(k.env).map(([E,M],I)=>c.jsxs("div",{className:"flex gap-2",children:[c.jsx(at,{placeholder:"Variable name",value:E,onChange:Q=>{const W={...k.env};delete W[E],W[Q.target.value]=M,T("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={...k.env};W[E]=Q.target.value,T("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={...k.env};delete Q[E],T("env",Q)},className:"bg-red-500/80 hover:bg-red-500 text-white",children:c.jsx(Kh,{className:"w-4 h-4"})})]},I))}),c.jsxs(le,{type:"button",size:"sm",onClick:()=>{const E={...k.env};E[""]="",T("env",E)},className:"mt-2 bg-white/20 hover:bg-white/30 text-white",children:[c.jsx(Fs,{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(Ge,{htmlFor:"local-description",className:"text-sm font-semibold",style:{color:"#92E4DD"},children:"Description"}),c.jsx(Ga,{id:"local-description",placeholder:"Brief description of capabilities...",value:k.description,onChange:E=>T("description",E.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:pa(Mn),onClick:A,disabled:_(),"data-testid":"button-register",children:[c.jsx(Fs,{className:"w-4 h-4 mr-2"}),D.isPending?"Registering...":G()]})]})]}),i==="complete"&&c.jsxs("div",{className:"text-center py-8",children:[c.jsx(Ev,{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(Ge,{htmlFor:"name",className:"text-sm font-semibold",style:{color:"#92E4DD"},children:"Agent Name"}),c.jsx(at,{id:"name",placeholder:"e.g., Code Assistant",value:N.name,onChange:E=>{q("name",E.target.value),E.target.value.trim()?z(E.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(Ar,{className:"w-4 h-4"}),c.jsx("span",{children:"A service with this name already exists"})]})]}),c.jsxs("div",{children:[c.jsx(Ge,{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:N.manifest_url,onChange:E=>q("manifest_url",E.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(Ge,{htmlFor:"description",className:"text-sm font-semibold",style:{color:"#92E4DD"},children:"Description"}),c.jsx(Ga,{id:"description",placeholder:"Brief description of capabilities...",value:N.description,onChange:E=>q("description",E.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:m.headers_enabled,onChange:E=>F(E.target.checked),className:"rounded border-white/20 bg-white/10"}),c.jsx(Ge,{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.)."})}),m.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(Ge,{htmlFor:"headers",className:"text-sm font-semibold",style:{color:"#92E4DD"},children:"HTTP Headers (JSON)"}),c.jsx(Ga,{id:"headers",placeholder:`{
|
|
391
|
+
"Authorization": "Bearer YOUR_TOKEN_HERE",
|
|
392
|
+
"X-API-Key": "YOUR_API_KEY_HERE"
|
|
393
|
+
}`,value:g,onChange:E=>{v(E.target.value),x&&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"}),x&&c.jsxs("p",{className:"text-red-400 text-xs mt-1 flex items-center gap-1",children:[c.jsx(Ar,{className:"w-3 h-3 shrink-0"}),x]}),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(Ar,{className:"w-4 h-4 mr-1"}),f]}),h&&c.jsxs("div",{className:"text-red-400 text-sm mt-2",children:[c.jsx(Ar,{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:pa(Mn),disabled:D.isPending||_(),"data-testid":"button-register",onClick:A,children:[c.jsx(Fs,{className:"w-4 h-4 mr-2"}),D.isPending?"Registering...":"Register Service"]})]})]})})}async function bR(e){return(await(await ke("POST","/api/export",{scope:e.scope??"collection",...e.deckId?{deckId:e.deckId}:{}})).json()).data}async function U9(e){return(await(await ke("POST","/api/import",e)).json()).data}function xR(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 F9(e){return e.trim().toLowerCase().replace(/[^a-z0-9]+/g,"-").replace(/^-+|-+$/g,"").slice(0,48)||"deck"}function F_(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 q9({decks:e,editingDeckId:t,onSelectDeck:n,isLoading:r}){const[a,i]=w.useState(!1),[s,o]=w.useState(""),l=ln(),{toast:u}=tn(),{data:d}=wt({queryKey:["/api/scope/bindings"],refetchInterval:3e3}),f=w.useMemo(()=>G6((d==null?void 0:d.data)??[]),[d]),p=St({mutationFn:async S=>ke("POST","/api/decks",{name:S,isActive:!1}),onSuccess:async(S,k)=>{var N;const C=await S.json();l.invalidateQueries({queryKey:["/api/decks"]}),(N=C.data)!=null&&N.id&&n(C.data.id),u({title:"Deck created",description:`${k} 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 k=await bR({scope:"deck",deckId:S.id});return xR(k,`${F9(S.name)}.agent-deck.json`),k},onSuccess:(S,k)=>{u({title:"Deck exported",description:`${k.name}: ${S.services.length} services, ${S.playbooks.length} playbooks`})},onError:S=>{u({title:"Export failed",description:S.message,variant:"destructive"})}}),y=(S,k)=>{S.stopPropagation(),h.mutate(k)},m=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,k)=>{S.stopPropagation();try{await navigator.clipboard.writeText(k.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,k)=>{S.stopPropagation(),window.confirm("Are you sure you want to delete this deck? This action cannot be undone.")&&m.mutate(k)},v=S=>{S.preventDefault();const k=s.trim();k&&p.mutate(k)},x=S=>{var k,C,N;return(((k=S.services)==null?void 0:k.length)??0)+(((C=S.credentials)==null?void 0:C.length)??0)+(((N=S.playbooks)==null?void 0:N.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,k)=>c.jsx("div",{className:"h-16 bg-white/5 rounded-lg"},k))})]})}):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(Bh,{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(Fs,{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 k=S.id===t,C=x(S),N=f.get(S.id)??0,P=Q6(C,N);return c.jsxs("div",{className:`p-2 rounded-lg border cursor-pointer transition-all relative group ${k?"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(pT,{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(Zb,{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(xd,{className:"w-2 h-2"})})]}),c.jsxs("div",{children:[c.jsx("h3",{className:`font-semibold text-sm pr-16 ${k?"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(vs,{open:a,onOpenChange:i,children:c.jsxs(pi,{className:"sm:max-w-md border-border bg-[#161612] text-[#E8F6F4]",children:[c.jsx(mi,{children:c.jsxs(gi,{className:"flex items-center text-xl font-bold",children:[c.jsx(Bh,{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(Ge,{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:p.isPending,"data-testid":"button-submit-create",children:p.isPending?"Creating…":"Create Deck"})]})]})]})})]})}function H9({open:e,onOpenChange:t}){const[n,r]=w.useState(""),[a,i]=w.useState(""),s=ln(),{toast:o}=tn(),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(vs,{open:e,onOpenChange:t,children:c.jsxs(pi,{className:"sm:max-w-md border-border bg-[#161612] text-[#E8F6F4]",children:[c.jsxs(mi,{children:[c.jsx(gi,{className:"text-[#E8F6F4]",children:"Register API key"}),c.jsx(No,{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(Ge,{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(Ge,{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:pa(Gn),onClick:()=>l.mutate(),disabled:!u||l.isPending,children:"Save to vault"})]})]})})}function B9({open:e,onOpenChange:t}){const[n,r]=w.useState(""),[a,i]=w.useState(""),[s,o]=w.useState(""),[l,u]=w.useState(""),[d,f]=w.useState(""),[p,h]=w.useState([]),[y,m]=w.useState([]),b=ln(),{toast:g}=tn(),{data:v}=wt({queryKey:["/api/credentials/vault"],enabled:e}),{data:x}=wt({queryKey:["/api/services"],enabled:e}),S=(v==null?void 0:v.data)??[],k=(x==null?void 0:x.data)??[],C=St({mutationFn:async()=>ke("POST","/api/playbooks",{title:n.trim(),body:a,triggers:s.split(",").map(R=>R.trim()).filter(Boolean),dependsOnCredentialIds:p,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([]),m([])},onError:R=>{g({title:"Could not save playbook",description:R.message,variant:"destructive"})}}),N=(R,$,j)=>{j(R.includes($)?R.filter(O=>O!==$):[...R,$])},P=n.trim().length>0&&a.trim().length>0;return c.jsx(vs,{open:e,onOpenChange:t,children:c.jsxs(pi,{className:"sm:max-w-2xl max-h-[90vh] overflow-y-auto border-border bg-[#161612] text-[#E8F6F4]",children:[c.jsxs(mi,{children:[c.jsx(gi,{children:"Register Playbook"}),c.jsxs(No,{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(Ge,{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(Ge,{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(Ge,{htmlFor:"playbook-body",children:"Instructions (markdown)"}),c.jsx(Ga,{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(Ge,{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:p.includes(R.id),onChange:()=>N(p,R.id,h)}),R.label]},R.id))})]}),c.jsxs("div",{className:"space-y-2",children:[c.jsx(Ge,{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:k.length===0?c.jsx("p",{className:"text-xs text-gray-500",children:"No MCP services registered yet."}):k.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:()=>N(y,R.id,m)}),R.name]},R.id))})]})]}),c.jsxs("div",{className:"space-y-2",children:[c.jsx(Ge,{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(Ge,{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:pa(Zr),onClick:()=>C.mutate(),disabled:!P||C.isPending,children:"Save to collection"})]})]})})}async function kd(e){const t=await e.json();if(!t.success)throw new Error(t.error??"Request failed");return t.data}function q_(e){return e.length===0?null:e.length<=3?e.join(", "):`${e.slice(0,3).join(", ")} and ${e.length-3} more`}async function zv(e){const t=e?`?status=${encodeURIComponent(e)}`:"",n=await ke("GET",`/api/playbook-patches${t}`);return kd(n)}async function V9(e){const t=await ke("GET",`/api/playbook-patches/${e}/preview`);return kd(t)}async function K9(e){const t=await ke("POST",`/api/playbook-patches/${e}/accept`);return kd(t)}async function Z9(e,t){const n=await ke("POST",`/api/playbook-patches/${e}/reject`,{});return kd(n)}async function G9(e){const t=await ke("GET",`/api/playbooks/${e}/events/count`);return kd(t)}async function yx(e){const t=await e.json();if(!t.success)throw new Error(t.error??"Request failed");return t.data}async function wR(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 yx(n)).open}async function Q9(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 yx(r)}async function Y9(e){const t=await ke("POST","/api/feedback-signals/discard",{signalIds:e});return yx(t)}function X9(e){return!!e.linkedPatchId&&e.status==="open"}function Jf(e){return`"${e.replace(/\\/g,"\\\\").replace(/"/g,'\\"').replace(/\n/g,"\\n")}"`}function W9(e){return e==null||e===""?"null":Jf(e)}function J9(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: ${W9(n.candidatePlaybookId)}`,` feedback: ${Jf(n.userFeedbackExcerpt)}`,` failure: ${Jf(n.failureSummary)}`];return n.correctedOutputHint&&r.push(` hint: ${Jf(n.correctedOutputHint)}`),n.candidateDeckId&&r.push(` deck: ${n.candidateDeckId}`),r.join(`
|
|
407
|
+
`)}).join(`
|
|
408
|
+
`)}
|
|
409
|
+
\`\`\``}function eF({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:()=>G9(e),enabled:t&&!!e}),{data:s}=wt({queryKey:["/api/feedback-signals/count","available",e],queryFn:()=>wR(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(vs,{open:t,onOpenChange:n,children:c.jsxs(pi,{className:"sm:max-w-6xl max-h-[90vh] overflow-y-auto border-border bg-[#161612] text-[#E8F6F4]",children:[c.jsxs(mi,{children:[c.jsx(gi,{children:(o==null?void 0:o.title)??"Playbook"}),c.jsx(No,{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(Ar,{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(Ar,{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 tF({credentialId:e,open:t,onOpenChange:n}){const r=ln(),{toast:a}=tn(),[i,s]=w.useState(""),[o,l]=w.useState(""),[u,d]=w.useState(""),{data:f,isLoading:p}=wt({queryKey:e?[`/api/credentials/${e}`]:["credential-detail-disabled"],enabled:t&&!!e}),h=f==null?void 0:f.data;w.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"})}}),m=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(vs,{open:t,onOpenChange:n,children:c.jsxs(pi,{className:"sm:max-w-md border-border bg-[#161612] text-[#E8F6F4]",children:[c.jsxs(mi,{children:[c.jsx(gi,{className:"text-[#E8F6F4]",children:(h==null?void 0:h.label)??"API key"}),c.jsx(No,{className:"font-mono text-xs text-[#A8C4C0]",children:(h==null?void 0:h.id)??e})]}),p||!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(Ar,{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(Ge,{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(Ge,{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(Ge,{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(Wa,{className:"h-4 w-4"})})]})]}),c.jsx(le,{variant:"ghost",className:`w-full border-2 hover:opacity-90 ${ha}`,style:pa(Gn),onClick:()=>y.mutate(),disabled:!m||y.isPending,children:y.isPending?"Saving…":"Save changes"})]})]})})}const nF=Qp("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 hn({className:e,variant:t,...n}){return c.jsx("div",{className:Te(nF({variant:t}),e),...n})}function H_(e,t){if(typeof e=="function")return e(t);e!=null&&(e.current=t)}function rF(...e){return t=>{let n=!1;const r=e.map(a=>{const i=H_(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():H_(e[a],null)}}}}function vx(...e){return w.useCallback(rF(...e),e)}function aF(e,t=[]){let n=[];function r(i,s){const o=w.createContext(s);o.displayName=i+"Context";const l=n.length;n=[...n,s];const u=f=>{var g;const{scope:p,children:h,...y}=f,m=((g=p==null?void 0:p[e])==null?void 0:g[l])||o,b=w.useMemo(()=>y,Object.values(y));return c.jsx(m.Provider,{value:b,children:h})};u.displayName=i+"Provider";function d(f,p,h={}){var g;const{optional:y=!1}=h,m=((g=p==null?void 0:p[e])==null?void 0:g[l])||o,b=w.useContext(m);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=>w.createContext(s));return function(o){const l=(o==null?void 0:o[e])||i;return w.useMemo(()=>({[`__scope${e}`]:{...o,[e]:l}}),[o,l])}};return a.scopeName=e,[r,iF(a,...t)]}function iF(...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 w.useMemo(()=>({[`__scope${t.scopeName}`]:s}),[s])}};return n.scopeName=t.scopeName,n}function B_(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 Jh=globalThis!=null&&globalThis.document?w.useLayoutEffect:()=>{},sF=ad[" useInsertionEffect ".trim().toString()]||Jh;function oF({prop:e,defaultProp:t,onChange:n=()=>{},caller:r}){const[a,i,s]=lF({defaultProp:t,onChange:n}),o=e!==void 0,l=o?e:a;{const d=w.useRef(e!==void 0);w.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=w.useCallback(d=>{var f;if(o){const p=cF(d)?d(e):d;p!==e&&((f=s.current)==null||f.call(s,p))}else i(d)},[o,e,i,s]);return[l,u]}function lF({defaultProp:e,onChange:t}){const[n,r]=w.useState(e),a=w.useRef(n),i=w.useRef(t);return sF(()=>{i.current=t},[t]),w.useEffect(()=>{var s;a.current!==n&&((s=i.current)==null||s.call(i,n),a.current=n)},[n,a]),[n,r,i]}function cF(e){return typeof e=="function"}function uF(e){const t=w.useRef({value:e,previous:e});return w.useMemo(()=>(t.current.value!==e&&(t.current.previous=t.current.value,t.current.value=e),t.current.previous),[e])}function dF(e){const[t,n]=w.useState(void 0);return Jh(()=>{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 fF(e,t){return w.useReducer((n,r)=>t[n][r]??n,e)}var SR=e=>{const{present:t,children:n}=e,r=hF(t),a=typeof n=="function"?n({present:r.isPresent}):w.Children.only(n),i=pF(r.ref,mF(a));return typeof n=="function"||r.isPresent?w.cloneElement(a,{ref:i}):null};SR.displayName="Presence";function hF(e){const[t,n]=w.useState(),r=w.useRef(null),a=w.useRef(e),i=w.useRef("none"),s=w.useRef(void 0),o=e?"mounted":"unmounted",[l,u]=fF(o,{mounted:{UNMOUNT:"unmounted",ANIMATION_OUT:"unmountSuspended"},unmountSuspended:{MOUNT:"mounted",ANIMATION_END:"unmounted"},unmounted:{MOUNT:"mounted"}});return w.useEffect(()=>{l==="mounted"?(i.current=s.current??Dc(r.current),s.current=void 0):i.current="none"},[l]),Jh(()=>{const d=r.current,f=a.current;if(f!==e){const h=i.current,y=Dc(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]),Jh(()=>{if(t){let d;const f=t.ownerDocument.defaultView??window,p=y=>{const b=Dc(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=Dc(r.current))};return t.addEventListener("animationstart",h),t.addEventListener("animationcancel",p),t.addEventListener("animationend",p),()=>{f.clearTimeout(d),t.removeEventListener("animationstart",h),t.removeEventListener("animationcancel",p),t.removeEventListener("animationend",p)}}else u("ANIMATION_END")},[t,u]),{isPresent:["mounted","unmountSuspended"].includes(l),ref:w.useCallback(d=>{if(d){const f=getComputedStyle(d);r.current=f,s.current=Dc(f)}else r.current=null;n(d)},[])}}function V_(e,t){if(typeof e=="function")return e(t);e!=null&&(e.current=t)}function pF(...e){const t=w.useRef(e);return t.current=e,w.useCallback(n=>{const r=t.current;let a=!1;const i=r.map(s=>{const o=V_(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():V_(r[s],null)}}},[])}function Dc(e){return(e==null?void 0:e.animationName)||"none"}function mF(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 gF(e){const t=w.forwardRef((n,r)=>{let{children:a,...i}=n,s=null,o=!1;const l=[];K_(a)&&typeof mf=="function"&&(a=mf(a._payload)),w.Children.forEach(a,p=>{var h;if(wF(p)){o=!0;const y=p;let m="child"in y.props?y.props.child:y.props.children;K_(m)&&typeof mf=="function"&&(m=mf(m._payload)),s=vF(y,m),l.push((h=s==null?void 0:s.props)==null?void 0:h.children)}else l.push(p)}),s?s=w.cloneElement(s,void 0,l):!o&&w.Children.count(a)===1&&w.isValidElement(a)&&(s=a);const u=s?xF(s):void 0,d=vx(r,u);if(!s){if(a||a===0)throw new Error(o?EF(e):kF(e));return a}const f=bF(i,s.props??{});return s.type!==w.Fragment&&(f.ref=r?d:u),w.cloneElement(s,f)});return t.displayName=`${e}.Slot`,t}var yF=Symbol.for("radix.slottable"),vF=(e,t)=>{if("child"in e.props){const n=e.props.child;return w.isValidElement(n)?w.cloneElement(n,void 0,e.props.children(n.props.children)):null}return w.isValidElement(t)?t:null};function bF(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 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){return w.isValidElement(e)&&typeof e.type=="function"&&"__radixId"in e.type&&e.type.__radixId===yF}var SF=Symbol.for("react.lazy");function K_(e){return e!=null&&typeof e=="object"&&"$$typeof"in e&&e.$$typeof===SF&&"_payload"in e&&_F(e._payload)}function _F(e){return typeof e=="object"&&e!==null&&"then"in e}var kF=e=>`${e} failed to slot onto its children. Expected a single React element child or \`Slottable\`.`,EF=e=>`${e} failed to slot onto its \`Slottable\`. Expected \`Slottable\` to receive a single React element child.`,mf=ad[" use ".trim().toString()],CF=["a","button","div","form","h2","h3","img","input","label","li","nav","ol","p","select","span","svg","ul"],bx=CF.reduce((e,t)=>{const n=gF(`Primitive.${t}`),r=w.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}},{}),um="Checkbox",[NF,nie]=aF(um),[jF,xx]=NF(um);function TF(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,[p,h]=oF({prop:n,defaultProp:a??!1,onChange:l,caller:um}),[y,m]=w.useState(null),[b,g]=w.useState(null),v=w.useRef(!1),x=y?!!s||!!y.closest("form"):!0,S={checked:p,disabled:i,setChecked:h,control:y,setControl:m,name:o,form:s,value:d,hasConsumerStoppedPropagationRef:v,required:u,defaultChecked:ss(a)?!1:a,isFormControl:x,bubbleInput:b,setBubbleInput:g};return c.jsx(jF,{scope:t,...S,children:AF(f)?f(S):r})}var _R="CheckboxTrigger",kR=w.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:p,isFormControl:h,bubbleInput:y}=xx(_R,e),m=vx(a,d),b=w.useRef(l);return w.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(bx.button,{type:"button",role:"checkbox","aria-checked":ss(l)?"mixed":l,"aria-required":u,"data-state":TR(l),"data-disabled":o?"":void 0,disabled:o,value:s,...r,ref:m,onKeyDown:B_(t,g=>{g.key==="Enter"&&g.preventDefault()}),onClick:B_(n,g=>{f(v=>ss(v)?!0:!v),y&&h&&(p.current=g.isPropagationStopped(),p.current||g.stopPropagation())})})});kR.displayName=_R;var wx=w.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(TF,{__scopeCheckbox:n,checked:a,defaultChecked:i,disabled:o,required:s,onCheckedChange:u,name:r,form:d,value:l,internal_do_not_use_render:({isFormControl:p})=>c.jsxs(c.Fragment,{children:[c.jsx(kR,{...f,ref:t,__scopeCheckbox:n}),p&&c.jsx(jR,{__scopeCheckbox:n})]})})});wx.displayName=um;var ER="CheckboxIndicator",CR=w.forwardRef((e,t)=>{const{__scopeCheckbox:n,forceMount:r,...a}=e,i=xx(ER,n);return c.jsx(SR,{present:r||ss(i.checked)||i.checked===!0,children:c.jsx(bx.span,{"data-state":TR(i.checked),"data-disabled":i.disabled?"":void 0,...a,ref:t,style:{pointerEvents:"none",...e.style}})})});CR.displayName=ER;var NR="CheckboxBubbleInput",jR=w.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:p,setBubbleInput:h}=xx(NR,e),y=vx(n,h),m=uF(i),b=dF(r);w.useEffect(()=>{const v=p;if(!v)return;const x=window.HTMLInputElement.prototype,k=Object.getOwnPropertyDescriptor(x,"checked").set,C=!a.current;if(m!==i&&k){const N=new Event("click",{bubbles:C});v.indeterminate=ss(i),k.call(v,ss(i)?!1:i),v.dispatchEvent(N)}},[p,m,i,a]);const g=w.useRef(ss(i)?!1:i);return c.jsx(bx.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%)"}})});jR.displayName=NR;function AF(e){return typeof e=="function"}function ss(e){return e==="indeterminate"}function TR(e){return ss(e)?"indeterminate":e?"checked":"unchecked"}const ep=w.forwardRef(({className:e,...t},n)=>c.jsx(wx,{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(CR,{className:Te("flex items-center justify-center text-current"),children:c.jsx(uT,{className:"h-4 w-4"})})}));ep.displayName=wx.displayName;const AR=w.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})}));AR.displayName="Table";const RR=w.forwardRef(({className:e,...t},n)=>c.jsx("thead",{ref:n,className:Te("[&_tr]:border-b",e),...t}));RR.displayName="TableHeader";const $R=w.forwardRef(({className:e,...t},n)=>c.jsx("tbody",{ref:n,className:Te("[&_tr:last-child]:border-0",e),...t}));$R.displayName="TableBody";const RF=w.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}));RF.displayName="TableFooter";const Fo=w.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}));Fo.displayName="TableRow";const eh=w.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}));eh.displayName="TableHead";const Ms=w.forwardRef(({className:e,...t},n)=>c.jsx("td",{ref:n,className:Te("p-4 align-middle [&:has([role=checkbox])]:pr-0",e),...t}));Ms.displayName="TableCell";const $F=w.forwardRef(({className:e,...t},n)=>c.jsx("caption",{ref:n,className:Te("mt-4 text-sm text-muted-foreground",e),...t}));$F.displayName="TableCaption";function OF(e,t){const n={};return(e[e.length-1]===""?[...e,""]:e).join((n.padRight?" ":"")+","+(n.padLeft===!1?"":" ")).trim()}const MF=/^[$_\p{ID_Start}][$_\u{200C}\u{200D}\p{ID_Continue}]*$/u,PF=/^[$_\p{ID_Start}][-$_\u{200C}\u{200D}\p{ID_Continue}]*$/u,DF={};function Z_(e,t){return(DF.jsx?PF:MF).test(e)}const zF=/[ \t\n\f\r]/g;function IF(e){return typeof e=="object"?e.type==="text"?G_(e.value):!1:G_(e)}function G_(e){return e.replace(zF,"")===""}class Ed{constructor(t,n,r){this.normal=n,this.property=t,r&&(this.space=r)}}Ed.prototype.normal={};Ed.prototype.property={};Ed.prototype.space=void 0;function OR(e,t){const n={},r={};for(const a of e)Object.assign(n,a.property),Object.assign(r,a.normal);return new Ed(n,r,t)}function Iv(e){return e.toLowerCase()}class tr{constructor(t,n){this.attribute=n,this.property=t}}tr.prototype.attribute="";tr.prototype.booleanish=!1;tr.prototype.boolean=!1;tr.prototype.commaOrSpaceSeparated=!1;tr.prototype.commaSeparated=!1;tr.prototype.defined=!1;tr.prototype.mustUseProperty=!1;tr.prototype.number=!1;tr.prototype.overloadedBoolean=!1;tr.prototype.property="";tr.prototype.spaceSeparated=!1;tr.prototype.space=void 0;let LF=0;const $e=jo(),Ht=jo(),Lv=jo(),ie=jo(),ct=jo(),no=jo(),ar=jo();function jo(){return 2**++LF}const Uv=Object.freeze(Object.defineProperty({__proto__:null,boolean:$e,booleanish:Ht,commaOrSpaceSeparated:ar,commaSeparated:no,number:ie,overloadedBoolean:Lv,spaceSeparated:ct},Symbol.toStringTag,{value:"Module"})),Pg=Object.keys(Uv);class Sx extends tr{constructor(t,n,r,a){let i=-1;if(super(t,n),Q_(this,"space",a),typeof r=="number")for(;++i<Pg.length;){const s=Pg[i];Q_(this,Pg[i],(r&Uv[s])===Uv[s])}}}Sx.prototype.defined=!0;function Q_(e,t,n){n&&(e[t]=n)}function bc(e){const t={},n={};for(const[r,a]of Object.entries(e.properties)){const i=new Sx(r,e.transform(e.attributes||{},r),a,e.space);e.mustUseProperty&&e.mustUseProperty.includes(r)&&(i.mustUseProperty=!0),t[r]=i,n[Iv(r)]=r,n[Iv(i.attribute)]=r}return new Ed(t,n,e.space)}const MR=bc({properties:{ariaActiveDescendant:null,ariaAtomic:Ht,ariaAutoComplete:null,ariaBusy:Ht,ariaChecked:Ht,ariaColCount:ie,ariaColIndex:ie,ariaColSpan:ie,ariaControls:ct,ariaCurrent:null,ariaDescribedBy:ct,ariaDetails:null,ariaDisabled:Ht,ariaDropEffect:ct,ariaErrorMessage:null,ariaExpanded:Ht,ariaFlowTo:ct,ariaGrabbed:Ht,ariaHasPopup:null,ariaHidden:Ht,ariaInvalid:null,ariaKeyShortcuts:null,ariaLabel:null,ariaLabelledBy:ct,ariaLevel:ie,ariaLive:null,ariaModal:Ht,ariaMultiLine:Ht,ariaMultiSelectable:Ht,ariaOrientation:null,ariaOwns:ct,ariaPlaceholder:null,ariaPosInSet:ie,ariaPressed:Ht,ariaReadOnly:Ht,ariaRelevant:null,ariaRequired:Ht,ariaRoleDescription:ct,ariaRowCount:ie,ariaRowIndex:ie,ariaRowSpan:ie,ariaSelected:Ht,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 PR(e,t){return t in e?e[t]:t}function DR(e,t){return PR(e,t.toLowerCase())}const UF=bc({attributes:{acceptcharset:"accept-charset",classname:"class",htmlfor:"for",httpequiv:"http-equiv"},mustUseProperty:["checked","multiple","muted","selected"],properties:{abbr:null,accept:no,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:Ht,controls:$e,controlsList:ct,coords:ie|no,crossOrigin:null,data:null,dateTime:null,decoding:null,default:$e,defer:$e,dir:null,dirName:null,disabled:$e,download:Lv,draggable:Ht,encType:null,enterKeyHint:null,fetchPriority:null,form:null,formAction:null,formEncType:null,formMethod:null,formNoValidate:$e,formTarget:null,headers:ct,height:ie,hidden:Lv,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:Ht,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:Ht,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:Ht,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:no,part:ct,prefix:null,property:null,results:ie,security:null,unselectable:null},space:"html",transform:DR}),FF=bc({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:ar,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:no,g2:no,glyphName:no,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:ar,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:ar,r:null,radius:null,referrerPolicy:null,refX:null,refY:null,rel:ar,rev:ar,renderingIntent:null,repeatCount:null,repeatDur:null,requiredExtensions:ar,requiredFeatures:ar,requiredFonts:ar,requiredFormats:ar,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:ar,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:ar,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:ar,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:PR}),zR=bc({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()}}),IR=bc({attributes:{xmlnsxlink:"xmlns:xlink"},properties:{xmlnsXLink:null,xmlns:null},space:"xmlns",transform:DR}),LR=bc({properties:{xmlBase:null,xmlLang:null,xmlSpace:null},space:"xml",transform(e,t){return"xml:"+t.slice(3).toLowerCase()}}),qF={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"},HF=/[A-Z]/g,Y_=/-[a-z]/g,BF=/^data[-\w.:]+$/i;function VF(e,t){const n=Iv(t);let r=t,a=tr;if(n in e.normal)return e.property[e.normal[n]];if(n.length>4&&n.slice(0,4)==="data"&&BF.test(t)){if(t.charAt(4)==="-"){const i=t.slice(5).replace(Y_,ZF);r="data"+i.charAt(0).toUpperCase()+i.slice(1)}else{const i=t.slice(4);if(!Y_.test(i)){let s=i.replace(HF,KF);s.charAt(0)!=="-"&&(s="-"+s),t="data"+s}}a=Sx}return new a(r,t)}function KF(e){return"-"+e.toLowerCase()}function ZF(e){return e.charAt(1).toUpperCase()}const GF=OR([MR,UF,zR,IR,LR],"html"),_x=OR([MR,FF,zR,IR,LR],"svg");function QF(e){return e.join(" ").trim()}var kx={},X_=/\/\*[^*]*\*+([^/*][^*]*\*+)*\//g,YF=/\n/g,XF=/^\s*/,WF=/^(\*?[-#/*\\\w]+(\[[0-9a-z_-]+\])?)\s*/,JF=/^:\s*/,e8=/^((?:'(?:\\'|.)*?'|"(?:\\"|.)*?"|\([^)]*?\)|[^};])+)/,t8=/^[;\s]*/,n8=/^\s+|\s+$/g,r8=`
|
|
410
|
+
`,W_="/",J_="*",Ds="",a8="comment",i8="declaration";function s8(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 m=y.match(YF);m&&(n+=m.length);var b=y.lastIndexOf(r8);r=~b?y.length-b:r+y.length}function i(){var y={line:n,column:r};return function(m){return m.position=new s(y),u(),m}}function s(y){this.start=y,this.end={line:n,column:r},this.source=t.source}s.prototype.content=e;function o(y){var m=new Error(t.source+":"+n+":"+r+": "+y);if(m.reason=y,m.filename=t.source,m.line=n,m.column=r,m.source=e,!t.silent)throw m}function l(y){var m=y.exec(e);if(m){var b=m[0];return a(b),e=e.slice(b.length),m}}function u(){l(XF)}function d(y){var m;for(y=y||[];m=f();)m!==!1&&y.push(m);return y}function f(){var y=i();if(!(W_!=e.charAt(0)||J_!=e.charAt(1))){for(var m=2;Ds!=e.charAt(m)&&(J_!=e.charAt(m)||W_!=e.charAt(m+1));)++m;if(m+=2,Ds===e.charAt(m-1))return o("End of comment missing");var b=e.slice(2,m-2);return r+=2,a(b),e=e.slice(m),r+=2,y({type:a8,comment:b})}}function p(){var y=i(),m=l(WF);if(m){if(f(),!l(JF))return o("property missing ':'");var b=l(e8),g=y({type:i8,property:ek(m[0].replace(X_,Ds)),value:b?ek(b[0].replace(X_,Ds)):Ds});return l(t8),g}}function h(){var y=[];d(y);for(var m;m=p();)m!==!1&&(y.push(m),d(y));return y}return u(),h()}function ek(e){return e?e.replace(n8,Ds):Ds}var o8=s8,l8=fh&&fh.__importDefault||function(e){return e&&e.__esModule?e:{default:e}};Object.defineProperty(kx,"__esModule",{value:!0});kx.default=u8;const c8=l8(o8);function u8(e,t){let n=null;if(!e||typeof e!="string")return n;const r=(0,c8.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 dm={};Object.defineProperty(dm,"__esModule",{value:!0});dm.camelCase=void 0;var d8=/^--[a-zA-Z0-9_-]+$/,f8=/-([a-z])/g,h8=/^[^-]+$/,p8=/^-(webkit|moz|ms|o|khtml)-/,m8=/^-(ms)-/,g8=function(e){return!e||h8.test(e)||d8.test(e)},y8=function(e,t){return t.toUpperCase()},tk=function(e,t){return"".concat(t,"-")},v8=function(e,t){return t===void 0&&(t={}),g8(e)?e:(e=e.toLowerCase(),t.reactCompat?e=e.replace(m8,tk):e=e.replace(p8,tk),e.replace(f8,y8))};dm.camelCase=v8;var b8=fh&&fh.__importDefault||function(e){return e&&e.__esModule?e:{default:e}},x8=b8(kx),w8=dm;function Fv(e,t){var n={};return!e||typeof e!="string"||(0,x8.default)(e,function(r,a){r&&a&&(n[(0,w8.camelCase)(r,t)]=a)}),n}Fv.default=Fv;var S8=Fv;const _8=ac(S8),UR=FR("end"),Ex=FR("start");function FR(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 k8(e){const t=Ex(e),n=UR(e);if(t&&n)return{start:t,end:n}}function vu(e){return!e||typeof e!="object"?"":"position"in e||"type"in e?nk(e.position):"start"in e||"end"in e?nk(e):"line"in e||"column"in e?qv(e):""}function qv(e){return rk(e&&e.line)+":"+rk(e&&e.column)}function nk(e){return qv(e&&e.start)+"-"+qv(e&&e.end)}function rk(e){return e&&typeof e=="number"?e:1}class jn 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=vu(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}}jn.prototype.file="";jn.prototype.name="";jn.prototype.reason="";jn.prototype.message="";jn.prototype.stack="";jn.prototype.column=void 0;jn.prototype.line=void 0;jn.prototype.ancestors=void 0;jn.prototype.cause=void 0;jn.prototype.fatal=void 0;jn.prototype.place=void 0;jn.prototype.ruleId=void 0;jn.prototype.source=void 0;const Cx={}.hasOwnProperty,E8=new Map,C8=/[A-Z]/g,N8=new Set(["table","tbody","thead","tfoot","tr"]),j8=new Set(["td","th"]),qR="https://github.com/syntax-tree/hast-util-to-jsx-runtime";function T8(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=z8(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=D8(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"?_x:GF,stylePropertyNameCase:t.stylePropertyNameCase||"dom",tableCellAlignToStyle:t.tableCellAlignToStyle!==!1},i=HR(a,e,void 0);return i&&typeof i!="string"?i:a.create(e,a.Fragment,{children:i||void 0},void 0)}function HR(e,t,n){if(t.type==="element")return A8(e,t,n);if(t.type==="mdxFlowExpression"||t.type==="mdxTextExpression")return R8(e,t);if(t.type==="mdxJsxFlowElement"||t.type==="mdxJsxTextElement")return O8(e,t,n);if(t.type==="mdxjsEsm")return $8(e,t);if(t.type==="root")return M8(e,t,n);if(t.type==="text")return P8(e,t)}function A8(e,t,n){const r=e.schema;let a=r;t.tagName.toLowerCase()==="svg"&&r.space==="html"&&(a=_x,e.schema=a),e.ancestors.push(t);const i=VR(e,t.tagName,!1),s=I8(e,t);let o=jx(e,t);return N8.has(t.tagName)&&(o=o.filter(function(l){return typeof l=="string"?!IF(l):!0})),BR(e,s,i,t),Nx(s,o),e.ancestors.pop(),e.schema=r,e.create(t,i,s,n)}function R8(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)}Gu(e,t.position)}function $8(e,t){if(t.data&&t.data.estree&&e.evaluater)return e.evaluater.evaluateProgram(t.data.estree);Gu(e,t.position)}function O8(e,t,n){const r=e.schema;let a=r;t.name==="svg"&&r.space==="html"&&(a=_x,e.schema=a),e.ancestors.push(t);const i=t.name===null?e.Fragment:VR(e,t.name,!0),s=L8(e,t),o=jx(e,t);return BR(e,s,i,t),Nx(s,o),e.ancestors.pop(),e.schema=r,e.create(t,i,s,n)}function M8(e,t,n){const r={};return Nx(r,jx(e,t)),e.create(t,e.Fragment,r,n)}function P8(e,t){return t.value}function BR(e,t,n,r){typeof n!="string"&&n!==e.Fragment&&e.passNode&&(t.node=r)}function Nx(e,t){if(t.length>0){const n=t.length>1?t:t[0];n&&(e.children=n)}}function D8(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 z8(e,t){return n;function n(r,a,i,s){const o=Array.isArray(i.children),l=Ex(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 I8(e,t){const n={};let r,a;for(a in t.properties)if(a!=="children"&&Cx.call(t.properties,a)){const i=U8(e,a,t.properties[a]);if(i){const[s,o]=i;e.tableCellAlignToStyle&&s==="align"&&typeof o=="string"&&j8.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 L8(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 Gu(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 Gu(e,t.position);else i=r.value===null?!0:r.value;n[a]=i}return n}function jx(e,t){const n=[];let r=-1;const a=e.passKeys?new Map:E8;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=HR(e,i,s);o!==void 0&&n.push(o)}return n}function U8(e,t,n){const r=VF(e.schema,t);if(!(n==null||typeof n=="number"&&Number.isNaN(n))){if(Array.isArray(n)&&(n=r.commaSeparated?OF(n):QF(n)),r.property==="style"){let a=typeof n=="object"?n:F8(e,String(n));return e.stylePropertyNameCase==="css"&&(a=q8(a)),["style",a]}return[e.elementAttributeNameCase==="react"&&r.space?qF[r.property]||r.property:r.attribute,n]}}function F8(e,t){try{return _8(t,{reactCompat:!0})}catch(n){if(e.ignoreInvalidStyle)return{};const r=n,a=new jn("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=qR+"#cannot-parse-style-attribute",a}}function VR(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=Z_(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=Z_(t)&&!/^[a-z]/.test(t)?{type:"Identifier",name:t}:{type:"Literal",value:t};if(r.type==="Literal"){const a=r.value;return Cx.call(e.components,a)?e.components[a]:a}if(e.evaluater)return e.evaluater.evaluateExpression(r);Gu(e)}function Gu(e,t){const n=new jn("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=qR+"#cannot-handle-mdx-estrees-without-createevaluater",n}function q8(e){const t={};let n;for(n in e)Cx.call(e,n)&&(t[H8(n)]=e[n]);return t}function H8(e){let t=e.replace(C8,B8);return t.slice(0,3)==="ms-"&&(t="-"+t),t}function B8(e){return"-"+e.toLowerCase()}const Dg={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"]},V8={};function Tx(e,t){const n=V8,r=typeof n.includeImageAlt=="boolean"?n.includeImageAlt:!0,a=typeof n.includeHtml=="boolean"?n.includeHtml:!0;return KR(e,r,a)}function KR(e,t,n){if(K8(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 ak(e.children,t,n)}return Array.isArray(e)?ak(e,t,n):""}function ak(e,t,n){const r=[];let a=-1;for(;++a<e.length;)r[a]=KR(e[a],t,n);return r.join("")}function K8(e){return!!(e&&typeof e=="object")}const ik=document.createElement("i");function Ax(e){const t="&"+e+";";ik.innerHTML=t;const n=ik.textContent;return n.charCodeAt(n.length-1)===59&&e!=="semi"||n===t?!1:n}function gr(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 Rr(e,t){return e.length>0?(gr(e,e.length,0,t),e):t}const sk={}.hasOwnProperty;function ZR(e){const t={};let n=-1;for(;++n<e.length;)Z8(t,e[n]);return t}function Z8(e,t){let n;for(n in t){const a=(sk.call(e,n)?e[n]:void 0)||(e[n]={}),i=t[n];let s;if(i)for(s in i){sk.call(a,s)||(a[s]=[]);const o=i[s];G8(a[s],Array.isArray(o)?o:o?[o]:[])}}}function G8(e,t){let n=-1;const r=[];for(;++n<t.length;)(t[n].add==="after"?e:r).push(t[n]);gr(e,0,0,r)}function GR(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 Jr(e){return e.replace(/[\t\n\r ]+/g," ").replace(/^ | $/g,"").toLowerCase().toUpperCase()}const Dn=bs(/[A-Za-z]/),Cn=bs(/[\dA-Za-z]/),Q8=bs(/[#-'*+\--9=?A-Z^-~]/);function tp(e){return e!==null&&(e<32||e===127)}const Hv=bs(/\d/),Y8=bs(/[\dA-Fa-f]/),X8=bs(/[!-/:-@[-`{-~]/);function Ee(e){return e!==null&&e<-2}function ft(e){return e!==null&&(e<0||e===32)}function Ve(e){return e===-2||e===-1||e===32}const fm=bs(new RegExp("\\p{P}|\\p{S}","u")),mo=bs(/\s/);function bs(e){return t;function t(n){return n!==null&&n>-1&&e.test(String.fromCharCode(n))}}function xc(e){const t=[];let n=-1,r=0,a=0;for(;++n<e.length;){const i=e.charCodeAt(n);let s="";if(i===37&&Cn(e.charCodeAt(n+1))&&Cn(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 Xe(e,t,n,r){const a=r?r-1:Number.POSITIVE_INFINITY;let i=0;return s;function s(l){return Ve(l)?(e.enter(n),o(l)):t(l)}function o(l){return Ve(l)&&i++<a?(e.consume(l),o):(e.exit(n),t(l))}}const W8={tokenize:J8};function J8(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"),Xe(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 eq={tokenize:tq},ok={tokenize:nq};function tq(e){const t=this,n=[];let r=0,a,i,s;return o;function o(x){if(r<n.length){const S=n[r];return t.containerState=S[1],e.attempt(S[0].continuation,l,u)(x)}return u(x)}function l(x){if(r++,t.containerState._closeFlow){t.containerState._closeFlow=void 0,a&&v();const S=t.events.length;let k=S,C;for(;k--;)if(t.events[k][0]==="exit"&&t.events[k][1].type==="chunkFlow"){C=t.events[k][1].end;break}g(r);let N=S;for(;N<t.events.length;)t.events[N][1].end={...C},N++;return gr(t.events,k+1,0,t.events.slice(S)),t.events.length=N,u(x)}return o(x)}function u(x){if(r===n.length){if(!a)return p(x);if(a.currentConstruct&&a.currentConstruct.concrete)return y(x);t.interrupt=!!(a.currentConstruct&&!a._gfmTableDynamicInterruptHack)}return t.containerState={},e.check(ok,d,f)(x)}function d(x){return a&&v(),g(r),p(x)}function f(x){return t.parser.lazy[t.now().line]=r!==n.length,s=t.now().offset,y(x)}function p(x){return t.containerState={},e.attempt(ok,h,y)(x)}function h(x){return r++,n.push([t.currentConstruct,t.containerState]),p(x)}function y(x){if(x===null){a&&v(),g(0),e.consume(x);return}return a=a||t.parser.flow(t.now()),e.enter("chunkFlow",{_tokenizer:a,contentType:"flow",previous:i}),m(x)}function m(x){if(x===null){b(e.exit("chunkFlow"),!0),g(0),e.consume(x);return}return Ee(x)?(e.consume(x),b(e.exit("chunkFlow")),r=0,t.interrupt=void 0,o):(e.consume(x),m)}function b(x,S){const k=t.sliceStream(x);if(S&&k.push(null),x.previous=i,i&&(i.next=x),i=x,a.defineSkip(x.start),a.write(k),t.parser.lazy[x.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 N=t.events.length;let P=N,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=N;C<t.events.length;)t.events[C][1].end={...$},C++;gr(t.events,P+1,0,t.events.slice(N)),t.events.length=C}}function g(x){let S=n.length;for(;S-- >x;){const k=n[S];t.containerState=k[1],k[0].exit.call(t,e)}n.length=x}function v(){a.write([null]),i=void 0,a=void 0,t.containerState._closeFlow=void 0}}function nq(e,t,n){return Xe(e,e.attempt(this.parser.constructs.document,t,n),"linePrefix",this.parser.constructs.disable.null.includes("codeIndented")?void 0:4)}function ec(e){if(e===null||ft(e)||mo(e))return 1;if(fm(e))return 2}function hm(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 Bv={name:"attention",resolveAll:rq,tokenize:aq};function rq(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},p={...e[n][1].start};lk(f,-l),lk(p,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:p},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=Rr(u,[["enter",e[r][1],t],["exit",e[r][1],t]])),u=Rr(u,[["enter",a,t],["enter",s,t],["exit",s,t],["enter",i,t]]),u=Rr(u,hm(t.parser.constructs.insideSpan.null,e.slice(r+1,n),t)),u=Rr(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=Rr(u,[["enter",e[n][1],t],["exit",e[n][1],t]])):d=0,gr(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 aq(e,t){const n=this.parser.constructs.attentionMarkers.null,r=this.previous,a=ec(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=ec(l),f=!d||d===2&&a||n.includes(l),p=!a||a===2&&d||n.includes(r);return u._open=!!(i===42?f:f&&(a||!p)),u._close=!!(i===42?p:p&&(d||!f)),t(l)}}function lk(e,t){e.column+=t,e.offset+=t,e._bufferIndex+=t}const iq={name:"autolink",tokenize:sq};function sq(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 Dn(h)?(e.consume(h),s):h===64?n(h):u(h)}function s(h){return h===43||h===45||h===46||Cn(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||Cn(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||tp(h)?n(h):(e.consume(h),l)}function u(h){return h===64?(e.consume(h),d):Q8(h)?(e.consume(h),u):n(h)}function d(h){return Cn(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):p(h)}function p(h){if((h===45||Cn(h))&&r++<63){const y=h===45?p:f;return e.consume(h),y}return n(h)}}const Cd={partial:!0,tokenize:oq};function oq(e,t,n){return r;function r(i){return Ve(i)?Xe(e,a,"linePrefix")(i):a(i)}function a(i){return i===null||Ee(i)?t(i):n(i)}}const QR={continuation:{tokenize:cq},exit:uq,name:"blockQuote",tokenize:lq};function lq(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 Ve(s)?(e.enter("blockQuotePrefixWhitespace"),e.consume(s),e.exit("blockQuotePrefixWhitespace"),e.exit("blockQuotePrefix"),t):(e.exit("blockQuotePrefix"),t(s))}}function cq(e,t,n){const r=this;return a;function a(s){return Ve(s)?Xe(e,i,"linePrefix",r.parser.constructs.disable.null.includes("codeIndented")?void 0:4)(s):i(s)}function i(s){return e.attempt(QR,t,n)(s)}}function uq(e){e.exit("blockQuote")}const YR={name:"characterEscape",tokenize:dq};function dq(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 X8(i)?(e.enter("characterEscapeValue"),e.consume(i),e.exit("characterEscapeValue"),e.exit("characterEscape"),t):n(i)}}const XR={name:"characterReference",tokenize:fq};function fq(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=Cn,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=Y8,d):(e.enter("characterReferenceValue"),i=7,s=Hv,d(f))}function d(f){if(f===59&&a){const p=e.exit("characterReferenceValue");return s===Cn&&!Ax(r.sliceSerialize(p))?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 ck={partial:!0,tokenize:pq},uk={concrete:!0,name:"codeFenced",tokenize:hq};function hq(e,t,n){const r=this,a={partial:!0,tokenize:k};let i=0,s=0,o;return l;function l(C){return u(C)}function u(C){const N=r.events[r.events.length-1];return i=N&&N[1].type==="linePrefix"?N[2].sliceSerialize(N[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"),Ve(C)?Xe(e,f,"whitespace")(C):f(C))}function f(C){return C===null||Ee(C)?(e.exit("codeFencedFence"),r.interrupt?t(C):e.check(ck,m,S)(C)):(e.enter("codeFencedFenceInfo"),e.enter("chunkString",{contentType:"string"}),p(C))}function p(C){return C===null||Ee(C)?(e.exit("chunkString"),e.exit("codeFencedFenceInfo"),f(C)):Ve(C)?(e.exit("chunkString"),e.exit("codeFencedFenceInfo"),Xe(e,h,"whitespace")(C)):C===96&&C===o?n(C):(e.consume(C),p)}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 m(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&&Ve(C)?Xe(e,v,"linePrefix",i+1)(C):v(C)}function v(C){return C===null||Ee(C)?e.check(ck,m,S)(C):(e.enter("codeFlowValue"),x(C))}function x(C){return C===null||Ee(C)?(e.exit("codeFlowValue"),v(C)):(e.consume(C),x)}function S(C){return e.exit("codeFenced"),t(C)}function k(C,N,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"),Ve(A)?Xe(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"),Ve(A)?Xe(C,D,"whitespace")(A):D(A)):P(A)}function D(A){return A===null||Ee(A)?(C.exit("codeFencedFence"),N(A)):P(A)}}}function pq(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 zg={name:"codeIndented",tokenize:gq},mq={partial:!0,tokenize:yq};function gq(e,t,n){const r=this;return a;function a(u){return e.enter("codeIndented"),Xe(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(mq,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 yq(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):Xe(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 vq={name:"codeText",previous:xq,resolve:bq,tokenize:wq};function bq(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 xq(e){return e!==96||this.events[this.events.length-1][1].type==="characterEscape"}function wq(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 Sq{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&&zc(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),zc(this.left,t)}unshift(t){this.setCursor(0),this.right.push(t)}unshiftMany(t){this.setCursor(0),zc(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);zc(this.right,n.reverse())}else{const n=this.right.splice(this.left.length+this.right.length-t,Number.POSITIVE_INFINITY);zc(this.left,n.reverse())}}}function zc(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 WR(e){const t={};let n=-1,r,a,i,s,o,l,u;const d=new Sq(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,_q(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 gr(e,0,Number.POSITIVE_INFINITY,d.slice(0)),!u}function _q(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,p=-1,h=n,y=0,m=0;const b=[m];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;++p<o.length;)o[p][0]==="exit"&&o[p-1][0]==="enter"&&o[p][1].type===o[p-1][1].type&&o[p][1].start.line!==o[p][1].end.line&&(m=p+1,b.push(m),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(),p=b.length;p--;){const g=o.slice(b[p],b[p+1]),v=i.pop();l.push([v,v+g.length-1]),e.splice(v,2,g)}for(l.reverse(),p=-1;++p<l.length;)u[y+l[p][0]]=y+l[p][1],y+=l[p][1]-l[p][0]-1;return u}const kq={resolve:Cq,tokenize:Nq},Eq={partial:!0,tokenize:jq};function Cq(e){return WR(e),e}function Nq(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(Eq,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 jq(e,t,n){const r=this;return a;function a(s){return e.exit("chunkContent"),e.enter("lineEnding"),e.consume(s),e.exit("lineEnding"),Xe(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 JR(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),p):g===null||g===32||g===41||tp(g)?n(g):(e.enter(r),e.enter(s),e.enter(o),e.enter("chunkString",{contentType:"string"}),m(g))}function p(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),p(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 m(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++,m):g===41?(e.consume(g),d--,m):g===null||g===32||g===40||tp(g)?n(g):(e.consume(g),g===92?b:m)}function b(g){return g===40||g===41||g===92?(e.consume(g),m):m(g)}}function e$(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=!Ve(h)),h===92?p:f)}function p(h){return h===91||h===92||h===93?(e.consume(h),o++,f):f(h)}}function t$(e,t,n,r,a,i){let s;return o;function o(p){return p===34||p===39||p===40?(e.enter(r),e.enter(a),e.consume(p),e.exit(a),s=p===40?41:p,l):n(p)}function l(p){return p===s?(e.enter(a),e.consume(p),e.exit(a),e.exit(r),t):(e.enter(i),u(p))}function u(p){return p===s?(e.exit(i),l(s)):p===null?n(p):Ee(p)?(e.enter("lineEnding"),e.consume(p),e.exit("lineEnding"),Xe(e,u,"linePrefix")):(e.enter("chunkString",{contentType:"string"}),d(p))}function d(p){return p===s||p===null||Ee(p)?(e.exit("chunkString"),u(p)):(e.consume(p),p===92?f:d)}function f(p){return p===s||p===92?(e.consume(p),d):d(p)}}function bu(e,t){let n;return r;function r(a){return Ee(a)?(e.enter("lineEnding"),e.consume(a),e.exit("lineEnding"),n=!0,r):Ve(a)?Xe(e,r,n?"linePrefix":"lineSuffix")(a):t(a)}}const Tq={name:"definition",tokenize:Rq},Aq={partial:!0,tokenize:$q};function Rq(e,t,n){const r=this;let a;return i;function i(h){return e.enter("definition"),s(h)}function s(h){return e$.call(r,e,o,n,"definitionLabel","definitionLabelMarker","definitionLabelString")(h)}function o(h){return a=Jr(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)?bu(e,u)(h):u(h)}function u(h){return JR(e,d,n,"definitionDestination","definitionDestinationLiteral","definitionDestinationLiteralMarker","definitionDestinationRaw","definitionDestinationString")(h)}function d(h){return e.attempt(Aq,f,f)(h)}function f(h){return Ve(h)?Xe(e,p,"whitespace")(h):p(h)}function p(h){return h===null||Ee(h)?(e.exit("definition"),r.parser.defined.push(a),t(h)):n(h)}}function $q(e,t,n){return r;function r(o){return ft(o)?bu(e,a)(o):n(o)}function a(o){return t$(e,i,n,"definitionTitle","definitionTitleMarker","definitionTitleString")(o)}function i(o){return Ve(o)?Xe(e,s,"whitespace")(o):s(o)}function s(o){return o===null||Ee(o)?t(o):n(o)}}const Oq={name:"hardBreakEscape",tokenize:Mq};function Mq(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 Pq={name:"headingAtx",resolve:Dq,tokenize:zq};function Dq(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"},gr(e,r,n-r+1,[["enter",a,t],["enter",i,t],["exit",i,t],["exit",a,t]])),e}function zq(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)):Ve(d)?Xe(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 Iq=["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"],dk=["pre","script","style","textarea"],Lq={concrete:!0,name:"htmlFlow",resolveTo:qq,tokenize:Hq},Uq={partial:!0,tokenize:Vq},Fq={partial:!0,tokenize:Bq};function qq(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 Hq(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(_),p):_===47?(e.consume(_),i=!0,m):_===63?(e.consume(_),a=3,r.interrupt?t:T):Dn(_)?(e.consume(_),s=String.fromCharCode(_),b):n(_)}function p(_){return _===45?(e.consume(_),a=2,h):_===91?(e.consume(_),a=5,o=0,y):Dn(_)?(e.consume(_),a=4,r.interrupt?t:T):n(_)}function h(_){return _===45?(e.consume(_),r.interrupt?t:T):n(_)}function y(_){const E="CDATA[";return _===E.charCodeAt(o++)?(e.consume(_),o===E.length?r.interrupt?t:O:y):n(_)}function m(_){return Dn(_)?(e.consume(_),s=String.fromCharCode(_),b):n(_)}function b(_){if(_===null||_===47||_===62||ft(_)){const E=_===47,M=s.toLowerCase();return!E&&!i&&dk.includes(M)?(a=1,r.interrupt?t(_):O(_)):Iq.includes(s.toLowerCase())?(a=6,E?(e.consume(_),g):r.interrupt?t(_):O(_)):(a=7,r.interrupt&&!r.parser.lazy[r.now().line]?n(_):i?v(_):x(_))}return _===45||Cn(_)?(e.consume(_),s+=String.fromCharCode(_),b):n(_)}function g(_){return _===62?(e.consume(_),r.interrupt?t:O):n(_)}function v(_){return Ve(_)?(e.consume(_),v):$(_)}function x(_){return _===47?(e.consume(_),$):_===58||_===95||Dn(_)?(e.consume(_),S):Ve(_)?(e.consume(_),x):$(_)}function S(_){return _===45||_===46||_===58||_===95||Cn(_)?(e.consume(_),S):k(_)}function k(_){return _===61?(e.consume(_),C):Ve(_)?(e.consume(_),k):x(_)}function C(_){return _===null||_===60||_===61||_===62||_===96?n(_):_===34||_===39?(e.consume(_),l=_,N):Ve(_)?(e.consume(_),C):P(_)}function N(_){return _===l?(e.consume(_),l=null,R):_===null||Ee(_)?n(_):(e.consume(_),N)}function P(_){return _===null||_===34||_===39||_===47||_===60||_===61||_===62||_===96||ft(_)?k(_):(e.consume(_),P)}function R(_){return _===47||_===62||Ve(_)?x(_):n(_)}function $(_){return _===62?(e.consume(_),j):n(_)}function j(_){return _===null||Ee(_)?O(_):Ve(_)?(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(_),T):_===93&&a===5?(e.consume(_),J):Ee(_)&&(a===6||a===7)?(e.exit("htmlFlowData"),e.check(Uq,G,z)(_)):_===null||Ee(_)?(e.exit("htmlFlowData"),z(_)):(e.consume(_),O)}function z(_){return e.check(Fq,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(_),T):O(_)}function Z(_){return _===47?(e.consume(_),s="",F):O(_)}function F(_){if(_===62){const E=s.toLowerCase();return dk.includes(E)?(e.consume(_),q):O(_)}return Dn(_)&&s.length<8?(e.consume(_),s+=String.fromCharCode(_),F):O(_)}function J(_){return _===93?(e.consume(_),T):O(_)}function T(_){return _===62?(e.consume(_),q):_===45&&a===2?(e.consume(_),T):O(_)}function q(_){return _===null||Ee(_)?(e.exit("htmlFlowData"),G(_)):(e.consume(_),q)}function G(_){return e.exit("htmlFlow"),t(_)}}function Bq(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 Vq(e,t,n){return r;function r(a){return e.enter("lineEnding"),e.consume(a),e.exit("lineEnding"),e.attempt(Cd,t,n)}}const Kq={name:"htmlText",tokenize:Zq};function Zq(e,t,n){const r=this;let a,i,s;return o;function o(T){return e.enter("htmlText"),e.enter("htmlTextData"),e.consume(T),l}function l(T){return T===33?(e.consume(T),u):T===47?(e.consume(T),k):T===63?(e.consume(T),x):Dn(T)?(e.consume(T),P):n(T)}function u(T){return T===45?(e.consume(T),d):T===91?(e.consume(T),i=0,y):Dn(T)?(e.consume(T),v):n(T)}function d(T){return T===45?(e.consume(T),h):n(T)}function f(T){return T===null?n(T):T===45?(e.consume(T),p):Ee(T)?(s=f,Z(T)):(e.consume(T),f)}function p(T){return T===45?(e.consume(T),h):f(T)}function h(T){return T===62?B(T):T===45?p(T):f(T)}function y(T){const q="CDATA[";return T===q.charCodeAt(i++)?(e.consume(T),i===q.length?m:y):n(T)}function m(T){return T===null?n(T):T===93?(e.consume(T),b):Ee(T)?(s=m,Z(T)):(e.consume(T),m)}function b(T){return T===93?(e.consume(T),g):m(T)}function g(T){return T===62?B(T):T===93?(e.consume(T),g):m(T)}function v(T){return T===null||T===62?B(T):Ee(T)?(s=v,Z(T)):(e.consume(T),v)}function x(T){return T===null?n(T):T===63?(e.consume(T),S):Ee(T)?(s=x,Z(T)):(e.consume(T),x)}function S(T){return T===62?B(T):x(T)}function k(T){return Dn(T)?(e.consume(T),C):n(T)}function C(T){return T===45||Cn(T)?(e.consume(T),C):N(T)}function N(T){return Ee(T)?(s=N,Z(T)):Ve(T)?(e.consume(T),N):B(T)}function P(T){return T===45||Cn(T)?(e.consume(T),P):T===47||T===62||ft(T)?R(T):n(T)}function R(T){return T===47?(e.consume(T),B):T===58||T===95||Dn(T)?(e.consume(T),$):Ee(T)?(s=R,Z(T)):Ve(T)?(e.consume(T),R):B(T)}function $(T){return T===45||T===46||T===58||T===95||Cn(T)?(e.consume(T),$):j(T)}function j(T){return T===61?(e.consume(T),O):Ee(T)?(s=j,Z(T)):Ve(T)?(e.consume(T),j):R(T)}function O(T){return T===null||T===60||T===61||T===62||T===96?n(T):T===34||T===39?(e.consume(T),a=T,z):Ee(T)?(s=O,Z(T)):Ve(T)?(e.consume(T),O):(e.consume(T),D)}function z(T){return T===a?(e.consume(T),a=void 0,A):T===null?n(T):Ee(T)?(s=z,Z(T)):(e.consume(T),z)}function D(T){return T===null||T===34||T===39||T===60||T===61||T===96?n(T):T===47||T===62||ft(T)?R(T):(e.consume(T),D)}function A(T){return T===47||T===62||ft(T)?R(T):n(T)}function B(T){return T===62?(e.consume(T),e.exit("htmlTextData"),e.exit("htmlText"),t):n(T)}function Z(T){return e.exit("htmlTextData"),e.enter("lineEnding"),e.consume(T),e.exit("lineEnding"),F}function F(T){return Ve(T)?Xe(e,J,"linePrefix",r.parser.constructs.disable.null.includes("codeIndented")?void 0:4)(T):J(T)}function J(T){return e.enter("htmlTextData"),s(T)}}const Rx={name:"labelEnd",resolveAll:Xq,resolveTo:Wq,tokenize:Jq},Gq={tokenize:eH},Qq={tokenize:tH},Yq={tokenize:nH};function Xq(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&&gr(e,0,e.length,n),e}function Wq(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=Rr(o,e.slice(i+1,i+r+3)),o=Rr(o,[["enter",d,t]]),o=Rr(o,hm(t.parser.constructs.insideSpan.null,e.slice(i+r+4,s-3),t)),o=Rr(o,[["exit",d,t],e[s-2],e[s-1],["exit",u,t]]),o=Rr(o,e.slice(s+1)),o=Rr(o,[["exit",l,t]]),gr(e,i,e.length,o),e}function Jq(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(p){return i?i._inactive?f(p):(s=r.parser.defined.includes(Jr(r.sliceSerialize({start:i.end,end:r.now()}))),e.enter("labelEnd"),e.enter("labelMarker"),e.consume(p),e.exit("labelMarker"),e.exit("labelEnd"),l):n(p)}function l(p){return p===40?e.attempt(Gq,d,s?d:f)(p):p===91?e.attempt(Qq,d,s?u:f)(p):s?d(p):f(p)}function u(p){return e.attempt(Yq,d,f)(p)}function d(p){return t(p)}function f(p){return i._balanced=!0,n(p)}}function eH(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)?bu(e,i)(f):i(f)}function i(f){return f===41?d(f):JR(e,s,o,"resourceDestination","resourceDestinationLiteral","resourceDestinationLiteralMarker","resourceDestinationRaw","resourceDestinationString",32)(f)}function s(f){return ft(f)?bu(e,l)(f):d(f)}function o(f){return n(f)}function l(f){return f===34||f===39||f===40?t$(e,u,n,"resourceTitle","resourceTitleMarker","resourceTitleString")(f):d(f)}function u(f){return ft(f)?bu(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 tH(e,t,n){const r=this;return a;function a(o){return e$.call(r,e,i,s,"reference","referenceMarker","referenceString")(o)}function i(o){return r.parser.defined.includes(Jr(r.sliceSerialize(r.events[r.events.length-1][1]).slice(1,-1)))?t(o):n(o)}function s(o){return n(o)}}function nH(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 rH={name:"labelStartImage",resolveAll:Rx.resolveAll,tokenize:aH};function aH(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 iH={name:"labelStartLink",resolveAll:Rx.resolveAll,tokenize:sH};function sH(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 Ig={name:"lineEnding",tokenize:oH};function oH(e,t){return n;function n(r){return e.enter("lineEnding"),e.consume(r),e.exit("lineEnding"),Xe(e,t,"linePrefix")}}const th={name:"thematicBreak",tokenize:lH};function lH(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"),Ve(u)?Xe(e,o,"whitespace")(u):o(u))}}const qn={continuation:{tokenize:fH},exit:pH,name:"list",tokenize:dH},cH={partial:!0,tokenize:mH},uH={partial:!0,tokenize:hH};function dH(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:Hv(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(th,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 Hv(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(Cd,r.interrupt?n:d,e.attempt(cH,p,f))}function d(h){return r.containerState.initialBlankLine=!0,i++,p(h)}function f(h){return Ve(h)?(e.enter("listItemPrefixWhitespace"),e.consume(h),e.exit("listItemPrefixWhitespace"),p):n(h)}function p(h){return r.containerState.size=i+r.sliceSerialize(e.exit("listItemPrefix"),!0).length,t(h)}}function fH(e,t,n){const r=this;return r.containerState._closeFlow=void 0,e.check(Cd,a,i);function a(o){return r.containerState.furtherBlankLines=r.containerState.furtherBlankLines||r.containerState.initialBlankLine,Xe(e,t,"listItemIndent",r.containerState.size+1)(o)}function i(o){return r.containerState.furtherBlankLines||!Ve(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(uH,t,s)(o))}function s(o){return r.containerState._closeFlow=!0,r.interrupt=void 0,Xe(e,e.attempt(qn,t,n),"linePrefix",r.parser.constructs.disable.null.includes("codeIndented")?void 0:4)(o)}}function hH(e,t,n){const r=this;return Xe(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 pH(e){e.exit(this.containerState.type)}function mH(e,t,n){const r=this;return Xe(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!Ve(i)&&s&&s[1].type==="listItemPrefixWhitespace"?t(i):n(i)}}const fk={name:"setextUnderline",resolveTo:gH,tokenize:yH};function gH(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 yH(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"),Ve(u)?Xe(e,l,"lineSuffix")(u):l(u))}function l(u){return u===null||Ee(u)?(e.exit("setextHeadingLine"),t(u)):n(u)}}const vH={tokenize:bH};function bH(e){const t=this,n=e.attempt(Cd,r,e.attempt(this.parser.constructs.flowInitial,a,Xe(e,e.attempt(this.parser.constructs.flow,a,e.attempt(kq,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 xH={resolveAll:r$()},wH=n$("string"),SH=n$("text");function n$(e){return{resolveAll:r$(e==="text"?_H: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 p=-1;if(f)for(;++p<f.length;){const h=f[p];if(!h.previous||h.previous.call(r,r.previous))return!0}return!1}}}function r$(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 _H(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 kH={42:qn,43:qn,45:qn,48:qn,49:qn,50:qn,51:qn,52:qn,53:qn,54:qn,55:qn,56:qn,57:qn,62:QR},EH={91:Tq},CH={[-2]:zg,[-1]:zg,32:zg},NH={35:Pq,42:th,45:[fk,th],60:Lq,61:fk,95:th,96:uk,126:uk},jH={38:XR,92:YR},TH={[-5]:Ig,[-4]:Ig,[-3]:Ig,33:rH,38:XR,42:Bv,60:[iq,Kq],91:iH,92:[Oq,YR],93:Rx,95:Bv,96:vq},AH={null:[Bv,xH]},RH={null:[42,95]},$H={null:[]},OH=Object.freeze(Object.defineProperty({__proto__:null,attentionMarkers:RH,contentInitial:EH,disable:$H,document:kH,flow:NH,flowInitial:CH,insideSpan:AH,string:jH,text:TH},Symbol.toStringTag,{value:"Module"}));function MH(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:N(k),check:N(C),consume:v,enter:x,exit:S,interrupt:N(C,{interrupt:!0})},u={code:null,containerState:{},defineSkip:m,events:[],now:y,parser:e,previous:null,sliceSerialize:p,sliceStream:h,write:f};let d=t.tokenize.call(u,l);return t.resolveAll&&i.push(t),u;function f(j){return s=Rr(s,j),b(),s[s.length-1]!==null?[]:(P(t,0),u.events=hm(i,u.events,u),u.events)}function p(j,O){return DH(h(j),O)}function h(j){return PH(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 m(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 x(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 k(j,O){P(j,O.from)}function C(j,O){O.restore()}function N(j,O){return z;function z(D,A,B){let Z,F,J,T;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 T=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,E,M)(W)}}function E(I){return j(J,T),A}function M(I){return T.restore(),++F<Z.length?_(Z[F]):B}}}function P(j,O){j.resolveAll&&!i.includes(j)&&i.push(j),j.resolve&&gr(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 PH(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 DH(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 zH(e){const r={constructs:ZR([OH,...(e||{}).extensions||[]]),content:a(W8),defined:[],document:a(eq),flow:a(vH),lazy:{},string:a(wH),text:a(SH)};return r;function a(i){return s;function s(o){return MH(r,i,o)}}}function IH(e){for(;!WR(e););return e}const hk=/[\0\t\n\r]/g;function LH(){let e=1,t="",n=!0,r;return a;function a(i,s,o){const l=[];let u,d,f,p,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(hk.lastIndex=f,u=hk.exec(i),p=u&&u.index!==void 0?u.index:i.length,h=i.charCodeAt(p),!u){t=i.slice(f);break}if(h===10&&f===p&&r)l.push(-3),r=void 0;else switch(r&&(l.push(-5),r=void 0),f<p&&(l.push(i.slice(f,p)),e+=p-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=p+1}return o&&(r&&l.push(-5),t&&l.push(t),l.push(null)),l}}const UH=/\\([!-/:-@[-`{-~])|&(#(?:\d{1,7}|x[\da-f]{1,6})|[\da-z]{1,31});/gi;function FH(e){return e.replace(UH,qH)}function qH(e,t,n){if(t)return t;if(n.charCodeAt(0)===35){const a=n.charCodeAt(1),i=a===120||a===88;return GR(n.slice(i?2:1),i?16:10)}return Ax(n)||e}const a$={}.hasOwnProperty;function HH(e,t,n){return t&&typeof t=="object"&&(n=t,t=void 0),BH(n)(IH(zH(n).document().write(LH()(e,t,!0))))}function BH(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:p,listOrdered:i(we,f),listUnordered:i(we),paragraph:i(ht),reference:_,referenceString:s,resourceDestinationString:s,resourceTitleString:s,setextHeading:i(K),strong:i(Lt),thematicBreak:i(rr)},exit:{atxHeading:l(),atxHeadingSequence:k,autolink:l(),autolinkEmail:oe,autolinkProtocol:W,blockQuote:l(),characterEscapeValue:$,characterReferenceMarkerHexadecimal:M,characterReferenceMarkerNumeric:M,characterReferenceValue:I,characterReference:Q,codeFenced:l(b),codeFencedFence:m,codeFencedFenceInfo:h,codeFencedFenceMeta:y,codeFlowValue:$,codeIndented:l(g),codeText:l(A),codeTextData:$,data:$,definition:l(),definitionDestinationString:S,definitionLabelString:v,definitionTitleString:x,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:E,resourceDestinationString:T,resourceTitleString:q,resource:G,setextHeading:l(P),setextHeadingLineSequence:N,setextHeadingText:C,strong:l(),thematicBreak:l()}};i$(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 Ye=-1;for(;++Ye<Y.length;)if(Y[Ye][1].type==="listOrdered"||Y[Ye][1].type==="listUnordered")if(Y[Ye][0]==="enter")je.push(Ye);else{const un=je.pop();Ye=a(Y,un,Ye)}for(Ye=-1;++Ye<Y.length;){const un=t[Y[Ye][0]];a$.call(un,Y[Ye][1].type)&&un[Y[Ye][1].type].call(Object.assign({sliceSerialize:Y[Ye][2].sliceSerialize},Se),Y[Ye][1])}if(Se.tokenStack.length>0){const un=Se.tokenStack[Se.tokenStack.length-1];(un[1]||pk).call(Se,void 0,un[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})},Ye=-1;++Ye<t.transforms.length;)se=t.transforms[Ye](se)||se;return se}function a(Y,se,Se){let je=se-1,Ye=-1,un=!1,wr,Ln,ia,sa;for(;++je<=Se;){const Gt=Y[je];switch(Gt[1].type){case"listUnordered":case"listOrdered":case"blockQuote":{Gt[0]==="enter"?Ye++:Ye--,sa=void 0;break}case"lineEndingBlank":{Gt[0]==="enter"&&(wr&&!sa&&!Ye&&!ia&&(ia=je),sa=void 0);break}case"linePrefix":case"listItemValue":case"listItemMarker":case"listItemPrefix":case"listItemPrefixWhitespace":break;default:sa=void 0}if(!Ye&&Gt[0]==="enter"&&Gt[1].type==="listItemPrefix"||Ye===-1&&Gt[0]==="exit"&&(Gt[1].type==="listUnordered"||Gt[1].type==="listOrdered")){if(wr){let Sr=je;for(Ln=void 0;Sr--;){const Tn=Y[Sr];if(Tn[1].type==="lineEnding"||Tn[1].type==="lineEndingBlank"){if(Tn[0]==="exit")continue;Ln&&(Y[Ln][1].type="lineEndingBlank",un=!0),Tn[1].type="lineEnding",Ln=Sr}else if(!(Tn[1].type==="linePrefix"||Tn[1].type==="blockQuotePrefix"||Tn[1].type==="blockQuotePrefixWhitespace"||Tn[1].type==="blockQuoteMarker"||Tn[1].type==="listItemIndent"))break}ia&&(!Ln||ia<Ln)&&(wr._spread=!0),wr.end=Object.assign({},Ln?Y[Ln][1].start:Gt[1].end),Y.splice(Ln||je,0,["exit",wr,Gt[2]]),je++,Se++}if(Gt[1].type==="listItemPrefix"){const Sr={type:"listItem",_spread:!1,start:Object.assign({},Gt[1].start),end:void 0};wr=Sr,Y.splice(je,0,["enter",Sr,Gt[2]]),je++,Se++,ia=void 0,sa=!0}}}return Y[se][1]._spread=un,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]||pk).call(this,Y,je[0]));else throw new Error("Cannot close `"+Y.type+"` ("+vu({start:Y.start,end:Y.end})+"): it’s not open");Se.position.end=wi(Y.end)}function d(){return Tx(this.stack.pop())}function f(){this.data.expectingFirstListItemValue=!0}function p(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 m(){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=Jr(this.sliceSerialize(Y)).toLowerCase()}function x(){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 k(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 N(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=FH(se),Se.identifier=Jr(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 T(){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 E(Y){const se=this.resume(),Se=this.stack[this.stack.length-1];Se.label=se,Se.identifier=Jr(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=GR(se,Se==="characterReferenceMarkerNumeric"?10:16),this.data.characterReferenceType=void 0):je=Ax(se);const Ye=this.stack[this.stack.length-1];Ye.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 Lt(){return{type:"strong",children:[]}}function gt(){return{type:"text",value:""}}function rr(){return{type:"thematicBreak"}}}function wi(e){return{line:e.line,column:e.column,offset:e.offset}}function i$(e,t){let n=-1;for(;++n<t.length;){const r=t[n];Array.isArray(r)?i$(e,r):VH(e,r)}}function VH(e,t){let n;for(n in t)if(a$.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 pk(e,t){throw e?new Error("Cannot close `"+e.type+"` ("+vu({start:e.start,end:e.end})+"): a different token (`"+t.type+"`, "+vu({start:t.start,end:t.end})+") is open"):new Error("Cannot close document, a token (`"+t.type+"`, "+vu({start:t.start,end:t.end})+") is still open")}function KH(e){const t=this;t.parser=n;function n(r){return HH(r,{...t.data("settings"),...e,extensions:t.data("micromarkExtensions")||[],mdastExtensions:t.data("fromMarkdownExtensions")||[]})}}function ZH(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 GH(e,t){const n={type:"element",tagName:"br",properties:{},children:[]};return e.patch(t,n),[e.applyData(t,n),{type:"text",value:`
|
|
413
|
+
`}]}function QH(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 YH(e,t){const n={type:"element",tagName:"del",properties:{},children:e.all(t)};return e.patch(t,n),e.applyData(t,n)}function XH(e,t){const n={type:"element",tagName:"em",properties:{},children:e.all(t)};return e.patch(t,n),e.applyData(t,n)}function WH(e,t){const n=typeof e.options.clobberPrefix=="string"?e.options.clobberPrefix:"user-content-",r=String(t.identifier).toUpperCase(),a=xc(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 JH(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 eB(e,t){if(e.options.allowDangerousHtml){const n={type:"raw",value:t.value};return e.patch(t,n),e.applyData(t,n)}}function s$(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 tB(e,t){const n=String(t.identifier).toUpperCase(),r=e.definitionById.get(n);if(!r)return s$(e,t);const a={src:xc(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 nB(e,t){const n={src:xc(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 rB(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 aB(e,t){const n=String(t.identifier).toUpperCase(),r=e.definitionById.get(n);if(!r)return s$(e,t);const a={href:xc(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 iB(e,t){const n={href:xc(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 sB(e,t,n){const r=e.all(t),a=n?oB(n):o$(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 oB(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=o$(n[r])}return t}function o$(e){const t=e.spread;return t??e.children.length>1}function lB(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 cB(e,t){const n={type:"element",tagName:"p",properties:{},children:e.all(t)};return e.patch(t,n),e.applyData(t,n)}function uB(e,t){const n={type:"root",children:e.wrap(e.all(t))};return e.patch(t,n),e.applyData(t,n)}function dB(e,t){const n={type:"element",tagName:"strong",properties:{},children:e.all(t)};return e.patch(t,n),e.applyData(t,n)}function fB(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=Ex(t.children[1]),l=UR(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 hB(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],p={},h=s?s[l]:void 0;h&&(p.align=h);let y={type:"element",tagName:i,properties:p,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 pB(e,t){const n={type:"element",tagName:"td",properties:{},children:e.all(t)};return e.patch(t,n),e.applyData(t,n)}const mk=9,gk=32;function mB(e){const t=String(e),n=/\r?\n|\r/g;let r=n.exec(t),a=0;const i=[];for(;r;)i.push(yk(t.slice(a,r.index),a>0,!0),r[0]),a=r.index+r[0].length,r=n.exec(t);return i.push(yk(t.slice(a),a>0,!1)),i.join("")}function yk(e,t,n){let r=0,a=e.length;if(t){let i=e.codePointAt(r);for(;i===mk||i===gk;)r++,i=e.codePointAt(r)}if(n){let i=e.codePointAt(a-1);for(;i===mk||i===gk;)a--,i=e.codePointAt(a-1)}return a>r?e.slice(r,a):""}function gB(e,t){const n={type:"text",value:mB(String(t.value))};return e.patch(t,n),e.applyData(t,n)}function yB(e,t){const n={type:"element",tagName:"hr",properties:{},children:[]};return e.patch(t,n),e.applyData(t,n)}const vB={blockquote:ZH,break:GH,code:QH,delete:YH,emphasis:XH,footnoteReference:WH,heading:JH,html:eB,imageReference:tB,image:nB,inlineCode:rB,linkReference:aB,link:iB,listItem:sB,list:lB,paragraph:cB,root:uB,strong:dB,table:fB,tableCell:pB,tableRow:hB,text:gB,thematicBreak:yB,toml:gf,yaml:gf,definition:gf,footnoteDefinition:gf};function gf(){}const l$=-1,pm=0,xu=1,np=2,$x=3,Ox=4,Mx=5,Px=6,c$=7,u$=8,vk=typeof self=="object"?self:globalThis,bB=(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 pm:case l$:return n(s,a);case xu:{const o=n([],a);for(const l of s)o.push(r(l));return o}case np:{const o=n({},a);for(const[l,u]of s)o[r(l)]=r(u);return o}case $x:return n(new Date(s),a);case Ox:{const{source:o,flags:l}=s;return n(new RegExp(o,l),a)}case Mx:{const o=n(new Map,a);for(const[l,u]of s)o.set(r(l),r(u));return o}case Px:{const o=n(new Set,a);for(const l of s)o.add(r(l));return o}case c$:{const{name:o,message:l}=s;return n(new vk[o](l),a)}case u$: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 vk[i](s),a)};return r},bk=e=>bB(new Map,e)(0),Po="",{toString:xB}={},{keys:wB}=Object,Ic=e=>{const t=typeof e;if(t!=="object"||!e)return[pm,t];const n=xB.call(e).slice(8,-1);switch(n){case"Array":return[xu,Po];case"Object":return[np,Po];case"Date":return[$x,Po];case"RegExp":return[Ox,Po];case"Map":return[Mx,Po];case"Set":return[Px,Po];case"DataView":return[xu,n]}return n.includes("Array")?[xu,n]:n.includes("Error")?[c$,n]:[np,n]},yf=([e,t])=>e===pm&&(t==="function"||t==="symbol"),SB=(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]=Ic(s);switch(o){case pm:{let d=s;switch(l){case"bigint":o=u$,d=s.toString();break;case"function":case"symbol":if(e)throw new TypeError("unable to serialize "+l);d=null;break;case"undefined":return a([l$],s)}return a([o,d],s)}case xu:{if(l){let p=s;return l==="DataView"?p=new Uint8Array(s.buffer):l==="ArrayBuffer"&&(p=new Uint8Array(s)),a([l,[...p]],s)}const d=[],f=a([o,d],s);for(const p of s)d.push(i(p));return f}case np:{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 p of wB(s))(e||!yf(Ic(s[p])))&&d.push([i(p),i(s[p])]);return f}case $x:return a([o,s.toISOString()],s);case Ox:{const{source:d,flags:f}=s;return a([o,{source:d,flags:f}],s)}case Mx:{const d=[],f=a([o,d],s);for(const[p,h]of s)(e||!(yf(Ic(p))||yf(Ic(h))))&&d.push([i(p),i(h)]);return f}case Px:{const d=[],f=a([o,d],s);for(const p of s)(e||!yf(Ic(p)))&&d.push(i(p));return f}}const{message:u}=s;return a([o,{name:l,message:u}],s)};return i},xk=(e,{json:t,lossy:n}={})=>{const r=[];return SB(!(t||n),!!t,new Map,r)(e),r},rp=typeof structuredClone=="function"?(e,t)=>t&&("json"in t||"lossy"in t)?bk(xk(e,t)):structuredClone(e):(e,t)=>bk(xk(e,t));function _B(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 kB(e,t){return"Back to reference "+(e+1)+(t>1?"-"+t:"")}function EB(e){const t=typeof e.options.clobberPrefix=="string"?e.options.clobberPrefix:"user-content-",n=e.options.footnoteBackContent||_B,r=e.options.footnoteBackLabel||kB,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(),p=xc(f.toLowerCase());let h=0;const y=[],m=e.footnoteCounts.get(f);for(;m!==void 0&&++h<=m;){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-"+p+(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-"+p},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:{...rp(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 mm=function(e){if(e==null)return TB;if(typeof e=="function")return gm(e);if(typeof e=="object")return Array.isArray(e)?CB(e):NB(e);if(typeof e=="string")return jB(e);throw new Error("Expected function, string, or object as test")};function CB(e){const t=[];let n=-1;for(;++n<e.length;)t[n]=mm(e[n]);return gm(r);function r(...a){let i=-1;for(;++i<t.length;)if(t[i].apply(this,a))return!0;return!1}}function NB(e){const t=e;return gm(n);function n(r){const a=r;let i;for(i in e)if(a[i]!==t[i])return!1;return!0}}function jB(e){return gm(t);function t(n){return n&&n.type===e}}function gm(e){return t;function t(n,r,a){return!!(AB(n)&&e.call(this,n,typeof r=="number"?r:void 0,a||void 0))}}function TB(){return!0}function AB(e){return e!==null&&typeof e=="object"&&"type"in e}const d$=[],RB=!0,Vv=!1,$B="skip";function f$(e,t,n,r){let a;typeof t=="function"&&typeof n!="function"?(r=n,n=t):a=t;const i=mm(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(p,"name",{value:"node ("+(l.type+(h?"<"+h+">":""))+")"})}return p;function p(){let h=d$,y,m,b;if((!t||i(l,u,d[d.length-1]||void 0))&&(h=OB(n(l,d)),h[0]===Vv))return h;if("children"in l&&l.children){const g=l;if(g.children&&h[0]!==$B)for(m=(r?g.children.length:-1)+s,b=d.concat(g);m>-1&&m<g.children.length;){const v=g.children[m];if(y=o(v,m,b)(),y[0]===Vv)return y;m=typeof y[1]=="number"?y[1]:m+s}}return h}}}function OB(e){return Array.isArray(e)?e:typeof e=="number"?[RB,e]:e==null?d$:[e]}function Dx(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),f$(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 Kv={}.hasOwnProperty,MB={};function PB(e,t){const n=t||MB,r=new Map,a=new Map,i=new Map,s={...vB,...n.handlers},o={all:u,applyData:zB,definitionById:r,footnoteById:a,footnoteCounts:i,footnoteOrder:[],handlers:s,one:l,options:n,patch:DB,wrap:LB};return Dx(e,function(d){if(d.type==="definition"||d.type==="footnoteDefinition"){const f=d.type==="definition"?r:a,p=String(d.identifier).toUpperCase();f.has(p)||f.set(p,d)}}),o;function l(d,f){const p=d.type,h=o.handlers[p];if(Kv.call(o.handlers,p)&&h)return h(o,d,f);if(o.options.passThrough&&o.options.passThrough.includes(p)){if("children"in d){const{children:m,...b}=d,g=rp(b);return g.children=o.all(d),g}return rp(d)}return(o.options.unknownHandler||IB)(o,d,f)}function u(d){const f=[];if("children"in d){const p=d.children;let h=-1;for(;++h<p.length;){const y=o.one(p[h],d);if(y){if(h&&p[h-1].type==="break"&&(!Array.isArray(y)&&y.type==="text"&&(y.value=wk(y.value)),!Array.isArray(y)&&y.type==="element")){const m=y.children[0];m&&m.type==="text"&&(m.value=wk(m.value))}Array.isArray(y)?f.push(...y):f.push(y)}}}return f}}function DB(e,t){e.position&&(t.position=k8(e))}function zB(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,rp(i)),"children"in n&&n.children&&a!==null&&a!==void 0&&(n.children=a)}return n}function IB(e,t){const n=t.data||{},r="value"in t&&!(Kv.call(n,"hProperties")||Kv.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 LB(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 wk(e){let t=0,n=e.charCodeAt(t);for(;n===9||n===32;)t++,n=e.charCodeAt(t);return e.slice(t)}function Sk(e,t){const n=PB(e,t),r=n.one(e,void 0),a=EB(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 UB(e,t){return e&&"run"in e?async function(n,r){const a=Sk(n,{file:r,...t});await e.run(a,r)}:function(n,r){return Sk(n,{file:r,...e||t})}}function _k(e){if(e)throw e}var nh=Object.prototype.hasOwnProperty,h$=Object.prototype.toString,kk=Object.defineProperty,Ek=Object.getOwnPropertyDescriptor,Ck=function(t){return typeof Array.isArray=="function"?Array.isArray(t):h$.call(t)==="[object Array]"},Nk=function(t){if(!t||h$.call(t)!=="[object Object]")return!1;var n=nh.call(t,"constructor"),r=t.constructor&&t.constructor.prototype&&nh.call(t.constructor.prototype,"isPrototypeOf");if(t.constructor&&!n&&!r)return!1;var a;for(a in t);return typeof a>"u"||nh.call(t,a)},jk=function(t,n){kk&&n.name==="__proto__"?kk(t,n.name,{enumerable:!0,configurable:!0,value:n.newValue,writable:!0}):t[n.name]=n.newValue},Tk=function(t,n){if(n==="__proto__")if(nh.call(t,n)){if(Ek)return Ek(t,n).value}else return;return t[n]},FB=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=Tk(o,n),a=Tk(t,n),o!==a&&(d&&a&&(Nk(a)||(i=Ck(a)))?(i?(i=!1,s=r&&Ck(r)?r:[]):s=r&&Nk(r)?r:{},jk(o,{name:n,newValue:e(d,s,a)})):typeof a<"u"&&jk(o,{name:n,newValue:a}));return o};const Lg=ac(FB);function Zv(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 qB(){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?HB(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 HB(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:BB,dirname:VB,extname:KB,join:ZB,sep:"/"};function BB(e,t){if(t!==void 0&&typeof t!="string")throw new TypeError('"ext" argument must be a string');Nd(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 VB(e){if(Nd(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 KB(e){Nd(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 ZB(...e){let t=-1,n;for(;++t<e.length;)Nd(e[t]),e[t]&&(n=n===void 0?e[t]:n+"/"+e[t]);return n===void 0?".":GB(n)}function GB(e){Nd(e);const t=e.codePointAt(0)===47;let n=QB(e,!t);return n.length===0&&!t&&(n="."),n.length>0&&e.codePointAt(e.length-1)===47&&(n+="/"),t?"/"+n:n}function QB(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 Nd(e){if(typeof e!="string")throw new TypeError("Path must be a string. Received "+JSON.stringify(e))}const YB={cwd:XB};function XB(){return"/"}function Gv(e){return!!(e!==null&&typeof e=="object"&&"href"in e&&e.href&&"protocol"in e&&e.protocol&&e.auth===void 0)}function WB(e){if(typeof e=="string")e=new URL(e);else if(!Gv(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 JB(e)}function JB(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 Ug=["history","path","basename","stem","extname","dirname"];class p${constructor(t){let n;t?Gv(t)?n={path:t}:typeof t=="string"||eV(t)?n={value:t}:n=t:n={},this.cwd="cwd"in n?"":YB.cwd(),this.data={},this.history=[],this.messages=[],this.value,this.map,this.result,this.stored;let r=-1;for(;++r<Ug.length;){const i=Ug[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)Ug.includes(a)||(this[a]=n[a])}get basename(){return typeof this.path=="string"?la.basename(this.path):void 0}set basename(t){qg(t,"basename"),Fg(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){Ak(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(Fg(t,"extname"),Ak(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){Gv(t)&&(t=WB(t)),qg(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){qg(t,"stem"),Fg(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 jn(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 Fg(e,t){if(e&&e.includes(la.sep))throw new Error("`"+t+"` cannot be a path: did not expect `"+la.sep+"`")}function qg(e,t){if(!e)throw new Error("`"+t+"` cannot be empty")}function Ak(e,t){if(!e)throw new Error("Setting `"+t+"` requires `path` to be set too")}function eV(e){return!!(e&&typeof e=="object"&&"byteLength"in e&&"byteOffset"in e)}const tV=function(e){const r=this.constructor.prototype,a=r[e],i=function(){return a.apply(i,arguments)};return Object.setPrototypeOf(i,r),i},nV={}.hasOwnProperty;class zx extends tV{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=qB()}copy(){const t=new zx;let n=-1;for(;++n<this.attachers.length;){const r=this.attachers[n];t.use(...r)}return t.data(Lg(!0,{},this.namespace)),t}data(t,n){return typeof t=="string"?arguments.length===2?(Vg("data",this.frozen),this.namespace[t]=n,this):nV.call(this.namespace,t)&&this.namespace[t]||void 0:t?(Vg("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=vf(t),r=this.parser||this.Parser;return Hg("parse",r),r(String(n),n)}process(t,n){const r=this;return this.freeze(),Hg("process",this.parser||this.Parser),Bg("process",this.compiler||this.Compiler),n?a(void 0,n):new Promise(a);function a(i,s){const o=vf(t),l=r.parse(o);r.run(l,o,function(d,f,p){if(d||!f||!p)return u(d);const h=f,y=r.stringify(h,p);iV(y)?p.value=y:p.result=y,u(d,p)});function u(d,f){d||!f?s(d):i?i(f):n(void 0,f)}}}processSync(t){let n=!1,r;return this.freeze(),Hg("processSync",this.parser||this.Parser),Bg("processSync",this.compiler||this.Compiler),this.process(t,a),$k("processSync","process",n),r;function a(i,s){n=!0,_k(i),r=s}}run(t,n,r){Rk(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=vf(n);a.run(t,l,u);function u(d,f,p){const h=f||t;d?o(d):s?s(h):r(void 0,h,p)}}}runSync(t,n){let r=!1,a;return this.run(t,n,i),$k("runSync","run",r),a;function i(s,o){_k(s),a=o,r=!0}}stringify(t,n){this.freeze();const r=vf(n),a=this.compiler||this.Compiler;return Bg("stringify",a),Rk(t),a(t,r)}use(t,...n){const r=this.attachers,a=this.namespace;if(Vg("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=Lg(!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,p=-1;for(;++f<r.length;)if(r[f][0]===u){p=f;break}if(p===-1)r.push([u,...d]);else if(d.length>0){let[h,...y]=d;const m=r[p][1];Zv(m)&&Zv(h)&&(h=Lg(!0,m,h)),r[p]=[u,h,...y]}}}}const rV=new zx().freeze();function Hg(e,t){if(typeof t!="function")throw new TypeError("Cannot `"+e+"` without `parser`")}function Bg(e,t){if(typeof t!="function")throw new TypeError("Cannot `"+e+"` without `compiler`")}function Vg(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 Rk(e){if(!Zv(e)||typeof e.type!="string")throw new TypeError("Expected node, got `"+e+"`")}function $k(e,t,n){if(!n)throw new Error("`"+e+"` finished async. Use `"+t+"` instead")}function vf(e){return aV(e)?e:new p$(e)}function aV(e){return!!(e&&typeof e=="object"&&"message"in e&&"messages"in e)}function iV(e){return typeof e=="string"||sV(e)}function sV(e){return!!(e&&typeof e=="object"&&"byteLength"in e&&"byteOffset"in e)}const oV="https://github.com/remarkjs/react-markdown/blob/main/changelog.md",Ok=[],Mk={allowDangerousHtml:!0},lV=/^(https?|ircs?|mailto|xmpp)$/i,cV=[{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 uV(e){const t=dV(e),n=fV(e);return hV(t.runSync(t.parse(n),n),e)}function dV(e){const t=e.rehypePlugins||Ok,n=e.remarkPlugins||Ok,r=e.remarkRehypeOptions?{...e.remarkRehypeOptions,...Mk}:Mk;return rV().use(KH).use(n).use(UB,r).use(t)}function fV(e){const t=e.children||"",n=new p$;return typeof t=="string"&&(n.value=t),n}function hV(e,t){const n=t.allowedElements,r=t.allowElement,a=t.components,i=t.disallowedElements,s=t.skipHtml,o=t.unwrapDisallowed,l=t.urlTransform||pV;for(const d of cV)Object.hasOwn(t,d.from)&&(""+d.from+(d.to?"use `"+d.to+"` instead":"remove it")+oV+d.id,void 0);return Dx(e,u),T8(e,{Fragment:c.Fragment,components:a,ignoreInvalidStyle:!0,jsx:c.jsx,jsxs:c.jsxs,passKeys:!0,passNode:!0});function u(d,f,p){if(d.type==="raw"&&p&&typeof f=="number")return s?p.children.splice(f,1):p.children[f]={type:"text",value:d.value},f;if(d.type==="element"){let h;for(h in Dg)if(Object.hasOwn(Dg,h)&&Object.hasOwn(d.properties,h)){const y=d.properties[h],m=Dg[h];(m===null||m.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,p)),h&&p&&typeof f=="number")return o&&d.children?p.children.splice(f,1,...d.children):p.children.splice(f,1),f}}}function pV(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||lV.test(e.slice(0,t))?e:""}function Pk(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 mV(e){if(typeof e!="string")throw new TypeError("Expected a string");return e.replace(/[|\\{}()[\]^$+*?.]/g,"\\$&").replace(/-/g,"\\x2d")}function gV(e,t,n){const a=mm((n||{}).ignore||[]),i=yV(t);let s=-1;for(;++s<i.length;)f$(e,"text",o);function o(u,d){let f=-1,p;for(;++f<d.length;){const h=d[f],y=p?p.children:void 0;if(a(h,y?y.indexOf(h):void 0,p))return;p=h}if(p)return l(u,d)}function l(u,d){const f=d[d.length-1],p=i[s][0],h=i[s][1];let y=0;const b=f.children.indexOf(u);let g=!1,v=[];p.lastIndex=0;let x=p.exec(u.value);for(;x;){const S=x.index,k={index:x.index,input:x.input,stack:[...d,u]};let C=h(...x,k);if(typeof C=="string"&&(C=C.length>0?{type:"text",value:C}:void 0),C===!1?p.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+x[0].length,g=!0),!p.global)break;x=p.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 yV(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([vV(a[0]),bV(a[1])])}return t}function vV(e){return typeof e=="string"?new RegExp(mV(e),"g"):e}function bV(e){return typeof e=="function"?e:function(){return e}}const Kg="phrasing",Zg=["autolink","link","image","label"];function xV(){return{transforms:[NV],enter:{literalAutolink:SV,literalAutolinkEmail:Gg,literalAutolinkHttp:Gg,literalAutolinkWww:Gg},exit:{literalAutolink:CV,literalAutolinkEmail:EV,literalAutolinkHttp:_V,literalAutolinkWww:kV}}}function wV(){return{unsafe:[{character:"@",before:"[+\\-.\\w]",after:"[\\-.\\w]",inConstruct:Kg,notInConstruct:Zg},{character:".",before:"[Ww]",after:"[\\-.\\w]",inConstruct:Kg,notInConstruct:Zg},{character:":",before:"[ps]",after:"\\/",inConstruct:Kg,notInConstruct:Zg}]}}function SV(e){this.enter({type:"link",title:null,url:"",children:[]},e)}function Gg(e){this.config.enter.autolinkProtocol.call(this,e)}function _V(e){this.config.exit.autolinkProtocol.call(this,e)}function kV(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 EV(e){this.config.exit.autolinkEmail.call(this,e)}function CV(e){this.exit(e)}function NV(e){gV(e,[[/(https?:\/\/|www(?=\.))([-.\w]+)([^ \t\r\n]*)/gi,jV],[new RegExp("(?<=^|\\s|\\p{P}|\\p{S})([-.\\w+]+)@([-\\w]+(?:\\.[-\\w]+)+)","gu"),TV]],{ignore:["link","linkReference"]})}function jV(e,t,n,r,a){let i="";if(!m$(a)||(/^w/i.test(t)&&(n=t+n,t="",i="http://"),!AV(n)))return!1;const s=RV(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 TV(e,t,n,r){return!m$(r,!0)||/[-\d_]$/.test(n)?!1:{type:"link",title:null,url:"mailto:"+t+"@"+n,children:[{type:"text",value:t+"@"+n}]}}function AV(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 RV(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=Pk(e,"(");let i=Pk(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 m$(e,t){const n=e.input.charCodeAt(e.index-1);return(e.index===0||mo(n)||fm(n))&&(!t||n!==47)}g$.peek=UV;function $V(){this.buffer()}function OV(e){this.enter({type:"footnoteReference",identifier:"",label:""},e)}function MV(){this.buffer()}function PV(e){this.enter({type:"footnoteDefinition",identifier:"",label:"",children:[]},e)}function DV(e){const t=this.resume(),n=this.stack[this.stack.length-1];n.type,n.identifier=Jr(this.sliceSerialize(e)).toLowerCase(),n.label=t}function zV(e){this.exit(e)}function IV(e){const t=this.resume(),n=this.stack[this.stack.length-1];n.type,n.identifier=Jr(this.sliceSerialize(e)).toLowerCase(),n.label=t}function LV(e){this.exit(e)}function UV(){return"["}function g$(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 FV(){return{enter:{gfmFootnoteCallString:$V,gfmFootnoteCall:OV,gfmFootnoteDefinitionLabelString:MV,gfmFootnoteDefinition:PV},exit:{gfmFootnoteCallString:DV,gfmFootnoteCall:zV,gfmFootnoteDefinitionLabelString:IV,gfmFootnoteDefinition:LV}}}function qV(e){let t=!1;return e&&e.firstLineBlank&&(t=!0),{handlers:{footnoteDefinition:n,footnoteReference:g$},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?y$:HV))),u(),l}}function HV(e,t,n){return t===0?e:y$(e,t,n)}function y$(e,t,n){return(n?"":" ")+e}const BV=["autolink","destinationLiteral","destinationRaw","reference","titleQuote","titleApostrophe"];v$.peek=QV;function VV(){return{canContainEols:["delete"],enter:{strikethrough:ZV},exit:{strikethrough:GV}}}function KV(){return{unsafe:[{character:"~",inConstruct:"phrasing",notInConstruct:BV}],handlers:{delete:v$}}}function ZV(e){this.enter({type:"delete",children:[]},e)}function GV(e){this.exit(e)}function v$(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 QV(){return"~"}function YV(e){return e.length}function XV(e,t){const n=t||{},r=(n.align||[]).concat(),a=n.stringLength||YV,i=[],s=[],o=[],l=[];let u=0,d=-1;for(;++d<e.length;){const m=[],b=[];let g=-1;for(e[d].length>u&&(u=e[d].length);++g<e[d].length;){const v=WV(e[d][g]);if(n.alignDelimiters!==!1){const x=a(v);b[g]=x,(l[g]===void 0||x>l[g])&&(l[g]=x)}m.push(v)}s[d]=m,o[d]=b}let f=-1;if(typeof r=="object"&&"length"in r)for(;++f<u;)i[f]=Dk(r[f]);else{const m=Dk(r);for(;++f<u;)i[f]=m}f=-1;const p=[],h=[];for(;++f<u;){const m=i[f];let b="",g="";m===99?(b=":",g=":"):m===108?b=":":m===114&&(g=":");let v=n.alignDelimiters===!1?1:Math.max(1,l[f]-b.length-g.length);const x=b+"-".repeat(v)+g;n.alignDelimiters!==!1&&(v=b.length+v+g.length,v>l[f]&&(l[f]=v),h[f]=v),p[f]=x}s.splice(1,0,p),o.splice(1,0,h),d=-1;const y=[];for(;++d<s.length;){const m=s[d],b=o[d];f=-1;const g=[];for(;++f<u;){const v=m[f]||"";let x="",S="";if(n.alignDelimiters!==!1){const k=l[f]-(b[f]||0),C=i[f];C===114?x=" ".repeat(k):C===99?k%2?(x=" ".repeat(k/2+.5),S=" ".repeat(k/2-.5)):(x=" ".repeat(k/2),S=x):S=" ".repeat(k)}n.delimiterStart!==!1&&!f&&g.push("|"),n.padding!==!1&&!(n.alignDelimiters===!1&&v==="")&&(n.delimiterStart!==!1||f)&&g.push(" "),n.alignDelimiters!==!1&&g.push(x),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 WV(e){return e==null?"":String(e)}function Dk(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 JV(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()),e7);return a(),s}function e7(e,t,n){return">"+(n?"":" ")+e}function t7(e,t){return zk(e,t.inConstruct,!0)&&!zk(e,t.notInConstruct,!1)}function zk(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 Ik(e,t,n,r){let a=-1;for(;++a<n.unsafe.length;)if(n.unsafe[a].character===`
|
|
425
|
+
`&&t7(n.stack,n.unsafe[a]))return/[ \t]/.test(r.before)?"":" ";return`\\
|
|
426
|
+
`}function n7(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 r7(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 a7(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 i7(e,t,n,r){const a=a7(n),i=e.value||"",s=a==="`"?"GraveAccent":"Tilde";if(r7(e,n)){const f=n.enter("codeIndented"),p=n.indentLines(i,s7);return f(),p}const o=n.createTracker(r),l=a.repeat(Math.max(n7(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 s7(e,t,n){return(n?"":" ")+e}function Ix(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 o7(e,t,n,r){const a=Ix(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 l7(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 Qu(e){return"&#x"+e.toString(16).toUpperCase()+";"}function ap(e,t,n){const r=ec(e),a=ec(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}}b$.peek=c7;function b$(e,t,n,r){const a=l7(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=ap(r.before.charCodeAt(r.before.length-1),u,a);d.inside&&(l=Qu(u)+l.slice(1));const f=l.charCodeAt(l.length-1),p=ap(r.after.charCodeAt(0),f,a);p.inside&&(l=l.slice(0,-1)+Qu(f));const h=s.move(a);return i(),n.attentionEncodeSurroundingInfo={after:p.outside,before:d.outside},o+l+h}function c7(e,t,n){return n.options.emphasis||"*"}function u7(e,t){let n=!1;return Dx(e,function(r){if("value"in r&&/\r?\n|\r/.test(r.value)||r.type==="break")return n=!0,Vv}),!!((!e.depth||e.depth<3)&&Tx(e)&&(t.options.setext||n))}function d7(e,t,n,r){const a=Math.max(Math.min(6,e.depth||1),1),i=n.createTracker(r);if(u7(e,n)){const d=n.enter("headingSetext"),f=n.enter("phrasing"),p=n.containerPhrasing(e,{...i.current(),before:`
|
|
431
|
+
`,after:`
|
|
432
|
+
`});return f(),d(),p+`
|
|
433
|
+
`+(a===1?"=":"-").repeat(p.length-(Math.max(p.lastIndexOf("\r"),p.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=Qu(u.charCodeAt(0))+u.slice(1)),u=u?s+" "+u:s,n.options.closeAtx&&(u+=" "+s),l(),o(),u}x$.peek=f7;function x$(e){return e.value||""}function f7(){return"<"}w$.peek=h7;function w$(e,t,n,r){const a=Ix(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 h7(){return"!"}S$.peek=p7;function S$(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 p7(){return"!"}_$.peek=m7;function _$(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 m7(){return"`"}function k$(e,t){const n=Tx(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))}E$.peek=g7;function E$(e,t,n,r){const a=Ix(n),i=a==='"'?"Quote":"Apostrophe",s=n.createTracker(r);let o,l;if(k$(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 g7(e,t,n){return k$(e,n)?"<":"["}C$.peek=y7;function C$(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 y7(){return"["}function Lx(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 v7(e){const t=Lx(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 b7(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 N$(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 x7(e,t,n,r){const a=n.enter("list"),i=n.bulletCurrent;let s=e.ordered?b7(n):Lx(n);const o=e.ordered?s==="."?")":".":v7(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),N$(n)===s&&d){let f=-1;for(;++f<e.children.length;){const p=e.children[f];if(p&&p.type==="listItem"&&p.children&&p.children[0]&&p.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 w7(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 S7(e,t,n,r){const a=w7(n);let i=n.bulletCurrent||Lx(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,p,h){return p?(h?"":" ".repeat(s))+f:(h?i:i+" ".repeat(s-i.length))+f}}function _7(e,t,n,r){const a=n.enter("paragraph"),i=n.enter("phrasing"),s=n.containerPhrasing(e,r);return i(),a(),s}const k7=mm(["break","delete","emphasis","footnote","footnoteReference","image","imageReference","inlineCode","inlineMath","link","linkReference","mdxJsxTextElement","mdxTextExpression","strong","text","textDirective"]);function E7(e,t,n,r){return(e.children.some(function(s){return k7(s)})?n.containerPhrasing:n.containerFlow).call(n,e,r)}function C7(e){const t=e.options.strong||"*";if(t!=="*"&&t!=="_")throw new Error("Cannot serialize strong with `"+t+"` for `options.strong`, expected `*`, or `_`");return t}j$.peek=N7;function j$(e,t,n,r){const a=C7(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=ap(r.before.charCodeAt(r.before.length-1),u,a);d.inside&&(l=Qu(u)+l.slice(1));const f=l.charCodeAt(l.length-1),p=ap(r.after.charCodeAt(0),f,a);p.inside&&(l=l.slice(0,-1)+Qu(f));const h=s.move(a+a);return i(),n.attentionEncodeSurroundingInfo={after:p.outside,before:d.outside},o+l+h}function N7(e,t,n){return n.options.strong||"*"}function j7(e,t,n,r){return n.safe(e.value,r)}function T7(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 A7(e,t,n){const r=(N$(n)+(n.options.ruleSpaces?" ":"")).repeat(T7(n));return n.options.ruleSpaces?r.slice(0,-1):r}const T$={blockquote:JV,break:Ik,code:i7,definition:o7,emphasis:b$,hardBreak:Ik,heading:d7,html:x$,image:w$,imageReference:S$,inlineCode:_$,link:E$,linkReference:C$,list:x7,listItem:S7,paragraph:_7,root:E7,strong:j$,text:j7,thematicBreak:A7};function R7(){return{enter:{table:$7,tableData:Lk,tableHeader:Lk,tableRow:M7},exit:{codeText:P7,table:O7,tableData:Qg,tableHeader:Qg,tableRow:Qg}}}function $7(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 O7(e){this.exit(e),this.data.inTable=void 0}function M7(e){this.enter({type:"tableRow",children:[]},e)}function Qg(e){this.exit(e)}function Lk(e){this.enter({type:"tableCell",children:[]},e)}function P7(e){let t=this.resume();this.data.inTable&&(t=t.replace(/\\([\\|])/g,D7));const n=this.stack[this.stack.length-1];n.type,n.value=t,this.exit(e)}function D7(e,t){return t==="|"?t:e}function z7(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:p,table:s,tableCell:l,tableRow:o}};function s(h,y,m,b){return u(d(h,m,b),h.align)}function o(h,y,m,b){const g=f(h,m,b),v=u([g]);return v.slice(0,v.indexOf(`
|
|
437
|
+
`))}function l(h,y,m,b){const g=m.enter("tableCell"),v=m.enter("phrasing"),x=m.containerPhrasing(h,{...b,before:i,after:i});return v(),g(),x}function u(h,y){return XV(h,{align:y,alignDelimiters:r,padding:n,stringLength:a})}function d(h,y,m){const b=h.children;let g=-1;const v=[],x=y.enter("table");for(;++g<b.length;)v[g]=f(b[g],y,m);return x(),v}function f(h,y,m){const b=h.children;let g=-1;const v=[],x=y.enter("tableRow");for(;++g<b.length;)v[g]=l(b[g],h,y,m);return x(),v}function p(h,y,m){let b=T$.inlineCode(h,y,m);return m.stack.includes("tableCell")&&(b=b.replace(/\|/g,"\\$&")),b}}function I7(){return{exit:{taskListCheckValueChecked:Uk,taskListCheckValueUnchecked:Uk,paragraph:U7}}}function L7(){return{unsafe:[{atBreak:!0,character:"-",after:"[:|-]"}],handlers:{listItem:F7}}}function Uk(e){const t=this.stack[this.stack.length-2];t.type,t.checked=e.type==="taskListCheckValueChecked"}function U7(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 F7(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=T$.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 q7(){return[xV(),FV(),VV(),R7(),I7()]}function H7(e){return{extensions:[wV(),qV(e),KV(),z7(e),L7()]}}const B7={tokenize:Y7,partial:!0},A$={tokenize:X7,partial:!0},R$={tokenize:W7,partial:!0},$$={tokenize:J7,partial:!0},V7={tokenize:eK,partial:!0},O$={name:"wwwAutolink",tokenize:G7,previous:P$},M$={name:"protocolAutolink",tokenize:Q7,previous:D$},yi={name:"emailAutolink",tokenize:Z7,previous:z$},Ca={};function K7(){return{text:Ca}}let Cs=48;for(;Cs<123;)Ca[Cs]=yi,Cs++,Cs===58?Cs=65:Cs===91&&(Cs=97);Ca[43]=yi;Ca[45]=yi;Ca[46]=yi;Ca[95]=yi;Ca[72]=[yi,M$];Ca[104]=[yi,M$];Ca[87]=[yi,O$];Ca[119]=[yi,O$];function Z7(e,t,n){const r=this;let a,i;return s;function s(f){return!Qv(f)||!z$.call(r,r.previous)||Ux(r.events)?n(f):(e.enter("literalAutolink"),e.enter("literalAutolinkEmail"),o(f))}function o(f){return Qv(f)?(e.consume(f),o):f===64?(e.consume(f),l):n(f)}function l(f){return f===46?e.check(V7,d,u)(f):f===45||f===95||Cn(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&&Dn(r.previous)?(e.exit("literalAutolinkEmail"),e.exit("literalAutolink"),t(f)):n(f)}}function G7(e,t,n){const r=this;return a;function a(s){return s!==87&&s!==119||!P$.call(r,r.previous)||Ux(r.events)?n(s):(e.enter("literalAutolink"),e.enter("literalAutolinkWww"),e.check(B7,e.attempt(A$,e.attempt(R$,i),n),n)(s))}function i(s){return e.exit("literalAutolinkWww"),e.exit("literalAutolink"),t(s)}}function Q7(e,t,n){const r=this;let a="",i=!1;return s;function s(f){return(f===72||f===104)&&D$.call(r,r.previous)&&!Ux(r.events)?(e.enter("literalAutolink"),e.enter("literalAutolinkHttp"),a+=String.fromCodePoint(f),e.consume(f),o):n(f)}function o(f){if(Dn(f)&&a.length<5)return a+=String.fromCodePoint(f),e.consume(f),o;if(f===58){const p=a.toLowerCase();if(p==="http"||p==="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||tp(f)||ft(f)||mo(f)||fm(f)?n(f):e.attempt(A$,e.attempt(R$,d),n)(f)}function d(f){return e.exit("literalAutolinkHttp"),e.exit("literalAutolink"),t(f)}}function Y7(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 X7(e,t,n){let r,a,i;return s;function s(u){return u===46||u===95?e.check($$,l,o)(u):u===null||ft(u)||mo(u)||u!==45&&fm(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 W7(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($$,t,i)(s):s===null||ft(s)||mo(s)?t(s):(e.consume(s),a)}function i(s){return s===41&&r++,e.consume(s),a}}function J7(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)||mo(o)?t(o):n(o)}function a(o){return o===null||o===40||o===91||ft(o)||mo(o)?t(o):r(o)}function i(o){return Dn(o)?s(o):n(o)}function s(o){return o===59?(e.consume(o),r):Dn(o)?(e.consume(o),s):n(o)}}function eK(e,t,n){return r;function r(i){return e.consume(i),a}function a(i){return Cn(i)?n(i):t(i)}}function P$(e){return e===null||e===40||e===42||e===95||e===91||e===93||e===126||ft(e)}function D$(e){return!Dn(e)}function z$(e){return!(e===47||Qv(e))}function Qv(e){return e===43||e===45||e===46||e===95||Cn(e)}function Ux(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 tK={tokenize:cK,partial:!0};function nK(){return{document:{91:{name:"gfmFootnoteDefinition",tokenize:sK,continuation:{tokenize:oK},exit:lK}},text:{91:{name:"gfmFootnoteCall",tokenize:iK},93:{name:"gfmPotentialFootnoteCall",add:"after",tokenize:rK,resolveTo:aK}}}}function rK(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=Jr(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 aK(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 iK(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 p=e.exit("gfmFootnoteCallString");return a.includes(Jr(r.sliceSerialize(p)))?(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 sK(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 m=e.exit("gfmFootnoteDefinitionLabelString");return i=Jr(r.sliceSerialize(m)),e.enter("gfmFootnoteDefinitionLabelMarker"),e.consume(y),e.exit("gfmFootnoteDefinitionLabelMarker"),e.exit("gfmFootnoteDefinitionLabel"),p}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 p(y){return y===58?(e.enter("definitionMarker"),e.consume(y),e.exit("definitionMarker"),a.includes(i)||a.push(i),Xe(e,h,"gfmFootnoteDefinitionWhitespace")):n(y)}function h(y){return t(y)}}function oK(e,t,n){return e.check(Cd,t,e.attempt(tK,t,n))}function lK(e){e.exit("gfmFootnoteDefinition")}function cK(e,t,n){const r=this;return Xe(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 uK(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)},p=[["enter",d,o],["enter",s[u][1],o],["exit",s[u][1],o],["enter",f,o]],h=o.parser.constructs.insideSpan.null;h&&gr(p,p.length,0,hm(h,s.slice(u+1,l),o)),gr(p,p.length,0,[["exit",f,o],["enter",s[l][1],o],["exit",s[l][1],o],["exit",d,o]]),gr(s,u-1,l-u+3,p),l=u+p.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 p;function p(y){return u===126&&d[d.length-1][1].type!=="characterEscape"?l(y):(s.enter("strikethroughSequenceTemporary"),h(y))}function h(y){const m=ec(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=ec(y);return b._open=!g||g===2&&!!m,b._close=!m||m===2&&!!g,o(y)}}}class dK{constructor(){this.map=[]}add(t,n,r){fK(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 fK(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 hK(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 pK(){return{flow:{null:{name:"table",tokenize:mK,resolveAll:gK}}}}function mK(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($):Ve($)?Xe(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?p:f)}function p($){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,Ve($)?Xe(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"),m):k($)}function m($){return Ve($)?Xe(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($):k($)}function g($){return $===45?(e.enter("tableDelimiterFiller"),v($)):k($)}function v($){return $===45?(e.consume($),v):$===58?(s=!0,e.exit("tableDelimiterFiller"),e.enter("tableDelimiterMarker"),e.consume($),e.exit("tableDelimiterMarker"),x):(e.exit("tableDelimiterFiller"),x($))}function x($){return Ve($)?Xe(e,S,"whitespace")($):S($)}function S($){return $===124?y($):$===null||Ee($)?!s||a!==i?k($):(e.exit("tableDelimiterRow"),e.exit("tableHead"),t($)):k($)}function k($){return n($)}function C($){return e.enter("tableRow"),N($)}function N($){return $===124?(e.enter("tableCellDivider"),e.consume($),e.exit("tableCellDivider"),N):$===null||Ee($)?(e.exit("tableRow"),t($)):Ve($)?Xe(e,N,"whitespace")($):(e.enter("data"),P($))}function P($){return $===null||$===124||ft($)?(e.exit("data"),N($)):(e.consume($),$===92?R:P)}function R($){return $===92||$===124?(e.consume($),P):P($)}}function gK(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 p=new dK;for(;++n<e.length;){const h=e[n],y=h[1];h[0]==="enter"?y.type==="tableHead"?(o=!1,l!==0&&(Fk(p,t,l,u,d),d=void 0,l=0),u={type:"table",start:Object.assign({},y.start),end:Object.assign({},y.end)},p.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)},p.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=bf(p,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=bf(p,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=bf(p,t,i,a,n,f)):s[1]!==0&&(f=bf(p,t,s,a,n,f)),a=0):a&&(y.type==="data"||y.type==="tableDelimiterMarker"||y.type==="tableDelimiterFiller")&&(s[3]=n)}for(l!==0&&Fk(p,t,l,u,d),p.consume(t.events),n=-1;++n<t.events.length;){const h=t.events[n];h[0]==="enter"&&h[1].type==="table"&&(h[1]._align=hK(t.events,n))}return e}function bf(e,t,n,r,a,i){const s=r===1?"tableHeader":r===2?"tableDelimiter":"tableData",o="tableContent";n[0]!==0&&(i.end=Object.assign({},qo(t.events,n[0])),e.add(n[0],0,[["exit",i,t]]));const l=qo(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=qo(t.events,n[2]),d=qo(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 p=t.events[n[2]],h=t.events[n[3]];if(p[1].end=Object.assign({},h[1].end),p[1].type="chunkText",p[1].contentType="text",n[3]>n[2]+1){const y=n[2]+1,m=n[3]-n[2]-1;e.add(y,m,[])}}e.add(n[3]+1,0,[["exit",f,t]])}return a!==void 0&&(i.end=Object.assign({},qo(t.events,a)),e.add(a,0,[["exit",i,t]]),i=void 0),i}function Fk(e,t,n,r,a){const i=[],s=qo(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 qo(e,t){const n=e[t],r=n[0]==="enter"?"start":"end";return n[1][r]}const yK={name:"tasklistCheck",tokenize:bK};function vK(){return{text:{91:yK}}}function bK(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):Ve(l)?e.check({tokenize:xK},t,n)(l):n(l)}}function xK(e,t,n){return Xe(e,r,"whitespace");function r(a){return a===null?n(a):t(a)}}function wK(e){return ZR([K7(),nK(),uK(e),pK(),vK()])}const SK={};function _K(e){const t=this,n=e||SK,r=t.data(),a=r.micromarkExtensions||(r.micromarkExtensions=[]),i=r.fromMarkdownExtensions||(r.fromMarkdownExtensions=[]),s=r.toMarkdownExtensions||(r.toMarkdownExtensions=[]);a.push(wK(n)),i.push(q7()),s.push(H7(n))}const ip=180;function kK(e){return e.replace(/\*\*([^*]+)\*\*/g,"$1").replace(/`([^`]+)`/g,"$1").replace(/^#+\s+/gm,"").replace(/\s+/g," ").trim()}function EK(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=kK(n);return r.length<=ip?r:`${r.slice(0,ip-1).trimEnd()}…`}function CK(e,t){return t!=null&&t.trim()&&e.length>ip?!0:e.length>ip||/\n/.test(e)}function NK({description:e,title:t,expanded:n,onToggle:r}){const a=EK(e,t),i=CK(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(Yp,{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 jK({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(uV,{remarkPlugins:[_K],children:e})})})}function TK(){const[e,t]=w.useState(null);return{expandedDescription:e,toggleDescription:r=>{t(a=>a===r?null:r)}}}function Yg(e){return new Set(e.filter(t=>t.enabled===!1).map(t=>t.name))}function AK({serviceId:e,tools:t,isLoading:n}){const[r,a]=w.useState(""),[i,s]=w.useState(null),{expandedDescription:o,toggleDescription:l}=TK(),[u,d]=w.useState(()=>Yg(t)),f=ln(),{toast:p}=tn(),h=w.useMemo(()=>t.map(S=>`${S.name}:${S.enabled===!1?"0":"1"}`).sort().join("\0"),[t]);w.useEffect(()=>{d(Yg(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=>{p({title:"Could not save tool settings",description:S.message,variant:"destructive"}),d(Yg(t))}}),m=S=>{d(S),y.mutate([...S])},b=(S,k)=>{const C=new Set(u);k?C.delete(S):C.add(S),m(C)},g=S=>{if(S){m(new Set);return}m(new Set(t.map(k=>k.name)))},v=w.useMemo(()=>{const S=r.trim().toLowerCase();return S?t.filter(k=>{var C;return k.name.toLowerCase().includes(S)||(((C=k.title)==null?void 0:C.toLowerCase().includes(S))??!1)||k.description.toLowerCase().includes(S)}):t},[t,r]),x=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(Gb,{className:"w-5 h-5 mr-2"}),"Tools",c.jsxs("span",{className:"ml-2 text-sm font-normal text-gray-400",children:[x," 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:x===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(mT,{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(AR,{children:[c.jsx(RR,{children:c.jsxs(Fo,{className:"border-white/10 hover:bg-transparent",children:[c.jsx(eh,{className:"w-[72px] text-center text-[#A8C4C0]",children:"Enabled"}),c.jsx(eh,{className:"w-[220px] text-[#A8C4C0]",children:"Tool"}),c.jsx(eh,{className:"text-[#A8C4C0]",children:"Description"})]})}),c.jsx($R,{children:v.length===0?c.jsx(Fo,{className:"border-white/10 hover:bg-transparent",children:c.jsx(Ms,{colSpan:3,className:"py-8 text-center text-sm text-gray-400",children:"No tools match your search."})}):v.map(S=>{const k=!u.has(S.name),C=i===S.name,N=o===S.name,P=S.inputSchema&&Object.keys(S.inputSchema).length>0;return c.jsxs(w.Fragment,{children:[c.jsxs(Fo,{className:`border-white/10 ${k?"hover:bg-white/5":"opacity-60 hover:bg-white/5"}`,children:[c.jsx(Ms,{className:"text-center",children:c.jsx("div",{className:"flex justify-center",children:c.jsx(ep,{checked:k,onCheckedChange:R=>b(S.name,R===!0),disabled:y.isPending,"aria-label":`${k?"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(Ms,{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(Yp,{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(Ms,{className:"max-w-0 text-sm text-gray-300",children:c.jsx(NK,{description:S.description,title:S.title,expanded:N,onToggle:()=>l(S.name)})})]}),N&&c.jsx(Fo,{className:"border-white/10 bg-black/30 hover:bg-black/30",children:c.jsx(Ms,{colSpan:3,className:"py-3",children:c.jsx(jK,{description:S.description})})}),P&&C&&c.jsx(Fo,{className:"border-white/10 bg-black/30 hover:bg-black/30",children:c.jsx(Ms,{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 Xg({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 qk({serviceId:e,onConnected:t}){const{toast:n}=tn(),[r,a]=w.useState(""),[i,s]=w.useState(""),[o,l]=w.useState(!1),[u,d]=w.useState(!1),[f,p]=w.useState(!1),{data:h,isLoading:y}=wt({queryKey:["/api/oauth",e,"setup"],queryFn:async()=>{const k=await ke("GET",`/api/oauth/${e}/setup`),C=await k.json();if(!k.ok||!C.success)throw new Error(C.error||"Failed to load OAuth setup");return C.data},enabled:!!e}),m=h==null?void 0:h.guide,b=!!(h!=null&&h.hasSavedCredentials),g=()=>{if(!u||(m==null?void 0:m.setupMode)!=="manual")return;const k={};return r.trim()&&(k.clientId=r.trim()),i.trim()&&(k.clientSecret=i.trim()),k},v=async(k,C)=>{try{await navigator.clipboard.writeText(C),n({title:"Copied",description:`${k} copied to clipboard.`})}catch{n({title:"Copy failed",description:"Select and copy manually.",variant:"destructive"})}};w.useEffect(()=>{(m==null?void 0:m.setupMode)==="manual"?d(!0):d(!1),p(!b)},[m==null?void 0:m.setupMode,b]),w.useEffect(()=>{h!=null&&h.savedOAuthClientId&&!r&&a(h.savedOAuthClientId)},[h==null?void 0:h.savedOAuthClientId,r]);const x=async k=>{var C,N,P;l(!0);try{const R=await ke("POST",`/api/oauth/${e}/connect`,k??{}),$=await R.json();if(!R.ok||!$.success){((C=$.data)!=null&&C.needsCredentials||((N=$.data)==null?void 0:N.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(!m)return null;if(m.setupMode==="unavailable")return c.jsxs("div",{className:"space-y-3 text-sm text-orange-100",children:[c.jsx("p",{children:m.unavailableReason}),m.docsUrl&&c.jsxs(le,{size:"sm",variant:"outline",className:"border-orange-500/30 text-orange-200",onClick:()=>window.open(m.docsUrl,"_blank"),children:[c.jsx(Wa,{className:"w-4 h-4 mr-1"}),"Provider docs"]})]});const S=m.setupMode==="dynamic"||m.setupMode==="managed"||m.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:m.title}),m.summary&&c.jsx("p",{className:"mt-1 text-xs text-orange-100/90",children:m.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:m.redirectUri})]}),m.easierAlternative&&c.jsx("p",{className:"mt-2 text-xs text-orange-100/70 border-l-2 border-orange-500/30 pl-2",children:m.easierAlternative})]}),b&&m.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."})]}),m.prerequisites&&m.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:m.prerequisites.map(k=>c.jsx("li",{children:k},k))})]}),(m.manifestJson||m.createAppUrl||S)&&c.jsxs("div",{className:"flex flex-wrap gap-2",children:[m.manifestJson&&c.jsxs(le,{size:"sm",variant:"outline",className:"border-orange-500/30 text-orange-200",onClick:()=>void v("App manifest",m.manifestJson),children:[c.jsx(UI,{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",m.redirectUri),children:[c.jsx(Zb,{className:"w-4 h-4 mr-1"}),"Copy redirect URI"]}),m.createAppUrl&&c.jsxs(le,{size:"sm",variant:"outline",className:"border-orange-500/30 text-orange-200",onClick:()=>window.open(m.createAppUrl,"_blank"),children:[c.jsx(Wa,{className:"w-4 h-4 mr-1"}),m.createAppLabel??"Open app creator"]})]}),m.steps.length>0&&c.jsx("div",{children:b&&m.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(Xg,{items:m.steps})})]}):c.jsxs(c.Fragment,{children:[m.setupMode==="informational"?c.jsx("p",{className:"text-xs font-medium text-orange-200 mb-1",children:"What to do"}):null,c.jsx(Xg,{items:m.steps})]})}),m.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: "}),m.tokenAlternative]}),u&&m.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(Ge,{htmlFor:`oauth-client-id-${e}`,className:"text-orange-200",children:"Client ID"}),c.jsx(at,{id:`oauth-client-id-${e}`,value:r,onChange:k=>a(k.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(Ge,{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:k=>s(k.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:()=>p(k=>!k),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."})]}),m.afterConnect&&m.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(Xg,{items:m.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&&m.setupMode==="manual"&&!b&&(!r.trim()||!i.trim()),onClick:()=>x(g()),children:o?"Connecting…":b&&m.setupMode==="manual"?"Reconnect":m.setupMode==="dynamic"||m.setupMode==="managed"?"Connect":"Connect with credentials"}),m.docsUrl&&c.jsxs(le,{size:"sm",variant:"outline",className:"border-orange-500/30 text-orange-200",onClick:()=>window.open(m.docsUrl,"_blank"),children:[c.jsx(Wa,{className:"w-4 h-4 mr-1"}),"Docs"]})]}),m.setupMode==="informational"&&m.docsUrl&&c.jsxs(le,{size:"sm",variant:"outline",className:"border-orange-500/30 text-orange-200",onClick:()=>window.open(m.docsUrl,"_blank"),children:[c.jsx(Wa,{className:"w-4 h-4 mr-1"}),"Docs"]})]})}function wu(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 I$="agent-deck:oauth-complete";function RK(e){return typeof e=="object"&&e!==null&&e.type===I$}function zs(e){return!!(e&&typeof e=="object"&&Object.keys(e).length>0)}function Hk(e){return zs(e)?JSON.stringify(e,null,2):`{
|
|
438
|
+
|
|
439
|
+
}`}function $K(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 OK(e){return/^bearer\s+/i.test(e)?"Bearer ••••":e.length>0?"••••":""}function xf(e){return zs(e)?Object.entries(e).map(([t,n])=>({name:t,masked:OK(n)})):[]}function wf(e){return e==="not_required"||e==="authenticated"||e==="authenticated_refreshable"}function MK(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 PK(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 DK({service:e,isOpen:t,onClose:n}){var je,Ye,un,wr,Ln,ia,sa,Gt,Sr,Tn,ja,Om,fe,nn,Ss,_s,u1,d1,f1,h1,p1,m1;const[r,a]=w.useState(null),[i,s]=w.useState(!1),[o,l]=w.useState(!1),[u,d]=w.useState(""),[f,p]=w.useState(""),[h,y]=w.useState(!1),[m,b]=w.useState(!1),[g,v]=w.useState(!1),[x,S]=w.useState(`{
|
|
440
|
+
|
|
441
|
+
}`),[k,C]=w.useState(null),[N,P]=w.useState(!1),[R,$]=w.useState(null),j=w.useRef(null),O=ln(),{toast:z}=tn(),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:T,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=((Ye=(je=F==null?void 0:F.data)==null?void 0:je.oauth)==null?void 0:Ye.required)===!0,{data:_,refetch:E}=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 ${MK(_.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:(wr=(un=F==null?void 0:F.data)==null?void 0:un.oauth)==null?void 0:wr.required,oauthData:(Ln=F==null?void 0:F.data)!=null&&Ln.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"||wf(I.status)),staleTime:0,gcTime:2*60*1e3});w.useEffect(()=>{if(!t||!(A!=null&&A.id)||A.type!=="mcp"&&A.type!=="local-mcp"||!(A.type==="local-mcp"||wf(I.status)||I.status==="not_required")||W||oe)return;let ve=!1;return(async()=>{try{const An=await(await ke("GET",`/api/services/${A.id}`)).json();!ve&&(An!=null&&An.success)&&An.data&&$(An.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]),w.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 kn=await(await ke("GET",`/api/services/${A.id}`)).json();!ue&&(kn!=null&&kn.success)&&kn.data&&$(kn.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:(Sr=(Gt=F==null?void 0:F.data)==null?void 0:Gt.oauth)==null?void 0:Sr.required,oauthStatus:I.status,toolsQueryEnabled:Z&&(A.type==="mcp"||A.type==="local-mcp")&&t&&(A.type==="local-mcp"||wf(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:T?String(T):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=(Tn=F==null?void 0:F.data)==null?void 0:Tn.oauth)==null?void 0:ja.required,oauthStatus:I.status,oauthMessage:I.message,oauthAuthenticated:_==null?void 0:_.authenticated,expiresAt:_==null?void 0:_.expiresAt}),w.useEffect(()=>{if(!t){$(null),v(!1),C(null),Ae.current=!1,ae.current=!1;return}e&&($(e),d(e.name||""),p(e.description||""),v(!1),C(null))},[e,t]);const ae=w.useRef(!1),Ae=w.useRef(!1);w.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..."}),wu(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(h_,{className:"w-6 h-6"}):c.jsx(Sg,{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"});w.useEffect(()=>{var ue,ve;i&&((ue=j.current)==null||ue.focus(),(ve=j.current)==null||ve.select())},[i]);const Lt=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)}}},rr=()=>{S(Hk(B)),C(null),v(!0)},Y=()=>{v(!1),C(null),S(Hk(B))},se=async()=>{if(!D)return;const ue=$K(x);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),wu(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&&(wu(O,(A==null?void 0:A.id)??(e==null?void 0:e.id)),Ae.current=!1),ae.current=!1,n())};return c.jsx(vs,{open:t,onOpenChange:Se,children:c.jsxs(pi,{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(mi,{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:()=>{Lt()},onKeyDown:ue=>{ue.key==="Enter"?(ue.preventDefault(),Lt()):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(hn,{className:`ml-3 ${Ce()} ${we()}`,children:(Om=e==null?void 0:e.type)==null?void 0:Om.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(zI,{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(Gb,{className:"w-3 h-3"})})]}),o?c.jsxs("div",{className:"space-y-2",children:[c.jsx("textarea",{value:f,onChange:ue=>p(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:m,className:"h-6 px-2 text-xs",children:m?"Saving...":"Save"}),c.jsx(le,{size:"sm",variant:"outline",onClick:()=>{l(!1),p((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(hn,{variant:"outline",className:"border-blue-500/30 text-blue-300",children:A.type.toUpperCase()}),zs(B)&&c.jsx(hn,{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(Wa,{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:rr,"data-testid":"button-edit-headers",children:"Edit"})]}),g?c.jsxs("div",{className:"space-y-2",children:[c.jsx(Ga,{value:x,onChange:ue=>{S(ue.target.value),k&&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:N}),k&&c.jsxs("p",{className:"text-red-400 text-xs flex items-center gap-1","data-testid":"headers-json-error",children:[c.jsx(Ar,{className:"w-3 h-3 shrink-0"}),k]}),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:N,"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:N,"data-testid":"button-save-headers",children:N?"Saving…":"Save"})]})]}):zs(B)?c.jsx("ul",{className:"space-y-1 font-mono","data-testid":"headers-masked-list",children:xf(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."})]}):zs(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:xf(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(hn,{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:PK(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(AK,{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(QI,{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(Wa,{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(cT,{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(hn,{className:"bg-green-500/20 text-green-300",children:"Streaming"}),K.capabilities.pushNotifications&&c.jsx(hn,{className:"bg-blue-500/20 text-blue-300",children:"Push Notifications"}),K.capabilities.stateTransitionHistory&&c.jsx(hn,{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(Sg,{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(Sg,{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,kn)=>c.jsx("span",{className:"text-purple-300 text-xs bg-purple-500/20 px-1 py-0.5 rounded",children:yt},kn))})]}),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(h_,{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(hn,{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(hn,{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(qk,{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"&&!wf(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(qk,{serviceId:A.id,onConnected:()=>void E()}),((nn=(fe=F==null?void 0:F.data)==null?void 0:fe.oauth)==null?void 0:nn.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"]}),zs(B)&&c.jsxs("div",{children:[c.jsx("p",{children:c.jsx("strong",{children:"📋 Headers sent:"})}),c.jsx("ul",{className:"text-xs font-mono",children:xf(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]}),zs(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:xf(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"||!((_s=(Ss=F==null?void 0:F.data)==null?void 0:Ss.oauth)!=null&&_s.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]})]}),((d1=(u1=F==null?void 0:F.data)==null?void 0:u1.oauth)==null?void 0:d1.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 An=await yt.json();(ue=An.data)!=null&&ue.registrationUrl?(window.open(An.data.registrationUrl,"_blank"),z({title:"OAuth Registration Required",description:`${An.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:An.error||"Failed to setup OAuth automatically. Please configure manually.",variant:"destructive"});return}const kn=await yt.json();kn.success&&((ve=kn.data)!=null&&ve.authorizationUrl)?(window.open(kn.data.authorizationUrl,"_blank"),z({title:"OAuth Setup Successful",description:"OAuth application registered automatically! Please complete the authorization in the new window.",duration:1e4}),E()):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(Wa,{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(Wa,{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)&&!((h1=(f1=F==null?void 0:F.data)==null?void 0:f1.oauth)!=null&&h1.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"})]}),((m1=(p1=F==null?void 0:F.data)==null?void 0:p1.oauth)==null?void 0:m1.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 An=await yt.json();(ue=An.data)!=null&&ue.registrationUrl?(window.open(An.data.registrationUrl,"_blank"),z({title:"OAuth Registration Required",description:`${An.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:An.error||"Failed to setup OAuth automatically. Please configure manually.",variant:"destructive"});return}const kn=await yt.json();kn.success&&((ve=kn.data)!=null&&ve.authorizationUrl)?(window.open(kn.data.authorizationUrl,"_blank"),z({title:"OAuth Setup Successful",description:"OAuth application registered automatically! Please complete the authorization in the new window.",duration:1e4}),E()):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"})]})]})]}),T&&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:T instanceof Error?T.message:String(T)})]})]})]}),!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 zK({open:e,onOpenChange:t}){const[n,r]=w.useState(null),[a,i]=w.useState(null),[s,o]=w.useState(null),[l,u]=w.useState(!1),d=ln(),{toast:f}=tn(),p=()=>{r(null),i(null),o(null),u(!1)},h=St({mutationFn:async()=>{if(!n)throw new Error("Choose a bundle file first");const m=await n.text();let b;try{b=JSON.parse(m)}catch{throw new Error("File is not valid JSON")}return U9(b)},onSuccess:m=>{o(m),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:F_(m)})},onError:m=>{f({title:"Import failed",description:m.message,variant:"destructive"})}}),y=async m=>{var b,g,v;if(r(m),o(null),!m){i(null);return}try{const x=await m.text(),S=JSON.parse(x);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(vs,{open:e,onOpenChange:m=>{m||p(),t(m)},children:c.jsxs(pi,{className:"sm:max-w-lg border-border bg-[#161612] text-[#E8F6F4]",children:[c.jsxs(mi,{children:[c.jsx(gi,{children:"Import bundle"}),c.jsx(No,{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(Ge,{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:m=>{var b;return y(((b=m.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:F_(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(m=>c.jsx("li",{children:m},m))})]}),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(m=>c.jsx("li",{children:m},m))})]}),c.jsx(le,{variant:"outline",size:"sm",className:"rounded-full border border-white/20 text-white hover:bg-white/10",onClick:()=>u(m=>!m),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:()=>{p(),t(!1)},children:"Done"})]})]})]})})}function IK(){const[e,t]=w.useState("connecting"),[n,r]=w.useState(null),a=w.useRef(null),i=w.useRef(null),s=ln();return w.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=p=>{var h;try{const y=JSON.parse(p.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),wu(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=p=>{console.error("WebSocket error:",p),t("disconnected")}}catch(f){console.error("Failed to connect WebSocket:",f),t("disconnected")}};u();const d=f=>{f.origin===window.location.origin&&RK(f.data)&&wu(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 Bk(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 LK(e){const[t,n]=w.useState(null),[r,a]=w.useState(null),[i,s]=w.useState(null),[o,l]=w.useState(!1),u=ln(),{toast:d}=tn(),f=()=>{if(!e)throw new Error("Select a deck to edit first");return e},p=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(T=>T.id===O);if(!A)throw new Error("Selected deck not found");if((F=A.services)!=null&&F.some(T=>T.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"})}}),m=St({mutationFn:async j=>{const O=await Bk("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 Bk("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)},x=(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),x(j,{kind:"service",id:O.id,fromDeck:z}),v(j,"0.5")},k=(j,O,z=!1)=>{a(O),n(null),s(null),l(z),x(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),x(j,{kind:"playbook",id:O.id,fromDeck:z}),v(j,"0.5")},N=j=>{n(null),a(null),s(null),v(j,"1")},P=j=>{if(j.kind==="service"){j.fromDeck?m.mutate(j.id):p.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:k,handlePlaybookDragStart:C,handleDragEnd:N,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&&p.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:p.isPending||h.isPending||y.isPending||m.isPending||b.isPending||g.isPending}}const Wg="agent-deck-editing-deck-id";function UK(e){const[t,n]=w.useState(()=>typeof window>"u"?null:localStorage.getItem(Wg));w.useEffect(()=>{if(e.length===0)return;if(!(t&&e.some(s=>s.id===t))){const s=e[0].id;n(s),localStorage.setItem(Wg,s)}},[e,t]);const r=i=>{n(i),localStorage.setItem(Wg,i)};return{editingDeck:e.find(i=>i.id===t)??null,editingDeckId:t,setEditingDeckId:r}}function Vk(e,[t,n]){return Math.min(n,Math.max(t,e))}function FK(e){const t=w.useRef({value:e,previous:e});return w.useMemo(()=>(t.current.value!==e&&(t.current.previous=t.current.value,t.current.value=e),t.current.previous),[e])}var qK=[" ","Enter","ArrowUp","ArrowDown"],HK=[" ","Enter"],go="Select",[ym,vm,BK]=qb(go),[wc,rie]=fi(go,[BK,vc]),bm=vc(),[VK,xs]=wc(go),[KK,ZK]=wc(go),L$=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:p,required:h,form:y}=e,m=bm(t),[b,g]=w.useState(null),[v,x]=w.useState(null),[S,k]=w.useState(!1),C=mx(u),[N,P]=fo({prop:r,defaultProp:a??!1,onChange:i,caller:go}),[R,$]=fo({prop:s,defaultProp:o,onChange:l,caller:go}),j=w.useRef(null),O=b?y||!!b.closest("form"):!0,[z,D]=w.useState(new Set),A=Array.from(z).map(B=>B.props.value).join(";");return c.jsx(ZT,{...m,children:c.jsxs(VK,{required:h,scope:t,trigger:b,onTriggerChange:g,valueNode:v,onValueNodeChange:x,valueNodeHasChildren:S,onValueNodeHasChildrenChange:k,contentId:ni(),value:R,onValueChange:$,open:N,onOpenChange:P,dir:C,triggerPointerDownPosRef:j,disabled:p,children:[c.jsx(ym.Provider,{scope:t,children:c.jsx(KK,{scope:e.__scopeSelect,onNativeOptionAdd:w.useCallback(B=>{D(Z=>new Set(Z).add(B))},[]),onNativeOptionRemove:w.useCallback(B=>{D(Z=>{const F=new Set(Z);return F.delete(B),F})},[]),children:n})}),O?c.jsxs(cO,{"aria-hidden":!0,required:h,tabIndex:-1,name:d,autoComplete:f,value:R,onChange:B=>$(B.target.value),disabled:p,form:y,children:[R===void 0?c.jsx("option",{value:""}):null,Array.from(z)]},A):null]})})};L$.displayName=go;var U$="SelectTrigger",F$=w.forwardRef((e,t)=>{const{__scopeSelect:n,disabled:r=!1,...a}=e,i=bm(n),s=xs(U$,n),o=s.disabled||r,l=lt(t,s.onTriggerChange),u=vm(n),d=w.useRef("touch"),[f,p,h]=dO(m=>{const b=u().filter(x=>!x.disabled),g=b.find(x=>x.value===s.value),v=fO(b,m,g);v!==void 0&&s.onValueChange(v.value)}),y=m=>{o||(s.onOpenChange(!0),h()),m&&(s.triggerPointerDownPosRef.current={x:Math.round(m.pageX),y:Math.round(m.pageY)})};return c.jsx(tm,{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":uO(s.value)?"":void 0,...a,ref:l,onClick:xe(a.onClick,m=>{m.currentTarget.focus(),d.current!=="mouse"&&y(m)}),onPointerDown:xe(a.onPointerDown,m=>{d.current=m.pointerType;const b=m.target;b.hasPointerCapture(m.pointerId)&&b.releasePointerCapture(m.pointerId),m.button===0&&m.ctrlKey===!1&&m.pointerType==="mouse"&&(y(m),m.preventDefault())}),onKeyDown:xe(a.onKeyDown,m=>{const b=f.current!=="";!(m.ctrlKey||m.altKey||m.metaKey)&&m.key.length===1&&p(m.key),!(b&&m.key===" ")&&qK.includes(m.key)&&(y(),m.preventDefault())})})})});F$.displayName=U$;var q$="SelectValue",H$=w.forwardRef((e,t)=>{const{__scopeSelect:n,className:r,style:a,children:i,placeholder:s="",...o}=e,l=xs(q$,n),{onValueNodeHasChildrenChange:u}=l,d=i!==void 0,f=lt(t,l.onValueNodeChange);return wn(()=>{u(d)},[u,d]),c.jsx(De.span,{...o,ref:f,style:{pointerEvents:"none"},children:uO(l.value)?c.jsx(c.Fragment,{children:s}):i})});H$.displayName=q$;var GK="SelectIcon",B$=w.forwardRef((e,t)=>{const{__scopeSelect:n,children:r,...a}=e;return c.jsx(De.span,{"aria-hidden":!0,...a,ref:t,children:r||"▼"})});B$.displayName=GK;var QK="SelectPortal",V$=e=>c.jsx(vd,{asChild:!0,...e});V$.displayName=QK;var yo="SelectContent",K$=w.forwardRef((e,t)=>{const n=xs(yo,e.__scopeSelect),[r,a]=w.useState();if(wn(()=>{a(new DocumentFragment)},[]),!n.open){const i=r;return i?wo.createPortal(c.jsx(Z$,{scope:e.__scopeSelect,children:c.jsx(ym.Slot,{scope:e.__scopeSelect,children:c.jsx("div",{children:e.children})})}),i):null}return c.jsx(G$,{...e,ref:t})});K$.displayName=yo;var Vr=10,[Z$,ws]=wc(yo),YK="SelectContentImpl",XK=uo("SelectContent.RemoveScroll"),G$=w.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:p,collisionPadding:h,sticky:y,hideWhenDetached:m,avoidCollisions:b,...g}=e,v=xs(yo,n),[x,S]=w.useState(null),[k,C]=w.useState(null),N=lt(t,Q=>S(Q)),[P,R]=w.useState(null),[$,j]=w.useState(null),O=vm(n),[z,D]=w.useState(!1),A=w.useRef(!1);w.useEffect(()=>{if(x)return ux(x)},[x]),cx();const B=w.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&&k&&(k.scrollTop=0),V===de&&k&&(k.scrollTop=k.scrollHeight),V==null||V.focus(),document.activeElement!==L))return},[O,k]),Z=w.useCallback(()=>B([P,x]),[B,P,x]);w.useEffect(()=>{z&&Z()},[z,Z]);const{onOpenChange:F,triggerPointerDownPosRef:J}=v;w.useEffect(()=>{if(x){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():x.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})}}},[x,F,J]),w.useEffect(()=>{const Q=()=>F(!1);return window.addEventListener("blur",Q),window.addEventListener("resize",Q),()=>{window.removeEventListener("blur",Q),window.removeEventListener("resize",Q)}},[F]);const[T,q]=dO(Q=>{const W=O().filter(L=>!L.disabled),oe=W.find(L=>L.ref.current===document.activeElement),de=fO(W,Q,oe);de&&setTimeout(()=>de.ref.current.focus())}),G=w.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]),_=w.useCallback(()=>x==null?void 0:x.focus(),[x]),E=w.useCallback((Q,W,oe)=>{const de=!A.current&&!oe;(v.value!==void 0&&v.value===W||de)&&j(Q)},[v.value]),M=r==="popper"?Yv:Q$,I=M===Yv?{side:o,sideOffset:l,align:u,alignOffset:d,arrowPadding:f,collisionBoundary:p,collisionPadding:h,sticky:y,hideWhenDetached:m,avoidCollisions:b}:{};return c.jsx(Z$,{scope:n,content:x,viewport:k,onViewportChange:C,itemRefCallback:G,selectedItem:P,onItemLeave:_,itemTextRefCallback:E,focusSelectedItem:Z,selectedItemText:$,position:r,isPositioned:z,searchRef:T,children:c.jsx(sm,{as:XK,allowPinchZoom:!0,children:c.jsx(am,{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:N,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()}})})})})})})});G$.displayName=YK;var WK="SelectItemAlignedPosition",Q$=w.forwardRef((e,t)=>{const{__scopeSelect:n,onPlaced:r,...a}=e,i=xs(yo,n),s=ws(yo,n),[o,l]=w.useState(null),[u,d]=w.useState(null),f=lt(t,N=>d(N)),p=vm(n),h=w.useRef(!1),y=w.useRef(!0),{viewport:m,selectedItem:b,selectedItemText:g,focusSelectedItem:v}=s,x=w.useCallback(()=>{if(i.trigger&&i.valueNode&&o&&u&&m&&b&&g){const N=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=N.left-V,ne=N.width+X,K=Math.max(ne,P.width),re=window.innerWidth-Vr,ae=Vk(V,[Vr,Math.max(Vr,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-N.right-V,ne=N.width+X,K=Math.max(ne,P.width),re=window.innerWidth-Vr,ae=Vk(V,[Vr,Math.max(Vr,re-K)]);o.style.minWidth=ne+"px",o.style.right=ae+"px"}const j=p(),O=window.innerHeight-Vr*2,z=m.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,T=Math.min(b.offsetHeight*5,J),q=window.getComputedStyle(m),G=parseInt(q.paddingTop,10),_=parseInt(q.paddingBottom,10),E=N.top+N.height/2-Vr,M=O-E,I=b.offsetHeight/2,Q=b.offsetTop+I,W=A+B+Q,oe=J-W;if(W<=E){const L=j.length>0&&b===j[j.length-1].ref.current;o.style.bottom="0px";const V=u.clientHeight-m.offsetTop-m.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(E,A+m.offsetTop+(L?G:0)+I)+oe;o.style.height=X+"px",m.scrollTop=W-E+m.offsetTop}o.style.margin=`${Vr}px 0`,o.style.minHeight=T+"px",o.style.maxHeight=O+"px",r==null||r(),requestAnimationFrame(()=>h.current=!0)}},[p,i.trigger,i.valueNode,o,u,m,b,g,i.dir,r]);wn(()=>x(),[x]);const[S,k]=w.useState();wn(()=>{u&&k(window.getComputedStyle(u).zIndex)},[u]);const C=w.useCallback(N=>{N&&y.current===!0&&(x(),v==null||v(),y.current=!1)},[x,v]);return c.jsx(eZ,{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}})})})});Q$.displayName=WK;var JK="SelectPopperPosition",Yv=w.forwardRef((e,t)=>{const{__scopeSelect:n,align:r="start",collisionPadding:a=Vr,...i}=e,s=bm(n);return c.jsx(ax,{...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)"}})});Yv.displayName=JK;var[eZ,Fx]=wc(yo,{}),Xv="SelectViewport",Y$=w.forwardRef((e,t)=>{const{__scopeSelect:n,nonce:r,...a}=e,i=ws(Xv,n),s=Fx(Xv,n),o=lt(t,i.onViewportChange),l=w.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(ym.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:p}=s;if(p!=null&&p.current&&f){const h=Math.abs(l.current-d.scrollTop);if(h>0){const y=window.innerHeight-Vr*2,m=parseFloat(f.style.minHeight),b=parseFloat(f.style.height),g=Math.max(m,b);if(g<y){const v=g+h,x=Math.min(y,v),S=v-x;f.style.height=x+"px",f.style.bottom==="0px"&&(d.scrollTop=S>0?S:0,f.style.justifyContent="flex-end")}}}l.current=d.scrollTop})})})]})});Y$.displayName=Xv;var X$="SelectGroup",[tZ,nZ]=wc(X$),rZ=w.forwardRef((e,t)=>{const{__scopeSelect:n,...r}=e,a=ni();return c.jsx(tZ,{scope:n,id:a,children:c.jsx(De.div,{role:"group","aria-labelledby":a,...r,ref:t})})});rZ.displayName=X$;var W$="SelectLabel",J$=w.forwardRef((e,t)=>{const{__scopeSelect:n,...r}=e,a=nZ(W$,n);return c.jsx(De.div,{id:a.id,...r,ref:t})});J$.displayName=W$;var sp="SelectItem",[aZ,eO]=wc(sp),tO=w.forwardRef((e,t)=>{const{__scopeSelect:n,value:r,disabled:a=!1,textValue:i,...s}=e,o=xs(sp,n),l=ws(sp,n),u=o.value===r,[d,f]=w.useState(i??""),[p,h]=w.useState(!1),y=lt(t,v=>{var x;return(x=l.itemRefCallback)==null?void 0:x.call(l,v,r,a)}),m=ni(),b=w.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(aZ,{scope:n,value:r,disabled:a,textId:m,isSelected:u,onItemTextChange:w.useCallback(v=>{f(x=>x||((v==null?void 0:v.textContent)??"").trim())},[]),children:c.jsx(ym.ItemSlot,{scope:n,value:r,disabled:a,textValue:d,children:c.jsx(De.div,{role:"option","aria-labelledby":m,"data-highlighted":p?"":void 0,"aria-selected":u&&p,"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 x;b.current=v.pointerType,a?(x=l.onItemLeave)==null||x.call(l):b.current==="mouse"&&v.currentTarget.focus({preventScroll:!0})}),onPointerLeave:xe(s.onPointerLeave,v=>{var x;v.currentTarget===document.activeElement&&((x=l.onItemLeave)==null||x.call(l))}),onKeyDown:xe(s.onKeyDown,v=>{var S;((S=l.searchRef)==null?void 0:S.current)!==""&&v.key===" "||(HK.includes(v.key)&&g(),v.key===" "&&v.preventDefault())})})})})});tO.displayName=sp;var Yc="SelectItemText",nO=w.forwardRef((e,t)=>{const{__scopeSelect:n,className:r,style:a,...i}=e,s=xs(Yc,n),o=ws(Yc,n),l=eO(Yc,n),u=ZK(Yc,n),[d,f]=w.useState(null),p=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=w.useMemo(()=>c.jsx("option",{value:l.value,disabled:l.disabled,children:h},l.value),[l.disabled,l.value,h]),{onNativeOptionAdd:m,onNativeOptionRemove:b}=u;return wn(()=>(m(y),()=>b(y)),[m,b,y]),c.jsxs(c.Fragment,{children:[c.jsx(De.span,{id:l.textId,...i,ref:p}),l.isSelected&&s.valueNode&&!s.valueNodeHasChildren?wo.createPortal(i.children,s.valueNode):null]})});nO.displayName=Yc;var rO="SelectItemIndicator",aO=w.forwardRef((e,t)=>{const{__scopeSelect:n,...r}=e;return eO(rO,n).isSelected?c.jsx(De.span,{"aria-hidden":!0,...r,ref:t}):null});aO.displayName=rO;var Wv="SelectScrollUpButton",iO=w.forwardRef((e,t)=>{const n=ws(Wv,e.__scopeSelect),r=Fx(Wv,e.__scopeSelect),[a,i]=w.useState(!1),s=lt(t,r.onScrollButtonChange);return wn(()=>{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(oO,{...e,ref:s,onAutoScroll:()=>{const{viewport:o,selectedItem:l}=n;o&&l&&(o.scrollTop=o.scrollTop-l.offsetHeight)}}):null});iO.displayName=Wv;var Jv="SelectScrollDownButton",sO=w.forwardRef((e,t)=>{const n=ws(Jv,e.__scopeSelect),r=Fx(Jv,e.__scopeSelect),[a,i]=w.useState(!1),s=lt(t,r.onScrollButtonChange);return wn(()=>{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(oO,{...e,ref:s,onAutoScroll:()=>{const{viewport:o,selectedItem:l}=n;o&&l&&(o.scrollTop=o.scrollTop+l.offsetHeight)}}):null});sO.displayName=Jv;var oO=w.forwardRef((e,t)=>{const{__scopeSelect:n,onAutoScroll:r,...a}=e,i=ws("SelectScrollButton",n),s=w.useRef(null),o=vm(n),l=w.useCallback(()=>{s.current!==null&&(window.clearInterval(s.current),s.current=null)},[]);return w.useEffect(()=>()=>l(),[l]),wn(()=>{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()})})}),iZ="SelectSeparator",lO=w.forwardRef((e,t)=>{const{__scopeSelect:n,...r}=e;return c.jsx(De.div,{"aria-hidden":!0,...r,ref:t})});lO.displayName=iZ;var e0="SelectArrow",sZ=w.forwardRef((e,t)=>{const{__scopeSelect:n,...r}=e,a=bm(n),i=xs(e0,n),s=ws(e0,n);return i.open&&s.position==="popper"?c.jsx(ix,{...a,...r,ref:t}):null});sZ.displayName=e0;var oZ="SelectBubbleInput",cO=w.forwardRef(({__scopeSelect:e,value:t,...n},r)=>{const a=w.useRef(null),i=lt(r,a),s=FK(t);return w.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:{...L2,...n.style},ref:i,defaultValue:t})});cO.displayName=oZ;function uO(e){return e===""||e===void 0}function dO(e){const t=Ir(e),n=w.useRef(""),r=w.useRef(0),a=w.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=w.useCallback(()=>{n.current="",window.clearTimeout(r.current)},[]);return w.useEffect(()=>()=>window.clearTimeout(r.current),[]),[n,a,i]}function fO(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=lZ(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 lZ(e,t){return e.map((n,r)=>e[(t+r)%e.length])}var cZ=L$,hO=F$,uZ=H$,dZ=B$,fZ=V$,pO=K$,hZ=Y$,mO=J$,gO=tO,pZ=nO,mZ=aO,yO=iO,vO=sO,bO=lO;const gZ=cZ,yZ=uZ,xO=w.forwardRef(({className:e,children:t,...n},r)=>c.jsxs(hO,{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(dZ,{asChild:!0,children:c.jsx(Yp,{className:"h-4 w-4 opacity-50"})})]}));xO.displayName=hO.displayName;const wO=w.forwardRef(({className:e,...t},n)=>c.jsx(yO,{ref:n,className:Te("flex cursor-default items-center justify-center py-1",e),...t,children:c.jsx(LI,{className:"h-4 w-4"})}));wO.displayName=yO.displayName;const SO=w.forwardRef(({className:e,...t},n)=>c.jsx(vO,{ref:n,className:Te("flex cursor-default items-center justify-center py-1",e),...t,children:c.jsx(Yp,{className:"h-4 w-4"})}));SO.displayName=vO.displayName;const _O=w.forwardRef(({className:e,children:t,position:n="popper",...r},a)=>c.jsx(fZ,{children:c.jsxs(pO,{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(wO,{}),c.jsx(hZ,{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(SO,{})]})}));_O.displayName=pO.displayName;const vZ=w.forwardRef(({className:e,...t},n)=>c.jsx(mO,{ref:n,className:Te("py-1.5 pl-8 pr-2 text-sm font-semibold",e),...t}));vZ.displayName=mO.displayName;const Ho=w.forwardRef(({className:e,children:t,...n},r)=>c.jsxs(gO,{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(mZ,{children:c.jsx(uT,{className:"h-4 w-4"})})}),c.jsx(pZ,{children:t})]}));Ho.displayName=gO.displayName;const bZ=w.forwardRef(({className:e,...t},n)=>c.jsx(bO,{ref:n,className:Te("-mx-1 my-1 h-px bg-muted",e),...t}));bZ.displayName=bO.displayName;const xZ="/assets/AgentDeckLogo3-X5qCXS2A.png";function wZ(){const[e,t]=w.useState(""),[n,r]=w.useState(""),[a,i]=w.useState(!1),[s,o]=w.useState(!1),[l,u]=w.useState(null),[d,f]=w.useState(!1),[p,h]=w.useState(!1),[y,m]=w.useState(null),[b,g]=w.useState(!1),[v,x]=w.useState(!1),[S,k]=w.useState(null),[C,N]=w.useState(!1),[P,R]=w.useState(!1),[$,j]=w.useState(!1),[O,z]=w.useState(null),{toast:D}=tn(),{data:A=[]}=wt({queryKey:["/api/playbook-patches","proposed"],queryFn:()=>zv("proposed")}),{data:B=0}=wt({queryKey:["/api/feedback-signals/count","available"],queryFn:()=>wR()}),Z=async()=>{j(!0);try{const fe=await bR({scope:"collection"});xR(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}=IK(),{data:J,isLoading:T,error:q}=wt({queryKey:["/api/decks"]}),G=(J==null?void 0:J.data)||[],{editingDeck:_,editingDeckId:E,setEditingDeckId:M}=UK(G),{handleDragStart:I,handleCredentialDragStart:Q,handlePlaybookDragStart:W,handleDragEnd:oe,handleDrop:de,handleGlobalDrop:L,isDraggingFromDeck:V}=LK(E),{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)||[],Lt=(Ae==null?void 0:Ae.data)||[],gt=w.useMemo(()=>bU(we==null?void 0:we.data),[we==null?void 0:we.data]),rr=(fe,nn)=>a?fe==="service"?gt.serviceWarnings.has(nn):fe==="credential"?gt.credentialWarnings.has(nn):gt.playbookWarnings.has(nn):!0,Y=Ce.filter(fe=>{var _s;if(!rr("service",fe.id)||n==="api-key"||n==="playbook")return!1;const nn=fe.name.toLowerCase().includes(e.toLowerCase())||((_s=fe.description)==null?void 0:_s.toLowerCase().includes(e.toLowerCase())),Ss=!n||n==="all"||fe.type===n;return nn&&Ss}),se=ht.filter(fe=>!rr("credential",fe.id)||n&&n!=="all"&&n!=="api-key"?!1:fe.label.toLowerCase().includes(e.toLowerCase())),Se=Lt.filter(fe=>!rr("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 Ye=()=>{t(""),r(""),i(!1)},un=!!(e||n||a),wr=new Set(((_==null?void 0:_.credentials)??[]).map(fe=>fe.id)),Ln=new Set(((_==null?void 0:_.playbooks)??[]).map(fe=>fe.id)),ia=(_==null?void 0:_.services)||[],sa=(_==null?void 0:_.playbooks)||[],Gt=fe=>{u(fe),f(!0)},Sr=fe=>{k(fe.id),N(!0)},Tn=fe=>{m(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||T||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:xZ,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(n9,{highlightDeckId:E??void 0}),c.jsx(Ql,{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(Ql,{href:"/playbook-patches",children:c.jsxs(le,{variant:"outline",size:"sm",className:"relative border-white/20 bg-white/5 text-[#E8F6F4]",children:[c.jsx(qI,{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(q9,{decks:G,editingDeckId:E,onSelectDeck:M,isLoading:T})}),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(cT,{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:pa(Mn),onClick:()=>o(!0),"data-testid":"button-register-mcp",children:[c.jsx(Vh,{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:pa(Gn),onClick:()=>h(!0),"data-testid":"button-register-api-key",children:[c.jsx(Cv,{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:pa(Zr),onClick:()=>x(!0),"data-testid":"button-register-playbook",children:[c.jsx(Kb,{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(IU,{deck:_,services:ia,credentials:_.credentials??[],playbooks:sa,allServices:Ce,collectionWarnings:gt,onDrop:de,onDragStart:I,onCredentialDragStart:Q,onPlaybookDragStart:W,onDragEnd:oe,onCardClick:Gt,onPlaybookClick:Sr,onCredentialClick:Tn})}):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(Bh,{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(Fs,{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(Bh,{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(HI,{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(pT,{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(GI,{className:"w-3 h-3 mr-1"}),"Import"]}),c.jsxs("div",{className:"relative",children:[c.jsx(mT,{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(gZ,{value:n||"all",onValueChange:fe=>r(fe==="all"?"":fe),children:[c.jsxs(xO,{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(FI,{className:"w-3 h-3 mr-1 shrink-0"}),c.jsx(yZ,{placeholder:"Type"})]}),c.jsxs(_O,{children:[c.jsx(Ho,{value:"all",children:"All"}),c.jsx(Ho,{value:"mcp",children:"MCP"}),c.jsx(Ho,{value:"local-mcp",children:"Local MCP"}),c.jsx(Ho,{value:"api-key",children:"API Key"}),c.jsx(Ho,{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:Ye,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(Ar,{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,nn)=>c.jsx("div",{className:"animate-pulse",children:c.jsx("div",{className:"bg-white/10 rounded-lg w-32 h-48 aspect-[2/3]"})},nn))}):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:un?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"}),!un&&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:pa(Mn),onClick:()=>o(!0),"data-testid":"button-register-mcp-empty",children:[c.jsx(Vh,{className:"w-3 h-3 mr-1"}),"Register MCP"]}),c.jsxs(le,{variant:"ghost",size:"sm",className:`border-2 hover:opacity-90 ${ha}`,style:pa(Gn),onClick:()=>h(!0),"data-testid":"button-register-api-key-empty",children:[c.jsx(Cv,{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,nn)=>c.jsx("div",{className:"relative group",style:{zIndex:O===fe.id?999999:je-nn},children:c.jsx(jU,{playbook:fe,isInActiveDeck:Ln.has(fe.id),activeDeck:_??void 0,isInCollection:!0,onDragStart:W,onDragEnd:oe,onCardClick:Sr,onMouseEnter:()=>ja(fe.id),onMouseLeave:()=>ja(null),warnings:gt.playbookWarnings.get(fe.id)})},fe.id)),se.map((fe,nn)=>c.jsx("div",{className:"relative group",style:{zIndex:O===fe.id?999999:je-Se.length-nn},children:c.jsx(CU,{credential:fe,isInActiveDeck:wr.has(fe.id),activeDeck:_??void 0,isInCollection:!0,onDragStart:Q,onDragEnd:oe,onMouseEnter:()=>ja(fe.id),onMouseLeave:()=>ja(null),onCardClick:Tn,warnings:gt.credentialWarnings.get(fe.id)})},fe.id)),Y.map((fe,nn)=>{var Ss;return c.jsx("div",{className:"relative group",style:{zIndex:O===fe.id?999999:je-Se.length-se.length-nn},children:c.jsx(_U,{service:fe,onDragStart:I,onDragEnd:oe,isInActiveDeck:((Ss=_==null?void 0:_.services)==null?void 0:Ss.some(_s=>_s.id===fe.id))||!1,onCardClick:Gt,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(L9,{type:"mcp",open:s,onOpenChange:o}),c.jsx(DK,{service:l,isOpen:d,onClose:()=>f(!1)}),c.jsx(H9,{open:p,onOpenChange:h}),c.jsx(tF,{credentialId:y,open:b,onOpenChange:g}),c.jsx(B9,{open:v,onOpenChange:x}),c.jsx(eF,{playbookId:S,open:C,onOpenChange:N}),c.jsx(zK,{open:P,onOpenChange:R})]})}const qa=w.forwardRef(({className:e,...t},n)=>c.jsx("div",{ref:n,className:Te("rounded-lg border bg-card text-card-foreground shadow-sm",e),...t}));qa.displayName="Card";const Ni=w.forwardRef(({className:e,...t},n)=>c.jsx("div",{ref:n,className:Te("flex flex-col space-y-1.5 p-6",e),...t}));Ni.displayName="CardHeader";const ji=w.forwardRef(({className:e,...t},n)=>c.jsx("div",{ref:n,className:Te("text-2xl font-semibold leading-none tracking-tight",e),...t}));ji.displayName="CardTitle";const Su=w.forwardRef(({className:e,...t},n)=>c.jsx("div",{ref:n,className:Te("text-sm text-muted-foreground",e),...t}));Su.displayName="CardDescription";const Ha=w.forwardRef(({className:e,...t},n)=>c.jsx("div",{ref:n,className:Te("p-6 pt-0",e),...t}));Ha.displayName="CardContent";const SZ=w.forwardRef(({className:e,...t},n)=>c.jsx("div",{ref:n,className:Te("flex items-center p-6 pt-0",e),...t}));SZ.displayName="CardFooter";function _Z(){return c.jsx("div",{className:"min-h-screen w-full flex items-center justify-center bg-gray-50",children:c.jsx(qa,{className:"w-full max-w-md mx-4",children:c.jsxs(Ha,{className:"pt-6",children:[c.jsxs("div",{className:"flex mb-4 gap-2",children:[c.jsx(hT,{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 kZ(){const[e]=Jz(),[t,n]=w.useState("loading"),[r,a]=w.useState("Authenticating...");return w.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:I$,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 sl(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(EZ).join("&"),n.hash=n.hash.slice(0,1)+encodeURIComponent(n.hash.slice(1)),n.href}function EZ([e,t]){return`${encodeURIComponent(e)}${t.length>0?`=${encodeURIComponent(t)}`:""}`}var Kk=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=sl(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 sl(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=sl(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?sl(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 CZ=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 Yu extends Error{constructor(){super("Encountered Promise during synchronous parse. Use .parseAsync() instead.")}}const kO={};function hs(e){return kO}function NZ(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 jZ(e,t){return typeof t=="bigint"?t.toString():t}function qx(e){return{get value(){{const t=e();return Object.defineProperty(this,"value",{value:t}),t}}}}function Hx(e){return e==null}function Bx(e){const t=e.startsWith("^")?1:0,n=e.endsWith("$")?e.length-1:e.length;return e.slice(t,n)}function TZ(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 Et(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 xm(e,t,n){Object.defineProperty(e,t,{value:n,writable:!0,enumerable:!0,configurable:!0})}function Lc(e){return JSON.stringify(e)}const EO=Error.captureStackTrace?Error.captureStackTrace:(...e)=>{};function op(e){return typeof e=="object"&&e!==null&&!Array.isArray(e)}const AZ=qx(()=>{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 lp(e){if(op(e)===!1)return!1;const t=e.constructor;if(t===void 0)return!0;const n=t.prototype;return!(op(n)===!1||Object.prototype.hasOwnProperty.call(n,"isPrototypeOf")===!1)}const RZ=new Set(["string","number","symbol"]);function jd(e){return e.replace(/[.*+?^${}()|[\]\\]/g,"\\$&")}function To(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 $Z(e){return Object.keys(e).filter(t=>e[t]._zod.optin==="optional"&&e[t]._zod.optout==="optional")}const OZ={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 MZ(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 To(e,{...e._zod.def,shape:n,checks:[]})}function PZ(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 To(e,{...e._zod.def,shape:n,checks:[]})}function DZ(e,t){if(!lp(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 xm(this,"shape",r),r},checks:[]};return To(e,n)}function zZ(e,t){return To(e,{...e._zod.def,get shape(){const n={...e._zod.def.shape,...t._zod.def.shape};return xm(this,"shape",n),n},catchall:t._zod.def.catchall,checks:[]})}function IZ(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 To(t,{...t._zod.def,shape:a,checks:[]})}function LZ(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 To(t,{...t._zod.def,shape:a,checks:[]})}function _u(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 qs(e,t){return t.map(n=>{var r;return(r=n).path??(r.path=[]),n.path.unshift(e),n})}function Sf(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=Sf((s=(i=(a=e.inst)==null?void 0:a._zod.def)==null?void 0:i.error)==null?void 0:s.call(i,e))??Sf((o=t==null?void 0:t.error)==null?void 0:o.call(t,e))??Sf((l=n.customError)==null?void 0:l.call(n,e))??Sf((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 Vx(e){return Array.isArray(e)?"array":typeof e=="string"?"string":"unknown"}function Xu(...e){const[t,n,r]=e;return typeof t=="string"?{message:t,code:"custom",input:n,inst:r}:{...t}}const CO=(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,jZ,2)},enumerable:!0}),Object.defineProperty(e,"toString",{value:()=>e.message,enumerable:!1})},NO=ee("$ZodError",CO),jO=ee("$ZodError",CO,{Parent:Error});function UZ(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 FZ(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 qZ=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 Yu;if(s.issues.length){const o=new((a==null?void 0:a.Err)??e)(s.issues.map(l=>ps(l,i,hs())));throw EO(o,a==null?void 0:a.callee),o}return s.value},HZ=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,hs())));throw EO(o,a==null?void 0:a.callee),o}return s.value},TO=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 Yu;return i.issues.length?{success:!1,error:new(e??NO)(i.issues.map(s=>ps(s,a,hs())))}:{success:!0,data:i.value}},AO=TO(jO),RO=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,hs())))}:{success:!0,data:i.value}},BZ=RO(jO),VZ=/^[cC][^\s-]{8,}$/,KZ=/^[0-9a-z]+$/,ZZ=/^[0-9A-HJKMNP-TV-Za-hjkmnp-tv-z]{26}$/,GZ=/^[0-9a-vA-V]{20}$/,QZ=/^[A-Za-z0-9]{27}$/,YZ=/^[a-zA-Z0-9_-]{21}$/,XZ=/^P(?:(\d+W)|(?!.*W)(?=\d|T\d)(\d+Y)?(\d+M)?(\d+D)?(T(?=\d)(\d+H)?(\d+M)?(\d+([.,]\d+)?S)?)?)$/,WZ=/^([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})$/,Zk=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)$/,JZ=/^(?!\.)(?!.*\.\.)([A-Za-z0-9_'+\-\.]*)[A-Za-z0-9_+-]@([A-Za-z0-9][A-Za-z0-9\-]*\.)+[A-Za-z]{2,}$/,eG="^(\\p{Extended_Pictographic}|\\p{Emoji_Component})+$";function tG(){return new RegExp(eG,"u")}const nG=/^(?:(?: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])$/,rG=/^(([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})$/,aG=/^((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])$/,iG=/^(([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])$/,sG=/^$|^(?:[0-9a-zA-Z+/]{4})*(?:(?:[0-9a-zA-Z+/]{2}==)|(?:[0-9a-zA-Z+/]{3}=))?$/,$O=/^[A-Za-z0-9_-]*$/,oG=/^([a-zA-Z0-9-]+\.)*[a-zA-Z0-9-]+$/,lG=/^\+(?:[0-9]){6,14}[0-9]$/,OO="(?:(?:\\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])))",cG=new RegExp(`^${OO}$`);function MO(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 uG(e){return new RegExp(`^${MO(e)}$`)}function dG(e){const t=MO({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(`^${OO}T(?:${r})$`)}const fG=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}$`)},hG=/^\d+$/,pG=/^-?\d+(?:\.\d+)?/i,mG=/true|false/i,gG=/null/i,yG=/^[^A-Z]*$/,vG=/^[^a-z]*$/,nr=ee("$ZodCheck",(e,t)=>{var n;e._zod??(e._zod={}),e._zod.def=t,(n=e._zod).onattach??(n.onattach=[])}),PO={number:"number",bigint:"bigint",object:"date"},DO=ee("$ZodCheckLessThan",(e,t)=>{nr.init(e,t);const n=PO[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})}}),zO=ee("$ZodCheckGreaterThan",(e,t)=>{nr.init(e,t);const n=PO[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})}}),bG=ee("$ZodCheckMultipleOf",(e,t)=>{nr.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):TZ(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})}}),xG=ee("$ZodCheckNumberFormat",(e,t)=>{var s;nr.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]=OZ[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=hG)}),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})}}),wG=ee("$ZodCheckMaxLength",(e,t)=>{var n;nr.init(e,t),(n=e._zod.def).when??(n.when=r=>{const a=r.value;return!Hx(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=Vx(a);r.issues.push({origin:s,code:"too_big",maximum:t.maximum,inclusive:!0,input:a,inst:e,continue:!t.abort})}}),SG=ee("$ZodCheckMinLength",(e,t)=>{var n;nr.init(e,t),(n=e._zod.def).when??(n.when=r=>{const a=r.value;return!Hx(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=Vx(a);r.issues.push({origin:s,code:"too_small",minimum:t.minimum,inclusive:!0,input:a,inst:e,continue:!t.abort})}}),_G=ee("$ZodCheckLengthEquals",(e,t)=>{var n;nr.init(e,t),(n=e._zod.def).when??(n.when=r=>{const a=r.value;return!Hx(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=Vx(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})}}),wm=ee("$ZodCheckStringFormat",(e,t)=>{var n,r;nr.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=()=>{})}),kG=ee("$ZodCheckRegex",(e,t)=>{wm.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})}}),EG=ee("$ZodCheckLowerCase",(e,t)=>{t.pattern??(t.pattern=yG),wm.init(e,t)}),CG=ee("$ZodCheckUpperCase",(e,t)=>{t.pattern??(t.pattern=vG),wm.init(e,t)}),NG=ee("$ZodCheckIncludes",(e,t)=>{nr.init(e,t);const n=jd(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})}}),jG=ee("$ZodCheckStartsWith",(e,t)=>{nr.init(e,t);const n=new RegExp(`^${jd(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})}}),TG=ee("$ZodCheckEndsWith",(e,t)=>{nr.init(e,t);const n=new RegExp(`.*${jd(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})}}),AG=ee("$ZodCheckOverwrite",(e,t)=>{nr.init(e,t),e._zod.check=n=>{n.value=t.tx(n.value)}});class RG{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 $G={major:4,minor:0,patch:0},mt=ee("$ZodType",(e,t)=>{var a;var n;e??(e={}),e._zod.def=t,e._zod.bag=e._zod.bag||{},e._zod.version=$G;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=_u(s),d;for(const f of o){if(f._zod.def.when){if(!f._zod.def.when(s))continue}else if(u)continue;const p=s.issues.length,h=f._zod.check(s);if(h instanceof Promise&&(l==null?void 0:l.async)===!1)throw new Yu;if(d||h instanceof Promise)d=(d??Promise.resolve()).then(async()=>{await h,s.issues.length!==p&&(u||(u=_u(s,p)))});else{if(s.issues.length===p)continue;u||(u=_u(s,p))}}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 Yu;return l.then(u=>i(u,r,o))}return i(l,r,o)}}e["~standard"]={validate:i=>{var s;try{const o=AO(e,i);return o.success?{value:o.data}:{issues:(s=o.error)==null?void 0:s.issues}}catch{return BZ(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}}),Kx=ee("$ZodString",(e,t)=>{var n;mt.init(e,t),e._zod.pattern=[...((n=e==null?void 0:e._zod.bag)==null?void 0:n.patterns)??[]].pop()??fG(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}}),At=ee("$ZodStringFormat",(e,t)=>{wm.init(e,t),Kx.init(e,t)}),OG=ee("$ZodGUID",(e,t)=>{t.pattern??(t.pattern=WZ),At.init(e,t)}),MG=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=Zk(r))}else t.pattern??(t.pattern=Zk());At.init(e,t)}),PG=ee("$ZodEmail",(e,t)=>{t.pattern??(t.pattern=JZ),At.init(e,t)}),DG=ee("$ZodURL",(e,t)=>{At.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:oG.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})}}}),zG=ee("$ZodEmoji",(e,t)=>{t.pattern??(t.pattern=tG()),At.init(e,t)}),IG=ee("$ZodNanoID",(e,t)=>{t.pattern??(t.pattern=YZ),At.init(e,t)}),LG=ee("$ZodCUID",(e,t)=>{t.pattern??(t.pattern=VZ),At.init(e,t)}),UG=ee("$ZodCUID2",(e,t)=>{t.pattern??(t.pattern=KZ),At.init(e,t)}),FG=ee("$ZodULID",(e,t)=>{t.pattern??(t.pattern=ZZ),At.init(e,t)}),qG=ee("$ZodXID",(e,t)=>{t.pattern??(t.pattern=GZ),At.init(e,t)}),HG=ee("$ZodKSUID",(e,t)=>{t.pattern??(t.pattern=QZ),At.init(e,t)}),BG=ee("$ZodISODateTime",(e,t)=>{t.pattern??(t.pattern=dG(t)),At.init(e,t)}),VG=ee("$ZodISODate",(e,t)=>{t.pattern??(t.pattern=cG),At.init(e,t)}),KG=ee("$ZodISOTime",(e,t)=>{t.pattern??(t.pattern=uG(t)),At.init(e,t)}),ZG=ee("$ZodISODuration",(e,t)=>{t.pattern??(t.pattern=XZ),At.init(e,t)}),GG=ee("$ZodIPv4",(e,t)=>{t.pattern??(t.pattern=nG),At.init(e,t),e._zod.onattach.push(n=>{const r=n._zod.bag;r.format="ipv4"})}),QG=ee("$ZodIPv6",(e,t)=>{t.pattern??(t.pattern=rG),At.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})}}}),YG=ee("$ZodCIDRv4",(e,t)=>{t.pattern??(t.pattern=aG),At.init(e,t)}),XG=ee("$ZodCIDRv6",(e,t)=>{t.pattern??(t.pattern=iG),At.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 IO(e){if(e==="")return!0;if(e.length%4!==0)return!1;try{return atob(e),!0}catch{return!1}}const WG=ee("$ZodBase64",(e,t)=>{t.pattern??(t.pattern=sG),At.init(e,t),e._zod.onattach.push(n=>{n._zod.bag.contentEncoding="base64"}),e._zod.check=n=>{IO(n.value)||n.issues.push({code:"invalid_format",format:"base64",input:n.value,inst:e,continue:!t.abort})}});function JG(e){if(!$O.test(e))return!1;const t=e.replace(/[-_]/g,r=>r==="-"?"+":"/"),n=t.padEnd(Math.ceil(t.length/4)*4,"=");return IO(n)}const eQ=ee("$ZodBase64URL",(e,t)=>{t.pattern??(t.pattern=$O),At.init(e,t),e._zod.onattach.push(n=>{n._zod.bag.contentEncoding="base64url"}),e._zod.check=n=>{JG(n.value)||n.issues.push({code:"invalid_format",format:"base64url",input:n.value,inst:e,continue:!t.abort})}}),tQ=ee("$ZodE164",(e,t)=>{t.pattern??(t.pattern=lG),At.init(e,t)});function nQ(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 rQ=ee("$ZodJWT",(e,t)=>{At.init(e,t),e._zod.check=n=>{nQ(n.value,t.alg)||n.issues.push({code:"invalid_format",format:"jwt",input:n.value,inst:e,continue:!t.abort})}}),LO=ee("$ZodNumber",(e,t)=>{mt.init(e,t),e._zod.pattern=e._zod.bag.pattern??pG,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}}),aQ=ee("$ZodNumber",(e,t)=>{xG.init(e,t),LO.init(e,t)}),iQ=ee("$ZodBoolean",(e,t)=>{mt.init(e,t),e._zod.pattern=mG,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}}),sQ=ee("$ZodNull",(e,t)=>{mt.init(e,t),e._zod.pattern=gG,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}}),oQ=ee("$ZodAny",(e,t)=>{mt.init(e,t),e._zod.parse=n=>n}),lQ=ee("$ZodUnknown",(e,t)=>{mt.init(e,t),e._zod.parse=n=>n}),cQ=ee("$ZodNever",(e,t)=>{mt.init(e,t),e._zod.parse=(n,r)=>(n.issues.push({expected:"never",code:"invalid_type",input:n.value,inst:e}),n)});function Gk(e,t,n){e.issues.length&&t.issues.push(...qs(n,e.issues)),t.value[n]=e.value}const uQ=ee("$ZodArray",(e,t)=>{mt.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=>Gk(u,n,s))):Gk(l,n,s)}return i.length?Promise.all(i).then(()=>n):n}});function _f(e,t,n){e.issues.length&&t.issues.push(...qs(n,e.issues)),t.value[n]=e.value}function Qk(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(...qs(n,e.issues)):e.value===void 0?n in r&&(t.value[n]=void 0):t.value[n]=e.value}const dQ=ee("$ZodObject",(e,t)=>{mt.init(e,t);const n=qx(()=>{const f=Object.keys(t.shape);for(const h of f)if(!(t.shape[h]instanceof mt))throw new Error(`Invalid element at key "${h}": expected a Zod schema`);const p=$Z(t.shape);return{shape:t.shape,keys:f,keySet:new Set(f),numKeys:f.length,optionalKeys:new Set(p)}});Et(e._zod,"propValues",()=>{const f=t.shape,p={};for(const h in f){const y=f[h]._zod;if(y.values){p[h]??(p[h]=new Set);for(const m of y.values)p[h].add(m)}}return p});const r=f=>{const p=new RG(["shape","payload","ctx"]),h=n.value,y=v=>{const x=Lc(v);return`shape[${x}]._zod.run({ value: input[${x}], issues: [] }, ctx)`};p.write("const input = payload.value;");const m=Object.create(null);let b=0;for(const v of h.keys)m[v]=`key_${b++}`;p.write("const newResult = {}");for(const v of h.keys)if(h.optionalKeys.has(v)){const x=m[v];p.write(`const ${x} = ${y(v)};`);const S=Lc(v);p.write(`
|
|
456
|
+
if (${x}.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
|
+
${x}.issues.map((iss) => ({
|
|
464
|
+
...iss,
|
|
465
|
+
path: iss.path ? [${S}, ...iss.path] : [${S}],
|
|
466
|
+
}))
|
|
467
|
+
);
|
|
468
|
+
}
|
|
469
|
+
} else if (${x}.value === undefined) {
|
|
470
|
+
if (${S} in input) newResult[${S}] = undefined;
|
|
471
|
+
} else {
|
|
472
|
+
newResult[${S}] = ${x}.value;
|
|
473
|
+
}
|
|
474
|
+
`)}else{const x=m[v];p.write(`const ${x} = ${y(v)};`),p.write(`
|
|
475
|
+
if (${x}.issues.length) payload.issues = payload.issues.concat(${x}.issues.map(iss => ({
|
|
476
|
+
...iss,
|
|
477
|
+
path: iss.path ? [${Lc(v)}, ...iss.path] : [${Lc(v)}]
|
|
478
|
+
})));`),p.write(`newResult[${Lc(v)}] = ${x}.value`)}p.write("payload.value = newResult;"),p.write("return payload;");const g=p.compile();return(v,x)=>g(f,v,x)};let a;const i=op,s=!kO.jitless,l=s&&AZ.value,u=t.catchall;let d;e._zod.parse=(f,p)=>{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&&(p==null?void 0:p.async)===!1&&p.jitless!==!0)a||(a=r(t.shape)),f=a(f,p);else{f.value={};const x=d.shape;for(const S of d.keys){const k=x[S],C=k._zod.run({value:h[S],issues:[]},p),N=k._zod.optin==="optional"&&k._zod.optout==="optional";C instanceof Promise?y.push(C.then(P=>N?Qk(P,f,S,h):_f(P,f,S))):N?Qk(C,f,S,h):_f(C,f,S)}}if(!u)return y.length?Promise.all(y).then(()=>f):f;const m=[],b=d.keySet,g=u._zod,v=g.def.type;for(const x of Object.keys(h)){if(b.has(x))continue;if(v==="never"){m.push(x);continue}const S=g.run({value:h[x],issues:[]},p);S instanceof Promise?y.push(S.then(k=>_f(k,f,x))):_f(S,f,x)}return m.length&&f.issues.push({code:"unrecognized_keys",keys:m,input:h,inst:e}),y.length?Promise.all(y).then(()=>f):f}});function Yk(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,hs())))}),t}const UO=ee("$ZodUnion",(e,t)=>{mt.init(e,t),Et(e._zod,"optin",()=>t.options.some(n=>n._zod.optin==="optional")?"optional":void 0),Et(e._zod,"optout",()=>t.options.some(n=>n._zod.optout==="optional")?"optional":void 0),Et(e._zod,"values",()=>{if(t.options.every(n=>n._zod.values))return new Set(t.options.flatMap(n=>Array.from(n._zod.values)))}),Et(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=>Bx(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=>Yk(s,n,e,r)):Yk(i,n,e,r)}}),fQ=ee("$ZodDiscriminatedUnion",(e,t)=>{UO.init(e,t);const n=e._zod.parse;Et(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=qx(()=>{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(!op(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)}}),hQ=ee("$ZodIntersection",(e,t)=>{mt.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])=>Xk(n,l,u)):Xk(n,i,s)}});function t0(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(lp(e)&&lp(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=t0(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=t0(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 Xk(e,t,n){if(t.issues.length&&e.issues.push(...t.issues),n.issues.length&&e.issues.push(...n.issues),_u(e))return e;const r=t0(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 pQ=ee("$ZodRecord",(e,t)=>{mt.init(e,t),e._zod.parse=(n,r)=>{const a=n.value;if(!lp(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(...qs(l,d.issues)),n.value[l]=d.value})):(u.issues.length&&n.issues.push(...qs(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,hs())),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(...qs(s,u.issues)),n.value[o.value]=u.value})):(l.issues.length&&n.issues.push(...qs(s,l.issues)),n.value[o.value]=l.value)}}return i.length?Promise.all(i).then(()=>n):n}}),mQ=ee("$ZodEnum",(e,t)=>{mt.init(e,t);const n=NZ(t.entries);e._zod.values=new Set(n),e._zod.pattern=new RegExp(`^(${n.filter(r=>RZ.has(typeof r)).map(r=>typeof r=="string"?jd(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}}),gQ=ee("$ZodLiteral",(e,t)=>{mt.init(e,t),e._zod.values=new Set(t.values),e._zod.pattern=new RegExp(`^(${t.values.map(n=>typeof n=="string"?jd(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}}),yQ=ee("$ZodTransform",(e,t)=>{mt.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 Yu;return n.value=a,n}}),vQ=ee("$ZodOptional",(e,t)=>{mt.init(e,t),e._zod.optin="optional",e._zod.optout="optional",Et(e._zod,"values",()=>t.innerType._zod.values?new Set([...t.innerType._zod.values,void 0]):void 0),Et(e._zod,"pattern",()=>{const n=t.innerType._zod.pattern;return n?new RegExp(`^(${Bx(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)}),bQ=ee("$ZodNullable",(e,t)=>{mt.init(e,t),Et(e._zod,"optin",()=>t.innerType._zod.optin),Et(e._zod,"optout",()=>t.innerType._zod.optout),Et(e._zod,"pattern",()=>{const n=t.innerType._zod.pattern;return n?new RegExp(`^(${Bx(n.source)}|null)$`):void 0}),Et(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)}),xQ=ee("$ZodDefault",(e,t)=>{mt.init(e,t),e._zod.optin="optional",Et(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=>Wk(i,t)):Wk(a,t)}});function Wk(e,t){return e.value===void 0&&(e.value=t.defaultValue),e}const wQ=ee("$ZodPrefault",(e,t)=>{mt.init(e,t),e._zod.optin="optional",Et(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))}),SQ=ee("$ZodNonOptional",(e,t)=>{mt.init(e,t),Et(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=>Jk(i,e)):Jk(a,e)}});function Jk(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 _Q=ee("$ZodCatch",(e,t)=>{mt.init(e,t),e._zod.optin="optional",Et(e._zod,"optout",()=>t.innerType._zod.optout),Et(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,hs()))},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,hs()))},input:n.value}),n.issues=[]),n)}}),kQ=ee("$ZodPipe",(e,t)=>{mt.init(e,t),Et(e._zod,"values",()=>t.in._zod.values),Et(e._zod,"optin",()=>t.in._zod.optin),Et(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=>eE(i,t,r)):eE(a,t,r)}});function eE(e,t,n){return _u(e)?e:t.out._zod.run({value:e.value,issues:e.issues},n)}const EQ=ee("$ZodReadonly",(e,t)=>{mt.init(e,t),Et(e._zod,"propValues",()=>t.innerType._zod.propValues),Et(e._zod,"values",()=>t.innerType._zod.values),Et(e._zod,"optin",()=>t.innerType._zod.optin),Et(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(tE):tE(a)}});function tE(e){return e.value=Object.freeze(e.value),e}const CQ=ee("$ZodCustom",(e,t)=>{nr.init(e,t),mt.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=>nE(i,n,r,e));nE(a,n,r,e)}});function nE(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(Xu(a))}}class NQ{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 jQ(){return new NQ}const kf=jQ();function TQ(e,t){return new e({type:"string",...ye(t)})}function AQ(e,t){return new e({type:"string",format:"email",check:"string_format",abort:!1,...ye(t)})}function rE(e,t){return new e({type:"string",format:"guid",check:"string_format",abort:!1,...ye(t)})}function RQ(e,t){return new e({type:"string",format:"uuid",check:"string_format",abort:!1,...ye(t)})}function $Q(e,t){return new e({type:"string",format:"uuid",check:"string_format",abort:!1,version:"v4",...ye(t)})}function OQ(e,t){return new e({type:"string",format:"uuid",check:"string_format",abort:!1,version:"v6",...ye(t)})}function MQ(e,t){return new e({type:"string",format:"uuid",check:"string_format",abort:!1,version:"v7",...ye(t)})}function FO(e,t){return new e({type:"string",format:"url",check:"string_format",abort:!1,...ye(t)})}function PQ(e,t){return new e({type:"string",format:"emoji",check:"string_format",abort:!1,...ye(t)})}function DQ(e,t){return new e({type:"string",format:"nanoid",check:"string_format",abort:!1,...ye(t)})}function zQ(e,t){return new e({type:"string",format:"cuid",check:"string_format",abort:!1,...ye(t)})}function IQ(e,t){return new e({type:"string",format:"cuid2",check:"string_format",abort:!1,...ye(t)})}function LQ(e,t){return new e({type:"string",format:"ulid",check:"string_format",abort:!1,...ye(t)})}function UQ(e,t){return new e({type:"string",format:"xid",check:"string_format",abort:!1,...ye(t)})}function FQ(e,t){return new e({type:"string",format:"ksuid",check:"string_format",abort:!1,...ye(t)})}function qQ(e,t){return new e({type:"string",format:"ipv4",check:"string_format",abort:!1,...ye(t)})}function HQ(e,t){return new e({type:"string",format:"ipv6",check:"string_format",abort:!1,...ye(t)})}function BQ(e,t){return new e({type:"string",format:"cidrv4",check:"string_format",abort:!1,...ye(t)})}function VQ(e,t){return new e({type:"string",format:"cidrv6",check:"string_format",abort:!1,...ye(t)})}function KQ(e,t){return new e({type:"string",format:"base64",check:"string_format",abort:!1,...ye(t)})}function ZQ(e,t){return new e({type:"string",format:"base64url",check:"string_format",abort:!1,...ye(t)})}function GQ(e,t){return new e({type:"string",format:"e164",check:"string_format",abort:!1,...ye(t)})}function QQ(e,t){return new e({type:"string",format:"jwt",check:"string_format",abort:!1,...ye(t)})}function YQ(e,t){return new e({type:"string",format:"datetime",check:"string_format",offset:!1,local:!1,precision:null,...ye(t)})}function XQ(e,t){return new e({type:"string",format:"date",check:"string_format",...ye(t)})}function WQ(e,t){return new e({type:"string",format:"time",check:"string_format",precision:null,...ye(t)})}function JQ(e,t){return new e({type:"string",format:"duration",check:"string_format",...ye(t)})}function eY(e,t){return new e({type:"number",checks:[],...ye(t)})}function tY(e,t){return new e({type:"number",coerce:!0,checks:[],...ye(t)})}function nY(e,t){return new e({type:"number",check:"number_format",abort:!1,format:"safeint",...ye(t)})}function rY(e,t){return new e({type:"boolean",...ye(t)})}function aY(e,t){return new e({type:"null",...ye(t)})}function iY(e){return new e({type:"any"})}function sY(e){return new e({type:"unknown"})}function oY(e,t){return new e({type:"never",...ye(t)})}function aE(e,t){return new DO({check:"less_than",...ye(t),value:e,inclusive:!1})}function Jg(e,t){return new DO({check:"less_than",...ye(t),value:e,inclusive:!0})}function iE(e,t){return new zO({check:"greater_than",...ye(t),value:e,inclusive:!1})}function ey(e,t){return new zO({check:"greater_than",...ye(t),value:e,inclusive:!0})}function sE(e,t){return new bG({check:"multiple_of",...ye(t),value:e})}function qO(e,t){return new wG({check:"max_length",...ye(t),maximum:e})}function cp(e,t){return new SG({check:"min_length",...ye(t),minimum:e})}function HO(e,t){return new _G({check:"length_equals",...ye(t),length:e})}function lY(e,t){return new kG({check:"string_format",format:"regex",...ye(t),pattern:e})}function cY(e){return new EG({check:"string_format",format:"lowercase",...ye(e)})}function uY(e){return new CG({check:"string_format",format:"uppercase",...ye(e)})}function dY(e,t){return new NG({check:"string_format",format:"includes",...ye(t),includes:e})}function fY(e,t){return new jG({check:"string_format",format:"starts_with",...ye(t),prefix:e})}function hY(e,t){return new TG({check:"string_format",format:"ends_with",...ye(t),suffix:e})}function Td(e){return new AG({check:"overwrite",tx:e})}function pY(e){return Td(t=>t.normalize(e))}function mY(){return Td(e=>e.trim())}function gY(){return Td(e=>e.toLowerCase())}function yY(){return Td(e=>e.toUpperCase())}function vY(e,t,n){return new e({type:"array",element:t,...ye(n)})}function bY(e,t,n){const r=ye(n);return r.abort??(r.abort=!0),new e({type:"custom",check:"custom",fn:t,...r})}function xY(e,t,n){return new e({type:"custom",check:"custom",fn:t,...ye(n)})}const wY=ee("ZodISODateTime",(e,t)=>{BG.init(e,t),Pt.init(e,t)});function BO(e){return YQ(wY,e)}const SY=ee("ZodISODate",(e,t)=>{VG.init(e,t),Pt.init(e,t)});function _Y(e){return XQ(SY,e)}const kY=ee("ZodISOTime",(e,t)=>{KG.init(e,t),Pt.init(e,t)});function EY(e){return WQ(kY,e)}const CY=ee("ZodISODuration",(e,t)=>{ZG.init(e,t),Pt.init(e,t)});function NY(e){return JQ(CY,e)}const jY=(e,t)=>{NO.init(e,t),e.name="ZodError",Object.defineProperties(e,{format:{value:n=>FZ(e,n)},flatten:{value:n=>UZ(e,n)},addIssue:{value:n=>e.issues.push(n)},addIssues:{value:n=>e.issues.push(...n)},isEmpty:{get(){return e.issues.length===0}}})},Sm=ee("ZodError",jY,{Parent:Error}),TY=qZ(Sm),AY=HZ(Sm),RY=TO(Sm),$Y=RO(Sm),Rt=ee("ZodType",(e,t)=>(mt.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)=>To(e,n,r),e.brand=()=>e,e.register=(n,r)=>(n.add(e,r),e),e.parse=(n,r)=>TY(e,n,r,{callee:e.parse}),e.safeParse=(n,r)=>RY(e,n,r),e.parseAsync=async(n,r)=>AY(e,n,r,{callee:e.parseAsync}),e.safeParseAsync=async(n,r)=>$Y(e,n,r),e.spa=e.safeParseAsync,e.refine=(n,r)=>e.check(EX(n,r)),e.superRefine=n=>e.check(CX(n)),e.overwrite=n=>e.check(Td(n)),e.optional=()=>Ot(e),e.nullable=()=>cE(e),e.nullish=()=>Ot(cE(e)),e.nonoptional=n=>yX(e,n),e.array=()=>he(e),e.or=n=>$t([e,n]),e.and=n=>Gx(e,n),e.transform=n=>r0(e,YO(n)),e.default=n=>pX(e,n),e.prefault=n=>gX(e,n),e.catch=n=>bX(e,n),e.pipe=n=>r0(e,n),e.readonly=()=>SX(e),e.describe=n=>{const r=e.clone();return kf.add(r,{description:n}),r},Object.defineProperty(e,"description",{get(){var n;return(n=kf.get(e))==null?void 0:n.description},configurable:!0}),e.meta=(...n)=>{if(n.length===0)return kf.get(e);const r=e.clone();return kf.add(r,n[0]),r},e.isOptional=()=>e.safeParse(void 0).success,e.isNullable=()=>e.safeParse(null).success,e)),VO=ee("_ZodString",(e,t)=>{Kx.init(e,t),Rt.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(lY(...r)),e.includes=(...r)=>e.check(dY(...r)),e.startsWith=(...r)=>e.check(fY(...r)),e.endsWith=(...r)=>e.check(hY(...r)),e.min=(...r)=>e.check(cp(...r)),e.max=(...r)=>e.check(qO(...r)),e.length=(...r)=>e.check(HO(...r)),e.nonempty=(...r)=>e.check(cp(1,...r)),e.lowercase=r=>e.check(cY(r)),e.uppercase=r=>e.check(uY(r)),e.trim=()=>e.check(mY()),e.normalize=(...r)=>e.check(pY(...r)),e.toLowerCase=()=>e.check(gY()),e.toUpperCase=()=>e.check(yY())}),OY=ee("ZodString",(e,t)=>{Kx.init(e,t),VO.init(e,t),e.email=n=>e.check(AQ(MY,n)),e.url=n=>e.check(FO(KO,n)),e.jwt=n=>e.check(QQ(YY,n)),e.emoji=n=>e.check(PQ(DY,n)),e.guid=n=>e.check(rE(oE,n)),e.uuid=n=>e.check(RQ(Ef,n)),e.uuidv4=n=>e.check($Q(Ef,n)),e.uuidv6=n=>e.check(OQ(Ef,n)),e.uuidv7=n=>e.check(MQ(Ef,n)),e.nanoid=n=>e.check(DQ(zY,n)),e.guid=n=>e.check(rE(oE,n)),e.cuid=n=>e.check(zQ(IY,n)),e.cuid2=n=>e.check(IQ(LY,n)),e.ulid=n=>e.check(LQ(UY,n)),e.base64=n=>e.check(KQ(ZY,n)),e.base64url=n=>e.check(ZQ(GY,n)),e.xid=n=>e.check(UQ(FY,n)),e.ksuid=n=>e.check(FQ(qY,n)),e.ipv4=n=>e.check(qQ(HY,n)),e.ipv6=n=>e.check(HQ(BY,n)),e.cidrv4=n=>e.check(BQ(VY,n)),e.cidrv6=n=>e.check(VQ(KY,n)),e.e164=n=>e.check(GQ(QY,n)),e.datetime=n=>e.check(BO(n)),e.date=n=>e.check(_Y(n)),e.time=n=>e.check(EY(n)),e.duration=n=>e.check(NY(n))});function H(e){return TQ(OY,e)}const Pt=ee("ZodStringFormat",(e,t)=>{At.init(e,t),VO.init(e,t)}),MY=ee("ZodEmail",(e,t)=>{PG.init(e,t),Pt.init(e,t)}),oE=ee("ZodGUID",(e,t)=>{OG.init(e,t),Pt.init(e,t)}),Ef=ee("ZodUUID",(e,t)=>{MG.init(e,t),Pt.init(e,t)}),KO=ee("ZodURL",(e,t)=>{DG.init(e,t),Pt.init(e,t)});function PY(e){return FO(KO,e)}const DY=ee("ZodEmoji",(e,t)=>{zG.init(e,t),Pt.init(e,t)}),zY=ee("ZodNanoID",(e,t)=>{IG.init(e,t),Pt.init(e,t)}),IY=ee("ZodCUID",(e,t)=>{LG.init(e,t),Pt.init(e,t)}),LY=ee("ZodCUID2",(e,t)=>{UG.init(e,t),Pt.init(e,t)}),UY=ee("ZodULID",(e,t)=>{FG.init(e,t),Pt.init(e,t)}),FY=ee("ZodXID",(e,t)=>{qG.init(e,t),Pt.init(e,t)}),qY=ee("ZodKSUID",(e,t)=>{HG.init(e,t),Pt.init(e,t)}),HY=ee("ZodIPv4",(e,t)=>{GG.init(e,t),Pt.init(e,t)}),BY=ee("ZodIPv6",(e,t)=>{QG.init(e,t),Pt.init(e,t)}),VY=ee("ZodCIDRv4",(e,t)=>{YG.init(e,t),Pt.init(e,t)}),KY=ee("ZodCIDRv6",(e,t)=>{XG.init(e,t),Pt.init(e,t)}),ZY=ee("ZodBase64",(e,t)=>{WG.init(e,t),Pt.init(e,t)}),GY=ee("ZodBase64URL",(e,t)=>{eQ.init(e,t),Pt.init(e,t)}),QY=ee("ZodE164",(e,t)=>{tQ.init(e,t),Pt.init(e,t)}),YY=ee("ZodJWT",(e,t)=>{rQ.init(e,t),Pt.init(e,t)}),Zx=ee("ZodNumber",(e,t)=>{LO.init(e,t),Rt.init(e,t),e.gt=(r,a)=>e.check(iE(r,a)),e.gte=(r,a)=>e.check(ey(r,a)),e.min=(r,a)=>e.check(ey(r,a)),e.lt=(r,a)=>e.check(aE(r,a)),e.lte=(r,a)=>e.check(Jg(r,a)),e.max=(r,a)=>e.check(Jg(r,a)),e.int=r=>e.check(lE(r)),e.safe=r=>e.check(lE(r)),e.positive=r=>e.check(iE(0,r)),e.nonnegative=r=>e.check(ey(0,r)),e.negative=r=>e.check(aE(0,r)),e.nonpositive=r=>e.check(Jg(0,r)),e.multipleOf=(r,a)=>e.check(sE(r,a)),e.step=(r,a)=>e.check(sE(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 et(e){return eY(Zx,e)}const XY=ee("ZodNumberFormat",(e,t)=>{aQ.init(e,t),Zx.init(e,t)});function lE(e){return nY(XY,e)}const WY=ee("ZodBoolean",(e,t)=>{iQ.init(e,t),Rt.init(e,t)});function _t(e){return rY(WY,e)}const JY=ee("ZodNull",(e,t)=>{sQ.init(e,t),Rt.init(e,t)});function eX(e){return aY(JY,e)}const tX=ee("ZodAny",(e,t)=>{oQ.init(e,t),Rt.init(e,t)});function nX(){return iY(tX)}const rX=ee("ZodUnknown",(e,t)=>{lQ.init(e,t),Rt.init(e,t)});function Mt(){return sY(rX)}const aX=ee("ZodNever",(e,t)=>{cQ.init(e,t),Rt.init(e,t)});function iX(e){return oY(aX,e)}const sX=ee("ZodArray",(e,t)=>{uQ.init(e,t),Rt.init(e,t),e.element=t.element,e.min=(n,r)=>e.check(cp(n,r)),e.nonempty=n=>e.check(cp(1,n)),e.max=(n,r)=>e.check(qO(n,r)),e.length=(n,r)=>e.check(HO(n,r)),e.unwrap=()=>e.element});function he(e,t){return vY(sX,e,t)}const ZO=ee("ZodObject",(e,t)=>{dQ.init(e,t),Rt.init(e,t),Et(e,"shape",()=>t.shape),e.keyof=()=>br(Object.keys(e._zod.def.shape)),e.catchall=n=>e.clone({...e._zod.def,catchall:n}),e.passthrough=()=>e.clone({...e._zod.def,catchall:Mt()}),e.loose=()=>e.clone({...e._zod.def,catchall:Mt()}),e.strict=()=>e.clone({...e._zod.def,catchall:iX()}),e.strip=()=>e.clone({...e._zod.def,catchall:void 0}),e.extend=n=>DZ(e,n),e.merge=n=>zZ(e,n),e.pick=n=>MZ(e,n),e.omit=n=>PZ(e,n),e.partial=(...n)=>IZ(XO,e,n[0]),e.required=(...n)=>LZ(WO,e,n[0])});function pe(e,t){const n={type:"object",get shape(){return xm(this,"shape",{...e}),this.shape},...ye(t)};return new ZO(n)}function bn(e,t){return new ZO({type:"object",get shape(){return xm(this,"shape",{...e}),this.shape},catchall:Mt(),...ye(t)})}const GO=ee("ZodUnion",(e,t)=>{UO.init(e,t),Rt.init(e,t),e.options=t.options});function $t(e,t){return new GO({type:"union",options:e,...ye(t)})}const oX=ee("ZodDiscriminatedUnion",(e,t)=>{GO.init(e,t),fQ.init(e,t)});function QO(e,t,n){return new oX({type:"union",options:t,discriminator:e,...ye(n)})}const lX=ee("ZodIntersection",(e,t)=>{hQ.init(e,t),Rt.init(e,t)});function Gx(e,t){return new lX({type:"intersection",left:e,right:t})}const cX=ee("ZodRecord",(e,t)=>{pQ.init(e,t),Rt.init(e,t),e.keyType=t.keyType,e.valueType=t.valueType});function Ct(e,t,n){return new cX({type:"record",keyType:e,valueType:t,...ye(n)})}const n0=ee("ZodEnum",(e,t)=>{mQ.init(e,t),Rt.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 n0({...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 n0({...t,checks:[],...ye(a),entries:i})}});function br(e,t){const n=Array.isArray(e)?Object.fromEntries(e.map(r=>[r,r])):e;return new n0({type:"enum",entries:n,...ye(t)})}const uX=ee("ZodLiteral",(e,t)=>{gQ.init(e,t),Rt.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 uX({type:"literal",values:Array.isArray(e)?e:[e],...ye(t)})}const dX=ee("ZodTransform",(e,t)=>{yQ.init(e,t),Rt.init(e,t),e._zod.parse=(n,r)=>{n.addIssue=i=>{if(typeof i=="string")n.issues.push(Xu(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(Xu(s))}};const a=t.transform(n.value,n);return a instanceof Promise?a.then(i=>(n.value=i,n)):(n.value=a,n)}});function YO(e){return new dX({type:"transform",transform:e})}const XO=ee("ZodOptional",(e,t)=>{vQ.init(e,t),Rt.init(e,t),e.unwrap=()=>e._zod.def.innerType});function Ot(e){return new XO({type:"optional",innerType:e})}const fX=ee("ZodNullable",(e,t)=>{bQ.init(e,t),Rt.init(e,t),e.unwrap=()=>e._zod.def.innerType});function cE(e){return new fX({type:"nullable",innerType:e})}const hX=ee("ZodDefault",(e,t)=>{xQ.init(e,t),Rt.init(e,t),e.unwrap=()=>e._zod.def.innerType,e.removeDefault=e.unwrap});function pX(e,t){return new hX({type:"default",innerType:e,get defaultValue(){return typeof t=="function"?t():t}})}const mX=ee("ZodPrefault",(e,t)=>{wQ.init(e,t),Rt.init(e,t),e.unwrap=()=>e._zod.def.innerType});function gX(e,t){return new mX({type:"prefault",innerType:e,get defaultValue(){return typeof t=="function"?t():t}})}const WO=ee("ZodNonOptional",(e,t)=>{SQ.init(e,t),Rt.init(e,t),e.unwrap=()=>e._zod.def.innerType});function yX(e,t){return new WO({type:"nonoptional",innerType:e,...ye(t)})}const vX=ee("ZodCatch",(e,t)=>{_Q.init(e,t),Rt.init(e,t),e.unwrap=()=>e._zod.def.innerType,e.removeCatch=e.unwrap});function bX(e,t){return new vX({type:"catch",innerType:e,catchValue:typeof t=="function"?t:()=>t})}const xX=ee("ZodPipe",(e,t)=>{kQ.init(e,t),Rt.init(e,t),e.in=t.in,e.out=t.out});function r0(e,t){return new xX({type:"pipe",in:e,out:t})}const wX=ee("ZodReadonly",(e,t)=>{EQ.init(e,t),Rt.init(e,t)});function SX(e){return new wX({type:"readonly",innerType:e})}const JO=ee("ZodCustom",(e,t)=>{CQ.init(e,t),Rt.init(e,t)});function _X(e){const t=new nr({check:"custom"});return t._zod.check=e,t}function kX(e,t){return bY(JO,e??(()=>!0),t)}function EX(e,t={}){return xY(JO,e,t)}function CX(e){const t=_X(n=>(n.addIssue=r=>{if(typeof r=="string")n.issues.push(Xu(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(Xu(a))}},e(n.value,n)));return t}function eM(e,t){return r0(YO(e),t)}const NX={custom:"custom"};function jX(e){return tY(Zx,e)}const _m="2025-11-25",TX=[_m,"2025-06-18","2025-03-26","2024-11-05","2024-10-07"],Ps="io.modelcontextprotocol/related-task",km="2.0",Jt=kX(e=>e!==null&&(typeof e=="object"||typeof e=="function")),tM=$t([H(),et().int()]),nM=H();bn({ttl:et().optional(),pollInterval:et().optional()});const AX=pe({ttl:et().optional()}),RX=pe({taskId:H()}),Qx=bn({progressToken:tM.optional(),[Ps]:RX.optional()}),xr=pe({_meta:Qx.optional()}),Ad=xr.extend({task:AX.optional()}),$X=e=>Ad.safeParse(e).success,Sn=pe({method:H(),params:xr.loose().optional()}),Lr=pe({_meta:Qx.optional()}),Ur=pe({method:H(),params:Lr.loose().optional()}),_n=bn({_meta:Qx.optional()}),Em=$t([H(),et().int()]),rM=pe({jsonrpc:be(km),id:Em,...Sn.shape}).strict(),a0=e=>rM.safeParse(e).success,aM=pe({jsonrpc:be(km),...Ur.shape}).strict(),OX=e=>aM.safeParse(e).success,Yx=pe({jsonrpc:be(km),id:Em,result:_n}).strict(),Xc=e=>Yx.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 Xx=pe({jsonrpc:be(km),id:Em.optional(),error:pe({code:et().int(),message:H(),data:Mt().optional()})}).strict(),MX=e=>Xx.safeParse(e).success,rh=$t([rM,aM,Yx,Xx]);$t([Yx,Xx]);const ol=_n.strict(),PX=Lr.extend({requestId:Em.optional(),reason:H().optional()}),Wx=Ur.extend({method:be("notifications/cancelled"),params:PX}),DX=pe({src:H(),mimeType:H().optional(),sizes:he(H()).optional(),theme:br(["light","dark"]).optional()}),Rd=pe({icons:he(DX).optional()}),tc=pe({name:H(),title:H().optional()}),iM=tc.extend({...tc.shape,...Rd.shape,version:H(),websiteUrl:H().optional(),description:H().optional()}),zX=Gx(pe({applyDefaults:_t().optional()}),Ct(H(),Mt())),IX=eM(e=>e&&typeof e=="object"&&!Array.isArray(e)&&Object.keys(e).length===0?{form:{}}:e,Gx(pe({form:zX.optional(),url:Jt.optional()}),Ct(H(),Mt()).optional())),LX=bn({list:Jt.optional(),cancel:Jt.optional(),requests:bn({sampling:bn({createMessage:Jt.optional()}).optional(),elicitation:bn({create:Jt.optional()}).optional()}).optional()}),UX=bn({list:Jt.optional(),cancel:Jt.optional(),requests:bn({tools:bn({call:Jt.optional()}).optional()}).optional()}),FX=pe({experimental:Ct(H(),Jt).optional(),sampling:pe({context:Jt.optional(),tools:Jt.optional()}).optional(),elicitation:IX.optional(),roots:pe({listChanged:_t().optional()}).optional(),tasks:LX.optional(),extensions:Ct(H(),Jt).optional()}),qX=xr.extend({protocolVersion:H(),capabilities:FX,clientInfo:iM}),HX=Sn.extend({method:be("initialize"),params:qX}),BX=pe({experimental:Ct(H(),Jt).optional(),logging:Jt.optional(),completions:Jt.optional(),prompts:pe({listChanged:_t().optional()}).optional(),resources:pe({subscribe:_t().optional(),listChanged:_t().optional()}).optional(),tools:pe({listChanged:_t().optional()}).optional(),tasks:UX.optional(),extensions:Ct(H(),Jt).optional()}),sM=_n.extend({protocolVersion:H(),capabilities:BX,serverInfo:iM,instructions:H().optional()}),oM=Ur.extend({method:be("notifications/initialized"),params:Lr.optional()}),VX=e=>oM.safeParse(e).success,Jx=Sn.extend({method:be("ping"),params:xr.optional()}),KX=pe({progress:et(),total:Ot(et()),message:Ot(H())}),ZX=pe({...Lr.shape,...KX.shape,progressToken:tM}),ew=Ur.extend({method:be("notifications/progress"),params:ZX}),GX=xr.extend({cursor:nM.optional()}),$d=Sn.extend({params:GX.optional()}),Od=_n.extend({nextCursor:nM.optional()}),QX=br(["working","input_required","completed","failed","cancelled"]),Md=pe({taskId:H(),status:QX,ttl:$t([et(),eX()]),createdAt:H(),lastUpdatedAt:H(),pollInterval:Ot(et()),statusMessage:Ot(H())}),Wu=_n.extend({task:Md}),YX=Lr.merge(Md),up=Ur.extend({method:be("notifications/tasks/status"),params:YX}),tw=Sn.extend({method:be("tasks/get"),params:xr.extend({taskId:H()})}),nw=_n.merge(Md),rw=Sn.extend({method:be("tasks/result"),params:xr.extend({taskId:H()})});_n.loose();const aw=$d.extend({method:be("tasks/list")}),iw=Od.extend({tasks:he(Md)}),sw=Sn.extend({method:be("tasks/cancel"),params:xr.extend({taskId:H()})}),XX=_n.merge(Md),lM=pe({uri:H(),mimeType:Ot(H()),_meta:Ct(H(),Mt()).optional()}),cM=lM.extend({text:H()}),ow=H().refine(e=>{try{return atob(e),!0}catch{return!1}},{message:"Invalid Base64 string"}),uM=lM.extend({blob:ow}),Pd=br(["user","assistant"]),Sc=pe({audience:he(Pd).optional(),priority:et().min(0).max(1).optional(),lastModified:BO({offset:!0}).optional()}),dM=pe({...tc.shape,...Rd.shape,uri:H(),description:Ot(H()),mimeType:Ot(H()),size:Ot(et()),annotations:Sc.optional(),_meta:Ot(bn({}))}),WX=pe({...tc.shape,...Rd.shape,uriTemplate:H(),description:Ot(H()),mimeType:Ot(H()),annotations:Sc.optional(),_meta:Ot(bn({}))}),JX=$d.extend({method:be("resources/list")}),dp=Od.extend({resources:he(dM)}),eW=$d.extend({method:be("resources/templates/list")}),fM=Od.extend({resourceTemplates:he(WX)}),lw=xr.extend({uri:H()}),tW=lw,nW=Sn.extend({method:be("resources/read"),params:tW}),cw=_n.extend({contents:he($t([cM,uM]))}),hM=Ur.extend({method:be("notifications/resources/list_changed"),params:Lr.optional()}),rW=lw,aW=Sn.extend({method:be("resources/subscribe"),params:rW}),iW=lw,sW=Sn.extend({method:be("resources/unsubscribe"),params:iW}),oW=Lr.extend({uri:H()}),lW=Ur.extend({method:be("notifications/resources/updated"),params:oW}),cW=pe({name:H(),description:Ot(H()),required:Ot(_t())}),uW=pe({...tc.shape,...Rd.shape,description:Ot(H()),arguments:Ot(he(cW)),_meta:Ot(bn({}))}),dW=$d.extend({method:be("prompts/list")}),fp=Od.extend({prompts:he(uW)}),fW=xr.extend({name:H(),arguments:Ct(H(),H()).optional()}),hW=Sn.extend({method:be("prompts/get"),params:fW}),uw=pe({type:be("text"),text:H(),annotations:Sc.optional(),_meta:Ct(H(),Mt()).optional()}),dw=pe({type:be("image"),data:ow,mimeType:H(),annotations:Sc.optional(),_meta:Ct(H(),Mt()).optional()}),fw=pe({type:be("audio"),data:ow,mimeType:H(),annotations:Sc.optional(),_meta:Ct(H(),Mt()).optional()}),pW=pe({type:be("tool_use"),name:H(),id:H(),input:Ct(H(),Mt()),_meta:Ct(H(),Mt()).optional()}),mW=pe({type:be("resource"),resource:$t([cM,uM]),annotations:Sc.optional(),_meta:Ct(H(),Mt()).optional()}),gW=dM.extend({type:be("resource_link")}),hw=$t([uw,dw,fw,gW,mW]),yW=pe({role:Pd,content:hw}),pw=_n.extend({description:H().optional(),messages:he(yW)}),pM=Ur.extend({method:be("notifications/prompts/list_changed"),params:Lr.optional()}),vW=pe({title:H().optional(),readOnlyHint:_t().optional(),destructiveHint:_t().optional(),idempotentHint:_t().optional(),openWorldHint:_t().optional()}),bW=pe({taskSupport:br(["required","optional","forbidden"]).optional()}),mM=pe({...tc.shape,...Rd.shape,description:H().optional(),inputSchema:pe({type:be("object"),properties:Ct(H(),Jt).optional(),required:he(H()).optional()}).catchall(Mt()),outputSchema:pe({type:be("object"),properties:Ct(H(),Jt).optional(),required:he(H()).optional()}).catchall(Mt()).optional(),annotations:vW.optional(),execution:bW.optional(),_meta:Ct(H(),Mt()).optional()}),xW=$d.extend({method:be("tools/list")}),mw=Od.extend({tools:he(mM)}),Dd=_n.extend({content:he(hw).default([]),structuredContent:Ct(H(),Mt()).optional(),isError:_t().optional()});Dd.or(_n.extend({toolResult:Mt()}));const wW=Ad.extend({name:H(),arguments:Ct(H(),Mt()).optional()}),SW=Sn.extend({method:be("tools/call"),params:wW}),gM=Ur.extend({method:be("notifications/tools/list_changed"),params:Lr.optional()}),_W=pe({autoRefresh:_t().default(!0),debounceMs:et().int().nonnegative().default(300)}),yM=br(["debug","info","notice","warning","error","critical","alert","emergency"]),kW=xr.extend({level:yM}),EW=Sn.extend({method:be("logging/setLevel"),params:kW}),CW=Lr.extend({level:yM,logger:H().optional(),data:Mt()}),NW=Ur.extend({method:be("notifications/message"),params:CW}),jW=pe({name:H().optional()}),TW=pe({hints:he(jW).optional(),costPriority:et().min(0).max(1).optional(),speedPriority:et().min(0).max(1).optional(),intelligencePriority:et().min(0).max(1).optional()}),AW=pe({mode:br(["auto","required","none"]).optional()}),RW=pe({type:be("tool_result"),toolUseId:H().describe("The unique identifier for the corresponding tool call."),content:he(hw).default([]),structuredContent:pe({}).loose().optional(),isError:_t().optional(),_meta:Ct(H(),Mt()).optional()}),$W=QO("type",[uw,dw,fw]),hp=QO("type",[uw,dw,fw,pW,RW]),OW=pe({role:Pd,content:$t([hp,he(hp)]),_meta:Ct(H(),Mt()).optional()}),MW=Ad.extend({messages:he(OW),modelPreferences:TW.optional(),systemPrompt:H().optional(),includeContext:br(["none","thisServer","allServers"]).optional(),temperature:et().optional(),maxTokens:et().int(),stopSequences:he(H()).optional(),metadata:Jt.optional(),tools:he(mM).optional(),toolChoice:AW.optional()}),vM=Sn.extend({method:be("sampling/createMessage"),params:MW}),bM=_n.extend({model:H(),stopReason:Ot(br(["endTurn","stopSequence","maxTokens"]).or(H())),role:Pd,content:$W}),xM=_n.extend({model:H(),stopReason:Ot(br(["endTurn","stopSequence","maxTokens","toolUse"]).or(H())),role:Pd,content:$t([hp,he(hp)])}),PW=pe({type:be("boolean"),title:H().optional(),description:H().optional(),default:_t().optional()}),DW=pe({type:be("string"),title:H().optional(),description:H().optional(),minLength:et().optional(),maxLength:et().optional(),format:br(["email","uri","date","date-time"]).optional(),default:H().optional()}),zW=pe({type:br(["number","integer"]),title:H().optional(),description:H().optional(),minimum:et().optional(),maximum:et().optional(),default:et().optional()}),IW=pe({type:be("string"),title:H().optional(),description:H().optional(),enum:he(H()),default:H().optional()}),LW=pe({type:be("string"),title:H().optional(),description:H().optional(),oneOf:he(pe({const:H(),title:H()})),default:H().optional()}),UW=pe({type:be("string"),title:H().optional(),description:H().optional(),enum:he(H()),enumNames:he(H()).optional(),default:H().optional()}),FW=$t([IW,LW]),qW=pe({type:be("array"),title:H().optional(),description:H().optional(),minItems:et().optional(),maxItems:et().optional(),items:pe({type:be("string"),enum:he(H())}),default:he(H()).optional()}),HW=pe({type:be("array"),title:H().optional(),description:H().optional(),minItems:et().optional(),maxItems:et().optional(),items:pe({anyOf:he(pe({const:H(),title:H()}))}),default:he(H()).optional()}),BW=$t([qW,HW]),VW=$t([UW,FW,BW]),KW=$t([VW,PW,DW,zW]),ZW=Ad.extend({mode:be("form").optional(),message:H(),requestedSchema:pe({type:be("object"),properties:Ct(H(),KW),required:he(H()).optional()})}),GW=Ad.extend({mode:be("url"),message:H(),elicitationId:H(),url:H().url()}),QW=$t([ZW,GW]),wM=Sn.extend({method:be("elicitation/create"),params:QW}),YW=Lr.extend({elicitationId:H()}),XW=Ur.extend({method:be("notifications/elicitation/complete"),params:YW}),SM=_n.extend({action:br(["accept","decline","cancel"]),content:eM(e=>e===null?void 0:e,Ct(H(),$t([H(),et(),_t(),he(H())])).optional())}),WW=pe({type:be("ref/resource"),uri:H()}),JW=pe({type:be("ref/prompt"),name:H()}),eJ=xr.extend({ref:$t([JW,WW]),argument:pe({name:H(),value:H()}),context:pe({arguments:Ct(H(),H()).optional()}).optional()}),tJ=Sn.extend({method:be("completion/complete"),params:eJ}),_M=_n.extend({completion:bn({values:he(H()).max(100),total:Ot(et().int()),hasMore:Ot(_t())})}),nJ=pe({uri:H().startsWith("file://"),name:H().optional(),_meta:Ct(H(),Mt()).optional()}),rJ=Sn.extend({method:be("roots/list"),params:xr.optional()}),aJ=_n.extend({roots:he(nJ)}),iJ=Ur.extend({method:be("notifications/roots/list_changed"),params:Lr.optional()});$t([Jx,HX,tJ,EW,hW,dW,JX,eW,nW,aW,sW,SW,xW,tw,rw,aw,sw]);$t([Wx,ew,oM,iJ,up]);$t([ol,bM,xM,SM,aJ,nw,iw,Wu]);$t([Jx,vM,wM,rJ,tw,rw,aw,sw]);$t([Wx,ew,NW,lW,hM,gM,pM,up,XW]);$t([ol,sM,_M,pw,fp,dp,fM,cw,Dd,mw,nw,iw,Wu]);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 sJ(a.elicitations,n)}return new Ne(t,n,r)}}class sJ 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 uE 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 ty(e){}function kM(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=ty,onError:n=ty,onRetry:r=ty,onComment:a}=e;let i="",s=!0,o,l="",u="";function d(m){const b=s?m.replace(/^\xEF\xBB\xBF/,""):m,[g,v]=oJ(`${i}${b}`);for(const x of g)f(x);i=v,s=!1}function f(m){if(m===""){h();return}if(m.startsWith(":")){a&&a(m.slice(m.startsWith(": ")?2:1));return}const b=m.indexOf(":");if(b!==-1){const g=m.slice(0,b),v=m[b+1]===" "?2:1,x=m.slice(b+v);p(g,x,m);return}p(m,"",m)}function p(m,b,g){switch(m){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 uE(`Invalid \`retry\` value: "${b}"`,{type:"invalid-retry",value:b,line:g}));break;default:n(new uE(`Unknown field "${m.length>20?`${m.slice(0,20)}…`:m}"`,{type:"unknown-field",field:m,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(m={}){i&&m.consume&&f(i),s=!0,o=void 0,l="",u="",i=""}return{feed:d,reset:y}}function oJ(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 dE 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(fE(this),n)}[Symbol.for("Deno.customInspect")](t,n){return t(fE(this),n)}}function lJ(e){const t=globalThis.DOMException;return typeof t=="function"?new t(e,"SyntaxError"):new SyntaxError(e)}function i0(e){return e instanceof Error?"errors"in e&&Array.isArray(e.errors)?e.errors.map(i0).join(", "):"cause"in e&&e.cause instanceof Error?`${e}: ${i0(e.cause)}`:e.message:`${e}`}function fE(e){return{type:e.type,message:e.message,code:e.code,defaultPrevented:e.defaultPrevented,cancelable:e.cancelable,timeStamp:e.timeStamp}}var EM=e=>{throw TypeError(e)},gw=(e,t,n)=>t.has(e)||EM("Cannot "+n),qe=(e,t,n)=>(gw(e,t,"read from private field"),n?n.call(e):t.get(e)),Qt=(e,t,n)=>t.has(e)?EM("Cannot add the same private member more than once"):t instanceof WeakSet?t.add(e):t.set(e,n),Tt=(e,t,n,r)=>(gw(e,t,"write to private field"),t.set(e,n),n),Ua=(e,t,n)=>(gw(e,t,"access private method"),n),Yn,Is,Bo,ah,pp,ku,ll,Eu,Mi,Vo,wl,Ko,Wc,Kr,s0,o0,l0,hE,c0,u0,Jc,d0,f0;class ih extends EventTarget{constructor(t,n){var r,a;super(),Qt(this,Kr),this.CONNECTING=0,this.OPEN=1,this.CLOSED=2,Qt(this,Yn),Qt(this,Is),Qt(this,Bo),Qt(this,ah),Qt(this,pp),Qt(this,ku),Qt(this,ll),Qt(this,Eu,null),Qt(this,Mi),Qt(this,Vo),Qt(this,wl,null),Qt(this,Ko,null),Qt(this,Wc,null),Qt(this,o0,async i=>{var s;qe(this,Vo).reset();const{body:o,redirected:l,status:u,headers:d}=i;if(u===204){Ua(this,Kr,Jc).call(this,"Server sent HTTP 204, not reconnecting",204),this.close();return}if(l?Tt(this,Bo,new URL(i.url)):Tt(this,Bo,void 0),u!==200){Ua(this,Kr,Jc).call(this,`Non-200 status code (${u})`,u);return}if(!(d.get("content-type")||"").startsWith("text/event-stream")){Ua(this,Kr,Jc).call(this,'Invalid content type, expected "text/event-stream"',u);return}if(qe(this,Yn)===this.CLOSED)return;Tt(this,Yn,this.OPEN);const f=new Event("open");if((s=qe(this,Wc))==null||s.call(this,f),this.dispatchEvent(f),typeof o!="object"||!o||!("getReader"in o)){Ua(this,Kr,Jc).call(this,"Invalid response body, expected a web ReadableStream",u),this.close();return}const p=new TextDecoder,h=o.getReader();let y=!0;do{const{done:m,value:b}=await h.read();b&&qe(this,Vo).feed(p.decode(b,{stream:!m})),m&&(y=!1,qe(this,Vo).reset(),Ua(this,Kr,d0).call(this))}while(y)}),Qt(this,l0,i=>{Tt(this,Mi,void 0),!(i.name==="AbortError"||i.type==="aborted")&&Ua(this,Kr,d0).call(this,i0(i))}),Qt(this,c0,i=>{typeof i.id=="string"&&Tt(this,Eu,i.id);const s=new MessageEvent(i.event||"message",{data:i.data,origin:qe(this,Bo)?qe(this,Bo).origin:qe(this,Is).origin,lastEventId:i.id||""});qe(this,Ko)&&(!i.event||i.event==="message")&&qe(this,Ko).call(this,s),this.dispatchEvent(s)}),Qt(this,u0,i=>{Tt(this,ku,i)}),Qt(this,f0,()=>{Tt(this,ll,void 0),qe(this,Yn)===this.CONNECTING&&Ua(this,Kr,s0).call(this)});try{if(t instanceof URL)Tt(this,Is,t);else if(typeof t=="string")Tt(this,Is,new URL(t,cJ()));else throw new Error("Invalid URL")}catch{throw lJ("An invalid or illegal string was specified")}Tt(this,Vo,kM({onEvent:qe(this,c0),onRetry:qe(this,u0)})),Tt(this,Yn,this.CONNECTING),Tt(this,ku,3e3),Tt(this,pp,(r=n==null?void 0:n.fetch)!=null?r:globalThis.fetch),Tt(this,ah,(a=n==null?void 0:n.withCredentials)!=null?a:!1),Ua(this,Kr,s0).call(this)}get readyState(){return qe(this,Yn)}get url(){return qe(this,Is).href}get withCredentials(){return qe(this,ah)}get onerror(){return qe(this,wl)}set onerror(t){Tt(this,wl,t)}get onmessage(){return qe(this,Ko)}set onmessage(t){Tt(this,Ko,t)}get onopen(){return qe(this,Wc)}set onopen(t){Tt(this,Wc,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(){qe(this,ll)&&clearTimeout(qe(this,ll)),qe(this,Yn)!==this.CLOSED&&(qe(this,Mi)&&qe(this,Mi).abort(),Tt(this,Yn,this.CLOSED),Tt(this,Mi,void 0))}}Yn=new WeakMap,Is=new WeakMap,Bo=new WeakMap,ah=new WeakMap,pp=new WeakMap,ku=new WeakMap,ll=new WeakMap,Eu=new WeakMap,Mi=new WeakMap,Vo=new WeakMap,wl=new WeakMap,Ko=new WeakMap,Wc=new WeakMap,Kr=new WeakSet,s0=function(){Tt(this,Yn,this.CONNECTING),Tt(this,Mi,new AbortController),qe(this,pp)(qe(this,Is),Ua(this,Kr,hE).call(this)).then(qe(this,o0)).catch(qe(this,l0))},o0=new WeakMap,l0=new WeakMap,hE=function(){var e;const t={mode:"cors",redirect:"follow",headers:{Accept:"text/event-stream",...qe(this,Eu)?{"Last-Event-ID":qe(this,Eu)}:void 0},cache:"no-store",signal:(e=qe(this,Mi))==null?void 0:e.signal};return"window"in globalThis&&(t.credentials=this.withCredentials?"include":"same-origin"),t},c0=new WeakMap,u0=new WeakMap,Jc=function(e,t){var n;qe(this,Yn)!==this.CLOSED&&Tt(this,Yn,this.CLOSED);const r=new dE("error",{code:t,message:e});(n=qe(this,wl))==null||n.call(this,r),this.dispatchEvent(r)},d0=function(e,t){var n;if(qe(this,Yn)===this.CLOSED)return;Tt(this,Yn,this.CONNECTING);const r=new dE("error",{code:t,message:e});(n=qe(this,wl))==null||n.call(this,r),this.dispatchEvent(r),Tt(this,ll,setTimeout(qe(this,f0),qe(this,ku)))},f0=new WeakMap,ih.CONNECTING=0,ih.OPEN=1,ih.CLOSED=2;function cJ(){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 mp(e){return e?e instanceof Headers?Object.fromEntries(e.entries()):Array.isArray(e)?Object.fromEntries(e):{...e}:{}}function CM(e=fetch,t){return t?async(n,r)=>{const a={...t,...r,headers:r!=null&&r.headers?{...mp(t.headers),...mp(r.headers)}:t.headers};return e(n,a)}:e}let yw;yw=globalThis.crypto;async function uJ(e){return(await yw).getRandomValues(new Uint8Array(e))}async function dJ(e){const t="abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ0123456789-._~";let n="";const r=await uJ(e);for(let a=0;a<e;a++){const i=r[a]%t.length;n+=t[i]}return n}async function fJ(e){return await dJ(e)}async function hJ(e){const t=await(await yw).subtle.digest("SHA-256",new TextEncoder().encode(e));return btoa(String.fromCharCode(...new Uint8Array(t))).replace(/\//g,"_").replace(/\+/g,"-").replace(/=/g,"")}async function pJ(e){if(e||(e=43),e<43||e>128)throw`Expected a length between 43 and 128. Received ${e}.`;const t=await fJ(e),n=await hJ(t);return{code_verifier:t,code_challenge:n}}const pn=PY().superRefine((e,t)=>{if(!URL.canParse(e))return t.addIssue({code:NX.custom,message:"URL must be parseable",fatal:!0}),CZ}).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"}),mJ=bn({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:_t().optional(),authorization_details_types_supported:he(H()).optional(),dpop_signing_alg_values_supported:he(H()).optional(),dpop_bound_access_tokens_required:_t().optional()}),NM=bn({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:_t().optional()}),gJ=bn({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:_t().optional(),request_parameter_supported:_t().optional(),request_uri_parameter_supported:_t().optional(),require_request_uri_registration:_t().optional(),op_policy_uri:pn.optional(),op_tos_uri:pn.optional(),client_id_metadata_document_supported:_t().optional()}),yJ=pe({...gJ.shape,...NM.pick({code_challenge_methods_supported:!0}).shape}),vJ=pe({access_token:H(),id_token:H().optional(),token_type:H(),expires_in:jX().optional(),scope:H().optional(),refresh_token:H().optional()}).strip(),bJ=pe({error:H(),error_description:H().optional(),error_uri:H().optional()}),pE=pn.optional().or(be("").transform(()=>{})),xJ=pe({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:pE,scope:H().optional(),contacts:he(H()).optional(),tos_uri:pE,policy_uri:H().optional(),jwks_uri:pn.optional(),jwks:nX().optional(),software_id:H().optional(),software_version:H().optional(),software_statement:H().optional()}).strip(),wJ=pe({client_id:H(),client_secret:H().optional(),client_id_issued_at:et().optional(),client_secret_expires_at:et().optional()}).strip(),SJ=xJ.merge(wJ);pe({error:H(),error_description:H().optional()}).strip();pe({token:H(),token_type_hint:H().optional()}).strip();function _J(e){const t=typeof e=="string"?new URL(e):new URL(e.href);return t.hash="",t}function kJ({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 cn 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 h0 extends cn{}h0.errorCode="invalid_request";class gp extends cn{}gp.errorCode="invalid_client";class yp extends cn{}yp.errorCode="invalid_grant";class vp extends cn{}vp.errorCode="unauthorized_client";class p0 extends cn{}p0.errorCode="unsupported_grant_type";class m0 extends cn{}m0.errorCode="invalid_scope";class g0 extends cn{}g0.errorCode="access_denied";class nc extends cn{}nc.errorCode="server_error";class y0 extends cn{}y0.errorCode="temporarily_unavailable";class v0 extends cn{}v0.errorCode="unsupported_response_type";class b0 extends cn{}b0.errorCode="unsupported_token_type";class x0 extends cn{}x0.errorCode="invalid_token";class w0 extends cn{}w0.errorCode="method_not_allowed";class S0 extends cn{}S0.errorCode="too_many_requests";class bp extends cn{}bp.errorCode="invalid_client_metadata";class _0 extends cn{}_0.errorCode="insufficient_scope";class k0 extends cn{}k0.errorCode="invalid_target";const EJ={[h0.errorCode]:h0,[gp.errorCode]:gp,[yp.errorCode]:yp,[vp.errorCode]:vp,[p0.errorCode]:p0,[m0.errorCode]:m0,[g0.errorCode]:g0,[nc.errorCode]:nc,[y0.errorCode]:y0,[v0.errorCode]:v0,[b0.errorCode]:b0,[x0.errorCode]:x0,[w0.errorCode]:w0,[S0.errorCode]:S0,[bp.errorCode]:bp,[_0.errorCode]:_0,[k0.errorCode]:k0};class lr extends Error{constructor(t){super(t??"Unauthorized")}}function CJ(e){return["client_secret_basic","client_secret_post","none"].includes(e)}const ny="code",ry="S256";function NJ(e,t){const n=e.client_secret!==void 0;return"token_endpoint_auth_method"in e&&e.token_endpoint_auth_method&&CJ(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 jJ(e,t,n,r){const{client_id:a,client_secret:i}=t;switch(e){case"client_secret_basic":TJ(a,i,n);return;case"client_secret_post":AJ(a,i,r);return;case"none":RJ(a,r);return;default:throw new Error(`Unsupported client authentication method: ${e}`)}}function TJ(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 AJ(e,t,n){n.set("client_id",e),t&&n.set("client_secret",t)}function RJ(e,t){t.set("client_id",e)}async function jM(e){const t=e instanceof Response?e.status:void 0,n=e instanceof Response?await e.text():e;try{const r=bJ.parse(JSON.parse(n)),{error:a,error_description:i,error_uri:s}=r,o=EJ[a]||nc;return new o(i||"",s)}catch(r){const a=`${t?`HTTP ${t}: `:""}Invalid OAuth error response: ${r}. Raw body: ${n}`;return new nc(a)}}async function Wr(e,t){var n,r;try{return await ay(e,t)}catch(a){if(a instanceof gp||a instanceof vp)return await((n=e.invalidateCredentials)==null?void 0:n.call(e,"all")),await ay(e,t);if(a instanceof yp)return await((r=e.invalidateCredentials)==null?void 0:r.call(e,"tokens")),await ay(e,t);throw a}}async function ay(e,{serverUrl:t,authorizationCode:n,scope:r,resourceMetadataUrl:a,fetchFn:i}){var x,S,k,C,N;const s=await((x=e.discoveryState)==null?void 0:x.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 AM(l,{fetchFn:i}),!o)try{o=await TM(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 IJ(t,{resourceMetadataUrl:d,fetchFn:i});l=P.authorizationServerUrl,u=P.authorizationServerMetadata,o=P.resourceMetadata,await((k=e.saveDiscoveryState)==null?void 0:k.call(e,{authorizationServerUrl:String(l),resourceMetadataUrl:d==null?void 0:d.toString(),resourceMetadata:o,authorizationServerMetadata:u}))}const f=await OJ(t,e,o),p=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&&!$J(R))throw new bp(`clientMetadataUrl must be a valid HTTPS URL with a non-root pathname, got: ${R}`);if(P&&R)h={client_id:R},await((N=e.saveClientInformation)==null?void 0:N.call(e,h));else{if(!e.saveClientInformation)throw new Error("OAuth client information must be saveable for dynamic registration");const j=await HJ(l,{metadata:u,clientMetadata:e.clientMetadata,scope:p,fetchFn:i});await e.saveClientInformation(j),h=j}}const y=!e.redirectUrl;if(n!==void 0||y){const P=await qJ(e,l,{metadata:u,resource:f,authorizationCode:n,fetchFn:i});return await e.saveTokens(P),"AUTHORIZED"}const m=await e.tokens();if(m!=null&&m.refresh_token)try{const P=await FJ(l,{metadata:u,clientInformation:h,refreshToken:m.refresh_token,resource:f,addClientAuthentication:e.addClientAuthentication,fetchFn:i});return await e.saveTokens(P),"AUTHORIZED"}catch(P){if(!(!(P instanceof cn)||P instanceof nc))throw P}const b=e.state?await e.state():void 0,{authorizationUrl:g,codeVerifier:v}=await LJ(l,{metadata:u,clientInformation:h,state:b,redirectUrl:e.redirectUrl,scope:p,resource:f});return await e.saveCodeVerifier(v),await e.redirectToAuthorization(g),"REDIRECT"}function $J(e){if(!e)return!1;try{const t=new URL(e);return t.protocol==="https:"&&t.pathname!=="/"}catch{return!1}}async function OJ(e,t,n){const r=_J(e);if(t.validateResourceURL)return await t.validateResourceURL(r,n==null?void 0:n.resource);if(n){if(!kJ({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 xp(e){const t=e.headers.get("WWW-Authenticate");if(!t)return{};const[n,r]=t.split(" ");if(n.toLowerCase()!=="bearer"||!r)return{};const a=iy(e,"resource_metadata")||void 0;let i;if(a)try{i=new URL(a)}catch{}const s=iy(e,"scope")||void 0,o=iy(e,"error")||void 0;return{resourceMetadataUrl:i,scope:s,error:o}}function iy(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 TM(e,t,n=fetch){var a,i;const r=await DJ(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 mJ.parse(await r.json())}async function vw(e,t,n=fetch){try{return await n(e,{headers:t})}catch(r){if(r instanceof TypeError)return t?vw(e,void 0,n):void 0;throw r}}function MJ(e,t="",n={}){return t.endsWith("/")&&(t=t.slice(0,-1)),n.prependPathname?`${t}/.well-known/${e}`:`/.well-known/${e}${t}`}async function mE(e,t,n=fetch){return await vw(e,{"MCP-Protocol-Version":t},n)}function PJ(e,t){return!e||e.status>=400&&e.status<500&&t!=="/"}async function DJ(e,t,n,r){const a=new URL(e),i=(r==null?void 0:r.protocolVersion)??_m;let s;if(r!=null&&r.metadataUrl)s=new URL(r.metadataUrl);else{const l=MJ(t,a.pathname);s=new URL(l,(r==null?void 0:r.metadataServerUrl)??a),s.search=a.search}let o=await mE(s,i,n);if(!(r!=null&&r.metadataUrl)&&PJ(o,a.pathname)){const l=new URL(`/.well-known/${t}`,a);o=await mE(l,i,n)}return o}function zJ(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 AM(e,{fetchFn:t=fetch,protocolVersion:n=_m}={}){var i;const r={"MCP-Protocol-Version":n,Accept:"application/json"},a=zJ(e);for(const{url:s,type:o}of a){const l=await vw(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"?NM.parse(await l.json()):yJ.parse(await l.json())}}}async function IJ(e,t){let n,r;try{n=await TM(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 AM(r,{fetchFn:t==null?void 0:t.fetchFn});return{authorizationServerUrl:r,authorizationServerMetadata:a,resourceMetadata:n}}async function LJ(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(ny))throw new Error(`Incompatible auth server: does not support response type ${ny}`);if(t.code_challenge_methods_supported&&!t.code_challenge_methods_supported.includes(ry))throw new Error(`Incompatible auth server: does not support code challenge method ${ry}`)}else o=new URL("/authorize",e);const l=await pJ(),u=l.code_verifier,d=l.code_challenge;return o.searchParams.set("response_type",ny),o.searchParams.set("client_id",n.client_id),o.searchParams.set("code_challenge",d),o.searchParams.set("code_challenge_method",ry),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 UJ(e,t,n){return new URLSearchParams({grant_type:"authorization_code",code:e,code_verifier:t,redirect_uri:String(n)})}async function RM(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=NJ(r,d);jJ(f,r,l,n)}const u=await(s??fetch)(o,{method:"POST",headers:l,body:n});if(!u.ok)throw await jM(u);return vJ.parse(await u.json())}async function FJ(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 RM(e,{metadata:t,tokenRequestParams:o,clientInformation:n,addClientAuthentication:i,resource:a,fetchFn:s});return{refresh_token:r,...l}}async function qJ(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=UJ(a,u,e.redirectUrl)}const l=await e.clientInformation();return RM(t,{metadata:n,tokenRequestParams:o,clientInformation:l??void 0,addClientAuthentication:e.addClientAuthentication,resource:r,fetchFn:i})}async function HJ(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 jM(s);return SJ.parse(await s.json())}class BJ extends Error{constructor(t,n,r){super(`SSE error: ${n}`),this.code=t,this.event=r}}class VJ{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=CM(n==null?void 0:n.fetch,n==null?void 0:n.requestInit)}async _authThenStart(){var n;if(!this._authProvider)throw new lr("No auth provider");let t;try{t=await Wr(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 lr;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=mp((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 ih(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}=xp(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 BJ(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=rh.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 lr("No auth provider");if(await Wr(this._authProvider,{serverUrl:this._url,authorizationCode:t,resourceMetadataUrl:this._resourceMetadataUrl,scope:this._scope,fetchFn:this._fetchWithInit})!=="AUTHORIZED")throw new lr("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}=xp(o);if(this._resourceMetadataUrl=u,this._scope=d,await Wr(this._authProvider,{serverUrl:this._url,resourceMetadataUrl:this._resourceMetadataUrl,scope:this._scope,fetchFn:this._fetchWithInit})!=="AUTHORIZED")throw new lr;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 KJ extends TransformStream{constructor({onError:t,onRetry:n,onComment:r}={}){let a;super({start(i){a=kM({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 ZJ={initialReconnectionDelay:1e3,maxReconnectionDelay:3e4,reconnectionDelayGrowFactor:1.5,maxRetries:2};class Do extends Error{constructor(t,n){super(`Streamable HTTP error: ${n}`),this.code=t}}class GJ{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=CM(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)??ZJ}async _authThenStart(){var n;if(!this._authProvider)throw new lr("No auth provider");let t;try{t=await Wr(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 lr;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=mp((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 Do(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,p,h;try{const y=t.pipeThrough(new TextDecoderStream).pipeThrough(new KJ({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 x=rh.parse(JSON.parse(g.data));Xc(x)&&(l=!0,i!==void 0&&(x.id=i)),(d=this.onmessage)==null||d.call(this,x)}catch(x){(f=this.onerror)==null||f.call(this,x)}}(r||o)&&!l&&this._abortController&&!this._abortController.signal.aborted&&this._scheduleReconnection({resumptionToken:s,onresumptiontoken:a,replayMessageId:i},0)}catch(y){if((p=this.onerror)==null||p.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 lr("No auth provider");if(await Wr(this._authProvider,{serverUrl:this._url,authorizationCode:t,resourceMetadataUrl:this._resourceMetadataUrl,scope:this._scope,fetchFn:this._fetchWithInit})!=="AUTHORIZED")throw new lr("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:a0(t)?t.id:void 0}).catch(v=>{var x;return(x=this.onerror)==null?void 0:x.call(this,v)});return}const f=await this._commonHeaders();f.set("content-type","application/json"),f.set("accept","application/json, text/event-stream");const p={...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,p),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 Do(401,"Server returned 401 after successful authentication");const{resourceMetadataUrl:x,scope:S}=xp(h);if(this._resourceMetadataUrl=x,this._scope=S,await Wr(this._authProvider,{serverUrl:this._url,resourceMetadataUrl:this._resourceMetadataUrl,scope:this._scope,fetchFn:this._fetchWithInit})!=="AUTHORIZED")throw new lr;return this._hasCompletedAuthFlow=!0,this.send(t)}if(h.status===403&&this._authProvider){const{resourceMetadataUrl:x,scope:S,error:k}=xp(h);if(k==="insufficient_scope"){const C=h.headers.get("WWW-Authenticate");if(this._lastUpscopingHeader===C)throw new Do(403,"Server returned 403 after trying upscoping");if(S&&(this._scope=S),x&&(this._resourceMetadataUrl=x),this._lastUpscopingHeader=C??void 0,await Wr(this._authProvider,{serverUrl:this._url,resourceMetadataUrl:this._resourceMetadataUrl,scope:this._scope,fetchFn:this._fetch})!=="AUTHORIZED")throw new lr;return this.send(t)}}throw new Do(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()),VX(t)&&this._startOrAuthSse({resumptionToken:void 0}).catch(v=>{var x;return(x=this.onerror)==null?void 0:x.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(),x=Array.isArray(v)?v.map(S=>rh.parse(S)):[rh.parse(v)];for(const S of x)(i=this.onmessage)==null||i.call(this,S)}else throw await((s=h.body)==null?void 0:s.cancel()),new Do(-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 Do(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 Cm(e){return!!e._zod}function Ti(e,t){return Cm(e)?AO(e,t):e.safeParse(t)}function $M(e){var n,r;if(!e)return;let t;if(Cm(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 QJ(e){var a;if(Cm(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 Ns(e){return e==="completed"||e==="failed"||e==="cancelled"}new Set("ABCDEFGHIJKLMNOPQRSTUVXYZabcdefghijklmnopqrstuvxyz0123456789");function gE(e){const t=$M(e),n=t==null?void 0:t.method;if(!n)throw new Error("Schema is missing a method literal");const r=QJ(n);if(typeof r!="string")throw new Error("Schema method literal must be a string");return r}function yE(e,t){const n=Ti(e,t);if(!n.success)throw n.error;return n.data}const YJ=6e4;class XJ{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(Wx,n=>{this._oncancel(n)}),this.setNotificationHandler(ew,n=>{this._onprogress(n)}),this.setRequestHandler(Jx,n=>({})),this._taskStore=t==null?void 0:t.taskStore,this._taskMessageQueue=t==null?void 0:t.taskMessageQueue,this._taskStore&&(this.setRequestHandler(tw,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(rw,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 p=u,h=new Ne(p.error.code,p.error.message,p.error.data);f(h)}else{const p=l.type==="response"?"Response":"Error";this._onerror(new Error(`${p} 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(!Ns(s.status))return await this._waitForTaskUpdate(i,r.signal),await a();if(Ns(s.status)){const l=await this._taskStore.getTaskResult(i,r.sessionId);return this._clearTaskQueue(i),{...l,_meta:{...l._meta,[Ps]:{taskId:i}}}}return await a()};return await a()}),this.setRequestHandler(aw,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(sw,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(Ns(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),Xc(l)||MX(l)?this._onresponse(l):a0(l)?this._onrequest(l,u):OX(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,p,h;const r=this._requestHandlers.get(t.method)??this.fallbackRequestHandler,a=this._transport,i=(p=(f=(d=t.params)==null?void 0:d._meta)==null?void 0:f[Ps])==null?void 0:p.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(m=>this._onerror(new Error(`Failed to enqueue error response: ${m}`))):a==null||a.send(y).catch(m=>this._onerror(new Error(`Failed to send an error response: ${m}`)));return}const s=new AbortController;this._requestHandlerAbortControllers.set(t.id,s);const o=$X(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 m={relatedRequestId:t.id};i&&(m.relatedTask={taskId:i}),await this.notification(y,m)},sendRequest:async(y,m,b)=>{var x;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=((x=g.relatedTask)==null?void 0:x.taskId)??i;return v&&l&&await l.updateTaskStatus(v,"input_required"),await this.request(y,m,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 m={result:y,jsonrpc:"2.0",id:t.id};i&&this._taskMessageQueue?await this._enqueueTaskMessage(i,{type:"response",message:m,timestamp:Date.now()},a==null?void 0:a.sessionId):await(a==null?void 0:a.send(m))},async y=>{if(s.signal.aborted)return;const m={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:m,timestamp:Date.now()},a==null?void 0:a.sessionId):await(a==null?void 0:a.send(m))}).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),Xc(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(Xc(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),Xc(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,Wu,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},Ns(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,x,S,k,C;const f=N=>{d(N)};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(N){f(N);return}(x=r==null?void 0:r.signal)==null||x.throwIfAborted();const p=this._requestMessageId++,h={...t,jsonrpc:"2.0",id:p};r!=null&&r.onprogress&&(this._progressHandlers.set(p,r.onprogress),h.params={...t.params,_meta:{...((S=t.params)==null?void 0:S._meta)||{},progressToken:p}}),o&&(h.params={...h.params,task:o}),l&&(h.params={...h.params,_meta:{...((k=h.params)==null?void 0:k._meta)||{},[Ps]:l}});const y=N=>{var R;this._responseHandlers.delete(p),this._progressHandlers.delete(p),this._cleanupTimeout(p),(R=this._transport)==null||R.send({jsonrpc:"2.0",method:"notifications/cancelled",params:{requestId:p,reason:String(N)}},{relatedRequestId:a,resumptionToken:i,onresumptiontoken:s}).catch($=>this._onerror(new Error(`Failed to send cancellation: ${$}`)));const P=N instanceof Ne?N:new Ne(Oe.RequestTimeout,String(N));d(P)};this._responseHandlers.set(p,N=>{var P;if(!((P=r==null?void 0:r.signal)!=null&&P.aborted)){if(N instanceof Error)return d(N);try{const R=Ti(n,N.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 N;y((N=r==null?void 0:r.signal)==null?void 0:N.reason)});const m=(r==null?void 0:r.timeout)??YJ,b=()=>y(Ne.fromError(Oe.RequestTimeout,"Request timed out",{timeout:m}));this._setupTimeout(p,m,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 N=P=>{const R=this._responseHandlers.get(p);R?R(P):this._onerror(new Error(`Response handler missing for side-channeled request ${p}`))};this._requestResolvers.set(p,N),this._enqueueTaskMessage(g,{type:"request",message:h,timestamp:Date.now()}).catch(P=>{this._cleanupTimeout(p),d(P)})}else this._transport.send(h,{relatedRequestId:a,resumptionToken:i,onresumptiontoken:s}).catch(N=>{this._cleanupTimeout(p),d(N)})})}async getTask(t,n){return this.request({method:"tasks/get",params:t},nw,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},iw,n)}async cancelTask(t,n){return this.request({method:"tasks/cancel",params:t},XX,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)||{},[Ps]: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 p,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:{...((p=f.params)==null?void 0:p._meta)||{},[Ps]: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)||{},[Ps]:n.relatedTask}}}),await this._transport.send(s,n)}setRequestHandler(t,n){const r=gE(t);this.assertRequestHandlerCapability(r),this._requestHandlers.set(r,(a,i)=>{const s=yE(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=gE(t);this._notificationHandlers.set(r,a=>{const i=yE(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"&&a0(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=up.parse({method:"notifications/tasks/status",params:o});await this.notification(l),Ns(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(Ns(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=up.parse({method:"notifications/tasks/status",params:l});await this.notification(u),Ns(l.status)&&this._cleanupTaskProgressHandler(a)}},listTasks:a=>r.listTasks(a,n)}}}function vE(e){return e!==null&&typeof e=="object"&&!Array.isArray(e)}function WJ(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];vE(s)&&vE(i)?n[a]={...s,...i}:n[a]=i}return n}var E0={exports:{}},OM={},Pa={},js={},zd={},Ue={},Ju={};(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((x,S)=>`${x}${S}`,"")}get names(){var v;return(v=this._names)!==null&&v!==void 0?v:this._names=this._items.reduce((x,S)=>(S instanceof n&&(x[S.str]=(x[S.str]||0)+1),x),{})}}e._Code=r,e.nil=new r("");function a(g,...v){const x=[g[0]];let S=0;for(;S<v.length;)o(x,v[S]),x.push(g[++S]);return new r(x)}e._=a;const i=new r("+");function s(g,...v){const x=[h(g[0])];let S=0;for(;S<v.length;)x.push(i),o(x,v[S]),x.push(i,h(g[++S]));return l(x),new r(x)}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 x=u(g[v-1],g[v+1]);if(x!==void 0){g.splice(v-1,3,x);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 p(g){return new r(h(g))}e.stringify=p;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 m(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=m;function b(g){return new r(g.toString())}e.regexpCode=b})(Ju);var C0={};(function(e){Object.defineProperty(e,"__esModule",{value:!0}),e.ValueScope=e.ValueScopeName=e.Scope=e.varKinds=e.UsedValueState=void 0;const t=Ju;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 p=this.toName(u),{prefix:h}=p,y=(f=d.key)!==null&&f!==void 0?f:d.ref;let m=this._values[h];if(m){const v=m.get(y);if(v)return v}else m=this._values[h]=new Map;m.set(y,p);const b=this._scope[h]||(this._scope[h]=[]),g=b.length;return b[g]=d.ref,p.setValue(d,{property:h,itemIndex:g}),p}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,p=>{if(p.value===void 0)throw new Error(`CodeGen: name "${p}" has no value`);return p.value.code},d,f)}_reduceValues(u,d,f={},p){let h=t.nil;for(const y in u){const m=u[y];if(!m)continue;const b=f[y]=f[y]||new Map;m.forEach(g=>{if(b.has(g))return;b.set(g,r.Started);let v=d(g);if(v){const x=this.opts.es5?e.varKinds.var:e.varKinds.const;h=(0,t._)`${h}${x} ${g} = ${v};${this.opts._n}`}else if(v=p==null?void 0:p(g))h=(0,t._)`${h}${v}${this.opts._n}`;else throw new n(g);b.set(g,r.Completed)})}return h}}e.ValueScope=o})(C0);(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=Ju,n=C0;var r=Ju;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=C0;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(E,M){return this}}class s extends i{constructor(E,M,I){super(),this.varKind=E,this.name=M,this.rhs=I}render({es5:E,_n:M}){const I=E?n.varKinds.var:this.varKind,Q=this.rhs===void 0?"":` = ${this.rhs}`;return`${I} ${this.name}${Q};`+M}optimizeNames(E,M){if(E[this.name.str])return this.rhs&&(this.rhs=D(this.rhs,E,M)),this}get names(){return this.rhs instanceof t._CodeOrName?this.rhs.names:{}}}class o extends i{constructor(E,M,I){super(),this.lhs=E,this.rhs=M,this.sideEffects=I}render({_n:E}){return`${this.lhs} = ${this.rhs};`+E}optimizeNames(E,M){if(!(this.lhs instanceof t.Name&&!E[this.lhs.str]&&!this.sideEffects))return this.rhs=D(this.rhs,E,M),this}get names(){const E=this.lhs instanceof t.Name?{}:{...this.lhs.names};return z(E,this.rhs)}}class l extends o{constructor(E,M,I,Q){super(E,I,Q),this.op=M}render({_n:E}){return`${this.lhs} ${this.op}= ${this.rhs};`+E}}class u extends i{constructor(E){super(),this.label=E,this.names={}}render({_n:E}){return`${this.label}:`+E}}class d extends i{constructor(E){super(),this.label=E,this.names={}}render({_n:E}){return`break${this.label?` ${this.label}`:""};`+E}}class f extends i{constructor(E){super(),this.error=E}render({_n:E}){return`throw ${this.error};`+E}get names(){return this.error.names}}class p extends i{constructor(E){super(),this.code=E}render({_n:E}){return`${this.code};`+E}optimizeNodes(){return`${this.code}`?this:void 0}optimizeNames(E,M){return this.code=D(this.code,E,M),this}get names(){return this.code instanceof t._CodeOrName?this.code.names:{}}}class h extends i{constructor(E=[]){super(),this.nodes=E}render(E){return this.nodes.reduce((M,I)=>M+I.render(E),"")}optimizeNodes(){const{nodes:E}=this;let M=E.length;for(;M--;){const I=E[M].optimizeNodes();Array.isArray(I)?E.splice(M,1,...I):I?E[M]=I:E.splice(M,1)}return E.length>0?this:void 0}optimizeNames(E,M){const{nodes:I}=this;let Q=I.length;for(;Q--;){const W=I[Q];W.optimizeNames(E,M)||(A(E,W.names),I.splice(Q,1))}return I.length>0?this:void 0}get names(){return this.nodes.reduce((E,M)=>O(E,M.names),{})}}class y extends h{render(E){return"{"+E._n+super.render(E)+"}"+E._n}}class m extends h{}class b extends y{}b.kind="else";class g extends y{constructor(E,M){super(M),this.condition=E}render(E){let M=`if(${this.condition})`+super.render(E);return this.else&&(M+="else "+this.else.render(E)),M}optimizeNodes(){super.optimizeNodes();const E=this.condition;if(E===!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 E===!1?M instanceof g?M:M.nodes:this.nodes.length?this:new g(B(E),M instanceof g?[M]:M.nodes);if(!(E===!1||!this.nodes.length))return this}optimizeNames(E,M){var I;if(this.else=(I=this.else)===null||I===void 0?void 0:I.optimizeNames(E,M),!!(super.optimizeNames(E,M)||this.else))return this.condition=D(this.condition,E,M),this}get names(){const E=super.names;return z(E,this.condition),this.else&&O(E,this.else.names),E}}g.kind="if";class v extends y{}v.kind="for";class x extends v{constructor(E){super(),this.iteration=E}render(E){return`for(${this.iteration})`+super.render(E)}optimizeNames(E,M){if(super.optimizeNames(E,M))return this.iteration=D(this.iteration,E,M),this}get names(){return O(super.names,this.iteration.names)}}class S extends v{constructor(E,M,I,Q){super(),this.varKind=E,this.name=M,this.from=I,this.to=Q}render(E){const M=E.es5?n.varKinds.var:this.varKind,{name:I,from:Q,to:W}=this;return`for(${M} ${I}=${Q}; ${I}<${W}; ${I}++)`+super.render(E)}get names(){const E=z(super.names,this.from);return z(E,this.to)}}class k extends v{constructor(E,M,I,Q){super(),this.loop=E,this.varKind=M,this.name=I,this.iterable=Q}render(E){return`for(${this.varKind} ${this.name} ${this.loop} ${this.iterable})`+super.render(E)}optimizeNames(E,M){if(super.optimizeNames(E,M))return this.iterable=D(this.iterable,E,M),this}get names(){return O(super.names,this.iterable.names)}}class C extends y{constructor(E,M,I){super(),this.name=E,this.args=M,this.async=I}render(E){return`${this.async?"async ":""}function ${this.name}(${this.args})`+super.render(E)}}C.kind="func";class N extends h{render(E){return"return "+super.render(E)}}N.kind="return";class P extends y{render(E){let M="try"+super.render(E);return this.catch&&(M+=this.catch.render(E)),this.finally&&(M+=this.finally.render(E)),M}optimizeNodes(){var E,M;return super.optimizeNodes(),(E=this.catch)===null||E===void 0||E.optimizeNodes(),(M=this.finally)===null||M===void 0||M.optimizeNodes(),this}optimizeNames(E,M){var I,Q;return super.optimizeNames(E,M),(I=this.catch)===null||I===void 0||I.optimizeNames(E,M),(Q=this.finally)===null||Q===void 0||Q.optimizeNames(E,M),this}get names(){const E=super.names;return this.catch&&O(E,this.catch.names),this.finally&&O(E,this.finally.names),E}}class R extends y{constructor(E){super(),this.error=E}render(E){return`catch(${this.error})`+super.render(E)}}R.kind="catch";class $ extends y{render(E){return"finally"+super.render(E)}}$.kind="finally";class j{constructor(E,M={}){this._values={},this._blockStarts=[],this._constants={},this.opts={...M,_n:M.lines?`
|
|
483
|
+
`:""},this._extScope=E,this._scope=new n.Scope({parent:E}),this._nodes=[new m]}toString(){return this._root.render(this.opts)}name(E){return this._scope.name(E)}scopeName(E){return this._extScope.name(E)}scopeValue(E,M){const I=this._extScope.value(E,M);return(this._values[I.prefix]||(this._values[I.prefix]=new Set)).add(I),I}getScopeValue(E,M){return this._extScope.getValue(E,M)}scopeRefs(E){return this._extScope.scopeRefs(E,this._values)}scopeCode(){return this._extScope.scopeCode(this._values)}_def(E,M,I,Q){const W=this._scope.toName(M);return I!==void 0&&Q&&(this._constants[W.str]=I),this._leafNode(new s(E,W,I)),W}const(E,M,I){return this._def(n.varKinds.const,E,M,I)}let(E,M,I){return this._def(n.varKinds.let,E,M,I)}var(E,M,I){return this._def(n.varKinds.var,E,M,I)}assign(E,M,I){return this._leafNode(new o(E,M,I))}add(E,M){return this._leafNode(new l(E,e.operators.ADD,M))}code(E){return typeof E=="function"?E():E!==t.nil&&this._leafNode(new p(E)),this}object(...E){const M=["{"];for(const[I,Q]of E)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(E,M,I){if(this._blockNode(new g(E)),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(E){return this._elseNode(new g(E))}else(){return this._elseNode(new b)}endIf(){return this._endBlockNode(g,b)}_for(E,M){return this._blockNode(E),M&&this.code(M).endFor(),this}for(E,M){return this._for(new x(E),M)}forRange(E,M,I,Q,W=this.opts.es5?n.varKinds.var:n.varKinds.let){const oe=this._scope.toName(E);return this._for(new S(W,oe,M,I),()=>Q(oe))}forOf(E,M,I,Q=n.varKinds.const){const W=this._scope.toName(E);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 k("of",Q,W,M),()=>I(W))}forIn(E,M,I,Q=this.opts.es5?n.varKinds.var:n.varKinds.const){if(this.opts.ownProperties)return this.forOf(E,(0,t._)`Object.keys(${M})`,I);const W=this._scope.toName(E);return this._for(new k("in",Q,W,M),()=>I(W))}endFor(){return this._endBlockNode(v)}label(E){return this._leafNode(new u(E))}break(E){return this._leafNode(new d(E))}return(E){const M=new N;if(this._blockNode(M),this.code(E),M.nodes.length!==1)throw new Error('CodeGen: "return" should have one node');return this._endBlockNode(N)}try(E,M,I){if(!M&&!I)throw new Error('CodeGen: "try" without "catch" and "finally"');const Q=new P;if(this._blockNode(Q),this.code(E),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(E){return this._leafNode(new f(E))}block(E,M){return this._blockStarts.push(this._nodes.length),E&&this.code(E).endBlock(M),this}endBlock(E){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||E!==void 0&&I!==E)throw new Error(`CodeGen: wrong number of nodes: ${I} vs ${E} expected`);return this._nodes.length=M,this}func(E,M=t.nil,I,Q){return this._blockNode(new C(E,M,I)),Q&&this.code(Q).endFunc(),this}endFunc(){return this._endBlockNode(C)}optimize(E=1){for(;E-- >0;)this._root.optimizeNodes(),this._root.optimizeNames(this._root.names,this._constants)}_leafNode(E){return this._currNode.nodes.push(E),this}_blockNode(E){this._currNode.nodes.push(E),this._nodes.push(E)}_endBlockNode(E,M){const I=this._currNode;if(I instanceof E||M&&I instanceof M)return this._nodes.pop(),this;throw new Error(`CodeGen: not in block "${M?`${E.kind}/${M.kind}`:E.kind}"`)}_elseNode(E){const M=this._currNode;if(!(M instanceof g))throw new Error('CodeGen: "else" without "if"');return this._currNode=M.else=E,this}get _root(){return this._nodes[0]}get _currNode(){const E=this._nodes;return E[E.length-1]}set _currNode(E){const M=this._nodes;M[M.length-1]=E}}e.CodeGen=j;function O(_,E){for(const M in E)_[M]=(_[M]||0)+(E[M]||0);return _}function z(_,E){return E instanceof t._CodeOrName?O(_,E.names):_}function D(_,E,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||E[W.str]!==1?W:(delete E[W.str],oe)}function Q(W){return W instanceof t._Code&&W._items.some(oe=>oe instanceof t.Name&&E[oe.str]===1&&M[oe.str]!==void 0)}}function A(_,E){for(const M in E)_[M]=(_[M]||0)-(E[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 T(..._){return _.reduce(J)}e.or=T;function q(_){return(E,M)=>E===t.nil?M:M===t.nil?E:(0,t._)`${G(E)} ${_} ${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,JJ=Ju;function eee(e){const t={};for(const n of e)t[n]=!0;return t}ge.toHash=eee;function tee(e,t){return typeof t=="boolean"?t:Object.keys(t).length===0?!0:(MM(e,t),!PM(t,e.self.RULES.all))}ge.alwaysValidSchema=tee;function MM(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]||IM(e,`unknown keyword: "${i}"`)}ge.checkUnknownRules=MM;function PM(e,t){if(typeof e=="boolean")return!e;for(const n in e)if(t[n])return!0;return!1}ge.schemaHasRules=PM;function nee(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=nee;function ree({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=ree;function aee(e){return DM(decodeURIComponent(e))}ge.unescapeFragment=aee;function iee(e){return encodeURIComponent(bw(e))}ge.escapeFragment=iee;function bw(e){return typeof e=="number"?`${e}`:e.replace(/~/g,"~0").replace(/\//g,"~1")}ge.escapeJsonPointer=bw;function DM(e){return e.replace(/~1/g,"/").replace(/~0/g,"~")}ge.unescapeJsonPointer=DM;function see(e,t){if(Array.isArray(e))for(const n of e)t(n);else t(e)}ge.eachItem=see;function bE({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:bE({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} || {}`),xw(e,n,t))}),mergeValues:(e,t)=>e===!0?!0:{...e,...t},resultToName:zM}),items:bE({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 zM(e,t){if(t===!0)return e.var("props",!0);const n=e.var("props",(0,ut._)`{}`);return t!==void 0&&xw(e,n,t),n}ge.evaluatedPropsToName=zM;function xw(e,t,n){Object.keys(n).forEach(r=>e.assign((0,ut._)`${t}${(0,ut.getProperty)(r)}`,!0))}ge.setEvaluated=xw;const xE={};function oee(e,t){return e.scopeValue("func",{ref:t,code:xE[t.code]||(xE[t.code]=new JJ._Code(t.code))})}ge.useFunc=oee;var N0;(function(e){e[e.Num=0]="Num",e[e.Str=1]="Str"})(N0||(ge.Type=N0={}));function lee(e,t,n){if(e instanceof ut.Name){const r=t===N0.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():"/"+bw(e)}ge.getErrorPath=lee;function IM(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=IM;var Na={};Object.defineProperty(Na,"__esModule",{value:!0});const En=Ue,cee={data:new En.Name("data"),valCxt:new En.Name("valCxt"),instancePath:new En.Name("instancePath"),parentData:new En.Name("parentData"),parentDataProperty:new En.Name("parentDataProperty"),rootData:new En.Name("rootData"),dynamicAnchors:new En.Name("dynamicAnchors"),vErrors:new En.Name("vErrors"),errors:new En.Name("errors"),this:new En.Name("this"),self:new En.Name("self"),scope:new En.Name("scope"),json:new En.Name("json"),jsonPos:new En.Name("jsonPos"),jsonLen:new En.Name("jsonLen"),jsonPart:new En.Name("jsonPart")};Na.default=cee;(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,x){const{it:S}=b,{gen:k,compositeRule:C,allErrors:N}=S,P=f(b,g,v);x??(C||N)?l(k,P):u(S,(0,t._)`[${P}]`)}e.reportError=a;function i(b,g=e.keywordError,v){const{it:x}=b,{gen:S,compositeRule:k,allErrors:C}=x,N=f(b,g,v);l(S,N),k||C||u(x,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:x,errsCount:S,it:k}){if(S===void 0)throw new Error("ajv implementation error");const C=b.name("err");b.forRange("i",S,r.default.errors,N=>{b.const(C,(0,t._)`${r.default.vErrors}[${N}]`),b.if((0,t._)`${C}.instancePath === undefined`,()=>b.assign((0,t._)`${C}.instancePath`,(0,t.strConcat)(r.default.instancePath,k.errorPath))),b.assign((0,t._)`${C}.schemaPath`,(0,t.str)`${k.errSchemaPath}/${g}`),k.opts.verbose&&(b.assign((0,t._)`${C}.schema`,v),b.assign((0,t._)`${C}.data`,x))})}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:x,schemaEnv:S}=b;S.$async?v.throw((0,t._)`new ${b.ValidationError}(${g})`):(v.assign((0,t._)`${x}.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:x}=b.it;return x===!1?(0,t._)`{}`:p(b,g,v)}function p(b,g,v={}){const{gen:x,it:S}=b,k=[h(S,v),y(b,v)];return m(b,g,k),x.object(...k)}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:x}){let S=x?g:(0,t.str)`${g}/${b}`;return v&&(S=(0,t.str)`${S}${(0,n.getErrorPath)(v,n.Type.Str)}`),[d.schemaPath,S]}function m(b,{params:g,message:v},x){const{keyword:S,data:k,schemaValue:C,it:N}=b,{opts:P,propertyName:R,topSchemaRef:$,schemaPath:j}=N;x.push([d.keyword,S],[d.params,typeof g=="function"?g(b):g||(0,t._)`{}`]),P.messages&&x.push([d.message,typeof v=="function"?v(b):v]),P.verbose&&x.push([d.schema,C],[d.parentSchema,(0,t._)`${$}${j}`],[r.default.data,k]),R&&x.push([d.propertyName,R])}})(zd);var wE;function uee(){if(wE)return js;wE=1,Object.defineProperty(js,"__esModule",{value:!0}),js.boolOrEmptySchema=js.topBoolOrEmptySchema=void 0;const e=zd,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))}js.topBoolOrEmptySchema=a;function i(o,l){const{gen:u,schema:d}=o;d===!1?(u.var(l,!1),s(o)):u.var(l,!0)}js.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 js}var Yt={},vo={};Object.defineProperty(vo,"__esModule",{value:!0});vo.getRules=vo.isJSONType=void 0;const dee=["string","number","integer","boolean","null","object","array"],fee=new Set(dee);function hee(e){return typeof e=="string"&&fee.has(e)}vo.isJSONType=hee;function pee(){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:{}}}vo.getRules=pee;var Da={},SE;function LM(){if(SE)return Da;SE=1,Object.defineProperty(Da,"__esModule",{value:!0}),Da.shouldUseRule=Da.shouldUseGroup=Da.schemaHasRulesForType=void 0;function e({schema:r,self:a},i){const s=a.RULES.types[i];return s&&s!==!0&&t(r,s)}Da.schemaHasRulesForType=e;function t(r,a){return a.rules.some(i=>n(r,i))}Da.shouldUseGroup=t;function n(r,a){var i;return r[a.keyword]!==void 0||((i=a.definition.implements)===null||i===void 0?void 0:i.some(s=>r[s]!==void 0))}return Da.shouldUseRule=n,Da}Object.defineProperty(Yt,"__esModule",{value:!0});Yt.reportTypeError=Yt.checkDataTypes=Yt.checkDataType=Yt.coerceAndCheckDataType=Yt.getJSONTypes=Yt.getSchemaTypes=Yt.DataType=void 0;const mee=vo,gee=LM(),yee=zd,Ie=Ue,UM=ge;var Sl;(function(e){e[e.Correct=0]="Correct",e[e.Wrong=1]="Wrong"})(Sl||(Yt.DataType=Sl={}));function vee(e){const t=FM(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}Yt.getSchemaTypes=vee;function FM(e){const t=Array.isArray(e)?e:e?[e]:[];if(t.every(mee.isJSONType))return t;throw new Error("type must be JSONType or JSONType[]: "+t.join(","))}Yt.getJSONTypes=FM;function bee(e,t){const{gen:n,data:r,opts:a}=e,i=xee(t,a.coerceTypes),s=t.length>0&&!(i.length===0&&t.length===1&&(0,gee.schemaHasRulesForType)(e,t[0]));if(s){const o=ww(t,r,a.strictNumbers,Sl.Wrong);n.if(o,()=>{i.length?wee(e,t,i):Sw(e)})}return s}Yt.coerceAndCheckDataType=bee;const qM=new Set(["string","number","integer","boolean","null"]);function xee(e,t){return t?e.filter(n=>qM.has(n)||t==="array"&&n==="array"):[]}function wee(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(ww(t,a,i.strictNumbers),()=>r.assign(o,a))),r.if((0,Ie._)`${o} !== undefined`);for(const u of n)(qM.has(u)||u==="array"&&i.coerceTypes==="array")&&l(u);r.else(),Sw(e),r.endIf(),r.if((0,Ie._)`${o} !== undefined`,()=>{r.assign(a,o),See(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 See({gen:e,parentData:t,parentDataProperty:n},r){e.if((0,Ie._)`${t} !== undefined`,()=>e.assign((0,Ie._)`${t}[${n}]`,r))}function j0(e,t,n,r=Sl.Correct){const a=r===Sl.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===Sl.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)}}Yt.checkDataType=j0;function ww(e,t,n,r){if(e.length===1)return j0(e[0],t,n,r);let a;const i=(0,UM.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,j0(s,t,n,r));return a}Yt.checkDataTypes=ww;const _ee={message:({schema:e})=>`must be ${e}`,params:({schema:e,schemaValue:t})=>typeof e=="string"?(0,Ie._)`{type: ${e}}`:(0,Ie._)`{type: ${t}}`};function Sw(e){const t=kee(e);(0,yee.reportError)(t,_ee)}Yt.reportTypeError=Sw;function kee(e){const{gen:t,data:n,schema:r}=e,a=(0,UM.schemaRefOrVal)(e,r,"type");return{gen:t,keyword:"type",data:n,schema:r.type,schemaCode:a,schemaValue:a,parentSchema:r,params:{},it:e}}var Uc={},_E;function Eee(){if(_E)return Uc;_E=1,Object.defineProperty(Uc,"__esModule",{value:!0}),Uc.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))}Uc.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 p=(0,e._)`${f} === undefined`;d.useDefaults==="empty"&&(p=(0,e._)`${p} || ${f} === null || ${f} === ""`),o.if(p,(0,e._)`${f} = ${(0,e.stringify)(s)}`)}return Uc}var qr={},nt={},kE;function aa(){if(kE)return nt;kE=1,Object.defineProperty(nt,"__esModule",{value:!0}),nt.validateUnion=nt.validateArray=nt.usePattern=nt.callValidateCode=nt.schemaProperties=nt.allSchemaProperties=nt.noPropertyInData=nt.propertyInData=nt.isOwnProperty=nt.hasPropFunc=nt.reportMissingProp=nt.checkMissingProp=nt.checkReportMissingProp=void 0;const e=Ue,t=ge,n=Na,r=ge;function a(v,x){const{gen:S,data:k,it:C}=v;S.if(d(S,k,x,C.opts.ownProperties),()=>{v.setParams({missingProperty:(0,e._)`${x}`},!0),v.error()})}nt.checkReportMissingProp=a;function i({gen:v,data:x,it:{opts:S}},k,C){return(0,e.or)(...k.map(N=>(0,e.and)(d(v,x,N,S.ownProperties),(0,e._)`${C} = ${N}`)))}nt.checkMissingProp=i;function s(v,x){v.setParams({missingProperty:x},!0),v.error()}nt.reportMissingProp=s;function o(v){return v.scopeValue("func",{ref:Object.prototype.hasOwnProperty,code:(0,e._)`Object.prototype.hasOwnProperty`})}nt.hasPropFunc=o;function l(v,x,S){return(0,e._)`${o(v)}.call(${x}, ${S})`}nt.isOwnProperty=l;function u(v,x,S,k){const C=(0,e._)`${x}${(0,e.getProperty)(S)} !== undefined`;return k?(0,e._)`${C} && ${l(v,x,S)}`:C}nt.propertyInData=u;function d(v,x,S,k){const C=(0,e._)`${x}${(0,e.getProperty)(S)} === undefined`;return k?(0,e.or)(C,(0,e.not)(l(v,x,S))):C}nt.noPropertyInData=d;function f(v){return v?Object.keys(v).filter(x=>x!=="__proto__"):[]}nt.allSchemaProperties=f;function p(v,x){return f(x).filter(S=>!(0,t.alwaysValidSchema)(v,x[S]))}nt.schemaProperties=p;function h({schemaCode:v,data:x,it:{gen:S,topSchemaRef:k,schemaPath:C,errorPath:N},it:P},R,$,j){const O=j?(0,e._)`${v}, ${x}, ${k}${C}`:x,z=[[n.default.instancePath,(0,e.strConcat)(n.default.instancePath,N)],[n.default.parentData,P.parentData],[n.default.parentDataProperty,P.parentDataProperty],[n.default.rootData,n.default.rootData]];P.opts.dynamicRef&&z.push([n.default.dynamicAnchors,n.default.dynamicAnchors]);const D=(0,e._)`${O}, ${S.object(...z)}`;return $!==e.nil?(0,e._)`${R}.call(${$}, ${D})`:(0,e._)`${R}(${D})`}nt.callValidateCode=h;const y=(0,e._)`new RegExp`;function m({gen:v,it:{opts:x}},S){const k=x.unicodeRegExp?"u":"",{regExp:C}=x.code,N=C(S,k);return v.scopeValue("pattern",{key:N.toString(),ref:N,code:(0,e._)`${C.code==="new RegExp"?y:(0,r.useFunc)(v,C)}(${S}, ${k})`})}nt.usePattern=m;function b(v){const{gen:x,data:S,keyword:k,it:C}=v,N=x.name("valid");if(C.allErrors){const R=x.let("valid",!0);return P(()=>x.assign(R,!1)),R}return x.var(N,!0),P(()=>x.break()),N;function P(R){const $=x.const("len",(0,e._)`${S}.length`);x.forRange("i",0,$,j=>{v.subschema({keyword:k,dataProp:j,dataPropType:t.Type.Num},N),x.if((0,e.not)(N),R)})}}nt.validateArray=b;function g(v){const{gen:x,schema:S,keyword:k,it:C}=v;if(!Array.isArray(S))throw new Error("ajv implementation error");if(S.some($=>(0,t.alwaysValidSchema)(C,$))&&!C.opts.unevaluated)return;const P=x.let("valid",!1),R=x.name("_valid");x.block(()=>S.forEach(($,j)=>{const O=v.subschema({keyword:k,schemaProp:j,compositeRule:!0},R);x.assign(P,(0,e._)`${P} || ${R}`),v.mergeValidEvaluated(O,R)||x.if((0,e.not)(P))})),v.result(P,()=>v.reset(),()=>v.error(!0))}return nt.validateUnion=g,nt}var EE;function Cee(){if(EE)return qr;EE=1,Object.defineProperty(qr,"__esModule",{value:!0}),qr.validateKeywordUsage=qr.validSchemaType=qr.funcKeywordCode=qr.macroKeywordCode=void 0;const e=Ue,t=Na,n=aa(),r=zd;function a(p,h){const{gen:y,keyword:m,schema:b,parentSchema:g,it:v}=p,x=h.macro.call(v.self,b,g,v),S=u(y,m,x);v.opts.validateSchema!==!1&&v.self.validateSchema(x,!0);const k=y.name("valid");p.subschema({schema:x,schemaPath:e.nil,errSchemaPath:`${v.errSchemaPath}/${m}`,topSchemaRef:S,compositeRule:!0},k),p.pass(k,()=>p.error(!0))}qr.macroKeywordCode=a;function i(p,h){var y;const{gen:m,keyword:b,schema:g,parentSchema:v,$data:x,it:S}=p;l(S,h);const k=!x&&h.compile?h.compile.call(S.self,g,v,S):h.validate,C=u(m,b,k),N=m.let("valid");p.block$data(N,P),p.ok((y=h.valid)!==null&&y!==void 0?y:N);function P(){if(h.errors===!1)j(),h.modifying&&s(p),O(()=>p.error());else{const z=h.async?R():$();h.modifying&&s(p),O(()=>o(p,z))}}function R(){const z=m.let("ruleErrs",null);return m.try(()=>j((0,e._)`await `),D=>m.assign(N,!1).if((0,e._)`${D} instanceof ${S.ValidationError}`,()=>m.assign(z,(0,e._)`${D}.errors`),()=>m.throw(D))),z}function $(){const z=(0,e._)`${C}.errors`;return m.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&&!x||h.schema===!1);m.assign(N,(0,e._)`${z}${(0,n.callValidateCode)(p,C,D,A)}`,h.modifying)}function O(z){var D;m.if((0,e.not)((D=h.valid)!==null&&D!==void 0?D:N),z)}}qr.funcKeywordCode=i;function s(p){const{gen:h,data:y,it:m}=p;h.if(m.parentData,()=>h.assign(y,(0,e._)`${m.parentData}[${m.parentDataProperty}]`))}function o(p,h){const{gen:y}=p;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)(p)},()=>p.error())}function l({schemaEnv:p},h){if(h.async&&!p.$async)throw new Error("async keyword in sync schema")}function u(p,h,y){if(y===void 0)throw new Error(`keyword "${h}" failed to compile`);return p.scopeValue("keyword",typeof y=="function"?{ref:y}:{ref:y,code:(0,e.stringify)(y)})}function d(p,h,y=!1){return!h.length||h.some(m=>m==="array"?Array.isArray(p):m==="object"?p&&typeof p=="object"&&!Array.isArray(p):typeof p==m||y&&typeof p>"u")}qr.validSchemaType=d;function f({schema:p,opts:h,self:y,errSchemaPath:m},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(x=>!Object.prototype.hasOwnProperty.call(p,x)))throw new Error(`parent schema must have dependencies of ${g}: ${v.join(",")}`);if(b.validateSchema&&!b.validateSchema(p[g])){const S=`keyword "${g}" value is invalid at path "${m}": `+y.errorsText(b.validateSchema.errors);if(h.validateSchema==="log")y.logger.error(S);else throw new Error(S)}}return qr.validateKeywordUsage=f,qr}var za={},CE;function Nee(){if(CE)return za;CE=1,Object.defineProperty(za,"__esModule",{value:!0}),za.extendSubschemaMode=za.extendSubschemaData=za.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 p=i.schema[s];return o===void 0?{schema:p,schemaPath:(0,e._)`${i.schemaPath}${(0,e.getProperty)(s)}`,errSchemaPath:`${i.errSchemaPath}/${s}`}:{schema:p[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')}za.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:p}=s;if(o!==void 0){const{errorPath:y,dataPathArr:m,opts:b}=s,g=p.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=[...m,i.parentDataProperty]}if(u!==void 0){const y=u instanceof e.Name?u:p.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]}}za.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 za.extendSubschemaMode=a,za}var mn={},HM=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},BM={exports:{}},Qi=BM.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(){};sh(t,r,a,e,"",e)};Qi.keywords={additionalItems:!0,items:!0,contains:!0,additionalProperties:!0,propertyNames:!0,not:!0,if:!0,then:!0,else:!0};Qi.arrayKeywords={items:!0,allOf:!0,anyOf:!0,oneOf:!0};Qi.propsKeywords={$defs:!0,definitions:!0,properties:!0,patternProperties:!0,dependencies:!0};Qi.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 sh(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 Qi.arrayKeywords)for(var p=0;p<f.length;p++)sh(e,t,n,f[p],a+"/"+d+"/"+p,i,a,d,r,p)}else if(d in Qi.propsKeywords){if(f&&typeof f=="object")for(var h in f)sh(e,t,n,f[h],a+"/"+d+"/"+jee(h),i,a,d,r,h)}else(d in Qi.keywords||e.allKeys&&!(d in Qi.skipKeywords))&&sh(e,t,n,f,a+"/"+d,i,a,d,r)}n(r,a,i,s,o,l,u)}}function jee(e){return e.replace(/~/g,"~0").replace(/\//g,"~1")}var Tee=BM.exports;Object.defineProperty(mn,"__esModule",{value:!0});mn.getSchemaRefs=mn.resolveUrl=mn.normalizeId=mn._getFullPath=mn.getFullPath=mn.inlineRef=void 0;const Aee=ge,Ree=HM,$ee=Tee,Oee=new Set(["type","format","pattern","maxLength","minLength","maxProperties","minProperties","maxItems","minItems","maximum","minimum","uniqueItems","multipleOf","required","enum","const"]);function Mee(e,t=!0){return typeof e=="boolean"?!0:t===!0?!T0(e):t?VM(e)<=t:!1}mn.inlineRef=Mee;const Pee=new Set(["$ref","$recursiveRef","$recursiveAnchor","$dynamicRef","$dynamicAnchor"]);function T0(e){for(const t in e){if(Pee.has(t))return!0;const n=e[t];if(Array.isArray(n)&&n.some(T0)||typeof n=="object"&&T0(n))return!0}return!1}function VM(e){let t=0;for(const n in e){if(n==="$ref")return 1/0;if(t++,!Oee.has(n)&&(typeof e[n]=="object"&&(0,Aee.eachItem)(e[n],r=>t+=VM(r)),t===1/0))return 1/0}return t}function KM(e,t="",n){n!==!1&&(t=_l(t));const r=e.parse(t);return ZM(e,r)}mn.getFullPath=KM;function ZM(e,t){return e.serialize(t).split("#")[0]+"#"}mn._getFullPath=ZM;const Dee=/#\/?$/;function _l(e){return e?e.replace(Dee,""):""}mn.normalizeId=_l;function zee(e,t,n){return n=_l(n),e.resolve(t,n)}mn.resolveUrl=zee;const Iee=/^[a-z_][-a-z0-9._]*$/i;function Lee(e,t){if(typeof e=="boolean")return{};const{schemaId:n,uriResolver:r}=this.opts,a=_l(e[n]||t),i={"":a},s=KM(r,a,!1),o={},l=new Set;return $ee(e,{allKeys:!0},(f,p,h,y)=>{if(y===void 0)return;const m=s+p;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[p]=b;function g(x){const S=this.opts.uriResolver.resolve;if(x=_l(b?S(b,x):x),l.has(x))throw d(x);l.add(x);let k=this.refs[x];return typeof k=="string"&&(k=this.refs[k]),typeof k=="object"?u(f,k.schema,x):x!==_l(m)&&(x[0]==="#"?(u(f,o[x],x),o[x]=f):this.refs[x]=m),x}function v(x){if(typeof x=="string"){if(!Iee.test(x))throw new Error(`invalid anchor "${x}"`);g.call(this,`#${x}`)}}}),o;function u(f,p,h){if(p!==void 0&&!Ree(f,p))throw d(h)}function d(f){return new Error(`reference "${f}" resolves to more than one schema`)}}mn.getSchemaRefs=Lee;var NE;function Nm(){if(NE)return Pa;NE=1,Object.defineProperty(Pa,"__esModule",{value:!0}),Pa.getData=Pa.KeywordCxt=Pa.validateFunctionCode=void 0;const e=uee(),t=Yt,n=LM(),r=Yt,a=Eee(),i=Cee(),s=Nee(),o=Ue,l=Na,u=mn,d=ge,f=zd;function p(L){if(k(L)&&(N(L),S(L))){b(L);return}h(L,()=>(0,e.topBoolOrEmptySchema)(L))}Pa.validateFunctionCode=p;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)}`),m(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 m(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 x(L,V){if(k(L)&&(N(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 k(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 N(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 Lt of Ce.rules)ht(Lt);ht(Ce.post)});function ht(Lt){(0,n.shouldUseGroup)(re,Lt)&&(Lt.type?(K.if((0,r.checkDataType)(Lt.type,ae,ce.strictNumbers)),Z(L,Lt),V.length===1&&V[0]===Lt.type&&X&&(K.else(),(0,r.reportTypeError)(L)),K.endIf()):Z(L,Lt),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||T(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(",")}"`)}),E(L,V)}}function T(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 E(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 x(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 Id={};Object.defineProperty(Id,"__esModule",{value:!0});class Uee extends Error{constructor(t){super("validation failed"),this.errors=t,this.ajv=this.validation=!0}}Id.default=Uee;var _c={};Object.defineProperty(_c,"__esModule",{value:!0});const sy=mn;class Fee extends Error{constructor(t,n,r,a){super(a||`can't resolve reference ${r} from id ${n}`),this.missingRef=(0,sy.resolveUrl)(t,n,r),this.missingSchema=(0,sy.normalizeId)((0,sy.getFullPath)(t,this.missingRef))}}_c.default=Fee;var Xn={};Object.defineProperty(Xn,"__esModule",{value:!0});Xn.resolveSchema=Xn.getCompilingSchema=Xn.resolveRef=Xn.compileSchema=Xn.SchemaEnv=void 0;const Hr=Ue,qee=Id,Ts=Na,Xr=mn,jE=ge,Hee=Nm();class jm{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,Xr.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={}}}Xn.SchemaEnv=jm;function _w(e){const t=GM.call(this,e);if(t)return t;const n=(0,Xr.getFullPath)(this.opts.uriResolver,e.root.baseId),{es5:r,lines:a}=this.opts.code,{ownProperties:i}=this.opts,s=new Hr.CodeGen(this.scope,{es5:r,lines:a,ownProperties:i});let o;e.$async&&(o=s.scopeValue("Error",{ref:qee.default,code:(0,Hr._)`require("ajv/dist/runtime/validation_error").default`}));const l=s.scopeName("validate");e.validateName=l;const u={gen:s,allErrors:this.opts.allErrors,data:Ts.default.data,parentData:Ts.default.parentData,parentDataProperty:Ts.default.parentDataProperty,dataNames:[Ts.default.data],dataPathArr:[Hr.nil],dataLevel:0,dataTypes:[],definedProperties:new Set,topSchemaRef:s.scopeValue("schema",this.opts.code.source===!0?{ref:e.schema,code:(0,Hr.stringify)(e.schema)}:{ref:e.schema}),validateName:l,ValidationError:o,schema:e.schema,schemaEnv:e,rootId:n,baseId:e.baseId||n,schemaPath:Hr.nil,errSchemaPath:e.schemaPath||(this.opts.jtd?"":"#"),errorPath:(0,Hr._)`""`,opts:this.opts,self:this};let d;try{this._compilations.add(e),(0,Hee.validateFunctionCode)(u),s.optimize(this.opts.code.optimize);const f=s.toString();d=`${s.scopeRefs(Ts.default.scope)}return ${f}`,this.opts.code.process&&(d=this.opts.code.process(d,e));const h=new Function(`${Ts.default.self}`,`${Ts.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:m}=u;h.evaluated={props:y instanceof Hr.Name?void 0:y,items:m instanceof Hr.Name?void 0:m,dynamicProps:y instanceof Hr.Name,dynamicItems:m instanceof Hr.Name},h.source&&(h.source.evaluated=(0,Hr.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)}}Xn.compileSchema=_w;function Bee(e,t,n){var r;n=(0,Xr.resolveUrl)(this.opts.uriResolver,t,n);const a=e.refs[n];if(a)return a;let i=Zee.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 jm({schema:s,schemaId:o,root:e,baseId:t}))}if(i!==void 0)return e.refs[n]=Vee.call(this,i)}Xn.resolveRef=Bee;function Vee(e){return(0,Xr.inlineRef)(e.schema,this.opts.inlineRefs)?e.schema:e.validate?e:_w.call(this,e)}function GM(e){for(const t of this._compilations)if(Kee(t,e))return t}Xn.getCompilingSchema=GM;function Kee(e,t){return e.schema===t.schema&&e.root===t.root&&e.baseId===t.baseId}function Zee(e,t){let n;for(;typeof(n=this.refs[t])=="string";)t=n;return n||this.schemas[t]||Tm.call(this,e,t)}function Tm(e,t){const n=this.opts.uriResolver.parse(t),r=(0,Xr._getFullPath)(this.opts.uriResolver,n);let a=(0,Xr.getFullPath)(this.opts.uriResolver,e.baseId,void 0);if(Object.keys(e.schema).length>0&&r===a)return oy.call(this,n,e);const i=(0,Xr.normalizeId)(r),s=this.refs[i]||this.schemas[i];if(typeof s=="string"){const o=Tm.call(this,e,s);return typeof(o==null?void 0:o.schema)!="object"?void 0:oy.call(this,n,o)}if(typeof(s==null?void 0:s.schema)=="object"){if(s.validate||_w.call(this,s),i===(0,Xr.normalizeId)(t)){const{schema:o}=s,{schemaId:l}=this.opts,u=o[l];return u&&(a=(0,Xr.resolveUrl)(this.opts.uriResolver,a,u)),new jm({schema:o,schemaId:l,root:e,baseId:a})}return oy.call(this,n,s)}}Xn.resolveSchema=Tm;const Gee=new Set(["properties","patternProperties","enum","dependencies","definitions"]);function oy(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,jE.unescapeFragment)(o)];if(l===void 0)return;n=l;const u=typeof n=="object"&&n[this.opts.schemaId];!Gee.has(o)&&u&&(t=(0,Xr.resolveUrl)(this.opts.uriResolver,t,u))}let i;if(typeof n!="boolean"&&n.$ref&&!(0,jE.schemaHasRulesButRef)(n,this.RULES)){const o=(0,Xr.resolveUrl)(this.opts.uriResolver,t,n.$ref);i=Tm.call(this,r,o)}const{schemaId:s}=this.opts;if(i=i||new jm({schema:n,schemaId:s,root:r,baseId:t}),i.schema!==i.root.schema)return i}const Qee="https://raw.githubusercontent.com/ajv-validator/ajv/master/lib/refs/data.json#",Yee="Meta-schema for $data reference (JSON AnySchema extension proposal)",Xee="object",Wee=["$data"],Jee={$data:{type:"string",anyOf:[{format:"relative-json-pointer"},{format:"json-pointer"}]}},ete=!1,tte={$id:Qee,description:Yee,type:Xee,required:Wee,properties:Jee,additionalProperties:ete};var kw={},Am={exports:{}};const nte=RegExp.prototype.test.bind(/^[\da-f]{8}-[\da-f]{4}-[\da-f]{4}-[\da-f]{4}-[\da-f]{12}$/iu),Ew=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),kc=RegExp.prototype.test.bind(/^[\da-f]{2}$/iu),Cw=RegExp.prototype.test.bind(/^[\da-z\-._~]$/iu),QM=RegExp.prototype.test.bind(/^[A-Za-z0-9\-._~!$&'()*+,;=:@/]$/u),Nw=RegExp.prototype.test.bind(/^[A-Za-z0-9\-._~!$&'()*+,;=:@/?]$/u),rte=RegExp.prototype.test.bind(/^[A-Za-z0-9\-._~!$&'()*+,;=:]$/u),Qn=new Array(256);{const e="0123456789ABCDEF";for(let t=0;t<256;t++)Qn[t]="%"+e[t>>4]+e[t&15]}function Nn(e){return e<2048?Qn[192|e>>6]+Qn[128|e&63]:e<65536?Qn[224|e>>12]+Qn[128|e>>6&63]+Qn[128|e&63]:Qn[240|e>>18]+Qn[128|e>>12&63]+Qn[128|e>>6&63]+Qn[128|e&63]}const ate=RegExp.prototype.test.bind(/^[\dA-Fa-f]{1,4}$/),ite=RegExp.prototype.test.bind(/^[vV][\dA-Fa-f]+\.[A-Za-z\d\-._~!$&'()*+,;=:]+$/),ste=RegExp.prototype.test.bind(/^[A-Za-z\d\-._~]$/),ote=RegExp.prototype.test.bind(/[^!"$&'()*+,\-.;=_`a-z{}~]/u);function lte(e){if(e.length===0)return!1;for(let t=0;t<e.length;t++)if(!ste(e[t])){if(e[t]==="%"&&t+2<e.length&&kc(e.slice(t+1,t+3))){t+=2;continue}return!1}return!0}function TE(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||!Ew(l))return;i+=2;continue}if(!ate(l))return;a[o]=parseInt(l,16).toString(16),i++}if(t===-1)return i!==8?void 0:TE(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 TE(s)}function A0(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&&ite(r))return r=r.toLowerCase(),{host:`[${r}]`,escapedHost:r,isIPV6:!1,isIPVFuture:!0};if(ute(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),!lte(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 ute(e,t){let n=0;for(let r=0;r<e.length;r++)e[r]===t&&n++;return n}function dte(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 fte={"@":"%40","/":"%2F","?":"%3F","#":"%23",":":"%3A"},hte=/[@/?#:]/g,pte=/[@/?#]/g;function YM(e,t){const n=t?pte:hte;return n.lastIndex=0,e.replace(n,r=>fte[r])}function XM(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(kc(a)){const i=a.toUpperCase(),s=String.fromCharCode(parseInt(i,16));t&&Cw(s)?n+=s:n+="%"+i,r+=2;continue}}n+=e[r]}return n}function mte(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(kc(a)){const i=a.toUpperCase(),s=String.fromCharCode(parseInt(i,16));s!=="."&&Cw(s)?t+=s:t+="%"+i,n+=2;continue}}if(QM(r))t+=r;else{const a=e.charCodeAt(n);if(a<128)t+=WM(a)?r:Qn[a];else if(a<55296||a>57343)t+=Nn(a);else if(a<=56319&&n+1<e.length){const i=e.charCodeAt(n+1);i>=56320&&i<=57343?(t+=Nn(65536+(a-55296<<10)+(i-56320)),n++):t+=Nn(65533)}else t+=Nn(65533)}}return t}function gte(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(kc(s)){n+="%"+s.toUpperCase(),a+=2;continue}}if(i==="/"&&(r=!1),QM(i)&&(i!==":"||!r))n+=i;else{const s=e.charCodeAt(a);if(s<128)n+=Qn[s];else if(s<55296||s>57343)n+=Nn(s);else if(s<=56319&&a+1<e.length){const o=e.charCodeAt(a+1);o>=56320&&o<=57343?(n+=Nn(65536+(s-55296<<10)+(o-56320)),a++):n+=Nn(65533)}else n+=Nn(65533)}}return n}function jw(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(kc(i)){n+="%"+i.toUpperCase(),r+=2;continue}}if(t(a))n+=a;else{const i=e.charCodeAt(r);if(i<128)n+=Qn[i];else if(i<55296||i>57343)n+=Nn(i);else if(i<=56319&&r+1<e.length){const s=e.charCodeAt(r+1);s>=56320&&s<=57343?(n+=Nn(65536+(i-55296<<10)+(s-56320)),r++):n+=Nn(65533)}else n+=Nn(65533)}}return n}function yte(e){return jw(e,rte)}function vte(e){return jw(e,Nw)}function bte(e){return jw(e,Nw)}function WM(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 xte(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(kc(a)){const i=a.toUpperCase(),s=String.fromCharCode(parseInt(i,16));Cw(s)?t+=s:t+="%"+i,n+=2;continue}}if(Nw(r))t+=r;else{const a=e.charCodeAt(n);if(a<128)t+=WM(a)?r:Qn[a];else if(a<55296||a>57343)t+=Nn(a);else if(a<=56319&&n+1<e.length){const i=e.charCodeAt(n+1);i>=56320&&i<=57343?(t+=Nn(65536+(a-55296<<10)+(i-56320)),n++):t+=Nn(65533)}else t+=Nn(65533)}}return t}function wte(e){const t=[];if(e.userinfo!==void 0&&(t.push(yte(e.userinfo)),t.push("@")),e.host!==void 0){let n=e.host;if(!Ew(n)){let r=A0(n);r.isIPV6!==!0&&r.isIPVFuture!==!0&&(n=XM(n,!0),r=A0(n)),r.isIPV6===!0||r.isIPVFuture===!0?n=`[${r.escapedHost}]`:n=YM(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 JM={nonSimpleDomain:ote,recomposeAuthority:wte,reescapeHostDelimiters:YM,normalizePercentEncoding:XM,normalizePathEncoding:mte,serializePathEncoding:gte,normalizeQueryFragmentEncoding:xte,encodeQuery:vte,encodeFragment:bte,removeDotSegments:dte,isIPv4:Ew,isUUID:nte,normalizeIPv6:A0};const{isUUID:Ste}=JM,_te=/^([\da-z][\d\-a-z]{0,31}):((?:[\w!$'()*+,\-./:;=@]|%[\da-f]{2})+)$/iu;function eP(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 tP(e){return e.host||(e.error=e.error||"HTTP URIs must have a host."),e}function nP(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 kte(e){return e.secure=eP(e),e.resourceName=(e.path||"/")+(e.query?"?"+e.query:""),e.path=void 0,e.query=void 0,e}function Ete(e){if((e.port===(eP(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 Cte(e,t){if(!e.path)return e.error="URN can not be parsed",e;const n=e.path.match(_te);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=Tw(a);e.path=void 0,i&&(e=i.parse(e,t))}else e.error=e.error||"URN can not be parsed.";return e}function Nte(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=Tw(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 jte(e,t){const n=e;return n.uuid=n.nss,n.nss=void 0,!t.tolerant&&(!n.uuid||!Ste(n.uuid))&&(n.error=n.error||"UUID is not valid."),n}function Tte(e){const t=e;return t.nss=(e.uuid||"").toLowerCase(),t}const rP={scheme:"http",domainHost:!0,parse:tP,serialize:nP},Ate={scheme:"https",domainHost:rP.domainHost,parse:tP,serialize:nP},oh={scheme:"ws",domainHost:!0,parse:kte,serialize:Ete},Rte={scheme:"wss",domainHost:oh.domainHost,parse:oh.parse,serialize:oh.serialize},$te={scheme:"urn",parse:Cte,serialize:Nte,skipNormalize:!0},Ote={scheme:"urn:uuid",parse:jte,serialize:Tte,skipNormalize:!0},wp={http:rP,https:Ate,ws:oh,wss:Rte,urn:$te,"urn:uuid":Ote};Object.setPrototypeOf(wp,null);function Tw(e){return e&&(wp[e]||wp[e.toLowerCase()])||void 0}var Mte={SCHEMES:wp,getSchemeHandler:Tw};const{normalizeIPv6:aP,removeDotSegments:eu,recomposeAuthority:Pte,normalizePercentEncoding:iP,normalizePathEncoding:Dte,serializePathEncoding:AE,normalizeQueryFragmentEncoding:RE,encodeQuery:zte,encodeFragment:Ite,reescapeHostDelimiters:Lte,isIPv4:sP,nonSimpleDomain:Ute}=JM,{SCHEMES:oP,getSchemeHandler:Aw}=Mte,lP=/^[A-Za-z][A-Za-z0-9+.-]*$/u,cP="URI scheme is malformed.";function $E(e){const t=unescape(String(e));if(!lP.test(t))throw new TypeError(cP);return t}function Fte(e,t){return typeof e=="string"?e=Qte(e,t):typeof e=="object"&&(e=_p(bo(e,t),t)),e}function qte(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}=Sp(e,r),{parsed:d,malformedAuthorityOrPort:f,malformedPercentEncoding:p,malformedSchemeSpecific:h,malformedHost:y,malformedScheme:m}=Sp(t,r);if(i||f||s||p||o||h||l||y||u||m)throw new Error(a.error||d.error||"URI is malformed.");const b=uP(a,d,r,!0),g=Aw(n&&n.scheme||b.scheme),v=b.host,x=v!==void 0&&v!==""&&(sP(v)||aP(v).isIPV6);dP(b,n||{},g,x);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,bo(b,r)}function uP(e,t,n,r){const a={};return r||(e=_p(bo(e,n),n),t=_p(bo(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=eu(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=eu(t.path||""),a.query=t.query):(t.path?(t.path[0]==="/"?a.path=eu(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=eu(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 Hte(e,t,n){const r=OE(e,n),a=OE(t,n);return r!==void 0&&a!==void 0&&r===a}function bo(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=$E(n.scheme));const i=Aw(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=iP(n.path):n.path=AE(n.path,o)),r.reference!=="suffix"&&n.scheme&&(n.scheme=$E(n.scheme),a.push(n.scheme,":"));const l=Pte(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=eu(u)),o&&(u=AE(u,!0)),l===void 0&&u[0]==="/"&&u[1]==="/"&&(u="/%2F"+u.slice(2)),a.push(u)}return n.query!==void 0&&a.push("?",zte(n.query)),n.fragment!==void 0&&a.push("#",Ite(n.fragment)),a.join("")}const Bte=/^(?:([^#/:?]+):)?(?:\/\/((?:([^#/?@]*)@)?(\[[^#/?\]]+\]|[^#/:?]*)(?::(\d*))?))?([^#?]*)(?:\?([^#]*))?(?:#((?:.|[\n\r])*))?/u,Vte=/^(?:[^#/:?]+:)?\/\/([^/?#]*)/,Kte=/^(?:[^#/:?]+:)?([/\\\t\n\r]*)/;function Zte(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 Fc(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 Gte(e){const t=e[4];return Fc(e[3])||t!==void 0&&!(t[0]==="["&&t[t.length-1]==="]")&&Fc(t)||Fc(e[6])||Fc(e[7])||Fc(e[8])}function dP(e,t,n,r){if(!t.unicodeSupport&&(!n||!n.unicodeSupport)&&e.host&&e.host[0]!=="["&&(t.domainHost||n&&n.domainHost)&&r===!1&&Ute(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 Sp(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(Vte);f!==null&&f[1].indexOf("\\")!==-1&&(r.error="URI authority must not contain a literal backslash.",a=!0);const p=e.match(Kte);if(p!==null){const y=p[1],m=y.replace(/[\t\n\r]/g,"");m.length>=2&&(m.slice(0,2)!=="//"?(r.error=r.error||"URI authority must not contain a literal backslash.",a=!0):y.length!==m.length&&(r.error=r.error||"URI authority introducer must not contain whitespace.",a=!0))}const h=e.match(Bte);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);lP.test(b)?r.scheme=b.toLowerCase():(r.error=r.error||cP,u=!0)}i=Gte(h),i&&(r.error=r.error||"URI contains malformed percent-encoding."),isNaN(r.port)&&(r.port=h[5]);const y=Zte(r,h);if(y!==void 0&&(r.error=r.error||y,a=!0),r.host)if(sP(r.host)===!1){const g=r.host[0]==="["&&r.host[r.host.length-1]==="]",v=aP(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 m=Aw(n.scheme||r.scheme);if(o=dP(r,n,m,d),!m||m&&!m.skipNormalize){if(e.indexOf("%")!==-1&&r.host!==void 0&&!l){const b=d?r.host:iP(r.host,!0);r.host=Lte(b,d)}r.path&&(r.path=Dte(r.path)),r.query&&(r.query=RE(r.query)),r.fragment&&(r.fragment=RE(r.fragment))}m&&m.parse&&(m.parse(r,n),m===oP.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 _p(e,t){return Sp(e,t).parsed}function Qte(e,t){return fP(e,t).normalized}function fP(e,t){const{parsed:n,malformedAuthorityOrPort:r,malformedPercentEncoding:a,malformedSchemeSpecific:i,malformedHost:s,malformedScheme:o}=Sp(e,t);return{normalized:r||a||i||s||o?e:bo(n,t),malformedAuthorityOrPort:r,malformedPercentEncoding:a,malformedSchemeSpecific:i,malformedHost:s,malformedScheme:o}}function OE(e,t){if(typeof e!="string"&&typeof e!="object")return;let n;try{n=typeof e=="string"?e:bo(e,t)}catch{return}const{normalized:r,malformedAuthorityOrPort:a,malformedPercentEncoding:i,malformedSchemeSpecific:s,malformedHost:o,malformedScheme:l}=fP(n,t);return a||i||s||o||l?void 0:r}const Rw={SCHEMES:oP,normalize:Fte,resolve:qte,resolveComponent:uP,equal:Hte,serialize:bo,parse:_p};Am.exports=Rw;Am.exports.default=Rw;Am.exports.fastUri=Rw;var Yte=Am.exports;Object.defineProperty(kw,"__esModule",{value:!0});const hP=Yte;hP.code='require("ajv/dist/runtime/uri").default';kw.default=hP;(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=Nm();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=Id,a=_c,i=vo,s=Xn,o=Ue,l=mn,u=Yt,d=ge,f=tte,p=kw,h=(T,q)=>new RegExp(T,q);h.code="new RegExp";const y=["removeAdditional","useDefaults","coerceTypes"],m=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 x(T){var q,G,_,E,M,I,Q,W,oe,de,L,V,X,ne,K,re,ae,Ae,ce,we,Ce,ht,Lt,gt,rr;const Y=T.strict,se=(q=T.code)===null||q===void 0?void 0:q.optimize,Se=se===!0||se===void 0?1:se||0,je=(_=(G=T.code)===null||G===void 0?void 0:G.regExp)!==null&&_!==void 0?_:h,Ye=(E=T.uriResolver)!==null&&E!==void 0?E:p.default;return{strictSchema:(I=(M=T.strictSchema)!==null&&M!==void 0?M:Y)!==null&&I!==void 0?I:!0,strictNumbers:(W=(Q=T.strictNumbers)!==null&&Q!==void 0?Q:Y)!==null&&W!==void 0?W:!0,strictTypes:(de=(oe=T.strictTypes)!==null&&oe!==void 0?oe:Y)!==null&&de!==void 0?de:"log",strictTuples:(V=(L=T.strictTuples)!==null&&L!==void 0?L:Y)!==null&&V!==void 0?V:"log",strictRequired:(ne=(X=T.strictRequired)!==null&&X!==void 0?X:Y)!==null&&ne!==void 0?ne:!1,code:T.code?{...T.code,optimize:Se,regExp:je}:{optimize:Se,regExp:je},loopRequired:(K=T.loopRequired)!==null&&K!==void 0?K:v,loopEnum:(re=T.loopEnum)!==null&&re!==void 0?re:v,meta:(ae=T.meta)!==null&&ae!==void 0?ae:!0,messages:(Ae=T.messages)!==null&&Ae!==void 0?Ae:!0,inlineRefs:(ce=T.inlineRefs)!==null&&ce!==void 0?ce:!0,schemaId:(we=T.schemaId)!==null&&we!==void 0?we:"$id",addUsedSchema:(Ce=T.addUsedSchema)!==null&&Ce!==void 0?Ce:!0,validateSchema:(ht=T.validateSchema)!==null&&ht!==void 0?ht:!0,validateFormats:(Lt=T.validateFormats)!==null&&Lt!==void 0?Lt:!0,unicodeRegExp:(gt=T.unicodeRegExp)!==null&>!==void 0?gt:!0,int32range:(rr=T.int32range)!==null&&rr!==void 0?rr:!0,uriResolver:Ye}}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,...x(q)};const{es5:G,lines:_}=this.opts.code;this.scope=new o.ValueScope({scope:{},prefixes:m,es5:G,lines:_}),this.logger=O(q.logger);const E=q.validateFormats;q.validateFormats=!1,this.RULES=(0,i.getRules)(),k.call(this,b,q,"NOT SUPPORTED"),k.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),N.call(this),q.validateFormats=E}_addVocabularies(){this.addKeyword("$async")}_addDefaultMetaSchema(){const{$data:q,meta:G,schemaId:_}=this.opts;let E=f;_==="id"&&(E={...f},E.id=E.$id,delete E.$id),G&&q&&this.addMetaSchema(E,E[_],!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 E=_(G);return"$async"in _||(this.errors=_.errors),E}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 E.call(this,q,G);async function E(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 E.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,_,E=this.opts.validateSchema){if(Array.isArray(q)){for(const I of q)this.addSchema(I,void 0,_,E);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,E,!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 E=this.validate(_,q);if(!E&&G){const M="schema is invalid: "+this.errorsText();if(this.opts.validateSchema==="log")this.logger.error(M);else throw new Error(M)}return E}getSchema(q){let G;for(;typeof(G=C.call(this,q))=="string";)q=G;if(G===void 0){const{schemaId:_}=this.opts,E=new s.SchemaEnv({schema:{},schemaId:_});if(G=s.resolveSchema.call(this,E,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 E={...G,type:(0,u.getJSONTypes)(G.type),schemaType:(0,u.getJSONTypes)(G.schemaType)};return(0,d.eachItem)(_,E.type.length===0?M=>A.call(this,M,E):M=>E.type.forEach(I=>A.call(this,M,E,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 E=_.rules.findIndex(M=>M.keyword===q);E>=0&&_.rules.splice(E,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(E=>`${_}${E.instancePath} ${E.message}`).reduce((E,M)=>E+G+M)}$dataMetaSchema(q,G){const _=this.RULES.all;q=JSON.parse(JSON.stringify(q));for(const E of G){const M=E.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 E=q[_];(!G||G.test(_))&&(typeof E=="string"?delete q[_]:E&&!E.meta&&(this._cache.delete(E.schema),delete q[_]))}}_addSchema(q,G,_,E=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),E&&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 k(T,q,G,_="error"){for(const E in T){const M=E;M in q&&this.logger[_](`${G}: option ${E}. ${T[M]}`)}}function C(T){return T=(0,l.normalizeId)(T),this.schemas[T]||this.refs[T]}function N(){const T=this.opts.schemas;if(T)if(Array.isArray(T))this.addSchema(T);else for(const q in T)this.addSchema(T[q],q)}function P(){for(const T in this.opts.formats){const q=this.opts.formats[T];q&&this.addFormat(T,q)}}function R(T){if(Array.isArray(T)){this.addVocabulary(T);return}this.logger.warn("keywords option as map is deprecated, pass array");for(const q in T){const G=T[q];G.keyword||(G.keyword=q),this.addKeyword(G)}}function $(){const T={...this.opts};for(const q of y)delete T[q];return T}const j={log(){},warn(){},error(){}};function O(T){if(T===!1)return j;if(T===void 0)return console;if(T.log&&T.warn&&T.error)return T;throw new Error("logger must implement log, warn and error methods")}const z=/^[a-z_$][a-z0-9_$:-]*$/i;function D(T,q){const{RULES:G}=this;if((0,d.eachItem)(T,_=>{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(T,q,G){var _;const E=q==null?void 0:q.post;if(G&&E)throw new Error('keyword with "post" flag cannot have "type"');const{RULES:M}=this;let I=E?M.post:M.rules.find(({type:W})=>W===G);if(I||(I={type:G,rules:[]},M.rules.push(I)),M.keywords[T]=!0,!q)return;const Q={keyword:T,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[T]=Q,(_=q.implements)===null||_===void 0||_.forEach(W=>this.addKeyword(W))}function B(T,q,G){const _=T.rules.findIndex(E=>E.keyword===G);_>=0?T.rules.splice(_,0,q):(T.rules.push(q),this.logger.warn(`rule ${G} is not defined`))}function Z(T){let{metaSchema:q}=T;q!==void 0&&(T.$data&&this.opts.$data&&(q=J(q)),T.validateSchema=this.compile(q,!0))}const F={$ref:"https://raw.githubusercontent.com/ajv-validator/ajv/master/lib/refs/data.json#"};function J(T){return{anyOf:[T,F]}}})(OM);var $w={},Ow={},Mw={};Object.defineProperty(Mw,"__esModule",{value:!0});const Xte={keyword:"id",code(){throw new Error('NOT SUPPORTED: keyword "id", use "$id" for schema ID')}};Mw.default=Xte;var xo={};Object.defineProperty(xo,"__esModule",{value:!0});xo.callRef=xo.getValidate=void 0;const Wte=_c,ME=aa(),Kn=Ue,zo=Na,PE=Xn,Cf=ge,Jte={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=PE.resolveRef.call(l,u,a,n);if(d===void 0)throw new Wte.default(r.opts.uriResolver,a,n);if(d instanceof PE.SchemaEnv)return p(d);return h(d);function f(){if(i===u)return lh(e,s,i,i.$async);const y=t.scopeValue("root",{ref:u});return lh(e,(0,Kn._)`${y}.validate`,u,u.$async)}function p(y){const m=pP(e,y);lh(e,m,y,y.$async)}function h(y){const m=t.scopeValue("schema",o.code.source===!0?{ref:y,code:(0,Kn.stringify)(y)}:{ref:y}),b=t.name("valid"),g=e.subschema({schema:y,dataTypes:[],schemaPath:Kn.nil,topSchemaRef:m,errSchemaPath:n},b);e.mergeEvaluated(g),e.ok(b)}}};function pP(e,t){const{gen:n}=e;return t.validate?n.scopeValue("validate",{ref:t.validate}):(0,Kn._)`${n.scopeValue("wrapper",{ref:t})}.validate`}xo.getValidate=pP;function lh(e,t,n,r){const{gen:a,it:i}=e,{allErrors:s,schemaEnv:o,opts:l}=i,u=l.passContext?zo.default.this:Kn.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,Kn._)`await ${(0,ME.callValidateCode)(e,t,u)}`),h(t),s||a.assign(y,!0)},m=>{a.if((0,Kn._)`!(${m} instanceof ${i.ValidationError})`,()=>a.throw(m)),p(m),s||a.assign(y,!1)}),e.ok(y)}function f(){e.result((0,ME.callValidateCode)(e,t,u),()=>h(t),()=>p(t))}function p(y){const m=(0,Kn._)`${y}.errors`;a.assign(zo.default.vErrors,(0,Kn._)`${zo.default.vErrors} === null ? ${m} : ${zo.default.vErrors}.concat(${m})`),a.assign(zo.default.errors,(0,Kn._)`${zo.default.vErrors}.length`)}function h(y){var m;if(!i.opts.unevaluated)return;const b=(m=n==null?void 0:n.validate)===null||m===void 0?void 0:m.evaluated;if(i.props!==!0)if(b&&!b.dynamicProps)b.props!==void 0&&(i.props=Cf.mergeEvaluated.props(a,b.props,i.props));else{const g=a.var("props",(0,Kn._)`${y}.evaluated.props`);i.props=Cf.mergeEvaluated.props(a,g,i.props,Kn.Name)}if(i.items!==!0)if(b&&!b.dynamicItems)b.items!==void 0&&(i.items=Cf.mergeEvaluated.items(a,b.items,i.items));else{const g=a.var("items",(0,Kn._)`${y}.evaluated.items`);i.items=Cf.mergeEvaluated.items(a,g,i.items,Kn.Name)}}}xo.callRef=lh;xo.default=Jte;Object.defineProperty(Ow,"__esModule",{value:!0});const ene=Mw,tne=xo,nne=["$schema","$id","$defs","$vocabulary",{keyword:"$comment"},"definitions",ene.default,tne.default];Ow.default=nne;var Pw={},Dw={};Object.defineProperty(Dw,"__esModule",{value:!0});const kp=Ue,Si=kp.operators,Ep={maximum:{okStr:"<=",ok:Si.LTE,fail:Si.GT},minimum:{okStr:">=",ok:Si.GTE,fail:Si.LT},exclusiveMaximum:{okStr:"<",ok:Si.LT,fail:Si.GTE},exclusiveMinimum:{okStr:">",ok:Si.GT,fail:Si.LTE}},rne={message:({keyword:e,schemaCode:t})=>(0,kp.str)`must be ${Ep[e].okStr} ${t}`,params:({keyword:e,schemaCode:t})=>(0,kp._)`{comparison: ${Ep[e].okStr}, limit: ${t}}`},ane={keyword:Object.keys(Ep),type:"number",schemaType:"number",$data:!0,error:rne,code(e){const{keyword:t,data:n,schemaCode:r}=e;e.fail$data((0,kp._)`${n} ${Ep[t].fail} ${r} || isNaN(${n})`)}};Dw.default=ane;var zw={};Object.defineProperty(zw,"__esModule",{value:!0});const Cu=Ue,ine={message:({schemaCode:e})=>(0,Cu.str)`must be multiple of ${e}`,params:({schemaCode:e})=>(0,Cu._)`{multipleOf: ${e}}`},sne={keyword:"multipleOf",type:"number",schemaType:"number",$data:!0,error:ine,code(e){const{gen:t,data:n,schemaCode:r,it:a}=e,i=a.opts.multipleOfPrecision,s=t.let("res"),o=i?(0,Cu._)`Math.abs(Math.round(${s}) - ${s}) > 1e-${i}`:(0,Cu._)`${s} !== parseInt(${s})`;e.fail$data((0,Cu._)`(${r} === 0 || (${s} = ${n}/${r}, ${o}))`)}};zw.default=sne;var Iw={},Lw={};Object.defineProperty(Lw,"__esModule",{value:!0});function mP(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}Lw.default=mP;mP.code='require("ajv/dist/runtime/ucs2length").default';Object.defineProperty(Iw,"__esModule",{value:!0});const Ls=Ue,one=ge,lne=Lw,cne={message({keyword:e,schemaCode:t}){const n=e==="maxLength"?"more":"fewer";return(0,Ls.str)`must NOT have ${n} than ${t} characters`},params:({schemaCode:e})=>(0,Ls._)`{limit: ${e}}`},une={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"?Ls.operators.GT:Ls.operators.LT,s=a.opts.unicode===!1?(0,Ls._)`${n}.length`:(0,Ls._)`${(0,one.useFunc)(e.gen,lne.default)}(${n})`;e.fail$data((0,Ls._)`${s} ${i} ${r}`)}};Iw.default=une;var Uw={};Object.defineProperty(Uw,"__esModule",{value:!0});const dne=aa(),fne=ge,cl=Ue,hne={message:({schemaCode:e})=>(0,cl.str)`must match pattern "${e}"`,params:({schemaCode:e})=>(0,cl._)`{pattern: ${e}}`},pne={keyword:"pattern",type:"string",schemaType:"string",$data:!0,error:hne,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,cl._)`new RegExp`:(0,fne.useFunc)(t,l),d=t.let("valid");t.try(()=>t.assign(d,(0,cl._)`${u}(${i}, ${o}).test(${n})`),()=>t.assign(d,!1)),e.fail$data((0,cl._)`!${d}`)}else{const l=(0,dne.usePattern)(e,a);e.fail$data((0,cl._)`!${l}.test(${n})`)}}};Uw.default=pne;var Fw={};Object.defineProperty(Fw,"__esModule",{value:!0});const Nu=Ue,mne={message({keyword:e,schemaCode:t}){const n=e==="maxProperties"?"more":"fewer";return(0,Nu.str)`must NOT have ${n} than ${t} properties`},params:({schemaCode:e})=>(0,Nu._)`{limit: ${e}}`},gne={keyword:["maxProperties","minProperties"],type:"object",schemaType:"number",$data:!0,error:mne,code(e){const{keyword:t,data:n,schemaCode:r}=e,a=t==="maxProperties"?Nu.operators.GT:Nu.operators.LT;e.fail$data((0,Nu._)`Object.keys(${n}).length ${a} ${r}`)}};Fw.default=gne;var qw={};Object.defineProperty(qw,"__esModule",{value:!0});const qc=aa(),ju=Ue,yne=ge,vne={message:({params:{missingProperty:e}})=>(0,ju.str)`must have required property '${e}'`,params:({params:{missingProperty:e}})=>(0,ju._)`{missingProperty: ${e}}`},bne={keyword:"required",type:"object",schemaType:"array",$data:!0,error:vne,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 m of n)if((h==null?void 0:h[m])===void 0&&!y.has(m)){const b=s.schemaEnv.baseId+s.errSchemaPath,g=`required property "${m}" is not defined at "${b}" (strictRequired)`;(0,yne.checkStrictMode)(s,g,s.opts.strictRequired)}}function u(){if(l||i)e.block$data(ju.nil,f);else for(const h of n)(0,qc.checkReportMissingProp)(e,h)}function d(){const h=t.let("missing");if(l||i){const y=t.let("valid",!0);e.block$data(y,()=>p(h,y)),e.ok(y)}else t.if((0,qc.checkMissingProp)(e,n,h)),(0,qc.reportMissingProp)(e,h),t.else()}function f(){t.forOf("prop",r,h=>{e.setParams({missingProperty:h}),t.if((0,qc.noPropertyInData)(t,a,h,o.ownProperties),()=>e.error())})}function p(h,y){e.setParams({missingProperty:h}),t.forOf(h,r,()=>{t.assign(y,(0,qc.propertyInData)(t,a,h,o.ownProperties)),t.if((0,ju.not)(y),()=>{e.error(),t.break()})},ju.nil)}}};qw.default=bne;var Hw={};Object.defineProperty(Hw,"__esModule",{value:!0});const Tu=Ue,xne={message({keyword:e,schemaCode:t}){const n=e==="maxItems"?"more":"fewer";return(0,Tu.str)`must NOT have ${n} than ${t} items`},params:({schemaCode:e})=>(0,Tu._)`{limit: ${e}}`},wne={keyword:["maxItems","minItems"],type:"array",schemaType:"number",$data:!0,error:xne,code(e){const{keyword:t,data:n,schemaCode:r}=e,a=t==="maxItems"?Tu.operators.GT:Tu.operators.LT;e.fail$data((0,Tu._)`${n}.length ${a} ${r}`)}};Hw.default=wne;var Bw={},Ld={};Object.defineProperty(Ld,"__esModule",{value:!0});const gP=HM;gP.code='require("ajv/dist/runtime/equal").default';Ld.default=gP;Object.defineProperty(Bw,"__esModule",{value:!0});const ly=Yt,dn=Ue,Sne=ge,_ne=Ld,kne={message:({params:{i:e,j:t}})=>(0,dn.str)`must NOT have duplicate items (items ## ${t} and ${e} are identical)`,params:({params:{i:e,j:t}})=>(0,dn._)`{i: ${e}, j: ${t}}`},Ene={keyword:"uniqueItems",type:"array",schemaType:"boolean",$data:!0,error:kne,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,ly.getSchemaTypes)(i.items):[];e.block$data(l,d,(0,dn._)`${s} === false`),e.ok(l);function d(){const y=t.let("i",(0,dn._)`${n}.length`),m=t.let("j");e.setParams({i:y,j:m}),t.assign(l,!0),t.if((0,dn._)`${y} > 1`,()=>(f()?p:h)(y,m))}function f(){return u.length>0&&!u.some(y=>y==="object"||y==="array")}function p(y,m){const b=t.name("item"),g=(0,ly.checkDataTypes)(u,b,o.opts.strictNumbers,ly.DataType.Wrong),v=t.const("indices",(0,dn._)`{}`);t.for((0,dn._)`;${y}--;`,()=>{t.let(b,(0,dn._)`${n}[${y}]`),t.if(g,(0,dn._)`continue`),u.length>1&&t.if((0,dn._)`typeof ${b} == "string"`,(0,dn._)`${b} += "_"`),t.if((0,dn._)`typeof ${v}[${b}] == "number"`,()=>{t.assign(m,(0,dn._)`${v}[${b}]`),e.error(),t.assign(l,!1).break()}).code((0,dn._)`${v}[${b}] = ${y}`)})}function h(y,m){const b=(0,Sne.useFunc)(t,_ne.default),g=t.name("outer");t.label(g).for((0,dn._)`;${y}--;`,()=>t.for((0,dn._)`${m} = ${y}; ${m}--;`,()=>t.if((0,dn._)`${b}(${n}[${y}], ${n}[${m}])`,()=>{e.error(),t.assign(l,!1).break(g)})))}}};Bw.default=Ene;var Vw={};Object.defineProperty(Vw,"__esModule",{value:!0});const R0=Ue,Cne=ge,Nne=Ld,jne={message:"must be equal to constant",params:({schemaCode:e})=>(0,R0._)`{allowedValue: ${e}}`},Tne={keyword:"const",$data:!0,error:jne,code(e){const{gen:t,data:n,$data:r,schemaCode:a,schema:i}=e;r||i&&typeof i=="object"?e.fail$data((0,R0._)`!${(0,Cne.useFunc)(t,Nne.default)}(${n}, ${a})`):e.fail((0,R0._)`${i} !== ${n}`)}};Vw.default=Tne;var Kw={};Object.defineProperty(Kw,"__esModule",{value:!0});const tu=Ue,Ane=ge,Rne=Ld,$ne={message:"must be equal to one of the allowed values",params:({schemaCode:e})=>(0,tu._)`{allowedValues: ${e}}`},One={keyword:"enum",schemaType:"array",$data:!0,error:$ne,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,Ane.useFunc)(t,Rne.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,tu.or)(...a.map((y,m)=>p(h,m)))}e.pass(d);function f(){t.assign(d,!1),t.forOf("v",i,h=>t.if((0,tu._)`${u()}(${n}, ${h})`,()=>t.assign(d,!0).break()))}function p(h,y){const m=a[y];return typeof m=="object"&&m!==null?(0,tu._)`${u()}(${n}, ${h}[${y}])`:(0,tu._)`${n} === ${m}`}}};Kw.default=One;Object.defineProperty(Pw,"__esModule",{value:!0});const Mne=Dw,Pne=zw,Dne=Iw,zne=Uw,Ine=Fw,Lne=qw,Une=Hw,Fne=Bw,qne=Vw,Hne=Kw,Bne=[Mne.default,Pne.default,Dne.default,zne.default,Ine.default,Lne.default,Une.default,Fne.default,{keyword:"type",schemaType:["string","array"]},{keyword:"nullable",schemaType:"boolean"},qne.default,Hne.default];Pw.default=Bne;var Zw={},Ec={};Object.defineProperty(Ec,"__esModule",{value:!0});Ec.validateAdditionalItems=void 0;const Us=Ue,$0=ge,Vne={message:({params:{len:e}})=>(0,Us.str)`must NOT have more than ${e} items`,params:({params:{len:e}})=>(0,Us._)`{limit: ${e}}`},Kne={keyword:"additionalItems",type:"array",schemaType:["boolean","object"],before:"uniqueItems",error:Vne,code(e){const{parentSchema:t,it:n}=e,{items:r}=t;if(!Array.isArray(r)){(0,$0.checkStrictMode)(n,'"additionalItems" is ignored when "items" is not an array of schemas');return}yP(e,r)}};function yP(e,t){const{gen:n,schema:r,data:a,keyword:i,it:s}=e;s.items=!0;const o=n.const("len",(0,Us._)`${a}.length`);if(r===!1)e.setParams({len:t.length}),e.pass((0,Us._)`${o} <= ${t.length}`);else if(typeof r=="object"&&!(0,$0.alwaysValidSchema)(s,r)){const u=n.var("valid",(0,Us._)`${o} <= ${t.length}`);n.if((0,Us.not)(u),()=>l(u)),e.ok(u)}function l(u){n.forRange("i",t.length,o,d=>{e.subschema({keyword:i,dataProp:d,dataPropType:$0.Type.Num},u),s.allErrors||n.if((0,Us.not)(u),()=>n.break())})}}Ec.validateAdditionalItems=yP;Ec.default=Kne;var Gw={},Cc={};Object.defineProperty(Cc,"__esModule",{value:!0});Cc.validateTuple=void 0;const DE=Ue,ch=ge,Zne=aa(),Gne={keyword:"items",type:"array",schemaType:["object","array","boolean"],before:"uniqueItems",code(e){const{schema:t,it:n}=e;if(Array.isArray(t))return vP(e,"additionalItems",t);n.items=!0,!(0,ch.alwaysValidSchema)(n,t)&&e.ok((0,Zne.validateArray)(e))}};function vP(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=ch.mergeEvaluated.items(r,n.length,o.items));const l=r.name("valid"),u=r.const("len",(0,DE._)`${i}.length`);n.forEach((f,p)=>{(0,ch.alwaysValidSchema)(o,f)||(r.if((0,DE._)`${u} > ${p}`,()=>e.subschema({keyword:s,schemaProp:p,dataProp:p},l)),e.ok(l))});function d(f){const{opts:p,errSchemaPath:h}=o,y=n.length,m=y===f.minItems&&(y===f.maxItems||f[t]===!1);if(p.strictTuples&&!m){const b=`"${s}" is ${y}-tuple, but minItems or maxItems/${t} are not specified or different at path "${h}"`;(0,ch.checkStrictMode)(o,b,p.strictTuples)}}}Cc.validateTuple=vP;Cc.default=Gne;Object.defineProperty(Gw,"__esModule",{value:!0});const Qne=Cc,Yne={keyword:"prefixItems",type:"array",schemaType:["array"],before:"uniqueItems",code:e=>(0,Qne.validateTuple)(e,"items")};Gw.default=Yne;var Qw={};Object.defineProperty(Qw,"__esModule",{value:!0});const zE=Ue,Xne=ge,Wne=aa(),Jne=Ec,ere={message:({params:{len:e}})=>(0,zE.str)`must NOT have more than ${e} items`,params:({params:{len:e}})=>(0,zE._)`{limit: ${e}}`},tre={keyword:"items",type:"array",schemaType:["object","boolean"],before:"uniqueItems",error:ere,code(e){const{schema:t,parentSchema:n,it:r}=e,{prefixItems:a}=n;r.items=!0,!(0,Xne.alwaysValidSchema)(r,t)&&(a?(0,Jne.validateAdditionalItems)(e,a):e.ok((0,Wne.validateArray)(e)))}};Qw.default=tre;var Yw={};Object.defineProperty(Yw,"__esModule",{value:!0});const Er=Ue,Nf=ge,nre={message:({params:{min:e,max:t}})=>t===void 0?(0,Er.str)`must contain at least ${e} valid item(s)`:(0,Er.str)`must contain at least ${e} and no more than ${t} valid item(s)`,params:({params:{min:e,max:t}})=>t===void 0?(0,Er._)`{minContains: ${e}}`:(0,Er._)`{minContains: ${e}, maxContains: ${t}}`},rre={keyword:"contains",type:"array",schemaType:["object","boolean"],before:"uniqueItems",trackErrors:!0,error:nre,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,Er._)`${a}.length`);if(e.setParams({min:s,max:o}),o===void 0&&s===0){(0,Nf.checkStrictMode)(i,'"minContains" == 0 without "maxContains": "contains" keyword ignored');return}if(o!==void 0&&s>o){(0,Nf.checkStrictMode)(i,'"minContains" > "maxContains" is always invalid'),e.fail();return}if((0,Nf.alwaysValidSchema)(i,n)){let m=(0,Er._)`${d} >= ${s}`;o!==void 0&&(m=(0,Er._)`${m} && ${d} <= ${o}`),e.pass(m);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,Er._)`${a}.length > 0`,p)):(t.let(f,!1),p()),e.result(f,()=>e.reset());function p(){const m=t.name("_valid"),b=t.let("count",0);h(m,()=>t.if(m,()=>y(b)))}function h(m,b){t.forRange("i",0,d,g=>{e.subschema({keyword:"contains",dataProp:g,dataPropType:Nf.Type.Num,compositeRule:!0},m),b()})}function y(m){t.code((0,Er._)`${m}++`),o===void 0?t.if((0,Er._)`${m} >= ${s}`,()=>t.assign(f,!0).break()):(t.if((0,Er._)`${m} > ${o}`,()=>t.assign(f,!1).break()),s===1?t.assign(f,!0):t.if((0,Er._)`${m} >= ${s}`,()=>t.assign(f,!0)))}}};Yw.default=rre;var bP={};(function(e){Object.defineProperty(e,"__esModule",{value:!0}),e.validateSchemaDeps=e.validatePropertyDeps=e.error=void 0;const t=Ue,n=ge,r=aa();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 p=Array.isArray(l[f])?u:d;p[f]=l[f]}return[u,d]}function s(l,u=l.schema){const{gen:d,data:f,it:p}=l;if(Object.keys(u).length===0)return;const h=d.let("missing");for(const y in u){const m=u[y];if(m.length===0)continue;const b=(0,r.propertyInData)(d,f,y,p.opts.ownProperties);l.setParams({property:y,depsCount:m.length,deps:m.join(", ")}),p.allErrors?d.if(b,()=>{for(const g of m)(0,r.checkReportMissingProp)(l,g)}):(d.if((0,t._)`${b} && (${(0,r.checkMissingProp)(l,m,h)})`),(0,r.reportMissingProp)(l,h),d.else())}}e.validatePropertyDeps=s;function o(l,u=l.schema){const{gen:d,data:f,keyword:p,it:h}=l,y=d.name("valid");for(const m in u)(0,n.alwaysValidSchema)(h,u[m])||(d.if((0,r.propertyInData)(d,f,m,h.opts.ownProperties),()=>{const b=l.subschema({keyword:p,schemaProp:m},y);l.mergeValidEvaluated(b,y)},()=>d.var(y,!0)),l.ok(y))}e.validateSchemaDeps=o,e.default=a})(bP);var Xw={};Object.defineProperty(Xw,"__esModule",{value:!0});const xP=Ue,are=ge,ire={message:"property name must be valid",params:({params:e})=>(0,xP._)`{propertyName: ${e.propertyName}}`},sre={keyword:"propertyNames",type:"object",schemaType:["object","boolean"],error:ire,code(e){const{gen:t,schema:n,data:r,it:a}=e;if((0,are.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,xP.not)(i),()=>{e.error(!0),a.allErrors||t.break()})}),e.ok(i)}};Xw.default=sre;var Rm={};Object.defineProperty(Rm,"__esModule",{value:!0});const jf=aa(),Br=Ue,ore=Na,Tf=ge,lre={message:"must NOT have additional properties",params:({params:e})=>(0,Br._)`{additionalProperty: ${e.additionalProperty}}`},cre={keyword:"additionalProperties",type:["object"],schemaType:["boolean","object"],allowUndefined:!0,trackErrors:!0,error:lre,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,Tf.alwaysValidSchema)(s,n))return;const u=(0,jf.allSchemaProperties)(r.properties),d=(0,jf.allSchemaProperties)(r.patternProperties);f(),e.ok((0,Br._)`${i} === ${ore.default.errors}`);function f(){t.forIn("key",a,b=>{!u.length&&!d.length?y(b):t.if(p(b),()=>y(b))})}function p(b){let g;if(u.length>8){const v=(0,Tf.schemaRefOrVal)(s,r.properties,"properties");g=(0,jf.isOwnProperty)(t,v,b)}else u.length?g=(0,Br.or)(...u.map(v=>(0,Br._)`${b} === ${v}`)):g=Br.nil;return d.length&&(g=(0,Br.or)(g,...d.map(v=>(0,Br._)`${(0,jf.usePattern)(e,v)}.test(${b})`))),(0,Br.not)(g)}function h(b){t.code((0,Br._)`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,Tf.alwaysValidSchema)(s,n)){const g=t.name("valid");l.removeAdditional==="failing"?(m(b,g,!1),t.if((0,Br.not)(g),()=>{e.reset(),h(b)})):(m(b,g),o||t.if((0,Br.not)(g),()=>t.break()))}}function m(b,g,v){const x={keyword:"additionalProperties",dataProp:b,dataPropType:Tf.Type.Str};v===!1&&Object.assign(x,{compositeRule:!0,createErrors:!1,allErrors:!1}),e.subschema(x,g)}}};Rm.default=cre;var Ww={};Object.defineProperty(Ww,"__esModule",{value:!0});const ure=Nm(),IE=aa(),cy=ge,LE=Rm,dre={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&&LE.default.code(new ure.KeywordCxt(i,LE.default,"additionalProperties"));const s=(0,IE.allSchemaProperties)(n);for(const f of s)i.definedProperties.add(f);i.opts.unevaluated&&s.length&&i.props!==!0&&(i.props=cy.mergeEvaluated.props(t,(0,cy.toHash)(s),i.props));const o=s.filter(f=>!(0,cy.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,IE.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)}}};Ww.default=dre;var Jw={};Object.defineProperty(Jw,"__esModule",{value:!0});const UE=aa(),Af=Ue,FE=ge,qE=ge,fre={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,UE.allSchemaProperties)(n),l=o.filter(m=>(0,FE.alwaysValidSchema)(i,n[m]));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 Af.Name)&&(i.props=(0,qE.evaluatedPropsToName)(t,i.props));const{props:f}=i;p();function p(){for(const m of o)u&&h(m),i.allErrors?y(m):(t.var(d,!0),y(m),t.if(d))}function h(m){for(const b in u)new RegExp(m).test(b)&&(0,FE.checkStrictMode)(i,`property ${b} matches pattern ${m} (use allowMatchingProperties)`)}function y(m){t.forIn("key",r,b=>{t.if((0,Af._)`${(0,UE.usePattern)(e,m)}.test(${b})`,()=>{const g=l.includes(m);g||e.subschema({keyword:"patternProperties",schemaProp:m,dataProp:b,dataPropType:qE.Type.Str},d),i.opts.unevaluated&&f!==!0?t.assign((0,Af._)`${f}[${b}]`,!0):!g&&!i.allErrors&&t.if((0,Af.not)(d),()=>t.break())})})}}};Jw.default=fre;var e1={};Object.defineProperty(e1,"__esModule",{value:!0});const hre=ge,pre={keyword:"not",schemaType:["object","boolean"],trackErrors:!0,code(e){const{gen:t,schema:n,it:r}=e;if((0,hre.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"}};e1.default=pre;var t1={};Object.defineProperty(t1,"__esModule",{value:!0});const mre=aa(),gre={keyword:"anyOf",schemaType:"array",trackErrors:!0,code:mre.validateUnion,error:{message:"must match a schema in anyOf"}};t1.default=gre;var n1={};Object.defineProperty(n1,"__esModule",{value:!0});const uh=Ue,yre=ge,vre={message:"must match exactly one schema in oneOf",params:({params:e})=>(0,uh._)`{passingSchemas: ${e.passing}}`},bre={keyword:"oneOf",schemaType:"array",trackErrors:!0,error:vre,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 p;(0,yre.alwaysValidSchema)(a,d)?t.var(l,!0):p=e.subschema({keyword:"oneOf",schemaProp:f,compositeRule:!0},l),f>0&&t.if((0,uh._)`${l} && ${s}`).assign(s,!1).assign(o,(0,uh._)`[${o}, ${f}]`).else(),t.if(l,()=>{t.assign(s,!0),t.assign(o,f),p&&e.mergeEvaluated(p,uh.Name)})})}}};n1.default=bre;var r1={};Object.defineProperty(r1,"__esModule",{value:!0});const xre=ge,wre={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,xre.alwaysValidSchema)(r,i))return;const o=e.subschema({keyword:"allOf",schemaProp:s},a);e.ok(a),e.mergeEvaluated(o)})}};r1.default=wre;var a1={};Object.defineProperty(a1,"__esModule",{value:!0});const Cp=Ue,wP=ge,Sre={message:({params:e})=>(0,Cp.str)`must match "${e.ifClause}" schema`,params:({params:e})=>(0,Cp._)`{failingKeyword: ${e.ifClause}}`},_re={keyword:"if",schemaType:["object","boolean"],trackErrors:!0,error:Sre,code(e){const{gen:t,parentSchema:n,it:r}=e;n.then===void 0&&n.else===void 0&&(0,wP.checkStrictMode)(r,'"if" without "then" and "else" is ignored');const a=HE(r,"then"),i=HE(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,Cp.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 p=e.subschema({keyword:d},o);t.assign(s,o),e.mergeValidEvaluated(p,s),f?t.assign(f,(0,Cp._)`${d}`):e.setParams({ifClause:d})}}}};function HE(e,t){const n=e.schema[t];return n!==void 0&&!(0,wP.alwaysValidSchema)(e,n)}a1.default=_re;var i1={};Object.defineProperty(i1,"__esModule",{value:!0});const kre=ge,Ere={keyword:["then","else"],schemaType:["object","boolean"],code({keyword:e,parentSchema:t,it:n}){t.if===void 0&&(0,kre.checkStrictMode)(n,`"${e}" without "if" is ignored`)}};i1.default=Ere;Object.defineProperty(Zw,"__esModule",{value:!0});const Cre=Ec,Nre=Gw,jre=Cc,Tre=Qw,Are=Yw,Rre=bP,$re=Xw,Ore=Rm,Mre=Ww,Pre=Jw,Dre=e1,zre=t1,Ire=n1,Lre=r1,Ure=a1,Fre=i1;function qre(e=!1){const t=[Dre.default,zre.default,Ire.default,Lre.default,Ure.default,Fre.default,$re.default,Ore.default,Rre.default,Mre.default,Pre.default];return e?t.push(Nre.default,Tre.default):t.push(Cre.default,jre.default),t.push(Are.default),t}Zw.default=qre;var s1={},o1={};Object.defineProperty(o1,"__esModule",{value:!0});const Ut=Ue,Hre={message:({schemaCode:e})=>(0,Ut.str)`must match format "${e}"`,params:({schemaCode:e})=>(0,Ut._)`{format: ${e}}`},Bre={keyword:"format",type:["number","string"],schemaType:"string",$data:!0,error:Hre,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?p():h();function p(){const y=n.scopeValue("formats",{ref:f.formats,code:l.code.formats}),m=n.const("fDef",(0,Ut._)`${y}[${s}]`),b=n.let("fType"),g=n.let("format");n.if((0,Ut._)`typeof ${m} == "object" && !(${m} instanceof RegExp)`,()=>n.assign(b,(0,Ut._)`${m}.type || "string"`).assign(g,(0,Ut._)`${m}.validate`),()=>n.assign(b,(0,Ut._)`"string"`).assign(g,m)),e.fail$data((0,Ut.or)(v(),x()));function v(){return l.strictSchema===!1?Ut.nil:(0,Ut._)`${s} && !${g}`}function x(){const S=d.$async?(0,Ut._)`(${m}.async ? await ${g}(${r}) : ${g}(${r}))`:(0,Ut._)`${g}(${r})`,k=(0,Ut._)`(typeof ${g} == "function" ? ${S} : ${g}.test(${r}))`;return(0,Ut._)`${g} && ${g} !== true && ${b} === ${t} && !${k}`}}function h(){const y=f.formats[i];if(!y){v();return}if(y===!0)return;const[m,b,g]=x(y);m===t&&e.pass(S());function v(){if(l.strictSchema===!1){f.logger.warn(k());return}throw new Error(k());function k(){return`unknown format "${i}" ignored in schema at path "${u}"`}}function x(k){const C=k instanceof RegExp?(0,Ut.regexpCode)(k):l.code.formats?(0,Ut._)`${l.code.formats}${(0,Ut.getProperty)(i)}`:void 0,N=n.scopeValue("formats",{key:i,ref:k,code:C});return typeof k=="object"&&!(k instanceof RegExp)?[k.type||"string",k.validate,(0,Ut._)`${N}.validate`]:["string",k,N]}function S(){if(typeof y=="object"&&!(y instanceof RegExp)&&y.async){if(!d.$async)throw new Error("async format in sync schema");return(0,Ut._)`await ${g}(${r})`}return typeof b=="function"?(0,Ut._)`${g}(${r})`:(0,Ut._)`${g}.test(${r})`}}}};o1.default=Bre;Object.defineProperty(s1,"__esModule",{value:!0});const Vre=o1,Kre=[Vre.default];s1.default=Kre;var rc={};Object.defineProperty(rc,"__esModule",{value:!0});rc.contentVocabulary=rc.metadataVocabulary=void 0;rc.metadataVocabulary=["title","description","default","deprecated","readOnly","writeOnly","examples"];rc.contentVocabulary=["contentMediaType","contentEncoding","contentSchema"];Object.defineProperty($w,"__esModule",{value:!0});const Zre=Ow,Gre=Pw,Qre=Zw,Yre=s1,BE=rc,Xre=[Zre.default,Gre.default,(0,Qre.default)(),Yre.default,BE.metadataVocabulary,BE.contentVocabulary];$w.default=Xre;var l1={},$m={};Object.defineProperty($m,"__esModule",{value:!0});$m.DiscrError=void 0;var VE;(function(e){e.Tag="tag",e.Mapping="mapping"})(VE||($m.DiscrError=VE={}));Object.defineProperty(l1,"__esModule",{value:!0});const Zo=Ue,O0=$m,KE=Xn,Wre=_c,Jre=ge,eae={message:({params:{discrError:e,tagName:t}})=>e===O0.DiscrError.Tag?`tag "${t}" must be string`:`value of tag "${t}" must be in oneOf`,params:({params:{discrError:e,tag:t,tagName:n}})=>(0,Zo._)`{error: ${e}, tag: ${n}, tagValue: ${t}}`},tae={keyword:"discriminator",type:"object",schemaType:"object",error:eae,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,Zo._)`${n}${(0,Zo.getProperty)(o)}`);t.if((0,Zo._)`typeof ${u} == "string"`,()=>d(),()=>e.error(!1,{discrError:O0.DiscrError.Tag,tag:u,tagName:o})),e.ok(l);function d(){const h=p();t.if(!1);for(const y in h)t.elseIf((0,Zo._)`${u} === ${y}`),t.assign(l,f(h[y]));t.else(),e.error(!1,{discrError:O0.DiscrError.Mapping,tag:u,tagName:o}),t.endIf()}function f(h){const y=t.name("valid"),m=e.subschema({keyword:"oneOf",schemaProp:h},y);return e.mergeEvaluated(m,Zo.Name),y}function p(){var h;const y={},m=g(a);let b=!0;for(let S=0;S<s.length;S++){let k=s[S];if(k!=null&&k.$ref&&!(0,Jre.schemaHasRulesButRef)(k,i.self.RULES)){const N=k.$ref;if(k=KE.resolveRef.call(i.self,i.schemaEnv.root,i.baseId,N),k instanceof KE.SchemaEnv&&(k=k.schema),k===void 0)throw new Wre.default(i.opts.uriResolver,i.baseId,N)}const C=(h=k==null?void 0:k.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&&(m||g(k)),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,k){if(S.const)x(S.const,k);else if(S.enum)for(const C of S.enum)x(C,k);else throw new Error(`discriminator: "properties/${o}" must have "const" or "enum"`)}function x(S,k){if(typeof S!="string"||S in y)throw new Error(`discriminator: "${o}" values must be unique strings`);y[S]=k}}}};l1.default=tae;const nae="http://json-schema.org/draft-07/schema#",rae="http://json-schema.org/draft-07/schema#",aae="Core schema meta-schema",iae={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:[]}},sae=["object","boolean"],oae={$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:"#"}},lae={$schema:nae,$id:rae,title:aae,definitions:iae,type:sae,properties:oae,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=OM,r=$w,a=l1,i=lae,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=Nm();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=Id;Object.defineProperty(t,"ValidationError",{enumerable:!0,get:function(){return f.default}});var p=_c;Object.defineProperty(t,"MissingRefError",{enumerable:!0,get:function(){return p.default}})})(E0,E0.exports);var SP=E0.exports;const cae=ac(SP);var M0={exports:{}},_P={};(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(p(!0),h),"iso-time":t(l(),d),"iso-date-time":t(p(),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:x,int32:{type:"number",validate:C},int64:{type:"number",validate:N},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,T=+(D[6]||0),q=+(D[7]||0);if(T>23||q>59||j&&!F)return!1;if(A<=23&&B<=59&&Z<60)return!0;const G=B-q*J,_=A-T*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 p(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 m=/\/|:/,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 m.test(j)&&b.test(j)}const v=/^(?:[A-Za-z0-9+/]{4})*(?:[A-Za-z0-9+/]{2}==|[A-Za-z0-9+/]{3}=)?$/gm;function x(j){return v.lastIndex=0,v.test(j)}const S=-2147483648,k=2**31-1;function C(j){return Number.isInteger(j)&&j<=k&&j>=S}function N(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}}})(_P);var kP={};(function(e){Object.defineProperty(e,"__esModule",{value:!0}),e.formatLimitDefinition=void 0;const t=SP,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:p}=o,{opts:h,self:y}=p;if(!h.validateFormats)return;const m=new t.KeywordCxt(p,y.RULES.all.format.definition,"format");m.$data?b():g();function b(){const x=l.scopeValue("formats",{ref:y.formats,code:h.code.formats}),S=l.const("fmt",(0,n._)`${x}[${m.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 x=m.schema,S=y.formats[x];if(!S||S===!0)return;if(typeof S!="object"||S instanceof RegExp||typeof S.compare!="function")throw new Error(`"${f}": format "${x}" does not define "compare" function`);const k=l.scopeValue("formats",{key:x,ref:S,code:h.code.formats?(0,n._)`${h.code.formats}${(0,n.getProperty)(x)}`:void 0});o.fail$data(v(k))}function v(x){return(0,n._)`${x}.compare(${u}, ${d}) ${a[f].fail} 0`}},dependencies:["format"]};const s=o=>(o.addKeyword(e.formatLimitDefinition),o);e.default=s})(kP);(function(e,t){Object.defineProperty(t,"__esModule",{value:!0});const n=_P,r=kP,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,p]=d.mode==="fast"?[n.fastFormats,s]:[n.fullFormats,i],h=d.formats||n.formatNames;return l(u,h,f,p),d.keywords&&(0,r.default)(u),u};o.get=(u,d="full")=>{const p=(d==="fast"?n.fastFormats:n.fullFormats)[u];if(!p)throw new Error(`Unknown format "${u}"`);return p};function l(u,d,f,p){var h,y;(h=(y=u.opts.code).formats)!==null&&h!==void 0||(y.formats=(0,a._)`require("ajv-formats/dist/formats").${p}`);for(const m of d)u.addFormat(m,f[m])}e.exports=t=o,Object.defineProperty(t,"__esModule",{value:!0}),t.default=o})(M0,M0.exports);var uae=M0.exports;const dae=ac(uae);function fae(){const e=new cae({strict:!1,validateFormats:!0,validateSchema:!1,allErrors:!0});return dae(e),e}class hae{constructor(t){this._ajv=t??fae()}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 pae{constructor(t){this._client=t}async*callToolStream(t,n=Dd,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 mae(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 gae(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 dh(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&&dh(i,n[a])}}if(Array.isArray(e.anyOf))for(const n of e.anyOf)typeof n!="boolean"&&dh(n,t);if(Array.isArray(e.oneOf))for(const n of e.oneOf)typeof n!="boolean"&&dh(n,t)}}function yae(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 vae extends XJ{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 hae,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",gM,t.tools,async()=>(await this.listTools()).tools),t.prompts&&((i=(a=this._serverCapabilities)==null?void 0:a.prompts)!=null&&i.listChanged)&&this._setupListChangedHandler("prompts",pM,t.prompts,async()=>(await this.listPrompts()).prompts),t.resources&&((o=(s=this._serverCapabilities)==null?void 0:s.resources)!=null&&o.listChanged)&&this._setupListChangedHandler("resources",hM,t.resources,async()=>(await this.listResources()).resources)}get experimental(){return this._experimental||(this._experimental={tasks:new pae(this)}),this._experimental}registerCapabilities(t){if(this.transport)throw new Error("Cannot register capabilities after connecting to transport");this._capabilities=WJ(this._capabilities,t)}setRequestHandler(t,n){var o;const r=$M(t),a=r==null?void 0:r.method;if(!a)throw new Error("Schema is missing a method literal");let i;if(Cm(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 x,S;const f=Ti(wM,u);if(!f.success){const k=f.error instanceof Error?f.error.message:String(f.error);throw new Ne(Oe.InvalidParams,`Invalid elicitation request: ${k}`)}const{params:p}=f.data;p.mode=p.mode??"form";const{supportsFormMode:h,supportsUrlMode:y}=yae(this._capabilities.elicitation);if(p.mode==="form"&&!h)throw new Ne(Oe.InvalidParams,"Client does not support form-mode elicitation requests");if(p.mode==="url"&&!y)throw new Ne(Oe.InvalidParams,"Client does not support URL-mode elicitation requests");const m=await Promise.resolve(n(u,d));if(p.task){const k=Ti(Wu,m);if(!k.success){const C=k.error instanceof Error?k.error.message:String(k.error);throw new Ne(Oe.InvalidParams,`Invalid task creation result: ${C}`)}return k.data}const b=Ti(SM,m);if(!b.success){const k=b.error instanceof Error?b.error.message:String(b.error);throw new Ne(Oe.InvalidParams,`Invalid elicitation result: ${k}`)}const g=b.data,v=p.mode==="form"?p.requestedSchema:void 0;if(p.mode==="form"&&g.action==="accept"&&g.content&&v&&(S=(x=this._capabilities.elicitation)==null?void 0:x.form)!=null&&S.applyDefaults)try{dh(v,g.content)}catch{}return g};return super.setRequestHandler(t,l)}if(s==="sampling/createMessage"){const l=async(u,d)=>{const f=Ti(vM,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:p}=f.data,h=await Promise.resolve(n(u,d));if(p.task){const g=Ti(Wu,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 m=p.tools||p.toolChoice?xM:bM,b=Ti(m,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:_m,capabilities:this._capabilities,clientInfo:this._clientInfo}},sM,n);if(r===void 0)throw new Error(`Server sent invalid initialize result: ${r}`);if(!TX.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;mae((r=(n=this._serverCapabilities)==null?void 0:n.tasks)==null?void 0:r.requests,t,"Server")}assertTaskHandlerCapability(t){var n;this._capabilities&&gae((n=this._capabilities.tasks)==null?void 0:n.requests,t,"Client")}async ping(t){return this.request({method:"ping"},ol,t)}async complete(t,n){return this.request({method:"completion/complete",params:t},_M,n)}async setLoggingLevel(t,n){return this.request({method:"logging/setLevel",params:{level:t}},ol,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},fp,n)}async listResources(t,n){return this.request({method:"resources/list",params:t},dp,n)}async listResourceTemplates(t,n){return this.request({method:"resources/templates/list",params:t},fM,n)}async readResource(t,n){return this.request({method:"resources/read",params:t},cw,n)}async subscribeResource(t,n){return this.request({method:"resources/subscribe",params:t},ol,n)}async unsubscribeResource(t,n){return this.request({method:"resources/unsubscribe",params:t},ol,n)}async callTool(t,n=Dd,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},mw,n);return this.cacheToolMetadata(r.tools),r}_setupListChangedHandler(t,n,r,a){const i=_W.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 p=f instanceof Error?f:new Error(String(f));l(p,null)}},d=()=>{if(o){const f=this._listChangedDebounceTimers.get(t);f&&clearTimeout(f);const p=setTimeout(u,o);this._listChangedDebounceTimers.set(t,p)}else u()};this.setNotificationHandler(n,d)}async sendRootsListChanged(){return this.notification({method:"notifications/roots/list_changed"})}}function Hc(e,t){if(!e)throw new Error(t)}var ZE=3e3,bae=5e3,uy=5*60*1e3;function xae(e){const{url:t,clientName:n,clientUri:r,callbackUrl:a=typeof window<"u"?sl(new URL("/oauth/callback",window.location.origin).toString()):"/oauth/callback",storageKeyPrefix:i="mcp:auth",clientConfig:s={},customHeaders:o={},autoRetry:l=!1,autoReconnect:u=ZE,transportType:d="auto",preventAutoAuth:f=!1,onPopupWindow:p}=e,[h,y]=w.useState("discovering"),[m,b]=w.useState([]),[g,v]=w.useState([]),[x,S]=w.useState([]),[k,C]=w.useState([]),[N,P]=w.useState(void 0),[R,$]=w.useState([]),[j,O]=w.useState(void 0),z=w.useRef(null),D=w.useRef(null),A=w.useRef(null),B=w.useRef(!1),Z=w.useRef(!0),F=w.useRef(0),J=w.useRef(null),T=w.useRef(h),q=w.useRef(u),G=w.useRef(null);w.useEffect(()=>{T.current=h,q.current=u},[h,u]);const _=w.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()}])},[]),E=w.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=w.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=w.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 Kk(t,{storageKeyPrefix:i,clientName:n,clientUri:r,callbackUrl:a,preventAutoAuth:f,onPopupWindow:p}),_("debug","BrowserOAuthClientProvider initialized in connect.")),z.current||(z.current=new vae({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...`),T.current!=="authenticating"&&y("connecting");let Ae;try{Hc(A.current,"Auth Provider must be initialized"),Hc(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=sl(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 GJ(Ce,ce),_("debug","StreamableHTTPClientTransport created successfully")):(_("debug","Creating SSEClientTransport..."),Ae=new VJ(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=T.current,we=q.current;if(ce==="ready"&&we){const Ce=typeof we=="number"?we:ZE;_("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"},mw);let we={resources:[],resourceTemplates:[]};try{we=await z.current.request({method:"resources/list"},dp)}catch(ht){_("debug","Server does not support resources/list method",ht)}let Ce={prompts:[]};try{Ce=await z.current.request({method:"prompts/list"},fp)}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"),Lt=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||Lt||gt))return _("warn",`HTTP transport failed (${gt?"CORS":ht?"404":"405"}).`),"fallback";if(we instanceof lr||Ce.includes("Unauthorized")||Ce.includes("401")){_("info","Authentication required."),Hc(A.current,"Auth Provider not available for auth flow");const rr=await A.current.tokens();if(f&&!rr)return _("info","Authentication required but auto-auth prevented. User action needed."),y("pending_auth"),"auth_redirect";T.current!=="authenticating"&&T.current!=="pending_auth"&&(y("authenticating"),J.current&&clearTimeout(J.current),J.current=setTimeout(()=>{},uy));try{const Y=await Wr(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&&T.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,E,Wr,t,i,n,r,a,s.name,s.version]),Q=w.useCallback(async(K,re)=>{if(T.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}},Dd);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 lr||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(()=>{},uy);try{Hc(A.current,"Auth Provider not available for tool re-auth");const ce=await Wr(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(T.current!=="authenticating")throw ae;return}},[h,t,_,M,I]),W=w.useCallback(()=>{T.current==="failed"?(_("info","Retry requested..."),I()):_("warn",`Retry called but state is not 'failed' (state: ${T.current}). Ignoring.`)},[_,I]),oe=w.useCallback(async()=>{var re;_("info","Manual authentication requested...");const K=T.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(()=>{},uy);try{Hc(A.current,"Auth Provider not available for manual auth");const ae=await Wr(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=w.useCallback(()=>{if(A.current){const K=A.current.clearStorage();_("info",`Cleared ${K} item(s) from localStorage for ${t}.`),O(void 0),E()}else _("warn","Auth provider not initialized, cannot clear storage.")},[t,_,E]),L=w.useCallback(async()=>{if(T.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"},dp);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=w.useCallback(async K=>{if(T.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}},cw);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=w.useCallback(async()=>{if(T.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"},fp);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=w.useCallback(async(K,re)=>{if(T.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 w.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]),w.useEffect(()=>(Z.current=!0,_("debug","useMcp mounted, initiating connection."),F.current=0,(!A.current||A.current.serverUrl!==t)&&(A.current=new Kk(t,{storageKeyPrefix:i,clientName:n,clientUri:r,callbackUrl:a,preventAutoAuth:f,onPopupWindow:p}),_("debug","BrowserOAuthClientProvider initialized/updated on mount/option change.")),I(),()=>{Z.current=!1,_("debug","useMcp unmounting, disconnecting."),E(!0)}),[t,i,a,n,r,s.name,s.version,I,E]),w.useEffect(()=>{let K=null;if(h==="failed"&&l&&F.current>0){const re=typeof l=="number"?l:bae;_("info",`Connection failed, auto-retrying in ${re}ms...`),K=setTimeout(()=>{Z.current&&T.current==="failed"&&W()},re)}return()=>{K&&clearTimeout(K)}},[h,l,W,_]),{state:h,tools:m,resources:g,resourceTemplates:x,prompts:k,error:N,log:R,authUrl:j,callTool:Q,listResources:L,readResource:V,listPrompts:X,getPrompt:ne,retry:W,disconnect:E,authenticate:oe,clearStorage:de}}function wae({service:e,autoConnect:t=!1,onConnected:n,onError:r}){const{toast:a}=tn(),{state:i,tools:s,resources:o,prompts:l,error:u,authUrl:d,callTool:f,readResource:p,listResources:h,getPrompt:y,listPrompts:m,retry:b,disconnect:g,authenticate:v,clearStorage:x}=xae({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",k=i==="connecting"||i==="loading",C=i==="authenticating"||i==="pending_auth",N=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(()=>{N&&u&&r&&(r(u),a({title:"MCP connection failed",description:u,variant:"destructive"}))},[N,u,r,a]),{isConnected:S,isConnecting:k,isAuthenticating:C,hasError:N,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 p(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 m()}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:x}}function Sae(){const[e,t]=w.useState("https://api.githubcopilot.com/mcp"),[n,r]=w.useState("get_me"),[a,i]=w.useState("{}"),[s,o]=w.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:p,error:h,tools:y,resources:m,prompts:b,connect:g,disconnect:v,retry:x,authenticate:S,callTool:k,authUrl:C,clearStorage:N}=wae({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:p_,color:"text-yellow-500"}:f?{status:"authenticating",icon:of,color:"text-blue-500"}:u?{status:"connected",icon:Ev,color:"text-green-500"}:p?{status:"error",icon:f_,color:"text-red-500"}:{status:"disconnected",icon:f_,color:"text-gray-500"},$=async()=>{try{let j={};a.trim()&&(j=JSON.parse(a));const O=await k(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(qa,{children:[c.jsxs(Ni,{children:[c.jsxs(ji,{className:"flex items-center gap-2",children:[c.jsx(R.icon,{className:`w-5 h-5 ${R.color}`}),"Connection Status: ",R.status]}),c.jsx(Su,{children:"Current connection state and available actions"})]}),c.jsxs(Ha,{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(Ge,{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"}),p&&c.jsxs(le,{onClick:x,variant:"outline",children:[c.jsx(p_,{className:"w-4 h-4 mr-1"}),"Retry"]}),C&&!u&&c.jsxs(le,{onClick:S,variant:"outline",children:[c.jsx(of,{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(hT,{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(qa,{children:[c.jsx(Ni,{children:c.jsxs(ji,{className:"flex items-center gap-2",children:[c.jsx(Gb,{className:"w-4 h-4"}),"Tools (",y.length,")"]})}),c.jsx(Ha,{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(hn,{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(qa,{children:[c.jsx(Ni,{children:c.jsxs(ji,{children:["Resources (",m.length,")"]})}),c.jsx(Ha,{children:c.jsx("p",{className:"text-sm text-muted-foreground",children:u?`${m.length} resources available`:"Connect to see resources"})})]}),c.jsxs(qa,{children:[c.jsx(Ni,{children:c.jsxs(ji,{children:["Prompts (",b.length,")"]})}),c.jsx(Ha,{children:c.jsx("p",{className:"text-sm text-muted-foreground",children:u?`${b.length} prompts available`:"Connect to see prompts"})})]})]}),u&&c.jsxs(qa,{children:[c.jsxs(Ni,{children:[c.jsx(ji,{children:"Test Tool Call"}),c.jsx(Su,{children:"Test calling a tool on the connected MCP service"})]}),c.jsxs(Ha,{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(Ge,{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(Ge,{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(BI,{className:"w-4 h-4 mr-1"}),"Call Tool"]}),s&&c.jsxs("div",{className:"space-y-2",children:[c.jsx(Ge,{children:"Result"}),c.jsx(Ga,{value:s,readOnly:!0,rows:10,className:"font-mono text-sm"})]})]})]}),C&&c.jsxs(qa,{children:[c.jsxs(Ni,{children:[c.jsxs(ji,{className:"flex items-center gap-2",children:[c.jsx(of,{className:"w-4 h-4"}),"OAuth Authentication"]}),c.jsx(Su,{children:"This service requires OAuth authentication"})]}),c.jsxs(Ha,{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(of,{className:"w-4 h-4 mr-1"}),"Start OAuth Flow"]}),c.jsx(le,{onClick:N,variant:"outline",children:"Clear OAuth Data"})]})]})]})]})}function EP(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 _ae{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,p=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 m=-1/0,b=1/0;const g=()=>{for(let v=Math.max(m,-u);v<=Math.min(b,u);v+=2){let x;const S=h[v-1],k=h[v+1];S&&(h[v-1]=void 0);let C=!1;if(k){const P=k.oldPos-v;C=k&&0<=P&&P<o}const N=S&&S.oldPos+1<l;if(!C&&!N){h[v]=void 0;continue}if(!N||C&&S.oldPos<k.oldPos?x=this.addToPath(k,!0,!1,0,r):x=this.addToPath(S,!1,!0,1,r),y=this.extractCommon(x,n,t,v,r),x.oldPos+1>=l&&y+1>=o)return s(this.buildValues(x.lastComponent,n,t))||!0;h[v]=x,x.oldPos+1>=l&&(b=Math.min(b,v-1)),y+1>=o&&(m=Math.max(m,v+1))}u++};if(a)(function v(){setTimeout(function(){if(u>d||Date.now()>p)return a(void 0);g()||v()},0)})();else for(;u<=d&&Date.now()<=p;){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(p,h){const y=r[u+h];return y.length>p.length?y:p}),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 kae extends _ae{constructor(){super(...arguments),this.tokenize=Nae}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 Eae=new kae;function Cae(e,t,n){return Eae.diff(e,t,n)}function Nae(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 dy=3,jae=10;function Tae(e){return e===""?[]:e.replace(/\n$/,"").split(`
|
|
497
|
+
`)}function Aae(e,t){const n=Cae(e,t),r=[];let a=1,i=1;for(const s of n){const o=Tae(s.value);if(!s.added&&!s.removed&&o.length>=jae){const u=o.slice(0,dy),d=o.slice(-dy),f=o.length-dy*2;for(const p of u)r.push({kind:"unchanged",text:p,oldLine:a++,newLine:i++});f>0&&(r.push({kind:"ellipsis",text:`${f} unchanged lines`}),a+=f,i+=f);for(const p of d)r.push({kind:"unchanged",text:p,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 Rae(e){return e.some(t=>t.kind==="added"||t.kind==="removed")}const c1="max-w-full overflow-x-auto rounded-md border border-gray-800 bg-gray-950 font-mono text-xs leading-5";function $ae(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 Oae(e){switch(e){case"added":return"+";case"removed":return"-";case"ellipsis":return"…";default:return" "}}function Mae({rows:e,emptyLabel:t}){return e.length===0?c.jsx("p",{className:"text-sm text-gray-500",children:t}):c.jsx("div",{className:c1,children:e.map((n,r)=>c.jsxs("div",{className:`grid min-w-0 grid-cols-[3rem_3rem_minmax(0,1fr)] gap-0 ${$ae(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:Oae(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 Pae({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:`${c1} 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 Dae({preview:e}){const t=EP(e),n=Aae(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))&&Rae(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:`${c1} 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(Mae,{rows:n,emptyLabel:"No body changes."})]}),i&&c.jsx(Pae,{before:e.before.triggers,after:e.after.triggers})]})}function zae(e){if(!e)return[];try{return JSON.parse(e)}catch{return[]}}function Iae({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(hn,{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 Rf=8,Lae=[{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 Uae(e){if(!e.evidenceJson)return null;try{return JSON.parse(e.evidenceJson)}catch{return null}}function GE(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 Fae(){const[e,t]=w.useState(null),[n,r]=w.useState("proposed"),[a,i]=w.useState(0),{toast:s}=tn(),o=ln();function l(j){t(j)}function u(j){r(j),i(0),t(null)}const{data:d=[]}=wt({queryKey:["/api/playbook-patches","proposed"],queryFn:()=>zv("proposed")}),f=n==="all"?void 0:n,{data:p=[],isLoading:h}=wt({queryKey:["/api/playbook-patches",n],queryFn:()=>zv(f)}),y=Math.max(1,Math.ceil(p.length/Rf)),m=Math.min(a,y-1),b=w.useMemo(()=>{const j=m*Rf;return p.slice(j,j+Rf)},[p,m]);w.useEffect(()=>{a!==m&&i(m)},[a,m]);const{data:g,isLoading:v,isError:x,error:S}=wt({queryKey:["/api/playbook-patches",e,"preview"],queryFn:()=>V9(e),enabled:!!e}),k=g?EP(g):!1,C=p.find(j=>j.id===e)??null,N=(C==null?void 0:C.status)==="proposed",P=St({mutationFn:j=>K9(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=>Z9(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(Ql,{href:"/",children:c.jsxs(le,{variant:"ghost",size:"sm",className:"text-gray-300",children:[c.jsx(lT,{className:"mr-1 h-4 w-4"}),"Deck"]})}),c.jsx("h1",{className:"text-lg font-semibold",children:"Playbook review queue"}),c.jsxs(hn,{variant:"secondary",children:[d.length," waiting"]}),c.jsx(Ql,{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:Lae.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&&p.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}),q_(j.deckNames)&&c.jsxs("span",{className:"mt-1 block text-xs text-gray-500",children:["Decks: ",q_(j.deckNames)]})]}),c.jsxs("div",{className:"flex shrink-0 flex-col items-end gap-1",children:[c.jsx(hn,{variant:"outline",className:"shrink-0",children:j.kind}),n!=="proposed"&&c.jsx(hn,{variant:"outline",className:`shrink-0 ${GE(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))})]}),p.length>Rf&&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:m<=0,onClick:()=>i(j=>Math.max(0,j-1)),children:[c.jsx(dT,{className:"mr-1 h-4 w-4"}),"Newer"]}),c.jsxs("span",{className:"text-xs text-gray-500",children:[m+1," / ",y,c.jsxs("span",{className:"ml-1 text-gray-600",children:["(",p.length,")"]})]}),c.jsxs(le,{type:"button",size:"sm",variant:"outline",className:"border-gray-600 bg-transparent text-gray-300 hover:bg-gray-800",disabled:m>=y-1,onClick:()=>i(j=>Math.min(y-1,j+1)),children:["Older",c.jsx(fT,{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(hn,{variant:"outline",className:GE(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=Uae(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=zae(C.conflictsJson),O=(g==null?void 0:g.trigger_conflicts)??[],z=O.length>0?O:j;return c.jsx(Iae,{conflicts:z})})(),v&&c.jsx("p",{className:"text-sm text-gray-500",children:"Loading preview…"}),x&&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.",N?" Reject and re-propose with exact list anchors or rewrite_body.":" Historical preview may be incomplete if the playbook changed."]}),g&&c.jsx(Dae,{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."})]})}),N?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||x||!k,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 QE="border-[#C4B643] data-[state=checked]:bg-[#C4B643] data-[state=checked]:text-[#0A0A07] data-[state=indeterminate]:bg-[#C4B643] data-[state=indeterminate]:text-[#0A0A07]";function qae(){const{toast:e}=tn(),t=ln(),[n,r]=w.useState("open"),[a,i]=w.useState(""),[s,o]=w.useState(!1),[l,u]=w.useState(new Set),{data:d}=wt({queryKey:["/api/playbooks/vault"]}),f=(d==null?void 0:d.data)??[],p=w.useMemo(()=>{const N=new Map;for(const P of f)N.set(P.id,P.title);return N},[f]),h={status:n==="all"?void 0:n,playbookId:a||void 0,excludeInProposal:n==="open"?!s:void 0},{data:y=[],isLoading:m}=wt({queryKey:["/api/feedback-signals",h],queryFn:()=>Q9(h)}),b=St({mutationFn:N=>Y9(N),onSuccess:N=>{e({title:`Discarded ${N.discarded} signal(s)`}),u(new Set),t.invalidateQueries({queryKey:["/api/feedback-signals"]})},onError:N=>{e({title:"Discard failed",description:N.message,variant:"destructive"})}}),g=N=>{u(P=>{const R=new Set(P);return R.has(N)?R.delete(N):R.add(N),R})},v=async()=>{const N=l.size>0?y.filter(P=>l.has(P.id)):y;if(N.length!==0){if(N.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(J9(N)),e({title:"Copied curation prompt",description:`${N.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"})}}},x=[...l].filter(N=>{const P=y.find(R=>R.id===N);return(P==null?void 0:P.status)==="open"}),S=y.length>0&&y.every(N=>l.has(N.id)),k=y.some(N=>l.has(N.id)),C=()=>{if(S){u(new Set);return}u(new Set(y.map(N=>N.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(Ql,{href:"/",children:c.jsxs(le,{variant:"ghost",size:"sm",className:"text-gray-300",children:[c.jsx(lT,{className:"mr-1 h-4 w-4"}),"Home"]})}),c.jsx("h1",{className:"text-lg font-semibold",children:"Feedback"}),c.jsx(hn,{variant:"outline",children:y.length}),c.jsx(Ql,{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:N=>{i(N.target.value),u(new Set)},children:[c.jsx("option",{value:"",children:"All"}),f.map(N=>c.jsx("option",{value:N.id,children:N.title},N.id))]})]}),c.jsx("div",{className:"flex flex-wrap gap-1",children:[["open","Open"],["actioned","Actioned"],["discarded","Discarded"],["all","All"]].map(([N,P])=>{const R=n===N;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(N),u(new Set)},children:P},N)})}),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:N=>o(N.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(Zb,{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:x.length===0||b.isPending,onClick:()=>b.mutate(x),children:[c.jsx(xd,{className:"mr-1 h-3.5 w-3.5"}),"Discard selected"]})]})]}),m&&c.jsx("p",{className:"text-sm text-gray-500",children:"Loading…"}),!m&&y.length===0&&c.jsx("p",{className:"text-sm text-gray-500",children:"No signals match these filters."}),!m&&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(ep,{checked:S?!0:k?"indeterminate":!1,onCheckedChange:C,"aria-label":"Select all visible signals",disabled:y.length===0,className:QE})}),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(N=>{const P=X9(N);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(ep,{checked:l.has(N.id),onCheckedChange:()=>g(N.id),"aria-label":`Select ${N.id}`,className:QE})}),c.jsxs("td",{className:"px-3 py-2",children:[c.jsx("p",{className:"font-mono text-[11px] text-gray-600",children:N.id}),c.jsxs("p",{className:"text-gray-200",children:["“",N.userFeedbackExcerpt,"”"]}),P&&c.jsx(hn,{variant:"outline",className:"mt-1 text-[10px]",children:"In proposal"})]}),c.jsx("td",{className:"px-3 py-2 text-gray-400",children:N.failureSummary}),c.jsx("td",{className:"px-3 py-2 text-gray-300",children:N.candidatePlaybookId?p.get(N.candidatePlaybookId)??N.candidatePlaybookId:"—"}),c.jsx("td",{className:"px-3 py-2 text-gray-500",children:N.source}),c.jsx("td",{className:"px-3 py-2 whitespace-nowrap text-gray-500",children:new Date(N.createdAt).toLocaleString()})]},N.id)})})]})})]})]})}function Hae(){const e=new URLSearchParams(window.location.search),t=e.get("challenge")??"",n=e.get("session")??"",[r,a]=w.useState("idle"),[i,s]=w.useState("");w.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(qa,{className:"w-full max-w-md",children:[c.jsxs(Ni,{children:[c.jsx(ji,{children:"Approve agent-admin elevation"}),c.jsx(Su,{children:"Grants ephemeral deck-admin mode to one MCP session (30-minute lease). This does not change the persistent workspace grant."})]}),c.jsxs(Ha,{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 Bae(){return c.jsxs(n3,{children:[c.jsx(Es,{path:"/",component:wZ}),c.jsx(Es,{path:"/oauth/callback",component:kZ}),c.jsx(Es,{path:"/playbook-patches",component:Fae}),c.jsx(Es,{path:"/feedback-signals",component:qae}),c.jsx(Es,{path:"/admin/approve",component:Hae}),c.jsx(Es,{path:"/mcp-test",component:Sae}),c.jsx(Es,{component:_Z})]})}function Vae(){const[e,t]=w.useState(!1);return w.useEffect(()=>{let n=!1;return z3().finally(()=>{n||t(!0)}),()=>{n=!0}},[]),e?c.jsx(_3,{client:D3,children:c.jsxs(gU,{children:[c.jsx(RL,{}),c.jsx(Bae,{})]})}):c.jsx("div",{className:"flex min-h-screen items-center justify-center bg-[#0B1220] text-sm text-gray-300",children:"Loading AgentDeck..."})}Ez.createRoot(document.getElementById("root")).render(c.jsx(w.StrictMode,{children:c.jsx(Vae,{})}));
|