@agent-deck/backend 1.1.6 → 1.2.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/.tsbuildinfo +1 -1
- package/dist/lib/paths.d.ts +8 -0
- package/dist/lib/paths.d.ts.map +1 -1
- package/dist/lib/paths.js +28 -4
- package/dist/lib/paths.js.map +1 -1
- package/dist/models/database.d.ts +5 -1
- package/dist/models/database.d.ts.map +1 -1
- package/dist/models/database.js +32 -19
- package/dist/models/database.js.map +1 -1
- package/dist/routes/oauth.d.ts.map +1 -1
- package/dist/routes/oauth.js +8 -5
- package/dist/routes/oauth.js.map +1 -1
- package/dist/routes/services.d.ts.map +1 -1
- package/dist/routes/services.js +9 -3
- package/dist/routes/services.js.map +1 -1
- package/dist/server/index.d.ts +3 -1
- package/dist/server/index.d.ts.map +1 -1
- package/dist/server/index.js +9 -4
- package/dist/server/index.js.map +1 -1
- package/dist/services/mcp-client-manager.d.ts +3 -1
- package/dist/services/mcp-client-manager.d.ts.map +1 -1
- package/dist/services/mcp-client-manager.js +18 -5
- package/dist/services/mcp-client-manager.js.map +1 -1
- package/dist/services/oauth-connect-service.d.ts +16 -2
- package/dist/services/oauth-connect-service.d.ts.map +1 -1
- package/dist/services/oauth-connect-service.js +48 -10
- package/dist/services/oauth-connect-service.js.map +1 -1
- package/dist/services/oauth-manager.d.ts +7 -1
- package/dist/services/oauth-manager.d.ts.map +1 -1
- package/dist/services/oauth-manager.js +42 -13
- package/dist/services/oauth-manager.js.map +1 -1
- package/dist/services/service-manager.d.ts +3 -1
- package/dist/services/service-manager.d.ts.map +1 -1
- package/dist/services/service-manager.js +14 -3
- package/dist/services/service-manager.js.map +1 -1
- package/dist/vault/index.d.ts +2 -0
- package/dist/vault/index.d.ts.map +1 -1
- package/dist/vault/index.js +2 -0
- package/dist/vault/index.js.map +1 -1
- package/dist/vault/oauth-client-secret-vault.d.ts +14 -0
- package/dist/vault/oauth-client-secret-vault.d.ts.map +1 -0
- package/dist/vault/oauth-client-secret-vault.js +46 -0
- package/dist/vault/oauth-client-secret-vault.js.map +1 -0
- package/dist/vault/oauth-token-vault.d.ts +20 -0
- package/dist/vault/oauth-token-vault.d.ts.map +1 -0
- package/dist/vault/oauth-token-vault.js +93 -0
- package/dist/vault/oauth-token-vault.js.map +1 -0
- package/dist/vault/yaml-sync.d.ts.map +1 -1
- package/dist/vault/yaml-sync.js +2 -2
- package/dist/vault/yaml-sync.js.map +1 -1
- package/package.json +4 -4
- package/static-ui/assets/AgentDeckLogo3-X5qCXS2A.png +0 -0
- package/static-ui/assets/index-BjQyNmxq.css +1 -0
- package/static-ui/assets/index-CnguTslT.js +372 -0
- package/static-ui/favicon.png +0 -0
- package/static-ui/index.html +2 -2
- package/static-ui/assets/AgentDeckLogo3-CEDxeHlz.png +0 -0
- package/static-ui/assets/index-CPNBMDJn.js +0 -354
- package/static-ui/assets/index-Df5pC3f-.css +0 -1
|
@@ -0,0 +1,372 @@
|
|
|
1
|
+
var jC=Object.defineProperty;var Eg=t=>{throw TypeError(t)};var RC=(t,e,r)=>e in t?jC(t,e,{enumerable:!0,configurable:!0,writable:!0,value:r}):t[e]=r;var Ln=(t,e,r)=>RC(t,typeof e!="symbol"?e+"":e,r),nf=(t,e,r)=>e.has(t)||Eg("Cannot "+r);var I=(t,e,r)=>(nf(t,e,"read from private field"),r?r.call(t):e.get(t)),Se=(t,e,r)=>e.has(t)?Eg("Cannot add the same private member more than once"):e instanceof WeakSet?e.add(t):e.set(t,r),ue=(t,e,r,s)=>(nf(t,e,"write to private field"),s?s.call(t,r):e.set(t,r),r),Le=(t,e,r)=>(nf(t,e,"access private method"),r);var nc=(t,e,r,s)=>({set _(n){ue(t,e,n,r)},get _(){return I(t,e,s)}});function TC(t,e){for(var r=0;r<e.length;r++){const s=e[r];if(typeof s!="string"&&!Array.isArray(s)){for(const n in s)if(n!=="default"&&!(n in t)){const a=Object.getOwnPropertyDescriptor(s,n);a&&Object.defineProperty(t,n,a.get?a:{enumerable:!0,get:()=>s[n]})}}}return Object.freeze(Object.defineProperty(t,Symbol.toStringTag,{value:"Module"}))}(function(){const e=document.createElement("link").relList;if(e&&e.supports&&e.supports("modulepreload"))return;for(const n of document.querySelectorAll('link[rel="modulepreload"]'))s(n);new MutationObserver(n=>{for(const a of n)if(a.type==="childList")for(const o of a.addedNodes)o.tagName==="LINK"&&o.rel==="modulepreload"&&s(o)}).observe(document,{childList:!0,subtree:!0});function r(n){const a={};return n.integrity&&(a.integrity=n.integrity),n.referrerPolicy&&(a.referrerPolicy=n.referrerPolicy),n.crossOrigin==="use-credentials"?a.credentials="include":n.crossOrigin==="anonymous"?a.credentials="omit":a.credentials="same-origin",a}function s(n){if(n.ep)return;n.ep=!0;const a=r(n);fetch(n.href,a)}})();var AC=typeof globalThis<"u"?globalThis:typeof window<"u"?window:typeof global<"u"?global:typeof self<"u"?self:{};function vm(t){return t&&t.__esModule&&Object.prototype.hasOwnProperty.call(t,"default")?t.default:t}var vx={exports:{}},cd={},gx={exports:{}},qe={};/**
|
|
2
|
+
* @license React
|
|
3
|
+
* react.production.min.js
|
|
4
|
+
*
|
|
5
|
+
* Copyright (c) Facebook, Inc. and its 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 Ml=Symbol.for("react.element"),OC=Symbol.for("react.portal"),IC=Symbol.for("react.fragment"),DC=Symbol.for("react.strict_mode"),MC=Symbol.for("react.profiler"),$C=Symbol.for("react.provider"),FC=Symbol.for("react.context"),LC=Symbol.for("react.forward_ref"),UC=Symbol.for("react.suspense"),zC=Symbol.for("react.memo"),VC=Symbol.for("react.lazy"),Cg=Symbol.iterator;function qC(t){return t===null||typeof t!="object"?null:(t=Cg&&t[Cg]||t["@@iterator"],typeof t=="function"?t:null)}var yx={isMounted:function(){return!1},enqueueForceUpdate:function(){},enqueueReplaceState:function(){},enqueueSetState:function(){}},xx=Object.assign,wx={};function yi(t,e,r){this.props=t,this.context=e,this.refs=wx,this.updater=r||yx}yi.prototype.isReactComponent={};yi.prototype.setState=function(t,e){if(typeof t!="object"&&typeof t!="function"&&t!=null)throw Error("setState(...): takes an object of state variables to update or a function which returns an object of state variables.");this.updater.enqueueSetState(this,t,e,"setState")};yi.prototype.forceUpdate=function(t){this.updater.enqueueForceUpdate(this,t,"forceUpdate")};function bx(){}bx.prototype=yi.prototype;function gm(t,e,r){this.props=t,this.context=e,this.refs=wx,this.updater=r||yx}var ym=gm.prototype=new bx;ym.constructor=gm;xx(ym,yi.prototype);ym.isPureReactComponent=!0;var kg=Array.isArray,Sx=Object.prototype.hasOwnProperty,xm={current:null},_x={key:!0,ref:!0,__self:!0,__source:!0};function Ex(t,e,r){var s,n={},a=null,o=null;if(e!=null)for(s in e.ref!==void 0&&(o=e.ref),e.key!==void 0&&(a=""+e.key),e)Sx.call(e,s)&&!_x.hasOwnProperty(s)&&(n[s]=e[s]);var l=arguments.length-2;if(l===1)n.children=r;else if(1<l){for(var c=Array(l),u=0;u<l;u++)c[u]=arguments[u+2];n.children=c}if(t&&t.defaultProps)for(s in l=t.defaultProps,l)n[s]===void 0&&(n[s]=l[s]);return{$$typeof:Ml,type:t,key:a,ref:o,props:n,_owner:xm.current}}function HC(t,e){return{$$typeof:Ml,type:t.type,key:e,ref:t.ref,props:t.props,_owner:t._owner}}function wm(t){return typeof t=="object"&&t!==null&&t.$$typeof===Ml}function BC(t){var e={"=":"=0",":":"=2"};return"$"+t.replace(/[=:]/g,function(r){return e[r]})}var Pg=/\/+/g;function sf(t,e){return typeof t=="object"&&t!==null&&t.key!=null?BC(""+t.key):e.toString(36)}function Mc(t,e,r,s,n){var a=typeof t;(a==="undefined"||a==="boolean")&&(t=null);var o=!1;if(t===null)o=!0;else switch(a){case"string":case"number":o=!0;break;case"object":switch(t.$$typeof){case Ml:case OC:o=!0}}if(o)return o=t,n=n(o),t=s===""?"."+sf(o,0):s,kg(n)?(r="",t!=null&&(r=t.replace(Pg,"$&/")+"/"),Mc(n,e,r,"",function(u){return u})):n!=null&&(wm(n)&&(n=HC(n,r+(!n.key||o&&o.key===n.key?"":(""+n.key).replace(Pg,"$&/")+"/")+t)),e.push(n)),1;if(o=0,s=s===""?".":s+":",kg(t))for(var l=0;l<t.length;l++){a=t[l];var c=s+sf(a,l);o+=Mc(a,e,r,c,n)}else if(c=qC(t),typeof c=="function")for(t=c.call(t),l=0;!(a=t.next()).done;)a=a.value,c=s+sf(a,l++),o+=Mc(a,e,r,c,n);else if(a==="object")throw e=String(t),Error("Objects are not valid as a React child (found: "+(e==="[object Object]"?"object with keys {"+Object.keys(t).join(", ")+"}":e)+"). If you meant to render a collection of children, use an array instead.");return o}function sc(t,e,r){if(t==null)return t;var s=[],n=0;return Mc(t,s,"","",function(a){return e.call(r,a,n++)}),s}function WC(t){if(t._status===-1){var e=t._result;e=e(),e.then(function(r){(t._status===0||t._status===-1)&&(t._status=1,t._result=r)},function(r){(t._status===0||t._status===-1)&&(t._status=2,t._result=r)}),t._status===-1&&(t._status=0,t._result=e)}if(t._status===1)return t._result.default;throw t._result}var sr={current:null},$c={transition:null},KC={ReactCurrentDispatcher:sr,ReactCurrentBatchConfig:$c,ReactCurrentOwner:xm};function Cx(){throw Error("act(...) is not supported in production builds of React.")}qe.Children={map:sc,forEach:function(t,e,r){sc(t,function(){e.apply(this,arguments)},r)},count:function(t){var e=0;return sc(t,function(){e++}),e},toArray:function(t){return sc(t,function(e){return e})||[]},only:function(t){if(!wm(t))throw Error("React.Children.only expected to receive a single React element child.");return t}};qe.Component=yi;qe.Fragment=IC;qe.Profiler=MC;qe.PureComponent=gm;qe.StrictMode=DC;qe.Suspense=UC;qe.__SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED=KC;qe.act=Cx;qe.cloneElement=function(t,e,r){if(t==null)throw Error("React.cloneElement(...): The argument must be a React element, but you passed "+t+".");var s=xx({},t.props),n=t.key,a=t.ref,o=t._owner;if(e!=null){if(e.ref!==void 0&&(a=e.ref,o=xm.current),e.key!==void 0&&(n=""+e.key),t.type&&t.type.defaultProps)var l=t.type.defaultProps;for(c in e)Sx.call(e,c)&&!_x.hasOwnProperty(c)&&(s[c]=e[c]===void 0&&l!==void 0?l[c]:e[c])}var c=arguments.length-2;if(c===1)s.children=r;else if(1<c){l=Array(c);for(var u=0;u<c;u++)l[u]=arguments[u+2];s.children=l}return{$$typeof:Ml,type:t.type,key:n,ref:a,props:s,_owner:o}};qe.createContext=function(t){return t={$$typeof:FC,_currentValue:t,_currentValue2:t,_threadCount:0,Provider:null,Consumer:null,_defaultValue:null,_globalName:null},t.Provider={$$typeof:$C,_context:t},t.Consumer=t};qe.createElement=Ex;qe.createFactory=function(t){var e=Ex.bind(null,t);return e.type=t,e};qe.createRef=function(){return{current:null}};qe.forwardRef=function(t){return{$$typeof:LC,render:t}};qe.isValidElement=wm;qe.lazy=function(t){return{$$typeof:VC,_payload:{_status:-1,_result:t},_init:WC}};qe.memo=function(t,e){return{$$typeof:zC,type:t,compare:e===void 0?null:e}};qe.startTransition=function(t){var e=$c.transition;$c.transition={};try{t()}finally{$c.transition=e}};qe.unstable_act=Cx;qe.useCallback=function(t,e){return sr.current.useCallback(t,e)};qe.useContext=function(t){return sr.current.useContext(t)};qe.useDebugValue=function(){};qe.useDeferredValue=function(t){return sr.current.useDeferredValue(t)};qe.useEffect=function(t,e){return sr.current.useEffect(t,e)};qe.useId=function(){return sr.current.useId()};qe.useImperativeHandle=function(t,e,r){return sr.current.useImperativeHandle(t,e,r)};qe.useInsertionEffect=function(t,e){return sr.current.useInsertionEffect(t,e)};qe.useLayoutEffect=function(t,e){return sr.current.useLayoutEffect(t,e)};qe.useMemo=function(t,e){return sr.current.useMemo(t,e)};qe.useReducer=function(t,e,r){return sr.current.useReducer(t,e,r)};qe.useRef=function(t){return sr.current.useRef(t)};qe.useState=function(t){return sr.current.useState(t)};qe.useSyncExternalStore=function(t,e,r){return sr.current.useSyncExternalStore(t,e,r)};qe.useTransition=function(){return sr.current.useTransition()};qe.version="18.3.1";gx.exports=qe;var x=gx.exports;const vn=vm(x),bm=TC({__proto__:null,default:vn},[x]);/**
|
|
10
|
+
* @license React
|
|
11
|
+
* react-jsx-runtime.production.min.js
|
|
12
|
+
*
|
|
13
|
+
* Copyright (c) Facebook, Inc. and its 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
|
+
*/var QC=x,GC=Symbol.for("react.element"),ZC=Symbol.for("react.fragment"),YC=Object.prototype.hasOwnProperty,JC=QC.__SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED.ReactCurrentOwner,XC={key:!0,ref:!0,__self:!0,__source:!0};function kx(t,e,r){var s,n={},a=null,o=null;r!==void 0&&(a=""+r),e.key!==void 0&&(a=""+e.key),e.ref!==void 0&&(o=e.ref);for(s in e)YC.call(e,s)&&!XC.hasOwnProperty(s)&&(n[s]=e[s]);if(t&&t.defaultProps)for(s in e=t.defaultProps,e)n[s]===void 0&&(n[s]=e[s]);return{$$typeof:GC,type:t,key:a,ref:o,props:n,_owner:JC.current}}cd.Fragment=ZC;cd.jsx=kx;cd.jsxs=kx;vx.exports=cd;var i=vx.exports,Px={exports:{}},Pr={},Nx={exports:{}},jx={};/**
|
|
18
|
+
* @license React
|
|
19
|
+
* scheduler.production.min.js
|
|
20
|
+
*
|
|
21
|
+
* Copyright (c) Facebook, Inc. and its 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
|
+
*/(function(t){function e($,F){var V=$.length;$.push(F);e:for(;0<V;){var ae=V-1>>>1,se=$[ae];if(0<n(se,F))$[ae]=F,$[V]=se,V=ae;else break e}}function r($){return $.length===0?null:$[0]}function s($){if($.length===0)return null;var F=$[0],V=$.pop();if(V!==F){$[0]=V;e:for(var ae=0,se=$.length,W=se>>>1;ae<W;){var L=2*(ae+1)-1,Q=$[L],oe=L+1,Z=$[oe];if(0>n(Q,V))oe<se&&0>n(Z,Q)?($[ae]=Z,$[oe]=V,ae=oe):($[ae]=Q,$[L]=V,ae=L);else if(oe<se&&0>n(Z,V))$[ae]=Z,$[oe]=V,ae=oe;else break e}}return F}function n($,F){var V=$.sortIndex-F.sortIndex;return V!==0?V:$.id-F.id}if(typeof performance=="object"&&typeof performance.now=="function"){var a=performance;t.unstable_now=function(){return a.now()}}else{var o=Date,l=o.now();t.unstable_now=function(){return o.now()-l}}var c=[],u=[],d=1,f=null,m=3,p=!1,w=!1,h=!1,g=typeof setTimeout=="function"?setTimeout:null,v=typeof clearTimeout=="function"?clearTimeout:null,y=typeof setImmediate<"u"?setImmediate:null;typeof navigator<"u"&&navigator.scheduling!==void 0&&navigator.scheduling.isInputPending!==void 0&&navigator.scheduling.isInputPending.bind(navigator.scheduling);function b($){for(var F=r(u);F!==null;){if(F.callback===null)s(u);else if(F.startTime<=$)s(u),F.sortIndex=F.expirationTime,e(c,F);else break;F=r(u)}}function S($){if(h=!1,b($),!w)if(r(c)!==null)w=!0,U(E);else{var F=r(u);F!==null&&K(S,F.startTime-$)}}function E($,F){w=!1,h&&(h=!1,v(T),T=-1),p=!0;var V=m;try{for(b(F),f=r(c);f!==null&&(!(f.expirationTime>F)||$&&!j());){var ae=f.callback;if(typeof ae=="function"){f.callback=null,m=f.priorityLevel;var se=ae(f.expirationTime<=F);F=t.unstable_now(),typeof se=="function"?f.callback=se:f===r(c)&&s(c),b(F)}else s(c);f=r(c)}if(f!==null)var W=!0;else{var L=r(u);L!==null&&K(S,L.startTime-F),W=!1}return W}finally{f=null,m=V,p=!1}}var k=!1,R=null,T=-1,N=5,O=-1;function j(){return!(t.unstable_now()-O<N)}function _(){if(R!==null){var $=t.unstable_now();O=$;var F=!0;try{F=R(!0,$)}finally{F?A():(k=!1,R=null)}}else k=!1}var A;if(typeof y=="function")A=function(){y(_)};else if(typeof MessageChannel<"u"){var C=new MessageChannel,z=C.port2;C.port1.onmessage=_,A=function(){z.postMessage(null)}}else A=function(){g(_,0)};function U($){R=$,k||(k=!0,A())}function K($,F){T=g(function(){$(t.unstable_now())},F)}t.unstable_IdlePriority=5,t.unstable_ImmediatePriority=1,t.unstable_LowPriority=4,t.unstable_NormalPriority=3,t.unstable_Profiling=null,t.unstable_UserBlockingPriority=2,t.unstable_cancelCallback=function($){$.callback=null},t.unstable_continueExecution=function(){w||p||(w=!0,U(E))},t.unstable_forceFrameRate=function($){0>$||125<$?console.error("forceFrameRate takes a positive int between 0 and 125, forcing frame rates higher than 125 fps is not supported"):N=0<$?Math.floor(1e3/$):5},t.unstable_getCurrentPriorityLevel=function(){return m},t.unstable_getFirstCallbackNode=function(){return r(c)},t.unstable_next=function($){switch(m){case 1:case 2:case 3:var F=3;break;default:F=m}var V=m;m=F;try{return $()}finally{m=V}},t.unstable_pauseExecution=function(){},t.unstable_requestPaint=function(){},t.unstable_runWithPriority=function($,F){switch($){case 1:case 2:case 3:case 4:case 5:break;default:$=3}var V=m;m=$;try{return F()}finally{m=V}},t.unstable_scheduleCallback=function($,F,V){var ae=t.unstable_now();switch(typeof V=="object"&&V!==null?(V=V.delay,V=typeof V=="number"&&0<V?ae+V:ae):V=ae,$){case 1:var se=-1;break;case 2:se=250;break;case 5:se=1073741823;break;case 4:se=1e4;break;default:se=5e3}return se=V+se,$={id:d++,callback:F,priorityLevel:$,startTime:V,expirationTime:se,sortIndex:-1},V>ae?($.sortIndex=V,e(u,$),r(c)===null&&$===r(u)&&(h?(v(T),T=-1):h=!0,K(S,V-ae))):($.sortIndex=se,e(c,$),w||p||(w=!0,U(E))),$},t.unstable_shouldYield=j,t.unstable_wrapCallback=function($){var F=m;return function(){var V=m;m=F;try{return $.apply(this,arguments)}finally{m=V}}}})(jx);Nx.exports=jx;var ek=Nx.exports;/**
|
|
26
|
+
* @license React
|
|
27
|
+
* react-dom.production.min.js
|
|
28
|
+
*
|
|
29
|
+
* Copyright (c) Facebook, Inc. and its 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 tk=x,kr=ek;function Y(t){for(var e="https://reactjs.org/docs/error-decoder.html?invariant="+t,r=1;r<arguments.length;r++)e+="&args[]="+encodeURIComponent(arguments[r]);return"Minified React error #"+t+"; visit "+e+" for the full message or use the non-minified dev environment for full errors and additional helpful warnings."}var Rx=new Set,ul={};function ro(t,e){si(t,e),si(t+"Capture",e)}function si(t,e){for(ul[t]=e,t=0;t<e.length;t++)Rx.add(e[t])}var ns=!(typeof window>"u"||typeof window.document>"u"||typeof window.document.createElement>"u"),ah=Object.prototype.hasOwnProperty,rk=/^[: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]*$/,Ng={},jg={};function nk(t){return ah.call(jg,t)?!0:ah.call(Ng,t)?!1:rk.test(t)?jg[t]=!0:(Ng[t]=!0,!1)}function sk(t,e,r,s){if(r!==null&&r.type===0)return!1;switch(typeof e){case"function":case"symbol":return!0;case"boolean":return s?!1:r!==null?!r.acceptsBooleans:(t=t.toLowerCase().slice(0,5),t!=="data-"&&t!=="aria-");default:return!1}}function ak(t,e,r,s){if(e===null||typeof e>"u"||sk(t,e,r,s))return!0;if(s)return!1;if(r!==null)switch(r.type){case 3:return!e;case 4:return e===!1;case 5:return isNaN(e);case 6:return isNaN(e)||1>e}return!1}function ar(t,e,r,s,n,a,o){this.acceptsBooleans=e===2||e===3||e===4,this.attributeName=s,this.attributeNamespace=n,this.mustUseProperty=r,this.propertyName=t,this.type=e,this.sanitizeURL=a,this.removeEmptyString=o}var Ht={};"children dangerouslySetInnerHTML defaultValue defaultChecked innerHTML suppressContentEditableWarning suppressHydrationWarning style".split(" ").forEach(function(t){Ht[t]=new ar(t,0,!1,t,null,!1,!1)});[["acceptCharset","accept-charset"],["className","class"],["htmlFor","for"],["httpEquiv","http-equiv"]].forEach(function(t){var e=t[0];Ht[e]=new ar(e,1,!1,t[1],null,!1,!1)});["contentEditable","draggable","spellCheck","value"].forEach(function(t){Ht[t]=new ar(t,2,!1,t.toLowerCase(),null,!1,!1)});["autoReverse","externalResourcesRequired","focusable","preserveAlpha"].forEach(function(t){Ht[t]=new ar(t,2,!1,t,null,!1,!1)});"allowFullScreen async autoFocus autoPlay controls default defer disabled disablePictureInPicture disableRemotePlayback formNoValidate hidden loop noModule noValidate open playsInline readOnly required reversed scoped seamless itemScope".split(" ").forEach(function(t){Ht[t]=new ar(t,3,!1,t.toLowerCase(),null,!1,!1)});["checked","multiple","muted","selected"].forEach(function(t){Ht[t]=new ar(t,3,!0,t,null,!1,!1)});["capture","download"].forEach(function(t){Ht[t]=new ar(t,4,!1,t,null,!1,!1)});["cols","rows","size","span"].forEach(function(t){Ht[t]=new ar(t,6,!1,t,null,!1,!1)});["rowSpan","start"].forEach(function(t){Ht[t]=new ar(t,5,!1,t.toLowerCase(),null,!1,!1)});var Sm=/[\-:]([a-z])/g;function _m(t){return t[1].toUpperCase()}"accent-height alignment-baseline arabic-form baseline-shift cap-height clip-path clip-rule color-interpolation color-interpolation-filters color-profile color-rendering dominant-baseline enable-background fill-opacity fill-rule flood-color flood-opacity font-family font-size font-size-adjust font-stretch font-style font-variant font-weight glyph-name glyph-orientation-horizontal glyph-orientation-vertical horiz-adv-x horiz-origin-x image-rendering letter-spacing lighting-color marker-end marker-mid marker-start overline-position overline-thickness paint-order panose-1 pointer-events rendering-intent shape-rendering stop-color stop-opacity strikethrough-position strikethrough-thickness stroke-dasharray stroke-dashoffset stroke-linecap stroke-linejoin stroke-miterlimit stroke-opacity stroke-width text-anchor text-decoration text-rendering underline-position underline-thickness unicode-bidi unicode-range units-per-em v-alphabetic v-hanging v-ideographic v-mathematical vector-effect vert-adv-y vert-origin-x vert-origin-y word-spacing writing-mode xmlns:xlink x-height".split(" ").forEach(function(t){var e=t.replace(Sm,_m);Ht[e]=new ar(e,1,!1,t,null,!1,!1)});"xlink:actuate xlink:arcrole xlink:role xlink:show xlink:title xlink:type".split(" ").forEach(function(t){var e=t.replace(Sm,_m);Ht[e]=new ar(e,1,!1,t,"http://www.w3.org/1999/xlink",!1,!1)});["xml:base","xml:lang","xml:space"].forEach(function(t){var e=t.replace(Sm,_m);Ht[e]=new ar(e,1,!1,t,"http://www.w3.org/XML/1998/namespace",!1,!1)});["tabIndex","crossOrigin"].forEach(function(t){Ht[t]=new ar(t,1,!1,t.toLowerCase(),null,!1,!1)});Ht.xlinkHref=new ar("xlinkHref",1,!1,"xlink:href","http://www.w3.org/1999/xlink",!0,!1);["src","href","action","formAction"].forEach(function(t){Ht[t]=new ar(t,1,!1,t.toLowerCase(),null,!0,!0)});function Em(t,e,r,s){var n=Ht.hasOwnProperty(e)?Ht[e]:null;(n!==null?n.type!==0:s||!(2<e.length)||e[0]!=="o"&&e[0]!=="O"||e[1]!=="n"&&e[1]!=="N")&&(ak(e,r,n,s)&&(r=null),s||n===null?nk(e)&&(r===null?t.removeAttribute(e):t.setAttribute(e,""+r)):n.mustUseProperty?t[n.propertyName]=r===null?n.type===3?!1:"":r:(e=n.attributeName,s=n.attributeNamespace,r===null?t.removeAttribute(e):(n=n.type,r=n===3||n===4&&r===!0?"":""+r,s?t.setAttributeNS(s,e,r):t.setAttribute(e,r))))}var ds=tk.__SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED,ac=Symbol.for("react.element"),xo=Symbol.for("react.portal"),wo=Symbol.for("react.fragment"),Cm=Symbol.for("react.strict_mode"),oh=Symbol.for("react.profiler"),Tx=Symbol.for("react.provider"),Ax=Symbol.for("react.context"),km=Symbol.for("react.forward_ref"),ih=Symbol.for("react.suspense"),lh=Symbol.for("react.suspense_list"),Pm=Symbol.for("react.memo"),_s=Symbol.for("react.lazy"),Ox=Symbol.for("react.offscreen"),Rg=Symbol.iterator;function Ri(t){return t===null||typeof t!="object"?null:(t=Rg&&t[Rg]||t["@@iterator"],typeof t=="function"?t:null)}var gt=Object.assign,af;function zi(t){if(af===void 0)try{throw Error()}catch(r){var e=r.stack.trim().match(/\n( *(at )?)/);af=e&&e[1]||""}return`
|
|
34
|
+
`+af+t}var of=!1;function lf(t,e){if(!t||of)return"";of=!0;var r=Error.prepareStackTrace;Error.prepareStackTrace=void 0;try{if(e)if(e=function(){throw Error()},Object.defineProperty(e.prototype,"props",{set:function(){throw Error()}}),typeof Reflect=="object"&&Reflect.construct){try{Reflect.construct(e,[])}catch(u){var s=u}Reflect.construct(t,[],e)}else{try{e.call()}catch(u){s=u}t.call(e.prototype)}else{try{throw Error()}catch(u){s=u}t()}}catch(u){if(u&&s&&typeof u.stack=="string"){for(var n=u.stack.split(`
|
|
35
|
+
`),a=s.stack.split(`
|
|
36
|
+
`),o=n.length-1,l=a.length-1;1<=o&&0<=l&&n[o]!==a[l];)l--;for(;1<=o&&0<=l;o--,l--)if(n[o]!==a[l]){if(o!==1||l!==1)do if(o--,l--,0>l||n[o]!==a[l]){var c=`
|
|
37
|
+
`+n[o].replace(" at new "," at ");return t.displayName&&c.includes("<anonymous>")&&(c=c.replace("<anonymous>",t.displayName)),c}while(1<=o&&0<=l);break}}}finally{of=!1,Error.prepareStackTrace=r}return(t=t?t.displayName||t.name:"")?zi(t):""}function ok(t){switch(t.tag){case 5:return zi(t.type);case 16:return zi("Lazy");case 13:return zi("Suspense");case 19:return zi("SuspenseList");case 0:case 2:case 15:return t=lf(t.type,!1),t;case 11:return t=lf(t.type.render,!1),t;case 1:return t=lf(t.type,!0),t;default:return""}}function ch(t){if(t==null)return null;if(typeof t=="function")return t.displayName||t.name||null;if(typeof t=="string")return t;switch(t){case wo:return"Fragment";case xo:return"Portal";case oh:return"Profiler";case Cm:return"StrictMode";case ih:return"Suspense";case lh:return"SuspenseList"}if(typeof t=="object")switch(t.$$typeof){case Ax:return(t.displayName||"Context")+".Consumer";case Tx:return(t._context.displayName||"Context")+".Provider";case km:var e=t.render;return t=t.displayName,t||(t=e.displayName||e.name||"",t=t!==""?"ForwardRef("+t+")":"ForwardRef"),t;case Pm:return e=t.displayName||null,e!==null?e:ch(t.type)||"Memo";case _s:e=t._payload,t=t._init;try{return ch(t(e))}catch{}}return null}function ik(t){var e=t.type;switch(t.tag){case 24:return"Cache";case 9:return(e.displayName||"Context")+".Consumer";case 10:return(e._context.displayName||"Context")+".Provider";case 18:return"DehydratedFragment";case 11:return t=e.render,t=t.displayName||t.name||"",e.displayName||(t!==""?"ForwardRef("+t+")":"ForwardRef");case 7:return"Fragment";case 5:return e;case 4:return"Portal";case 3:return"Root";case 6:return"Text";case 16:return ch(e);case 8:return e===Cm?"StrictMode":"Mode";case 22:return"Offscreen";case 12:return"Profiler";case 21:return"Scope";case 13:return"Suspense";case 19:return"SuspenseList";case 25:return"TracingMarker";case 1:case 0:case 17:case 2:case 14:case 15:if(typeof e=="function")return e.displayName||e.name||null;if(typeof e=="string")return e}return null}function na(t){switch(typeof t){case"boolean":case"number":case"string":case"undefined":return t;case"object":return t;default:return""}}function Ix(t){var e=t.type;return(t=t.nodeName)&&t.toLowerCase()==="input"&&(e==="checkbox"||e==="radio")}function lk(t){var e=Ix(t)?"checked":"value",r=Object.getOwnPropertyDescriptor(t.constructor.prototype,e),s=""+t[e];if(!t.hasOwnProperty(e)&&typeof r<"u"&&typeof r.get=="function"&&typeof r.set=="function"){var n=r.get,a=r.set;return Object.defineProperty(t,e,{configurable:!0,get:function(){return n.call(this)},set:function(o){s=""+o,a.call(this,o)}}),Object.defineProperty(t,e,{enumerable:r.enumerable}),{getValue:function(){return s},setValue:function(o){s=""+o},stopTracking:function(){t._valueTracker=null,delete t[e]}}}}function oc(t){t._valueTracker||(t._valueTracker=lk(t))}function Dx(t){if(!t)return!1;var e=t._valueTracker;if(!e)return!0;var r=e.getValue(),s="";return t&&(s=Ix(t)?t.checked?"true":"false":t.value),t=s,t!==r?(e.setValue(t),!0):!1}function ou(t){if(t=t||(typeof document<"u"?document:void 0),typeof t>"u")return null;try{return t.activeElement||t.body}catch{return t.body}}function uh(t,e){var r=e.checked;return gt({},e,{defaultChecked:void 0,defaultValue:void 0,value:void 0,checked:r??t._wrapperState.initialChecked})}function Tg(t,e){var r=e.defaultValue==null?"":e.defaultValue,s=e.checked!=null?e.checked:e.defaultChecked;r=na(e.value!=null?e.value:r),t._wrapperState={initialChecked:s,initialValue:r,controlled:e.type==="checkbox"||e.type==="radio"?e.checked!=null:e.value!=null}}function Mx(t,e){e=e.checked,e!=null&&Em(t,"checked",e,!1)}function dh(t,e){Mx(t,e);var r=na(e.value),s=e.type;if(r!=null)s==="number"?(r===0&&t.value===""||t.value!=r)&&(t.value=""+r):t.value!==""+r&&(t.value=""+r);else if(s==="submit"||s==="reset"){t.removeAttribute("value");return}e.hasOwnProperty("value")?fh(t,e.type,r):e.hasOwnProperty("defaultValue")&&fh(t,e.type,na(e.defaultValue)),e.checked==null&&e.defaultChecked!=null&&(t.defaultChecked=!!e.defaultChecked)}function Ag(t,e,r){if(e.hasOwnProperty("value")||e.hasOwnProperty("defaultValue")){var s=e.type;if(!(s!=="submit"&&s!=="reset"||e.value!==void 0&&e.value!==null))return;e=""+t._wrapperState.initialValue,r||e===t.value||(t.value=e),t.defaultValue=e}r=t.name,r!==""&&(t.name=""),t.defaultChecked=!!t._wrapperState.initialChecked,r!==""&&(t.name=r)}function fh(t,e,r){(e!=="number"||ou(t.ownerDocument)!==t)&&(r==null?t.defaultValue=""+t._wrapperState.initialValue:t.defaultValue!==""+r&&(t.defaultValue=""+r))}var Vi=Array.isArray;function Io(t,e,r,s){if(t=t.options,e){e={};for(var n=0;n<r.length;n++)e["$"+r[n]]=!0;for(r=0;r<t.length;r++)n=e.hasOwnProperty("$"+t[r].value),t[r].selected!==n&&(t[r].selected=n),n&&s&&(t[r].defaultSelected=!0)}else{for(r=""+na(r),e=null,n=0;n<t.length;n++){if(t[n].value===r){t[n].selected=!0,s&&(t[n].defaultSelected=!0);return}e!==null||t[n].disabled||(e=t[n])}e!==null&&(e.selected=!0)}}function hh(t,e){if(e.dangerouslySetInnerHTML!=null)throw Error(Y(91));return gt({},e,{value:void 0,defaultValue:void 0,children:""+t._wrapperState.initialValue})}function Og(t,e){var r=e.value;if(r==null){if(r=e.children,e=e.defaultValue,r!=null){if(e!=null)throw Error(Y(92));if(Vi(r)){if(1<r.length)throw Error(Y(93));r=r[0]}e=r}e==null&&(e=""),r=e}t._wrapperState={initialValue:na(r)}}function $x(t,e){var r=na(e.value),s=na(e.defaultValue);r!=null&&(r=""+r,r!==t.value&&(t.value=r),e.defaultValue==null&&t.defaultValue!==r&&(t.defaultValue=r)),s!=null&&(t.defaultValue=""+s)}function Ig(t){var e=t.textContent;e===t._wrapperState.initialValue&&e!==""&&e!==null&&(t.value=e)}function Fx(t){switch(t){case"svg":return"http://www.w3.org/2000/svg";case"math":return"http://www.w3.org/1998/Math/MathML";default:return"http://www.w3.org/1999/xhtml"}}function ph(t,e){return t==null||t==="http://www.w3.org/1999/xhtml"?Fx(e):t==="http://www.w3.org/2000/svg"&&e==="foreignObject"?"http://www.w3.org/1999/xhtml":t}var ic,Lx=function(t){return typeof MSApp<"u"&&MSApp.execUnsafeLocalFunction?function(e,r,s,n){MSApp.execUnsafeLocalFunction(function(){return t(e,r,s,n)})}:t}(function(t,e){if(t.namespaceURI!=="http://www.w3.org/2000/svg"||"innerHTML"in t)t.innerHTML=e;else{for(ic=ic||document.createElement("div"),ic.innerHTML="<svg>"+e.valueOf().toString()+"</svg>",e=ic.firstChild;t.firstChild;)t.removeChild(t.firstChild);for(;e.firstChild;)t.appendChild(e.firstChild)}});function dl(t,e){if(e){var r=t.firstChild;if(r&&r===t.lastChild&&r.nodeType===3){r.nodeValue=e;return}}t.textContent=e}var Yi={animationIterationCount:!0,aspectRatio:!0,borderImageOutset:!0,borderImageSlice:!0,borderImageWidth:!0,boxFlex:!0,boxFlexGroup:!0,boxOrdinalGroup:!0,columnCount:!0,columns:!0,flex:!0,flexGrow:!0,flexPositive:!0,flexShrink:!0,flexNegative:!0,flexOrder:!0,gridArea:!0,gridRow:!0,gridRowEnd:!0,gridRowSpan:!0,gridRowStart:!0,gridColumn:!0,gridColumnEnd:!0,gridColumnSpan:!0,gridColumnStart:!0,fontWeight:!0,lineClamp:!0,lineHeight:!0,opacity:!0,order:!0,orphans:!0,tabSize:!0,widows:!0,zIndex:!0,zoom:!0,fillOpacity:!0,floodOpacity:!0,stopOpacity:!0,strokeDasharray:!0,strokeDashoffset:!0,strokeMiterlimit:!0,strokeOpacity:!0,strokeWidth:!0},ck=["Webkit","ms","Moz","O"];Object.keys(Yi).forEach(function(t){ck.forEach(function(e){e=e+t.charAt(0).toUpperCase()+t.substring(1),Yi[e]=Yi[t]})});function Ux(t,e,r){return e==null||typeof e=="boolean"||e===""?"":r||typeof e!="number"||e===0||Yi.hasOwnProperty(t)&&Yi[t]?(""+e).trim():e+"px"}function zx(t,e){t=t.style;for(var r in e)if(e.hasOwnProperty(r)){var s=r.indexOf("--")===0,n=Ux(r,e[r],s);r==="float"&&(r="cssFloat"),s?t.setProperty(r,n):t[r]=n}}var uk=gt({menuitem:!0},{area:!0,base:!0,br:!0,col:!0,embed:!0,hr:!0,img:!0,input:!0,keygen:!0,link:!0,meta:!0,param:!0,source:!0,track:!0,wbr:!0});function mh(t,e){if(e){if(uk[t]&&(e.children!=null||e.dangerouslySetInnerHTML!=null))throw Error(Y(137,t));if(e.dangerouslySetInnerHTML!=null){if(e.children!=null)throw Error(Y(60));if(typeof e.dangerouslySetInnerHTML!="object"||!("__html"in e.dangerouslySetInnerHTML))throw Error(Y(61))}if(e.style!=null&&typeof e.style!="object")throw Error(Y(62))}}function vh(t,e){if(t.indexOf("-")===-1)return typeof e.is=="string";switch(t){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 gh=null;function Nm(t){return t=t.target||t.srcElement||window,t.correspondingUseElement&&(t=t.correspondingUseElement),t.nodeType===3?t.parentNode:t}var yh=null,Do=null,Mo=null;function Dg(t){if(t=Ll(t)){if(typeof yh!="function")throw Error(Y(280));var e=t.stateNode;e&&(e=pd(e),yh(t.stateNode,t.type,e))}}function Vx(t){Do?Mo?Mo.push(t):Mo=[t]:Do=t}function qx(){if(Do){var t=Do,e=Mo;if(Mo=Do=null,Dg(t),e)for(t=0;t<e.length;t++)Dg(e[t])}}function Hx(t,e){return t(e)}function Bx(){}var cf=!1;function Wx(t,e,r){if(cf)return t(e,r);cf=!0;try{return Hx(t,e,r)}finally{cf=!1,(Do!==null||Mo!==null)&&(Bx(),qx())}}function fl(t,e){var r=t.stateNode;if(r===null)return null;var s=pd(r);if(s===null)return null;r=s[e];e:switch(e){case"onClick":case"onClickCapture":case"onDoubleClick":case"onDoubleClickCapture":case"onMouseDown":case"onMouseDownCapture":case"onMouseMove":case"onMouseMoveCapture":case"onMouseUp":case"onMouseUpCapture":case"onMouseEnter":(s=!s.disabled)||(t=t.type,s=!(t==="button"||t==="input"||t==="select"||t==="textarea")),t=!s;break e;default:t=!1}if(t)return null;if(r&&typeof r!="function")throw Error(Y(231,e,typeof r));return r}var xh=!1;if(ns)try{var Ti={};Object.defineProperty(Ti,"passive",{get:function(){xh=!0}}),window.addEventListener("test",Ti,Ti),window.removeEventListener("test",Ti,Ti)}catch{xh=!1}function dk(t,e,r,s,n,a,o,l,c){var u=Array.prototype.slice.call(arguments,3);try{e.apply(r,u)}catch(d){this.onError(d)}}var Ji=!1,iu=null,lu=!1,wh=null,fk={onError:function(t){Ji=!0,iu=t}};function hk(t,e,r,s,n,a,o,l,c){Ji=!1,iu=null,dk.apply(fk,arguments)}function pk(t,e,r,s,n,a,o,l,c){if(hk.apply(this,arguments),Ji){if(Ji){var u=iu;Ji=!1,iu=null}else throw Error(Y(198));lu||(lu=!0,wh=u)}}function no(t){var e=t,r=t;if(t.alternate)for(;e.return;)e=e.return;else{t=e;do e=t,e.flags&4098&&(r=e.return),t=e.return;while(t)}return e.tag===3?r:null}function Kx(t){if(t.tag===13){var e=t.memoizedState;if(e===null&&(t=t.alternate,t!==null&&(e=t.memoizedState)),e!==null)return e.dehydrated}return null}function Mg(t){if(no(t)!==t)throw Error(Y(188))}function mk(t){var e=t.alternate;if(!e){if(e=no(t),e===null)throw Error(Y(188));return e!==t?null:t}for(var r=t,s=e;;){var n=r.return;if(n===null)break;var a=n.alternate;if(a===null){if(s=n.return,s!==null){r=s;continue}break}if(n.child===a.child){for(a=n.child;a;){if(a===r)return Mg(n),t;if(a===s)return Mg(n),e;a=a.sibling}throw Error(Y(188))}if(r.return!==s.return)r=n,s=a;else{for(var o=!1,l=n.child;l;){if(l===r){o=!0,r=n,s=a;break}if(l===s){o=!0,s=n,r=a;break}l=l.sibling}if(!o){for(l=a.child;l;){if(l===r){o=!0,r=a,s=n;break}if(l===s){o=!0,s=a,r=n;break}l=l.sibling}if(!o)throw Error(Y(189))}}if(r.alternate!==s)throw Error(Y(190))}if(r.tag!==3)throw Error(Y(188));return r.stateNode.current===r?t:e}function Qx(t){return t=mk(t),t!==null?Gx(t):null}function Gx(t){if(t.tag===5||t.tag===6)return t;for(t=t.child;t!==null;){var e=Gx(t);if(e!==null)return e;t=t.sibling}return null}var Zx=kr.unstable_scheduleCallback,$g=kr.unstable_cancelCallback,vk=kr.unstable_shouldYield,gk=kr.unstable_requestPaint,_t=kr.unstable_now,yk=kr.unstable_getCurrentPriorityLevel,jm=kr.unstable_ImmediatePriority,Yx=kr.unstable_UserBlockingPriority,cu=kr.unstable_NormalPriority,xk=kr.unstable_LowPriority,Jx=kr.unstable_IdlePriority,ud=null,Pn=null;function wk(t){if(Pn&&typeof Pn.onCommitFiberRoot=="function")try{Pn.onCommitFiberRoot(ud,t,void 0,(t.current.flags&128)===128)}catch{}}var nn=Math.clz32?Math.clz32:_k,bk=Math.log,Sk=Math.LN2;function _k(t){return t>>>=0,t===0?32:31-(bk(t)/Sk|0)|0}var lc=64,cc=4194304;function qi(t){switch(t&-t){case 1:return 1;case 2:return 2;case 4:return 4;case 8:return 8;case 16:return 16;case 32:return 32;case 64:case 128:case 256:case 512:case 1024:case 2048:case 4096:case 8192:case 16384:case 32768:case 65536:case 131072:case 262144:case 524288:case 1048576:case 2097152:return t&4194240;case 4194304:case 8388608:case 16777216:case 33554432:case 67108864:return t&130023424;case 134217728:return 134217728;case 268435456:return 268435456;case 536870912:return 536870912;case 1073741824:return 1073741824;default:return t}}function uu(t,e){var r=t.pendingLanes;if(r===0)return 0;var s=0,n=t.suspendedLanes,a=t.pingedLanes,o=r&268435455;if(o!==0){var l=o&~n;l!==0?s=qi(l):(a&=o,a!==0&&(s=qi(a)))}else o=r&~n,o!==0?s=qi(o):a!==0&&(s=qi(a));if(s===0)return 0;if(e!==0&&e!==s&&!(e&n)&&(n=s&-s,a=e&-e,n>=a||n===16&&(a&4194240)!==0))return e;if(s&4&&(s|=r&16),e=t.entangledLanes,e!==0)for(t=t.entanglements,e&=s;0<e;)r=31-nn(e),n=1<<r,s|=t[r],e&=~n;return s}function Ek(t,e){switch(t){case 1:case 2:case 4:return e+250;case 8:case 16:case 32:case 64:case 128:case 256:case 512:case 1024:case 2048:case 4096:case 8192:case 16384:case 32768:case 65536:case 131072:case 262144:case 524288:case 1048576:case 2097152:return e+5e3;case 4194304:case 8388608:case 16777216:case 33554432:case 67108864:return-1;case 134217728:case 268435456:case 536870912:case 1073741824:return-1;default:return-1}}function Ck(t,e){for(var r=t.suspendedLanes,s=t.pingedLanes,n=t.expirationTimes,a=t.pendingLanes;0<a;){var o=31-nn(a),l=1<<o,c=n[o];c===-1?(!(l&r)||l&s)&&(n[o]=Ek(l,e)):c<=e&&(t.expiredLanes|=l),a&=~l}}function bh(t){return t=t.pendingLanes&-1073741825,t!==0?t:t&1073741824?1073741824:0}function Xx(){var t=lc;return lc<<=1,!(lc&4194240)&&(lc=64),t}function uf(t){for(var e=[],r=0;31>r;r++)e.push(t);return e}function $l(t,e,r){t.pendingLanes|=e,e!==536870912&&(t.suspendedLanes=0,t.pingedLanes=0),t=t.eventTimes,e=31-nn(e),t[e]=r}function kk(t,e){var r=t.pendingLanes&~e;t.pendingLanes=e,t.suspendedLanes=0,t.pingedLanes=0,t.expiredLanes&=e,t.mutableReadLanes&=e,t.entangledLanes&=e,e=t.entanglements;var s=t.eventTimes;for(t=t.expirationTimes;0<r;){var n=31-nn(r),a=1<<n;e[n]=0,s[n]=-1,t[n]=-1,r&=~a}}function Rm(t,e){var r=t.entangledLanes|=e;for(t=t.entanglements;r;){var s=31-nn(r),n=1<<s;n&e|t[s]&e&&(t[s]|=e),r&=~n}}var Xe=0;function ew(t){return t&=-t,1<t?4<t?t&268435455?16:536870912:4:1}var tw,Tm,rw,nw,sw,Sh=!1,uc=[],Bs=null,Ws=null,Ks=null,hl=new Map,pl=new Map,Ns=[],Pk="mousedown mouseup touchcancel touchend touchstart auxclick dblclick pointercancel pointerdown pointerup dragend dragstart drop compositionend compositionstart keydown keypress keyup input textInput copy cut paste click change contextmenu reset submit".split(" ");function Fg(t,e){switch(t){case"focusin":case"focusout":Bs=null;break;case"dragenter":case"dragleave":Ws=null;break;case"mouseover":case"mouseout":Ks=null;break;case"pointerover":case"pointerout":hl.delete(e.pointerId);break;case"gotpointercapture":case"lostpointercapture":pl.delete(e.pointerId)}}function Ai(t,e,r,s,n,a){return t===null||t.nativeEvent!==a?(t={blockedOn:e,domEventName:r,eventSystemFlags:s,nativeEvent:a,targetContainers:[n]},e!==null&&(e=Ll(e),e!==null&&Tm(e)),t):(t.eventSystemFlags|=s,e=t.targetContainers,n!==null&&e.indexOf(n)===-1&&e.push(n),t)}function Nk(t,e,r,s,n){switch(e){case"focusin":return Bs=Ai(Bs,t,e,r,s,n),!0;case"dragenter":return Ws=Ai(Ws,t,e,r,s,n),!0;case"mouseover":return Ks=Ai(Ks,t,e,r,s,n),!0;case"pointerover":var a=n.pointerId;return hl.set(a,Ai(hl.get(a)||null,t,e,r,s,n)),!0;case"gotpointercapture":return a=n.pointerId,pl.set(a,Ai(pl.get(a)||null,t,e,r,s,n)),!0}return!1}function aw(t){var e=ka(t.target);if(e!==null){var r=no(e);if(r!==null){if(e=r.tag,e===13){if(e=Kx(r),e!==null){t.blockedOn=e,sw(t.priority,function(){rw(r)});return}}else if(e===3&&r.stateNode.current.memoizedState.isDehydrated){t.blockedOn=r.tag===3?r.stateNode.containerInfo:null;return}}}t.blockedOn=null}function Fc(t){if(t.blockedOn!==null)return!1;for(var e=t.targetContainers;0<e.length;){var r=_h(t.domEventName,t.eventSystemFlags,e[0],t.nativeEvent);if(r===null){r=t.nativeEvent;var s=new r.constructor(r.type,r);gh=s,r.target.dispatchEvent(s),gh=null}else return e=Ll(r),e!==null&&Tm(e),t.blockedOn=r,!1;e.shift()}return!0}function Lg(t,e,r){Fc(t)&&r.delete(e)}function jk(){Sh=!1,Bs!==null&&Fc(Bs)&&(Bs=null),Ws!==null&&Fc(Ws)&&(Ws=null),Ks!==null&&Fc(Ks)&&(Ks=null),hl.forEach(Lg),pl.forEach(Lg)}function Oi(t,e){t.blockedOn===e&&(t.blockedOn=null,Sh||(Sh=!0,kr.unstable_scheduleCallback(kr.unstable_NormalPriority,jk)))}function ml(t){function e(n){return Oi(n,t)}if(0<uc.length){Oi(uc[0],t);for(var r=1;r<uc.length;r++){var s=uc[r];s.blockedOn===t&&(s.blockedOn=null)}}for(Bs!==null&&Oi(Bs,t),Ws!==null&&Oi(Ws,t),Ks!==null&&Oi(Ks,t),hl.forEach(e),pl.forEach(e),r=0;r<Ns.length;r++)s=Ns[r],s.blockedOn===t&&(s.blockedOn=null);for(;0<Ns.length&&(r=Ns[0],r.blockedOn===null);)aw(r),r.blockedOn===null&&Ns.shift()}var $o=ds.ReactCurrentBatchConfig,du=!0;function Rk(t,e,r,s){var n=Xe,a=$o.transition;$o.transition=null;try{Xe=1,Am(t,e,r,s)}finally{Xe=n,$o.transition=a}}function Tk(t,e,r,s){var n=Xe,a=$o.transition;$o.transition=null;try{Xe=4,Am(t,e,r,s)}finally{Xe=n,$o.transition=a}}function Am(t,e,r,s){if(du){var n=_h(t,e,r,s);if(n===null)wf(t,e,s,fu,r),Fg(t,s);else if(Nk(n,t,e,r,s))s.stopPropagation();else if(Fg(t,s),e&4&&-1<Pk.indexOf(t)){for(;n!==null;){var a=Ll(n);if(a!==null&&tw(a),a=_h(t,e,r,s),a===null&&wf(t,e,s,fu,r),a===n)break;n=a}n!==null&&s.stopPropagation()}else wf(t,e,s,null,r)}}var fu=null;function _h(t,e,r,s){if(fu=null,t=Nm(s),t=ka(t),t!==null)if(e=no(t),e===null)t=null;else if(r=e.tag,r===13){if(t=Kx(e),t!==null)return t;t=null}else if(r===3){if(e.stateNode.current.memoizedState.isDehydrated)return e.tag===3?e.stateNode.containerInfo:null;t=null}else e!==t&&(t=null);return fu=t,null}function ow(t){switch(t){case"cancel":case"click":case"close":case"contextmenu":case"copy":case"cut":case"auxclick":case"dblclick":case"dragend":case"dragstart":case"drop":case"focusin":case"focusout":case"input":case"invalid":case"keydown":case"keypress":case"keyup":case"mousedown":case"mouseup":case"paste":case"pause":case"play":case"pointercancel":case"pointerdown":case"pointerup":case"ratechange":case"reset":case"resize":case"seeked":case"submit":case"touchcancel":case"touchend":case"touchstart":case"volumechange":case"change":case"selectionchange":case"textInput":case"compositionstart":case"compositionend":case"compositionupdate":case"beforeblur":case"afterblur":case"beforeinput":case"blur":case"fullscreenchange":case"focus":case"hashchange":case"popstate":case"select":case"selectstart":return 1;case"drag":case"dragenter":case"dragexit":case"dragleave":case"dragover":case"mousemove":case"mouseout":case"mouseover":case"pointermove":case"pointerout":case"pointerover":case"scroll":case"toggle":case"touchmove":case"wheel":case"mouseenter":case"mouseleave":case"pointerenter":case"pointerleave":return 4;case"message":switch(yk()){case jm:return 1;case Yx:return 4;case cu:case xk:return 16;case Jx:return 536870912;default:return 16}default:return 16}}var Us=null,Om=null,Lc=null;function iw(){if(Lc)return Lc;var t,e=Om,r=e.length,s,n="value"in Us?Us.value:Us.textContent,a=n.length;for(t=0;t<r&&e[t]===n[t];t++);var o=r-t;for(s=1;s<=o&&e[r-s]===n[a-s];s++);return Lc=n.slice(t,1<s?1-s:void 0)}function Uc(t){var e=t.keyCode;return"charCode"in t?(t=t.charCode,t===0&&e===13&&(t=13)):t=e,t===10&&(t=13),32<=t||t===13?t:0}function dc(){return!0}function Ug(){return!1}function Nr(t){function e(r,s,n,a,o){this._reactName=r,this._targetInst=n,this.type=s,this.nativeEvent=a,this.target=o,this.currentTarget=null;for(var l in t)t.hasOwnProperty(l)&&(r=t[l],this[l]=r?r(a):a[l]);return this.isDefaultPrevented=(a.defaultPrevented!=null?a.defaultPrevented:a.returnValue===!1)?dc:Ug,this.isPropagationStopped=Ug,this}return gt(e.prototype,{preventDefault:function(){this.defaultPrevented=!0;var r=this.nativeEvent;r&&(r.preventDefault?r.preventDefault():typeof r.returnValue!="unknown"&&(r.returnValue=!1),this.isDefaultPrevented=dc)},stopPropagation:function(){var r=this.nativeEvent;r&&(r.stopPropagation?r.stopPropagation():typeof r.cancelBubble!="unknown"&&(r.cancelBubble=!0),this.isPropagationStopped=dc)},persist:function(){},isPersistent:dc}),e}var xi={eventPhase:0,bubbles:0,cancelable:0,timeStamp:function(t){return t.timeStamp||Date.now()},defaultPrevented:0,isTrusted:0},Im=Nr(xi),Fl=gt({},xi,{view:0,detail:0}),Ak=Nr(Fl),df,ff,Ii,dd=gt({},Fl,{screenX:0,screenY:0,clientX:0,clientY:0,pageX:0,pageY:0,ctrlKey:0,shiftKey:0,altKey:0,metaKey:0,getModifierState:Dm,button:0,buttons:0,relatedTarget:function(t){return t.relatedTarget===void 0?t.fromElement===t.srcElement?t.toElement:t.fromElement:t.relatedTarget},movementX:function(t){return"movementX"in t?t.movementX:(t!==Ii&&(Ii&&t.type==="mousemove"?(df=t.screenX-Ii.screenX,ff=t.screenY-Ii.screenY):ff=df=0,Ii=t),df)},movementY:function(t){return"movementY"in t?t.movementY:ff}}),zg=Nr(dd),Ok=gt({},dd,{dataTransfer:0}),Ik=Nr(Ok),Dk=gt({},Fl,{relatedTarget:0}),hf=Nr(Dk),Mk=gt({},xi,{animationName:0,elapsedTime:0,pseudoElement:0}),$k=Nr(Mk),Fk=gt({},xi,{clipboardData:function(t){return"clipboardData"in t?t.clipboardData:window.clipboardData}}),Lk=Nr(Fk),Uk=gt({},xi,{data:0}),Vg=Nr(Uk),zk={Esc:"Escape",Spacebar:" ",Left:"ArrowLeft",Up:"ArrowUp",Right:"ArrowRight",Down:"ArrowDown",Del:"Delete",Win:"OS",Menu:"ContextMenu",Apps:"ContextMenu",Scroll:"ScrollLock",MozPrintableKey:"Unidentified"},Vk={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"},qk={Alt:"altKey",Control:"ctrlKey",Meta:"metaKey",Shift:"shiftKey"};function Hk(t){var e=this.nativeEvent;return e.getModifierState?e.getModifierState(t):(t=qk[t])?!!e[t]:!1}function Dm(){return Hk}var Bk=gt({},Fl,{key:function(t){if(t.key){var e=zk[t.key]||t.key;if(e!=="Unidentified")return e}return t.type==="keypress"?(t=Uc(t),t===13?"Enter":String.fromCharCode(t)):t.type==="keydown"||t.type==="keyup"?Vk[t.keyCode]||"Unidentified":""},code:0,location:0,ctrlKey:0,shiftKey:0,altKey:0,metaKey:0,repeat:0,locale:0,getModifierState:Dm,charCode:function(t){return t.type==="keypress"?Uc(t):0},keyCode:function(t){return t.type==="keydown"||t.type==="keyup"?t.keyCode:0},which:function(t){return t.type==="keypress"?Uc(t):t.type==="keydown"||t.type==="keyup"?t.keyCode:0}}),Wk=Nr(Bk),Kk=gt({},dd,{pointerId:0,width:0,height:0,pressure:0,tangentialPressure:0,tiltX:0,tiltY:0,twist:0,pointerType:0,isPrimary:0}),qg=Nr(Kk),Qk=gt({},Fl,{touches:0,targetTouches:0,changedTouches:0,altKey:0,metaKey:0,ctrlKey:0,shiftKey:0,getModifierState:Dm}),Gk=Nr(Qk),Zk=gt({},xi,{propertyName:0,elapsedTime:0,pseudoElement:0}),Yk=Nr(Zk),Jk=gt({},dd,{deltaX:function(t){return"deltaX"in t?t.deltaX:"wheelDeltaX"in t?-t.wheelDeltaX:0},deltaY:function(t){return"deltaY"in t?t.deltaY:"wheelDeltaY"in t?-t.wheelDeltaY:"wheelDelta"in t?-t.wheelDelta:0},deltaZ:0,deltaMode:0}),Xk=Nr(Jk),eP=[9,13,27,32],Mm=ns&&"CompositionEvent"in window,Xi=null;ns&&"documentMode"in document&&(Xi=document.documentMode);var tP=ns&&"TextEvent"in window&&!Xi,lw=ns&&(!Mm||Xi&&8<Xi&&11>=Xi),Hg=" ",Bg=!1;function cw(t,e){switch(t){case"keyup":return eP.indexOf(e.keyCode)!==-1;case"keydown":return e.keyCode!==229;case"keypress":case"mousedown":case"focusout":return!0;default:return!1}}function uw(t){return t=t.detail,typeof t=="object"&&"data"in t?t.data:null}var bo=!1;function rP(t,e){switch(t){case"compositionend":return uw(e);case"keypress":return e.which!==32?null:(Bg=!0,Hg);case"textInput":return t=e.data,t===Hg&&Bg?null:t;default:return null}}function nP(t,e){if(bo)return t==="compositionend"||!Mm&&cw(t,e)?(t=iw(),Lc=Om=Us=null,bo=!1,t):null;switch(t){case"paste":return null;case"keypress":if(!(e.ctrlKey||e.altKey||e.metaKey)||e.ctrlKey&&e.altKey){if(e.char&&1<e.char.length)return e.char;if(e.which)return String.fromCharCode(e.which)}return null;case"compositionend":return lw&&e.locale!=="ko"?null:e.data;default:return null}}var sP={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 Wg(t){var e=t&&t.nodeName&&t.nodeName.toLowerCase();return e==="input"?!!sP[t.type]:e==="textarea"}function dw(t,e,r,s){Vx(s),e=hu(e,"onChange"),0<e.length&&(r=new Im("onChange","change",null,r,s),t.push({event:r,listeners:e}))}var el=null,vl=null;function aP(t){Sw(t,0)}function fd(t){var e=Eo(t);if(Dx(e))return t}function oP(t,e){if(t==="change")return e}var fw=!1;if(ns){var pf;if(ns){var mf="oninput"in document;if(!mf){var Kg=document.createElement("div");Kg.setAttribute("oninput","return;"),mf=typeof Kg.oninput=="function"}pf=mf}else pf=!1;fw=pf&&(!document.documentMode||9<document.documentMode)}function Qg(){el&&(el.detachEvent("onpropertychange",hw),vl=el=null)}function hw(t){if(t.propertyName==="value"&&fd(vl)){var e=[];dw(e,vl,t,Nm(t)),Wx(aP,e)}}function iP(t,e,r){t==="focusin"?(Qg(),el=e,vl=r,el.attachEvent("onpropertychange",hw)):t==="focusout"&&Qg()}function lP(t){if(t==="selectionchange"||t==="keyup"||t==="keydown")return fd(vl)}function cP(t,e){if(t==="click")return fd(e)}function uP(t,e){if(t==="input"||t==="change")return fd(e)}function dP(t,e){return t===e&&(t!==0||1/t===1/e)||t!==t&&e!==e}var an=typeof Object.is=="function"?Object.is:dP;function gl(t,e){if(an(t,e))return!0;if(typeof t!="object"||t===null||typeof e!="object"||e===null)return!1;var r=Object.keys(t),s=Object.keys(e);if(r.length!==s.length)return!1;for(s=0;s<r.length;s++){var n=r[s];if(!ah.call(e,n)||!an(t[n],e[n]))return!1}return!0}function Gg(t){for(;t&&t.firstChild;)t=t.firstChild;return t}function Zg(t,e){var r=Gg(t);t=0;for(var s;r;){if(r.nodeType===3){if(s=t+r.textContent.length,t<=e&&s>=e)return{node:r,offset:e-t};t=s}e:{for(;r;){if(r.nextSibling){r=r.nextSibling;break e}r=r.parentNode}r=void 0}r=Gg(r)}}function pw(t,e){return t&&e?t===e?!0:t&&t.nodeType===3?!1:e&&e.nodeType===3?pw(t,e.parentNode):"contains"in t?t.contains(e):t.compareDocumentPosition?!!(t.compareDocumentPosition(e)&16):!1:!1}function mw(){for(var t=window,e=ou();e instanceof t.HTMLIFrameElement;){try{var r=typeof e.contentWindow.location.href=="string"}catch{r=!1}if(r)t=e.contentWindow;else break;e=ou(t.document)}return e}function $m(t){var e=t&&t.nodeName&&t.nodeName.toLowerCase();return e&&(e==="input"&&(t.type==="text"||t.type==="search"||t.type==="tel"||t.type==="url"||t.type==="password")||e==="textarea"||t.contentEditable==="true")}function fP(t){var e=mw(),r=t.focusedElem,s=t.selectionRange;if(e!==r&&r&&r.ownerDocument&&pw(r.ownerDocument.documentElement,r)){if(s!==null&&$m(r)){if(e=s.start,t=s.end,t===void 0&&(t=e),"selectionStart"in r)r.selectionStart=e,r.selectionEnd=Math.min(t,r.value.length);else if(t=(e=r.ownerDocument||document)&&e.defaultView||window,t.getSelection){t=t.getSelection();var n=r.textContent.length,a=Math.min(s.start,n);s=s.end===void 0?a:Math.min(s.end,n),!t.extend&&a>s&&(n=s,s=a,a=n),n=Zg(r,a);var o=Zg(r,s);n&&o&&(t.rangeCount!==1||t.anchorNode!==n.node||t.anchorOffset!==n.offset||t.focusNode!==o.node||t.focusOffset!==o.offset)&&(e=e.createRange(),e.setStart(n.node,n.offset),t.removeAllRanges(),a>s?(t.addRange(e),t.extend(o.node,o.offset)):(e.setEnd(o.node,o.offset),t.addRange(e)))}}for(e=[],t=r;t=t.parentNode;)t.nodeType===1&&e.push({element:t,left:t.scrollLeft,top:t.scrollTop});for(typeof r.focus=="function"&&r.focus(),r=0;r<e.length;r++)t=e[r],t.element.scrollLeft=t.left,t.element.scrollTop=t.top}}var hP=ns&&"documentMode"in document&&11>=document.documentMode,So=null,Eh=null,tl=null,Ch=!1;function Yg(t,e,r){var s=r.window===r?r.document:r.nodeType===9?r:r.ownerDocument;Ch||So==null||So!==ou(s)||(s=So,"selectionStart"in s&&$m(s)?s={start:s.selectionStart,end:s.selectionEnd}:(s=(s.ownerDocument&&s.ownerDocument.defaultView||window).getSelection(),s={anchorNode:s.anchorNode,anchorOffset:s.anchorOffset,focusNode:s.focusNode,focusOffset:s.focusOffset}),tl&&gl(tl,s)||(tl=s,s=hu(Eh,"onSelect"),0<s.length&&(e=new Im("onSelect","select",null,e,r),t.push({event:e,listeners:s}),e.target=So)))}function fc(t,e){var r={};return r[t.toLowerCase()]=e.toLowerCase(),r["Webkit"+t]="webkit"+e,r["Moz"+t]="moz"+e,r}var _o={animationend:fc("Animation","AnimationEnd"),animationiteration:fc("Animation","AnimationIteration"),animationstart:fc("Animation","AnimationStart"),transitionend:fc("Transition","TransitionEnd")},vf={},vw={};ns&&(vw=document.createElement("div").style,"AnimationEvent"in window||(delete _o.animationend.animation,delete _o.animationiteration.animation,delete _o.animationstart.animation),"TransitionEvent"in window||delete _o.transitionend.transition);function hd(t){if(vf[t])return vf[t];if(!_o[t])return t;var e=_o[t],r;for(r in e)if(e.hasOwnProperty(r)&&r in vw)return vf[t]=e[r];return t}var gw=hd("animationend"),yw=hd("animationiteration"),xw=hd("animationstart"),ww=hd("transitionend"),bw=new Map,Jg="abort auxClick cancel canPlay canPlayThrough click close contextMenu copy cut drag dragEnd dragEnter dragExit dragLeave dragOver dragStart drop durationChange emptied encrypted ended error gotPointerCapture input invalid keyDown keyPress keyUp load loadedData loadedMetadata loadStart lostPointerCapture mouseDown mouseMove mouseOut mouseOver mouseUp paste pause play playing pointerCancel pointerDown pointerMove pointerOut pointerOver pointerUp progress rateChange reset resize seeked seeking stalled submit suspend timeUpdate touchCancel touchEnd touchStart volumeChange scroll toggle touchMove waiting wheel".split(" ");function la(t,e){bw.set(t,e),ro(e,[t])}for(var gf=0;gf<Jg.length;gf++){var yf=Jg[gf],pP=yf.toLowerCase(),mP=yf[0].toUpperCase()+yf.slice(1);la(pP,"on"+mP)}la(gw,"onAnimationEnd");la(yw,"onAnimationIteration");la(xw,"onAnimationStart");la("dblclick","onDoubleClick");la("focusin","onFocus");la("focusout","onBlur");la(ww,"onTransitionEnd");si("onMouseEnter",["mouseout","mouseover"]);si("onMouseLeave",["mouseout","mouseover"]);si("onPointerEnter",["pointerout","pointerover"]);si("onPointerLeave",["pointerout","pointerover"]);ro("onChange","change click focusin focusout input keydown keyup selectionchange".split(" "));ro("onSelect","focusout contextmenu dragend focusin keydown keyup mousedown mouseup selectionchange".split(" "));ro("onBeforeInput",["compositionend","keypress","textInput","paste"]);ro("onCompositionEnd","compositionend focusout keydown keypress keyup mousedown".split(" "));ro("onCompositionStart","compositionstart focusout keydown keypress keyup mousedown".split(" "));ro("onCompositionUpdate","compositionupdate focusout keydown keypress keyup mousedown".split(" "));var Hi="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(" "),vP=new Set("cancel close invalid load scroll toggle".split(" ").concat(Hi));function Xg(t,e,r){var s=t.type||"unknown-event";t.currentTarget=r,pk(s,e,void 0,t),t.currentTarget=null}function Sw(t,e){e=(e&4)!==0;for(var r=0;r<t.length;r++){var s=t[r],n=s.event;s=s.listeners;e:{var a=void 0;if(e)for(var o=s.length-1;0<=o;o--){var l=s[o],c=l.instance,u=l.currentTarget;if(l=l.listener,c!==a&&n.isPropagationStopped())break e;Xg(n,l,u),a=c}else for(o=0;o<s.length;o++){if(l=s[o],c=l.instance,u=l.currentTarget,l=l.listener,c!==a&&n.isPropagationStopped())break e;Xg(n,l,u),a=c}}}if(lu)throw t=wh,lu=!1,wh=null,t}function lt(t,e){var r=e[Rh];r===void 0&&(r=e[Rh]=new Set);var s=t+"__bubble";r.has(s)||(_w(e,t,2,!1),r.add(s))}function xf(t,e,r){var s=0;e&&(s|=4),_w(r,t,s,e)}var hc="_reactListening"+Math.random().toString(36).slice(2);function yl(t){if(!t[hc]){t[hc]=!0,Rx.forEach(function(r){r!=="selectionchange"&&(vP.has(r)||xf(r,!1,t),xf(r,!0,t))});var e=t.nodeType===9?t:t.ownerDocument;e===null||e[hc]||(e[hc]=!0,xf("selectionchange",!1,e))}}function _w(t,e,r,s){switch(ow(e)){case 1:var n=Rk;break;case 4:n=Tk;break;default:n=Am}r=n.bind(null,e,r,t),n=void 0,!xh||e!=="touchstart"&&e!=="touchmove"&&e!=="wheel"||(n=!0),s?n!==void 0?t.addEventListener(e,r,{capture:!0,passive:n}):t.addEventListener(e,r,!0):n!==void 0?t.addEventListener(e,r,{passive:n}):t.addEventListener(e,r,!1)}function wf(t,e,r,s,n){var a=s;if(!(e&1)&&!(e&2)&&s!==null)e:for(;;){if(s===null)return;var o=s.tag;if(o===3||o===4){var l=s.stateNode.containerInfo;if(l===n||l.nodeType===8&&l.parentNode===n)break;if(o===4)for(o=s.return;o!==null;){var c=o.tag;if((c===3||c===4)&&(c=o.stateNode.containerInfo,c===n||c.nodeType===8&&c.parentNode===n))return;o=o.return}for(;l!==null;){if(o=ka(l),o===null)return;if(c=o.tag,c===5||c===6){s=a=o;continue e}l=l.parentNode}}s=s.return}Wx(function(){var u=a,d=Nm(r),f=[];e:{var m=bw.get(t);if(m!==void 0){var p=Im,w=t;switch(t){case"keypress":if(Uc(r)===0)break e;case"keydown":case"keyup":p=Wk;break;case"focusin":w="focus",p=hf;break;case"focusout":w="blur",p=hf;break;case"beforeblur":case"afterblur":p=hf;break;case"click":if(r.button===2)break e;case"auxclick":case"dblclick":case"mousedown":case"mousemove":case"mouseup":case"mouseout":case"mouseover":case"contextmenu":p=zg;break;case"drag":case"dragend":case"dragenter":case"dragexit":case"dragleave":case"dragover":case"dragstart":case"drop":p=Ik;break;case"touchcancel":case"touchend":case"touchmove":case"touchstart":p=Gk;break;case gw:case yw:case xw:p=$k;break;case ww:p=Yk;break;case"scroll":p=Ak;break;case"wheel":p=Xk;break;case"copy":case"cut":case"paste":p=Lk;break;case"gotpointercapture":case"lostpointercapture":case"pointercancel":case"pointerdown":case"pointermove":case"pointerout":case"pointerover":case"pointerup":p=qg}var h=(e&4)!==0,g=!h&&t==="scroll",v=h?m!==null?m+"Capture":null:m;h=[];for(var y=u,b;y!==null;){b=y;var S=b.stateNode;if(b.tag===5&&S!==null&&(b=S,v!==null&&(S=fl(y,v),S!=null&&h.push(xl(y,S,b)))),g)break;y=y.return}0<h.length&&(m=new p(m,w,null,r,d),f.push({event:m,listeners:h}))}}if(!(e&7)){e:{if(m=t==="mouseover"||t==="pointerover",p=t==="mouseout"||t==="pointerout",m&&r!==gh&&(w=r.relatedTarget||r.fromElement)&&(ka(w)||w[ss]))break e;if((p||m)&&(m=d.window===d?d:(m=d.ownerDocument)?m.defaultView||m.parentWindow:window,p?(w=r.relatedTarget||r.toElement,p=u,w=w?ka(w):null,w!==null&&(g=no(w),w!==g||w.tag!==5&&w.tag!==6)&&(w=null)):(p=null,w=u),p!==w)){if(h=zg,S="onMouseLeave",v="onMouseEnter",y="mouse",(t==="pointerout"||t==="pointerover")&&(h=qg,S="onPointerLeave",v="onPointerEnter",y="pointer"),g=p==null?m:Eo(p),b=w==null?m:Eo(w),m=new h(S,y+"leave",p,r,d),m.target=g,m.relatedTarget=b,S=null,ka(d)===u&&(h=new h(v,y+"enter",w,r,d),h.target=b,h.relatedTarget=g,S=h),g=S,p&&w)t:{for(h=p,v=w,y=0,b=h;b;b=lo(b))y++;for(b=0,S=v;S;S=lo(S))b++;for(;0<y-b;)h=lo(h),y--;for(;0<b-y;)v=lo(v),b--;for(;y--;){if(h===v||v!==null&&h===v.alternate)break t;h=lo(h),v=lo(v)}h=null}else h=null;p!==null&&ey(f,m,p,h,!1),w!==null&&g!==null&&ey(f,g,w,h,!0)}}e:{if(m=u?Eo(u):window,p=m.nodeName&&m.nodeName.toLowerCase(),p==="select"||p==="input"&&m.type==="file")var E=oP;else if(Wg(m))if(fw)E=uP;else{E=lP;var k=iP}else(p=m.nodeName)&&p.toLowerCase()==="input"&&(m.type==="checkbox"||m.type==="radio")&&(E=cP);if(E&&(E=E(t,u))){dw(f,E,r,d);break e}k&&k(t,m,u),t==="focusout"&&(k=m._wrapperState)&&k.controlled&&m.type==="number"&&fh(m,"number",m.value)}switch(k=u?Eo(u):window,t){case"focusin":(Wg(k)||k.contentEditable==="true")&&(So=k,Eh=u,tl=null);break;case"focusout":tl=Eh=So=null;break;case"mousedown":Ch=!0;break;case"contextmenu":case"mouseup":case"dragend":Ch=!1,Yg(f,r,d);break;case"selectionchange":if(hP)break;case"keydown":case"keyup":Yg(f,r,d)}var R;if(Mm)e:{switch(t){case"compositionstart":var T="onCompositionStart";break e;case"compositionend":T="onCompositionEnd";break e;case"compositionupdate":T="onCompositionUpdate";break e}T=void 0}else bo?cw(t,r)&&(T="onCompositionEnd"):t==="keydown"&&r.keyCode===229&&(T="onCompositionStart");T&&(lw&&r.locale!=="ko"&&(bo||T!=="onCompositionStart"?T==="onCompositionEnd"&&bo&&(R=iw()):(Us=d,Om="value"in Us?Us.value:Us.textContent,bo=!0)),k=hu(u,T),0<k.length&&(T=new Vg(T,t,null,r,d),f.push({event:T,listeners:k}),R?T.data=R:(R=uw(r),R!==null&&(T.data=R)))),(R=tP?rP(t,r):nP(t,r))&&(u=hu(u,"onBeforeInput"),0<u.length&&(d=new Vg("onBeforeInput","beforeinput",null,r,d),f.push({event:d,listeners:u}),d.data=R))}Sw(f,e)})}function xl(t,e,r){return{instance:t,listener:e,currentTarget:r}}function hu(t,e){for(var r=e+"Capture",s=[];t!==null;){var n=t,a=n.stateNode;n.tag===5&&a!==null&&(n=a,a=fl(t,r),a!=null&&s.unshift(xl(t,a,n)),a=fl(t,e),a!=null&&s.push(xl(t,a,n))),t=t.return}return s}function lo(t){if(t===null)return null;do t=t.return;while(t&&t.tag!==5);return t||null}function ey(t,e,r,s,n){for(var a=e._reactName,o=[];r!==null&&r!==s;){var l=r,c=l.alternate,u=l.stateNode;if(c!==null&&c===s)break;l.tag===5&&u!==null&&(l=u,n?(c=fl(r,a),c!=null&&o.unshift(xl(r,c,l))):n||(c=fl(r,a),c!=null&&o.push(xl(r,c,l)))),r=r.return}o.length!==0&&t.push({event:e,listeners:o})}var gP=/\r\n?/g,yP=/\u0000|\uFFFD/g;function ty(t){return(typeof t=="string"?t:""+t).replace(gP,`
|
|
38
|
+
`).replace(yP,"")}function pc(t,e,r){if(e=ty(e),ty(t)!==e&&r)throw Error(Y(425))}function pu(){}var kh=null,Ph=null;function Nh(t,e){return t==="textarea"||t==="noscript"||typeof e.children=="string"||typeof e.children=="number"||typeof e.dangerouslySetInnerHTML=="object"&&e.dangerouslySetInnerHTML!==null&&e.dangerouslySetInnerHTML.__html!=null}var jh=typeof setTimeout=="function"?setTimeout:void 0,xP=typeof clearTimeout=="function"?clearTimeout:void 0,ry=typeof Promise=="function"?Promise:void 0,wP=typeof queueMicrotask=="function"?queueMicrotask:typeof ry<"u"?function(t){return ry.resolve(null).then(t).catch(bP)}:jh;function bP(t){setTimeout(function(){throw t})}function bf(t,e){var r=e,s=0;do{var n=r.nextSibling;if(t.removeChild(r),n&&n.nodeType===8)if(r=n.data,r==="/$"){if(s===0){t.removeChild(n),ml(e);return}s--}else r!=="$"&&r!=="$?"&&r!=="$!"||s++;r=n}while(r);ml(e)}function Qs(t){for(;t!=null;t=t.nextSibling){var e=t.nodeType;if(e===1||e===3)break;if(e===8){if(e=t.data,e==="$"||e==="$!"||e==="$?")break;if(e==="/$")return null}}return t}function ny(t){t=t.previousSibling;for(var e=0;t;){if(t.nodeType===8){var r=t.data;if(r==="$"||r==="$!"||r==="$?"){if(e===0)return t;e--}else r==="/$"&&e++}t=t.previousSibling}return null}var wi=Math.random().toString(36).slice(2),wn="__reactFiber$"+wi,wl="__reactProps$"+wi,ss="__reactContainer$"+wi,Rh="__reactEvents$"+wi,SP="__reactListeners$"+wi,_P="__reactHandles$"+wi;function ka(t){var e=t[wn];if(e)return e;for(var r=t.parentNode;r;){if(e=r[ss]||r[wn]){if(r=e.alternate,e.child!==null||r!==null&&r.child!==null)for(t=ny(t);t!==null;){if(r=t[wn])return r;t=ny(t)}return e}t=r,r=t.parentNode}return null}function Ll(t){return t=t[wn]||t[ss],!t||t.tag!==5&&t.tag!==6&&t.tag!==13&&t.tag!==3?null:t}function Eo(t){if(t.tag===5||t.tag===6)return t.stateNode;throw Error(Y(33))}function pd(t){return t[wl]||null}var Th=[],Co=-1;function ca(t){return{current:t}}function ct(t){0>Co||(t.current=Th[Co],Th[Co]=null,Co--)}function st(t,e){Co++,Th[Co]=t.current,t.current=e}var sa={},Zt=ca(sa),mr=ca(!1),Ua=sa;function ai(t,e){var r=t.type.contextTypes;if(!r)return sa;var s=t.stateNode;if(s&&s.__reactInternalMemoizedUnmaskedChildContext===e)return s.__reactInternalMemoizedMaskedChildContext;var n={},a;for(a in r)n[a]=e[a];return s&&(t=t.stateNode,t.__reactInternalMemoizedUnmaskedChildContext=e,t.__reactInternalMemoizedMaskedChildContext=n),n}function vr(t){return t=t.childContextTypes,t!=null}function mu(){ct(mr),ct(Zt)}function sy(t,e,r){if(Zt.current!==sa)throw Error(Y(168));st(Zt,e),st(mr,r)}function Ew(t,e,r){var s=t.stateNode;if(e=e.childContextTypes,typeof s.getChildContext!="function")return r;s=s.getChildContext();for(var n in s)if(!(n in e))throw Error(Y(108,ik(t)||"Unknown",n));return gt({},r,s)}function vu(t){return t=(t=t.stateNode)&&t.__reactInternalMemoizedMergedChildContext||sa,Ua=Zt.current,st(Zt,t),st(mr,mr.current),!0}function ay(t,e,r){var s=t.stateNode;if(!s)throw Error(Y(169));r?(t=Ew(t,e,Ua),s.__reactInternalMemoizedMergedChildContext=t,ct(mr),ct(Zt),st(Zt,t)):ct(mr),st(mr,r)}var Bn=null,md=!1,Sf=!1;function Cw(t){Bn===null?Bn=[t]:Bn.push(t)}function EP(t){md=!0,Cw(t)}function ua(){if(!Sf&&Bn!==null){Sf=!0;var t=0,e=Xe;try{var r=Bn;for(Xe=1;t<r.length;t++){var s=r[t];do s=s(!0);while(s!==null)}Bn=null,md=!1}catch(n){throw Bn!==null&&(Bn=Bn.slice(t+1)),Zx(jm,ua),n}finally{Xe=e,Sf=!1}}return null}var ko=[],Po=0,gu=null,yu=0,Or=[],Ir=0,za=null,Zn=1,Yn="";function ba(t,e){ko[Po++]=yu,ko[Po++]=gu,gu=t,yu=e}function kw(t,e,r){Or[Ir++]=Zn,Or[Ir++]=Yn,Or[Ir++]=za,za=t;var s=Zn;t=Yn;var n=32-nn(s)-1;s&=~(1<<n),r+=1;var a=32-nn(e)+n;if(30<a){var o=n-n%5;a=(s&(1<<o)-1).toString(32),s>>=o,n-=o,Zn=1<<32-nn(e)+n|r<<n|s,Yn=a+t}else Zn=1<<a|r<<n|s,Yn=t}function Fm(t){t.return!==null&&(ba(t,1),kw(t,1,0))}function Lm(t){for(;t===gu;)gu=ko[--Po],ko[Po]=null,yu=ko[--Po],ko[Po]=null;for(;t===za;)za=Or[--Ir],Or[Ir]=null,Yn=Or[--Ir],Or[Ir]=null,Zn=Or[--Ir],Or[Ir]=null}var Er=null,_r=null,ht=!1,tn=null;function Pw(t,e){var r=Mr(5,null,null,0);r.elementType="DELETED",r.stateNode=e,r.return=t,e=t.deletions,e===null?(t.deletions=[r],t.flags|=16):e.push(r)}function oy(t,e){switch(t.tag){case 5:var r=t.type;return e=e.nodeType!==1||r.toLowerCase()!==e.nodeName.toLowerCase()?null:e,e!==null?(t.stateNode=e,Er=t,_r=Qs(e.firstChild),!0):!1;case 6:return e=t.pendingProps===""||e.nodeType!==3?null:e,e!==null?(t.stateNode=e,Er=t,_r=null,!0):!1;case 13:return e=e.nodeType!==8?null:e,e!==null?(r=za!==null?{id:Zn,overflow:Yn}:null,t.memoizedState={dehydrated:e,treeContext:r,retryLane:1073741824},r=Mr(18,null,null,0),r.stateNode=e,r.return=t,t.child=r,Er=t,_r=null,!0):!1;default:return!1}}function Ah(t){return(t.mode&1)!==0&&(t.flags&128)===0}function Oh(t){if(ht){var e=_r;if(e){var r=e;if(!oy(t,e)){if(Ah(t))throw Error(Y(418));e=Qs(r.nextSibling);var s=Er;e&&oy(t,e)?Pw(s,r):(t.flags=t.flags&-4097|2,ht=!1,Er=t)}}else{if(Ah(t))throw Error(Y(418));t.flags=t.flags&-4097|2,ht=!1,Er=t}}}function iy(t){for(t=t.return;t!==null&&t.tag!==5&&t.tag!==3&&t.tag!==13;)t=t.return;Er=t}function mc(t){if(t!==Er)return!1;if(!ht)return iy(t),ht=!0,!1;var e;if((e=t.tag!==3)&&!(e=t.tag!==5)&&(e=t.type,e=e!=="head"&&e!=="body"&&!Nh(t.type,t.memoizedProps)),e&&(e=_r)){if(Ah(t))throw Nw(),Error(Y(418));for(;e;)Pw(t,e),e=Qs(e.nextSibling)}if(iy(t),t.tag===13){if(t=t.memoizedState,t=t!==null?t.dehydrated:null,!t)throw Error(Y(317));e:{for(t=t.nextSibling,e=0;t;){if(t.nodeType===8){var r=t.data;if(r==="/$"){if(e===0){_r=Qs(t.nextSibling);break e}e--}else r!=="$"&&r!=="$!"&&r!=="$?"||e++}t=t.nextSibling}_r=null}}else _r=Er?Qs(t.stateNode.nextSibling):null;return!0}function Nw(){for(var t=_r;t;)t=Qs(t.nextSibling)}function oi(){_r=Er=null,ht=!1}function Um(t){tn===null?tn=[t]:tn.push(t)}var CP=ds.ReactCurrentBatchConfig;function Di(t,e,r){if(t=r.ref,t!==null&&typeof t!="function"&&typeof t!="object"){if(r._owner){if(r=r._owner,r){if(r.tag!==1)throw Error(Y(309));var s=r.stateNode}if(!s)throw Error(Y(147,t));var n=s,a=""+t;return e!==null&&e.ref!==null&&typeof e.ref=="function"&&e.ref._stringRef===a?e.ref:(e=function(o){var l=n.refs;o===null?delete l[a]:l[a]=o},e._stringRef=a,e)}if(typeof t!="string")throw Error(Y(284));if(!r._owner)throw Error(Y(290,t))}return t}function vc(t,e){throw t=Object.prototype.toString.call(e),Error(Y(31,t==="[object Object]"?"object with keys {"+Object.keys(e).join(", ")+"}":t))}function ly(t){var e=t._init;return e(t._payload)}function jw(t){function e(v,y){if(t){var b=v.deletions;b===null?(v.deletions=[y],v.flags|=16):b.push(y)}}function r(v,y){if(!t)return null;for(;y!==null;)e(v,y),y=y.sibling;return null}function s(v,y){for(v=new Map;y!==null;)y.key!==null?v.set(y.key,y):v.set(y.index,y),y=y.sibling;return v}function n(v,y){return v=Js(v,y),v.index=0,v.sibling=null,v}function a(v,y,b){return v.index=b,t?(b=v.alternate,b!==null?(b=b.index,b<y?(v.flags|=2,y):b):(v.flags|=2,y)):(v.flags|=1048576,y)}function o(v){return t&&v.alternate===null&&(v.flags|=2),v}function l(v,y,b,S){return y===null||y.tag!==6?(y=jf(b,v.mode,S),y.return=v,y):(y=n(y,b),y.return=v,y)}function c(v,y,b,S){var E=b.type;return E===wo?d(v,y,b.props.children,S,b.key):y!==null&&(y.elementType===E||typeof E=="object"&&E!==null&&E.$$typeof===_s&&ly(E)===y.type)?(S=n(y,b.props),S.ref=Di(v,y,b),S.return=v,S):(S=Kc(b.type,b.key,b.props,null,v.mode,S),S.ref=Di(v,y,b),S.return=v,S)}function u(v,y,b,S){return y===null||y.tag!==4||y.stateNode.containerInfo!==b.containerInfo||y.stateNode.implementation!==b.implementation?(y=Rf(b,v.mode,S),y.return=v,y):(y=n(y,b.children||[]),y.return=v,y)}function d(v,y,b,S,E){return y===null||y.tag!==7?(y=Fa(b,v.mode,S,E),y.return=v,y):(y=n(y,b),y.return=v,y)}function f(v,y,b){if(typeof y=="string"&&y!==""||typeof y=="number")return y=jf(""+y,v.mode,b),y.return=v,y;if(typeof y=="object"&&y!==null){switch(y.$$typeof){case ac:return b=Kc(y.type,y.key,y.props,null,v.mode,b),b.ref=Di(v,null,y),b.return=v,b;case xo:return y=Rf(y,v.mode,b),y.return=v,y;case _s:var S=y._init;return f(v,S(y._payload),b)}if(Vi(y)||Ri(y))return y=Fa(y,v.mode,b,null),y.return=v,y;vc(v,y)}return null}function m(v,y,b,S){var E=y!==null?y.key:null;if(typeof b=="string"&&b!==""||typeof b=="number")return E!==null?null:l(v,y,""+b,S);if(typeof b=="object"&&b!==null){switch(b.$$typeof){case ac:return b.key===E?c(v,y,b,S):null;case xo:return b.key===E?u(v,y,b,S):null;case _s:return E=b._init,m(v,y,E(b._payload),S)}if(Vi(b)||Ri(b))return E!==null?null:d(v,y,b,S,null);vc(v,b)}return null}function p(v,y,b,S,E){if(typeof S=="string"&&S!==""||typeof S=="number")return v=v.get(b)||null,l(y,v,""+S,E);if(typeof S=="object"&&S!==null){switch(S.$$typeof){case ac:return v=v.get(S.key===null?b:S.key)||null,c(y,v,S,E);case xo:return v=v.get(S.key===null?b:S.key)||null,u(y,v,S,E);case _s:var k=S._init;return p(v,y,b,k(S._payload),E)}if(Vi(S)||Ri(S))return v=v.get(b)||null,d(y,v,S,E,null);vc(y,S)}return null}function w(v,y,b,S){for(var E=null,k=null,R=y,T=y=0,N=null;R!==null&&T<b.length;T++){R.index>T?(N=R,R=null):N=R.sibling;var O=m(v,R,b[T],S);if(O===null){R===null&&(R=N);break}t&&R&&O.alternate===null&&e(v,R),y=a(O,y,T),k===null?E=O:k.sibling=O,k=O,R=N}if(T===b.length)return r(v,R),ht&&ba(v,T),E;if(R===null){for(;T<b.length;T++)R=f(v,b[T],S),R!==null&&(y=a(R,y,T),k===null?E=R:k.sibling=R,k=R);return ht&&ba(v,T),E}for(R=s(v,R);T<b.length;T++)N=p(R,v,T,b[T],S),N!==null&&(t&&N.alternate!==null&&R.delete(N.key===null?T:N.key),y=a(N,y,T),k===null?E=N:k.sibling=N,k=N);return t&&R.forEach(function(j){return e(v,j)}),ht&&ba(v,T),E}function h(v,y,b,S){var E=Ri(b);if(typeof E!="function")throw Error(Y(150));if(b=E.call(b),b==null)throw Error(Y(151));for(var k=E=null,R=y,T=y=0,N=null,O=b.next();R!==null&&!O.done;T++,O=b.next()){R.index>T?(N=R,R=null):N=R.sibling;var j=m(v,R,O.value,S);if(j===null){R===null&&(R=N);break}t&&R&&j.alternate===null&&e(v,R),y=a(j,y,T),k===null?E=j:k.sibling=j,k=j,R=N}if(O.done)return r(v,R),ht&&ba(v,T),E;if(R===null){for(;!O.done;T++,O=b.next())O=f(v,O.value,S),O!==null&&(y=a(O,y,T),k===null?E=O:k.sibling=O,k=O);return ht&&ba(v,T),E}for(R=s(v,R);!O.done;T++,O=b.next())O=p(R,v,T,O.value,S),O!==null&&(t&&O.alternate!==null&&R.delete(O.key===null?T:O.key),y=a(O,y,T),k===null?E=O:k.sibling=O,k=O);return t&&R.forEach(function(_){return e(v,_)}),ht&&ba(v,T),E}function g(v,y,b,S){if(typeof b=="object"&&b!==null&&b.type===wo&&b.key===null&&(b=b.props.children),typeof b=="object"&&b!==null){switch(b.$$typeof){case ac:e:{for(var E=b.key,k=y;k!==null;){if(k.key===E){if(E=b.type,E===wo){if(k.tag===7){r(v,k.sibling),y=n(k,b.props.children),y.return=v,v=y;break e}}else if(k.elementType===E||typeof E=="object"&&E!==null&&E.$$typeof===_s&&ly(E)===k.type){r(v,k.sibling),y=n(k,b.props),y.ref=Di(v,k,b),y.return=v,v=y;break e}r(v,k);break}else e(v,k);k=k.sibling}b.type===wo?(y=Fa(b.props.children,v.mode,S,b.key),y.return=v,v=y):(S=Kc(b.type,b.key,b.props,null,v.mode,S),S.ref=Di(v,y,b),S.return=v,v=S)}return o(v);case xo:e:{for(k=b.key;y!==null;){if(y.key===k)if(y.tag===4&&y.stateNode.containerInfo===b.containerInfo&&y.stateNode.implementation===b.implementation){r(v,y.sibling),y=n(y,b.children||[]),y.return=v,v=y;break e}else{r(v,y);break}else e(v,y);y=y.sibling}y=Rf(b,v.mode,S),y.return=v,v=y}return o(v);case _s:return k=b._init,g(v,y,k(b._payload),S)}if(Vi(b))return w(v,y,b,S);if(Ri(b))return h(v,y,b,S);vc(v,b)}return typeof b=="string"&&b!==""||typeof b=="number"?(b=""+b,y!==null&&y.tag===6?(r(v,y.sibling),y=n(y,b),y.return=v,v=y):(r(v,y),y=jf(b,v.mode,S),y.return=v,v=y),o(v)):r(v,y)}return g}var ii=jw(!0),Rw=jw(!1),xu=ca(null),wu=null,No=null,zm=null;function Vm(){zm=No=wu=null}function qm(t){var e=xu.current;ct(xu),t._currentValue=e}function Ih(t,e,r){for(;t!==null;){var s=t.alternate;if((t.childLanes&e)!==e?(t.childLanes|=e,s!==null&&(s.childLanes|=e)):s!==null&&(s.childLanes&e)!==e&&(s.childLanes|=e),t===r)break;t=t.return}}function Fo(t,e){wu=t,zm=No=null,t=t.dependencies,t!==null&&t.firstContext!==null&&(t.lanes&e&&(pr=!0),t.firstContext=null)}function Fr(t){var e=t._currentValue;if(zm!==t)if(t={context:t,memoizedValue:e,next:null},No===null){if(wu===null)throw Error(Y(308));No=t,wu.dependencies={lanes:0,firstContext:t}}else No=No.next=t;return e}var Pa=null;function Hm(t){Pa===null?Pa=[t]:Pa.push(t)}function Tw(t,e,r,s){var n=e.interleaved;return n===null?(r.next=r,Hm(e)):(r.next=n.next,n.next=r),e.interleaved=r,as(t,s)}function as(t,e){t.lanes|=e;var r=t.alternate;for(r!==null&&(r.lanes|=e),r=t,t=t.return;t!==null;)t.childLanes|=e,r=t.alternate,r!==null&&(r.childLanes|=e),r=t,t=t.return;return r.tag===3?r.stateNode:null}var Es=!1;function Bm(t){t.updateQueue={baseState:t.memoizedState,firstBaseUpdate:null,lastBaseUpdate:null,shared:{pending:null,interleaved:null,lanes:0},effects:null}}function Aw(t,e){t=t.updateQueue,e.updateQueue===t&&(e.updateQueue={baseState:t.baseState,firstBaseUpdate:t.firstBaseUpdate,lastBaseUpdate:t.lastBaseUpdate,shared:t.shared,effects:t.effects})}function es(t,e){return{eventTime:t,lane:e,tag:0,payload:null,callback:null,next:null}}function Gs(t,e,r){var s=t.updateQueue;if(s===null)return null;if(s=s.shared,Ze&2){var n=s.pending;return n===null?e.next=e:(e.next=n.next,n.next=e),s.pending=e,as(t,r)}return n=s.interleaved,n===null?(e.next=e,Hm(s)):(e.next=n.next,n.next=e),s.interleaved=e,as(t,r)}function zc(t,e,r){if(e=e.updateQueue,e!==null&&(e=e.shared,(r&4194240)!==0)){var s=e.lanes;s&=t.pendingLanes,r|=s,e.lanes=r,Rm(t,r)}}function cy(t,e){var r=t.updateQueue,s=t.alternate;if(s!==null&&(s=s.updateQueue,r===s)){var n=null,a=null;if(r=r.firstBaseUpdate,r!==null){do{var o={eventTime:r.eventTime,lane:r.lane,tag:r.tag,payload:r.payload,callback:r.callback,next:null};a===null?n=a=o:a=a.next=o,r=r.next}while(r!==null);a===null?n=a=e:a=a.next=e}else n=a=e;r={baseState:s.baseState,firstBaseUpdate:n,lastBaseUpdate:a,shared:s.shared,effects:s.effects},t.updateQueue=r;return}t=r.lastBaseUpdate,t===null?r.firstBaseUpdate=e:t.next=e,r.lastBaseUpdate=e}function bu(t,e,r,s){var n=t.updateQueue;Es=!1;var a=n.firstBaseUpdate,o=n.lastBaseUpdate,l=n.shared.pending;if(l!==null){n.shared.pending=null;var c=l,u=c.next;c.next=null,o===null?a=u:o.next=u,o=c;var d=t.alternate;d!==null&&(d=d.updateQueue,l=d.lastBaseUpdate,l!==o&&(l===null?d.firstBaseUpdate=u:l.next=u,d.lastBaseUpdate=c))}if(a!==null){var f=n.baseState;o=0,d=u=c=null,l=a;do{var m=l.lane,p=l.eventTime;if((s&m)===m){d!==null&&(d=d.next={eventTime:p,lane:0,tag:l.tag,payload:l.payload,callback:l.callback,next:null});e:{var w=t,h=l;switch(m=e,p=r,h.tag){case 1:if(w=h.payload,typeof w=="function"){f=w.call(p,f,m);break e}f=w;break e;case 3:w.flags=w.flags&-65537|128;case 0:if(w=h.payload,m=typeof w=="function"?w.call(p,f,m):w,m==null)break e;f=gt({},f,m);break e;case 2:Es=!0}}l.callback!==null&&l.lane!==0&&(t.flags|=64,m=n.effects,m===null?n.effects=[l]:m.push(l))}else p={eventTime:p,lane:m,tag:l.tag,payload:l.payload,callback:l.callback,next:null},d===null?(u=d=p,c=f):d=d.next=p,o|=m;if(l=l.next,l===null){if(l=n.shared.pending,l===null)break;m=l,l=m.next,m.next=null,n.lastBaseUpdate=m,n.shared.pending=null}}while(!0);if(d===null&&(c=f),n.baseState=c,n.firstBaseUpdate=u,n.lastBaseUpdate=d,e=n.shared.interleaved,e!==null){n=e;do o|=n.lane,n=n.next;while(n!==e)}else a===null&&(n.shared.lanes=0);qa|=o,t.lanes=o,t.memoizedState=f}}function uy(t,e,r){if(t=e.effects,e.effects=null,t!==null)for(e=0;e<t.length;e++){var s=t[e],n=s.callback;if(n!==null){if(s.callback=null,s=r,typeof n!="function")throw Error(Y(191,n));n.call(s)}}}var Ul={},Nn=ca(Ul),bl=ca(Ul),Sl=ca(Ul);function Na(t){if(t===Ul)throw Error(Y(174));return t}function Wm(t,e){switch(st(Sl,e),st(bl,t),st(Nn,Ul),t=e.nodeType,t){case 9:case 11:e=(e=e.documentElement)?e.namespaceURI:ph(null,"");break;default:t=t===8?e.parentNode:e,e=t.namespaceURI||null,t=t.tagName,e=ph(e,t)}ct(Nn),st(Nn,e)}function li(){ct(Nn),ct(bl),ct(Sl)}function Ow(t){Na(Sl.current);var e=Na(Nn.current),r=ph(e,t.type);e!==r&&(st(bl,t),st(Nn,r))}function Km(t){bl.current===t&&(ct(Nn),ct(bl))}var mt=ca(0);function Su(t){for(var e=t;e!==null;){if(e.tag===13){var r=e.memoizedState;if(r!==null&&(r=r.dehydrated,r===null||r.data==="$?"||r.data==="$!"))return e}else if(e.tag===19&&e.memoizedProps.revealOrder!==void 0){if(e.flags&128)return e}else if(e.child!==null){e.child.return=e,e=e.child;continue}if(e===t)break;for(;e.sibling===null;){if(e.return===null||e.return===t)return null;e=e.return}e.sibling.return=e.return,e=e.sibling}return null}var _f=[];function Qm(){for(var t=0;t<_f.length;t++)_f[t]._workInProgressVersionPrimary=null;_f.length=0}var Vc=ds.ReactCurrentDispatcher,Ef=ds.ReactCurrentBatchConfig,Va=0,vt=null,Rt=null,$t=null,_u=!1,rl=!1,_l=0,kP=0;function Kt(){throw Error(Y(321))}function Gm(t,e){if(e===null)return!1;for(var r=0;r<e.length&&r<t.length;r++)if(!an(t[r],e[r]))return!1;return!0}function Zm(t,e,r,s,n,a){if(Va=a,vt=e,e.memoizedState=null,e.updateQueue=null,e.lanes=0,Vc.current=t===null||t.memoizedState===null?RP:TP,t=r(s,n),rl){a=0;do{if(rl=!1,_l=0,25<=a)throw Error(Y(301));a+=1,$t=Rt=null,e.updateQueue=null,Vc.current=AP,t=r(s,n)}while(rl)}if(Vc.current=Eu,e=Rt!==null&&Rt.next!==null,Va=0,$t=Rt=vt=null,_u=!1,e)throw Error(Y(300));return t}function Ym(){var t=_l!==0;return _l=0,t}function mn(){var t={memoizedState:null,baseState:null,baseQueue:null,queue:null,next:null};return $t===null?vt.memoizedState=$t=t:$t=$t.next=t,$t}function Lr(){if(Rt===null){var t=vt.alternate;t=t!==null?t.memoizedState:null}else t=Rt.next;var e=$t===null?vt.memoizedState:$t.next;if(e!==null)$t=e,Rt=t;else{if(t===null)throw Error(Y(310));Rt=t,t={memoizedState:Rt.memoizedState,baseState:Rt.baseState,baseQueue:Rt.baseQueue,queue:Rt.queue,next:null},$t===null?vt.memoizedState=$t=t:$t=$t.next=t}return $t}function El(t,e){return typeof e=="function"?e(t):e}function Cf(t){var e=Lr(),r=e.queue;if(r===null)throw Error(Y(311));r.lastRenderedReducer=t;var s=Rt,n=s.baseQueue,a=r.pending;if(a!==null){if(n!==null){var o=n.next;n.next=a.next,a.next=o}s.baseQueue=n=a,r.pending=null}if(n!==null){a=n.next,s=s.baseState;var l=o=null,c=null,u=a;do{var d=u.lane;if((Va&d)===d)c!==null&&(c=c.next={lane:0,action:u.action,hasEagerState:u.hasEagerState,eagerState:u.eagerState,next:null}),s=u.hasEagerState?u.eagerState:t(s,u.action);else{var f={lane:d,action:u.action,hasEagerState:u.hasEagerState,eagerState:u.eagerState,next:null};c===null?(l=c=f,o=s):c=c.next=f,vt.lanes|=d,qa|=d}u=u.next}while(u!==null&&u!==a);c===null?o=s:c.next=l,an(s,e.memoizedState)||(pr=!0),e.memoizedState=s,e.baseState=o,e.baseQueue=c,r.lastRenderedState=s}if(t=r.interleaved,t!==null){n=t;do a=n.lane,vt.lanes|=a,qa|=a,n=n.next;while(n!==t)}else n===null&&(r.lanes=0);return[e.memoizedState,r.dispatch]}function kf(t){var e=Lr(),r=e.queue;if(r===null)throw Error(Y(311));r.lastRenderedReducer=t;var s=r.dispatch,n=r.pending,a=e.memoizedState;if(n!==null){r.pending=null;var o=n=n.next;do a=t(a,o.action),o=o.next;while(o!==n);an(a,e.memoizedState)||(pr=!0),e.memoizedState=a,e.baseQueue===null&&(e.baseState=a),r.lastRenderedState=a}return[a,s]}function Iw(){}function Dw(t,e){var r=vt,s=Lr(),n=e(),a=!an(s.memoizedState,n);if(a&&(s.memoizedState=n,pr=!0),s=s.queue,Jm(Fw.bind(null,r,s,t),[t]),s.getSnapshot!==e||a||$t!==null&&$t.memoizedState.tag&1){if(r.flags|=2048,Cl(9,$w.bind(null,r,s,n,e),void 0,null),Lt===null)throw Error(Y(349));Va&30||Mw(r,e,n)}return n}function Mw(t,e,r){t.flags|=16384,t={getSnapshot:e,value:r},e=vt.updateQueue,e===null?(e={lastEffect:null,stores:null},vt.updateQueue=e,e.stores=[t]):(r=e.stores,r===null?e.stores=[t]:r.push(t))}function $w(t,e,r,s){e.value=r,e.getSnapshot=s,Lw(e)&&Uw(t)}function Fw(t,e,r){return r(function(){Lw(e)&&Uw(t)})}function Lw(t){var e=t.getSnapshot;t=t.value;try{var r=e();return!an(t,r)}catch{return!0}}function Uw(t){var e=as(t,1);e!==null&&sn(e,t,1,-1)}function dy(t){var e=mn();return typeof t=="function"&&(t=t()),e.memoizedState=e.baseState=t,t={pending:null,interleaved:null,lanes:0,dispatch:null,lastRenderedReducer:El,lastRenderedState:t},e.queue=t,t=t.dispatch=jP.bind(null,vt,t),[e.memoizedState,t]}function Cl(t,e,r,s){return t={tag:t,create:e,destroy:r,deps:s,next:null},e=vt.updateQueue,e===null?(e={lastEffect:null,stores:null},vt.updateQueue=e,e.lastEffect=t.next=t):(r=e.lastEffect,r===null?e.lastEffect=t.next=t:(s=r.next,r.next=t,t.next=s,e.lastEffect=t)),t}function zw(){return Lr().memoizedState}function qc(t,e,r,s){var n=mn();vt.flags|=t,n.memoizedState=Cl(1|e,r,void 0,s===void 0?null:s)}function vd(t,e,r,s){var n=Lr();s=s===void 0?null:s;var a=void 0;if(Rt!==null){var o=Rt.memoizedState;if(a=o.destroy,s!==null&&Gm(s,o.deps)){n.memoizedState=Cl(e,r,a,s);return}}vt.flags|=t,n.memoizedState=Cl(1|e,r,a,s)}function fy(t,e){return qc(8390656,8,t,e)}function Jm(t,e){return vd(2048,8,t,e)}function Vw(t,e){return vd(4,2,t,e)}function qw(t,e){return vd(4,4,t,e)}function Hw(t,e){if(typeof e=="function")return t=t(),e(t),function(){e(null)};if(e!=null)return t=t(),e.current=t,function(){e.current=null}}function Bw(t,e,r){return r=r!=null?r.concat([t]):null,vd(4,4,Hw.bind(null,e,t),r)}function Xm(){}function Ww(t,e){var r=Lr();e=e===void 0?null:e;var s=r.memoizedState;return s!==null&&e!==null&&Gm(e,s[1])?s[0]:(r.memoizedState=[t,e],t)}function Kw(t,e){var r=Lr();e=e===void 0?null:e;var s=r.memoizedState;return s!==null&&e!==null&&Gm(e,s[1])?s[0]:(t=t(),r.memoizedState=[t,e],t)}function Qw(t,e,r){return Va&21?(an(r,e)||(r=Xx(),vt.lanes|=r,qa|=r,t.baseState=!0),e):(t.baseState&&(t.baseState=!1,pr=!0),t.memoizedState=r)}function PP(t,e){var r=Xe;Xe=r!==0&&4>r?r:4,t(!0);var s=Ef.transition;Ef.transition={};try{t(!1),e()}finally{Xe=r,Ef.transition=s}}function Gw(){return Lr().memoizedState}function NP(t,e,r){var s=Ys(t);if(r={lane:s,action:r,hasEagerState:!1,eagerState:null,next:null},Zw(t))Yw(e,r);else if(r=Tw(t,e,r,s),r!==null){var n=rr();sn(r,t,s,n),Jw(r,e,s)}}function jP(t,e,r){var s=Ys(t),n={lane:s,action:r,hasEagerState:!1,eagerState:null,next:null};if(Zw(t))Yw(e,n);else{var a=t.alternate;if(t.lanes===0&&(a===null||a.lanes===0)&&(a=e.lastRenderedReducer,a!==null))try{var o=e.lastRenderedState,l=a(o,r);if(n.hasEagerState=!0,n.eagerState=l,an(l,o)){var c=e.interleaved;c===null?(n.next=n,Hm(e)):(n.next=c.next,c.next=n),e.interleaved=n;return}}catch{}finally{}r=Tw(t,e,n,s),r!==null&&(n=rr(),sn(r,t,s,n),Jw(r,e,s))}}function Zw(t){var e=t.alternate;return t===vt||e!==null&&e===vt}function Yw(t,e){rl=_u=!0;var r=t.pending;r===null?e.next=e:(e.next=r.next,r.next=e),t.pending=e}function Jw(t,e,r){if(r&4194240){var s=e.lanes;s&=t.pendingLanes,r|=s,e.lanes=r,Rm(t,r)}}var Eu={readContext:Fr,useCallback:Kt,useContext:Kt,useEffect:Kt,useImperativeHandle:Kt,useInsertionEffect:Kt,useLayoutEffect:Kt,useMemo:Kt,useReducer:Kt,useRef:Kt,useState:Kt,useDebugValue:Kt,useDeferredValue:Kt,useTransition:Kt,useMutableSource:Kt,useSyncExternalStore:Kt,useId:Kt,unstable_isNewReconciler:!1},RP={readContext:Fr,useCallback:function(t,e){return mn().memoizedState=[t,e===void 0?null:e],t},useContext:Fr,useEffect:fy,useImperativeHandle:function(t,e,r){return r=r!=null?r.concat([t]):null,qc(4194308,4,Hw.bind(null,e,t),r)},useLayoutEffect:function(t,e){return qc(4194308,4,t,e)},useInsertionEffect:function(t,e){return qc(4,2,t,e)},useMemo:function(t,e){var r=mn();return e=e===void 0?null:e,t=t(),r.memoizedState=[t,e],t},useReducer:function(t,e,r){var s=mn();return e=r!==void 0?r(e):e,s.memoizedState=s.baseState=e,t={pending:null,interleaved:null,lanes:0,dispatch:null,lastRenderedReducer:t,lastRenderedState:e},s.queue=t,t=t.dispatch=NP.bind(null,vt,t),[s.memoizedState,t]},useRef:function(t){var e=mn();return t={current:t},e.memoizedState=t},useState:dy,useDebugValue:Xm,useDeferredValue:function(t){return mn().memoizedState=t},useTransition:function(){var t=dy(!1),e=t[0];return t=PP.bind(null,t[1]),mn().memoizedState=t,[e,t]},useMutableSource:function(){},useSyncExternalStore:function(t,e,r){var s=vt,n=mn();if(ht){if(r===void 0)throw Error(Y(407));r=r()}else{if(r=e(),Lt===null)throw Error(Y(349));Va&30||Mw(s,e,r)}n.memoizedState=r;var a={value:r,getSnapshot:e};return n.queue=a,fy(Fw.bind(null,s,a,t),[t]),s.flags|=2048,Cl(9,$w.bind(null,s,a,r,e),void 0,null),r},useId:function(){var t=mn(),e=Lt.identifierPrefix;if(ht){var r=Yn,s=Zn;r=(s&~(1<<32-nn(s)-1)).toString(32)+r,e=":"+e+"R"+r,r=_l++,0<r&&(e+="H"+r.toString(32)),e+=":"}else r=kP++,e=":"+e+"r"+r.toString(32)+":";return t.memoizedState=e},unstable_isNewReconciler:!1},TP={readContext:Fr,useCallback:Ww,useContext:Fr,useEffect:Jm,useImperativeHandle:Bw,useInsertionEffect:Vw,useLayoutEffect:qw,useMemo:Kw,useReducer:Cf,useRef:zw,useState:function(){return Cf(El)},useDebugValue:Xm,useDeferredValue:function(t){var e=Lr();return Qw(e,Rt.memoizedState,t)},useTransition:function(){var t=Cf(El)[0],e=Lr().memoizedState;return[t,e]},useMutableSource:Iw,useSyncExternalStore:Dw,useId:Gw,unstable_isNewReconciler:!1},AP={readContext:Fr,useCallback:Ww,useContext:Fr,useEffect:Jm,useImperativeHandle:Bw,useInsertionEffect:Vw,useLayoutEffect:qw,useMemo:Kw,useReducer:kf,useRef:zw,useState:function(){return kf(El)},useDebugValue:Xm,useDeferredValue:function(t){var e=Lr();return Rt===null?e.memoizedState=t:Qw(e,Rt.memoizedState,t)},useTransition:function(){var t=kf(El)[0],e=Lr().memoizedState;return[t,e]},useMutableSource:Iw,useSyncExternalStore:Dw,useId:Gw,unstable_isNewReconciler:!1};function Zr(t,e){if(t&&t.defaultProps){e=gt({},e),t=t.defaultProps;for(var r in t)e[r]===void 0&&(e[r]=t[r]);return e}return e}function Dh(t,e,r,s){e=t.memoizedState,r=r(s,e),r=r==null?e:gt({},e,r),t.memoizedState=r,t.lanes===0&&(t.updateQueue.baseState=r)}var gd={isMounted:function(t){return(t=t._reactInternals)?no(t)===t:!1},enqueueSetState:function(t,e,r){t=t._reactInternals;var s=rr(),n=Ys(t),a=es(s,n);a.payload=e,r!=null&&(a.callback=r),e=Gs(t,a,n),e!==null&&(sn(e,t,n,s),zc(e,t,n))},enqueueReplaceState:function(t,e,r){t=t._reactInternals;var s=rr(),n=Ys(t),a=es(s,n);a.tag=1,a.payload=e,r!=null&&(a.callback=r),e=Gs(t,a,n),e!==null&&(sn(e,t,n,s),zc(e,t,n))},enqueueForceUpdate:function(t,e){t=t._reactInternals;var r=rr(),s=Ys(t),n=es(r,s);n.tag=2,e!=null&&(n.callback=e),e=Gs(t,n,s),e!==null&&(sn(e,t,s,r),zc(e,t,s))}};function hy(t,e,r,s,n,a,o){return t=t.stateNode,typeof t.shouldComponentUpdate=="function"?t.shouldComponentUpdate(s,a,o):e.prototype&&e.prototype.isPureReactComponent?!gl(r,s)||!gl(n,a):!0}function Xw(t,e,r){var s=!1,n=sa,a=e.contextType;return typeof a=="object"&&a!==null?a=Fr(a):(n=vr(e)?Ua:Zt.current,s=e.contextTypes,a=(s=s!=null)?ai(t,n):sa),e=new e(r,a),t.memoizedState=e.state!==null&&e.state!==void 0?e.state:null,e.updater=gd,t.stateNode=e,e._reactInternals=t,s&&(t=t.stateNode,t.__reactInternalMemoizedUnmaskedChildContext=n,t.__reactInternalMemoizedMaskedChildContext=a),e}function py(t,e,r,s){t=e.state,typeof e.componentWillReceiveProps=="function"&&e.componentWillReceiveProps(r,s),typeof e.UNSAFE_componentWillReceiveProps=="function"&&e.UNSAFE_componentWillReceiveProps(r,s),e.state!==t&&gd.enqueueReplaceState(e,e.state,null)}function Mh(t,e,r,s){var n=t.stateNode;n.props=r,n.state=t.memoizedState,n.refs={},Bm(t);var a=e.contextType;typeof a=="object"&&a!==null?n.context=Fr(a):(a=vr(e)?Ua:Zt.current,n.context=ai(t,a)),n.state=t.memoizedState,a=e.getDerivedStateFromProps,typeof a=="function"&&(Dh(t,e,a,r),n.state=t.memoizedState),typeof e.getDerivedStateFromProps=="function"||typeof n.getSnapshotBeforeUpdate=="function"||typeof n.UNSAFE_componentWillMount!="function"&&typeof n.componentWillMount!="function"||(e=n.state,typeof n.componentWillMount=="function"&&n.componentWillMount(),typeof n.UNSAFE_componentWillMount=="function"&&n.UNSAFE_componentWillMount(),e!==n.state&&gd.enqueueReplaceState(n,n.state,null),bu(t,r,n,s),n.state=t.memoizedState),typeof n.componentDidMount=="function"&&(t.flags|=4194308)}function ci(t,e){try{var r="",s=e;do r+=ok(s),s=s.return;while(s);var n=r}catch(a){n=`
|
|
39
|
+
Error generating stack: `+a.message+`
|
|
40
|
+
`+a.stack}return{value:t,source:e,stack:n,digest:null}}function Pf(t,e,r){return{value:t,source:null,stack:r??null,digest:e??null}}function $h(t,e){try{console.error(e.value)}catch(r){setTimeout(function(){throw r})}}var OP=typeof WeakMap=="function"?WeakMap:Map;function eb(t,e,r){r=es(-1,r),r.tag=3,r.payload={element:null};var s=e.value;return r.callback=function(){ku||(ku=!0,Kh=s),$h(t,e)},r}function tb(t,e,r){r=es(-1,r),r.tag=3;var s=t.type.getDerivedStateFromError;if(typeof s=="function"){var n=e.value;r.payload=function(){return s(n)},r.callback=function(){$h(t,e)}}var a=t.stateNode;return a!==null&&typeof a.componentDidCatch=="function"&&(r.callback=function(){$h(t,e),typeof s!="function"&&(Zs===null?Zs=new Set([this]):Zs.add(this));var o=e.stack;this.componentDidCatch(e.value,{componentStack:o!==null?o:""})}),r}function my(t,e,r){var s=t.pingCache;if(s===null){s=t.pingCache=new OP;var n=new Set;s.set(e,n)}else n=s.get(e),n===void 0&&(n=new Set,s.set(e,n));n.has(r)||(n.add(r),t=KP.bind(null,t,e,r),e.then(t,t))}function vy(t){do{var e;if((e=t.tag===13)&&(e=t.memoizedState,e=e!==null?e.dehydrated!==null:!0),e)return t;t=t.return}while(t!==null);return null}function gy(t,e,r,s,n){return t.mode&1?(t.flags|=65536,t.lanes=n,t):(t===e?t.flags|=65536:(t.flags|=128,r.flags|=131072,r.flags&=-52805,r.tag===1&&(r.alternate===null?r.tag=17:(e=es(-1,1),e.tag=2,Gs(r,e,1))),r.lanes|=1),t)}var IP=ds.ReactCurrentOwner,pr=!1;function er(t,e,r,s){e.child=t===null?Rw(e,null,r,s):ii(e,t.child,r,s)}function yy(t,e,r,s,n){r=r.render;var a=e.ref;return Fo(e,n),s=Zm(t,e,r,s,a,n),r=Ym(),t!==null&&!pr?(e.updateQueue=t.updateQueue,e.flags&=-2053,t.lanes&=~n,os(t,e,n)):(ht&&r&&Fm(e),e.flags|=1,er(t,e,s,n),e.child)}function xy(t,e,r,s,n){if(t===null){var a=r.type;return typeof a=="function"&&!iv(a)&&a.defaultProps===void 0&&r.compare===null&&r.defaultProps===void 0?(e.tag=15,e.type=a,rb(t,e,a,s,n)):(t=Kc(r.type,null,s,e,e.mode,n),t.ref=e.ref,t.return=e,e.child=t)}if(a=t.child,!(t.lanes&n)){var o=a.memoizedProps;if(r=r.compare,r=r!==null?r:gl,r(o,s)&&t.ref===e.ref)return os(t,e,n)}return e.flags|=1,t=Js(a,s),t.ref=e.ref,t.return=e,e.child=t}function rb(t,e,r,s,n){if(t!==null){var a=t.memoizedProps;if(gl(a,s)&&t.ref===e.ref)if(pr=!1,e.pendingProps=s=a,(t.lanes&n)!==0)t.flags&131072&&(pr=!0);else return e.lanes=t.lanes,os(t,e,n)}return Fh(t,e,r,s,n)}function nb(t,e,r){var s=e.pendingProps,n=s.children,a=t!==null?t.memoizedState:null;if(s.mode==="hidden")if(!(e.mode&1))e.memoizedState={baseLanes:0,cachePool:null,transitions:null},st(Ro,br),br|=r;else{if(!(r&1073741824))return t=a!==null?a.baseLanes|r:r,e.lanes=e.childLanes=1073741824,e.memoizedState={baseLanes:t,cachePool:null,transitions:null},e.updateQueue=null,st(Ro,br),br|=t,null;e.memoizedState={baseLanes:0,cachePool:null,transitions:null},s=a!==null?a.baseLanes:r,st(Ro,br),br|=s}else a!==null?(s=a.baseLanes|r,e.memoizedState=null):s=r,st(Ro,br),br|=s;return er(t,e,n,r),e.child}function sb(t,e){var r=e.ref;(t===null&&r!==null||t!==null&&t.ref!==r)&&(e.flags|=512,e.flags|=2097152)}function Fh(t,e,r,s,n){var a=vr(r)?Ua:Zt.current;return a=ai(e,a),Fo(e,n),r=Zm(t,e,r,s,a,n),s=Ym(),t!==null&&!pr?(e.updateQueue=t.updateQueue,e.flags&=-2053,t.lanes&=~n,os(t,e,n)):(ht&&s&&Fm(e),e.flags|=1,er(t,e,r,n),e.child)}function wy(t,e,r,s,n){if(vr(r)){var a=!0;vu(e)}else a=!1;if(Fo(e,n),e.stateNode===null)Hc(t,e),Xw(e,r,s),Mh(e,r,s,n),s=!0;else if(t===null){var o=e.stateNode,l=e.memoizedProps;o.props=l;var c=o.context,u=r.contextType;typeof u=="object"&&u!==null?u=Fr(u):(u=vr(r)?Ua:Zt.current,u=ai(e,u));var d=r.getDerivedStateFromProps,f=typeof d=="function"||typeof o.getSnapshotBeforeUpdate=="function";f||typeof o.UNSAFE_componentWillReceiveProps!="function"&&typeof o.componentWillReceiveProps!="function"||(l!==s||c!==u)&&py(e,o,s,u),Es=!1;var m=e.memoizedState;o.state=m,bu(e,s,o,n),c=e.memoizedState,l!==s||m!==c||mr.current||Es?(typeof d=="function"&&(Dh(e,r,d,s),c=e.memoizedState),(l=Es||hy(e,r,l,s,m,c,u))?(f||typeof o.UNSAFE_componentWillMount!="function"&&typeof o.componentWillMount!="function"||(typeof o.componentWillMount=="function"&&o.componentWillMount(),typeof o.UNSAFE_componentWillMount=="function"&&o.UNSAFE_componentWillMount()),typeof o.componentDidMount=="function"&&(e.flags|=4194308)):(typeof o.componentDidMount=="function"&&(e.flags|=4194308),e.memoizedProps=s,e.memoizedState=c),o.props=s,o.state=c,o.context=u,s=l):(typeof o.componentDidMount=="function"&&(e.flags|=4194308),s=!1)}else{o=e.stateNode,Aw(t,e),l=e.memoizedProps,u=e.type===e.elementType?l:Zr(e.type,l),o.props=u,f=e.pendingProps,m=o.context,c=r.contextType,typeof c=="object"&&c!==null?c=Fr(c):(c=vr(r)?Ua:Zt.current,c=ai(e,c));var p=r.getDerivedStateFromProps;(d=typeof p=="function"||typeof o.getSnapshotBeforeUpdate=="function")||typeof o.UNSAFE_componentWillReceiveProps!="function"&&typeof o.componentWillReceiveProps!="function"||(l!==f||m!==c)&&py(e,o,s,c),Es=!1,m=e.memoizedState,o.state=m,bu(e,s,o,n);var w=e.memoizedState;l!==f||m!==w||mr.current||Es?(typeof p=="function"&&(Dh(e,r,p,s),w=e.memoizedState),(u=Es||hy(e,r,u,s,m,w,c)||!1)?(d||typeof o.UNSAFE_componentWillUpdate!="function"&&typeof o.componentWillUpdate!="function"||(typeof o.componentWillUpdate=="function"&&o.componentWillUpdate(s,w,c),typeof o.UNSAFE_componentWillUpdate=="function"&&o.UNSAFE_componentWillUpdate(s,w,c)),typeof o.componentDidUpdate=="function"&&(e.flags|=4),typeof o.getSnapshotBeforeUpdate=="function"&&(e.flags|=1024)):(typeof o.componentDidUpdate!="function"||l===t.memoizedProps&&m===t.memoizedState||(e.flags|=4),typeof o.getSnapshotBeforeUpdate!="function"||l===t.memoizedProps&&m===t.memoizedState||(e.flags|=1024),e.memoizedProps=s,e.memoizedState=w),o.props=s,o.state=w,o.context=c,s=u):(typeof o.componentDidUpdate!="function"||l===t.memoizedProps&&m===t.memoizedState||(e.flags|=4),typeof o.getSnapshotBeforeUpdate!="function"||l===t.memoizedProps&&m===t.memoizedState||(e.flags|=1024),s=!1)}return Lh(t,e,r,s,a,n)}function Lh(t,e,r,s,n,a){sb(t,e);var o=(e.flags&128)!==0;if(!s&&!o)return n&&ay(e,r,!1),os(t,e,a);s=e.stateNode,IP.current=e;var l=o&&typeof r.getDerivedStateFromError!="function"?null:s.render();return e.flags|=1,t!==null&&o?(e.child=ii(e,t.child,null,a),e.child=ii(e,null,l,a)):er(t,e,l,a),e.memoizedState=s.state,n&&ay(e,r,!0),e.child}function ab(t){var e=t.stateNode;e.pendingContext?sy(t,e.pendingContext,e.pendingContext!==e.context):e.context&&sy(t,e.context,!1),Wm(t,e.containerInfo)}function by(t,e,r,s,n){return oi(),Um(n),e.flags|=256,er(t,e,r,s),e.child}var Uh={dehydrated:null,treeContext:null,retryLane:0};function zh(t){return{baseLanes:t,cachePool:null,transitions:null}}function ob(t,e,r){var s=e.pendingProps,n=mt.current,a=!1,o=(e.flags&128)!==0,l;if((l=o)||(l=t!==null&&t.memoizedState===null?!1:(n&2)!==0),l?(a=!0,e.flags&=-129):(t===null||t.memoizedState!==null)&&(n|=1),st(mt,n&1),t===null)return Oh(e),t=e.memoizedState,t!==null&&(t=t.dehydrated,t!==null)?(e.mode&1?t.data==="$!"?e.lanes=8:e.lanes=1073741824:e.lanes=1,null):(o=s.children,t=s.fallback,a?(s=e.mode,a=e.child,o={mode:"hidden",children:o},!(s&1)&&a!==null?(a.childLanes=0,a.pendingProps=o):a=wd(o,s,0,null),t=Fa(t,s,r,null),a.return=e,t.return=e,a.sibling=t,e.child=a,e.child.memoizedState=zh(r),e.memoizedState=Uh,t):ev(e,o));if(n=t.memoizedState,n!==null&&(l=n.dehydrated,l!==null))return DP(t,e,o,s,l,n,r);if(a){a=s.fallback,o=e.mode,n=t.child,l=n.sibling;var c={mode:"hidden",children:s.children};return!(o&1)&&e.child!==n?(s=e.child,s.childLanes=0,s.pendingProps=c,e.deletions=null):(s=Js(n,c),s.subtreeFlags=n.subtreeFlags&14680064),l!==null?a=Js(l,a):(a=Fa(a,o,r,null),a.flags|=2),a.return=e,s.return=e,s.sibling=a,e.child=s,s=a,a=e.child,o=t.child.memoizedState,o=o===null?zh(r):{baseLanes:o.baseLanes|r,cachePool:null,transitions:o.transitions},a.memoizedState=o,a.childLanes=t.childLanes&~r,e.memoizedState=Uh,s}return a=t.child,t=a.sibling,s=Js(a,{mode:"visible",children:s.children}),!(e.mode&1)&&(s.lanes=r),s.return=e,s.sibling=null,t!==null&&(r=e.deletions,r===null?(e.deletions=[t],e.flags|=16):r.push(t)),e.child=s,e.memoizedState=null,s}function ev(t,e){return e=wd({mode:"visible",children:e},t.mode,0,null),e.return=t,t.child=e}function gc(t,e,r,s){return s!==null&&Um(s),ii(e,t.child,null,r),t=ev(e,e.pendingProps.children),t.flags|=2,e.memoizedState=null,t}function DP(t,e,r,s,n,a,o){if(r)return e.flags&256?(e.flags&=-257,s=Pf(Error(Y(422))),gc(t,e,o,s)):e.memoizedState!==null?(e.child=t.child,e.flags|=128,null):(a=s.fallback,n=e.mode,s=wd({mode:"visible",children:s.children},n,0,null),a=Fa(a,n,o,null),a.flags|=2,s.return=e,a.return=e,s.sibling=a,e.child=s,e.mode&1&&ii(e,t.child,null,o),e.child.memoizedState=zh(o),e.memoizedState=Uh,a);if(!(e.mode&1))return gc(t,e,o,null);if(n.data==="$!"){if(s=n.nextSibling&&n.nextSibling.dataset,s)var l=s.dgst;return s=l,a=Error(Y(419)),s=Pf(a,s,void 0),gc(t,e,o,s)}if(l=(o&t.childLanes)!==0,pr||l){if(s=Lt,s!==null){switch(o&-o){case 4:n=2;break;case 16:n=8;break;case 64:case 128:case 256:case 512:case 1024:case 2048:case 4096:case 8192:case 16384:case 32768:case 65536:case 131072:case 262144:case 524288:case 1048576:case 2097152:case 4194304:case 8388608:case 16777216:case 33554432:case 67108864:n=32;break;case 536870912:n=268435456;break;default:n=0}n=n&(s.suspendedLanes|o)?0:n,n!==0&&n!==a.retryLane&&(a.retryLane=n,as(t,n),sn(s,t,n,-1))}return ov(),s=Pf(Error(Y(421))),gc(t,e,o,s)}return n.data==="$?"?(e.flags|=128,e.child=t.child,e=QP.bind(null,t),n._reactRetry=e,null):(t=a.treeContext,_r=Qs(n.nextSibling),Er=e,ht=!0,tn=null,t!==null&&(Or[Ir++]=Zn,Or[Ir++]=Yn,Or[Ir++]=za,Zn=t.id,Yn=t.overflow,za=e),e=ev(e,s.children),e.flags|=4096,e)}function Sy(t,e,r){t.lanes|=e;var s=t.alternate;s!==null&&(s.lanes|=e),Ih(t.return,e,r)}function Nf(t,e,r,s,n){var a=t.memoizedState;a===null?t.memoizedState={isBackwards:e,rendering:null,renderingStartTime:0,last:s,tail:r,tailMode:n}:(a.isBackwards=e,a.rendering=null,a.renderingStartTime=0,a.last=s,a.tail=r,a.tailMode=n)}function ib(t,e,r){var s=e.pendingProps,n=s.revealOrder,a=s.tail;if(er(t,e,s.children,r),s=mt.current,s&2)s=s&1|2,e.flags|=128;else{if(t!==null&&t.flags&128)e:for(t=e.child;t!==null;){if(t.tag===13)t.memoizedState!==null&&Sy(t,r,e);else if(t.tag===19)Sy(t,r,e);else if(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;t=t.return}t.sibling.return=t.return,t=t.sibling}s&=1}if(st(mt,s),!(e.mode&1))e.memoizedState=null;else switch(n){case"forwards":for(r=e.child,n=null;r!==null;)t=r.alternate,t!==null&&Su(t)===null&&(n=r),r=r.sibling;r=n,r===null?(n=e.child,e.child=null):(n=r.sibling,r.sibling=null),Nf(e,!1,n,r,a);break;case"backwards":for(r=null,n=e.child,e.child=null;n!==null;){if(t=n.alternate,t!==null&&Su(t)===null){e.child=n;break}t=n.sibling,n.sibling=r,r=n,n=t}Nf(e,!0,r,null,a);break;case"together":Nf(e,!1,null,null,void 0);break;default:e.memoizedState=null}return e.child}function Hc(t,e){!(e.mode&1)&&t!==null&&(t.alternate=null,e.alternate=null,e.flags|=2)}function os(t,e,r){if(t!==null&&(e.dependencies=t.dependencies),qa|=e.lanes,!(r&e.childLanes))return null;if(t!==null&&e.child!==t.child)throw Error(Y(153));if(e.child!==null){for(t=e.child,r=Js(t,t.pendingProps),e.child=r,r.return=e;t.sibling!==null;)t=t.sibling,r=r.sibling=Js(t,t.pendingProps),r.return=e;r.sibling=null}return e.child}function MP(t,e,r){switch(e.tag){case 3:ab(e),oi();break;case 5:Ow(e);break;case 1:vr(e.type)&&vu(e);break;case 4:Wm(e,e.stateNode.containerInfo);break;case 10:var s=e.type._context,n=e.memoizedProps.value;st(xu,s._currentValue),s._currentValue=n;break;case 13:if(s=e.memoizedState,s!==null)return s.dehydrated!==null?(st(mt,mt.current&1),e.flags|=128,null):r&e.child.childLanes?ob(t,e,r):(st(mt,mt.current&1),t=os(t,e,r),t!==null?t.sibling:null);st(mt,mt.current&1);break;case 19:if(s=(r&e.childLanes)!==0,t.flags&128){if(s)return ib(t,e,r);e.flags|=128}if(n=e.memoizedState,n!==null&&(n.rendering=null,n.tail=null,n.lastEffect=null),st(mt,mt.current),s)break;return null;case 22:case 23:return e.lanes=0,nb(t,e,r)}return os(t,e,r)}var lb,Vh,cb,ub;lb=function(t,e){for(var r=e.child;r!==null;){if(r.tag===5||r.tag===6)t.appendChild(r.stateNode);else if(r.tag!==4&&r.child!==null){r.child.return=r,r=r.child;continue}if(r===e)break;for(;r.sibling===null;){if(r.return===null||r.return===e)return;r=r.return}r.sibling.return=r.return,r=r.sibling}};Vh=function(){};cb=function(t,e,r,s){var n=t.memoizedProps;if(n!==s){t=e.stateNode,Na(Nn.current);var a=null;switch(r){case"input":n=uh(t,n),s=uh(t,s),a=[];break;case"select":n=gt({},n,{value:void 0}),s=gt({},s,{value:void 0}),a=[];break;case"textarea":n=hh(t,n),s=hh(t,s),a=[];break;default:typeof n.onClick!="function"&&typeof s.onClick=="function"&&(t.onclick=pu)}mh(r,s);var o;r=null;for(u in n)if(!s.hasOwnProperty(u)&&n.hasOwnProperty(u)&&n[u]!=null)if(u==="style"){var l=n[u];for(o in l)l.hasOwnProperty(o)&&(r||(r={}),r[o]="")}else u!=="dangerouslySetInnerHTML"&&u!=="children"&&u!=="suppressContentEditableWarning"&&u!=="suppressHydrationWarning"&&u!=="autoFocus"&&(ul.hasOwnProperty(u)?a||(a=[]):(a=a||[]).push(u,null));for(u in s){var c=s[u];if(l=n!=null?n[u]:void 0,s.hasOwnProperty(u)&&c!==l&&(c!=null||l!=null))if(u==="style")if(l){for(o in l)!l.hasOwnProperty(o)||c&&c.hasOwnProperty(o)||(r||(r={}),r[o]="");for(o in c)c.hasOwnProperty(o)&&l[o]!==c[o]&&(r||(r={}),r[o]=c[o])}else r||(a||(a=[]),a.push(u,r)),r=c;else u==="dangerouslySetInnerHTML"?(c=c?c.__html:void 0,l=l?l.__html:void 0,c!=null&&l!==c&&(a=a||[]).push(u,c)):u==="children"?typeof c!="string"&&typeof c!="number"||(a=a||[]).push(u,""+c):u!=="suppressContentEditableWarning"&&u!=="suppressHydrationWarning"&&(ul.hasOwnProperty(u)?(c!=null&&u==="onScroll"&<("scroll",t),a||l===c||(a=[])):(a=a||[]).push(u,c))}r&&(a=a||[]).push("style",r);var u=a;(e.updateQueue=u)&&(e.flags|=4)}};ub=function(t,e,r,s){r!==s&&(e.flags|=4)};function Mi(t,e){if(!ht)switch(t.tailMode){case"hidden":e=t.tail;for(var r=null;e!==null;)e.alternate!==null&&(r=e),e=e.sibling;r===null?t.tail=null:r.sibling=null;break;case"collapsed":r=t.tail;for(var s=null;r!==null;)r.alternate!==null&&(s=r),r=r.sibling;s===null?e||t.tail===null?t.tail=null:t.tail.sibling=null:s.sibling=null}}function Qt(t){var e=t.alternate!==null&&t.alternate.child===t.child,r=0,s=0;if(e)for(var n=t.child;n!==null;)r|=n.lanes|n.childLanes,s|=n.subtreeFlags&14680064,s|=n.flags&14680064,n.return=t,n=n.sibling;else for(n=t.child;n!==null;)r|=n.lanes|n.childLanes,s|=n.subtreeFlags,s|=n.flags,n.return=t,n=n.sibling;return t.subtreeFlags|=s,t.childLanes=r,e}function $P(t,e,r){var s=e.pendingProps;switch(Lm(e),e.tag){case 2:case 16:case 15:case 0:case 11:case 7:case 8:case 12:case 9:case 14:return Qt(e),null;case 1:return vr(e.type)&&mu(),Qt(e),null;case 3:return s=e.stateNode,li(),ct(mr),ct(Zt),Qm(),s.pendingContext&&(s.context=s.pendingContext,s.pendingContext=null),(t===null||t.child===null)&&(mc(e)?e.flags|=4:t===null||t.memoizedState.isDehydrated&&!(e.flags&256)||(e.flags|=1024,tn!==null&&(Zh(tn),tn=null))),Vh(t,e),Qt(e),null;case 5:Km(e);var n=Na(Sl.current);if(r=e.type,t!==null&&e.stateNode!=null)cb(t,e,r,s,n),t.ref!==e.ref&&(e.flags|=512,e.flags|=2097152);else{if(!s){if(e.stateNode===null)throw Error(Y(166));return Qt(e),null}if(t=Na(Nn.current),mc(e)){s=e.stateNode,r=e.type;var a=e.memoizedProps;switch(s[wn]=e,s[wl]=a,t=(e.mode&1)!==0,r){case"dialog":lt("cancel",s),lt("close",s);break;case"iframe":case"object":case"embed":lt("load",s);break;case"video":case"audio":for(n=0;n<Hi.length;n++)lt(Hi[n],s);break;case"source":lt("error",s);break;case"img":case"image":case"link":lt("error",s),lt("load",s);break;case"details":lt("toggle",s);break;case"input":Tg(s,a),lt("invalid",s);break;case"select":s._wrapperState={wasMultiple:!!a.multiple},lt("invalid",s);break;case"textarea":Og(s,a),lt("invalid",s)}mh(r,a),n=null;for(var o in a)if(a.hasOwnProperty(o)){var l=a[o];o==="children"?typeof l=="string"?s.textContent!==l&&(a.suppressHydrationWarning!==!0&&pc(s.textContent,l,t),n=["children",l]):typeof l=="number"&&s.textContent!==""+l&&(a.suppressHydrationWarning!==!0&&pc(s.textContent,l,t),n=["children",""+l]):ul.hasOwnProperty(o)&&l!=null&&o==="onScroll"&<("scroll",s)}switch(r){case"input":oc(s),Ag(s,a,!0);break;case"textarea":oc(s),Ig(s);break;case"select":case"option":break;default:typeof a.onClick=="function"&&(s.onclick=pu)}s=n,e.updateQueue=s,s!==null&&(e.flags|=4)}else{o=n.nodeType===9?n:n.ownerDocument,t==="http://www.w3.org/1999/xhtml"&&(t=Fx(r)),t==="http://www.w3.org/1999/xhtml"?r==="script"?(t=o.createElement("div"),t.innerHTML="<script><\/script>",t=t.removeChild(t.firstChild)):typeof s.is=="string"?t=o.createElement(r,{is:s.is}):(t=o.createElement(r),r==="select"&&(o=t,s.multiple?o.multiple=!0:s.size&&(o.size=s.size))):t=o.createElementNS(t,r),t[wn]=e,t[wl]=s,lb(t,e,!1,!1),e.stateNode=t;e:{switch(o=vh(r,s),r){case"dialog":lt("cancel",t),lt("close",t),n=s;break;case"iframe":case"object":case"embed":lt("load",t),n=s;break;case"video":case"audio":for(n=0;n<Hi.length;n++)lt(Hi[n],t);n=s;break;case"source":lt("error",t),n=s;break;case"img":case"image":case"link":lt("error",t),lt("load",t),n=s;break;case"details":lt("toggle",t),n=s;break;case"input":Tg(t,s),n=uh(t,s),lt("invalid",t);break;case"option":n=s;break;case"select":t._wrapperState={wasMultiple:!!s.multiple},n=gt({},s,{value:void 0}),lt("invalid",t);break;case"textarea":Og(t,s),n=hh(t,s),lt("invalid",t);break;default:n=s}mh(r,n),l=n;for(a in l)if(l.hasOwnProperty(a)){var c=l[a];a==="style"?zx(t,c):a==="dangerouslySetInnerHTML"?(c=c?c.__html:void 0,c!=null&&Lx(t,c)):a==="children"?typeof c=="string"?(r!=="textarea"||c!=="")&&dl(t,c):typeof c=="number"&&dl(t,""+c):a!=="suppressContentEditableWarning"&&a!=="suppressHydrationWarning"&&a!=="autoFocus"&&(ul.hasOwnProperty(a)?c!=null&&a==="onScroll"&<("scroll",t):c!=null&&Em(t,a,c,o))}switch(r){case"input":oc(t),Ag(t,s,!1);break;case"textarea":oc(t),Ig(t);break;case"option":s.value!=null&&t.setAttribute("value",""+na(s.value));break;case"select":t.multiple=!!s.multiple,a=s.value,a!=null?Io(t,!!s.multiple,a,!1):s.defaultValue!=null&&Io(t,!!s.multiple,s.defaultValue,!0);break;default:typeof n.onClick=="function"&&(t.onclick=pu)}switch(r){case"button":case"input":case"select":case"textarea":s=!!s.autoFocus;break e;case"img":s=!0;break e;default:s=!1}}s&&(e.flags|=4)}e.ref!==null&&(e.flags|=512,e.flags|=2097152)}return Qt(e),null;case 6:if(t&&e.stateNode!=null)ub(t,e,t.memoizedProps,s);else{if(typeof s!="string"&&e.stateNode===null)throw Error(Y(166));if(r=Na(Sl.current),Na(Nn.current),mc(e)){if(s=e.stateNode,r=e.memoizedProps,s[wn]=e,(a=s.nodeValue!==r)&&(t=Er,t!==null))switch(t.tag){case 3:pc(s.nodeValue,r,(t.mode&1)!==0);break;case 5:t.memoizedProps.suppressHydrationWarning!==!0&&pc(s.nodeValue,r,(t.mode&1)!==0)}a&&(e.flags|=4)}else s=(r.nodeType===9?r:r.ownerDocument).createTextNode(s),s[wn]=e,e.stateNode=s}return Qt(e),null;case 13:if(ct(mt),s=e.memoizedState,t===null||t.memoizedState!==null&&t.memoizedState.dehydrated!==null){if(ht&&_r!==null&&e.mode&1&&!(e.flags&128))Nw(),oi(),e.flags|=98560,a=!1;else if(a=mc(e),s!==null&&s.dehydrated!==null){if(t===null){if(!a)throw Error(Y(318));if(a=e.memoizedState,a=a!==null?a.dehydrated:null,!a)throw Error(Y(317));a[wn]=e}else oi(),!(e.flags&128)&&(e.memoizedState=null),e.flags|=4;Qt(e),a=!1}else tn!==null&&(Zh(tn),tn=null),a=!0;if(!a)return e.flags&65536?e:null}return e.flags&128?(e.lanes=r,e):(s=s!==null,s!==(t!==null&&t.memoizedState!==null)&&s&&(e.child.flags|=8192,e.mode&1&&(t===null||mt.current&1?Ot===0&&(Ot=3):ov())),e.updateQueue!==null&&(e.flags|=4),Qt(e),null);case 4:return li(),Vh(t,e),t===null&&yl(e.stateNode.containerInfo),Qt(e),null;case 10:return qm(e.type._context),Qt(e),null;case 17:return vr(e.type)&&mu(),Qt(e),null;case 19:if(ct(mt),a=e.memoizedState,a===null)return Qt(e),null;if(s=(e.flags&128)!==0,o=a.rendering,o===null)if(s)Mi(a,!1);else{if(Ot!==0||t!==null&&t.flags&128)for(t=e.child;t!==null;){if(o=Su(t),o!==null){for(e.flags|=128,Mi(a,!1),s=o.updateQueue,s!==null&&(e.updateQueue=s,e.flags|=4),e.subtreeFlags=0,s=r,r=e.child;r!==null;)a=r,t=s,a.flags&=14680066,o=a.alternate,o===null?(a.childLanes=0,a.lanes=t,a.child=null,a.subtreeFlags=0,a.memoizedProps=null,a.memoizedState=null,a.updateQueue=null,a.dependencies=null,a.stateNode=null):(a.childLanes=o.childLanes,a.lanes=o.lanes,a.child=o.child,a.subtreeFlags=0,a.deletions=null,a.memoizedProps=o.memoizedProps,a.memoizedState=o.memoizedState,a.updateQueue=o.updateQueue,a.type=o.type,t=o.dependencies,a.dependencies=t===null?null:{lanes:t.lanes,firstContext:t.firstContext}),r=r.sibling;return st(mt,mt.current&1|2),e.child}t=t.sibling}a.tail!==null&&_t()>ui&&(e.flags|=128,s=!0,Mi(a,!1),e.lanes=4194304)}else{if(!s)if(t=Su(o),t!==null){if(e.flags|=128,s=!0,r=t.updateQueue,r!==null&&(e.updateQueue=r,e.flags|=4),Mi(a,!0),a.tail===null&&a.tailMode==="hidden"&&!o.alternate&&!ht)return Qt(e),null}else 2*_t()-a.renderingStartTime>ui&&r!==1073741824&&(e.flags|=128,s=!0,Mi(a,!1),e.lanes=4194304);a.isBackwards?(o.sibling=e.child,e.child=o):(r=a.last,r!==null?r.sibling=o:e.child=o,a.last=o)}return a.tail!==null?(e=a.tail,a.rendering=e,a.tail=e.sibling,a.renderingStartTime=_t(),e.sibling=null,r=mt.current,st(mt,s?r&1|2:r&1),e):(Qt(e),null);case 22:case 23:return av(),s=e.memoizedState!==null,t!==null&&t.memoizedState!==null!==s&&(e.flags|=8192),s&&e.mode&1?br&1073741824&&(Qt(e),e.subtreeFlags&6&&(e.flags|=8192)):Qt(e),null;case 24:return null;case 25:return null}throw Error(Y(156,e.tag))}function FP(t,e){switch(Lm(e),e.tag){case 1:return vr(e.type)&&mu(),t=e.flags,t&65536?(e.flags=t&-65537|128,e):null;case 3:return li(),ct(mr),ct(Zt),Qm(),t=e.flags,t&65536&&!(t&128)?(e.flags=t&-65537|128,e):null;case 5:return Km(e),null;case 13:if(ct(mt),t=e.memoizedState,t!==null&&t.dehydrated!==null){if(e.alternate===null)throw Error(Y(340));oi()}return t=e.flags,t&65536?(e.flags=t&-65537|128,e):null;case 19:return ct(mt),null;case 4:return li(),null;case 10:return qm(e.type._context),null;case 22:case 23:return av(),null;case 24:return null;default:return null}}var yc=!1,Gt=!1,LP=typeof WeakSet=="function"?WeakSet:Set,he=null;function jo(t,e){var r=t.ref;if(r!==null)if(typeof r=="function")try{r(null)}catch(s){xt(t,e,s)}else r.current=null}function qh(t,e,r){try{r()}catch(s){xt(t,e,s)}}var _y=!1;function UP(t,e){if(kh=du,t=mw(),$m(t)){if("selectionStart"in t)var r={start:t.selectionStart,end:t.selectionEnd};else e:{r=(r=t.ownerDocument)&&r.defaultView||window;var s=r.getSelection&&r.getSelection();if(s&&s.rangeCount!==0){r=s.anchorNode;var n=s.anchorOffset,a=s.focusNode;s=s.focusOffset;try{r.nodeType,a.nodeType}catch{r=null;break e}var o=0,l=-1,c=-1,u=0,d=0,f=t,m=null;t:for(;;){for(var p;f!==r||n!==0&&f.nodeType!==3||(l=o+n),f!==a||s!==0&&f.nodeType!==3||(c=o+s),f.nodeType===3&&(o+=f.nodeValue.length),(p=f.firstChild)!==null;)m=f,f=p;for(;;){if(f===t)break t;if(m===r&&++u===n&&(l=o),m===a&&++d===s&&(c=o),(p=f.nextSibling)!==null)break;f=m,m=f.parentNode}f=p}r=l===-1||c===-1?null:{start:l,end:c}}else r=null}r=r||{start:0,end:0}}else r=null;for(Ph={focusedElem:t,selectionRange:r},du=!1,he=e;he!==null;)if(e=he,t=e.child,(e.subtreeFlags&1028)!==0&&t!==null)t.return=e,he=t;else for(;he!==null;){e=he;try{var w=e.alternate;if(e.flags&1024)switch(e.tag){case 0:case 11:case 15:break;case 1:if(w!==null){var h=w.memoizedProps,g=w.memoizedState,v=e.stateNode,y=v.getSnapshotBeforeUpdate(e.elementType===e.type?h:Zr(e.type,h),g);v.__reactInternalSnapshotBeforeUpdate=y}break;case 3:var b=e.stateNode.containerInfo;b.nodeType===1?b.textContent="":b.nodeType===9&&b.documentElement&&b.removeChild(b.documentElement);break;case 5:case 6:case 4:case 17:break;default:throw Error(Y(163))}}catch(S){xt(e,e.return,S)}if(t=e.sibling,t!==null){t.return=e.return,he=t;break}he=e.return}return w=_y,_y=!1,w}function nl(t,e,r){var s=e.updateQueue;if(s=s!==null?s.lastEffect:null,s!==null){var n=s=s.next;do{if((n.tag&t)===t){var a=n.destroy;n.destroy=void 0,a!==void 0&&qh(e,r,a)}n=n.next}while(n!==s)}}function yd(t,e){if(e=e.updateQueue,e=e!==null?e.lastEffect:null,e!==null){var r=e=e.next;do{if((r.tag&t)===t){var s=r.create;r.destroy=s()}r=r.next}while(r!==e)}}function Hh(t){var e=t.ref;if(e!==null){var r=t.stateNode;switch(t.tag){case 5:t=r;break;default:t=r}typeof e=="function"?e(t):e.current=t}}function db(t){var e=t.alternate;e!==null&&(t.alternate=null,db(e)),t.child=null,t.deletions=null,t.sibling=null,t.tag===5&&(e=t.stateNode,e!==null&&(delete e[wn],delete e[wl],delete e[Rh],delete e[SP],delete e[_P])),t.stateNode=null,t.return=null,t.dependencies=null,t.memoizedProps=null,t.memoizedState=null,t.pendingProps=null,t.stateNode=null,t.updateQueue=null}function fb(t){return t.tag===5||t.tag===3||t.tag===4}function Ey(t){e:for(;;){for(;t.sibling===null;){if(t.return===null||fb(t.return))return null;t=t.return}for(t.sibling.return=t.return,t=t.sibling;t.tag!==5&&t.tag!==6&&t.tag!==18;){if(t.flags&2||t.child===null||t.tag===4)continue e;t.child.return=t,t=t.child}if(!(t.flags&2))return t.stateNode}}function Bh(t,e,r){var s=t.tag;if(s===5||s===6)t=t.stateNode,e?r.nodeType===8?r.parentNode.insertBefore(t,e):r.insertBefore(t,e):(r.nodeType===8?(e=r.parentNode,e.insertBefore(t,r)):(e=r,e.appendChild(t)),r=r._reactRootContainer,r!=null||e.onclick!==null||(e.onclick=pu));else if(s!==4&&(t=t.child,t!==null))for(Bh(t,e,r),t=t.sibling;t!==null;)Bh(t,e,r),t=t.sibling}function Wh(t,e,r){var s=t.tag;if(s===5||s===6)t=t.stateNode,e?r.insertBefore(t,e):r.appendChild(t);else if(s!==4&&(t=t.child,t!==null))for(Wh(t,e,r),t=t.sibling;t!==null;)Wh(t,e,r),t=t.sibling}var Vt=null,en=!1;function ys(t,e,r){for(r=r.child;r!==null;)hb(t,e,r),r=r.sibling}function hb(t,e,r){if(Pn&&typeof Pn.onCommitFiberUnmount=="function")try{Pn.onCommitFiberUnmount(ud,r)}catch{}switch(r.tag){case 5:Gt||jo(r,e);case 6:var s=Vt,n=en;Vt=null,ys(t,e,r),Vt=s,en=n,Vt!==null&&(en?(t=Vt,r=r.stateNode,t.nodeType===8?t.parentNode.removeChild(r):t.removeChild(r)):Vt.removeChild(r.stateNode));break;case 18:Vt!==null&&(en?(t=Vt,r=r.stateNode,t.nodeType===8?bf(t.parentNode,r):t.nodeType===1&&bf(t,r),ml(t)):bf(Vt,r.stateNode));break;case 4:s=Vt,n=en,Vt=r.stateNode.containerInfo,en=!0,ys(t,e,r),Vt=s,en=n;break;case 0:case 11:case 14:case 15:if(!Gt&&(s=r.updateQueue,s!==null&&(s=s.lastEffect,s!==null))){n=s=s.next;do{var a=n,o=a.destroy;a=a.tag,o!==void 0&&(a&2||a&4)&&qh(r,e,o),n=n.next}while(n!==s)}ys(t,e,r);break;case 1:if(!Gt&&(jo(r,e),s=r.stateNode,typeof s.componentWillUnmount=="function"))try{s.props=r.memoizedProps,s.state=r.memoizedState,s.componentWillUnmount()}catch(l){xt(r,e,l)}ys(t,e,r);break;case 21:ys(t,e,r);break;case 22:r.mode&1?(Gt=(s=Gt)||r.memoizedState!==null,ys(t,e,r),Gt=s):ys(t,e,r);break;default:ys(t,e,r)}}function Cy(t){var e=t.updateQueue;if(e!==null){t.updateQueue=null;var r=t.stateNode;r===null&&(r=t.stateNode=new LP),e.forEach(function(s){var n=GP.bind(null,t,s);r.has(s)||(r.add(s),s.then(n,n))})}}function Wr(t,e){var r=e.deletions;if(r!==null)for(var s=0;s<r.length;s++){var n=r[s];try{var a=t,o=e,l=o;e:for(;l!==null;){switch(l.tag){case 5:Vt=l.stateNode,en=!1;break e;case 3:Vt=l.stateNode.containerInfo,en=!0;break e;case 4:Vt=l.stateNode.containerInfo,en=!0;break e}l=l.return}if(Vt===null)throw Error(Y(160));hb(a,o,n),Vt=null,en=!1;var c=n.alternate;c!==null&&(c.return=null),n.return=null}catch(u){xt(n,e,u)}}if(e.subtreeFlags&12854)for(e=e.child;e!==null;)pb(e,t),e=e.sibling}function pb(t,e){var r=t.alternate,s=t.flags;switch(t.tag){case 0:case 11:case 14:case 15:if(Wr(e,t),hn(t),s&4){try{nl(3,t,t.return),yd(3,t)}catch(h){xt(t,t.return,h)}try{nl(5,t,t.return)}catch(h){xt(t,t.return,h)}}break;case 1:Wr(e,t),hn(t),s&512&&r!==null&&jo(r,r.return);break;case 5:if(Wr(e,t),hn(t),s&512&&r!==null&&jo(r,r.return),t.flags&32){var n=t.stateNode;try{dl(n,"")}catch(h){xt(t,t.return,h)}}if(s&4&&(n=t.stateNode,n!=null)){var a=t.memoizedProps,o=r!==null?r.memoizedProps:a,l=t.type,c=t.updateQueue;if(t.updateQueue=null,c!==null)try{l==="input"&&a.type==="radio"&&a.name!=null&&Mx(n,a),vh(l,o);var u=vh(l,a);for(o=0;o<c.length;o+=2){var d=c[o],f=c[o+1];d==="style"?zx(n,f):d==="dangerouslySetInnerHTML"?Lx(n,f):d==="children"?dl(n,f):Em(n,d,f,u)}switch(l){case"input":dh(n,a);break;case"textarea":$x(n,a);break;case"select":var m=n._wrapperState.wasMultiple;n._wrapperState.wasMultiple=!!a.multiple;var p=a.value;p!=null?Io(n,!!a.multiple,p,!1):m!==!!a.multiple&&(a.defaultValue!=null?Io(n,!!a.multiple,a.defaultValue,!0):Io(n,!!a.multiple,a.multiple?[]:"",!1))}n[wl]=a}catch(h){xt(t,t.return,h)}}break;case 6:if(Wr(e,t),hn(t),s&4){if(t.stateNode===null)throw Error(Y(162));n=t.stateNode,a=t.memoizedProps;try{n.nodeValue=a}catch(h){xt(t,t.return,h)}}break;case 3:if(Wr(e,t),hn(t),s&4&&r!==null&&r.memoizedState.isDehydrated)try{ml(e.containerInfo)}catch(h){xt(t,t.return,h)}break;case 4:Wr(e,t),hn(t);break;case 13:Wr(e,t),hn(t),n=t.child,n.flags&8192&&(a=n.memoizedState!==null,n.stateNode.isHidden=a,!a||n.alternate!==null&&n.alternate.memoizedState!==null||(nv=_t())),s&4&&Cy(t);break;case 22:if(d=r!==null&&r.memoizedState!==null,t.mode&1?(Gt=(u=Gt)||d,Wr(e,t),Gt=u):Wr(e,t),hn(t),s&8192){if(u=t.memoizedState!==null,(t.stateNode.isHidden=u)&&!d&&t.mode&1)for(he=t,d=t.child;d!==null;){for(f=he=d;he!==null;){switch(m=he,p=m.child,m.tag){case 0:case 11:case 14:case 15:nl(4,m,m.return);break;case 1:jo(m,m.return);var w=m.stateNode;if(typeof w.componentWillUnmount=="function"){s=m,r=m.return;try{e=s,w.props=e.memoizedProps,w.state=e.memoizedState,w.componentWillUnmount()}catch(h){xt(s,r,h)}}break;case 5:jo(m,m.return);break;case 22:if(m.memoizedState!==null){Py(f);continue}}p!==null?(p.return=m,he=p):Py(f)}d=d.sibling}e:for(d=null,f=t;;){if(f.tag===5){if(d===null){d=f;try{n=f.stateNode,u?(a=n.style,typeof a.setProperty=="function"?a.setProperty("display","none","important"):a.display="none"):(l=f.stateNode,c=f.memoizedProps.style,o=c!=null&&c.hasOwnProperty("display")?c.display:null,l.style.display=Ux("display",o))}catch(h){xt(t,t.return,h)}}}else if(f.tag===6){if(d===null)try{f.stateNode.nodeValue=u?"":f.memoizedProps}catch(h){xt(t,t.return,h)}}else if((f.tag!==22&&f.tag!==23||f.memoizedState===null||f===t)&&f.child!==null){f.child.return=f,f=f.child;continue}if(f===t)break e;for(;f.sibling===null;){if(f.return===null||f.return===t)break e;d===f&&(d=null),f=f.return}d===f&&(d=null),f.sibling.return=f.return,f=f.sibling}}break;case 19:Wr(e,t),hn(t),s&4&&Cy(t);break;case 21:break;default:Wr(e,t),hn(t)}}function hn(t){var e=t.flags;if(e&2){try{e:{for(var r=t.return;r!==null;){if(fb(r)){var s=r;break e}r=r.return}throw Error(Y(160))}switch(s.tag){case 5:var n=s.stateNode;s.flags&32&&(dl(n,""),s.flags&=-33);var a=Ey(t);Wh(t,a,n);break;case 3:case 4:var o=s.stateNode.containerInfo,l=Ey(t);Bh(t,l,o);break;default:throw Error(Y(161))}}catch(c){xt(t,t.return,c)}t.flags&=-3}e&4096&&(t.flags&=-4097)}function zP(t,e,r){he=t,mb(t)}function mb(t,e,r){for(var s=(t.mode&1)!==0;he!==null;){var n=he,a=n.child;if(n.tag===22&&s){var o=n.memoizedState!==null||yc;if(!o){var l=n.alternate,c=l!==null&&l.memoizedState!==null||Gt;l=yc;var u=Gt;if(yc=o,(Gt=c)&&!u)for(he=n;he!==null;)o=he,c=o.child,o.tag===22&&o.memoizedState!==null?Ny(n):c!==null?(c.return=o,he=c):Ny(n);for(;a!==null;)he=a,mb(a),a=a.sibling;he=n,yc=l,Gt=u}ky(t)}else n.subtreeFlags&8772&&a!==null?(a.return=n,he=a):ky(t)}}function ky(t){for(;he!==null;){var e=he;if(e.flags&8772){var r=e.alternate;try{if(e.flags&8772)switch(e.tag){case 0:case 11:case 15:Gt||yd(5,e);break;case 1:var s=e.stateNode;if(e.flags&4&&!Gt)if(r===null)s.componentDidMount();else{var n=e.elementType===e.type?r.memoizedProps:Zr(e.type,r.memoizedProps);s.componentDidUpdate(n,r.memoizedState,s.__reactInternalSnapshotBeforeUpdate)}var a=e.updateQueue;a!==null&&uy(e,a,s);break;case 3:var o=e.updateQueue;if(o!==null){if(r=null,e.child!==null)switch(e.child.tag){case 5:r=e.child.stateNode;break;case 1:r=e.child.stateNode}uy(e,o,r)}break;case 5:var l=e.stateNode;if(r===null&&e.flags&4){r=l;var c=e.memoizedProps;switch(e.type){case"button":case"input":case"select":case"textarea":c.autoFocus&&r.focus();break;case"img":c.src&&(r.src=c.src)}}break;case 6:break;case 4:break;case 12:break;case 13:if(e.memoizedState===null){var u=e.alternate;if(u!==null){var d=u.memoizedState;if(d!==null){var f=d.dehydrated;f!==null&&ml(f)}}}break;case 19:case 17:case 21:case 22:case 23:case 25:break;default:throw Error(Y(163))}Gt||e.flags&512&&Hh(e)}catch(m){xt(e,e.return,m)}}if(e===t){he=null;break}if(r=e.sibling,r!==null){r.return=e.return,he=r;break}he=e.return}}function Py(t){for(;he!==null;){var e=he;if(e===t){he=null;break}var r=e.sibling;if(r!==null){r.return=e.return,he=r;break}he=e.return}}function Ny(t){for(;he!==null;){var e=he;try{switch(e.tag){case 0:case 11:case 15:var r=e.return;try{yd(4,e)}catch(c){xt(e,r,c)}break;case 1:var s=e.stateNode;if(typeof s.componentDidMount=="function"){var n=e.return;try{s.componentDidMount()}catch(c){xt(e,n,c)}}var a=e.return;try{Hh(e)}catch(c){xt(e,a,c)}break;case 5:var o=e.return;try{Hh(e)}catch(c){xt(e,o,c)}}}catch(c){xt(e,e.return,c)}if(e===t){he=null;break}var l=e.sibling;if(l!==null){l.return=e.return,he=l;break}he=e.return}}var VP=Math.ceil,Cu=ds.ReactCurrentDispatcher,tv=ds.ReactCurrentOwner,$r=ds.ReactCurrentBatchConfig,Ze=0,Lt=null,Pt=null,qt=0,br=0,Ro=ca(0),Ot=0,kl=null,qa=0,xd=0,rv=0,sl=null,fr=null,nv=0,ui=1/0,Hn=null,ku=!1,Kh=null,Zs=null,xc=!1,zs=null,Pu=0,al=0,Qh=null,Bc=-1,Wc=0;function rr(){return Ze&6?_t():Bc!==-1?Bc:Bc=_t()}function Ys(t){return t.mode&1?Ze&2&&qt!==0?qt&-qt:CP.transition!==null?(Wc===0&&(Wc=Xx()),Wc):(t=Xe,t!==0||(t=window.event,t=t===void 0?16:ow(t.type)),t):1}function sn(t,e,r,s){if(50<al)throw al=0,Qh=null,Error(Y(185));$l(t,r,s),(!(Ze&2)||t!==Lt)&&(t===Lt&&(!(Ze&2)&&(xd|=r),Ot===4&&js(t,qt)),gr(t,s),r===1&&Ze===0&&!(e.mode&1)&&(ui=_t()+500,md&&ua()))}function gr(t,e){var r=t.callbackNode;Ck(t,e);var s=uu(t,t===Lt?qt:0);if(s===0)r!==null&&$g(r),t.callbackNode=null,t.callbackPriority=0;else if(e=s&-s,t.callbackPriority!==e){if(r!=null&&$g(r),e===1)t.tag===0?EP(jy.bind(null,t)):Cw(jy.bind(null,t)),wP(function(){!(Ze&6)&&ua()}),r=null;else{switch(ew(s)){case 1:r=jm;break;case 4:r=Yx;break;case 16:r=cu;break;case 536870912:r=Jx;break;default:r=cu}r=_b(r,vb.bind(null,t))}t.callbackPriority=e,t.callbackNode=r}}function vb(t,e){if(Bc=-1,Wc=0,Ze&6)throw Error(Y(327));var r=t.callbackNode;if(Lo()&&t.callbackNode!==r)return null;var s=uu(t,t===Lt?qt:0);if(s===0)return null;if(s&30||s&t.expiredLanes||e)e=Nu(t,s);else{e=s;var n=Ze;Ze|=2;var a=yb();(Lt!==t||qt!==e)&&(Hn=null,ui=_t()+500,$a(t,e));do try{BP();break}catch(l){gb(t,l)}while(!0);Vm(),Cu.current=a,Ze=n,Pt!==null?e=0:(Lt=null,qt=0,e=Ot)}if(e!==0){if(e===2&&(n=bh(t),n!==0&&(s=n,e=Gh(t,n))),e===1)throw r=kl,$a(t,0),js(t,s),gr(t,_t()),r;if(e===6)js(t,s);else{if(n=t.current.alternate,!(s&30)&&!qP(n)&&(e=Nu(t,s),e===2&&(a=bh(t),a!==0&&(s=a,e=Gh(t,a))),e===1))throw r=kl,$a(t,0),js(t,s),gr(t,_t()),r;switch(t.finishedWork=n,t.finishedLanes=s,e){case 0:case 1:throw Error(Y(345));case 2:Sa(t,fr,Hn);break;case 3:if(js(t,s),(s&130023424)===s&&(e=nv+500-_t(),10<e)){if(uu(t,0)!==0)break;if(n=t.suspendedLanes,(n&s)!==s){rr(),t.pingedLanes|=t.suspendedLanes&n;break}t.timeoutHandle=jh(Sa.bind(null,t,fr,Hn),e);break}Sa(t,fr,Hn);break;case 4:if(js(t,s),(s&4194240)===s)break;for(e=t.eventTimes,n=-1;0<s;){var o=31-nn(s);a=1<<o,o=e[o],o>n&&(n=o),s&=~a}if(s=n,s=_t()-s,s=(120>s?120:480>s?480:1080>s?1080:1920>s?1920:3e3>s?3e3:4320>s?4320:1960*VP(s/1960))-s,10<s){t.timeoutHandle=jh(Sa.bind(null,t,fr,Hn),s);break}Sa(t,fr,Hn);break;case 5:Sa(t,fr,Hn);break;default:throw Error(Y(329))}}}return gr(t,_t()),t.callbackNode===r?vb.bind(null,t):null}function Gh(t,e){var r=sl;return t.current.memoizedState.isDehydrated&&($a(t,e).flags|=256),t=Nu(t,e),t!==2&&(e=fr,fr=r,e!==null&&Zh(e)),t}function Zh(t){fr===null?fr=t:fr.push.apply(fr,t)}function qP(t){for(var e=t;;){if(e.flags&16384){var r=e.updateQueue;if(r!==null&&(r=r.stores,r!==null))for(var s=0;s<r.length;s++){var n=r[s],a=n.getSnapshot;n=n.value;try{if(!an(a(),n))return!1}catch{return!1}}}if(r=e.child,e.subtreeFlags&16384&&r!==null)r.return=e,e=r;else{if(e===t)break;for(;e.sibling===null;){if(e.return===null||e.return===t)return!0;e=e.return}e.sibling.return=e.return,e=e.sibling}}return!0}function js(t,e){for(e&=~rv,e&=~xd,t.suspendedLanes|=e,t.pingedLanes&=~e,t=t.expirationTimes;0<e;){var r=31-nn(e),s=1<<r;t[r]=-1,e&=~s}}function jy(t){if(Ze&6)throw Error(Y(327));Lo();var e=uu(t,0);if(!(e&1))return gr(t,_t()),null;var r=Nu(t,e);if(t.tag!==0&&r===2){var s=bh(t);s!==0&&(e=s,r=Gh(t,s))}if(r===1)throw r=kl,$a(t,0),js(t,e),gr(t,_t()),r;if(r===6)throw Error(Y(345));return t.finishedWork=t.current.alternate,t.finishedLanes=e,Sa(t,fr,Hn),gr(t,_t()),null}function sv(t,e){var r=Ze;Ze|=1;try{return t(e)}finally{Ze=r,Ze===0&&(ui=_t()+500,md&&ua())}}function Ha(t){zs!==null&&zs.tag===0&&!(Ze&6)&&Lo();var e=Ze;Ze|=1;var r=$r.transition,s=Xe;try{if($r.transition=null,Xe=1,t)return t()}finally{Xe=s,$r.transition=r,Ze=e,!(Ze&6)&&ua()}}function av(){br=Ro.current,ct(Ro)}function $a(t,e){t.finishedWork=null,t.finishedLanes=0;var r=t.timeoutHandle;if(r!==-1&&(t.timeoutHandle=-1,xP(r)),Pt!==null)for(r=Pt.return;r!==null;){var s=r;switch(Lm(s),s.tag){case 1:s=s.type.childContextTypes,s!=null&&mu();break;case 3:li(),ct(mr),ct(Zt),Qm();break;case 5:Km(s);break;case 4:li();break;case 13:ct(mt);break;case 19:ct(mt);break;case 10:qm(s.type._context);break;case 22:case 23:av()}r=r.return}if(Lt=t,Pt=t=Js(t.current,null),qt=br=e,Ot=0,kl=null,rv=xd=qa=0,fr=sl=null,Pa!==null){for(e=0;e<Pa.length;e++)if(r=Pa[e],s=r.interleaved,s!==null){r.interleaved=null;var n=s.next,a=r.pending;if(a!==null){var o=a.next;a.next=n,s.next=o}r.pending=s}Pa=null}return t}function gb(t,e){do{var r=Pt;try{if(Vm(),Vc.current=Eu,_u){for(var s=vt.memoizedState;s!==null;){var n=s.queue;n!==null&&(n.pending=null),s=s.next}_u=!1}if(Va=0,$t=Rt=vt=null,rl=!1,_l=0,tv.current=null,r===null||r.return===null){Ot=1,kl=e,Pt=null;break}e:{var a=t,o=r.return,l=r,c=e;if(e=qt,l.flags|=32768,c!==null&&typeof c=="object"&&typeof c.then=="function"){var u=c,d=l,f=d.tag;if(!(d.mode&1)&&(f===0||f===11||f===15)){var m=d.alternate;m?(d.updateQueue=m.updateQueue,d.memoizedState=m.memoizedState,d.lanes=m.lanes):(d.updateQueue=null,d.memoizedState=null)}var p=vy(o);if(p!==null){p.flags&=-257,gy(p,o,l,a,e),p.mode&1&&my(a,u,e),e=p,c=u;var w=e.updateQueue;if(w===null){var h=new Set;h.add(c),e.updateQueue=h}else w.add(c);break e}else{if(!(e&1)){my(a,u,e),ov();break e}c=Error(Y(426))}}else if(ht&&l.mode&1){var g=vy(o);if(g!==null){!(g.flags&65536)&&(g.flags|=256),gy(g,o,l,a,e),Um(ci(c,l));break e}}a=c=ci(c,l),Ot!==4&&(Ot=2),sl===null?sl=[a]:sl.push(a),a=o;do{switch(a.tag){case 3:a.flags|=65536,e&=-e,a.lanes|=e;var v=eb(a,c,e);cy(a,v);break e;case 1:l=c;var y=a.type,b=a.stateNode;if(!(a.flags&128)&&(typeof y.getDerivedStateFromError=="function"||b!==null&&typeof b.componentDidCatch=="function"&&(Zs===null||!Zs.has(b)))){a.flags|=65536,e&=-e,a.lanes|=e;var S=tb(a,l,e);cy(a,S);break e}}a=a.return}while(a!==null)}wb(r)}catch(E){e=E,Pt===r&&r!==null&&(Pt=r=r.return);continue}break}while(!0)}function yb(){var t=Cu.current;return Cu.current=Eu,t===null?Eu:t}function ov(){(Ot===0||Ot===3||Ot===2)&&(Ot=4),Lt===null||!(qa&268435455)&&!(xd&268435455)||js(Lt,qt)}function Nu(t,e){var r=Ze;Ze|=2;var s=yb();(Lt!==t||qt!==e)&&(Hn=null,$a(t,e));do try{HP();break}catch(n){gb(t,n)}while(!0);if(Vm(),Ze=r,Cu.current=s,Pt!==null)throw Error(Y(261));return Lt=null,qt=0,Ot}function HP(){for(;Pt!==null;)xb(Pt)}function BP(){for(;Pt!==null&&!vk();)xb(Pt)}function xb(t){var e=Sb(t.alternate,t,br);t.memoizedProps=t.pendingProps,e===null?wb(t):Pt=e,tv.current=null}function wb(t){var e=t;do{var r=e.alternate;if(t=e.return,e.flags&32768){if(r=FP(r,e),r!==null){r.flags&=32767,Pt=r;return}if(t!==null)t.flags|=32768,t.subtreeFlags=0,t.deletions=null;else{Ot=6,Pt=null;return}}else if(r=$P(r,e,br),r!==null){Pt=r;return}if(e=e.sibling,e!==null){Pt=e;return}Pt=e=t}while(e!==null);Ot===0&&(Ot=5)}function Sa(t,e,r){var s=Xe,n=$r.transition;try{$r.transition=null,Xe=1,WP(t,e,r,s)}finally{$r.transition=n,Xe=s}return null}function WP(t,e,r,s){do Lo();while(zs!==null);if(Ze&6)throw Error(Y(327));r=t.finishedWork;var n=t.finishedLanes;if(r===null)return null;if(t.finishedWork=null,t.finishedLanes=0,r===t.current)throw Error(Y(177));t.callbackNode=null,t.callbackPriority=0;var a=r.lanes|r.childLanes;if(kk(t,a),t===Lt&&(Pt=Lt=null,qt=0),!(r.subtreeFlags&2064)&&!(r.flags&2064)||xc||(xc=!0,_b(cu,function(){return Lo(),null})),a=(r.flags&15990)!==0,r.subtreeFlags&15990||a){a=$r.transition,$r.transition=null;var o=Xe;Xe=1;var l=Ze;Ze|=4,tv.current=null,UP(t,r),pb(r,t),fP(Ph),du=!!kh,Ph=kh=null,t.current=r,zP(r),gk(),Ze=l,Xe=o,$r.transition=a}else t.current=r;if(xc&&(xc=!1,zs=t,Pu=n),a=t.pendingLanes,a===0&&(Zs=null),wk(r.stateNode),gr(t,_t()),e!==null)for(s=t.onRecoverableError,r=0;r<e.length;r++)n=e[r],s(n.value,{componentStack:n.stack,digest:n.digest});if(ku)throw ku=!1,t=Kh,Kh=null,t;return Pu&1&&t.tag!==0&&Lo(),a=t.pendingLanes,a&1?t===Qh?al++:(al=0,Qh=t):al=0,ua(),null}function Lo(){if(zs!==null){var t=ew(Pu),e=$r.transition,r=Xe;try{if($r.transition=null,Xe=16>t?16:t,zs===null)var s=!1;else{if(t=zs,zs=null,Pu=0,Ze&6)throw Error(Y(331));var n=Ze;for(Ze|=4,he=t.current;he!==null;){var a=he,o=a.child;if(he.flags&16){var l=a.deletions;if(l!==null){for(var c=0;c<l.length;c++){var u=l[c];for(he=u;he!==null;){var d=he;switch(d.tag){case 0:case 11:case 15:nl(8,d,a)}var f=d.child;if(f!==null)f.return=d,he=f;else for(;he!==null;){d=he;var m=d.sibling,p=d.return;if(db(d),d===u){he=null;break}if(m!==null){m.return=p,he=m;break}he=p}}}var w=a.alternate;if(w!==null){var h=w.child;if(h!==null){w.child=null;do{var g=h.sibling;h.sibling=null,h=g}while(h!==null)}}he=a}}if(a.subtreeFlags&2064&&o!==null)o.return=a,he=o;else e:for(;he!==null;){if(a=he,a.flags&2048)switch(a.tag){case 0:case 11:case 15:nl(9,a,a.return)}var v=a.sibling;if(v!==null){v.return=a.return,he=v;break e}he=a.return}}var y=t.current;for(he=y;he!==null;){o=he;var b=o.child;if(o.subtreeFlags&2064&&b!==null)b.return=o,he=b;else e:for(o=y;he!==null;){if(l=he,l.flags&2048)try{switch(l.tag){case 0:case 11:case 15:yd(9,l)}}catch(E){xt(l,l.return,E)}if(l===o){he=null;break e}var S=l.sibling;if(S!==null){S.return=l.return,he=S;break e}he=l.return}}if(Ze=n,ua(),Pn&&typeof Pn.onPostCommitFiberRoot=="function")try{Pn.onPostCommitFiberRoot(ud,t)}catch{}s=!0}return s}finally{Xe=r,$r.transition=e}}return!1}function Ry(t,e,r){e=ci(r,e),e=eb(t,e,1),t=Gs(t,e,1),e=rr(),t!==null&&($l(t,1,e),gr(t,e))}function xt(t,e,r){if(t.tag===3)Ry(t,t,r);else for(;e!==null;){if(e.tag===3){Ry(e,t,r);break}else if(e.tag===1){var s=e.stateNode;if(typeof e.type.getDerivedStateFromError=="function"||typeof s.componentDidCatch=="function"&&(Zs===null||!Zs.has(s))){t=ci(r,t),t=tb(e,t,1),e=Gs(e,t,1),t=rr(),e!==null&&($l(e,1,t),gr(e,t));break}}e=e.return}}function KP(t,e,r){var s=t.pingCache;s!==null&&s.delete(e),e=rr(),t.pingedLanes|=t.suspendedLanes&r,Lt===t&&(qt&r)===r&&(Ot===4||Ot===3&&(qt&130023424)===qt&&500>_t()-nv?$a(t,0):rv|=r),gr(t,e)}function bb(t,e){e===0&&(t.mode&1?(e=cc,cc<<=1,!(cc&130023424)&&(cc=4194304)):e=1);var r=rr();t=as(t,e),t!==null&&($l(t,e,r),gr(t,r))}function QP(t){var e=t.memoizedState,r=0;e!==null&&(r=e.retryLane),bb(t,r)}function GP(t,e){var r=0;switch(t.tag){case 13:var s=t.stateNode,n=t.memoizedState;n!==null&&(r=n.retryLane);break;case 19:s=t.stateNode;break;default:throw Error(Y(314))}s!==null&&s.delete(e),bb(t,r)}var Sb;Sb=function(t,e,r){if(t!==null)if(t.memoizedProps!==e.pendingProps||mr.current)pr=!0;else{if(!(t.lanes&r)&&!(e.flags&128))return pr=!1,MP(t,e,r);pr=!!(t.flags&131072)}else pr=!1,ht&&e.flags&1048576&&kw(e,yu,e.index);switch(e.lanes=0,e.tag){case 2:var s=e.type;Hc(t,e),t=e.pendingProps;var n=ai(e,Zt.current);Fo(e,r),n=Zm(null,e,s,t,n,r);var a=Ym();return e.flags|=1,typeof n=="object"&&n!==null&&typeof n.render=="function"&&n.$$typeof===void 0?(e.tag=1,e.memoizedState=null,e.updateQueue=null,vr(s)?(a=!0,vu(e)):a=!1,e.memoizedState=n.state!==null&&n.state!==void 0?n.state:null,Bm(e),n.updater=gd,e.stateNode=n,n._reactInternals=e,Mh(e,s,t,r),e=Lh(null,e,s,!0,a,r)):(e.tag=0,ht&&a&&Fm(e),er(null,e,n,r),e=e.child),e;case 16:s=e.elementType;e:{switch(Hc(t,e),t=e.pendingProps,n=s._init,s=n(s._payload),e.type=s,n=e.tag=YP(s),t=Zr(s,t),n){case 0:e=Fh(null,e,s,t,r);break e;case 1:e=wy(null,e,s,t,r);break e;case 11:e=yy(null,e,s,t,r);break e;case 14:e=xy(null,e,s,Zr(s.type,t),r);break e}throw Error(Y(306,s,""))}return e;case 0:return s=e.type,n=e.pendingProps,n=e.elementType===s?n:Zr(s,n),Fh(t,e,s,n,r);case 1:return s=e.type,n=e.pendingProps,n=e.elementType===s?n:Zr(s,n),wy(t,e,s,n,r);case 3:e:{if(ab(e),t===null)throw Error(Y(387));s=e.pendingProps,a=e.memoizedState,n=a.element,Aw(t,e),bu(e,s,null,r);var o=e.memoizedState;if(s=o.element,a.isDehydrated)if(a={element:s,isDehydrated:!1,cache:o.cache,pendingSuspenseBoundaries:o.pendingSuspenseBoundaries,transitions:o.transitions},e.updateQueue.baseState=a,e.memoizedState=a,e.flags&256){n=ci(Error(Y(423)),e),e=by(t,e,s,r,n);break e}else if(s!==n){n=ci(Error(Y(424)),e),e=by(t,e,s,r,n);break e}else for(_r=Qs(e.stateNode.containerInfo.firstChild),Er=e,ht=!0,tn=null,r=Rw(e,null,s,r),e.child=r;r;)r.flags=r.flags&-3|4096,r=r.sibling;else{if(oi(),s===n){e=os(t,e,r);break e}er(t,e,s,r)}e=e.child}return e;case 5:return Ow(e),t===null&&Oh(e),s=e.type,n=e.pendingProps,a=t!==null?t.memoizedProps:null,o=n.children,Nh(s,n)?o=null:a!==null&&Nh(s,a)&&(e.flags|=32),sb(t,e),er(t,e,o,r),e.child;case 6:return t===null&&Oh(e),null;case 13:return ob(t,e,r);case 4:return Wm(e,e.stateNode.containerInfo),s=e.pendingProps,t===null?e.child=ii(e,null,s,r):er(t,e,s,r),e.child;case 11:return s=e.type,n=e.pendingProps,n=e.elementType===s?n:Zr(s,n),yy(t,e,s,n,r);case 7:return er(t,e,e.pendingProps,r),e.child;case 8:return er(t,e,e.pendingProps.children,r),e.child;case 12:return er(t,e,e.pendingProps.children,r),e.child;case 10:e:{if(s=e.type._context,n=e.pendingProps,a=e.memoizedProps,o=n.value,st(xu,s._currentValue),s._currentValue=o,a!==null)if(an(a.value,o)){if(a.children===n.children&&!mr.current){e=os(t,e,r);break e}}else for(a=e.child,a!==null&&(a.return=e);a!==null;){var l=a.dependencies;if(l!==null){o=a.child;for(var c=l.firstContext;c!==null;){if(c.context===s){if(a.tag===1){c=es(-1,r&-r),c.tag=2;var u=a.updateQueue;if(u!==null){u=u.shared;var d=u.pending;d===null?c.next=c:(c.next=d.next,d.next=c),u.pending=c}}a.lanes|=r,c=a.alternate,c!==null&&(c.lanes|=r),Ih(a.return,r,e),l.lanes|=r;break}c=c.next}}else if(a.tag===10)o=a.type===e.type?null:a.child;else if(a.tag===18){if(o=a.return,o===null)throw Error(Y(341));o.lanes|=r,l=o.alternate,l!==null&&(l.lanes|=r),Ih(o,r,e),o=a.sibling}else o=a.child;if(o!==null)o.return=a;else for(o=a;o!==null;){if(o===e){o=null;break}if(a=o.sibling,a!==null){a.return=o.return,o=a;break}o=o.return}a=o}er(t,e,n.children,r),e=e.child}return e;case 9:return n=e.type,s=e.pendingProps.children,Fo(e,r),n=Fr(n),s=s(n),e.flags|=1,er(t,e,s,r),e.child;case 14:return s=e.type,n=Zr(s,e.pendingProps),n=Zr(s.type,n),xy(t,e,s,n,r);case 15:return rb(t,e,e.type,e.pendingProps,r);case 17:return s=e.type,n=e.pendingProps,n=e.elementType===s?n:Zr(s,n),Hc(t,e),e.tag=1,vr(s)?(t=!0,vu(e)):t=!1,Fo(e,r),Xw(e,s,n),Mh(e,s,n,r),Lh(null,e,s,!0,t,r);case 19:return ib(t,e,r);case 22:return nb(t,e,r)}throw Error(Y(156,e.tag))};function _b(t,e){return Zx(t,e)}function ZP(t,e,r,s){this.tag=t,this.key=r,this.sibling=this.child=this.return=this.stateNode=this.type=this.elementType=null,this.index=0,this.ref=null,this.pendingProps=e,this.dependencies=this.memoizedState=this.updateQueue=this.memoizedProps=null,this.mode=s,this.subtreeFlags=this.flags=0,this.deletions=null,this.childLanes=this.lanes=0,this.alternate=null}function Mr(t,e,r,s){return new ZP(t,e,r,s)}function iv(t){return t=t.prototype,!(!t||!t.isReactComponent)}function YP(t){if(typeof t=="function")return iv(t)?1:0;if(t!=null){if(t=t.$$typeof,t===km)return 11;if(t===Pm)return 14}return 2}function Js(t,e){var r=t.alternate;return r===null?(r=Mr(t.tag,e,t.key,t.mode),r.elementType=t.elementType,r.type=t.type,r.stateNode=t.stateNode,r.alternate=t,t.alternate=r):(r.pendingProps=e,r.type=t.type,r.flags=0,r.subtreeFlags=0,r.deletions=null),r.flags=t.flags&14680064,r.childLanes=t.childLanes,r.lanes=t.lanes,r.child=t.child,r.memoizedProps=t.memoizedProps,r.memoizedState=t.memoizedState,r.updateQueue=t.updateQueue,e=t.dependencies,r.dependencies=e===null?null:{lanes:e.lanes,firstContext:e.firstContext},r.sibling=t.sibling,r.index=t.index,r.ref=t.ref,r}function Kc(t,e,r,s,n,a){var o=2;if(s=t,typeof t=="function")iv(t)&&(o=1);else if(typeof t=="string")o=5;else e:switch(t){case wo:return Fa(r.children,n,a,e);case Cm:o=8,n|=8;break;case oh:return t=Mr(12,r,e,n|2),t.elementType=oh,t.lanes=a,t;case ih:return t=Mr(13,r,e,n),t.elementType=ih,t.lanes=a,t;case lh:return t=Mr(19,r,e,n),t.elementType=lh,t.lanes=a,t;case Ox:return wd(r,n,a,e);default:if(typeof t=="object"&&t!==null)switch(t.$$typeof){case Tx:o=10;break e;case Ax:o=9;break e;case km:o=11;break e;case Pm:o=14;break e;case _s:o=16,s=null;break e}throw Error(Y(130,t==null?t:typeof t,""))}return e=Mr(o,r,e,n),e.elementType=t,e.type=s,e.lanes=a,e}function Fa(t,e,r,s){return t=Mr(7,t,s,e),t.lanes=r,t}function wd(t,e,r,s){return t=Mr(22,t,s,e),t.elementType=Ox,t.lanes=r,t.stateNode={isHidden:!1},t}function jf(t,e,r){return t=Mr(6,t,null,e),t.lanes=r,t}function Rf(t,e,r){return e=Mr(4,t.children!==null?t.children:[],t.key,e),e.lanes=r,e.stateNode={containerInfo:t.containerInfo,pendingChildren:null,implementation:t.implementation},e}function JP(t,e,r,s,n){this.tag=e,this.containerInfo=t,this.finishedWork=this.pingCache=this.current=this.pendingChildren=null,this.timeoutHandle=-1,this.callbackNode=this.pendingContext=this.context=null,this.callbackPriority=0,this.eventTimes=uf(0),this.expirationTimes=uf(-1),this.entangledLanes=this.finishedLanes=this.mutableReadLanes=this.expiredLanes=this.pingedLanes=this.suspendedLanes=this.pendingLanes=0,this.entanglements=uf(0),this.identifierPrefix=s,this.onRecoverableError=n,this.mutableSourceEagerHydrationData=null}function lv(t,e,r,s,n,a,o,l,c){return t=new JP(t,e,r,l,c),e===1?(e=1,a===!0&&(e|=8)):e=0,a=Mr(3,null,null,e),t.current=a,a.stateNode=t,a.memoizedState={element:s,isDehydrated:r,cache:null,transitions:null,pendingSuspenseBoundaries:null},Bm(a),t}function XP(t,e,r){var s=3<arguments.length&&arguments[3]!==void 0?arguments[3]:null;return{$$typeof:xo,key:s==null?null:""+s,children:t,containerInfo:e,implementation:r}}function Eb(t){if(!t)return sa;t=t._reactInternals;e:{if(no(t)!==t||t.tag!==1)throw Error(Y(170));var e=t;do{switch(e.tag){case 3:e=e.stateNode.context;break e;case 1:if(vr(e.type)){e=e.stateNode.__reactInternalMemoizedMergedChildContext;break e}}e=e.return}while(e!==null);throw Error(Y(171))}if(t.tag===1){var r=t.type;if(vr(r))return Ew(t,r,e)}return e}function Cb(t,e,r,s,n,a,o,l,c){return t=lv(r,s,!0,t,n,a,o,l,c),t.context=Eb(null),r=t.current,s=rr(),n=Ys(r),a=es(s,n),a.callback=e??null,Gs(r,a,n),t.current.lanes=n,$l(t,n,s),gr(t,s),t}function bd(t,e,r,s){var n=e.current,a=rr(),o=Ys(n);return r=Eb(r),e.context===null?e.context=r:e.pendingContext=r,e=es(a,o),e.payload={element:t},s=s===void 0?null:s,s!==null&&(e.callback=s),t=Gs(n,e,o),t!==null&&(sn(t,n,o,a),zc(t,n,o)),o}function ju(t){if(t=t.current,!t.child)return null;switch(t.child.tag){case 5:return t.child.stateNode;default:return t.child.stateNode}}function Ty(t,e){if(t=t.memoizedState,t!==null&&t.dehydrated!==null){var r=t.retryLane;t.retryLane=r!==0&&r<e?r:e}}function cv(t,e){Ty(t,e),(t=t.alternate)&&Ty(t,e)}function eN(){return null}var kb=typeof reportError=="function"?reportError:function(t){console.error(t)};function uv(t){this._internalRoot=t}Sd.prototype.render=uv.prototype.render=function(t){var e=this._internalRoot;if(e===null)throw Error(Y(409));bd(t,e,null,null)};Sd.prototype.unmount=uv.prototype.unmount=function(){var t=this._internalRoot;if(t!==null){this._internalRoot=null;var e=t.containerInfo;Ha(function(){bd(null,t,null,null)}),e[ss]=null}};function Sd(t){this._internalRoot=t}Sd.prototype.unstable_scheduleHydration=function(t){if(t){var e=nw();t={blockedOn:null,target:t,priority:e};for(var r=0;r<Ns.length&&e!==0&&e<Ns[r].priority;r++);Ns.splice(r,0,t),r===0&&aw(t)}};function dv(t){return!(!t||t.nodeType!==1&&t.nodeType!==9&&t.nodeType!==11)}function _d(t){return!(!t||t.nodeType!==1&&t.nodeType!==9&&t.nodeType!==11&&(t.nodeType!==8||t.nodeValue!==" react-mount-point-unstable "))}function Ay(){}function tN(t,e,r,s,n){if(n){if(typeof s=="function"){var a=s;s=function(){var u=ju(o);a.call(u)}}var o=Cb(e,s,t,0,null,!1,!1,"",Ay);return t._reactRootContainer=o,t[ss]=o.current,yl(t.nodeType===8?t.parentNode:t),Ha(),o}for(;n=t.lastChild;)t.removeChild(n);if(typeof s=="function"){var l=s;s=function(){var u=ju(c);l.call(u)}}var c=lv(t,0,!1,null,null,!1,!1,"",Ay);return t._reactRootContainer=c,t[ss]=c.current,yl(t.nodeType===8?t.parentNode:t),Ha(function(){bd(e,c,r,s)}),c}function Ed(t,e,r,s,n){var a=r._reactRootContainer;if(a){var o=a;if(typeof n=="function"){var l=n;n=function(){var c=ju(o);l.call(c)}}bd(e,o,t,n)}else o=tN(r,e,t,n,s);return ju(o)}tw=function(t){switch(t.tag){case 3:var e=t.stateNode;if(e.current.memoizedState.isDehydrated){var r=qi(e.pendingLanes);r!==0&&(Rm(e,r|1),gr(e,_t()),!(Ze&6)&&(ui=_t()+500,ua()))}break;case 13:Ha(function(){var s=as(t,1);if(s!==null){var n=rr();sn(s,t,1,n)}}),cv(t,1)}};Tm=function(t){if(t.tag===13){var e=as(t,134217728);if(e!==null){var r=rr();sn(e,t,134217728,r)}cv(t,134217728)}};rw=function(t){if(t.tag===13){var e=Ys(t),r=as(t,e);if(r!==null){var s=rr();sn(r,t,e,s)}cv(t,e)}};nw=function(){return Xe};sw=function(t,e){var r=Xe;try{return Xe=t,e()}finally{Xe=r}};yh=function(t,e,r){switch(e){case"input":if(dh(t,r),e=r.name,r.type==="radio"&&e!=null){for(r=t;r.parentNode;)r=r.parentNode;for(r=r.querySelectorAll("input[name="+JSON.stringify(""+e)+'][type="radio"]'),e=0;e<r.length;e++){var s=r[e];if(s!==t&&s.form===t.form){var n=pd(s);if(!n)throw Error(Y(90));Dx(s),dh(s,n)}}}break;case"textarea":$x(t,r);break;case"select":e=r.value,e!=null&&Io(t,!!r.multiple,e,!1)}};Hx=sv;Bx=Ha;var rN={usingClientEntryPoint:!1,Events:[Ll,Eo,pd,Vx,qx,sv]},$i={findFiberByHostInstance:ka,bundleType:0,version:"18.3.1",rendererPackageName:"react-dom"},nN={bundleType:$i.bundleType,version:$i.version,rendererPackageName:$i.rendererPackageName,rendererConfig:$i.rendererConfig,overrideHookState:null,overrideHookStateDeletePath:null,overrideHookStateRenamePath:null,overrideProps:null,overridePropsDeletePath:null,overridePropsRenamePath:null,setErrorHandler:null,setSuspenseHandler:null,scheduleUpdate:null,currentDispatcherRef:ds.ReactCurrentDispatcher,findHostInstanceByFiber:function(t){return t=Qx(t),t===null?null:t.stateNode},findFiberByHostInstance:$i.findFiberByHostInstance||eN,findHostInstancesForRefresh:null,scheduleRefresh:null,scheduleRoot:null,setRefreshHandler:null,getCurrentFiber:null,reconcilerVersion:"18.3.1-next-f1338f8080-20240426"};if(typeof __REACT_DEVTOOLS_GLOBAL_HOOK__<"u"){var wc=__REACT_DEVTOOLS_GLOBAL_HOOK__;if(!wc.isDisabled&&wc.supportsFiber)try{ud=wc.inject(nN),Pn=wc}catch{}}Pr.__SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED=rN;Pr.createPortal=function(t,e){var r=2<arguments.length&&arguments[2]!==void 0?arguments[2]:null;if(!dv(e))throw Error(Y(200));return XP(t,e,null,r)};Pr.createRoot=function(t,e){if(!dv(t))throw Error(Y(299));var r=!1,s="",n=kb;return e!=null&&(e.unstable_strictMode===!0&&(r=!0),e.identifierPrefix!==void 0&&(s=e.identifierPrefix),e.onRecoverableError!==void 0&&(n=e.onRecoverableError)),e=lv(t,1,!1,null,null,r,!1,s,n),t[ss]=e.current,yl(t.nodeType===8?t.parentNode:t),new uv(e)};Pr.findDOMNode=function(t){if(t==null)return null;if(t.nodeType===1)return t;var e=t._reactInternals;if(e===void 0)throw typeof t.render=="function"?Error(Y(188)):(t=Object.keys(t).join(","),Error(Y(268,t)));return t=Qx(e),t=t===null?null:t.stateNode,t};Pr.flushSync=function(t){return Ha(t)};Pr.hydrate=function(t,e,r){if(!_d(e))throw Error(Y(200));return Ed(null,t,e,!0,r)};Pr.hydrateRoot=function(t,e,r){if(!dv(t))throw Error(Y(405));var s=r!=null&&r.hydratedSources||null,n=!1,a="",o=kb;if(r!=null&&(r.unstable_strictMode===!0&&(n=!0),r.identifierPrefix!==void 0&&(a=r.identifierPrefix),r.onRecoverableError!==void 0&&(o=r.onRecoverableError)),e=Cb(e,null,t,1,r??null,n,!1,a,o),t[ss]=e.current,yl(t),s)for(t=0;t<s.length;t++)r=s[t],n=r._getVersion,n=n(r._source),e.mutableSourceEagerHydrationData==null?e.mutableSourceEagerHydrationData=[r,n]:e.mutableSourceEagerHydrationData.push(r,n);return new Sd(e)};Pr.render=function(t,e,r){if(!_d(e))throw Error(Y(200));return Ed(null,t,e,!1,r)};Pr.unmountComponentAtNode=function(t){if(!_d(t))throw Error(Y(40));return t._reactRootContainer?(Ha(function(){Ed(null,null,t,!1,function(){t._reactRootContainer=null,t[ss]=null})}),!0):!1};Pr.unstable_batchedUpdates=sv;Pr.unstable_renderSubtreeIntoContainer=function(t,e,r,s){if(!_d(r))throw Error(Y(200));if(t==null||t._reactInternals===void 0)throw Error(Y(38));return Ed(t,e,r,!1,s)};Pr.version="18.3.1-next-f1338f8080-20240426";function Pb(){if(!(typeof __REACT_DEVTOOLS_GLOBAL_HOOK__>"u"||typeof __REACT_DEVTOOLS_GLOBAL_HOOK__.checkDCE!="function"))try{__REACT_DEVTOOLS_GLOBAL_HOOK__.checkDCE(Pb)}catch(t){console.error(t)}}Pb(),Px.exports=Pr;var so=Px.exports;const sN=vm(so);var Nb,Oy=so;Nb=Oy.createRoot,Oy.hydrateRoot;function aN(t,e){if(t instanceof RegExp)return{keys:!1,pattern:t};var r,s,n,a,o=[],l="",c=t.split("/");for(c[0]||c.shift();n=c.shift();)r=n[0],r==="*"?(o.push(r),l+=n[1]==="?"?"(?:/(.*))?":"/(.*)"):r===":"?(s=n.indexOf("?",1),a=n.indexOf(".",1),o.push(n.substring(1,~s?s:~a?a:n.length)),l+=~s&&!~a?"(?:/([^/]+?))?":"/([^/]+?)",~a&&(l+=(~s?"?":"")+"\\"+n.substring(a))):l+="/"+n;return{keys:o,pattern:new RegExp("^"+l+(e?"(?=$|/)":"/?$"),"i")}}var jb={exports:{}},Rb={};/**
|
|
41
|
+
* @license React
|
|
42
|
+
* use-sync-external-store-shim.production.js
|
|
43
|
+
*
|
|
44
|
+
* Copyright (c) Meta Platforms, Inc. and affiliates.
|
|
45
|
+
*
|
|
46
|
+
* This source code is licensed under the MIT license found in the
|
|
47
|
+
* LICENSE file in the root directory of this source tree.
|
|
48
|
+
*/var di=x;function oN(t,e){return t===e&&(t!==0||1/t===1/e)||t!==t&&e!==e}var iN=typeof Object.is=="function"?Object.is:oN,lN=di.useState,cN=di.useEffect,uN=di.useLayoutEffect,dN=di.useDebugValue;function fN(t,e){var r=e(),s=lN({inst:{value:r,getSnapshot:e}}),n=s[0].inst,a=s[1];return uN(function(){n.value=r,n.getSnapshot=e,Tf(n)&&a({inst:n})},[t,r,e]),cN(function(){return Tf(n)&&a({inst:n}),t(function(){Tf(n)&&a({inst:n})})},[t]),dN(r),r}function Tf(t){var e=t.getSnapshot;t=t.value;try{var r=e();return!iN(t,r)}catch{return!0}}function hN(t,e){return e()}var pN=typeof window>"u"||typeof window.document>"u"||typeof window.document.createElement>"u"?hN:fN;Rb.useSyncExternalStore=di.useSyncExternalStore!==void 0?di.useSyncExternalStore:pN;jb.exports=Rb;var mN=jb.exports;const vN=bm.useInsertionEffect,gN=typeof window<"u"&&typeof window.document<"u"&&typeof window.document.createElement<"u",yN=gN?x.useLayoutEffect:x.useEffect,xN=vN||yN,Tb=t=>{const e=x.useRef([t,(...r)=>e[0](...r)]).current;return xN(()=>{e[0]=t}),e[1]},wN="popstate",fv="pushState",hv="replaceState",bN="hashchange",Iy=[wN,fv,hv,bN],SN=t=>{for(const e of Iy)addEventListener(e,t);return()=>{for(const e of Iy)removeEventListener(e,t)}},Ab=(t,e)=>mN.useSyncExternalStore(SN,t,e),_N=()=>location.search,EN=({ssrSearch:t=""}={})=>Ab(_N,()=>t),Dy=()=>location.pathname,CN=({ssrPath:t}={})=>Ab(Dy,t?()=>t:Dy),kN=(t,{replace:e=!1,state:r=null}={})=>history[e?hv:fv](r,"",t),PN=(t={})=>[CN(t),kN],My=Symbol.for("wouter_v3");if(typeof history<"u"&&typeof window[My]>"u"){for(const t of[fv,hv]){const e=history[t];history[t]=function(){const r=e.apply(this,arguments),s=new Event(t);return s.arguments=arguments,dispatchEvent(s),r}}Object.defineProperty(window,My,{value:!0})}const NN=(t,e)=>e.toLowerCase().indexOf(t.toLowerCase())?"~"+e:e.slice(t.length)||"/",Ob=(t="")=>t==="/"?"":t,jN=(t,e)=>t[0]==="~"?t.slice(1):Ob(e)+t,RN=(t="",e)=>NN($y(Ob(t)),$y(e)),$y=t=>{try{return decodeURI(t)}catch{return t}},Ib={hook:PN,searchHook:EN,parser:aN,base:"",ssrPath:void 0,ssrSearch:void 0,ssrContext:void 0,hrefs:t=>t},Db=x.createContext(Ib),zl=()=>x.useContext(Db),Mb={},$b=x.createContext(Mb),TN=()=>x.useContext($b),Cd=t=>{const[e,r]=t.hook(t);return[RN(t.base,e),Tb((s,n)=>r(jN(s,t.base),n))]},AN=()=>Cd(zl()),Fb=(t,e,r,s)=>{const{pattern:n,keys:a}=e instanceof RegExp?{keys:!1,pattern:e}:t(e||"*",s),o=n.exec(r)||[],[l,...c]=o;return l!==void 0?[!0,(()=>{const u=a!==!1?Object.fromEntries(a.map((f,m)=>[f,c[m]])):o.groups;let d={...c};return u&&Object.assign(d,u),d})(),...s?[l]:[]]:[!1,null]},ON=({children:t,...e})=>{var d,f;const r=zl(),s=e.hook?Ib:r;let n=s;const[a,o]=((d=e.ssrPath)==null?void 0:d.split("?"))??[];o&&(e.ssrSearch=o,e.ssrPath=a),e.hrefs=e.hrefs??((f=e.hook)==null?void 0:f.hrefs);let l=x.useRef({}),c=l.current,u=c;for(let m in s){const p=m==="base"?s[m]+(e[m]||""):e[m]||s[m];c===u&&p!==u[m]&&(l.current=u={...u}),u[m]=p,(p!==s[m]||p!==n[m])&&(n=u)}return x.createElement(Db.Provider,{value:n,children:t})},Fy=({children:t,component:e},r)=>e?x.createElement(e,{params:r}):typeof t=="function"?t(r):t,IN=t=>{let e=x.useRef(Mb);const r=e.current;return e.current=Object.keys(t).length!==Object.keys(r).length||Object.entries(t).some(([s,n])=>n!==r[s])?t:r},bc=({path:t,nest:e,match:r,...s})=>{const n=zl(),[a]=Cd(n),[o,l,c]=r??Fb(n.parser,t,a,e),u=IN({...TN(),...l});if(!o)return null;const d=c?x.createElement(ON,{base:c},Fy(s,u)):Fy(s,u);return x.createElement($b.Provider,{value:u,children:d})};x.forwardRef((t,e)=>{const r=zl(),[s,n]=Cd(r),{to:a="",href:o=a,onClick:l,asChild:c,children:u,className:d,replace:f,state:m,...p}=t,w=Tb(g=>{g.ctrlKey||g.metaKey||g.altKey||g.shiftKey||g.button!==0||(l==null||l(g),g.defaultPrevented||(g.preventDefault(),n(o,t)))}),h=r.hrefs(o[0]==="~"?o.slice(1):r.base+o,r);return c&&x.isValidElement(u)?x.cloneElement(u,{onClick:w,href:h}):x.createElement("a",{...p,onClick:w,href:h,className:d!=null&&d.call?d(s===o):d,children:u,ref:e})});const Lb=t=>Array.isArray(t)?t.flatMap(e=>Lb(e&&e.type===x.Fragment?e.props.children:e)):[t],DN=({children:t,location:e})=>{const r=zl(),[s]=Cd(r);for(const n of Lb(t)){let a=0;if(x.isValidElement(n)&&(a=Fb(r.parser,n.props.path,e||s,n.props.nest))[0])return x.cloneElement(n,{match:a})}return null};var bi=class{constructor(){this.listeners=new Set,this.subscribe=this.subscribe.bind(this)}subscribe(t){return this.listeners.add(t),this.onSubscribe(),()=>{this.listeners.delete(t),this.onUnsubscribe()}}hasListeners(){return this.listeners.size>0}onSubscribe(){}onUnsubscribe(){}},Ba=typeof window>"u"||"Deno"in globalThis;function tr(){}function MN(t,e){return typeof t=="function"?t(e):t}function Yh(t){return typeof t=="number"&&t>=0&&t!==1/0}function Ub(t,e){return Math.max(t+(e||0)-Date.now(),0)}function Xs(t,e){return typeof t=="function"?t(e):t}function Ar(t,e){return typeof t=="function"?t(e):t}function Ly(t,e){const{type:r="all",exact:s,fetchStatus:n,predicate:a,queryKey:o,stale:l}=t;if(o){if(s){if(e.queryHash!==pv(o,e.options))return!1}else if(!Pl(e.queryKey,o))return!1}if(r!=="all"){const c=e.isActive();if(r==="active"&&!c||r==="inactive"&&c)return!1}return!(typeof l=="boolean"&&e.isStale()!==l||n&&n!==e.state.fetchStatus||a&&!a(e))}function Uy(t,e){const{exact:r,status:s,predicate:n,mutationKey:a}=t;if(a){if(!e.options.mutationKey)return!1;if(r){if(Wa(e.options.mutationKey)!==Wa(a))return!1}else if(!Pl(e.options.mutationKey,a))return!1}return!(s&&e.state.status!==s||n&&!n(e))}function pv(t,e){return((e==null?void 0:e.queryKeyHashFn)||Wa)(t)}function Wa(t){return JSON.stringify(t,(e,r)=>Jh(r)?Object.keys(r).sort().reduce((s,n)=>(s[n]=r[n],s),{}):r)}function Pl(t,e){return t===e?!0:typeof t!=typeof e?!1:t&&e&&typeof t=="object"&&typeof e=="object"?Object.keys(e).every(r=>Pl(t[r],e[r])):!1}function zb(t,e){if(t===e)return t;const r=zy(t)&&zy(e);if(r||Jh(t)&&Jh(e)){const s=r?t:Object.keys(t),n=s.length,a=r?e:Object.keys(e),o=a.length,l=r?[]:{},c=new Set(s);let u=0;for(let d=0;d<o;d++){const f=r?d:a[d];(!r&&c.has(f)||r)&&t[f]===void 0&&e[f]===void 0?(l[f]=void 0,u++):(l[f]=zb(t[f],e[f]),l[f]===t[f]&&t[f]!==void 0&&u++)}return n===o&&u===n?t:l}return e}function Ru(t,e){if(!e||Object.keys(t).length!==Object.keys(e).length)return!1;for(const r in t)if(t[r]!==e[r])return!1;return!0}function zy(t){return Array.isArray(t)&&t.length===Object.keys(t).length}function Jh(t){if(!Vy(t))return!1;const e=t.constructor;if(e===void 0)return!0;const r=e.prototype;return!(!Vy(r)||!r.hasOwnProperty("isPrototypeOf")||Object.getPrototypeOf(t)!==Object.prototype)}function Vy(t){return Object.prototype.toString.call(t)==="[object Object]"}function $N(t){return new Promise(e=>{setTimeout(e,t)})}function Xh(t,e,r){return typeof r.structuralSharing=="function"?r.structuralSharing(t,e):r.structuralSharing!==!1?zb(t,e):e}function FN(t,e,r=0){const s=[...t,e];return r&&s.length>r?s.slice(1):s}function LN(t,e,r=0){const s=[e,...t];return r&&s.length>r?s.slice(0,-1):s}var mv=Symbol();function Vb(t,e){return!t.queryFn&&(e!=null&&e.initialPromise)?()=>e.initialPromise:!t.queryFn||t.queryFn===mv?()=>Promise.reject(new Error(`Missing queryFn: '${t.queryHash}'`)):t.queryFn}function qb(t,e){return typeof t=="function"?t(...e):!!t}var ja,Ts,Bo,ox,UN=(ox=class extends bi{constructor(){super();Se(this,ja);Se(this,Ts);Se(this,Bo);ue(this,Bo,e=>{if(!Ba&&window.addEventListener){const r=()=>e();return window.addEventListener("visibilitychange",r,!1),()=>{window.removeEventListener("visibilitychange",r)}}})}onSubscribe(){I(this,Ts)||this.setEventListener(I(this,Bo))}onUnsubscribe(){var e;this.hasListeners()||((e=I(this,Ts))==null||e.call(this),ue(this,Ts,void 0))}setEventListener(e){var r;ue(this,Bo,e),(r=I(this,Ts))==null||r.call(this),ue(this,Ts,e(s=>{typeof s=="boolean"?this.setFocused(s):this.onFocus()}))}setFocused(e){I(this,ja)!==e&&(ue(this,ja,e),this.onFocus())}onFocus(){const e=this.isFocused();this.listeners.forEach(r=>{r(e)})}isFocused(){var e;return typeof I(this,ja)=="boolean"?I(this,ja):((e=globalThis.document)==null?void 0:e.visibilityState)!=="hidden"}},ja=new WeakMap,Ts=new WeakMap,Bo=new WeakMap,ox),vv=new UN,Wo,As,Ko,ix,zN=(ix=class extends bi{constructor(){super();Se(this,Wo,!0);Se(this,As);Se(this,Ko);ue(this,Ko,e=>{if(!Ba&&window.addEventListener){const r=()=>e(!0),s=()=>e(!1);return window.addEventListener("online",r,!1),window.addEventListener("offline",s,!1),()=>{window.removeEventListener("online",r),window.removeEventListener("offline",s)}}})}onSubscribe(){I(this,As)||this.setEventListener(I(this,Ko))}onUnsubscribe(){var e;this.hasListeners()||((e=I(this,As))==null||e.call(this),ue(this,As,void 0))}setEventListener(e){var r;ue(this,Ko,e),(r=I(this,As))==null||r.call(this),ue(this,As,e(this.setOnline.bind(this)))}setOnline(e){I(this,Wo)!==e&&(ue(this,Wo,e),this.listeners.forEach(s=>{s(e)}))}isOnline(){return I(this,Wo)}},Wo=new WeakMap,As=new WeakMap,Ko=new WeakMap,ix),Tu=new zN;function ep(){let t,e;const r=new Promise((n,a)=>{t=n,e=a});r.status="pending",r.catch(()=>{});function s(n){Object.assign(r,n),delete r.resolve,delete r.reject}return r.resolve=n=>{s({status:"fulfilled",value:n}),t(n)},r.reject=n=>{s({status:"rejected",reason:n}),e(n)},r}function VN(t){return Math.min(1e3*2**t,3e4)}function Hb(t){return(t??"online")==="online"?Tu.isOnline():!0}var Bb=class extends Error{constructor(t){super("CancelledError"),this.revert=t==null?void 0:t.revert,this.silent=t==null?void 0:t.silent}};function Wb(t){let e=!1,r=0,s;const n=ep(),a=()=>n.status!=="pending",o=h=>{var g;a()||(m(new Bb(h)),(g=t.abort)==null||g.call(t))},l=()=>{e=!0},c=()=>{e=!1},u=()=>vv.isFocused()&&(t.networkMode==="always"||Tu.isOnline())&&t.canRun(),d=()=>Hb(t.networkMode)&&t.canRun(),f=h=>{a()||(s==null||s(),n.resolve(h))},m=h=>{a()||(s==null||s(),n.reject(h))},p=()=>new Promise(h=>{var g;s=v=>{(a()||u())&&h(v)},(g=t.onPause)==null||g.call(t)}).then(()=>{var h;s=void 0,a()||(h=t.onContinue)==null||h.call(t)}),w=()=>{if(a())return;let h;const g=r===0?t.initialPromise:void 0;try{h=g??t.fn()}catch(v){h=Promise.reject(v)}Promise.resolve(h).then(f).catch(v=>{var k;if(a())return;const y=t.retry??(Ba?0:3),b=t.retryDelay??VN,S=typeof b=="function"?b(r,v):b,E=y===!0||typeof y=="number"&&r<y||typeof y=="function"&&y(r,v);if(e||!E){m(v);return}r++,(k=t.onFail)==null||k.call(t,r,v),$N(S).then(()=>u()?void 0:p()).then(()=>{e?m(v):w()})})};return{promise:n,status:()=>n.status,cancel:o,continue:()=>(s==null||s(),n),cancelRetry:l,continueRetry:c,canStart:d,start:()=>(d()?w():p().then(w),n)}}var qN=t=>setTimeout(t,0);function HN(){let t=[],e=0,r=l=>{l()},s=l=>{l()},n=qN;const a=l=>{e?t.push(l):n(()=>{r(l)})},o=()=>{const l=t;t=[],l.length&&n(()=>{s(()=>{l.forEach(c=>{r(c)})})})};return{batch:l=>{let c;e++;try{c=l()}finally{e--,e||o()}return c},batchCalls:l=>(...c)=>{a(()=>{l(...c)})},schedule:a,setNotifyFunction:l=>{r=l},setBatchNotifyFunction:l=>{s=l},setScheduler:l=>{n=l}}}var Tt=HN(),Ra,lx,Kb=(lx=class{constructor(){Se(this,Ra)}destroy(){this.clearGcTimeout()}scheduleGc(){this.clearGcTimeout(),Yh(this.gcTime)&&ue(this,Ra,setTimeout(()=>{this.optionalRemove()},this.gcTime))}updateGcTime(t){this.gcTime=Math.max(this.gcTime||0,t??(Ba?1/0:5*60*1e3))}clearGcTimeout(){I(this,Ra)&&(clearTimeout(I(this,Ra)),ue(this,Ra,void 0))}},Ra=new WeakMap,lx),Qo,Go,Tr,Ta,Mt,Al,Aa,Jr,zn,cx,BN=(cx=class extends Kb{constructor(e){super();Se(this,Jr);Se(this,Qo);Se(this,Go);Se(this,Tr);Se(this,Ta);Se(this,Mt);Se(this,Al);Se(this,Aa);ue(this,Aa,!1),ue(this,Al,e.defaultOptions),this.setOptions(e.options),this.observers=[],ue(this,Ta,e.client),ue(this,Tr,I(this,Ta).getQueryCache()),this.queryKey=e.queryKey,this.queryHash=e.queryHash,ue(this,Qo,WN(this.options)),this.state=e.state??I(this,Qo),this.scheduleGc()}get meta(){return this.options.meta}get promise(){var e;return(e=I(this,Mt))==null?void 0:e.promise}setOptions(e){this.options={...I(this,Al),...e},this.updateGcTime(this.options.gcTime)}optionalRemove(){!this.observers.length&&this.state.fetchStatus==="idle"&&I(this,Tr).remove(this)}setData(e,r){const s=Xh(this.state.data,e,this.options);return Le(this,Jr,zn).call(this,{data:s,type:"success",dataUpdatedAt:r==null?void 0:r.updatedAt,manual:r==null?void 0:r.manual}),s}setState(e,r){Le(this,Jr,zn).call(this,{type:"setState",state:e,setStateOptions:r})}cancel(e){var s,n;const r=(s=I(this,Mt))==null?void 0:s.promise;return(n=I(this,Mt))==null||n.cancel(e),r?r.then(tr).catch(tr):Promise.resolve()}destroy(){super.destroy(),this.cancel({silent:!0})}reset(){this.destroy(),this.setState(I(this,Qo))}isActive(){return this.observers.some(e=>Ar(e.options.enabled,this)!==!1)}isDisabled(){return this.getObserversCount()>0?!this.isActive():this.options.queryFn===mv||this.state.dataUpdateCount+this.state.errorUpdateCount===0}isStatic(){return this.getObserversCount()>0?this.observers.some(e=>Xs(e.options.staleTime,this)==="static"):!1}isStale(){return this.getObserversCount()>0?this.observers.some(e=>e.getCurrentResult().isStale):this.state.data===void 0||this.state.isInvalidated}isStaleByTime(e=0){return this.state.data===void 0?!0:e==="static"?!1:this.state.isInvalidated?!0:!Ub(this.state.dataUpdatedAt,e)}onFocus(){var r;const e=this.observers.find(s=>s.shouldFetchOnWindowFocus());e==null||e.refetch({cancelRefetch:!1}),(r=I(this,Mt))==null||r.continue()}onOnline(){var r;const e=this.observers.find(s=>s.shouldFetchOnReconnect());e==null||e.refetch({cancelRefetch:!1}),(r=I(this,Mt))==null||r.continue()}addObserver(e){this.observers.includes(e)||(this.observers.push(e),this.clearGcTimeout(),I(this,Tr).notify({type:"observerAdded",query:this,observer:e}))}removeObserver(e){this.observers.includes(e)&&(this.observers=this.observers.filter(r=>r!==e),this.observers.length||(I(this,Mt)&&(I(this,Aa)?I(this,Mt).cancel({revert:!0}):I(this,Mt).cancelRetry()),this.scheduleGc()),I(this,Tr).notify({type:"observerRemoved",query:this,observer:e}))}getObserversCount(){return this.observers.length}invalidate(){this.state.isInvalidated||Le(this,Jr,zn).call(this,{type:"invalidate"})}async fetch(e,r){var c,u,d,f,m,p,w,h,g,v,y,b;if(this.state.fetchStatus!=="idle"&&((c=I(this,Mt))==null?void 0:c.status())!=="rejected"){if(this.state.data!==void 0&&(r!=null&&r.cancelRefetch))this.cancel({silent:!0});else if(I(this,Mt))return I(this,Mt).continueRetry(),I(this,Mt).promise}if(e&&this.setOptions(e),!this.options.queryFn){const S=this.observers.find(E=>E.options.queryFn);S&&this.setOptions(S.options)}const s=new AbortController,n=S=>{Object.defineProperty(S,"signal",{enumerable:!0,get:()=>(ue(this,Aa,!0),s.signal)})},a=()=>{const S=Vb(this.options,r),k=(()=>{const R={client:I(this,Ta),queryKey:this.queryKey,meta:this.meta};return n(R),R})();return ue(this,Aa,!1),this.options.persister?this.options.persister(S,k,this):S(k)},l=(()=>{const S={fetchOptions:r,options:this.options,queryKey:this.queryKey,client:I(this,Ta),state:this.state,fetchFn:a};return n(S),S})();(u=this.options.behavior)==null||u.onFetch(l,this),ue(this,Go,this.state),(this.state.fetchStatus==="idle"||this.state.fetchMeta!==((d=l.fetchOptions)==null?void 0:d.meta))&&Le(this,Jr,zn).call(this,{type:"fetch",meta:(f=l.fetchOptions)==null?void 0:f.meta}),ue(this,Mt,Wb({initialPromise:r==null?void 0:r.initialPromise,fn:l.fetchFn,abort:s.abort.bind(s),onFail:(S,E)=>{Le(this,Jr,zn).call(this,{type:"failed",failureCount:S,error:E})},onPause:()=>{Le(this,Jr,zn).call(this,{type:"pause"})},onContinue:()=>{Le(this,Jr,zn).call(this,{type:"continue"})},retry:l.options.retry,retryDelay:l.options.retryDelay,networkMode:l.options.networkMode,canRun:()=>!0}));try{const S=await I(this,Mt).start();if(S===void 0)throw new Error(`${this.queryHash} data is undefined`);return this.setData(S),(p=(m=I(this,Tr).config).onSuccess)==null||p.call(m,S,this),(h=(w=I(this,Tr).config).onSettled)==null||h.call(w,S,this.state.error,this),S}catch(S){if(S instanceof Bb){if(S.silent)return I(this,Mt).promise;if(S.revert){if(this.setState({...I(this,Go),fetchStatus:"idle"}),this.state.data===void 0)throw S;return this.state.data}}throw Le(this,Jr,zn).call(this,{type:"error",error:S}),(v=(g=I(this,Tr).config).onError)==null||v.call(g,S,this),(b=(y=I(this,Tr).config).onSettled)==null||b.call(y,this.state.data,S,this),S}finally{this.scheduleGc()}}},Qo=new WeakMap,Go=new WeakMap,Tr=new WeakMap,Ta=new WeakMap,Mt=new WeakMap,Al=new WeakMap,Aa=new WeakMap,Jr=new WeakSet,zn=function(e){const r=s=>{switch(e.type){case"failed":return{...s,fetchFailureCount:e.failureCount,fetchFailureReason:e.error};case"pause":return{...s,fetchStatus:"paused"};case"continue":return{...s,fetchStatus:"fetching"};case"fetch":return{...s,...Qb(s.data,this.options),fetchMeta:e.meta??null};case"success":const n={...s,data:e.data,dataUpdateCount:s.dataUpdateCount+1,dataUpdatedAt:e.dataUpdatedAt??Date.now(),error:null,isInvalidated:!1,status:"success",...!e.manual&&{fetchStatus:"idle",fetchFailureCount:0,fetchFailureReason:null}};return ue(this,Go,e.manual?n:void 0),n;case"error":const a=e.error;return{...s,error:a,errorUpdateCount:s.errorUpdateCount+1,errorUpdatedAt:Date.now(),fetchFailureCount:s.fetchFailureCount+1,fetchFailureReason:a,fetchStatus:"idle",status:"error"};case"invalidate":return{...s,isInvalidated:!0};case"setState":return{...s,...e.state}}};this.state=r(this.state),Tt.batch(()=>{this.observers.forEach(s=>{s.onQueryUpdate()}),I(this,Tr).notify({query:this,type:"updated",action:e})})},cx);function Qb(t,e){return{fetchFailureCount:0,fetchFailureReason:null,fetchStatus:Hb(e.networkMode)?"fetching":"paused",...t===void 0&&{error:null,status:"pending"}}}function WN(t){const e=typeof t.initialData=="function"?t.initialData():t.initialData,r=e!==void 0,s=r?typeof t.initialDataUpdatedAt=="function"?t.initialDataUpdatedAt():t.initialDataUpdatedAt:0;return{data:e,dataUpdateCount:0,dataUpdatedAt:r?s??Date.now():0,error:null,errorUpdateCount:0,errorUpdatedAt:0,fetchFailureCount:0,fetchFailureReason:null,fetchMeta:null,isInvalidated:!1,status:r?"success":"pending",fetchStatus:"idle"}}var gn,ux,KN=(ux=class extends bi{constructor(e={}){super();Se(this,gn);this.config=e,ue(this,gn,new Map)}build(e,r,s){const n=r.queryKey,a=r.queryHash??pv(n,r);let o=this.get(a);return o||(o=new BN({client:e,queryKey:n,queryHash:a,options:e.defaultQueryOptions(r),state:s,defaultOptions:e.getQueryDefaults(n)}),this.add(o)),o}add(e){I(this,gn).has(e.queryHash)||(I(this,gn).set(e.queryHash,e),this.notify({type:"added",query:e}))}remove(e){const r=I(this,gn).get(e.queryHash);r&&(e.destroy(),r===e&&I(this,gn).delete(e.queryHash),this.notify({type:"removed",query:e}))}clear(){Tt.batch(()=>{this.getAll().forEach(e=>{this.remove(e)})})}get(e){return I(this,gn).get(e)}getAll(){return[...I(this,gn).values()]}find(e){const r={exact:!0,...e};return this.getAll().find(s=>Ly(r,s))}findAll(e={}){const r=this.getAll();return Object.keys(e).length>0?r.filter(s=>Ly(e,s)):r}notify(e){Tt.batch(()=>{this.listeners.forEach(r=>{r(e)})})}onFocus(){Tt.batch(()=>{this.getAll().forEach(e=>{e.onFocus()})})}onOnline(){Tt.batch(()=>{this.getAll().forEach(e=>{e.onOnline()})})}},gn=new WeakMap,ux),yn,Jt,Oa,xn,bs,dx,QN=(dx=class extends Kb{constructor(e){super();Se(this,xn);Se(this,yn);Se(this,Jt);Se(this,Oa);this.mutationId=e.mutationId,ue(this,Jt,e.mutationCache),ue(this,yn,[]),this.state=e.state||Gb(),this.setOptions(e.options),this.scheduleGc()}setOptions(e){this.options=e,this.updateGcTime(this.options.gcTime)}get meta(){return this.options.meta}addObserver(e){I(this,yn).includes(e)||(I(this,yn).push(e),this.clearGcTimeout(),I(this,Jt).notify({type:"observerAdded",mutation:this,observer:e}))}removeObserver(e){ue(this,yn,I(this,yn).filter(r=>r!==e)),this.scheduleGc(),I(this,Jt).notify({type:"observerRemoved",mutation:this,observer:e})}optionalRemove(){I(this,yn).length||(this.state.status==="pending"?this.scheduleGc():I(this,Jt).remove(this))}continue(){var e;return((e=I(this,Oa))==null?void 0:e.continue())??this.execute(this.state.variables)}async execute(e){var a,o,l,c,u,d,f,m,p,w,h,g,v,y,b,S,E,k,R,T;const r=()=>{Le(this,xn,bs).call(this,{type:"continue"})};ue(this,Oa,Wb({fn:()=>this.options.mutationFn?this.options.mutationFn(e):Promise.reject(new Error("No mutationFn found")),onFail:(N,O)=>{Le(this,xn,bs).call(this,{type:"failed",failureCount:N,error:O})},onPause:()=>{Le(this,xn,bs).call(this,{type:"pause"})},onContinue:r,retry:this.options.retry??0,retryDelay:this.options.retryDelay,networkMode:this.options.networkMode,canRun:()=>I(this,Jt).canRun(this)}));const s=this.state.status==="pending",n=!I(this,Oa).canStart();try{if(s)r();else{Le(this,xn,bs).call(this,{type:"pending",variables:e,isPaused:n}),await((o=(a=I(this,Jt).config).onMutate)==null?void 0:o.call(a,e,this));const O=await((c=(l=this.options).onMutate)==null?void 0:c.call(l,e));O!==this.state.context&&Le(this,xn,bs).call(this,{type:"pending",context:O,variables:e,isPaused:n})}const N=await I(this,Oa).start();return await((d=(u=I(this,Jt).config).onSuccess)==null?void 0:d.call(u,N,e,this.state.context,this)),await((m=(f=this.options).onSuccess)==null?void 0:m.call(f,N,e,this.state.context)),await((w=(p=I(this,Jt).config).onSettled)==null?void 0:w.call(p,N,null,this.state.variables,this.state.context,this)),await((g=(h=this.options).onSettled)==null?void 0:g.call(h,N,null,e,this.state.context)),Le(this,xn,bs).call(this,{type:"success",data:N}),N}catch(N){try{throw await((y=(v=I(this,Jt).config).onError)==null?void 0:y.call(v,N,e,this.state.context,this)),await((S=(b=this.options).onError)==null?void 0:S.call(b,N,e,this.state.context)),await((k=(E=I(this,Jt).config).onSettled)==null?void 0:k.call(E,void 0,N,this.state.variables,this.state.context,this)),await((T=(R=this.options).onSettled)==null?void 0:T.call(R,void 0,N,e,this.state.context)),N}finally{Le(this,xn,bs).call(this,{type:"error",error:N})}}finally{I(this,Jt).runNext(this)}}},yn=new WeakMap,Jt=new WeakMap,Oa=new WeakMap,xn=new WeakSet,bs=function(e){const r=s=>{switch(e.type){case"failed":return{...s,failureCount:e.failureCount,failureReason:e.error};case"pause":return{...s,isPaused:!0};case"continue":return{...s,isPaused:!1};case"pending":return{...s,context:e.context,data:void 0,failureCount:0,failureReason:null,error:null,isPaused:e.isPaused,status:"pending",variables:e.variables,submittedAt:Date.now()};case"success":return{...s,data:e.data,failureCount:0,failureReason:null,error:null,status:"success",isPaused:!1};case"error":return{...s,data:void 0,error:e.error,failureCount:s.failureCount+1,failureReason:e.error,isPaused:!1,status:"error"}}};this.state=r(this.state),Tt.batch(()=>{I(this,yn).forEach(s=>{s.onMutationUpdate(e)}),I(this,Jt).notify({mutation:this,type:"updated",action:e})})},dx);function Gb(){return{context:void 0,data:void 0,error:null,failureCount:0,failureReason:null,isPaused:!1,status:"idle",variables:void 0,submittedAt:0}}var Wn,Xr,Ol,fx,GN=(fx=class extends bi{constructor(e={}){super();Se(this,Wn);Se(this,Xr);Se(this,Ol);this.config=e,ue(this,Wn,new Set),ue(this,Xr,new Map),ue(this,Ol,0)}build(e,r,s){const n=new QN({mutationCache:this,mutationId:++nc(this,Ol)._,options:e.defaultMutationOptions(r),state:s});return this.add(n),n}add(e){I(this,Wn).add(e);const r=Sc(e);if(typeof r=="string"){const s=I(this,Xr).get(r);s?s.push(e):I(this,Xr).set(r,[e])}this.notify({type:"added",mutation:e})}remove(e){if(I(this,Wn).delete(e)){const r=Sc(e);if(typeof r=="string"){const s=I(this,Xr).get(r);if(s)if(s.length>1){const n=s.indexOf(e);n!==-1&&s.splice(n,1)}else s[0]===e&&I(this,Xr).delete(r)}}this.notify({type:"removed",mutation:e})}canRun(e){const r=Sc(e);if(typeof r=="string"){const s=I(this,Xr).get(r),n=s==null?void 0:s.find(a=>a.state.status==="pending");return!n||n===e}else return!0}runNext(e){var s;const r=Sc(e);if(typeof r=="string"){const n=(s=I(this,Xr).get(r))==null?void 0:s.find(a=>a!==e&&a.state.isPaused);return(n==null?void 0:n.continue())??Promise.resolve()}else return Promise.resolve()}clear(){Tt.batch(()=>{I(this,Wn).forEach(e=>{this.notify({type:"removed",mutation:e})}),I(this,Wn).clear(),I(this,Xr).clear()})}getAll(){return Array.from(I(this,Wn))}find(e){const r={exact:!0,...e};return this.getAll().find(s=>Uy(r,s))}findAll(e={}){return this.getAll().filter(r=>Uy(e,r))}notify(e){Tt.batch(()=>{this.listeners.forEach(r=>{r(e)})})}resumePausedMutations(){const e=this.getAll().filter(r=>r.state.isPaused);return Tt.batch(()=>Promise.all(e.map(r=>r.continue().catch(tr))))}},Wn=new WeakMap,Xr=new WeakMap,Ol=new WeakMap,fx);function Sc(t){var e;return(e=t.options.scope)==null?void 0:e.id}function qy(t){return{onFetch:(e,r)=>{var d,f,m,p,w;const s=e.options,n=(m=(f=(d=e.fetchOptions)==null?void 0:d.meta)==null?void 0:f.fetchMore)==null?void 0:m.direction,a=((p=e.state.data)==null?void 0:p.pages)||[],o=((w=e.state.data)==null?void 0:w.pageParams)||[];let l={pages:[],pageParams:[]},c=0;const u=async()=>{let h=!1;const g=b=>{Object.defineProperty(b,"signal",{enumerable:!0,get:()=>(e.signal.aborted?h=!0:e.signal.addEventListener("abort",()=>{h=!0}),e.signal)})},v=Vb(e.options,e.fetchOptions),y=async(b,S,E)=>{if(h)return Promise.reject();if(S==null&&b.pages.length)return Promise.resolve(b);const R=(()=>{const j={client:e.client,queryKey:e.queryKey,pageParam:S,direction:E?"backward":"forward",meta:e.options.meta};return g(j),j})(),T=await v(R),{maxPages:N}=e.options,O=E?LN:FN;return{pages:O(b.pages,T,N),pageParams:O(b.pageParams,S,N)}};if(n&&a.length){const b=n==="backward",S=b?ZN:Hy,E={pages:a,pageParams:o},k=S(s,E);l=await y(E,k,b)}else{const b=t??a.length;do{const S=c===0?o[0]??s.initialPageParam:Hy(s,l);if(c>0&&S==null)break;l=await y(l,S),c++}while(c<b)}return l};e.options.persister?e.fetchFn=()=>{var h,g;return(g=(h=e.options).persister)==null?void 0:g.call(h,u,{client:e.client,queryKey:e.queryKey,meta:e.options.meta,signal:e.signal},r)}:e.fetchFn=u}}}function Hy(t,{pages:e,pageParams:r}){const s=e.length-1;return e.length>0?t.getNextPageParam(e[s],e,r[s],r):void 0}function ZN(t,{pages:e,pageParams:r}){var s;return e.length>0?(s=t.getPreviousPageParam)==null?void 0:s.call(t,e[0],e,r[0],r):void 0}var yt,Os,Is,Zo,Yo,Ds,Jo,Xo,hx,YN=(hx=class{constructor(t={}){Se(this,yt);Se(this,Os);Se(this,Is);Se(this,Zo);Se(this,Yo);Se(this,Ds);Se(this,Jo);Se(this,Xo);ue(this,yt,t.queryCache||new KN),ue(this,Os,t.mutationCache||new GN),ue(this,Is,t.defaultOptions||{}),ue(this,Zo,new Map),ue(this,Yo,new Map),ue(this,Ds,0)}mount(){nc(this,Ds)._++,I(this,Ds)===1&&(ue(this,Jo,vv.subscribe(async t=>{t&&(await this.resumePausedMutations(),I(this,yt).onFocus())})),ue(this,Xo,Tu.subscribe(async t=>{t&&(await this.resumePausedMutations(),I(this,yt).onOnline())})))}unmount(){var t,e;nc(this,Ds)._--,I(this,Ds)===0&&((t=I(this,Jo))==null||t.call(this),ue(this,Jo,void 0),(e=I(this,Xo))==null||e.call(this),ue(this,Xo,void 0))}isFetching(t){return I(this,yt).findAll({...t,fetchStatus:"fetching"}).length}isMutating(t){return I(this,Os).findAll({...t,status:"pending"}).length}getQueryData(t){var r;const e=this.defaultQueryOptions({queryKey:t});return(r=I(this,yt).get(e.queryHash))==null?void 0:r.state.data}ensureQueryData(t){const e=this.defaultQueryOptions(t),r=I(this,yt).build(this,e),s=r.state.data;return s===void 0?this.fetchQuery(t):(t.revalidateIfStale&&r.isStaleByTime(Xs(e.staleTime,r))&&this.prefetchQuery(e),Promise.resolve(s))}getQueriesData(t){return I(this,yt).findAll(t).map(({queryKey:e,state:r})=>{const s=r.data;return[e,s]})}setQueryData(t,e,r){const s=this.defaultQueryOptions({queryKey:t}),n=I(this,yt).get(s.queryHash),a=n==null?void 0:n.state.data,o=MN(e,a);if(o!==void 0)return I(this,yt).build(this,s).setData(o,{...r,manual:!0})}setQueriesData(t,e,r){return Tt.batch(()=>I(this,yt).findAll(t).map(({queryKey:s})=>[s,this.setQueryData(s,e,r)]))}getQueryState(t){var r;const e=this.defaultQueryOptions({queryKey:t});return(r=I(this,yt).get(e.queryHash))==null?void 0:r.state}removeQueries(t){const e=I(this,yt);Tt.batch(()=>{e.findAll(t).forEach(r=>{e.remove(r)})})}resetQueries(t,e){const r=I(this,yt);return Tt.batch(()=>(r.findAll(t).forEach(s=>{s.reset()}),this.refetchQueries({type:"active",...t},e)))}cancelQueries(t,e={}){const r={revert:!0,...e},s=Tt.batch(()=>I(this,yt).findAll(t).map(n=>n.cancel(r)));return Promise.all(s).then(tr).catch(tr)}invalidateQueries(t,e={}){return Tt.batch(()=>(I(this,yt).findAll(t).forEach(r=>{r.invalidate()}),(t==null?void 0:t.refetchType)==="none"?Promise.resolve():this.refetchQueries({...t,type:(t==null?void 0:t.refetchType)??(t==null?void 0:t.type)??"active"},e)))}refetchQueries(t,e={}){const r={...e,cancelRefetch:e.cancelRefetch??!0},s=Tt.batch(()=>I(this,yt).findAll(t).filter(n=>!n.isDisabled()&&!n.isStatic()).map(n=>{let a=n.fetch(void 0,r);return r.throwOnError||(a=a.catch(tr)),n.state.fetchStatus==="paused"?Promise.resolve():a}));return Promise.all(s).then(tr)}fetchQuery(t){const e=this.defaultQueryOptions(t);e.retry===void 0&&(e.retry=!1);const r=I(this,yt).build(this,e);return r.isStaleByTime(Xs(e.staleTime,r))?r.fetch(e):Promise.resolve(r.state.data)}prefetchQuery(t){return this.fetchQuery(t).then(tr).catch(tr)}fetchInfiniteQuery(t){return t.behavior=qy(t.pages),this.fetchQuery(t)}prefetchInfiniteQuery(t){return this.fetchInfiniteQuery(t).then(tr).catch(tr)}ensureInfiniteQueryData(t){return t.behavior=qy(t.pages),this.ensureQueryData(t)}resumePausedMutations(){return Tu.isOnline()?I(this,Os).resumePausedMutations():Promise.resolve()}getQueryCache(){return I(this,yt)}getMutationCache(){return I(this,Os)}getDefaultOptions(){return I(this,Is)}setDefaultOptions(t){ue(this,Is,t)}setQueryDefaults(t,e){I(this,Zo).set(Wa(t),{queryKey:t,defaultOptions:e})}getQueryDefaults(t){const e=[...I(this,Zo).values()],r={};return e.forEach(s=>{Pl(t,s.queryKey)&&Object.assign(r,s.defaultOptions)}),r}setMutationDefaults(t,e){I(this,Yo).set(Wa(t),{mutationKey:t,defaultOptions:e})}getMutationDefaults(t){const e=[...I(this,Yo).values()],r={};return e.forEach(s=>{Pl(t,s.mutationKey)&&Object.assign(r,s.defaultOptions)}),r}defaultQueryOptions(t){if(t._defaulted)return t;const e={...I(this,Is).queries,...this.getQueryDefaults(t.queryKey),...t,_defaulted:!0};return e.queryHash||(e.queryHash=pv(e.queryKey,e)),e.refetchOnReconnect===void 0&&(e.refetchOnReconnect=e.networkMode!=="always"),e.throwOnError===void 0&&(e.throwOnError=!!e.suspense),!e.networkMode&&e.persister&&(e.networkMode="offlineFirst"),e.queryFn===mv&&(e.enabled=!1),e}defaultMutationOptions(t){return t!=null&&t._defaulted?t:{...I(this,Is).mutations,...(t==null?void 0:t.mutationKey)&&this.getMutationDefaults(t.mutationKey),...t,_defaulted:!0}}clear(){I(this,yt).clear(),I(this,Os).clear()}},yt=new WeakMap,Os=new WeakMap,Is=new WeakMap,Zo=new WeakMap,Yo=new WeakMap,Ds=new WeakMap,Jo=new WeakMap,Xo=new WeakMap,hx),lr,We,Il,Xt,Ia,ei,Kn,Ms,Dl,ti,ri,Da,Ma,$s,ni,Je,Bi,tp,rp,np,sp,ap,op,ip,Zb,px,JN=(px=class extends bi{constructor(e,r){super();Se(this,Je);Se(this,lr);Se(this,We);Se(this,Il);Se(this,Xt);Se(this,Ia);Se(this,ei);Se(this,Kn);Se(this,Ms);Se(this,Dl);Se(this,ti);Se(this,ri);Se(this,Da);Se(this,Ma);Se(this,$s);Se(this,ni,new Set);this.options=r,ue(this,lr,e),ue(this,Ms,null),ue(this,Kn,ep()),this.bindMethods(),this.setOptions(r)}bindMethods(){this.refetch=this.refetch.bind(this)}onSubscribe(){this.listeners.size===1&&(I(this,We).addObserver(this),By(I(this,We),this.options)?Le(this,Je,Bi).call(this):this.updateResult(),Le(this,Je,sp).call(this))}onUnsubscribe(){this.hasListeners()||this.destroy()}shouldFetchOnReconnect(){return lp(I(this,We),this.options,this.options.refetchOnReconnect)}shouldFetchOnWindowFocus(){return lp(I(this,We),this.options,this.options.refetchOnWindowFocus)}destroy(){this.listeners=new Set,Le(this,Je,ap).call(this),Le(this,Je,op).call(this),I(this,We).removeObserver(this)}setOptions(e){const r=this.options,s=I(this,We);if(this.options=I(this,lr).defaultQueryOptions(e),this.options.enabled!==void 0&&typeof this.options.enabled!="boolean"&&typeof this.options.enabled!="function"&&typeof Ar(this.options.enabled,I(this,We))!="boolean")throw new Error("Expected enabled to be a boolean or a callback that returns a boolean");Le(this,Je,ip).call(this),I(this,We).setOptions(this.options),r._defaulted&&!Ru(this.options,r)&&I(this,lr).getQueryCache().notify({type:"observerOptionsUpdated",query:I(this,We),observer:this});const n=this.hasListeners();n&&Wy(I(this,We),s,this.options,r)&&Le(this,Je,Bi).call(this),this.updateResult(),n&&(I(this,We)!==s||Ar(this.options.enabled,I(this,We))!==Ar(r.enabled,I(this,We))||Xs(this.options.staleTime,I(this,We))!==Xs(r.staleTime,I(this,We)))&&Le(this,Je,tp).call(this);const a=Le(this,Je,rp).call(this);n&&(I(this,We)!==s||Ar(this.options.enabled,I(this,We))!==Ar(r.enabled,I(this,We))||a!==I(this,$s))&&Le(this,Je,np).call(this,a)}getOptimisticResult(e){const r=I(this,lr).getQueryCache().build(I(this,lr),e),s=this.createResult(r,e);return ej(this,s)&&(ue(this,Xt,s),ue(this,ei,this.options),ue(this,Ia,I(this,We).state)),s}getCurrentResult(){return I(this,Xt)}trackResult(e,r){return new Proxy(e,{get:(s,n)=>(this.trackProp(n),r==null||r(n),n==="promise"&&!this.options.experimental_prefetchInRender&&I(this,Kn).status==="pending"&&I(this,Kn).reject(new Error("experimental_prefetchInRender feature flag is not enabled")),Reflect.get(s,n))})}trackProp(e){I(this,ni).add(e)}getCurrentQuery(){return I(this,We)}refetch({...e}={}){return this.fetch({...e})}fetchOptimistic(e){const r=I(this,lr).defaultQueryOptions(e),s=I(this,lr).getQueryCache().build(I(this,lr),r);return s.fetch().then(()=>this.createResult(s,r))}fetch(e){return Le(this,Je,Bi).call(this,{...e,cancelRefetch:e.cancelRefetch??!0}).then(()=>(this.updateResult(),I(this,Xt)))}createResult(e,r){var N;const s=I(this,We),n=this.options,a=I(this,Xt),o=I(this,Ia),l=I(this,ei),u=e!==s?e.state:I(this,Il),{state:d}=e;let f={...d},m=!1,p;if(r._optimisticResults){const O=this.hasListeners(),j=!O&&By(e,r),_=O&&Wy(e,s,r,n);(j||_)&&(f={...f,...Qb(d.data,e.options)}),r._optimisticResults==="isRestoring"&&(f.fetchStatus="idle")}let{error:w,errorUpdatedAt:h,status:g}=f;p=f.data;let v=!1;if(r.placeholderData!==void 0&&p===void 0&&g==="pending"){let O;a!=null&&a.isPlaceholderData&&r.placeholderData===(l==null?void 0:l.placeholderData)?(O=a.data,v=!0):O=typeof r.placeholderData=="function"?r.placeholderData((N=I(this,ri))==null?void 0:N.state.data,I(this,ri)):r.placeholderData,O!==void 0&&(g="success",p=Xh(a==null?void 0:a.data,O,r),m=!0)}if(r.select&&p!==void 0&&!v)if(a&&p===(o==null?void 0:o.data)&&r.select===I(this,Dl))p=I(this,ti);else try{ue(this,Dl,r.select),p=r.select(p),p=Xh(a==null?void 0:a.data,p,r),ue(this,ti,p),ue(this,Ms,null)}catch(O){ue(this,Ms,O)}I(this,Ms)&&(w=I(this,Ms),p=I(this,ti),h=Date.now(),g="error");const y=f.fetchStatus==="fetching",b=g==="pending",S=g==="error",E=b&&y,k=p!==void 0,T={status:g,fetchStatus:f.fetchStatus,isPending:b,isSuccess:g==="success",isError:S,isInitialLoading:E,isLoading:E,data:p,dataUpdatedAt:f.dataUpdatedAt,error:w,errorUpdatedAt:h,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:y,isRefetching:y&&!b,isLoadingError:S&&!k,isPaused:f.fetchStatus==="paused",isPlaceholderData:m,isRefetchError:S&&k,isStale:gv(e,r),refetch:this.refetch,promise:I(this,Kn),isEnabled:Ar(r.enabled,e)!==!1};if(this.options.experimental_prefetchInRender){const O=A=>{T.status==="error"?A.reject(T.error):T.data!==void 0&&A.resolve(T.data)},j=()=>{const A=ue(this,Kn,T.promise=ep());O(A)},_=I(this,Kn);switch(_.status){case"pending":e.queryHash===s.queryHash&&O(_);break;case"fulfilled":(T.status==="error"||T.data!==_.value)&&j();break;case"rejected":(T.status!=="error"||T.error!==_.reason)&&j();break}}return T}updateResult(){const e=I(this,Xt),r=this.createResult(I(this,We),this.options);if(ue(this,Ia,I(this,We).state),ue(this,ei,this.options),I(this,Ia).data!==void 0&&ue(this,ri,I(this,We)),Ru(r,e))return;ue(this,Xt,r);const s=()=>{if(!e)return!0;const{notifyOnChangeProps:n}=this.options,a=typeof n=="function"?n():n;if(a==="all"||!a&&!I(this,ni).size)return!0;const o=new Set(a??I(this,ni));return this.options.throwOnError&&o.add("error"),Object.keys(I(this,Xt)).some(l=>{const c=l;return I(this,Xt)[c]!==e[c]&&o.has(c)})};Le(this,Je,Zb).call(this,{listeners:s()})}onQueryUpdate(){this.updateResult(),this.hasListeners()&&Le(this,Je,sp).call(this)}},lr=new WeakMap,We=new WeakMap,Il=new WeakMap,Xt=new WeakMap,Ia=new WeakMap,ei=new WeakMap,Kn=new WeakMap,Ms=new WeakMap,Dl=new WeakMap,ti=new WeakMap,ri=new WeakMap,Da=new WeakMap,Ma=new WeakMap,$s=new WeakMap,ni=new WeakMap,Je=new WeakSet,Bi=function(e){Le(this,Je,ip).call(this);let r=I(this,We).fetch(this.options,e);return e!=null&&e.throwOnError||(r=r.catch(tr)),r},tp=function(){Le(this,Je,ap).call(this);const e=Xs(this.options.staleTime,I(this,We));if(Ba||I(this,Xt).isStale||!Yh(e))return;const s=Ub(I(this,Xt).dataUpdatedAt,e)+1;ue(this,Da,setTimeout(()=>{I(this,Xt).isStale||this.updateResult()},s))},rp=function(){return(typeof this.options.refetchInterval=="function"?this.options.refetchInterval(I(this,We)):this.options.refetchInterval)??!1},np=function(e){Le(this,Je,op).call(this),ue(this,$s,e),!(Ba||Ar(this.options.enabled,I(this,We))===!1||!Yh(I(this,$s))||I(this,$s)===0)&&ue(this,Ma,setInterval(()=>{(this.options.refetchIntervalInBackground||vv.isFocused())&&Le(this,Je,Bi).call(this)},I(this,$s)))},sp=function(){Le(this,Je,tp).call(this),Le(this,Je,np).call(this,Le(this,Je,rp).call(this))},ap=function(){I(this,Da)&&(clearTimeout(I(this,Da)),ue(this,Da,void 0))},op=function(){I(this,Ma)&&(clearInterval(I(this,Ma)),ue(this,Ma,void 0))},ip=function(){const e=I(this,lr).getQueryCache().build(I(this,lr),this.options);if(e===I(this,We))return;const r=I(this,We);ue(this,We,e),ue(this,Il,e.state),this.hasListeners()&&(r==null||r.removeObserver(this),e.addObserver(this))},Zb=function(e){Tt.batch(()=>{e.listeners&&this.listeners.forEach(r=>{r(I(this,Xt))}),I(this,lr).getQueryCache().notify({query:I(this,We),type:"observerResultsUpdated"})})},px);function XN(t,e){return Ar(e.enabled,t)!==!1&&t.state.data===void 0&&!(t.state.status==="error"&&e.retryOnMount===!1)}function By(t,e){return XN(t,e)||t.state.data!==void 0&&lp(t,e,e.refetchOnMount)}function lp(t,e,r){if(Ar(e.enabled,t)!==!1&&Xs(e.staleTime,t)!=="static"){const s=typeof r=="function"?r(t):r;return s==="always"||s!==!1&&gv(t,e)}return!1}function Wy(t,e,r,s){return(t!==e||Ar(s.enabled,t)===!1)&&(!r.suspense||t.state.status!=="error")&&gv(t,r)}function gv(t,e){return Ar(e.enabled,t)!==!1&&t.isStaleByTime(Xs(e.staleTime,t))}function ej(t,e){return!Ru(t.getCurrentResult(),e)}var Fs,Ls,cr,Qn,rs,Qc,cp,mx,tj=(mx=class extends bi{constructor(r,s){super();Se(this,rs);Se(this,Fs);Se(this,Ls);Se(this,cr);Se(this,Qn);ue(this,Fs,r),this.setOptions(s),this.bindMethods(),Le(this,rs,Qc).call(this)}bindMethods(){this.mutate=this.mutate.bind(this),this.reset=this.reset.bind(this)}setOptions(r){var n;const s=this.options;this.options=I(this,Fs).defaultMutationOptions(r),Ru(this.options,s)||I(this,Fs).getMutationCache().notify({type:"observerOptionsUpdated",mutation:I(this,cr),observer:this}),s!=null&&s.mutationKey&&this.options.mutationKey&&Wa(s.mutationKey)!==Wa(this.options.mutationKey)?this.reset():((n=I(this,cr))==null?void 0:n.state.status)==="pending"&&I(this,cr).setOptions(this.options)}onUnsubscribe(){var r;this.hasListeners()||(r=I(this,cr))==null||r.removeObserver(this)}onMutationUpdate(r){Le(this,rs,Qc).call(this),Le(this,rs,cp).call(this,r)}getCurrentResult(){return I(this,Ls)}reset(){var r;(r=I(this,cr))==null||r.removeObserver(this),ue(this,cr,void 0),Le(this,rs,Qc).call(this),Le(this,rs,cp).call(this)}mutate(r,s){var n;return ue(this,Qn,s),(n=I(this,cr))==null||n.removeObserver(this),ue(this,cr,I(this,Fs).getMutationCache().build(I(this,Fs),this.options)),I(this,cr).addObserver(this),I(this,cr).execute(r)}},Fs=new WeakMap,Ls=new WeakMap,cr=new WeakMap,Qn=new WeakMap,rs=new WeakSet,Qc=function(){var s;const r=((s=I(this,cr))==null?void 0:s.state)??Gb();ue(this,Ls,{...r,isPending:r.status==="pending",isSuccess:r.status==="success",isError:r.status==="error",isIdle:r.status==="idle",mutate:this.mutate,reset:this.reset})},cp=function(r){Tt.batch(()=>{var s,n,a,o,l,c,u,d;if(I(this,Qn)&&this.hasListeners()){const f=I(this,Ls).variables,m=I(this,Ls).context;(r==null?void 0:r.type)==="success"?((n=(s=I(this,Qn)).onSuccess)==null||n.call(s,r.data,f,m),(o=(a=I(this,Qn)).onSettled)==null||o.call(a,r.data,null,f,m)):(r==null?void 0:r.type)==="error"&&((c=(l=I(this,Qn)).onError)==null||c.call(l,r.error,f,m),(d=(u=I(this,Qn)).onSettled)==null||d.call(u,void 0,r.error,f,m))}this.listeners.forEach(f=>{f(I(this,Ls))})})},mx),Yb=x.createContext(void 0),yr=t=>{const e=x.useContext(Yb);if(!e)throw new Error("No QueryClient set, use QueryClientProvider to set one");return e},rj=({client:t,children:e})=>(x.useEffect(()=>(t.mount(),()=>{t.unmount()}),[t]),i.jsx(Yb.Provider,{value:t,children:e})),Jb=x.createContext(!1),nj=()=>x.useContext(Jb);Jb.Provider;function sj(){let t=!1;return{clearReset:()=>{t=!1},reset:()=>{t=!0},isReset:()=>t}}var aj=x.createContext(sj()),oj=()=>x.useContext(aj),ij=(t,e)=>{(t.suspense||t.throwOnError||t.experimental_prefetchInRender)&&(e.isReset()||(t.retryOnMount=!1))},lj=t=>{x.useEffect(()=>{t.clearReset()},[t])},cj=({result:t,errorResetBoundary:e,throwOnError:r,query:s,suspense:n})=>t.isError&&!e.isReset()&&!t.isFetching&&s&&(n&&t.data===void 0||qb(r,[t.error,s])),uj=t=>{if(t.suspense){const e=s=>s==="static"?s:Math.max(s??1e3,1e3),r=t.staleTime;t.staleTime=typeof r=="function"?(...s)=>e(r(...s)):e(r),typeof t.gcTime=="number"&&(t.gcTime=Math.max(t.gcTime,1e3))}},dj=(t,e)=>t.isLoading&&t.isFetching&&!e,fj=(t,e)=>(t==null?void 0:t.suspense)&&e.isPending,Ky=(t,e,r)=>e.fetchOptimistic(t).catch(()=>{r.clearReset()});function hj(t,e,r){var f,m,p,w,h;const s=nj(),n=oj(),a=yr(),o=a.defaultQueryOptions(t);(m=(f=a.getDefaultOptions().queries)==null?void 0:f._experimental_beforeQuery)==null||m.call(f,o),o._optimisticResults=s?"isRestoring":"optimistic",uj(o),ij(o,n),lj(n);const l=!a.getQueryCache().get(o.queryHash),[c]=x.useState(()=>new e(a,o)),u=c.getOptimisticResult(o),d=!s&&t.subscribed!==!1;if(x.useSyncExternalStore(x.useCallback(g=>{const v=d?c.subscribe(Tt.batchCalls(g)):tr;return c.updateResult(),v},[c,d]),()=>c.getCurrentResult(),()=>c.getCurrentResult()),x.useEffect(()=>{c.setOptions(o)},[o,c]),fj(o,u))throw Ky(o,c,n);if(cj({result:u,errorResetBoundary:n,throwOnError:o.throwOnError,query:a.getQueryCache().get(o.queryHash),suspense:o.suspense}))throw u.error;if((w=(p=a.getDefaultOptions().queries)==null?void 0:p._experimental_afterQuery)==null||w.call(p,o,u),o.experimental_prefetchInRender&&!Ba&&dj(u,s)){const g=l?Ky(o,c,n):(h=a.getQueryCache().get(o.queryHash))==null?void 0:h.promise;g==null||g.catch(tr).finally(()=>{c.updateResult()})}return o.notifyOnChangeProps?u:c.trackResult(u)}function hr(t,e){return hj(t,JN)}function At(t,e){const r=yr(),[s]=x.useState(()=>new tj(r,t));x.useEffect(()=>{s.setOptions(t)},[s,t]);const n=x.useSyncExternalStore(x.useCallback(o=>s.subscribe(Tt.batchCalls(o)),[s]),()=>s.getCurrentResult(),()=>s.getCurrentResult()),a=x.useCallback((o,l)=>{s.mutate(o,l).catch(tr)},[s]);if(n.error&&qb(s.options.throwOnError,[n.error]))throw n.error;return{...n,mutate:a,mutateAsync:n.mutate}}const pj="x-agent-deck-client",mj="dashboard",Xb={[pj]:mj};async function e1(t){if(t.ok)return;let e=t.statusText;try{const r=await t.text();try{const s=JSON.parse(r);e=s.error||s.message||e}catch{r.trim()&&(e=`${t.status}: ${r}`)}}catch(r){console.warn("Response body parsing failed:",r)}throw new Error(e)}async function Oe(t,e,r){const s=await fetch(e,{method:t,headers:{...Xb,...r?{"Content-Type":"application/json"}:{}},body:r?JSON.stringify(r):void 0});return await e1(s),s}const vj=({on401:t})=>async({queryKey:e})=>{const r=e.join("/"),s=await fetch(r,{headers:Xb});return await e1(s),await s.json()},gj=new YN({defaultOptions:{queries:{queryFn:vj({on401:"throw"}),refetchInterval:!1,refetchOnWindowFocus:!0,staleTime:0,gcTime:10*60*1e3,retry:!1},mutations:{retry:!1}}}),yj=1,xj=1e6;let Af=0;function wj(){return Af=(Af+1)%Number.MAX_SAFE_INTEGER,Af.toString()}const Of=new Map,Qy=t=>{if(Of.has(t))return;const e=setTimeout(()=>{Of.delete(t),ol({type:"REMOVE_TOAST",toastId:t})},xj);Of.set(t,e)},bj=(t,e)=>{switch(e.type){case"ADD_TOAST":return{...t,toasts:[e.toast,...t.toasts].slice(0,yj)};case"UPDATE_TOAST":return{...t,toasts:t.toasts.map(r=>r.id===e.toast.id?{...r,...e.toast}:r)};case"DISMISS_TOAST":{const{toastId:r}=e;return r?Qy(r):t.toasts.forEach(s=>{Qy(s.id)}),{...t,toasts:t.toasts.map(s=>s.id===r||r===void 0?{...s,open:!1}:s)}}case"REMOVE_TOAST":return e.toastId===void 0?{...t,toasts:[]}:{...t,toasts:t.toasts.filter(r=>r.id!==e.toastId)}}},Gc=[];let Zc={toasts:[]};function ol(t){Zc=bj(Zc,t),Gc.forEach(e=>{e(Zc)})}function Sj({...t}){const e=wj(),r=n=>ol({type:"UPDATE_TOAST",toast:{...n,id:e}}),s=()=>ol({type:"DISMISS_TOAST",toastId:e});return ol({type:"ADD_TOAST",toast:{...t,id:e,open:!0,onOpenChange:n=>{n||s()}}}),{id:e,dismiss:s,update:r}}function or(){const[t,e]=x.useState(Zc);return x.useEffect(()=>(Gc.push(e),()=>{const r=Gc.indexOf(e);r>-1&&Gc.splice(r,1)}),[t]),{...t,toast:Sj,dismiss:r=>ol({type:"DISMISS_TOAST",toastId:r})}}function _e(t,e,{checkForDefaultPrevented:r=!0}={}){return function(n){if(t==null||t(n),r===!1||!n.defaultPrevented)return e==null?void 0:e(n)}}function Gy(t,e){if(typeof t=="function")return t(e);t!=null&&(t.current=e)}function t1(...t){return e=>{let r=!1;const s=t.map(n=>{const a=Gy(n,e);return!r&&typeof a=="function"&&(r=!0),a});if(r)return()=>{for(let n=0;n<s.length;n++){const a=s[n];typeof a=="function"?a():Gy(t[n],null)}}}}function et(...t){return x.useCallback(t1(...t),t)}function _j(t,e){const r=x.createContext(e),s=a=>{const{children:o,...l}=a,c=x.useMemo(()=>l,Object.values(l));return i.jsx(r.Provider,{value:c,children:o})};s.displayName=t+"Provider";function n(a){const o=x.useContext(r);if(o)return o;if(e!==void 0)return e;throw new Error(`\`${a}\` must be used within \`${t}\``)}return[s,n]}function fs(t,e=[]){let r=[];function s(a,o){const l=x.createContext(o),c=r.length;r=[...r,o];const u=f=>{var v;const{scope:m,children:p,...w}=f,h=((v=m==null?void 0:m[t])==null?void 0:v[c])||l,g=x.useMemo(()=>w,Object.values(w));return i.jsx(h.Provider,{value:g,children:p})};u.displayName=a+"Provider";function d(f,m){var h;const p=((h=m==null?void 0:m[t])==null?void 0:h[c])||l,w=x.useContext(p);if(w)return w;if(o!==void 0)return o;throw new Error(`\`${f}\` must be used within \`${a}\``)}return[u,d]}const n=()=>{const a=r.map(o=>x.createContext(o));return function(l){const c=(l==null?void 0:l[t])||a;return x.useMemo(()=>({[`__scope${t}`]:{...l,[t]:c}}),[l,c])}};return n.scopeName=t,[s,Ej(n,...e)]}function Ej(...t){const e=t[0];if(t.length===1)return e;const r=()=>{const s=t.map(n=>({useScope:n(),scopeName:n.scopeName}));return function(a){const o=s.reduce((l,{useScope:c,scopeName:u})=>{const f=c(a)[`__scope${u}`];return{...l,...f}},{});return x.useMemo(()=>({[`__scope${e.scopeName}`]:o}),[o])}};return r.scopeName=e.scopeName,r}function fi(t){const e=kj(t),r=x.forwardRef((s,n)=>{const{children:a,...o}=s,l=x.Children.toArray(a),c=l.find(Nj);if(c){const u=c.props.children,d=l.map(f=>f===c?x.Children.count(u)>1?x.Children.only(null):x.isValidElement(u)?u.props.children:null:f);return i.jsx(e,{...o,ref:n,children:x.isValidElement(u)?x.cloneElement(u,void 0,d):null})}return i.jsx(e,{...o,ref:n,children:a})});return r.displayName=`${t}.Slot`,r}var Cj=fi("Slot");function kj(t){const e=x.forwardRef((r,s)=>{const{children:n,...a}=r;if(x.isValidElement(n)){const o=Rj(n),l=jj(a,n.props);return n.type!==x.Fragment&&(l.ref=s?t1(s,o):o),x.cloneElement(n,l)}return x.Children.count(n)>1?x.Children.only(null):null});return e.displayName=`${t}.SlotClone`,e}var r1=Symbol("radix.slottable");function Pj(t){const e=({children:r})=>i.jsx(i.Fragment,{children:r});return e.displayName=`${t}.Slottable`,e.__radixId=r1,e}function Nj(t){return x.isValidElement(t)&&typeof t.type=="function"&&"__radixId"in t.type&&t.type.__radixId===r1}function jj(t,e){const r={...e};for(const s in e){const n=t[s],a=e[s];/^on[A-Z]/.test(s)?n&&a?r[s]=(...l)=>{const c=a(...l);return n(...l),c}:n&&(r[s]=n):s==="style"?r[s]={...n,...a}:s==="className"&&(r[s]=[n,a].filter(Boolean).join(" "))}return{...t,...r}}function Rj(t){var s,n;let e=(s=Object.getOwnPropertyDescriptor(t.props,"ref"))==null?void 0:s.get,r=e&&"isReactWarning"in e&&e.isReactWarning;return r?t.ref:(e=(n=Object.getOwnPropertyDescriptor(t,"ref"))==null?void 0:n.get,r=e&&"isReactWarning"in e&&e.isReactWarning,r?t.props.ref:t.props.ref||t.ref)}function yv(t){const e=t+"CollectionProvider",[r,s]=fs(e),[n,a]=r(e,{collectionRef:{current:null},itemMap:new Map}),o=h=>{const{scope:g,children:v}=h,y=vn.useRef(null),b=vn.useRef(new Map).current;return i.jsx(n,{scope:g,itemMap:b,collectionRef:y,children:v})};o.displayName=e;const l=t+"CollectionSlot",c=fi(l),u=vn.forwardRef((h,g)=>{const{scope:v,children:y}=h,b=a(l,v),S=et(g,b.collectionRef);return i.jsx(c,{ref:S,children:y})});u.displayName=l;const d=t+"CollectionItemSlot",f="data-radix-collection-item",m=fi(d),p=vn.forwardRef((h,g)=>{const{scope:v,children:y,...b}=h,S=vn.useRef(null),E=et(g,S),k=a(d,v);return vn.useEffect(()=>(k.itemMap.set(S,{ref:S,...b}),()=>void k.itemMap.delete(S))),i.jsx(m,{[f]:"",ref:E,children:y})});p.displayName=d;function w(h){const g=a(t+"CollectionConsumer",h);return vn.useCallback(()=>{const y=g.collectionRef.current;if(!y)return[];const b=Array.from(y.querySelectorAll(`[${f}]`));return Array.from(g.itemMap.values()).sort((k,R)=>b.indexOf(k.ref.current)-b.indexOf(R.ref.current))},[g.collectionRef,g.itemMap])}return[{Provider:o,Slot:u,ItemSlot:p},w,s]}var Tj=["a","button","div","form","h2","h3","img","input","label","li","nav","ol","p","select","span","svg","ul"],Ae=Tj.reduce((t,e)=>{const r=fi(`Primitive.${e}`),s=x.forwardRef((n,a)=>{const{asChild:o,...l}=n,c=o?r:e;return typeof window<"u"&&(window[Symbol.for("radix-ui")]=!0),i.jsx(c,{...l,ref:a})});return s.displayName=`Primitive.${e}`,{...t,[e]:s}},{});function n1(t,e){t&&so.flushSync(()=>t.dispatchEvent(e))}function Ur(t){const e=x.useRef(t);return x.useEffect(()=>{e.current=t}),x.useMemo(()=>(...r)=>{var s;return(s=e.current)==null?void 0:s.call(e,...r)},[])}function Aj(t,e=globalThis==null?void 0:globalThis.document){const r=Ur(t);x.useEffect(()=>{const s=n=>{n.key==="Escape"&&r(n)};return e.addEventListener("keydown",s,{capture:!0}),()=>e.removeEventListener("keydown",s,{capture:!0})},[r,e])}var Oj="DismissableLayer",up="dismissableLayer.update",Ij="dismissableLayer.pointerDownOutside",Dj="dismissableLayer.focusOutside",Zy,s1=x.createContext({layers:new Set,layersWithOutsidePointerEventsDisabled:new Set,branches:new Set}),Vl=x.forwardRef((t,e)=>{const{disableOutsidePointerEvents:r=!1,onEscapeKeyDown:s,onPointerDownOutside:n,onFocusOutside:a,onInteractOutside:o,onDismiss:l,...c}=t,u=x.useContext(s1),[d,f]=x.useState(null),m=(d==null?void 0:d.ownerDocument)??(globalThis==null?void 0:globalThis.document),[,p]=x.useState({}),w=et(e,R=>f(R)),h=Array.from(u.layers),[g]=[...u.layersWithOutsidePointerEventsDisabled].slice(-1),v=h.indexOf(g),y=d?h.indexOf(d):-1,b=u.layersWithOutsidePointerEventsDisabled.size>0,S=y>=v,E=$j(R=>{const T=R.target,N=[...u.branches].some(O=>O.contains(T));!S||N||(n==null||n(R),o==null||o(R),R.defaultPrevented||l==null||l())},m),k=Fj(R=>{const T=R.target;[...u.branches].some(O=>O.contains(T))||(a==null||a(R),o==null||o(R),R.defaultPrevented||l==null||l())},m);return Aj(R=>{y===u.layers.size-1&&(s==null||s(R),!R.defaultPrevented&&l&&(R.preventDefault(),l()))},m),x.useEffect(()=>{if(d)return r&&(u.layersWithOutsidePointerEventsDisabled.size===0&&(Zy=m.body.style.pointerEvents,m.body.style.pointerEvents="none"),u.layersWithOutsidePointerEventsDisabled.add(d)),u.layers.add(d),Yy(),()=>{r&&u.layersWithOutsidePointerEventsDisabled.size===1&&(m.body.style.pointerEvents=Zy)}},[d,m,r,u]),x.useEffect(()=>()=>{d&&(u.layers.delete(d),u.layersWithOutsidePointerEventsDisabled.delete(d),Yy())},[d,u]),x.useEffect(()=>{const R=()=>p({});return document.addEventListener(up,R),()=>document.removeEventListener(up,R)},[]),i.jsx(Ae.div,{...c,ref:w,style:{pointerEvents:b?S?"auto":"none":void 0,...t.style},onFocusCapture:_e(t.onFocusCapture,k.onFocusCapture),onBlurCapture:_e(t.onBlurCapture,k.onBlurCapture),onPointerDownCapture:_e(t.onPointerDownCapture,E.onPointerDownCapture)})});Vl.displayName=Oj;var Mj="DismissableLayerBranch",a1=x.forwardRef((t,e)=>{const r=x.useContext(s1),s=x.useRef(null),n=et(e,s);return x.useEffect(()=>{const a=s.current;if(a)return r.branches.add(a),()=>{r.branches.delete(a)}},[r.branches]),i.jsx(Ae.div,{...t,ref:n})});a1.displayName=Mj;function $j(t,e=globalThis==null?void 0:globalThis.document){const r=Ur(t),s=x.useRef(!1),n=x.useRef(()=>{});return x.useEffect(()=>{const a=l=>{if(l.target&&!s.current){let c=function(){o1(Ij,r,u,{discrete:!0})};const u={originalEvent:l};l.pointerType==="touch"?(e.removeEventListener("click",n.current),n.current=c,e.addEventListener("click",n.current,{once:!0})):c()}else e.removeEventListener("click",n.current);s.current=!1},o=window.setTimeout(()=>{e.addEventListener("pointerdown",a)},0);return()=>{window.clearTimeout(o),e.removeEventListener("pointerdown",a),e.removeEventListener("click",n.current)}},[e,r]),{onPointerDownCapture:()=>s.current=!0}}function Fj(t,e=globalThis==null?void 0:globalThis.document){const r=Ur(t),s=x.useRef(!1);return x.useEffect(()=>{const n=a=>{a.target&&!s.current&&o1(Dj,r,{originalEvent:a},{discrete:!1})};return e.addEventListener("focusin",n),()=>e.removeEventListener("focusin",n)},[e,r]),{onFocusCapture:()=>s.current=!0,onBlurCapture:()=>s.current=!1}}function Yy(){const t=new CustomEvent(up);document.dispatchEvent(t)}function o1(t,e,r,{discrete:s}){const n=r.originalEvent.target,a=new CustomEvent(t,{bubbles:!1,cancelable:!0,detail:r});e&&n.addEventListener(t,e,{once:!0}),s?n1(n,a):n.dispatchEvent(a)}var Lj=Vl,Uj=a1,Bt=globalThis!=null&&globalThis.document?x.useLayoutEffect:()=>{},zj="Portal",kd=x.forwardRef((t,e)=>{var l;const{container:r,...s}=t,[n,a]=x.useState(!1);Bt(()=>a(!0),[]);const o=r||n&&((l=globalThis==null?void 0:globalThis.document)==null?void 0:l.body);return o?sN.createPortal(i.jsx(Ae.div,{...s,ref:e}),o):null});kd.displayName=zj;function Vj(t,e){return x.useReducer((r,s)=>e[r][s]??r,t)}var da=t=>{const{present:e,children:r}=t,s=qj(e),n=typeof r=="function"?r({present:s.isPresent}):x.Children.only(r),a=et(s.ref,Hj(n));return typeof r=="function"||s.isPresent?x.cloneElement(n,{ref:a}):null};da.displayName="Presence";function qj(t){const[e,r]=x.useState(),s=x.useRef(null),n=x.useRef(t),a=x.useRef("none"),o=t?"mounted":"unmounted",[l,c]=Vj(o,{mounted:{UNMOUNT:"unmounted",ANIMATION_OUT:"unmountSuspended"},unmountSuspended:{MOUNT:"mounted",ANIMATION_END:"unmounted"},unmounted:{MOUNT:"mounted"}});return x.useEffect(()=>{const u=_c(s.current);a.current=l==="mounted"?u:"none"},[l]),Bt(()=>{const u=s.current,d=n.current;if(d!==t){const m=a.current,p=_c(u);t?c("MOUNT"):p==="none"||(u==null?void 0:u.display)==="none"?c("UNMOUNT"):c(d&&m!==p?"ANIMATION_OUT":"UNMOUNT"),n.current=t}},[t,c]),Bt(()=>{if(e){let u;const d=e.ownerDocument.defaultView??window,f=p=>{const h=_c(s.current).includes(CSS.escape(p.animationName));if(p.target===e&&h&&(c("ANIMATION_END"),!n.current)){const g=e.style.animationFillMode;e.style.animationFillMode="forwards",u=d.setTimeout(()=>{e.style.animationFillMode==="forwards"&&(e.style.animationFillMode=g)})}},m=p=>{p.target===e&&(a.current=_c(s.current))};return e.addEventListener("animationstart",m),e.addEventListener("animationcancel",f),e.addEventListener("animationend",f),()=>{d.clearTimeout(u),e.removeEventListener("animationstart",m),e.removeEventListener("animationcancel",f),e.removeEventListener("animationend",f)}}else c("ANIMATION_END")},[e,c]),{isPresent:["mounted","unmountSuspended"].includes(l),ref:x.useCallback(u=>{s.current=u?getComputedStyle(u):null,r(u)},[])}}function _c(t){return(t==null?void 0:t.animationName)||"none"}function Hj(t){var s,n;let e=(s=Object.getOwnPropertyDescriptor(t.props,"ref"))==null?void 0:s.get,r=e&&"isReactWarning"in e&&e.isReactWarning;return r?t.ref:(e=(n=Object.getOwnPropertyDescriptor(t,"ref"))==null?void 0:n.get,r=e&&"isReactWarning"in e&&e.isReactWarning,r?t.props.ref:t.props.ref||t.ref)}var Bj=bm[" useInsertionEffect ".trim().toString()]||Bt;function Ka({prop:t,defaultProp:e,onChange:r=()=>{},caller:s}){const[n,a,o]=Wj({defaultProp:e,onChange:r}),l=t!==void 0,c=l?t:n;{const d=x.useRef(t!==void 0);x.useEffect(()=>{const f=d.current;f!==l&&console.warn(`${s} is changing from ${f?"controlled":"uncontrolled"} to ${l?"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=l},[l,s])}const u=x.useCallback(d=>{var f;if(l){const m=Kj(d)?d(t):d;m!==t&&((f=o.current)==null||f.call(o,m))}else a(d)},[l,t,a,o]);return[c,u]}function Wj({defaultProp:t,onChange:e}){const[r,s]=x.useState(t),n=x.useRef(r),a=x.useRef(e);return Bj(()=>{a.current=e},[e]),x.useEffect(()=>{var o;n.current!==r&&((o=a.current)==null||o.call(a,r),n.current=r)},[r,n]),[r,s,a]}function Kj(t){return typeof t=="function"}var i1=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"}),Qj="VisuallyHidden",Pd=x.forwardRef((t,e)=>i.jsx(Ae.span,{...t,ref:e,style:{...i1,...t.style}}));Pd.displayName=Qj;var Gj=Pd,xv="ToastProvider",[wv,Zj,Yj]=yv("Toast"),[l1,MF]=fs("Toast",[Yj]),[Jj,Nd]=l1(xv),c1=t=>{const{__scopeToast:e,label:r="Notification",duration:s=5e3,swipeDirection:n="right",swipeThreshold:a=50,children:o}=t,[l,c]=x.useState(null),[u,d]=x.useState(0),f=x.useRef(!1),m=x.useRef(!1);return r.trim()||console.error(`Invalid prop \`label\` supplied to \`${xv}\`. Expected non-empty \`string\`.`),i.jsx(wv.Provider,{scope:e,children:i.jsx(Jj,{scope:e,label:r,duration:s,swipeDirection:n,swipeThreshold:a,toastCount:u,viewport:l,onViewportChange:c,onToastAdd:x.useCallback(()=>d(p=>p+1),[]),onToastRemove:x.useCallback(()=>d(p=>p-1),[]),isFocusedToastEscapeKeyDownRef:f,isClosePausedRef:m,children:o})})};c1.displayName=xv;var u1="ToastViewport",Xj=["F8"],dp="toast.viewportPause",fp="toast.viewportResume",d1=x.forwardRef((t,e)=>{const{__scopeToast:r,hotkey:s=Xj,label:n="Notifications ({hotkey})",...a}=t,o=Nd(u1,r),l=Zj(r),c=x.useRef(null),u=x.useRef(null),d=x.useRef(null),f=x.useRef(null),m=et(e,f,o.onViewportChange),p=s.join("+").replace(/Key/g,"").replace(/Digit/g,""),w=o.toastCount>0;x.useEffect(()=>{const g=v=>{var b;s.length!==0&&s.every(S=>v[S]||v.code===S)&&((b=f.current)==null||b.focus())};return document.addEventListener("keydown",g),()=>document.removeEventListener("keydown",g)},[s]),x.useEffect(()=>{const g=c.current,v=f.current;if(w&&g&&v){const y=()=>{if(!o.isClosePausedRef.current){const k=new CustomEvent(dp);v.dispatchEvent(k),o.isClosePausedRef.current=!0}},b=()=>{if(o.isClosePausedRef.current){const k=new CustomEvent(fp);v.dispatchEvent(k),o.isClosePausedRef.current=!1}},S=k=>{!g.contains(k.relatedTarget)&&b()},E=()=>{g.contains(document.activeElement)||b()};return g.addEventListener("focusin",y),g.addEventListener("focusout",S),g.addEventListener("pointermove",y),g.addEventListener("pointerleave",E),window.addEventListener("blur",y),window.addEventListener("focus",b),()=>{g.removeEventListener("focusin",y),g.removeEventListener("focusout",S),g.removeEventListener("pointermove",y),g.removeEventListener("pointerleave",E),window.removeEventListener("blur",y),window.removeEventListener("focus",b)}}},[w,o.isClosePausedRef]);const h=x.useCallback(({tabbingDirection:g})=>{const y=l().map(b=>{const S=b.ref.current,E=[S,...f2(S)];return g==="forwards"?E:E.reverse()});return(g==="forwards"?y.reverse():y).flat()},[l]);return x.useEffect(()=>{const g=f.current;if(g){const v=y=>{var E,k,R;const b=y.altKey||y.ctrlKey||y.metaKey;if(y.key==="Tab"&&!b){const T=document.activeElement,N=y.shiftKey;if(y.target===g&&N){(E=u.current)==null||E.focus();return}const _=h({tabbingDirection:N?"backwards":"forwards"}),A=_.findIndex(C=>C===T);If(_.slice(A+1))?y.preventDefault():N?(k=u.current)==null||k.focus():(R=d.current)==null||R.focus()}};return g.addEventListener("keydown",v),()=>g.removeEventListener("keydown",v)}},[l,h]),i.jsxs(Uj,{ref:c,role:"region","aria-label":n.replace("{hotkey}",p),tabIndex:-1,style:{pointerEvents:w?void 0:"none"},children:[w&&i.jsx(hp,{ref:u,onFocusFromOutsideViewport:()=>{const g=h({tabbingDirection:"forwards"});If(g)}}),i.jsx(wv.Slot,{scope:r,children:i.jsx(Ae.ol,{tabIndex:-1,...a,ref:m})}),w&&i.jsx(hp,{ref:d,onFocusFromOutsideViewport:()=>{const g=h({tabbingDirection:"backwards"});If(g)}})]})});d1.displayName=u1;var f1="ToastFocusProxy",hp=x.forwardRef((t,e)=>{const{__scopeToast:r,onFocusFromOutsideViewport:s,...n}=t,a=Nd(f1,r);return i.jsx(Pd,{tabIndex:0,...n,ref:e,style:{position:"fixed"},onFocus:o=>{var u;const l=o.relatedTarget;!((u=a.viewport)!=null&&u.contains(l))&&s()}})});hp.displayName=f1;var ql="Toast",e2="toast.swipeStart",t2="toast.swipeMove",r2="toast.swipeCancel",n2="toast.swipeEnd",h1=x.forwardRef((t,e)=>{const{forceMount:r,open:s,defaultOpen:n,onOpenChange:a,...o}=t,[l,c]=Ka({prop:s,defaultProp:n??!0,onChange:a,caller:ql});return i.jsx(da,{present:r||l,children:i.jsx(o2,{open:l,...o,ref:e,onClose:()=>c(!1),onPause:Ur(t.onPause),onResume:Ur(t.onResume),onSwipeStart:_e(t.onSwipeStart,u=>{u.currentTarget.setAttribute("data-swipe","start")}),onSwipeMove:_e(t.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:_e(t.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:_e(t.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`),c(!1)})})})});h1.displayName=ql;var[s2,a2]=l1(ql,{onClose(){}}),o2=x.forwardRef((t,e)=>{const{__scopeToast:r,type:s="foreground",duration:n,open:a,onClose:o,onEscapeKeyDown:l,onPause:c,onResume:u,onSwipeStart:d,onSwipeMove:f,onSwipeCancel:m,onSwipeEnd:p,...w}=t,h=Nd(ql,r),[g,v]=x.useState(null),y=et(e,C=>v(C)),b=x.useRef(null),S=x.useRef(null),E=n||h.duration,k=x.useRef(0),R=x.useRef(E),T=x.useRef(0),{onToastAdd:N,onToastRemove:O}=h,j=Ur(()=>{var z;(g==null?void 0:g.contains(document.activeElement))&&((z=h.viewport)==null||z.focus()),o()}),_=x.useCallback(C=>{!C||C===1/0||(window.clearTimeout(T.current),k.current=new Date().getTime(),T.current=window.setTimeout(j,C))},[j]);x.useEffect(()=>{const C=h.viewport;if(C){const z=()=>{_(R.current),u==null||u()},U=()=>{const K=new Date().getTime()-k.current;R.current=R.current-K,window.clearTimeout(T.current),c==null||c()};return C.addEventListener(dp,U),C.addEventListener(fp,z),()=>{C.removeEventListener(dp,U),C.removeEventListener(fp,z)}}},[h.viewport,E,c,u,_]),x.useEffect(()=>{a&&!h.isClosePausedRef.current&&_(E)},[a,E,h.isClosePausedRef,_]),x.useEffect(()=>(N(),()=>O()),[N,O]);const A=x.useMemo(()=>g?w1(g):null,[g]);return h.viewport?i.jsxs(i.Fragment,{children:[A&&i.jsx(i2,{__scopeToast:r,role:"status","aria-live":s==="foreground"?"assertive":"polite",children:A}),i.jsx(s2,{scope:r,onClose:j,children:so.createPortal(i.jsx(wv.ItemSlot,{scope:r,children:i.jsx(Lj,{asChild:!0,onEscapeKeyDown:_e(l,()=>{h.isFocusedToastEscapeKeyDownRef.current||j(),h.isFocusedToastEscapeKeyDownRef.current=!1}),children:i.jsx(Ae.li,{tabIndex:0,"data-state":a?"open":"closed","data-swipe-direction":h.swipeDirection,...w,ref:y,style:{userSelect:"none",touchAction:"none",...t.style},onKeyDown:_e(t.onKeyDown,C=>{C.key==="Escape"&&(l==null||l(C.nativeEvent),C.nativeEvent.defaultPrevented||(h.isFocusedToastEscapeKeyDownRef.current=!0,j()))}),onPointerDown:_e(t.onPointerDown,C=>{C.button===0&&(b.current={x:C.clientX,y:C.clientY})}),onPointerMove:_e(t.onPointerMove,C=>{if(!b.current)return;const z=C.clientX-b.current.x,U=C.clientY-b.current.y,K=!!S.current,$=["left","right"].includes(h.swipeDirection),F=["left","up"].includes(h.swipeDirection)?Math.min:Math.max,V=$?F(0,z):0,ae=$?0:F(0,U),se=C.pointerType==="touch"?10:2,W={x:V,y:ae},L={originalEvent:C,delta:W};K?(S.current=W,Ec(t2,f,L,{discrete:!1})):Jy(W,h.swipeDirection,se)?(S.current=W,Ec(e2,d,L,{discrete:!1}),C.target.setPointerCapture(C.pointerId)):(Math.abs(z)>se||Math.abs(U)>se)&&(b.current=null)}),onPointerUp:_e(t.onPointerUp,C=>{const z=S.current,U=C.target;if(U.hasPointerCapture(C.pointerId)&&U.releasePointerCapture(C.pointerId),S.current=null,b.current=null,z){const K=C.currentTarget,$={originalEvent:C,delta:z};Jy(z,h.swipeDirection,h.swipeThreshold)?Ec(n2,p,$,{discrete:!0}):Ec(r2,m,$,{discrete:!0}),K.addEventListener("click",F=>F.preventDefault(),{once:!0})}})})})}),h.viewport)})]}):null}),i2=t=>{const{__scopeToast:e,children:r,...s}=t,n=Nd(ql,e),[a,o]=x.useState(!1),[l,c]=x.useState(!1);return u2(()=>o(!0)),x.useEffect(()=>{const u=window.setTimeout(()=>c(!0),1e3);return()=>window.clearTimeout(u)},[]),l?null:i.jsx(kd,{asChild:!0,children:i.jsx(Pd,{...s,children:a&&i.jsxs(i.Fragment,{children:[n.label," ",r]})})})},l2="ToastTitle",p1=x.forwardRef((t,e)=>{const{__scopeToast:r,...s}=t;return i.jsx(Ae.div,{...s,ref:e})});p1.displayName=l2;var c2="ToastDescription",m1=x.forwardRef((t,e)=>{const{__scopeToast:r,...s}=t;return i.jsx(Ae.div,{...s,ref:e})});m1.displayName=c2;var v1="ToastAction",g1=x.forwardRef((t,e)=>{const{altText:r,...s}=t;return r.trim()?i.jsx(x1,{altText:r,asChild:!0,children:i.jsx(bv,{...s,ref:e})}):(console.error(`Invalid prop \`altText\` supplied to \`${v1}\`. Expected non-empty \`string\`.`),null)});g1.displayName=v1;var y1="ToastClose",bv=x.forwardRef((t,e)=>{const{__scopeToast:r,...s}=t,n=a2(y1,r);return i.jsx(x1,{asChild:!0,children:i.jsx(Ae.button,{type:"button",...s,ref:e,onClick:_e(t.onClick,n.onClose)})})});bv.displayName=y1;var x1=x.forwardRef((t,e)=>{const{__scopeToast:r,altText:s,...n}=t;return i.jsx(Ae.div,{"data-radix-toast-announce-exclude":"","data-radix-toast-announce-alt":s||void 0,...n,ref:e})});function w1(t){const e=[];return Array.from(t.childNodes).forEach(s=>{if(s.nodeType===s.TEXT_NODE&&s.textContent&&e.push(s.textContent),d2(s)){const n=s.ariaHidden||s.hidden||s.style.display==="none",a=s.dataset.radixToastAnnounceExclude==="";if(!n)if(a){const o=s.dataset.radixToastAnnounceAlt;o&&e.push(o)}else e.push(...w1(s))}}),e}function Ec(t,e,r,{discrete:s}){const n=r.originalEvent.currentTarget,a=new CustomEvent(t,{bubbles:!0,cancelable:!0,detail:r});e&&n.addEventListener(t,e,{once:!0}),s?n1(n,a):n.dispatchEvent(a)}var Jy=(t,e,r=0)=>{const s=Math.abs(t.x),n=Math.abs(t.y),a=s>n;return e==="left"||e==="right"?a&&s>r:!a&&n>r};function u2(t=()=>{}){const e=Ur(t);Bt(()=>{let r=0,s=0;return r=window.requestAnimationFrame(()=>s=window.requestAnimationFrame(e)),()=>{window.cancelAnimationFrame(r),window.cancelAnimationFrame(s)}},[e])}function d2(t){return t.nodeType===t.ELEMENT_NODE}function f2(t){const e=[],r=document.createTreeWalker(t,NodeFilter.SHOW_ELEMENT,{acceptNode:s=>{const n=s.tagName==="INPUT"&&s.type==="hidden";return s.disabled||s.hidden||n?NodeFilter.FILTER_SKIP:s.tabIndex>=0?NodeFilter.FILTER_ACCEPT:NodeFilter.FILTER_SKIP}});for(;r.nextNode();)e.push(r.currentNode);return e}function If(t){const e=document.activeElement;return t.some(r=>r===e?!0:(r.focus(),document.activeElement!==e))}var h2=c1,b1=d1,S1=h1,_1=p1,E1=m1,C1=g1,k1=bv;function P1(t){var e,r,s="";if(typeof t=="string"||typeof t=="number")s+=t;else if(typeof t=="object")if(Array.isArray(t)){var n=t.length;for(e=0;e<n;e++)t[e]&&(r=P1(t[e]))&&(s&&(s+=" "),s+=r)}else for(r in t)t[r]&&(s&&(s+=" "),s+=r);return s}function N1(){for(var t,e,r=0,s="",n=arguments.length;r<n;r++)(t=arguments[r])&&(e=P1(t))&&(s&&(s+=" "),s+=e);return s}const Xy=t=>typeof t=="boolean"?`${t}`:t===0?"0":t,e0=N1,jd=(t,e)=>r=>{var s;if((e==null?void 0:e.variants)==null)return e0(t,r==null?void 0:r.class,r==null?void 0:r.className);const{variants:n,defaultVariants:a}=e,o=Object.keys(n).map(u=>{const d=r==null?void 0:r[u],f=a==null?void 0:a[u];if(d===null)return null;const m=Xy(d)||Xy(f);return n[u][m]}),l=r&&Object.entries(r).reduce((u,d)=>{let[f,m]=d;return m===void 0||(u[f]=m),u},{}),c=e==null||(s=e.compoundVariants)===null||s===void 0?void 0:s.reduce((u,d)=>{let{class:f,className:m,...p}=d;return Object.entries(p).every(w=>{let[h,g]=w;return Array.isArray(g)?g.includes({...a,...l}[h]):{...a,...l}[h]===g})?[...u,f,m]:u},[]);return e0(t,o,c,r==null?void 0:r.class,r==null?void 0:r.className)};/**
|
|
49
|
+
* @license lucide-react v0.453.0 - ISC
|
|
50
|
+
*
|
|
51
|
+
* This source code is licensed under the ISC license.
|
|
52
|
+
* See the LICENSE file in the root directory of this source tree.
|
|
53
|
+
*/const p2=t=>t.replace(/([a-z0-9])([A-Z])/g,"$1-$2").toLowerCase(),j1=(...t)=>t.filter((e,r,s)=>!!e&&s.indexOf(e)===r).join(" ");/**
|
|
54
|
+
* @license lucide-react v0.453.0 - ISC
|
|
55
|
+
*
|
|
56
|
+
* This source code is licensed under the ISC license.
|
|
57
|
+
* See the LICENSE file in the root directory of this source tree.
|
|
58
|
+
*/var m2={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"};/**
|
|
59
|
+
* @license lucide-react v0.453.0 - ISC
|
|
60
|
+
*
|
|
61
|
+
* This source code is licensed under the ISC license.
|
|
62
|
+
* See the LICENSE file in the root directory of this source tree.
|
|
63
|
+
*/const v2=x.forwardRef(({color:t="currentColor",size:e=24,strokeWidth:r=2,absoluteStrokeWidth:s,className:n="",children:a,iconNode:o,...l},c)=>x.createElement("svg",{ref:c,...m2,width:e,height:e,stroke:t,strokeWidth:s?Number(r)*24/Number(e):r,className:j1("lucide",n),...l},[...o.map(([u,d])=>x.createElement(u,d)),...Array.isArray(a)?a:[a]]));/**
|
|
64
|
+
* @license lucide-react v0.453.0 - ISC
|
|
65
|
+
*
|
|
66
|
+
* This source code is licensed under the ISC license.
|
|
67
|
+
* See the LICENSE file in the root directory of this source tree.
|
|
68
|
+
*/const Ye=(t,e)=>{const r=x.forwardRef(({className:s,...n},a)=>x.createElement(v2,{ref:a,iconNode:e,className:j1(`lucide-${p2(t)}`,s),...n}));return r.displayName=`${t}`,r};/**
|
|
69
|
+
* @license lucide-react v0.453.0 - ISC
|
|
70
|
+
*
|
|
71
|
+
* This source code is licensed under the ISC license.
|
|
72
|
+
* See the LICENSE file in the root directory of this source tree.
|
|
73
|
+
*/const g2=Ye("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"}]]);/**
|
|
74
|
+
* @license lucide-react v0.453.0 - ISC
|
|
75
|
+
*
|
|
76
|
+
* This source code is licensed under the ISC license.
|
|
77
|
+
* See the LICENSE file in the root directory of this source tree.
|
|
78
|
+
*/const R1=Ye("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"}]]);/**
|
|
79
|
+
* @license lucide-react v0.453.0 - ISC
|
|
80
|
+
*
|
|
81
|
+
* This source code is licensed under the ISC license.
|
|
82
|
+
* See the LICENSE file in the root directory of this source tree.
|
|
83
|
+
*/const Sv=Ye("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"}]]);/**
|
|
84
|
+
* @license lucide-react v0.453.0 - ISC
|
|
85
|
+
*
|
|
86
|
+
* This source code is licensed under the ISC license.
|
|
87
|
+
* See the LICENSE file in the root directory of this source tree.
|
|
88
|
+
*/const y2=Ye("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"}]]);/**
|
|
89
|
+
* @license lucide-react v0.453.0 - ISC
|
|
90
|
+
*
|
|
91
|
+
* This source code is licensed under the ISC license.
|
|
92
|
+
* See the LICENSE file in the root directory of this source tree.
|
|
93
|
+
*/const Df=Ye("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"}]]);/**
|
|
94
|
+
* @license lucide-react v0.453.0 - ISC
|
|
95
|
+
*
|
|
96
|
+
* This source code is licensed under the ISC license.
|
|
97
|
+
* See the LICENSE file in the root directory of this source tree.
|
|
98
|
+
*/const T1=Ye("Check",[["path",{d:"M20 6 9 17l-5-5",key:"1gmf2c"}]]);/**
|
|
99
|
+
* @license lucide-react v0.453.0 - ISC
|
|
100
|
+
*
|
|
101
|
+
* This source code is licensed under the ISC license.
|
|
102
|
+
* See the LICENSE file in the root directory of this source tree.
|
|
103
|
+
*/const _v=Ye("ChevronDown",[["path",{d:"m6 9 6 6 6-6",key:"qrunsl"}]]);/**
|
|
104
|
+
* @license lucide-react v0.453.0 - ISC
|
|
105
|
+
*
|
|
106
|
+
* This source code is licensed under the ISC license.
|
|
107
|
+
* See the LICENSE file in the root directory of this source tree.
|
|
108
|
+
*/const x2=Ye("ChevronLeft",[["path",{d:"m15 18-6-6 6-6",key:"1wnfg3"}]]);/**
|
|
109
|
+
* @license lucide-react v0.453.0 - ISC
|
|
110
|
+
*
|
|
111
|
+
* This source code is licensed under the ISC license.
|
|
112
|
+
* See the LICENSE file in the root directory of this source tree.
|
|
113
|
+
*/const w2=Ye("ChevronRight",[["path",{d:"m9 18 6-6-6-6",key:"mthhwq"}]]);/**
|
|
114
|
+
* @license lucide-react v0.453.0 - ISC
|
|
115
|
+
*
|
|
116
|
+
* This source code is licensed under the ISC license.
|
|
117
|
+
* See the LICENSE file in the root directory of this source tree.
|
|
118
|
+
*/const b2=Ye("ChevronUp",[["path",{d:"m18 15-6-6-6 6",key:"153udz"}]]);/**
|
|
119
|
+
* @license lucide-react v0.453.0 - ISC
|
|
120
|
+
*
|
|
121
|
+
* This source code is licensed under the ISC license.
|
|
122
|
+
* See the LICENSE file in the root directory of this source tree.
|
|
123
|
+
*/const A1=Ye("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"}]]);/**
|
|
124
|
+
* @license lucide-react v0.453.0 - ISC
|
|
125
|
+
*
|
|
126
|
+
* This source code is licensed under the ISC license.
|
|
127
|
+
* See the LICENSE file in the root directory of this source tree.
|
|
128
|
+
*/const pp=Ye("CircleCheckBig",[["path",{d:"M21.801 10A10 10 0 1 1 17 3.335",key:"yps3ct"}],["path",{d:"m9 11 3 3L22 4",key:"1pflzl"}]]);/**
|
|
129
|
+
* @license lucide-react v0.453.0 - ISC
|
|
130
|
+
*
|
|
131
|
+
* This source code is licensed under the ISC license.
|
|
132
|
+
* See the LICENSE file in the root directory of this source tree.
|
|
133
|
+
*/const t0=Ye("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"}]]);/**
|
|
134
|
+
* @license lucide-react v0.453.0 - ISC
|
|
135
|
+
*
|
|
136
|
+
* This source code is licensed under the ISC license.
|
|
137
|
+
* See the LICENSE file in the root directory of this source tree.
|
|
138
|
+
*/const S2=Ye("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"}]]);/**
|
|
139
|
+
* @license lucide-react v0.453.0 - ISC
|
|
140
|
+
*
|
|
141
|
+
* This source code is licensed under the ISC license.
|
|
142
|
+
* See the LICENSE file in the root directory of this source tree.
|
|
143
|
+
*/const O1=Ye("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"}]]);/**
|
|
144
|
+
* @license lucide-react v0.453.0 - ISC
|
|
145
|
+
*
|
|
146
|
+
* This source code is licensed under the ISC license.
|
|
147
|
+
* See the LICENSE file in the root directory of this source tree.
|
|
148
|
+
*/const r0=Ye("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"}]]);/**
|
|
149
|
+
* @license lucide-react v0.453.0 - ISC
|
|
150
|
+
*
|
|
151
|
+
* This source code is licensed under the ISC license.
|
|
152
|
+
* See the LICENSE file in the root directory of this source tree.
|
|
153
|
+
*/const Jn=Ye("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"}]]);/**
|
|
154
|
+
* @license lucide-react v0.453.0 - ISC
|
|
155
|
+
*
|
|
156
|
+
* This source code is licensed under the ISC license.
|
|
157
|
+
* See the LICENSE file in the root directory of this source tree.
|
|
158
|
+
*/const _2=Ye("Filter",[["polygon",{points:"22 3 2 3 10 12.46 10 19 14 21 14 12.46 22 3",key:"1yg77f"}]]);/**
|
|
159
|
+
* @license lucide-react v0.453.0 - ISC
|
|
160
|
+
*
|
|
161
|
+
* This source code is licensed under the ISC license.
|
|
162
|
+
* See the LICENSE file in the root directory of this source tree.
|
|
163
|
+
*/const mp=Ye("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"}]]);/**
|
|
164
|
+
* @license lucide-react v0.453.0 - ISC
|
|
165
|
+
*
|
|
166
|
+
* This source code is licensed under the ISC license.
|
|
167
|
+
* See the LICENSE file in the root directory of this source tree.
|
|
168
|
+
*/const Cc=Ye("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"}]]);/**
|
|
169
|
+
* @license lucide-react v0.453.0 - ISC
|
|
170
|
+
*
|
|
171
|
+
* This source code is licensed under the ISC license.
|
|
172
|
+
* See the LICENSE file in the root directory of this source tree.
|
|
173
|
+
*/const vp=Ye("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"}]]);/**
|
|
174
|
+
* @license lucide-react v0.453.0 - ISC
|
|
175
|
+
*
|
|
176
|
+
* This source code is licensed under the ISC license.
|
|
177
|
+
* See the LICENSE file in the root directory of this source tree.
|
|
178
|
+
*/const E2=Ye("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"}]]);/**
|
|
179
|
+
* @license lucide-react v0.453.0 - ISC
|
|
180
|
+
*
|
|
181
|
+
* This source code is licensed under the ISC license.
|
|
182
|
+
* See the LICENSE file in the root directory of this source tree.
|
|
183
|
+
*/const n0=Ye("LoaderCircle",[["path",{d:"M21 12a9 9 0 1 1-6.219-8.56",key:"13zald"}]]);/**
|
|
184
|
+
* @license lucide-react v0.453.0 - ISC
|
|
185
|
+
*
|
|
186
|
+
* This source code is licensed under the ISC license.
|
|
187
|
+
* See the LICENSE file in the root directory of this source tree.
|
|
188
|
+
*/const C2=Ye("Play",[["polygon",{points:"6 3 20 12 6 21 6 3",key:"1oa8hb"}]]);/**
|
|
189
|
+
* @license lucide-react v0.453.0 - ISC
|
|
190
|
+
*
|
|
191
|
+
* This source code is licensed under the ISC license.
|
|
192
|
+
* See the LICENSE file in the root directory of this source tree.
|
|
193
|
+
*/const Vs=Ye("Plus",[["path",{d:"M5 12h14",key:"1ays0h"}],["path",{d:"M12 5v14",key:"s699le"}]]);/**
|
|
194
|
+
* @license lucide-react v0.453.0 - ISC
|
|
195
|
+
*
|
|
196
|
+
* This source code is licensed under the ISC license.
|
|
197
|
+
* See the LICENSE file in the root directory of this source tree.
|
|
198
|
+
*/const I1=Ye("Search",[["circle",{cx:"11",cy:"11",r:"8",key:"4ej97u"}],["path",{d:"m21 21-4.3-4.3",key:"1qie3q"}]]);/**
|
|
199
|
+
* @license lucide-react v0.453.0 - ISC
|
|
200
|
+
*
|
|
201
|
+
* This source code is licensed under the ISC license.
|
|
202
|
+
* See the LICENSE file in the root directory of this source tree.
|
|
203
|
+
*/const Au=Ye("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"}]]);/**
|
|
204
|
+
* @license lucide-react v0.453.0 - ISC
|
|
205
|
+
*
|
|
206
|
+
* This source code is licensed under the ISC license.
|
|
207
|
+
* See the LICENSE file in the root directory of this source tree.
|
|
208
|
+
*/const k2=Ye("Terminal",[["polyline",{points:"4 17 10 11 4 5",key:"akl6gq"}],["line",{x1:"12",x2:"20",y1:"19",y2:"19",key:"q2wloq"}]]);/**
|
|
209
|
+
* @license lucide-react v0.453.0 - ISC
|
|
210
|
+
*
|
|
211
|
+
* This source code is licensed under the ISC license.
|
|
212
|
+
* See the LICENSE file in the root directory of this source tree.
|
|
213
|
+
*/const Rd=Ye("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"}]]);/**
|
|
214
|
+
* @license lucide-react v0.453.0 - ISC
|
|
215
|
+
*
|
|
216
|
+
* This source code is licensed under the ISC license.
|
|
217
|
+
* See the LICENSE file in the root directory of this source tree.
|
|
218
|
+
*/const rn=Ye("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"}]]);/**
|
|
219
|
+
* @license lucide-react v0.453.0 - ISC
|
|
220
|
+
*
|
|
221
|
+
* This source code is licensed under the ISC license.
|
|
222
|
+
* See the LICENSE file in the root directory of this source tree.
|
|
223
|
+
*/const P2=Ye("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"}]]);/**
|
|
224
|
+
* @license lucide-react v0.453.0 - ISC
|
|
225
|
+
*
|
|
226
|
+
* This source code is licensed under the ISC license.
|
|
227
|
+
* See the LICENSE file in the root directory of this source tree.
|
|
228
|
+
*/const Ou=Ye("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"}]]);/**
|
|
229
|
+
* @license lucide-react v0.453.0 - ISC
|
|
230
|
+
*
|
|
231
|
+
* This source code is licensed under the ISC license.
|
|
232
|
+
* See the LICENSE file in the root directory of this source tree.
|
|
233
|
+
*/const Iu=Ye("X",[["path",{d:"M18 6 6 18",key:"1bl5f8"}],["path",{d:"m6 6 12 12",key:"d8bk6v"}]]),Ev="-",N2=t=>{const e=R2(t),{conflictingClassGroups:r,conflictingClassGroupModifiers:s}=t;return{getClassGroupId:o=>{const l=o.split(Ev);return l[0]===""&&l.length!==1&&l.shift(),D1(l,e)||j2(o)},getConflictingClassGroupIds:(o,l)=>{const c=r[o]||[];return l&&s[o]?[...c,...s[o]]:c}}},D1=(t,e)=>{var o;if(t.length===0)return e.classGroupId;const r=t[0],s=e.nextPart.get(r),n=s?D1(t.slice(1),s):void 0;if(n)return n;if(e.validators.length===0)return;const a=t.join(Ev);return(o=e.validators.find(({validator:l})=>l(a)))==null?void 0:o.classGroupId},s0=/^\[(.+)\]$/,j2=t=>{if(s0.test(t)){const e=s0.exec(t)[1],r=e==null?void 0:e.substring(0,e.indexOf(":"));if(r)return"arbitrary.."+r}},R2=t=>{const{theme:e,prefix:r}=t,s={nextPart:new Map,validators:[]};return A2(Object.entries(t.classGroups),r).forEach(([a,o])=>{gp(o,s,a,e)}),s},gp=(t,e,r,s)=>{t.forEach(n=>{if(typeof n=="string"){const a=n===""?e:a0(e,n);a.classGroupId=r;return}if(typeof n=="function"){if(T2(n)){gp(n(s),e,r,s);return}e.validators.push({validator:n,classGroupId:r});return}Object.entries(n).forEach(([a,o])=>{gp(o,a0(e,a),r,s)})})},a0=(t,e)=>{let r=t;return e.split(Ev).forEach(s=>{r.nextPart.has(s)||r.nextPart.set(s,{nextPart:new Map,validators:[]}),r=r.nextPart.get(s)}),r},T2=t=>t.isThemeGetter,A2=(t,e)=>e?t.map(([r,s])=>{const n=s.map(a=>typeof a=="string"?e+a:typeof a=="object"?Object.fromEntries(Object.entries(a).map(([o,l])=>[e+o,l])):a);return[r,n]}):t,O2=t=>{if(t<1)return{get:()=>{},set:()=>{}};let e=0,r=new Map,s=new Map;const n=(a,o)=>{r.set(a,o),e++,e>t&&(e=0,s=r,r=new Map)};return{get(a){let o=r.get(a);if(o!==void 0)return o;if((o=s.get(a))!==void 0)return n(a,o),o},set(a,o){r.has(a)?r.set(a,o):n(a,o)}}},M1="!",I2=t=>{const{separator:e,experimentalParseClassName:r}=t,s=e.length===1,n=e[0],a=e.length,o=l=>{const c=[];let u=0,d=0,f;for(let g=0;g<l.length;g++){let v=l[g];if(u===0){if(v===n&&(s||l.slice(g,g+a)===e)){c.push(l.slice(d,g)),d=g+a;continue}if(v==="/"){f=g;continue}}v==="["?u++:v==="]"&&u--}const m=c.length===0?l:l.substring(d),p=m.startsWith(M1),w=p?m.substring(1):m,h=f&&f>d?f-d:void 0;return{modifiers:c,hasImportantModifier:p,baseClassName:w,maybePostfixModifierPosition:h}};return r?l=>r({className:l,parseClassName:o}):o},D2=t=>{if(t.length<=1)return t;const e=[];let r=[];return t.forEach(s=>{s[0]==="["?(e.push(...r.sort(),s),r=[]):r.push(s)}),e.push(...r.sort()),e},M2=t=>({cache:O2(t.cacheSize),parseClassName:I2(t),...N2(t)}),$2=/\s+/,F2=(t,e)=>{const{parseClassName:r,getClassGroupId:s,getConflictingClassGroupIds:n}=e,a=[],o=t.trim().split($2);let l="";for(let c=o.length-1;c>=0;c-=1){const u=o[c],{modifiers:d,hasImportantModifier:f,baseClassName:m,maybePostfixModifierPosition:p}=r(u);let w=!!p,h=s(w?m.substring(0,p):m);if(!h){if(!w){l=u+(l.length>0?" "+l:l);continue}if(h=s(m),!h){l=u+(l.length>0?" "+l:l);continue}w=!1}const g=D2(d).join(":"),v=f?g+M1:g,y=v+h;if(a.includes(y))continue;a.push(y);const b=n(h,w);for(let S=0;S<b.length;++S){const E=b[S];a.push(v+E)}l=u+(l.length>0?" "+l:l)}return l};function L2(){let t=0,e,r,s="";for(;t<arguments.length;)(e=arguments[t++])&&(r=$1(e))&&(s&&(s+=" "),s+=r);return s}const $1=t=>{if(typeof t=="string")return t;let e,r="";for(let s=0;s<t.length;s++)t[s]&&(e=$1(t[s]))&&(r&&(r+=" "),r+=e);return r};function U2(t,...e){let r,s,n,a=o;function o(c){const u=e.reduce((d,f)=>f(d),t());return r=M2(u),s=r.cache.get,n=r.cache.set,a=l,l(c)}function l(c){const u=s(c);if(u)return u;const d=F2(c,r);return n(c,d),d}return function(){return a(L2.apply(null,arguments))}}const it=t=>{const e=r=>r[t]||[];return e.isThemeGetter=!0,e},F1=/^\[(?:([a-z-]+):)?(.+)\]$/i,z2=/^\d+\/\d+$/,V2=new Set(["px","full","screen"]),q2=/^(\d+(\.\d+)?)?(xs|sm|md|lg|xl)$/,H2=/\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$/,B2=/^(rgba?|hsla?|hwb|(ok)?(lab|lch))\(.+\)$/,W2=/^(inset_)?-?((\d+)?\.?(\d+)[a-z]+|0)_-?((\d+)?\.?(\d+)[a-z]+|0)/,K2=/^(url|image|image-set|cross-fade|element|(repeating-)?(linear|radial|conic)-gradient)\(.+\)$/,Un=t=>Uo(t)||V2.has(t)||z2.test(t),xs=t=>Si(t,"length",tR),Uo=t=>!!t&&!Number.isNaN(Number(t)),Mf=t=>Si(t,"number",Uo),Fi=t=>!!t&&Number.isInteger(Number(t)),Q2=t=>t.endsWith("%")&&Uo(t.slice(0,-1)),$e=t=>F1.test(t),ws=t=>q2.test(t),G2=new Set(["length","size","percentage"]),Z2=t=>Si(t,G2,L1),Y2=t=>Si(t,"position",L1),J2=new Set(["image","url"]),X2=t=>Si(t,J2,nR),eR=t=>Si(t,"",rR),Li=()=>!0,Si=(t,e,r)=>{const s=F1.exec(t);return s?s[1]?typeof e=="string"?s[1]===e:e.has(s[1]):r(s[2]):!1},tR=t=>H2.test(t)&&!B2.test(t),L1=()=>!1,rR=t=>W2.test(t),nR=t=>K2.test(t),sR=()=>{const t=it("colors"),e=it("spacing"),r=it("blur"),s=it("brightness"),n=it("borderColor"),a=it("borderRadius"),o=it("borderSpacing"),l=it("borderWidth"),c=it("contrast"),u=it("grayscale"),d=it("hueRotate"),f=it("invert"),m=it("gap"),p=it("gradientColorStops"),w=it("gradientColorStopPositions"),h=it("inset"),g=it("margin"),v=it("opacity"),y=it("padding"),b=it("saturate"),S=it("scale"),E=it("sepia"),k=it("skew"),R=it("space"),T=it("translate"),N=()=>["auto","contain","none"],O=()=>["auto","hidden","clip","visible","scroll"],j=()=>["auto",$e,e],_=()=>[$e,e],A=()=>["",Un,xs],C=()=>["auto",Uo,$e],z=()=>["bottom","center","left","left-bottom","left-top","right","right-bottom","right-top","top"],U=()=>["solid","dashed","dotted","double","none"],K=()=>["normal","multiply","screen","overlay","darken","lighten","color-dodge","color-burn","hard-light","soft-light","difference","exclusion","hue","saturation","color","luminosity"],$=()=>["start","end","center","between","around","evenly","stretch"],F=()=>["","0",$e],V=()=>["auto","avoid","all","avoid-page","page","left","right","column"],ae=()=>[Uo,$e];return{cacheSize:500,separator:":",theme:{colors:[Li],spacing:[Un,xs],blur:["none","",ws,$e],brightness:ae(),borderColor:[t],borderRadius:["none","","full",ws,$e],borderSpacing:_(),borderWidth:A(),contrast:ae(),grayscale:F(),hueRotate:ae(),invert:F(),gap:_(),gradientColorStops:[t],gradientColorStopPositions:[Q2,xs],inset:j(),margin:j(),opacity:ae(),padding:_(),saturate:ae(),scale:ae(),sepia:F(),skew:ae(),space:_(),translate:_()},classGroups:{aspect:[{aspect:["auto","square","video",$e]}],container:["container"],columns:[{columns:[ws]}],"break-after":[{"break-after":V()}],"break-before":[{"break-before":V()}],"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:[...z(),$e]}],overflow:[{overflow:O()}],"overflow-x":[{"overflow-x":O()}],"overflow-y":[{"overflow-y":O()}],overscroll:[{overscroll:N()}],"overscroll-x":[{"overscroll-x":N()}],"overscroll-y":[{"overscroll-y":N()}],position:["static","fixed","absolute","relative","sticky"],inset:[{inset:[h]}],"inset-x":[{"inset-x":[h]}],"inset-y":[{"inset-y":[h]}],start:[{start:[h]}],end:[{end:[h]}],top:[{top:[h]}],right:[{right:[h]}],bottom:[{bottom:[h]}],left:[{left:[h]}],visibility:["visible","invisible","collapse"],z:[{z:["auto",Fi,$e]}],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",$e]}],grow:[{grow:F()}],shrink:[{shrink:F()}],order:[{order:["first","last","none",Fi,$e]}],"grid-cols":[{"grid-cols":[Li]}],"col-start-end":[{col:["auto",{span:["full",Fi,$e]},$e]}],"col-start":[{"col-start":C()}],"col-end":[{"col-end":C()}],"grid-rows":[{"grid-rows":[Li]}],"row-start-end":[{row:["auto",{span:[Fi,$e]},$e]}],"row-start":[{"row-start":C()}],"row-end":[{"row-end":C()}],"grid-flow":[{"grid-flow":["row","col","dense","row-dense","col-dense"]}],"auto-cols":[{"auto-cols":["auto","min","max","fr",$e]}],"auto-rows":[{"auto-rows":["auto","min","max","fr",$e]}],gap:[{gap:[m]}],"gap-x":[{"gap-x":[m]}],"gap-y":[{"gap-y":[m]}],"justify-content":[{justify:["normal",...$()]}],"justify-items":[{"justify-items":["start","end","center","stretch"]}],"justify-self":[{"justify-self":["auto","start","end","center","stretch"]}],"align-content":[{content:["normal",...$(),"baseline"]}],"align-items":[{items:["start","end","center","baseline","stretch"]}],"align-self":[{self:["auto","start","end","center","stretch","baseline"]}],"place-content":[{"place-content":[...$(),"baseline"]}],"place-items":[{"place-items":["start","end","center","baseline","stretch"]}],"place-self":[{"place-self":["auto","start","end","center","stretch"]}],p:[{p:[y]}],px:[{px:[y]}],py:[{py:[y]}],ps:[{ps:[y]}],pe:[{pe:[y]}],pt:[{pt:[y]}],pr:[{pr:[y]}],pb:[{pb:[y]}],pl:[{pl:[y]}],m:[{m:[g]}],mx:[{mx:[g]}],my:[{my:[g]}],ms:[{ms:[g]}],me:[{me:[g]}],mt:[{mt:[g]}],mr:[{mr:[g]}],mb:[{mb:[g]}],ml:[{ml:[g]}],"space-x":[{"space-x":[R]}],"space-x-reverse":["space-x-reverse"],"space-y":[{"space-y":[R]}],"space-y-reverse":["space-y-reverse"],w:[{w:["auto","min","max","fit","svw","lvw","dvw",$e,e]}],"min-w":[{"min-w":[$e,e,"min","max","fit"]}],"max-w":[{"max-w":[$e,e,"none","full","min","max","fit","prose",{screen:[ws]},ws]}],h:[{h:[$e,e,"auto","min","max","fit","svh","lvh","dvh"]}],"min-h":[{"min-h":[$e,e,"min","max","fit","svh","lvh","dvh"]}],"max-h":[{"max-h":[$e,e,"min","max","fit","svh","lvh","dvh"]}],size:[{size:[$e,e,"auto","min","max","fit"]}],"font-size":[{text:["base",ws,xs]}],"font-smoothing":["antialiased","subpixel-antialiased"],"font-style":["italic","not-italic"],"font-weight":[{font:["thin","extralight","light","normal","medium","semibold","bold","extrabold","black",Mf]}],"font-family":[{font:[Li]}],"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",$e]}],"line-clamp":[{"line-clamp":["none",Uo,Mf]}],leading:[{leading:["none","tight","snug","normal","relaxed","loose",Un,$e]}],"list-image":[{"list-image":["none",$e]}],"list-style-type":[{list:["none","disc","decimal",$e]}],"list-style-position":[{list:["inside","outside"]}],"placeholder-color":[{placeholder:[t]}],"placeholder-opacity":[{"placeholder-opacity":[v]}],"text-alignment":[{text:["left","center","right","justify","start","end"]}],"text-color":[{text:[t]}],"text-opacity":[{"text-opacity":[v]}],"text-decoration":["underline","overline","line-through","no-underline"],"text-decoration-style":[{decoration:[...U(),"wavy"]}],"text-decoration-thickness":[{decoration:["auto","from-font",Un,xs]}],"underline-offset":[{"underline-offset":["auto",Un,$e]}],"text-decoration-color":[{decoration:[t]}],"text-transform":["uppercase","lowercase","capitalize","normal-case"],"text-overflow":["truncate","text-ellipsis","text-clip"],"text-wrap":[{text:["wrap","nowrap","balance","pretty"]}],indent:[{indent:_()}],"vertical-align":[{align:["baseline","top","middle","bottom","text-top","text-bottom","sub","super",$e]}],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",$e]}],"bg-attachment":[{bg:["fixed","local","scroll"]}],"bg-clip":[{"bg-clip":["border","padding","content","text"]}],"bg-opacity":[{"bg-opacity":[v]}],"bg-origin":[{"bg-origin":["border","padding","content"]}],"bg-position":[{bg:[...z(),Y2]}],"bg-repeat":[{bg:["no-repeat",{repeat:["","x","y","round","space"]}]}],"bg-size":[{bg:["auto","cover","contain",Z2]}],"bg-image":[{bg:["none",{"gradient-to":["t","tr","r","br","b","bl","l","tl"]},X2]}],"bg-color":[{bg:[t]}],"gradient-from-pos":[{from:[w]}],"gradient-via-pos":[{via:[w]}],"gradient-to-pos":[{to:[w]}],"gradient-from":[{from:[p]}],"gradient-via":[{via:[p]}],"gradient-to":[{to:[p]}],rounded:[{rounded:[a]}],"rounded-s":[{"rounded-s":[a]}],"rounded-e":[{"rounded-e":[a]}],"rounded-t":[{"rounded-t":[a]}],"rounded-r":[{"rounded-r":[a]}],"rounded-b":[{"rounded-b":[a]}],"rounded-l":[{"rounded-l":[a]}],"rounded-ss":[{"rounded-ss":[a]}],"rounded-se":[{"rounded-se":[a]}],"rounded-ee":[{"rounded-ee":[a]}],"rounded-es":[{"rounded-es":[a]}],"rounded-tl":[{"rounded-tl":[a]}],"rounded-tr":[{"rounded-tr":[a]}],"rounded-br":[{"rounded-br":[a]}],"rounded-bl":[{"rounded-bl":[a]}],"border-w":[{border:[l]}],"border-w-x":[{"border-x":[l]}],"border-w-y":[{"border-y":[l]}],"border-w-s":[{"border-s":[l]}],"border-w-e":[{"border-e":[l]}],"border-w-t":[{"border-t":[l]}],"border-w-r":[{"border-r":[l]}],"border-w-b":[{"border-b":[l]}],"border-w-l":[{"border-l":[l]}],"border-opacity":[{"border-opacity":[v]}],"border-style":[{border:[...U(),"hidden"]}],"divide-x":[{"divide-x":[l]}],"divide-x-reverse":["divide-x-reverse"],"divide-y":[{"divide-y":[l]}],"divide-y-reverse":["divide-y-reverse"],"divide-opacity":[{"divide-opacity":[v]}],"divide-style":[{divide:U()}],"border-color":[{border:[n]}],"border-color-x":[{"border-x":[n]}],"border-color-y":[{"border-y":[n]}],"border-color-s":[{"border-s":[n]}],"border-color-e":[{"border-e":[n]}],"border-color-t":[{"border-t":[n]}],"border-color-r":[{"border-r":[n]}],"border-color-b":[{"border-b":[n]}],"border-color-l":[{"border-l":[n]}],"divide-color":[{divide:[n]}],"outline-style":[{outline:["",...U()]}],"outline-offset":[{"outline-offset":[Un,$e]}],"outline-w":[{outline:[Un,xs]}],"outline-color":[{outline:[t]}],"ring-w":[{ring:A()}],"ring-w-inset":["ring-inset"],"ring-color":[{ring:[t]}],"ring-opacity":[{"ring-opacity":[v]}],"ring-offset-w":[{"ring-offset":[Un,xs]}],"ring-offset-color":[{"ring-offset":[t]}],shadow:[{shadow:["","inner","none",ws,eR]}],"shadow-color":[{shadow:[Li]}],opacity:[{opacity:[v]}],"mix-blend":[{"mix-blend":[...K(),"plus-lighter","plus-darker"]}],"bg-blend":[{"bg-blend":K()}],filter:[{filter:["","none"]}],blur:[{blur:[r]}],brightness:[{brightness:[s]}],contrast:[{contrast:[c]}],"drop-shadow":[{"drop-shadow":["","none",ws,$e]}],grayscale:[{grayscale:[u]}],"hue-rotate":[{"hue-rotate":[d]}],invert:[{invert:[f]}],saturate:[{saturate:[b]}],sepia:[{sepia:[E]}],"backdrop-filter":[{"backdrop-filter":["","none"]}],"backdrop-blur":[{"backdrop-blur":[r]}],"backdrop-brightness":[{"backdrop-brightness":[s]}],"backdrop-contrast":[{"backdrop-contrast":[c]}],"backdrop-grayscale":[{"backdrop-grayscale":[u]}],"backdrop-hue-rotate":[{"backdrop-hue-rotate":[d]}],"backdrop-invert":[{"backdrop-invert":[f]}],"backdrop-opacity":[{"backdrop-opacity":[v]}],"backdrop-saturate":[{"backdrop-saturate":[b]}],"backdrop-sepia":[{"backdrop-sepia":[E]}],"border-collapse":[{border:["collapse","separate"]}],"border-spacing":[{"border-spacing":[o]}],"border-spacing-x":[{"border-spacing-x":[o]}],"border-spacing-y":[{"border-spacing-y":[o]}],"table-layout":[{table:["auto","fixed"]}],caption:[{caption:["top","bottom"]}],transition:[{transition:["none","all","","colors","opacity","shadow","transform",$e]}],duration:[{duration:ae()}],ease:[{ease:["linear","in","out","in-out",$e]}],delay:[{delay:ae()}],animate:[{animate:["none","spin","ping","pulse","bounce",$e]}],transform:[{transform:["","gpu","none"]}],scale:[{scale:[S]}],"scale-x":[{"scale-x":[S]}],"scale-y":[{"scale-y":[S]}],rotate:[{rotate:[Fi,$e]}],"translate-x":[{"translate-x":[T]}],"translate-y":[{"translate-y":[T]}],"skew-x":[{"skew-x":[k]}],"skew-y":[{"skew-y":[k]}],"transform-origin":[{origin:["center","top","top-right","right","bottom-right","bottom","bottom-left","left","top-left",$e]}],accent:[{accent:["auto",t]}],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",$e]}],"caret-color":[{caret:[t]}],"pointer-events":[{"pointer-events":["none","auto"]}],resize:[{resize:["none","y","x",""]}],"scroll-behavior":[{scroll:["auto","smooth"]}],"scroll-m":[{"scroll-m":_()}],"scroll-mx":[{"scroll-mx":_()}],"scroll-my":[{"scroll-my":_()}],"scroll-ms":[{"scroll-ms":_()}],"scroll-me":[{"scroll-me":_()}],"scroll-mt":[{"scroll-mt":_()}],"scroll-mr":[{"scroll-mr":_()}],"scroll-mb":[{"scroll-mb":_()}],"scroll-ml":[{"scroll-ml":_()}],"scroll-p":[{"scroll-p":_()}],"scroll-px":[{"scroll-px":_()}],"scroll-py":[{"scroll-py":_()}],"scroll-ps":[{"scroll-ps":_()}],"scroll-pe":[{"scroll-pe":_()}],"scroll-pt":[{"scroll-pt":_()}],"scroll-pr":[{"scroll-pr":_()}],"scroll-pb":[{"scroll-pb":_()}],"scroll-pl":[{"scroll-pl":_()}],"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",$e]}],fill:[{fill:[t,"none"]}],"stroke-w":[{stroke:[Un,xs,Mf]}],stroke:[{stroke:[t,"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"]}}},aR=U2(sR);function Te(...t){return aR(N1(t))}const oR=h2,U1=x.forwardRef(({className:t,...e},r)=>i.jsx(b1,{ref:r,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]",t),...e}));U1.displayName=b1.displayName;const iR=jd("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"}}),z1=x.forwardRef(({className:t,variant:e,...r},s)=>i.jsx(S1,{ref:s,className:Te(iR({variant:e}),t),...r}));z1.displayName=S1.displayName;const lR=x.forwardRef(({className:t,...e},r)=>i.jsx(C1,{ref:r,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",t),...e}));lR.displayName=C1.displayName;const V1=x.forwardRef(({className:t,...e},r)=>i.jsx(k1,{ref:r,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",t),"toast-close":"",...e,children:i.jsx(Iu,{className:"h-4 w-4"})}));V1.displayName=k1.displayName;const q1=x.forwardRef(({className:t,...e},r)=>i.jsx(_1,{ref:r,className:Te("text-sm font-semibold",t),...e}));q1.displayName=_1.displayName;const H1=x.forwardRef(({className:t,...e},r)=>i.jsx(E1,{ref:r,className:Te("text-sm opacity-90",t),...e}));H1.displayName=E1.displayName;function cR(){const{toasts:t}=or();return i.jsxs(oR,{children:[t.map(function({id:e,title:r,description:s,action:n,...a}){return i.jsxs(z1,{...a,children:[i.jsxs("div",{className:"grid gap-1",children:[r&&i.jsx(q1,{children:r}),s&&i.jsx(H1,{children:s})]}),n,i.jsx(V1,{})]},e)}),i.jsx(U1,{})]})}var uR=bm[" useId ".trim().toString()]||(()=>{}),dR=0;function ea(t){const[e,r]=x.useState(uR());return Bt(()=>{r(s=>s??String(dR++))},[t]),e?`radix-${e}`:""}const fR=["top","right","bottom","left"],aa=Math.min,Sr=Math.max,Du=Math.round,kc=Math.floor,jn=t=>({x:t,y:t}),hR={left:"right",right:"left",bottom:"top",top:"bottom"},pR={start:"end",end:"start"};function yp(t,e,r){return Sr(t,aa(e,r))}function is(t,e){return typeof t=="function"?t(e):t}function ls(t){return t.split("-")[0]}function _i(t){return t.split("-")[1]}function Cv(t){return t==="x"?"y":"x"}function kv(t){return t==="y"?"height":"width"}const mR=new Set(["top","bottom"]);function Cn(t){return mR.has(ls(t))?"y":"x"}function Pv(t){return Cv(Cn(t))}function vR(t,e,r){r===void 0&&(r=!1);const s=_i(t),n=Pv(t),a=kv(n);let o=n==="x"?s===(r?"end":"start")?"right":"left":s==="start"?"bottom":"top";return e.reference[a]>e.floating[a]&&(o=Mu(o)),[o,Mu(o)]}function gR(t){const e=Mu(t);return[xp(t),e,xp(e)]}function xp(t){return t.replace(/start|end/g,e=>pR[e])}const o0=["left","right"],i0=["right","left"],yR=["top","bottom"],xR=["bottom","top"];function wR(t,e,r){switch(t){case"top":case"bottom":return r?e?i0:o0:e?o0:i0;case"left":case"right":return e?yR:xR;default:return[]}}function bR(t,e,r,s){const n=_i(t);let a=wR(ls(t),r==="start",s);return n&&(a=a.map(o=>o+"-"+n),e&&(a=a.concat(a.map(xp)))),a}function Mu(t){return t.replace(/left|right|bottom|top/g,e=>hR[e])}function SR(t){return{top:0,right:0,bottom:0,left:0,...t}}function B1(t){return typeof t!="number"?SR(t):{top:t,right:t,bottom:t,left:t}}function $u(t){const{x:e,y:r,width:s,height:n}=t;return{width:s,height:n,top:r,left:e,right:e+s,bottom:r+n,x:e,y:r}}function l0(t,e,r){let{reference:s,floating:n}=t;const a=Cn(e),o=Pv(e),l=kv(o),c=ls(e),u=a==="y",d=s.x+s.width/2-n.width/2,f=s.y+s.height/2-n.height/2,m=s[l]/2-n[l]/2;let p;switch(c){case"top":p={x:d,y:s.y-n.height};break;case"bottom":p={x:d,y:s.y+s.height};break;case"right":p={x:s.x+s.width,y:f};break;case"left":p={x:s.x-n.width,y:f};break;default:p={x:s.x,y:s.y}}switch(_i(e)){case"start":p[o]-=m*(r&&u?-1:1);break;case"end":p[o]+=m*(r&&u?-1:1);break}return p}const _R=async(t,e,r)=>{const{placement:s="bottom",strategy:n="absolute",middleware:a=[],platform:o}=r,l=a.filter(Boolean),c=await(o.isRTL==null?void 0:o.isRTL(e));let u=await o.getElementRects({reference:t,floating:e,strategy:n}),{x:d,y:f}=l0(u,s,c),m=s,p={},w=0;for(let h=0;h<l.length;h++){const{name:g,fn:v}=l[h],{x:y,y:b,data:S,reset:E}=await v({x:d,y:f,initialPlacement:s,placement:m,strategy:n,middlewareData:p,rects:u,platform:o,elements:{reference:t,floating:e}});d=y??d,f=b??f,p={...p,[g]:{...p[g],...S}},E&&w<=50&&(w++,typeof E=="object"&&(E.placement&&(m=E.placement),E.rects&&(u=E.rects===!0?await o.getElementRects({reference:t,floating:e,strategy:n}):E.rects),{x:d,y:f}=l0(u,m,c)),h=-1)}return{x:d,y:f,placement:m,strategy:n,middlewareData:p}};async function Nl(t,e){var r;e===void 0&&(e={});const{x:s,y:n,platform:a,rects:o,elements:l,strategy:c}=t,{boundary:u="clippingAncestors",rootBoundary:d="viewport",elementContext:f="floating",altBoundary:m=!1,padding:p=0}=is(e,t),w=B1(p),g=l[m?f==="floating"?"reference":"floating":f],v=$u(await a.getClippingRect({element:(r=await(a.isElement==null?void 0:a.isElement(g)))==null||r?g:g.contextElement||await(a.getDocumentElement==null?void 0:a.getDocumentElement(l.floating)),boundary:u,rootBoundary:d,strategy:c})),y=f==="floating"?{x:s,y:n,width:o.floating.width,height:o.floating.height}:o.reference,b=await(a.getOffsetParent==null?void 0:a.getOffsetParent(l.floating)),S=await(a.isElement==null?void 0:a.isElement(b))?await(a.getScale==null?void 0:a.getScale(b))||{x:1,y:1}:{x:1,y:1},E=$u(a.convertOffsetParentRelativeRectToViewportRelativeRect?await a.convertOffsetParentRelativeRectToViewportRelativeRect({elements:l,rect:y,offsetParent:b,strategy:c}):y);return{top:(v.top-E.top+w.top)/S.y,bottom:(E.bottom-v.bottom+w.bottom)/S.y,left:(v.left-E.left+w.left)/S.x,right:(E.right-v.right+w.right)/S.x}}const ER=t=>({name:"arrow",options:t,async fn(e){const{x:r,y:s,placement:n,rects:a,platform:o,elements:l,middlewareData:c}=e,{element:u,padding:d=0}=is(t,e)||{};if(u==null)return{};const f=B1(d),m={x:r,y:s},p=Pv(n),w=kv(p),h=await o.getDimensions(u),g=p==="y",v=g?"top":"left",y=g?"bottom":"right",b=g?"clientHeight":"clientWidth",S=a.reference[w]+a.reference[p]-m[p]-a.floating[w],E=m[p]-a.reference[p],k=await(o.getOffsetParent==null?void 0:o.getOffsetParent(u));let R=k?k[b]:0;(!R||!await(o.isElement==null?void 0:o.isElement(k)))&&(R=l.floating[b]||a.floating[w]);const T=S/2-E/2,N=R/2-h[w]/2-1,O=aa(f[v],N),j=aa(f[y],N),_=O,A=R-h[w]-j,C=R/2-h[w]/2+T,z=yp(_,C,A),U=!c.arrow&&_i(n)!=null&&C!==z&&a.reference[w]/2-(C<_?O:j)-h[w]/2<0,K=U?C<_?C-_:C-A:0;return{[p]:m[p]+K,data:{[p]:z,centerOffset:C-z-K,...U&&{alignmentOffset:K}},reset:U}}}),CR=function(t){return t===void 0&&(t={}),{name:"flip",options:t,async fn(e){var r,s;const{placement:n,middlewareData:a,rects:o,initialPlacement:l,platform:c,elements:u}=e,{mainAxis:d=!0,crossAxis:f=!0,fallbackPlacements:m,fallbackStrategy:p="bestFit",fallbackAxisSideDirection:w="none",flipAlignment:h=!0,...g}=is(t,e);if((r=a.arrow)!=null&&r.alignmentOffset)return{};const v=ls(n),y=Cn(l),b=ls(l)===l,S=await(c.isRTL==null?void 0:c.isRTL(u.floating)),E=m||(b||!h?[Mu(l)]:gR(l)),k=w!=="none";!m&&k&&E.push(...bR(l,h,w,S));const R=[l,...E],T=await Nl(e,g),N=[];let O=((s=a.flip)==null?void 0:s.overflows)||[];if(d&&N.push(T[v]),f){const C=vR(n,o,S);N.push(T[C[0]],T[C[1]])}if(O=[...O,{placement:n,overflows:N}],!N.every(C=>C<=0)){var j,_;const C=(((j=a.flip)==null?void 0:j.index)||0)+1,z=R[C];if(z&&(!(f==="alignment"?y!==Cn(z):!1)||O.every($=>Cn($.placement)===y?$.overflows[0]>0:!0)))return{data:{index:C,overflows:O},reset:{placement:z}};let U=(_=O.filter(K=>K.overflows[0]<=0).sort((K,$)=>K.overflows[1]-$.overflows[1])[0])==null?void 0:_.placement;if(!U)switch(p){case"bestFit":{var A;const K=(A=O.filter($=>{if(k){const F=Cn($.placement);return F===y||F==="y"}return!0}).map($=>[$.placement,$.overflows.filter(F=>F>0).reduce((F,V)=>F+V,0)]).sort(($,F)=>$[1]-F[1])[0])==null?void 0:A[0];K&&(U=K);break}case"initialPlacement":U=l;break}if(n!==U)return{reset:{placement:U}}}return{}}}};function c0(t,e){return{top:t.top-e.height,right:t.right-e.width,bottom:t.bottom-e.height,left:t.left-e.width}}function u0(t){return fR.some(e=>t[e]>=0)}const kR=function(t){return t===void 0&&(t={}),{name:"hide",options:t,async fn(e){const{rects:r}=e,{strategy:s="referenceHidden",...n}=is(t,e);switch(s){case"referenceHidden":{const a=await Nl(e,{...n,elementContext:"reference"}),o=c0(a,r.reference);return{data:{referenceHiddenOffsets:o,referenceHidden:u0(o)}}}case"escaped":{const a=await Nl(e,{...n,altBoundary:!0}),o=c0(a,r.floating);return{data:{escapedOffsets:o,escaped:u0(o)}}}default:return{}}}}},W1=new Set(["left","top"]);async function PR(t,e){const{placement:r,platform:s,elements:n}=t,a=await(s.isRTL==null?void 0:s.isRTL(n.floating)),o=ls(r),l=_i(r),c=Cn(r)==="y",u=W1.has(o)?-1:1,d=a&&c?-1:1,f=is(e,t);let{mainAxis:m,crossAxis:p,alignmentAxis:w}=typeof f=="number"?{mainAxis:f,crossAxis:0,alignmentAxis:null}:{mainAxis:f.mainAxis||0,crossAxis:f.crossAxis||0,alignmentAxis:f.alignmentAxis};return l&&typeof w=="number"&&(p=l==="end"?w*-1:w),c?{x:p*d,y:m*u}:{x:m*u,y:p*d}}const NR=function(t){return t===void 0&&(t=0),{name:"offset",options:t,async fn(e){var r,s;const{x:n,y:a,placement:o,middlewareData:l}=e,c=await PR(e,t);return o===((r=l.offset)==null?void 0:r.placement)&&(s=l.arrow)!=null&&s.alignmentOffset?{}:{x:n+c.x,y:a+c.y,data:{...c,placement:o}}}}},jR=function(t){return t===void 0&&(t={}),{name:"shift",options:t,async fn(e){const{x:r,y:s,placement:n}=e,{mainAxis:a=!0,crossAxis:o=!1,limiter:l={fn:g=>{let{x:v,y}=g;return{x:v,y}}},...c}=is(t,e),u={x:r,y:s},d=await Nl(e,c),f=Cn(ls(n)),m=Cv(f);let p=u[m],w=u[f];if(a){const g=m==="y"?"top":"left",v=m==="y"?"bottom":"right",y=p+d[g],b=p-d[v];p=yp(y,p,b)}if(o){const g=f==="y"?"top":"left",v=f==="y"?"bottom":"right",y=w+d[g],b=w-d[v];w=yp(y,w,b)}const h=l.fn({...e,[m]:p,[f]:w});return{...h,data:{x:h.x-r,y:h.y-s,enabled:{[m]:a,[f]:o}}}}}},RR=function(t){return t===void 0&&(t={}),{options:t,fn(e){const{x:r,y:s,placement:n,rects:a,middlewareData:o}=e,{offset:l=0,mainAxis:c=!0,crossAxis:u=!0}=is(t,e),d={x:r,y:s},f=Cn(n),m=Cv(f);let p=d[m],w=d[f];const h=is(l,e),g=typeof h=="number"?{mainAxis:h,crossAxis:0}:{mainAxis:0,crossAxis:0,...h};if(c){const b=m==="y"?"height":"width",S=a.reference[m]-a.floating[b]+g.mainAxis,E=a.reference[m]+a.reference[b]-g.mainAxis;p<S?p=S:p>E&&(p=E)}if(u){var v,y;const b=m==="y"?"width":"height",S=W1.has(ls(n)),E=a.reference[f]-a.floating[b]+(S&&((v=o.offset)==null?void 0:v[f])||0)+(S?0:g.crossAxis),k=a.reference[f]+a.reference[b]+(S?0:((y=o.offset)==null?void 0:y[f])||0)-(S?g.crossAxis:0);w<E?w=E:w>k&&(w=k)}return{[m]:p,[f]:w}}}},TR=function(t){return t===void 0&&(t={}),{name:"size",options:t,async fn(e){var r,s;const{placement:n,rects:a,platform:o,elements:l}=e,{apply:c=()=>{},...u}=is(t,e),d=await Nl(e,u),f=ls(n),m=_i(n),p=Cn(n)==="y",{width:w,height:h}=a.floating;let g,v;f==="top"||f==="bottom"?(g=f,v=m===(await(o.isRTL==null?void 0:o.isRTL(l.floating))?"start":"end")?"left":"right"):(v=f,g=m==="end"?"top":"bottom");const y=h-d.top-d.bottom,b=w-d.left-d.right,S=aa(h-d[g],y),E=aa(w-d[v],b),k=!e.middlewareData.shift;let R=S,T=E;if((r=e.middlewareData.shift)!=null&&r.enabled.x&&(T=b),(s=e.middlewareData.shift)!=null&&s.enabled.y&&(R=y),k&&!m){const O=Sr(d.left,0),j=Sr(d.right,0),_=Sr(d.top,0),A=Sr(d.bottom,0);p?T=w-2*(O!==0||j!==0?O+j:Sr(d.left,d.right)):R=h-2*(_!==0||A!==0?_+A:Sr(d.top,d.bottom))}await c({...e,availableWidth:T,availableHeight:R});const N=await o.getDimensions(l.floating);return w!==N.width||h!==N.height?{reset:{rects:!0}}:{}}}};function Td(){return typeof window<"u"}function Ei(t){return K1(t)?(t.nodeName||"").toLowerCase():"#document"}function Cr(t){var e;return(t==null||(e=t.ownerDocument)==null?void 0:e.defaultView)||window}function On(t){var e;return(e=(K1(t)?t.ownerDocument:t.document)||window.document)==null?void 0:e.documentElement}function K1(t){return Td()?t instanceof Node||t instanceof Cr(t).Node:!1}function on(t){return Td()?t instanceof Element||t instanceof Cr(t).Element:!1}function Tn(t){return Td()?t instanceof HTMLElement||t instanceof Cr(t).HTMLElement:!1}function d0(t){return!Td()||typeof ShadowRoot>"u"?!1:t instanceof ShadowRoot||t instanceof Cr(t).ShadowRoot}const AR=new Set(["inline","contents"]);function Hl(t){const{overflow:e,overflowX:r,overflowY:s,display:n}=ln(t);return/auto|scroll|overlay|hidden|clip/.test(e+s+r)&&!AR.has(n)}const OR=new Set(["table","td","th"]);function IR(t){return OR.has(Ei(t))}const DR=[":popover-open",":modal"];function Ad(t){return DR.some(e=>{try{return t.matches(e)}catch{return!1}})}const MR=["transform","translate","scale","rotate","perspective"],$R=["transform","translate","scale","rotate","perspective","filter"],FR=["paint","layout","strict","content"];function Nv(t){const e=jv(),r=on(t)?ln(t):t;return MR.some(s=>r[s]?r[s]!=="none":!1)||(r.containerType?r.containerType!=="normal":!1)||!e&&(r.backdropFilter?r.backdropFilter!=="none":!1)||!e&&(r.filter?r.filter!=="none":!1)||$R.some(s=>(r.willChange||"").includes(s))||FR.some(s=>(r.contain||"").includes(s))}function LR(t){let e=oa(t);for(;Tn(e)&&!hi(e);){if(Nv(e))return e;if(Ad(e))return null;e=oa(e)}return null}function jv(){return typeof CSS>"u"||!CSS.supports?!1:CSS.supports("-webkit-backdrop-filter","none")}const UR=new Set(["html","body","#document"]);function hi(t){return UR.has(Ei(t))}function ln(t){return Cr(t).getComputedStyle(t)}function Od(t){return on(t)?{scrollLeft:t.scrollLeft,scrollTop:t.scrollTop}:{scrollLeft:t.scrollX,scrollTop:t.scrollY}}function oa(t){if(Ei(t)==="html")return t;const e=t.assignedSlot||t.parentNode||d0(t)&&t.host||On(t);return d0(e)?e.host:e}function Q1(t){const e=oa(t);return hi(e)?t.ownerDocument?t.ownerDocument.body:t.body:Tn(e)&&Hl(e)?e:Q1(e)}function jl(t,e,r){var s;e===void 0&&(e=[]),r===void 0&&(r=!0);const n=Q1(t),a=n===((s=t.ownerDocument)==null?void 0:s.body),o=Cr(n);if(a){const l=wp(o);return e.concat(o,o.visualViewport||[],Hl(n)?n:[],l&&r?jl(l):[])}return e.concat(n,jl(n,[],r))}function wp(t){return t.parent&&Object.getPrototypeOf(t.parent)?t.frameElement:null}function G1(t){const e=ln(t);let r=parseFloat(e.width)||0,s=parseFloat(e.height)||0;const n=Tn(t),a=n?t.offsetWidth:r,o=n?t.offsetHeight:s,l=Du(r)!==a||Du(s)!==o;return l&&(r=a,s=o),{width:r,height:s,$:l}}function Rv(t){return on(t)?t:t.contextElement}function zo(t){const e=Rv(t);if(!Tn(e))return jn(1);const r=e.getBoundingClientRect(),{width:s,height:n,$:a}=G1(e);let o=(a?Du(r.width):r.width)/s,l=(a?Du(r.height):r.height)/n;return(!o||!Number.isFinite(o))&&(o=1),(!l||!Number.isFinite(l))&&(l=1),{x:o,y:l}}const zR=jn(0);function Z1(t){const e=Cr(t);return!jv()||!e.visualViewport?zR:{x:e.visualViewport.offsetLeft,y:e.visualViewport.offsetTop}}function VR(t,e,r){return e===void 0&&(e=!1),!r||e&&r!==Cr(t)?!1:e}function Qa(t,e,r,s){e===void 0&&(e=!1),r===void 0&&(r=!1);const n=t.getBoundingClientRect(),a=Rv(t);let o=jn(1);e&&(s?on(s)&&(o=zo(s)):o=zo(t));const l=VR(a,r,s)?Z1(a):jn(0);let c=(n.left+l.x)/o.x,u=(n.top+l.y)/o.y,d=n.width/o.x,f=n.height/o.y;if(a){const m=Cr(a),p=s&&on(s)?Cr(s):s;let w=m,h=wp(w);for(;h&&s&&p!==w;){const g=zo(h),v=h.getBoundingClientRect(),y=ln(h),b=v.left+(h.clientLeft+parseFloat(y.paddingLeft))*g.x,S=v.top+(h.clientTop+parseFloat(y.paddingTop))*g.y;c*=g.x,u*=g.y,d*=g.x,f*=g.y,c+=b,u+=S,w=Cr(h),h=wp(w)}}return $u({width:d,height:f,x:c,y:u})}function Id(t,e){const r=Od(t).scrollLeft;return e?e.left+r:Qa(On(t)).left+r}function Y1(t,e){const r=t.getBoundingClientRect(),s=r.left+e.scrollLeft-Id(t,r),n=r.top+e.scrollTop;return{x:s,y:n}}function qR(t){let{elements:e,rect:r,offsetParent:s,strategy:n}=t;const a=n==="fixed",o=On(s),l=e?Ad(e.floating):!1;if(s===o||l&&a)return r;let c={scrollLeft:0,scrollTop:0},u=jn(1);const d=jn(0),f=Tn(s);if((f||!f&&!a)&&((Ei(s)!=="body"||Hl(o))&&(c=Od(s)),Tn(s))){const p=Qa(s);u=zo(s),d.x=p.x+s.clientLeft,d.y=p.y+s.clientTop}const m=o&&!f&&!a?Y1(o,c):jn(0);return{width:r.width*u.x,height:r.height*u.y,x:r.x*u.x-c.scrollLeft*u.x+d.x+m.x,y:r.y*u.y-c.scrollTop*u.y+d.y+m.y}}function HR(t){return Array.from(t.getClientRects())}function BR(t){const e=On(t),r=Od(t),s=t.ownerDocument.body,n=Sr(e.scrollWidth,e.clientWidth,s.scrollWidth,s.clientWidth),a=Sr(e.scrollHeight,e.clientHeight,s.scrollHeight,s.clientHeight);let o=-r.scrollLeft+Id(t);const l=-r.scrollTop;return ln(s).direction==="rtl"&&(o+=Sr(e.clientWidth,s.clientWidth)-n),{width:n,height:a,x:o,y:l}}const f0=25;function WR(t,e){const r=Cr(t),s=On(t),n=r.visualViewport;let a=s.clientWidth,o=s.clientHeight,l=0,c=0;if(n){a=n.width,o=n.height;const d=jv();(!d||d&&e==="fixed")&&(l=n.offsetLeft,c=n.offsetTop)}const u=Id(s);if(u<=0){const d=s.ownerDocument,f=d.body,m=getComputedStyle(f),p=d.compatMode==="CSS1Compat"&&parseFloat(m.marginLeft)+parseFloat(m.marginRight)||0,w=Math.abs(s.clientWidth-f.clientWidth-p);w<=f0&&(a-=w)}else u<=f0&&(a+=u);return{width:a,height:o,x:l,y:c}}const KR=new Set(["absolute","fixed"]);function QR(t,e){const r=Qa(t,!0,e==="fixed"),s=r.top+t.clientTop,n=r.left+t.clientLeft,a=Tn(t)?zo(t):jn(1),o=t.clientWidth*a.x,l=t.clientHeight*a.y,c=n*a.x,u=s*a.y;return{width:o,height:l,x:c,y:u}}function h0(t,e,r){let s;if(e==="viewport")s=WR(t,r);else if(e==="document")s=BR(On(t));else if(on(e))s=QR(e,r);else{const n=Z1(t);s={x:e.x-n.x,y:e.y-n.y,width:e.width,height:e.height}}return $u(s)}function J1(t,e){const r=oa(t);return r===e||!on(r)||hi(r)?!1:ln(r).position==="fixed"||J1(r,e)}function GR(t,e){const r=e.get(t);if(r)return r;let s=jl(t,[],!1).filter(l=>on(l)&&Ei(l)!=="body"),n=null;const a=ln(t).position==="fixed";let o=a?oa(t):t;for(;on(o)&&!hi(o);){const l=ln(o),c=Nv(o);!c&&l.position==="fixed"&&(n=null),(a?!c&&!n:!c&&l.position==="static"&&!!n&&KR.has(n.position)||Hl(o)&&!c&&J1(t,o))?s=s.filter(d=>d!==o):n=l,o=oa(o)}return e.set(t,s),s}function ZR(t){let{element:e,boundary:r,rootBoundary:s,strategy:n}=t;const o=[...r==="clippingAncestors"?Ad(e)?[]:GR(e,this._c):[].concat(r),s],l=o[0],c=o.reduce((u,d)=>{const f=h0(e,d,n);return u.top=Sr(f.top,u.top),u.right=aa(f.right,u.right),u.bottom=aa(f.bottom,u.bottom),u.left=Sr(f.left,u.left),u},h0(e,l,n));return{width:c.right-c.left,height:c.bottom-c.top,x:c.left,y:c.top}}function YR(t){const{width:e,height:r}=G1(t);return{width:e,height:r}}function JR(t,e,r){const s=Tn(e),n=On(e),a=r==="fixed",o=Qa(t,!0,a,e);let l={scrollLeft:0,scrollTop:0};const c=jn(0);function u(){c.x=Id(n)}if(s||!s&&!a)if((Ei(e)!=="body"||Hl(n))&&(l=Od(e)),s){const p=Qa(e,!0,a,e);c.x=p.x+e.clientLeft,c.y=p.y+e.clientTop}else n&&u();a&&!s&&n&&u();const d=n&&!s&&!a?Y1(n,l):jn(0),f=o.left+l.scrollLeft-c.x-d.x,m=o.top+l.scrollTop-c.y-d.y;return{x:f,y:m,width:o.width,height:o.height}}function $f(t){return ln(t).position==="static"}function p0(t,e){if(!Tn(t)||ln(t).position==="fixed")return null;if(e)return e(t);let r=t.offsetParent;return On(t)===r&&(r=r.ownerDocument.body),r}function X1(t,e){const r=Cr(t);if(Ad(t))return r;if(!Tn(t)){let n=oa(t);for(;n&&!hi(n);){if(on(n)&&!$f(n))return n;n=oa(n)}return r}let s=p0(t,e);for(;s&&IR(s)&&$f(s);)s=p0(s,e);return s&&hi(s)&&$f(s)&&!Nv(s)?r:s||LR(t)||r}const XR=async function(t){const e=this.getOffsetParent||X1,r=this.getDimensions,s=await r(t.floating);return{reference:JR(t.reference,await e(t.floating),t.strategy),floating:{x:0,y:0,width:s.width,height:s.height}}};function eT(t){return ln(t).direction==="rtl"}const tT={convertOffsetParentRelativeRectToViewportRelativeRect:qR,getDocumentElement:On,getClippingRect:ZR,getOffsetParent:X1,getElementRects:XR,getClientRects:HR,getDimensions:YR,getScale:zo,isElement:on,isRTL:eT};function eS(t,e){return t.x===e.x&&t.y===e.y&&t.width===e.width&&t.height===e.height}function rT(t,e){let r=null,s;const n=On(t);function a(){var l;clearTimeout(s),(l=r)==null||l.disconnect(),r=null}function o(l,c){l===void 0&&(l=!1),c===void 0&&(c=1),a();const u=t.getBoundingClientRect(),{left:d,top:f,width:m,height:p}=u;if(l||e(),!m||!p)return;const w=kc(f),h=kc(n.clientWidth-(d+m)),g=kc(n.clientHeight-(f+p)),v=kc(d),b={rootMargin:-w+"px "+-h+"px "+-g+"px "+-v+"px",threshold:Sr(0,aa(1,c))||1};let S=!0;function E(k){const R=k[0].intersectionRatio;if(R!==c){if(!S)return o();R?o(!1,R):s=setTimeout(()=>{o(!1,1e-7)},1e3)}R===1&&!eS(u,t.getBoundingClientRect())&&o(),S=!1}try{r=new IntersectionObserver(E,{...b,root:n.ownerDocument})}catch{r=new IntersectionObserver(E,b)}r.observe(t)}return o(!0),a}function nT(t,e,r,s){s===void 0&&(s={});const{ancestorScroll:n=!0,ancestorResize:a=!0,elementResize:o=typeof ResizeObserver=="function",layoutShift:l=typeof IntersectionObserver=="function",animationFrame:c=!1}=s,u=Rv(t),d=n||a?[...u?jl(u):[],...jl(e)]:[];d.forEach(v=>{n&&v.addEventListener("scroll",r,{passive:!0}),a&&v.addEventListener("resize",r)});const f=u&&l?rT(u,r):null;let m=-1,p=null;o&&(p=new ResizeObserver(v=>{let[y]=v;y&&y.target===u&&p&&(p.unobserve(e),cancelAnimationFrame(m),m=requestAnimationFrame(()=>{var b;(b=p)==null||b.observe(e)})),r()}),u&&!c&&p.observe(u),p.observe(e));let w,h=c?Qa(t):null;c&&g();function g(){const v=Qa(t);h&&!eS(h,v)&&r(),h=v,w=requestAnimationFrame(g)}return r(),()=>{var v;d.forEach(y=>{n&&y.removeEventListener("scroll",r),a&&y.removeEventListener("resize",r)}),f==null||f(),(v=p)==null||v.disconnect(),p=null,c&&cancelAnimationFrame(w)}}const sT=NR,aT=jR,oT=CR,iT=TR,lT=kR,m0=ER,cT=RR,uT=(t,e,r)=>{const s=new Map,n={platform:tT,...r},a={...n.platform,_c:s};return _R(t,e,{...n,platform:a})};var dT=typeof document<"u",fT=function(){},Yc=dT?x.useLayoutEffect:fT;function Fu(t,e){if(t===e)return!0;if(typeof t!=typeof e)return!1;if(typeof t=="function"&&t.toString()===e.toString())return!0;let r,s,n;if(t&&e&&typeof t=="object"){if(Array.isArray(t)){if(r=t.length,r!==e.length)return!1;for(s=r;s--!==0;)if(!Fu(t[s],e[s]))return!1;return!0}if(n=Object.keys(t),r=n.length,r!==Object.keys(e).length)return!1;for(s=r;s--!==0;)if(!{}.hasOwnProperty.call(e,n[s]))return!1;for(s=r;s--!==0;){const a=n[s];if(!(a==="_owner"&&t.$$typeof)&&!Fu(t[a],e[a]))return!1}return!0}return t!==t&&e!==e}function tS(t){return typeof window>"u"?1:(t.ownerDocument.defaultView||window).devicePixelRatio||1}function v0(t,e){const r=tS(t);return Math.round(e*r)/r}function Ff(t){const e=x.useRef(t);return Yc(()=>{e.current=t}),e}function hT(t){t===void 0&&(t={});const{placement:e="bottom",strategy:r="absolute",middleware:s=[],platform:n,elements:{reference:a,floating:o}={},transform:l=!0,whileElementsMounted:c,open:u}=t,[d,f]=x.useState({x:0,y:0,strategy:r,placement:e,middlewareData:{},isPositioned:!1}),[m,p]=x.useState(s);Fu(m,s)||p(s);const[w,h]=x.useState(null),[g,v]=x.useState(null),y=x.useCallback($=>{$!==k.current&&(k.current=$,h($))},[]),b=x.useCallback($=>{$!==R.current&&(R.current=$,v($))},[]),S=a||w,E=o||g,k=x.useRef(null),R=x.useRef(null),T=x.useRef(d),N=c!=null,O=Ff(c),j=Ff(n),_=Ff(u),A=x.useCallback(()=>{if(!k.current||!R.current)return;const $={placement:e,strategy:r,middleware:m};j.current&&($.platform=j.current),uT(k.current,R.current,$).then(F=>{const V={...F,isPositioned:_.current!==!1};C.current&&!Fu(T.current,V)&&(T.current=V,so.flushSync(()=>{f(V)}))})},[m,e,r,j,_]);Yc(()=>{u===!1&&T.current.isPositioned&&(T.current.isPositioned=!1,f($=>({...$,isPositioned:!1})))},[u]);const C=x.useRef(!1);Yc(()=>(C.current=!0,()=>{C.current=!1}),[]),Yc(()=>{if(S&&(k.current=S),E&&(R.current=E),S&&E){if(O.current)return O.current(S,E,A);A()}},[S,E,A,O,N]);const z=x.useMemo(()=>({reference:k,floating:R,setReference:y,setFloating:b}),[y,b]),U=x.useMemo(()=>({reference:S,floating:E}),[S,E]),K=x.useMemo(()=>{const $={position:r,left:0,top:0};if(!U.floating)return $;const F=v0(U.floating,d.x),V=v0(U.floating,d.y);return l?{...$,transform:"translate("+F+"px, "+V+"px)",...tS(U.floating)>=1.5&&{willChange:"transform"}}:{position:r,left:F,top:V}},[r,l,U.floating,d.x,d.y]);return x.useMemo(()=>({...d,update:A,refs:z,elements:U,floatingStyles:K}),[d,A,z,U,K])}const pT=t=>{function e(r){return{}.hasOwnProperty.call(r,"current")}return{name:"arrow",options:t,fn(r){const{element:s,padding:n}=typeof t=="function"?t(r):t;return s&&e(s)?s.current!=null?m0({element:s.current,padding:n}).fn(r):{}:s?m0({element:s,padding:n}).fn(r):{}}}},mT=(t,e)=>({...sT(t),options:[t,e]}),vT=(t,e)=>({...aT(t),options:[t,e]}),gT=(t,e)=>({...cT(t),options:[t,e]}),yT=(t,e)=>({...oT(t),options:[t,e]}),xT=(t,e)=>({...iT(t),options:[t,e]}),wT=(t,e)=>({...lT(t),options:[t,e]}),bT=(t,e)=>({...pT(t),options:[t,e]});var ST="Arrow",rS=x.forwardRef((t,e)=>{const{children:r,width:s=10,height:n=5,...a}=t;return i.jsx(Ae.svg,{...a,ref:e,width:s,height:n,viewBox:"0 0 30 10",preserveAspectRatio:"none",children:t.asChild?r:i.jsx("polygon",{points:"0,0 30,0 15,10"})})});rS.displayName=ST;var _T=rS;function nS(t){const[e,r]=x.useState(void 0);return Bt(()=>{if(t){r({width:t.offsetWidth,height:t.offsetHeight});const s=new ResizeObserver(n=>{if(!Array.isArray(n)||!n.length)return;const a=n[0];let o,l;if("borderBoxSize"in a){const c=a.borderBoxSize,u=Array.isArray(c)?c[0]:c;o=u.inlineSize,l=u.blockSize}else o=t.offsetWidth,l=t.offsetHeight;r({width:o,height:l})});return s.observe(t,{box:"border-box"}),()=>s.unobserve(t)}else r(void 0)},[t]),e}var Tv="Popper",[sS,Dd]=fs(Tv),[ET,aS]=sS(Tv),oS=t=>{const{__scopePopper:e,children:r}=t,[s,n]=x.useState(null);return i.jsx(ET,{scope:e,anchor:s,onAnchorChange:n,children:r})};oS.displayName=Tv;var iS="PopperAnchor",lS=x.forwardRef((t,e)=>{const{__scopePopper:r,virtualRef:s,...n}=t,a=aS(iS,r),o=x.useRef(null),l=et(e,o),c=x.useRef(null);return x.useEffect(()=>{const u=c.current;c.current=(s==null?void 0:s.current)||o.current,u!==c.current&&a.onAnchorChange(c.current)}),s?null:i.jsx(Ae.div,{...n,ref:l})});lS.displayName=iS;var Av="PopperContent",[CT,kT]=sS(Av),cS=x.forwardRef((t,e)=>{var Z,ce,Ee,ve,te,we;const{__scopePopper:r,side:s="bottom",sideOffset:n=0,align:a="center",alignOffset:o=0,arrowPadding:l=0,avoidCollisions:c=!0,collisionBoundary:u=[],collisionPadding:d=0,sticky:f="partial",hideWhenDetached:m=!1,updatePositionStrategy:p="optimized",onPlaced:w,...h}=t,g=aS(Av,r),[v,y]=x.useState(null),b=et(e,Pe=>y(Pe)),[S,E]=x.useState(null),k=nS(S),R=(k==null?void 0:k.width)??0,T=(k==null?void 0:k.height)??0,N=s+(a!=="center"?"-"+a:""),O=typeof d=="number"?d:{top:0,right:0,bottom:0,left:0,...d},j=Array.isArray(u)?u:[u],_=j.length>0,A={padding:O,boundary:j.filter(NT),altBoundary:_},{refs:C,floatingStyles:z,placement:U,isPositioned:K,middlewareData:$}=hT({strategy:"fixed",placement:N,whileElementsMounted:(...Pe)=>nT(...Pe,{animationFrame:p==="always"}),elements:{reference:g.anchor},middleware:[mT({mainAxis:n+T,alignmentAxis:o}),c&&vT({mainAxis:!0,crossAxis:!1,limiter:f==="partial"?gT():void 0,...A}),c&&yT({...A}),xT({...A,apply:({elements:Pe,rects:De,availableWidth:ee,availableHeight:fe})=>{const{width:X,height:ze}=De.reference,re=Pe.floating.style;re.setProperty("--radix-popper-available-width",`${ee}px`),re.setProperty("--radix-popper-available-height",`${fe}px`),re.setProperty("--radix-popper-anchor-width",`${X}px`),re.setProperty("--radix-popper-anchor-height",`${ze}px`)}}),S&&bT({element:S,padding:l}),jT({arrowWidth:R,arrowHeight:T}),m&&wT({strategy:"referenceHidden",...A})]}),[F,V]=fS(U),ae=Ur(w);Bt(()=>{K&&(ae==null||ae())},[K,ae]);const se=(Z=$.arrow)==null?void 0:Z.x,W=(ce=$.arrow)==null?void 0:ce.y,L=((Ee=$.arrow)==null?void 0:Ee.centerOffset)!==0,[Q,oe]=x.useState();return Bt(()=>{v&&oe(window.getComputedStyle(v).zIndex)},[v]),i.jsx("div",{ref:C.setFloating,"data-radix-popper-content-wrapper":"",style:{...z,transform:K?z.transform:"translate(0, -200%)",minWidth:"max-content",zIndex:Q,"--radix-popper-transform-origin":[(ve=$.transformOrigin)==null?void 0:ve.x,(te=$.transformOrigin)==null?void 0:te.y].join(" "),...((we=$.hide)==null?void 0:we.referenceHidden)&&{visibility:"hidden",pointerEvents:"none"}},dir:t.dir,children:i.jsx(CT,{scope:r,placedSide:F,onArrowChange:E,arrowX:se,arrowY:W,shouldHideArrow:L,children:i.jsx(Ae.div,{"data-side":F,"data-align":V,...h,ref:b,style:{...h.style,animation:K?void 0:"none"}})})})});cS.displayName=Av;var uS="PopperArrow",PT={top:"bottom",right:"left",bottom:"top",left:"right"},dS=x.forwardRef(function(e,r){const{__scopePopper:s,...n}=e,a=kT(uS,s),o=PT[a.placedSide];return i.jsx("span",{ref:a.onArrowChange,style:{position:"absolute",left:a.arrowX,top:a.arrowY,[o]:0,transformOrigin:{top:"",right:"0 0",bottom:"center 0",left:"100% 0"}[a.placedSide],transform:{top:"translateY(100%)",right:"translateY(50%) rotate(90deg) translateX(-50%)",bottom:"rotate(180deg)",left:"translateY(50%) rotate(-90deg) translateX(50%)"}[a.placedSide],visibility:a.shouldHideArrow?"hidden":void 0},children:i.jsx(_T,{...n,ref:r,style:{...n.style,display:"block"}})})});dS.displayName=uS;function NT(t){return t!==null}var jT=t=>({name:"transformOrigin",options:t,fn(e){var g,v,y;const{placement:r,rects:s,middlewareData:n}=e,o=((g=n.arrow)==null?void 0:g.centerOffset)!==0,l=o?0:t.arrowWidth,c=o?0:t.arrowHeight,[u,d]=fS(r),f={start:"0%",center:"50%",end:"100%"}[d],m=(((v=n.arrow)==null?void 0:v.x)??0)+l/2,p=(((y=n.arrow)==null?void 0:y.y)??0)+c/2;let w="",h="";return u==="bottom"?(w=o?f:`${m}px`,h=`${-c}px`):u==="top"?(w=o?f:`${m}px`,h=`${s.floating.height+c}px`):u==="right"?(w=`${-c}px`,h=o?f:`${p}px`):u==="left"&&(w=`${s.floating.width+c}px`,h=o?f:`${p}px`),{data:{x:w,y:h}}}});function fS(t){const[e,r="center"]=t.split("-");return[e,r]}var RT=oS,hS=lS,pS=cS,mS=dS,[Md,$F]=fs("Tooltip",[Dd]),Ov=Dd(),vS="TooltipProvider",TT=700,g0="tooltip.open",[AT,gS]=Md(vS),yS=t=>{const{__scopeTooltip:e,delayDuration:r=TT,skipDelayDuration:s=300,disableHoverableContent:n=!1,children:a}=t,o=x.useRef(!0),l=x.useRef(!1),c=x.useRef(0);return x.useEffect(()=>{const u=c.current;return()=>window.clearTimeout(u)},[]),i.jsx(AT,{scope:e,isOpenDelayedRef:o,delayDuration:r,onOpen:x.useCallback(()=>{window.clearTimeout(c.current),o.current=!1},[]),onClose:x.useCallback(()=>{window.clearTimeout(c.current),c.current=window.setTimeout(()=>o.current=!0,s)},[s]),isPointerInTransitRef:l,onPointerInTransitChange:x.useCallback(u=>{l.current=u},[]),disableHoverableContent:n,children:a})};yS.displayName=vS;var xS="Tooltip",[FF,$d]=Md(xS),bp="TooltipTrigger",OT=x.forwardRef((t,e)=>{const{__scopeTooltip:r,...s}=t,n=$d(bp,r),a=gS(bp,r),o=Ov(r),l=x.useRef(null),c=et(e,l,n.onTriggerChange),u=x.useRef(!1),d=x.useRef(!1),f=x.useCallback(()=>u.current=!1,[]);return x.useEffect(()=>()=>document.removeEventListener("pointerup",f),[f]),i.jsx(hS,{asChild:!0,...o,children:i.jsx(Ae.button,{"aria-describedby":n.open?n.contentId:void 0,"data-state":n.stateAttribute,...s,ref:c,onPointerMove:_e(t.onPointerMove,m=>{m.pointerType!=="touch"&&!d.current&&!a.isPointerInTransitRef.current&&(n.onTriggerEnter(),d.current=!0)}),onPointerLeave:_e(t.onPointerLeave,()=>{n.onTriggerLeave(),d.current=!1}),onPointerDown:_e(t.onPointerDown,()=>{n.open&&n.onClose(),u.current=!0,document.addEventListener("pointerup",f,{once:!0})}),onFocus:_e(t.onFocus,()=>{u.current||n.onOpen()}),onBlur:_e(t.onBlur,n.onClose),onClick:_e(t.onClick,n.onClose)})})});OT.displayName=bp;var IT="TooltipPortal",[LF,DT]=Md(IT,{forceMount:void 0}),pi="TooltipContent",wS=x.forwardRef((t,e)=>{const r=DT(pi,t.__scopeTooltip),{forceMount:s=r.forceMount,side:n="top",...a}=t,o=$d(pi,t.__scopeTooltip);return i.jsx(da,{present:s||o.open,children:o.disableHoverableContent?i.jsx(bS,{side:n,...a,ref:e}):i.jsx(MT,{side:n,...a,ref:e})})}),MT=x.forwardRef((t,e)=>{const r=$d(pi,t.__scopeTooltip),s=gS(pi,t.__scopeTooltip),n=x.useRef(null),a=et(e,n),[o,l]=x.useState(null),{trigger:c,onClose:u}=r,d=n.current,{onPointerInTransitChange:f}=s,m=x.useCallback(()=>{l(null),f(!1)},[f]),p=x.useCallback((w,h)=>{const g=w.currentTarget,v={x:w.clientX,y:w.clientY},y=zT(v,g.getBoundingClientRect()),b=VT(v,y),S=qT(h.getBoundingClientRect()),E=BT([...b,...S]);l(E),f(!0)},[f]);return x.useEffect(()=>()=>m(),[m]),x.useEffect(()=>{if(c&&d){const w=g=>p(g,d),h=g=>p(g,c);return c.addEventListener("pointerleave",w),d.addEventListener("pointerleave",h),()=>{c.removeEventListener("pointerleave",w),d.removeEventListener("pointerleave",h)}}},[c,d,p,m]),x.useEffect(()=>{if(o){const w=h=>{const g=h.target,v={x:h.clientX,y:h.clientY},y=(c==null?void 0:c.contains(g))||(d==null?void 0:d.contains(g)),b=!HT(v,o);y?m():b&&(m(),u())};return document.addEventListener("pointermove",w),()=>document.removeEventListener("pointermove",w)}},[c,d,o,u,m]),i.jsx(bS,{...t,ref:a})}),[$T,FT]=Md(xS,{isInside:!1}),LT=Pj("TooltipContent"),bS=x.forwardRef((t,e)=>{const{__scopeTooltip:r,children:s,"aria-label":n,onEscapeKeyDown:a,onPointerDownOutside:o,...l}=t,c=$d(pi,r),u=Ov(r),{onClose:d}=c;return x.useEffect(()=>(document.addEventListener(g0,d),()=>document.removeEventListener(g0,d)),[d]),x.useEffect(()=>{if(c.trigger){const f=m=>{const p=m.target;p!=null&&p.contains(c.trigger)&&d()};return window.addEventListener("scroll",f,{capture:!0}),()=>window.removeEventListener("scroll",f,{capture:!0})}},[c.trigger,d]),i.jsx(Vl,{asChild:!0,disableOutsidePointerEvents:!1,onEscapeKeyDown:a,onPointerDownOutside:o,onFocusOutside:f=>f.preventDefault(),onDismiss:d,children:i.jsxs(pS,{"data-state":c.stateAttribute,...u,...l,ref:e,style:{...l.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:[i.jsx(LT,{children:s}),i.jsx($T,{scope:r,isInside:!0,children:i.jsx(Gj,{id:c.contentId,role:"tooltip",children:n||s})})]})})});wS.displayName=pi;var SS="TooltipArrow",UT=x.forwardRef((t,e)=>{const{__scopeTooltip:r,...s}=t,n=Ov(r);return FT(SS,r).isInside?null:i.jsx(mS,{...n,...s,ref:e})});UT.displayName=SS;function zT(t,e){const r=Math.abs(e.top-t.y),s=Math.abs(e.bottom-t.y),n=Math.abs(e.right-t.x),a=Math.abs(e.left-t.x);switch(Math.min(r,s,n,a)){case a:return"left";case n:return"right";case r:return"top";case s:return"bottom";default:throw new Error("unreachable")}}function VT(t,e,r=5){const s=[];switch(e){case"top":s.push({x:t.x-r,y:t.y+r},{x:t.x+r,y:t.y+r});break;case"bottom":s.push({x:t.x-r,y:t.y-r},{x:t.x+r,y:t.y-r});break;case"left":s.push({x:t.x+r,y:t.y-r},{x:t.x+r,y:t.y+r});break;case"right":s.push({x:t.x-r,y:t.y-r},{x:t.x-r,y:t.y+r});break}return s}function qT(t){const{top:e,right:r,bottom:s,left:n}=t;return[{x:n,y:e},{x:r,y:e},{x:r,y:s},{x:n,y:s}]}function HT(t,e){const{x:r,y:s}=t;let n=!1;for(let a=0,o=e.length-1;a<e.length;o=a++){const l=e[a],c=e[o],u=l.x,d=l.y,f=c.x,m=c.y;d>s!=m>s&&r<(f-u)*(s-d)/(m-d)+u&&(n=!n)}return n}function BT(t){const e=t.slice();return e.sort((r,s)=>r.x<s.x?-1:r.x>s.x?1:r.y<s.y?-1:r.y>s.y?1:0),WT(e)}function WT(t){if(t.length<=1)return t.slice();const e=[];for(let s=0;s<t.length;s++){const n=t[s];for(;e.length>=2;){const a=e[e.length-1],o=e[e.length-2];if((a.x-o.x)*(n.y-o.y)>=(a.y-o.y)*(n.x-o.x))e.pop();else break}e.push(n)}e.pop();const r=[];for(let s=t.length-1;s>=0;s--){const n=t[s];for(;r.length>=2;){const a=r[r.length-1],o=r[r.length-2];if((a.x-o.x)*(n.y-o.y)>=(a.y-o.y)*(n.x-o.x))r.pop();else break}r.push(n)}return r.pop(),e.length===1&&r.length===1&&e[0].x===r[0].x&&e[0].y===r[0].y?e:e.concat(r)}var KT=yS,_S=wS;const QT=KT,GT=x.forwardRef(({className:t,sideOffset:e=4,...r},s)=>i.jsx(_S,{ref:s,sideOffset:e,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]",t),...r}));GT.displayName=_S.displayName;const ZT={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 YT(t){return t?{total:t.total,byKind:t.byKind,serviceWarnings:new Map(Object.entries(t.services)),credentialWarnings:new Map(Object.entries(t.credentials)),playbookWarnings:new Map(Object.entries(t.playbooks))}:ZT}const wr="#92E4DD",ur="#F9386D",Yr="#FFFFFF",bn="bg-gradient-to-b from-gray-900 via-gray-800 to-gray-900";function Kr(t){return t.type==="mcp"||t.type==="local-mcp"?wr:t.cardColor??wr}function Sn(t){return{borderColor:t,color:t,boxShadow:`0 0 20px ${t}20`}}const JT=jd("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:{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"}}),me=x.forwardRef(({className:t,variant:e,size:r,asChild:s=!1,...n},a)=>{const o=s?Cj:"button";return i.jsx(o,{className:Te(JT({variant:e,size:r,className:t})),ref:a,...n})});me.displayName="Button";const Lu="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 ES(t){return t.iconUrl?t.iconUrl:null}function Vo({warnings:t}){if(!(t!=null&&t.length))return null;const e=t.find(s=>s.severity==="error")??t[0],r=e.severity==="error";return i.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 ${r?"bg-red-500/90 text-white border border-red-300/60":"bg-amber-500/90 text-black border border-amber-200/60"}`,title:t.map(s=>s.message).join(" · "),"data-testid":"card-warning-badge",children:[i.jsx(rn,{className:"h-2.5 w-2.5 shrink-0"}),i.jsx("span",{className:"max-w-[72px] truncate",children:e.message})]})}function Iv(t){return t?"ring-2 ring-inset ring-yellow-400/90 shadow-[0_0_10px_rgba(250,204,21,0.2)]":""}function Dv(){return i.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"})}const XT=t=>{const e=Kr(t),r=ES(t);return r?i.jsx("img",{src:r,alt:"",className:"w-7 h-7 object-contain rounded-sm",draggable:!1}):i.jsx("div",{style:{width:28,height:28,backgroundColor:e,WebkitMask:`url(${Lu}) no-repeat center / contain`,mask:`url(${Lu}) no-repeat center / contain`}})};function eA({service:t,onDragStart:e,onDragEnd:r,isInActiveDeck:s,onCardClick:n,isInCollection:a=!1,onMouseEnter:o,onMouseLeave:l,activeDeck:c,warnings:u}){const d=yr(),{toast:f}=or(),m=Kr(t),p=At({mutationFn:async()=>{if(!c)throw new Error("No active deck found");return Oe("POST",`/api/decks/${c.id}/services`,{serviceId:t.id,position:0})},onSuccess:()=>{d.invalidateQueries({queryKey:["/api/decks"]}),f({title:"Service added to deck",description:`${t.name} has been added to your active deck.`})},onError:v=>{f({title:"Failed to add service",description:v.message,variant:"destructive"})}}),w=At({mutationFn:async()=>Oe("DELETE",`/api/services/${t.id}`,{}),onSuccess:()=>{d.invalidateQueries({queryKey:["/api/services"]}),d.invalidateQueries({queryKey:["/api/collection/warnings"]}),d.invalidateQueries({queryKey:["/api/decks"]}),f({title:"Service deleted",description:`${t.name} has been deleted successfully.`})},onError:v=>{f({title:"Failed to delete service",description:v.message,variant:"destructive"})}}),h=v=>{v.stopPropagation(),p.mutate()},g=v=>{v.stopPropagation(),window.confirm(`Are you sure you want to delete ${t.name}? This action cannot be undone.`)&&w.mutate()};return i.jsx("div",{className:"relative group cursor-pointer",draggable:!s,onDragStart:v=>e(v,t),onDragEnd:r,onClick:()=>n==null?void 0:n(t),"data-testid":`card-${t.id}`,onMouseEnter:o,onMouseLeave:l,children:i.jsxs("div",{className:`
|
|
234
|
+
w-32 h-48 aspect-[2/3] rounded-lg border-2 p-3
|
|
235
|
+
transform transition-all duration-300 shadow-lg hover:shadow-2xl
|
|
236
|
+
bg-gradient-to-b from-gray-900 via-gray-800 to-gray-900
|
|
237
|
+
relative overflow-hidden
|
|
238
|
+
${Iv(s)}
|
|
239
|
+
${a?"hover:scale-110 hover:rotate-0":"hover:scale-105"}
|
|
240
|
+
`,style:{borderColor:m,boxShadow:`0 0 20px ${m}20`},children:[i.jsx(Vo,{warnings:u}),s&&i.jsx(Dv,{}),i.jsx("div",{className:"absolute top-1 left-1 text-xs font-bold",children:i.jsx("div",{className:"leading-none",style:{color:m},children:t.type==="mcp"?"RM":t.type==="local-mcp"?"LM":"A"})}),i.jsx("div",{className:"absolute bottom-1 right-1 text-xs font-bold rotate-180",children:i.jsx("div",{className:"leading-none",style:{color:m},children:t.type==="mcp"?"RM":t.type==="local-mcp"?"LM":"A"})}),i.jsx("div",{className:"absolute top-1 right-1 opacity-0 group-hover:opacity-100 transition-opacity duration-200 z-10",children:i.jsx(me,{size:"sm",variant:"destructive",className:"h-5 w-5 p-0 bg-red-500/80 hover:bg-red-500 border-red-400",onClick:g,title:`Delete ${t.name}`,children:i.jsx(Rd,{className:"w-3 h-3"})})}),i.jsxs("div",{className:"absolute inset-x-2 top-6 bottom-8 flex flex-col items-center justify-center text-center",children:[i.jsx("div",{className:"mb-2",style:{color:m},children:XT(t)}),i.jsx("h3",{className:"font-bold text-xs mb-1 line-clamp-2","data-testid":`text-service-name-${t.id}`,style:{color:m},children:t.name}),i.jsx("div",{className:"text-[8px] px-1 py-0.5 rounded border opacity-70",style:{color:m,borderColor:m},children:t.type==="mcp"?"Remote MCP":t.type==="local-mcp"?"Local MCP":"A2A"})]}),i.jsx("div",{className:"absolute bottom-6 inset-x-1",children:i.jsx(me,{size:"sm",className:"w-full text-[8px] px-1 py-1 h-5 bg-black/20 hover:bg-black/40 border",style:{color:m,borderColor:m},onClick:h,disabled:s||p.isPending,"data-testid":`button-add-to-deck-${t.id}`,children:s?"IN DECK":"ADD"})}),i.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 tA=x.memo(eA);function rA(t){return t.iconUrl?t.iconUrl:null}function CS({credential:t,color:e}){const r=rA(t);return r?i.jsx("img",{src:r,alt:"",className:"h-7 w-7 object-contain rounded-sm",draggable:!1}):i.jsx(mp,{className:"h-7 w-7",strokeWidth:2.25,style:{color:e}})}function nA({credential:t,isInActiveDeck:e,activeDeck:r,isInCollection:s=!0,onDragStart:n,onDragEnd:a,onMouseEnter:o,onMouseLeave:l,onCardClick:c,warnings:u}){const d=yr(),{toast:f}=or(),m=ur,p=At({mutationFn:async()=>{if(!r)throw new Error("No active deck found");return Oe("POST",`/api/decks/${r.id}/credentials`,{credentialId:t.id})},onSuccess:()=>{d.invalidateQueries({queryKey:["/api/decks"]}),d.invalidateQueries({queryKey:["/api/decks"]}),f({title:"Added to deck",description:`${t.label} is in your active deck.`})},onError:h=>{f({title:"Failed to add to deck",description:h.message,variant:"destructive"})}}),w=At({mutationFn:async()=>Oe("DELETE",`/api/credentials/${t.id}`),onSuccess:()=>{d.invalidateQueries({queryKey:["/api/credentials/vault"]}),d.invalidateQueries({queryKey:["/api/decks"]}),d.invalidateQueries({queryKey:["/api/decks"]}),f({title:"API key removed",description:`${t.label} was deleted from your vault.`})},onError:h=>{f({title:"Failed to remove API key",description:h.message,variant:"destructive"})}});return i.jsx("div",{className:"relative group cursor-pointer",draggable:!e&&!!n,onDragStart:n?h=>n(h,t):void 0,onDragEnd:a,onClick:()=>c==null?void 0:c(t),"data-testid":`card-${t.id}`,onMouseEnter:o,onMouseLeave:l,children:i.jsxs("div",{className:`
|
|
241
|
+
w-32 h-48 aspect-[2/3] rounded-lg border-2 p-3
|
|
242
|
+
transform transition-all duration-300 shadow-lg hover:shadow-2xl
|
|
243
|
+
bg-gradient-to-b from-gray-900 via-gray-800 to-gray-900
|
|
244
|
+
relative overflow-hidden
|
|
245
|
+
${Iv(e)}
|
|
246
|
+
${s?"hover:scale-110 hover:rotate-0":"hover:scale-105"}
|
|
247
|
+
`,style:{borderColor:m,boxShadow:`0 0 20px ${m}20`},children:[i.jsx(Vo,{warnings:u}),e&&i.jsx(Dv,{}),i.jsx("div",{className:"absolute top-1 left-1 text-xs font-bold",children:i.jsx("div",{className:"leading-none",style:{color:m},children:"AK"})}),i.jsx("div",{className:"absolute bottom-1 right-1 text-xs font-bold rotate-180",children:i.jsx("div",{className:"leading-none",style:{color:m},children:"AK"})}),i.jsx("div",{className:"absolute top-1 right-1 opacity-0 group-hover:opacity-100 transition-opacity duration-200 z-10",children:i.jsx(me,{size:"sm",variant:"destructive",className:"h-5 w-5 p-0 bg-red-500/80 hover:bg-red-500 border-red-400",onClick:h=>{h.stopPropagation(),window.confirm(`Remove ${t.label} from your vault?`)&&w.mutate()},title:`Remove ${t.label}`,children:i.jsx(Rd,{className:"w-3 h-3"})})}),i.jsxs("div",{className:"absolute inset-x-2 top-6 bottom-8 flex flex-col items-center justify-center text-center",children:[i.jsx("div",{className:"mb-2",style:{color:m},children:i.jsx(CS,{credential:t,color:m})}),i.jsx("h3",{className:"font-bold text-xs mb-1 line-clamp-2","data-testid":`text-credential-name-${t.id}`,style:{color:m},children:t.label}),i.jsx("div",{className:"text-[8px] px-1 py-0.5 rounded border opacity-70",style:{color:m,borderColor:m},children:t.hasSecret?"API Key":"Missing key"})]}),i.jsx("div",{className:"absolute bottom-6 inset-x-1",children:i.jsx(me,{size:"sm",className:"w-full text-[8px] px-1 py-1 h-5 bg-black/20 hover:bg-black/40 border",style:{color:m,borderColor:m},onClick:h=>{h.stopPropagation(),p.mutate()},disabled:e||p.isPending||!r,"data-testid":`button-add-to-deck-${t.id}`,children:e?"IN DECK":"ADD"})}),i.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 sA=x.memo(nA);function aA({playbook:t,isInActiveDeck:e,activeDeck:r,isInCollection:s=!0,onDragStart:n,onDragEnd:a,onMouseEnter:o,onMouseLeave:l,onCardClick:c,warnings:u}){const d=yr(),{toast:f}=or(),m=Yr,p=t.dependsOnCredentialIds.length+t.dependsOnServiceIds.length,w=At({mutationFn:async()=>{if(!r)throw new Error("No deck selected");return Oe("POST",`/api/decks/${r.id}/playbooks`,{playbookId:t.id})},onSuccess:()=>{d.invalidateQueries({queryKey:["/api/decks"]}),f({title:"Playbook added to deck",description:`${t.title} is on this deck.`})},onError:g=>{f({title:"Failed to add playbook",description:g.message,variant:"destructive"})}}),h=At({mutationFn:async()=>Oe("DELETE",`/api/playbooks/${t.id}`),onSuccess:()=>{d.invalidateQueries({queryKey:["/api/playbooks/vault"]}),d.invalidateQueries({queryKey:["/api/decks"]}),f({title:"Playbook deleted",description:`${t.title} was removed from your collection.`})},onError:g=>{f({title:"Failed to delete playbook",description:g.message,variant:"destructive"})}});return i.jsx("div",{className:"relative group cursor-pointer",draggable:!e&&!!n,onDragStart:n?g=>n(g,t):void 0,onDragEnd:a,onClick:()=>c==null?void 0:c(t),"data-testid":`card-${t.id}`,onMouseEnter:o,onMouseLeave:l,children:i.jsxs("div",{className:`
|
|
248
|
+
w-32 h-48 aspect-[2/3] rounded-lg border-2 p-3
|
|
249
|
+
transform transition-all duration-300 shadow-lg hover:shadow-2xl
|
|
250
|
+
bg-gradient-to-b from-gray-900 via-gray-800 to-gray-900
|
|
251
|
+
relative overflow-hidden
|
|
252
|
+
${Iv(e)}
|
|
253
|
+
${s?"hover:scale-110 hover:rotate-0":"hover:scale-105"}
|
|
254
|
+
`,style:{borderColor:m,boxShadow:`0 0 20px ${m}20`},children:[i.jsx(Vo,{warnings:u}),e&&i.jsx(Dv,{}),i.jsx("div",{className:"absolute top-1 left-1 text-xs font-bold",children:i.jsx("div",{className:"leading-none",style:{color:m},children:"PB"})}),i.jsx("div",{className:"absolute bottom-1 right-1 text-xs font-bold rotate-180",children:i.jsx("div",{className:"leading-none",style:{color:m},children:"PB"})}),i.jsx("div",{className:"absolute top-1 right-1 opacity-0 group-hover:opacity-100 transition-opacity duration-200 z-10",children:i.jsx(me,{size:"sm",variant:"destructive",className:"h-5 w-5 p-0 bg-red-500/80 hover:bg-red-500 border-red-400",onClick:g=>{g.stopPropagation(),window.confirm(`Delete playbook "${t.title}"?`)&&h.mutate()},title:`Delete ${t.title}`,children:i.jsx(Rd,{className:"w-3 h-3"})})}),i.jsxs("div",{className:"absolute inset-x-2 top-6 bottom-8 flex flex-col items-center justify-center text-center",children:[i.jsx("div",{className:"mb-2",style:{color:m},children:i.jsx(Sv,{className:"h-7 w-7",strokeWidth:2.25})}),i.jsx("h3",{className:"font-bold text-xs mb-1 line-clamp-2",style:{color:m},children:t.title}),i.jsxs("div",{className:"text-[8px] px-1 py-0.5 rounded border opacity-70",style:{color:m,borderColor:m},children:["Playbook",p>0?` · ${p} deps`:""]})]}),i.jsx("div",{className:"absolute bottom-6 inset-x-1",children:i.jsx(me,{size:"sm",className:"w-full text-[8px] px-1 py-1 h-5 bg-black/20 hover:bg-black/40 border",style:{color:m,borderColor:m},onClick:g=>{g.stopPropagation(),w.mutate()},disabled:e||w.isPending||!r,children:e?"IN DECK":"ADD"})}),i.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 oA=x.memo(aA),y0=128,Fd=48,iA=10,Pc=64,Nc=4,x0=14,lA=12;function kS(t,e=Fd){return t===0?0:y0+Math.max(0,t-1)*(y0-e)}const cA=kS(iA,Fd);function uA(t,e,r,s=lA){const n=e+r/2,a=r/2;if(a<=0)return 0;const o=(t-n)/a;return Math.max(-s,Math.min(s,o*s))}function dA(t){return{flexShrink:0,marginLeft:t===0?0:`-${Fd}px`}}function fA(t,e,r){return r===t?999999:e-t}function hA({cardCount:t,children:e}){const r=x.useRef(null),s=x.useRef([]),n=x.useRef(0),a=x.useRef(void 0),[o,l]=x.useState(!1),[c,u]=x.useState(!1),[d,f]=x.useState(!1),[m,p]=x.useState(!1),[w,h]=x.useState(!1),g=x.useRef(!1),v=x.useRef(!1),[y,b]=x.useState(null),S=x.useRef(null);S.current=y;const E=x.useCallback(()=>{const N=r.current;if(!N)return;const O=N.getBoundingClientRect(),j=S.current;s.current.forEach((_,A)=>{if(!_)return;const C=_.getBoundingClientRect(),z=C.left+C.width/2,U=j===A?0:uA(z,O.left,O.width);_.style.transform=`rotate(${U}deg)`,_.style.zIndex=String(fA(A,t,j))})},[t]),k=x.useCallback(()=>{const N=r.current;if(!N)return;const j=kS(t,Fd)>N.clientWidth+2;l(j),u(j&&N.scrollLeft>4),f(j&&N.scrollLeft+N.clientWidth<N.scrollWidth-4),E()},[t,E]);x.useLayoutEffect(()=>{const N=r.current;if(!N)return;k();const O=new ResizeObserver(k);return O.observe(N),N.addEventListener("scroll",k,{passive:!0}),()=>{O.disconnect(),N.removeEventListener("scroll",k)}},[t,k]),x.useEffect(()=>{const N=()=>{const O=r.current,j=n.current;if(O&&j!==0){O.scrollLeft+=j,E();const C=O.scrollLeft>4,z=O.scrollLeft+O.clientWidth<O.scrollWidth-4;u(C),f(z)}const _=j<0,A=j>0;_!==g.current&&(g.current=_,p(_)),A!==v.current&&(v.current=A,h(A)),a.current=requestAnimationFrame(N)};return a.current=requestAnimationFrame(N),()=>{a.current!==void 0&&cancelAnimationFrame(a.current)}},[E]);const R=N=>{const O=r.current;if(!O||!o){n.current=0;return}const j=O.getBoundingClientRect(),_=N.clientX-j.left;if(_<Pc&&c){const A=1-_/Pc;n.current=-(Nc+A*(x0-Nc))}else if(_>j.width-Pc&&d){const A=1-(j.width-_)/Pc;n.current=Nc+A*(x0-Nc)}else n.current=0;E()},T=()=>{n.current=0,g.current=!1,v.current=!1,p(!1),h(!1)};return x.useLayoutEffect(()=>{E()},[t,y,E]),t===0?i.jsx(i.Fragment,{children:e}):i.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:R,onMouseLeave:T,children:[o&&i.jsx("div",{className:`pointer-events-none absolute left-2 top-1/2 z-30 -translate-y-1/2 rounded-full bg-black/60 p-1 text-yellow-300 shadow-lg transition-all duration-150 ${c?"opacity-90":"opacity-25"} ${m?"scale-125":"scale-100"}`,"aria-hidden":!0,"data-testid":"deck-scroll-left",children:i.jsx(x2,{className:"h-6 w-6",strokeWidth:2.5})}),o&&i.jsx("div",{className:`pointer-events-none absolute right-2 top-1/2 z-30 -translate-y-1/2 rounded-full bg-black/60 p-1 text-yellow-300 shadow-lg transition-all duration-150 ${d?"opacity-90":"opacity-25"} ${w?"scale-125":"scale-100"}`,"aria-hidden":!0,"data-testid":"deck-scroll-right",children:i.jsx(w2,{className:"h-6 w-6",strokeWidth:2.5})}),o&&i.jsxs(i.Fragment,{children:[i.jsx("div",{className:"pointer-events-none absolute inset-y-4 left-0 z-20 w-16 bg-gradient-to-r from-gray-950/90 to-transparent","aria-hidden":!0}),i.jsx("div",{className:"pointer-events-none absolute inset-y-4 right-0 z-20 w-16 bg-gradient-to-l from-gray-950/90 to-transparent","aria-hidden":!0})]}),i.jsx("div",{ref:r,className:"h-full max-h-full overflow-x-auto overflow-y-hidden py-2 [scrollbar-width:none] [&::-webkit-scrollbar]:hidden",style:{width:cA,maxWidth:"100%"},children:i.jsx("div",{className:"flex items-center justify-start isolate group/fan",children:x.Children.map(e,(N,O)=>i.jsx("div",{ref:j=>{s.current[O]=j},className:"relative transition-all duration-500",style:dA(O),onMouseEnter:()=>b(O),onMouseLeave:()=>b(null),children:N},N&&typeof N=="object"&&"key"in N?N.key:O))})})]})}function pA({deck:t,services:e,credentials:r=[],playbooks:s=[],collectionWarnings:n,onDrop:a,onDragStart:o,onCredentialDragStart:l,onPlaybookDragStart:c,onDragEnd:u,onCardClick:d,onPlaybookClick:f,onCredentialClick:m}){const p=v=>{v.preventDefault(),a(v)},w=v=>{v.preventDefault()},h=v=>{const y=Kr(v),b=ES(v);return b?i.jsx("img",{src:b,alt:"",className:"w-7 h-7 object-contain rounded-sm",draggable:!1}):i.jsx("div",{style:{width:28,height:28,backgroundColor:y,WebkitMask:`url(${Lu}) no-repeat center / contain`,mask:`url(${Lu}) no-repeat center / contain`}})},g=e.length+r.length+s.length;return i.jsxs("div",{className:"flex h-full min-w-0 flex-col overflow-hidden",children:[i.jsx("div",{className:"mb-4 shrink-0 flex items-center justify-between",children:i.jsxs("h3",{className:"text-lg font-bold flex items-center",children:[i.jsx("i",{className:"fas fa-layer-group mr-2 text-blue-400"}),"Deck",i.jsx("span",{className:"ml-2 text-sm font-normal text-gray-400",children:t.name}),i.jsxs("span",{className:"ml-2 text-sm font-normal text-gray-400",children:["(",g," cards)"]})]})}),i.jsx("div",{className:"relative flex min-h-0 flex-1 items-center justify-center overflow-hidden rounded-xl border-2 border-dashed p-4 min-w-0",onDrop:p,onDragOver:w,style:{minHeight:"200px",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:i.jsx("div",{className:"relative h-full w-full min-w-0 overflow-hidden",children:g===0?i.jsx("div",{className:"text-center",children:i.jsx("div",{className:"w-32 h-48 border-2 border-dashed border-gray-500 rounded-lg flex items-center justify-center opacity-50 hover:opacity-75 transition-all mb-4",children:i.jsx(Vs,{className:"w-8 h-8 text-gray-500"})})}):i.jsxs(hA,{cardCount:g,children:[r.map((v,y)=>i.jsxs("div",{className:"w-32 h-48 aspect-[2/3] rounded-lg border-2 p-3 transform transition-all duration-500 shadow-lg hover:shadow-2xl hover:scale-110 bg-gradient-to-b from-gray-900 via-gray-800 to-gray-900 relative overflow-hidden cursor-pointer hover:rotate-0",style:{borderColor:ur,boxShadow:`0 0 20px ${ur}20`},draggable:!0,onDragStart:b=>l(b,v,!0),onDragEnd:u,onClick:()=>m==null?void 0:m(v),"data-testid":`deck-card-${v.id}`,children:[i.jsx(Vo,{warnings:n==null?void 0:n.credentialWarnings.get(v.id)}),i.jsx("div",{className:"absolute top-1 left-1 text-xs font-bold",children:i.jsx("div",{className:"leading-none",style:{color:ur},children:"AK"})}),i.jsx("div",{className:"absolute bottom-1 right-1 text-xs font-bold rotate-180",children:i.jsx("div",{className:"leading-none",style:{color:ur},children:"AK"})}),i.jsxs("div",{className:"absolute inset-x-2 top-6 bottom-8 flex flex-col items-center justify-center text-center",children:[i.jsx("div",{className:"mb-2",style:{color:ur},children:i.jsx(CS,{credential:v,color:ur})}),i.jsx("h3",{className:"font-bold text-xs mb-1 line-clamp-2",style:{color:ur},children:v.label}),i.jsx("div",{className:"text-[8px] px-1 py-0.5 rounded border opacity-70",style:{color:ur,borderColor:ur},children:v.hasSecret?"API Key":"Missing key"})]})]},v.id)),s.map((v,y)=>i.jsxs("div",{className:"w-32 h-48 aspect-[2/3] rounded-lg border-2 p-3 transform transition-all duration-500 shadow-lg hover:shadow-2xl hover:scale-110 bg-gradient-to-b from-gray-900 via-gray-800 to-gray-900 relative overflow-hidden cursor-pointer hover:rotate-0",style:{borderColor:Yr,boxShadow:`0 0 20px ${Yr}20`},draggable:!0,onDragStart:b=>c(b,v,!0),onDragEnd:u,onClick:()=>f==null?void 0:f(v),"data-testid":`deck-card-${v.id}`,children:[i.jsx(Vo,{warnings:n==null?void 0:n.playbookWarnings.get(v.id)}),i.jsx("div",{className:"absolute top-1 left-1 text-xs font-bold",children:i.jsx("div",{className:"leading-none",style:{color:Yr},children:"PB"})}),i.jsx("div",{className:"absolute bottom-1 right-1 text-xs font-bold rotate-180",children:i.jsx("div",{className:"leading-none",style:{color:Yr},children:"PB"})}),i.jsxs("div",{className:"absolute inset-x-2 top-6 bottom-8 flex flex-col items-center justify-center text-center",children:[i.jsx("div",{className:"mb-2",style:{color:Yr},children:i.jsx(Sv,{className:"h-7 w-7",strokeWidth:2.25})}),i.jsx("h3",{className:"font-bold text-xs mb-1 line-clamp-2",style:{color:Yr},children:v.title}),i.jsx("div",{className:"text-[8px] px-1 py-0.5 rounded border opacity-70",style:{color:Yr,borderColor:Yr},children:"Playbook"})]})]},v.id)),e.map((v,y)=>{const b=h(v);return i.jsxs("div",{className:"w-32 h-48 aspect-[2/3] rounded-lg border-2 p-3 transform transition-all duration-500 shadow-lg hover:shadow-2xl hover:scale-110 bg-gradient-to-b from-gray-900 via-gray-800 to-gray-900 relative overflow-hidden cursor-pointer hover:rotate-0",style:{borderColor:Kr(v),boxShadow:`0 0 20px ${Kr(v)}20`},draggable:!0,onDragStart:S=>o(S,v,!0),onDragEnd:u,onClick:()=>d==null?void 0:d(v),"data-testid":`deck-card-${v.id}`,children:[i.jsx(Vo,{warnings:n==null?void 0:n.serviceWarnings.get(v.id)}),i.jsx("div",{className:"absolute top-1 left-1 text-xs font-bold",children:i.jsx("div",{className:"leading-none",style:{color:Kr(v)},children:v.type==="mcp"?"RM":v.type==="local-mcp"?"LM":"A"})}),i.jsx("div",{className:"absolute bottom-1 right-1 text-xs font-bold rotate-180",children:i.jsx("div",{className:"leading-none",style:{color:Kr(v)},children:v.type==="mcp"?"RM":v.type==="local-mcp"?"LM":"A"})}),i.jsxs("div",{className:"absolute inset-x-2 top-6 bottom-8 flex flex-col items-center justify-center text-center",children:[i.jsx("div",{className:"mb-2",style:{color:Kr(v)},children:b}),i.jsx("h3",{className:"font-bold text-xs mb-1 line-clamp-2",style:{color:Kr(v)},children:v.name}),i.jsx("div",{className:"text-[8px] px-1 py-0.5 rounded border opacity-70",style:{color:Kr(v),borderColor:Kr(v)},children:v.type==="mcp"?"Remote MCP":v.type==="local-mcp"?"Local MCP":"A2A"})]})]},v.id)})]})})})]})}var Lf="focusScope.autoFocusOnMount",Uf="focusScope.autoFocusOnUnmount",w0={bubbles:!1,cancelable:!0},mA="FocusScope",Mv=x.forwardRef((t,e)=>{const{loop:r=!1,trapped:s=!1,onMountAutoFocus:n,onUnmountAutoFocus:a,...o}=t,[l,c]=x.useState(null),u=Ur(n),d=Ur(a),f=x.useRef(null),m=et(e,h=>c(h)),p=x.useRef({paused:!1,pause(){this.paused=!0},resume(){this.paused=!1}}).current;x.useEffect(()=>{if(s){let h=function(b){if(p.paused||!l)return;const S=b.target;l.contains(S)?f.current=S:Ss(f.current,{select:!0})},g=function(b){if(p.paused||!l)return;const S=b.relatedTarget;S!==null&&(l.contains(S)||Ss(f.current,{select:!0}))},v=function(b){if(document.activeElement===document.body)for(const E of b)E.removedNodes.length>0&&Ss(l)};document.addEventListener("focusin",h),document.addEventListener("focusout",g);const y=new MutationObserver(v);return l&&y.observe(l,{childList:!0,subtree:!0}),()=>{document.removeEventListener("focusin",h),document.removeEventListener("focusout",g),y.disconnect()}}},[s,l,p.paused]),x.useEffect(()=>{if(l){S0.add(p);const h=document.activeElement;if(!l.contains(h)){const v=new CustomEvent(Lf,w0);l.addEventListener(Lf,u),l.dispatchEvent(v),v.defaultPrevented||(vA(bA(PS(l)),{select:!0}),document.activeElement===h&&Ss(l))}return()=>{l.removeEventListener(Lf,u),setTimeout(()=>{const v=new CustomEvent(Uf,w0);l.addEventListener(Uf,d),l.dispatchEvent(v),v.defaultPrevented||Ss(h??document.body,{select:!0}),l.removeEventListener(Uf,d),S0.remove(p)},0)}}},[l,u,d,p]);const w=x.useCallback(h=>{if(!r&&!s||p.paused)return;const g=h.key==="Tab"&&!h.altKey&&!h.ctrlKey&&!h.metaKey,v=document.activeElement;if(g&&v){const y=h.currentTarget,[b,S]=gA(y);b&&S?!h.shiftKey&&v===S?(h.preventDefault(),r&&Ss(b,{select:!0})):h.shiftKey&&v===b&&(h.preventDefault(),r&&Ss(S,{select:!0})):v===y&&h.preventDefault()}},[r,s,p.paused]);return i.jsx(Ae.div,{tabIndex:-1,...o,ref:m,onKeyDown:w})});Mv.displayName=mA;function vA(t,{select:e=!1}={}){const r=document.activeElement;for(const s of t)if(Ss(s,{select:e}),document.activeElement!==r)return}function gA(t){const e=PS(t),r=b0(e,t),s=b0(e.reverse(),t);return[r,s]}function PS(t){const e=[],r=document.createTreeWalker(t,NodeFilter.SHOW_ELEMENT,{acceptNode:s=>{const n=s.tagName==="INPUT"&&s.type==="hidden";return s.disabled||s.hidden||n?NodeFilter.FILTER_SKIP:s.tabIndex>=0?NodeFilter.FILTER_ACCEPT:NodeFilter.FILTER_SKIP}});for(;r.nextNode();)e.push(r.currentNode);return e}function b0(t,e){for(const r of t)if(!yA(r,{upTo:e}))return r}function yA(t,{upTo:e}){if(getComputedStyle(t).visibility==="hidden")return!0;for(;t;){if(e!==void 0&&t===e)return!1;if(getComputedStyle(t).display==="none")return!0;t=t.parentElement}return!1}function xA(t){return t instanceof HTMLInputElement&&"select"in t}function Ss(t,{select:e=!1}={}){if(t&&t.focus){const r=document.activeElement;t.focus({preventScroll:!0}),t!==r&&xA(t)&&e&&t.select()}}var S0=wA();function wA(){let t=[];return{add(e){const r=t[0];e!==r&&(r==null||r.pause()),t=_0(t,e),t.unshift(e)},remove(e){var r;t=_0(t,e),(r=t[0])==null||r.resume()}}}function _0(t,e){const r=[...t],s=r.indexOf(e);return s!==-1&&r.splice(s,1),r}function bA(t){return t.filter(e=>e.tagName!=="A")}var zf=0;function NS(){x.useEffect(()=>{const t=document.querySelectorAll("[data-radix-focus-guard]");return document.body.insertAdjacentElement("afterbegin",t[0]??E0()),document.body.insertAdjacentElement("beforeend",t[1]??E0()),zf++,()=>{zf===1&&document.querySelectorAll("[data-radix-focus-guard]").forEach(e=>e.remove()),zf--}},[])}function E0(){const t=document.createElement("span");return t.setAttribute("data-radix-focus-guard",""),t.tabIndex=0,t.style.outline="none",t.style.opacity="0",t.style.position="fixed",t.style.pointerEvents="none",t}var _n=function(){return _n=Object.assign||function(e){for(var r,s=1,n=arguments.length;s<n;s++){r=arguments[s];for(var a in r)Object.prototype.hasOwnProperty.call(r,a)&&(e[a]=r[a])}return e},_n.apply(this,arguments)};function jS(t,e){var r={};for(var s in t)Object.prototype.hasOwnProperty.call(t,s)&&e.indexOf(s)<0&&(r[s]=t[s]);if(t!=null&&typeof Object.getOwnPropertySymbols=="function")for(var n=0,s=Object.getOwnPropertySymbols(t);n<s.length;n++)e.indexOf(s[n])<0&&Object.prototype.propertyIsEnumerable.call(t,s[n])&&(r[s[n]]=t[s[n]]);return r}function SA(t,e,r){if(r||arguments.length===2)for(var s=0,n=e.length,a;s<n;s++)(a||!(s in e))&&(a||(a=Array.prototype.slice.call(e,0,s)),a[s]=e[s]);return t.concat(a||Array.prototype.slice.call(e))}var Jc="right-scroll-bar-position",Xc="width-before-scroll-bar",_A="with-scroll-bars-hidden",EA="--removed-body-scroll-bar-size";function Vf(t,e){return typeof t=="function"?t(e):t&&(t.current=e),t}function CA(t,e){var r=x.useState(function(){return{value:t,callback:e,facade:{get current(){return r.value},set current(s){var n=r.value;n!==s&&(r.value=s,r.callback(s,n))}}}})[0];return r.callback=e,r.facade}var kA=typeof window<"u"?x.useLayoutEffect:x.useEffect,C0=new WeakMap;function PA(t,e){var r=CA(null,function(s){return t.forEach(function(n){return Vf(n,s)})});return kA(function(){var s=C0.get(r);if(s){var n=new Set(s),a=new Set(t),o=r.current;n.forEach(function(l){a.has(l)||Vf(l,null)}),a.forEach(function(l){n.has(l)||Vf(l,o)})}C0.set(r,t)},[t]),r}function NA(t){return t}function jA(t,e){e===void 0&&(e=NA);var r=[],s=!1,n={read:function(){if(s)throw new Error("Sidecar: could not `read` from an `assigned` medium. `read` could be used only with `useMedium`.");return r.length?r[r.length-1]:t},useMedium:function(a){var o=e(a,s);return r.push(o),function(){r=r.filter(function(l){return l!==o})}},assignSyncMedium:function(a){for(s=!0;r.length;){var o=r;r=[],o.forEach(a)}r={push:function(l){return a(l)},filter:function(){return r}}},assignMedium:function(a){s=!0;var o=[];if(r.length){var l=r;r=[],l.forEach(a),o=r}var c=function(){var d=o;o=[],d.forEach(a)},u=function(){return Promise.resolve().then(c)};u(),r={push:function(d){o.push(d),u()},filter:function(d){return o=o.filter(d),r}}}};return n}function RA(t){t===void 0&&(t={});var e=jA(null);return e.options=_n({async:!0,ssr:!1},t),e}var RS=function(t){var e=t.sideCar,r=jS(t,["sideCar"]);if(!e)throw new Error("Sidecar: please provide `sideCar` property to import the right car");var s=e.read();if(!s)throw new Error("Sidecar medium not found");return x.createElement(s,_n({},r))};RS.isSideCarExport=!0;function TA(t,e){return t.useMedium(e),RS}var TS=RA(),qf=function(){},Ld=x.forwardRef(function(t,e){var r=x.useRef(null),s=x.useState({onScrollCapture:qf,onWheelCapture:qf,onTouchMoveCapture:qf}),n=s[0],a=s[1],o=t.forwardProps,l=t.children,c=t.className,u=t.removeScrollBar,d=t.enabled,f=t.shards,m=t.sideCar,p=t.noRelative,w=t.noIsolation,h=t.inert,g=t.allowPinchZoom,v=t.as,y=v===void 0?"div":v,b=t.gapMode,S=jS(t,["forwardProps","children","className","removeScrollBar","enabled","shards","sideCar","noRelative","noIsolation","inert","allowPinchZoom","as","gapMode"]),E=m,k=PA([r,e]),R=_n(_n({},S),n);return x.createElement(x.Fragment,null,d&&x.createElement(E,{sideCar:TS,removeScrollBar:u,shards:f,noRelative:p,noIsolation:w,inert:h,setCallbacks:a,allowPinchZoom:!!g,lockRef:r,gapMode:b}),o?x.cloneElement(x.Children.only(l),_n(_n({},R),{ref:k})):x.createElement(y,_n({},R,{className:c,ref:k}),l))});Ld.defaultProps={enabled:!0,removeScrollBar:!0,inert:!1};Ld.classNames={fullWidth:Xc,zeroRight:Jc};var AA=function(){if(typeof __webpack_nonce__<"u")return __webpack_nonce__};function OA(){if(!document)return null;var t=document.createElement("style");t.type="text/css";var e=AA();return e&&t.setAttribute("nonce",e),t}function IA(t,e){t.styleSheet?t.styleSheet.cssText=e:t.appendChild(document.createTextNode(e))}function DA(t){var e=document.head||document.getElementsByTagName("head")[0];e.appendChild(t)}var MA=function(){var t=0,e=null;return{add:function(r){t==0&&(e=OA())&&(IA(e,r),DA(e)),t++},remove:function(){t--,!t&&e&&(e.parentNode&&e.parentNode.removeChild(e),e=null)}}},$A=function(){var t=MA();return function(e,r){x.useEffect(function(){return t.add(e),function(){t.remove()}},[e&&r])}},AS=function(){var t=$A(),e=function(r){var s=r.styles,n=r.dynamic;return t(s,n),null};return e},FA={left:0,top:0,right:0,gap:0},Hf=function(t){return parseInt(t||"",10)||0},LA=function(t){var e=window.getComputedStyle(document.body),r=e[t==="padding"?"paddingLeft":"marginLeft"],s=e[t==="padding"?"paddingTop":"marginTop"],n=e[t==="padding"?"paddingRight":"marginRight"];return[Hf(r),Hf(s),Hf(n)]},UA=function(t){if(t===void 0&&(t="margin"),typeof window>"u")return FA;var e=LA(t),r=document.documentElement.clientWidth,s=window.innerWidth;return{left:e[0],top:e[1],right:e[2],gap:Math.max(0,s-r+e[2]-e[0])}},zA=AS(),qo="data-scroll-locked",VA=function(t,e,r,s){var n=t.left,a=t.top,o=t.right,l=t.gap;return r===void 0&&(r="margin"),`
|
|
255
|
+
.`.concat(_A,` {
|
|
256
|
+
overflow: hidden `).concat(s,`;
|
|
257
|
+
padding-right: `).concat(l,"px ").concat(s,`;
|
|
258
|
+
}
|
|
259
|
+
body[`).concat(qo,`] {
|
|
260
|
+
overflow: hidden `).concat(s,`;
|
|
261
|
+
overscroll-behavior: contain;
|
|
262
|
+
`).concat([e&&"position: relative ".concat(s,";"),r==="margin"&&`
|
|
263
|
+
padding-left: `.concat(n,`px;
|
|
264
|
+
padding-top: `).concat(a,`px;
|
|
265
|
+
padding-right: `).concat(o,`px;
|
|
266
|
+
margin-left:0;
|
|
267
|
+
margin-top:0;
|
|
268
|
+
margin-right: `).concat(l,"px ").concat(s,`;
|
|
269
|
+
`),r==="padding"&&"padding-right: ".concat(l,"px ").concat(s,";")].filter(Boolean).join(""),`
|
|
270
|
+
}
|
|
271
|
+
|
|
272
|
+
.`).concat(Jc,` {
|
|
273
|
+
right: `).concat(l,"px ").concat(s,`;
|
|
274
|
+
}
|
|
275
|
+
|
|
276
|
+
.`).concat(Xc,` {
|
|
277
|
+
margin-right: `).concat(l,"px ").concat(s,`;
|
|
278
|
+
}
|
|
279
|
+
|
|
280
|
+
.`).concat(Jc," .").concat(Jc,` {
|
|
281
|
+
right: 0 `).concat(s,`;
|
|
282
|
+
}
|
|
283
|
+
|
|
284
|
+
.`).concat(Xc," .").concat(Xc,` {
|
|
285
|
+
margin-right: 0 `).concat(s,`;
|
|
286
|
+
}
|
|
287
|
+
|
|
288
|
+
body[`).concat(qo,`] {
|
|
289
|
+
`).concat(EA,": ").concat(l,`px;
|
|
290
|
+
}
|
|
291
|
+
`)},k0=function(){var t=parseInt(document.body.getAttribute(qo)||"0",10);return isFinite(t)?t:0},qA=function(){x.useEffect(function(){return document.body.setAttribute(qo,(k0()+1).toString()),function(){var t=k0()-1;t<=0?document.body.removeAttribute(qo):document.body.setAttribute(qo,t.toString())}},[])},HA=function(t){var e=t.noRelative,r=t.noImportant,s=t.gapMode,n=s===void 0?"margin":s;qA();var a=x.useMemo(function(){return UA(n)},[n]);return x.createElement(zA,{styles:VA(a,!e,n,r?"":"!important")})},Sp=!1;if(typeof window<"u")try{var jc=Object.defineProperty({},"passive",{get:function(){return Sp=!0,!0}});window.addEventListener("test",jc,jc),window.removeEventListener("test",jc,jc)}catch{Sp=!1}var co=Sp?{passive:!1}:!1,BA=function(t){return t.tagName==="TEXTAREA"},OS=function(t,e){if(!(t instanceof Element))return!1;var r=window.getComputedStyle(t);return r[e]!=="hidden"&&!(r.overflowY===r.overflowX&&!BA(t)&&r[e]==="visible")},WA=function(t){return OS(t,"overflowY")},KA=function(t){return OS(t,"overflowX")},P0=function(t,e){var r=e.ownerDocument,s=e;do{typeof ShadowRoot<"u"&&s instanceof ShadowRoot&&(s=s.host);var n=IS(t,s);if(n){var a=DS(t,s),o=a[1],l=a[2];if(o>l)return!0}s=s.parentNode}while(s&&s!==r.body);return!1},QA=function(t){var e=t.scrollTop,r=t.scrollHeight,s=t.clientHeight;return[e,r,s]},GA=function(t){var e=t.scrollLeft,r=t.scrollWidth,s=t.clientWidth;return[e,r,s]},IS=function(t,e){return t==="v"?WA(e):KA(e)},DS=function(t,e){return t==="v"?QA(e):GA(e)},ZA=function(t,e){return t==="h"&&e==="rtl"?-1:1},YA=function(t,e,r,s,n){var a=ZA(t,window.getComputedStyle(e).direction),o=a*s,l=r.target,c=e.contains(l),u=!1,d=o>0,f=0,m=0;do{if(!l)break;var p=DS(t,l),w=p[0],h=p[1],g=p[2],v=h-g-a*w;(w||v)&&IS(t,l)&&(f+=v,m+=w);var y=l.parentNode;l=y&&y.nodeType===Node.DOCUMENT_FRAGMENT_NODE?y.host:y}while(!c&&l!==document.body||c&&(e.contains(l)||e===l));return(d&&Math.abs(f)<1||!d&&Math.abs(m)<1)&&(u=!0),u},Rc=function(t){return"changedTouches"in t?[t.changedTouches[0].clientX,t.changedTouches[0].clientY]:[0,0]},N0=function(t){return[t.deltaX,t.deltaY]},j0=function(t){return t&&"current"in t?t.current:t},JA=function(t,e){return t[0]===e[0]&&t[1]===e[1]},XA=function(t){return`
|
|
292
|
+
.block-interactivity-`.concat(t,` {pointer-events: none;}
|
|
293
|
+
.allow-interactivity-`).concat(t,` {pointer-events: all;}
|
|
294
|
+
`)},eO=0,uo=[];function tO(t){var e=x.useRef([]),r=x.useRef([0,0]),s=x.useRef(),n=x.useState(eO++)[0],a=x.useState(AS)[0],o=x.useRef(t);x.useEffect(function(){o.current=t},[t]),x.useEffect(function(){if(t.inert){document.body.classList.add("block-interactivity-".concat(n));var h=SA([t.lockRef.current],(t.shards||[]).map(j0),!0).filter(Boolean);return h.forEach(function(g){return g.classList.add("allow-interactivity-".concat(n))}),function(){document.body.classList.remove("block-interactivity-".concat(n)),h.forEach(function(g){return g.classList.remove("allow-interactivity-".concat(n))})}}},[t.inert,t.lockRef.current,t.shards]);var l=x.useCallback(function(h,g){if("touches"in h&&h.touches.length===2||h.type==="wheel"&&h.ctrlKey)return!o.current.allowPinchZoom;var v=Rc(h),y=r.current,b="deltaX"in h?h.deltaX:y[0]-v[0],S="deltaY"in h?h.deltaY:y[1]-v[1],E,k=h.target,R=Math.abs(b)>Math.abs(S)?"h":"v";if("touches"in h&&R==="h"&&k.type==="range")return!1;var T=P0(R,k);if(!T)return!0;if(T?E=R:(E=R==="v"?"h":"v",T=P0(R,k)),!T)return!1;if(!s.current&&"changedTouches"in h&&(b||S)&&(s.current=E),!E)return!0;var N=s.current||E;return YA(N,g,h,N==="h"?b:S)},[]),c=x.useCallback(function(h){var g=h;if(!(!uo.length||uo[uo.length-1]!==a)){var v="deltaY"in g?N0(g):Rc(g),y=e.current.filter(function(E){return E.name===g.type&&(E.target===g.target||g.target===E.shadowParent)&&JA(E.delta,v)})[0];if(y&&y.should){g.cancelable&&g.preventDefault();return}if(!y){var b=(o.current.shards||[]).map(j0).filter(Boolean).filter(function(E){return E.contains(g.target)}),S=b.length>0?l(g,b[0]):!o.current.noIsolation;S&&g.cancelable&&g.preventDefault()}}},[]),u=x.useCallback(function(h,g,v,y){var b={name:h,delta:g,target:v,should:y,shadowParent:rO(v)};e.current.push(b),setTimeout(function(){e.current=e.current.filter(function(S){return S!==b})},1)},[]),d=x.useCallback(function(h){r.current=Rc(h),s.current=void 0},[]),f=x.useCallback(function(h){u(h.type,N0(h),h.target,l(h,t.lockRef.current))},[]),m=x.useCallback(function(h){u(h.type,Rc(h),h.target,l(h,t.lockRef.current))},[]);x.useEffect(function(){return uo.push(a),t.setCallbacks({onScrollCapture:f,onWheelCapture:f,onTouchMoveCapture:m}),document.addEventListener("wheel",c,co),document.addEventListener("touchmove",c,co),document.addEventListener("touchstart",d,co),function(){uo=uo.filter(function(h){return h!==a}),document.removeEventListener("wheel",c,co),document.removeEventListener("touchmove",c,co),document.removeEventListener("touchstart",d,co)}},[]);var p=t.removeScrollBar,w=t.inert;return x.createElement(x.Fragment,null,w?x.createElement(a,{styles:XA(n)}):null,p?x.createElement(HA,{noRelative:t.noRelative,gapMode:t.gapMode}):null)}function rO(t){for(var e=null;t!==null;)t instanceof ShadowRoot&&(e=t.host,t=t.host),t=t.parentNode;return e}const nO=TA(TS,tO);var $v=x.forwardRef(function(t,e){return x.createElement(Ld,_n({},t,{ref:e,sideCar:nO}))});$v.classNames=Ld.classNames;var sO=function(t){if(typeof document>"u")return null;var e=Array.isArray(t)?t[0]:t;return e.ownerDocument.body},fo=new WeakMap,Tc=new WeakMap,Ac={},Bf=0,MS=function(t){return t&&(t.host||MS(t.parentNode))},aO=function(t,e){return e.map(function(r){if(t.contains(r))return r;var s=MS(r);return s&&t.contains(s)?s:(console.error("aria-hidden",r,"in not contained inside",t,". Doing nothing"),null)}).filter(function(r){return!!r})},oO=function(t,e,r,s){var n=aO(e,Array.isArray(t)?t:[t]);Ac[r]||(Ac[r]=new WeakMap);var a=Ac[r],o=[],l=new Set,c=new Set(n),u=function(f){!f||l.has(f)||(l.add(f),u(f.parentNode))};n.forEach(u);var d=function(f){!f||c.has(f)||Array.prototype.forEach.call(f.children,function(m){if(l.has(m))d(m);else try{var p=m.getAttribute(s),w=p!==null&&p!=="false",h=(fo.get(m)||0)+1,g=(a.get(m)||0)+1;fo.set(m,h),a.set(m,g),o.push(m),h===1&&w&&Tc.set(m,!0),g===1&&m.setAttribute(r,"true"),w||m.setAttribute(s,"true")}catch(v){console.error("aria-hidden: cannot operate on ",m,v)}})};return d(e),l.clear(),Bf++,function(){o.forEach(function(f){var m=fo.get(f)-1,p=a.get(f)-1;fo.set(f,m),a.set(f,p),m||(Tc.has(f)||f.removeAttribute(s),Tc.delete(f)),p||f.removeAttribute(r)}),Bf--,Bf||(fo=new WeakMap,fo=new WeakMap,Tc=new WeakMap,Ac={})}},$S=function(t,e,r){r===void 0&&(r="data-aria-hidden");var s=Array.from(Array.isArray(t)?t:[t]),n=sO(t);return n?(s.push.apply(s,Array.from(n.querySelectorAll("[aria-live], script"))),oO(s,n,r,"aria-hidden")):function(){return null}},Ud="Dialog",[FS,UF]=fs(Ud),[iO,cn]=FS(Ud),LS=t=>{const{__scopeDialog:e,children:r,open:s,defaultOpen:n,onOpenChange:a,modal:o=!0}=t,l=x.useRef(null),c=x.useRef(null),[u,d]=Ka({prop:s,defaultProp:n??!1,onChange:a,caller:Ud});return i.jsx(iO,{scope:e,triggerRef:l,contentRef:c,contentId:ea(),titleId:ea(),descriptionId:ea(),open:u,onOpenChange:d,onOpenToggle:x.useCallback(()=>d(f=>!f),[d]),modal:o,children:r})};LS.displayName=Ud;var US="DialogTrigger",lO=x.forwardRef((t,e)=>{const{__scopeDialog:r,...s}=t,n=cn(US,r),a=et(e,n.triggerRef);return i.jsx(Ae.button,{type:"button","aria-haspopup":"dialog","aria-expanded":n.open,"aria-controls":n.contentId,"data-state":Uv(n.open),...s,ref:a,onClick:_e(t.onClick,n.onOpenToggle)})});lO.displayName=US;var Fv="DialogPortal",[cO,zS]=FS(Fv,{forceMount:void 0}),VS=t=>{const{__scopeDialog:e,forceMount:r,children:s,container:n}=t,a=cn(Fv,e);return i.jsx(cO,{scope:e,forceMount:r,children:x.Children.map(s,o=>i.jsx(da,{present:r||a.open,children:i.jsx(kd,{asChild:!0,container:n,children:o})}))})};VS.displayName=Fv;var Uu="DialogOverlay",qS=x.forwardRef((t,e)=>{const r=zS(Uu,t.__scopeDialog),{forceMount:s=r.forceMount,...n}=t,a=cn(Uu,t.__scopeDialog);return a.modal?i.jsx(da,{present:s||a.open,children:i.jsx(dO,{...n,ref:e})}):null});qS.displayName=Uu;var uO=fi("DialogOverlay.RemoveScroll"),dO=x.forwardRef((t,e)=>{const{__scopeDialog:r,...s}=t,n=cn(Uu,r);return i.jsx($v,{as:uO,allowPinchZoom:!0,shards:[n.contentRef],children:i.jsx(Ae.div,{"data-state":Uv(n.open),...s,ref:e,style:{pointerEvents:"auto",...s.style}})})}),Ga="DialogContent",HS=x.forwardRef((t,e)=>{const r=zS(Ga,t.__scopeDialog),{forceMount:s=r.forceMount,...n}=t,a=cn(Ga,t.__scopeDialog);return i.jsx(da,{present:s||a.open,children:a.modal?i.jsx(fO,{...n,ref:e}):i.jsx(hO,{...n,ref:e})})});HS.displayName=Ga;var fO=x.forwardRef((t,e)=>{const r=cn(Ga,t.__scopeDialog),s=x.useRef(null),n=et(e,r.contentRef,s);return x.useEffect(()=>{const a=s.current;if(a)return $S(a)},[]),i.jsx(BS,{...t,ref:n,trapFocus:r.open,disableOutsidePointerEvents:!0,onCloseAutoFocus:_e(t.onCloseAutoFocus,a=>{var o;a.preventDefault(),(o=r.triggerRef.current)==null||o.focus()}),onPointerDownOutside:_e(t.onPointerDownOutside,a=>{const o=a.detail.originalEvent,l=o.button===0&&o.ctrlKey===!0;(o.button===2||l)&&a.preventDefault()}),onFocusOutside:_e(t.onFocusOutside,a=>a.preventDefault())})}),hO=x.forwardRef((t,e)=>{const r=cn(Ga,t.__scopeDialog),s=x.useRef(!1),n=x.useRef(!1);return i.jsx(BS,{...t,ref:e,trapFocus:!1,disableOutsidePointerEvents:!1,onCloseAutoFocus:a=>{var o,l;(o=t.onCloseAutoFocus)==null||o.call(t,a),a.defaultPrevented||(s.current||(l=r.triggerRef.current)==null||l.focus(),a.preventDefault()),s.current=!1,n.current=!1},onInteractOutside:a=>{var c,u;(c=t.onInteractOutside)==null||c.call(t,a),a.defaultPrevented||(s.current=!0,a.detail.originalEvent.type==="pointerdown"&&(n.current=!0));const o=a.target;((u=r.triggerRef.current)==null?void 0:u.contains(o))&&a.preventDefault(),a.detail.originalEvent.type==="focusin"&&n.current&&a.preventDefault()}})}),BS=x.forwardRef((t,e)=>{const{__scopeDialog:r,trapFocus:s,onOpenAutoFocus:n,onCloseAutoFocus:a,...o}=t,l=cn(Ga,r),c=x.useRef(null),u=et(e,c);return NS(),i.jsxs(i.Fragment,{children:[i.jsx(Mv,{asChild:!0,loop:!0,trapped:s,onMountAutoFocus:n,onUnmountAutoFocus:a,children:i.jsx(Vl,{role:"dialog",id:l.contentId,"aria-describedby":l.descriptionId,"aria-labelledby":l.titleId,"data-state":Uv(l.open),...o,ref:u,onDismiss:()=>l.onOpenChange(!1)})}),i.jsxs(i.Fragment,{children:[i.jsx(pO,{titleId:l.titleId}),i.jsx(vO,{contentRef:c,descriptionId:l.descriptionId})]})]})}),Lv="DialogTitle",WS=x.forwardRef((t,e)=>{const{__scopeDialog:r,...s}=t,n=cn(Lv,r);return i.jsx(Ae.h2,{id:n.titleId,...s,ref:e})});WS.displayName=Lv;var KS="DialogDescription",QS=x.forwardRef((t,e)=>{const{__scopeDialog:r,...s}=t,n=cn(KS,r);return i.jsx(Ae.p,{id:n.descriptionId,...s,ref:e})});QS.displayName=KS;var GS="DialogClose",ZS=x.forwardRef((t,e)=>{const{__scopeDialog:r,...s}=t,n=cn(GS,r);return i.jsx(Ae.button,{type:"button",...s,ref:e,onClick:_e(t.onClick,()=>n.onOpenChange(!1))})});ZS.displayName=GS;function Uv(t){return t?"open":"closed"}var YS="DialogTitleWarning",[zF,JS]=_j(YS,{contentName:Ga,titleName:Lv,docsSlug:"dialog"}),pO=({titleId:t})=>{const e=JS(YS),r=`\`${e.contentName}\` requires a \`${e.titleName}\` for the component to be accessible for screen reader users.
|
|
295
|
+
|
|
296
|
+
If you want to hide the \`${e.titleName}\`, you can wrap it with our VisuallyHidden component.
|
|
297
|
+
|
|
298
|
+
For more information, see https://radix-ui.com/primitives/docs/components/${e.docsSlug}`;return x.useEffect(()=>{t&&(document.getElementById(t)||console.error(r))},[r,t]),null},mO="DialogDescriptionWarning",vO=({contentRef:t,descriptionId:e})=>{const s=`Warning: Missing \`Description\` or \`aria-describedby={undefined}\` for {${JS(mO).contentName}}.`;return x.useEffect(()=>{var a;const n=(a=t.current)==null?void 0:a.getAttribute("aria-describedby");e&&n&&(document.getElementById(e)||console.warn(s))},[s,t,e]),null},gO=LS,yO=VS,XS=qS,e_=HS,t_=WS,r_=QS,xO=ZS;const ao=gO,wO=yO,n_=x.forwardRef(({className:t,...e},r)=>i.jsx(XS,{ref:r,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",t),...e}));n_.displayName=XS.displayName;const fa=x.forwardRef(({className:t,children:e,...r},s)=>i.jsxs(wO,{children:[i.jsx(n_,{}),i.jsxs(e_,{ref:s,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",t),...r,children:[e,i.jsxs(xO,{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:[i.jsx(Iu,{className:"h-4 w-4"}),i.jsx("span",{className:"sr-only",children:"Close"})]})]})]}));fa.displayName=e_.displayName;const ha=({className:t,...e})=>i.jsx("div",{className:Te("flex flex-col space-y-1.5 text-center sm:text-left",t),...e});ha.displayName="DialogHeader";const pa=x.forwardRef(({className:t,...e},r)=>i.jsx(t_,{ref:r,className:Te("text-lg font-semibold leading-none tracking-tight",t),...e}));pa.displayName=t_.displayName;const Ci=x.forwardRef(({className:t,...e},r)=>i.jsx(r_,{ref:r,className:Te("text-sm text-muted-foreground",t),...e}));Ci.displayName=r_.displayName;const tt=x.forwardRef(({className:t,type:e,...r},s)=>i.jsx("input",{type:e,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",t),ref:s,...r}));tt.displayName="Input";const Gn=x.forwardRef(({className:t,...e},r)=>i.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",t),ref:r,...e}));Gn.displayName="Textarea";var bO="Label",s_=x.forwardRef((t,e)=>i.jsx(Ae.label,{...t,ref:e,onMouseDown:r=>{var n;r.target.closest("button, input, select, textarea")||((n=t.onMouseDown)==null||n.call(t,r),!r.defaultPrevented&&r.detail>1&&r.preventDefault())}}));s_.displayName=bO;var a_=s_;const SO=jd("text-sm font-medium leading-none peer-disabled:cursor-not-allowed peer-disabled:opacity-70"),Ke=x.forwardRef(({className:t,...e},r)=>i.jsx(a_,{ref:r,className:Te(SO(),t),...e}));Ke.displayName=a_.displayName;var _O=x.createContext(void 0);function zv(t){const e=x.useContext(_O);return t||e||"ltr"}var Wf="rovingFocusGroup.onEntryFocus",EO={bubbles:!1,cancelable:!0},Bl="RovingFocusGroup",[_p,o_,CO]=yv(Bl),[kO,i_]=fs(Bl,[CO]),[PO,NO]=kO(Bl),l_=x.forwardRef((t,e)=>i.jsx(_p.Provider,{scope:t.__scopeRovingFocusGroup,children:i.jsx(_p.Slot,{scope:t.__scopeRovingFocusGroup,children:i.jsx(jO,{...t,ref:e})})}));l_.displayName=Bl;var jO=x.forwardRef((t,e)=>{const{__scopeRovingFocusGroup:r,orientation:s,loop:n=!1,dir:a,currentTabStopId:o,defaultCurrentTabStopId:l,onCurrentTabStopIdChange:c,onEntryFocus:u,preventScrollOnEntryFocus:d=!1,...f}=t,m=x.useRef(null),p=et(e,m),w=zv(a),[h,g]=Ka({prop:o,defaultProp:l??null,onChange:c,caller:Bl}),[v,y]=x.useState(!1),b=Ur(u),S=o_(r),E=x.useRef(!1),[k,R]=x.useState(0);return x.useEffect(()=>{const T=m.current;if(T)return T.addEventListener(Wf,b),()=>T.removeEventListener(Wf,b)},[b]),i.jsx(PO,{scope:r,orientation:s,dir:w,loop:n,currentTabStopId:h,onItemFocus:x.useCallback(T=>g(T),[g]),onItemShiftTab:x.useCallback(()=>y(!0),[]),onFocusableItemAdd:x.useCallback(()=>R(T=>T+1),[]),onFocusableItemRemove:x.useCallback(()=>R(T=>T-1),[]),children:i.jsx(Ae.div,{tabIndex:v||k===0?-1:0,"data-orientation":s,...f,ref:p,style:{outline:"none",...t.style},onMouseDown:_e(t.onMouseDown,()=>{E.current=!0}),onFocus:_e(t.onFocus,T=>{const N=!E.current;if(T.target===T.currentTarget&&N&&!v){const O=new CustomEvent(Wf,EO);if(T.currentTarget.dispatchEvent(O),!O.defaultPrevented){const j=S().filter(U=>U.focusable),_=j.find(U=>U.active),A=j.find(U=>U.id===h),z=[_,A,...j].filter(Boolean).map(U=>U.ref.current);d_(z,d)}}E.current=!1}),onBlur:_e(t.onBlur,()=>y(!1))})})}),c_="RovingFocusGroupItem",u_=x.forwardRef((t,e)=>{const{__scopeRovingFocusGroup:r,focusable:s=!0,active:n=!1,tabStopId:a,children:o,...l}=t,c=ea(),u=a||c,d=NO(c_,r),f=d.currentTabStopId===u,m=o_(r),{onFocusableItemAdd:p,onFocusableItemRemove:w,currentTabStopId:h}=d;return x.useEffect(()=>{if(s)return p(),()=>w()},[s,p,w]),i.jsx(_p.ItemSlot,{scope:r,id:u,focusable:s,active:n,children:i.jsx(Ae.span,{tabIndex:f?0:-1,"data-orientation":d.orientation,...l,ref:e,onMouseDown:_e(t.onMouseDown,g=>{s?d.onItemFocus(u):g.preventDefault()}),onFocus:_e(t.onFocus,()=>d.onItemFocus(u)),onKeyDown:_e(t.onKeyDown,g=>{if(g.key==="Tab"&&g.shiftKey){d.onItemShiftTab();return}if(g.target!==g.currentTarget)return;const v=AO(g,d.orientation,d.dir);if(v!==void 0){if(g.metaKey||g.ctrlKey||g.altKey||g.shiftKey)return;g.preventDefault();let b=m().filter(S=>S.focusable).map(S=>S.ref.current);if(v==="last")b.reverse();else if(v==="prev"||v==="next"){v==="prev"&&b.reverse();const S=b.indexOf(g.currentTarget);b=d.loop?OO(b,S+1):b.slice(S+1)}setTimeout(()=>d_(b))}}),children:typeof o=="function"?o({isCurrentTabStop:f,hasTabStop:h!=null}):o})})});u_.displayName=c_;var RO={ArrowLeft:"prev",ArrowUp:"prev",ArrowRight:"next",ArrowDown:"next",PageUp:"first",Home:"first",PageDown:"last",End:"last"};function TO(t,e){return e!=="rtl"?t:t==="ArrowLeft"?"ArrowRight":t==="ArrowRight"?"ArrowLeft":t}function AO(t,e,r){const s=TO(t.key,r);if(!(e==="vertical"&&["ArrowLeft","ArrowRight"].includes(s))&&!(e==="horizontal"&&["ArrowUp","ArrowDown"].includes(s)))return RO[s]}function d_(t,e=!1){const r=document.activeElement;for(const s of t)if(s===r||(s.focus({preventScroll:e}),document.activeElement!==r))return}function OO(t,e){return t.map((r,s)=>t[(e+s)%t.length])}var IO=l_,DO=u_,zd="Tabs",[MO,VF]=fs(zd,[i_]),f_=i_(),[$O,Vv]=MO(zd),h_=x.forwardRef((t,e)=>{const{__scopeTabs:r,value:s,onValueChange:n,defaultValue:a,orientation:o="horizontal",dir:l,activationMode:c="automatic",...u}=t,d=zv(l),[f,m]=Ka({prop:s,onChange:n,defaultProp:a??"",caller:zd});return i.jsx($O,{scope:r,baseId:ea(),value:f,onValueChange:m,orientation:o,dir:d,activationMode:c,children:i.jsx(Ae.div,{dir:d,"data-orientation":o,...u,ref:e})})});h_.displayName=zd;var p_="TabsList",m_=x.forwardRef((t,e)=>{const{__scopeTabs:r,loop:s=!0,...n}=t,a=Vv(p_,r),o=f_(r);return i.jsx(IO,{asChild:!0,...o,orientation:a.orientation,dir:a.dir,loop:s,children:i.jsx(Ae.div,{role:"tablist","aria-orientation":a.orientation,...n,ref:e})})});m_.displayName=p_;var v_="TabsTrigger",g_=x.forwardRef((t,e)=>{const{__scopeTabs:r,value:s,disabled:n=!1,...a}=t,o=Vv(v_,r),l=f_(r),c=w_(o.baseId,s),u=b_(o.baseId,s),d=s===o.value;return i.jsx(DO,{asChild:!0,...l,focusable:!n,active:d,children:i.jsx(Ae.button,{type:"button",role:"tab","aria-selected":d,"aria-controls":u,"data-state":d?"active":"inactive","data-disabled":n?"":void 0,disabled:n,id:c,...a,ref:e,onMouseDown:_e(t.onMouseDown,f=>{!n&&f.button===0&&f.ctrlKey===!1?o.onValueChange(s):f.preventDefault()}),onKeyDown:_e(t.onKeyDown,f=>{[" ","Enter"].includes(f.key)&&o.onValueChange(s)}),onFocus:_e(t.onFocus,()=>{const f=o.activationMode!=="manual";!d&&!n&&f&&o.onValueChange(s)})})})});g_.displayName=v_;var y_="TabsContent",x_=x.forwardRef((t,e)=>{const{__scopeTabs:r,value:s,forceMount:n,children:a,...o}=t,l=Vv(y_,r),c=w_(l.baseId,s),u=b_(l.baseId,s),d=s===l.value,f=x.useRef(d);return x.useEffect(()=>{const m=requestAnimationFrame(()=>f.current=!1);return()=>cancelAnimationFrame(m)},[]),i.jsx(da,{present:n||d,children:({present:m})=>i.jsx(Ae.div,{"data-state":d?"active":"inactive","data-orientation":l.orientation,role:"tabpanel","aria-labelledby":c,hidden:!m,id:u,tabIndex:0,...o,ref:e,style:{...t.style,animationDuration:f.current?"0s":void 0},children:m&&a})})});x_.displayName=y_;function w_(t,e){return`${t}-trigger-${e}`}function b_(t,e){return`${t}-content-${e}`}var FO=h_,S_=m_,__=g_,E_=x_;const LO=FO,C_=x.forwardRef(({className:t,...e},r)=>i.jsx(S_,{ref:r,className:Te("inline-flex h-10 items-center justify-center rounded-md bg-muted p-1 text-muted-foreground",t),...e}));C_.displayName=S_.displayName;const Ep=x.forwardRef(({className:t,...e},r)=>i.jsx(__,{ref:r,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",t),...e}));Ep.displayName=__.displayName;const Cp=x.forwardRef(({className:t,...e},r)=>i.jsx(E_,{ref:r,className:Te("mt-2 ring-offset-background focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-ring focus-visible:ring-offset-2",t),...e}));Cp.displayName=E_.displayName;function il(t){return typeof t=="object"&&t!==null&&!Array.isArray(t)}function k_(t){return il(t)&&typeof t.command=="string"}function Kf(t){return!il(t)||Object.keys(t).length===0?!1:Object.values(t).every(k_)}function UO(t){let e=t.trim();return e.startsWith("```")?e.replace(/^```(?:json)?\s*\n?/i,"").replace(/\n?```\s*$/,"").trim():e}function zO(t){if(!il(t))throw new Error("Configuration must be a JSON object");if(il(t.config)&&Kf(t.config.mcpServers))return{mcpServers:t.config.mcpServers};if(Kf(t.mcpServers))return{mcpServers:t.mcpServers};if(il(t)&&typeof t.command=="string"){const e=typeof t.name=="string"&&t.name.trim()?t.name.trim():"local-server",{name:r,...s}=t;if(!k_(s))throw new Error("Missing or invalid command");return{mcpServers:{[e]:s}}}if(Kf(t))return{mcpServers:t};throw new Error(`Invalid configuration: expected a top-level "mcpServers" object. Example:
|
|
299
|
+
{
|
|
300
|
+
"mcpServers": {
|
|
301
|
+
"google-drive": {
|
|
302
|
+
"command": "npx",
|
|
303
|
+
"args": ["-y", "@piotr-agier/google-drive-mcp"]
|
|
304
|
+
}
|
|
305
|
+
}
|
|
306
|
+
}`)}function VO(t){let e;try{e=JSON.parse(UO(t))}catch(r){throw new Error(`Failed to parse JSON: ${r instanceof Error?r.message:"Unknown error"}`)}return zO(e)}function qO({type:t,open:e,onOpenChange:r}){const[s,n]=x.useState("remote"),[a,o]=x.useState("json"),[l,c]=x.useState(`{
|
|
307
|
+
"mcpServers": {
|
|
308
|
+
"memory": {
|
|
309
|
+
"command": "npx",
|
|
310
|
+
"args": ["-y", "@modelcontextprotocol/server-memory"],
|
|
311
|
+
"env": {
|
|
312
|
+
"MEMORY_FILE_PATH": "/path/to/custom/memory.json"
|
|
313
|
+
}
|
|
314
|
+
}
|
|
315
|
+
}
|
|
316
|
+
}`),[u,d]=x.useState(null),[f,m]=x.useState(null),[p,w]=x.useState(null),[h,g]=x.useState({name:"",type:"mcp",url:"http://localhost:8000/mcp",description:"",headers_enabled:!1,headers:{},cardColor:wr}),[v,y]=x.useState(`{
|
|
317
|
+
|
|
318
|
+
}`),[b,S]=x.useState(null),[E,k]=x.useState({name:"",type:"local-mcp",command:"",args:[""],env:{},description:"",cardColor:wr}),[R,T]=x.useState({name:"",type:"a2a",manifest_url:"http://localhost:8001/.well-known/a2a/manifest.json",description:"",cardColor:wr}),N=yr(),{toast:O}=or(),j=()=>{try{m(null);const L=VO(l),Q=Object.entries(L.mcpServers);if(Q.length===0)throw new Error("No MCP servers found in configuration");if(Q.length>1)throw new Error("Multiple servers not supported. Please configure one server at a time.");const[oe,Z]=Q[0],{command:ce,args:Ee,env:ve,description:te}=Z;if(!ce||typeof ce!="string")throw new Error("Missing or invalid command");if(!Ee||!Array.isArray(Ee))throw new Error("Missing or invalid args array");const we={name:oe,command:ce,args:Ee.map(String),env:ve&&typeof ve=="object"?ve:void 0,description:te&&typeof te=="string"?te:void 0};d(we),o("review"),k({name:we.name,type:"local-mcp",command:we.command,args:we.args,env:we.env||{},description:we.description||"",cardColor:wr}),_(oe)}catch(L){m(L instanceof Error?L.message:"Failed to parse JSON"),d(null)}},_=async L=>{try{const Z=((await Oe("GET","/api/services")).data||[]).find(ce=>ce.name===L);w(Z?L:null)}catch(Q){console.error("Failed to check name conflict:",Q)}},A=async L=>{await _(L)},C=At({mutationFn:async L=>{if(t==="mcp"&&s==="local"){const Q={mcpServers:{[L.name]:{command:L.command,args:L.args.filter(oe=>oe.trim()!==""),...Object.keys(L.env).length>0&&{env:L.env}}}};return console.log("Importing local MCP server:",Q),Oe("POST","/api/local-mcp/import",{config:JSON.stringify(Q)})}else{const Q={name:L.name,type:t,url:t==="mcp"?L.url:L.manifest_url,description:L.description,cardColor:L.cardColor,...L.headers_enabled&&{headers:L.headers}};return console.log("Sending service data:",Q),Oe("POST","/api/services",Q)}},onSuccess:()=>{N.invalidateQueries({queryKey:["/api/services"]}),N.invalidateQueries({queryKey:["/api/collection/warnings"]}),O({title:"Service registered successfully!",description:`${(t==="mcp"?s==="remote"?h:E:R).name} has been added to your collection.`}),U()},onError:L=>{var Q;console.error("Registration failed:",L),console.error("Error details:",{message:L==null?void 0:L.message,name:L==null?void 0:L.name,stack:L==null?void 0:L.stack,toString:L==null?void 0:L.toString(),constructor:(Q=L==null?void 0:L.constructor)==null?void 0:Q.name}),O({title:"Registration failed",description:(L==null?void 0:L.message)||"Failed to register service. Please try again.",variant:"destructive"})}}),z=async()=>{if(t==="mcp"&&s==="local"){if(a==="json")j();else if(a==="review"){if(await A(E.name),p){O({title:"Name Conflict",description:`A service with the name "${E.name}" already exists. Please choose a different name.`,variant:"destructive"});return}C.mutate(E)}}else{const L=t==="mcp"?s==="remote"?h:E:R;if(await A(L.name),p){O({title:"Name Conflict",description:`A service with the name "${L.name}" already exists. Please choose a different name.`,variant:"destructive"});return}if(t==="mcp"&&s==="remote"&&h.headers_enabled){const Q=F();if(Q===null)return;C.mutate({...h,headers:Q});return}C.mutate(L)}},U=()=>{o("json"),c(`{
|
|
319
|
+
"mcpServers": {
|
|
320
|
+
"memory": {
|
|
321
|
+
"command": "npx",
|
|
322
|
+
"args": ["-y", "@modelcontextprotocol/server-memory"],
|
|
323
|
+
"env": {
|
|
324
|
+
"MEMORY_FILE_PATH": "/path/to/custom/memory.json"
|
|
325
|
+
}
|
|
326
|
+
}
|
|
327
|
+
}
|
|
328
|
+
}`),d(null),m(null),w(null),g({name:"",type:"mcp",url:"http://localhost:8000/mcp",description:"",headers_enabled:!1,headers:{},cardColor:wr}),y(`{
|
|
329
|
+
|
|
330
|
+
}`),S(null),k({name:"",type:"local-mcp",command:"",args:[""],env:{},description:"",cardColor:wr}),T({name:"",type:"a2a",manifest_url:"http://localhost:8001/.well-known/a2a/manifest.json",description:"",cardColor:wr}),r(!1)},K=(L,Q)=>{g(oe=>({...oe,[L]:Q}))},$=L=>{K("headers_enabled",L),L&&v.trim()===`{
|
|
331
|
+
|
|
332
|
+
}`&&y(`{
|
|
333
|
+
"Authorization": "Bearer "
|
|
334
|
+
}`),L||S(null)},F=()=>{const L=v.trim();if(!L||L==="{}")return{};try{const Q=JSON.parse(L);if(typeof Q!="object"||Q===null||Array.isArray(Q))return S('Headers must be a JSON object (e.g. {"Authorization": "Bearer token"})'),null;for(const[oe,Z]of Object.entries(Q))if(typeof Z!="string")return S(`Header "${oe}" must be a string value`),null;return S(null),Q}catch{return S("Invalid JSON — fix syntax before registering"),null}},V=(L,Q)=>{k(oe=>({...oe,[L]:Q}))},ae=(L,Q)=>{T(oe=>({...oe,[L]:Q}))},se=()=>{if(t==="mcp"&&s==="local"){if(a==="json")return"Parse Configuration";if(a==="review")return p?"Register Anyway":"Register Service"}return"Register Service"},W=()=>{var L,Q;if(t==="mcp"&&s==="local"){if(a==="json")return!l.trim();if(a==="review")return!E.name.trim()||!E.command.trim()}else{const oe=t==="mcp"?s==="remote"?h:E:R;return!oe.name.trim()||t==="mcp"&&s==="remote"&&!((L=oe.url)!=null&&L.trim())||t==="a2a"&&!((Q=oe.manifest_url)!=null&&Q.trim())}return!1};return i.jsx(ao,{open:e,onOpenChange:r,children:i.jsxs(fa,{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:[i.jsxs(ha,{children:[i.jsxs(pa,{className:"text-2xl font-bold flex items-center",style:{background:"linear-gradient(to right, #C4B643, #D4C760)",WebkitBackgroundClip:"text",WebkitTextFillColor:"transparent",backgroundClip:"text"},children:[t==="mcp"?i.jsx(Au,{className:"w-6 h-6 mr-3",style:{color:"#92E4DD"}}):i.jsx(y2,{className:"w-6 h-6 mr-3",style:{color:"#92E4DD"}}),"Register ",t==="mcp"?"MCP Server":"A2A Agent"]}),i.jsx(Ci,{className:"mt-2",style:{color:"#92E4DD",opacity:.8},children:t==="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."})]}),t==="mcp"?i.jsxs(LO,{value:s,onValueChange:L=>n(L),className:"w-full",children:[i.jsxs(C_,{className:"grid w-full grid-cols-2 bg-white/10 border border-white/20",children:[i.jsxs(Ep,{value:"remote",className:"data-[state=active]:bg-white/20 data-[state=active]:text-white text-gray-400",children:[i.jsx(Au,{className:"w-4 h-4 mr-2"}),"Remote MCP"]}),i.jsxs(Ep,{value:"local",className:"data-[state=active]:bg-white/20 data-[state=active]:text-white text-gray-400",children:[i.jsx(k2,{className:"w-4 h-4 mr-2"}),"Local MCP"]})]}),i.jsxs(Cp,{value:"remote",className:"space-y-4 mt-4",children:[i.jsxs("div",{children:[i.jsx(Ke,{htmlFor:"name",className:"text-sm font-semibold",style:{color:"#92E4DD"},children:"Server Name"}),i.jsx(tt,{id:"name",placeholder:"e.g., Database Tools",value:h.name,onChange:L=>{K("name",L.target.value),L.target.value.trim()?A(L.target.value):w(null)},className:"bg-white/10 border-white/20 text-white placeholder-gray-400",required:!0,"data-testid":"input-service-name"}),p&&i.jsxs("div",{className:"flex items-center gap-2 mt-1 text-red-400 text-sm",children:[i.jsx(rn,{className:"w-4 h-4"}),i.jsx("span",{children:"A service with this name already exists"})]})]}),i.jsxs("div",{children:[i.jsx(Ke,{htmlFor:"url",className:"text-sm font-semibold",style:{color:"#92E4DD"},children:"MCP URL"}),i.jsx(tt,{id:"url",type:"url",placeholder:"http://localhost:8080/mcp or https://mcp.notion.com/mcp",value:h.url,onChange:L=>K("url",L.target.value),className:"bg-white/10 border-white/20 text-white placeholder-gray-400",required:!0,"data-testid":"input-mcp-url"}),i.jsxs("div",{className:"mt-1 text-xs text-gray-400",children:[i.jsx("p",{children:"Supported formats:"}),i.jsxs("ul",{className:"list-disc list-inside ml-2 space-y-1",children:[i.jsxs("li",{children:["HTTP MCP: ",i.jsx("code",{children:"http://localhost:8080/mcp"})]}),i.jsxs("li",{children:["SSE MCP: ",i.jsx("code",{children:"https://be.omnimcp.ai/api/v1/mcp/.../sse"})]}),i.jsxs("li",{children:["Notion MCP: ",i.jsx("code",{children:"https://mcp.notion.com/mcp"})]})]})]})]}),i.jsxs("div",{children:[i.jsx(Ke,{htmlFor:"description",className:"text-sm font-semibold",style:{color:"#92E4DD"},children:"Description"}),i.jsx(Gn,{id:"description",placeholder:"Brief description of capabilities...",value:h.description,onChange:L=>K("description",L.target.value),rows:3,className:"bg-white/10 border-white/20 text-white placeholder-gray-400 resize-none","data-testid":"textarea-description"})]})]}),i.jsxs(Cp,{value:"local",className:"space-y-4 mt-4",children:[a==="json"&&i.jsxs("div",{className:"space-y-4",children:[i.jsxs("div",{children:[i.jsx(Ke,{htmlFor:"local-json",className:"text-sm font-semibold",style:{color:"#92E4DD"},children:"Local MCP Configuration (JSON)"}),i.jsx(Gn,{id:"local-json",placeholder:`{
|
|
335
|
+
"mcpServers": {
|
|
336
|
+
"memory": {
|
|
337
|
+
"command": "npx",
|
|
338
|
+
"args": ["-y", "@modelcontextprotocol/server-memory"]
|
|
339
|
+
}
|
|
340
|
+
}
|
|
341
|
+
}`,value:l,onChange:L=>c(L.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"}),i.jsxs("div",{className:"mt-2 text-xs text-gray-400",children:[i.jsx("p",{children:"Enter your local MCP server configuration in JSON format."}),i.jsx("p",{children:"Example:"}),i.jsx("pre",{className:"bg-white/10 p-2 rounded-md text-xs text-gray-300",children:`{
|
|
342
|
+
"mcpServers": {
|
|
343
|
+
"memory": {
|
|
344
|
+
"command": "npx",
|
|
345
|
+
"args": ["-y", "@modelcontextprotocol/server-memory"],
|
|
346
|
+
"env": {
|
|
347
|
+
"MEMORY_FILE_PATH": "/path/to/custom/memory.json"
|
|
348
|
+
}
|
|
349
|
+
}
|
|
350
|
+
}
|
|
351
|
+
}`})]})]}),i.jsxs(me,{type:"button",className:"flex-1 border",style:{background:"linear-gradient(135deg, #C4B643, #D4C760)",borderColor:"#C4B643",color:"#0A0A07"},onClick:j,disabled:!l.trim()||l.trim().length<10,"data-testid":"button-parse-json",children:[i.jsx(pp,{className:"w-4 h-4 mr-2",style:{color:"#0A0A07"}}),"Parse Configuration"]})]}),a==="review"&&i.jsxs("div",{className:"space-y-4",children:[i.jsxs("div",{children:[i.jsx(Ke,{htmlFor:"local-name",className:"text-sm font-semibold",style:{color:"#92E4DD"},children:"Server Name"}),i.jsx(tt,{id:"local-name",placeholder:"e.g., Memory Server",value:E.name,onChange:L=>{V("name",L.target.value),L.target.value.trim()?A(L.target.value):w(null)},className:"bg-white/10 border-white/20 text-white placeholder-gray-400",required:!0,"data-testid":"input-local-service-name"}),p&&i.jsxs("div",{className:"mt-2 text-xs text-red-400 flex items-center",children:[i.jsx(rn,{className:"w-4 h-4 mr-1"}),'A service with the name "',p,'" already exists.']})]}),i.jsxs("div",{children:[i.jsx(Ke,{htmlFor:"command",className:"text-sm font-semibold",style:{color:"#92E4DD"},children:"Command"}),i.jsx(tt,{id:"command",placeholder:"e.g., npx, python, node",value:E.command,onChange:L=>V("command",L.target.value),className:"bg-white/10 border-white/20 text-white placeholder-gray-400",required:!0,"data-testid":"input-command"}),i.jsx("div",{className:"mt-1 text-xs text-gray-400",children:"The command to execute (e.g., npx, python, node)"})]}),i.jsxs("div",{children:[i.jsx(Ke,{className:"text-sm font-semibold",style:{color:"#92E4DD"},children:"Arguments"}),E.args.map((L,Q)=>i.jsxs("div",{className:"flex gap-2 mb-2",children:[i.jsx(tt,{placeholder:`Argument ${Q+1}`,value:L,onChange:oe=>{const Z=[...E.args];Z[Q]=oe.target.value,V("args",Z)},className:"bg-white/10 border-white/20 text-white placeholder-gray-400","data-testid":`input-arg-${Q}`}),Q===E.args.length-1&&i.jsx(me,{type:"button",size:"sm",onClick:()=>V("args",[...E.args,""]),className:"bg-white/20 hover:bg-white/30 text-white",children:i.jsx(Vs,{className:"w-4 h-4"})}),E.args.length>1&&i.jsx(me,{type:"button",size:"sm",variant:"destructive",onClick:()=>{const oe=E.args.filter((Z,ce)=>ce!==Q);V("args",oe)},className:"bg-red-500/80 hover:bg-red-500 text-white",children:i.jsx(Iu,{className:"w-4 h-4"})})]},Q)),i.jsx("div",{className:"mt-1 text-xs text-gray-400",children:"Command arguments (e.g., -y, @modelcontextprotocol/server-memory)"})]}),i.jsxs("div",{children:[i.jsx(Ke,{className:"text-sm font-semibold",style:{color:"#92E4DD"},children:"Environment Variables"}),Object.entries(E.env).length===0?i.jsx("div",{className:"text-gray-400 text-sm italic",children:"No environment variables configured"}):i.jsx("div",{className:"space-y-2",children:Object.entries(E.env).map(([L,Q],oe)=>i.jsxs("div",{className:"flex gap-2",children:[i.jsx(tt,{placeholder:"Variable name",value:L,onChange:Z=>{const ce={...E.env};delete ce[L],ce[Z.target.value]=Q,V("env",ce)},className:"bg-white/10 border-white/20 text-white placeholder-gray-400","data-testid":`input-env-key-${oe}`}),i.jsx(tt,{placeholder:"Value",value:Q,onChange:Z=>{const ce={...E.env};ce[L]=Z.target.value,V("env",ce)},className:"bg-white/10 border-white/20 text-white placeholder-gray-400","data-testid":`input-env-value-${oe}`}),i.jsx(me,{type:"button",size:"sm",variant:"destructive",onClick:()=>{const Z={...E.env};delete Z[L],V("env",Z)},className:"bg-red-500/80 hover:bg-red-500 text-white",children:i.jsx(Iu,{className:"w-4 h-4"})})]},oe))}),i.jsxs(me,{type:"button",size:"sm",onClick:()=>{const L={...E.env};L[""]="",V("env",L)},className:"mt-2 bg-white/20 hover:bg-white/30 text-white",children:[i.jsx(Vs,{className:"w-4 h-4 mr-2"}),"Add Environment Variable"]}),i.jsx("div",{className:"mt-1 text-xs text-gray-400",children:"Environment variables for the MCP server process"})]}),i.jsxs("div",{children:[i.jsx(Ke,{htmlFor:"local-description",className:"text-sm font-semibold",style:{color:"#92E4DD"},children:"Description"}),i.jsx(Gn,{id:"local-description",placeholder:"Brief description of capabilities...",value:E.description,onChange:L=>V("description",L.target.value),rows:3,className:"bg-white/10 border-white/20 text-white placeholder-gray-400 resize-none","data-testid":"textarea-local-description"})]}),i.jsxs("div",{className:"flex gap-3",children:[i.jsx(me,{type:"button",variant:"outline",className:"flex-1 border-white/20 text-white hover:bg-white/10",onClick:()=>o("json"),"data-testid":"button-back-to-json",children:"← Back to JSON"}),i.jsxs(me,{type:"button",variant:"ghost",className:`flex-1 border-2 hover:opacity-90 ${bn}`,style:Sn(wr),onClick:z,disabled:W(),"data-testid":"button-register",children:[i.jsx(Vs,{className:"w-4 h-4 mr-2"}),C.isPending?"Registering...":se()]})]})]}),a==="complete"&&i.jsxs("div",{className:"text-center py-8",children:[i.jsx(pp,{className:"w-16 h-16 text-green-500 mx-auto mb-4"}),i.jsx("h3",{className:"text-xl font-bold mb-2",style:{color:"#92E4DD"},children:"Local MCP Registered!"}),i.jsx("p",{className:"text-gray-400 mb-4",children:"Your local MCP server has been successfully registered."}),i.jsx(me,{type:"button",className:"flex-1 border",style:{background:"linear-gradient(135deg, #C4B643, #D4C760)",borderColor:"#C4B643",color:"#0A0A07"},onClick:U,"data-testid":"button-close",children:"Close"})]})]})]}):i.jsxs("div",{className:"space-y-4",children:[i.jsxs("div",{children:[i.jsx(Ke,{htmlFor:"name",className:"text-sm font-semibold",style:{color:"#92E4DD"},children:"Agent Name"}),i.jsx(tt,{id:"name",placeholder:"e.g., Code Assistant",value:R.name,onChange:L=>{ae("name",L.target.value),L.target.value.trim()?A(L.target.value):w(null)},className:"bg-white/10 border-white/20 text-white placeholder-gray-400",required:!0,"data-testid":"input-service-name"}),p&&i.jsxs("div",{className:"flex items-center gap-2 mt-1 text-red-400 text-sm",children:[i.jsx(rn,{className:"w-4 h-4"}),i.jsx("span",{children:"A service with this name already exists"})]})]}),i.jsxs("div",{children:[i.jsx(Ke,{htmlFor:"manifest_url",className:"text-sm font-semibold",style:{color:"#92E4DD"},children:"Manifest URL"}),i.jsx(tt,{id:"manifest_url",type:"url",placeholder:"http://localhost:8001/.well-known/a2a/manifest.json",value:R.manifest_url,onChange:L=>ae("manifest_url",L.target.value),className:"bg-white/10 border-white/20 text-white placeholder-gray-400",required:!0,"data-testid":"input-manifest-url"})]}),i.jsxs("div",{children:[i.jsx(Ke,{htmlFor:"description",className:"text-sm font-semibold",style:{color:"#92E4DD"},children:"Description"}),i.jsx(Gn,{id:"description",placeholder:"Brief description of capabilities...",value:R.description,onChange:L=>ae("description",L.target.value),rows:3,className:"bg-white/10 border-white/20 text-white placeholder-gray-400 resize-none","data-testid":"textarea-description"})]})]}),t==="mcp"&&s==="remote"&&i.jsxs("div",{className:"space-y-4 border border-white/10 rounded-lg p-4",children:[i.jsxs("div",{className:"flex items-center space-x-2",children:[i.jsx("input",{type:"checkbox",id:"headers_enabled",checked:h.headers_enabled,onChange:L=>$(L.target.checked),className:"rounded border-white/20 bg-white/10"}),i.jsx(Ke,{htmlFor:"headers_enabled",className:"text-sm font-semibold",style:{color:"#92E4DD"},children:"🔐 Authentication Required"})]}),i.jsx("div",{className:"text-xs text-gray-400",children:i.jsx("p",{children:"Enable this if your MCP server requires authentication (API keys, tokens, etc.)."})}),h.headers_enabled&&i.jsxs("div",{className:"space-y-3 pl-6",children:[i.jsxs("div",{className:"text-xs text-gray-400 mb-2",children:[i.jsx("p",{children:"Configure HTTP headers for authentication. Common examples:"}),i.jsxs("ul",{className:"list-disc list-inside ml-2 mt-1 space-y-1",children:[i.jsxs("li",{children:[i.jsx("code",{children:"Authorization: Bearer YOUR_TOKEN"})," - For API tokens"]}),i.jsxs("li",{children:[i.jsx("code",{children:"X-API-Key: YOUR_API_KEY"})," - For API keys"]}),i.jsxs("li",{children:[i.jsx("code",{children:"X-Custom-Header: value"})," - For custom headers"]})]})]}),i.jsxs("div",{children:[i.jsx(Ke,{htmlFor:"headers",className:"text-sm font-semibold",style:{color:"#92E4DD"},children:"HTTP Headers (JSON)"}),i.jsx(Gn,{id:"headers",placeholder:`{
|
|
352
|
+
"Authorization": "Bearer YOUR_TOKEN_HERE",
|
|
353
|
+
"X-API-Key": "YOUR_API_KEY_HERE"
|
|
354
|
+
}`,value:v,onChange:L=>{y(L.target.value),b&&S(null)},onBlur:()=>{v.trim()&&F()},rows:6,className:"bg-white/10 border-white/20 text-white placeholder-gray-400 resize-none font-mono text-xs","data-testid":"textarea-headers"}),b&&i.jsxs("p",{className:"text-red-400 text-xs mt-1 flex items-center gap-1",children:[i.jsx(rn,{className:"w-3 h-3 shrink-0"}),b]}),i.jsx("div",{className:"text-xs text-gray-400 mt-1",children:i.jsx("p",{children:"Enter headers as JSON. Keys are header names, values are header values."})})]})]})]}),f&&i.jsxs("div",{className:"text-red-400 text-sm mt-2",children:[i.jsx(rn,{className:"w-4 h-4 mr-1"}),f]}),p&&i.jsxs("div",{className:"text-red-400 text-sm mt-2",children:[i.jsx(rn,{className:"w-4 h-4 mr-1"}),'A service with the name "',p,'" already exists. You can register it anyway, but it might overwrite the existing one.']}),i.jsxs("div",{className:"flex space-x-3 pt-4",children:[i.jsx(me,{type:"button",variant:"secondary",className:"flex-1 border text-white",style:{background:"#ad095e",borderColor:"#ad095e"},onClick:U,"data-testid":"button-cancel",children:"Cancel"}),!(t==="mcp"&&s==="local")&&i.jsxs(me,{type:"button",variant:"ghost",className:`flex-1 border-2 hover:opacity-90 ${bn}`,style:Sn(wr),disabled:C.isPending||W(),"data-testid":"button-register",onClick:z,children:[i.jsx(Vs,{className:"w-4 h-4 mr-2"}),C.isPending?"Registering...":"Register Service"]})]})]})})}function HO({decks:t,editingDeckId:e,onSelectDeck:r,isLoading:s}){const[n,a]=x.useState(!1),[o,l]=x.useState({name:"",description:""}),c=yr(),{toast:u}=or(),d=At({mutationFn:async g=>Oe("POST","/api/decks",{name:g.name,description:g.description,isActive:!1}),onSuccess:async g=>{var y;const v=await g.json();c.invalidateQueries({queryKey:["/api/decks"]}),(y=v.data)!=null&&y.id&&r(v.data.id),u({title:"Deck created",description:`${o.name} has been created successfully.`}),a(!1),l({name:"",description:""})},onError:g=>{u({title:"Failed to create deck",description:g.message,variant:"destructive"})}}),f=At({mutationFn:async g=>Oe("DELETE",`/api/decks/${g}`,{}),onSuccess:()=>{c.invalidateQueries({queryKey:["/api/decks"]}),u({title:"Deck deleted",description:"Your deck has been deleted successfully."})},onError:g=>{g.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:g.message,variant:"destructive"})}}),m=async(g,v)=>{g.stopPropagation();try{const b=await(await Oe("GET",`/api/scope/manifest-template?deckId=${encodeURIComponent(v.id)}&name=${encodeURIComponent(v.name)}`)).json();await navigator.clipboard.writeText(b.data.content),u({title:"Copied deck.yaml snippet",description:"Paste into .agent-deck/deck.yaml in repos that use this deck."})}catch(y){u({title:"Failed to copy manifest",description:y instanceof Error?y.message:"Unknown error",variant:"destructive"})}},p=(g,v)=>{g.stopPropagation(),window.confirm("Are you sure you want to delete this deck? This action cannot be undone.")&&f.mutate(v)},w=g=>{g.preventDefault(),d.mutate(o)},h=g=>{var v,y,b;return(((v=g.services)==null?void 0:v.length)??0)+(((y=g.credentials)==null?void 0:y.length)??0)+(((b=g.playbooks)==null?void 0:b.length)??0)};return s?i.jsx("div",{className:"bg-black/40 backdrop-blur-md rounded-2xl border border-white/10 p-6 shadow-2xl",children:i.jsxs("div",{className:"animate-pulse space-y-4",children:[i.jsx("div",{className:"h-6 bg-white/10 rounded"}),i.jsx("div",{className:"space-y-3",children:Array.from({length:3}).map((g,v)=>i.jsx("div",{className:"h-16 bg-white/5 rounded-lg"},v))})]})}):i.jsxs(i.Fragment,{children:[i.jsxs("div",{className:"h-full flex flex-col","data-testid":"deck-management-panel",children:[i.jsxs("h2",{className:"text-lg font-bold mb-3 flex items-center",children:[i.jsx(vp,{className:"w-4 h-4 mr-2",style:{color:"#92E4DD"}}),i.jsx("span",{style:{color:"#92E4DD"},children:"My Decks"})]}),i.jsx("div",{className:"mb-3",children:i.jsxs(me,{onClick:()=>a(!0),className:"w-full border text-sm py-2",style:{background:"#C4B643",borderColor:"#C4B643",color:"black"},"data-testid":"create-deck-button",children:[i.jsx(Vs,{className:"w-3 h-3 mr-2"}),"Add Deck"]})}),i.jsx("div",{className:"flex-1 overflow-y-auto",children:i.jsx("div",{className:"space-y-2",children:t.map(g=>{const v=g.id===e,y=h(g);return i.jsxs("div",{className:`p-2 rounded-lg border cursor-pointer transition-all relative group ${v?"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:()=>r(g.id),"data-testid":`deck-item-${g.id}`,children:[i.jsxs("div",{className:"absolute top-1 right-1 flex gap-1 opacity-0 group-hover:opacity-100 transition-opacity duration-200",children:[i.jsx(me,{size:"sm",variant:"secondary",className:"h-5 w-5 p-0",onClick:b=>m(b,g),title:"Copy .agent-deck/deck.yaml snippet",children:i.jsx(O1,{className:"w-2 h-2"})}),i.jsx(me,{size:"sm",variant:"destructive",className:"h-5 w-5 p-0 bg-red-500/80 hover:bg-red-500 border-red-400",onClick:b=>p(b,g.id),title:"Delete deck",children:i.jsx(Rd,{className:"w-2 h-2"})})]}),i.jsxs("div",{children:[i.jsx("h3",{className:`font-semibold text-sm pr-12 ${v?"text-yellow-300":"text-white"}`,children:g.name}),i.jsx("p",{className:"text-xs text-gray-400",children:y>0?`${y} cards`:"Empty"})]})]},g.id)})})})]}),i.jsx(ao,{open:n,onOpenChange:a,children:i.jsxs(fa,{className:"sm:max-w-md bg-gradient-to-br from-cosmic-900 to-cosmic-800 border border-white/20 text-white",children:[i.jsx(ha,{children:i.jsxs(pa,{className:"text-xl font-bold flex items-center",children:[i.jsx(Vs,{className:"w-5 h-5 mr-2 text-purple-400"}),"Create New Deck"]})}),i.jsxs("form",{onSubmit:w,className:"space-y-4","data-testid":"form-create-deck",children:[i.jsxs("div",{children:[i.jsx(Ke,{htmlFor:"deckName",className:"text-sm font-semibold",children:"Deck Name"}),i.jsx(tt,{id:"deckName",placeholder:"e.g., Hiring stack",value:o.name,onChange:g=>l(v=>({...v,name:g.target.value})),className:"bg-white/10 border-white/20 text-white placeholder-gray-400",required:!0,"data-testid":"input-deck-name"})]}),i.jsxs("div",{children:[i.jsx(Ke,{htmlFor:"deckDescription",className:"text-sm font-semibold",children:"Description"}),i.jsx(Gn,{id:"deckDescription",placeholder:"Brief description of this deck...",value:o.description,onChange:g=>l(v=>({...v,description:g.target.value})),rows:3,className:"bg-white/10 border-white/20 text-white placeholder-gray-400 resize-none","data-testid":"textarea-deck-description"})]}),i.jsxs("div",{className:"flex space-x-3 pt-4",children:[i.jsx(me,{type:"button",variant:"secondary",className:"flex-1",onClick:()=>a(!1),"data-testid":"button-cancel-create",children:"Cancel"}),i.jsx(me,{type:"submit",className:"flex-1 bg-gradient-to-r from-purple-600 to-blue-600 hover:from-purple-700 hover:to-blue-700",disabled:d.isPending,"data-testid":"button-submit-create",children:d.isPending?"Creating...":"Create Deck"})]})]})]})})]})}function BO({open:t,onOpenChange:e}){const[r,s]=x.useState(""),[n,a]=x.useState(""),o=yr(),{toast:l}=or(),c=At({mutationFn:async()=>Oe("POST","/api/credentials",{label:r.trim(),value:n}),onSuccess:()=>{o.invalidateQueries({queryKey:["/api/credentials/vault"]}),o.invalidateQueries({queryKey:["/api/decks"]}),l({title:"API key saved",description:`${r.trim()} is stored securely. Your agent can use it from the active deck.`}),e(!1),s(""),a("")},onError:d=>{l({title:"Could not save API key",description:d.message,variant:"destructive"})}}),u=r.trim().length>0&&n.trim().length>0;return i.jsx(ao,{open:t,onOpenChange:e,children:i.jsxs(fa,{className:"sm:max-w-md border-border bg-[#161612] text-[#E8F6F4]",children:[i.jsxs(ha,{children:[i.jsx(pa,{className:"text-[#E8F6F4]",children:"Register API key"}),i.jsx(Ci,{className:"text-[#A8C4C0]",children:"Name the service and paste the key. Agent Deck handles the rest — stored in your vault, never shown again."})]}),i.jsxs("div",{className:"space-y-4",children:[i.jsxs("div",{className:"space-y-2",children:[i.jsx(Ke,{htmlFor:"credential-name",className:"text-[#CFEAE6]",children:"Service name"}),i.jsx(tt,{id:"credential-name",placeholder:"OpenAI, Linear, Slack…",value:r,onChange:d=>s(d.target.value),className:"border-white/15 bg-[#0F0F0C] text-[#E8F6F4] placeholder:text-[#6B8581]"})]}),i.jsxs("div",{className:"space-y-2",children:[i.jsx(Ke,{htmlFor:"credential-value",className:"text-[#CFEAE6]",children:"API key"}),i.jsx(tt,{id:"credential-value",type:"password",placeholder:"Paste key from the service dashboard",value:n,onChange:d=>a(d.target.value),className:"border-white/15 bg-[#0F0F0C] text-[#E8F6F4] placeholder:text-[#6B8581]"})]}),i.jsx(me,{variant:"ghost",className:`w-full border-2 hover:opacity-90 ${bn}`,style:Sn(ur),onClick:()=>c.mutate(),disabled:!u||c.isPending,children:"Save to vault"})]})]})})}function WO({open:t,onOpenChange:e}){const[r,s]=x.useState(""),[n,a]=x.useState(""),[o,l]=x.useState(""),[c,u]=x.useState(""),[d,f]=x.useState(""),[m,p]=x.useState([]),[w,h]=x.useState([]),g=yr(),{toast:v}=or(),{data:y}=hr({queryKey:["/api/credentials/vault"],enabled:t}),{data:b}=hr({queryKey:["/api/services"],enabled:t}),S=(y==null?void 0:y.data)??[],E=(b==null?void 0:b.data)??[],k=At({mutationFn:async()=>Oe("POST","/api/playbooks",{title:r.trim(),body:n,triggers:o.split(",").map(N=>N.trim()).filter(Boolean),dependsOnCredentialIds:m,dependsOnServiceIds:w,exec:c.trim()||void 0,skill:d.trim()||void 0,autoDetectDependencies:!0}),onSuccess:()=>{g.invalidateQueries({queryKey:["/api/playbooks/vault"]}),v({title:"Playbook saved",description:`${r.trim()} is in your collection.`}),e(!1),s(""),a(""),l(""),u(""),f(""),p([]),h([])},onError:N=>{v({title:"Could not save playbook",description:N.message,variant:"destructive"})}}),R=(N,O,j)=>{j(N.includes(O)?N.filter(_=>_!==O):[...N,O])},T=r.trim().length>0&&n.trim().length>0;return i.jsx(ao,{open:t,onOpenChange:e,children:i.jsxs(fa,{className:"sm:max-w-2xl max-h-[90vh] overflow-y-auto border-border bg-[#161612] text-[#E8F6F4]",children:[i.jsxs(ha,{children:[i.jsx(pa,{children:"Register Playbook"}),i.jsxs(Ci,{className:"text-[#A8C4C0]",children:["Prefer"," ",i.jsx("span",{className:"font-mono text-xs",children:"register_playbook"})," /"," ",i.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."]})]}),i.jsxs("div",{className:"space-y-4",children:[i.jsxs("div",{className:"space-y-2",children:[i.jsx(Ke,{htmlFor:"playbook-title",children:"Title"}),i.jsx(tt,{id:"playbook-title",placeholder:"Hiring inbox, Ashby API guide…",value:r,onChange:N=>s(N.target.value),className:"border-white/15 bg-[#0F0F0C] text-[#E8F6F4]"})]}),i.jsxs("div",{className:"space-y-2",children:[i.jsx(Ke,{htmlFor:"playbook-triggers",children:"Triggers (comma-separated)"}),i.jsx(tt,{id:"playbook-triggers",placeholder:"check inbox, review applicants",value:o,onChange:N=>l(N.target.value),className:"border-white/15 bg-[#0F0F0C] text-[#E8F6F4]"})]}),i.jsxs("div",{className:"space-y-2",children:[i.jsx(Ke,{htmlFor:"playbook-body",children:"Instructions (markdown)"}),i.jsx(Gn,{id:"playbook-body",rows:8,placeholder:`# Steps
|
|
355
|
+
1. …
|
|
356
|
+
2. …`,value:n,onChange:N=>a(N.target.value),className:"border-white/15 bg-[#0F0F0C] text-[#E8F6F4] font-mono text-sm"})]}),i.jsxs("div",{className:"grid grid-cols-2 gap-4",children:[i.jsxs("div",{className:"space-y-2",children:[i.jsx(Ke,{children:"Extra API key deps (optional)"}),i.jsx("p",{className:"text-xs text-gray-500",children:"Merged with auto-detected refs from content."}),i.jsx("div",{className:"max-h-28 overflow-y-auto rounded border border-white/10 p-2 space-y-1",children:S.length===0?i.jsx("p",{className:"text-xs text-gray-500",children:"No API keys registered yet."}):S.map(N=>i.jsxs("label",{className:"flex items-center gap-2 text-xs cursor-pointer",children:[i.jsx("input",{type:"checkbox",checked:m.includes(N.id),onChange:()=>R(m,N.id,p)}),N.label]},N.id))})]}),i.jsxs("div",{className:"space-y-2",children:[i.jsx(Ke,{children:"Extra MCP deps (optional)"}),i.jsx("p",{className:"text-xs text-gray-500",children:"Merged with auto-detected refs from content."}),i.jsx("div",{className:"max-h-28 overflow-y-auto rounded border border-white/10 p-2 space-y-1",children:E.length===0?i.jsx("p",{className:"text-xs text-gray-500",children:"No MCP services registered yet."}):E.map(N=>i.jsxs("label",{className:"flex items-center gap-2 text-xs cursor-pointer",children:[i.jsx("input",{type:"checkbox",checked:w.includes(N.id),onChange:()=>R(w,N.id,h)}),N.name]},N.id))})]})]}),i.jsxs("div",{className:"space-y-2",children:[i.jsx(Ke,{htmlFor:"playbook-exec",children:"Suggested exec (optional)"}),i.jsx(tt,{id:"playbook-exec",placeholder:"agent-deck exec --connections … -- uv run …",value:c,onChange:N=>u(N.target.value),className:"border-white/15 bg-[#0F0F0C] text-[#E8F6F4] font-mono text-xs"})]}),i.jsxs("div",{className:"space-y-2",children:[i.jsx(Ke,{htmlFor:"playbook-skill",children:"Skill path hint (optional)"}),i.jsx(tt,{id:"playbook-skill",placeholder:".cursor/skills/…/SKILL.md",value:d,onChange:N=>f(N.target.value),className:"border-white/15 bg-[#0F0F0C] text-[#E8F6F4] font-mono text-xs"})]}),i.jsx(me,{variant:"ghost",className:`w-full border-2 hover:opacity-90 ${bn}`,style:Sn(Yr),onClick:()=>k.mutate(),disabled:!T||k.isPending,children:"Save to collection"})]})]})})}function KO({playbookId:t,open:e,onOpenChange:r}){const{data:s,isLoading:n}=hr({queryKey:t?[`/api/playbooks/${t}`]:["playbook-detail-disabled"],enabled:e&&!!t}),a=s==null?void 0:s.data,o=((a==null?void 0:a.dependencies.missingCredentialIds.length)??0)+((a==null?void 0:a.dependencies.missingServiceIds.length)??0);return i.jsx(ao,{open:e,onOpenChange:r,children:i.jsxs(fa,{className:"sm:max-w-2xl max-h-[90vh] overflow-y-auto border-border bg-[#161612] text-[#E8F6F4]",children:[i.jsxs(ha,{children:[i.jsx(pa,{children:(a==null?void 0:a.title)??"Playbook"}),i.jsx(Ci,{className:"text-[#A8C4C0]",children:(a==null?void 0:a.id)??t})]}),n||!a?i.jsx("p",{className:"text-sm text-gray-400",children:"Loading…"}):i.jsxs("div",{className:"space-y-4 text-sm",children:[i.jsxs("p",{className:"rounded-md border border-white/10 bg-white/5 px-3 py-2 text-[#A8C4C0]",children:["Ask your AI agent to refine this playbook with"," ",i.jsx("span",{className:"font-mono text-xs",children:"update_playbook"})," — dependencies are re-detected from the content automatically."]}),a.triggers.length>0&&i.jsxs("div",{children:[i.jsx("h4",{className:"font-semibold text-amber-200 mb-1",children:"Triggers"}),i.jsx("p",{className:"text-gray-300",children:a.triggers.join(", ")})]}),i.jsxs("div",{children:[i.jsx("h4",{className:"font-semibold text-amber-200 mb-1",children:"Dependencies"}),a.dependencies.credentials.length===0&&a.dependencies.services.length===0&&o===0?i.jsx("p",{className:"text-gray-400",children:"None declared."}):i.jsxs("ul",{className:"space-y-1 text-gray-300",children:[a.dependencies.credentials.map(l=>i.jsxs("li",{children:["API key: ",l.label]},l.id)),a.dependencies.services.map(l=>i.jsxs("li",{children:["MCP: ",l.label]},l.id)),a.dependencies.missingCredentialIds.map(l=>i.jsxs("li",{className:"text-amber-300 flex items-center gap-1",children:[i.jsx(rn,{className:"w-3 h-3"})," Missing API key: ",l]},l)),a.dependencies.missingServiceIds.map(l=>i.jsxs("li",{className:"text-amber-300 flex items-center gap-1",children:[i.jsx(rn,{className:"w-3 h-3"})," Missing MCP: ",l]},l))]})]}),a.exec&&i.jsxs("div",{children:[i.jsx("h4",{className:"font-semibold text-amber-200 mb-1",children:"Suggested exec"}),i.jsx("pre",{className:"rounded bg-black/40 p-2 text-xs overflow-x-auto",children:a.exec})]}),a.skill&&i.jsxs("div",{children:[i.jsx("h4",{className:"font-semibold text-amber-200 mb-1",children:"Skill hint"}),i.jsx("p",{className:"font-mono text-xs text-gray-300",children:a.skill})]}),i.jsxs("div",{children:[i.jsx("h4",{className:"font-semibold text-amber-200 mb-1",children:"Instructions"}),i.jsx("div",{className:"rounded bg-black/30 p-3 whitespace-pre-wrap text-gray-200",children:a.body})]})]})]})})}function QO({credentialId:t,open:e,onOpenChange:r}){const s=yr(),{toast:n}=or(),[a,o]=x.useState(""),[l,c]=x.useState(""),[u,d]=x.useState(""),{data:f,isLoading:m}=hr({queryKey:t?[`/api/credentials/${t}`]:["credential-detail-disabled"],enabled:e&&!!t}),p=f==null?void 0:f.data;x.useEffect(()=>{p&&(o(p.label),c(p.docsUrl??""),d(""))},[p==null?void 0:p.id,p==null?void 0:p.label,p==null?void 0:p.docsUrl]);const w=At({mutationFn:async()=>{if(!t)throw new Error("No credential selected");const g=a.trim();if(!g)throw new Error("Name is required");const v=l.trim();if(v)try{new URL(v)}catch{throw new Error("Documentation link must be a valid URL")}await Oe("PUT",`/api/credentials/${t}`,{label:g,docsUrl:v}),u.trim()&&await Oe("POST",`/api/credentials/${t}/rotate`,{value:u.trim()})},onSuccess:()=>{s.invalidateQueries({queryKey:["/api/credentials/vault"]}),t&&s.invalidateQueries({queryKey:[`/api/credentials/${t}`]}),s.invalidateQueries({queryKey:["/api/collection/warnings"]}),s.invalidateQueries({queryKey:["/api/decks"]}),n({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(""),r(!1)},onError:g=>{n({title:"Could not save API key",description:g.message,variant:"destructive"})}}),h=a.trim().length>0&&(a.trim()!==(p==null?void 0:p.label)||l.trim()!==((p==null?void 0:p.docsUrl)??"")||u.trim().length>0);return i.jsx(ao,{open:e,onOpenChange:r,children:i.jsxs(fa,{className:"sm:max-w-md border-border bg-[#161612] text-[#E8F6F4]",children:[i.jsxs(ha,{children:[i.jsx(pa,{className:"text-[#E8F6F4]",children:(p==null?void 0:p.label)??"API key"}),i.jsx(Ci,{className:"font-mono text-xs text-[#A8C4C0]",children:(p==null?void 0:p.id)??t})]}),m||!p?i.jsx("p",{className:"text-sm text-gray-400",children:"Loading…"}):i.jsxs("div",{className:"space-y-4",children:[!p.hasSecret&&i.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:[i.jsx(rn,{className:"mt-0.5 h-4 w-4 shrink-0"}),i.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."})]}),i.jsxs("div",{className:"space-y-2",children:[i.jsx(Ke,{htmlFor:"credential-detail-name",className:"text-[#CFEAE6]",children:"Name"}),i.jsx(tt,{id:"credential-detail-name",value:a,onChange:g=>o(g.target.value),className:"border-white/15 bg-[#0F0F0C] text-[#E8F6F4] placeholder:text-[#6B8581]"})]}),i.jsxs("div",{className:"space-y-2",children:[i.jsx(Ke,{htmlFor:"credential-detail-key",className:"text-[#CFEAE6]",children:p.hasSecret?"Rotate API key":"API key"}),i.jsx(tt,{id:"credential-detail-key",type:"password",placeholder:p.hasSecret?"Leave blank to keep current key":"Paste key from the service dashboard",value:u,onChange:g=>d(g.target.value),className:"border-white/15 bg-[#0F0F0C] text-[#E8F6F4] placeholder:text-[#6B8581]"}),p.hasSecret&&i.jsx("p",{className:"text-xs text-[#6B8581]",children:"Stored securely in Keychain. Enter a new value only when rotating."})]}),i.jsxs("div",{className:"space-y-2",children:[i.jsx(Ke,{htmlFor:"credential-detail-docs",className:"text-[#CFEAE6]",children:"Documentation link"}),i.jsxs("div",{className:"flex gap-2",children:[i.jsx(tt,{id:"credential-detail-docs",type:"url",placeholder:"https://…",value:l,onChange:g=>c(g.target.value),className:"border-white/15 bg-[#0F0F0C] text-[#E8F6F4] placeholder:text-[#6B8581]"}),l.trim()&&i.jsx(me,{type:"button",variant:"outline",size:"icon",className:"shrink-0 border-white/15 bg-[#0F0F0C] text-[#A8C4C0] hover:bg-white/5",onClick:()=>window.open(l.trim(),"_blank","noopener,noreferrer"),title:"Open documentation",children:i.jsx(Jn,{className:"h-4 w-4"})})]})]}),i.jsx(me,{variant:"ghost",className:`w-full border-2 hover:opacity-90 ${bn}`,style:Sn(ur),onClick:()=>w.mutate(),disabled:!h||w.isPending,children:w.isPending?"Saving…":"Save changes"})]})]})})}const GO=jd("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 pn({className:t,variant:e,...r}){return i.jsx("div",{className:Te(GO({variant:e}),t),...r})}function P_(t){const e=x.useRef({value:t,previous:t});return x.useMemo(()=>(e.current.value!==t&&(e.current.previous=e.current.value,e.current.value=t),e.current.previous),[t])}var Vd="Checkbox",[ZO,qF]=fs(Vd),[YO,qv]=ZO(Vd);function JO(t){const{__scopeCheckbox:e,checked:r,children:s,defaultChecked:n,disabled:a,form:o,name:l,onCheckedChange:c,required:u,value:d="on",internal_do_not_use_render:f}=t,[m,p]=Ka({prop:r,defaultProp:n??!1,onChange:c,caller:Vd}),[w,h]=x.useState(null),[g,v]=x.useState(null),y=x.useRef(!1),b=w?!!o||!!w.closest("form"):!0,S={checked:m,disabled:a,setChecked:p,control:w,setControl:h,name:l,form:o,value:d,hasConsumerStoppedPropagationRef:y,required:u,defaultChecked:ta(n)?!1:n,isFormControl:b,bubbleInput:g,setBubbleInput:v};return i.jsx(YO,{scope:e,...S,children:XO(f)?f(S):s})}var N_="CheckboxTrigger",j_=x.forwardRef(({__scopeCheckbox:t,onKeyDown:e,onClick:r,...s},n)=>{const{control:a,value:o,disabled:l,checked:c,required:u,setControl:d,setChecked:f,hasConsumerStoppedPropagationRef:m,isFormControl:p,bubbleInput:w}=qv(N_,t),h=et(n,d),g=x.useRef(c);return x.useEffect(()=>{const v=a==null?void 0:a.form;if(v){const y=()=>f(g.current);return v.addEventListener("reset",y),()=>v.removeEventListener("reset",y)}},[a,f]),i.jsx(Ae.button,{type:"button",role:"checkbox","aria-checked":ta(c)?"mixed":c,"aria-required":u,"data-state":I_(c),"data-disabled":l?"":void 0,disabled:l,value:o,...s,ref:h,onKeyDown:_e(e,v=>{v.key==="Enter"&&v.preventDefault()}),onClick:_e(r,v=>{f(y=>ta(y)?!0:!y),w&&p&&(m.current=v.isPropagationStopped(),m.current||v.stopPropagation())})})});j_.displayName=N_;var Hv=x.forwardRef((t,e)=>{const{__scopeCheckbox:r,name:s,checked:n,defaultChecked:a,required:o,disabled:l,value:c,onCheckedChange:u,form:d,...f}=t;return i.jsx(JO,{__scopeCheckbox:r,checked:n,defaultChecked:a,disabled:l,required:o,onCheckedChange:u,name:s,form:d,value:c,internal_do_not_use_render:({isFormControl:m})=>i.jsxs(i.Fragment,{children:[i.jsx(j_,{...f,ref:e,__scopeCheckbox:r}),m&&i.jsx(O_,{__scopeCheckbox:r})]})})});Hv.displayName=Vd;var R_="CheckboxIndicator",T_=x.forwardRef((t,e)=>{const{__scopeCheckbox:r,forceMount:s,...n}=t,a=qv(R_,r);return i.jsx(da,{present:s||ta(a.checked)||a.checked===!0,children:i.jsx(Ae.span,{"data-state":I_(a.checked),"data-disabled":a.disabled?"":void 0,...n,ref:e,style:{pointerEvents:"none",...t.style}})})});T_.displayName=R_;var A_="CheckboxBubbleInput",O_=x.forwardRef(({__scopeCheckbox:t,...e},r)=>{const{control:s,hasConsumerStoppedPropagationRef:n,checked:a,defaultChecked:o,required:l,disabled:c,name:u,value:d,form:f,bubbleInput:m,setBubbleInput:p}=qv(A_,t),w=et(r,p),h=P_(a),g=nS(s);x.useEffect(()=>{const y=m;if(!y)return;const b=window.HTMLInputElement.prototype,E=Object.getOwnPropertyDescriptor(b,"checked").set,k=!n.current;if(h!==a&&E){const R=new Event("click",{bubbles:k});y.indeterminate=ta(a),E.call(y,ta(a)?!1:a),y.dispatchEvent(R)}},[m,h,a,n]);const v=x.useRef(ta(a)?!1:a);return i.jsx(Ae.input,{type:"checkbox","aria-hidden":!0,defaultChecked:o??v.current,required:l,disabled:c,name:u,value:d,form:f,...e,tabIndex:-1,ref:w,style:{...e.style,...g,position:"absolute",pointerEvents:"none",opacity:0,margin:0,transform:"translateX(-100%)"}})});O_.displayName=A_;function XO(t){return typeof t=="function"}function ta(t){return t==="indeterminate"}function I_(t){return ta(t)?"indeterminate":t?"checked":"unchecked"}const D_=x.forwardRef(({className:t,...e},r)=>i.jsx(Hv,{ref:r,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",t),...e,children:i.jsx(T_,{className:Te("flex items-center justify-center text-current"),children:i.jsx(T1,{className:"h-4 w-4"})})}));D_.displayName=Hv.displayName;const M_=x.forwardRef(({className:t,...e},r)=>i.jsx("div",{className:"relative w-full overflow-auto",children:i.jsx("table",{ref:r,className:Te("w-full caption-bottom text-sm",t),...e})}));M_.displayName="Table";const $_=x.forwardRef(({className:t,...e},r)=>i.jsx("thead",{ref:r,className:Te("[&_tr]:border-b",t),...e}));$_.displayName="TableHeader";const F_=x.forwardRef(({className:t,...e},r)=>i.jsx("tbody",{ref:r,className:Te("[&_tr:last-child]:border-0",t),...e}));F_.displayName="TableBody";const eI=x.forwardRef(({className:t,...e},r)=>i.jsx("tfoot",{ref:r,className:Te("border-t bg-muted/50 font-medium [&>tr]:last:border-b-0",t),...e}));eI.displayName="TableFooter";const Wi=x.forwardRef(({className:t,...e},r)=>i.jsx("tr",{ref:r,className:Te("border-b transition-colors hover:bg-muted/50 data-[state=selected]:bg-muted",t),...e}));Wi.displayName="TableRow";const eu=x.forwardRef(({className:t,...e},r)=>i.jsx("th",{ref:r,className:Te("h-12 px-4 text-left align-middle font-medium text-muted-foreground [&:has([role=checkbox])]:pr-0",t),...e}));eu.displayName="TableHead";const ho=x.forwardRef(({className:t,...e},r)=>i.jsx("td",{ref:r,className:Te("p-4 align-middle [&:has([role=checkbox])]:pr-0",t),...e}));ho.displayName="TableCell";const tI=x.forwardRef(({className:t,...e},r)=>i.jsx("caption",{ref:r,className:Te("mt-4 text-sm text-muted-foreground",t),...e}));tI.displayName="TableCaption";function Qf(t){return new Set(t.filter(e=>e.enabled===!1).map(e=>e.name))}function rI({serviceId:t,tools:e,isLoading:r}){const[s,n]=x.useState(""),[a,o]=x.useState(null),[l,c]=x.useState(()=>Qf(e)),u=yr(),{toast:d}=or(),f=x.useMemo(()=>e.filter(y=>y.enabled===!1).map(y=>y.name).sort().join("\0"),[e]);x.useEffect(()=>{c(Qf(e))},[t,f,e.length]);const m=At({mutationFn:async y=>{await Oe("PUT",`/api/services/${t}/tool-settings`,{disabledTools:y})},onSuccess:()=>{u.invalidateQueries({queryKey:["/api/services",t,"tools"]}),u.invalidateQueries({queryKey:["/api/services"]})},onError:y=>{d({title:"Could not save tool settings",description:y.message,variant:"destructive"}),c(Qf(e))}}),p=y=>{c(y),m.mutate([...y])},w=(y,b)=>{const S=new Set(l);b?S.delete(y):S.add(y),p(S)},h=y=>{if(y){p(new Set);return}p(new Set(e.map(b=>b.name)))},g=x.useMemo(()=>{const y=s.trim().toLowerCase();return y?e.filter(b=>b.name.toLowerCase().includes(y)||b.description.toLowerCase().includes(y)):e},[e,s]),v=e.length-l.size;return r?i.jsx("div",{className:"bg-black/20 rounded-lg p-4 border border-white/10",children:i.jsx("p",{className:"text-sm text-gray-400",children:"Loading tools…"})}):e.length===0?null:i.jsxs("div",{className:"bg-black/20 rounded-lg p-4 border border-white/10",children:[i.jsxs("div",{className:"mb-4 flex flex-col gap-3 sm:flex-row sm:items-center sm:justify-between",children:[i.jsxs("h3",{className:"text-lg font-semibold flex items-center",children:[i.jsx(Ou,{className:"w-5 h-5 mr-2"}),"Tools",i.jsxs("span",{className:"ml-2 text-sm font-normal text-gray-400",children:[v," of ",e.length," enabled"]})]}),i.jsxs("div",{className:"flex flex-wrap items-center gap-2",children:[i.jsx(me,{type:"button",size:"sm",variant:"ghost",className:"h-8 text-xs text-[#A8C4C0] hover:text-white hover:bg-white/10",onClick:()=>h(!0),disabled:l.size===0||m.isPending,children:"Enable all"}),i.jsx(me,{type:"button",size:"sm",variant:"ghost",className:"h-8 text-xs text-[#A8C4C0] hover:text-white hover:bg-white/10",onClick:()=>h(!1),disabled:v===0||m.isPending,children:"Disable all"})]})]}),i.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."}),i.jsxs("div",{className:"relative mb-3",children:[i.jsx(I1,{className:"absolute left-3 top-1/2 h-4 w-4 -translate-y-1/2 text-gray-500"}),i.jsx(tt,{value:s,onChange:y=>n(y.target.value),placeholder:"Search tools…",className:"border-white/15 bg-[#0F0F0C] pl-9 text-[#E8F6F4] placeholder:text-[#6B8581]"})]}),i.jsx("div",{className:"rounded-md border border-white/10 overflow-hidden",children:i.jsxs(M_,{children:[i.jsx($_,{children:i.jsxs(Wi,{className:"border-white/10 hover:bg-transparent",children:[i.jsx(eu,{className:"w-[72px] text-center text-[#A8C4C0]",children:"Enabled"}),i.jsx(eu,{className:"w-[220px] text-[#A8C4C0]",children:"Tool"}),i.jsx(eu,{className:"text-[#A8C4C0]",children:"Description"})]})}),i.jsx(F_,{children:g.length===0?i.jsx(Wi,{className:"border-white/10 hover:bg-transparent",children:i.jsx(ho,{colSpan:3,className:"py-8 text-center text-sm text-gray-400",children:"No tools match your search."})}):g.map(y=>{const b=!l.has(y.name),S=a===y.name,E=y.inputSchema&&Object.keys(y.inputSchema).length>0;return i.jsxs(x.Fragment,{children:[i.jsxs(Wi,{className:`border-white/10 ${b?"hover:bg-white/5":"opacity-60 hover:bg-white/5"}`,children:[i.jsx(ho,{className:"text-center",children:i.jsx("div",{className:"flex justify-center",children:i.jsx(D_,{checked:b,onCheckedChange:k=>w(y.name,k===!0),disabled:m.isPending,"aria-label":`${b?"Disable":"Enable"} ${y.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]"})})}),i.jsx(ho,{children:E?i.jsxs("button",{type:"button",onClick:()=>o(S?null:y.name),className:"flex w-full items-center gap-1 text-left font-mono text-sm text-[#92E4DD] hover:text-white",children:[i.jsx(_v,{className:`h-4 w-4 shrink-0 transition-transform ${S?"rotate-180":""}`}),y.name]}):i.jsx("span",{className:"font-mono text-sm text-[#92E4DD]",children:y.name})}),i.jsx(ho,{className:"text-sm text-gray-300",children:y.description||"—"})]}),E&&S&&i.jsx(Wi,{className:"border-white/10 bg-black/30 hover:bg-black/30",children:i.jsx(ho,{colSpan:3,className:"py-3",children:i.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(y.inputSchema,null,2)})})})]},y.name)})})]})})]})}function Gf({items:t,className:e}){return t.length===0?null:i.jsx("ol",{className:`list-decimal list-inside space-y-1 text-xs ${e??""}`,children:t.map((r,s)=>i.jsx("li",{children:r},`${s}-${r.slice(0,24)}`))})}function R0({serviceId:t,onConnected:e}){const{toast:r}=or(),[s,n]=x.useState(""),[a,o]=x.useState(""),[l,c]=x.useState(!1),[u,d]=x.useState(!1),[f,m]=x.useState(!1),{data:p,isLoading:w}=hr({queryKey:["/api/oauth",t,"setup"],queryFn:async()=>{const E=await Oe("GET",`/api/oauth/${t}/setup`),k=await E.json();if(!E.ok||!k.success)throw new Error(k.error||"Failed to load OAuth setup");return k.data},enabled:!!t}),h=p==null?void 0:p.guide,g=!!(p!=null&&p.hasSavedCredentials),v=()=>{if(!u||(h==null?void 0:h.setupMode)!=="manual")return;const E={};return s.trim()&&(E.clientId=s.trim()),a.trim()&&(E.clientSecret=a.trim()),E},y=async(E,k)=>{try{await navigator.clipboard.writeText(k),r({title:"Copied",description:`${E} copied to clipboard.`})}catch{r({title:"Copy failed",description:"Select and copy manually.",variant:"destructive"})}};x.useEffect(()=>{(h==null?void 0:h.setupMode)==="manual"?d(!0):d(!1),m(!g)},[h==null?void 0:h.setupMode,g]),x.useEffect(()=>{p!=null&&p.savedOAuthClientId&&!s&&n(p.savedOAuthClientId)},[p==null?void 0:p.savedOAuthClientId,s]);const b=async E=>{var k,R,T;c(!0);try{const N=await Oe("POST",`/api/oauth/${t}/connect`,E??{}),O=await N.json();if(!N.ok||!O.success){((k=O.data)!=null&&k.needsCredentials||((R=O.data)==null?void 0:R.setupMode)==="manual")&&d(!0),r({title:"OAuth setup",description:O.error||"Could not start OAuth flow.",variant:"destructive"});return}(T=O.data)!=null&&T.authorizationUrl&&(window.open(O.data.authorizationUrl,"_blank"),r({title:"Continue in browser",description:"Complete sign-in in the new tab, then return here."}),e==null||e())}catch(N){r({title:"OAuth setup failed",description:N instanceof Error?N.message:"Unknown error",variant:"destructive"})}finally{c(!1)}};if(w)return i.jsx("p",{className:"text-sm text-orange-200",children:"Loading setup guide…"});if(!h)return null;if(h.setupMode==="unavailable")return i.jsxs("div",{className:"space-y-3 text-sm text-orange-100",children:[i.jsx("p",{children:h.unavailableReason}),h.docsUrl&&i.jsxs(me,{size:"sm",variant:"outline",className:"border-orange-500/30 text-orange-200",onClick:()=>window.open(h.docsUrl,"_blank"),children:[i.jsx(Jn,{className:"w-4 h-4 mr-1"}),"Provider docs"]})]});const S=h.setupMode==="dynamic"||h.setupMode==="managed"||h.setupMode==="manual";return i.jsxs("div",{className:"space-y-4 text-sm text-orange-100",children:[i.jsxs("div",{children:[i.jsx("p",{className:"font-medium text-orange-200",children:h.title}),h.summary&&i.jsx("p",{className:"mt-1 text-xs text-orange-100/90",children:h.summary}),S&&i.jsxs("p",{className:"mt-2 text-xs text-orange-100/80",children:["Redirect URI:"," ",i.jsx("code",{className:"text-orange-50",children:h.redirectUri})]}),h.easierAlternative&&i.jsx("p",{className:"mt-2 text-xs text-orange-100/70 border-l-2 border-orange-500/30 pl-2",children:h.easierAlternative})]}),g&&h.setupMode==="manual"&&i.jsxs("div",{className:"rounded-lg border border-green-500/30 bg-green-500/10 p-3 text-xs text-green-100",children:[i.jsx("p",{className:"font-medium text-green-200",children:"OAuth credentials saved"}),i.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."})]}),h.prerequisites&&h.prerequisites.length>0&&!g&&i.jsxs("div",{children:[i.jsx("p",{className:"text-xs font-medium text-orange-200 mb-1",children:"Before you start"}),i.jsx("ul",{className:"list-disc list-inside space-y-1 text-xs text-orange-100/90",children:h.prerequisites.map(E=>i.jsx("li",{children:E},E))})]}),(h.manifestJson||h.createAppUrl||S)&&i.jsxs("div",{className:"flex flex-wrap gap-2",children:[h.manifestJson&&i.jsxs(me,{size:"sm",variant:"outline",className:"border-orange-500/30 text-orange-200",onClick:()=>void y("App manifest",h.manifestJson),children:[i.jsx(S2,{className:"w-4 h-4 mr-1"}),"Copy manifest"]}),S&&i.jsxs(me,{size:"sm",variant:"outline",className:"border-orange-500/30 text-orange-200",onClick:()=>void y("Redirect URI",h.redirectUri),children:[i.jsx(O1,{className:"w-4 h-4 mr-1"}),"Copy redirect URI"]}),h.createAppUrl&&i.jsxs(me,{size:"sm",variant:"outline",className:"border-orange-500/30 text-orange-200",onClick:()=>window.open(h.createAppUrl,"_blank"),children:[i.jsx(Jn,{className:"w-4 h-4 mr-1"}),h.createAppLabel??"Open app creator"]})]}),h.steps.length>0&&i.jsx("div",{children:g&&h.setupMode==="manual"?i.jsxs("details",{className:"rounded-lg border border-orange-500/20 bg-orange-500/5 p-3",children:[i.jsx("summary",{className:"cursor-pointer text-xs font-medium text-orange-200",children:"First-time Slack app setup"}),i.jsx("div",{className:"mt-2",children:i.jsx(Gf,{items:h.steps})})]}):i.jsxs(i.Fragment,{children:[h.setupMode==="informational"?i.jsx("p",{className:"text-xs font-medium text-orange-200 mb-1",children:"What to do"}):null,i.jsx(Gf,{items:h.steps})]})}),h.tokenAlternative&&i.jsxs("p",{className:"text-xs text-orange-100/80 border-l-2 border-orange-500/30 pl-2",children:[i.jsx("span",{className:"font-medium text-orange-200",children:"Alternative: "}),h.tokenAlternative]}),u&&h.setupMode==="manual"&&i.jsxs("div",{className:"space-y-3 rounded-lg border border-orange-500/20 bg-orange-500/5 p-3",children:[i.jsxs("div",{className:"space-y-1",children:[i.jsx(Ke,{htmlFor:`oauth-client-id-${t}`,className:"text-orange-200",children:"Client ID"}),i.jsx(tt,{id:`oauth-client-id-${t}`,value:s,onChange:E=>n(E.target.value),placeholder:"OAuth Client ID",className:"bg-black/20 border-orange-500/30"})]}),f?i.jsxs("div",{className:"space-y-1",children:[i.jsx(Ke,{htmlFor:`oauth-client-secret-${t}`,className:"text-orange-200",children:"Client Secret"}),i.jsx(tt,{id:`oauth-client-secret-${t}`,type:"password",value:a,onChange:E=>o(E.target.value),placeholder:"OAuth Client Secret",className:"bg-black/20 border-orange-500/30"})]}):i.jsx("p",{className:"text-xs text-orange-200/80",children:"Client secret is saved locally for this service."}),g&&i.jsx(me,{type:"button",size:"sm",variant:"outline",className:"border-orange-500/30 text-orange-200",onClick:()=>m(E=>!E),children:f?"Hide client secret field":"Update client secret"}),(p==null?void 0:p.hasStoredClientSecret)&&f&&i.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."})]}),h.afterConnect&&h.afterConnect.length>0&&i.jsxs("div",{children:[i.jsx("p",{className:"text-xs font-medium text-orange-200 mb-1",children:"After connect"}),i.jsx(Gf,{items:h.afterConnect,className:"text-orange-100/80"})]}),S&&i.jsxs("div",{className:"flex flex-wrap gap-2",children:[i.jsx(me,{size:"sm",className:"bg-orange-600 hover:bg-orange-700",disabled:l||u&&h.setupMode==="manual"&&!g&&(!s.trim()||!a.trim()),onClick:()=>b(v()),children:l?"Connecting…":g&&h.setupMode==="manual"?"Reconnect":h.setupMode==="dynamic"||h.setupMode==="managed"?"Connect":"Connect with credentials"}),h.docsUrl&&i.jsxs(me,{size:"sm",variant:"outline",className:"border-orange-500/30 text-orange-200",onClick:()=>window.open(h.docsUrl,"_blank"),children:[i.jsx(Jn,{className:"w-4 h-4 mr-1"}),"Docs"]})]}),h.setupMode==="informational"&&h.docsUrl&&i.jsxs(me,{size:"sm",variant:"outline",className:"border-orange-500/30 text-orange-200",onClick:()=>window.open(h.docsUrl,"_blank"),children:[i.jsx(Jn,{className:"w-4 h-4 mr-1"}),"Docs"]})]})}function nI(t){if(!t||t.type!=="local-mcp")return!1;const e=[t.localCommand,...t.localArgs??[],t.url,t.name].filter(Boolean).join(" ").toLowerCase();return e.includes("google-drive")||e.includes("google_drive")}function sI({service:t,isOpen:e,onClose:r}){var Ne,rt,pt,Hr,zt,hs,oo,Yt,Br,ps,jr,Dn,ms,ya,vs,ne,Et,Mn,$n,Yl,Jl,Xl;const[s,n]=x.useState(null),[a,o]=x.useState(!1),[l,c]=x.useState(""),[u,d]=x.useState(!1),[f,m]=x.useState(!1),[p,w]=x.useState(!1),[h,g]=x.useState(""),[v,y]=x.useState(""),[b,S]=x.useState(!1),[E,k]=x.useState(!1),[R,T]=x.useState(null),N=yr(),{toast:O}=or(),j=t&&(R==null?void 0:R.id)===t.id?R:t,_=j,A=!!(_&&_.id&&_.url),{data:C,isLoading:z,error:U,refetch:K}=hr({queryKey:["/api/mcp/discover",_==null?void 0:_.url],queryFn:async()=>{if(!_||_.type!=="mcp")return null;console.log(`🔍 Attempting MCP discovery for: ${_.url}`);try{const je=await(await Oe("POST","/api/mcp/discover",{url:_.url})).json();return console.log(`✅ MCP discovery successful for ${_.url}:`,je),je}catch(de){throw console.log(`❌ MCP discovery failed for ${_.url}:`,de),de}},enabled:A&&_.type==="mcp"&&e,staleTime:0,gcTime:2*60*1e3}),$=((rt=(Ne=C==null?void 0:C.data)==null?void 0:Ne.oauth)==null?void 0:rt.required)===!0,{data:F,refetch:V}=hr({queryKey:["/api/oauth",_==null?void 0:_.id,"status"],queryFn:async()=>{const de=await Oe("GET",`/api/oauth/${_.id}/status`),je=await de.json();if(!de.ok||!je.success)throw new Error(je.error||"Failed to load OAuth status");return je.data},enabled:A&&_.type==="mcp"&&e&&$,refetchInterval:de=>{const je=de.state.data;return je!=null&&je.authenticated?!1:2e3}}),se=$?F!=null&&F.authenticated?{status:"authenticated",message:null}:F!=null&&F.hasToken&&(F!=null&&F.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:_==null?void 0:_.id,apiServiceType:_==null?void 0:_.type,apiServiceUrl:_==null?void 0:_.url,isOpen:e,hasValidService:A,enabled:A&&_.type==="mcp"&&e,mcpDiscoveryLoading:z,mcpDiscoveryData:C?JSON.stringify(C,null,2):null,mcpDiscoveryDataKeys:C?Object.keys(C):null,oauthRequired:(Hr=(pt=C==null?void 0:C.data)==null?void 0:pt.oauth)==null?void 0:Hr.required,oauthData:(zt=C==null?void 0:C.data)!=null&&zt.oauth?JSON.stringify(C.data.oauth,null,2):null,toolsQueryEnabled:A&&_.type==="mcp"&&e&&!((oo=(hs=C==null?void 0:C.data)==null?void 0:hs.oauth)!=null&&oo.required)});const{data:W,isLoading:L,error:Q,refetch:oe}=hr({queryKey:["/api/services",_==null?void 0:_.id,"tools"],queryFn:async()=>{if(!_||_.type!=="mcp"&&_.type!=="local-mcp")return{data:[]};console.log(`🔍 Attempting to discover tools for MCP service: ${_.id} at ${_.url}`);try{const je=await(await Oe("GET",`/api/services/${_.id}/tools`)).json();return console.log(`✅ MCP tools discovery successful for ${_.id}:`,je),je}catch(de){throw console.log(`❌ MCP tools discovery failed for ${_.id}:`,de),de}},enabled:A&&(_.type==="mcp"||_.type==="local-mcp")&&e&&(_.type==="local-mcp"||se.status==="authenticated"||se.status==="not_required"),staleTime:0,gcTime:2*60*1e3});x.useEffect(()=>{if(!e||!(_!=null&&_.id)||_.type!=="mcp"&&_.type!=="local-mcp"||!(_.type==="local-mcp"||se.status==="authenticated"||se.status==="not_required")||L||Q)return;let je=!1;return(async()=>{try{const Nt=await(await Oe("GET",`/api/services/${_.id}`)).json();!je&&(Nt!=null&&Nt.success)&&Nt.data&&T(Nt.data),N.invalidateQueries({queryKey:["/api/services"]})}catch{}})(),()=>{je=!0}},[e,_==null?void 0:_.id,_==null?void 0:_.type,L,Q,se.status,N]),x.useEffect(()=>{if(!e||!(_!=null&&_.id)||_.type!=="a2a")return;let de=!1;return(async()=>{try{await Oe("GET",`/api/services/${_.id}/health`);const Dt=await(await Oe("GET",`/api/services/${_.id}`)).json();!de&&(Dt!=null&&Dt.success)&&Dt.data&&T(Dt.data),N.invalidateQueries({queryKey:["/api/services"]})}catch{}})(),()=>{de=!0}},[e,_==null?void 0:_.id,_==null?void 0:_.type,N]),console.log("MCP Tools Query Debug:",{hasValidService:A,apiServiceType:_==null?void 0:_.type,isOpen:e,oauthRequired:(Br=(Yt=C==null?void 0:C.data)==null?void 0:Yt.oauth)==null?void 0:Br.required,oauthStatus:se.status,toolsQueryEnabled:A&&(_.type==="mcp"||_.type==="local-mcp")&&e&&(_.type==="local-mcp"||se.status==="authenticated"||se.status==="not_required"),mcpToolsLoading:L});const{data:Z,isLoading:ce,error:Ee}=hr({queryKey:["/api/proxy/a2a",_==null?void 0:_.id,"manifest"],queryFn:async()=>{if(!_||_.type!=="a2a")return null;const je=await(await Oe("GET",`/api/proxy/a2a/${_.id}/manifest`)).text();return JSON.parse(je)},enabled:A&&_.type==="a2a"&&e,staleTime:0,gcTime:2*60*1e3}),ve=(W==null?void 0:W.data)||[],te=Z,we=L||ce;console.log("ServiceDetailsModal Debug:",{service:t==null?void 0:t.id,serviceType:t==null?void 0:t.type,isOpen:e,mcpDiscoveryLoading:z,mcpDiscoveryData:C,mcpDiscoveryError:U?String(U):null,mcpToolsLoading:L,a2aManifestLoading:ce,mcpToolsError:Q?String(Q):null,a2aManifestError:Ee?String(Ee):null,mcpToolsCount:ve.length,mcpToolsData:W,hasA2aManifest:!!te,isLoading:we,oauthRequired:(jr=(ps=C==null?void 0:C.data)==null?void 0:ps.oauth)==null?void 0:jr.required,oauthStatus:se.status,oauthMessage:se.message,oauthAuthenticated:F==null?void 0:F.authenticated,expiresAt:F==null?void 0:F.expiresAt}),x.useEffect(()=>{if(!e){T(null);return}t&&(T(t),c(t.cardColor||"#92E4DD"),g(t.name||""),y(t.description||""))},[t,e]);const Pe=x.useRef(!1);x.useEffect(()=>{if(!e||!(_!=null&&_.id)){Pe.current=!1;return}if(!(F!=null&&F.authenticated)){Pe.current=!1;return}if(Pe.current)return;Pe.current=!0,(async()=>{O({title:"OAuth completed",description:"Authentication successful! Refreshing service status..."}),N.invalidateQueries({queryKey:["/api/services",_.id]}),N.invalidateQueries({queryKey:["/api/mcp/discover",_.url]}),N.invalidateQueries({queryKey:["/api/collection-warnings"]});try{const je=await Oe("GET",`/api/services/${_.id}`);if(je.ok){const at=await je.json();T(at.data??at)}}catch{}await K(),N.invalidateQueries({queryKey:["/api/services",_.id,"tools"]}),await oe()})()},[F==null?void 0:F.authenticated,e,_==null?void 0:_.id]),x.useEffect(()=>{const de=je=>{const at=je.target;a&&!at.closest(".color-picker-container")&&o(!1)};return document.addEventListener("mousedown",de),()=>{document.removeEventListener("mousedown",de)}},[a]);const De=()=>(t==null?void 0:t.type)==="mcp"?i.jsx(r0,{className:"w-6 h-6"}):i.jsx(Df,{className:"w-6 h-6"}),ee=()=>(t==null?void 0:t.type)==="mcp"?"text-blue-400":"text-purple-400",fe=()=>(t==null?void 0:t.type)==="mcp"?"bg-blue-500/20":"bg-purple-500/20",X=de=>new Date(de).toLocaleDateString("en-US",{year:"numeric",month:"short",day:"numeric",hour:"2-digit",minute:"2-digit"}),ze=async de=>{if(t){d(!0),c(de);try{if((await Oe("PUT",`/api/services/${t.id}`,{cardColor:de})).ok)N.invalidateQueries({queryKey:["/api/services"]}),N.invalidateQueries({queryKey:["/api/collection/warnings"]}),N.invalidateQueries({queryKey:["/api/decks"]}),N.invalidateQueries({queryKey:["/api/decks"]}),O({title:"Color updated",description:"Card color has been updated successfully."}),o(!1);else throw new Error("Failed to update color")}catch{c(t.cardColor||"#92E4DD"),O({title:"Update failed",description:"Failed to update card color. Please try again.",variant:"destructive"})}finally{d(!1)}}},re=async()=>{if(!(!t||!h.trim())){S(!0);try{if((await Oe("PUT",`/api/services/${t.id}`,{name:h.trim()})).ok){if(R){const je={...R,name:h.trim()};T(je)}N.invalidateQueries({queryKey:["/api/services"]}),N.invalidateQueries({queryKey:["/api/collection/warnings"]}),N.invalidateQueries({queryKey:["/api/decks"]}),N.invalidateQueries({queryKey:["/api/decks"]}),O({title:"Name updated",description:"Service name has been updated successfully."}),m(!1)}else throw new Error("Failed to update name")}catch{O({title:"Update failed",description:"Failed to update service name. Please try again.",variant:"destructive"})}finally{S(!1)}}},Me=async()=>{if(t){k(!0);try{if((await Oe("PUT",`/api/services/${t.id}`,{description:v.trim()})).ok){if(R){const je={...R,description:v.trim()};T(je)}N.invalidateQueries({queryKey:["/api/services"]}),N.invalidateQueries({queryKey:["/api/collection/warnings"]}),N.invalidateQueries({queryKey:["/api/decks"]}),N.invalidateQueries({queryKey:["/api/decks"]}),O({title:"Description updated",description:"Service description has been updated successfully."}),w(!1)}else throw new Error("Failed to update description")}catch{O({title:"Update failed",description:"Failed to update service description. Please try again.",variant:"destructive"})}finally{k(!1)}}},Ue=[{value:"#92E4DD",label:"Default"},{value:"#F9386D",label:"Red"},{value:"#E0E0E0",label:"Gray"},{value:"#FF6B00",label:"Orange"}];return i.jsx(ao,{open:e,onOpenChange:r,children:i.jsxs(fa,{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:[i.jsx(ha,{children:i.jsxs(pa,{className:"text-2xl font-bold flex items-center",children:[De(),i.jsx("div",{className:"ml-3 flex items-center",children:f?i.jsxs("div",{className:"flex items-center gap-2",children:[i.jsx("input",{type:"text",value:h,onChange:de=>g(de.target.value),onKeyDown:de=>{de.key==="Enter"?re():de.key==="Escape"&&(m(!1),g((j==null?void 0:j.name)||""))},className:"bg-black/30 border border-white/20 rounded px-2 py-1 text-white text-2xl font-bold focus:outline-none focus:border-white/40",autoFocus:!0}),i.jsx(me,{size:"sm",onClick:re,disabled:b,className:"h-6 px-2 text-xs",children:b?"Saving...":"Save"}),i.jsx(me,{size:"sm",variant:"outline",onClick:()=>{m(!1),g((j==null?void 0:j.name)||"")},className:"h-6 px-2 text-xs",children:"Cancel"})]}):i.jsxs("div",{className:"flex items-center gap-2",children:[i.jsx("span",{className:"cursor-pointer hover:bg-white/10 px-2 py-1 rounded transition-colors",onClick:()=>m(!0),title:"Click to edit name",children:j==null?void 0:j.name}),i.jsx(me,{size:"sm",variant:"ghost",onClick:()=>m(!0),className:"h-6 w-6 p-0 opacity-0 hover:opacity-100 transition-opacity",title:"Edit name",children:i.jsx(Ou,{className:"w-3 h-3"})})]})}),i.jsx(pn,{className:`ml-3 ${fe()} ${ee()}`,children:(Dn=t==null?void 0:t.type)==null?void 0:Dn.toUpperCase()})]})}),t&&i.jsxs("div",{className:"space-y-6",children:[i.jsxs("div",{className:"bg-black/20 rounded-lg p-4 border border-white/10",children:[i.jsxs("div",{className:"flex items-center justify-between mb-3",children:[i.jsxs("h3",{className:"text-lg font-semibold flex items-center",children:[i.jsx(g2,{className:"w-5 h-5 mr-2"}),"Service Overview"]}),i.jsxs("div",{className:"relative color-picker-container",children:[i.jsx(me,{size:"sm",variant:"outline",className:"h-8 w-8 p-0 border-white/20 hover:bg-white/10",onClick:()=>o(!a),title:"Change card color",children:i.jsx("div",{className:"w-4 h-4 rounded-full border border-white/20",style:{backgroundColor:l||t.cardColor||"#92E4DD"}})}),a&&i.jsxs("div",{className:"absolute top-full right-0 mt-2 bg-black/90 border border-white/20 rounded-lg p-3 z-50 min-w-32",children:[i.jsx("div",{className:"text-xs text-gray-300 mb-2",children:"Choose Color:"}),i.jsx("div",{className:"grid grid-cols-1 gap-1",children:Ue.map(de=>i.jsxs("button",{className:`flex items-center gap-2 px-2 py-1 rounded text-xs hover:bg-white/10 transition-colors ${(l||t.cardColor)===de.value?"bg-white/20":""}`,onClick:()=>ze(de.value),disabled:u,children:[i.jsx("div",{className:"w-3 h-3 rounded-full border border-white/20",style:{backgroundColor:de.value}}),i.jsx("span",{className:"text-white",children:de.label}),u&&t.cardColor===de.value&&i.jsx("div",{className:"ml-auto w-3 h-3 border border-white/20 border-t-transparent rounded-full animate-spin"})]},de.value))})]})]})]}),i.jsxs("div",{className:"grid grid-cols-1 md:grid-cols-2 gap-4",children:[i.jsxs("div",{children:[i.jsxs("div",{className:"flex items-center justify-between mb-1",children:[i.jsx("p",{className:"text-gray-300 text-sm",children:"Description"}),!p&&i.jsx(me,{size:"sm",variant:"ghost",onClick:()=>w(!0),className:"h-6 w-6 p-0 opacity-0 hover:opacity-100 transition-opacity",title:"Edit description",children:i.jsx(Ou,{className:"w-3 h-3"})})]}),p?i.jsxs("div",{className:"space-y-2",children:[i.jsx("textarea",{value:v,onChange:de=>y(de.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}),i.jsxs("div",{className:"flex gap-2",children:[i.jsx(me,{size:"sm",onClick:Me,disabled:E,className:"h-6 px-2 text-xs",children:E?"Saving...":"Save"}),i.jsx(me,{size:"sm",variant:"outline",onClick:()=>{w(!1),y((j==null?void 0:j.description)||"")},className:"h-6 px-2 text-xs",children:"Cancel"})]})]}):i.jsx("p",{className:"text-white cursor-pointer hover:bg-white/10 px-2 py-1 rounded transition-colors",onClick:()=>w(!0),title:"Click to edit description",children:(j==null?void 0:j.description)||"No description"})]}),i.jsxs("div",{children:[i.jsx("p",{className:"text-gray-300 text-sm mb-1",children:"Endpoint"}),i.jsxs("div",{className:"space-y-2",children:[i.jsxs("div",{className:"flex items-center justify-between",children:[i.jsxs("div",{className:"flex items-center space-x-2",children:[i.jsx(pn,{variant:"outline",className:"border-blue-500/30 text-blue-300",children:_.type.toUpperCase()}),t.headers&&typeof t.headers=="object"&&Object.keys(t.headers).length>0&&i.jsx(pn,{variant:"outline",className:"border-green-500/30 text-green-300",children:"Custom Headers"})]}),i.jsx(me,{size:"sm",variant:"ghost",onClick:()=>window.open(_.url,"_blank"),className:"p-1 h-auto",children:i.jsx(Jn,{className:"w-4 h-4"})})]}),i.jsx("div",{className:"text-xs text-gray-400 break-all bg-black/20 p-2 rounded border border-white/10",children:_.url||"No URL available"}),t.headers&&typeof t.headers=="object"&&Object.keys(t.headers).length>0&&i.jsxs("div",{className:"text-xs text-gray-400 bg-black/20 p-2 rounded border border-white/10",children:[i.jsx("p",{className:"font-semibold mb-1",children:"Custom Headers:"}),i.jsx("pre",{className:"text-xs overflow-x-auto",children:JSON.stringify(t.headers,null,2)})]})]})]}),i.jsxs("div",{children:[i.jsx("p",{className:"text-gray-300 text-sm mb-1",children:"Health Status"}),i.jsx(pn,{className:_.health==="healthy"?"bg-green-500/20 text-green-300":_.health==="unhealthy"?"bg-red-500/20 text-red-300":"bg-amber-500/20 text-amber-200",children:_.health==="healthy"?"Healthy":_.health==="unhealthy"?"Unreachable":se.status==="required"||se.status==="expired"?"Auth required":"Unknown"})]}),i.jsxs("div",{children:[i.jsx("p",{className:"text-gray-300 text-sm mb-1",children:"Registered"}),i.jsx("p",{className:"text-white text-sm",children:X(_.registeredAt)})]})]})]}),we&&i.jsxs("div",{className:"text-center py-8",children:[i.jsx("div",{className:"animate-spin rounded-full h-8 w-8 border-b-2 border-white mx-auto mb-4"}),i.jsx("p",{className:"text-gray-400",children:"Fetching service details..."})]}),s&&i.jsx("div",{className:"bg-red-500/20 border border-red-500/30 rounded-lg p-4",children:i.jsx("p",{className:"text-red-300",children:s})}),(t.type==="mcp"||t.type==="local-mcp")&&i.jsxs(i.Fragment,{children:[t.type==="local-mcp"&&i.jsxs("div",{className:"bg-cyan-500/15 border border-cyan-500/30 rounded-lg p-4 mb-4",children:[i.jsx("h3",{className:"text-cyan-200 font-semibold mb-2",children:"Local MCP — auth happens outside Agent Deck"}),i.jsx("div",{className:"text-cyan-100/90 text-sm space-y-2",children:nI(_)?i.jsxs(i.Fragment,{children:[i.jsxs("p",{children:["This card runs ",i.jsx("code",{className:"text-xs",children:"@piotr-agier/google-drive-mcp"})," on your machine. Agent Deck does ",i.jsx("strong",{children:"not"}),' handle Google OAuth for it. If Google shows "app not verified", that is ',i.jsx("strong",{children:"your Google Cloud project"}),", not Agent Deck."]}),i.jsxs("ol",{className:"list-decimal list-inside space-y-1 ml-1",children:[i.jsxs("li",{children:["Create a GCP OAuth client type ",i.jsx("strong",{children:"Desktop app"})," (not Web)."]}),i.jsxs("li",{children:["Add yourself as a ",i.jsx("strong",{children:"Test user"})," on the consent screen."]}),i.jsxs("li",{children:["Run in terminal first:"," ",i.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"
|
|
357
|
+
export GOOGLE_DRIVE_MCP_AUTH_PORT=3100
|
|
358
|
+
npx @piotr-agier/google-drive-mcp auth`})]}),i.jsxs("li",{children:["Set ",i.jsx("code",{className:"text-xs",children:"GOOGLE_DRIVE_MCP_TOKEN_PATH"})," in the card env to the same token file (",i.jsx("code",{className:"text-xs",children:"~/.config/google-drive-mcp/tokens.json"}),")."]})]}),i.jsxs("p",{className:"text-xs text-cyan-200/80",children:["Full steps: ",i.jsx("code",{className:"text-xs",children:"docs/GOOGLE_DRIVE_WORKAROUND.md"})," in the repo."]})]}):i.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."})})]}),i.jsx(rI,{serviceId:_.id,tools:ve,isLoading:L})]}),t.type==="a2a"&&te&&i.jsxs("div",{className:"space-y-6",children:[i.jsxs("div",{className:"bg-black/20 rounded-lg p-4 border border-white/10",children:[i.jsxs("h3",{className:"text-lg font-semibold mb-4 flex items-center",children:[i.jsx(P2,{className:"w-5 h-5 mr-2"}),"Agent Overview"]}),i.jsxs("div",{className:"grid grid-cols-1 md:grid-cols-2 gap-4",children:[i.jsxs("div",{children:[i.jsx("p",{className:"text-gray-300 text-sm mb-1",children:"Agent Name"}),i.jsx("p",{className:"text-white font-semibold",children:te.name})]}),i.jsxs("div",{children:[i.jsx("p",{className:"text-gray-300 text-sm mb-1",children:"Version"}),i.jsx("p",{className:"text-white",children:te.version})]}),i.jsxs("div",{className:"md:col-span-2",children:[i.jsx("p",{className:"text-gray-300 text-sm mb-1",children:"Description"}),i.jsx("p",{className:"text-white",children:te.description})]}),te.provider&&i.jsxs("div",{children:[i.jsx("p",{className:"text-gray-300 text-sm mb-1",children:"Provider"}),i.jsx("p",{className:"text-white",children:te.provider.organization})]}),te.documentationUrl&&i.jsxs("div",{children:[i.jsx("p",{className:"text-gray-300 text-sm mb-1",children:"Documentation"}),i.jsxs(me,{size:"sm",variant:"ghost",onClick:()=>window.open(te.documentationUrl,"_blank"),className:"p-1 h-auto text-purple-300",children:[i.jsx(Jn,{className:"w-4 h-4 mr-1"}),"View Docs"]})]})]})]}),te.capabilities&&i.jsxs("div",{className:"bg-black/20 rounded-lg p-4 border border-white/10",children:[i.jsxs("h3",{className:"text-lg font-semibold mb-4 flex items-center",children:[i.jsx(R1,{className:"w-5 h-5 mr-2"}),"Capabilities"]}),i.jsxs("div",{className:"grid grid-cols-1 md:grid-cols-3 gap-3",children:[te.capabilities.streaming&&i.jsx(pn,{className:"bg-green-500/20 text-green-300",children:"Streaming"}),te.capabilities.pushNotifications&&i.jsx(pn,{className:"bg-blue-500/20 text-blue-300",children:"Push Notifications"}),te.capabilities.stateTransitionHistory&&i.jsx(pn,{className:"bg-purple-500/20 text-purple-300",children:"State History"})]})]}),te.skills&&te.skills.length>0&&i.jsxs("div",{className:"bg-black/20 rounded-lg p-4 border border-white/10",children:[i.jsxs("h3",{className:"text-lg font-semibold mb-4 flex items-center",children:[i.jsx(Df,{className:"w-5 h-5 mr-2"}),"Skills (",te.skills.length,")"]}),i.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:te.skills.map((de,je)=>i.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:[i.jsx("div",{className:"absolute top-2 left-2 text-xs font-bold",children:i.jsx("div",{className:"text-purple-300 leading-none",children:"S"})}),i.jsx("div",{className:"absolute bottom-2 right-2 text-xs font-bold rotate-180",children:i.jsx("div",{className:"text-purple-300 leading-none",children:"S"})}),i.jsxs("div",{className:"absolute inset-x-3 top-8 bottom-8 flex flex-col items-center justify-center text-center",children:[i.jsx("div",{className:"text-purple-300 mb-2",children:i.jsx(Df,{className:"w-6 h-6"})}),i.jsx("h4",{className:"font-bold text-sm mb-2 line-clamp-2 text-white",children:de.name}),i.jsx("p",{className:"text-gray-300 text-xs line-clamp-4 mb-2",children:de.description}),de.tags&&de.tags.length>0&&i.jsx("div",{className:"flex flex-wrap gap-1 justify-center",children:de.tags.slice(0,2).map((at,Dt)=>i.jsx("span",{className:"text-purple-300 text-xs bg-purple-500/20 px-1 py-0.5 rounded",children:at},Dt))})]}),i.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"})]},je))})]}),(te.defaultInputModes||te.defaultOutputModes)&&i.jsxs("div",{className:"bg-black/20 rounded-lg p-4 border border-white/10",children:[i.jsxs("h3",{className:"text-lg font-semibold mb-3 flex items-center",children:[i.jsx(r0,{className:"w-5 h-5 mr-2"}),"Data Modes"]}),i.jsxs("div",{className:"grid grid-cols-1 md:grid-cols-2 gap-4",children:[te.defaultInputModes&&i.jsxs("div",{children:[i.jsx("p",{className:"text-gray-300 text-sm mb-2",children:"Input Modes"}),i.jsx("div",{className:"flex flex-wrap gap-2",children:te.defaultInputModes.map((de,je)=>i.jsx(pn,{className:"bg-blue-500/20 text-blue-300 text-xs",children:de},je))})]}),te.defaultOutputModes&&i.jsxs("div",{children:[i.jsx("p",{className:"text-gray-300 text-sm mb-2",children:"Output Modes"}),i.jsx("div",{className:"flex flex-wrap gap-2",children:te.defaultOutputModes.map((de,je)=>i.jsx(pn,{className:"bg-green-500/20 text-green-300 text-xs",children:de},je))})]})]})]})]}),(t==null?void 0:t.type)==="mcp"&&se.status==="not_required"&&(_==null?void 0:_.id)&&i.jsxs("div",{className:"bg-blue-500/20 border border-blue-500/30 rounded-lg p-4 mb-4",children:[i.jsx("h3",{className:"text-blue-300 font-semibold mb-2",children:"How to connect"}),i.jsx(R0,{serviceId:_.id})]}),(t==null?void 0:t.type)==="mcp"&&se.status!=="authenticated"&&se.status!=="not_required"&&i.jsxs("div",{className:`${se.status==="expired"?"bg-red-500/20 border-red-500/30":"bg-orange-500/20 border-orange-500/30"} rounded-lg p-4 mb-4`,children:[i.jsx("h3",{className:`${se.status==="expired"?"text-red-300":"text-orange-300"} font-semibold mb-2`,children:se.status==="expired"?"⏰ Token Expired":"🔐 Authentication Required"}),i.jsxs("div",{className:`${se.status==="expired"?"text-red-200":"text-orange-200"} text-sm space-y-2`,children:[i.jsx("p",{children:i.jsx("strong",{children:se.message})}),i.jsx("p",{children:se.status==="expired"?"Your OAuth token has expired. Please re-authenticate to continue using this service.":"This MCP server requires OAuth authentication to access its tools. Please authenticate to continue."}),(_==null?void 0:_.id)&&i.jsx(R0,{serviceId:_.id,onConnected:()=>void V()}),((ya=(ms=C==null?void 0:C.data)==null?void 0:ms.oauth)==null?void 0:ya.resourceName)&&i.jsx("div",{className:"mt-3 p-2 bg-orange-500/10 rounded border border-orange-500/20 text-xs text-orange-100",children:i.jsxs("p",{children:[i.jsx("strong",{children:"Resource:"})," ",C.data.oauth.resourceName]})})]})]}),(t==null?void 0:t.type)==="mcp"&&i.jsxs("div",{className:"bg-gray-800/50 border border-gray-600/30 rounded-lg p-4 mb-4",children:[i.jsx("h3",{className:"text-gray-300 font-semibold mb-2",children:"Connection Logs"}),i.jsxs("div",{className:"text-gray-200 text-sm space-y-2",children:[i.jsxs("div",{className:"bg-black/30 p-2 rounded text-xs",children:[i.jsx("p",{children:i.jsx("strong",{children:"🔍 Attempting to discover tools for MCP service:"})}),i.jsxs("p",{children:["Service ID: ",t==null?void 0:t.id]}),i.jsxs("p",{children:["Service URL: ",_==null?void 0:_.url]}),i.jsxs("p",{children:["Status: ",L?"🔄 Loading...":Q?"❌ Failed":"✅ Complete"]})]}),L&&i.jsxs("div",{className:"bg-yellow-500/20 p-2 rounded text-xs",children:[i.jsxs("p",{children:["🔄 Making HTTP request to: ",i.jsxs("code",{children:["GET /api/services/",t==null?void 0:t.id,"/tools"]})]}),i.jsxs("p",{children:["Target MCP server: ",i.jsx("code",{children:_==null?void 0:_.url})]})]}),Q&&i.jsxs("div",{className:"bg-red-500/20 p-2 rounded text-xs",children:[i.jsx("p",{children:"❌ Request failed:"}),i.jsx("pre",{className:"whitespace-pre-wrap overflow-x-auto",children:Q instanceof Error?Q.message:String(Q)}),i.jsxs("div",{className:"mt-2 p-2 bg-black/30 rounded",children:[i.jsx("p",{children:i.jsx("strong",{children:"🔍 What we tried:"})}),i.jsxs("p",{children:["• Service ID: ",t==null?void 0:t.id]}),i.jsxs("p",{children:["• Target URL: ",_==null?void 0:_.url]}),i.jsxs("p",{children:["• Request: GET /api/services/",t==null?void 0:t.id,"/tools"]}),(_==null?void 0:_.headers)&&i.jsxs("div",{children:[i.jsx("p",{children:i.jsx("strong",{children:"📋 Headers sent:"})}),i.jsx("pre",{className:"text-xs overflow-x-auto",children:JSON.stringify(_.headers,null,2)})]}),i.jsxs("div",{className:"mt-2",children:[i.jsx("p",{children:i.jsx("strong",{children:"💡 What this means:"})}),i.jsxs("p",{children:["• The MCP server at ",_==null?void 0:_.url," returned an error"]}),i.jsx("p",{children:"• This could be due to authentication issues, server being down, or invalid configuration"}),i.jsx("p",{children:"• Check the error message above for specific details from the MCP server"})]})]})]}),!L&&!Q&&ve.length>0&&i.jsx("div",{className:"bg-green-500/20 p-2 rounded text-xs",children:i.jsxs("p",{children:["✅ Successfully discovered ",ve.length," tools from MCP server"]})}),!L&&!Q&&ve.length===0&&i.jsxs("div",{className:"bg-yellow-500/20 p-2 rounded text-xs",children:[i.jsx("p",{children:"⚠️ Connected to MCP server but no tools were found"}),i.jsx("p",{children:"This could mean the server has no tools or requires specific authentication"})]})]})]}),Q&&(t.type==="mcp"||t.type==="local-mcp")&&i.jsxs("div",{className:"bg-red-500/20 border border-red-500/30 rounded-lg p-4",children:[i.jsx("h3",{className:"text-red-300 font-semibold mb-2",children:"MCP Tool Discovery Failed"}),i.jsxs("div",{className:"text-red-200 text-sm space-y-2",children:[i.jsx("p",{children:i.jsx("strong",{children:"Raw Error:"})}),i.jsx("pre",{className:"bg-black/30 p-2 rounded text-xs overflow-x-auto whitespace-pre-wrap",children:Q instanceof Error?Q.message:String(Q)}),i.jsxs("p",{children:[i.jsx("strong",{children:"Service URL:"})," ",_==null?void 0:_.url]}),i.jsxs("p",{children:[i.jsx("strong",{children:"Service ID:"})," ",_==null?void 0:_.id]}),(_==null?void 0:_.headers)&&i.jsxs("div",{children:[i.jsx("p",{children:i.jsx("strong",{children:"Custom Headers:"})}),i.jsx("pre",{className:"bg-black/30 p-2 rounded text-xs overflow-x-auto",children:JSON.stringify(_.headers,null,2)})]})]})]}),Ee&&t.type==="a2a"&&i.jsxs("div",{className:"bg-red-500/20 border border-red-500/30 rounded-lg p-4",children:[i.jsx("h3",{className:"text-red-300 font-semibold mb-2",children:"A2A Manifest Discovery Failed"}),i.jsxs("div",{className:"text-red-200 text-sm space-y-2",children:[i.jsx("p",{children:i.jsx("strong",{children:"Raw Error:"})}),i.jsx("pre",{className:"bg-black/30 p-2 rounded text-xs overflow-x-auto whitespace-pre-wrap",children:Ee instanceof Error?Ee.message:String(Ee)}),i.jsxs("p",{children:[i.jsx("strong",{children:"Service URL:"})," ",_==null?void 0:_.url]}),i.jsxs("p",{children:[i.jsx("strong",{children:"Service ID:"})," ",_==null?void 0:_.id]})]})]}),!we&&!Q&&!Ee&&(t.type==="mcp"||t.type==="local-mcp")&&ve.length===0&&(t.type==="local-mcp"||!((ne=(vs=C==null?void 0:C.data)==null?void 0:vs.oauth)!=null&&ne.required))&&i.jsxs("div",{className:"bg-yellow-500/20 border border-yellow-500/30 rounded-lg p-4",children:[i.jsx("h3",{className:"text-yellow-300 font-semibold mb-2",children:"No Tools Available"}),i.jsxs("p",{className:"text-yellow-200 text-sm",children:["Successfully connected to MCP server at ",_==null?void 0:_.url,", but no tools were discovered."]}),i.jsxs("div",{className:"text-yellow-200 text-xs mt-2",children:[i.jsx("p",{children:i.jsx("strong",{children:"This could mean:"})}),i.jsxs("ul",{className:"list-disc list-inside ml-2 space-y-1",children:[i.jsx("li",{children:"The MCP server has no tools registered"}),i.jsx("li",{children:"Tools require specific authentication"}),i.jsx("li",{children:"Tools are only available after certain operations"})]})]})]}),(t.type==="mcp"||t.type==="local-mcp")&&i.jsxs("div",{className:"bg-blue-500/20 border border-blue-500/30 rounded-lg p-4",children:[i.jsx("h3",{className:"text-blue-300 font-semibold mb-2",children:"🔍 MCP Server Analysis"}),i.jsxs("div",{className:"text-blue-200 text-sm space-y-2",children:[i.jsxs("p",{children:[i.jsx("strong",{children:"Server URL:"})," ",_==null?void 0:_.url]}),z&&i.jsx("div",{className:"mt-3 p-3 bg-black/30 rounded",children:i.jsx("p",{children:"🔍 Analyzing MCP server configuration..."})}),C&&i.jsxs("div",{className:"mt-3 p-3 bg-black/30 rounded",children:[i.jsx("p",{children:i.jsx("strong",{children:"🔍 What we discovered:"})}),C.error&&C.analysis&&i.jsxs("div",{className:"text-yellow-200",children:[C.analysis.auth_type==="oauth2"&&i.jsxs("div",{children:[i.jsxs("p",{children:["• ",i.jsx("strong",{children:"OAuth 2.0 Authentication Required"})]}),i.jsx("p",{children:"• This MCP server requires OAuth 2.0 Bearer token authentication"}),i.jsx("p",{children:"• You'll need to provide OAuth credentials (client ID, client secret, authorization URL, token URL)"}),i.jsx("p",{children:"• Check the service provider's documentation for OAuth setup instructions"})]}),C.analysis.protocol==="sse"&&i.jsxs("div",{children:[i.jsxs("p",{children:["• ",i.jsx("strong",{children:"SSE Protocol Required"})]}),i.jsx("p",{children:"• This MCP server uses Server-Sent Events (SSE) protocol"}),i.jsx("p",{children:"• We'll need to connect using event streaming instead of HTTP"})]}),C.analysis.issue==="not_found"&&i.jsxs("div",{children:[i.jsxs("p",{children:["• ",i.jsx("strong",{children:"Server Not Found"})]}),i.jsx("p",{children:"• The MCP server URL might be incorrect"}),i.jsx("p",{children:"• Check if the server is running and the URL is correct"})]}),C.analysis.issue==="server_error"&&i.jsxs("div",{children:[i.jsxs("p",{children:["• ",i.jsx("strong",{children:"Server Error"})]}),i.jsx("p",{children:"• The MCP server is experiencing internal errors"}),i.jsx("p",{children:"• Try again later or contact the service provider"})]}),C.analysis.message&&i.jsxs("p",{children:["• ",i.jsx("strong",{children:"Analysis:"})," ",C.analysis.message]})]}),((Mn=(Et=C==null?void 0:C.data)==null?void 0:Et.oauth)==null?void 0:Mn.required)&&i.jsxs("div",{className:"text-yellow-200",children:[i.jsxs("p",{children:["• ",i.jsx("strong",{children:"OAuth 2.0 Authentication Required"})]}),C.data.oauth.authorizationUrl&&i.jsxs("div",{className:"mt-2 flex items-center gap-2",children:[i.jsx(me,{size:"sm",variant:"default",className:"h-7",onClick:async()=>{var de,je;if(_!=null&&_.id)try{O({title:"Setting up OAuth...",description:"Automatically registering OAuth application and starting authorization flow..."});const at=await Oe("POST",`/api/oauth/${_.id}/auto-setup`,{});if(!at.ok){const Nt=await at.json();(de=Nt.data)!=null&&de.registrationUrl?(window.open(Nt.data.registrationUrl,"_blank"),O({title:"OAuth Registration Required",description:`${Nt.error} I've opened the registration page for you. Please create an OAuth app and then come back to add your credentials.`,duration:15e3})):O({title:"OAuth Setup Failed",description:Nt.error||"Failed to setup OAuth automatically. Please configure manually.",variant:"destructive"});return}const Dt=await at.json();Dt.success&&((je=Dt.data)!=null&&je.authorizationUrl)?(window.open(Dt.data.authorizationUrl,"_blank"),O({title:"OAuth Setup Successful",description:"OAuth application registered automatically! Please complete the authorization in the new window.",duration:1e4}),V()):O({title:"OAuth Setup Failed",description:"Failed to get authorization URL. Please try again.",variant:"destructive"})}catch(at){O({title:"OAuth Setup Failed",description:at instanceof Error?at.message:"Unknown error occurred",variant:"destructive"})}},children:"🔧 Auto-Setup OAuth"}),i.jsxs(me,{size:"sm",variant:"ghost",className:"p-1 h-auto text-blue-300",onClick:()=>window.open(C.data.oauth.authorizationUrl,"_blank"),children:[i.jsx(Jn,{className:"w-4 h-4 mr-1"}),"Open Raw Authorization URL"]})]}),!C.data.oauth.authorizationUrl&&C.data.oauth.protectedResourceConfigUrl&&i.jsx("div",{className:"mt-2",children:i.jsxs(me,{size:"sm",variant:"ghost",className:"p-1 h-auto text-blue-300",onClick:()=>window.open(C.data.oauth.protectedResourceConfigUrl,"_blank"),children:[i.jsx(Jn,{className:"w-4 h-4 mr-1"}),"View OAuth Configuration"]})}),C.data.oauth.authorizationServerMetadataUrl&&i.jsxs("div",{className:"mt-2 text-xs text-gray-300",children:[i.jsx("span",{className:"mr-1",children:"Auth Server Metadata:"}),i.jsx("button",{className:"underline text-blue-300",onClick:()=>window.open(C.data.oauth.authorizationServerMetadataUrl,"_blank"),children:C.data.oauth.authorizationServerMetadataUrl})]})]}),(C==null?void 0:C.success)&&!((Yl=($n=C==null?void 0:C.data)==null?void 0:$n.oauth)!=null&&Yl.required)&&i.jsxs("div",{className:"text-green-200",children:[i.jsxs("p",{children:["• ",i.jsx("strong",{children:"✅ Server Analysis Complete"})]}),i.jsx("p",{children:"• MCP server is accessible and responding"}),i.jsx("p",{children:"• No authentication issues detected"}),i.jsx("p",{children:"• Protocol compatibility confirmed"})]}),((Xl=(Jl=C==null?void 0:C.data)==null?void 0:Jl.oauth)==null?void 0:Xl.required)&&i.jsxs("div",{className:"text-orange-200",children:[i.jsxs("p",{children:["• ",i.jsx("strong",{children:"🔐 OAuth 2.0 Authentication Required"})]}),i.jsx("p",{children:"• This MCP server requires OAuth authentication"}),C.data.oauth.resourceName&&i.jsxs("p",{children:["• Service: ",C.data.oauth.resourceName]}),C.data.oauth.authorizationUrl&&i.jsxs("p",{children:["• Authorization URL: ",C.data.oauth.authorizationUrl]}),C.data.oauth.tokenUrl&&i.jsxs("p",{children:["• Token URL: ",C.data.oauth.tokenUrl]}),i.jsxs("div",{className:"mt-3 flex flex-wrap gap-2",children:[i.jsx(me,{size:"sm",variant:"default",className:"bg-orange-600 hover:bg-orange-700",onClick:async()=>{var de,je;if(_!=null&&_.id)try{O({title:"Setting up OAuth...",description:"Automatically registering OAuth application and starting authorization flow..."});const at=await Oe("POST",`/api/oauth/${_.id}/auto-setup`,{});if(!at.ok){const Nt=await at.json();(de=Nt.data)!=null&&de.registrationUrl?(window.open(Nt.data.registrationUrl,"_blank"),O({title:"OAuth Registration Required",description:`${Nt.error} I've opened the registration page for you. Please create an OAuth app and then come back to add your credentials.`,duration:15e3})):O({title:"OAuth Setup Failed",description:Nt.error||"Failed to setup OAuth automatically. Please configure manually.",variant:"destructive"});return}const Dt=await at.json();Dt.success&&((je=Dt.data)!=null&&je.authorizationUrl)?(window.open(Dt.data.authorizationUrl,"_blank"),O({title:"OAuth Setup Successful",description:"OAuth application registered automatically! Please complete the authorization in the new window.",duration:1e4}),V()):O({title:"OAuth Setup Failed",description:"Failed to get authorization URL. Please try again.",variant:"destructive"})}catch(at){O({title:"OAuth Setup Failed",description:at instanceof Error?at.message:"Unknown error occurred",variant:"destructive"})}},children:"🔧 Auto-Setup OAuth"}),i.jsx(me,{size:"sm",variant:"outline",className:"border-orange-500/30 text-orange-300 hover:bg-orange-500/10",onClick:()=>{const de=`OAuth Setup Instructions:
|
|
359
|
+
|
|
360
|
+
1. Go to the service provider's OAuth/Developer settings
|
|
361
|
+
2. Create a new OAuth application
|
|
362
|
+
3. Set Redirect URL: http://localhost:8000/api/oauth/${_==null?void 0:_.id}/callback
|
|
363
|
+
4. Copy the Client ID and Client Secret
|
|
364
|
+
5. Edit this service and add the credentials
|
|
365
|
+
|
|
366
|
+
${C.data.oauth.authorizationUrl?`Authorization URL: ${C.data.oauth.authorizationUrl}`:""}
|
|
367
|
+
${C.data.oauth.tokenUrl?`Token URL: ${C.data.oauth.tokenUrl}`:""}
|
|
368
|
+
${C.data.oauth.issuer?`Issuer: ${C.data.oauth.issuer}`:""}`;O({title:"OAuth Setup Instructions",description:de,duration:1e4})},children:"📋 Setup Instructions"})]})]}),i.jsxs("div",{className:"mt-2 text-xs",children:[i.jsx("p",{children:i.jsx("strong",{children:"💡 Next Steps:"})}),i.jsxs("ul",{className:"list-disc list-inside ml-2 space-y-1",children:[i.jsx("li",{children:"For OAuth servers: Provide OAuth credentials in service settings"}),i.jsx("li",{children:"For SSE servers: We'll automatically use the correct protocol"}),i.jsx("li",{children:"For connection issues: Verify the server URL and status"})]})]})]}),U&&i.jsxs("div",{className:"mt-3 p-3 bg-red-500/20 rounded",children:[i.jsx("p",{children:i.jsx("strong",{children:"❌ Discovery Failed"})}),i.jsx("p",{children:"Could not analyze MCP server configuration"}),i.jsx("pre",{className:"text-xs overflow-x-auto",children:U instanceof Error?U.message:String(U)})]})]})]}),!we&&!Q&&!Ee&&t.type==="a2a"&&!te&&i.jsxs("div",{className:"bg-yellow-500/20 border border-yellow-500/30 rounded-lg p-4",children:[i.jsx("h3",{className:"text-yellow-300 font-semibold mb-2",children:"Agent Details Not Available"}),i.jsxs("p",{className:"text-yellow-200 text-sm",children:["Successfully connected to A2A agent at ",_==null?void 0:_.url,", but no manifest was found."]}),i.jsxs("div",{className:"text-yellow-200 text-xs mt-2",children:[i.jsx("p",{children:i.jsx("strong",{children:"This could mean:"})}),i.jsxs("ul",{className:"list-disc list-inside ml-2 space-y-1",children:[i.jsx("li",{children:"The agent doesn't provide a manifest"}),i.jsx("li",{children:"Manifest endpoint is not implemented"}),i.jsx("li",{children:"Agent requires specific authentication"})]})]})]})]})]})})}function aI(){const[t,e]=x.useState("connecting"),[r,s]=x.useState(null),n=x.useRef(null),a=x.useRef(null),o=yr();return x.useEffect(()=>{const c=`${window.location.protocol==="https:"?"wss:":"ws:"}//${window.location.host}/api/ws/events`,u=()=>{try{const d=new WebSocket(c);n.current=d,d.onopen=()=>{console.log("WebSocket connected"),e("connected")},d.onmessage=f=>{try{const m=JSON.parse(f.data);s(m),m.type==="deck_update"?(console.log("Received deck update:",m),o.invalidateQueries({queryKey:["/api/decks"]}),o.invalidateQueries({queryKey:["/api/decks"]})):m.type==="service_update"?(console.log("Received service update:",m),o.invalidateQueries({queryKey:["/api/services"]})):m.type==="connection_status"&&e(m.status==="connected"?"connected":"disconnected")}catch(m){console.error("Failed to parse WebSocket message:",m)}},d.onclose=()=>{console.log("WebSocket disconnected"),e("disconnected"),a.current=setTimeout(()=>{console.log("Attempting to reconnect WebSocket..."),e("connecting"),u()},3e3)},d.onerror=f=>{console.error("WebSocket error:",f),e("disconnected")}}catch(d){console.error("Failed to connect WebSocket:",d),e("disconnected")}};return u(),()=>{a.current&&clearTimeout(a.current),n.current&&n.current.readyState===WebSocket.OPEN&&n.current.close()}},[o]),{connectionStatus:t,lastMessage:r}}async function T0(t,e){const r=t==="credential"?`credentialId=${encodeURIComponent(e)}`:`serviceId=${encodeURIComponent(e)}`;return(await(await Oe("GET",`/api/playbooks/dependents/check?${r}`)).json()).data??[]}function oI(t){const[e,r]=x.useState(null),[s,n]=x.useState(null),[a,o]=x.useState(null),[l,c]=x.useState(!1),u=yr(),{toast:d}=or(),f=()=>{if(!t)throw new Error("Select a deck to edit first");return t},m=At({mutationFn:async j=>{var K,$,F;const _=f(),z=(K=(await(await Oe("GET","/api/decks")).json()).data)==null?void 0:K.find(V=>V.id===_);if(!z)throw new Error("Selected deck not found");if(($=z.services)!=null&&$.some(V=>V.id===j))throw new Error("Service is already in the deck");const U=((F=z.services)==null?void 0:F.length)??0;return Oe("POST",`/api/decks/${_}/services`,{serviceId:j,position:U})},onSuccess:()=>{u.invalidateQueries({queryKey:["/api/decks"]}),d({title:"Service added to deck",description:`${(e==null?void 0:e.name)||"Service"} has been added to the deck.`})},onError:j=>{d({title:"Failed to add service",description:j.message,variant:"destructive"})}}),p=At({mutationFn:async j=>{var U,K;const _=f(),z=(U=(await(await Oe("GET","/api/decks")).json()).data)==null?void 0:U.find($=>$.id===_);if((K=z==null?void 0:z.credentials)!=null&&K.some($=>$.id===j))throw new Error("API key is already in the deck");return Oe("POST",`/api/decks/${_}/credentials`,{credentialId:j})},onSuccess:()=>{u.invalidateQueries({queryKey:["/api/decks"]}),d({title:"API key added to deck",description:`${(s==null?void 0:s.label)||"API key"} is scoped to this deck.`})},onError:j=>{d({title:"Failed to add API key",description:j.message,variant:"destructive"})}}),w=At({mutationFn:async j=>{var U,K;const _=f(),z=(U=(await(await Oe("GET","/api/decks")).json()).data)==null?void 0:U.find($=>$.id===_);if((K=z==null?void 0:z.playbooks)!=null&&K.some($=>$.id===j))throw new Error("Playbook is already in the deck");return Oe("POST",`/api/decks/${_}/playbooks`,{playbookId:j})},onSuccess:()=>{u.invalidateQueries({queryKey:["/api/decks"]}),d({title:"Playbook added to deck",description:`${(a==null?void 0:a.title)||"Playbook"} is on this deck.`})},onError:j=>{d({title:"Failed to add playbook",description:j.message,variant:"destructive"})}}),h=At({mutationFn:async j=>{const _=await T0("service",j);if(_.length>0){const C=_.map(U=>U.title).join(", ");if(!window.confirm(`Warning: ${_.length} playbook(s) depend on this MCP (${C}). Remove from deck anyway?`))throw new Error("Cancelled")}const A=f();return Oe("DELETE",`/api/decks/${A}/services`,{serviceId:j})},onSuccess:()=>{u.invalidateQueries({queryKey:["/api/decks"]}),d({title:"Service removed from deck",description:`${(e==null?void 0:e.name)||"Service"} has been removed from the deck.`})},onError:j=>{j.message!=="Cancelled"&&d({title:"Failed to remove service",description:j.message,variant:"destructive"})}}),g=At({mutationFn:async j=>{const _=await T0("credential",j);if(_.length>0){const C=_.map(U=>U.title).join(", ");if(!window.confirm(`Warning: ${_.length} playbook(s) depend on this API key (${C}). Remove from deck anyway?`))throw new Error("Cancelled")}const A=f();return Oe("DELETE",`/api/decks/${A}/credentials`,{credentialId:j})},onSuccess:()=>{u.invalidateQueries({queryKey:["/api/decks"]}),d({title:"API key removed from deck",description:`${(s==null?void 0:s.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"})}}),v=At({mutationFn:async j=>{const _=f();return Oe("DELETE",`/api/decks/${_}/playbooks`,{playbookId:j})},onSuccess:()=>{u.invalidateQueries({queryKey:["/api/decks"]}),d({title:"Playbook removed from deck",description:`${(a==null?void 0:a.title)||"Playbook"} is no longer on this deck.`})},onError:j=>{d({title:"Failed to remove playbook",description:j.message,variant:"destructive"})}}),y=(j,_)=>{j.currentTarget instanceof HTMLElement&&(j.currentTarget.style.opacity=_)},b=(j,_)=>{j.dataTransfer.setData("text/plain",_.id),j.dataTransfer.setData("application/json",JSON.stringify(_)),j.dataTransfer.effectAllowed=_.fromDeck?"move":"copy"},S=(j,_,A=!1)=>{r(_),n(null),o(null),c(A),b(j,{kind:"service",id:_.id,fromDeck:A}),y(j,"0.5")},E=(j,_,A=!1)=>{n(_),r(null),o(null),c(A),b(j,{kind:"credential",id:_.id,fromDeck:A}),y(j,"0.5")},k=(j,_,A=!1)=>{o(_),r(null),n(null),c(A),b(j,{kind:"playbook",id:_.id,fromDeck:A}),y(j,"0.5")},R=j=>{r(null),n(null),o(null),y(j,"1")},T=j=>{if(j.kind==="service"){j.fromDeck?h.mutate(j.id):m.mutate(j.id);return}if(j.kind==="credential"){j.fromDeck?g.mutate(j.id):p.mutate(j.id);return}j.fromDeck?v.mutate(j.id):w.mutate(j.id)};return{draggedService:e,draggedCredential:s,draggedPlaybook:a,isDraggingFromDeck:l,handleDragStart:S,handleCredentialDragStart:E,handlePlaybookDragStart:k,handleDragEnd:R,handleDrop:j=>{j.preventDefault();const _=j.dataTransfer.getData("application/json");if(_){try{T(JSON.parse(_))}catch{const A=j.dataTransfer.getData("text/plain");A&&e&&m.mutate(A)}r(null),n(null),o(null),c(!1)}},handleGlobalDrop:j=>{j.preventDefault();const _=j.dataTransfer.getData("application/json");if(_){try{const A=JSON.parse(_);A.fromDeck&&T(A)}catch{}r(null),n(null),o(null),c(!1)}},isDropping:m.isPending||p.isPending||w.isPending||h.isPending||g.isPending||v.isPending}}const Zf="agent-deck-editing-deck-id";function iI(t){const[e,r]=x.useState(()=>typeof window>"u"?null:localStorage.getItem(Zf));x.useEffect(()=>{if(t.length===0)return;if(!(e&&t.some(o=>o.id===e))){const o=t[0].id;r(o),localStorage.setItem(Zf,o)}},[t,e]);const s=a=>{r(a),localStorage.setItem(Zf,a)};return{editingDeck:t.find(a=>a.id===e)??null,editingDeckId:e,setEditingDeckId:s}}function A0(t,[e,r]){return Math.min(r,Math.max(e,t))}var lI=[" ","Enter","ArrowUp","ArrowDown"],cI=[" ","Enter"],Za="Select",[qd,Hd,uI]=yv(Za),[ki,HF]=fs(Za,[uI,Dd]),Bd=Dd(),[dI,ma]=ki(Za),[fI,hI]=ki(Za),L_=t=>{const{__scopeSelect:e,children:r,open:s,defaultOpen:n,onOpenChange:a,value:o,defaultValue:l,onValueChange:c,dir:u,name:d,autoComplete:f,disabled:m,required:p,form:w}=t,h=Bd(e),[g,v]=x.useState(null),[y,b]=x.useState(null),[S,E]=x.useState(!1),k=zv(u),[R,T]=Ka({prop:s,defaultProp:n??!1,onChange:a,caller:Za}),[N,O]=Ka({prop:o,defaultProp:l,onChange:c,caller:Za}),j=x.useRef(null),_=g?w||!!g.closest("form"):!0,[A,C]=x.useState(new Set),z=Array.from(A).map(U=>U.props.value).join(";");return i.jsx(RT,{...h,children:i.jsxs(dI,{required:p,scope:e,trigger:g,onTriggerChange:v,valueNode:y,onValueNodeChange:b,valueNodeHasChildren:S,onValueNodeHasChildrenChange:E,contentId:ea(),value:N,onValueChange:O,open:R,onOpenChange:T,dir:k,triggerPointerDownPosRef:j,disabled:m,children:[i.jsx(qd.Provider,{scope:e,children:i.jsx(fI,{scope:t.__scopeSelect,onNativeOptionAdd:x.useCallback(U=>{C(K=>new Set(K).add(U))},[]),onNativeOptionRemove:x.useCallback(U=>{C(K=>{const $=new Set(K);return $.delete(U),$})},[]),children:r})}),_?i.jsxs(cE,{"aria-hidden":!0,required:p,tabIndex:-1,name:d,autoComplete:f,value:N,onChange:U=>O(U.target.value),disabled:m,form:w,children:[N===void 0?i.jsx("option",{value:""}):null,Array.from(A)]},z):null]})})};L_.displayName=Za;var U_="SelectTrigger",z_=x.forwardRef((t,e)=>{const{__scopeSelect:r,disabled:s=!1,...n}=t,a=Bd(r),o=ma(U_,r),l=o.disabled||s,c=et(e,o.onTriggerChange),u=Hd(r),d=x.useRef("touch"),[f,m,p]=dE(h=>{const g=u().filter(b=>!b.disabled),v=g.find(b=>b.value===o.value),y=fE(g,h,v);y!==void 0&&o.onValueChange(y.value)}),w=h=>{l||(o.onOpenChange(!0),p()),h&&(o.triggerPointerDownPosRef.current={x:Math.round(h.pageX),y:Math.round(h.pageY)})};return i.jsx(hS,{asChild:!0,...a,children:i.jsx(Ae.button,{type:"button",role:"combobox","aria-controls":o.contentId,"aria-expanded":o.open,"aria-required":o.required,"aria-autocomplete":"none",dir:o.dir,"data-state":o.open?"open":"closed",disabled:l,"data-disabled":l?"":void 0,"data-placeholder":uE(o.value)?"":void 0,...n,ref:c,onClick:_e(n.onClick,h=>{h.currentTarget.focus(),d.current!=="mouse"&&w(h)}),onPointerDown:_e(n.onPointerDown,h=>{d.current=h.pointerType;const g=h.target;g.hasPointerCapture(h.pointerId)&&g.releasePointerCapture(h.pointerId),h.button===0&&h.ctrlKey===!1&&h.pointerType==="mouse"&&(w(h),h.preventDefault())}),onKeyDown:_e(n.onKeyDown,h=>{const g=f.current!=="";!(h.ctrlKey||h.altKey||h.metaKey)&&h.key.length===1&&m(h.key),!(g&&h.key===" ")&&lI.includes(h.key)&&(w(),h.preventDefault())})})})});z_.displayName=U_;var V_="SelectValue",q_=x.forwardRef((t,e)=>{const{__scopeSelect:r,className:s,style:n,children:a,placeholder:o="",...l}=t,c=ma(V_,r),{onValueNodeHasChildrenChange:u}=c,d=a!==void 0,f=et(e,c.onValueNodeChange);return Bt(()=>{u(d)},[u,d]),i.jsx(Ae.span,{...l,ref:f,style:{pointerEvents:"none"},children:uE(c.value)?i.jsx(i.Fragment,{children:o}):a})});q_.displayName=V_;var pI="SelectIcon",H_=x.forwardRef((t,e)=>{const{__scopeSelect:r,children:s,...n}=t;return i.jsx(Ae.span,{"aria-hidden":!0,...n,ref:e,children:s||"▼"})});H_.displayName=pI;var mI="SelectPortal",B_=t=>i.jsx(kd,{asChild:!0,...t});B_.displayName=mI;var Ya="SelectContent",W_=x.forwardRef((t,e)=>{const r=ma(Ya,t.__scopeSelect),[s,n]=x.useState();if(Bt(()=>{n(new DocumentFragment)},[]),!r.open){const a=s;return a?so.createPortal(i.jsx(K_,{scope:t.__scopeSelect,children:i.jsx(qd.Slot,{scope:t.__scopeSelect,children:i.jsx("div",{children:t.children})})}),a):null}return i.jsx(Q_,{...t,ref:e})});W_.displayName=Ya;var Qr=10,[K_,va]=ki(Ya),vI="SelectContentImpl",gI=fi("SelectContent.RemoveScroll"),Q_=x.forwardRef((t,e)=>{const{__scopeSelect:r,position:s="item-aligned",onCloseAutoFocus:n,onEscapeKeyDown:a,onPointerDownOutside:o,side:l,sideOffset:c,align:u,alignOffset:d,arrowPadding:f,collisionBoundary:m,collisionPadding:p,sticky:w,hideWhenDetached:h,avoidCollisions:g,...v}=t,y=ma(Ya,r),[b,S]=x.useState(null),[E,k]=x.useState(null),R=et(e,Z=>S(Z)),[T,N]=x.useState(null),[O,j]=x.useState(null),_=Hd(r),[A,C]=x.useState(!1),z=x.useRef(!1);x.useEffect(()=>{if(b)return $S(b)},[b]),NS();const U=x.useCallback(Z=>{const[ce,...Ee]=_().map(we=>we.ref.current),[ve]=Ee.slice(-1),te=document.activeElement;for(const we of Z)if(we===te||(we==null||we.scrollIntoView({block:"nearest"}),we===ce&&E&&(E.scrollTop=0),we===ve&&E&&(E.scrollTop=E.scrollHeight),we==null||we.focus(),document.activeElement!==te))return},[_,E]),K=x.useCallback(()=>U([T,b]),[U,T,b]);x.useEffect(()=>{A&&K()},[A,K]);const{onOpenChange:$,triggerPointerDownPosRef:F}=y;x.useEffect(()=>{if(b){let Z={x:0,y:0};const ce=ve=>{var te,we;Z={x:Math.abs(Math.round(ve.pageX)-(((te=F.current)==null?void 0:te.x)??0)),y:Math.abs(Math.round(ve.pageY)-(((we=F.current)==null?void 0:we.y)??0))}},Ee=ve=>{Z.x<=10&&Z.y<=10?ve.preventDefault():b.contains(ve.target)||$(!1),document.removeEventListener("pointermove",ce),F.current=null};return F.current!==null&&(document.addEventListener("pointermove",ce),document.addEventListener("pointerup",Ee,{capture:!0,once:!0})),()=>{document.removeEventListener("pointermove",ce),document.removeEventListener("pointerup",Ee,{capture:!0})}}},[b,$,F]),x.useEffect(()=>{const Z=()=>$(!1);return window.addEventListener("blur",Z),window.addEventListener("resize",Z),()=>{window.removeEventListener("blur",Z),window.removeEventListener("resize",Z)}},[$]);const[V,ae]=dE(Z=>{const ce=_().filter(te=>!te.disabled),Ee=ce.find(te=>te.ref.current===document.activeElement),ve=fE(ce,Z,Ee);ve&&setTimeout(()=>ve.ref.current.focus())}),se=x.useCallback((Z,ce,Ee)=>{const ve=!z.current&&!Ee;(y.value!==void 0&&y.value===ce||ve)&&(N(Z),ve&&(z.current=!0))},[y.value]),W=x.useCallback(()=>b==null?void 0:b.focus(),[b]),L=x.useCallback((Z,ce,Ee)=>{const ve=!z.current&&!Ee;(y.value!==void 0&&y.value===ce||ve)&&j(Z)},[y.value]),Q=s==="popper"?kp:G_,oe=Q===kp?{side:l,sideOffset:c,align:u,alignOffset:d,arrowPadding:f,collisionBoundary:m,collisionPadding:p,sticky:w,hideWhenDetached:h,avoidCollisions:g}:{};return i.jsx(K_,{scope:r,content:b,viewport:E,onViewportChange:k,itemRefCallback:se,selectedItem:T,onItemLeave:W,itemTextRefCallback:L,focusSelectedItem:K,selectedItemText:O,position:s,isPositioned:A,searchRef:V,children:i.jsx($v,{as:gI,allowPinchZoom:!0,children:i.jsx(Mv,{asChild:!0,trapped:y.open,onMountAutoFocus:Z=>{Z.preventDefault()},onUnmountAutoFocus:_e(n,Z=>{var ce;(ce=y.trigger)==null||ce.focus({preventScroll:!0}),Z.preventDefault()}),children:i.jsx(Vl,{asChild:!0,disableOutsidePointerEvents:!0,onEscapeKeyDown:a,onPointerDownOutside:o,onFocusOutside:Z=>Z.preventDefault(),onDismiss:()=>y.onOpenChange(!1),children:i.jsx(Q,{role:"listbox",id:y.contentId,"data-state":y.open?"open":"closed",dir:y.dir,onContextMenu:Z=>Z.preventDefault(),...v,...oe,onPlaced:()=>C(!0),ref:R,style:{display:"flex",flexDirection:"column",outline:"none",...v.style},onKeyDown:_e(v.onKeyDown,Z=>{const ce=Z.ctrlKey||Z.altKey||Z.metaKey;if(Z.key==="Tab"&&Z.preventDefault(),!ce&&Z.key.length===1&&ae(Z.key),["ArrowUp","ArrowDown","Home","End"].includes(Z.key)){let ve=_().filter(te=>!te.disabled).map(te=>te.ref.current);if(["ArrowUp","End"].includes(Z.key)&&(ve=ve.slice().reverse()),["ArrowUp","ArrowDown"].includes(Z.key)){const te=Z.target,we=ve.indexOf(te);ve=ve.slice(we+1)}setTimeout(()=>U(ve)),Z.preventDefault()}})})})})})})});Q_.displayName=vI;var yI="SelectItemAlignedPosition",G_=x.forwardRef((t,e)=>{const{__scopeSelect:r,onPlaced:s,...n}=t,a=ma(Ya,r),o=va(Ya,r),[l,c]=x.useState(null),[u,d]=x.useState(null),f=et(e,R=>d(R)),m=Hd(r),p=x.useRef(!1),w=x.useRef(!0),{viewport:h,selectedItem:g,selectedItemText:v,focusSelectedItem:y}=o,b=x.useCallback(()=>{if(a.trigger&&a.valueNode&&l&&u&&h&&g&&v){const R=a.trigger.getBoundingClientRect(),T=u.getBoundingClientRect(),N=a.valueNode.getBoundingClientRect(),O=v.getBoundingClientRect();if(a.dir!=="rtl"){const te=O.left-T.left,we=N.left-te,Pe=R.left-we,De=R.width+Pe,ee=Math.max(De,T.width),fe=window.innerWidth-Qr,X=A0(we,[Qr,Math.max(Qr,fe-ee)]);l.style.minWidth=De+"px",l.style.left=X+"px"}else{const te=T.right-O.right,we=window.innerWidth-N.right-te,Pe=window.innerWidth-R.right-we,De=R.width+Pe,ee=Math.max(De,T.width),fe=window.innerWidth-Qr,X=A0(we,[Qr,Math.max(Qr,fe-ee)]);l.style.minWidth=De+"px",l.style.right=X+"px"}const j=m(),_=window.innerHeight-Qr*2,A=h.scrollHeight,C=window.getComputedStyle(u),z=parseInt(C.borderTopWidth,10),U=parseInt(C.paddingTop,10),K=parseInt(C.borderBottomWidth,10),$=parseInt(C.paddingBottom,10),F=z+U+A+$+K,V=Math.min(g.offsetHeight*5,F),ae=window.getComputedStyle(h),se=parseInt(ae.paddingTop,10),W=parseInt(ae.paddingBottom,10),L=R.top+R.height/2-Qr,Q=_-L,oe=g.offsetHeight/2,Z=g.offsetTop+oe,ce=z+U+Z,Ee=F-ce;if(ce<=L){const te=j.length>0&&g===j[j.length-1].ref.current;l.style.bottom="0px";const we=u.clientHeight-h.offsetTop-h.offsetHeight,Pe=Math.max(Q,oe+(te?W:0)+we+K),De=ce+Pe;l.style.height=De+"px"}else{const te=j.length>0&&g===j[0].ref.current;l.style.top="0px";const Pe=Math.max(L,z+h.offsetTop+(te?se:0)+oe)+Ee;l.style.height=Pe+"px",h.scrollTop=ce-L+h.offsetTop}l.style.margin=`${Qr}px 0`,l.style.minHeight=V+"px",l.style.maxHeight=_+"px",s==null||s(),requestAnimationFrame(()=>p.current=!0)}},[m,a.trigger,a.valueNode,l,u,h,g,v,a.dir,s]);Bt(()=>b(),[b]);const[S,E]=x.useState();Bt(()=>{u&&E(window.getComputedStyle(u).zIndex)},[u]);const k=x.useCallback(R=>{R&&w.current===!0&&(b(),y==null||y(),w.current=!1)},[b,y]);return i.jsx(wI,{scope:r,contentWrapper:l,shouldExpandOnScrollRef:p,onScrollButtonChange:k,children:i.jsx("div",{ref:c,style:{display:"flex",flexDirection:"column",position:"fixed",zIndex:S},children:i.jsx(Ae.div,{...n,ref:f,style:{boxSizing:"border-box",maxHeight:"100%",...n.style}})})})});G_.displayName=yI;var xI="SelectPopperPosition",kp=x.forwardRef((t,e)=>{const{__scopeSelect:r,align:s="start",collisionPadding:n=Qr,...a}=t,o=Bd(r);return i.jsx(pS,{...o,...a,ref:e,align:s,collisionPadding:n,style:{boxSizing:"border-box",...a.style,"--radix-select-content-transform-origin":"var(--radix-popper-transform-origin)","--radix-select-content-available-width":"var(--radix-popper-available-width)","--radix-select-content-available-height":"var(--radix-popper-available-height)","--radix-select-trigger-width":"var(--radix-popper-anchor-width)","--radix-select-trigger-height":"var(--radix-popper-anchor-height)"}})});kp.displayName=xI;var[wI,Bv]=ki(Ya,{}),Pp="SelectViewport",Z_=x.forwardRef((t,e)=>{const{__scopeSelect:r,nonce:s,...n}=t,a=va(Pp,r),o=Bv(Pp,r),l=et(e,a.onViewportChange),c=x.useRef(0);return i.jsxs(i.Fragment,{children:[i.jsx("style",{dangerouslySetInnerHTML:{__html:"[data-radix-select-viewport]{scrollbar-width:none;-ms-overflow-style:none;-webkit-overflow-scrolling:touch;}[data-radix-select-viewport]::-webkit-scrollbar{display:none}"},nonce:s}),i.jsx(qd.Slot,{scope:r,children:i.jsx(Ae.div,{"data-radix-select-viewport":"",role:"presentation",...n,ref:l,style:{position:"relative",flex:1,overflow:"hidden auto",...n.style},onScroll:_e(n.onScroll,u=>{const d=u.currentTarget,{contentWrapper:f,shouldExpandOnScrollRef:m}=o;if(m!=null&&m.current&&f){const p=Math.abs(c.current-d.scrollTop);if(p>0){const w=window.innerHeight-Qr*2,h=parseFloat(f.style.minHeight),g=parseFloat(f.style.height),v=Math.max(h,g);if(v<w){const y=v+p,b=Math.min(w,y),S=y-b;f.style.height=b+"px",f.style.bottom==="0px"&&(d.scrollTop=S>0?S:0,f.style.justifyContent="flex-end")}}}c.current=d.scrollTop})})})]})});Z_.displayName=Pp;var Y_="SelectGroup",[bI,SI]=ki(Y_),_I=x.forwardRef((t,e)=>{const{__scopeSelect:r,...s}=t,n=ea();return i.jsx(bI,{scope:r,id:n,children:i.jsx(Ae.div,{role:"group","aria-labelledby":n,...s,ref:e})})});_I.displayName=Y_;var J_="SelectLabel",X_=x.forwardRef((t,e)=>{const{__scopeSelect:r,...s}=t,n=SI(J_,r);return i.jsx(Ae.div,{id:n.id,...s,ref:e})});X_.displayName=J_;var zu="SelectItem",[EI,eE]=ki(zu),tE=x.forwardRef((t,e)=>{const{__scopeSelect:r,value:s,disabled:n=!1,textValue:a,...o}=t,l=ma(zu,r),c=va(zu,r),u=l.value===s,[d,f]=x.useState(a??""),[m,p]=x.useState(!1),w=et(e,y=>{var b;return(b=c.itemRefCallback)==null?void 0:b.call(c,y,s,n)}),h=ea(),g=x.useRef("touch"),v=()=>{n||(l.onValueChange(s),l.onOpenChange(!1))};if(s==="")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 i.jsx(EI,{scope:r,value:s,disabled:n,textId:h,isSelected:u,onItemTextChange:x.useCallback(y=>{f(b=>b||((y==null?void 0:y.textContent)??"").trim())},[]),children:i.jsx(qd.ItemSlot,{scope:r,value:s,disabled:n,textValue:d,children:i.jsx(Ae.div,{role:"option","aria-labelledby":h,"data-highlighted":m?"":void 0,"aria-selected":u&&m,"data-state":u?"checked":"unchecked","aria-disabled":n||void 0,"data-disabled":n?"":void 0,tabIndex:n?void 0:-1,...o,ref:w,onFocus:_e(o.onFocus,()=>p(!0)),onBlur:_e(o.onBlur,()=>p(!1)),onClick:_e(o.onClick,()=>{g.current!=="mouse"&&v()}),onPointerUp:_e(o.onPointerUp,()=>{g.current==="mouse"&&v()}),onPointerDown:_e(o.onPointerDown,y=>{g.current=y.pointerType}),onPointerMove:_e(o.onPointerMove,y=>{var b;g.current=y.pointerType,n?(b=c.onItemLeave)==null||b.call(c):g.current==="mouse"&&y.currentTarget.focus({preventScroll:!0})}),onPointerLeave:_e(o.onPointerLeave,y=>{var b;y.currentTarget===document.activeElement&&((b=c.onItemLeave)==null||b.call(c))}),onKeyDown:_e(o.onKeyDown,y=>{var S;((S=c.searchRef)==null?void 0:S.current)!==""&&y.key===" "||(cI.includes(y.key)&&v(),y.key===" "&&y.preventDefault())})})})})});tE.displayName=zu;var Ki="SelectItemText",rE=x.forwardRef((t,e)=>{const{__scopeSelect:r,className:s,style:n,...a}=t,o=ma(Ki,r),l=va(Ki,r),c=eE(Ki,r),u=hI(Ki,r),[d,f]=x.useState(null),m=et(e,v=>f(v),c.onItemTextChange,v=>{var y;return(y=l.itemTextRefCallback)==null?void 0:y.call(l,v,c.value,c.disabled)}),p=d==null?void 0:d.textContent,w=x.useMemo(()=>i.jsx("option",{value:c.value,disabled:c.disabled,children:p},c.value),[c.disabled,c.value,p]),{onNativeOptionAdd:h,onNativeOptionRemove:g}=u;return Bt(()=>(h(w),()=>g(w)),[h,g,w]),i.jsxs(i.Fragment,{children:[i.jsx(Ae.span,{id:c.textId,...a,ref:m}),c.isSelected&&o.valueNode&&!o.valueNodeHasChildren?so.createPortal(a.children,o.valueNode):null]})});rE.displayName=Ki;var nE="SelectItemIndicator",sE=x.forwardRef((t,e)=>{const{__scopeSelect:r,...s}=t;return eE(nE,r).isSelected?i.jsx(Ae.span,{"aria-hidden":!0,...s,ref:e}):null});sE.displayName=nE;var Np="SelectScrollUpButton",aE=x.forwardRef((t,e)=>{const r=va(Np,t.__scopeSelect),s=Bv(Np,t.__scopeSelect),[n,a]=x.useState(!1),o=et(e,s.onScrollButtonChange);return Bt(()=>{if(r.viewport&&r.isPositioned){let l=function(){const u=c.scrollTop>0;a(u)};const c=r.viewport;return l(),c.addEventListener("scroll",l),()=>c.removeEventListener("scroll",l)}},[r.viewport,r.isPositioned]),n?i.jsx(iE,{...t,ref:o,onAutoScroll:()=>{const{viewport:l,selectedItem:c}=r;l&&c&&(l.scrollTop=l.scrollTop-c.offsetHeight)}}):null});aE.displayName=Np;var jp="SelectScrollDownButton",oE=x.forwardRef((t,e)=>{const r=va(jp,t.__scopeSelect),s=Bv(jp,t.__scopeSelect),[n,a]=x.useState(!1),o=et(e,s.onScrollButtonChange);return Bt(()=>{if(r.viewport&&r.isPositioned){let l=function(){const u=c.scrollHeight-c.clientHeight,d=Math.ceil(c.scrollTop)<u;a(d)};const c=r.viewport;return l(),c.addEventListener("scroll",l),()=>c.removeEventListener("scroll",l)}},[r.viewport,r.isPositioned]),n?i.jsx(iE,{...t,ref:o,onAutoScroll:()=>{const{viewport:l,selectedItem:c}=r;l&&c&&(l.scrollTop=l.scrollTop+c.offsetHeight)}}):null});oE.displayName=jp;var iE=x.forwardRef((t,e)=>{const{__scopeSelect:r,onAutoScroll:s,...n}=t,a=va("SelectScrollButton",r),o=x.useRef(null),l=Hd(r),c=x.useCallback(()=>{o.current!==null&&(window.clearInterval(o.current),o.current=null)},[]);return x.useEffect(()=>()=>c(),[c]),Bt(()=>{var d;const u=l().find(f=>f.ref.current===document.activeElement);(d=u==null?void 0:u.ref.current)==null||d.scrollIntoView({block:"nearest"})},[l]),i.jsx(Ae.div,{"aria-hidden":!0,...n,ref:e,style:{flexShrink:0,...n.style},onPointerDown:_e(n.onPointerDown,()=>{o.current===null&&(o.current=window.setInterval(s,50))}),onPointerMove:_e(n.onPointerMove,()=>{var u;(u=a.onItemLeave)==null||u.call(a),o.current===null&&(o.current=window.setInterval(s,50))}),onPointerLeave:_e(n.onPointerLeave,()=>{c()})})}),CI="SelectSeparator",lE=x.forwardRef((t,e)=>{const{__scopeSelect:r,...s}=t;return i.jsx(Ae.div,{"aria-hidden":!0,...s,ref:e})});lE.displayName=CI;var Rp="SelectArrow",kI=x.forwardRef((t,e)=>{const{__scopeSelect:r,...s}=t,n=Bd(r),a=ma(Rp,r),o=va(Rp,r);return a.open&&o.position==="popper"?i.jsx(mS,{...n,...s,ref:e}):null});kI.displayName=Rp;var PI="SelectBubbleInput",cE=x.forwardRef(({__scopeSelect:t,value:e,...r},s)=>{const n=x.useRef(null),a=et(s,n),o=P_(e);return x.useEffect(()=>{const l=n.current;if(!l)return;const c=window.HTMLSelectElement.prototype,d=Object.getOwnPropertyDescriptor(c,"value").set;if(o!==e&&d){const f=new Event("change",{bubbles:!0});d.call(l,e),l.dispatchEvent(f)}},[o,e]),i.jsx(Ae.select,{...r,style:{...i1,...r.style},ref:a,defaultValue:e})});cE.displayName=PI;function uE(t){return t===""||t===void 0}function dE(t){const e=Ur(t),r=x.useRef(""),s=x.useRef(0),n=x.useCallback(o=>{const l=r.current+o;e(l),function c(u){r.current=u,window.clearTimeout(s.current),u!==""&&(s.current=window.setTimeout(()=>c(""),1e3))}(l)},[e]),a=x.useCallback(()=>{r.current="",window.clearTimeout(s.current)},[]);return x.useEffect(()=>()=>window.clearTimeout(s.current),[]),[r,n,a]}function fE(t,e,r){const n=e.length>1&&Array.from(e).every(u=>u===e[0])?e[0]:e,a=r?t.indexOf(r):-1;let o=NI(t,Math.max(a,0));n.length===1&&(o=o.filter(u=>u!==r));const c=o.find(u=>u.textValue.toLowerCase().startsWith(n.toLowerCase()));return c!==r?c:void 0}function NI(t,e){return t.map((r,s)=>t[(e+s)%t.length])}var jI=L_,hE=z_,RI=q_,TI=H_,AI=B_,pE=W_,OI=Z_,mE=X_,vE=tE,II=rE,DI=sE,gE=aE,yE=oE,xE=lE;const MI=jI,$I=RI,wE=x.forwardRef(({className:t,children:e,...r},s)=>i.jsxs(hE,{ref:s,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",t),...r,children:[e,i.jsx(TI,{asChild:!0,children:i.jsx(_v,{className:"h-4 w-4 opacity-50"})})]}));wE.displayName=hE.displayName;const bE=x.forwardRef(({className:t,...e},r)=>i.jsx(gE,{ref:r,className:Te("flex cursor-default items-center justify-center py-1",t),...e,children:i.jsx(b2,{className:"h-4 w-4"})}));bE.displayName=gE.displayName;const SE=x.forwardRef(({className:t,...e},r)=>i.jsx(yE,{ref:r,className:Te("flex cursor-default items-center justify-center py-1",t),...e,children:i.jsx(_v,{className:"h-4 w-4"})}));SE.displayName=yE.displayName;const _E=x.forwardRef(({className:t,children:e,position:r="popper",...s},n)=>i.jsx(AI,{children:i.jsxs(pE,{ref:n,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]",r==="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",t),position:r,...s,children:[i.jsx(bE,{}),i.jsx(OI,{className:Te("p-1",r==="popper"&&"h-[var(--radix-select-trigger-height)] w-full min-w-[var(--radix-select-trigger-width)]"),children:e}),i.jsx(SE,{})]})}));_E.displayName=pE.displayName;const FI=x.forwardRef(({className:t,...e},r)=>i.jsx(mE,{ref:r,className:Te("py-1.5 pl-8 pr-2 text-sm font-semibold",t),...e}));FI.displayName=mE.displayName;const po=x.forwardRef(({className:t,children:e,...r},s)=>i.jsxs(vE,{ref:s,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",t),...r,children:[i.jsx("span",{className:"absolute left-2 flex h-3.5 w-3.5 items-center justify-center",children:i.jsx(DI,{children:i.jsx(T1,{className:"h-4 w-4"})})}),i.jsx(II,{children:e})]}));po.displayName=vE.displayName;const LI=x.forwardRef(({className:t,...e},r)=>i.jsx(xE,{ref:r,className:Te("-mx-1 my-1 h-px bg-muted",t),...e}));LI.displayName=xE.displayName;const UI="/assets/AgentDeckLogo3-X5qCXS2A.png";function zI(){var ms,ya,vs;const[t,e]=x.useState(""),[r,s]=x.useState(""),[n,a]=x.useState(!1),[o,l]=x.useState(!1),[c,u]=x.useState(null),[d,f]=x.useState(!1),[m,p]=x.useState(!1),[w,h]=x.useState(null),[g,v]=x.useState(!1),[y,b]=x.useState(!1),[S,E]=x.useState(null),[k,R]=x.useState(!1),[T,N]=x.useState(null),{toast:O}=or(),{connectionStatus:j}=aI(),{data:_,isLoading:A,error:C}=hr({queryKey:["/api/decks"]}),z=(_==null?void 0:_.data)||[],{editingDeck:U,editingDeckId:K,setEditingDeckId:$}=iI(z),{handleDragStart:F,handleCredentialDragStart:V,handlePlaybookDragStart:ae,handleDragEnd:se,handleDrop:W,handleGlobalDrop:L,isDraggingFromDeck:Q}=oI(K),{data:oe,isLoading:Z,error:ce}=hr({queryKey:["/api/services"]}),{data:Ee,isLoading:ve}=hr({queryKey:["/api/credentials/vault"]}),{data:te,isLoading:we}=hr({queryKey:["/api/playbooks/vault"]}),{data:Pe}=hr({queryKey:["/api/collection/warnings"],staleTime:6e4}),De=(oe==null?void 0:oe.data)||[],ee=(Ee==null?void 0:Ee.data)||[],fe=(te==null?void 0:te.data)||[],X=x.useMemo(()=>YT(Pe==null?void 0:Pe.data),[Pe==null?void 0:Pe.data]),ze=(ne,Et)=>n?ne==="service"?X.serviceWarnings.has(Et):ne==="credential"?X.credentialWarnings.has(Et):X.playbookWarnings.has(Et):!0,re=De.filter(ne=>{var $n;if(!ze("service",ne.id)||r==="api-key"||r==="playbook")return!1;const Et=ne.name.toLowerCase().includes(t.toLowerCase())||(($n=ne.description)==null?void 0:$n.toLowerCase().includes(t.toLowerCase())),Mn=!r||r==="all"||ne.type===r;return Et&&Mn}),Me=ee.filter(ne=>!ze("credential",ne.id)||r&&r!=="all"&&r!=="api-key"?!1:ne.label.toLowerCase().includes(t.toLowerCase())),Ue=fe.filter(ne=>!ze("playbook",ne.id)||r&&r!=="all"&&r!=="playbook"?!1:ne.title.toLowerCase().includes(t.toLowerCase())||ne.body.toLowerCase().includes(t.toLowerCase())),Ne=re.length+Me.length+Ue.length;ce&&console.error("Services error:",ce),C&&console.error("Decks error:",C);const rt=()=>{e(""),s(""),a(!1)},pt=!!(t||r||n),Hr=new Set(((U==null?void 0:U.credentials)??[]).map(ne=>ne.id)),zt=new Set(((U==null?void 0:U.playbooks)??[]).map(ne=>ne.id)),hs=(U==null?void 0:U.services)||[],oo=(U==null?void 0:U.playbooks)||[],Yt=ne=>{u(ne),f(!0)},Br=ne=>{E(ne.id),R(!0)},ps=ne=>{h(ne.id),v(!0)},jr=ne=>{N(ne)};if(ce||C){const ne=(C instanceof Error?C.message:null)??(ce instanceof Error?ce.message:null)??"There was an error loading the application data.";return i.jsx("div",{className:"min-h-screen flex items-center justify-center bg-gray-900",children:i.jsxs("div",{className:"text-center max-w-lg px-4",children:[i.jsx("h2",{className:"text-2xl font-bold text-red-400 mb-4",children:"Error Loading Data"}),i.jsx("p",{className:"text-gray-300 mb-2",children:"There was an error loading the application data."}),i.jsx("p",{className:"text-gray-400 text-sm mb-4",children:ne}),i.jsxs("p",{className:"text-gray-500 text-xs mb-6",children:["Is the API running? Try ",i.jsx("code",{className:"text-gray-300",children:"agent-deck stop && agent-deck start"})]}),i.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 Z||A||ve||we?i.jsx("div",{className:"min-h-screen flex items-center justify-center bg-gray-900",children:i.jsxs("div",{className:"text-center",children:[i.jsx("div",{className:"animate-spin rounded-full h-12 w-12 border-b-2 border-yellow-400 mx-auto mb-4"}),i.jsx("p",{className:"text-gray-300",children:"Loading AgentDeck..."})]})}):i.jsxs("div",{className:"min-h-screen",onDrop:L,onDragOver:ne=>ne.preventDefault(),style:{position:"relative",...Q&&{background:"linear-gradient(to bottom right, #1a1a2e, #16213e, #0f3460)"}},children:[i.jsx("header",{className:"relative z-20 bg-black/30 backdrop-blur-md border-b border-white/10",children:i.jsx("div",{className:"container mx-auto px-4 py-4",children:i.jsxs("div",{className:"flex items-center justify-between",children:[i.jsxs("div",{className:"flex items-center space-x-4",children:[i.jsx("img",{src:UI,alt:"Agent Deck Logo",className:"h-16 w-16 object-contain"}),i.jsxs("div",{children:[i.jsx("h1",{className:"text-2xl font-bold bg-gradient-to-r from-yellow-400 to-yellow-600 bg-clip-text text-transparent",style:{background:"linear-gradient(to right, #C4B643, #D4C760)",WebkitBackgroundClip:"text",WebkitTextFillColor:"transparent",backgroundClip:"text"},children:"AgentDeck"}),i.jsx("p",{className:"text-sm",style:{color:"#92E4DD"},children:"Build tool deck for your agent"})]})]}),i.jsxs("div",{className:"flex items-center space-x-6",children:[i.jsxs("div",{className:`flex items-center space-x-2 px-3 py-1 rounded-full border ${j==="connected"?"bg-emerald-500/20 border-emerald-500/30":"bg-red-500/20 border-red-500/30"}`,children:[i.jsx("div",{className:`w-2 h-2 rounded-full animate-pulse ${j==="connected"?"bg-emerald-400":"bg-red-400"}`}),i.jsx("button",{className:`text-sm hover:underline cursor-pointer ${j==="connected"?"text-emerald-300":"text-red-300"}`,"data-testid":"button-copy-mcp-url",onClick:()=>{navigator.clipboard.writeText("http://localhost:3001/mcp").then(()=>{O({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"})]}),U&&i.jsx("div",{className:"px-4 py-2 rounded-lg border",style:{backgroundColor:"rgba(196, 182, 67, 0.2)",borderColor:"rgba(196, 182, 67, 0.4)"},children:i.jsxs("div",{className:"flex items-center space-x-2",children:[i.jsx("i",{className:"fas fa-star",style:{color:"#C4B643"}}),i.jsx("span",{className:"text-sm font-medium","data-testid":"editing-deck-name",style:{color:"#92E4DD"},children:U.name}),i.jsxs("span",{className:"text-xs",style:{color:"#92E4DD",opacity:.7},"data-testid":"editing-deck-count",children:[(((ms=U.services)==null?void 0:ms.length)??0)+(((ya=U.credentials)==null?void 0:ya.length)??0)+(((vs=U.playbooks)==null?void 0:vs.length)??0)," ","cards"]})]})})]})]})})}),Q&&i.jsx("div",{className:"fixed inset-0 pointer-events-none z-50 flex items-center justify-center",children:i.jsxs("div",{className:"bg-red-500/20 border-2 border-dashed border-red-500/50 rounded-lg p-8 text-center",children:[i.jsx("div",{className:"text-red-400 text-lg font-bold mb-2",children:"Drop to Remove"}),i.jsx("div",{className:"text-red-300 text-sm",children:"Release to remove card from deck"})]})}),i.jsx("main",{className:"container mx-auto px-4 py-6",children:i.jsxs("div",{className:"grid grid-cols-1 xl:grid-cols-4 gap-6 h-screen min-w-0",children:[i.jsxs("div",{className:"xl:col-span-1 space-y-6 min-w-0",children:[i.jsx("div",{className:"panel-surface p-4 h-80 overflow-hidden min-w-0",children:i.jsx(HO,{decks:z,editingDeckId:K,onSelectDeck:$,isLoading:A})}),i.jsxs("div",{className:"panel-surface p-4",children:[i.jsxs("h2",{className:"text-lg font-bold mb-3 flex items-center",children:[i.jsx(R1,{className:"w-4 h-4 mr-2",style:{color:"#92E4DD"}}),i.jsx("span",{style:{color:"#92E4DD"},children:"Add Cards"})]}),i.jsxs("div",{className:"space-y-2",children:[i.jsxs(me,{variant:"ghost",className:`w-full border-2 text-sm py-2 hover:opacity-90 ${bn}`,style:Sn(wr),onClick:()=>l(!0),"data-testid":"button-register-mcp",children:[i.jsx(Au,{className:"w-3 h-3 mr-2"}),"Register MCP"]}),i.jsxs(me,{variant:"ghost",className:`w-full border-2 text-sm py-2 hover:opacity-90 ${bn}`,style:Sn(ur),onClick:()=>p(!0),"data-testid":"button-register-api-key",children:[i.jsx(mp,{className:"w-3 h-3 mr-2"}),"Register API key"]}),i.jsxs(me,{variant:"ghost",className:`w-full border-2 text-sm py-2 hover:opacity-90 ${bn}`,style:Sn(Yr),onClick:()=>b(!0),"data-testid":"button-register-playbook",children:[i.jsx(Sv,{className:"w-3 h-3 mr-2"}),"Register Playbook"]})]})]})]}),i.jsxs("div",{className:"xl:col-span-3 space-y-6 min-w-0",children:[i.jsx("div",{className:"panel-surface p-4 h-80 overflow-hidden min-w-0",children:U?i.jsx("div",{className:"h-full",children:i.jsx(pA,{deck:U,services:hs,credentials:U.credentials??[],playbooks:oo,allServices:De,collectionWarnings:X,onDrop:W,onDragStart:F,onCredentialDragStart:V,onPlaybookDragStart:ae,onDragEnd:se,onCardClick:Yt,onPlaybookClick:Br,onCredentialClick:ps})}):i.jsxs("div",{className:"text-center h-full flex flex-col justify-center",children:[i.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:i.jsx(vp,{className:"w-6 h-6 text-yellow-400"})}),i.jsx("h3",{className:"text-lg font-bold mb-2",style:{color:"#92E4DD"},children:"No deck selected"}),i.jsx("p",{className:"text-gray-300 mb-4 text-sm",children:"Create a deck or select one from the sidebar to edit its cards."}),i.jsxs("div",{className:"flex flex-col gap-2",children:[i.jsxs(me,{onClick:()=>{const ne=document.querySelector('[data-testid="create-deck-button"]');ne&&ne.click()},className:"border text-sm py-2",style:{background:"#C4B643",borderColor:"#C4B643",color:"black"},children:[i.jsx(Vs,{className:"w-4 h-4 mr-2"}),"Create New Deck"]}),i.jsxs(me,{variant:"outline",className:"border-white/20 text-white hover:bg-white/10 text-sm py-2",onClick:()=>{const ne=document.querySelector('[data-testid="deck-management-panel"]');ne&&ne.scrollIntoView({behavior:"smooth"})},children:[i.jsx(vp,{className:"w-4 h-4 mr-2"}),"Manage Decks"]})]})]})}),i.jsxs("div",{className:"panel-surface p-4 h-80",children:[i.jsxs("div",{className:"flex items-center justify-between mb-3",children:[i.jsxs("h2",{className:"text-lg font-bold flex items-center",children:[i.jsx(E2,{className:"w-4 h-4 mr-2",style:{color:"#92E4DD"}}),i.jsx("span",{style:{color:"#92E4DD"},children:"My Collection"}),i.jsxs("span",{className:"ml-3 text-sm font-normal text-gray-400",children:["(",Ne," cards)"]})]}),i.jsxs("div",{className:"flex items-center gap-2",children:[i.jsxs("div",{className:"relative",children:[i.jsx(I1,{className:"absolute left-2 top-1/2 transform -translate-y-1/2 text-gray-400 w-4 h-4"}),i.jsx(tt,{placeholder:"Search...",value:t,onChange:ne=>e(ne.target.value),className:"w-48 pl-8 h-8 text-sm bg-white/10 border-white/20 text-white placeholder-gray-400","data-testid":"input-search"})]}),i.jsxs(MI,{value:r||"all",onValueChange:ne=>s(ne==="all"?"":ne),children:[i.jsxs(wE,{className:"w-[7.5rem] h-8 bg-white/10 border-white/20 text-white text-xs shrink-0","data-testid":"select-type",children:[i.jsx(_2,{className:"w-3 h-3 mr-1 shrink-0"}),i.jsx($I,{placeholder:"Type"})]}),i.jsxs(_E,{children:[i.jsx(po,{value:"all",children:"All"}),i.jsx(po,{value:"mcp",children:"MCP"}),i.jsx(po,{value:"local-mcp",children:"Local MCP"}),i.jsx(po,{value:"api-key",children:"API Key"}),i.jsx(po,{value:"playbook",children:"Playbook"})]})]}),(t||r||n)&&i.jsx(me,{size:"sm",variant:"outline",className:"h-8 px-2 text-xs border-white/20 text-white hover:bg-white/10",onClick:rt,title:"Clear all filters",children:"Clear"})]})]}),X.total>0&&i.jsx("button",{type:"button",onClick:()=>a(ne=>!ne),className:`mb-4 w-full rounded-lg border px-3 py-2 text-left text-sm transition-colors ${n?"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:i.jsxs("span",{className:"flex items-start gap-2",children:[i.jsx(rn,{className:"mt-0.5 h-4 w-4 shrink-0 text-amber-300"}),i.jsx("span",{children:n?i.jsxs(i.Fragment,{children:["Showing ",i.jsx("strong",{children:Ne})," card",Ne===1?"":"s"," needing attention.",i.jsx("span",{className:"text-amber-200/80",children:" Click to show all cards."})]}):i.jsxs(i.Fragment,{children:[i.jsx("strong",{children:X.total})," card",X.total===1?"":"s"," need attention",X.byKind.oauth_expired+X.byKind.oauth_required>0&&i.jsxs(i.Fragment,{children:[" ","(",X.byKind.oauth_expired+X.byKind.oauth_required," ","OAuth)"]}),". ",i.jsx("span",{className:"text-amber-200/80",children:"Click to filter."})]})})]})}),Z||ve||we?i.jsx("div",{className:"grid grid-cols-[repeat(auto-fill,80px)] gap-0",children:Array.from({length:10}).map((ne,Et)=>i.jsx("div",{className:"animate-pulse",children:i.jsx("div",{className:"bg-white/10 rounded-lg w-32 h-48 aspect-[2/3]"})},Et))}):Ne===0?i.jsxs("div",{className:"text-center py-12",children:[i.jsx("div",{className:"text-gray-400 mb-4",children:i.jsx("i",{className:"fas fa-layer-group text-4xl"})}),i.jsx("h3",{className:"text-lg font-semibold text-gray-300 mb-2",children:"No cards yet"}),i.jsx("p",{className:"text-gray-400 text-sm mb-4",children:pt?n?"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"}),!pt&&i.jsxs("div",{className:"flex gap-3 justify-center",children:[i.jsxs(me,{variant:"ghost",size:"sm",className:`border-2 hover:opacity-90 ${bn}`,style:Sn(wr),onClick:()=>l(!0),"data-testid":"button-register-mcp-empty",children:[i.jsx(Au,{className:"w-3 h-3 mr-1"}),"Register MCP"]}),i.jsxs(me,{variant:"ghost",size:"sm",className:`border-2 hover:opacity-90 ${bn}`,style:Sn(ur),onClick:()=>p(!0),"data-testid":"button-register-api-key-empty",children:[i.jsx(mp,{className:"w-3 h-3 mr-1"}),"Register API key"]})]})]}):i.jsxs("div",{className:"grid grid-cols-[repeat(auto-fill,80px)] gap-0 relative isolate",style:{isolation:"isolate"},children:[Ue.map((ne,Et)=>i.jsx("div",{className:"relative group",style:{zIndex:T===ne.id?999999:Ne-Et},children:i.jsx(oA,{playbook:ne,isInActiveDeck:zt.has(ne.id),activeDeck:U??void 0,isInCollection:!0,onDragStart:ae,onDragEnd:se,onCardClick:Br,onMouseEnter:()=>jr(ne.id),onMouseLeave:()=>jr(null),warnings:X.playbookWarnings.get(ne.id)})},ne.id)),Me.map((ne,Et)=>i.jsx("div",{className:"relative group",style:{zIndex:T===ne.id?999999:Ne-Ue.length-Et},children:i.jsx(sA,{credential:ne,isInActiveDeck:Hr.has(ne.id),activeDeck:U??void 0,isInCollection:!0,onDragStart:V,onDragEnd:se,onMouseEnter:()=>jr(ne.id),onMouseLeave:()=>jr(null),onCardClick:ps,warnings:X.credentialWarnings.get(ne.id)})},ne.id)),re.map((ne,Et)=>{var Mn;return i.jsx("div",{className:"relative group",style:{zIndex:T===ne.id?999999:Ne-Ue.length-Me.length-Et},children:i.jsx(tA,{service:ne,onDragStart:F,onDragEnd:se,isInActiveDeck:((Mn=U==null?void 0:U.services)==null?void 0:Mn.some($n=>$n.id===ne.id))||!1,onCardClick:Yt,isInCollection:!0,onMouseEnter:()=>jr(ne.id),onMouseLeave:()=>jr(null),activeDeck:U??void 0,warnings:X.serviceWarnings.get(ne.id)})},ne.id)})]})]})]})]})}),i.jsxs("div",{className:"fixed inset-0 pointer-events-none z-0",children:[i.jsx("div",{className:"absolute top-20 left-20 w-96 h-96 bg-cyan-500/10 rounded-full blur-3xl animate-float"}),i.jsx("div",{className:"absolute bottom-20 right-20 w-96 h-96 bg-pink-500/10 rounded-full blur-3xl animate-float",style:{animationDelay:"-1s"}}),i.jsx("div",{className:"absolute top-1/2 left-1/2 transform -translate-x-1/2 -translate-y-1/2 w-96 h-96 bg-purple-500/5 rounded-full blur-3xl animate-float",style:{animationDelay:"-2s"}})]}),i.jsx(qO,{type:"mcp",open:o,onOpenChange:l}),i.jsx(sI,{service:c,isOpen:d,onClose:()=>f(!1)}),i.jsx(BO,{open:m,onOpenChange:p}),i.jsx(QO,{credentialId:w,open:g,onOpenChange:v}),i.jsx(WO,{open:y,onOpenChange:b}),i.jsx(KO,{playbookId:S,open:k,onOpenChange:R})]})}const Cs=x.forwardRef(({className:t,...e},r)=>i.jsx("div",{ref:r,className:Te("rounded-lg border bg-card text-card-foreground shadow-sm",t),...e}));Cs.displayName="Card";const _a=x.forwardRef(({className:t,...e},r)=>i.jsx("div",{ref:r,className:Te("flex flex-col space-y-1.5 p-6",t),...e}));_a.displayName="CardHeader";const Ea=x.forwardRef(({className:t,...e},r)=>i.jsx("div",{ref:r,className:Te("text-2xl font-semibold leading-none tracking-tight",t),...e}));Ea.displayName="CardTitle";const tu=x.forwardRef(({className:t,...e},r)=>i.jsx("div",{ref:r,className:Te("text-sm text-muted-foreground",t),...e}));tu.displayName="CardDescription";const ks=x.forwardRef(({className:t,...e},r)=>i.jsx("div",{ref:r,className:Te("p-6 pt-0",t),...e}));ks.displayName="CardContent";const VI=x.forwardRef(({className:t,...e},r)=>i.jsx("div",{ref:r,className:Te("flex items-center p-6 pt-0",t),...e}));VI.displayName="CardFooter";function qI(){return i.jsx("div",{className:"min-h-screen w-full flex items-center justify-center bg-gray-50",children:i.jsx(Cs,{className:"w-full max-w-md mx-4",children:i.jsxs(ks,{className:"pt-6",children:[i.jsxs("div",{className:"flex mb-4 gap-2",children:[i.jsx(A1,{className:"h-8 w-8 text-red-500"}),i.jsx("h1",{className:"text-2xl font-bold text-gray-900",children:"404 Page Not Found"})]}),i.jsx("p",{className:"mt-4 text-sm text-gray-600",children:"Did you forget to add the page to the router?"})]})})})}function HI(){const[t]=AN(),[e,r]=x.useState("loading"),[s,n]=x.useState("Authenticating...");return x.useEffect(()=>{(async()=>{try{const o=new URL(window.location.href),l=o.searchParams.get("success"),c=o.searchParams.get("error");l==="true"?(r("success"),n("Authentication successful! This window will close automatically."),setTimeout(()=>{window.close()},2e3)):l==="false"?(r("error"),n(`OAuth Error: ${c||"Authentication failed"}`)):(r("error"),n("Invalid OAuth callback - please try again"))}catch(o){r("error"),n(o instanceof Error?o.message:"Authentication failed")}})()},[t]),i.jsx("div",{className:"flex items-center justify-center min-h-screen bg-background",children:i.jsxs("div",{className:"text-center space-y-4",children:[e==="loading"&&i.jsx("div",{className:"animate-spin rounded-full h-8 w-8 border-b-2 border-primary mx-auto"}),e==="success"&&i.jsx("div",{className:"text-green-500 text-4xl",children:"✓"}),e==="error"&&i.jsx("div",{className:"text-red-500 text-4xl",children:"✗"}),i.jsx("h1",{className:"text-xl font-semibold",children:s}),e==="error"&&i.jsx("button",{onClick:()=>window.close(),className:"px-4 py-2 bg-primary text-primary-foreground rounded hover:bg-primary/90",children:"Close Window"})]})})}function To(t){const e=()=>{throw new Error(`Invalid url to pass to open(): ${t}`)};let r;try{r=new URL(t)}catch{e()}return r.protocol!=="https:"&&r.protocol!=="http:"&&e(),r.hostname!==encodeURIComponent(r.hostname)&&e(),r.username&&(r.username=encodeURIComponent(r.username)),r.password&&(r.password=encodeURIComponent(r.password)),r.pathname=r.pathname.slice(0,1)+encodeURIComponent(r.pathname.slice(1)).replace(/%2f/ig,"/"),r.search=r.search.slice(0,1)+Array.from(r.searchParams.entries()).map(BI).join("&"),r.hash=r.hash.slice(0,1)+encodeURIComponent(r.hash.slice(1)),r.href}function BI([t,e]){return`${encodeURIComponent(t)}${e.length>0?`=${encodeURIComponent(e)}`:""}`}var O0=class{constructor(t,e={}){Ln(this,"serverUrl");Ln(this,"storageKeyPrefix");Ln(this,"serverUrlHash");Ln(this,"clientName");Ln(this,"clientUri");Ln(this,"callbackUrl");Ln(this,"preventAutoAuth");Ln(this,"onPopupWindow");this.serverUrl=t,this.storageKeyPrefix=e.storageKeyPrefix||"mcp:auth",this.serverUrlHash=this.hashString(t),this.clientName=e.clientName||"MCP Browser Client",this.clientUri=e.clientUri||(typeof window<"u"?window.location.origin:""),this.callbackUrl=To(e.callbackUrl||(typeof window<"u"?new URL("/oauth/callback",window.location.origin).toString():"/oauth/callback")),this.preventAutoAuth=e.preventAutoAuth,this.onPopupWindow=e.onPopupWindow}get redirectUrl(){return To(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 t=this.getKey("client_info"),e=localStorage.getItem(t);if(e)try{return JSON.parse(e)}catch(r){console.warn(`[${this.storageKeyPrefix}] Failed to parse client information:`,r),localStorage.removeItem(t);return}}async saveClientInformation(t){const e=this.getKey("client_info");localStorage.setItem(e,JSON.stringify(t))}async tokens(){const t=this.getKey("tokens"),e=localStorage.getItem(t);if(e)try{return JSON.parse(e)}catch(r){console.warn(`[${this.storageKeyPrefix}] Failed to parse tokens:`,r),localStorage.removeItem(t);return}}async saveTokens(t){const e=this.getKey("tokens");localStorage.setItem(e,JSON.stringify(t)),localStorage.removeItem(this.getKey("code_verifier")),localStorage.removeItem(this.getKey("last_auth_url"))}async saveCodeVerifier(t){const e=this.getKey("code_verifier");localStorage.setItem(e,t)}async codeVerifier(){const t=this.getKey("code_verifier"),e=localStorage.getItem(t);if(!e)throw new Error(`[${this.storageKeyPrefix}] Code verifier not found in storage for key ${t}. Auth flow likely corrupted or timed out.`);return e}async prepareAuthorizationUrl(t){const e=crypto.randomUUID(),r=`${this.storageKeyPrefix}:state_${e}`,s={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(r,JSON.stringify(s)),t.searchParams.set("state",e);const n=t.toString(),a=To(n);return localStorage.setItem(this.getKey("last_auth_url"),a),a}async redirectToAuthorization(t){if(this.preventAutoAuth)return;const e=await this.prepareAuthorizationUrl(t),r="width=600,height=700,resizable=yes,scrollbars=yes,status=yes";try{const s=window.open(e,`mcp_auth_${this.serverUrlHash}`,r);this.onPopupWindow&&this.onPopupWindow(e,r,s),!s||s.closed||typeof s.closed>"u"?console.warn(`[${this.storageKeyPrefix}] Popup likely blocked by browser. Manual navigation might be required using the stored URL.`):(s.focus(),console.info(`[${this.storageKeyPrefix}] Redirecting to authorization URL in popup.`))}catch(s){console.error(`[${this.storageKeyPrefix}] Error opening popup window:`,s)}}getLastAttemptedAuthUrl(){const t=localStorage.getItem(this.getKey("last_auth_url"));return t?To(t):null}clearStorage(){const t=`${this.storageKeyPrefix}_${this.serverUrlHash}_`,e=`${this.storageKeyPrefix}:state_`,r=[];let s=0;for(let a=0;a<localStorage.length;a++){const o=localStorage.key(a);if(o){if(o.startsWith(t))r.push(o);else if(o.startsWith(e))try{const l=localStorage.getItem(o);l&&JSON.parse(l).serverUrlHash===this.serverUrlHash&&r.push(o)}catch(l){console.warn(`[${this.storageKeyPrefix}] Error parsing state key ${o} during clearStorage:`,l)}}}return[...new Set(r)].forEach(a=>{localStorage.removeItem(a),s++}),s}hashString(t){let e=0;for(let r=0;r<t.length;r++){const s=t.charCodeAt(r);e=(e<<5)-e+s,e=e&e}return Math.abs(e).toString(16)}getKey(t){return`${this.storageKeyPrefix}_${this.serverUrlHash}_${t}`}},Ge;(function(t){t.assertEqual=n=>{};function e(n){}t.assertIs=e;function r(n){throw new Error}t.assertNever=r,t.arrayToEnum=n=>{const a={};for(const o of n)a[o]=o;return a},t.getValidEnumValues=n=>{const a=t.objectKeys(n).filter(l=>typeof n[n[l]]!="number"),o={};for(const l of a)o[l]=n[l];return t.objectValues(o)},t.objectValues=n=>t.objectKeys(n).map(function(a){return n[a]}),t.objectKeys=typeof Object.keys=="function"?n=>Object.keys(n):n=>{const a=[];for(const o in n)Object.prototype.hasOwnProperty.call(n,o)&&a.push(o);return a},t.find=(n,a)=>{for(const o of n)if(a(o))return o},t.isInteger=typeof Number.isInteger=="function"?n=>Number.isInteger(n):n=>typeof n=="number"&&Number.isFinite(n)&&Math.floor(n)===n;function s(n,a=" | "){return n.map(o=>typeof o=="string"?`'${o}'`:o).join(a)}t.joinValues=s,t.jsonStringifyReplacer=(n,a)=>typeof a=="bigint"?a.toString():a})(Ge||(Ge={}));var I0;(function(t){t.mergeShapes=(e,r)=>({...e,...r})})(I0||(I0={}));const pe=Ge.arrayToEnum(["string","nan","number","integer","float","boolean","date","bigint","symbol","function","undefined","null","array","object","unknown","promise","void","never","map","set"]),Ps=t=>{switch(typeof t){case"undefined":return pe.undefined;case"string":return pe.string;case"number":return Number.isNaN(t)?pe.nan:pe.number;case"boolean":return pe.boolean;case"function":return pe.function;case"bigint":return pe.bigint;case"symbol":return pe.symbol;case"object":return Array.isArray(t)?pe.array:t===null?pe.null:t.then&&typeof t.then=="function"&&t.catch&&typeof t.catch=="function"?pe.promise:typeof Map<"u"&&t instanceof Map?pe.map:typeof Set<"u"&&t instanceof Set?pe.set:typeof Date<"u"&&t instanceof Date?pe.date:pe.object;default:return pe.unknown}},J=Ge.arrayToEnum(["invalid_type","invalid_literal","custom","invalid_union","invalid_union_discriminator","invalid_enum_value","unrecognized_keys","invalid_arguments","invalid_return_type","invalid_date","invalid_string","too_small","too_big","invalid_intersection_types","not_multiple_of","not_finite"]);class cs extends Error{get errors(){return this.issues}constructor(e){super(),this.issues=[],this.addIssue=s=>{this.issues=[...this.issues,s]},this.addIssues=(s=[])=>{this.issues=[...this.issues,...s]};const r=new.target.prototype;Object.setPrototypeOf?Object.setPrototypeOf(this,r):this.__proto__=r,this.name="ZodError",this.issues=e}format(e){const r=e||function(a){return a.message},s={_errors:[]},n=a=>{for(const o of a.issues)if(o.code==="invalid_union")o.unionErrors.map(n);else if(o.code==="invalid_return_type")n(o.returnTypeError);else if(o.code==="invalid_arguments")n(o.argumentsError);else if(o.path.length===0)s._errors.push(r(o));else{let l=s,c=0;for(;c<o.path.length;){const u=o.path[c];c===o.path.length-1?(l[u]=l[u]||{_errors:[]},l[u]._errors.push(r(o))):l[u]=l[u]||{_errors:[]},l=l[u],c++}}};return n(this),s}static assert(e){if(!(e instanceof cs))throw new Error(`Not a ZodError: ${e}`)}toString(){return this.message}get message(){return JSON.stringify(this.issues,Ge.jsonStringifyReplacer,2)}get isEmpty(){return this.issues.length===0}flatten(e=r=>r.message){const r={},s=[];for(const n of this.issues)if(n.path.length>0){const a=n.path[0];r[a]=r[a]||[],r[a].push(e(n))}else s.push(e(n));return{formErrors:s,fieldErrors:r}}get formErrors(){return this.flatten()}}cs.create=t=>new cs(t);const Tp=(t,e)=>{let r;switch(t.code){case J.invalid_type:t.received===pe.undefined?r="Required":r=`Expected ${t.expected}, received ${t.received}`;break;case J.invalid_literal:r=`Invalid literal value, expected ${JSON.stringify(t.expected,Ge.jsonStringifyReplacer)}`;break;case J.unrecognized_keys:r=`Unrecognized key(s) in object: ${Ge.joinValues(t.keys,", ")}`;break;case J.invalid_union:r="Invalid input";break;case J.invalid_union_discriminator:r=`Invalid discriminator value. Expected ${Ge.joinValues(t.options)}`;break;case J.invalid_enum_value:r=`Invalid enum value. Expected ${Ge.joinValues(t.options)}, received '${t.received}'`;break;case J.invalid_arguments:r="Invalid function arguments";break;case J.invalid_return_type:r="Invalid function return type";break;case J.invalid_date:r="Invalid date";break;case J.invalid_string:typeof t.validation=="object"?"includes"in t.validation?(r=`Invalid input: must include "${t.validation.includes}"`,typeof t.validation.position=="number"&&(r=`${r} at one or more positions greater than or equal to ${t.validation.position}`)):"startsWith"in t.validation?r=`Invalid input: must start with "${t.validation.startsWith}"`:"endsWith"in t.validation?r=`Invalid input: must end with "${t.validation.endsWith}"`:Ge.assertNever(t.validation):t.validation!=="regex"?r=`Invalid ${t.validation}`:r="Invalid";break;case J.too_small:t.type==="array"?r=`Array must contain ${t.exact?"exactly":t.inclusive?"at least":"more than"} ${t.minimum} element(s)`:t.type==="string"?r=`String must contain ${t.exact?"exactly":t.inclusive?"at least":"over"} ${t.minimum} character(s)`:t.type==="number"?r=`Number must be ${t.exact?"exactly equal to ":t.inclusive?"greater than or equal to ":"greater than "}${t.minimum}`:t.type==="bigint"?r=`Number must be ${t.exact?"exactly equal to ":t.inclusive?"greater than or equal to ":"greater than "}${t.minimum}`:t.type==="date"?r=`Date must be ${t.exact?"exactly equal to ":t.inclusive?"greater than or equal to ":"greater than "}${new Date(Number(t.minimum))}`:r="Invalid input";break;case J.too_big:t.type==="array"?r=`Array must contain ${t.exact?"exactly":t.inclusive?"at most":"less than"} ${t.maximum} element(s)`:t.type==="string"?r=`String must contain ${t.exact?"exactly":t.inclusive?"at most":"under"} ${t.maximum} character(s)`:t.type==="number"?r=`Number must be ${t.exact?"exactly":t.inclusive?"less than or equal to":"less than"} ${t.maximum}`:t.type==="bigint"?r=`BigInt must be ${t.exact?"exactly":t.inclusive?"less than or equal to":"less than"} ${t.maximum}`:t.type==="date"?r=`Date must be ${t.exact?"exactly":t.inclusive?"smaller than or equal to":"smaller than"} ${new Date(Number(t.maximum))}`:r="Invalid input";break;case J.custom:r="Invalid input";break;case J.invalid_intersection_types:r="Intersection results could not be merged";break;case J.not_multiple_of:r=`Number must be a multiple of ${t.multipleOf}`;break;case J.not_finite:r="Number must be finite";break;default:r=e.defaultError,Ge.assertNever(t)}return{message:r}};let WI=Tp;function KI(){return WI}const QI=t=>{const{data:e,path:r,errorMaps:s,issueData:n}=t,a=[...r,...n.path||[]],o={...n,path:a};if(n.message!==void 0)return{...n,path:a,message:n.message};let l="";const c=s.filter(u=>!!u).slice().reverse();for(const u of c)l=u(o,{data:e,defaultError:l}).message;return{...n,path:a,message:l}};function le(t,e){const r=KI(),s=QI({issueData:e,data:t.data,path:t.path,errorMaps:[t.common.contextualErrorMap,t.schemaErrorMap,r,r===Tp?void 0:Tp].filter(n=>!!n)});t.common.issues.push(s)}class nr{constructor(){this.value="valid"}dirty(){this.value==="valid"&&(this.value="dirty")}abort(){this.value!=="aborted"&&(this.value="aborted")}static mergeArray(e,r){const s=[];for(const n of r){if(n.status==="aborted")return Ce;n.status==="dirty"&&e.dirty(),s.push(n.value)}return{status:e.value,value:s}}static async mergeObjectAsync(e,r){const s=[];for(const n of r){const a=await n.key,o=await n.value;s.push({key:a,value:o})}return nr.mergeObjectSync(e,s)}static mergeObjectSync(e,r){const s={};for(const n of r){const{key:a,value:o}=n;if(a.status==="aborted"||o.status==="aborted")return Ce;a.status==="dirty"&&e.dirty(),o.status==="dirty"&&e.dirty(),a.value!=="__proto__"&&(typeof o.value<"u"||n.alwaysSet)&&(s[a.value]=o.value)}return{status:e.value,value:s}}}const Ce=Object.freeze({status:"aborted"}),Qi=t=>({status:"dirty",value:t}),zr=t=>({status:"valid",value:t}),D0=t=>t.status==="aborted",M0=t=>t.status==="dirty",mi=t=>t.status==="valid",Vu=t=>typeof Promise<"u"&&t instanceof Promise;var ye;(function(t){t.errToObj=e=>typeof e=="string"?{message:e}:e||{},t.toString=e=>typeof e=="string"?e:e==null?void 0:e.message})(ye||(ye={}));class An{constructor(e,r,s,n){this._cachedPath=[],this.parent=e,this.data=r,this._path=s,this._key=n}get path(){return this._cachedPath.length||(Array.isArray(this._key)?this._cachedPath.push(...this._path,...this._key):this._cachedPath.push(...this._path,this._key)),this._cachedPath}}const $0=(t,e)=>{if(mi(e))return{success:!0,data:e.value};if(!t.common.issues.length)throw new Error("Validation failed but no issues detected.");return{success:!1,get error(){if(this._error)return this._error;const r=new cs(t.common.issues);return this._error=r,this._error}}};function Fe(t){if(!t)return{};const{errorMap:e,invalid_type_error:r,required_error:s,description:n}=t;if(e&&(r||s))throw new Error(`Can't use "invalid_type_error" or "required_error" in conjunction with custom error map.`);return e?{errorMap:e,description:n}:{errorMap:(o,l)=>{const{message:c}=t;return o.code==="invalid_enum_value"?{message:c??l.defaultError}:typeof l.data>"u"?{message:c??s??l.defaultError}:o.code!=="invalid_type"?{message:l.defaultError}:{message:c??r??l.defaultError}},description:n}}class Be{get description(){return this._def.description}_getType(e){return Ps(e.data)}_getOrReturnCtx(e,r){return r||{common:e.parent.common,data:e.data,parsedType:Ps(e.data),schemaErrorMap:this._def.errorMap,path:e.path,parent:e.parent}}_processInputParams(e){return{status:new nr,ctx:{common:e.parent.common,data:e.data,parsedType:Ps(e.data),schemaErrorMap:this._def.errorMap,path:e.path,parent:e.parent}}}_parseSync(e){const r=this._parse(e);if(Vu(r))throw new Error("Synchronous parse encountered promise.");return r}_parseAsync(e){const r=this._parse(e);return Promise.resolve(r)}parse(e,r){const s=this.safeParse(e,r);if(s.success)return s.data;throw s.error}safeParse(e,r){const s={common:{issues:[],async:(r==null?void 0:r.async)??!1,contextualErrorMap:r==null?void 0:r.errorMap},path:(r==null?void 0:r.path)||[],schemaErrorMap:this._def.errorMap,parent:null,data:e,parsedType:Ps(e)},n=this._parseSync({data:e,path:s.path,parent:s});return $0(s,n)}"~validate"(e){var s,n;const r={common:{issues:[],async:!!this["~standard"].async},path:[],schemaErrorMap:this._def.errorMap,parent:null,data:e,parsedType:Ps(e)};if(!this["~standard"].async)try{const a=this._parseSync({data:e,path:[],parent:r});return mi(a)?{value:a.value}:{issues:r.common.issues}}catch(a){(n=(s=a==null?void 0:a.message)==null?void 0:s.toLowerCase())!=null&&n.includes("encountered")&&(this["~standard"].async=!0),r.common={issues:[],async:!0}}return this._parseAsync({data:e,path:[],parent:r}).then(a=>mi(a)?{value:a.value}:{issues:r.common.issues})}async parseAsync(e,r){const s=await this.safeParseAsync(e,r);if(s.success)return s.data;throw s.error}async safeParseAsync(e,r){const s={common:{issues:[],contextualErrorMap:r==null?void 0:r.errorMap,async:!0},path:(r==null?void 0:r.path)||[],schemaErrorMap:this._def.errorMap,parent:null,data:e,parsedType:Ps(e)},n=this._parse({data:e,path:s.path,parent:s}),a=await(Vu(n)?n:Promise.resolve(n));return $0(s,a)}refine(e,r){const s=n=>typeof r=="string"||typeof r>"u"?{message:r}:typeof r=="function"?r(n):r;return this._refinement((n,a)=>{const o=e(n),l=()=>a.addIssue({code:J.custom,...s(n)});return typeof Promise<"u"&&o instanceof Promise?o.then(c=>c?!0:(l(),!1)):o?!0:(l(),!1)})}refinement(e,r){return this._refinement((s,n)=>e(s)?!0:(n.addIssue(typeof r=="function"?r(s,n):r),!1))}_refinement(e){return new eo({schema:this,typeName:ke.ZodEffects,effect:{type:"refinement",refinement:e}})}superRefine(e){return this._refinement(e)}constructor(e){this.spa=this.safeParseAsync,this._def=e,this.parse=this.parse.bind(this),this.safeParse=this.safeParse.bind(this),this.parseAsync=this.parseAsync.bind(this),this.safeParseAsync=this.safeParseAsync.bind(this),this.spa=this.spa.bind(this),this.refine=this.refine.bind(this),this.refinement=this.refinement.bind(this),this.superRefine=this.superRefine.bind(this),this.optional=this.optional.bind(this),this.nullable=this.nullable.bind(this),this.nullish=this.nullish.bind(this),this.array=this.array.bind(this),this.promise=this.promise.bind(this),this.or=this.or.bind(this),this.and=this.and.bind(this),this.transform=this.transform.bind(this),this.brand=this.brand.bind(this),this.default=this.default.bind(this),this.catch=this.catch.bind(this),this.describe=this.describe.bind(this),this.pipe=this.pipe.bind(this),this.readonly=this.readonly.bind(this),this.isNullable=this.isNullable.bind(this),this.isOptional=this.isOptional.bind(this),this["~standard"]={version:1,vendor:"zod",validate:r=>this["~validate"](r)}}optional(){return ts.create(this,this._def)}nullable(){return to.create(this,this._def)}nullish(){return this.nullable().optional()}array(){return Rn.create(this)}promise(){return Qu.create(this,this._def)}or(e){return Hu.create([this,e],this._def)}and(e){return Bu.create(this,e,this._def)}transform(e){return new eo({...Fe(this._def),schema:this,typeName:ke.ZodEffects,effect:{type:"transform",transform:e}})}default(e){const r=typeof e=="function"?e:()=>e;return new Gu({...Fe(this._def),innerType:this,defaultValue:r,typeName:ke.ZodDefault})}brand(){return new PE({typeName:ke.ZodBranded,type:this,...Fe(this._def)})}catch(e){const r=typeof e=="function"?e:()=>e;return new Zu({...Fe(this._def),innerType:this,catchValue:r,typeName:ke.ZodCatch})}describe(e){const r=this.constructor;return new r({...this._def,description:e})}pipe(e){return Kv.create(this,e)}readonly(){return Yu.create(this)}isOptional(){return this.safeParse(void 0).success}isNullable(){return this.safeParse(null).success}}const GI=/^c[^\s-]{8,}$/i,ZI=/^[0-9a-z]+$/,YI=/^[0-9A-HJKMNP-TV-Z]{26}$/i,JI=/^[0-9a-fA-F]{8}\b-[0-9a-fA-F]{4}\b-[0-9a-fA-F]{4}\b-[0-9a-fA-F]{4}\b-[0-9a-fA-F]{12}$/i,XI=/^[a-z0-9_-]{21}$/i,e4=/^[A-Za-z0-9-_]+\.[A-Za-z0-9-_]+\.[A-Za-z0-9-_]*$/,t4=/^[-+]?P(?!$)(?:(?:[-+]?\d+Y)|(?:[-+]?\d+[.,]\d+Y$))?(?:(?:[-+]?\d+M)|(?:[-+]?\d+[.,]\d+M$))?(?:(?:[-+]?\d+W)|(?:[-+]?\d+[.,]\d+W$))?(?:(?:[-+]?\d+D)|(?:[-+]?\d+[.,]\d+D$))?(?:T(?=[\d+-])(?:(?:[-+]?\d+H)|(?:[-+]?\d+[.,]\d+H$))?(?:(?:[-+]?\d+M)|(?:[-+]?\d+[.,]\d+M$))?(?:[-+]?\d+(?:[.,]\d+)?S)?)??$/,r4=/^(?!\.)(?!.*\.\.)([A-Z0-9_'+\-\.]*)[A-Z0-9_+-]@([A-Z0-9][A-Z0-9\-]*\.)+[A-Z]{2,}$/i,n4="^(\\p{Extended_Pictographic}|\\p{Emoji_Component})+$";let Yf;const s4=/^(?:(?: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])$/,a4=/^(?:(?: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])\/(3[0-2]|[12]?[0-9])$/,o4=/^(([0-9a-fA-F]{1,4}:){7,7}[0-9a-fA-F]{1,4}|([0-9a-fA-F]{1,4}:){1,7}:|([0-9a-fA-F]{1,4}:){1,6}:[0-9a-fA-F]{1,4}|([0-9a-fA-F]{1,4}:){1,5}(:[0-9a-fA-F]{1,4}){1,2}|([0-9a-fA-F]{1,4}:){1,4}(:[0-9a-fA-F]{1,4}){1,3}|([0-9a-fA-F]{1,4}:){1,3}(:[0-9a-fA-F]{1,4}){1,4}|([0-9a-fA-F]{1,4}:){1,2}(:[0-9a-fA-F]{1,4}){1,5}|[0-9a-fA-F]{1,4}:((:[0-9a-fA-F]{1,4}){1,6})|:((:[0-9a-fA-F]{1,4}){1,7}|:)|fe80:(:[0-9a-fA-F]{0,4}){0,4}%[0-9a-zA-Z]{1,}|::(ffff(:0{1,4}){0,1}:){0,1}((25[0-5]|(2[0-4]|1{0,1}[0-9]){0,1}[0-9])\.){3,3}(25[0-5]|(2[0-4]|1{0,1}[0-9]){0,1}[0-9])|([0-9a-fA-F]{1,4}:){1,4}:((25[0-5]|(2[0-4]|1{0,1}[0-9]){0,1}[0-9])\.){3,3}(25[0-5]|(2[0-4]|1{0,1}[0-9]){0,1}[0-9]))$/,i4=/^(([0-9a-fA-F]{1,4}:){7,7}[0-9a-fA-F]{1,4}|([0-9a-fA-F]{1,4}:){1,7}:|([0-9a-fA-F]{1,4}:){1,6}:[0-9a-fA-F]{1,4}|([0-9a-fA-F]{1,4}:){1,5}(:[0-9a-fA-F]{1,4}){1,2}|([0-9a-fA-F]{1,4}:){1,4}(:[0-9a-fA-F]{1,4}){1,3}|([0-9a-fA-F]{1,4}:){1,3}(:[0-9a-fA-F]{1,4}){1,4}|([0-9a-fA-F]{1,4}:){1,2}(:[0-9a-fA-F]{1,4}){1,5}|[0-9a-fA-F]{1,4}:((:[0-9a-fA-F]{1,4}){1,6})|:((:[0-9a-fA-F]{1,4}){1,7}|:)|fe80:(:[0-9a-fA-F]{0,4}){0,4}%[0-9a-zA-Z]{1,}|::(ffff(:0{1,4}){0,1}:){0,1}((25[0-5]|(2[0-4]|1{0,1}[0-9]){0,1}[0-9])\.){3,3}(25[0-5]|(2[0-4]|1{0,1}[0-9]){0,1}[0-9])|([0-9a-fA-F]{1,4}:){1,4}:((25[0-5]|(2[0-4]|1{0,1}[0-9]){0,1}[0-9])\.){3,3}(25[0-5]|(2[0-4]|1{0,1}[0-9]){0,1}[0-9]))\/(12[0-8]|1[01][0-9]|[1-9]?[0-9])$/,l4=/^([0-9a-zA-Z+/]{4})*(([0-9a-zA-Z+/]{2}==)|([0-9a-zA-Z+/]{3}=))?$/,c4=/^([0-9a-zA-Z-_]{4})*(([0-9a-zA-Z-_]{2}(==)?)|([0-9a-zA-Z-_]{3}(=)?))?$/,EE="((\\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])))",u4=new RegExp(`^${EE}$`);function CE(t){let e="[0-5]\\d";t.precision?e=`${e}\\.\\d{${t.precision}}`:t.precision==null&&(e=`${e}(\\.\\d+)?`);const r=t.precision?"+":"?";return`([01]\\d|2[0-3]):[0-5]\\d(:${e})${r}`}function d4(t){return new RegExp(`^${CE(t)}$`)}function f4(t){let e=`${EE}T${CE(t)}`;const r=[];return r.push(t.local?"Z?":"Z"),t.offset&&r.push("([+-]\\d{2}:?\\d{2})"),e=`${e}(${r.join("|")})`,new RegExp(`^${e}$`)}function h4(t,e){return!!((e==="v4"||!e)&&s4.test(t)||(e==="v6"||!e)&&o4.test(t))}function p4(t,e){if(!e4.test(t))return!1;try{const[r]=t.split(".");if(!r)return!1;const s=r.replace(/-/g,"+").replace(/_/g,"/").padEnd(r.length+(4-r.length%4)%4,"="),n=JSON.parse(atob(s));return!(typeof n!="object"||n===null||"typ"in n&&(n==null?void 0:n.typ)!=="JWT"||!n.alg||e&&n.alg!==e)}catch{return!1}}function m4(t,e){return!!((e==="v4"||!e)&&a4.test(t)||(e==="v6"||!e)&&i4.test(t))}class Xn extends Be{_parse(e){if(this._def.coerce&&(e.data=String(e.data)),this._getType(e)!==pe.string){const a=this._getOrReturnCtx(e);return le(a,{code:J.invalid_type,expected:pe.string,received:a.parsedType}),Ce}const s=new nr;let n;for(const a of this._def.checks)if(a.kind==="min")e.data.length<a.value&&(n=this._getOrReturnCtx(e,n),le(n,{code:J.too_small,minimum:a.value,type:"string",inclusive:!0,exact:!1,message:a.message}),s.dirty());else if(a.kind==="max")e.data.length>a.value&&(n=this._getOrReturnCtx(e,n),le(n,{code:J.too_big,maximum:a.value,type:"string",inclusive:!0,exact:!1,message:a.message}),s.dirty());else if(a.kind==="length"){const o=e.data.length>a.value,l=e.data.length<a.value;(o||l)&&(n=this._getOrReturnCtx(e,n),o?le(n,{code:J.too_big,maximum:a.value,type:"string",inclusive:!0,exact:!0,message:a.message}):l&&le(n,{code:J.too_small,minimum:a.value,type:"string",inclusive:!0,exact:!0,message:a.message}),s.dirty())}else if(a.kind==="email")r4.test(e.data)||(n=this._getOrReturnCtx(e,n),le(n,{validation:"email",code:J.invalid_string,message:a.message}),s.dirty());else if(a.kind==="emoji")Yf||(Yf=new RegExp(n4,"u")),Yf.test(e.data)||(n=this._getOrReturnCtx(e,n),le(n,{validation:"emoji",code:J.invalid_string,message:a.message}),s.dirty());else if(a.kind==="uuid")JI.test(e.data)||(n=this._getOrReturnCtx(e,n),le(n,{validation:"uuid",code:J.invalid_string,message:a.message}),s.dirty());else if(a.kind==="nanoid")XI.test(e.data)||(n=this._getOrReturnCtx(e,n),le(n,{validation:"nanoid",code:J.invalid_string,message:a.message}),s.dirty());else if(a.kind==="cuid")GI.test(e.data)||(n=this._getOrReturnCtx(e,n),le(n,{validation:"cuid",code:J.invalid_string,message:a.message}),s.dirty());else if(a.kind==="cuid2")ZI.test(e.data)||(n=this._getOrReturnCtx(e,n),le(n,{validation:"cuid2",code:J.invalid_string,message:a.message}),s.dirty());else if(a.kind==="ulid")YI.test(e.data)||(n=this._getOrReturnCtx(e,n),le(n,{validation:"ulid",code:J.invalid_string,message:a.message}),s.dirty());else if(a.kind==="url")try{new URL(e.data)}catch{n=this._getOrReturnCtx(e,n),le(n,{validation:"url",code:J.invalid_string,message:a.message}),s.dirty()}else a.kind==="regex"?(a.regex.lastIndex=0,a.regex.test(e.data)||(n=this._getOrReturnCtx(e,n),le(n,{validation:"regex",code:J.invalid_string,message:a.message}),s.dirty())):a.kind==="trim"?e.data=e.data.trim():a.kind==="includes"?e.data.includes(a.value,a.position)||(n=this._getOrReturnCtx(e,n),le(n,{code:J.invalid_string,validation:{includes:a.value,position:a.position},message:a.message}),s.dirty()):a.kind==="toLowerCase"?e.data=e.data.toLowerCase():a.kind==="toUpperCase"?e.data=e.data.toUpperCase():a.kind==="startsWith"?e.data.startsWith(a.value)||(n=this._getOrReturnCtx(e,n),le(n,{code:J.invalid_string,validation:{startsWith:a.value},message:a.message}),s.dirty()):a.kind==="endsWith"?e.data.endsWith(a.value)||(n=this._getOrReturnCtx(e,n),le(n,{code:J.invalid_string,validation:{endsWith:a.value},message:a.message}),s.dirty()):a.kind==="datetime"?f4(a).test(e.data)||(n=this._getOrReturnCtx(e,n),le(n,{code:J.invalid_string,validation:"datetime",message:a.message}),s.dirty()):a.kind==="date"?u4.test(e.data)||(n=this._getOrReturnCtx(e,n),le(n,{code:J.invalid_string,validation:"date",message:a.message}),s.dirty()):a.kind==="time"?d4(a).test(e.data)||(n=this._getOrReturnCtx(e,n),le(n,{code:J.invalid_string,validation:"time",message:a.message}),s.dirty()):a.kind==="duration"?t4.test(e.data)||(n=this._getOrReturnCtx(e,n),le(n,{validation:"duration",code:J.invalid_string,message:a.message}),s.dirty()):a.kind==="ip"?h4(e.data,a.version)||(n=this._getOrReturnCtx(e,n),le(n,{validation:"ip",code:J.invalid_string,message:a.message}),s.dirty()):a.kind==="jwt"?p4(e.data,a.alg)||(n=this._getOrReturnCtx(e,n),le(n,{validation:"jwt",code:J.invalid_string,message:a.message}),s.dirty()):a.kind==="cidr"?m4(e.data,a.version)||(n=this._getOrReturnCtx(e,n),le(n,{validation:"cidr",code:J.invalid_string,message:a.message}),s.dirty()):a.kind==="base64"?l4.test(e.data)||(n=this._getOrReturnCtx(e,n),le(n,{validation:"base64",code:J.invalid_string,message:a.message}),s.dirty()):a.kind==="base64url"?c4.test(e.data)||(n=this._getOrReturnCtx(e,n),le(n,{validation:"base64url",code:J.invalid_string,message:a.message}),s.dirty()):Ge.assertNever(a);return{status:s.value,value:e.data}}_regex(e,r,s){return this.refinement(n=>e.test(n),{validation:r,code:J.invalid_string,...ye.errToObj(s)})}_addCheck(e){return new Xn({...this._def,checks:[...this._def.checks,e]})}email(e){return this._addCheck({kind:"email",...ye.errToObj(e)})}url(e){return this._addCheck({kind:"url",...ye.errToObj(e)})}emoji(e){return this._addCheck({kind:"emoji",...ye.errToObj(e)})}uuid(e){return this._addCheck({kind:"uuid",...ye.errToObj(e)})}nanoid(e){return this._addCheck({kind:"nanoid",...ye.errToObj(e)})}cuid(e){return this._addCheck({kind:"cuid",...ye.errToObj(e)})}cuid2(e){return this._addCheck({kind:"cuid2",...ye.errToObj(e)})}ulid(e){return this._addCheck({kind:"ulid",...ye.errToObj(e)})}base64(e){return this._addCheck({kind:"base64",...ye.errToObj(e)})}base64url(e){return this._addCheck({kind:"base64url",...ye.errToObj(e)})}jwt(e){return this._addCheck({kind:"jwt",...ye.errToObj(e)})}ip(e){return this._addCheck({kind:"ip",...ye.errToObj(e)})}cidr(e){return this._addCheck({kind:"cidr",...ye.errToObj(e)})}datetime(e){return typeof e=="string"?this._addCheck({kind:"datetime",precision:null,offset:!1,local:!1,message:e}):this._addCheck({kind:"datetime",precision:typeof(e==null?void 0:e.precision)>"u"?null:e==null?void 0:e.precision,offset:(e==null?void 0:e.offset)??!1,local:(e==null?void 0:e.local)??!1,...ye.errToObj(e==null?void 0:e.message)})}date(e){return this._addCheck({kind:"date",message:e})}time(e){return typeof e=="string"?this._addCheck({kind:"time",precision:null,message:e}):this._addCheck({kind:"time",precision:typeof(e==null?void 0:e.precision)>"u"?null:e==null?void 0:e.precision,...ye.errToObj(e==null?void 0:e.message)})}duration(e){return this._addCheck({kind:"duration",...ye.errToObj(e)})}regex(e,r){return this._addCheck({kind:"regex",regex:e,...ye.errToObj(r)})}includes(e,r){return this._addCheck({kind:"includes",value:e,position:r==null?void 0:r.position,...ye.errToObj(r==null?void 0:r.message)})}startsWith(e,r){return this._addCheck({kind:"startsWith",value:e,...ye.errToObj(r)})}endsWith(e,r){return this._addCheck({kind:"endsWith",value:e,...ye.errToObj(r)})}min(e,r){return this._addCheck({kind:"min",value:e,...ye.errToObj(r)})}max(e,r){return this._addCheck({kind:"max",value:e,...ye.errToObj(r)})}length(e,r){return this._addCheck({kind:"length",value:e,...ye.errToObj(r)})}nonempty(e){return this.min(1,ye.errToObj(e))}trim(){return new Xn({...this._def,checks:[...this._def.checks,{kind:"trim"}]})}toLowerCase(){return new Xn({...this._def,checks:[...this._def.checks,{kind:"toLowerCase"}]})}toUpperCase(){return new Xn({...this._def,checks:[...this._def.checks,{kind:"toUpperCase"}]})}get isDatetime(){return!!this._def.checks.find(e=>e.kind==="datetime")}get isDate(){return!!this._def.checks.find(e=>e.kind==="date")}get isTime(){return!!this._def.checks.find(e=>e.kind==="time")}get isDuration(){return!!this._def.checks.find(e=>e.kind==="duration")}get isEmail(){return!!this._def.checks.find(e=>e.kind==="email")}get isURL(){return!!this._def.checks.find(e=>e.kind==="url")}get isEmoji(){return!!this._def.checks.find(e=>e.kind==="emoji")}get isUUID(){return!!this._def.checks.find(e=>e.kind==="uuid")}get isNANOID(){return!!this._def.checks.find(e=>e.kind==="nanoid")}get isCUID(){return!!this._def.checks.find(e=>e.kind==="cuid")}get isCUID2(){return!!this._def.checks.find(e=>e.kind==="cuid2")}get isULID(){return!!this._def.checks.find(e=>e.kind==="ulid")}get isIP(){return!!this._def.checks.find(e=>e.kind==="ip")}get isCIDR(){return!!this._def.checks.find(e=>e.kind==="cidr")}get isBase64(){return!!this._def.checks.find(e=>e.kind==="base64")}get isBase64url(){return!!this._def.checks.find(e=>e.kind==="base64url")}get minLength(){let e=null;for(const r of this._def.checks)r.kind==="min"&&(e===null||r.value>e)&&(e=r.value);return e}get maxLength(){let e=null;for(const r of this._def.checks)r.kind==="max"&&(e===null||r.value<e)&&(e=r.value);return e}}Xn.create=t=>new Xn({checks:[],typeName:ke.ZodString,coerce:(t==null?void 0:t.coerce)??!1,...Fe(t)});function v4(t,e){const r=(t.toString().split(".")[1]||"").length,s=(e.toString().split(".")[1]||"").length,n=r>s?r:s,a=Number.parseInt(t.toFixed(n).replace(".","")),o=Number.parseInt(e.toFixed(n).replace(".",""));return a%o/10**n}class vi extends Be{constructor(){super(...arguments),this.min=this.gte,this.max=this.lte,this.step=this.multipleOf}_parse(e){if(this._def.coerce&&(e.data=Number(e.data)),this._getType(e)!==pe.number){const a=this._getOrReturnCtx(e);return le(a,{code:J.invalid_type,expected:pe.number,received:a.parsedType}),Ce}let s;const n=new nr;for(const a of this._def.checks)a.kind==="int"?Ge.isInteger(e.data)||(s=this._getOrReturnCtx(e,s),le(s,{code:J.invalid_type,expected:"integer",received:"float",message:a.message}),n.dirty()):a.kind==="min"?(a.inclusive?e.data<a.value:e.data<=a.value)&&(s=this._getOrReturnCtx(e,s),le(s,{code:J.too_small,minimum:a.value,type:"number",inclusive:a.inclusive,exact:!1,message:a.message}),n.dirty()):a.kind==="max"?(a.inclusive?e.data>a.value:e.data>=a.value)&&(s=this._getOrReturnCtx(e,s),le(s,{code:J.too_big,maximum:a.value,type:"number",inclusive:a.inclusive,exact:!1,message:a.message}),n.dirty()):a.kind==="multipleOf"?v4(e.data,a.value)!==0&&(s=this._getOrReturnCtx(e,s),le(s,{code:J.not_multiple_of,multipleOf:a.value,message:a.message}),n.dirty()):a.kind==="finite"?Number.isFinite(e.data)||(s=this._getOrReturnCtx(e,s),le(s,{code:J.not_finite,message:a.message}),n.dirty()):Ge.assertNever(a);return{status:n.value,value:e.data}}gte(e,r){return this.setLimit("min",e,!0,ye.toString(r))}gt(e,r){return this.setLimit("min",e,!1,ye.toString(r))}lte(e,r){return this.setLimit("max",e,!0,ye.toString(r))}lt(e,r){return this.setLimit("max",e,!1,ye.toString(r))}setLimit(e,r,s,n){return new vi({...this._def,checks:[...this._def.checks,{kind:e,value:r,inclusive:s,message:ye.toString(n)}]})}_addCheck(e){return new vi({...this._def,checks:[...this._def.checks,e]})}int(e){return this._addCheck({kind:"int",message:ye.toString(e)})}positive(e){return this._addCheck({kind:"min",value:0,inclusive:!1,message:ye.toString(e)})}negative(e){return this._addCheck({kind:"max",value:0,inclusive:!1,message:ye.toString(e)})}nonpositive(e){return this._addCheck({kind:"max",value:0,inclusive:!0,message:ye.toString(e)})}nonnegative(e){return this._addCheck({kind:"min",value:0,inclusive:!0,message:ye.toString(e)})}multipleOf(e,r){return this._addCheck({kind:"multipleOf",value:e,message:ye.toString(r)})}finite(e){return this._addCheck({kind:"finite",message:ye.toString(e)})}safe(e){return this._addCheck({kind:"min",inclusive:!0,value:Number.MIN_SAFE_INTEGER,message:ye.toString(e)})._addCheck({kind:"max",inclusive:!0,value:Number.MAX_SAFE_INTEGER,message:ye.toString(e)})}get minValue(){let e=null;for(const r of this._def.checks)r.kind==="min"&&(e===null||r.value>e)&&(e=r.value);return e}get maxValue(){let e=null;for(const r of this._def.checks)r.kind==="max"&&(e===null||r.value<e)&&(e=r.value);return e}get isInt(){return!!this._def.checks.find(e=>e.kind==="int"||e.kind==="multipleOf"&&Ge.isInteger(e.value))}get isFinite(){let e=null,r=null;for(const s of this._def.checks){if(s.kind==="finite"||s.kind==="int"||s.kind==="multipleOf")return!0;s.kind==="min"?(r===null||s.value>r)&&(r=s.value):s.kind==="max"&&(e===null||s.value<e)&&(e=s.value)}return Number.isFinite(r)&&Number.isFinite(e)}}vi.create=t=>new vi({checks:[],typeName:ke.ZodNumber,coerce:(t==null?void 0:t.coerce)||!1,...Fe(t)});class Rl extends Be{constructor(){super(...arguments),this.min=this.gte,this.max=this.lte}_parse(e){if(this._def.coerce)try{e.data=BigInt(e.data)}catch{return this._getInvalidInput(e)}if(this._getType(e)!==pe.bigint)return this._getInvalidInput(e);let s;const n=new nr;for(const a of this._def.checks)a.kind==="min"?(a.inclusive?e.data<a.value:e.data<=a.value)&&(s=this._getOrReturnCtx(e,s),le(s,{code:J.too_small,type:"bigint",minimum:a.value,inclusive:a.inclusive,message:a.message}),n.dirty()):a.kind==="max"?(a.inclusive?e.data>a.value:e.data>=a.value)&&(s=this._getOrReturnCtx(e,s),le(s,{code:J.too_big,type:"bigint",maximum:a.value,inclusive:a.inclusive,message:a.message}),n.dirty()):a.kind==="multipleOf"?e.data%a.value!==BigInt(0)&&(s=this._getOrReturnCtx(e,s),le(s,{code:J.not_multiple_of,multipleOf:a.value,message:a.message}),n.dirty()):Ge.assertNever(a);return{status:n.value,value:e.data}}_getInvalidInput(e){const r=this._getOrReturnCtx(e);return le(r,{code:J.invalid_type,expected:pe.bigint,received:r.parsedType}),Ce}gte(e,r){return this.setLimit("min",e,!0,ye.toString(r))}gt(e,r){return this.setLimit("min",e,!1,ye.toString(r))}lte(e,r){return this.setLimit("max",e,!0,ye.toString(r))}lt(e,r){return this.setLimit("max",e,!1,ye.toString(r))}setLimit(e,r,s,n){return new Rl({...this._def,checks:[...this._def.checks,{kind:e,value:r,inclusive:s,message:ye.toString(n)}]})}_addCheck(e){return new Rl({...this._def,checks:[...this._def.checks,e]})}positive(e){return this._addCheck({kind:"min",value:BigInt(0),inclusive:!1,message:ye.toString(e)})}negative(e){return this._addCheck({kind:"max",value:BigInt(0),inclusive:!1,message:ye.toString(e)})}nonpositive(e){return this._addCheck({kind:"max",value:BigInt(0),inclusive:!0,message:ye.toString(e)})}nonnegative(e){return this._addCheck({kind:"min",value:BigInt(0),inclusive:!0,message:ye.toString(e)})}multipleOf(e,r){return this._addCheck({kind:"multipleOf",value:e,message:ye.toString(r)})}get minValue(){let e=null;for(const r of this._def.checks)r.kind==="min"&&(e===null||r.value>e)&&(e=r.value);return e}get maxValue(){let e=null;for(const r of this._def.checks)r.kind==="max"&&(e===null||r.value<e)&&(e=r.value);return e}}Rl.create=t=>new Rl({checks:[],typeName:ke.ZodBigInt,coerce:(t==null?void 0:t.coerce)??!1,...Fe(t)});class Ap extends Be{_parse(e){if(this._def.coerce&&(e.data=!!e.data),this._getType(e)!==pe.boolean){const s=this._getOrReturnCtx(e);return le(s,{code:J.invalid_type,expected:pe.boolean,received:s.parsedType}),Ce}return zr(e.data)}}Ap.create=t=>new Ap({typeName:ke.ZodBoolean,coerce:(t==null?void 0:t.coerce)||!1,...Fe(t)});class qu extends Be{_parse(e){if(this._def.coerce&&(e.data=new Date(e.data)),this._getType(e)!==pe.date){const a=this._getOrReturnCtx(e);return le(a,{code:J.invalid_type,expected:pe.date,received:a.parsedType}),Ce}if(Number.isNaN(e.data.getTime())){const a=this._getOrReturnCtx(e);return le(a,{code:J.invalid_date}),Ce}const s=new nr;let n;for(const a of this._def.checks)a.kind==="min"?e.data.getTime()<a.value&&(n=this._getOrReturnCtx(e,n),le(n,{code:J.too_small,message:a.message,inclusive:!0,exact:!1,minimum:a.value,type:"date"}),s.dirty()):a.kind==="max"?e.data.getTime()>a.value&&(n=this._getOrReturnCtx(e,n),le(n,{code:J.too_big,message:a.message,inclusive:!0,exact:!1,maximum:a.value,type:"date"}),s.dirty()):Ge.assertNever(a);return{status:s.value,value:new Date(e.data.getTime())}}_addCheck(e){return new qu({...this._def,checks:[...this._def.checks,e]})}min(e,r){return this._addCheck({kind:"min",value:e.getTime(),message:ye.toString(r)})}max(e,r){return this._addCheck({kind:"max",value:e.getTime(),message:ye.toString(r)})}get minDate(){let e=null;for(const r of this._def.checks)r.kind==="min"&&(e===null||r.value>e)&&(e=r.value);return e!=null?new Date(e):null}get maxDate(){let e=null;for(const r of this._def.checks)r.kind==="max"&&(e===null||r.value<e)&&(e=r.value);return e!=null?new Date(e):null}}qu.create=t=>new qu({checks:[],coerce:(t==null?void 0:t.coerce)||!1,typeName:ke.ZodDate,...Fe(t)});class F0 extends Be{_parse(e){if(this._getType(e)!==pe.symbol){const s=this._getOrReturnCtx(e);return le(s,{code:J.invalid_type,expected:pe.symbol,received:s.parsedType}),Ce}return zr(e.data)}}F0.create=t=>new F0({typeName:ke.ZodSymbol,...Fe(t)});class Op extends Be{_parse(e){if(this._getType(e)!==pe.undefined){const s=this._getOrReturnCtx(e);return le(s,{code:J.invalid_type,expected:pe.undefined,received:s.parsedType}),Ce}return zr(e.data)}}Op.create=t=>new Op({typeName:ke.ZodUndefined,...Fe(t)});class Ip extends Be{_parse(e){if(this._getType(e)!==pe.null){const s=this._getOrReturnCtx(e);return le(s,{code:J.invalid_type,expected:pe.null,received:s.parsedType}),Ce}return zr(e.data)}}Ip.create=t=>new Ip({typeName:ke.ZodNull,...Fe(t)});class Dp extends Be{constructor(){super(...arguments),this._any=!0}_parse(e){return zr(e.data)}}Dp.create=t=>new Dp({typeName:ke.ZodAny,...Fe(t)});class Mp extends Be{constructor(){super(...arguments),this._unknown=!0}_parse(e){return zr(e.data)}}Mp.create=t=>new Mp({typeName:ke.ZodUnknown,...Fe(t)});class ia extends Be{_parse(e){const r=this._getOrReturnCtx(e);return le(r,{code:J.invalid_type,expected:pe.never,received:r.parsedType}),Ce}}ia.create=t=>new ia({typeName:ke.ZodNever,...Fe(t)});class L0 extends Be{_parse(e){if(this._getType(e)!==pe.undefined){const s=this._getOrReturnCtx(e);return le(s,{code:J.invalid_type,expected:pe.void,received:s.parsedType}),Ce}return zr(e.data)}}L0.create=t=>new L0({typeName:ke.ZodVoid,...Fe(t)});class Rn extends Be{_parse(e){const{ctx:r,status:s}=this._processInputParams(e),n=this._def;if(r.parsedType!==pe.array)return le(r,{code:J.invalid_type,expected:pe.array,received:r.parsedType}),Ce;if(n.exactLength!==null){const o=r.data.length>n.exactLength.value,l=r.data.length<n.exactLength.value;(o||l)&&(le(r,{code:o?J.too_big:J.too_small,minimum:l?n.exactLength.value:void 0,maximum:o?n.exactLength.value:void 0,type:"array",inclusive:!0,exact:!0,message:n.exactLength.message}),s.dirty())}if(n.minLength!==null&&r.data.length<n.minLength.value&&(le(r,{code:J.too_small,minimum:n.minLength.value,type:"array",inclusive:!0,exact:!1,message:n.minLength.message}),s.dirty()),n.maxLength!==null&&r.data.length>n.maxLength.value&&(le(r,{code:J.too_big,maximum:n.maxLength.value,type:"array",inclusive:!0,exact:!1,message:n.maxLength.message}),s.dirty()),r.common.async)return Promise.all([...r.data].map((o,l)=>n.type._parseAsync(new An(r,o,r.path,l)))).then(o=>nr.mergeArray(s,o));const a=[...r.data].map((o,l)=>n.type._parseSync(new An(r,o,r.path,l)));return nr.mergeArray(s,a)}get element(){return this._def.type}min(e,r){return new Rn({...this._def,minLength:{value:e,message:ye.toString(r)}})}max(e,r){return new Rn({...this._def,maxLength:{value:e,message:ye.toString(r)}})}length(e,r){return new Rn({...this._def,exactLength:{value:e,message:ye.toString(r)}})}nonempty(e){return this.min(1,e)}}Rn.create=(t,e)=>new Rn({type:t,minLength:null,maxLength:null,exactLength:null,typeName:ke.ZodArray,...Fe(e)});function mo(t){if(t instanceof kt){const e={};for(const r in t.shape){const s=t.shape[r];e[r]=ts.create(mo(s))}return new kt({...t._def,shape:()=>e})}else return t instanceof Rn?new Rn({...t._def,type:mo(t.element)}):t instanceof ts?ts.create(mo(t.unwrap())):t instanceof to?to.create(mo(t.unwrap())):t instanceof Ja?Ja.create(t.items.map(e=>mo(e))):t}class kt extends Be{constructor(){super(...arguments),this._cached=null,this.nonstrict=this.passthrough,this.augment=this.extend}_getCached(){if(this._cached!==null)return this._cached;const e=this._def.shape(),r=Ge.objectKeys(e);return this._cached={shape:e,keys:r},this._cached}_parse(e){if(this._getType(e)!==pe.object){const u=this._getOrReturnCtx(e);return le(u,{code:J.invalid_type,expected:pe.object,received:u.parsedType}),Ce}const{status:s,ctx:n}=this._processInputParams(e),{shape:a,keys:o}=this._getCached(),l=[];if(!(this._def.catchall instanceof ia&&this._def.unknownKeys==="strip"))for(const u in n.data)o.includes(u)||l.push(u);const c=[];for(const u of o){const d=a[u],f=n.data[u];c.push({key:{status:"valid",value:u},value:d._parse(new An(n,f,n.path,u)),alwaysSet:u in n.data})}if(this._def.catchall instanceof ia){const u=this._def.unknownKeys;if(u==="passthrough")for(const d of l)c.push({key:{status:"valid",value:d},value:{status:"valid",value:n.data[d]}});else if(u==="strict")l.length>0&&(le(n,{code:J.unrecognized_keys,keys:l}),s.dirty());else if(u!=="strip")throw new Error("Internal ZodObject error: invalid unknownKeys value.")}else{const u=this._def.catchall;for(const d of l){const f=n.data[d];c.push({key:{status:"valid",value:d},value:u._parse(new An(n,f,n.path,d)),alwaysSet:d in n.data})}}return n.common.async?Promise.resolve().then(async()=>{const u=[];for(const d of c){const f=await d.key,m=await d.value;u.push({key:f,value:m,alwaysSet:d.alwaysSet})}return u}).then(u=>nr.mergeObjectSync(s,u)):nr.mergeObjectSync(s,c)}get shape(){return this._def.shape()}strict(e){return ye.errToObj,new kt({...this._def,unknownKeys:"strict",...e!==void 0?{errorMap:(r,s)=>{var a,o;const n=((o=(a=this._def).errorMap)==null?void 0:o.call(a,r,s).message)??s.defaultError;return r.code==="unrecognized_keys"?{message:ye.errToObj(e).message??n}:{message:n}}}:{}})}strip(){return new kt({...this._def,unknownKeys:"strip"})}passthrough(){return new kt({...this._def,unknownKeys:"passthrough"})}extend(e){return new kt({...this._def,shape:()=>({...this._def.shape(),...e})})}merge(e){return new kt({unknownKeys:e._def.unknownKeys,catchall:e._def.catchall,shape:()=>({...this._def.shape(),...e._def.shape()}),typeName:ke.ZodObject})}setKey(e,r){return this.augment({[e]:r})}catchall(e){return new kt({...this._def,catchall:e})}pick(e){const r={};for(const s of Ge.objectKeys(e))e[s]&&this.shape[s]&&(r[s]=this.shape[s]);return new kt({...this._def,shape:()=>r})}omit(e){const r={};for(const s of Ge.objectKeys(this.shape))e[s]||(r[s]=this.shape[s]);return new kt({...this._def,shape:()=>r})}deepPartial(){return mo(this)}partial(e){const r={};for(const s of Ge.objectKeys(this.shape)){const n=this.shape[s];e&&!e[s]?r[s]=n:r[s]=n.optional()}return new kt({...this._def,shape:()=>r})}required(e){const r={};for(const s of Ge.objectKeys(this.shape))if(e&&!e[s])r[s]=this.shape[s];else{let a=this.shape[s];for(;a instanceof ts;)a=a._def.innerType;r[s]=a}return new kt({...this._def,shape:()=>r})}keyof(){return kE(Ge.objectKeys(this.shape))}}kt.create=(t,e)=>new kt({shape:()=>t,unknownKeys:"strip",catchall:ia.create(),typeName:ke.ZodObject,...Fe(e)});kt.strictCreate=(t,e)=>new kt({shape:()=>t,unknownKeys:"strict",catchall:ia.create(),typeName:ke.ZodObject,...Fe(e)});kt.lazycreate=(t,e)=>new kt({shape:t,unknownKeys:"strip",catchall:ia.create(),typeName:ke.ZodObject,...Fe(e)});class Hu extends Be{_parse(e){const{ctx:r}=this._processInputParams(e),s=this._def.options;function n(a){for(const l of a)if(l.result.status==="valid")return l.result;for(const l of a)if(l.result.status==="dirty")return r.common.issues.push(...l.ctx.common.issues),l.result;const o=a.map(l=>new cs(l.ctx.common.issues));return le(r,{code:J.invalid_union,unionErrors:o}),Ce}if(r.common.async)return Promise.all(s.map(async a=>{const o={...r,common:{...r.common,issues:[]},parent:null};return{result:await a._parseAsync({data:r.data,path:r.path,parent:o}),ctx:o}})).then(n);{let a;const o=[];for(const c of s){const u={...r,common:{...r.common,issues:[]},parent:null},d=c._parseSync({data:r.data,path:r.path,parent:u});if(d.status==="valid")return d;d.status==="dirty"&&!a&&(a={result:d,ctx:u}),u.common.issues.length&&o.push(u.common.issues)}if(a)return r.common.issues.push(...a.ctx.common.issues),a.result;const l=o.map(c=>new cs(c));return le(r,{code:J.invalid_union,unionErrors:l}),Ce}}get options(){return this._def.options}}Hu.create=(t,e)=>new Hu({options:t,typeName:ke.ZodUnion,...Fe(e)});const Vn=t=>t instanceof Fp?Vn(t.schema):t instanceof eo?Vn(t.innerType()):t instanceof Ku?[t.value]:t instanceof Xa?t.options:t instanceof Lp?Ge.objectValues(t.enum):t instanceof Gu?Vn(t._def.innerType):t instanceof Op?[void 0]:t instanceof Ip?[null]:t instanceof ts?[void 0,...Vn(t.unwrap())]:t instanceof to?[null,...Vn(t.unwrap())]:t instanceof PE||t instanceof Yu?Vn(t.unwrap()):t instanceof Zu?Vn(t._def.innerType):[];class Wv extends Be{_parse(e){const{ctx:r}=this._processInputParams(e);if(r.parsedType!==pe.object)return le(r,{code:J.invalid_type,expected:pe.object,received:r.parsedType}),Ce;const s=this.discriminator,n=r.data[s],a=this.optionsMap.get(n);return a?r.common.async?a._parseAsync({data:r.data,path:r.path,parent:r}):a._parseSync({data:r.data,path:r.path,parent:r}):(le(r,{code:J.invalid_union_discriminator,options:Array.from(this.optionsMap.keys()),path:[s]}),Ce)}get discriminator(){return this._def.discriminator}get options(){return this._def.options}get optionsMap(){return this._def.optionsMap}static create(e,r,s){const n=new Map;for(const a of r){const o=Vn(a.shape[e]);if(!o.length)throw new Error(`A discriminator value for key \`${e}\` could not be extracted from all schema options`);for(const l of o){if(n.has(l))throw new Error(`Discriminator property ${String(e)} has duplicate value ${String(l)}`);n.set(l,a)}}return new Wv({typeName:ke.ZodDiscriminatedUnion,discriminator:e,options:r,optionsMap:n,...Fe(s)})}}function $p(t,e){const r=Ps(t),s=Ps(e);if(t===e)return{valid:!0,data:t};if(r===pe.object&&s===pe.object){const n=Ge.objectKeys(e),a=Ge.objectKeys(t).filter(l=>n.indexOf(l)!==-1),o={...t,...e};for(const l of a){const c=$p(t[l],e[l]);if(!c.valid)return{valid:!1};o[l]=c.data}return{valid:!0,data:o}}else if(r===pe.array&&s===pe.array){if(t.length!==e.length)return{valid:!1};const n=[];for(let a=0;a<t.length;a++){const o=t[a],l=e[a],c=$p(o,l);if(!c.valid)return{valid:!1};n.push(c.data)}return{valid:!0,data:n}}else return r===pe.date&&s===pe.date&&+t==+e?{valid:!0,data:t}:{valid:!1}}class Bu extends Be{_parse(e){const{status:r,ctx:s}=this._processInputParams(e),n=(a,o)=>{if(D0(a)||D0(o))return Ce;const l=$p(a.value,o.value);return l.valid?((M0(a)||M0(o))&&r.dirty(),{status:r.value,value:l.data}):(le(s,{code:J.invalid_intersection_types}),Ce)};return s.common.async?Promise.all([this._def.left._parseAsync({data:s.data,path:s.path,parent:s}),this._def.right._parseAsync({data:s.data,path:s.path,parent:s})]).then(([a,o])=>n(a,o)):n(this._def.left._parseSync({data:s.data,path:s.path,parent:s}),this._def.right._parseSync({data:s.data,path:s.path,parent:s}))}}Bu.create=(t,e,r)=>new Bu({left:t,right:e,typeName:ke.ZodIntersection,...Fe(r)});class Ja extends Be{_parse(e){const{status:r,ctx:s}=this._processInputParams(e);if(s.parsedType!==pe.array)return le(s,{code:J.invalid_type,expected:pe.array,received:s.parsedType}),Ce;if(s.data.length<this._def.items.length)return le(s,{code:J.too_small,minimum:this._def.items.length,inclusive:!0,exact:!1,type:"array"}),Ce;!this._def.rest&&s.data.length>this._def.items.length&&(le(s,{code:J.too_big,maximum:this._def.items.length,inclusive:!0,exact:!1,type:"array"}),r.dirty());const a=[...s.data].map((o,l)=>{const c=this._def.items[l]||this._def.rest;return c?c._parse(new An(s,o,s.path,l)):null}).filter(o=>!!o);return s.common.async?Promise.all(a).then(o=>nr.mergeArray(r,o)):nr.mergeArray(r,a)}get items(){return this._def.items}rest(e){return new Ja({...this._def,rest:e})}}Ja.create=(t,e)=>{if(!Array.isArray(t))throw new Error("You must pass an array of schemas to z.tuple([ ... ])");return new Ja({items:t,typeName:ke.ZodTuple,rest:null,...Fe(e)})};class Wu extends Be{get keySchema(){return this._def.keyType}get valueSchema(){return this._def.valueType}_parse(e){const{status:r,ctx:s}=this._processInputParams(e);if(s.parsedType!==pe.object)return le(s,{code:J.invalid_type,expected:pe.object,received:s.parsedType}),Ce;const n=[],a=this._def.keyType,o=this._def.valueType;for(const l in s.data)n.push({key:a._parse(new An(s,l,s.path,l)),value:o._parse(new An(s,s.data[l],s.path,l)),alwaysSet:l in s.data});return s.common.async?nr.mergeObjectAsync(r,n):nr.mergeObjectSync(r,n)}get element(){return this._def.valueType}static create(e,r,s){return r instanceof Be?new Wu({keyType:e,valueType:r,typeName:ke.ZodRecord,...Fe(s)}):new Wu({keyType:Xn.create(),valueType:e,typeName:ke.ZodRecord,...Fe(r)})}}class U0 extends Be{get keySchema(){return this._def.keyType}get valueSchema(){return this._def.valueType}_parse(e){const{status:r,ctx:s}=this._processInputParams(e);if(s.parsedType!==pe.map)return le(s,{code:J.invalid_type,expected:pe.map,received:s.parsedType}),Ce;const n=this._def.keyType,a=this._def.valueType,o=[...s.data.entries()].map(([l,c],u)=>({key:n._parse(new An(s,l,s.path,[u,"key"])),value:a._parse(new An(s,c,s.path,[u,"value"]))}));if(s.common.async){const l=new Map;return Promise.resolve().then(async()=>{for(const c of o){const u=await c.key,d=await c.value;if(u.status==="aborted"||d.status==="aborted")return Ce;(u.status==="dirty"||d.status==="dirty")&&r.dirty(),l.set(u.value,d.value)}return{status:r.value,value:l}})}else{const l=new Map;for(const c of o){const u=c.key,d=c.value;if(u.status==="aborted"||d.status==="aborted")return Ce;(u.status==="dirty"||d.status==="dirty")&&r.dirty(),l.set(u.value,d.value)}return{status:r.value,value:l}}}}U0.create=(t,e,r)=>new U0({valueType:e,keyType:t,typeName:ke.ZodMap,...Fe(r)});class Tl extends Be{_parse(e){const{status:r,ctx:s}=this._processInputParams(e);if(s.parsedType!==pe.set)return le(s,{code:J.invalid_type,expected:pe.set,received:s.parsedType}),Ce;const n=this._def;n.minSize!==null&&s.data.size<n.minSize.value&&(le(s,{code:J.too_small,minimum:n.minSize.value,type:"set",inclusive:!0,exact:!1,message:n.minSize.message}),r.dirty()),n.maxSize!==null&&s.data.size>n.maxSize.value&&(le(s,{code:J.too_big,maximum:n.maxSize.value,type:"set",inclusive:!0,exact:!1,message:n.maxSize.message}),r.dirty());const a=this._def.valueType;function o(c){const u=new Set;for(const d of c){if(d.status==="aborted")return Ce;d.status==="dirty"&&r.dirty(),u.add(d.value)}return{status:r.value,value:u}}const l=[...s.data.values()].map((c,u)=>a._parse(new An(s,c,s.path,u)));return s.common.async?Promise.all(l).then(c=>o(c)):o(l)}min(e,r){return new Tl({...this._def,minSize:{value:e,message:ye.toString(r)}})}max(e,r){return new Tl({...this._def,maxSize:{value:e,message:ye.toString(r)}})}size(e,r){return this.min(e,r).max(e,r)}nonempty(e){return this.min(1,e)}}Tl.create=(t,e)=>new Tl({valueType:t,minSize:null,maxSize:null,typeName:ke.ZodSet,...Fe(e)});class Fp extends Be{get schema(){return this._def.getter()}_parse(e){const{ctx:r}=this._processInputParams(e);return this._def.getter()._parse({data:r.data,path:r.path,parent:r})}}Fp.create=(t,e)=>new Fp({getter:t,typeName:ke.ZodLazy,...Fe(e)});class Ku extends Be{_parse(e){if(e.data!==this._def.value){const r=this._getOrReturnCtx(e);return le(r,{received:r.data,code:J.invalid_literal,expected:this._def.value}),Ce}return{status:"valid",value:e.data}}get value(){return this._def.value}}Ku.create=(t,e)=>new Ku({value:t,typeName:ke.ZodLiteral,...Fe(e)});function kE(t,e){return new Xa({values:t,typeName:ke.ZodEnum,...Fe(e)})}class Xa extends Be{_parse(e){if(typeof e.data!="string"){const r=this._getOrReturnCtx(e),s=this._def.values;return le(r,{expected:Ge.joinValues(s),received:r.parsedType,code:J.invalid_type}),Ce}if(this._cache||(this._cache=new Set(this._def.values)),!this._cache.has(e.data)){const r=this._getOrReturnCtx(e),s=this._def.values;return le(r,{received:r.data,code:J.invalid_enum_value,options:s}),Ce}return zr(e.data)}get options(){return this._def.values}get enum(){const e={};for(const r of this._def.values)e[r]=r;return e}get Values(){const e={};for(const r of this._def.values)e[r]=r;return e}get Enum(){const e={};for(const r of this._def.values)e[r]=r;return e}extract(e,r=this._def){return Xa.create(e,{...this._def,...r})}exclude(e,r=this._def){return Xa.create(this.options.filter(s=>!e.includes(s)),{...this._def,...r})}}Xa.create=kE;class Lp extends Be{_parse(e){const r=Ge.getValidEnumValues(this._def.values),s=this._getOrReturnCtx(e);if(s.parsedType!==pe.string&&s.parsedType!==pe.number){const n=Ge.objectValues(r);return le(s,{expected:Ge.joinValues(n),received:s.parsedType,code:J.invalid_type}),Ce}if(this._cache||(this._cache=new Set(Ge.getValidEnumValues(this._def.values))),!this._cache.has(e.data)){const n=Ge.objectValues(r);return le(s,{received:s.data,code:J.invalid_enum_value,options:n}),Ce}return zr(e.data)}get enum(){return this._def.values}}Lp.create=(t,e)=>new Lp({values:t,typeName:ke.ZodNativeEnum,...Fe(e)});class Qu extends Be{unwrap(){return this._def.type}_parse(e){const{ctx:r}=this._processInputParams(e);if(r.parsedType!==pe.promise&&r.common.async===!1)return le(r,{code:J.invalid_type,expected:pe.promise,received:r.parsedType}),Ce;const s=r.parsedType===pe.promise?r.data:Promise.resolve(r.data);return zr(s.then(n=>this._def.type.parseAsync(n,{path:r.path,errorMap:r.common.contextualErrorMap})))}}Qu.create=(t,e)=>new Qu({type:t,typeName:ke.ZodPromise,...Fe(e)});class eo extends Be{innerType(){return this._def.schema}sourceType(){return this._def.schema._def.typeName===ke.ZodEffects?this._def.schema.sourceType():this._def.schema}_parse(e){const{status:r,ctx:s}=this._processInputParams(e),n=this._def.effect||null,a={addIssue:o=>{le(s,o),o.fatal?r.abort():r.dirty()},get path(){return s.path}};if(a.addIssue=a.addIssue.bind(a),n.type==="preprocess"){const o=n.transform(s.data,a);if(s.common.async)return Promise.resolve(o).then(async l=>{if(r.value==="aborted")return Ce;const c=await this._def.schema._parseAsync({data:l,path:s.path,parent:s});return c.status==="aborted"?Ce:c.status==="dirty"||r.value==="dirty"?Qi(c.value):c});{if(r.value==="aborted")return Ce;const l=this._def.schema._parseSync({data:o,path:s.path,parent:s});return l.status==="aborted"?Ce:l.status==="dirty"||r.value==="dirty"?Qi(l.value):l}}if(n.type==="refinement"){const o=l=>{const c=n.refinement(l,a);if(s.common.async)return Promise.resolve(c);if(c instanceof Promise)throw new Error("Async refinement encountered during synchronous parse operation. Use .parseAsync instead.");return l};if(s.common.async===!1){const l=this._def.schema._parseSync({data:s.data,path:s.path,parent:s});return l.status==="aborted"?Ce:(l.status==="dirty"&&r.dirty(),o(l.value),{status:r.value,value:l.value})}else return this._def.schema._parseAsync({data:s.data,path:s.path,parent:s}).then(l=>l.status==="aborted"?Ce:(l.status==="dirty"&&r.dirty(),o(l.value).then(()=>({status:r.value,value:l.value}))))}if(n.type==="transform")if(s.common.async===!1){const o=this._def.schema._parseSync({data:s.data,path:s.path,parent:s});if(!mi(o))return Ce;const l=n.transform(o.value,a);if(l instanceof Promise)throw new Error("Asynchronous transform encountered during synchronous parse operation. Use .parseAsync instead.");return{status:r.value,value:l}}else return this._def.schema._parseAsync({data:s.data,path:s.path,parent:s}).then(o=>mi(o)?Promise.resolve(n.transform(o.value,a)).then(l=>({status:r.value,value:l})):Ce);Ge.assertNever(n)}}eo.create=(t,e,r)=>new eo({schema:t,typeName:ke.ZodEffects,effect:e,...Fe(r)});eo.createWithPreprocess=(t,e,r)=>new eo({schema:e,effect:{type:"preprocess",transform:t},typeName:ke.ZodEffects,...Fe(r)});class ts extends Be{_parse(e){return this._getType(e)===pe.undefined?zr(void 0):this._def.innerType._parse(e)}unwrap(){return this._def.innerType}}ts.create=(t,e)=>new ts({innerType:t,typeName:ke.ZodOptional,...Fe(e)});class to extends Be{_parse(e){return this._getType(e)===pe.null?zr(null):this._def.innerType._parse(e)}unwrap(){return this._def.innerType}}to.create=(t,e)=>new to({innerType:t,typeName:ke.ZodNullable,...Fe(e)});class Gu extends Be{_parse(e){const{ctx:r}=this._processInputParams(e);let s=r.data;return r.parsedType===pe.undefined&&(s=this._def.defaultValue()),this._def.innerType._parse({data:s,path:r.path,parent:r})}removeDefault(){return this._def.innerType}}Gu.create=(t,e)=>new Gu({innerType:t,typeName:ke.ZodDefault,defaultValue:typeof e.default=="function"?e.default:()=>e.default,...Fe(e)});class Zu extends Be{_parse(e){const{ctx:r}=this._processInputParams(e),s={...r,common:{...r.common,issues:[]}},n=this._def.innerType._parse({data:s.data,path:s.path,parent:{...s}});return Vu(n)?n.then(a=>({status:"valid",value:a.status==="valid"?a.value:this._def.catchValue({get error(){return new cs(s.common.issues)},input:s.data})})):{status:"valid",value:n.status==="valid"?n.value:this._def.catchValue({get error(){return new cs(s.common.issues)},input:s.data})}}removeCatch(){return this._def.innerType}}Zu.create=(t,e)=>new Zu({innerType:t,typeName:ke.ZodCatch,catchValue:typeof e.catch=="function"?e.catch:()=>e.catch,...Fe(e)});class z0 extends Be{_parse(e){if(this._getType(e)!==pe.nan){const s=this._getOrReturnCtx(e);return le(s,{code:J.invalid_type,expected:pe.nan,received:s.parsedType}),Ce}return{status:"valid",value:e.data}}}z0.create=t=>new z0({typeName:ke.ZodNaN,...Fe(t)});class PE extends Be{_parse(e){const{ctx:r}=this._processInputParams(e),s=r.data;return this._def.type._parse({data:s,path:r.path,parent:r})}unwrap(){return this._def.type}}class Kv extends Be{_parse(e){const{status:r,ctx:s}=this._processInputParams(e);if(s.common.async)return(async()=>{const a=await this._def.in._parseAsync({data:s.data,path:s.path,parent:s});return a.status==="aborted"?Ce:a.status==="dirty"?(r.dirty(),Qi(a.value)):this._def.out._parseAsync({data:a.value,path:s.path,parent:s})})();{const n=this._def.in._parseSync({data:s.data,path:s.path,parent:s});return n.status==="aborted"?Ce:n.status==="dirty"?(r.dirty(),{status:"dirty",value:n.value}):this._def.out._parseSync({data:n.value,path:s.path,parent:s})}}static create(e,r){return new Kv({in:e,out:r,typeName:ke.ZodPipeline})}}class Yu extends Be{_parse(e){const r=this._def.innerType._parse(e),s=n=>(mi(n)&&(n.value=Object.freeze(n.value)),n);return Vu(r)?r.then(n=>s(n)):s(r)}unwrap(){return this._def.innerType}}Yu.create=(t,e)=>new Yu({innerType:t,typeName:ke.ZodReadonly,...Fe(e)});var ke;(function(t){t.ZodString="ZodString",t.ZodNumber="ZodNumber",t.ZodNaN="ZodNaN",t.ZodBigInt="ZodBigInt",t.ZodBoolean="ZodBoolean",t.ZodDate="ZodDate",t.ZodSymbol="ZodSymbol",t.ZodUndefined="ZodUndefined",t.ZodNull="ZodNull",t.ZodAny="ZodAny",t.ZodUnknown="ZodUnknown",t.ZodNever="ZodNever",t.ZodVoid="ZodVoid",t.ZodArray="ZodArray",t.ZodObject="ZodObject",t.ZodUnion="ZodUnion",t.ZodDiscriminatedUnion="ZodDiscriminatedUnion",t.ZodIntersection="ZodIntersection",t.ZodTuple="ZodTuple",t.ZodRecord="ZodRecord",t.ZodMap="ZodMap",t.ZodSet="ZodSet",t.ZodFunction="ZodFunction",t.ZodLazy="ZodLazy",t.ZodLiteral="ZodLiteral",t.ZodEnum="ZodEnum",t.ZodEffects="ZodEffects",t.ZodNativeEnum="ZodNativeEnum",t.ZodOptional="ZodOptional",t.ZodNullable="ZodNullable",t.ZodDefault="ZodDefault",t.ZodCatch="ZodCatch",t.ZodPromise="ZodPromise",t.ZodBranded="ZodBranded",t.ZodPipeline="ZodPipeline",t.ZodReadonly="ZodReadonly"})(ke||(ke={}));const q=Xn.create,Ut=vi.create,It=Ap.create,g4=Dp.create,Wl=Mp.create;ia.create;const ge=Rn.create,ie=kt.create,ir=Hu.create,y4=Wv.create;Bu.create;Ja.create;const Kl=Wu.create,Ie=Ku.create,us=Xa.create;Qu.create;const G=ts.create;to.create;const x4=Ce,Wd="2025-06-18",w4=[Wd,"2025-03-26","2024-11-05","2024-10-07"],Kd="2.0",NE=ir([q(),Ut().int()]),jE=q(),b4=ie({progressToken:G(NE)}).passthrough(),Vr=ie({_meta:G(b4)}).passthrough(),xr=ie({method:q(),params:G(Vr)}),Ql=ie({_meta:G(ie({}).passthrough())}).passthrough(),In=ie({method:q(),params:G(Ql)}),qr=ie({_meta:G(ie({}).passthrough())}).passthrough(),Qd=ir([q(),Ut().int()]),RE=ie({jsonrpc:Ie(Kd),id:Qd}).merge(xr).strict(),TE=t=>RE.safeParse(t).success,AE=ie({jsonrpc:Ie(Kd)}).merge(In).strict(),S4=t=>AE.safeParse(t).success,OE=ie({jsonrpc:Ie(Kd),id:Qd,result:qr}).strict(),Up=t=>OE.safeParse(t).success;var En;(function(t){t[t.ConnectionClosed=-32e3]="ConnectionClosed",t[t.RequestTimeout=-32001]="RequestTimeout",t[t.ParseError=-32700]="ParseError",t[t.InvalidRequest=-32600]="InvalidRequest",t[t.MethodNotFound=-32601]="MethodNotFound",t[t.InvalidParams=-32602]="InvalidParams",t[t.InternalError=-32603]="InternalError"})(En||(En={}));const IE=ie({jsonrpc:Ie(Kd),id:Qd,error:ie({code:Ut().int(),message:q(),data:G(Wl())})}).strict(),_4=t=>IE.safeParse(t).success,ru=ir([RE,AE,OE,IE]),Ao=qr.strict(),Qv=In.extend({method:Ie("notifications/cancelled"),params:Ql.extend({requestId:Qd,reason:q().optional()})}),Gl=ie({name:q(),title:G(q())}).passthrough(),DE=Gl.extend({version:q()}),E4=ie({experimental:G(ie({}).passthrough()),sampling:G(ie({}).passthrough()),elicitation:G(ie({}).passthrough()),roots:G(ie({listChanged:G(It())}).passthrough())}).passthrough(),C4=xr.extend({method:Ie("initialize"),params:Vr.extend({protocolVersion:q(),capabilities:E4,clientInfo:DE})}),k4=ie({experimental:G(ie({}).passthrough()),logging:G(ie({}).passthrough()),completions:G(ie({}).passthrough()),prompts:G(ie({listChanged:G(It())}).passthrough()),resources:G(ie({subscribe:G(It()),listChanged:G(It())}).passthrough()),tools:G(ie({listChanged:G(It())}).passthrough())}).passthrough(),ME=qr.extend({protocolVersion:q(),capabilities:k4,serverInfo:DE,instructions:G(q())}),$E=In.extend({method:Ie("notifications/initialized")}),P4=t=>$E.safeParse(t).success,Gv=xr.extend({method:Ie("ping")}),N4=ie({progress:Ut(),total:G(Ut()),message:G(q())}).passthrough(),Zv=In.extend({method:Ie("notifications/progress"),params:Ql.merge(N4).extend({progressToken:NE})}),Gd=xr.extend({params:Vr.extend({cursor:G(jE)}).optional()}),Zd=qr.extend({nextCursor:G(jE)}),FE=ie({uri:q(),mimeType:G(q()),_meta:G(ie({}).passthrough())}).passthrough(),LE=FE.extend({text:q()}),Yv=q().refine(t=>{try{return atob(t),!0}catch{return!1}},{message:"Invalid Base64 string"}),UE=FE.extend({blob:Yv}),zE=Gl.extend({uri:q(),description:G(q()),mimeType:G(q()),_meta:G(ie({}).passthrough())}),j4=Gl.extend({uriTemplate:q(),description:G(q()),mimeType:G(q()),_meta:G(ie({}).passthrough())}),R4=Gd.extend({method:Ie("resources/list")}),Ju=Zd.extend({resources:ge(zE)}),T4=Gd.extend({method:Ie("resources/templates/list")}),VE=Zd.extend({resourceTemplates:ge(j4)}),A4=xr.extend({method:Ie("resources/read"),params:Vr.extend({uri:q()})}),Jv=qr.extend({contents:ge(ir([LE,UE]))}),O4=In.extend({method:Ie("notifications/resources/list_changed")}),I4=xr.extend({method:Ie("resources/subscribe"),params:Vr.extend({uri:q()})}),D4=xr.extend({method:Ie("resources/unsubscribe"),params:Vr.extend({uri:q()})}),M4=In.extend({method:Ie("notifications/resources/updated"),params:Ql.extend({uri:q()})}),$4=ie({name:q(),description:G(q()),required:G(It())}).passthrough(),F4=Gl.extend({description:G(q()),arguments:G(ge($4)),_meta:G(ie({}).passthrough())}),L4=Gd.extend({method:Ie("prompts/list")}),Xu=Zd.extend({prompts:ge(F4)}),U4=xr.extend({method:Ie("prompts/get"),params:Vr.extend({name:q(),arguments:G(Kl(q()))})}),Xv=ie({type:Ie("text"),text:q(),_meta:G(ie({}).passthrough())}).passthrough(),eg=ie({type:Ie("image"),data:Yv,mimeType:q(),_meta:G(ie({}).passthrough())}).passthrough(),tg=ie({type:Ie("audio"),data:Yv,mimeType:q(),_meta:G(ie({}).passthrough())}).passthrough(),z4=ie({type:Ie("resource"),resource:ir([LE,UE]),_meta:G(ie({}).passthrough())}).passthrough(),V4=zE.extend({type:Ie("resource_link")}),qE=ir([Xv,eg,tg,V4,z4]),q4=ie({role:us(["user","assistant"]),content:qE}).passthrough(),rg=qr.extend({description:G(q()),messages:ge(q4)}),H4=In.extend({method:Ie("notifications/prompts/list_changed")}),B4=ie({title:G(q()),readOnlyHint:G(It()),destructiveHint:G(It()),idempotentHint:G(It()),openWorldHint:G(It())}).passthrough(),W4=Gl.extend({description:G(q()),inputSchema:ie({type:Ie("object"),properties:G(ie({}).passthrough()),required:G(ge(q()))}).passthrough(),outputSchema:G(ie({type:Ie("object"),properties:G(ie({}).passthrough()),required:G(ge(q()))}).passthrough()),annotations:G(B4),_meta:G(ie({}).passthrough())}),K4=Gd.extend({method:Ie("tools/list")}),ng=Zd.extend({tools:ge(W4)}),Yd=qr.extend({content:ge(qE).default([]),structuredContent:ie({}).passthrough().optional(),isError:G(It())});Yd.or(qr.extend({toolResult:Wl()}));const Q4=xr.extend({method:Ie("tools/call"),params:Vr.extend({name:q(),arguments:G(Kl(Wl()))})}),G4=In.extend({method:Ie("notifications/tools/list_changed")}),HE=us(["debug","info","notice","warning","error","critical","alert","emergency"]),Z4=xr.extend({method:Ie("logging/setLevel"),params:Vr.extend({level:HE})}),Y4=In.extend({method:Ie("notifications/message"),params:Ql.extend({level:HE,logger:G(q()),data:Wl()})}),J4=ie({name:q().optional()}).passthrough(),X4=ie({hints:G(ge(J4)),costPriority:G(Ut().min(0).max(1)),speedPriority:G(Ut().min(0).max(1)),intelligencePriority:G(Ut().min(0).max(1))}).passthrough(),eD=ie({role:us(["user","assistant"]),content:ir([Xv,eg,tg])}).passthrough(),tD=xr.extend({method:Ie("sampling/createMessage"),params:Vr.extend({messages:ge(eD),systemPrompt:G(q()),includeContext:G(us(["none","thisServer","allServers"])),temperature:G(Ut()),maxTokens:Ut().int(),stopSequences:G(ge(q())),metadata:G(ie({}).passthrough()),modelPreferences:G(X4)})}),rD=qr.extend({model:q(),stopReason:G(us(["endTurn","stopSequence","maxTokens"]).or(q())),role:us(["user","assistant"]),content:y4("type",[Xv,eg,tg])}),nD=ie({type:Ie("boolean"),title:G(q()),description:G(q()),default:G(It())}).passthrough(),sD=ie({type:Ie("string"),title:G(q()),description:G(q()),minLength:G(Ut()),maxLength:G(Ut()),format:G(us(["email","uri","date","date-time"]))}).passthrough(),aD=ie({type:us(["number","integer"]),title:G(q()),description:G(q()),minimum:G(Ut()),maximum:G(Ut())}).passthrough(),oD=ie({type:Ie("string"),title:G(q()),description:G(q()),enum:ge(q()),enumNames:G(ge(q()))}).passthrough(),iD=ir([nD,sD,aD,oD]),lD=xr.extend({method:Ie("elicitation/create"),params:Vr.extend({message:q(),requestedSchema:ie({type:Ie("object"),properties:Kl(q(),iD),required:G(ge(q()))}).passthrough()})}),cD=qr.extend({action:us(["accept","decline","cancel"]),content:G(Kl(q(),Wl()))}),uD=ie({type:Ie("ref/resource"),uri:q()}).passthrough(),dD=ie({type:Ie("ref/prompt"),name:q()}).passthrough(),fD=xr.extend({method:Ie("completion/complete"),params:Vr.extend({ref:ir([dD,uD]),argument:ie({name:q(),value:q()}).passthrough(),context:G(ie({arguments:G(Kl(q(),q()))}))})}),BE=qr.extend({completion:ie({values:ge(q()).max(100),total:G(Ut().int()),hasMore:G(It())}).passthrough()}),hD=ie({uri:q().startsWith("file://"),name:G(q()),_meta:G(ie({}).passthrough())}).passthrough(),pD=xr.extend({method:Ie("roots/list")}),mD=qr.extend({roots:ge(hD)}),vD=In.extend({method:Ie("notifications/roots/list_changed")});ir([Gv,C4,fD,Z4,U4,L4,R4,T4,A4,I4,D4,Q4,K4]);ir([Qv,Zv,$E,vD]);ir([Ao,rD,cD,mD]);ir([Gv,tD,lD,pD]);ir([Qv,Zv,Y4,M4,O4,G4,H4]);ir([Ao,ME,BE,rg,Xu,Ju,VE,Jv,Yd,ng]);class qs extends Error{constructor(e,r,s){super(`MCP error ${e}: ${r}`),this.code=e,this.data=s,this.name="McpError"}}class V0 extends Error{constructor(e,r){super(e),this.name="ParseError",this.type=r.type,this.field=r.field,this.value=r.value,this.line=r.line}}function Jf(t){}function WE(t){if(typeof t=="function")throw new TypeError("`callbacks` must be an object, got a function instead. Did you mean `{onEvent: fn}`?");const{onEvent:e=Jf,onError:r=Jf,onRetry:s=Jf,onComment:n}=t;let a="",o=!0,l,c="",u="";function d(h){const g=o?h.replace(/^\xEF\xBB\xBF/,""):h,[v,y]=gD(`${a}${g}`);for(const b of v)f(b);a=y,o=!1}function f(h){if(h===""){p();return}if(h.startsWith(":")){n&&n(h.slice(h.startsWith(": ")?2:1));return}const g=h.indexOf(":");if(g!==-1){const v=h.slice(0,g),y=h[g+1]===" "?2:1,b=h.slice(g+y);m(v,b,h);return}m(h,"",h)}function m(h,g,v){switch(h){case"event":u=g;break;case"data":c=`${c}${g}
|
|
369
|
+
`;break;case"id":l=g.includes("\0")?void 0:g;break;case"retry":/^\d+$/.test(g)?s(parseInt(g,10)):r(new V0(`Invalid \`retry\` value: "${g}"`,{type:"invalid-retry",value:g,line:v}));break;default:r(new V0(`Unknown field "${h.length>20?`${h.slice(0,20)}…`:h}"`,{type:"unknown-field",field:h,value:g,line:v}));break}}function p(){c.length>0&&e({id:l,event:u||void 0,data:c.endsWith(`
|
|
370
|
+
`)?c.slice(0,-1):c}),l=void 0,c="",u=""}function w(h={}){a&&h.consume&&f(a),o=!0,l=void 0,c="",u="",a=""}return{feed:d,reset:w}}function gD(t){const e=[];let r="",s=0;for(;s<t.length;){const n=t.indexOf("\r",s),a=t.indexOf(`
|
|
371
|
+
`,s);let o=-1;if(n!==-1&&a!==-1?o=Math.min(n,a):n!==-1?n===t.length-1?o=-1:o=n:a!==-1&&(o=a),o===-1){r=t.slice(s);break}else{const l=t.slice(s,o);e.push(l),s=o+1,t[s-1]==="\r"&&t[s]===`
|
|
372
|
+
`&&s++}}return[e,r]}class q0 extends Event{constructor(e,r){var s,n;super(e),this.code=(s=r==null?void 0:r.code)!=null?s:void 0,this.message=(n=r==null?void 0:r.message)!=null?n:void 0}[Symbol.for("nodejs.util.inspect.custom")](e,r,s){return s(H0(this),r)}[Symbol.for("Deno.customInspect")](e,r){return e(H0(this),r)}}function yD(t){const e=globalThis.DOMException;return typeof e=="function"?new e(t,"SyntaxError"):new SyntaxError(t)}function zp(t){return t instanceof Error?"errors"in t&&Array.isArray(t.errors)?t.errors.map(zp).join(", "):"cause"in t&&t.cause instanceof Error?`${t}: ${zp(t.cause)}`:t.message:`${t}`}function H0(t){return{type:t.type,message:t.message,code:t.code,defaultPrevented:t.defaultPrevented,cancelable:t.cancelable,timeStamp:t.timeStamp}}var KE=t=>{throw TypeError(t)},sg=(t,e,r)=>e.has(t)||KE("Cannot "+r),Ve=(t,e,r)=>(sg(t,e,"read from private field"),r?r.call(t):e.get(t)),jt=(t,e,r)=>e.has(t)?KE("Cannot add the same private member more than once"):e instanceof WeakSet?e.add(t):e.set(t,r),ft=(t,e,r,s)=>(sg(t,e,"write to private field"),e.set(t,r),r),qn=(t,e,r)=>(sg(t,e,"access private method"),r),dr,Ca,vo,nu,ed,ll,Oo,cl,Rs,go,Ho,yo,Gi,Gr,Vp,qp,Hp,B0,Bp,Wp,Zi,Kp,Qp;class su extends EventTarget{constructor(e,r){var s,n;super(),jt(this,Gr),this.CONNECTING=0,this.OPEN=1,this.CLOSED=2,jt(this,dr),jt(this,Ca),jt(this,vo),jt(this,nu),jt(this,ed),jt(this,ll),jt(this,Oo),jt(this,cl,null),jt(this,Rs),jt(this,go),jt(this,Ho,null),jt(this,yo,null),jt(this,Gi,null),jt(this,qp,async a=>{var o;Ve(this,go).reset();const{body:l,redirected:c,status:u,headers:d}=a;if(u===204){qn(this,Gr,Zi).call(this,"Server sent HTTP 204, not reconnecting",204),this.close();return}if(c?ft(this,vo,new URL(a.url)):ft(this,vo,void 0),u!==200){qn(this,Gr,Zi).call(this,`Non-200 status code (${u})`,u);return}if(!(d.get("content-type")||"").startsWith("text/event-stream")){qn(this,Gr,Zi).call(this,'Invalid content type, expected "text/event-stream"',u);return}if(Ve(this,dr)===this.CLOSED)return;ft(this,dr,this.OPEN);const f=new Event("open");if((o=Ve(this,Gi))==null||o.call(this,f),this.dispatchEvent(f),typeof l!="object"||!l||!("getReader"in l)){qn(this,Gr,Zi).call(this,"Invalid response body, expected a web ReadableStream",u),this.close();return}const m=new TextDecoder,p=l.getReader();let w=!0;do{const{done:h,value:g}=await p.read();g&&Ve(this,go).feed(m.decode(g,{stream:!h})),h&&(w=!1,Ve(this,go).reset(),qn(this,Gr,Kp).call(this))}while(w)}),jt(this,Hp,a=>{ft(this,Rs,void 0),!(a.name==="AbortError"||a.type==="aborted")&&qn(this,Gr,Kp).call(this,zp(a))}),jt(this,Bp,a=>{typeof a.id=="string"&&ft(this,cl,a.id);const o=new MessageEvent(a.event||"message",{data:a.data,origin:Ve(this,vo)?Ve(this,vo).origin:Ve(this,Ca).origin,lastEventId:a.id||""});Ve(this,yo)&&(!a.event||a.event==="message")&&Ve(this,yo).call(this,o),this.dispatchEvent(o)}),jt(this,Wp,a=>{ft(this,ll,a)}),jt(this,Qp,()=>{ft(this,Oo,void 0),Ve(this,dr)===this.CONNECTING&&qn(this,Gr,Vp).call(this)});try{if(e instanceof URL)ft(this,Ca,e);else if(typeof e=="string")ft(this,Ca,new URL(e,xD()));else throw new Error("Invalid URL")}catch{throw yD("An invalid or illegal string was specified")}ft(this,go,WE({onEvent:Ve(this,Bp),onRetry:Ve(this,Wp)})),ft(this,dr,this.CONNECTING),ft(this,ll,3e3),ft(this,ed,(s=r==null?void 0:r.fetch)!=null?s:globalThis.fetch),ft(this,nu,(n=r==null?void 0:r.withCredentials)!=null?n:!1),qn(this,Gr,Vp).call(this)}get readyState(){return Ve(this,dr)}get url(){return Ve(this,Ca).href}get withCredentials(){return Ve(this,nu)}get onerror(){return Ve(this,Ho)}set onerror(e){ft(this,Ho,e)}get onmessage(){return Ve(this,yo)}set onmessage(e){ft(this,yo,e)}get onopen(){return Ve(this,Gi)}set onopen(e){ft(this,Gi,e)}addEventListener(e,r,s){const n=r;super.addEventListener(e,n,s)}removeEventListener(e,r,s){const n=r;super.removeEventListener(e,n,s)}close(){Ve(this,Oo)&&clearTimeout(Ve(this,Oo)),Ve(this,dr)!==this.CLOSED&&(Ve(this,Rs)&&Ve(this,Rs).abort(),ft(this,dr,this.CLOSED),ft(this,Rs,void 0))}}dr=new WeakMap,Ca=new WeakMap,vo=new WeakMap,nu=new WeakMap,ed=new WeakMap,ll=new WeakMap,Oo=new WeakMap,cl=new WeakMap,Rs=new WeakMap,go=new WeakMap,Ho=new WeakMap,yo=new WeakMap,Gi=new WeakMap,Gr=new WeakSet,Vp=function(){ft(this,dr,this.CONNECTING),ft(this,Rs,new AbortController),Ve(this,ed)(Ve(this,Ca),qn(this,Gr,B0).call(this)).then(Ve(this,qp)).catch(Ve(this,Hp))},qp=new WeakMap,Hp=new WeakMap,B0=function(){var t;const e={mode:"cors",redirect:"follow",headers:{Accept:"text/event-stream",...Ve(this,cl)?{"Last-Event-ID":Ve(this,cl)}:void 0},cache:"no-store",signal:(t=Ve(this,Rs))==null?void 0:t.signal};return"window"in globalThis&&(e.credentials=this.withCredentials?"include":"same-origin"),e},Bp=new WeakMap,Wp=new WeakMap,Zi=function(t,e){var r;Ve(this,dr)!==this.CLOSED&&ft(this,dr,this.CLOSED);const s=new q0("error",{code:e,message:t});(r=Ve(this,Ho))==null||r.call(this,s),this.dispatchEvent(s)},Kp=function(t,e){var r;if(Ve(this,dr)===this.CLOSED)return;ft(this,dr,this.CONNECTING);const s=new q0("error",{code:e,message:t});(r=Ve(this,Ho))==null||r.call(this,s),this.dispatchEvent(s),ft(this,Oo,setTimeout(Ve(this,Qp),Ve(this,ll)))},Qp=new WeakMap,su.CONNECTING=0,su.OPEN=1,su.CLOSED=2;function xD(){const t="document"in globalThis?globalThis.document:void 0;return t&&typeof t=="object"&&"baseURI"in t&&typeof t.baseURI=="string"?t.baseURI:void 0}let ag;ag=globalThis.crypto;async function wD(t){return(await ag).getRandomValues(new Uint8Array(t))}async function bD(t){const e="abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ0123456789-._~";let r="";const s=await wD(t);for(let n=0;n<t;n++){const a=s[n]%e.length;r+=e[a]}return r}async function SD(t){return await bD(t)}async function _D(t){const e=await(await ag).subtle.digest("SHA-256",new TextEncoder().encode(t));return btoa(String.fromCharCode(...new Uint8Array(e))).replace(/\//g,"_").replace(/\+/g,"-").replace(/=/g,"")}async function ED(t){if(t||(t=43),t<43||t>128)throw`Expected a length between 43 and 128. Received ${t}.`;const e=await SD(t),r=await _D(e);return{code_verifier:e,code_challenge:r}}const Ft=q().url().superRefine((t,e)=>{if(!URL.canParse(t))return e.addIssue({code:J.custom,message:"URL must be parseable",fatal:!0}),x4}).refine(t=>{const e=new URL(t);return e.protocol!=="javascript:"&&e.protocol!=="data:"&&e.protocol!=="vbscript:"},{message:"URL cannot use javascript:, data:, or vbscript: scheme"}),CD=ie({resource:q().url(),authorization_servers:ge(Ft).optional(),jwks_uri:q().url().optional(),scopes_supported:ge(q()).optional(),bearer_methods_supported:ge(q()).optional(),resource_signing_alg_values_supported:ge(q()).optional(),resource_name:q().optional(),resource_documentation:q().optional(),resource_policy_uri:q().url().optional(),resource_tos_uri:q().url().optional(),tls_client_certificate_bound_access_tokens:It().optional(),authorization_details_types_supported:ge(q()).optional(),dpop_signing_alg_values_supported:ge(q()).optional(),dpop_bound_access_tokens_required:It().optional()}).passthrough(),QE=ie({issuer:q(),authorization_endpoint:Ft,token_endpoint:Ft,registration_endpoint:Ft.optional(),scopes_supported:ge(q()).optional(),response_types_supported:ge(q()),response_modes_supported:ge(q()).optional(),grant_types_supported:ge(q()).optional(),token_endpoint_auth_methods_supported:ge(q()).optional(),token_endpoint_auth_signing_alg_values_supported:ge(q()).optional(),service_documentation:Ft.optional(),revocation_endpoint:Ft.optional(),revocation_endpoint_auth_methods_supported:ge(q()).optional(),revocation_endpoint_auth_signing_alg_values_supported:ge(q()).optional(),introspection_endpoint:q().optional(),introspection_endpoint_auth_methods_supported:ge(q()).optional(),introspection_endpoint_auth_signing_alg_values_supported:ge(q()).optional(),code_challenge_methods_supported:ge(q()).optional()}).passthrough(),kD=ie({issuer:q(),authorization_endpoint:Ft,token_endpoint:Ft,userinfo_endpoint:Ft.optional(),jwks_uri:Ft,registration_endpoint:Ft.optional(),scopes_supported:ge(q()).optional(),response_types_supported:ge(q()),response_modes_supported:ge(q()).optional(),grant_types_supported:ge(q()).optional(),acr_values_supported:ge(q()).optional(),subject_types_supported:ge(q()),id_token_signing_alg_values_supported:ge(q()),id_token_encryption_alg_values_supported:ge(q()).optional(),id_token_encryption_enc_values_supported:ge(q()).optional(),userinfo_signing_alg_values_supported:ge(q()).optional(),userinfo_encryption_alg_values_supported:ge(q()).optional(),userinfo_encryption_enc_values_supported:ge(q()).optional(),request_object_signing_alg_values_supported:ge(q()).optional(),request_object_encryption_alg_values_supported:ge(q()).optional(),request_object_encryption_enc_values_supported:ge(q()).optional(),token_endpoint_auth_methods_supported:ge(q()).optional(),token_endpoint_auth_signing_alg_values_supported:ge(q()).optional(),display_values_supported:ge(q()).optional(),claim_types_supported:ge(q()).optional(),claims_supported:ge(q()).optional(),service_documentation:q().optional(),claims_locales_supported:ge(q()).optional(),ui_locales_supported:ge(q()).optional(),claims_parameter_supported:It().optional(),request_parameter_supported:It().optional(),request_uri_parameter_supported:It().optional(),require_request_uri_registration:It().optional(),op_policy_uri:Ft.optional(),op_tos_uri:Ft.optional()}).passthrough(),PD=kD.merge(QE.pick({code_challenge_methods_supported:!0})),GE=ie({access_token:q(),id_token:q().optional(),token_type:q(),expires_in:Ut().optional(),scope:q().optional(),refresh_token:q().optional()}).strip(),ND=ie({error:q(),error_description:q().optional(),error_uri:q().optional()}),jD=ie({redirect_uris:ge(Ft),token_endpoint_auth_method:q().optional(),grant_types:ge(q()).optional(),response_types:ge(q()).optional(),client_name:q().optional(),client_uri:Ft.optional(),logo_uri:Ft.optional(),scope:q().optional(),contacts:ge(q()).optional(),tos_uri:Ft.optional(),policy_uri:q().optional(),jwks_uri:Ft.optional(),jwks:g4().optional(),software_id:q().optional(),software_version:q().optional(),software_statement:q().optional()}).strip(),RD=ie({client_id:q(),client_secret:q().optional(),client_id_issued_at:Ut().optional(),client_secret_expires_at:Ut().optional()}).strip(),TD=jD.merge(RD);ie({error:q(),error_description:q().optional()}).strip();ie({token:q(),token_type_hint:q().optional()}).strip();function AD(t){const e=typeof t=="string"?new URL(t):new URL(t.href);return e.hash="",e}function OD({requestedResource:t,configuredResource:e}){const r=typeof t=="string"?new URL(t):new URL(t.href),s=typeof e=="string"?new URL(e):new URL(e.href);if(r.origin!==s.origin||r.pathname.length<s.pathname.length)return!1;const n=r.pathname.endsWith("/")?r.pathname:r.pathname+"/",a=s.pathname.endsWith("/")?s.pathname:s.pathname+"/";return n.startsWith(a)}class Wt extends Error{constructor(e,r){super(e),this.errorUri=r,this.name=this.constructor.name}toResponseObject(){const e={error:this.errorCode,error_description:this.message};return this.errorUri&&(e.error_uri=this.errorUri),e}get errorCode(){return this.constructor.errorCode}}class Gp extends Wt{}Gp.errorCode="invalid_request";class td extends Wt{}td.errorCode="invalid_client";class rd extends Wt{}rd.errorCode="invalid_grant";class nd extends Wt{}nd.errorCode="unauthorized_client";class Zp extends Wt{}Zp.errorCode="unsupported_grant_type";class Yp extends Wt{}Yp.errorCode="invalid_scope";class Jp extends Wt{}Jp.errorCode="access_denied";class gi extends Wt{}gi.errorCode="server_error";class Xp extends Wt{}Xp.errorCode="temporarily_unavailable";class em extends Wt{}em.errorCode="unsupported_response_type";class tm extends Wt{}tm.errorCode="unsupported_token_type";class rm extends Wt{}rm.errorCode="invalid_token";class nm extends Wt{}nm.errorCode="method_not_allowed";class sm extends Wt{}sm.errorCode="too_many_requests";class am extends Wt{}am.errorCode="invalid_client_metadata";class om extends Wt{}om.errorCode="insufficient_scope";const ID={[Gp.errorCode]:Gp,[td.errorCode]:td,[rd.errorCode]:rd,[nd.errorCode]:nd,[Zp.errorCode]:Zp,[Yp.errorCode]:Yp,[Jp.errorCode]:Jp,[gi.errorCode]:gi,[Xp.errorCode]:Xp,[em.errorCode]:em,[tm.errorCode]:tm,[rm.errorCode]:rm,[nm.errorCode]:nm,[sm.errorCode]:sm,[am.errorCode]:am,[om.errorCode]:om};class Dr extends Error{constructor(e){super(e??"Unauthorized")}}function ZE(t,e){const r=t.client_secret!==void 0;return e.length===0?r?"client_secret_post":"none":r&&e.includes("client_secret_basic")?"client_secret_basic":r&&e.includes("client_secret_post")?"client_secret_post":e.includes("none")?"none":r?"client_secret_post":"none"}function YE(t,e,r,s){const{client_id:n,client_secret:a}=e;switch(t){case"client_secret_basic":DD(n,a,r);return;case"client_secret_post":MD(n,a,s);return;case"none":$D(n,s);return;default:throw new Error(`Unsupported client authentication method: ${t}`)}}function DD(t,e,r){if(!e)throw new Error("client_secret_basic authentication requires a client_secret");const s=btoa(`${t}:${e}`);r.set("Authorization",`Basic ${s}`)}function MD(t,e,r){r.set("client_id",t),e&&r.set("client_secret",e)}function $D(t,e){e.set("client_id",t)}async function og(t){const e=t instanceof Response?t.status:void 0,r=t instanceof Response?await t.text():t;try{const s=ND.parse(JSON.parse(r)),{error:n,error_description:a,error_uri:o}=s,l=ID[n]||gi;return new l(a||"",o)}catch(s){const n=`${e?`HTTP ${e}: `:""}Invalid OAuth error response: ${s}. Raw body: ${r}`;return new gi(n)}}async function kn(t,e){var r,s;try{return await Xf(t,e)}catch(n){if(n instanceof td||n instanceof nd)return await((r=t.invalidateCredentials)===null||r===void 0?void 0:r.call(t,"all")),await Xf(t,e);if(n instanceof rd)return await((s=t.invalidateCredentials)===null||s===void 0?void 0:s.call(t,"tokens")),await Xf(t,e);throw n}}async function Xf(t,{serverUrl:e,authorizationCode:r,scope:s,resourceMetadataUrl:n,fetchFn:a}){let o,l;try{o=await LD(e,{resourceMetadataUrl:n},a),o.authorization_servers&&o.authorization_servers.length>0&&(l=o.authorization_servers[0])}catch{}l||(l=e);const c=await FD(e,t,o),u=await HD(l,{fetchFn:a});let d=await Promise.resolve(t.clientInformation());if(!d){if(r!==void 0)throw new Error("Existing OAuth client information is required when exchanging an authorization code");if(!t.saveClientInformation)throw new Error("OAuth client information must be saveable for dynamic registration");const h=await QD(l,{metadata:u,clientMetadata:t.clientMetadata,fetchFn:a});await t.saveClientInformation(h),d=h}if(r!==void 0){const h=await t.codeVerifier(),g=await WD(l,{metadata:u,clientInformation:d,authorizationCode:r,codeVerifier:h,redirectUri:t.redirectUrl,resource:c,addClientAuthentication:t.addClientAuthentication,fetchFn:a});return await t.saveTokens(g),"AUTHORIZED"}const f=await t.tokens();if(f!=null&&f.refresh_token)try{const h=await KD(l,{metadata:u,clientInformation:d,refreshToken:f.refresh_token,resource:c,addClientAuthentication:t.addClientAuthentication,fetchFn:a});return await t.saveTokens(h),"AUTHORIZED"}catch(h){if(!(!(h instanceof Wt)||h instanceof gi))throw h}const m=t.state?await t.state():void 0,{authorizationUrl:p,codeVerifier:w}=await BD(l,{metadata:u,clientInformation:d,state:m,redirectUrl:t.redirectUrl,scope:s||t.clientMetadata.scope,resource:c});return await t.saveCodeVerifier(w),await t.redirectToAuthorization(p),"REDIRECT"}async function FD(t,e,r){const s=AD(t);if(e.validateResourceURL)return await e.validateResourceURL(s,r==null?void 0:r.resource);if(r){if(!OD({requestedResource:s,configuredResource:r.resource}))throw new Error(`Protected resource ${r.resource} does not match expected ${s} (or origin)`);return new URL(r.resource)}}function im(t){const e=t.headers.get("WWW-Authenticate");if(!e)return;const[r,s]=e.split(" ");if(r.toLowerCase()!=="bearer"||!s)return;const a=/resource_metadata="([^"]*)"/.exec(e);if(a)try{return new URL(a[1])}catch{return}}async function LD(t,e,r=fetch){const s=await VD(t,"oauth-protected-resource",r,{protocolVersion:e==null?void 0:e.protocolVersion,metadataUrl:e==null?void 0:e.resourceMetadataUrl});if(!s||s.status===404)throw new Error("Resource server does not implement OAuth 2.0 Protected Resource Metadata.");if(!s.ok)throw new Error(`HTTP ${s.status} trying to load well-known OAuth protected resource metadata.`);return CD.parse(await s.json())}async function ig(t,e,r=fetch){try{return await r(t,{headers:e})}catch(s){if(s instanceof TypeError)return e?ig(t,void 0,r):void 0;throw s}}function UD(t,e="",r={}){return e.endsWith("/")&&(e=e.slice(0,-1)),r.prependPathname?`${e}/.well-known/${t}`:`/.well-known/${t}${e}`}async function W0(t,e,r=fetch){return await ig(t,{"MCP-Protocol-Version":e},r)}function zD(t,e){return!t||t.status>=400&&t.status<500&&e!=="/"}async function VD(t,e,r,s){var n,a;const o=new URL(t),l=(n=s==null?void 0:s.protocolVersion)!==null&&n!==void 0?n:Wd;let c;if(s!=null&&s.metadataUrl)c=new URL(s.metadataUrl);else{const d=UD(e,o.pathname);c=new URL(d,(a=s==null?void 0:s.metadataServerUrl)!==null&&a!==void 0?a:o),c.search=o.search}let u=await W0(c,l,r);if(!(s!=null&&s.metadataUrl)&&zD(u,o.pathname)){const d=new URL(`/.well-known/${e}`,o);u=await W0(d,l,r)}return u}function qD(t){const e=typeof t=="string"?new URL(t):t,r=e.pathname!=="/",s=[];if(!r)return s.push({url:new URL("/.well-known/oauth-authorization-server",e.origin),type:"oauth"}),s.push({url:new URL("/.well-known/openid-configuration",e.origin),type:"oidc"}),s;let n=e.pathname;return n.endsWith("/")&&(n=n.slice(0,-1)),s.push({url:new URL(`/.well-known/oauth-authorization-server${n}`,e.origin),type:"oauth"}),s.push({url:new URL("/.well-known/oauth-authorization-server",e.origin),type:"oauth"}),s.push({url:new URL(`/.well-known/openid-configuration${n}`,e.origin),type:"oidc"}),s.push({url:new URL(`${n}/.well-known/openid-configuration`,e.origin),type:"oidc"}),s}async function HD(t,{fetchFn:e=fetch,protocolVersion:r=Wd}={}){var s;const n={"MCP-Protocol-Version":r},a=qD(t);for(const{url:o,type:l}of a){const c=await ig(o,n,e);if(c){if(!c.ok){if(c.status>=400&&c.status<500)continue;throw new Error(`HTTP ${c.status} trying to load ${l==="oauth"?"OAuth":"OpenID provider"} metadata from ${o}`)}if(l==="oauth")return QE.parse(await c.json());{const u=PD.parse(await c.json());if(!(!((s=u.code_challenge_methods_supported)===null||s===void 0)&&s.includes("S256")))throw new Error(`Incompatible OIDC provider at ${o}: does not support S256 code challenge method required by MCP specification`);return u}}}}async function BD(t,{metadata:e,clientInformation:r,redirectUrl:s,scope:n,state:a,resource:o}){const l="code",c="S256";let u;if(e){if(u=new URL(e.authorization_endpoint),!e.response_types_supported.includes(l))throw new Error(`Incompatible auth server: does not support response type ${l}`);if(!e.code_challenge_methods_supported||!e.code_challenge_methods_supported.includes(c))throw new Error(`Incompatible auth server: does not support code challenge method ${c}`)}else u=new URL("/authorize",t);const d=await ED(),f=d.code_verifier,m=d.code_challenge;return u.searchParams.set("response_type",l),u.searchParams.set("client_id",r.client_id),u.searchParams.set("code_challenge",m),u.searchParams.set("code_challenge_method",c),u.searchParams.set("redirect_uri",String(s)),a&&u.searchParams.set("state",a),n&&u.searchParams.set("scope",n),n!=null&&n.includes("offline_access")&&u.searchParams.append("prompt","consent"),o&&u.searchParams.set("resource",o.href),{authorizationUrl:u,codeVerifier:f}}async function WD(t,{metadata:e,clientInformation:r,authorizationCode:s,codeVerifier:n,redirectUri:a,resource:o,addClientAuthentication:l,fetchFn:c}){var u;const d="authorization_code",f=e!=null&&e.token_endpoint?new URL(e.token_endpoint):new URL("/token",t);if(e!=null&&e.grant_types_supported&&!e.grant_types_supported.includes(d))throw new Error(`Incompatible auth server: does not support grant type ${d}`);const m=new Headers({"Content-Type":"application/x-www-form-urlencoded",Accept:"application/json"}),p=new URLSearchParams({grant_type:d,code:s,code_verifier:n,redirect_uri:String(a)});if(l)l(m,p,t,e);else{const h=(u=e==null?void 0:e.token_endpoint_auth_methods_supported)!==null&&u!==void 0?u:[],g=ZE(r,h);YE(g,r,m,p)}o&&p.set("resource",o.href);const w=await(c??fetch)(f,{method:"POST",headers:m,body:p});if(!w.ok)throw await og(w);return GE.parse(await w.json())}async function KD(t,{metadata:e,clientInformation:r,refreshToken:s,resource:n,addClientAuthentication:a,fetchFn:o}){var l;const c="refresh_token";let u;if(e){if(u=new URL(e.token_endpoint),e.grant_types_supported&&!e.grant_types_supported.includes(c))throw new Error(`Incompatible auth server: does not support grant type ${c}`)}else u=new URL("/token",t);const d=new Headers({"Content-Type":"application/x-www-form-urlencoded"}),f=new URLSearchParams({grant_type:c,refresh_token:s});if(a)a(d,f,t,e);else{const p=(l=e==null?void 0:e.token_endpoint_auth_methods_supported)!==null&&l!==void 0?l:[],w=ZE(r,p);YE(w,r,d,f)}n&&f.set("resource",n.href);const m=await(o??fetch)(u,{method:"POST",headers:d,body:f});if(!m.ok)throw await og(m);return GE.parse({refresh_token:s,...await m.json()})}async function QD(t,{metadata:e,clientMetadata:r,fetchFn:s}){let n;if(e){if(!e.registration_endpoint)throw new Error("Incompatible auth server: does not support dynamic client registration");n=new URL(e.registration_endpoint)}else n=new URL("/register",t);const a=await(s??fetch)(n,{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify(r)});if(!a.ok)throw await og(a);return TD.parse(await a.json())}class GD extends Error{constructor(e,r,s){super(`SSE error: ${r}`),this.code=e,this.event=s}}class ZD{constructor(e,r){this._url=e,this._resourceMetadataUrl=void 0,this._eventSourceInit=r==null?void 0:r.eventSourceInit,this._requestInit=r==null?void 0:r.requestInit,this._authProvider=r==null?void 0:r.authProvider,this._fetch=r==null?void 0:r.fetch}async _authThenStart(){var e;if(!this._authProvider)throw new Dr("No auth provider");let r;try{r=await kn(this._authProvider,{serverUrl:this._url,resourceMetadataUrl:this._resourceMetadataUrl,fetchFn:this._fetch})}catch(s){throw(e=this.onerror)===null||e===void 0||e.call(this,s),s}if(r!=="AUTHORIZED")throw new Dr;return await this._startOrAuth()}async _commonHeaders(){var e;const r={};if(this._authProvider){const s=await this._authProvider.tokens();s&&(r.Authorization=`Bearer ${s.access_token}`)}return this._protocolVersion&&(r["mcp-protocol-version"]=this._protocolVersion),new Headers({...r,...(e=this._requestInit)===null||e===void 0?void 0:e.headers})}_startOrAuth(){var e,r,s;const n=(s=(r=(e=this===null||this===void 0?void 0:this._eventSourceInit)===null||e===void 0?void 0:e.fetch)!==null&&r!==void 0?r:this._fetch)!==null&&s!==void 0?s:fetch;return new Promise((a,o)=>{this._eventSource=new su(this._url.href,{...this._eventSourceInit,fetch:async(l,c)=>{const u=await this._commonHeaders();u.set("Accept","text/event-stream");const d=await n(l,{...c,headers:u});return d.status===401&&d.headers.has("www-authenticate")&&(this._resourceMetadataUrl=im(d)),d}}),this._abortController=new AbortController,this._eventSource.onerror=l=>{var c;if(l.code===401&&this._authProvider){this._authThenStart().then(a,o);return}const u=new GD(l.code,l.message,l);o(u),(c=this.onerror)===null||c===void 0||c.call(this,u)},this._eventSource.onopen=()=>{},this._eventSource.addEventListener("endpoint",l=>{var c;const u=l;try{if(this._endpoint=new URL(u.data,this._url),this._endpoint.origin!==this._url.origin)throw new Error(`Endpoint origin does not match connection origin: ${this._endpoint.origin}`)}catch(d){o(d),(c=this.onerror)===null||c===void 0||c.call(this,d),this.close();return}a()}),this._eventSource.onmessage=l=>{var c,u;const d=l;let f;try{f=ru.parse(JSON.parse(d.data))}catch(m){(c=this.onerror)===null||c===void 0||c.call(this,m);return}(u=this.onmessage)===null||u===void 0||u.call(this,f)}})}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(e){if(!this._authProvider)throw new Dr("No auth provider");if(await kn(this._authProvider,{serverUrl:this._url,authorizationCode:e,resourceMetadataUrl:this._resourceMetadataUrl,fetchFn:this._fetch})!=="AUTHORIZED")throw new Dr("Failed to authorize")}async close(){var e,r,s;(e=this._abortController)===null||e===void 0||e.abort(),(r=this._eventSource)===null||r===void 0||r.close(),(s=this.onclose)===null||s===void 0||s.call(this)}async send(e){var r,s,n;if(!this._endpoint)throw new Error("Not connected");try{const a=await this._commonHeaders();a.set("content-type","application/json");const o={...this._requestInit,method:"POST",headers:a,body:JSON.stringify(e),signal:(r=this._abortController)===null||r===void 0?void 0:r.signal},l=await((s=this._fetch)!==null&&s!==void 0?s:fetch)(this._endpoint,o);if(!l.ok){if(l.status===401&&this._authProvider){if(this._resourceMetadataUrl=im(l),await kn(this._authProvider,{serverUrl:this._url,resourceMetadataUrl:this._resourceMetadataUrl,fetchFn:this._fetch})!=="AUTHORIZED")throw new Dr;return this.send(e)}const c=await l.text().catch(()=>null);throw new Error(`Error POSTing to endpoint (HTTP ${l.status}): ${c}`)}}catch(a){throw(n=this.onerror)===null||n===void 0||n.call(this,a),a}}setProtocolVersion(e){this._protocolVersion=e}}class YD extends TransformStream{constructor({onError:e,onRetry:r,onComment:s}={}){let n;super({start(a){n=WE({onEvent:o=>{a.enqueue(o)},onError(o){e==="terminate"?a.error(o):typeof e=="function"&&e(o)},onRetry:r,onComment:s})},transform(a){n.feed(a)}})}}const JD={initialReconnectionDelay:1e3,maxReconnectionDelay:3e4,reconnectionDelayGrowFactor:1.5,maxRetries:2};class eh extends Error{constructor(e,r){super(`Streamable HTTP error: ${r}`),this.code=e}}class XD{constructor(e,r){var s;this._url=e,this._resourceMetadataUrl=void 0,this._requestInit=r==null?void 0:r.requestInit,this._authProvider=r==null?void 0:r.authProvider,this._fetch=r==null?void 0:r.fetch,this._sessionId=r==null?void 0:r.sessionId,this._reconnectionOptions=(s=r==null?void 0:r.reconnectionOptions)!==null&&s!==void 0?s:JD}async _authThenStart(){var e;if(!this._authProvider)throw new Dr("No auth provider");let r;try{r=await kn(this._authProvider,{serverUrl:this._url,resourceMetadataUrl:this._resourceMetadataUrl,fetchFn:this._fetch})}catch(s){throw(e=this.onerror)===null||e===void 0||e.call(this,s),s}if(r!=="AUTHORIZED")throw new Dr;return await this._startOrAuthSse({resumptionToken:void 0})}async _commonHeaders(){var e;const r={};if(this._authProvider){const n=await this._authProvider.tokens();n&&(r.Authorization=`Bearer ${n.access_token}`)}this._sessionId&&(r["mcp-session-id"]=this._sessionId),this._protocolVersion&&(r["mcp-protocol-version"]=this._protocolVersion);const s=this._normalizeHeaders((e=this._requestInit)===null||e===void 0?void 0:e.headers);return new Headers({...r,...s})}async _startOrAuthSse(e){var r,s,n;const{resumptionToken:a}=e;try{const o=await this._commonHeaders();o.set("Accept","text/event-stream"),a&&o.set("last-event-id",a);const l=await((r=this._fetch)!==null&&r!==void 0?r:fetch)(this._url,{method:"GET",headers:o,signal:(s=this._abortController)===null||s===void 0?void 0:s.signal});if(!l.ok){if(l.status===401&&this._authProvider)return await this._authThenStart();if(l.status===405)return;throw new eh(l.status,`Failed to open SSE stream: ${l.statusText}`)}this._handleSseStream(l.body,e,!0)}catch(o){throw(n=this.onerror)===null||n===void 0||n.call(this,o),o}}_getNextReconnectionDelay(e){const r=this._reconnectionOptions.initialReconnectionDelay,s=this._reconnectionOptions.reconnectionDelayGrowFactor,n=this._reconnectionOptions.maxReconnectionDelay;return Math.min(r*Math.pow(s,e),n)}_normalizeHeaders(e){return e?e instanceof Headers?Object.fromEntries(e.entries()):Array.isArray(e)?Object.fromEntries(e):{...e}:{}}_scheduleReconnection(e,r=0){var s;const n=this._reconnectionOptions.maxRetries;if(n>0&&r>=n){(s=this.onerror)===null||s===void 0||s.call(this,new Error(`Maximum reconnection attempts (${n}) exceeded.`));return}const a=this._getNextReconnectionDelay(r);setTimeout(()=>{this._startOrAuthSse(e).catch(o=>{var l;(l=this.onerror)===null||l===void 0||l.call(this,new Error(`Failed to reconnect SSE stream: ${o instanceof Error?o.message:String(o)}`)),this._scheduleReconnection(e,r+1)})},a)}_handleSseStream(e,r,s){if(!e)return;const{onresumptiontoken:n,replayMessageId:a}=r;let o;(async()=>{var c,u,d,f;try{const m=e.pipeThrough(new TextDecoderStream).pipeThrough(new YD).getReader();for(;;){const{value:p,done:w}=await m.read();if(w)break;if(p.id&&(o=p.id,n==null||n(p.id)),!p.event||p.event==="message")try{const h=ru.parse(JSON.parse(p.data));a!==void 0&&Up(h)&&(h.id=a),(c=this.onmessage)===null||c===void 0||c.call(this,h)}catch(h){(u=this.onerror)===null||u===void 0||u.call(this,h)}}}catch(m){if((d=this.onerror)===null||d===void 0||d.call(this,new Error(`SSE stream disconnected: ${m}`)),s&&this._abortController&&!this._abortController.signal.aborted)try{this._scheduleReconnection({resumptionToken:o,onresumptiontoken:n,replayMessageId:a},0)}catch(p){(f=this.onerror)===null||f===void 0||f.call(this,new Error(`Failed to reconnect: ${p instanceof Error?p.message:String(p)}`))}}})()}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(e){if(!this._authProvider)throw new Dr("No auth provider");if(await kn(this._authProvider,{serverUrl:this._url,authorizationCode:e,resourceMetadataUrl:this._resourceMetadataUrl,fetchFn:this._fetch})!=="AUTHORIZED")throw new Dr("Failed to authorize")}async close(){var e,r;(e=this._abortController)===null||e===void 0||e.abort(),(r=this.onclose)===null||r===void 0||r.call(this)}async send(e,r){var s,n,a,o;try{const{resumptionToken:l,onresumptiontoken:c}=r||{};if(l){this._startOrAuthSse({resumptionToken:l,replayMessageId:TE(e)?e.id:void 0}).catch(g=>{var v;return(v=this.onerror)===null||v===void 0?void 0:v.call(this,g)});return}const u=await this._commonHeaders();u.set("content-type","application/json"),u.set("accept","application/json, text/event-stream");const d={...this._requestInit,method:"POST",headers:u,body:JSON.stringify(e),signal:(s=this._abortController)===null||s===void 0?void 0:s.signal},f=await((n=this._fetch)!==null&&n!==void 0?n:fetch)(this._url,d),m=f.headers.get("mcp-session-id");if(m&&(this._sessionId=m),!f.ok){if(f.status===401&&this._authProvider){if(this._resourceMetadataUrl=im(f),await kn(this._authProvider,{serverUrl:this._url,resourceMetadataUrl:this._resourceMetadataUrl,fetchFn:this._fetch})!=="AUTHORIZED")throw new Dr;return this.send(e)}const g=await f.text().catch(()=>null);throw new Error(`Error POSTing to endpoint (HTTP ${f.status}): ${g}`)}if(f.status===202){P4(e)&&this._startOrAuthSse({resumptionToken:void 0}).catch(g=>{var v;return(v=this.onerror)===null||v===void 0?void 0:v.call(this,g)});return}const w=(Array.isArray(e)?e:[e]).filter(g=>"method"in g&&"id"in g&&g.id!==void 0).length>0,h=f.headers.get("content-type");if(w)if(h!=null&&h.includes("text/event-stream"))this._handleSseStream(f.body,{onresumptiontoken:c},!1);else if(h!=null&&h.includes("application/json")){const g=await f.json(),v=Array.isArray(g)?g.map(y=>ru.parse(y)):[ru.parse(g)];for(const y of v)(a=this.onmessage)===null||a===void 0||a.call(this,y)}else throw new eh(-1,`Unexpected content type: ${h}`)}catch(l){throw(o=this.onerror)===null||o===void 0||o.call(this,l),l}}get sessionId(){return this._sessionId}async terminateSession(){var e,r,s;if(this._sessionId)try{const n=await this._commonHeaders(),a={...this._requestInit,method:"DELETE",headers:n,signal:(e=this._abortController)===null||e===void 0?void 0:e.signal},o=await((r=this._fetch)!==null&&r!==void 0?r:fetch)(this._url,a);if(!o.ok&&o.status!==405)throw new eh(o.status,`Failed to terminate session: ${o.statusText}`);this._sessionId=void 0}catch(n){throw(s=this.onerror)===null||s===void 0||s.call(this,n),n}}setProtocolVersion(e){this._protocolVersion=e}get protocolVersion(){return this._protocolVersion}}const eM=6e4;class tM{constructor(e){this._options=e,this._requestMessageId=0,this._requestHandlers=new Map,this._requestHandlerAbortControllers=new Map,this._notificationHandlers=new Map,this._responseHandlers=new Map,this._progressHandlers=new Map,this._timeoutInfo=new Map,this._pendingDebouncedNotifications=new Set,this.setNotificationHandler(Qv,r=>{const s=this._requestHandlerAbortControllers.get(r.params.requestId);s==null||s.abort(r.params.reason)}),this.setNotificationHandler(Zv,r=>{this._onprogress(r)}),this.setRequestHandler(Gv,r=>({}))}_setupTimeout(e,r,s,n,a=!1){this._timeoutInfo.set(e,{timeoutId:setTimeout(n,r),startTime:Date.now(),timeout:r,maxTotalTimeout:s,resetTimeoutOnProgress:a,onTimeout:n})}_resetTimeout(e){const r=this._timeoutInfo.get(e);if(!r)return!1;const s=Date.now()-r.startTime;if(r.maxTotalTimeout&&s>=r.maxTotalTimeout)throw this._timeoutInfo.delete(e),new qs(En.RequestTimeout,"Maximum total timeout exceeded",{maxTotalTimeout:r.maxTotalTimeout,totalElapsed:s});return clearTimeout(r.timeoutId),r.timeoutId=setTimeout(r.onTimeout,r.timeout),!0}_cleanupTimeout(e){const r=this._timeoutInfo.get(e);r&&(clearTimeout(r.timeoutId),this._timeoutInfo.delete(e))}async connect(e){var r,s,n;this._transport=e;const a=(r=this.transport)===null||r===void 0?void 0:r.onclose;this._transport.onclose=()=>{a==null||a(),this._onclose()};const o=(s=this.transport)===null||s===void 0?void 0:s.onerror;this._transport.onerror=c=>{o==null||o(c),this._onerror(c)};const l=(n=this._transport)===null||n===void 0?void 0:n.onmessage;this._transport.onmessage=(c,u)=>{l==null||l(c,u),Up(c)||_4(c)?this._onresponse(c):TE(c)?this._onrequest(c,u):S4(c)?this._onnotification(c):this._onerror(new Error(`Unknown message type: ${JSON.stringify(c)}`))},await this._transport.start()}_onclose(){var e;const r=this._responseHandlers;this._responseHandlers=new Map,this._progressHandlers.clear(),this._pendingDebouncedNotifications.clear(),this._transport=void 0,(e=this.onclose)===null||e===void 0||e.call(this);const s=new qs(En.ConnectionClosed,"Connection closed");for(const n of r.values())n(s)}_onerror(e){var r;(r=this.onerror)===null||r===void 0||r.call(this,e)}_onnotification(e){var r;const s=(r=this._notificationHandlers.get(e.method))!==null&&r!==void 0?r:this.fallbackNotificationHandler;s!==void 0&&Promise.resolve().then(()=>s(e)).catch(n=>this._onerror(new Error(`Uncaught error in notification handler: ${n}`)))}_onrequest(e,r){var s,n;const a=(s=this._requestHandlers.get(e.method))!==null&&s!==void 0?s:this.fallbackRequestHandler,o=this._transport;if(a===void 0){o==null||o.send({jsonrpc:"2.0",id:e.id,error:{code:En.MethodNotFound,message:"Method not found"}}).catch(u=>this._onerror(new Error(`Failed to send an error response: ${u}`)));return}const l=new AbortController;this._requestHandlerAbortControllers.set(e.id,l);const c={signal:l.signal,sessionId:o==null?void 0:o.sessionId,_meta:(n=e.params)===null||n===void 0?void 0:n._meta,sendNotification:u=>this.notification(u,{relatedRequestId:e.id}),sendRequest:(u,d,f)=>this.request(u,d,{...f,relatedRequestId:e.id}),authInfo:r==null?void 0:r.authInfo,requestId:e.id,requestInfo:r==null?void 0:r.requestInfo};Promise.resolve().then(()=>a(e,c)).then(u=>{if(!l.signal.aborted)return o==null?void 0:o.send({result:u,jsonrpc:"2.0",id:e.id})},u=>{var d;if(!l.signal.aborted)return o==null?void 0:o.send({jsonrpc:"2.0",id:e.id,error:{code:Number.isSafeInteger(u.code)?u.code:En.InternalError,message:(d=u.message)!==null&&d!==void 0?d:"Internal error"}})}).catch(u=>this._onerror(new Error(`Failed to send response: ${u}`))).finally(()=>{this._requestHandlerAbortControllers.delete(e.id)})}_onprogress(e){const{progressToken:r,...s}=e.params,n=Number(r),a=this._progressHandlers.get(n);if(!a){this._onerror(new Error(`Received a progress notification for an unknown token: ${JSON.stringify(e)}`));return}const o=this._responseHandlers.get(n),l=this._timeoutInfo.get(n);if(l&&o&&l.resetTimeoutOnProgress)try{this._resetTimeout(n)}catch(c){o(c);return}a(s)}_onresponse(e){const r=Number(e.id),s=this._responseHandlers.get(r);if(s===void 0){this._onerror(new Error(`Received a response for an unknown message ID: ${JSON.stringify(e)}`));return}if(this._responseHandlers.delete(r),this._progressHandlers.delete(r),this._cleanupTimeout(r),Up(e))s(e);else{const n=new qs(e.error.code,e.error.message,e.error.data);s(n)}}get transport(){return this._transport}async close(){var e;await((e=this._transport)===null||e===void 0?void 0:e.close())}request(e,r,s){const{relatedRequestId:n,resumptionToken:a,onresumptiontoken:o}=s??{};return new Promise((l,c)=>{var u,d,f,m,p,w;if(!this._transport){c(new Error("Not connected"));return}((u=this._options)===null||u===void 0?void 0:u.enforceStrictCapabilities)===!0&&this.assertCapabilityForMethod(e.method),(d=s==null?void 0:s.signal)===null||d===void 0||d.throwIfAborted();const h=this._requestMessageId++,g={...e,jsonrpc:"2.0",id:h};s!=null&&s.onprogress&&(this._progressHandlers.set(h,s.onprogress),g.params={...e.params,_meta:{...((f=e.params)===null||f===void 0?void 0:f._meta)||{},progressToken:h}});const v=S=>{var E;this._responseHandlers.delete(h),this._progressHandlers.delete(h),this._cleanupTimeout(h),(E=this._transport)===null||E===void 0||E.send({jsonrpc:"2.0",method:"notifications/cancelled",params:{requestId:h,reason:String(S)}},{relatedRequestId:n,resumptionToken:a,onresumptiontoken:o}).catch(k=>this._onerror(new Error(`Failed to send cancellation: ${k}`))),c(S)};this._responseHandlers.set(h,S=>{var E;if(!(!((E=s==null?void 0:s.signal)===null||E===void 0)&&E.aborted)){if(S instanceof Error)return c(S);try{const k=r.parse(S.result);l(k)}catch(k){c(k)}}}),(m=s==null?void 0:s.signal)===null||m===void 0||m.addEventListener("abort",()=>{var S;v((S=s==null?void 0:s.signal)===null||S===void 0?void 0:S.reason)});const y=(p=s==null?void 0:s.timeout)!==null&&p!==void 0?p:eM,b=()=>v(new qs(En.RequestTimeout,"Request timed out",{timeout:y}));this._setupTimeout(h,y,s==null?void 0:s.maxTotalTimeout,b,(w=s==null?void 0:s.resetTimeoutOnProgress)!==null&&w!==void 0?w:!1),this._transport.send(g,{relatedRequestId:n,resumptionToken:a,onresumptiontoken:o}).catch(S=>{this._cleanupTimeout(h),c(S)})})}async notification(e,r){var s,n;if(!this._transport)throw new Error("Not connected");if(this.assertNotificationCapability(e.method),((n=(s=this._options)===null||s===void 0?void 0:s.debouncedNotificationMethods)!==null&&n!==void 0?n:[]).includes(e.method)&&!e.params&&!(r!=null&&r.relatedRequestId)){if(this._pendingDebouncedNotifications.has(e.method))return;this._pendingDebouncedNotifications.add(e.method),Promise.resolve().then(()=>{var c;if(this._pendingDebouncedNotifications.delete(e.method),!this._transport)return;const u={...e,jsonrpc:"2.0"};(c=this._transport)===null||c===void 0||c.send(u,r).catch(d=>this._onerror(d))});return}const l={...e,jsonrpc:"2.0"};await this._transport.send(l,r)}setRequestHandler(e,r){const s=e.shape.method.value;this.assertRequestHandlerCapability(s),this._requestHandlers.set(s,(n,a)=>Promise.resolve(r(e.parse(n),a)))}removeRequestHandler(e){this._requestHandlers.delete(e)}assertCanSetRequestHandler(e){if(this._requestHandlers.has(e))throw new Error(`A request handler for ${e} already exists, which would be overridden`)}setNotificationHandler(e,r){this._notificationHandlers.set(e.shape.method.value,s=>Promise.resolve(r(e.parse(s))))}removeNotificationHandler(e){this._notificationHandlers.delete(e)}}function rM(t,e){return Object.entries(e).reduce((r,[s,n])=>(n&&typeof n=="object"?r[s]=r[s]?{...r[s],...n}:n:r[s]=n,r),{...t})}var lm={exports:{}};/** @license URI.js v4.4.1 (c) 2011 Gary Court. License: http://github.com/garycourt/uri-js */(function(t,e){(function(r,s){s(e)})(AC,function(r){function s(){for(var D=arguments.length,P=Array(D),M=0;M<D;M++)P[M]=arguments[M];if(P.length>1){P[0]=P[0].slice(0,-1);for(var B=P.length-1,H=1;H<B;++H)P[H]=P[H].slice(1,-1);return P[B]=P[B].slice(1),P.join("")}else return P[0]}function n(D){return"(?:"+D+")"}function a(D){return D===void 0?"undefined":D===null?"null":Object.prototype.toString.call(D).split(" ").pop().split("]").shift().toLowerCase()}function o(D){return D.toUpperCase()}function l(D){return D!=null?D instanceof Array?D:typeof D.length!="number"||D.split||D.setInterval||D.call?[D]:Array.prototype.slice.call(D):[]}function c(D,P){var M=D;if(P)for(var B in P)M[B]=P[B];return M}function u(D){var P="[A-Za-z]",M="[0-9]",B=s(M,"[A-Fa-f]"),H=n(n("%[EFef]"+B+"%"+B+B+"%"+B+B)+"|"+n("%[89A-Fa-f]"+B+"%"+B+B)+"|"+n("%"+B+B)),xe="[\\:\\/\\?\\#\\[\\]\\@]",be="[\\!\\$\\&\\'\\(\\)\\*\\+\\,\\;\\=]",Qe=s(xe,be),ot=D?"[\\xA0-\\u200D\\u2010-\\u2029\\u202F-\\uD7FF\\uF900-\\uFDCF\\uFDF0-\\uFFEF]":"[]",bt=D?"[\\uE000-\\uF8FF]":"[]",He=s(P,M,"[\\-\\.\\_\\~]",ot);n(P+s(P,M,"[\\+\\-\\.]")+"*"),n(n(H+"|"+s(He,be,"[\\:]"))+"*");var nt=n(n("25[0-5]")+"|"+n("2[0-4]"+M)+"|"+n("1"+M+M)+"|"+n("0?[1-9]"+M)+"|0?0?"+M),St=n(nt+"\\."+nt+"\\."+nt+"\\."+nt),Re=n(B+"{1,4}"),ut=n(n(Re+"\\:"+Re)+"|"+St),Ct=n(n(Re+"\\:")+"{6}"+ut),dt=n("\\:\\:"+n(Re+"\\:")+"{5}"+ut),gs=n(n(Re)+"?\\:\\:"+n(Re+"\\:")+"{4}"+ut),un=n(n(n(Re+"\\:")+"{0,1}"+Re)+"?\\:\\:"+n(Re+"\\:")+"{3}"+ut),dn=n(n(n(Re+"\\:")+"{0,2}"+Re)+"?\\:\\:"+n(Re+"\\:")+"{2}"+ut),io=n(n(n(Re+"\\:")+"{0,3}"+Re)+"?\\:\\:"+Re+"\\:"+ut),xa=n(n(n(Re+"\\:")+"{0,4}"+Re)+"?\\:\\:"+ut),Rr=n(n(n(Re+"\\:")+"{0,5}"+Re)+"?\\:\\:"+Re),fn=n(n(n(Re+"\\:")+"{0,6}"+Re)+"?\\:\\:"),wa=n([Ct,dt,gs,un,dn,io,xa,Rr,fn].join("|")),Fn=n(n(He+"|"+H)+"+");n("[vV]"+B+"+\\."+s(He,be,"[\\:]")+"+"),n(n(H+"|"+s(He,be))+"*");var Ni=n(H+"|"+s(He,be,"[\\:\\@]"));return n(n(H+"|"+s(He,be,"[\\@]"))+"+"),n(n(Ni+"|"+s("[\\/\\?]",bt))+"*"),{NOT_SCHEME:new RegExp(s("[^]",P,M,"[\\+\\-\\.]"),"g"),NOT_USERINFO:new RegExp(s("[^\\%\\:]",He,be),"g"),NOT_HOST:new RegExp(s("[^\\%\\[\\]\\:]",He,be),"g"),NOT_PATH:new RegExp(s("[^\\%\\/\\:\\@]",He,be),"g"),NOT_PATH_NOSCHEME:new RegExp(s("[^\\%\\/\\@]",He,be),"g"),NOT_QUERY:new RegExp(s("[^\\%]",He,be,"[\\:\\@\\/\\?]",bt),"g"),NOT_FRAGMENT:new RegExp(s("[^\\%]",He,be,"[\\:\\@\\/\\?]"),"g"),ESCAPE:new RegExp(s("[^]",He,be),"g"),UNRESERVED:new RegExp(He,"g"),OTHER_CHARS:new RegExp(s("[^\\%]",He,Qe),"g"),PCT_ENCODED:new RegExp(H,"g"),IPV4ADDRESS:new RegExp("^("+St+")$"),IPV6ADDRESS:new RegExp("^\\[?("+wa+")"+n(n("\\%25|\\%(?!"+B+"{2})")+"("+Fn+")")+"?\\]?$")}}var d=u(!1),f=u(!0),m=function(){function D(P,M){var B=[],H=!0,xe=!1,be=void 0;try{for(var Qe=P[Symbol.iterator](),ot;!(H=(ot=Qe.next()).done)&&(B.push(ot.value),!(M&&B.length===M));H=!0);}catch(bt){xe=!0,be=bt}finally{try{!H&&Qe.return&&Qe.return()}finally{if(xe)throw be}}return B}return function(P,M){if(Array.isArray(P))return P;if(Symbol.iterator in Object(P))return D(P,M);throw new TypeError("Invalid attempt to destructure non-iterable instance")}}(),p=function(D){if(Array.isArray(D)){for(var P=0,M=Array(D.length);P<D.length;P++)M[P]=D[P];return M}else return Array.from(D)},w=2147483647,h=36,g=1,v=26,y=38,b=700,S=72,E=128,k="-",R=/^xn--/,T=/[^\0-\x7E]/,N=/[\x2E\u3002\uFF0E\uFF61]/g,O={overflow:"Overflow: input needs wider integers to process","not-basic":"Illegal input >= 0x80 (not a basic code point)","invalid-input":"Invalid input"},j=h-g,_=Math.floor,A=String.fromCharCode;function C(D){throw new RangeError(O[D])}function z(D,P){for(var M=[],B=D.length;B--;)M[B]=P(D[B]);return M}function U(D,P){var M=D.split("@"),B="";M.length>1&&(B=M[0]+"@",D=M[1]),D=D.replace(N,".");var H=D.split("."),xe=z(H,P).join(".");return B+xe}function K(D){for(var P=[],M=0,B=D.length;M<B;){var H=D.charCodeAt(M++);if(H>=55296&&H<=56319&&M<B){var xe=D.charCodeAt(M++);(xe&64512)==56320?P.push(((H&1023)<<10)+(xe&1023)+65536):(P.push(H),M--)}else P.push(H)}return P}var $=function(P){return String.fromCodePoint.apply(String,p(P))},F=function(P){return P-48<10?P-22:P-65<26?P-65:P-97<26?P-97:h},V=function(P,M){return P+22+75*(P<26)-((M!=0)<<5)},ae=function(P,M,B){var H=0;for(P=B?_(P/b):P>>1,P+=_(P/M);P>j*v>>1;H+=h)P=_(P/j);return _(H+(j+1)*P/(P+y))},se=function(P){var M=[],B=P.length,H=0,xe=E,be=S,Qe=P.lastIndexOf(k);Qe<0&&(Qe=0);for(var ot=0;ot<Qe;++ot)P.charCodeAt(ot)>=128&&C("not-basic"),M.push(P.charCodeAt(ot));for(var bt=Qe>0?Qe+1:0;bt<B;){for(var He=H,nt=1,St=h;;St+=h){bt>=B&&C("invalid-input");var Re=F(P.charCodeAt(bt++));(Re>=h||Re>_((w-H)/nt))&&C("overflow"),H+=Re*nt;var ut=St<=be?g:St>=be+v?v:St-be;if(Re<ut)break;var Ct=h-ut;nt>_(w/Ct)&&C("overflow"),nt*=Ct}var dt=M.length+1;be=ae(H-He,dt,He==0),_(H/dt)>w-xe&&C("overflow"),xe+=_(H/dt),H%=dt,M.splice(H++,0,xe)}return String.fromCodePoint.apply(String,M)},W=function(P){var M=[];P=K(P);var B=P.length,H=E,xe=0,be=S,Qe=!0,ot=!1,bt=void 0;try{for(var He=P[Symbol.iterator](),nt;!(Qe=(nt=He.next()).done);Qe=!0){var St=nt.value;St<128&&M.push(A(St))}}catch(ji){ot=!0,bt=ji}finally{try{!Qe&&He.return&&He.return()}finally{if(ot)throw bt}}var Re=M.length,ut=Re;for(Re&&M.push(k);ut<B;){var Ct=w,dt=!0,gs=!1,un=void 0;try{for(var dn=P[Symbol.iterator](),io;!(dt=(io=dn.next()).done);dt=!0){var xa=io.value;xa>=H&&xa<Ct&&(Ct=xa)}}catch(ji){gs=!0,un=ji}finally{try{!dt&&dn.return&&dn.return()}finally{if(gs)throw un}}var Rr=ut+1;Ct-H>_((w-xe)/Rr)&&C("overflow"),xe+=(Ct-H)*Rr,H=Ct;var fn=!0,wa=!1,Fn=void 0;try{for(var Ni=P[Symbol.iterator](),wg;!(fn=(wg=Ni.next()).done);fn=!0){var bg=wg.value;if(bg<H&&++xe>w&&C("overflow"),bg==H){for(var ec=xe,tc=h;;tc+=h){var rc=tc<=be?g:tc>=be+v?v:tc-be;if(ec<rc)break;var Sg=ec-rc,_g=h-rc;M.push(A(V(rc+Sg%_g,0))),ec=_(Sg/_g)}M.push(A(V(ec,0))),be=ae(xe,Rr,ut==Re),xe=0,++ut}}}catch(ji){wa=!0,Fn=ji}finally{try{!fn&&Ni.return&&Ni.return()}finally{if(wa)throw Fn}}++xe,++H}return M.join("")},L=function(P){return U(P,function(M){return R.test(M)?se(M.slice(4).toLowerCase()):M})},Q=function(P){return U(P,function(M){return T.test(M)?"xn--"+W(M):M})},oe={version:"2.1.0",ucs2:{decode:K,encode:$},decode:se,encode:W,toASCII:Q,toUnicode:L},Z={};function ce(D){var P=D.charCodeAt(0),M=void 0;return P<16?M="%0"+P.toString(16).toUpperCase():P<128?M="%"+P.toString(16).toUpperCase():P<2048?M="%"+(P>>6|192).toString(16).toUpperCase()+"%"+(P&63|128).toString(16).toUpperCase():M="%"+(P>>12|224).toString(16).toUpperCase()+"%"+(P>>6&63|128).toString(16).toUpperCase()+"%"+(P&63|128).toString(16).toUpperCase(),M}function Ee(D){for(var P="",M=0,B=D.length;M<B;){var H=parseInt(D.substr(M+1,2),16);if(H<128)P+=String.fromCharCode(H),M+=3;else if(H>=194&&H<224){if(B-M>=6){var xe=parseInt(D.substr(M+4,2),16);P+=String.fromCharCode((H&31)<<6|xe&63)}else P+=D.substr(M,6);M+=6}else if(H>=224){if(B-M>=9){var be=parseInt(D.substr(M+4,2),16),Qe=parseInt(D.substr(M+7,2),16);P+=String.fromCharCode((H&15)<<12|(be&63)<<6|Qe&63)}else P+=D.substr(M,9);M+=9}else P+=D.substr(M,3),M+=3}return P}function ve(D,P){function M(B){var H=Ee(B);return H.match(P.UNRESERVED)?H:B}return D.scheme&&(D.scheme=String(D.scheme).replace(P.PCT_ENCODED,M).toLowerCase().replace(P.NOT_SCHEME,"")),D.userinfo!==void 0&&(D.userinfo=String(D.userinfo).replace(P.PCT_ENCODED,M).replace(P.NOT_USERINFO,ce).replace(P.PCT_ENCODED,o)),D.host!==void 0&&(D.host=String(D.host).replace(P.PCT_ENCODED,M).toLowerCase().replace(P.NOT_HOST,ce).replace(P.PCT_ENCODED,o)),D.path!==void 0&&(D.path=String(D.path).replace(P.PCT_ENCODED,M).replace(D.scheme?P.NOT_PATH:P.NOT_PATH_NOSCHEME,ce).replace(P.PCT_ENCODED,o)),D.query!==void 0&&(D.query=String(D.query).replace(P.PCT_ENCODED,M).replace(P.NOT_QUERY,ce).replace(P.PCT_ENCODED,o)),D.fragment!==void 0&&(D.fragment=String(D.fragment).replace(P.PCT_ENCODED,M).replace(P.NOT_FRAGMENT,ce).replace(P.PCT_ENCODED,o)),D}function te(D){return D.replace(/^0*(.*)/,"$1")||"0"}function we(D,P){var M=D.match(P.IPV4ADDRESS)||[],B=m(M,2),H=B[1];return H?H.split(".").map(te).join("."):D}function Pe(D,P){var M=D.match(P.IPV6ADDRESS)||[],B=m(M,3),H=B[1],xe=B[2];if(H){for(var be=H.toLowerCase().split("::").reverse(),Qe=m(be,2),ot=Qe[0],bt=Qe[1],He=bt?bt.split(":").map(te):[],nt=ot.split(":").map(te),St=P.IPV4ADDRESS.test(nt[nt.length-1]),Re=St?7:8,ut=nt.length-Re,Ct=Array(Re),dt=0;dt<Re;++dt)Ct[dt]=He[dt]||nt[ut+dt]||"";St&&(Ct[Re-1]=we(Ct[Re-1],P));var gs=Ct.reduce(function(Rr,fn,wa){if(!fn||fn==="0"){var Fn=Rr[Rr.length-1];Fn&&Fn.index+Fn.length===wa?Fn.length++:Rr.push({index:wa,length:1})}return Rr},[]),un=gs.sort(function(Rr,fn){return fn.length-Rr.length})[0],dn=void 0;if(un&&un.length>1){var io=Ct.slice(0,un.index),xa=Ct.slice(un.index+un.length);dn=io.join(":")+"::"+xa.join(":")}else dn=Ct.join(":");return xe&&(dn+="%"+xe),dn}else return D}var De=/^(?:([^:\/?#]+):)?(?:\/\/((?:([^\/?#@]*)@)?(\[[^\/?#\]]+\]|[^\/?#:]*)(?:\:(\d*))?))?([^?#]*)(?:\?([^#]*))?(?:#((?:.|\n|\r)*))?/i,ee="".match(/(){0}/)[1]===void 0;function fe(D){var P=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{},M={},B=P.iri!==!1?f:d;P.reference==="suffix"&&(D=(P.scheme?P.scheme+":":"")+"//"+D);var H=D.match(De);if(H){ee?(M.scheme=H[1],M.userinfo=H[3],M.host=H[4],M.port=parseInt(H[5],10),M.path=H[6]||"",M.query=H[7],M.fragment=H[8],isNaN(M.port)&&(M.port=H[5])):(M.scheme=H[1]||void 0,M.userinfo=D.indexOf("@")!==-1?H[3]:void 0,M.host=D.indexOf("//")!==-1?H[4]:void 0,M.port=parseInt(H[5],10),M.path=H[6]||"",M.query=D.indexOf("?")!==-1?H[7]:void 0,M.fragment=D.indexOf("#")!==-1?H[8]:void 0,isNaN(M.port)&&(M.port=D.match(/\/\/(?:.|\n)*\:(?:\/|\?|\#|$)/)?H[4]:void 0)),M.host&&(M.host=Pe(we(M.host,B),B)),M.scheme===void 0&&M.userinfo===void 0&&M.host===void 0&&M.port===void 0&&!M.path&&M.query===void 0?M.reference="same-document":M.scheme===void 0?M.reference="relative":M.fragment===void 0?M.reference="absolute":M.reference="uri",P.reference&&P.reference!=="suffix"&&P.reference!==M.reference&&(M.error=M.error||"URI is not a "+P.reference+" reference.");var xe=Z[(P.scheme||M.scheme||"").toLowerCase()];if(!P.unicodeSupport&&(!xe||!xe.unicodeSupport)){if(M.host&&(P.domainHost||xe&&xe.domainHost))try{M.host=oe.toASCII(M.host.replace(B.PCT_ENCODED,Ee).toLowerCase())}catch(be){M.error=M.error||"Host's domain name can not be converted to ASCII via punycode: "+be}ve(M,d)}else ve(M,B);xe&&xe.parse&&xe.parse(M,P)}else M.error=M.error||"URI can not be parsed.";return M}function X(D,P){var M=P.iri!==!1?f:d,B=[];return D.userinfo!==void 0&&(B.push(D.userinfo),B.push("@")),D.host!==void 0&&B.push(Pe(we(String(D.host),M),M).replace(M.IPV6ADDRESS,function(H,xe,be){return"["+xe+(be?"%25"+be:"")+"]"})),(typeof D.port=="number"||typeof D.port=="string")&&(B.push(":"),B.push(String(D.port))),B.length?B.join(""):void 0}var ze=/^\.\.?\//,re=/^\/\.(\/|$)/,Me=/^\/\.\.(\/|$)/,Ue=/^\/?(?:.|\n)*?(?=\/|$)/;function Ne(D){for(var P=[];D.length;)if(D.match(ze))D=D.replace(ze,"");else if(D.match(re))D=D.replace(re,"/");else if(D.match(Me))D=D.replace(Me,"/"),P.pop();else if(D==="."||D==="..")D="";else{var M=D.match(Ue);if(M){var B=M[0];D=D.slice(B.length),P.push(B)}else throw new Error("Unexpected dot segment condition")}return P.join("")}function rt(D){var P=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{},M=P.iri?f:d,B=[],H=Z[(P.scheme||D.scheme||"").toLowerCase()];if(H&&H.serialize&&H.serialize(D,P),D.host&&!M.IPV6ADDRESS.test(D.host)){if(P.domainHost||H&&H.domainHost)try{D.host=P.iri?oe.toUnicode(D.host):oe.toASCII(D.host.replace(M.PCT_ENCODED,Ee).toLowerCase())}catch(Qe){D.error=D.error||"Host's domain name can not be converted to "+(P.iri?"Unicode":"ASCII")+" via punycode: "+Qe}}ve(D,M),P.reference!=="suffix"&&D.scheme&&(B.push(D.scheme),B.push(":"));var xe=X(D,P);if(xe!==void 0&&(P.reference!=="suffix"&&B.push("//"),B.push(xe),D.path&&D.path.charAt(0)!=="/"&&B.push("/")),D.path!==void 0){var be=D.path;!P.absolutePath&&(!H||!H.absolutePath)&&(be=Ne(be)),xe===void 0&&(be=be.replace(/^\/\//,"/%2F")),B.push(be)}return D.query!==void 0&&(B.push("?"),B.push(D.query)),D.fragment!==void 0&&(B.push("#"),B.push(D.fragment)),B.join("")}function pt(D,P){var M=arguments.length>2&&arguments[2]!==void 0?arguments[2]:{},B=arguments[3],H={};return B||(D=fe(rt(D,M),M),P=fe(rt(P,M),M)),M=M||{},!M.tolerant&&P.scheme?(H.scheme=P.scheme,H.userinfo=P.userinfo,H.host=P.host,H.port=P.port,H.path=Ne(P.path||""),H.query=P.query):(P.userinfo!==void 0||P.host!==void 0||P.port!==void 0?(H.userinfo=P.userinfo,H.host=P.host,H.port=P.port,H.path=Ne(P.path||""),H.query=P.query):(P.path?(P.path.charAt(0)==="/"?H.path=Ne(P.path):((D.userinfo!==void 0||D.host!==void 0||D.port!==void 0)&&!D.path?H.path="/"+P.path:D.path?H.path=D.path.slice(0,D.path.lastIndexOf("/")+1)+P.path:H.path=P.path,H.path=Ne(H.path)),H.query=P.query):(H.path=D.path,P.query!==void 0?H.query=P.query:H.query=D.query),H.userinfo=D.userinfo,H.host=D.host,H.port=D.port),H.scheme=D.scheme),H.fragment=P.fragment,H}function Hr(D,P,M){var B=c({scheme:"null"},M);return rt(pt(fe(D,B),fe(P,B),B,!0),B)}function zt(D,P){return typeof D=="string"?D=rt(fe(D,P),P):a(D)==="object"&&(D=fe(rt(D,P),P)),D}function hs(D,P,M){return typeof D=="string"?D=rt(fe(D,M),M):a(D)==="object"&&(D=rt(D,M)),typeof P=="string"?P=rt(fe(P,M),M):a(P)==="object"&&(P=rt(P,M)),D===P}function oo(D,P){return D&&D.toString().replace(!P||!P.iri?d.ESCAPE:f.ESCAPE,ce)}function Yt(D,P){return D&&D.toString().replace(!P||!P.iri?d.PCT_ENCODED:f.PCT_ENCODED,Ee)}var Br={scheme:"http",domainHost:!0,parse:function(P,M){return P.host||(P.error=P.error||"HTTP URIs must have a host."),P},serialize:function(P,M){var B=String(P.scheme).toLowerCase()==="https";return(P.port===(B?443:80)||P.port==="")&&(P.port=void 0),P.path||(P.path="/"),P}},ps={scheme:"https",domainHost:Br.domainHost,parse:Br.parse,serialize:Br.serialize};function jr(D){return typeof D.secure=="boolean"?D.secure:String(D.scheme).toLowerCase()==="wss"}var Dn={scheme:"ws",domainHost:!0,parse:function(P,M){var B=P;return B.secure=jr(B),B.resourceName=(B.path||"/")+(B.query?"?"+B.query:""),B.path=void 0,B.query=void 0,B},serialize:function(P,M){if((P.port===(jr(P)?443:80)||P.port==="")&&(P.port=void 0),typeof P.secure=="boolean"&&(P.scheme=P.secure?"wss":"ws",P.secure=void 0),P.resourceName){var B=P.resourceName.split("?"),H=m(B,2),xe=H[0],be=H[1];P.path=xe&&xe!=="/"?xe:void 0,P.query=be,P.resourceName=void 0}return P.fragment=void 0,P}},ms={scheme:"wss",domainHost:Dn.domainHost,parse:Dn.parse,serialize:Dn.serialize},ya={},vs="[A-Za-z0-9\\-\\.\\_\\~\\xA0-\\u200D\\u2010-\\u2029\\u202F-\\uD7FF\\uF900-\\uFDCF\\uFDF0-\\uFFEF]",ne="[0-9A-Fa-f]",Et=n(n("%[EFef]"+ne+"%"+ne+ne+"%"+ne+ne)+"|"+n("%[89A-Fa-f]"+ne+"%"+ne+ne)+"|"+n("%"+ne+ne)),Mn="[A-Za-z0-9\\!\\$\\%\\'\\*\\+\\-\\^\\_\\`\\{\\|\\}\\~]",$n="[\\!\\$\\%\\'\\(\\)\\*\\+\\,\\-\\.0-9\\<\\>A-Z\\x5E-\\x7E]",Yl=s($n,'[\\"\\\\]'),Jl="[\\!\\$\\'\\(\\)\\*\\+\\,\\;\\:\\@]",Xl=new RegExp(vs,"g"),de=new RegExp(Et,"g"),je=new RegExp(s("[^]",Mn,"[\\.]",'[\\"]',Yl),"g"),at=new RegExp(s("[^]",vs,Jl),"g"),Dt=at;function Nt(D){var P=Ee(D);return P.match(Xl)?P:D}var gg={scheme:"mailto",parse:function(P,M){var B=P,H=B.to=B.path?B.path.split(","):[];if(B.path=void 0,B.query){for(var xe=!1,be={},Qe=B.query.split("&"),ot=0,bt=Qe.length;ot<bt;++ot){var He=Qe[ot].split("=");switch(He[0]){case"to":for(var nt=He[1].split(","),St=0,Re=nt.length;St<Re;++St)H.push(nt[St]);break;case"subject":B.subject=Yt(He[1],M);break;case"body":B.body=Yt(He[1],M);break;default:xe=!0,be[Yt(He[0],M)]=Yt(He[1],M);break}}xe&&(B.headers=be)}B.query=void 0;for(var ut=0,Ct=H.length;ut<Ct;++ut){var dt=H[ut].split("@");if(dt[0]=Yt(dt[0]),M.unicodeSupport)dt[1]=Yt(dt[1],M).toLowerCase();else try{dt[1]=oe.toASCII(Yt(dt[1],M).toLowerCase())}catch(gs){B.error=B.error||"Email address's domain name can not be converted to ASCII via punycode: "+gs}H[ut]=dt.join("@")}return B},serialize:function(P,M){var B=P,H=l(P.to);if(H){for(var xe=0,be=H.length;xe<be;++xe){var Qe=String(H[xe]),ot=Qe.lastIndexOf("@"),bt=Qe.slice(0,ot).replace(de,Nt).replace(de,o).replace(je,ce),He=Qe.slice(ot+1);try{He=M.iri?oe.toUnicode(He):oe.toASCII(Yt(He,M).toLowerCase())}catch(ut){B.error=B.error||"Email address's domain name can not be converted to "+(M.iri?"Unicode":"ASCII")+" via punycode: "+ut}H[xe]=bt+"@"+He}B.path=H.join(",")}var nt=P.headers=P.headers||{};P.subject&&(nt.subject=P.subject),P.body&&(nt.body=P.body);var St=[];for(var Re in nt)nt[Re]!==ya[Re]&&St.push(Re.replace(de,Nt).replace(de,o).replace(at,ce)+"="+nt[Re].replace(de,Nt).replace(de,o).replace(Dt,ce));return St.length&&(B.query=St.join("&")),B}},PC=/^([^\:]+)\:(.*)/,yg={scheme:"urn",parse:function(P,M){var B=P.path&&P.path.match(PC),H=P;if(B){var xe=M.scheme||H.scheme||"urn",be=B[1].toLowerCase(),Qe=B[2],ot=xe+":"+(M.nid||be),bt=Z[ot];H.nid=be,H.nss=Qe,H.path=void 0,bt&&(H=bt.parse(H,M))}else H.error=H.error||"URN can not be parsed.";return H},serialize:function(P,M){var B=M.scheme||P.scheme||"urn",H=P.nid,xe=B+":"+(M.nid||H),be=Z[xe];be&&(P=be.serialize(P,M));var Qe=P,ot=P.nss;return Qe.path=(H||M.nid)+":"+ot,Qe}},NC=/^[0-9A-Fa-f]{8}(?:\-[0-9A-Fa-f]{4}){3}\-[0-9A-Fa-f]{12}$/,xg={scheme:"urn:uuid",parse:function(P,M){var B=P;return B.uuid=B.nss,B.nss=void 0,!M.tolerant&&(!B.uuid||!B.uuid.match(NC))&&(B.error=B.error||"UUID is not valid."),B},serialize:function(P,M){var B=P;return B.nss=(P.uuid||"").toLowerCase(),B}};Z[Br.scheme]=Br,Z[ps.scheme]=ps,Z[Dn.scheme]=Dn,Z[ms.scheme]=ms,Z[gg.scheme]=gg,Z[yg.scheme]=yg,Z[xg.scheme]=xg,r.SCHEMES=Z,r.pctEncChar=ce,r.pctDecChars=Ee,r.parse=fe,r.removeDotSegments=Ne,r.serialize=rt,r.resolveComponents=pt,r.resolve=Hr,r.normalize=zt,r.equal=hs,r.escapeComponent=oo,r.unescapeComponent=Yt,Object.defineProperty(r,"__esModule",{value:!0})})})(lm,lm.exports);var nM=lm.exports,lg=function t(e,r){if(e===r)return!0;if(e&&r&&typeof e=="object"&&typeof r=="object"){if(e.constructor!==r.constructor)return!1;var s,n,a;if(Array.isArray(e)){if(s=e.length,s!=r.length)return!1;for(n=s;n--!==0;)if(!t(e[n],r[n]))return!1;return!0}if(e.constructor===RegExp)return e.source===r.source&&e.flags===r.flags;if(e.valueOf!==Object.prototype.valueOf)return e.valueOf()===r.valueOf();if(e.toString!==Object.prototype.toString)return e.toString()===r.toString();if(a=Object.keys(e),s=a.length,s!==Object.keys(r).length)return!1;for(n=s;n--!==0;)if(!Object.prototype.hasOwnProperty.call(r,a[n]))return!1;for(n=s;n--!==0;){var o=a[n];if(!t(e[o],r[o]))return!1}return!0}return e!==e&&r!==r},sM=function(e){for(var r=0,s=e.length,n=0,a;n<s;)r++,a=e.charCodeAt(n++),a>=55296&&a<=56319&&n<s&&(a=e.charCodeAt(n),(a&64512)==56320&&n++);return r},Pi={copy:aM,checkDataType:cm,checkDataTypes:oM,coerceToTypes:iM,toHash:cg,getProperty:ug,escapeQuotes:dg,equal:lg,ucs2length:sM,varOccurences:uM,varReplace:dM,schemaHasRules:fM,schemaHasRulesExcept:hM,schemaUnknownRules:pM,toQuotedString:um,getPathExpr:mM,getPath:vM,getData:xM,unescapeFragment:wM,unescapeJsonPointer:hg,escapeFragment:bM,escapeJsonPointer:fg};function aM(t,e){e=e||{};for(var r in t)e[r]=t[r];return e}function cm(t,e,r,s){var n=s?" !== ":" === ",a=s?" || ":" && ",o=s?"!":"",l=s?"":"!";switch(t){case"null":return e+n+"null";case"array":return o+"Array.isArray("+e+")";case"object":return"("+o+e+a+"typeof "+e+n+'"object"'+a+l+"Array.isArray("+e+"))";case"integer":return"(typeof "+e+n+'"number"'+a+l+"("+e+" % 1)"+a+e+n+e+(r?a+o+"isFinite("+e+")":"")+")";case"number":return"(typeof "+e+n+'"'+t+'"'+(r?a+o+"isFinite("+e+")":"")+")";default:return"typeof "+e+n+'"'+t+'"'}}function oM(t,e,r){switch(t.length){case 1:return cm(t[0],e,r,!0);default:var s="",n=cg(t);n.array&&n.object&&(s=n.null?"(":"(!"+e+" || ",s+="typeof "+e+' !== "object")',delete n.null,delete n.array,delete n.object),n.number&&delete n.integer;for(var a in n)s+=(s?" && ":"")+cm(a,e,r,!0);return s}}var K0=cg(["string","number","integer","boolean","null"]);function iM(t,e){if(Array.isArray(e)){for(var r=[],s=0;s<e.length;s++){var n=e[s];(K0[n]||t==="array"&&n==="array")&&(r[r.length]=n)}if(r.length)return r}else{if(K0[e])return[e];if(t==="array"&&e==="array")return["array"]}}function cg(t){for(var e={},r=0;r<t.length;r++)e[t[r]]=!0;return e}var lM=/^[a-z$_][a-z$_0-9]*$/i,cM=/'|\\/g;function ug(t){return typeof t=="number"?"["+t+"]":lM.test(t)?"."+t:"['"+dg(t)+"']"}function dg(t){return t.replace(cM,"\\$&").replace(/\n/g,"\\n").replace(/\r/g,"\\r").replace(/\f/g,"\\f").replace(/\t/g,"\\t")}function uM(t,e){e+="[^0-9]";var r=t.match(new RegExp(e,"g"));return r?r.length:0}function dM(t,e,r){return e+="([^0-9])",r=r.replace(/\$/g,"$$$$"),t.replace(new RegExp(e,"g"),r+"$1")}function fM(t,e){if(typeof t=="boolean")return!t;for(var r in t)if(e[r])return!0}function hM(t,e,r){if(typeof t=="boolean")return!t&&r!="not";for(var s in t)if(s!=r&&e[s])return!0}function pM(t,e){if(typeof t!="boolean"){for(var r in t)if(!e[r])return r}}function um(t){return"'"+dg(t)+"'"}function mM(t,e,r,s){var n=r?"'/' + "+e+(s?"":".replace(/~/g, '~0').replace(/\\//g, '~1')"):s?"'[' + "+e+" + ']'":"'[\\'' + "+e+" + '\\']'";return JE(t,n)}function vM(t,e,r){var s=um(r?"/"+fg(e):ug(e));return JE(t,s)}var gM=/^\/(?:[^~]|~0|~1)*$/,yM=/^([0-9]+)(#|\/(?:[^~]|~0|~1)*)?$/;function xM(t,e,r){var s,n,a,o;if(t==="")return"rootData";if(t[0]=="/"){if(!gM.test(t))throw new Error("Invalid JSON-pointer: "+t);n=t,a="rootData"}else{if(o=t.match(yM),!o)throw new Error("Invalid JSON-pointer: "+t);if(s=+o[1],n=o[2],n=="#"){if(s>=e)throw new Error("Cannot access property/index "+s+" levels up, current level is "+e);return r[e-s]}if(s>e)throw new Error("Cannot access data "+s+" levels up, current level is "+e);if(a="data"+(e-s||""),!n)return a}for(var l=a,c=n.split("/"),u=0;u<c.length;u++){var d=c[u];d&&(a+=ug(hg(d)),l+=" && "+a)}return l}function JE(t,e){return t=='""'?e:(t+" + "+e).replace(/([^\\])' \+ '/g,"$1")}function wM(t){return hg(decodeURIComponent(t))}function bM(t){return encodeURIComponent(fg(t))}function fg(t){return t.replace(/~/g,"~0").replace(/\//g,"~1")}function hg(t){return t.replace(/~1/g,"/").replace(/~0/g,"~")}var SM=Pi,XE=_M;function _M(t){SM.copy(t,this)}var eC={exports:{}},Hs=eC.exports=function(t,e,r){typeof e=="function"&&(r=e,e={}),r=e.cb||r;var s=typeof r=="function"?r:r.pre||function(){},n=r.post||function(){};au(e,s,n,t,"",t)};Hs.keywords={additionalItems:!0,items:!0,contains:!0,additionalProperties:!0,propertyNames:!0,not:!0};Hs.arrayKeywords={items:!0,allOf:!0,anyOf:!0,oneOf:!0};Hs.propsKeywords={definitions:!0,properties:!0,patternProperties:!0,dependencies:!0};Hs.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 au(t,e,r,s,n,a,o,l,c,u){if(s&&typeof s=="object"&&!Array.isArray(s)){e(s,n,a,o,l,c,u);for(var d in s){var f=s[d];if(Array.isArray(f)){if(d in Hs.arrayKeywords)for(var m=0;m<f.length;m++)au(t,e,r,f[m],n+"/"+d+"/"+m,a,n,d,s,m)}else if(d in Hs.propsKeywords){if(f&&typeof f=="object")for(var p in f)au(t,e,r,f[p],n+"/"+d+"/"+EM(p),a,n,d,s,p)}else(d in Hs.keywords||t.allKeys&&!(d in Hs.skipKeywords))&&au(t,e,r,f,n+"/"+d,a,n,d,s)}r(s,n,a,o,l,c,u)}}function EM(t){return t.replace(/~/g,"~0").replace(/\//g,"~1")}var CM=eC.exports,Zl=nM,Q0=lg,Jd=Pi,sd=XE,kM=CM,pg=ga;ga.normalizeId=ra;ga.fullPath=ad;ga.url=od;ga.ids=TM;ga.inlineRef=dm;ga.schema=Xd;function ga(t,e,r){var s=this._refs[r];if(typeof s=="string")if(this._refs[s])s=this._refs[s];else return ga.call(this,t,e,s);if(s=s||this._schemas[r],s instanceof sd)return dm(s.schema,this._opts.inlineRefs)?s.schema:s.validate||this._compile(s);var n=Xd.call(this,e,r),a,o,l;return n&&(a=n.schema,e=n.root,l=n.baseId),a instanceof sd?o=a.validate||t.call(this,a.schema,e,void 0,l):a!==void 0&&(o=dm(a,this._opts.inlineRefs)?a:t.call(this,a,e,void 0,l)),o}function Xd(t,e){var r=Zl.parse(e),s=rC(r),n=ad(this._getId(t.schema));if(Object.keys(t.schema).length===0||s!==n){var a=ra(s),o=this._refs[a];if(typeof o=="string")return PM.call(this,t,o,r);if(o instanceof sd)o.validate||this._compile(o),t=o;else if(o=this._schemas[a],o instanceof sd){if(o.validate||this._compile(o),a==ra(e))return{schema:o,root:t,baseId:n};t=o}else return;if(!t.schema)return;n=ad(this._getId(t.schema))}return tC.call(this,r,n,t.schema,t)}function PM(t,e,r){var s=Xd.call(this,t,e);if(s){var n=s.schema,a=s.baseId;t=s.root;var o=this._getId(n);return o&&(a=od(a,o)),tC.call(this,r,a,n,t)}}var NM=Jd.toHash(["properties","patternProperties","enum","dependencies","definitions"]);function tC(t,e,r,s){if(t.fragment=t.fragment||"",t.fragment.slice(0,1)=="/"){for(var n=t.fragment.split("/"),a=1;a<n.length;a++){var o=n[a];if(o){if(o=Jd.unescapeFragment(o),r=r[o],r===void 0)break;var l;if(!NM[o]&&(l=this._getId(r),l&&(e=od(e,l)),r.$ref)){var c=od(e,r.$ref),u=Xd.call(this,s,c);u&&(r=u.schema,s=u.root,e=u.baseId)}}}if(r!==void 0&&r!==s.schema)return{schema:r,root:s,baseId:e}}}var jM=Jd.toHash(["type","format","pattern","maxLength","minLength","maxProperties","minProperties","maxItems","minItems","maximum","minimum","uniqueItems","multipleOf","required","enum"]);function dm(t,e){if(e===!1)return!1;if(e===void 0||e===!0)return fm(t);if(e)return hm(t)<=e}function fm(t){var e;if(Array.isArray(t)){for(var r=0;r<t.length;r++)if(e=t[r],typeof e=="object"&&!fm(e))return!1}else for(var s in t)if(s=="$ref"||(e=t[s],typeof e=="object"&&!fm(e)))return!1;return!0}function hm(t){var e=0,r;if(Array.isArray(t)){for(var s=0;s<t.length;s++)if(r=t[s],typeof r=="object"&&(e+=hm(r)),e==1/0)return 1/0}else for(var n in t){if(n=="$ref")return 1/0;if(jM[n])e++;else if(r=t[n],typeof r=="object"&&(e+=hm(r)+1),e==1/0)return 1/0}return e}function ad(t,e){e!==!1&&(t=ra(t));var r=Zl.parse(t);return rC(r)}function rC(t){return Zl.serialize(t).split("#")[0]+"#"}var RM=/#\/?$/;function ra(t){return t?t.replace(RM,""):""}function od(t,e){return e=ra(e),Zl.resolve(t,e)}function TM(t){var e=ra(this._getId(t)),r={"":e},s={"":ad(e,!1)},n={},a=this;return kM(t,{allKeys:!0},function(o,l,c,u,d,f,m){if(l!==""){var p=a._getId(o),w=r[u],h=s[u]+"/"+d;if(m!==void 0&&(h+="/"+(typeof m=="number"?m:Jd.escapeFragment(m))),typeof p=="string"){p=w=ra(w?Zl.resolve(w,p):p);var g=a._refs[p];if(typeof g=="string"&&(g=a._refs[g]),g&&g.schema){if(!Q0(o,g.schema))throw new Error('id "'+p+'" resolves to more than one schema')}else if(p!=ra(h))if(p[0]=="#"){if(n[p]&&!Q0(o,n[p]))throw new Error('id "'+p+'" resolves to more than one schema');n[p]=o}else a._refs[p]=h}r[l]=w,s[l]=h}}),n}var th=pg,mg={Validation:G0(AM),MissingRef:G0(vg)};function AM(t){this.message="validation failed",this.errors=t,this.ajv=this.validation=!0}vg.message=function(t,e){return"can't resolve reference "+e+" from id "+t};function vg(t,e,r){this.message=r||vg.message(t,e),this.missingRef=th.url(t,e),this.missingSchema=th.normalizeId(th.fullPath(this.missingRef))}function G0(t){return t.prototype=Object.create(Error.prototype),t.prototype.constructor=t,t}var nC=function(t,e){e||(e={}),typeof e=="function"&&(e={cmp:e});var r=typeof e.cycles=="boolean"?e.cycles:!1,s=e.cmp&&function(a){return function(o){return function(l,c){var u={key:l,value:o[l]},d={key:c,value:o[c]};return a(u,d)}}}(e.cmp),n=[];return function a(o){if(o&&o.toJSON&&typeof o.toJSON=="function"&&(o=o.toJSON()),o!==void 0){if(typeof o=="number")return isFinite(o)?""+o:"null";if(typeof o!="object")return JSON.stringify(o);var l,c;if(Array.isArray(o)){for(c="[",l=0;l<o.length;l++)l&&(c+=","),c+=a(o[l])||"null";return c+"]"}if(o===null)return"null";if(n.indexOf(o)!==-1){if(r)return JSON.stringify("__cycle__");throw new TypeError("Converting circular structure to JSON")}var u=n.push(o)-1,d=Object.keys(o).sort(s&&s(o));for(c="",l=0;l<d.length;l++){var f=d[l],m=a(o[f]);m&&(c&&(c+=","),c+=JSON.stringify(f)+":"+m)}return n.splice(u,1),"{"+c+"}"}}(t)},sC=function(e,r,s){var n="",a=e.schema.$async===!0,o=e.util.schemaHasRulesExcept(e.schema,e.RULES.all,"$ref"),l=e.self._getId(e.schema);if(e.opts.strictKeywords){var c=e.util.schemaUnknownRules(e.schema,e.RULES.keywords);if(c){var u="unknown keyword: "+c;if(e.opts.strictKeywords==="log")e.logger.warn(u);else throw new Error(u)}}if(e.isTop&&(n+=" var validate = ",a&&(e.async=!0,n+="async "),n+="function(data, dataPath, parentData, parentDataProperty, rootData) { 'use strict'; ",l&&(e.opts.sourceCode||e.opts.processCode)&&(n+=" "+("/*# sourceURL="+l+" */")+" ")),typeof e.schema=="boolean"||!(o||e.schema.$ref)){var r="false schema",d=e.level,f=e.dataLevel,m=e.schema[r],p=e.schemaPath+e.util.getProperty(r),w=e.errSchemaPath+"/"+r,E=!e.opts.allErrors,T,h="data"+(f||""),S="valid"+d;if(e.schema===!1){e.isTop?E=!0:n+=" var "+S+" = false; ";var g=g||[];g.push(n),n="",e.createErrors!==!1?(n+=" { keyword: '"+(T||"false schema")+"' , dataPath: (dataPath || '') + "+e.errorPath+" , schemaPath: "+e.util.toQuotedString(w)+" , params: {} ",e.opts.messages!==!1&&(n+=" , message: 'boolean schema is false' "),e.opts.verbose&&(n+=" , schema: false , parentSchema: validate.schema"+e.schemaPath+" , data: "+h+" "),n+=" } "):n+=" {} ";var v=n;n=g.pop(),!e.compositeRule&&E?e.async?n+=" throw new ValidationError(["+v+"]); ":n+=" validate.errors = ["+v+"]; return false; ":n+=" var err = "+v+"; if (vErrors === null) vErrors = [err]; else vErrors.push(err); errors++; "}else e.isTop?a?n+=" return data; ":n+=" validate.errors = null; return true; ":n+=" var "+S+" = true; ";return e.isTop&&(n+=" }; return validate; "),n}if(e.isTop){var y=e.isTop,d=e.level=0,f=e.dataLevel=0,h="data";if(e.rootId=e.resolve.fullPath(e.self._getId(e.root.schema)),e.baseId=e.baseId||e.rootId,delete e.isTop,e.dataPathArr=[""],e.schema.default!==void 0&&e.opts.useDefaults&&e.opts.strictDefaults){var b="default is ignored in the schema root";if(e.opts.strictDefaults==="log")e.logger.warn(b);else throw new Error(b)}n+=" var vErrors = null; ",n+=" var errors = 0; ",n+=" if (rootData === undefined) rootData = data; "}else{var d=e.level,f=e.dataLevel,h="data"+(f||"");if(l&&(e.baseId=e.resolve.url(e.baseId,l)),a&&!e.async)throw new Error("async schema in sync schema");n+=" var errs_"+d+" = errors;"}var S="valid"+d,E=!e.opts.allErrors,k="",R="",T,N=e.schema.type,O=Array.isArray(N);if(N&&e.opts.nullable&&e.schema.nullable===!0&&(O?N.indexOf("null")==-1&&(N=N.concat("null")):N!="null"&&(N=[N,"null"],O=!0)),O&&N.length==1&&(N=N[0],O=!1),e.schema.$ref&&o){if(e.opts.extendRefs=="fail")throw new Error('$ref: validation keywords used in schema at path "'+e.errSchemaPath+'" (see option extendRefs)');e.opts.extendRefs!==!0&&(o=!1,e.logger.warn('$ref: keywords ignored in schema at path "'+e.errSchemaPath+'"'))}if(e.schema.$comment&&e.opts.$comment&&(n+=" "+e.RULES.all.$comment.code(e,"$comment")),N){if(e.opts.coerceTypes)var j=e.util.coerceToTypes(e.opts.coerceTypes,N);var _=e.RULES.types[N];if(j||O||_===!0||_&&!re(_)){var p=e.schemaPath+".type",w=e.errSchemaPath+"/type",p=e.schemaPath+".type",w=e.errSchemaPath+"/type",A=O?"checkDataTypes":"checkDataType";if(n+=" if ("+e.util[A](N,h,e.opts.strictNumbers,!0)+") { ",j){var C="dataType"+d,z="coerced"+d;n+=" var "+C+" = typeof "+h+"; var "+z+" = undefined; ",e.opts.coerceTypes=="array"&&(n+=" if ("+C+" == 'object' && Array.isArray("+h+") && "+h+".length == 1) { "+h+" = "+h+"[0]; "+C+" = typeof "+h+"; if ("+e.util.checkDataType(e.schema.type,h,e.opts.strictNumbers)+") "+z+" = "+h+"; } "),n+=" if ("+z+" !== undefined) ; ";var U=j;if(U)for(var K,$=-1,F=U.length-1;$<F;)K=U[$+=1],K=="string"?n+=" else if ("+C+" == 'number' || "+C+" == 'boolean') "+z+" = '' + "+h+"; else if ("+h+" === null) "+z+" = ''; ":K=="number"||K=="integer"?(n+=" else if ("+C+" == 'boolean' || "+h+" === null || ("+C+" == 'string' && "+h+" && "+h+" == +"+h+" ",K=="integer"&&(n+=" && !("+h+" % 1)"),n+=")) "+z+" = +"+h+"; "):K=="boolean"?n+=" else if ("+h+" === 'false' || "+h+" === 0 || "+h+" === null) "+z+" = false; else if ("+h+" === 'true' || "+h+" === 1) "+z+" = true; ":K=="null"?n+=" else if ("+h+" === '' || "+h+" === 0 || "+h+" === false) "+z+" = null; ":e.opts.coerceTypes=="array"&&K=="array"&&(n+=" else if ("+C+" == 'string' || "+C+" == 'number' || "+C+" == 'boolean' || "+h+" == null) "+z+" = ["+h+"]; ");n+=" else { ";var g=g||[];g.push(n),n="",e.createErrors!==!1?(n+=" { keyword: '"+(T||"type")+"' , dataPath: (dataPath || '') + "+e.errorPath+" , schemaPath: "+e.util.toQuotedString(w)+" , params: { type: '",O?n+=""+N.join(","):n+=""+N,n+="' } ",e.opts.messages!==!1&&(n+=" , message: 'should be ",O?n+=""+N.join(","):n+=""+N,n+="' "),e.opts.verbose&&(n+=" , schema: validate.schema"+p+" , parentSchema: validate.schema"+e.schemaPath+" , data: "+h+" "),n+=" } "):n+=" {} ";var v=n;n=g.pop(),!e.compositeRule&&E?e.async?n+=" throw new ValidationError(["+v+"]); ":n+=" validate.errors = ["+v+"]; return false; ":n+=" var err = "+v+"; if (vErrors === null) vErrors = [err]; else vErrors.push(err); errors++; ",n+=" } if ("+z+" !== undefined) { ";var V=f?"data"+(f-1||""):"parentData",ae=f?e.dataPathArr[f]:"parentDataProperty";n+=" "+h+" = "+z+"; ",f||(n+="if ("+V+" !== undefined)"),n+=" "+V+"["+ae+"] = "+z+"; } "}else{var g=g||[];g.push(n),n="",e.createErrors!==!1?(n+=" { keyword: '"+(T||"type")+"' , dataPath: (dataPath || '') + "+e.errorPath+" , schemaPath: "+e.util.toQuotedString(w)+" , params: { type: '",O?n+=""+N.join(","):n+=""+N,n+="' } ",e.opts.messages!==!1&&(n+=" , message: 'should be ",O?n+=""+N.join(","):n+=""+N,n+="' "),e.opts.verbose&&(n+=" , schema: validate.schema"+p+" , parentSchema: validate.schema"+e.schemaPath+" , data: "+h+" "),n+=" } "):n+=" {} ";var v=n;n=g.pop(),!e.compositeRule&&E?e.async?n+=" throw new ValidationError(["+v+"]); ":n+=" validate.errors = ["+v+"]; return false; ":n+=" var err = "+v+"; if (vErrors === null) vErrors = [err]; else vErrors.push(err); errors++; "}n+=" } "}}if(e.schema.$ref&&!o)n+=" "+e.RULES.all.$ref.code(e,"$ref")+" ",E&&(n+=" } if (errors === ",y?n+="0":n+="errs_"+d,n+=") { ",R+="}");else{var se=e.RULES;if(se){for(var _,W=-1,L=se.length-1;W<L;)if(_=se[W+=1],re(_)){if(_.type&&(n+=" if ("+e.util.checkDataType(_.type,h,e.opts.strictNumbers)+") { "),e.opts.useDefaults){if(_.type=="object"&&e.schema.properties){var m=e.schema.properties,Q=Object.keys(m),oe=Q;if(oe)for(var Z,ce=-1,Ee=oe.length-1;ce<Ee;){Z=oe[ce+=1];var ve=m[Z];if(ve.default!==void 0){var te=h+e.util.getProperty(Z);if(e.compositeRule){if(e.opts.strictDefaults){var b="default is ignored for: "+te;if(e.opts.strictDefaults==="log")e.logger.warn(b);else throw new Error(b)}}else n+=" if ("+te+" === undefined ",e.opts.useDefaults=="empty"&&(n+=" || "+te+" === null || "+te+" === '' "),n+=" ) "+te+" = ",e.opts.useDefaults=="shared"?n+=" "+e.useDefault(ve.default)+" ":n+=" "+JSON.stringify(ve.default)+" ",n+="; "}}}else if(_.type=="array"&&Array.isArray(e.schema.items)){var we=e.schema.items;if(we){for(var ve,$=-1,Pe=we.length-1;$<Pe;)if(ve=we[$+=1],ve.default!==void 0){var te=h+"["+$+"]";if(e.compositeRule){if(e.opts.strictDefaults){var b="default is ignored for: "+te;if(e.opts.strictDefaults==="log")e.logger.warn(b);else throw new Error(b)}}else n+=" if ("+te+" === undefined ",e.opts.useDefaults=="empty"&&(n+=" || "+te+" === null || "+te+" === '' "),n+=" ) "+te+" = ",e.opts.useDefaults=="shared"?n+=" "+e.useDefault(ve.default)+" ":n+=" "+JSON.stringify(ve.default)+" ",n+="; "}}}}var De=_.rules;if(De){for(var ee,fe=-1,X=De.length-1;fe<X;)if(ee=De[fe+=1],Me(ee)){var ze=ee.code(e,ee.keyword,_.type);ze&&(n+=" "+ze+" ",E&&(k+="}"))}}if(E&&(n+=" "+k+" ",k=""),_.type&&(n+=" } ",N&&N===_.type&&!j)){n+=" else { ";var p=e.schemaPath+".type",w=e.errSchemaPath+"/type",g=g||[];g.push(n),n="",e.createErrors!==!1?(n+=" { keyword: '"+(T||"type")+"' , dataPath: (dataPath || '') + "+e.errorPath+" , schemaPath: "+e.util.toQuotedString(w)+" , params: { type: '",O?n+=""+N.join(","):n+=""+N,n+="' } ",e.opts.messages!==!1&&(n+=" , message: 'should be ",O?n+=""+N.join(","):n+=""+N,n+="' "),e.opts.verbose&&(n+=" , schema: validate.schema"+p+" , parentSchema: validate.schema"+e.schemaPath+" , data: "+h+" "),n+=" } "):n+=" {} ";var v=n;n=g.pop(),!e.compositeRule&&E?e.async?n+=" throw new ValidationError(["+v+"]); ":n+=" validate.errors = ["+v+"]; return false; ":n+=" var err = "+v+"; if (vErrors === null) vErrors = [err]; else vErrors.push(err); errors++; ",n+=" } "}E&&(n+=" if (errors === ",y?n+="0":n+="errs_"+d,n+=") { ",R+="}")}}}E&&(n+=" "+R+" "),y?(a?(n+=" if (errors === 0) return data; ",n+=" else throw new ValidationError(vErrors); "):(n+=" validate.errors = vErrors; ",n+=" return errors === 0; "),n+=" }; return validate;"):n+=" var "+S+" = errors === errs_"+d+";";function re(Ne){for(var rt=Ne.rules,pt=0;pt<rt.length;pt++)if(Me(rt[pt]))return!0}function Me(Ne){return e.schema[Ne.keyword]!==void 0||Ne.implements&&Ue(Ne)}function Ue(Ne){for(var rt=Ne.implements,pt=0;pt<rt.length;pt++)if(e.schema[rt[pt]]!==void 0)return!0}return n},Oc=pg,id=Pi,aC=mg,OM=nC,Z0=sC,IM=id.ucs2length,DM=lg,MM=aC.Validation,$M=pm;function pm(t,e,r,s){var n=this,a=this._opts,o=[void 0],l={},c=[],u={},d=[],f={},m=[];e=e||{schema:t,refVal:o,refs:l};var p=FM.call(this,t,e,s),w=this._compilations[p.index];if(p.compiling)return w.callValidate=b;var h=this._formats,g=this.RULES;try{var v=S(t,e,r,s);w.validate=v;var y=w.callValidate;return y&&(y.schema=v.schema,y.errors=null,y.refs=v.refs,y.refVal=v.refVal,y.root=v.root,y.$async=v.$async,a.sourceCode&&(y.source=v.source)),v}finally{LM.call(this,t,e,s)}function b(){var A=w.validate,C=A.apply(this,arguments);return b.errors=A.errors,C}function S(A,C,z,U){var K=!C||C&&C.schema==A;if(C.schema!=e.schema)return pm.call(n,A,C,z,U);var $=A.$async===!0,F=Z0({isTop:!0,schema:A,isRoot:K,baseId:U,root:C,schemaPath:"",errSchemaPath:"#",errorPath:'""',MissingRefError:aC.MissingRef,RULES:g,validate:Z0,util:id,resolve:Oc,resolveRef:E,usePattern:O,useDefault:j,useCustomRule:_,opts:a,formats:h,logger:n.logger,self:n});F=Ic(o,VM)+Ic(c,UM)+Ic(d,zM)+Ic(m,qM)+F,a.processCode&&(F=a.processCode(F,A));var V;try{var ae=new Function("self","RULES","formats","root","refVal","defaults","customRules","equal","ucs2length","ValidationError",F);V=ae(n,g,h,e,o,d,m,DM,IM,MM),o[0]=V}catch(se){throw n.logger.error("Error compiling schema, function code:",F),se}return V.schema=A,V.errors=null,V.refs=l,V.refVal=o,V.root=K?V:C,$&&(V.$async=!0),a.sourceCode===!0&&(V.source={code:F,patterns:c,defaults:d}),V}function E(A,C,z){C=Oc.url(A,C);var U=l[C],K,$;if(U!==void 0)return K=o[U],$="refVal["+U+"]",N(K,$);if(!z&&e.refs){var F=e.refs[C];if(F!==void 0)return K=e.refVal[F],$=k(C,K),N(K,$)}$=k(C);var V=Oc.call(n,S,e,C);if(V===void 0){var ae=r&&r[C];ae&&(V=Oc.inlineRef(ae,a.inlineRefs)?ae:pm.call(n,ae,e,r,A))}if(V===void 0)R(C);else return T(C,V),N(V,$)}function k(A,C){var z=o.length;return o[z]=C,l[A]=z,"refVal"+z}function R(A){delete l[A]}function T(A,C){var z=l[A];o[z]=C}function N(A,C){return typeof A=="object"||typeof A=="boolean"?{code:C,schema:A,inline:!0}:{code:C,$async:A&&!!A.$async}}function O(A){var C=u[A];return C===void 0&&(C=u[A]=c.length,c[C]=A),"pattern"+C}function j(A){switch(typeof A){case"boolean":case"number":return""+A;case"string":return id.toQuotedString(A);case"object":if(A===null)return"null";var C=OM(A),z=f[C];return z===void 0&&(z=f[C]=d.length,d[z]=A),"default"+z}}function _(A,C,z,U){if(n._opts.validateSchema!==!1){var K=A.definition.dependencies;if(K&&!K.every(function(oe){return Object.prototype.hasOwnProperty.call(z,oe)}))throw new Error("parent schema must have all required keywords: "+K.join(","));var $=A.definition.validateSchema;if($){var F=$(C);if(!F){var V="keyword schema is invalid: "+n.errorsText($.errors);if(n._opts.validateSchema=="log")n.logger.error(V);else throw new Error(V)}}}var ae=A.definition.compile,se=A.definition.inline,W=A.definition.macro,L;if(ae)L=ae.call(n,C,z,U);else if(W)L=W.call(n,C,z,U),a.validateSchema!==!1&&n.validateSchema(L,!0);else if(se)L=se.call(n,U,A.keyword,C,z);else if(L=A.definition.validate,!L)return;if(L===void 0)throw new Error('custom keyword "'+A.keyword+'"failed to compile');var Q=m.length;return m[Q]=L,{code:"customRule"+Q,validate:L}}}function FM(t,e,r){var s=oC.call(this,t,e,r);return s>=0?{index:s,compiling:!0}:(s=this._compilations.length,this._compilations[s]={schema:t,root:e,baseId:r},{index:s,compiling:!1})}function LM(t,e,r){var s=oC.call(this,t,e,r);s>=0&&this._compilations.splice(s,1)}function oC(t,e,r){for(var s=0;s<this._compilations.length;s++){var n=this._compilations[s];if(n.schema==t&&n.root==e&&n.baseId==r)return s}return-1}function UM(t,e){return"var pattern"+t+" = new RegExp("+id.toQuotedString(e[t])+");"}function zM(t){return"var default"+t+" = defaults["+t+"];"}function VM(t,e){return e[t]===void 0?"":"var refVal"+t+" = refVal["+t+"];"}function qM(t){return"var customRule"+t+" = customRules["+t+"];"}function Ic(t,e){if(!t.length)return"";for(var r="",s=0;s<t.length;s++)r+=e(s,t);return r}var iC={exports:{}},ef=iC.exports=function(){this._cache={}};ef.prototype.put=function(e,r){this._cache[e]=r};ef.prototype.get=function(e){return this._cache[e]};ef.prototype.del=function(e){delete this._cache[e]};ef.prototype.clear=function(){this._cache={}};var HM=iC.exports,BM=Pi,WM=/^(\d\d\d\d)-(\d\d)-(\d\d)$/,KM=[0,31,28,31,30,31,30,31,31,30,31,30,31],QM=/^(\d\d):(\d\d):(\d\d)(\.\d+)?(z|[+-]\d\d(?::?\d\d)?)?$/i,lC=/^(?=.{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,GM=/^(?:[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,ZM=/^(?:[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,cC=/^(?:(?:[^\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,uC=/^(?:(?:http[s\u017F]?|ftp):\/\/)(?:(?:[\0-\x08\x0E-\x1F!-\x9F\xA1-\u167F\u1681-\u1FFF\u200B-\u2027\u202A-\u202E\u2030-\u205E\u2060-\u2FFF\u3001-\uD7FF\uE000-\uFEFE\uFF00-\uFFFF]|[\uD800-\uDBFF][\uDC00-\uDFFF]|[\uD800-\uDBFF](?![\uDC00-\uDFFF])|(?:[^\uD800-\uDBFF]|^)[\uDC00-\uDFFF])+(?::(?:[\0-\x08\x0E-\x1F!-\x9F\xA1-\u167F\u1681-\u1FFF\u200B-\u2027\u202A-\u202E\u2030-\u205E\u2060-\u2FFF\u3001-\uD7FF\uE000-\uFEFE\uFF00-\uFFFF]|[\uD800-\uDBFF][\uDC00-\uDFFF]|[\uD800-\uDBFF](?![\uDC00-\uDFFF])|(?:[^\uD800-\uDBFF]|^)[\uDC00-\uDFFF])*)?@)?(?:(?!10(?:\.[0-9]{1,3}){3})(?!127(?:\.[0-9]{1,3}){3})(?!169\.254(?:\.[0-9]{1,3}){2})(?!192\.168(?:\.[0-9]{1,3}){2})(?!172\.(?:1[6-9]|2[0-9]|3[01])(?:\.[0-9]{1,3}){2})(?:[1-9][0-9]?|1[0-9][0-9]|2[01][0-9]|22[0-3])(?:\.(?:1?[0-9]{1,2}|2[0-4][0-9]|25[0-5])){2}(?:\.(?:[1-9][0-9]?|1[0-9][0-9]|2[0-4][0-9]|25[0-4]))|(?:(?:(?:[0-9a-z\xA1-\uD7FF\uE000-\uFFFF]|[\uD800-\uDBFF](?![\uDC00-\uDFFF])|(?:[^\uD800-\uDBFF]|^)[\uDC00-\uDFFF])+-)*(?:[0-9a-z\xA1-\uD7FF\uE000-\uFFFF]|[\uD800-\uDBFF](?![\uDC00-\uDFFF])|(?:[^\uD800-\uDBFF]|^)[\uDC00-\uDFFF])+)(?:\.(?:(?:[0-9a-z\xA1-\uD7FF\uE000-\uFFFF]|[\uD800-\uDBFF](?![\uDC00-\uDFFF])|(?:[^\uD800-\uDBFF]|^)[\uDC00-\uDFFF])+-)*(?:[0-9a-z\xA1-\uD7FF\uE000-\uFFFF]|[\uD800-\uDBFF](?![\uDC00-\uDFFF])|(?:[^\uD800-\uDBFF]|^)[\uDC00-\uDFFF])+)*(?:\.(?:(?:[a-z\xA1-\uD7FF\uE000-\uFFFF]|[\uD800-\uDBFF](?![\uDC00-\uDFFF])|(?:[^\uD800-\uDBFF]|^)[\uDC00-\uDFFF]){2,})))(?::[0-9]{2,5})?(?:\/(?:[\0-\x08\x0E-\x1F!-\x9F\xA1-\u167F\u1681-\u1FFF\u200B-\u2027\u202A-\u202E\u2030-\u205E\u2060-\u2FFF\u3001-\uD7FF\uE000-\uFEFE\uFF00-\uFFFF]|[\uD800-\uDBFF][\uDC00-\uDFFF]|[\uD800-\uDBFF](?![\uDC00-\uDFFF])|(?:[^\uD800-\uDBFF]|^)[\uDC00-\uDFFF])*)?$/i,dC=/^(?:urn:uuid:)?[0-9a-f]{8}-(?:[0-9a-f]{4}-){3}[0-9a-f]{12}$/i,fC=/^(?:\/(?:[^~/]|~0|~1)*)*$/,hC=/^#(?:\/(?:[a-z0-9_\-.!$&'()*+,;:=@]|%[0-9a-f]{2}|~0|~1)*)*$/i,pC=/^(?:0|[1-9][0-9]*)(?:#|(?:\/(?:[^~/]|~0|~1)*)*)$/,YM=tf;function tf(t){return t=t=="full"?"full":"fast",BM.copy(tf[t])}tf.fast={date:/^\d\d\d\d-[0-1]\d-[0-3]\d$/,time:/^(?:[0-2]\d:[0-5]\d:[0-5]\d|23:59:60)(?:\.\d+)?(?:z|[+-]\d\d(?::?\d\d)?)?$/i,"date-time":/^\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,uri:/^(?:[a-z][a-z0-9+\-.]*:)(?:\/?\/)?[^\s]*$/i,"uri-reference":/^(?:(?:[a-z][a-z0-9+\-.]*:)?\/?\/)?(?:[^\\\s#][^\s#]*)?(?:#[^\\\s]*)?$/i,"uri-template":cC,url:uC,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,hostname:lC,ipv4:/^(?:(?:25[0-5]|2[0-4]\d|[01]?\d\d?)\.){3}(?:25[0-5]|2[0-4]\d|[01]?\d\d?)$/,ipv6:/^\s*(?:(?:(?:[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}))|:)))(?:%.+)?\s*$/i,regex:gC,uuid:dC,"json-pointer":fC,"json-pointer-uri-fragment":hC,"relative-json-pointer":pC};tf.full={date:mC,time:vC,"date-time":e$,uri:r$,"uri-reference":ZM,"uri-template":cC,url:uC,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:lC,ipv4:/^(?:(?:25[0-5]|2[0-4]\d|[01]?\d\d?)\.){3}(?:25[0-5]|2[0-4]\d|[01]?\d\d?)$/,ipv6:/^\s*(?:(?:(?:[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}))|:)))(?:%.+)?\s*$/i,regex:gC,uuid:dC,"json-pointer":fC,"json-pointer-uri-fragment":hC,"relative-json-pointer":pC};function JM(t){return t%4===0&&(t%100!==0||t%400===0)}function mC(t){var e=t.match(WM);if(!e)return!1;var r=+e[1],s=+e[2],n=+e[3];return s>=1&&s<=12&&n>=1&&n<=(s==2&&JM(r)?29:KM[s])}function vC(t,e){var r=t.match(QM);if(!r)return!1;var s=r[1],n=r[2],a=r[3],o=r[5];return(s<=23&&n<=59&&a<=59||s==23&&n==59&&a==60)&&(!e||o)}var XM=/t|\s/i;function e$(t){var e=t.split(XM);return e.length==2&&mC(e[0])&&vC(e[1],!0)}var t$=/\/|:/;function r$(t){return t$.test(t)&&GM.test(t)}var n$=/[^\\]\\Z/;function gC(t){if(n$.test(t))return!1;try{return new RegExp(t),!0}catch{return!1}}var s$=function(e,r,s){var n=" ",a=e.level,o=e.dataLevel,l=e.schema[r],c=e.errSchemaPath+"/"+r,u=!e.opts.allErrors,d="data"+(o||""),f="valid"+a,m,p;if(l=="#"||l=="#/")e.isRoot?(m=e.async,p="validate"):(m=e.root.schema.$async===!0,p="root.refVal[0]");else{var w=e.resolveRef(e.baseId,l,e.isRoot);if(w===void 0){var h=e.MissingRefError.message(e.baseId,l);if(e.opts.missingRefs=="fail"){e.logger.error(h);var g=g||[];g.push(n),n="",e.createErrors!==!1?(n+=" { keyword: '$ref' , dataPath: (dataPath || '') + "+e.errorPath+" , schemaPath: "+e.util.toQuotedString(c)+" , params: { ref: '"+e.util.escapeQuotes(l)+"' } ",e.opts.messages!==!1&&(n+=" , message: 'can\\'t resolve reference "+e.util.escapeQuotes(l)+"' "),e.opts.verbose&&(n+=" , schema: "+e.util.toQuotedString(l)+" , parentSchema: validate.schema"+e.schemaPath+" , data: "+d+" "),n+=" } "):n+=" {} ";var v=n;n=g.pop(),!e.compositeRule&&u?e.async?n+=" throw new ValidationError(["+v+"]); ":n+=" validate.errors = ["+v+"]; return false; ":n+=" var err = "+v+"; if (vErrors === null) vErrors = [err]; else vErrors.push(err); errors++; ",u&&(n+=" if (false) { ")}else if(e.opts.missingRefs=="ignore")e.logger.warn(h),u&&(n+=" if (true) { ");else throw new e.MissingRefError(e.baseId,l,h)}else if(w.inline){var y=e.util.copy(e);y.level++;var b="valid"+y.level;y.schema=w.schema,y.schemaPath="",y.errSchemaPath=l;var S=e.validate(y).replace(/validate\.schema/g,w.code);n+=" "+S+" ",u&&(n+=" if ("+b+") { ")}else m=w.$async===!0||e.async&&w.$async!==!1,p=w.code}if(p){var g=g||[];g.push(n),n="",e.opts.passContext?n+=" "+p+".call(this, ":n+=" "+p+"( ",n+=" "+d+", (dataPath || '')",e.errorPath!='""'&&(n+=" + "+e.errorPath);var E=o?"data"+(o-1||""):"parentData",k=o?e.dataPathArr[o]:"parentDataProperty";n+=" , "+E+" , "+k+", rootData) ";var R=n;if(n=g.pop(),m){if(!e.async)throw new Error("async schema referenced by sync schema");u&&(n+=" var "+f+"; "),n+=" try { await "+R+"; ",u&&(n+=" "+f+" = true; "),n+=" } catch (e) { if (!(e instanceof ValidationError)) throw e; if (vErrors === null) vErrors = e.errors; else vErrors = vErrors.concat(e.errors); errors = vErrors.length; ",u&&(n+=" "+f+" = false; "),n+=" } ",u&&(n+=" if ("+f+") { ")}else n+=" if (!"+R+") { if (vErrors === null) vErrors = "+p+".errors; else vErrors = vErrors.concat("+p+".errors); errors = vErrors.length; } ",u&&(n+=" else { ")}return n},a$=function(e,r,s){var n=" ",a=e.schema[r],o=e.schemaPath+e.util.getProperty(r),l=e.errSchemaPath+"/"+r,c=!e.opts.allErrors,u=e.util.copy(e),d="";u.level++;var f="valid"+u.level,m=u.baseId,p=!0,w=a;if(w)for(var h,g=-1,v=w.length-1;g<v;)h=w[g+=1],(e.opts.strictKeywords?typeof h=="object"&&Object.keys(h).length>0||h===!1:e.util.schemaHasRules(h,e.RULES.all))&&(p=!1,u.schema=h,u.schemaPath=o+"["+g+"]",u.errSchemaPath=l+"/"+g,n+=" "+e.validate(u)+" ",u.baseId=m,c&&(n+=" if ("+f+") { ",d+="}"));return c&&(p?n+=" if (true) { ":n+=" "+d.slice(0,-1)+" "),n},o$=function(e,r,s){var n=" ",a=e.level,o=e.dataLevel,l=e.schema[r],c=e.schemaPath+e.util.getProperty(r),u=e.errSchemaPath+"/"+r,d=!e.opts.allErrors,f="data"+(o||""),m="valid"+a,p="errs__"+a,w=e.util.copy(e),h="";w.level++;var g="valid"+w.level,v=l.every(function(T){return e.opts.strictKeywords?typeof T=="object"&&Object.keys(T).length>0||T===!1:e.util.schemaHasRules(T,e.RULES.all)});if(v){var y=w.baseId;n+=" var "+p+" = errors; var "+m+" = false; ";var b=e.compositeRule;e.compositeRule=w.compositeRule=!0;var S=l;if(S)for(var E,k=-1,R=S.length-1;k<R;)E=S[k+=1],w.schema=E,w.schemaPath=c+"["+k+"]",w.errSchemaPath=u+"/"+k,n+=" "+e.validate(w)+" ",w.baseId=y,n+=" "+m+" = "+m+" || "+g+"; if (!"+m+") { ",h+="}";e.compositeRule=w.compositeRule=b,n+=" "+h+" if (!"+m+") { var err = ",e.createErrors!==!1?(n+=" { keyword: 'anyOf' , dataPath: (dataPath || '') + "+e.errorPath+" , schemaPath: "+e.util.toQuotedString(u)+" , params: {} ",e.opts.messages!==!1&&(n+=" , message: 'should match some schema in anyOf' "),e.opts.verbose&&(n+=" , schema: validate.schema"+c+" , parentSchema: validate.schema"+e.schemaPath+" , data: "+f+" "),n+=" } "):n+=" {} ",n+="; if (vErrors === null) vErrors = [err]; else vErrors.push(err); errors++; ",!e.compositeRule&&d&&(e.async?n+=" throw new ValidationError(vErrors); ":n+=" validate.errors = vErrors; return false; "),n+=" } else { errors = "+p+"; if (vErrors !== null) { if ("+p+") vErrors.length = "+p+"; else vErrors = null; } ",e.opts.allErrors&&(n+=" } ")}else d&&(n+=" if (true) { ");return n},i$=function(e,r,s){var n=" ",a=e.schema[r],o=e.errSchemaPath+"/"+r;e.opts.allErrors;var l=e.util.toQuotedString(a);return e.opts.$comment===!0?n+=" console.log("+l+");":typeof e.opts.$comment=="function"&&(n+=" self._opts.$comment("+l+", "+e.util.toQuotedString(o)+", validate.root.schema);"),n},l$=function(e,r,s){var n=" ",a=e.level,o=e.dataLevel,l=e.schema[r],c=e.schemaPath+e.util.getProperty(r),u=e.errSchemaPath+"/"+r,d=!e.opts.allErrors,f="data"+(o||""),m="valid"+a,p=e.opts.$data&&l&&l.$data;p&&(n+=" var schema"+a+" = "+e.util.getData(l.$data,o,e.dataPathArr)+"; "),p||(n+=" var schema"+a+" = validate.schema"+c+";"),n+="var "+m+" = equal("+f+", schema"+a+"); if (!"+m+") { ";var w=w||[];w.push(n),n="",e.createErrors!==!1?(n+=" { keyword: 'const' , dataPath: (dataPath || '') + "+e.errorPath+" , schemaPath: "+e.util.toQuotedString(u)+" , params: { allowedValue: schema"+a+" } ",e.opts.messages!==!1&&(n+=" , message: 'should be equal to constant' "),e.opts.verbose&&(n+=" , schema: validate.schema"+c+" , parentSchema: validate.schema"+e.schemaPath+" , data: "+f+" "),n+=" } "):n+=" {} ";var h=n;return n=w.pop(),!e.compositeRule&&d?e.async?n+=" throw new ValidationError(["+h+"]); ":n+=" validate.errors = ["+h+"]; return false; ":n+=" var err = "+h+"; if (vErrors === null) vErrors = [err]; else vErrors.push(err); errors++; ",n+=" }",d&&(n+=" else { "),n},c$=function(e,r,s){var n=" ",a=e.level,o=e.dataLevel,l=e.schema[r],c=e.schemaPath+e.util.getProperty(r),u=e.errSchemaPath+"/"+r,d=!e.opts.allErrors,f="data"+(o||""),m="valid"+a,p="errs__"+a,w=e.util.copy(e),h="";w.level++;var g="valid"+w.level,v="i"+a,y=w.dataLevel=e.dataLevel+1,b="data"+y,S=e.baseId,E=e.opts.strictKeywords?typeof l=="object"&&Object.keys(l).length>0||l===!1:e.util.schemaHasRules(l,e.RULES.all);if(n+="var "+p+" = errors;var "+m+";",E){var k=e.compositeRule;e.compositeRule=w.compositeRule=!0,w.schema=l,w.schemaPath=c,w.errSchemaPath=u,n+=" var "+g+" = false; for (var "+v+" = 0; "+v+" < "+f+".length; "+v+"++) { ",w.errorPath=e.util.getPathExpr(e.errorPath,v,e.opts.jsonPointers,!0);var R=f+"["+v+"]";w.dataPathArr[y]=v;var T=e.validate(w);w.baseId=S,e.util.varOccurences(T,b)<2?n+=" "+e.util.varReplace(T,b,R)+" ":n+=" var "+b+" = "+R+"; "+T+" ",n+=" if ("+g+") break; } ",e.compositeRule=w.compositeRule=k,n+=" "+h+" if (!"+g+") {"}else n+=" if ("+f+".length == 0) {";var N=N||[];N.push(n),n="",e.createErrors!==!1?(n+=" { keyword: 'contains' , dataPath: (dataPath || '') + "+e.errorPath+" , schemaPath: "+e.util.toQuotedString(u)+" , params: {} ",e.opts.messages!==!1&&(n+=" , message: 'should contain a valid item' "),e.opts.verbose&&(n+=" , schema: validate.schema"+c+" , parentSchema: validate.schema"+e.schemaPath+" , data: "+f+" "),n+=" } "):n+=" {} ";var O=n;return n=N.pop(),!e.compositeRule&&d?e.async?n+=" throw new ValidationError(["+O+"]); ":n+=" validate.errors = ["+O+"]; return false; ":n+=" var err = "+O+"; if (vErrors === null) vErrors = [err]; else vErrors.push(err); errors++; ",n+=" } else { ",E&&(n+=" errors = "+p+"; if (vErrors !== null) { if ("+p+") vErrors.length = "+p+"; else vErrors = null; } "),e.opts.allErrors&&(n+=" } "),n},u$=function(e,r,s){var n=" ",a=e.level,o=e.dataLevel,l=e.schema[r],c=e.schemaPath+e.util.getProperty(r),u=e.errSchemaPath+"/"+r,d=!e.opts.allErrors,f="data"+(o||""),m="errs__"+a,p=e.util.copy(e),w="";p.level++;var h="valid"+p.level,g={},v={},y=e.opts.ownProperties;for(k in l)if(k!="__proto__"){var b=l[k],S=Array.isArray(b)?v:g;S[k]=b}n+="var "+m+" = errors;";var E=e.errorPath;n+="var missing"+a+";";for(var k in v)if(S=v[k],S.length){if(n+=" if ( "+f+e.util.getProperty(k)+" !== undefined ",y&&(n+=" && Object.prototype.hasOwnProperty.call("+f+", '"+e.util.escapeQuotes(k)+"') "),d){n+=" && ( ";var R=S;if(R)for(var T,N=-1,O=R.length-1;N<O;){T=R[N+=1],N&&(n+=" || ");var j=e.util.getProperty(T),_=f+j;n+=" ( ( "+_+" === undefined ",y&&(n+=" || ! Object.prototype.hasOwnProperty.call("+f+", '"+e.util.escapeQuotes(T)+"') "),n+=") && (missing"+a+" = "+e.util.toQuotedString(e.opts.jsonPointers?T:j)+") ) "}n+=")) { ";var A="missing"+a,C="' + "+A+" + '";e.opts._errorDataPathProperty&&(e.errorPath=e.opts.jsonPointers?e.util.getPathExpr(E,A,!0):E+" + "+A);var z=z||[];z.push(n),n="",e.createErrors!==!1?(n+=" { keyword: 'dependencies' , dataPath: (dataPath || '') + "+e.errorPath+" , schemaPath: "+e.util.toQuotedString(u)+" , params: { property: '"+e.util.escapeQuotes(k)+"', missingProperty: '"+C+"', depsCount: "+S.length+", deps: '"+e.util.escapeQuotes(S.length==1?S[0]:S.join(", "))+"' } ",e.opts.messages!==!1&&(n+=" , message: 'should have ",S.length==1?n+="property "+e.util.escapeQuotes(S[0]):n+="properties "+e.util.escapeQuotes(S.join(", ")),n+=" when property "+e.util.escapeQuotes(k)+" is present' "),e.opts.verbose&&(n+=" , schema: validate.schema"+c+" , parentSchema: validate.schema"+e.schemaPath+" , data: "+f+" "),n+=" } "):n+=" {} ";var U=n;n=z.pop(),!e.compositeRule&&d?e.async?n+=" throw new ValidationError(["+U+"]); ":n+=" validate.errors = ["+U+"]; return false; ":n+=" var err = "+U+"; if (vErrors === null) vErrors = [err]; else vErrors.push(err); errors++; "}else{n+=" ) { ";var K=S;if(K)for(var T,$=-1,F=K.length-1;$<F;){T=K[$+=1];var j=e.util.getProperty(T),C=e.util.escapeQuotes(T),_=f+j;e.opts._errorDataPathProperty&&(e.errorPath=e.util.getPath(E,T,e.opts.jsonPointers)),n+=" if ( "+_+" === undefined ",y&&(n+=" || ! Object.prototype.hasOwnProperty.call("+f+", '"+e.util.escapeQuotes(T)+"') "),n+=") { var err = ",e.createErrors!==!1?(n+=" { keyword: 'dependencies' , dataPath: (dataPath || '') + "+e.errorPath+" , schemaPath: "+e.util.toQuotedString(u)+" , params: { property: '"+e.util.escapeQuotes(k)+"', missingProperty: '"+C+"', depsCount: "+S.length+", deps: '"+e.util.escapeQuotes(S.length==1?S[0]:S.join(", "))+"' } ",e.opts.messages!==!1&&(n+=" , message: 'should have ",S.length==1?n+="property "+e.util.escapeQuotes(S[0]):n+="properties "+e.util.escapeQuotes(S.join(", ")),n+=" when property "+e.util.escapeQuotes(k)+" is present' "),e.opts.verbose&&(n+=" , schema: validate.schema"+c+" , parentSchema: validate.schema"+e.schemaPath+" , data: "+f+" "),n+=" } "):n+=" {} ",n+="; if (vErrors === null) vErrors = [err]; else vErrors.push(err); errors++; } "}}n+=" } ",d&&(w+="}",n+=" else { ")}e.errorPath=E;var V=p.baseId;for(var k in g){var b=g[k];(e.opts.strictKeywords?typeof b=="object"&&Object.keys(b).length>0||b===!1:e.util.schemaHasRules(b,e.RULES.all))&&(n+=" "+h+" = true; if ( "+f+e.util.getProperty(k)+" !== undefined ",y&&(n+=" && Object.prototype.hasOwnProperty.call("+f+", '"+e.util.escapeQuotes(k)+"') "),n+=") { ",p.schema=b,p.schemaPath=c+e.util.getProperty(k),p.errSchemaPath=u+"/"+e.util.escapeFragment(k),n+=" "+e.validate(p)+" ",p.baseId=V,n+=" } ",d&&(n+=" if ("+h+") { ",w+="}"))}return d&&(n+=" "+w+" if ("+m+" == errors) {"),n},d$=function(e,r,s){var n=" ",a=e.level,o=e.dataLevel,l=e.schema[r],c=e.schemaPath+e.util.getProperty(r),u=e.errSchemaPath+"/"+r,d=!e.opts.allErrors,f="data"+(o||""),m="valid"+a,p=e.opts.$data&&l&&l.$data;p&&(n+=" var schema"+a+" = "+e.util.getData(l.$data,o,e.dataPathArr)+"; ");var w="i"+a,h="schema"+a;p||(n+=" var "+h+" = validate.schema"+c+";"),n+="var "+m+";",p&&(n+=" if (schema"+a+" === undefined) "+m+" = true; else if (!Array.isArray(schema"+a+")) "+m+" = false; else {"),n+=""+m+" = false;for (var "+w+"=0; "+w+"<"+h+".length; "+w+"++) if (equal("+f+", "+h+"["+w+"])) { "+m+" = true; break; }",p&&(n+=" } "),n+=" if (!"+m+") { ";var g=g||[];g.push(n),n="",e.createErrors!==!1?(n+=" { keyword: 'enum' , dataPath: (dataPath || '') + "+e.errorPath+" , schemaPath: "+e.util.toQuotedString(u)+" , params: { allowedValues: schema"+a+" } ",e.opts.messages!==!1&&(n+=" , message: 'should be equal to one of the allowed values' "),e.opts.verbose&&(n+=" , schema: validate.schema"+c+" , parentSchema: validate.schema"+e.schemaPath+" , data: "+f+" "),n+=" } "):n+=" {} ";var v=n;return n=g.pop(),!e.compositeRule&&d?e.async?n+=" throw new ValidationError(["+v+"]); ":n+=" validate.errors = ["+v+"]; return false; ":n+=" var err = "+v+"; if (vErrors === null) vErrors = [err]; else vErrors.push(err); errors++; ",n+=" }",d&&(n+=" else { "),n},f$=function(e,r,s){var n=" ",a=e.level,o=e.dataLevel,l=e.schema[r],c=e.schemaPath+e.util.getProperty(r),u=e.errSchemaPath+"/"+r,d=!e.opts.allErrors,f="data"+(o||"");if(e.opts.format===!1)return d&&(n+=" if (true) { "),n;var m=e.opts.$data&&l&&l.$data,p;m?(n+=" var schema"+a+" = "+e.util.getData(l.$data,o,e.dataPathArr)+"; ",p="schema"+a):p=l;var w=e.opts.unknownFormats,h=Array.isArray(w);if(m){var g="format"+a,v="isObject"+a,y="formatType"+a;n+=" var "+g+" = formats["+p+"]; var "+v+" = typeof "+g+" == 'object' && !("+g+" instanceof RegExp) && "+g+".validate; var "+y+" = "+v+" && "+g+".type || 'string'; if ("+v+") { ",e.async&&(n+=" var async"+a+" = "+g+".async; "),n+=" "+g+" = "+g+".validate; } if ( ",m&&(n+=" ("+p+" !== undefined && typeof "+p+" != 'string') || "),n+=" (",w!="ignore"&&(n+=" ("+p+" && !"+g+" ",h&&(n+=" && self._opts.unknownFormats.indexOf("+p+") == -1 "),n+=") || "),n+=" ("+g+" && "+y+" == '"+s+"' && !(typeof "+g+" == 'function' ? ",e.async?n+=" (async"+a+" ? await "+g+"("+f+") : "+g+"("+f+")) ":n+=" "+g+"("+f+") ",n+=" : "+g+".test("+f+"))))) {"}else{var g=e.formats[l];if(!g){if(w=="ignore")return e.logger.warn('unknown format "'+l+'" ignored in schema at path "'+e.errSchemaPath+'"'),d&&(n+=" if (true) { "),n;if(h&&w.indexOf(l)>=0)return d&&(n+=" if (true) { "),n;throw new Error('unknown format "'+l+'" is used in schema at path "'+e.errSchemaPath+'"')}var v=typeof g=="object"&&!(g instanceof RegExp)&&g.validate,y=v&&g.type||"string";if(v){var b=g.async===!0;g=g.validate}if(y!=s)return d&&(n+=" if (true) { "),n;if(b){if(!e.async)throw new Error("async format in sync schema");var S="formats"+e.util.getProperty(l)+".validate";n+=" if (!(await "+S+"("+f+"))) { "}else{n+=" if (! ";var S="formats"+e.util.getProperty(l);v&&(S+=".validate"),typeof g=="function"?n+=" "+S+"("+f+") ":n+=" "+S+".test("+f+") ",n+=") { "}}var E=E||[];E.push(n),n="",e.createErrors!==!1?(n+=" { keyword: 'format' , dataPath: (dataPath || '') + "+e.errorPath+" , schemaPath: "+e.util.toQuotedString(u)+" , params: { format: ",m?n+=""+p:n+=""+e.util.toQuotedString(l),n+=" } ",e.opts.messages!==!1&&(n+=` , message: 'should match format "`,m?n+="' + "+p+" + '":n+=""+e.util.escapeQuotes(l),n+=`"' `),e.opts.verbose&&(n+=" , schema: ",m?n+="validate.schema"+c:n+=""+e.util.toQuotedString(l),n+=" , parentSchema: validate.schema"+e.schemaPath+" , data: "+f+" "),n+=" } "):n+=" {} ";var k=n;return n=E.pop(),!e.compositeRule&&d?e.async?n+=" throw new ValidationError(["+k+"]); ":n+=" validate.errors = ["+k+"]; return false; ":n+=" var err = "+k+"; if (vErrors === null) vErrors = [err]; else vErrors.push(err); errors++; ",n+=" } ",d&&(n+=" else { "),n},h$=function(e,r,s){var n=" ",a=e.level,o=e.dataLevel,l=e.schema[r],c=e.schemaPath+e.util.getProperty(r),u=e.errSchemaPath+"/"+r,d=!e.opts.allErrors,f="data"+(o||""),m="valid"+a,p="errs__"+a,w=e.util.copy(e);w.level++;var h="valid"+w.level,g=e.schema.then,v=e.schema.else,y=g!==void 0&&(e.opts.strictKeywords?typeof g=="object"&&Object.keys(g).length>0||g===!1:e.util.schemaHasRules(g,e.RULES.all)),b=v!==void 0&&(e.opts.strictKeywords?typeof v=="object"&&Object.keys(v).length>0||v===!1:e.util.schemaHasRules(v,e.RULES.all)),S=w.baseId;if(y||b){var E;w.createErrors=!1,w.schema=l,w.schemaPath=c,w.errSchemaPath=u,n+=" var "+p+" = errors; var "+m+" = true; ";var k=e.compositeRule;e.compositeRule=w.compositeRule=!0,n+=" "+e.validate(w)+" ",w.baseId=S,w.createErrors=!0,n+=" errors = "+p+"; if (vErrors !== null) { if ("+p+") vErrors.length = "+p+"; else vErrors = null; } ",e.compositeRule=w.compositeRule=k,y?(n+=" if ("+h+") { ",w.schema=e.schema.then,w.schemaPath=e.schemaPath+".then",w.errSchemaPath=e.errSchemaPath+"/then",n+=" "+e.validate(w)+" ",w.baseId=S,n+=" "+m+" = "+h+"; ",y&&b?(E="ifClause"+a,n+=" var "+E+" = 'then'; "):E="'then'",n+=" } ",b&&(n+=" else { ")):n+=" if (!"+h+") { ",b&&(w.schema=e.schema.else,w.schemaPath=e.schemaPath+".else",w.errSchemaPath=e.errSchemaPath+"/else",n+=" "+e.validate(w)+" ",w.baseId=S,n+=" "+m+" = "+h+"; ",y&&b?(E="ifClause"+a,n+=" var "+E+" = 'else'; "):E="'else'",n+=" } "),n+=" if (!"+m+") { var err = ",e.createErrors!==!1?(n+=" { keyword: 'if' , dataPath: (dataPath || '') + "+e.errorPath+" , schemaPath: "+e.util.toQuotedString(u)+" , params: { failingKeyword: "+E+" } ",e.opts.messages!==!1&&(n+=` , message: 'should match "' + `+E+` + '" schema' `),e.opts.verbose&&(n+=" , schema: validate.schema"+c+" , parentSchema: validate.schema"+e.schemaPath+" , data: "+f+" "),n+=" } "):n+=" {} ",n+="; if (vErrors === null) vErrors = [err]; else vErrors.push(err); errors++; ",!e.compositeRule&&d&&(e.async?n+=" throw new ValidationError(vErrors); ":n+=" validate.errors = vErrors; return false; "),n+=" } ",d&&(n+=" else { ")}else d&&(n+=" if (true) { ");return n},p$=function(e,r,s){var n=" ",a=e.level,o=e.dataLevel,l=e.schema[r],c=e.schemaPath+e.util.getProperty(r),u=e.errSchemaPath+"/"+r,d=!e.opts.allErrors,f="data"+(o||""),m="valid"+a,p="errs__"+a,w=e.util.copy(e),h="";w.level++;var g="valid"+w.level,v="i"+a,y=w.dataLevel=e.dataLevel+1,b="data"+y,S=e.baseId;if(n+="var "+p+" = errors;var "+m+";",Array.isArray(l)){var E=e.schema.additionalItems;if(E===!1){n+=" "+m+" = "+f+".length <= "+l.length+"; ";var k=u;u=e.errSchemaPath+"/additionalItems",n+=" if (!"+m+") { ";var R=R||[];R.push(n),n="",e.createErrors!==!1?(n+=" { keyword: 'additionalItems' , dataPath: (dataPath || '') + "+e.errorPath+" , schemaPath: "+e.util.toQuotedString(u)+" , params: { limit: "+l.length+" } ",e.opts.messages!==!1&&(n+=" , message: 'should NOT have more than "+l.length+" items' "),e.opts.verbose&&(n+=" , schema: false , parentSchema: validate.schema"+e.schemaPath+" , data: "+f+" "),n+=" } "):n+=" {} ";var T=n;n=R.pop(),!e.compositeRule&&d?e.async?n+=" throw new ValidationError(["+T+"]); ":n+=" validate.errors = ["+T+"]; return false; ":n+=" var err = "+T+"; if (vErrors === null) vErrors = [err]; else vErrors.push(err); errors++; ",n+=" } ",u=k,d&&(h+="}",n+=" else { ")}var N=l;if(N){for(var O,j=-1,_=N.length-1;j<_;)if(O=N[j+=1],e.opts.strictKeywords?typeof O=="object"&&Object.keys(O).length>0||O===!1:e.util.schemaHasRules(O,e.RULES.all)){n+=" "+g+" = true; if ("+f+".length > "+j+") { ";var A=f+"["+j+"]";w.schema=O,w.schemaPath=c+"["+j+"]",w.errSchemaPath=u+"/"+j,w.errorPath=e.util.getPathExpr(e.errorPath,j,e.opts.jsonPointers,!0),w.dataPathArr[y]=j;var C=e.validate(w);w.baseId=S,e.util.varOccurences(C,b)<2?n+=" "+e.util.varReplace(C,b,A)+" ":n+=" var "+b+" = "+A+"; "+C+" ",n+=" } ",d&&(n+=" if ("+g+") { ",h+="}")}}if(typeof E=="object"&&(e.opts.strictKeywords?typeof E=="object"&&Object.keys(E).length>0||E===!1:e.util.schemaHasRules(E,e.RULES.all))){w.schema=E,w.schemaPath=e.schemaPath+".additionalItems",w.errSchemaPath=e.errSchemaPath+"/additionalItems",n+=" "+g+" = true; if ("+f+".length > "+l.length+") { for (var "+v+" = "+l.length+"; "+v+" < "+f+".length; "+v+"++) { ",w.errorPath=e.util.getPathExpr(e.errorPath,v,e.opts.jsonPointers,!0);var A=f+"["+v+"]";w.dataPathArr[y]=v;var C=e.validate(w);w.baseId=S,e.util.varOccurences(C,b)<2?n+=" "+e.util.varReplace(C,b,A)+" ":n+=" var "+b+" = "+A+"; "+C+" ",d&&(n+=" if (!"+g+") break; "),n+=" } } ",d&&(n+=" if ("+g+") { ",h+="}")}}else if(e.opts.strictKeywords?typeof l=="object"&&Object.keys(l).length>0||l===!1:e.util.schemaHasRules(l,e.RULES.all)){w.schema=l,w.schemaPath=c,w.errSchemaPath=u,n+=" for (var "+v+" = 0; "+v+" < "+f+".length; "+v+"++) { ",w.errorPath=e.util.getPathExpr(e.errorPath,v,e.opts.jsonPointers,!0);var A=f+"["+v+"]";w.dataPathArr[y]=v;var C=e.validate(w);w.baseId=S,e.util.varOccurences(C,b)<2?n+=" "+e.util.varReplace(C,b,A)+" ":n+=" var "+b+" = "+A+"; "+C+" ",d&&(n+=" if (!"+g+") break; "),n+=" }"}return d&&(n+=" "+h+" if ("+p+" == errors) {"),n},Y0=function(e,r,s){var n=" ",a=e.level,o=e.dataLevel,l=e.schema[r],c=e.schemaPath+e.util.getProperty(r),u=e.errSchemaPath+"/"+r,d=!e.opts.allErrors,S,f="data"+(o||""),m=e.opts.$data&&l&&l.$data,p;m?(n+=" var schema"+a+" = "+e.util.getData(l.$data,o,e.dataPathArr)+"; ",p="schema"+a):p=l;var w=r=="maximum",h=w?"exclusiveMaximum":"exclusiveMinimum",g=e.schema[h],v=e.opts.$data&&g&&g.$data,y=w?"<":">",b=w?">":"<",S=void 0;if(!(m||typeof l=="number"||l===void 0))throw new Error(r+" must be number");if(!(v||g===void 0||typeof g=="number"||typeof g=="boolean"))throw new Error(h+" must be number or boolean");if(v){var E=e.util.getData(g.$data,o,e.dataPathArr),k="exclusive"+a,R="exclType"+a,T="exclIsNumber"+a,N="op"+a,O="' + "+N+" + '";n+=" var schemaExcl"+a+" = "+E+"; ",E="schemaExcl"+a,n+=" var "+k+"; var "+R+" = typeof "+E+"; if ("+R+" != 'boolean' && "+R+" != 'undefined' && "+R+" != 'number') { ";var S=h,j=j||[];j.push(n),n="",e.createErrors!==!1?(n+=" { keyword: '"+(S||"_exclusiveLimit")+"' , dataPath: (dataPath || '') + "+e.errorPath+" , schemaPath: "+e.util.toQuotedString(u)+" , params: {} ",e.opts.messages!==!1&&(n+=" , message: '"+h+" should be boolean' "),e.opts.verbose&&(n+=" , schema: validate.schema"+c+" , parentSchema: validate.schema"+e.schemaPath+" , data: "+f+" "),n+=" } "):n+=" {} ";var _=n;n=j.pop(),!e.compositeRule&&d?e.async?n+=" throw new ValidationError(["+_+"]); ":n+=" validate.errors = ["+_+"]; return false; ":n+=" var err = "+_+"; if (vErrors === null) vErrors = [err]; else vErrors.push(err); errors++; ",n+=" } else if ( ",m&&(n+=" ("+p+" !== undefined && typeof "+p+" != 'number') || "),n+=" "+R+" == 'number' ? ( ("+k+" = "+p+" === undefined || "+E+" "+y+"= "+p+") ? "+f+" "+b+"= "+E+" : "+f+" "+b+" "+p+" ) : ( ("+k+" = "+E+" === true) ? "+f+" "+b+"= "+p+" : "+f+" "+b+" "+p+" ) || "+f+" !== "+f+") { var op"+a+" = "+k+" ? '"+y+"' : '"+y+"='; ",l===void 0&&(S=h,u=e.errSchemaPath+"/"+h,p=E,m=v)}else{var T=typeof g=="number",O=y;if(T&&m){var N="'"+O+"'";n+=" if ( ",m&&(n+=" ("+p+" !== undefined && typeof "+p+" != 'number') || "),n+=" ( "+p+" === undefined || "+g+" "+y+"= "+p+" ? "+f+" "+b+"= "+g+" : "+f+" "+b+" "+p+" ) || "+f+" !== "+f+") { "}else{T&&l===void 0?(k=!0,S=h,u=e.errSchemaPath+"/"+h,p=g,b+="="):(T&&(p=Math[w?"min":"max"](g,l)),g===(T?p:!0)?(k=!0,S=h,u=e.errSchemaPath+"/"+h,b+="="):(k=!1,O+="="));var N="'"+O+"'";n+=" if ( ",m&&(n+=" ("+p+" !== undefined && typeof "+p+" != 'number') || "),n+=" "+f+" "+b+" "+p+" || "+f+" !== "+f+") { "}}S=S||r;var j=j||[];j.push(n),n="",e.createErrors!==!1?(n+=" { keyword: '"+(S||"_limit")+"' , dataPath: (dataPath || '') + "+e.errorPath+" , schemaPath: "+e.util.toQuotedString(u)+" , params: { comparison: "+N+", limit: "+p+", exclusive: "+k+" } ",e.opts.messages!==!1&&(n+=" , message: 'should be "+O+" ",m?n+="' + "+p:n+=""+p+"'"),e.opts.verbose&&(n+=" , schema: ",m?n+="validate.schema"+c:n+=""+l,n+=" , parentSchema: validate.schema"+e.schemaPath+" , data: "+f+" "),n+=" } "):n+=" {} ";var _=n;return n=j.pop(),!e.compositeRule&&d?e.async?n+=" throw new ValidationError(["+_+"]); ":n+=" validate.errors = ["+_+"]; return false; ":n+=" var err = "+_+"; if (vErrors === null) vErrors = [err]; else vErrors.push(err); errors++; ",n+=" } ",d&&(n+=" else { "),n},J0=function(e,r,s){var n=" ",a=e.level,o=e.dataLevel,l=e.schema[r],c=e.schemaPath+e.util.getProperty(r),u=e.errSchemaPath+"/"+r,d=!e.opts.allErrors,h,f="data"+(o||""),m=e.opts.$data&&l&&l.$data,p;if(m?(n+=" var schema"+a+" = "+e.util.getData(l.$data,o,e.dataPathArr)+"; ",p="schema"+a):p=l,!(m||typeof l=="number"))throw new Error(r+" must be number");var w=r=="maxItems"?">":"<";n+="if ( ",m&&(n+=" ("+p+" !== undefined && typeof "+p+" != 'number') || "),n+=" "+f+".length "+w+" "+p+") { ";var h=r,g=g||[];g.push(n),n="",e.createErrors!==!1?(n+=" { keyword: '"+(h||"_limitItems")+"' , dataPath: (dataPath || '') + "+e.errorPath+" , schemaPath: "+e.util.toQuotedString(u)+" , params: { limit: "+p+" } ",e.opts.messages!==!1&&(n+=" , message: 'should NOT have ",r=="maxItems"?n+="more":n+="fewer",n+=" than ",m?n+="' + "+p+" + '":n+=""+l,n+=" items' "),e.opts.verbose&&(n+=" , schema: ",m?n+="validate.schema"+c:n+=""+l,n+=" , parentSchema: validate.schema"+e.schemaPath+" , data: "+f+" "),n+=" } "):n+=" {} ";var v=n;return n=g.pop(),!e.compositeRule&&d?e.async?n+=" throw new ValidationError(["+v+"]); ":n+=" validate.errors = ["+v+"]; return false; ":n+=" var err = "+v+"; if (vErrors === null) vErrors = [err]; else vErrors.push(err); errors++; ",n+="} ",d&&(n+=" else { "),n},X0=function(e,r,s){var n=" ",a=e.level,o=e.dataLevel,l=e.schema[r],c=e.schemaPath+e.util.getProperty(r),u=e.errSchemaPath+"/"+r,d=!e.opts.allErrors,h,f="data"+(o||""),m=e.opts.$data&&l&&l.$data,p;if(m?(n+=" var schema"+a+" = "+e.util.getData(l.$data,o,e.dataPathArr)+"; ",p="schema"+a):p=l,!(m||typeof l=="number"))throw new Error(r+" must be number");var w=r=="maxLength"?">":"<";n+="if ( ",m&&(n+=" ("+p+" !== undefined && typeof "+p+" != 'number') || "),e.opts.unicode===!1?n+=" "+f+".length ":n+=" ucs2length("+f+") ",n+=" "+w+" "+p+") { ";var h=r,g=g||[];g.push(n),n="",e.createErrors!==!1?(n+=" { keyword: '"+(h||"_limitLength")+"' , dataPath: (dataPath || '') + "+e.errorPath+" , schemaPath: "+e.util.toQuotedString(u)+" , params: { limit: "+p+" } ",e.opts.messages!==!1&&(n+=" , message: 'should NOT be ",r=="maxLength"?n+="longer":n+="shorter",n+=" than ",m?n+="' + "+p+" + '":n+=""+l,n+=" characters' "),e.opts.verbose&&(n+=" , schema: ",m?n+="validate.schema"+c:n+=""+l,n+=" , parentSchema: validate.schema"+e.schemaPath+" , data: "+f+" "),n+=" } "):n+=" {} ";var v=n;return n=g.pop(),!e.compositeRule&&d?e.async?n+=" throw new ValidationError(["+v+"]); ":n+=" validate.errors = ["+v+"]; return false; ":n+=" var err = "+v+"; if (vErrors === null) vErrors = [err]; else vErrors.push(err); errors++; ",n+="} ",d&&(n+=" else { "),n},ex=function(e,r,s){var n=" ",a=e.level,o=e.dataLevel,l=e.schema[r],c=e.schemaPath+e.util.getProperty(r),u=e.errSchemaPath+"/"+r,d=!e.opts.allErrors,h,f="data"+(o||""),m=e.opts.$data&&l&&l.$data,p;if(m?(n+=" var schema"+a+" = "+e.util.getData(l.$data,o,e.dataPathArr)+"; ",p="schema"+a):p=l,!(m||typeof l=="number"))throw new Error(r+" must be number");var w=r=="maxProperties"?">":"<";n+="if ( ",m&&(n+=" ("+p+" !== undefined && typeof "+p+" != 'number') || "),n+=" Object.keys("+f+").length "+w+" "+p+") { ";var h=r,g=g||[];g.push(n),n="",e.createErrors!==!1?(n+=" { keyword: '"+(h||"_limitProperties")+"' , dataPath: (dataPath || '') + "+e.errorPath+" , schemaPath: "+e.util.toQuotedString(u)+" , params: { limit: "+p+" } ",e.opts.messages!==!1&&(n+=" , message: 'should NOT have ",r=="maxProperties"?n+="more":n+="fewer",n+=" than ",m?n+="' + "+p+" + '":n+=""+l,n+=" properties' "),e.opts.verbose&&(n+=" , schema: ",m?n+="validate.schema"+c:n+=""+l,n+=" , parentSchema: validate.schema"+e.schemaPath+" , data: "+f+" "),n+=" } "):n+=" {} ";var v=n;return n=g.pop(),!e.compositeRule&&d?e.async?n+=" throw new ValidationError(["+v+"]); ":n+=" validate.errors = ["+v+"]; return false; ":n+=" var err = "+v+"; if (vErrors === null) vErrors = [err]; else vErrors.push(err); errors++; ",n+="} ",d&&(n+=" else { "),n},m$=function(e,r,s){var n=" ",a=e.level,o=e.dataLevel,l=e.schema[r],c=e.schemaPath+e.util.getProperty(r),u=e.errSchemaPath+"/"+r,d=!e.opts.allErrors,f="data"+(o||""),m=e.opts.$data&&l&&l.$data,p;if(m?(n+=" var schema"+a+" = "+e.util.getData(l.$data,o,e.dataPathArr)+"; ",p="schema"+a):p=l,!(m||typeof l=="number"))throw new Error(r+" must be number");n+="var division"+a+";if (",m&&(n+=" "+p+" !== undefined && ( typeof "+p+" != 'number' || "),n+=" (division"+a+" = "+f+" / "+p+", ",e.opts.multipleOfPrecision?n+=" Math.abs(Math.round(division"+a+") - division"+a+") > 1e-"+e.opts.multipleOfPrecision+" ":n+=" division"+a+" !== parseInt(division"+a+") ",n+=" ) ",m&&(n+=" ) "),n+=" ) { ";var w=w||[];w.push(n),n="",e.createErrors!==!1?(n+=" { keyword: 'multipleOf' , dataPath: (dataPath || '') + "+e.errorPath+" , schemaPath: "+e.util.toQuotedString(u)+" , params: { multipleOf: "+p+" } ",e.opts.messages!==!1&&(n+=" , message: 'should be multiple of ",m?n+="' + "+p:n+=""+p+"'"),e.opts.verbose&&(n+=" , schema: ",m?n+="validate.schema"+c:n+=""+l,n+=" , parentSchema: validate.schema"+e.schemaPath+" , data: "+f+" "),n+=" } "):n+=" {} ";var h=n;return n=w.pop(),!e.compositeRule&&d?e.async?n+=" throw new ValidationError(["+h+"]); ":n+=" validate.errors = ["+h+"]; return false; ":n+=" var err = "+h+"; if (vErrors === null) vErrors = [err]; else vErrors.push(err); errors++; ",n+="} ",d&&(n+=" else { "),n},v$=function(e,r,s){var n=" ",a=e.level,o=e.dataLevel,l=e.schema[r],c=e.schemaPath+e.util.getProperty(r),u=e.errSchemaPath+"/"+r,d=!e.opts.allErrors,f="data"+(o||""),m="errs__"+a,p=e.util.copy(e);p.level++;var w="valid"+p.level;if(e.opts.strictKeywords?typeof l=="object"&&Object.keys(l).length>0||l===!1:e.util.schemaHasRules(l,e.RULES.all)){p.schema=l,p.schemaPath=c,p.errSchemaPath=u,n+=" var "+m+" = errors; ";var h=e.compositeRule;e.compositeRule=p.compositeRule=!0,p.createErrors=!1;var g;p.opts.allErrors&&(g=p.opts.allErrors,p.opts.allErrors=!1),n+=" "+e.validate(p)+" ",p.createErrors=!0,g&&(p.opts.allErrors=g),e.compositeRule=p.compositeRule=h,n+=" if ("+w+") { ";var v=v||[];v.push(n),n="",e.createErrors!==!1?(n+=" { keyword: 'not' , dataPath: (dataPath || '') + "+e.errorPath+" , schemaPath: "+e.util.toQuotedString(u)+" , params: {} ",e.opts.messages!==!1&&(n+=" , message: 'should NOT be valid' "),e.opts.verbose&&(n+=" , schema: validate.schema"+c+" , parentSchema: validate.schema"+e.schemaPath+" , data: "+f+" "),n+=" } "):n+=" {} ";var y=n;n=v.pop(),!e.compositeRule&&d?e.async?n+=" throw new ValidationError(["+y+"]); ":n+=" validate.errors = ["+y+"]; return false; ":n+=" var err = "+y+"; if (vErrors === null) vErrors = [err]; else vErrors.push(err); errors++; ",n+=" } else { errors = "+m+"; if (vErrors !== null) { if ("+m+") vErrors.length = "+m+"; else vErrors = null; } ",e.opts.allErrors&&(n+=" } ")}else n+=" var err = ",e.createErrors!==!1?(n+=" { keyword: 'not' , dataPath: (dataPath || '') + "+e.errorPath+" , schemaPath: "+e.util.toQuotedString(u)+" , params: {} ",e.opts.messages!==!1&&(n+=" , message: 'should NOT be valid' "),e.opts.verbose&&(n+=" , schema: validate.schema"+c+" , parentSchema: validate.schema"+e.schemaPath+" , data: "+f+" "),n+=" } "):n+=" {} ",n+="; if (vErrors === null) vErrors = [err]; else vErrors.push(err); errors++; ",d&&(n+=" if (false) { ");return n},g$=function(e,r,s){var n=" ",a=e.level,o=e.dataLevel,l=e.schema[r],c=e.schemaPath+e.util.getProperty(r),u=e.errSchemaPath+"/"+r,d=!e.opts.allErrors,f="data"+(o||""),m="valid"+a,p="errs__"+a,w=e.util.copy(e),h="";w.level++;var g="valid"+w.level,v=w.baseId,y="prevValid"+a,b="passingSchemas"+a;n+="var "+p+" = errors , "+y+" = false , "+m+" = false , "+b+" = null; ";var S=e.compositeRule;e.compositeRule=w.compositeRule=!0;var E=l;if(E)for(var k,R=-1,T=E.length-1;R<T;)k=E[R+=1],(e.opts.strictKeywords?typeof k=="object"&&Object.keys(k).length>0||k===!1:e.util.schemaHasRules(k,e.RULES.all))?(w.schema=k,w.schemaPath=c+"["+R+"]",w.errSchemaPath=u+"/"+R,n+=" "+e.validate(w)+" ",w.baseId=v):n+=" var "+g+" = true; ",R&&(n+=" if ("+g+" && "+y+") { "+m+" = false; "+b+" = ["+b+", "+R+"]; } else { ",h+="}"),n+=" if ("+g+") { "+m+" = "+y+" = true; "+b+" = "+R+"; }";return e.compositeRule=w.compositeRule=S,n+=""+h+"if (!"+m+") { var err = ",e.createErrors!==!1?(n+=" { keyword: 'oneOf' , dataPath: (dataPath || '') + "+e.errorPath+" , schemaPath: "+e.util.toQuotedString(u)+" , params: { passingSchemas: "+b+" } ",e.opts.messages!==!1&&(n+=" , message: 'should match exactly one schema in oneOf' "),e.opts.verbose&&(n+=" , schema: validate.schema"+c+" , parentSchema: validate.schema"+e.schemaPath+" , data: "+f+" "),n+=" } "):n+=" {} ",n+="; if (vErrors === null) vErrors = [err]; else vErrors.push(err); errors++; ",!e.compositeRule&&d&&(e.async?n+=" throw new ValidationError(vErrors); ":n+=" validate.errors = vErrors; return false; "),n+="} else { errors = "+p+"; if (vErrors !== null) { if ("+p+") vErrors.length = "+p+"; else vErrors = null; }",e.opts.allErrors&&(n+=" } "),n},y$=function(e,r,s){var n=" ",a=e.level,o=e.dataLevel,l=e.schema[r],c=e.schemaPath+e.util.getProperty(r),u=e.errSchemaPath+"/"+r,d=!e.opts.allErrors,f="data"+(o||""),m=e.opts.$data&&l&&l.$data,p;m?(n+=" var schema"+a+" = "+e.util.getData(l.$data,o,e.dataPathArr)+"; ",p="schema"+a):p=l;var w=m?"(new RegExp("+p+"))":e.usePattern(l);n+="if ( ",m&&(n+=" ("+p+" !== undefined && typeof "+p+" != 'string') || "),n+=" !"+w+".test("+f+") ) { ";var h=h||[];h.push(n),n="",e.createErrors!==!1?(n+=" { keyword: 'pattern' , dataPath: (dataPath || '') + "+e.errorPath+" , schemaPath: "+e.util.toQuotedString(u)+" , params: { pattern: ",m?n+=""+p:n+=""+e.util.toQuotedString(l),n+=" } ",e.opts.messages!==!1&&(n+=` , message: 'should match pattern "`,m?n+="' + "+p+" + '":n+=""+e.util.escapeQuotes(l),n+=`"' `),e.opts.verbose&&(n+=" , schema: ",m?n+="validate.schema"+c:n+=""+e.util.toQuotedString(l),n+=" , parentSchema: validate.schema"+e.schemaPath+" , data: "+f+" "),n+=" } "):n+=" {} ";var g=n;return n=h.pop(),!e.compositeRule&&d?e.async?n+=" throw new ValidationError(["+g+"]); ":n+=" validate.errors = ["+g+"]; return false; ":n+=" var err = "+g+"; if (vErrors === null) vErrors = [err]; else vErrors.push(err); errors++; ",n+="} ",d&&(n+=" else { "),n},x$=function(e,r,s){var n=" ",a=e.level,o=e.dataLevel,l=e.schema[r],c=e.schemaPath+e.util.getProperty(r),u=e.errSchemaPath+"/"+r,d=!e.opts.allErrors,f="data"+(o||""),m="errs__"+a,p=e.util.copy(e),w="";p.level++;var h="valid"+p.level,g="key"+a,v="idx"+a,y=p.dataLevel=e.dataLevel+1,b="data"+y,S="dataProperties"+a,E=Object.keys(l||{}).filter($),k=e.schema.patternProperties||{},R=Object.keys(k).filter($),T=e.schema.additionalProperties,N=E.length||R.length,O=T===!1,j=typeof T=="object"&&Object.keys(T).length,_=e.opts.removeAdditional,A=O||j||_,C=e.opts.ownProperties,z=e.baseId,U=e.schema.required;if(U&&!(e.opts.$data&&U.$data)&&U.length<e.opts.loopRequired)var K=e.util.toHash(U);function $(hs){return hs!=="__proto__"}if(n+="var "+m+" = errors;var "+h+" = true;",C&&(n+=" var "+S+" = undefined;"),A){if(C?n+=" "+S+" = "+S+" || Object.keys("+f+"); for (var "+v+"=0; "+v+"<"+S+".length; "+v+"++) { var "+g+" = "+S+"["+v+"]; ":n+=" for (var "+g+" in "+f+") { ",N){if(n+=" var isAdditional"+a+" = !(false ",E.length)if(E.length>8)n+=" || validate.schema"+c+".hasOwnProperty("+g+") ";else{var F=E;if(F)for(var V,ae=-1,se=F.length-1;ae<se;)V=F[ae+=1],n+=" || "+g+" == "+e.util.toQuotedString(V)+" "}if(R.length){var W=R;if(W)for(var L,Q=-1,oe=W.length-1;Q<oe;)L=W[Q+=1],n+=" || "+e.usePattern(L)+".test("+g+") "}n+=" ); if (isAdditional"+a+") { "}if(_=="all")n+=" delete "+f+"["+g+"]; ";else{var Z=e.errorPath,ce="' + "+g+" + '";if(e.opts._errorDataPathProperty&&(e.errorPath=e.util.getPathExpr(e.errorPath,g,e.opts.jsonPointers)),O)if(_)n+=" delete "+f+"["+g+"]; ";else{n+=" "+h+" = false; ";var Ee=u;u=e.errSchemaPath+"/additionalProperties";var ve=ve||[];ve.push(n),n="",e.createErrors!==!1?(n+=" { keyword: 'additionalProperties' , dataPath: (dataPath || '') + "+e.errorPath+" , schemaPath: "+e.util.toQuotedString(u)+" , params: { additionalProperty: '"+ce+"' } ",e.opts.messages!==!1&&(n+=" , message: '",e.opts._errorDataPathProperty?n+="is an invalid additional property":n+="should NOT have additional properties",n+="' "),e.opts.verbose&&(n+=" , schema: false , parentSchema: validate.schema"+e.schemaPath+" , data: "+f+" "),n+=" } "):n+=" {} ";var te=n;n=ve.pop(),!e.compositeRule&&d?e.async?n+=" throw new ValidationError(["+te+"]); ":n+=" validate.errors = ["+te+"]; return false; ":n+=" var err = "+te+"; if (vErrors === null) vErrors = [err]; else vErrors.push(err); errors++; ",u=Ee,d&&(n+=" break; ")}else if(j)if(_=="failing"){n+=" var "+m+" = errors; ";var we=e.compositeRule;e.compositeRule=p.compositeRule=!0,p.schema=T,p.schemaPath=e.schemaPath+".additionalProperties",p.errSchemaPath=e.errSchemaPath+"/additionalProperties",p.errorPath=e.opts._errorDataPathProperty?e.errorPath:e.util.getPathExpr(e.errorPath,g,e.opts.jsonPointers);var Pe=f+"["+g+"]";p.dataPathArr[y]=g;var De=e.validate(p);p.baseId=z,e.util.varOccurences(De,b)<2?n+=" "+e.util.varReplace(De,b,Pe)+" ":n+=" var "+b+" = "+Pe+"; "+De+" ",n+=" if (!"+h+") { errors = "+m+"; if (validate.errors !== null) { if (errors) validate.errors.length = errors; else validate.errors = null; } delete "+f+"["+g+"]; } ",e.compositeRule=p.compositeRule=we}else{p.schema=T,p.schemaPath=e.schemaPath+".additionalProperties",p.errSchemaPath=e.errSchemaPath+"/additionalProperties",p.errorPath=e.opts._errorDataPathProperty?e.errorPath:e.util.getPathExpr(e.errorPath,g,e.opts.jsonPointers);var Pe=f+"["+g+"]";p.dataPathArr[y]=g;var De=e.validate(p);p.baseId=z,e.util.varOccurences(De,b)<2?n+=" "+e.util.varReplace(De,b,Pe)+" ":n+=" var "+b+" = "+Pe+"; "+De+" ",d&&(n+=" if (!"+h+") break; ")}e.errorPath=Z}N&&(n+=" } "),n+=" } ",d&&(n+=" if ("+h+") { ",w+="}")}var ee=e.opts.useDefaults&&!e.compositeRule;if(E.length){var fe=E;if(fe)for(var V,X=-1,ze=fe.length-1;X<ze;){V=fe[X+=1];var re=l[V];if(e.opts.strictKeywords?typeof re=="object"&&Object.keys(re).length>0||re===!1:e.util.schemaHasRules(re,e.RULES.all)){var Me=e.util.getProperty(V),Pe=f+Me,Ue=ee&&re.default!==void 0;p.schema=re,p.schemaPath=c+Me,p.errSchemaPath=u+"/"+e.util.escapeFragment(V),p.errorPath=e.util.getPath(e.errorPath,V,e.opts.jsonPointers),p.dataPathArr[y]=e.util.toQuotedString(V);var De=e.validate(p);if(p.baseId=z,e.util.varOccurences(De,b)<2){De=e.util.varReplace(De,b,Pe);var Ne=Pe}else{var Ne=b;n+=" var "+b+" = "+Pe+"; "}if(Ue)n+=" "+De+" ";else{if(K&&K[V]){n+=" if ( "+Ne+" === undefined ",C&&(n+=" || ! Object.prototype.hasOwnProperty.call("+f+", '"+e.util.escapeQuotes(V)+"') "),n+=") { "+h+" = false; ";var Z=e.errorPath,Ee=u,rt=e.util.escapeQuotes(V);e.opts._errorDataPathProperty&&(e.errorPath=e.util.getPath(Z,V,e.opts.jsonPointers)),u=e.errSchemaPath+"/required";var ve=ve||[];ve.push(n),n="",e.createErrors!==!1?(n+=" { keyword: 'required' , dataPath: (dataPath || '') + "+e.errorPath+" , schemaPath: "+e.util.toQuotedString(u)+" , params: { missingProperty: '"+rt+"' } ",e.opts.messages!==!1&&(n+=" , message: '",e.opts._errorDataPathProperty?n+="is a required property":n+="should have required property \\'"+rt+"\\'",n+="' "),e.opts.verbose&&(n+=" , schema: validate.schema"+c+" , parentSchema: validate.schema"+e.schemaPath+" , data: "+f+" "),n+=" } "):n+=" {} ";var te=n;n=ve.pop(),!e.compositeRule&&d?e.async?n+=" throw new ValidationError(["+te+"]); ":n+=" validate.errors = ["+te+"]; return false; ":n+=" var err = "+te+"; if (vErrors === null) vErrors = [err]; else vErrors.push(err); errors++; ",u=Ee,e.errorPath=Z,n+=" } else { "}else d?(n+=" if ( "+Ne+" === undefined ",C&&(n+=" || ! Object.prototype.hasOwnProperty.call("+f+", '"+e.util.escapeQuotes(V)+"') "),n+=") { "+h+" = true; } else { "):(n+=" if ("+Ne+" !== undefined ",C&&(n+=" && Object.prototype.hasOwnProperty.call("+f+", '"+e.util.escapeQuotes(V)+"') "),n+=" ) { ");n+=" "+De+" } "}}d&&(n+=" if ("+h+") { ",w+="}")}}if(R.length){var pt=R;if(pt)for(var L,Hr=-1,zt=pt.length-1;Hr<zt;){L=pt[Hr+=1];var re=k[L];if(e.opts.strictKeywords?typeof re=="object"&&Object.keys(re).length>0||re===!1:e.util.schemaHasRules(re,e.RULES.all)){p.schema=re,p.schemaPath=e.schemaPath+".patternProperties"+e.util.getProperty(L),p.errSchemaPath=e.errSchemaPath+"/patternProperties/"+e.util.escapeFragment(L),C?n+=" "+S+" = "+S+" || Object.keys("+f+"); for (var "+v+"=0; "+v+"<"+S+".length; "+v+"++) { var "+g+" = "+S+"["+v+"]; ":n+=" for (var "+g+" in "+f+") { ",n+=" if ("+e.usePattern(L)+".test("+g+")) { ",p.errorPath=e.util.getPathExpr(e.errorPath,g,e.opts.jsonPointers);var Pe=f+"["+g+"]";p.dataPathArr[y]=g;var De=e.validate(p);p.baseId=z,e.util.varOccurences(De,b)<2?n+=" "+e.util.varReplace(De,b,Pe)+" ":n+=" var "+b+" = "+Pe+"; "+De+" ",d&&(n+=" if (!"+h+") break; "),n+=" } ",d&&(n+=" else "+h+" = true; "),n+=" } ",d&&(n+=" if ("+h+") { ",w+="}")}}}return d&&(n+=" "+w+" if ("+m+" == errors) {"),n},w$=function(e,r,s){var n=" ",a=e.level,o=e.dataLevel,l=e.schema[r],c=e.schemaPath+e.util.getProperty(r),u=e.errSchemaPath+"/"+r,d=!e.opts.allErrors,f="data"+(o||""),m="errs__"+a,p=e.util.copy(e),w="";p.level++;var h="valid"+p.level;if(n+="var "+m+" = errors;",e.opts.strictKeywords?typeof l=="object"&&Object.keys(l).length>0||l===!1:e.util.schemaHasRules(l,e.RULES.all)){p.schema=l,p.schemaPath=c,p.errSchemaPath=u;var g="key"+a,v="idx"+a,y="i"+a,b="' + "+g+" + '",S=p.dataLevel=e.dataLevel+1,E="data"+S,k="dataProperties"+a,R=e.opts.ownProperties,T=e.baseId;R&&(n+=" var "+k+" = undefined; "),R?n+=" "+k+" = "+k+" || Object.keys("+f+"); for (var "+v+"=0; "+v+"<"+k+".length; "+v+"++) { var "+g+" = "+k+"["+v+"]; ":n+=" for (var "+g+" in "+f+") { ",n+=" var startErrs"+a+" = errors; ";var N=g,O=e.compositeRule;e.compositeRule=p.compositeRule=!0;var j=e.validate(p);p.baseId=T,e.util.varOccurences(j,E)<2?n+=" "+e.util.varReplace(j,E,N)+" ":n+=" var "+E+" = "+N+"; "+j+" ",e.compositeRule=p.compositeRule=O,n+=" if (!"+h+") { for (var "+y+"=startErrs"+a+"; "+y+"<errors; "+y+"++) { vErrors["+y+"].propertyName = "+g+"; } var err = ",e.createErrors!==!1?(n+=" { keyword: 'propertyNames' , dataPath: (dataPath || '') + "+e.errorPath+" , schemaPath: "+e.util.toQuotedString(u)+" , params: { propertyName: '"+b+"' } ",e.opts.messages!==!1&&(n+=" , message: 'property name \\'"+b+"\\' is invalid' "),e.opts.verbose&&(n+=" , schema: validate.schema"+c+" , parentSchema: validate.schema"+e.schemaPath+" , data: "+f+" "),n+=" } "):n+=" {} ",n+="; if (vErrors === null) vErrors = [err]; else vErrors.push(err); errors++; ",!e.compositeRule&&d&&(e.async?n+=" throw new ValidationError(vErrors); ":n+=" validate.errors = vErrors; return false; "),d&&(n+=" break; "),n+=" } }"}return d&&(n+=" "+w+" if ("+m+" == errors) {"),n},b$=function(e,r,s){var n=" ",a=e.level,o=e.dataLevel,l=e.schema[r],c=e.schemaPath+e.util.getProperty(r),u=e.errSchemaPath+"/"+r,d=!e.opts.allErrors,f="data"+(o||""),m="valid"+a,p=e.opts.$data&&l&&l.$data;p&&(n+=" var schema"+a+" = "+e.util.getData(l.$data,o,e.dataPathArr)+"; ");var w="schema"+a;if(!p)if(l.length<e.opts.loopRequired&&e.schema.properties&&Object.keys(e.schema.properties).length){var h=[],g=l;if(g)for(var v,y=-1,b=g.length-1;y<b;){v=g[y+=1];var S=e.schema.properties[v];S&&(e.opts.strictKeywords?typeof S=="object"&&Object.keys(S).length>0||S===!1:e.util.schemaHasRules(S,e.RULES.all))||(h[h.length]=v)}}else var h=l;if(p||h.length){var E=e.errorPath,k=p||h.length>=e.opts.loopRequired,R=e.opts.ownProperties;if(d)if(n+=" var missing"+a+"; ",k){p||(n+=" var "+w+" = validate.schema"+c+"; ");var T="i"+a,N="schema"+a+"["+T+"]",O="' + "+N+" + '";e.opts._errorDataPathProperty&&(e.errorPath=e.util.getPathExpr(E,N,e.opts.jsonPointers)),n+=" var "+m+" = true; ",p&&(n+=" if (schema"+a+" === undefined) "+m+" = true; else if (!Array.isArray(schema"+a+")) "+m+" = false; else {"),n+=" for (var "+T+" = 0; "+T+" < "+w+".length; "+T+"++) { "+m+" = "+f+"["+w+"["+T+"]] !== undefined ",R&&(n+=" && Object.prototype.hasOwnProperty.call("+f+", "+w+"["+T+"]) "),n+="; if (!"+m+") break; } ",p&&(n+=" } "),n+=" if (!"+m+") { ";var j=j||[];j.push(n),n="",e.createErrors!==!1?(n+=" { keyword: 'required' , dataPath: (dataPath || '') + "+e.errorPath+" , schemaPath: "+e.util.toQuotedString(u)+" , params: { missingProperty: '"+O+"' } ",e.opts.messages!==!1&&(n+=" , message: '",e.opts._errorDataPathProperty?n+="is a required property":n+="should have required property \\'"+O+"\\'",n+="' "),e.opts.verbose&&(n+=" , schema: validate.schema"+c+" , parentSchema: validate.schema"+e.schemaPath+" , data: "+f+" "),n+=" } "):n+=" {} ";var _=n;n=j.pop(),!e.compositeRule&&d?e.async?n+=" throw new ValidationError(["+_+"]); ":n+=" validate.errors = ["+_+"]; return false; ":n+=" var err = "+_+"; if (vErrors === null) vErrors = [err]; else vErrors.push(err); errors++; ",n+=" } else { "}else{n+=" if ( ";var A=h;if(A)for(var C,T=-1,z=A.length-1;T<z;){C=A[T+=1],T&&(n+=" || ");var U=e.util.getProperty(C),K=f+U;n+=" ( ( "+K+" === undefined ",R&&(n+=" || ! Object.prototype.hasOwnProperty.call("+f+", '"+e.util.escapeQuotes(C)+"') "),n+=") && (missing"+a+" = "+e.util.toQuotedString(e.opts.jsonPointers?C:U)+") ) "}n+=") { ";var N="missing"+a,O="' + "+N+" + '";e.opts._errorDataPathProperty&&(e.errorPath=e.opts.jsonPointers?e.util.getPathExpr(E,N,!0):E+" + "+N);var j=j||[];j.push(n),n="",e.createErrors!==!1?(n+=" { keyword: 'required' , dataPath: (dataPath || '') + "+e.errorPath+" , schemaPath: "+e.util.toQuotedString(u)+" , params: { missingProperty: '"+O+"' } ",e.opts.messages!==!1&&(n+=" , message: '",e.opts._errorDataPathProperty?n+="is a required property":n+="should have required property \\'"+O+"\\'",n+="' "),e.opts.verbose&&(n+=" , schema: validate.schema"+c+" , parentSchema: validate.schema"+e.schemaPath+" , data: "+f+" "),n+=" } "):n+=" {} ";var _=n;n=j.pop(),!e.compositeRule&&d?e.async?n+=" throw new ValidationError(["+_+"]); ":n+=" validate.errors = ["+_+"]; return false; ":n+=" var err = "+_+"; if (vErrors === null) vErrors = [err]; else vErrors.push(err); errors++; ",n+=" } else { "}else if(k){p||(n+=" var "+w+" = validate.schema"+c+"; ");var T="i"+a,N="schema"+a+"["+T+"]",O="' + "+N+" + '";e.opts._errorDataPathProperty&&(e.errorPath=e.util.getPathExpr(E,N,e.opts.jsonPointers)),p&&(n+=" if ("+w+" && !Array.isArray("+w+")) { var err = ",e.createErrors!==!1?(n+=" { keyword: 'required' , dataPath: (dataPath || '') + "+e.errorPath+" , schemaPath: "+e.util.toQuotedString(u)+" , params: { missingProperty: '"+O+"' } ",e.opts.messages!==!1&&(n+=" , message: '",e.opts._errorDataPathProperty?n+="is a required property":n+="should have required property \\'"+O+"\\'",n+="' "),e.opts.verbose&&(n+=" , schema: validate.schema"+c+" , parentSchema: validate.schema"+e.schemaPath+" , data: "+f+" "),n+=" } "):n+=" {} ",n+="; if (vErrors === null) vErrors = [err]; else vErrors.push(err); errors++; } else if ("+w+" !== undefined) { "),n+=" for (var "+T+" = 0; "+T+" < "+w+".length; "+T+"++) { if ("+f+"["+w+"["+T+"]] === undefined ",R&&(n+=" || ! Object.prototype.hasOwnProperty.call("+f+", "+w+"["+T+"]) "),n+=") { var err = ",e.createErrors!==!1?(n+=" { keyword: 'required' , dataPath: (dataPath || '') + "+e.errorPath+" , schemaPath: "+e.util.toQuotedString(u)+" , params: { missingProperty: '"+O+"' } ",e.opts.messages!==!1&&(n+=" , message: '",e.opts._errorDataPathProperty?n+="is a required property":n+="should have required property \\'"+O+"\\'",n+="' "),e.opts.verbose&&(n+=" , schema: validate.schema"+c+" , parentSchema: validate.schema"+e.schemaPath+" , data: "+f+" "),n+=" } "):n+=" {} ",n+="; if (vErrors === null) vErrors = [err]; else vErrors.push(err); errors++; } } ",p&&(n+=" } ")}else{var $=h;if($)for(var C,F=-1,V=$.length-1;F<V;){C=$[F+=1];var U=e.util.getProperty(C),O=e.util.escapeQuotes(C),K=f+U;e.opts._errorDataPathProperty&&(e.errorPath=e.util.getPath(E,C,e.opts.jsonPointers)),n+=" if ( "+K+" === undefined ",R&&(n+=" || ! Object.prototype.hasOwnProperty.call("+f+", '"+e.util.escapeQuotes(C)+"') "),n+=") { var err = ",e.createErrors!==!1?(n+=" { keyword: 'required' , dataPath: (dataPath || '') + "+e.errorPath+" , schemaPath: "+e.util.toQuotedString(u)+" , params: { missingProperty: '"+O+"' } ",e.opts.messages!==!1&&(n+=" , message: '",e.opts._errorDataPathProperty?n+="is a required property":n+="should have required property \\'"+O+"\\'",n+="' "),e.opts.verbose&&(n+=" , schema: validate.schema"+c+" , parentSchema: validate.schema"+e.schemaPath+" , data: "+f+" "),n+=" } "):n+=" {} ",n+="; if (vErrors === null) vErrors = [err]; else vErrors.push(err); errors++; } "}}e.errorPath=E}else d&&(n+=" if (true) {");return n},S$=function(e,r,s){var n=" ",a=e.level,o=e.dataLevel,l=e.schema[r],c=e.schemaPath+e.util.getProperty(r),u=e.errSchemaPath+"/"+r,d=!e.opts.allErrors,f="data"+(o||""),m="valid"+a,p=e.opts.$data&&l&&l.$data,w;if(p?(n+=" var schema"+a+" = "+e.util.getData(l.$data,o,e.dataPathArr)+"; ",w="schema"+a):w=l,(l||p)&&e.opts.uniqueItems!==!1){p&&(n+=" var "+m+"; if ("+w+" === false || "+w+" === undefined) "+m+" = true; else if (typeof "+w+" != 'boolean') "+m+" = false; else { "),n+=" var i = "+f+".length , "+m+" = true , j; if (i > 1) { ";var h=e.schema.items&&e.schema.items.type,g=Array.isArray(h);if(!h||h=="object"||h=="array"||g&&(h.indexOf("object")>=0||h.indexOf("array")>=0))n+=" outer: for (;i--;) { for (j = i; j--;) { if (equal("+f+"[i], "+f+"[j])) { "+m+" = false; break outer; } } } ";else{n+=" var itemIndices = {}, item; for (;i--;) { var item = "+f+"[i]; ";var v="checkDataType"+(g?"s":"");n+=" if ("+e.util[v](h,"item",e.opts.strictNumbers,!0)+") continue; ",g&&(n+=` if (typeof item == 'string') item = '"' + item; `),n+=" if (typeof itemIndices[item] == 'number') { "+m+" = false; j = itemIndices[item]; break; } itemIndices[item] = i; } "}n+=" } ",p&&(n+=" } "),n+=" if (!"+m+") { ";var y=y||[];y.push(n),n="",e.createErrors!==!1?(n+=" { keyword: 'uniqueItems' , dataPath: (dataPath || '') + "+e.errorPath+" , schemaPath: "+e.util.toQuotedString(u)+" , params: { i: i, j: j } ",e.opts.messages!==!1&&(n+=" , message: 'should NOT have duplicate items (items ## ' + j + ' and ' + i + ' are identical)' "),e.opts.verbose&&(n+=" , schema: ",p?n+="validate.schema"+c:n+=""+l,n+=" , parentSchema: validate.schema"+e.schemaPath+" , data: "+f+" "),n+=" } "):n+=" {} ";var b=n;n=y.pop(),!e.compositeRule&&d?e.async?n+=" throw new ValidationError(["+b+"]); ":n+=" validate.errors = ["+b+"]; return false; ":n+=" var err = "+b+"; if (vErrors === null) vErrors = [err]; else vErrors.push(err); errors++; ",n+=" } ",d&&(n+=" else { ")}else d&&(n+=" if (true) { ");return n},_$={$ref:s$,allOf:a$,anyOf:o$,$comment:i$,const:l$,contains:c$,dependencies:u$,enum:d$,format:f$,if:h$,items:p$,maximum:Y0,minimum:Y0,maxItems:J0,minItems:J0,maxLength:X0,minLength:X0,maxProperties:ex,minProperties:ex,multipleOf:m$,not:v$,oneOf:g$,pattern:y$,properties:x$,propertyNames:w$,required:b$,uniqueItems:S$,validate:sC},tx=_$,rh=Pi.toHash,E$=function(){var e=[{type:"number",rules:[{maximum:["exclusiveMaximum"]},{minimum:["exclusiveMinimum"]},"multipleOf","format"]},{type:"string",rules:["maxLength","minLength","pattern","format"]},{type:"array",rules:["maxItems","minItems","items","contains","uniqueItems"]},{type:"object",rules:["maxProperties","minProperties","required","dependencies","propertyNames",{properties:["additionalProperties","patternProperties"]}]},{rules:["$ref","const","enum","not","anyOf","oneOf","allOf","if"]}],r=["type","$comment"],s=["$schema","$id","id","$data","$async","title","description","default","definitions","examples","readOnly","writeOnly","contentMediaType","contentEncoding","additionalItems","then","else"],n=["number","integer","string","array","object","boolean","null"];return e.all=rh(r),e.types=rh(n),e.forEach(function(a){a.rules=a.rules.map(function(o){var l;if(typeof o=="object"){var c=Object.keys(o)[0];l=o[c],o=c,l.forEach(function(d){r.push(d),e.all[d]=!0})}r.push(o);var u=e.all[o]={keyword:o,code:tx[o],implements:l};return u}),e.all.$comment={keyword:"$comment",code:tx.$comment},a.type&&(e.types[a.type]=a)}),e.keywords=rh(r.concat(s)),e.custom={},e},rx=["multipleOf","maximum","exclusiveMaximum","minimum","exclusiveMinimum","maxLength","minLength","pattern","additionalItems","maxItems","minItems","uniqueItems","maxProperties","minProperties","required","additionalProperties","enum","format","const"],C$=function(t,e){for(var r=0;r<e.length;r++){t=JSON.parse(JSON.stringify(t));var s=e[r].split("/"),n=t,a;for(a=1;a<s.length;a++)n=n[s[a]];for(a=0;a<rx.length;a++){var o=rx[a],l=n[o];l&&(n[o]={anyOf:[l,{$ref:"https://raw.githubusercontent.com/ajv-validator/ajv/master/lib/refs/data.json#"}]})}}return t},k$=mg.MissingRef,P$=yC;function yC(t,e,r){var s=this;if(typeof this._opts.loadSchema!="function")throw new Error("options.loadSchema should be a function");typeof e=="function"&&(r=e,e=void 0);var n=a(t).then(function(){var l=s._addSchema(t,void 0,e);return l.validate||o(l)});return r&&n.then(function(l){r(null,l)},r),n;function a(l){var c=l.$schema;return c&&!s.getSchema(c)?yC.call(s,{$ref:c},!0):Promise.resolve()}function o(l){try{return s._compile(l)}catch(u){if(u instanceof k$)return c(u);throw u}function c(u){var d=u.missingSchema;if(p(d))throw new Error("Schema "+d+" is loaded but "+u.missingRef+" cannot be resolved");var f=s._loadingSchemas[d];return f||(f=s._loadingSchemas[d]=s._opts.loadSchema(d),f.then(m,m)),f.then(function(w){if(!p(d))return a(w).then(function(){p(d)||s.addSchema(w,d,void 0,e)})}).then(function(){return o(l)});function m(){delete s._loadingSchemas[d]}function p(w){return s._refs[w]||s._schemas[w]}}}}var N$=function(e,r,s){var n=" ",a=e.level,o=e.dataLevel,l=e.schema[r],c=e.schemaPath+e.util.getProperty(r),u=e.errSchemaPath+"/"+r,d=!e.opts.allErrors,f,m="data"+(o||""),p="valid"+a,w="errs__"+a,h=e.opts.$data&&l&&l.$data,g;h?(n+=" var schema"+a+" = "+e.util.getData(l.$data,o,e.dataPathArr)+"; ",g="schema"+a):g=l;var v=this,y="definition"+a,b=v.definition,S="",E,k,R,T,N;if(h&&b.$data){N="keywordValidate"+a;var O=b.validateSchema;n+=" var "+y+" = RULES.custom['"+r+"'].definition; var "+N+" = "+y+".validate;"}else{if(T=e.useCustomRule(v,l,e.schema,e),!T)return;g="validate.schema"+c,N=T.code,E=b.compile,k=b.inline,R=b.macro}var j=N+".errors",_="i"+a,A="ruleErr"+a,C=b.async;if(C&&!e.async)throw new Error("async keyword in sync schema");if(k||R||(n+=""+j+" = null;"),n+="var "+w+" = errors;var "+p+";",h&&b.$data&&(S+="}",n+=" if ("+g+" === undefined) { "+p+" = true; } else { ",O&&(S+="}",n+=" "+p+" = "+y+".validateSchema("+g+"); if ("+p+") { ")),k)b.statements?n+=" "+T.validate+" ":n+=" "+p+" = "+T.validate+"; ";else if(R){var z=e.util.copy(e),S="";z.level++;var U="valid"+z.level;z.schema=T.validate,z.schemaPath="";var K=e.compositeRule;e.compositeRule=z.compositeRule=!0;var $=e.validate(z).replace(/validate\.schema/g,N);e.compositeRule=z.compositeRule=K,n+=" "+$}else{var F=F||[];F.push(n),n="",n+=" "+N+".call( ",e.opts.passContext?n+="this":n+="self",E||b.schema===!1?n+=" , "+m+" ":n+=" , "+g+" , "+m+" , validate.schema"+e.schemaPath+" ",n+=" , (dataPath || '')",e.errorPath!='""'&&(n+=" + "+e.errorPath);var V=o?"data"+(o-1||""):"parentData",ae=o?e.dataPathArr[o]:"parentDataProperty";n+=" , "+V+" , "+ae+" , rootData ) ";var se=n;n=F.pop(),b.errors===!1?(n+=" "+p+" = ",C&&(n+="await "),n+=""+se+"; "):C?(j="customErrors"+a,n+=" var "+j+" = null; try { "+p+" = await "+se+"; } catch (e) { "+p+" = false; if (e instanceof ValidationError) "+j+" = e.errors; else throw e; } "):n+=" "+j+" = null; "+p+" = "+se+"; "}if(b.modifying&&(n+=" if ("+V+") "+m+" = "+V+"["+ae+"];"),n+=""+S,b.valid)d&&(n+=" if (true) { ");else{n+=" if ( ",b.valid===void 0?(n+=" !",R?n+=""+U:n+=""+p):n+=" "+!b.valid+" ",n+=") { ",f=v.keyword;var F=F||[];F.push(n),n="";var F=F||[];F.push(n),n="",e.createErrors!==!1?(n+=" { keyword: '"+(f||"custom")+"' , dataPath: (dataPath || '') + "+e.errorPath+" , schemaPath: "+e.util.toQuotedString(u)+" , params: { keyword: '"+v.keyword+"' } ",e.opts.messages!==!1&&(n+=` , message: 'should pass "`+v.keyword+`" keyword validation' `),e.opts.verbose&&(n+=" , schema: validate.schema"+c+" , parentSchema: validate.schema"+e.schemaPath+" , data: "+m+" "),n+=" } "):n+=" {} ";var W=n;n=F.pop(),!e.compositeRule&&d?e.async?n+=" throw new ValidationError(["+W+"]); ":n+=" validate.errors = ["+W+"]; return false; ":n+=" var err = "+W+"; if (vErrors === null) vErrors = [err]; else vErrors.push(err); errors++; ";var L=n;n=F.pop(),k?b.errors?b.errors!="full"&&(n+=" for (var "+_+"="+w+"; "+_+"<errors; "+_+"++) { var "+A+" = vErrors["+_+"]; if ("+A+".dataPath === undefined) "+A+".dataPath = (dataPath || '') + "+e.errorPath+"; if ("+A+".schemaPath === undefined) { "+A+'.schemaPath = "'+u+'"; } ',e.opts.verbose&&(n+=" "+A+".schema = "+g+"; "+A+".data = "+m+"; "),n+=" } "):b.errors===!1?n+=" "+L+" ":(n+=" if ("+w+" == errors) { "+L+" } else { for (var "+_+"="+w+"; "+_+"<errors; "+_+"++) { var "+A+" = vErrors["+_+"]; if ("+A+".dataPath === undefined) "+A+".dataPath = (dataPath || '') + "+e.errorPath+"; if ("+A+".schemaPath === undefined) { "+A+'.schemaPath = "'+u+'"; } ',e.opts.verbose&&(n+=" "+A+".schema = "+g+"; "+A+".data = "+m+"; "),n+=" } } "):R?(n+=" var err = ",e.createErrors!==!1?(n+=" { keyword: '"+(f||"custom")+"' , dataPath: (dataPath || '') + "+e.errorPath+" , schemaPath: "+e.util.toQuotedString(u)+" , params: { keyword: '"+v.keyword+"' } ",e.opts.messages!==!1&&(n+=` , message: 'should pass "`+v.keyword+`" keyword validation' `),e.opts.verbose&&(n+=" , schema: validate.schema"+c+" , parentSchema: validate.schema"+e.schemaPath+" , data: "+m+" "),n+=" } "):n+=" {} ",n+="; if (vErrors === null) vErrors = [err]; else vErrors.push(err); errors++; ",!e.compositeRule&&d&&(e.async?n+=" throw new ValidationError(vErrors); ":n+=" validate.errors = vErrors; return false; ")):b.errors===!1?n+=" "+L+" ":(n+=" if (Array.isArray("+j+")) { if (vErrors === null) vErrors = "+j+"; else vErrors = vErrors.concat("+j+"); errors = vErrors.length; for (var "+_+"="+w+"; "+_+"<errors; "+_+"++) { var "+A+" = vErrors["+_+"]; if ("+A+".dataPath === undefined) "+A+".dataPath = (dataPath || '') + "+e.errorPath+"; "+A+'.schemaPath = "'+u+'"; ',e.opts.verbose&&(n+=" "+A+".schema = "+g+"; "+A+".data = "+m+"; "),n+=" } } else { "+L+" } "),n+=" } ",d&&(n+=" else { ")}return n};const j$="http://json-schema.org/draft-07/schema#",R$="http://json-schema.org/draft-07/schema#",T$="Core schema meta-schema",A$={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:[]}},O$=["object","boolean"],I$={$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:"#"}},xC={$schema:j$,$id:R$,title:T$,definitions:A$,type:O$,properties:I$,default:!0};var nx=xC,D$={$id:"https://github.com/ajv-validator/ajv/blob/master/lib/definition_schema.js",definitions:{simpleTypes:nx.definitions.simpleTypes},type:"object",dependencies:{schema:["validate"],$data:["validate"],statements:["inline"],valid:{not:{required:["macro"]}}},properties:{type:nx.properties.type,schema:{type:"boolean"},statements:{type:"boolean"},dependencies:{type:"array",items:{type:"string"}},metaSchema:{type:"object"},modifying:{type:"boolean"},valid:{type:"boolean"},$data:{type:"boolean"},async:{type:"boolean"},errors:{anyOf:[{type:"boolean"},{const:"full"}]}}},M$=/^[a-z_$][a-z0-9_$-]*$/i,$$=N$,F$=D$,L$={add:U$,get:z$,remove:V$,validate:mm};function U$(t,e){var r=this.RULES;if(r.keywords[t])throw new Error("Keyword "+t+" is already defined");if(!M$.test(t))throw new Error("Keyword "+t+" is not a valid identifier");if(e){this.validateKeyword(e,!0);var s=e.type;if(Array.isArray(s))for(var n=0;n<s.length;n++)o(t,s[n],e);else o(t,s,e);var a=e.metaSchema;a&&(e.$data&&this._opts.$data&&(a={anyOf:[a,{$ref:"https://raw.githubusercontent.com/ajv-validator/ajv/master/lib/refs/data.json#"}]}),e.validateSchema=this.compile(a,!0))}r.keywords[t]=r.all[t]=!0;function o(l,c,u){for(var d,f=0;f<r.length;f++){var m=r[f];if(m.type==c){d=m;break}}d||(d={type:c,rules:[]},r.push(d));var p={keyword:l,definition:u,custom:!0,code:$$,implements:u.implements};d.rules.push(p),r.custom[l]=p}return this}function z$(t){var e=this.RULES.custom[t];return e?e.definition:this.RULES.keywords[t]||!1}function V$(t){var e=this.RULES;delete e.keywords[t],delete e.all[t],delete e.custom[t];for(var r=0;r<e.length;r++)for(var s=e[r].rules,n=0;n<s.length;n++)if(s[n].keyword==t){s.splice(n,1);break}return this}function mm(t,e){mm.errors=null;var r=this._validateKeyword=this._validateKeyword||this.compile(F$,!0);if(r(t))return!0;if(mm.errors=r.errors,e)throw new Error("custom keyword definition is invalid: "+this.errorsText(r.errors));return!1}const q$="http://json-schema.org/draft-07/schema#",H$="https://raw.githubusercontent.com/ajv-validator/ajv/master/lib/refs/data.json#",B$="Meta-schema for $data reference (JSON Schema extension proposal)",W$="object",K$=["$data"],Q$={$data:{type:"string",anyOf:[{format:"relative-json-pointer"},{format:"json-pointer"}]}},G$=!1,Z$={$schema:q$,$id:H$,description:B$,type:W$,required:K$,properties:Q$,additionalProperties:G$};var wC=$M,La=pg,Y$=HM,bC=XE,J$=nC,X$=YM,eF=E$,SC=C$,_C=Pi,tF=wt;wt.prototype.validate=nF;wt.prototype.compile=sF;wt.prototype.addSchema=aF;wt.prototype.addMetaSchema=oF;wt.prototype.validateSchema=iF;wt.prototype.getSchema=cF;wt.prototype.removeSchema=dF;wt.prototype.addFormat=xF;wt.prototype.errorsText=yF;wt.prototype._addSchema=fF;wt.prototype._compile=hF;wt.prototype.compileAsync=P$;var rf=L$;wt.prototype.addKeyword=rf.add;wt.prototype.getKeyword=rf.get;wt.prototype.removeKeyword=rf.remove;wt.prototype.validateKeyword=rf.validate;var EC=mg;wt.ValidationError=EC.Validation;wt.MissingRefError=EC.MissingRef;wt.$dataMetaSchema=SC;var ld="http://json-schema.org/draft-07/schema",sx=["removeAdditional","useDefaults","coerceTypes","strictDefaults"],rF=["/properties"];function wt(t){if(!(this instanceof wt))return new wt(t);t=this._opts=_C.copy(t)||{},CF(this),this._schemas={},this._refs={},this._fragments={},this._formats=X$(t.format),this._cache=t.cache||new Y$,this._loadingSchemas={},this._compilations=[],this.RULES=eF(),this._getId=pF(t),t.loopRequired=t.loopRequired||1/0,t.errorDataPath=="property"&&(t._errorDataPathProperty=!0),t.serialize===void 0&&(t.serialize=J$),this._metaOpts=EF(this),t.formats&&SF(this),t.keywords&&_F(this),wF(this),typeof t.meta=="object"&&this.addMetaSchema(t.meta),t.nullable&&this.addKeyword("nullable",{metaSchema:{type:"boolean"}}),bF(this)}function nF(t,e){var r;if(typeof t=="string"){if(r=this.getSchema(t),!r)throw new Error('no schema with key or ref "'+t+'"')}else{var s=this._addSchema(t);r=s.validate||this._compile(s)}var n=r(e);return r.$async!==!0&&(this.errors=r.errors),n}function sF(t,e){var r=this._addSchema(t,void 0,e);return r.validate||this._compile(r)}function aF(t,e,r,s){if(Array.isArray(t)){for(var n=0;n<t.length;n++)this.addSchema(t[n],void 0,r,s);return this}var a=this._getId(t);if(a!==void 0&&typeof a!="string")throw new Error("schema id must be string");return e=La.normalizeId(e||a),kC(this,e),this._schemas[e]=this._addSchema(t,r,s,!0),this}function oF(t,e,r){return this.addSchema(t,e,r,!0),this}function iF(t,e){var r=t.$schema;if(r!==void 0&&typeof r!="string")throw new Error("$schema must be a string");if(r=r||this._opts.defaultMeta||lF(this),!r)return this.logger.warn("meta-schema not available"),this.errors=null,!0;var s=this.validate(r,t);if(!s&&e){var n="schema is invalid: "+this.errorsText();if(this._opts.validateSchema=="log")this.logger.error(n);else throw new Error(n)}return s}function lF(t){var e=t._opts.meta;return t._opts.defaultMeta=typeof e=="object"?t._getId(e)||e:t.getSchema(ld)?ld:void 0,t._opts.defaultMeta}function cF(t){var e=CC(this,t);switch(typeof e){case"object":return e.validate||this._compile(e);case"string":return this.getSchema(e);case"undefined":return uF(this,t)}}function uF(t,e){var r=La.schema.call(t,{schema:{}},e);if(r){var s=r.schema,n=r.root,a=r.baseId,o=wC.call(t,s,n,void 0,a);return t._fragments[e]=new bC({ref:e,fragment:!0,schema:s,root:n,baseId:a,validate:o}),o}}function CC(t,e){return e=La.normalizeId(e),t._schemas[e]||t._refs[e]||t._fragments[e]}function dF(t){if(t instanceof RegExp)return Dc(this,this._schemas,t),Dc(this,this._refs,t),this;switch(typeof t){case"undefined":return Dc(this,this._schemas),Dc(this,this._refs),this._cache.clear(),this;case"string":var e=CC(this,t);return e&&this._cache.del(e.cacheKey),delete this._schemas[t],delete this._refs[t],this;case"object":var r=this._opts.serialize,s=r?r(t):t;this._cache.del(s);var n=this._getId(t);n&&(n=La.normalizeId(n),delete this._schemas[n],delete this._refs[n])}return this}function Dc(t,e,r){for(var s in e){var n=e[s];!n.meta&&(!r||r.test(s))&&(t._cache.del(n.cacheKey),delete e[s])}}function fF(t,e,r,s){if(typeof t!="object"&&typeof t!="boolean")throw new Error("schema should be object or boolean");var n=this._opts.serialize,a=n?n(t):t,o=this._cache.get(a);if(o)return o;s=s||this._opts.addUsedSchema!==!1;var l=La.normalizeId(this._getId(t));l&&s&&kC(this,l);var c=this._opts.validateSchema!==!1&&!e,u;c&&!(u=l&&l==La.normalizeId(t.$schema))&&this.validateSchema(t,!0);var d=La.ids.call(this,t),f=new bC({id:l,schema:t,localRefs:d,cacheKey:a,meta:r});return l[0]!="#"&&s&&(this._refs[l]=f),this._cache.put(a,f),c&&u&&this.validateSchema(t,!0),f}function hF(t,e){if(t.compiling)return t.validate=n,n.schema=t.schema,n.errors=null,n.root=e||n,t.schema.$async===!0&&(n.$async=!0),n;t.compiling=!0;var r;t.meta&&(r=this._opts,this._opts=this._metaOpts);var s;try{s=wC.call(this,t.schema,e,t.localRefs)}catch(a){throw delete t.validate,a}finally{t.compiling=!1,t.meta&&(this._opts=r)}return t.validate=s,t.refs=s.refs,t.refVal=s.refVal,t.root=s.root,s;function n(){var a=t.validate,o=a.apply(this,arguments);return n.errors=a.errors,o}}function pF(t){switch(t.schemaId){case"auto":return gF;case"id":return mF;default:return vF}}function mF(t){return t.$id&&this.logger.warn("schema $id ignored",t.$id),t.id}function vF(t){return t.id&&this.logger.warn("schema id ignored",t.id),t.$id}function gF(t){if(t.$id&&t.id&&t.$id!=t.id)throw new Error("schema $id is different from id");return t.$id||t.id}function yF(t,e){if(t=t||this.errors,!t)return"No errors";e=e||{};for(var r=e.separator===void 0?", ":e.separator,s=e.dataVar===void 0?"data":e.dataVar,n="",a=0;a<t.length;a++){var o=t[a];o&&(n+=s+o.dataPath+" "+o.message+r)}return n.slice(0,-r.length)}function xF(t,e){return typeof e=="string"&&(e=new RegExp(e)),this._formats[t]=e,this}function wF(t){var e;if(t._opts.$data&&(e=Z$,t.addMetaSchema(e,e.$id,!0)),t._opts.meta!==!1){var r=xC;t._opts.$data&&(r=SC(r,rF)),t.addMetaSchema(r,ld,!0),t._refs["http://json-schema.org/schema"]=ld}}function bF(t){var e=t._opts.schemas;if(e)if(Array.isArray(e))t.addSchema(e);else for(var r in e)t.addSchema(e[r],r)}function SF(t){for(var e in t._opts.formats){var r=t._opts.formats[e];t.addFormat(e,r)}}function _F(t){for(var e in t._opts.keywords){var r=t._opts.keywords[e];t.addKeyword(e,r)}}function kC(t,e){if(t._schemas[e]||t._refs[e])throw new Error('schema with key or id "'+e+'" already exists')}function EF(t){for(var e=_C.copy(t._opts),r=0;r<sx.length;r++)delete e[sx[r]];return e}function CF(t){var e=t._opts.logger;if(e===!1)t.logger={log:nh,warn:nh,error:nh};else{if(e===void 0&&(e=console),!(typeof e=="object"&&e.log&&e.warn&&e.error))throw new Error("logger must implement log, warn and error methods");t.logger=e}}function nh(){}const kF=vm(tF);class PF extends tM{constructor(e,r){var s;super(r),this._clientInfo=e,this._cachedToolOutputValidators=new Map,this._capabilities=(s=r==null?void 0:r.capabilities)!==null&&s!==void 0?s:{},this._ajv=new kF}registerCapabilities(e){if(this.transport)throw new Error("Cannot register capabilities after connecting to transport");this._capabilities=rM(this._capabilities,e)}assertCapability(e,r){var s;if(!(!((s=this._serverCapabilities)===null||s===void 0)&&s[e]))throw new Error(`Server does not support ${e} (required for ${r})`)}async connect(e,r){if(await super.connect(e),e.sessionId===void 0)try{const s=await this.request({method:"initialize",params:{protocolVersion:Wd,capabilities:this._capabilities,clientInfo:this._clientInfo}},ME,r);if(s===void 0)throw new Error(`Server sent invalid initialize result: ${s}`);if(!w4.includes(s.protocolVersion))throw new Error(`Server's protocol version is not supported: ${s.protocolVersion}`);this._serverCapabilities=s.capabilities,this._serverVersion=s.serverInfo,e.setProtocolVersion&&e.setProtocolVersion(s.protocolVersion),this._instructions=s.instructions,await this.notification({method:"notifications/initialized"})}catch(s){throw this.close(),s}}getServerCapabilities(){return this._serverCapabilities}getServerVersion(){return this._serverVersion}getInstructions(){return this._instructions}assertCapabilityForMethod(e){var r,s,n,a,o;switch(e){case"logging/setLevel":if(!(!((r=this._serverCapabilities)===null||r===void 0)&&r.logging))throw new Error(`Server does not support logging (required for ${e})`);break;case"prompts/get":case"prompts/list":if(!(!((s=this._serverCapabilities)===null||s===void 0)&&s.prompts))throw new Error(`Server does not support prompts (required for ${e})`);break;case"resources/list":case"resources/templates/list":case"resources/read":case"resources/subscribe":case"resources/unsubscribe":if(!(!((n=this._serverCapabilities)===null||n===void 0)&&n.resources))throw new Error(`Server does not support resources (required for ${e})`);if(e==="resources/subscribe"&&!this._serverCapabilities.resources.subscribe)throw new Error(`Server does not support resource subscriptions (required for ${e})`);break;case"tools/call":case"tools/list":if(!(!((a=this._serverCapabilities)===null||a===void 0)&&a.tools))throw new Error(`Server does not support tools (required for ${e})`);break;case"completion/complete":if(!(!((o=this._serverCapabilities)===null||o===void 0)&&o.completions))throw new Error(`Server does not support completions (required for ${e})`);break}}assertNotificationCapability(e){var r;switch(e){case"notifications/roots/list_changed":if(!(!((r=this._capabilities.roots)===null||r===void 0)&&r.listChanged))throw new Error(`Client does not support roots list changed notifications (required for ${e})`);break}}assertRequestHandlerCapability(e){switch(e){case"sampling/createMessage":if(!this._capabilities.sampling)throw new Error(`Client does not support sampling capability (required for ${e})`);break;case"elicitation/create":if(!this._capabilities.elicitation)throw new Error(`Client does not support elicitation capability (required for ${e})`);break;case"roots/list":if(!this._capabilities.roots)throw new Error(`Client does not support roots capability (required for ${e})`);break}}async ping(e){return this.request({method:"ping"},Ao,e)}async complete(e,r){return this.request({method:"completion/complete",params:e},BE,r)}async setLoggingLevel(e,r){return this.request({method:"logging/setLevel",params:{level:e}},Ao,r)}async getPrompt(e,r){return this.request({method:"prompts/get",params:e},rg,r)}async listPrompts(e,r){return this.request({method:"prompts/list",params:e},Xu,r)}async listResources(e,r){return this.request({method:"resources/list",params:e},Ju,r)}async listResourceTemplates(e,r){return this.request({method:"resources/templates/list",params:e},VE,r)}async readResource(e,r){return this.request({method:"resources/read",params:e},Jv,r)}async subscribeResource(e,r){return this.request({method:"resources/subscribe",params:e},Ao,r)}async unsubscribeResource(e,r){return this.request({method:"resources/unsubscribe",params:e},Ao,r)}async callTool(e,r=Yd,s){const n=await this.request({method:"tools/call",params:e},r,s),a=this.getToolOutputValidator(e.name);if(a){if(!n.structuredContent&&!n.isError)throw new qs(En.InvalidRequest,`Tool ${e.name} has an output schema but did not return structured content`);if(n.structuredContent)try{if(!a(n.structuredContent))throw new qs(En.InvalidParams,`Structured content does not match the tool's output schema: ${this._ajv.errorsText(a.errors)}`)}catch(o){throw o instanceof qs?o:new qs(En.InvalidParams,`Failed to validate structured content: ${o instanceof Error?o.message:String(o)}`)}}return n}cacheToolOutputSchemas(e){this._cachedToolOutputValidators.clear();for(const r of e)if(r.outputSchema)try{const s=this._ajv.compile(r.outputSchema);this._cachedToolOutputValidators.set(r.name,s)}catch{}}getToolOutputValidator(e){return this._cachedToolOutputValidators.get(e)}async listTools(e,r){const s=await this.request({method:"tools/list",params:e},ng,r);return this.cacheToolOutputSchemas(s.tools),s}async sendRootsListChanged(){return this.notification({method:"notifications/roots/list_changed"})}}function Ui(t,e){if(!t)throw new Error(e)}var ax=3e3,NF=5e3,sh=5*60*1e3;function jF(t){const{url:e,clientName:r,clientUri:s,callbackUrl:n=typeof window<"u"?To(new URL("/oauth/callback",window.location.origin).toString()):"/oauth/callback",storageKeyPrefix:a="mcp:auth",clientConfig:o={},customHeaders:l={},autoRetry:c=!1,autoReconnect:u=ax,transportType:d="auto",preventAutoAuth:f=!1,onPopupWindow:m}=t,[p,w]=x.useState("discovering"),[h,g]=x.useState([]),[v,y]=x.useState([]),[b,S]=x.useState([]),[E,k]=x.useState([]),[R,T]=x.useState(void 0),[N,O]=x.useState([]),[j,_]=x.useState(void 0),A=x.useRef(null),C=x.useRef(null),z=x.useRef(null),U=x.useRef(!1),K=x.useRef(!0),$=x.useRef(0),F=x.useRef(null),V=x.useRef(p),ae=x.useRef(u),se=x.useRef(null);x.useEffect(()=>{V.current=p,ae.current=u},[p,u]);const W=x.useCallback((ee,fe,...X)=>{const ze=X.length>0?`${fe} ${X.map(re=>JSON.stringify(re)).join(" ")}`:fe;console[ee](`[useMcp] ${ze}`),K.current&&O(re=>[...re.slice(-100),{level:ee,message:ze,timestamp:Date.now()}])},[]),L=x.useCallback(async(ee=!1)=>{ee||W("info","Disconnecting..."),U.current=!1,F.current&&clearTimeout(F.current),F.current=null;const fe=C.current;if(A.current=null,C.current=null,K.current&&!ee&&(w("discovering"),g([]),y([]),S([]),k([]),T(void 0),_(void 0)),fe)try{await fe.close(),ee||W("debug","Transport closed")}catch(X){ee||W("warn","Error closing transport:",X)}},[W]),Q=x.useCallback((ee,fe)=>{var X;if(W("error",ee,fe??""),K.current){w("failed"),T(ee);const ze=(X=z.current)==null?void 0:X.getLastAttemptedAuthUrl();ze&&(_(ze),W("info","Manual authentication URL may be available.",ze))}U.current=!1},[W]),oe=x.useCallback(async()=>{if(U.current){W("debug","Connection attempt already in progress.");return}if(!K.current){W("debug","Connect called after unmount, aborting.");return}U.current=!0,$.current+=1,T(void 0),_(void 0),se.current=null,w("discovering"),W("info",`Connecting attempt #${$.current} to ${e}...`),z.current||(z.current=new O0(e,{storageKeyPrefix:a,clientName:r,clientUri:s,callbackUrl:n,preventAutoAuth:f,onPopupWindow:m}),W("debug","BrowserOAuthClientProvider initialized in connect.")),A.current||(A.current=new PF({name:o.name||"use-mcp-react-client",version:o.version||"0.1.0"},{capabilities:{}}),W("debug","MCP Client initialized in connect."));const ee=async X=>{W("info",`Attempting connection with ${X.toUpperCase()} transport...`),V.current!=="authenticating"&&w("connecting");let ze;try{Ui(z.current,"Auth Provider must be initialized"),Ui(A.current,"Client must be initialized"),C.current&&(await C.current.close().catch(Ne=>W("warn",`Error closing previous transport: ${Ne.message}`)),C.current=null);const re={authProvider:z.current,requestInit:{headers:{Accept:"application/json, text/event-stream",...l}}},Me=To(e),Ue=new URL(Me);W("debug",`Creating ${X.toUpperCase()} transport for URL: ${Ue.toString()}`),W("debug","Transport options:",{authProvider:!!z.current,headers:l,url:Ue.toString()}),X==="http"?(W("debug","Creating StreamableHTTPClientTransport..."),ze=new XD(Ue,re),W("debug","StreamableHTTPClientTransport created successfully")):(W("debug","Creating SSEClientTransport..."),ze=new ZD(Ue,re),W("debug","SSEClientTransport created successfully")),C.current=ze,W("debug",`${X.toUpperCase()} transport created and assigned to ref.`)}catch(re){return Q(`Failed to create ${X.toUpperCase()} transport: ${re instanceof Error?re.message:String(re)}`,re instanceof Error?re:void 0),"failed"}ze.onmessage=re=>{var Me,Ue;W("debug",`[Transport] Received: ${JSON.stringify(re)}`),(Ue=(Me=A.current)==null?void 0:Me.handleMessage)==null||Ue.call(Me,re)},ze.onerror=re=>{W("warn",`Transport error event (${X.toUpperCase()}):`,re),W("debug","Error details:",{message:re.message,stack:re.stack,name:re.name,cause:re.cause}),Q(`Transport error (${X.toUpperCase()}): ${re.message}`,re)},ze.onclose=()=>{if(!K.current||U.current)return;W("info",`Transport connection closed (${se.current||"unknown"} type).`);const re=V.current,Me=ae.current;if(re==="ready"&&Me){const Ue=typeof Me=="number"?Me:ax;W("info",`Attempting to reconnect in ${Ue}ms...`),w("connecting"),setTimeout(()=>{K.current&&oe()},Ue)}else re!=="failed"&&re!=="authenticating"&&Q("Connection closed unexpectedly.")};try{W("info",`Connecting client via ${X.toUpperCase()}...`),W("debug","About to call client.connect() with transport instance"),W("debug",`Transport instance type: ${ze.constructor.name}`),await A.current.connect(ze),W("info",`Client connected via ${X.toUpperCase()}. Loading tools, resources, and prompts...`),se.current=X,w("loading");const re=await A.current.request({method:"tools/list"},ng);let Me={resources:[],resourceTemplates:[]};try{Me=await A.current.request({method:"resources/list"},Ju)}catch(Ne){W("debug","Server does not support resources/list method",Ne)}let Ue={prompts:[]};try{Ue=await A.current.request({method:"prompts/list"},Xu)}catch(Ne){W("debug","Server does not support prompts/list method",Ne)}if(K.current){g(re.tools),y(Me.resources),S(Array.isArray(Me.resourceTemplates)?Me.resourceTemplates:[]),k(Ue.prompts);const Ne=[`Loaded ${re.tools.length} tools`];return(Me.resources.length>0||Me.resourceTemplates&&Me.resourceTemplates.length>0)&&(Ne.push(`${Me.resources.length} resources`),Array.isArray(Me.resourceTemplates)&&Me.resourceTemplates.length>0&&Ne.push(`${Me.resourceTemplates.length} resource templates`)),Ue.prompts.length>0&&Ne.push(`${Ue.prompts.length} prompts`),W("info",Ne.join(", ")+"."),w("ready"),$.current=0,"success"}else return"failed"}catch(re){W("debug",`Client connect error via ${X.toUpperCase()}:`,re),W("debug","Connect error details:",{message:re instanceof Error?re.message:String(re),stack:re instanceof Error?re.stack:"N/A",name:re instanceof Error?re.name:"Unknown",cause:re instanceof Error?re.cause:void 0});const Me=re instanceof Error?re:new Error(String(re)),Ue=Me.message,Ne=Ue.includes("404")||Ue.includes("Not Found"),rt=Ue.includes("405")||Ue.includes("Method Not Allowed"),pt=Ue==="Failed to fetch"||Ue==="NetworkError when attempting to fetch resource."||Ue==="Load failed";if(X==="http"&&(Ne||rt||pt))return W("warn",`HTTP transport failed (${pt?"CORS":Ne?"404":"405"}).`),"fallback";if(Me instanceof Dr||Ue.includes("Unauthorized")||Ue.includes("401")){W("info","Authentication required."),Ui(z.current,"Auth Provider not available for auth flow");const Hr=await z.current.tokens();if(f&&!Hr)return W("info","Authentication required but auto-auth prevented. User action needed."),w("pending_auth"),"auth_redirect";V.current!=="authenticating"&&V.current!=="pending_auth"&&(w("authenticating"),F.current&&clearTimeout(F.current),F.current=setTimeout(()=>{},sh));try{const zt=await kn(z.current,{serverUrl:e});if(!K.current)return"failed";if(zt==="AUTHORIZED")return W("info","Authentication successful via existing token or refresh. Re-attempting connection..."),F.current&&clearTimeout(F.current),U.current=!1,oe(),"failed";if(zt==="REDIRECT")return W("info","Redirecting for authentication. Waiting for callback..."),"auth_redirect"}catch(zt){return K.current&&(F.current&&clearTimeout(F.current),Q(`Failed to initiate authentication: ${zt instanceof Error?zt.message:String(zt)}`,zt instanceof Error?zt:void 0)),"failed"}}return Q(`Failed to connect via ${X.toUpperCase()}: ${Ue}`,Me),"failed"}};let fe="failed";if(console.log({transportType:d}),d==="sse")W("debug","Using SSE-only transport mode"),fe=await ee("sse");else if(d==="http")W("debug","Using HTTP-only transport mode"),fe=await ee("http");else{W("debug","Using auto transport mode (HTTP with SSE fallback)");const X=await ee("http");if(X==="fallback"&&K.current&&V.current!=="authenticating"){W("info","HTTP failed, attempting SSE fallback...");const ze=await ee("sse");fe=ze,ze==="failed"&&K.current}else fe=X}(fe==="success"||fe==="failed")&&(U.current=!1),W("debug",`Connection sequence finished with status: ${fe}`)},[W,Q,L,kn,e,a,r,s,n,o.name,o.version]),Z=x.useCallback(async(ee,fe)=>{if(V.current!=="ready"||!A.current)throw new Error(`MCP client is not ready (current state: ${p}). Cannot call tool "${ee}".`);W("info",`Calling tool: ${ee}`,fe);try{const X=await A.current.request({method:"tools/call",params:{name:ee,arguments:fe}},Yd);return W("info",`Tool "${ee}" call successful:`,X),X}catch(X){W("error",`Error calling tool "${ee}": ${X instanceof Error?X.message:String(X)}`,X);const ze=X instanceof Error?X:new Error(String(X));if(ze instanceof Dr||ze.message.includes("Unauthorized")||ze.message.includes("401")){W("warn","Tool call unauthorized, attempting re-authentication..."),w("authenticating"),F.current&&clearTimeout(F.current),F.current=setTimeout(()=>{},sh);try{Ui(z.current,"Auth Provider not available for tool re-auth");const re=await kn(z.current,{serverUrl:e});if(!K.current)return;re==="AUTHORIZED"?(W("info","Re-authentication successful. Retrying tool call is recommended, or reconnecting."),F.current&&clearTimeout(F.current),U.current=!1,oe()):re==="REDIRECT"&&W("info","Redirecting for re-authentication for tool call.")}catch(re){if(!K.current)return;F.current&&clearTimeout(F.current),Q(`Re-authentication failed: ${re instanceof Error?re.message:String(re)}`,re instanceof Error?re:void 0)}}if(V.current!=="authenticating")throw X;return}},[p,e,W,Q,oe]),ce=x.useCallback(()=>{V.current==="failed"?(W("info","Retry requested..."),oe()):W("warn",`Retry called but state is not 'failed' (state: ${V.current}). Ignoring.`)},[W,oe]),Ee=x.useCallback(async()=>{var fe;W("info","Manual authentication requested...");const ee=V.current;if(ee==="failed")W("info","Attempting to reconnect and authenticate via retry..."),ce();else if(ee==="pending_auth"){W("info","Proceeding with authentication from pending state..."),w("authenticating"),F.current&&clearTimeout(F.current),F.current=setTimeout(()=>{},sh);try{Ui(z.current,"Auth Provider not available for manual auth");const X=await kn(z.current,{serverUrl:e});if(!K.current)return;X==="AUTHORIZED"?(W("info","Manual authentication successful. Re-attempting connection..."),F.current&&clearTimeout(F.current),U.current=!1,oe()):X==="REDIRECT"&&W("info","Redirecting for manual authentication. Waiting for callback...")}catch(X){if(!K.current)return;F.current&&clearTimeout(F.current),Q(`Manual authentication failed: ${X instanceof Error?X.message:String(X)}`,X instanceof Error?X:void 0)}}else if(ee==="authenticating"){W("warn","Already attempting authentication. Check for blocked popups or wait for timeout.");const X=(fe=z.current)==null?void 0:fe.getLastAttemptedAuthUrl();X&&!j&&(_(X),W("info","Manual authentication URL retrieved:",X))}else W("info",`Client not in a state requiring manual authentication trigger (state: ${ee}). If needed, try disconnecting and reconnecting.`)},[W,ce,j,e,Q,oe]),ve=x.useCallback(()=>{if(z.current){const ee=z.current.clearStorage();W("info",`Cleared ${ee} item(s) from localStorage for ${e}.`),_(void 0),L()}else W("warn","Auth provider not initialized, cannot clear storage.")},[e,W,L]),te=x.useCallback(async()=>{if(V.current!=="ready"||!A.current)throw new Error(`MCP client is not ready (current state: ${p}). Cannot list resources.`);W("info","Listing resources...");try{const ee=await A.current.request({method:"resources/list"},Ju);K.current&&(y(ee.resources),S(Array.isArray(ee.resourceTemplates)?ee.resourceTemplates:[]),W("info",`Listed ${ee.resources.length} resources, ${Array.isArray(ee.resourceTemplates)?ee.resourceTemplates.length:0} resource templates.`))}catch(ee){throw W("error",`Error listing resources: ${ee instanceof Error?ee.message:String(ee)}`,ee),ee}},[p,W]),we=x.useCallback(async ee=>{if(V.current!=="ready"||!A.current)throw new Error(`MCP client is not ready (current state: ${p}). Cannot read resource "${ee}".`);W("info",`Reading resource: ${ee}`);try{const fe=await A.current.request({method:"resources/read",params:{uri:ee}},Jv);return W("info",`Resource "${ee}" read successfully`),fe}catch(fe){throw W("error",`Error reading resource "${ee}": ${fe instanceof Error?fe.message:String(fe)}`,fe),fe}},[p,W]),Pe=x.useCallback(async()=>{if(V.current!=="ready"||!A.current)throw new Error(`MCP client is not ready (current state: ${p}). Cannot list prompts.`);W("info","Listing prompts...");try{const ee=await A.current.request({method:"prompts/list"},Xu);K.current&&(k(ee.prompts),W("info",`Listed ${ee.prompts.length} prompts.`))}catch(ee){throw W("error",`Error listing prompts: ${ee instanceof Error?ee.message:String(ee)}`,ee),ee}},[p,W]),De=x.useCallback(async(ee,fe)=>{if(V.current!=="ready"||!A.current)throw new Error(`MCP client is not ready (current state: ${p}). Cannot get prompt "${ee}".`);W("info",`Getting prompt: ${ee}`,fe);try{const X=await A.current.request({method:"prompts/get",params:{name:ee,arguments:fe}},rg);return W("info",`Prompt "${ee}" retrieved successfully`),X}catch(X){throw W("error",`Error getting prompt "${ee}": ${X instanceof Error?X.message:String(X)}`,X),X}},[p,W]);return x.useEffect(()=>{const ee=fe=>{var X;fe.origin===window.location.origin&&((X=fe.data)==null?void 0:X.type)==="mcp_auth_callback"&&(W("info","Received auth callback message.",fe.data),F.current&&clearTimeout(F.current),fe.data.success?(W("info","Authentication successful via popup. Reconnecting client..."),U.current=!1,oe()):Q(`Authentication failed in callback: ${fe.data.error||"Unknown reason."}`))};return window.addEventListener("message",ee),W("debug","Auth callback message listener added."),()=>{window.removeEventListener("message",ee),W("debug","Auth callback message listener removed."),F.current&&clearTimeout(F.current)}},[W,Q,oe]),x.useEffect(()=>(K.current=!0,W("debug","useMcp mounted, initiating connection."),$.current=0,(!z.current||z.current.serverUrl!==e)&&(z.current=new O0(e,{storageKeyPrefix:a,clientName:r,clientUri:s,callbackUrl:n,preventAutoAuth:f,onPopupWindow:m}),W("debug","BrowserOAuthClientProvider initialized/updated on mount/option change.")),oe(),()=>{K.current=!1,W("debug","useMcp unmounting, disconnecting."),L(!0)}),[e,a,n,r,s,o.name,o.version,oe,L]),x.useEffect(()=>{let ee=null;if(p==="failed"&&c&&$.current>0){const fe=typeof c=="number"?c:NF;W("info",`Connection failed, auto-retrying in ${fe}ms...`),ee=setTimeout(()=>{K.current&&V.current==="failed"&&ce()},fe)}return()=>{ee&&clearTimeout(ee)}},[p,c,ce,W]),{state:p,tools:h,resources:v,resourceTemplates:b,prompts:E,error:R,log:N,authUrl:j,callTool:Z,listResources:te,readResource:we,listPrompts:Pe,getPrompt:De,retry:ce,disconnect:L,authenticate:Ee,clearStorage:ve}}function RF({service:t,autoConnect:e=!1,onConnected:r,onError:s}){const{toast:n}=or(),{state:a,tools:o,resources:l,prompts:c,error:u,authUrl:d,callTool:f,readResource:m,listResources:p,getPrompt:w,listPrompts:h,retry:g,disconnect:v,authenticate:y,clearStorage:b}=jF({url:t.url,clientName:"AgentDeck",clientUri:window.location.origin,callbackUrl:`${window.location.origin}/oauth/callback`,storageKeyPrefix:`mcp:auth:${t.id}`,autoRetry:3,autoReconnect:5e3,transportType:"auto",preventAutoAuth:!e}),S=a==="ready",E=a==="connecting"||a==="loading",k=a==="authenticating"||a==="pending_auth",R=a==="failed";return vn.useEffect(()=>{S&&r&&(r(),n({title:"Connected to MCP service",description:`Successfully connected to ${t.name}`}))},[S,r,t.name,n]),vn.useEffect(()=>{R&&u&&s&&(s(u),n({title:"MCP connection failed",description:u,variant:"destructive"}))},[R,u,s,n]),{isConnected:S,isConnecting:E,isAuthenticating:k,hasError:R,error:u,tools:o,resources:l,prompts:c,connect:()=>{g()},disconnect:v,retry:g,authenticate:y,callTool:async(A,C)=>{try{return await f(A,C)}catch(z){const U=z instanceof Error?z.message:"Unknown error";throw n({title:"Tool call failed",description:U,variant:"destructive"}),z}},readResource:async A=>{try{return await m(A)}catch(C){const z=C instanceof Error?C.message:"Unknown error";throw n({title:"Resource read failed",description:z,variant:"destructive"}),C}},listResources:async()=>{try{await p()}catch(A){const C=A instanceof Error?A.message:"Unknown error";throw n({title:"Resource listing failed",description:C,variant:"destructive"}),A}},getPrompt:async(A,C)=>{try{return await w(A,C)}catch(z){const U=z instanceof Error?z.message:"Unknown error";throw n({title:"Prompt retrieval failed",description:U,variant:"destructive"}),z}},listPrompts:async()=>{try{await h()}catch(A){const C=A instanceof Error?A.message:"Unknown error";throw n({title:"Prompt listing failed",description:C,variant:"destructive"}),A}},authUrl:d,clearStorage:b}}function TF(){const[t,e]=x.useState("https://api.githubcopilot.com/mcp"),[r,s]=x.useState("get_me"),[n,a]=x.useState("{}"),[o,l]=x.useState(""),c={id:"test-mcp-service",name:"Test MCP Service",url:t,registeredAt:new Date().toISOString(),updatedAt:new Date().toISOString()},{isConnected:u,isConnecting:d,isAuthenticating:f,hasError:m,error:p,tools:w,resources:h,prompts:g,connect:v,disconnect:y,retry:b,authenticate:S,callTool:E,authUrl:k,clearStorage:R}=RF({service:c,autoConnect:!1,onConnected:()=>{console.log("Connected to test MCP service")},onError:j=>{console.error("Test MCP service error:",j)}}),N=d?{status:"connecting",icon:n0,color:"text-yellow-500"}:f?{status:"authenticating",icon:Cc,color:"text-blue-500"}:u?{status:"connected",icon:pp,color:"text-green-500"}:m?{status:"error",icon:t0,color:"text-red-500"}:{status:"disconnected",icon:t0,color:"text-gray-500"},O=async()=>{try{let j={};n.trim()&&(j=JSON.parse(n));const _=await E(r,j);l(JSON.stringify(_,null,2))}catch(j){l(`Error: ${j instanceof Error?j.message:"Unknown error"}`)}};return i.jsxs("div",{className:"container mx-auto p-6 space-y-6",children:[i.jsxs("div",{className:"text-center",children:[i.jsx("h1",{className:"text-3xl font-bold mb-2",children:"use-mcp Integration Test"}),i.jsx("p",{className:"text-muted-foreground",children:"Testing the new use-mcp library integration with OAuth support"})]}),i.jsxs(Cs,{children:[i.jsxs(_a,{children:[i.jsxs(Ea,{className:"flex items-center gap-2",children:[i.jsx(N.icon,{className:`w-5 h-5 ${N.color}`}),"Connection Status: ",N.status]}),i.jsx(tu,{children:"Current connection state and available actions"})]}),i.jsxs(ks,{className:"space-y-4",children:[i.jsxs("div",{className:"flex items-center justify-between",children:[i.jsxs("div",{className:"space-y-1",children:[i.jsx(Ke,{children:"Service URL"}),i.jsx(tt,{value:t,onChange:j=>e(j.target.value),placeholder:"Enter MCP service URL"})]}),i.jsxs("div",{className:"flex gap-2",children:[!u&&!d&&i.jsx(me,{onClick:v,children:"Connect"}),u&&i.jsx(me,{onClick:y,variant:"outline",children:"Disconnect"}),m&&i.jsxs(me,{onClick:b,variant:"outline",children:[i.jsx(n0,{className:"w-4 h-4 mr-1"}),"Retry"]}),k&&!u&&i.jsxs(me,{onClick:S,variant:"outline",children:[i.jsx(Cc,{className:"w-4 h-4 mr-1"}),"Authenticate"]})]})]}),p&&i.jsxs("div",{className:"flex items-center gap-2 p-3 bg-destructive/10 border border-destructive/20 rounded-md",children:[i.jsx(A1,{className:"w-4 h-4 text-destructive"}),i.jsx("span",{className:"text-sm text-destructive",children:p})]})]})]}),i.jsxs("div",{className:"grid grid-cols-1 md:grid-cols-3 gap-4",children:[i.jsxs(Cs,{children:[i.jsx(_a,{children:i.jsxs(Ea,{className:"flex items-center gap-2",children:[i.jsx(Ou,{className:"w-4 h-4"}),"Tools (",w.length,")"]})}),i.jsx(ks,{children:w.length===0?i.jsx("p",{className:"text-sm text-muted-foreground",children:u?"No tools available":"Connect to see tools"}):i.jsxs("div",{className:"space-y-2",children:[w.slice(0,5).map((j,_)=>i.jsx("div",{className:"text-sm",children:i.jsx(pn,{variant:"outline",className:"text-xs",children:j.name})},_)),w.length>5&&i.jsxs("p",{className:"text-xs text-muted-foreground",children:["+",w.length-5," more tools"]})]})})]}),i.jsxs(Cs,{children:[i.jsx(_a,{children:i.jsxs(Ea,{children:["Resources (",h.length,")"]})}),i.jsx(ks,{children:i.jsx("p",{className:"text-sm text-muted-foreground",children:u?`${h.length} resources available`:"Connect to see resources"})})]}),i.jsxs(Cs,{children:[i.jsx(_a,{children:i.jsxs(Ea,{children:["Prompts (",g.length,")"]})}),i.jsx(ks,{children:i.jsx("p",{className:"text-sm text-muted-foreground",children:u?`${g.length} prompts available`:"Connect to see prompts"})})]})]}),u&&i.jsxs(Cs,{children:[i.jsxs(_a,{children:[i.jsx(Ea,{children:"Test Tool Call"}),i.jsx(tu,{children:"Test calling a tool on the connected MCP service"})]}),i.jsxs(ks,{className:"space-y-4",children:[i.jsxs("div",{className:"grid grid-cols-1 md:grid-cols-2 gap-4",children:[i.jsxs("div",{className:"space-y-2",children:[i.jsx(Ke,{htmlFor:"toolName",children:"Tool Name"}),i.jsx(tt,{id:"toolName",value:r,onChange:j=>s(j.target.value),placeholder:"e.g., get_me"})]}),i.jsxs("div",{className:"space-y-2",children:[i.jsx(Ke,{htmlFor:"toolArgs",children:"Arguments (JSON)"}),i.jsx(tt,{id:"toolArgs",value:n,onChange:j=>a(j.target.value),placeholder:'{"key": "value"}'})]})]}),i.jsxs(me,{onClick:O,disabled:!u,children:[i.jsx(C2,{className:"w-4 h-4 mr-1"}),"Call Tool"]}),o&&i.jsxs("div",{className:"space-y-2",children:[i.jsx(Ke,{children:"Result"}),i.jsx(Gn,{value:o,readOnly:!0,rows:10,className:"font-mono text-sm"})]})]})]}),k&&i.jsxs(Cs,{children:[i.jsxs(_a,{children:[i.jsxs(Ea,{className:"flex items-center gap-2",children:[i.jsx(Cc,{className:"w-4 h-4"}),"OAuth Authentication"]}),i.jsx(tu,{children:"This service requires OAuth authentication"})]}),i.jsxs(ks,{className:"space-y-4",children:[i.jsx("div",{className:"p-3 bg-blue-50 border border-blue-200 rounded-md",children:i.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.'})}),i.jsxs("div",{className:"flex gap-2",children:[i.jsxs(me,{onClick:S,variant:"outline",children:[i.jsx(Cc,{className:"w-4 h-4 mr-1"}),"Start OAuth Flow"]}),i.jsx(me,{onClick:R,variant:"outline",children:"Clear OAuth Data"})]})]})]})]})}function AF(){return i.jsxs(DN,{children:[i.jsx(bc,{path:"/",component:zI}),i.jsx(bc,{path:"/oauth/callback",component:HI}),i.jsx(bc,{path:"/mcp-test",component:TF}),i.jsx(bc,{component:qI})]})}function OF(){return i.jsx(rj,{client:gj,children:i.jsxs(QT,{children:[i.jsx(cR,{}),i.jsx(AF,{})]})})}Nb(document.getElementById("root")).render(i.jsx(x.StrictMode,{children:i.jsx(OF,{})}));
|